Compare commits

...

1515 commits

Author SHA1 Message Date
Devin Howard
98081097b4 Revert "update rails dependencies"
Original commit broke the build, since some dependencies have breaking
changes.

This reverts commit f753392d49.
2018-11-09 07:42:26 -08:00
Devin Howard
f753392d49 update rails dependencies 2018-10-17 19:51:51 -07:00
Connor Turland
38a209a970 small bug fix (#1174)
if someone besides one of "us" tried to change their password, and their settings, it wouldn't work

in the typical case it would work fine
2018-03-11 21:57:23 -07:00
Devin Howard
bd7bf20810
factory_girl => factory_bot (#1172) 2018-03-10 08:10:09 -08:00
Devin Howard
955ebdd747
Change log level of Metamaps.Debug (#1170)
debug log level is invisible in Chrome by default, which is confusing
2018-02-05 21:35:53 -08:00
Devin Howard
fdcd8a93f1 tag 3.6.1 2018-01-24 20:02:28 -08:00
Devin Howard
b5c52adf5e update to paperclip 5.2.0 2018-01-24 19:52:33 -08:00
Devin Howard
b7761a3627
manual rubocop fixes (#1163) 2018-01-21 14:21:00 -08:00
Devin Howard
e0d72fce14
update nokogiri (#1169) 2018-01-21 14:20:21 -08:00
Devin Howard
139fdf8e2b
update rubocop to 0.48.1. We still want to match Code Climate though (#1168) 2018-01-20 14:10:26 -08:00
Devin Howard
4313f6eff8
TopicCard/Desc.spec.js (#1167)
TopicCard/Desc.spec.js
2018-01-20 13:31:36 -08:00
Devin Howard
91c004ebfd
TopicCard/Permission.spec.js (#1166) 2017-12-04 21:06:09 -08:00
Devin Howard
96056f43ef
TopicCard/Title.spec.js (#1165) 2017-12-02 12:45:05 -08:00
Devin Howard
32e58fa8af
tests for TopicCard/index.js (#1164) 2017-11-26 16:13:17 -08:00
Devin Howard
5ebbd87afc
automatic rubocop fixes (#1162) 2017-11-25 11:23:47 -08:00
Devin Howard
006920b686 fix broken experience if forgot password email isn't found 2017-11-13 07:16:25 -08:00
Devin Howard
97448b389f null check in synapse policy 2017-11-13 07:11:48 -08:00
Connor Turland
f1ecc9eb0b Merge pull request #1160 from metamaps/bug/map.info.box.closing
event listener was getting lost cuz react
2017-10-26 19:17:42 -04:00
Connor Turland
ca2684fcf3 event listener was getting lost cuz react 2017-10-26 19:09:28 -04:00
Connor Turland
d9c53514fe Update pull-changes.md 2017-10-25 06:44:20 -04:00
Connor Turland
e195b89bbd Merge pull request #1155 from metamaps/bug/fix.emails
fix map activity emails
2017-10-17 12:26:20 -04:00
Connor Turland
e66498a861 add logging for delayedJob 2017-10-17 12:20:51 -04:00
Connor Turland
901eb4a513 Update daily_summary.html.erb 2017-10-17 12:06:37 -04:00
Devin Howard
cbf44e3dfe add one view test 2017-10-17 08:28:00 -07:00
Connor Turland
8b492d6dc8 made the mistake of not checking all cases 2017-10-17 01:28:07 -04:00
Connor Turland
b83f366284 Merge pull request #1151 from metamaps/feature/admin.pages
move admin header to react
2017-10-15 16:05:18 -04:00
Connor Turland
1ac06d973c Merge pull request #1153 from metamaps/feature/follow.created
follow created maps as default setting
2017-10-15 14:08:04 -04:00
Connor Turland
9af3754bc8 follow created maps as default setting
if you are the map creator, we'd like to set you up to be following it by default
2017-10-15 14:07:11 -04:00
Connor Turland
8169f24072 Merge pull request #1150 from metamaps/rake-assets-precompile
run perms:fix on assets:precompile
2017-10-15 11:02:59 -04:00
Connor Turland
b9fb4a2829 move admin header to react 2017-10-15 10:56:51 -04:00
Connor Turland
9b52d0e081 fix tests 2017-10-15 10:56:04 -04:00
Devin Howard
14dc3687cd run perms:fix on assets:precompile 2017-10-14 12:02:41 -07:00
Metamaps on Linode
0a6e7918ef fix docs building by reverting raml2html 2017-10-14 14:55:42 -04:00
Metamaps on Linode
4a7595e76d fixup imports 2017-10-14 14:55:42 -04:00
Connor Turland
e899179314 Update first-deploy.md 2017-10-14 14:44:10 -04:00
Connor Turland
44fec58985 Merge pull request #1149 from metamaps/feature/reorg.react
reorg code to distinguish between route components and normal ones
2017-10-14 12:38:57 -04:00
Connor Turland
29a25c28a8 distinguish between route components and reusable components 2017-10-14 12:37:48 -04:00
Connor Turland
76c727cd61 Merge pull request #1148 from metamaps/feature/refactor.nav.bar
rename exploreMapsBar into reusable navBar
2017-10-14 12:30:29 -04:00
Connor Turland
693e6f5e10 bug fixes and make active class auto 2017-10-14 12:03:05 -04:00
Connor Turland
a1d4c99ff6 abstract exploreMapsBar into reusable navBar 2017-10-13 13:58:21 -04:00
Connor Turland
55f2425501 Merge pull request #1142 from metamaps/feature/notifs.box
Notifications Dropdown
2017-10-13 12:29:21 -04:00
Connor Turland
f9c139c19e ruby codeclimate fixes 2017-10-13 12:22:05 -04:00
Connor Turland
d51a22c5a9 eslint fixes 2017-10-13 12:13:36 -04:00
Connor Turland
567bc9d69d Merge pull request #1145 from metamaps/feature/lower.case.headings
Switch junto headings to have normal casing (not all uppercase)
2017-10-04 11:22:33 -04:00
Connor Turland
15f512efef improve notificationbox readability 2017-09-29 14:05:39 -04:00
Connor Turland
5e6fb6290c refactor for clarity 2017-09-29 13:06:33 -04:00
Connor Turland
8695297a0f wasn't using the proper serializer causing frontend error 2017-09-29 13:06:19 -04:00
Connor Turland
216a19476b add hover states and empty case 2017-09-28 12:28:33 -04:00
Connor Turland
a0c9530c91 Update index.js 2017-09-25 16:01:25 -04:00
Connor Turland
277644f59d improve styling, fix index notifs page 2017-09-25 15:21:04 -04:00
Connor Turland
0ffc01b3fb Merge pull request #1144 from metamaps/feature/hide-learn-markdown
hide "learn markdown" unless you're editing the topic card desc
2017-09-25 14:46:44 -04:00
Devin Howard
9471efb6bd hide "learn markdown" unless you're editing the topic card desc 2017-09-23 13:19:43 -07:00
Connor Turland
fc8ac6eef1 nest inconsistent data under data key 2017-09-23 11:20:02 -04:00
Connor Turland
9cc700c64d use decorator pattern for notifs api 2017-09-22 18:38:38 -04:00
Connor Turland
64ffc78f45 add the container for the notifications dropdown 2017-09-19 23:48:46 -04:00
Connor Turland
322da431eb Merge pull request #1139 from metamaps/feature/right.click.react
Right click/context menu redone in React
2017-09-19 11:49:30 -04:00
Connor Turland
3c7c8812a4 tempplate strings and new lines 2017-09-19 11:46:19 -04:00
Connor Turland
0d6963ebb0 eslint 2017-09-19 10:16:14 -04:00
Connor Turland
c4d0bf8ce4 clean up jquery ref and strings 2017-09-19 10:02:05 -04:00
Connor Turland
3406f2e04d make render a callback and use async apply for ease of use 2017-09-19 09:58:59 -04:00
Connor Turland
a4c905df4e move each li into its own function 2017-09-19 09:04:21 -04:00
Connor Turland
5f1fe4dc3f reimplement shifting menu according to click position 2017-09-19 08:37:00 -04:00
Connor Turland
2515073393 replace old edgeRightClick code 2017-09-19 00:46:23 -04:00
Connor Turland
a04cd0d395 call the right callbacks and show in the right context 2017-09-19 00:34:37 -04:00
Connor Turland
da9e44afa0 clear the right click menu the right way 2017-09-18 23:49:35 -04:00
Connor Turland
e290244404 beginning to come together 2017-09-18 23:30:33 -04:00
Connor Turland
6e1878413f wip right click in react 2017-09-18 21:09:35 -04:00
Connor Turland
77846cfcb7 missing period for consistency 2017-09-18 16:59:52 -04:00
Connor Turland
1ffc513617 Merge pull request #1137 from metamaps/feature/improve.desc
make desc edit area larger and resizable
2017-09-17 16:25:53 -04:00
Connor Turland
3886e62a7b make desc edit area larger and resizable 2017-09-17 09:01:44 -04:00
Devin Howard
ad2ba33db6 downgrade redis to 3.3.3
This fixes the following error seen on metamaps.cc:

> *A* `Gem::LoadError` *occurred while* `POST </mappings>` *was processed
> by* `mappings#create`: Specified 'redis' for Action Cable pubsub
> adapter, but the gem is not loaded. Add `gem 'redis'` to your Gemfile
> (and ensure its version is at the minimum required by Action Cable).

Backtrace
----------------

    ```/usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/monitor.rb:214:in
    `mon_synchronize'
    /home/metamaps/metamaps.cc/app/models/mapping.rb:32:in `after_created'
    /home/metamaps/metamaps.cc/app/controllers/mappings_controller.rb:24:in
    `create'```
2017-09-16 13:41:50 -07:00
Devin Howard
cf9f54c738 tag v3.5 2017-09-16 12:27:02 -07:00
Connor Turland
f323796030 Merge pull request #1132 from metamaps/feature/mod.follow
add active scope to follows model
2017-09-13 22:45:50 -04:00
Connor Turland
a080b82e7f Merge pull request #1133 from metamaps/feature/topic.follow
Topic Card Design changes (to include 'follows')
2017-09-13 10:32:44 -04:00
Connor Turland
1174123b60 use scss vars and font fallbacks 2017-09-13 10:31:48 -04:00
Connor Turland
35f77129ad email job needs to respect active as well 2017-09-13 10:20:25 -04:00
Connor Turland
a56991aede add exception notifier for failed jobs 2017-09-13 10:18:00 -04:00
Connor Turland
672b456193 add markdown clarifications 2017-09-12 21:37:49 -04:00
Connor Turland
21518c8696 revert react router update and webpack config 2017-09-12 17:07:57 -04:00
Connor Turland
29bf2a23e8 review changes 2017-09-12 17:01:08 -04:00
Connor Turland
61eac509de Merge branch 'develop' into feature/topic.follow 2017-09-10 18:16:11 -04:00
Connor Turland
4cc420eb63 eslint fixes 2017-09-10 18:13:25 -04:00
Connor Turland
ec3e09c578 topic card design changes 2017-09-10 17:17:56 -04:00
Devin Howard
3e03e0ebbf update npm/gem dependencies (#1131)
* update npm/gem dependencies

* move to react prop-types package and fix jsdom usage

* fix sinon

* fix test support

* eslint?
2017-09-09 09:38:18 -07:00
Connor Turland
9ab7e7e170 topic card re-org 2017-09-08 16:58:17 -04:00
Connor Turland
5af2b8f216 add active scope to follows model 2017-09-08 13:42:56 -04:00
Connor Turland
8af66b1b2c Merge pull request #1130 from metamaps/feature/release.notifs
make notifs and follows work for all users
2017-09-03 18:44:33 -04:00
Connor Turland
9b2193ad8c show autofollow on client and mute on unfollow 2017-09-03 15:18:57 -04:00
Connor Turland
1a8c7810be fix eslint issue picked up by codeclimate 2017-09-03 09:13:15 -04:00
Connor Turland
d87bb7c75c make notifs and follows work for all users 2017-09-03 09:07:29 -04:00
Connor Turland
aceb3ff31e Merge pull request #1129 from metamaps/feature/map.activity.improved
improve email styling for release
2017-09-03 08:33:13 -04:00
Connor Turland
f26c6cf0b7 Merge pull request #1128 from metamaps/feature/prevent.notif.fork
dont send notification for each topic of forked map
2017-09-03 08:29:03 -04:00
Connor Turland
42f4ecb37b added bg color to sections 2017-09-03 08:27:05 -04:00
Connor Turland
64f4249f44 add comment 2017-09-02 14:12:07 -04:00
Connor Turland
958bd8c70c improve email styling for release 2017-09-02 14:06:23 -04:00
Connor Turland
3830946723 dont send notif for each topic of forked map 2017-09-02 09:59:21 -04:00
Connor Turland
3482e799fd Merge pull request #1127 from metamaps/update-docs
update docs
2017-07-26 09:26:59 -07:00
Connor Turland
e016b923a4 Update WindowsInstallation.md 2017-07-26 09:25:41 -07:00
Connor Turland
bb546779cd Update VagrantInstallation.md 2017-07-26 09:24:51 -07:00
Connor Turland
3829d32390 Update UbuntuInstallation.md 2017-07-26 09:22:34 -07:00
Connor Turland
9783a5ee1e Update MacInstallation.md 2017-07-26 09:22:06 -07:00
Connor Turland
12fc0c71f6 Update README.md 2017-07-26 09:21:16 -07:00
Connor Turland
c2cb8949eb Create VagrantInstallation.md 2017-07-25 17:22:27 -07:00
Connor Turland
4e7bf02749 Update README.md 2017-07-25 17:19:17 -07:00
Connor Turland
3203c2b4d0 de-prioritize vagrant docs, as its no longer our setup of choice 2017-07-25 17:18:07 -07:00
Connor Turland
1ec9dc20e4 Update MacInstallation.md 2017-07-25 17:07:46 -07:00
Connor Turland
1af4728073 Update UbuntuInstallation.md 2017-07-25 17:06:27 -07:00
Connor Turland
785e16eeae make Vagrantfile realtime server port match default 2017-07-25 16:57:37 -07:00
Connor Turland
d08cb3f95e Update UbuntuInstallation.md 2017-07-25 16:52:11 -07:00
Connor Turland
271fc7ebd0 Update MacInstallation.md 2017-07-25 16:47:33 -07:00
Connor Turland
9d590295cb Update WindowsInstallation.md 2017-07-25 16:44:40 -07:00
Connor Turland
dc4d44951e Update UbuntuInstallation.md 2017-07-25 16:41:47 -07:00
Connor Turland
767414ad9f Update MacInstallation.md 2017-07-25 16:37:16 -07:00
Connor Turland
1ec897b8c8 Update MacInstallation.md 2017-07-17 20:45:34 -07:00
Connor Turland
00e2aefb4e Delete ISSUE_TEMPLATE.md 2017-07-16 20:50:14 -07:00
Connor Turland
aec0f104b8 Merge pull request #1121 from JohnGillanders/develop
Update README.md
2017-07-09 23:32:41 -07:00
John Gillanders
db6d2e77da Merge pull request #1 from metamaps/develop
Updates from metamaps base 04/07/2017
2017-07-04 12:59:20 +12:00
John Gillanders
9585dce511 Update README.md
Added example of cloning repository using https:// protocol instead of SSH protocol - this is simpler to do since no set-up of SSH keys is required.
2017-07-04 12:49:28 +12:00
Devin Howard
78acd7e0b0 fix NoMethodError in mappings after_created when synapse's topic1/topic2 are nil 2017-05-20 10:58:06 -07:00
Devin Howard
328c1a14f3 mark v3.4.1 one commit too late 2017-05-13 19:32:51 -07:00
Devin Howard
10ac64c574 before destroy callback on maps to remove source_id foreign key relations (#1119) 2017-05-13 19:26:43 -07:00
Devin Howard
edce66c44d new react tests with enzyme library (#1116)
* move ImportDialogBox into a folder

* install enzyme

* start testing InfoAndHelp component

* add star logic to tests

* switch ImportDialogBox to using enzyme but tests are still failing

* make `npm run test` work

* tests pass again

* eslint

* try to fix travis by adding react-addons-test-utils again

* eslintrc for test dir

* remove duplicated code

* fix

* try to suppress 2 warnings
2017-05-13 13:50:52 -04:00
Devin Howard
74df2559a4 try to fix fatal on notifications index when a topic is invalid (#1115)
* try to fix fatal on notifications index when a topic is invalid

* Update index.html.erb
2017-05-13 13:49:46 -04:00
Robert Best
a6694a3f72 Improvements to Import (#1109)
* Changed URL Regex to make more links importable, also removed need for special text formatting in order to paste or drop new topic labels. (Didn't break TSV import mode)

* Removed console logs

* add url regex with full documentation

* don't eslint 3rd party lib

* check for TSV only at start of string

* fix a bug with event/e and eslint

* handleTEXT => handleText
2017-04-11 11:51:22 -04:00
Devin Howard
8c7a657499 update vimeo url, use asset path + erb for poster path (#1106) 2017-03-26 13:53:59 -07:00
Connor Turland
90f77cd4f7 simplify views/topiccard (#1102)
* simplify views/topiccard

* Update Links.js
2017-03-22 19:22:38 -04:00
Connor Turland
af4dc869c0 devins right shouldnt push straight to develop 2017-03-22 17:04:18 +00:00
Connor Turland
2cae12e1ab found a better way to handle junto chat panel 2017-03-22 16:35:28 +00:00
Connor Turland
49102ea474 only toggle if authorized 2017-03-22 16:13:59 +00:00
Connor Turland
f2a7cc1f19 stop using jquery ui for topic card dragging 2017-03-22 16:10:08 +00:00
Devin Howard
a5d5cd6000 fix editing synapse desc (#1101) 2017-03-20 19:32:54 -07:00
Devin Howard
391a1d8b24 link feedback directly to a hylo feedback tag (#1099) 2017-03-20 12:48:30 -07:00
Connor Turland
cc17c1ed38 add tiny divider between global and map items 2017-03-17 12:54:18 -04:00
Connor Turland
eee1febbf9 clean up unused vars and logs 2017-03-17 10:25:08 -04:00
Connor Turland
c8f6374ac8 remove no longer needed comments 2017-03-17 09:32:52 -04:00
Connor Turland
ed76162b63 added icons to mobile menu fixes #1095 2017-03-17 01:32:01 -04:00
Connor Turland
1eb4187691 broken import 2017-03-17 00:11:57 -04:00
Connor Turland
4a7dd54aca remove unused vars 2017-03-17 00:48:28 +00:00
Connor Turland
efd6258c7e mobile.js was already removed but not deleted 2017-03-17 00:29:24 +00:00
Connor Turland
f4d1b8ba35 ensure node is defined before calling function on it 2017-03-17 00:10:32 +00:00
Connor Turland
47a74dd77b react-router and rebuild app structure in react (#1091)
* initial restructuring

* stuff

* lock version number

* just keep using current mapinfobox

* fix map upperRightUI layout

* make mapsWidth work and add mobile

* remove filterBoxOpen for now

* redo the mobile menu in react

* get account menu and invite lightbox working

* fixed maps scrolling

* make other routes work

* fix signed out home page

* fix accountbox toggling

* add metacode edit routes

* lots of fixes

* fix map chat layout and tab bug

* improve topic card readability and fix dragging bug

* fixup mapchat stuff

* fix up navigation to use react-router

* jquery no longer handling access requests

* handle case where user hasn't loaded yet

* this shouldn't have been removed

* add frame for topic view

* rewrite map instructions

* fix toast (and sign out bug)

* fix apps pages and missing routes

* made our request invite page look nice

* filter box in react

* forgot to add one proptype

* remove extra comments

* handle page title and mobile title updates

* reenable google analytics

* make filterbox use onclickoutside

* reenable topic view in react

* fix csrf auth token

* fix little homepage styling issue

* try putting preparevizdata in a timeout

* installing render log to count

* little fixes

* fixup filters

* make filter map function names more readable

* eslint helps

* renaming for clarity

* use onclickoutside for account/sign in box

* add some logging to see whether this is source of many renders

* turns out chatview was heavily hogging memory

* tiimeout not needed
2017-03-16 17:58:56 -04:00
Robert Best
33276444c7 [Feature] Expand current selection to include neighbors by pressing CTRL+SHIFT+UP (#1090)
* Expand current selection to include neighbors by pressing CTRL+SHIFT+UP

* minor fixes as requested
2017-03-10 15:22:30 -08:00
Devin Howard
1124d76475 re-enable codeclimate duplication 2017-03-10 08:30:01 -08:00
Connor Turland
4ffa9460f5 bug fix for people who aren't testers on settings page 2017-03-10 11:29:00 -05:00
Connor Turland
44753dbfe1 Merge branch 'develop' 2017-03-09 14:55:59 -05:00
Connor Turland
77f76b1b5a variable name fix and make is_tester method global for reuse in views 2017-03-09 14:36:24 -05:00
Devin Howard
e544d6a6db refactor api and fix bugs (#1088)
* fix weird double-embed issue

* fix users/current api if not logged in

* turbocharge the api

* fix docs
2017-03-09 14:24:52 -05:00
Devin Howard
780e66632b fix react embedly (#1089) 2017-03-09 14:23:24 -05:00
Connor Turland
de4f51bb5c fix permissions and don't send if has map open 2017-03-08 15:45:40 -05:00
Connor Turland
5d0da4c5f1 method was preventing certain follows from succeeding 2017-03-08 15:02:22 -05:00
Connor Turland
9079d1bffc check permissions prior to sending 2017-03-08 15:01:58 -05:00
Connor Turland
962881a35d Update follow_service.rb 2017-03-08 14:13:47 -05:00
Connor Turland
8483b62603 allow users to select follow settings 2017-03-08 18:50:56 +00:00
Devin Howard
e3b4dac1e1 remove takeScreenshot button in favour of separate buttons in the map card and import/export dialogue (#1086) 2017-03-07 12:15:28 -05:00
Connor Turland
8998e3858c fixes bug where popups are happening 2017-03-07 16:55:15 +00:00
Devin Howard
ce51eeca8c remove dedupe plugin 2017-03-07 07:54:25 -08:00
Connor Turland
3178f6e650 bump version number 2017-03-07 03:58:29 +00:00
Connor Turland
7ee96bf6c6 Into master: two finger pan/zoom, map and topic follows (for internal testing) on the UI, map activity emails (#1084)
* fix topic spec

* fix synapse/mapping spec

* brakeman csrf warning suppressed :|

* follows for maps in the ui for internal testing only still (#1072)

* follows for maps in the ui for testers

* require user for these actions

* match how map follow works

* include ability to unfollow from email

* fixup templates

* add unfollow_from_email to the policies

* Update _cheatsheet.html.erb

Clean up text, clarify, and bring in line with current functionality

* topicsRegex and synapsesRegex should allow commas (#1073)

* even better import csv regexes

* prevent double prompt on file drop import

* topic card in react (#1031)

* its coming along

* links bar

* scssify a bunch

* metacode image working a bit better

* metacode selector in react topic card

* riek editing for name field on topic card

* riek submit on enter

* factor out Title and Links from Topic Card component, but not the listeners

* create working Desc editor

* styling is much better now

* textarea min height for desc

* disallow images in topic card markdown

* shift enter is linebreak, enter is save

* attachments split out, but it's pretty buggy

* move listeners into Links.js

* slightly wider metacodeTitle

* fix positioning on metacode selector

* fix metacode selection

* move metacode and permissions into subcomponents

* fixes

* prevent editing on desc/title if not authorized to edit

* fix topic card draggability

* fix embedly

* fix md test

* remove the removed link card manually with jquery

* fix test syntax

* eslint

* more eslin

* reuse authorizedToEdit

* convert metacode sets to a json object for react

* add the html in react whoop

* fix metacode styling

* sort wasn't working

* finishing metacode select

* readd the above link input border

* fix syntax

* multiline title editable textarea

* more portable metacode selector component

* factor out #metacodeOptions into one react component with a callback :D:D:D

* render metacodeOptions in right click menu with react

* render metacodeOptions in right click menu with react

* fix up right click menu's metacode editing

* fix topic card title character counter

* ignore metamaps secret bundle in ag

* simplify Attachments props

* factor out embedly card into its own component; it seems to help

* link resetter

* fix edit icon on title in topic card

* move mapCount and synapseCount hover/click logic to react

* fix up the showMore control

* metacode selection tweaks

* tweak links bar spacing in topic card

* rubocop

* remove TODOs

* more badass permissions selector

* close permission selector when you click outside

* fix overeager metacode selector

* more modular attachments component

* fix bug in Desc.js

* fix right click styling

* permission changes are different than edit rights

* bad module ref

* ensure maxLength on topic titles

* hellz yeah (#1074)

* fix drop from two touches to one

* don't commit activity service

* ability to select/unselect all metacodes in custom set with keyboard shortcut (fix #390) (#1078)

* ability to select/unselect all metacodes in custom set with keyboard shortcut

* select all button

* nicer all/none buttons

* set up react testing (#1080)

* install mocha-webpack. also switch hark to npm version instead of github version

* well, mocha-webpack runs

* add jsdom for tests

* upgrade to webpack 2

* fix npm run test errors

* ImportDialogBox component tests

* Fixes bug where pressing delete key while editing text will suggest... (#1083)

* Fixes bug where pressing delete key while editing text will suggest the deletion of selected map entities

* Changed the DEL key to remove entities instead of delete them

* temporarily disable code climate duplication engine

* add topic following for internal testing

* daily map activity emails (#1081)

* data prepared, task setup

* add the basics of the email template

* cover granular permissions

* unfollow this map

* break out permissions tests better

* rename so test runs
2017-03-06 22:49:46 -05:00
Connor Turland
b740fef8fe daily map activity emails (#1081)
* data prepared, task setup

* add the basics of the email template

* cover granular permissions

* unfollow this map

* break out permissions tests better

* rename so test runs
2017-03-06 22:42:22 -05:00
Connor Turland
55b031ccb7 add topic following for internal testing 2017-03-07 01:47:10 +00:00
Devin Howard
9df389060e temporarily disable code climate duplication engine 2017-03-06 09:29:36 -08:00
Robert Best
153cc38d1a Fixes bug where pressing delete key while editing text will suggest... (#1083)
* Fixes bug where pressing delete key while editing text will suggest the deletion of selected map entities

* Changed the DEL key to remove entities instead of delete them
2017-03-06 11:48:59 -05:00
Devin Howard
4ff9619837 set up react testing (#1080)
* install mocha-webpack. also switch hark to npm version instead of github version

* well, mocha-webpack runs

* add jsdom for tests

* upgrade to webpack 2

* fix npm run test errors

* ImportDialogBox component tests
2017-03-06 02:29:12 +08:00
Devin Howard
a6c1c0c730 ability to select/unselect all metacodes in custom set with keyboard shortcut (fix #390) (#1078)
* ability to select/unselect all metacodes in custom set with keyboard shortcut

* select all button

* nicer all/none buttons
2017-03-04 11:51:51 -05:00
Connor Turland
529dec09a3 don't commit activity service 2017-03-02 04:38:33 +00:00
Connor Turland
ddbaac513f fix drop from two touches to one 2017-03-02 04:35:13 +00:00
Connor Turland
ba943b20f1 hellz yeah (#1074) 2017-02-27 17:06:56 -05:00
Connor Turland
4deb3f5ab9 topic card in react (#1031)
* its coming along

* links bar

* scssify a bunch

* metacode image working a bit better

* metacode selector in react topic card

* riek editing for name field on topic card

* riek submit on enter

* factor out Title and Links from Topic Card component, but not the listeners

* create working Desc editor

* styling is much better now

* textarea min height for desc

* disallow images in topic card markdown

* shift enter is linebreak, enter is save

* attachments split out, but it's pretty buggy

* move listeners into Links.js

* slightly wider metacodeTitle

* fix positioning on metacode selector

* fix metacode selection

* move metacode and permissions into subcomponents

* fixes

* prevent editing on desc/title if not authorized to edit

* fix topic card draggability

* fix embedly

* fix md test

* remove the removed link card manually with jquery

* fix test syntax

* eslint

* more eslin

* reuse authorizedToEdit

* convert metacode sets to a json object for react

* add the html in react whoop

* fix metacode styling

* sort wasn't working

* finishing metacode select

* readd the above link input border

* fix syntax

* multiline title editable textarea

* more portable metacode selector component

* factor out #metacodeOptions into one react component with a callback :D:D:D

* render metacodeOptions in right click menu with react

* render metacodeOptions in right click menu with react

* fix up right click menu's metacode editing

* fix topic card title character counter

* ignore metamaps secret bundle in ag

* simplify Attachments props

* factor out embedly card into its own component; it seems to help

* link resetter

* fix edit icon on title in topic card

* move mapCount and synapseCount hover/click logic to react

* fix up the showMore control

* metacode selection tweaks

* tweak links bar spacing in topic card

* rubocop

* remove TODOs

* more badass permissions selector

* close permission selector when you click outside

* fix overeager metacode selector

* more modular attachments component

* fix bug in Desc.js

* fix right click styling

* permission changes are different than edit rights

* bad module ref

* ensure maxLength on topic titles
2017-02-26 11:42:47 -05:00
Devin Howard
47d0faadf2 prevent double prompt on file drop import 2017-02-25 13:04:00 -08:00
Devin Howard
9800cc27c6 even better import csv regexes 2017-02-25 12:15:45 -08:00
Devin Howard
7840e09e5f topicsRegex and synapsesRegex should allow commas (#1073) 2017-02-25 12:05:56 -08:00
ben, bro
687b957737 Update _cheatsheet.html.erb
Clean up text, clarify, and bring in line with current functionality
2017-02-23 22:03:33 -08:00
Connor Turland
9ce989eba5 add unfollow_from_email to the policies 2017-02-16 14:01:22 +00:00
Connor Turland
2c85590d65 fixup templates 2017-02-16 13:55:19 +00:00
Connor Turland
2b34d84715 include ability to unfollow from email 2017-02-16 13:42:35 +00:00
Connor Turland
013e3c7f21 follows for maps in the ui for internal testing only still (#1072)
* follows for maps in the ui for testers

* require user for these actions

* match how map follow works
2017-02-15 23:01:53 -05:00
Devin Howard
8d771543d8 Merge branch 'fix/rspec' into develop 2017-02-12 15:29:40 -08:00
Devin Howard
50639e8a0a Merge branch 'develop' 2017-02-12 15:11:19 -08:00
Devin Howard
9d52aa9c74 tag v3.3 2017-02-12 15:09:08 -08:00
Devin Howard
545706e17a disable cookie based auth on the API - mostly (#1070) 2017-02-12 12:54:54 -05:00
Devin Howard
95901e17e8 fix travis (#1071)
* fix topic spec

* fix synapse/mapping spec

* brakeman csrf warning suppressed :|
2017-02-12 12:53:04 -05:00
Devin Howard
9dbbdf1150 brakeman csrf warning suppressed :| 2017-02-11 20:00:42 -08:00
Devin Howard
4ee4aeaad2 fix synapse/mapping spec 2017-02-11 19:56:07 -08:00
Devin Howard
bfdce21a66 fix topic spec 2017-02-11 19:54:09 -08:00
Devin Howard
53d4beddec move hr tag in notification emails 2017-02-11 19:35:23 -08:00
Devin Howard
d455ced683 send mail by default is false in message from devs. also fixes a bug where the option didn't do anything 2017-02-11 19:30:58 -08:00
Connor Turland
d8698ef6f2 api stuffs (#1069)
* Update restful_controller.rb

* Update tokens_controller.rb

* /tokens/new form

* thats all
2017-02-11 19:29:03 -05:00
Connor Turland
1374da35da Update notification_service.rb 2017-02-11 15:29:31 -05:00
Connor Turland
2d0d0403b1 little fixes for deploy 2017-02-11 19:50:59 +00:00
Connor Turland
2d50f24be6 var misnamed 2017-02-11 14:21:47 +00:00
Connor Turland
876c61a18e Better experience of notifications. (#1066)
* all the good changes

* follows

* dont send duplicates

* remove follow_type for now

* dont add all the extra stuff we're not implementing yet

* refactor

* lots of fixes

* notifications improvements

* bad merge
2017-02-11 09:06:01 -05:00
Connor Turland
b0deafc53e Follows and some new notifications (#1063)
* all the good changes

* follows

* dont send duplicates

* remove follow_type for now

* dont add all the extra stuff we're not implementing yet

* refactor

* lots of fixes

* Delete activity.html.erb

* Delete activity.text.erb

* Update 20170209215819_create_follows.rb

* Update schema.rb

* Update mapping.rb

* Update mailboxer.rb
2017-02-11 00:20:42 -05:00
Connor Turland
a647d80efa third try to fix this little bug 2017-02-10 12:02:05 -05:00
Connor Turland
559ad230ce actually this fixes it 2017-02-10 11:52:58 -05:00
Connor Turland
26dfcbf823 edge case where realtime server is passing empty object 2017-02-10 11:45:05 -05:00
Connor Turland
915defcd1b little fixes 2017-02-10 00:32:15 +00:00
Connor Turland
dde097ea75 all the good changes (#1065) 2017-02-09 16:53:19 -05:00
Devin Howard
3706cd83e7 helper function and notification setup for messages from the devs to be sent to all users (#1064)
* message from devs notification type

* helper function for messages from devs

* don't use find_by_email

* temporary fix
2017-02-09 10:37:35 -05:00
Connor Turland
575a3ec8bf Rename user_not_present_on_map.rB to user_not_present_on_map.rb 2017-02-05 22:09:51 -05:00
Connor Turland
b2bf9978aa Update ISSUE_TEMPLATE.md 2017-02-05 14:34:47 -05:00
Connor Turland
0441850504 Secret.convo (#1059)
* set up for using secret css/js

* testing

* add stuff

* final tweak for secret convos

* looks like its all working

* realized this change is just good all around

* minor touch ups

* only us for now

* no longer validate presence of xloc/yloc

* fix syntax issue
2017-02-05 14:30:23 -05:00
Connor Turland
3ae4072b5d add ability to keep metacode focus 2017-02-05 06:28:10 +00:00
Robert Best
00ecb0f6bb Make DEL key delete selected items (With confirmation still :P ) (#1058)
* add del key

* made DEL key into delete shortcut
2017-02-03 14:23:04 -05:00
Devin Howard
45a15da896 fix error in loading url titles 2017-02-01 12:37:50 -05:00
Devin Howard
a96c8ae75c fix bug 2017-01-31 23:44:10 -05:00
Devin Howard
a137c21d2d searchfields api parameter (#1054) 2017-01-28 16:53:54 -05:00
Connor Turland
952cf4e79f keep permission of topic/synapse in sync with map its deferring to from beginning (#1053)
* Update topic.rb

* Update synapse.rb
2017-01-28 16:40:41 -05:00
Devin Howard
53bc4ee1c8 fix mapper page (#1050) 2017-01-28 15:44:38 -05:00
Connor Turland
c60f7f4525 add Story, which is on metamaps, total is now 48 2017-01-28 01:04:23 -05:00
Connor Turland
8df2cd8732 fix metacode names 2017-01-28 01:01:20 -05:00
Devin Howard
2c6da79df3 redirect /explore to / (#1051) 2017-01-27 15:16:31 -05:00
Connor Turland
6e913efbae track pageloads with google analytics. fixes #1012 (#1048)
* track pageloads with google analytics. fixes #1012

* Update Router.js
2017-01-25 20:57:34 -08:00
Connor Turland
db81962c91 some c9 files to gitignore 2017-01-26 00:24:31 +00:00
Connor Turland
8330ef9679 treat cable sub/unsub as joined/left map. fixes #1035 (#1047) 2017-01-25 15:32:13 -08:00
Devin Howard
696ff396b0 file attachments in db (re: #124) (#1043)
* file attachments in db

* rubocop

* factor out a bunch of file types

* thumb and medium image styles"

* syntax error in concern

* markdown is also plaintext

* rubocop
2017-01-24 15:10:40 -05:00
Devin Howard
b16617286f revert back to jquery 1 to fix best in place 2017-01-23 19:50:59 -05:00
Devin Howard
fee011bba6 fix readme bullets 2017-01-23 19:37:50 -05:00
Devin Howard
d16709e8e7 fix codeclimate style issues (#1046)
* bunch of code climate fixes

* more
2017-01-23 19:30:13 -05:00
Devin Howard
0ad10c0f5a fix style of thumb button on map card (#1044) 2017-01-23 14:02:14 -05:00
Devin Howard
d11278b63b map rdf export (fixes #1015) (#1036)
* simple rdf export of maps

* register ttl mime type

* owl

* mm

* fix up export service

* implement base url thing whoo

* add more rdf fields

* fix rdf syntax errors

* hide unused fields in rdf

* some code climate fixes

* update ontology a bit more

* syntax fix

* typo
2017-01-22 16:42:04 -05:00
Devin Howard
2652d53e9b update ruby dependencies too (#1042)
* update rubygem dependencies

* update backbone

* brakeman fix

* brakeman

* ugh syntax fix
2017-01-22 16:41:51 -05:00
Devin Howard
dc8d274487 whoops, I guess we do need jquery in package.json 2017-01-22 14:07:04 -05:00
Devin Howard
2fd972ddce ajax queue (fixes #853) (#1037)
* jquery.ajaxq

* install jquery.ajaxq from npm

* patch ajaxq into Backbone code

* use ajaxq library with more github stars

* eslint
2017-01-22 13:50:34 -05:00
Devin Howard
bba8231e8c update npm dependencies (#1038)
* only one github dependency left

* update npm deps

* exact versions of npm deps
2017-01-21 15:37:14 -05:00
Devin Howard
1229e92feb fix bug in Debug.js 2017-01-21 13:34:39 -05:00
Devin Howard
ba3d5f07dd try to fix metamaps.debug 2017-01-21 13:09:26 -05:00
Devin Howard
d47d7e50e7 mark v3.2 on develop 2017-01-21 13:04:28 -05:00
Devin Howard
af2c6ebef1 split screenshot function/button into two parts (#1027)
* split screenshot function into 4 separate helpers

* screenshot download button in import dialog box

* thumbnail button inside map info box

* import blue button styling

* fight with styling to make the button at least appear

* add more text

* fix tooltip display

* automatically start downloading the screenshot

* eslint

* revamp GlobalUI.notifyUser

* fix object destructuring syntax

* fix
2017-01-19 14:50:08 -05:00
Devin Howard
a9f19815e4 fix api embed to use the correct serializers (fix #998) (#1029)
* use correct serializer for singular embeds in api (almost fixes #998)

* fix has_many api embeds too!

* unused arg
2017-01-19 14:49:40 -05:00
Devin Howard
460de840b6 redis server 2017-01-18 16:38:34 -05:00
Devin Howard
36ed85312e fix crontab 2017-01-18 16:29:52 -05:00
Devin Howard
991c4cabdb move node installation further up 2017-01-18 13:40:48 -05:00
Devin Howard
38004c1f1f fix npm install isntructions 2017-01-18 13:34:32 -05:00
Devin Howard
cd796f3ade gist for unicode error on db:setup 2017-01-18 13:25:50 -05:00
Devin Howard
c57015cb15 rvm install needs sudo 2017-01-18 13:16:33 -05:00
Devin Howard
9223295320 add node source 2017-01-18 13:14:39 -05:00
Devin Howard
b4bffbe427 database called metamaps, not metamap002 in example 2017-01-18 13:10:09 -05:00
Devin Howard
6296df1102 need postgres dev headers 2017-01-18 13:09:47 -05:00
Devin Howard
2e0acfc170 update docs 2017-01-18 12:04:40 -05:00
Devin Howard
99b21be27b tag v3.2 2017-01-16 14:18:49 -05:00
Devin Howard
2c60d7335c Merge branch 'develop' (v3.2) 2017-01-16 11:21:02 -05:00
Connor Turland
6f6e5bea06 Update README.md 2017-01-15 20:23:18 -05:00
Connor Turland
6f0d391aaa Update ISSUE_TEMPLATE.md 2017-01-15 20:17:30 -05:00
Connor Turland
b1a64c6e7a Update ISSUE_TEMPLATE.md 2017-01-15 20:16:53 -05:00
Connor Turland
59b3d254dd include new info zones 2017-01-14 01:35:48 -05:00
Devin Howard
f3539f54bf hotfix ugh 2017-01-11 23:36:30 -05:00
Devin Howard
75ccfb0ab3 hotfix map title in meta tags whoops 2017-01-11 23:32:13 -05:00
Devin Howard
7b5bd53c28 I think this will fix the meta tags (#1030) 2017-01-11 23:27:05 -05:00
Connor Turland
5302f03196 remove exclamation mark 2017-01-11 23:00:19 -05:00
Devin Howard
536c458981 add code climate to the readme 2017-01-11 22:42:32 -05:00
Devin Howard
f64612f99b add meta tags to maps (#1028) 2017-01-11 22:26:45 -05:00
Connor Turland
cbc38e0c93 emoji-mart styling fix 2017-01-11 14:02:11 -05:00
Devin Howard
42d671c05b stop replacing shortcodes/emoticon in the live NewMessage textarea (#1026) 2017-01-11 13:56:44 -05:00
Devin Howard
08109ee5de remove instructions from ImportDialogBox (#1022)
* remove instructions from ImportDialogBox

* link back to docs.metamaps.cc for import instructions
2017-01-11 13:50:37 -05:00
Connor Turland
0952c0f3c9 Bug/name.overflow (#1025)
* creator name was pushing 'view only' off card

* Update MapCard.js
2017-01-11 13:36:07 -05:00
Devin Howard
25b4d388de eslint commands and apply some style fixes (#1021)
* auto eslint and add commands for eslint

* eslint the entire frontend folder
2017-01-11 12:52:34 -05:00
Devin Howard
8b738f3d28 emoticons turned on by default 2017-01-10 22:05:04 -05:00
Devin Howard
da94cd0c8b systemd job in deploy docs 2017-01-10 18:00:46 -05:00
Devin Howard
e9e6b1dc09 tweak chat emoji (#1019) 2017-01-09 14:55:21 -05:00
Connor Turland
e84dfbaa33 fix message styling 2017-01-09 13:27:39 -05:00
Devin Howard
cb95e027c4 Add emoji to chat (#1013)
* add emoji picker unstyled

* rename junto.css.erb => junto.scss.erb

* junto scss-ified

* add emoji mart css

* emoji are replaced in the text area

* remove unicode emoji from messages before sending to db

* add emoji back into messages on display

* bigger font size on chat messages

* tweak styling

* codeclimate (eslint)
2017-01-09 13:14:20 -05:00
Connor Turland
8e50efb3c1 render messages nicer 2017-01-04 18:12:07 -05:00
Connor Turland
5ab5f6fec2 Update README.md 2017-01-04 17:17:53 -05:00
Devin Howard
cbf1ec3afb fix missing npm github dep (#1011) 2017-01-04 12:34:08 -05:00
Connor Turland
d3315d962d only render google analytics if a tracking code envvar is set 2017-01-04 12:08:12 -05:00
Connor Turland
ae05fb35d3 more config updates for heroku 2017-01-04 11:14:03 -05:00
Connor Turland
9e6ce90950 update config for heroku and prod 2017-01-04 11:08:32 -05:00
Connor Turland
3868910dde Stream map related events from rails server via actioncable instead of nodejs (#1010)
* actioncable needs puma not webrick

* add framework

* remove the old way

* send events from server to client

* get all events working

* clean up receivable

* map is polymorphic on message

* add the moved event

* make todo comments clear

* verify before streaming from map channel

* rubocop fixes

* wasn't set up correctly for nodejs realtime
2017-01-03 16:12:58 -05:00
Connor Turland
5c1261892f remove the one pixel gap between search input and icon 2016-12-26 21:03:22 -05:00
Connor Turland
9ada1ca935 remove exclamation mark 2016-12-26 17:19:56 -05:00
Connor Turland
df5cc4e1a8 remove exclamation mark 2016-12-26 17:15:42 -05:00
Connor Turland
ce073028c8 remove exclamation mark 2016-12-26 17:13:42 -05:00
Connor Turland
7d869d7b63 remove exclamation mark 2016-12-26 17:10:41 -05:00
Connor Turland
73e8f2d4c8 re-implement chat in react (#997)
* hidously mangle ChatView to start moving it to React

* fix up Realtime/index.js - should be good now?

* in theory this should compile

* ok the MapChat renders using react...

* move Handlers code into react - woot

* try reintegrating backbone

* fix wrapper styling

* chat box opens and closes properly

* make the unread count work

* organize more sanely

* refactor some of the ChatView functions

* removed management of chatview from room

* css can stop handling logic right about now

* makin things work

* don't need room here anymore

* set raw html in message

* make pending work

* removeParticipant when mapper left was broken

* re-enable scrolling, focus, and blur
2016-12-21 03:56:29 -05:00
Connor Turland
68f0e91259 track forks (#994)
* track forks

* update api and docs

* fix tests
2016-12-18 16:17:51 -05:00
Devin Howard
b07941834c v3.1 in initializers 2016-12-16 17:22:48 -05:00
Devin Howard
b914065bb3 Merge branch 'develop'; tag v3.1 2016-12-16 17:17:24 -05:00
Devin Howard
33fc27ffd1 Merge pull request #989 from metamaps/fix/travis
fix travis
2016-12-16 17:16:32 -05:00
Devin Howard
7ca7f0862f fix mapping spec 2016-12-16 17:09:23 -05:00
Devin Howard
c604e69d77 enable postgresql 9.4 in travis 2016-12-16 17:09:23 -05:00
Connor Turland
fb12c7e202 Track everything we need to reconstruct maps (#984)
* feature/more.events

* keep mapping.user as the creator

* cleanup cruft and include slack notifs

* capture topic and synapse updates, store the old values

* avoid the mapping gets deleted problem

* include an indicator of which values changed

* style cleanup

* remove the hack in favor of a legit way

* updated schema file
2016-12-16 16:51:52 -05:00
Devin Howard
9ab1c9c647 Merge pull request #932 from metamaps/feature/mailboxer
mailboxer notification centre
2016-12-16 16:41:37 -05:00
Connor Turland
28d960459e styling of notifs list 2016-12-16 16:25:14 -05:00
Connor Turland
ef84209de1 make it look better when its taking up the full screen width 2016-12-16 16:25:13 -05:00
Connor Turland
2d920cf66a add maps links to nav locations 2016-12-16 16:25:13 -05:00
Connor Turland
40a97a5ae9 these are output in the main layout file 2016-12-16 16:25:13 -05:00
Devin Howard
186129807e fix spec, bugs, style 2016-12-16 16:25:08 -05:00
Connor Turland
87228c27c1 Fix mailboxer + email bugs 2016-12-16 16:24:24 -05:00
Connor Turland
6d8392d2e7 Make mailboxer look good and update email templates 2016-12-16 16:24:01 -05:00
Devin Howard
0960159265 Mailboxer notification pagination 2016-12-16 16:23:49 -05:00
Devin Howard
88e98c7342 polish mailboxer with bug fixes 2016-12-16 16:23:32 -05:00
Devin Howard
3f6f020ce1 grant/deny buttons mark access request notifications as read 2016-12-16 16:23:30 -05:00
Devin Howard
8e958ec9a8 invite to edit notifications marked as read in system once map is visited 2016-12-16 16:23:30 -05:00
Devin Howard
9debcdde39 Integrate rails mailers with mailboxer 2016-12-16 16:23:17 -05:00
Robert Best
b4ad51e69d reactify notification icon 2016-12-16 16:21:40 -05:00
Devin Howard
9b95e91f1a more style tweaks + brakeman fix 2016-12-16 16:21:23 -05:00
Connor Turland
c46e85529e little style tweaks to css and content 2016-12-16 16:21:01 -05:00
Devin Howard
85408a14d3 Initial notification centre using mailboxer 2016-12-16 16:20:53 -05:00
Connor Turland
3b8a5d0c2e Update message_policy.rb (#973) 2016-12-14 13:23:40 -05:00
Robert Best
6f88c2a7eb Update ISSUE_TEMPLATE.md 2016-12-12 13:49:26 -05:00
Robert Best
f1e62fb6c1 Update ISSUE_TEMPLATE.md
changed multiplication symbol so that double-clicking number placeholders works again.
2016-12-12 13:47:00 -05:00
Robert Best
0c52188014 Update ISSUE_TEMPLATE.md
reduced whitespace
2016-12-12 13:30:56 -05:00
Robert Best
7c0e0f731f Update ISSUE_TEMPLATE.md
changed multiplication sign from asterisks to x, because markdown treats asterisks as special.
2016-12-12 11:35:59 -05:00
Devin Howard
1ba339b3be subset of synapse creation changes (#970)
* esc cancels topic and synapse creation now

* close topic/synapse creation on right click

* backspace and delete don't close synapse creation anymore

* hitting tab saves the synapse you're creating
2016-12-11 17:15:09 -05:00
Devin Howard
6129a27ecf hit Ctrl+A a second time to select all synapses, too (#968) 2016-12-11 16:21:36 -05:00
Devin Howard
d51e3f3b52 update npm deps, EXCEPT socket.io and backbone (#950)
* update npm dependencies (with some exceptions)

* update autolinker, remove underscore
2016-12-11 16:09:12 -05:00
Robert Best
1317186f63 Update ISSUE_TEMPLATE.md
changed all place-holders to underscores, they ae easier to double-click so as to select/replace.
2016-12-09 13:40:58 -05:00
Robert Best
d6527ea80e Create ISSUE_TEMPLATE.md 2016-12-09 12:20:30 -05:00
Connor Turland
a133702be2 Some topics and synapses were hidden from users erroneously (#944)
* ensure topics and synapses have their permission match the map they're deferring to

* update permission of topics and synapses as map perm changes, when defer_to_map

* try enabling count threshold on rubocop

* remove unused mk_permission functions

* change *_count methods to use delegate to save lines in map.rb model

* rubocop topic.rb
2016-12-06 16:46:46 -05:00
Devin Howard
d2074ada79 fix policy scope errors in search controller (#947) 2016-12-06 13:09:42 -05:00
Devin Howard
00286fcc29 tag v3.0.4 2016-12-06 12:38:06 -05:00
Devin Howard
01cd624bfa add polyfill so chrome 49 can upload map thumbnail screenshots (#946) 2016-12-06 12:36:06 -05:00
Connor Turland
a5f793fe54 fixup topic card template 2016-12-02 21:21:37 +00:00
Devin Howard
d1aa62d382 fix policy scope error (#941) 2016-11-30 11:46:09 -05:00
Devin Howard
3f161c1076 make topic titles have width of 25 chars (#933) 2016-11-29 11:00:14 -05:00
Devin Howard
4da3a9d55f hide mobile menu if browser is resized to full size (#937) 2016-11-28 13:53:29 -05:00
Devin Howard
90c5bc26fc Active.Mapper was being initialized twice, causing errors (#934) 2016-11-27 21:12:05 -05:00
Devin Howard
5d8ff3efce realtime shouldn't poll forever if the dev server isn't up (#931) 2016-11-24 14:40:14 -05:00
Devin Howard
95b8b52224 fix NoMethodError in topics#autocomplete_topic (#930) 2016-11-24 14:16:58 -05:00
Devin Howard
55853c60f4 update user model with fixes, including style and recentMetacodes algorithm (#922) 2016-11-13 14:29:07 -08:00
Devin Howard
5b90c38b22 Merge pull request #902 from metamaps/fix/schema
fix db schema
2016-11-13 14:24:31 -08:00
Devin Howard
c03d6dd5f6 remove in_trash from schema to match production 2016-11-13 17:21:42 -05:00
Devin Howard
51d5d77629 Merge pull request #929 from metamaps/fix/develop-bugs
fix some develop bugs, merge master, and move realtime port to .env
2016-11-09 21:14:48 -05:00
Devin Howard
ce2d462578 fix bugs on develop branch 2016-11-09 20:44:00 -05:00
Devin Howard
4533a0f2fe merge changes from metamapscc instance branch (#913)
* homepage video fallback

* public/50x.html

* remove blog from public/ html pages

* remove video file since it's on metamaps.cc server

* eslint
2016-11-09 09:34:10 -05:00
Devin Howard
5851d57eef Merge branch 'master' into develop 2016-11-09 09:29:30 -05:00
Connor Turland
e1441acde0 synapse wasn't updating calculated_permission 2016-11-08 19:50:08 +00:00
Connor Turland
d1f75c8c24 oops! don't change rt server port 2016-11-08 19:45:51 +00:00
Connor Turland
83b58d43d5 only remove user once they've left all maps 2016-11-08 19:42:48 +00:00
Devin Howard
3759851621 fix access#access route (#926) 2016-11-08 09:37:06 -08:00
Devin Howard
a176cdf231 eslint frontend folder (#923) 2016-11-07 15:25:08 -05:00
Devin Howard
9df974a037 strip whitespace from search terms (#919) 2016-11-07 14:58:53 -05:00
Devin Howard
bd4072f81c Merge pull request #707 from metamaps/feature/split-out-backbone
finish removing global Metamaps references from frontend code
2016-11-07 14:58:20 -05:00
Devin Howard
6a2646c9cd fix mailer specs (#921) 2016-11-07 14:56:35 -05:00
Devin Howard
2f4fe525ce Fix a bunch of errors and style issues 2016-11-07 14:55:20 -05:00
Devin Howard
518782e1c7 remove Metamaps.Erb 2016-11-07 14:55:20 -05:00
Devin Howard
7c9b6a2205 try to move all rails data into Metamaps.ServerData
Metamaps.Erb and currentPage and currentSection are still not in; should they be?
2016-11-07 14:55:20 -05:00
Devin Howard
8026969799 start storing data in ServerData 2016-11-07 14:55:17 -05:00
Devin Howard
4b500a4428 move Metamaps.Loading into node modules 2016-11-07 14:40:43 -05:00
Devin Howard
0778179ba7 eslint 2016-11-07 14:40:43 -05:00
Devin Howard
bfd23c6d32 split Backbone.js into a bunch of different files. Still more work to do to modularize it 2016-11-07 14:40:43 -05:00
Devin Howard
9cb3074245 rename Metamaps.Backbone to Metamaps.DataModel 2016-11-07 14:40:43 -05:00
Devin Howard
e4d193572f fix mailer specs 2016-11-07 14:40:25 -05:00
Connor Turland
0f85abfda2 add channel to webhooks (#915) 2016-11-05 09:34:50 -07:00
Connor Turland
887c3f7570 fixes #903 and #831 (#911) 2016-11-04 15:02:56 -07:00
Connor Turland
667f5653a7 topic descriptions from old data can be nil 2016-11-04 21:03:11 +00:00
Connor Turland
48b93b2269 change grant to allow. fixes #909 (#910) 2016-11-04 13:22:06 -07:00
Connor Turland
9ad4684825 firefox needs e.pageX not e.x (#906) 2016-11-02 19:20:06 -07:00
Devin Howard
f516e1e73d fix up deploy docs 2016-11-01 16:31:36 +08:00
Devin Howard
2588636837 tag v3.0.1 - bugfixes for 3.0 2016-11-01 16:06:05 +08:00
Devin Howard
644df6fcdc fix pasting urls (#901) 2016-11-01 16:01:34 +08:00
Devin Howard
c10a4f4837 fix exception notification backtrace (#898) 2016-11-01 10:05:45 +08:00
Devin Howard
304722b528 fix api docs (#897)
* fix api docs

* more rake => rails
2016-11-01 09:52:10 +08:00
Devin Howard
a9c67e70d4 move webhook and event serializers back (#899) 2016-11-01 09:46:44 +08:00
Connor Turland
ed3e4780d2 bug when topic was in more than 5 maps fixes #891 (#894) 2016-10-31 17:10:44 -04:00
Connor Turland
b013499c76 misnamed variable errors out maps search (#893) 2016-10-31 16:41:37 -04:00
Devin Howard
5270c5a611 Merge branch 'develop' for v3.0 2016-10-31 19:51:02 +08:00
Devin Howard
5cfa8ffdc7 bump version to 3.0 2016-10-31 19:48:07 +08:00
Devin Howard
814c1acc0f a few markdown style updates (#885)
* markdown block padding

* a few more markdown style updates
2016-10-31 15:38:16 +08:00
Devin Howard
62e2acdd52 add about lightbox again (#884)
* add about lightbox again

* fix about lightbox style
2016-10-31 15:38:09 +08:00
Connor Turland
151e96f803 Metamaps.Realtime.synapseRemoved is not a function (#880) 2016-10-29 12:10:13 -04:00
Devin Howard
bc1f212c93 fix tab/shift-tab for metacode selection (#879) 2016-10-30 00:08:51 +08:00
Devin Howard
b9190233b1 enable sucker punch for heroku (#878) 2016-10-29 23:38:17 +08:00
Devin Howard
5e0e44b436 supercharge the schemas (#874)
* fix map schema - woot it works

* update other schemas to include embeddable attrs

* update current user schema/examples
2016-10-29 22:58:31 +08:00
Devin Howard
1fbfd56d57 filter maps by user_id in api (#872)
* filter maps by user_id in api

* test user_id map filter

* update starred maps example to make starred true lol

* add user id to map schema/examples
2016-10-29 22:07:27 +08:00
Devin Howard
a32f98bde2 to_json should be as_json or there's bugs (#870)
* to_json should be as_json or there's bugs

* revert explore controller, it's better without

* revert search controller and some topic methods
2016-10-29 18:28:29 +08:00
Connor Turland
6cc827d11c wasn't updating calculated_permission when updating permission (#869) 2016-10-28 18:26:40 -04:00
Devin Howard
de16420796 fix logCanvasAttributes error (#863) 2016-10-28 15:20:39 +08:00
Devin Howard
e49e5c258a make synapse permissions depend on topic1 and topic2 (#839)
* deep change to synapse policy - is this ok?

* make synapse policy resilient to nil topic1/topic2/map

* use a transaction to handle authorization vs invalid record in synapse controller

* more synapse controller tests

* inline documentation

* fix policy(Synapse).create?
2016-10-28 11:03:59 +08:00
Devin Howard
4dc32d7d2e fix metacodes page scrolling (#862)
* fix metacodes page scrolling

use scheme from
http://brandonhilkert.com/blog/page-specific-javascript-in-rails/

* switch overflow:hidden to be on explicit controllers
2016-10-28 10:55:04 +08:00
Devin Howard
9d821c920b reorder API authentication precedence to be: token, oauth, cookie (#860)
* reorder authentication to be: token, then oauth, then cookie

* all APIs but tokens are accessible anonymously (so add mappings to the list)

* fix mapping order
2016-10-28 10:51:58 +08:00
Devin Howard
6b1220b533 overflow-y: hidden on body to prevent openLightbox from showing a scrollbar (#859) 2016-10-27 18:40:42 -04:00
Devin Howard
4f3d12d7a5 fix import promises (#858) 2016-10-27 14:03:18 +08:00
Devin Howard
7b4a072fd8 attempt to fix import problems (#852) 2016-10-26 20:34:22 +08:00
Devin Howard
175a3ee73e policy_scope on has_many relationships in serializers (#840)
* token overrides current user in api

* policy scope has_many relationships

* fix hard coded topics - whoops

* handle policy_scope returning nil in application serializer
2016-10-26 19:56:30 +08:00
Devin Howard
b13587456d fix coordsToPixels calls even more 2016-10-26 19:11:40 +08:00
Devin Howard
f023a18069 fix pixel stuff for real? (#851)
* fix getPastelColor function (I think)

* fix pixelsToCoords and coordsToPixels function calls

* update signature of coord/pixel functions in Util.spec.js
2016-10-26 19:04:00 +08:00
Devin Howard
e640048386 fix topic card title word break css (#844) 2016-10-26 17:01:05 +08:00
Devin Howard
98725b3ee4 fix getPastelColor function (I think) (#850)
* fix getPastelColor function (I think)

* fix pixelsToCoords and coordsToPixels function calls

* update signature of coord/pixel functions in Util.spec.js
2016-10-26 14:26:48 +08:00
Devin Howard
8a95262f2c allow anonymous users to GET api routes (#842)
* make map methods use ActiveRecord relations so they don't error on pundit

* test for logged out maps GET api

* open up GET routes on maps/topics/synapses and update api docs
2016-10-26 08:37:23 +08:00
Robert Best
ed89f80f49 Update README.md
some small tweaks to grammar and word choice
2016-10-25 14:24:10 -04:00
Devin Howard
47bca5907e add tests for Metamaps.Util (#825)
* decouple Util from other Metamaps modules

* first few Util tests

* more Util tests

* remove dead code

* eslint
2016-10-25 12:28:51 +08:00
Devin Howard
5163794698 anonymous users are nil, so need to remove the raise (#841) 2016-10-25 12:26:22 +08:00
Robert Best
0b6348e13f This fix closes the topic creation spinner when the map is panned. (Since, sometimes a click turns into a really small pan) (#828) 2016-10-24 11:48:34 -04:00
Connor Turland
ce1205f6d7 one more mapper card style fix 2016-10-24 14:35:23 +00:00
Connor Turland
96d25cc91d mapper profile mobile styling 2016-10-24 14:23:05 +00:00
Connor Turland
a9ef6feebd mapper page bug fix and styling 2016-10-24 13:42:26 +00:00
Connor Turland
98e2de68da oooh was using ineffective media queries for desktop 2016-10-23 16:49:16 -04:00
Connor Turland
4c68fd90ca set useful num for desc truncation on map cards 2016-10-23 16:30:54 -04:00
Connor Turland
cda0c21a0b make it responsive (#820) 2016-10-23 16:12:07 -04:00
Connor Turland
a44edbb17e better transition from map to explore 2016-10-23 11:44:20 -04:00
Connor Turland
aa96d074af dont show import on topic page 2016-10-23 11:21:38 -04:00
Connor Turland
4f9b9460ad don't block all right clicks 2016-10-23 11:12:43 -04:00
Devin Howard
a63cd02bc6 fix develop branch bug 2016-10-23 22:51:16 +08:00
Devin Howard
fb6c8a74a7 scoping on topic json properties (#813) 2016-10-23 22:11:38 +08:00
Devin Howard
5db8e27496 make metacode selector reliable after switching metacode sets (#816) 2016-10-23 22:11:26 +08:00
Devin Howard
87dc20fa50 stop showing map info box on topic view (#815) 2016-10-23 22:07:38 +08:00
Devin Howard
154257d062 fix Ctrl+A (#814) 2016-10-23 18:02:59 +08:00
Connor Turland
497c6ae017 spelling mistake fix 2016-10-22 15:16:55 -04:00
Connor Turland
9600983311 remove Connor thinking out loud comment 2016-10-22 11:07:50 -04:00
Connor Turland
cbcdd912c9 Comments were for non-redux scenario 2016-10-22 11:04:14 -04:00
Connor Turland
1d13da4ab5 Update README.md 2016-10-22 10:59:43 -04:00
Connor Turland
d359eb063a fixed the oauth redirect bug and a bit more (#796) 2016-10-22 16:46:39 +08:00
Connor Turland
4187dbd803 fix it up (#804) 2016-10-22 03:58:19 -04:00
Connor Turland
d549083cce prefer variable height lightbox over scrolling visually 2016-10-22 03:10:33 -04:00
Connor Turland
bc8660c83e remove about lightbox in prep for homepage redo and about page 2016-10-22 03:10:09 -04:00
Robert Best
c0b35280f6 Middle.mouse.click features (Open contained link & copy text to clipboard) (#792)
* changed the code to be based off of the current dev branch

* Update JIT.js

* Update Util.js

* Update JIT.js

A few logical operators were replaced with their stricter counterpart.

* Update JIT.js

* Update index.js

* Update Util.js
2016-10-22 02:58:13 -04:00
Connor Turland
31078c554e just make it 'tutorial' 2016-10-22 02:41:36 -04:00
Robert Best
ea20ba45b3 Merge pull request #738 from metamaps/window.resize.fix
Makes it so that resizing the browser window doesn't change the user's current location on the map
2016-10-22 02:12:54 -04:00
Robert Best
37b989c38e Update Listeners.js 2016-10-22 01:52:43 -04:00
Robert Best
759ec7845b cleaned up the window resize function even further 2016-10-22 05:50:31 +00:00
Robert Best
cfb8f51214 simplified the window resize function by adding a Util function that logs the canvas attributes. 2016-10-22 05:21:32 +00:00
Robert Best
1cd7e22c40 Merge commit '858ca66d69ed9e43f4d3a4ce6be288508cf4efa1' of github.com:metamaps/metamaps into window.resize.fix 2016-10-22 05:00:10 +00:00
Robert Best
ad1889dfc5 Merge branch 'develop' of github.com:metamaps/metamaps into window.resize.fix 2016-10-22 04:54:31 +00:00
Connor Turland
cbc8e6cdd4 the return of the infinite scroll (#795) 2016-10-22 00:15:10 -04:00
Connor Turland
f8556c30a5 resize every time it renders 2016-10-21 19:10:28 -04:00
Connor Turland
8af1e69460 undo last commit, don't need for rails5 2016-10-21 18:25:07 -04:00
Connor Turland
d1e8ecbf3b readd 12factor for debugging on heroku 2016-10-21 18:22:15 -04:00
Connor Turland
8e38469b1f add border radius to mapper list 2016-10-21 18:10:37 -04:00
Connor Turland
abb997c75c some quick fixes for realtime server after devins refactor 2016-10-21 18:04:18 -04:00
Connor Turland
be8efa6025 add card features (#793) 2016-10-21 17:42:21 -04:00
Robert Best
439527c464 Merge pull request #724 from metamaps/feature/edge.shift
Made it so that the map pans when you drag a selection of topics near the edge of the window
2016-10-21 17:03:25 -04:00
Robert Best
f68deea202 changed all logical operators to be more strict 2016-10-21 20:59:16 +00:00
Robert Best
b61cdb04fc Fixed the glitchyness, and made it suitable to merge with develop 2016-10-21 20:47:14 +00:00
Robert Best
5c67fcbff7 this time I actually addressed the conflicts 2016-10-21 20:38:17 +00:00
Robert Best
2eeb0a671f Fixed cherry pick conflicts 2016-10-21 20:26:42 +00:00
Connor Turland
fb427a11f0 [WIP] keep client fresh with junto info globally (#791)
* push state to client

* junto status is live on map cards XD

* little fixes

* eslint stuff

* remove object rest spread

* i think this makes realtime work without needing babel-node
2016-10-21 09:29:04 -04:00
Connor Turland
7a09a1c620 last commit broke stuff 2016-10-20 18:27:14 -04:00
Connor Turland
103ed5cbd7 max at 4, use fewer if not enough maps 2016-10-20 18:10:28 -04:00
Devin Howard
b1a7e548a2 add email/twitter links 2016-10-20 07:01:15 +08:00
Connor Turland
52c340b8f5 center the explore maps div! (#787)
* ooh baby

* will add displayStyle again later if we actually build it
2016-10-19 14:40:42 -04:00
Connor Turland
9299ca5f2c dont do translate with arrow keys till we can block conflicts 2016-10-19 17:47:10 +00:00
Devin Howard
261ed49977 replace uservoice with docs.metamaps.cc + Hylo (#777)
* replace uservoice with docs.metamaps.cc + Hylo

* re-add the feedback tab as link to hylo
2016-10-19 13:39:57 -04:00
Devin Howard
e2d9b6aef2 Merge pull request #786 from metamaps/fix/empty-autocomplete
fix topic autocomplete controller action
2016-10-19 22:16:26 +08:00
Devin Howard
1042fb020d Merge pull request #778 from metamaps/feature/auto-copy-invite-link
copy share invite link to clipboard automatically where possible
2016-10-19 22:15:21 +08:00
Devin Howard
7f1c04015e fix topic autocomplete controller action 2016-10-19 22:10:38 +08:00
Devin Howard
f75d5253b3 Merge pull request #781 from metamaps/fix/registration
clean up and fix devise code
2016-10-19 14:36:39 +08:00
Devin Howard
bb6566a45e clean up and fix devise code 2016-10-19 12:40:52 +08:00
Devin Howard
2529e0d44f copy share invite link to clipboard automatically where possible 2016-10-19 11:07:20 +08:00
Connor Turland
139837e997 restructure realtime server for clarity (#780)
* restructure realtime server for clarity

* better indenting on signal.js

* don't need it because socketioconnection is being imported now
2016-10-18 20:29:21 -04:00
Connor Turland
d8cd536a95 too much logging 2016-10-18 14:10:41 -04:00
Connor Turland
29913cd10b fix for heroku 2016-10-18 14:08:10 -04:00
Connor Turland
d004e98ada holy insanity realtime refactor (#779)
* all the refactoring

* make it all work
2016-10-18 12:34:19 -04:00
Connor Turland
d2e097fd05 add webrtc logging 2016-10-17 22:59:28 -04:00
Connor Turland
fe0da255dd [WIP] display whether a map is live on every map card (#775)
* tidy up

* checkwhethertosave was no longer correct
2016-10-17 22:27:15 -04:00
Devin Howard
6e75274737 access request tests (#772)
* access request tests

* map mailer spec update
2016-10-17 10:53:53 -04:00
Devin Howard
6c9d464a9f Global => All Maps (#774) 2016-10-17 10:53:33 -04:00
Connor Turland
517cfcb913 remove static lib files in favor of npm ones (#773)
* remove static lib files in favor of npm ones

* update howler to work correctly

* patch npm modules to not use window
2016-10-17 10:39:08 -04:00
Devin Howard
0ee1b3284a fix check-canvas-support require 2016-10-17 13:47:42 +08:00
Devin Howard
b976c13db2 Merge pull request #770 from metamaps/feature/remove-canvas-function
remove check-canvas-support.js
2016-10-17 13:40:34 +08:00
Connor Turland
c0955d7c5e multiple policy issues (#771)
* multiple policy errors

* make some things more explicit
2016-10-17 01:20:48 -04:00
Connor Turland
332bb2ec08 Map Card changes (#769)
* map card rewrite underway

* star count

* css fix
2016-10-16 23:46:55 -04:00
Devin Howard
179849b639 remove check-canvas-support.js 2016-10-17 11:42:11 +08:00
Devin Howard
4f6dae304c Merge pull request #768 from metamaps/feature/default-rails-scripts
add scripts from default rails install
2016-10-17 10:51:47 +08:00
Devin Howard
3479fb7ff7 Merge pull request #767 from metamaps/fix/schema
schema update
2016-10-17 10:46:57 +08:00
Devin Howard
c113253fc5 add scripts from default rails install 2016-10-17 10:42:14 +08:00
Devin Howard
e46aa54ba3 schema update 2016-10-17 10:39:46 +08:00
Connor Turland
4602ded8a4 access requests (#762)
* start on access requests

* set up access requests further

* set default values for approved and answered
2016-10-16 20:22:00 -04:00
Devin Howard
14ea18a967 Merge pull request #764 from metamaps/fix/import-dialog-box
fix file upload box
2016-10-16 22:11:36 +08:00
Devin Howard
8180a8cc71 fix file upload box 2016-10-14 14:45:17 +08:00
Devin Howard
da5191171a Merge pull request #760 from metamaps/feature/mailer-tests
tests for map_mailer.rb
2016-10-14 11:24:31 +08:00
Devin Howard
26a8cddd14 mailer spec 2016-10-13 18:45:54 +08:00
Devin Howard
407ac1f29c more simplecov groups 2016-10-13 16:48:54 +08:00
Devin Howard
fc2849824f fix js syntax error 2016-10-13 16:48:46 +08:00
Devin Howard
6f3c74b7f1 token policy fix 2016-10-13 15:21:27 +08:00
Devin Howard
c3dbd59280 Merge pull request #758 from metamaps/feature/remove-gems
don't need coffeescript
2016-10-13 14:55:04 +08:00
Devin Howard
0e7e649f56 don't need coffeescript, tunemygc fails on Windows 2016-10-13 14:52:59 +08:00
Devin Howard
6e03132f1b fix spec 2016-10-13 14:51:58 +08:00
Devin Howard
b2a4acc99d make default category explicit in import.js 2016-10-13 14:24:08 +08:00
Devin Howard
7eae8deacb revamp HTML template a bit for api docs (#757)
* my_tokens endpoint moved to normal index

* remove secured_by from metacodes/users

* ch ch ch changes

* mess with template

* fix securedBy

* convenience open

* gross authentication notes at the top of every endpoint

* better ordering

* move login tutorials into security tab

* oauth tutorial

* getting closer

* remove unneeded Endpoints header

* ok looks OK
2016-10-12 13:54:43 -04:00
Devin Howard
62c489cba7 suggesting api doc updates (#756) 2016-10-12 12:22:38 -04:00
Devin Howard
3051723bcf [WIP] add markdown getting started page to api docs (#752)
* add markdown getting started page to api docs. TODO section 3

* Update getting-started.md
2016-10-11 12:08:31 -04:00
Devin Howard
858ca66d69 eslint updates 2016-10-10 17:22:22 +08:00
Devin Howard
a0c0dcbc79 Merge pull request #753 from metamaps/fix/screenshot-no-file
fix screenshot no file error
2016-10-10 13:01:50 +08:00
Devin Howard
6e6d33abbe fix screenshot no file error 2016-10-10 12:12:42 +08:00
Devin Howard
8b1d85c3ca actually the smart option is dumb 2016-10-09 10:24:13 +08:00
Devin Howard
56d3ef8bea Merge pull request #751 from metamaps/feature/markdown-xss-safe
enable xss filtering and smart quote replacement in markdown
2016-10-09 10:23:00 +08:00
Devin Howard
ba9e26bc05 enable xss filtering and smart quote replacement in markdown 2016-10-09 10:20:17 +08:00
Devin Howard
9ac24f7468 Merge pull request #744 from metamaps/feature/markdown-in-topic-cards
markdown in topic card description field
2016-10-08 16:58:32 +08:00
Devin Howard
fe1c57b458 further updates - make Enter update bip fields whaaat 2016-10-08 16:55:46 +08:00
Devin Howard
9d85dab975 Merge pull request #747 from metamaps/fix/unauth-error
redirect to root_path if you get a 403
2016-10-08 14:16:13 +08:00
Devin Howard
ab76b77bdd Merge pull request #748 from metamaps/feature/api-json-404
return 404s for all unmatched api routes
2016-10-08 14:16:00 +08:00
Devin Howard
9513087bbd remove unnecessary api v1 code 2016-10-08 14:12:54 +08:00
Devin Howard
2c64b67abd return 404s for all unmatched api routes 2016-10-08 13:58:19 +08:00
Devin Howard
be6a2401b6 fix spec. not sure how this should work 2016-10-08 13:42:25 +08:00
Devin Howard
0764133d11 Merge pull request #661 from metamaps/feature/file-upload-component
set up a dialog box to help with import/export
2016-10-08 12:34:28 +08:00
Devin Howard
129e3db946 redirect to root_path if you get a 403 2016-10-08 12:26:08 +08:00
Devin Howard
7eacda2ae7 code style 2016-10-08 09:35:05 +08:00
Devin Howard
f775629371 showCard .desc css for ul and a tags 2016-10-08 09:24:17 +08:00
Devin Howard
0085ce71e6 upgrade to best in place 3.0.0 alpha 2016-10-08 09:24:16 +08:00
Devin Howard
fc044294f1 add markdown to topic cards 2016-10-08 09:23:57 +08:00
Devin Howard
20da1ef39f fiddle with import icon 2016-10-08 00:21:04 +08:00
Devin Howard
42bb2cd86a look and feel updates 2016-10-08 00:16:37 +08:00
Devin Howard
dc55bae243 Merge pull request #740 from metamaps/feature/ctrl-or-meta
make all Ctrl shortcuts also work with Meta (Cmd on OSX)
2016-10-08 00:07:07 +08:00
Robert Best
b6da38e29e Update Listeners.js
Simplified based on Connor's suggestion about usage of variables.
2016-10-07 02:36:41 -04:00
Devin Howard
2b036bfb4e all Ctrl shortcuts now also work with Meta (Cmd on OSX) 2016-10-07 14:03:48 +08:00
Robert Best
3e4ff59a82 Update Listeners.js 2016-10-06 23:58:57 -04:00
Robert Best
08f89ee630 Update Listeners.js 2016-10-06 23:56:39 -04:00
Connor Turland
86a6e92bc3 dont show private maps in global collection (#734)
* dont show private maps in global collection

* Update explore_controller.rb

* Update main_controller.rb
2016-10-06 23:45:17 -04:00
Robert Best
b978247785 Put all the code within the if statement 2016-10-07 00:51:52 +00:00
Robert Best
0aeb6caadb Makes it so that resizing the browser window doesn't change the user's location on the map 2016-10-07 00:33:16 +00:00
Connor Turland
97d2868fad dont pan while using arrow keys during creation fixes #721 (#733) 2016-10-06 10:49:49 -04:00
Connor Turland
658f102a4e fixes #720 double topic create when pinned (#732) 2016-10-06 10:37:01 -04:00
Connor Turland
b52523e7be one more maps in maps error 2016-10-06 10:32:06 -04:00
Connor Turland
e72ae5df94 another issue from the maps in maps branch 2016-10-06 09:33:10 -04:00
Connor Turland
a56c4eb110 missing comma 2016-10-06 09:27:18 -04:00
Connor Turland
85dcad928f enable pulling in of references to maps through typeahead (#636) 2016-10-06 09:12:01 -04:00
Connor Turland
a79d6a824c dont do async: false (#731)
* dont do async: false

* account for case where callback isn't provided
2016-10-06 09:07:46 -04:00
Devin Howard
38c323a18a global lightbox css changes 2016-10-06 16:22:22 +08:00
Devin Howard
518773d6e1 pop up a lightbox using React to help you export 2016-10-06 16:22:21 +08:00
Devin Howard
33bcfc1505 move Maps into a folder 2016-10-06 16:20:27 +08:00
Devin Howard
d80d33761d Merge pull request #730 from metamaps/feature/synapse-check-for-topic-by-name
allow synapses to be imported by topic name as well as id
2016-10-06 14:09:43 +08:00
Devin Howard
df59c28aa8 Merge pull request #729 from metamaps/fix/chat-message-word-wrap
word wrap on chat message text
2016-10-06 14:08:59 +08:00
Devin Howard
b4d1250959 share normalizeKey between TSV, CSV, and JSON 2016-10-06 12:03:23 +08:00
Devin Howard
c0a220abc9 allow synapses to be imported by topic name as well as id 2016-10-06 11:52:05 +08:00
Devin Howard
eb4073c228 word wrap on chat message text. Fixes #726 2016-10-06 11:18:55 +08:00
Connor Turland
98fae4b721 fixes #711 toast button styling 2016-10-05 22:28:37 -04:00
Connor Turland
0cfbe41d95 don't prevent all right clicking 2016-10-05 22:22:38 -04:00
Connor Turland
c256d0891b dont conflict message sending with topic creation 2016-10-05 22:17:04 -04:00
Connor Turland
6d6a5099e9 Enable access to Most Used and Recently Used metacodes in lists and carousel (#708)
* used and recent

* enable most used and recent in all metacode select situations

* selected changed to active at some point

* switch recent and most used positions

* remove index doc page
2016-10-05 10:45:39 -04:00
Connor Turland
8d613eab33 improve descriptors 2016-10-05 10:38:38 -04:00
Devin Howard
d193c9a53c add starred to maps API (#719)
* add starred to maps API and endpoint to create/delete

* add token to requests without token param

* add minor version number to api version

* metacode/user use uri in schema

* make code climate happier
2016-10-05 10:36:03 -04:00
Devin Howard
40453242fa Merge pull request #717 from metamaps/feature/eslint-updates
eslint updates
2016-10-05 11:55:47 +08:00
Devin Howard
12417d8cd3 update JIT eslint style 2016-10-05 01:46:51 +08:00
Devin Howard
e3db00f229 Merge pull request #718 from metamaps/fix/raml
fix api documentation
2016-10-05 00:00:34 +08:00
Devin Howard
e2c0ce7c22 fix api documentation 2016-10-04 23:43:42 +08:00
Devin Howard
113a5a2530 fix a bunch of bug risk eslint warnings 2016-10-04 23:38:32 +08:00
Devin Howard
959260f234 Merge pull request #716 from metamaps/feature/new-endpoints
users and metacodes api endpoints
2016-10-04 23:12:04 +08:00
Devin Howard
dbc2ff75df make eslint work and update yoda config 2016-10-04 23:06:49 +08:00
Devin Howard
df29e48d8c rubocop + allow unauthed users to see all users 2016-10-04 22:51:21 +08:00
Devin Howard
2eae89a6b7 users and metacodes api endpoints 2016-10-04 22:28:10 +08:00
Devin Howard
c90460802e enable heroku to serve apidocs 2016-10-04 17:59:13 +08:00
Devin Howard
a9831946d0 ensure public/api directory exists 2016-10-04 16:33:15 +08:00
Devin Howard
bf733b57d2 Merge pull request #715 from metamaps/feature/faster-builds
speed up travis builds by excluding raml2html from npm install
2016-10-04 16:24:10 +08:00
Devin Howard
15b8440fbc move raml2html to optional dependencies so it can be installed globally 2016-10-04 16:21:09 +08:00
Devin Howard
c58a8da1a6 Merge pull request #714 from metamaps/feature/raml-1.0
update raml and create a build script for it
2016-10-04 16:10:02 +08:00
Devin Howard
8afef1bc4a make tokens description field optional 2016-10-04 16:08:07 +08:00
Devin Howard
8ac8aad105 PUT and PATCH parameters are optional 2016-10-04 15:30:06 +08:00
Devin Howard
2466a0912f raml2html build script 2016-10-04 15:22:24 +08:00
Devin Howard
3d7a2ef5b1 make raml traits work and be accurate/useful 2016-10-04 15:22:24 +08:00
Devin Howard
a2cde20f8f raml2html with 1.0 syntax working 2016-10-04 15:22:22 +08:00
Connor Turland
da3795a2c2 new map improvements (#710)
* prehighlight the text for editing when taken to a new map

* style
2016-10-02 22:49:45 -04:00
Devin Howard
6d2efefbbc Merge pull request #709 from metamaps/bug/backbone
backbone router fix
2016-10-03 08:28:36 +08:00
Devin Howard
7d0b56da19 Merge pull request #689 from metamaps/feature/user-in-slack-notification
Custom formatter for slack exception notifications
2016-10-03 08:26:13 +08:00
Devin Howard
87228a9631 delete old gems and upgrade aws/paperclip (#676)
* remove old gems from gemfile, upgrade aws/paperclip

* update paperclip config

* upload screenshots as a blob instead of base64 to maps controller
2016-10-02 18:29:35 -04:00
Connor Turland
0f740e751a topics wasn't in backbone routes 2016-10-02 17:37:14 -04:00
Devin Howard
afa4422608 Custom formatter for slack exception notifications 2016-10-02 17:07:45 +08:00
Devin Howard
7ec9feff80 Merge pull request #702 from metamaps/feature/quiet-assets
quiet assets again
2016-10-02 11:01:17 +08:00
Devin Howard
b3c7e12d9a assets.debug was why assets were loud 2016-10-02 10:53:35 +08:00
Devin Howard
bc139608c2 Search.focus() is the new Search.open() 2016-10-02 10:09:55 +08:00
Devin Howard
05c1e4c60d Merge pull request #699 from metamaps/feature/arrow-keys-pan
arrow key panning - fixes #239
2016-10-02 00:13:16 +08:00
Devin Howard
ca981898d4 arrow key panning - fixes #239 2016-10-02 00:09:55 +08:00
Devin Howard
77d353464b Merge pull request #698 from metamaps/feature/random-updates
more random js & import updates
2016-10-01 23:26:58 +08:00
Devin Howard
8f230736dc code climate 2016-10-01 13:47:16 +08:00
Devin Howard
bb013787b6 make AutoLayout skip over coordinates if there is a mapping at that exact position 2016-10-01 13:34:52 +08:00
Devin Howard
20a32afe3b integrate handleURL into Import 2016-10-01 13:18:50 +08:00
Devin Howard
c5564e02fc don't needt o open topic card 2016-10-01 12:47:30 +08:00
Devin Howard
4949f0dbd6 eslint and use AutoLayout 2016-10-01 12:43:30 +08:00
Devin Howard
99d07d2d65 Merge pull request #695 from metamaps/fix/topic-bugs
fix topic controller bugs
2016-10-01 12:38:56 +08:00
Devin Howard
fdf03ac83a source maps!
(I think)
2016-10-01 12:32:40 +08:00
Devin Howard
1562d8fcfe topics imported with a link get Reference metacode 2016-10-01 12:14:38 +08:00
Devin Howard
e5e8a3dcbb Merge pull request #697 from metamaps/feature/random-updates
import fixes + random config updates
2016-10-01 11:36:57 +08:00
Devin Howard
e093ca5a30 more liberally import csv 2016-10-01 11:21:42 +08:00
Devin Howard
4328a6205f enable code duplication checks on code climate 2016-10-01 11:20:31 +08:00
Devin Howard
01872e740e fix import if there are errors 2016-10-01 11:19:38 +08:00
Devin Howard
6ae391265e enable source maps 2016-10-01 10:49:34 +08:00
Devin Howard
ea18479822 Merge pull request #696 from metamaps/fix/import
fix tsv import
2016-09-30 22:38:36 +08:00
Devin Howard
0e79f2ae4b fix tsv 2016-09-30 22:33:09 +08:00
Devin Howard
7156fab3e2 fix topic controller bugs 2016-09-30 14:42:07 +08:00
Devin Howard
97c118a20b Merge pull request #693 from metamaps/feature/re-enable-search
re-enable Ctrl+/ search box focus shortcut
2016-09-30 12:02:44 +08:00
Devin Howard
b396b94477 re-enable Ctrl+/ search box focus shortcut 2016-09-30 11:55:43 +08:00
Devin Howard
e916ea32dc Merge pull request #690 from metamaps/feature/globalui-lint
eslint updates for GlobalUI.js
2016-09-30 11:54:40 +08:00
Devin Howard
816d5adf94 remove old code from GlobalUI.Search 2016-09-30 11:52:01 +08:00
Robert Best
8864dbbdcf Merge pull request #691 from metamaps/feature/better.zoom
I changed how zoom by mouse-wheel works so that it zooms based on whe…
2016-09-29 18:26:02 -04:00
Robert Best
44a183ed7b I changed how zoom by mouse-wheel works so that it zooms based on where your mouse pointer is 2016-09-29 21:32:55 +00:00
Devin Howard
e4e6043ded split GlobalUI into files 2016-09-30 00:20:16 +08:00
Devin Howard
24caafba74 move GlobalUI into a folder 2016-09-30 00:08:45 +08:00
Devin Howard
3b8199aac6 eslint updates for GlobalUI.js 2016-09-30 00:08:04 +08:00
Devin Howard
2f0b0f39e5 Merge pull request #688 from metamaps/fix/searchsynapses-undefined-topic
fix error when searching for synapse with undefined topic1id
2016-09-29 23:56:16 +08:00
Devin Howard
1d4d7f07e2 fix error when searching for synapse with undefined topic1id 2016-09-29 18:38:54 +08:00
Devin Howard
9af3f04f4d Merge pull request #685 from metamaps/feature/chatview-lint
update ChatView.js eslint style
2016-09-29 15:21:15 +08:00
Devin Howard
ec8dbbb4a7 Merge pull request #687 from metamaps/fix/rack-attack
disable 5 minute request limit on rack attack
2016-09-29 15:18:48 +08:00
Devin Howard
26977d06a8 disable 5 minute request limit on rack attack 2016-09-29 13:15:14 +08:00
Connor Turland
1bbc72fff0 was destroying and not reinitializing 2016-09-28 22:36:53 -04:00
Devin Howard
bca85337cc add template strings + outdent to chatview 2016-09-29 09:33:13 +08:00
Devin Howard
e858a2a773 update ChatView.js eslint style 2016-09-29 09:24:17 +08:00
Devin Howard
ee9a49d7c6 Merge pull request #683 from metamaps/fix/routes
fix routes.rb
2016-09-29 08:44:15 +08:00
Devin Howard
88297b4eaa fix routes.rb 2016-09-29 08:40:39 +08:00
Connor Turland
93341719a9 Update main_controller.rb (#682) 2016-09-28 20:22:55 -04:00
Devin Howard
db3cf0490f fix develop branch bugs (#679)
* bugfix - rename SearchController so it works

* remove unneeded respond_with

* fix to_json calls
2016-09-29 08:02:25 +08:00
Robert Best
9605b24640 Merge pull request #681 from metamaps/better-contextMenu-fix
Better default context menu suppression fix
2016-09-28 15:37:46 -04:00
Robert Best
e8746ee7d9 Update Create.js 2016-09-28 15:32:49 -04:00
Robert Best
a37f60060c Update JIT.js 2016-09-28 15:31:08 -04:00
Robert Best
4e506ad290 Update JIT.js 2016-09-28 15:18:44 -04:00
Robert Best
67c4912c62 Update index.js 2016-09-28 13:37:08 -04:00
Robert Best
10a2782f85 Update JIT.js 2016-09-28 13:03:44 -04:00
Robert Best
2c3b387e42 Update index.js 2016-09-28 13:00:32 -04:00
Devin Howard
d6a239d6b4 Merge pull request #670 from metamaps/feature/explore-controller-simplify
[WIP test it] clean up routes and some controllers
2016-09-28 22:34:34 +08:00
Devin Howard
466b1716a5 more changes to routes.rb 2016-09-28 22:29:53 +08:00
Devin Howard
9699b41159 make requestinvite controller method explicit 2016-09-28 22:29:53 +08:00
Devin Howard
c1acaba941 re-order config/routes.rb 2016-09-28 22:29:53 +08:00
Devin Howard
5b9eedc830 pull search routes into their own controller 2016-09-28 22:29:53 +08:00
Devin Howard
5065655436 factor stars into their own controller 2016-09-28 22:27:32 +08:00
Devin Howard
3ee8d41298 maps controller code climate 2016-09-28 22:27:32 +08:00
Devin Howard
f75ad41a82 factor out map_scope function 2016-09-28 22:27:32 +08:00
Devin Howard
bb87c9c2db simplify explore controller a bit 2016-09-28 22:27:32 +08:00
Devin Howard
a8b698b11c Merge pull request #677 from metamaps/feature/node1-topic1-migration
node{1,2}_id => topic{1,2}_id migration and code changes
2016-09-28 22:26:50 +08:00
Devin Howard
cc412ac491 Merge pull request #675 from metamaps/feature/no-xls-export
remove excel export
2016-09-28 22:25:04 +08:00
Robert Best
ac60370d6f Merge pull request #678 from metamaps/prevent-context-menu
Prevent default context menu from opening when topics/synapses are right-clicked
2016-09-28 05:27:03 -04:00
Robert Best
40b7e95b68 Update index.js
Prevents the default chrome context menu from appearing overtop the Metamaps context menu
2016-09-28 04:35:41 -04:00
Devin Howard
743c9b3af9 node{1,2}_id => topic{1,2}_id migration and code changes 2016-09-28 10:35:14 +08:00
Devin Howard
a86101dda0 remove excel export 2016-09-27 21:10:14 +08:00
Connor Turland
8f0b350a2d Fix underscore bug (#674)
* Update package.json

* Update ChatView.js
2016-09-26 20:39:33 -04:00
Connor Turland
c60e103d97 Update _switchmetacodes.html.erb 2016-09-26 20:28:06 -04:00
Devin Howard
7150b9fcce Merge pull request #673 from metamaps/fix/eslint-updates
Figured out eslint-3 + some small eslint fixes
2016-09-26 18:18:31 +08:00
Devin Howard
bc8ce0fee4 topic view bug fix 2016-09-26 14:04:31 +08:00
Devin Howard
12cb675bb5 switch to using the eslint-standard plugin again 2016-09-26 13:44:23 +08:00
Devin Howard
c9a79468f4 switch to eslint-3 2016-09-26 13:40:02 +08:00
Devin Howard
ebaae084ae simple eslint fixes 2016-09-26 13:37:42 +08:00
Devin Howard
e646585a7a Merge pull request #672 from metamaps/feature/eslint-config
fix eslint config for code climate
2016-09-26 10:50:30 +08:00
Devin Howard
0e17ec11ec fix eslint config for code climate
this is MOSTLY the same as feross/standard
2016-09-26 10:47:45 +08:00
Devin Howard
5649798e4b Merge pull request #668 from metamaps/fix/hide-addTopic-message-on-double-click
show/hide add a topic instructions more consistently
2016-09-25 23:51:00 +08:00
Devin Howard
c20e503785 show/hide add a topic instructions more consistently 2016-09-25 23:48:14 +08:00
Devin Howard
17870e7a4c Merge pull request #669 from metamaps/fix/remove-invalid-links
show link remover for invalid links too
2016-09-25 23:47:30 +08:00
Devin Howard
b49cb7766a Merge pull request #652 from metamaps/feature/explore-controller
refactor map controller
2016-09-25 23:47:22 +08:00
Devin Howard
fb563c6eed Merge pull request #648 from metamaps/feature/load-url-title-hack
hack to load link titles when pulling a url into a map
2016-09-25 23:47:10 +08:00
Devin Howard
03ba3a89f1 main controller renders by name 2016-09-25 23:37:08 +08:00
Devin Howard
05495b0224 move explore views to their own folder 2016-09-25 23:35:35 +08:00
Devin Howard
18d8929bf1 use .or to fix all sorts of @map.mappings bugs 2016-09-25 23:35:26 +08:00
Devin Howard
50f98aebea explore controller spec 2016-09-25 23:25:38 +08:00
Devin Howard
dad048eb20 rubocop 2016-09-25 23:25:38 +08:00
Devin Howard
c76de5b1d5 refactor map model a bit and fix bugs 2016-09-25 23:25:38 +08:00
Devin Howard
3f9077b380 clean up 2016-09-25 23:25:38 +08:00
Devin Howard
b722d2d3b0 fix map controller create spec 2016-09-25 23:25:38 +08:00
Devin Howard
5e180ac10e set up explore controller routes and rename methods 2016-09-25 23:25:38 +08:00
Devin Howard
686d80e274 move more logic into map model 2016-09-25 23:25:37 +08:00
Devin Howard
7275beb163 put CRUD at top of maps controller, and alphabetize other actions below 2016-09-25 23:25:37 +08:00
Devin Howard
40bd9ed95a refactor maps controller a bit 2016-09-25 23:25:37 +08:00
Devin Howard
1ab8703008 move explore maps methods into their own controller 2016-09-25 23:25:37 +08:00
Devin Howard
eed5ff76ef add rate limiting headers 2016-09-25 23:23:52 +08:00
Devin Howard
959aa693f3 ok, i guess this is ready 2016-09-25 23:22:20 +08:00
Devin Howard
7f8110b6be configure rack attack to allow 5r/s for the load_url_title route 2016-09-25 23:22:18 +08:00
Devin Howard
ceb2699760 install rack-attack 2016-09-25 22:54:40 +08:00
Devin Howard
cc2e3b9358 hack to get the <title> tag when importing a url, without CORS issues 2016-09-25 22:50:16 +08:00
Devin Howard
8c16c60554 show link remover for invalid links too 2016-09-25 22:44:07 +08:00
Devin Howard
cc986368be Merge pull request #667 from metamaps/feature/update-package.json
update package.json and save a bit of bundle size
2016-09-25 22:25:31 +08:00
Devin Howard
dd78c0c379 Merge pull request #665 from metamaps/fix/topic-to-map-transition
hide circles when transitioning from topic view to map view
2016-09-25 22:25:19 +08:00
Devin Howard
0df17c4aa0 update deps in package.json 2016-09-25 21:53:40 +08:00
Devin Howard
2ade375c20 babel-plugin-lodash to slim down bundle size by 300 KB 2016-09-25 21:53:26 +08:00
Devin Howard
11d13445fb fix authorizeToEdit call 2016-09-25 20:19:38 +08:00
Devin Howard
7734272737 hide circles when transitioning from topic view to map view
fixes #389
2016-09-25 20:10:18 +08:00
Devin Howard
43fafb8e6f Merge pull request #663 from metamaps/fix/git-versioning
fix git versioning
2016-09-25 19:48:48 +08:00
Devin Howard
5819447828 fix git versioning 2016-09-25 19:35:37 +08:00
Devin Howard
997a4b7329 Merge pull request #662 from metamaps/fix/no-add-topic-message-if-logged-out
hide double click to add topic message if can't edit map
2016-09-25 18:50:57 +08:00
Devin Howard
35d6dbd0b4 hide double click to add topic message if can't edit map 2016-09-25 15:04:14 +08:00
Devin Howard
1810faacbe Merge pull request #660 from metamaps/feature/csv
enable csv import using csv-parse module
2016-09-25 14:27:48 +08:00
Devin Howard
40f89b1c61 enable csv import using csv-parse module 2016-09-25 12:49:57 +08:00
Devin Howard
82b7c7e5ac Merge pull request #659 from metamaps/feature/js-fiddling
simplify js
2016-09-24 23:35:50 +08:00
Devin Howard
0a0ff2fdab remove fetch api - we don't want no polyfills, and already have jQuery 2016-09-24 23:28:11 +08:00
Devin Howard
045bd3fd73 Metamaps.Filter bug and use _.omit instead of util function 2016-09-24 23:23:12 +08:00
Devin Howard
79aa7717ed exact versions in package.json 2016-09-24 23:21:29 +08:00
Devin Howard
0bb7b1523d Metamaps.ReactComponents isn't needed anymore 2016-09-24 14:40:40 +08:00
Devin Howard
03eacde753 Merge pull request #656 from metamaps/feature/tech-debt
rubocop style updates
2016-09-24 13:59:27 +08:00
Devin Howard
a164dccc94 fix errors!! 2016-09-24 13:55:52 +08:00
Devin Howard
20bd959c69 fix models that rubocop broke >:( 2016-09-24 13:02:53 +08:00
Devin Howard
b0fac7648a Merge pull request #650 from metamaps/fix/map-serialization-bug
fix @maps serialization bug
2016-09-24 12:32:38 +08:00
Devin Howard
f8c11f234d more rubocop updates 2016-09-24 12:27:34 +08:00
Devin Howard
5fab6de48a fiddle with metacodes controller 2016-09-24 11:00:53 +08:00
Devin Howard
0ace202ace automatic rubocop updates 2016-09-24 11:00:46 +08:00
Robert Best
0a62eb3299 Merge pull request #655 from metamaps/feature/fix-map-titles
Feature/fix map titles
2016-09-23 16:48:44 -04:00
Robert Best
afa0cc96b9 Update index.js 2016-09-23 16:06:28 -04:00
Robert Best
f41ece6f1c Update index.js 2016-09-23 15:47:37 -04:00
Robert Best
b8ae2c4b6a Update Router.js 2016-09-23 15:45:11 -04:00
Devin Howard
c76657ecb4 fix restful controller style issuse 2016-09-23 18:54:05 +08:00
Devin Howard
8255653d24 disable duplication checking in code climate for now 2016-09-23 18:51:34 +08:00
Devin Howard
04a3027368 code climate linked to travis 2016-09-23 18:43:54 +08:00
Devin Howard
cbd9395142 Merge pull request #651 from metamaps/feature/update
update gems
2016-09-23 18:37:14 +08:00
Devin Howard
bb5ba4861d [WIP] code climate config file (#654)
code climate config file
2016-09-23 18:36:47 +08:00
Devin Howard
4afab70414 Merge pull request #653 from metamaps/fix/travis
safer git dating
2016-09-23 17:57:02 +08:00
Devin Howard
a7338f8960 safer git dating 2016-09-23 17:49:26 +08:00
Devin Howard
117b7910bf test 2016-09-23 17:40:30 +08:00
Devin Howard
ce1ad3e24b update gems 2016-09-23 15:28:31 +08:00
Devin Howard
df84bd9e1d fix @maps serialization bug
if @maps is empty, it returns {"maps":[]}, instead of [] like we expect
on the frontend.

This commit fixes this issue
2016-09-23 14:40:26 +08:00
Devin Howard
eef8a281cb Merge pull request #649 from metamaps/feature/Metamaps-in-frontend
move Metamaps code to webpack
2016-09-23 14:22:46 +08:00
Devin Howard
6f91ce5ff5 fix a few more errors 2016-09-23 14:12:27 +08:00
Devin Howard
e65a5e2d1c whoops, reenable travis npm test 2016-09-23 12:00:47 +08:00
Devin Howard
bda740491c moved JIT to npm. tests pass. whoop whoop 2016-09-23 11:59:23 +08:00
Connor Turland
700119cc9e opts can be undefined and throw error 2016-09-22 23:04:46 -04:00
Devin Howard
07e4ac3865 attempt to get npm testing working; fail 2016-09-23 10:37:59 +08:00
Connor Turland
499593fc82 fixing references 2016-09-22 21:40:49 -04:00
Connor Turland
f59a5775ae tweaks to import/exports 2016-09-22 20:16:18 -04:00
Devin Howard
73e7c38873 syntax fixes 2016-09-23 08:05:26 +08:00
Devin Howard
30fc943833 clean up backbone file imports 2016-09-23 00:20:05 +08:00
Devin Howard
a996734c79 remove Backbone from window 2016-09-23 00:16:15 +08:00
Devin Howard
30894a313f move views to their own frontend folder 2016-09-23 00:07:30 +08:00
Devin Howard
fe3012136d import _ 2016-09-22 23:51:33 +08:00
Devin Howard
59b471ac62 break Map into three files 2016-09-22 23:51:28 +08:00
Devin Howard
120c2c0b67 finish most except Backbone 2016-09-22 18:36:22 +08:00
Devin Howard
0065b201c7 make more code modular 2016-09-22 17:36:47 +08:00
Devin Howard
8ed2b3ffc1 remove Constants.js 2016-09-22 17:14:34 +08:00
Devin Howard
9c1543de64 move some variables into JIT 2016-09-22 17:08:53 +08:00
Devin Howard
8f100d99cb start to do stuff that may/may not work 2016-09-22 17:05:28 +08:00
Devin Howard
0562134157 low hanging fruit
Here is my TODO list:

already done
==> Account.js <==
==> Admin.js <==
==> AutoLayout.js <==
==> Listeners.js <==
==> Mapper.js <==
==> Organize.js <==
==> PasteInput.js <==
==> ReactComponents.js <==
==> Util.js <==

TODO (I think) simple to make modular
==> Backbone.js <==
==> Control.js <==
==> Create.js <==
==> Filter.js <==
==> Import.js <==
==> Mobile.js <==
==> Synapse.js <==
==> SynapseCard.js <==
==> Topic.js <==
==> TopicCard.js <==
==> Views.js <==
==> Visualize.js <==

TODO hard to make modular
==> Constants.js <==
==> Debug.js <==
==> GlobalUI.js <==
==> JIT.js <==
==> Map.js <==
==> Realtime.js <==
==> Router.js <==
2016-09-22 17:00:36 +08:00
Devin Howard
0a109895f7 merge realtime/package.json into top level package.json 2016-09-22 17:00:36 +08:00
Devin Howard
c0f63abc59 upgrade testing to es6 2016-09-22 17:00:36 +08:00
Devin Howard
d97b5c2977 make Util modular 2016-09-22 17:00:27 +08:00
Devin Howard
7f83f86460 refactor a bit, make a comment about the Constants file 2016-09-22 15:29:55 +08:00
Devin Howard
03446f548a start making the code modular. many files still need global scape 2016-09-22 15:23:14 +08:00
Devin Howard
d02c836805 remove Metamaps from filenames 2016-09-22 14:35:14 +08:00
Devin Howard
a4d31241a8 move Metamaps code into webpack 2016-09-22 14:28:20 +08:00
Devin Howard
b13ebc6716 Merge pull request #640 from metamaps/fix/password-reset-error
fix password reset error
2016-09-22 09:16:25 +08:00
Devin Howard
1370b63311 Merge pull request #639 from metamaps/feature/paste-url
Allow pasting URLs into the map to create a new topic
2016-09-22 09:16:03 +08:00
Connor Turland
2219e0d0dd Update Metamaps.Topic.js 2016-09-21 14:53:17 -04:00
Devin Howard
8b19c9e340 automatic versioning via git (#621) 2016-09-21 13:24:14 -04:00
Devin Howard
3843cab643 rails 5 + api v2 + raml api docs (#593)
* update Gemfile to rails 5 and ruby 2.3.0

* fiddle with javascripts and add sprockets manifest file

* update config directory for rails 5

* fix some errors with controllers/serializers

* fix travis and rspec

* new serializers renamed to serializers

* module Api::V1

* reusable embedding code

* add index/collections/paging. overriding most of snorlax now |:)

* raml api documentation + rspec tests to verify schemas/examples

* add sorting by ?sort and searching by ?q. Add pagination Link headers

* api v1 => v2

* fill out synapse api

* alphabetize map policy

* fix page thing

* fill out maps api

* formParameters => properties, and fiddle with map api

* more raml 1.0 stuff i'm learning about

* deprecate v1 api

* rails 5 uses ApplicationRecord class for app-wide model config

* Update topic spec for api v2

* workaround for user_preference.rb issue

* get ready for token api docs. also TODO is mapping api docs

* spec out mapping api

* map/mapping/synapse spec, plus other bugs

* awesome, token specs/apis are done

* add sanity checks to the api tests

* more cleanup

* devise fix

* fix starred map error
2016-09-21 13:22:40 -04:00
Devin Howard
1efd78ad7b initial attempt at focussing input field when entering multiple topics 2016-09-21 14:27:49 +08:00
Devin Howard
49084b98dd omg import bookmarks 😍 2016-09-21 10:48:47 +08:00
Devin Howard
fac59f346f fix topic init function 2016-09-21 10:24:57 +08:00
Devin Howard
ec96d69876 refactor import view:
-Paste Input wrapper class to abstract away getting input
-Add ability to drop files in PasteInput
-Add ability to drop .webloc files or paste a link to create a new topic with that link in the link and desc fields
2016-09-21 10:11:08 +08:00
Devin Howard
9515152315 move auto layout function into its own file 2016-09-21 10:10:08 +08:00
Connor Turland
aace6796f5 allow topic carousel to be pinned open (#643)
* so that rapid topic creation can happen in succession

* close when map closes
2016-09-19 20:30:34 -04:00
Connor Turland
61e27a4dcb height shouldn't stay hard set. fixes 622 2016-09-17 23:45:04 +00:00
Connor Turland
823c0c5990 no room is created if anon user (#642) 2016-09-17 15:06:54 -04:00
Connor Turland
698adf69cd Update README.md 2016-09-17 14:55:23 -04:00
Devin Howard
cd31452c79 update readme (#575)
* update readme

* remove google plus
2016-09-17 14:54:44 -04:00
Devin Howard
ca74e8c5fc Merge pull request #641 from metamaps/fix/get-siblings-by-type
Get siblings by metacode type returns only topics with that metacode - fix #538
2016-09-17 20:57:48 +08:00
Devin Howard
d1c390636a Get siblings by metacode type returns only topics with that metacode - fix #538 2016-09-17 17:12:39 +08:00
Devin Howard
4723c62b20 fix password reset error 2016-09-15 07:18:15 +08:00
Devin Howard
4bbb9df5af can't use ` with uglify 2016-09-14 10:45:42 +08:00
Devin Howard
40cb7606e3 enable metamaps.debug whoops 2016-09-13 15:21:00 +08:00
Devin Howard
0b64b6371f fix pull changes docs 2016-09-13 15:19:01 +08:00
Devin Howard
eaffc346fd v2.9.1 2016-09-13 14:30:09 +08:00
Connor Turland
6b2887e8da namespace the event listeners to turn them off (#637) 2016-09-11 18:47:59 -04:00
Connor Turland
4a8b017144 add nvmrc 2016-09-10 20:30:58 -04:00
Connor Turland
9070bfc836 use a subset of the simplest metacodes for new users (#633)
* use a subset of the simplest ones for new users

* Update user_preference.rb

* Update user_preference.rb
2016-09-09 20:36:49 -04:00
Connor Turland
d3bc3e3d18 dont change home link in the mapper profile case 2016-09-10 00:29:10 +00:00
Connor Turland
75260496be annoying scroll issue fix (#634) 2016-09-09 17:06:05 -04:00
Devin Howard
61465ff148 Merge pull request #630 from metamaps/feature/mapping-policy
add mapping policy
2016-09-05 18:58:38 +08:00
Devin Howard
8d372f780d Merge pull request #626 from metamaps/bug/detached
shouldn't reference relatives that are connected in private ways
2016-09-05 11:58:08 +08:00
Devin Howard
3e38fba215 remove relatives1 and relatives2 2016-09-05 11:55:19 +08:00
Devin Howard
e761e1693c use Topic.relatives scope to get all relatives 2016-09-05 11:52:35 +08:00
Devin Howard
158e2d5383 add mapping policy 2016-09-05 10:47:11 +08:00
Connor Turland
7de89cfa0f shouldn't reference relatives that are connected in private ways 2016-09-02 12:37:01 -04:00
Connor Turland
4a2f3203bd Update clean.css.erb 2016-09-01 15:41:20 -04:00
Devin Howard
8a55491dab forgot last updated 2016-09-01 15:48:47 +08:00
Devin Howard
b36dc03f59 bump version to 2.9.0 2016-09-01 10:14:02 +08:00
Connor Turland
549c086af4 styleee (#620) 2016-08-31 18:57:19 -04:00
Connor Turland
19dabe81cc Enable users to star maps, and to see their starred collection (#615)
* enable starring

* users should be able to star others maps

* proper star icon

* starred maps display as starred without refreshing

* oops

* make phrasing clearer
2016-08-31 16:58:49 -04:00
Connor Turland
370499e453 avoid prompt 2016-08-30 17:00:14 -04:00
Connor Turland
d7759c8c07 Redo all of explore together in React (#617)
* unify explore in react

* no more need for manual scroll reseting

* we're not opening/closing the search anymore
2016-08-21 21:02:49 -04:00
Connor Turland
c89a6771ea Fix mapper page bugs + other things (#611)
* fix centering of explore headers

* make sure the mobile map title updates

* styling was broken on admin pages

* fixup callbacks when fetching user

* enable loading more
2016-08-17 10:00:37 -04:00
Connor Turland
4cb1dfe401 include link to create new map in mobile menu 2016-08-16 15:45:54 +00:00
Connor Turland
21e2418281 move apps header out of exploreMapsHeader 2016-08-16 15:38:05 +00:00
Connor Turland
b8c8f25c83 fixup applications page 2016-08-16 14:30:10 +00:00
Connor Turland
b58f55353a switch so that backbone router is opt-in, not opt-out (#610) 2016-08-16 10:25:07 -04:00
Devin Howard
03e98e617b fix login redirect loop - fixes #602 (#609) 2016-08-16 08:03:22 -04:00
Connor Turland
57181e208f layout tweaks (#607)
* new map creation pops to new window

* hide the search on logged out homepage

* add { }

* just writing the same code better

* remove that old code
2016-08-16 08:03:06 -04:00
Connor Turland
da30078ef4 er, we use a static/modded version of best_in_place (#608) 2016-08-15 17:01:24 -04:00
Connor Turland
5b5fc86a3b enable text overflow for title on mob (#606) 2016-08-14 12:50:44 -04:00
Devin Howard
15ca43d49f Merge pull request #601 from metamaps/fix/nil-mapping-export
I think this fixes issue #566 but I'm not sure
2016-08-14 14:14:51 +08:00
Connor Turland
0140d68e87 adjusted media query breakpoints 2016-08-14 00:31:48 +00:00
Connor Turland
d4d992a0da improve styling for mobile of map list (#605) 2016-08-13 20:10:23 -04:00
Connor Turland
34ecf4f70b enable panning (#603) 2016-08-12 11:07:59 -04:00
Devin Howard
c77e3b2da5 Merge pull request #578 from metamaps/paring.down
remove all traces of Famous and improve mobile
2016-08-12 13:42:57 +08:00
Devin Howard
6eff5e640e Metamaps.Mobile.js dependencies comment 2016-08-12 13:32:51 +08:00
Connor Turland
ceb335e728 use border radius on profile image 2016-08-12 05:09:10 +00:00
Connor Turland
dc60c3f3ed add profile image and fix exploreMaps bar 2016-08-12 05:03:28 +00:00
Devin Howard
796f4d57a1 I think this fixes issue #566 but I'm not sure 2016-08-12 12:39:30 +08:00
Connor Turland
b4c75649ba all teh mobile things 2016-08-12 04:04:18 +00:00
Devin Howard
f4eb9250ad npm update 2016-08-12 10:51:14 +08:00
Connor Turland
449c2084bb make maps go under explore bar 2016-08-11 17:26:11 -04:00
Connor Turland
44bb0020bc Merge branch 'develop' into paring.down 2016-08-11 15:59:45 -04:00
Devin Howard
fae69133be try fixing react warnings again 2016-08-11 11:42:35 +08:00
Connor Turland
bdac00bc10 fix typo 2016-08-11 01:44:40 +00:00
Connor Turland
848bb11c08 needed to clear div switching between map view and topic view 2016-08-10 18:37:26 +00:00
Connor Turland
d5cec3844b make sure toast hides again 2016-08-10 18:08:48 +00:00
Connor Turland
a3f1d51bc6 make the toast work 2016-08-10 18:06:28 +00:00
Connor Turland
da090e60db remove homepage changes 2016-08-10 17:32:43 +00:00
Connor Turland
c308e276e8 Merge branch 'develop' into paring.down 2016-08-10 17:16:33 +00:00
Devin Howard
63b528c8bf don't import into textarea elements either - fix #579 (#598) 2016-08-10 13:14:33 -04:00
Devin Howard
9db5ce551e inject NODE_ENV into webpack - probably fixes #595 (#599) 2016-08-10 13:13:54 -04:00
Connor Turland
f71d552504 Merge branch 'develop' into paring.down 2016-08-10 17:09:37 +00:00
Devin Howard
beb52bc471 fix topic view keyboard shortcuts (#597)
* fix topic view selection crash on centerAndReveal

* topic view shortcuts switch to Alt

* change delete behaviour to be smarter

* fetchRelatives recursively handles arrays

* update topic url and Metamaps.Active.Topic when you center

* make heroku work 4 realz
2016-08-09 11:53:50 -04:00
Devin Howard
4478ca43b8 Merge pull request #594 from metamaps/feature/fix-heroku
multi-buildpack setup for heroku:
2016-08-09 20:35:06 +08:00
Devin Howard
b9247d2692 multi-buildpack setup for heroku:
$ heroku buildpacks:set https://github.com/heroku/heroku-buildpack-multi.git

will set it up
2016-08-09 13:49:38 +08:00
Devin Howard
3b24165fd0 Merge pull request #589 from metamaps/feature/topicview-remove-topics
enable removal of topics from topic view - fixes #467
2016-08-08 21:46:15 +08:00
Devin Howard
9cedf69432 fetch siblings & center topic keyboard shortcuts - fixes #466 (#588)
* fetch siblings & center topic keyboard shortcuts - fixes #466

* add keyboard shortcut labels

* update keyboard shortcuts to Ctrl+E, Ctrl+R, and Ctrl+T, and update docs

* zoom extents back to Ctrl+E and use e.preventDefault
2016-08-08 21:46:05 +08:00
Devin Howard
3050f1413a Merge pull request #587 from metamaps/feature/topicview-selection-box
fix selection box on radial view - fix #463
2016-08-08 21:43:22 +08:00
Devin Howard
5510cb2e99 enable removal of topics from topic view - fixes #467 2016-08-08 21:40:55 +08:00
Devin Howard
3b65ad923b only show travis build status badge for develop branch 2016-08-07 21:26:53 +08:00
Devin Howard
713063e578 fix npm testing script - it will actually break travis now 2016-08-07 20:00:44 +08:00
Devin Howard
b66b75615a remove frontend folder reference from travis 2016-08-07 19:45:11 +08:00
Devin Howard
77e8716588 Merge branch 'master' into develop 2016-08-07 17:23:57 +08:00
Devin Howard
fcc1dbdd11 Merge pull request #592 from metamaps/fix/synapse-import
fix: synapse import fails if synapses are missing desc
2016-08-07 17:21:21 +08:00
Devin Howard
23543ac7ad fix: synapse import fails if synapses are missing desc 2016-08-07 17:18:54 +08:00
Devin Howard
d778016571 fix selection box on radial view - fix #463 2016-08-07 13:17:25 +08:00
Devin Howard
00c54b7d66 fix another react bug 2016-08-05 10:54:18 +08:00
Devin Howard
980fca9844 remove spread syntax 2016-08-05 10:54:17 +08:00
Devin Howard
2274155801 split out a separate MapLink component for code reuse 2016-08-04 13:58:59 -04:00
Devin Howard
1774f8c530 object destructure + let/const 2016-08-04 13:58:59 -04:00
Devin Howard
2b2f6e6dc4 add propTypes 2016-08-04 13:58:59 -04:00
Connor Turland
17da8441f4 fixup react setup 2016-08-04 13:58:59 -04:00
Connor Turland
4005b301ac uncomment commented header lines 2016-08-04 13:58:59 -04:00
Connor Turland
804afc3e1d remove famous leftovers 2016-08-04 13:58:59 -04:00
Connor Turland
ede1dfb91c made the header more generic to serve other functions 2016-08-04 13:58:59 -04:00
Connor Turland
30e9a27663 almost rid of famous completely 2016-08-04 13:58:06 -04:00
Connor Turland
aed423214f started using react instead of famous 2016-08-04 13:57:35 -04:00
Connor Turland
6b2386a545 progress onthe home page 2016-08-04 13:56:39 -04:00
Connor Turland
293e68da05 remove old stuff 2016-08-04 13:56:39 -04:00
Devin Howard
a6951920eb fix module.exports javascript bug 2016-08-04 17:08:10 +08:00
Devin Howard
69bdb0bf01 hotfix master with mappable_policy.try 2016-08-04 17:04:01 +08:00
Devin Howard
194a4dc975 add production schema file 2016-08-04 16:53:09 +08:00
Devin Howard
52cbd57367 Merge pull request #586 from metamaps/merge/master-into-develop
merge master into develop
2016-08-04 10:53:00 +08:00
Devin Howard
6df8da16bc Merge branch 'master' into develop 2016-08-04 10:51:36 +08:00
Devin Howard
dc725c3b9a Merge pull request #583 from metamaps/fix/purple-metacodes
attempt to fix purple metacodes (#527)
2016-08-04 10:16:04 +08:00
Devin Howard
17a9a2d23a fix jquery error and move package.json etc to root dir 2016-08-03 22:40:14 +08:00
Devin Howard
6eff2d91c9 fix backbone jquery 2016-08-03 21:25:44 +08:00
Devin Howard
720f67cee7 move metacode loading earlier, and add a query string to work around amazon aws CORS issues 2016-08-03 08:54:10 +08:00
Devin Howard
6997142fd9 finish integrating npm. move underscore/backbone into npm management (#577)
* finish integrating npm. move underscore/backbone into npm management

* update docs for npm integration

* allow jsx or js extension

* change underscore version
2016-08-01 15:59:53 -04:00
Devin Howard
e6954eb37a Merge pull request #574 from metamaps/fix/synapse-search-duplicates
fix synapse autocomplete duplicates
2016-08-01 08:56:55 +08:00
Devin Howard
70a4f54399 switch to ruby 2.3.0 (#572) 2016-08-01 08:33:45 +08:00
Devin Howard
5fe03641cb move frontend code into a folder, and setup react build tooling with es6 transforms (#576) 2016-07-31 14:51:06 -04:00
Devin Howard
4161f70d2e remove duplicates from synapse search
there were 2 issues. one is synapses with leading/trailing whitespace. I've run a script on production to strip existing leading/trailing whitespace from synapse descs.

The second issue was that this code wasn't actually modifying the @synapses array, and collectedDesc wasn't doing anything. So this new line will be more effective.
2016-07-31 19:31:31 +08:00
Devin Howard
7d4da81272 Update code style automatically using rubocop gem (#563)
* install rubocop

* 1961 automatic rubocop fixes

* update rubocop.yml to ignore half of the remaining cops

* rubocop lint warnings

* random other warnings fixed
2016-07-26 08:14:23 +08:00
Devin Howard
17bccd809a Merge pull request #568 from metamaps/fix/import-export
use Wildcard if no metacode
2016-07-26 08:05:00 +08:00
Devin Howard
e5c9af8f95 use Wildcard if no metacode 2016-07-24 13:43:12 +08:00
Devin Howard
27942546b8 fix 2 bugs on develop (#565)
* fix js bug

* if mappable is nil it causes an error
2016-07-02 16:32:02 +08:00
Devin Howard
872ae90832 submit new map form on Enter - fixes #555 (#562)
* submit new map form on Enter - fixes #555

* update divs too
2016-07-01 16:48:38 +08:00
Devin Howard
6c22ebcc51 have policy_scope always use scope.all or something else to ensure it's an ActiveRecord relation 2016-06-28 14:49:46 +08:00
Devin Howard
b72536853f fix activemaps_path url bug (#559)
* fix activemaps_path url bug

* annoying doc updates

* skip policy scope if redirecting an explore page

* lol that would have been dumb
2016-06-20 08:32:39 +08:00
Devin Howard
f5912d511d fix activemaps_path url bug (#559)
* fix activemaps_path url bug

* annoying doc updates

* skip policy scope if redirecting an explore page

* lol that would have been dumb
2016-06-20 08:31:32 +08:00
Devin Howard
6e1797183e brakeman (#556)
* update rails to 4.2.5.1

* fix brakeman gem warning

* make brakeman happier and add it to travis

* install brakeman gem for static security analysis

* fix brakeman call in travis
2016-06-16 15:44:08 +08:00
Devin Howard
97e9f999d9 Merge branch 'master' into develop 2016-06-16 15:43:30 +08:00
Devin Howard
1f9078638e fix truncate bug when map desc is nil (#557) 2016-06-16 15:42:43 +08:00
Devin Howard
5cf3416dc6 Merge pull request #558 from metamaps/fix/truncate-bug
merge truncate fix + master into develop
2016-06-16 15:42:36 +08:00
Devin Howard
2989406954 fix truncate bug when map desc is nil 2016-06-15 12:17:32 +08:00
Devin Howard
b0860ef670 Merge branch 'develop' 2016-06-08 12:47:26 +08:00
Devin Howard
1d12aed3eb switch to dotenv-rails 2016-06-07 12:55:49 +08:00
Devin Howard
11f921b058 remove secret key from source control - fixme on production.
This will expire all cookies, but make our install more secure from
hackers who know their way around Github
2016-06-07 12:54:55 +08:00
Connor Turland
c08868a5c1 user presence event (#552) 2016-04-26 08:08:12 -04:00
Devin Howard
45adda93b1 set up scaffolding for js tests (#553) 2016-04-26 10:22:32 +08:00
Connor Turland
2a3fa80540 wording needed updating 2016-04-24 12:15:40 -04:00
Connor Turland
8c51108a0c enable shared private and public maps (#530)
* enable shared private and public maps

* change the list

* yeehaw add collaborators

* I believe this fixes the error connor brought up

* when topic or synapse is no longer on a map, don't defer

* needs to be before?

* just do it in the controller

* make recommendation they sign in and retry

* better email

* config for mailer previews

* improve wording

* shouldn't have included that

* switch to green

* don't execute if there's no map

* wasn't including the right people in some circumstances

* Finish breaking out JS files (#551)

* metamaps.Realtime refactor

* Metamaps.Util

* Metamaps.Visualize

* Metamaps.SynapseCard

* Metamaps.TopicCard

* Metamaps.Create.js

* Remove erb extension from Metamaps.Map.js

* Metmaps.Account and Metamaps.GlobalUI remove extension

* Metamaps.JIT no more erb extension

* move Backbone.init; standard-format on Metamaps.js.erb

* factor out canvas support check function

* some llittle template bugs

* remove featured from signed in explore maps bar

* don't let it overflow off the page
2016-04-24 11:50:35 -04:00
Devin Howard
44ae6730a6 fix user search error 2016-04-21 00:30:11 -04:00
Devin Howard
437c73b0fe Merge develop 2016-04-20 11:25:59 +08:00
Devin Howard
e569a0376d Merge pull request #548 from metamaps/feature/refactor-javascript
split out all javascript files
2016-04-20 11:24:20 +08:00
Devin Howard
af4a958f59 Merge pull request #549 from metamaps/fix/map-fork
fix map forking (fix #540)
2016-04-20 09:36:52 +08:00
Devin Howard
da0da1a117 Merge pull request #546 from metamaps/feature/exception-notification
slack exception notifications
2016-04-20 09:06:42 +08:00
Devin Howard
837e4bde1b fix map forking (fix #540) 2016-04-20 09:00:45 +08:00
Devin Howard
5a60135392 Merge branch 'develop' 2016-04-15 11:51:40 +08:00
Devin Howard
c1d963d669 remove .erb from files that don't need it 2016-04-15 09:18:17 +08:00
Devin Howard
8bb96d12a6 Metamaps.Control 2016-04-15 09:13:01 +08:00
Devin Howard
6a8921ae6d standard-format Metamaps.JIT.js.erb 2016-04-15 09:13:01 +08:00
Devin Howard
074eaf0bd3 alphabetize dependecies 2016-04-15 09:13:01 +08:00
Devin Howard
324719e531 Metamaps.Filter 2016-04-15 09:13:01 +08:00
Devin Howard
b10f0cef0e Metamaps.Listeners.js.erb 2016-04-15 09:13:01 +08:00
Devin Howard
a5bd0440a8 Metamaps.Organize 2016-04-15 09:13:01 +08:00
Devin Howard
ca5928113d whoops don't forget standard format 2016-04-15 09:13:01 +08:00
Devin Howard
de62a08307 Metamaps.Topic 2016-04-15 09:13:01 +08:00
Devin Howard
4833dd8da6 Metamaps.Synapse 2016-04-15 09:13:01 +08:00
Devin Howard
11a87582c7 Metamaps.Map 2016-04-15 09:13:01 +08:00
Devin Howard
13d6ab56e5 factor out two more small view modules 2016-04-15 09:13:01 +08:00
Connor Turland
7bb7f345f1 added an event for conversations starting (#547)
* added an event for conversations starting

* switch to post
2016-04-14 14:35:28 -04:00
Devin Howard
317f0c245e Merge pull request #545 from metamaps/feature/refactor-javascript
JS refactoring part 1 of many!
2016-04-14 12:35:21 +08:00
Devin Howard
fb80f56a7d slack exception notifications 2016-04-13 17:20:01 +08:00
Devin Howard
134d4171f8 alphabetize gemfile 2016-04-13 17:07:23 +08:00
Devin Howard
6653d10edf Debug gets a header. Still need to parse through Metamaps, Metamaps.GlobalUI, and Metamaps.JIT 2016-04-13 16:06:01 +08:00
Devin Howard
be99ad8285 factor out Metamaps.Admin 2016-04-13 16:04:15 +08:00
Devin Howard
799f6e4623 Metamaps.Router standard style 2016-04-13 15:58:54 +08:00
Devin Howard
df9c0a93bc Metamaps.Views standard style 2016-04-13 15:58:54 +08:00
Devin Howard
e8c55df4e8 Metamaps.Backbone standard style 2016-04-13 15:58:54 +08:00
Devin Howard
5a3ab025b7 Metamaps.Import standard style 2016-04-13 15:58:54 +08:00
Devin Howard
031e35e50c Merge branch 'develop' 2016-04-13 10:53:46 +08:00
Devin Howard
d2d67d5d6c Merge pull request #544 from metamaps/fix/versioncode
quick fix to version code code
2016-04-13 10:53:31 +08:00
Devin Howard
e6c4313184 reindent upperelements template + fix input tag 2016-04-13 10:50:51 +08:00
Devin Howard
a2ce20b564 versioncode fix 2016-04-13 10:48:34 +08:00
Devin Howard
bd1e1ffe81 ruby gemset 2016-04-13 10:32:34 +08:00
Devin Howard
3040c004f0 ruby gemset 2016-04-13 10:32:27 +08:00
Devin Howard
0de7333d6a Merge branch 'develop' 2016-04-13 10:26:01 +08:00
Devin Howard
5ed1fd3156 v2.8.4 2016-04-13 10:19:35 +08:00
Devin Howard
0a9a1c27d8 Merge pull request #543 from metamaps/feature/rename-repo
rename repo
2016-04-13 10:17:30 +08:00
Devin Howard
c9bba0cdb2 rename repo 2016-04-13 10:16:54 +08:00
Devin Howard
6659a97f28 Merge pull request #536 from metamaps/feature/metamaps.debug
metamaps.debug function, and move VERSION into a rails constant initializer.
2016-04-13 10:14:23 +08:00
Devin Howard
fd9c27c631 Merge pull request #535 from metamaps/feature/cors
add rack-cors; fix #531
2016-04-13 10:13:16 +08:00
Devin Howard
e27d64e643 only allow cors on api routes 2016-04-06 20:09:25 +08:00
Devin Howard
2e6f04d0be metamaps.debug function, and move VERSION into a rails constant initializer.
from this commit on, we would need to modify config/initializers/version.rb to increment the version number.
2016-04-06 10:27:31 +08:00
Devin Howard
a8d0d9da09 2.8.3:
- add Junto sounds
- fix json import
- fix invite link
2016-04-06 10:06:37 +08:00
Devin Howard
7de642ccb2 add rack-cors; fix #531 2016-04-05 10:12:12 +08:00
Connor Turland
8a6d434fc3 Junto Sounds
* awesome news sounnndzzzz

* prevent double sound

* bug fixes and chat sounds on by default
2016-04-04 10:50:02 -04:00
Devin Howard
f21a3d114f Merge pull request #529 from metamaps/fix/import-fixes
fix json import
2016-04-01 13:37:43 +08:00
Devin Howard
7eb8ae37ee Merge pull request #526 from metamaps/fix/invite-link
fix invite link
2016-04-01 13:37:33 +08:00
Devin Howard
7d6acb7014 fix json import 2016-03-31 13:03:14 +08:00
Devin Howard
a83382efe9 Merge branch 'develop'
v2.8.2 - fixes import code
2016-03-31 10:11:49 +08:00
Devin Howard
b9b9e57c41 Merge pull request #528 from metamaps/fix/import-fixes
import fixes
2016-03-31 10:04:33 +08:00
Devin Howard
ccd07ddd19 import fixes 2016-03-31 09:25:14 +08:00
Devin Howard
a2fe1399e4 fix invite link 2016-03-29 22:34:47 +08:00
Devin Howard
c1aa7c6a92 Merge pull request #523 from metamaps/feature/production-deploy-steps
add production deploy/update steps (see issue #518)
2016-03-29 10:00:00 +08:00
Devin Howard
da25dd0d9c add production deploy/update steps (see issue #518) 2016-03-28 10:38:24 +08:00
Raymon Johnstone
b2a4cbf3ec Merge pull request #522 from Tadasu85/master
Merge pull request #1 from metamaps/master
2016-03-27 18:09:16 -04:00
Connor Turland
e1c0509c91 Merge pull request #520 from metamaps/develop
fix request invite
2016-03-27 12:12:26 -07:00
Connor Turland
3c03d30c08 Merge pull request #519 from metamaps/bug/requestinvite
request invite page was broken
2016-03-27 12:11:21 -07:00
Connor Turland
8fa856451d request invite page was broken 2016-03-27 12:04:28 -07:00
Connor Turland
fbba487b83 Merge pull request #482 from metamaps/develop
merge develop into master (version 2.8!)
2016-03-27 00:43:54 -07:00
Devin Howard
8a6e702c12 fix js error 2016-03-27 15:32:18 +08:00
Devin Howard
dae3106b34 Merge pull request #509 from metamaps/feature/import.export
import/export tweaks
2016-03-27 15:22:17 +08:00
Connor Turland
49f4b2030e gemfile.lock needed to change for travis to be happy 2016-03-27 00:21:32 -07:00
Devin Howard
30d327f07a solution using backbone events instead of setTimeout 2016-03-27 15:20:09 +08:00
Connor Turland
a82b0048d8 don't need sequenced 2016-03-27 00:14:22 -07:00
Devin Howard
f9e6249615 Fix up import - want more backboney event listening though 2016-03-27 15:09:08 +08:00
Connor Turland
e4145ef9fb Merge pull request #506 from metamaps/feature/import.export
minimal import/export - could go in v2.8 for the keeners
2016-03-26 23:46:28 -07:00
Devin Howard
ae9f4a51a2 fix a few embarassing errors - export is working 2016-03-26 15:53:14 +08:00
Devin Howard
53867caae8 allow JSON or TSV parsing 2016-03-26 15:03:44 +08:00
Devin Howard
92f78aa56a update tsv code to handle new export code at the very least.
next step will be allowing json input too
2016-03-26 12:49:26 +08:00
Devin Howard
d3649f1d26 DRY map exporting with policy_scoping 2016-03-26 12:46:43 +08:00
Devin Howard
14bdc8546b metacodes#show routes 2016-03-26 10:12:32 +08:00
Devin Howard
579ddcc047 Merge pull request #505 from metamaps/fix/crappy-export
add missing synapses_csv function (fixes #504)
2016-03-25 16:55:05 +08:00
Devin Howard
387c863222 fix a bug with synapses and use cid to link new topics with synapses
Synapses are now created client-side, but still rejected server-side
2016-03-25 16:48:14 +08:00
Devin Howard
c77cc32734 import fixes
- better abort logic & messaging
 - handle \r line delim
 - better example format at top
2016-03-25 16:48:14 +08:00
Devin Howard
ea677f8a6b DRY up csv/xls rendering, put it into model 2016-03-25 16:48:14 +08:00
Devin Howard
8f532708ce update xls/csv format to better serialize topics and synapses 2016-03-25 16:47:35 +08:00
Devin Howard
61262aaec2 implement csv/xls export 2016-03-25 16:47:35 +08:00
Devin Howard
0c1e12a301 use state machine to implement smarter topic/synapse import
also include better auto-layout of new topics if x/y not specified
2016-03-25 16:46:05 +08:00
Devin Howard
b47ed7b5b4 don't ask about adding 0 topics 2016-03-25 16:46:05 +08:00
Devin Howard
6df7fa849a bare minimum topic import functionality - use by Ctrl+V onto the map canvas itself 2016-03-25 16:46:05 +08:00
Devin Howard
6c055ea3b9 add missing synapses_csv function (fixes #504) 2016-03-25 16:36:05 +08:00
Connor Turland
87d6dfe8de fix the autocomplete 2016-03-24 23:36:57 -07:00
Connor Turland
b36d5df6cb this may make it work 2016-03-24 23:33:26 -07:00
Connor Turland
c6f1e3cc4a breaking the mapping_policy 2016-03-24 23:29:08 -07:00
Connor Turland
fc1dc591f3 Merge branch 'copy/version.and.peers' into develop 2016-03-24 21:28:24 -07:00
Connor Turland
415c9b8ac3 final touchups on oauth 2016-03-24 21:26:07 -07:00
Connor Turland
540b35c757 Merge branch 'feature/no-cancancan' into develop 2016-03-24 20:47:35 -07:00
Connor Turland
42eea78bc4 Merge branch 'fix/typo' into develop 2016-03-24 20:47:23 -07:00
Devin Howard
530a16cadb instantiate_resource 2016-03-25 10:26:32 +08:00
Devin Howard
34d3a80db1 use new pundit-enabled snorlax 2016-03-25 10:07:57 +08:00
Connor Turland
14dfe3c926 styling for doorkeeper and api functional 2016-03-24 17:16:27 -07:00
Raymon Johnstone
e23224aa16 Merge pull request #1 from metamaps/master
Syncing
2016-03-23 22:51:42 -04:00
Connor Turland
5317711b57 Merge branch 'develop' into oauth.provider 2016-03-23 18:00:59 -07:00
Connor Turland
b6fac7d49b Merge pull request #420 from metamaps/feature/realtime.video
JUUUUUUUUNTOOOO
2016-03-23 17:46:35 -07:00
Connor Turland
70bc0959b0 update version, date, and peers 2016-03-23 16:52:53 -07:00
Connor Turland
c4890274f2 switch messages to use pundit 2016-03-23 16:29:26 -07:00
Connor Turland
baa5439f0f auto position videos which haven't been manually positioned 2016-03-23 16:12:23 -07:00
Devin Howard
3bb3fa9e73 Merge pull request #493 from metamaps/feature/icon-tests
metacode icon tests
2016-03-22 14:22:05 +08:00
Devin Howard
b305584d5d Merge pull request #490 from metamaps/feature/call-for-developers
call for developers in Inspect Element window
2016-03-22 14:21:52 +08:00
Devin Howard
cb4137c13f Merge pull request #491 from metamaps/feature/rails-intro
add rails intro for newcomers
2016-03-22 14:21:38 +08:00
Connor Turland
617dec72b9 hide sound option. green 'in call' dot. tooltip 2016-03-21 13:08:34 -07:00
Connor Turland
e6ac4b1dcb make metamaps an oauth provider 2016-03-19 13:28:55 +11:00
Devin Howard
0c3010be90 Small revisions to rails intro 2016-03-16 11:45:12 +08:00
Devin Howard
a0d38c8fb8 check https manual icons 2016-03-16 11:42:51 +08:00
Devin Howard
8b54e53743 metacode icon tests 2016-03-16 11:39:24 +08:00
Devin Howard
5ea61341eb add rails intro for newcomers 2016-03-15 16:16:19 +08:00
Devin Howard
756fe75664 call for developers in Inspect Element window 2016-03-15 16:06:37 +08:00
Connor Turland
f055f4c7c5 Merge branch 'develop' into feature/realtime.video 2016-03-14 21:45:36 +11:00
Connor Turland
ac9460be77 do still need cancan 2016-03-14 21:44:50 +11:00
Connor Turland
1ee33b843f Merge branch 'develop' into feature/realtime.video 2016-03-14 21:40:25 +11:00
Connor Turland
3e24a088da Merge branch 'develop' of github.com:metamaps/metamaps_gen002 into develop 2016-03-14 21:36:57 +11:00
Connor Turland
8bd032472d topic related things weren't working at all 2016-03-14 21:36:34 +11:00
Connor Turland
f24def8be6 fix up javascript errors 2016-03-14 21:36:16 +11:00
Connor Turland
10a5a099e7 Merge pull request #489 from metamaps/feature/fix-tests
fix tests
2016-03-14 18:17:25 +11:00
Devin Howard
5cb5eac9d6 Merge pull request #488 from metamaps/feature/no-cancan
no cancan
2016-03-14 14:44:35 +08:00
Devin Howard
a05c7dc5fe avoid pundit error if no map specified with a mapping 2016-03-14 14:37:01 +08:00
Devin Howard
d11f3923dd remove unused has_viewable_synapses function 2016-03-14 14:34:36 +08:00
Devin Howard
32326ff4af update map/topic delete action test 2016-03-14 11:47:01 +08:00
Devin Howard
7716462c8f fix topics controller test 2016-03-14 11:47:01 +08:00
Devin Howard
ee0ca3ba35 Merge pull request #487 from metamaps/feature/pundit
policy specs & remove old permission tests
2016-03-14 11:46:09 +08:00
Devin Howard
f7201e048e pending mapping policy 2016-03-14 11:15:10 +08:00
Devin Howard
3823c708fd update mapping policy 2016-03-14 11:09:27 +08:00
Devin Howard
c5009952f3 remove permissions tests 2016-03-14 11:03:30 +08:00
Devin Howard
dbb8052a17 trifecta of policy tests 2016-03-14 11:01:29 +08:00
Devin Howard
88c070cbbd no cancan 2016-03-14 10:55:26 +08:00
Connor Turland
8664cc0bd9 Merge branch 'develop' into feature/realtime.video 2016-03-14 11:11:11 +11:00
Connor Turland
579c36ec75 ensure the search box opens 2016-03-14 11:10:18 +11:00
Connor Turland
6715ba7e7f not a function 2016-03-14 11:03:11 +11:00
Connor Turland
604087c592 Merge branch 'develop' into feature/realtime.video 2016-03-14 10:45:16 +11:00
Connor Turland
6f5258cbb7 needed a policy for tokens 2016-03-14 08:19:26 +11:00
Connor Turland
b40fedda1a Merge pull request #483 from harlantwood/travis
Run tests on Travis CI; show build status badge
2016-03-14 07:54:20 +11:00
Connor Turland
e0b2991596 Merge pull request #484 from harlantwood/token-entropy
more token entropy
2016-03-14 07:51:37 +11:00
Harlan T Wood
f3eb558971 fix test regex 2016-03-13 13:28:07 -07:00
Harlan T Wood
3fbb3d1dc9 more token entropy 2016-03-13 00:56:10 -08:00
Harlan T Wood
74cf9ba717 Run tests on Travis CI; show build status badge 2016-03-12 19:40:56 -08:00
Connor Turland
4f76d3914d Merge pull request #418 from metamaps/feature/slack
first 2 slack events
2016-03-13 12:00:17 +11:00
Connor Turland
72b2e8f8f2 doesn't look good for now, take it out, add it later 2016-03-13 11:58:09 +11:00
Connor Turland
77d69dd2a3 turns out we do need delayed_job 2016-03-13 11:56:18 +11:00
Connor Turland
fe578ca3b2 add migrations 2016-03-13 11:24:00 +11:00
Connor Turland
d863d1c15b remove traces of delayed_job 2016-03-13 10:42:55 +11:00
Connor Turland
11e57c1b37 rebase onto develop which now has API and pundit 2016-03-13 10:36:38 +11:00
Connor Turland
5fbf7ac34d hide metamaps_mobile in gitignore 2016-03-13 03:16:31 +11:00
Connor Turland
b236f4c689 handle not logged in scenarios 2016-03-13 02:41:32 +11:00
Connor Turland
7ff24fb3b6 Merge pull request #481 from metamaps/feature/api
quietly release a token based metamaps api just for maps, topics, synapses, and mappings
2016-03-13 02:29:44 +11:00
Connor Turland
3aec00e07c just don't include mappable for now 2016-03-13 02:28:39 +11:00
Connor Turland
f072e39c4c pundit: sometimes no user 2016-03-13 02:27:05 +11:00
Connor Turland
ada29c6832 cleanup 2016-03-12 21:35:56 +11:00
Connor Turland
efe13dc7c0 Merge branch 'develop' into feature/api 2016-03-12 21:30:27 +11:00
Connor Turland
f58185fd40 Merge branch 'feature/pundit' into develop 2016-03-12 21:26:06 +11:00
Connor Turland
446619c451 omg not having this was breaking things 2016-03-12 13:20:15 +11:00
Connor Turland
8b8db40c67 Merge branch 'feature/pundit' into feature/api 2016-03-12 12:59:42 +11:00
Connor Turland
a295c61322 json response was broken 2016-03-12 12:58:13 +11:00
Connor Turland
e4ac5b0134 Merge branch 'feature/pundit' into feature/api 2016-03-12 12:40:11 +11:00
Devin Howard
7e7ef173e5 map policy spec 2016-03-12 09:27:31 +08:00
Connor Turland
bf4fbbeb06 fix tokens 2016-03-12 12:26:23 +11:00
Devin Howard
bb03b49d80 update main controller (searching) to use policies 2016-03-12 09:09:41 +08:00
Connor Turland
521aa6b5d0 function no longer exists 2016-03-12 11:58:26 +11:00
Connor Turland
7f86810f62 remove things again not needed 2016-03-12 11:53:12 +11:00
Connor Turland
a78312f90c Merge branch 'feature/pundit' into feature/api.pundit 2016-03-12 11:49:41 +11:00
Connor Turland
bc505a1361 pundit: now updating maps actually works 2016-03-12 11:47:40 +11:00
Connor Turland
5d179ae5ec pundit: policy didn't exist 2016-03-12 11:47:32 +11:00
Connor Turland
d0aecc0b31 pundit: make it work 2016-03-12 11:47:24 +11:00
Connor Turland
dc6ccd2022 pundit: fixing up topics and synapses 2016-03-12 11:47:05 +11:00
Connor Turland
1cf3182e75 pundit: exclude topic action 2016-03-12 11:46:52 +11:00
Connor Turland
bd3afff069 pundit: fix queries 2016-03-12 11:46:31 +11:00
Connor Turland
5f3f5212c5 pundit: syntax error 2016-03-12 11:46:18 +11:00
Connor Turland
2d53922f1c can load maps 2016-03-12 11:46:01 +11:00
Connor Turland
d8c328468e changess for pundit 2016-03-12 11:45:39 +11:00
Connor Turland
d0fd676aa0 pundit: now updating maps actually works 2016-03-12 11:35:03 +11:00
Connor Turland
fdd9351378 pundit: policy didn't exist 2016-03-12 11:24:49 +11:00
Connor Turland
cb79f2deae pundit: make it work 2016-03-12 11:16:46 +11:00
Connor Turland
4ed00240eb api: revert silly js change 2016-03-12 11:15:14 +11:00
Connor Turland
bef21341c6 pundit: fixing up topics and synapses 2016-03-12 11:10:30 +11:00
Connor Turland
09a7b336bf pundit: exclude topic action 2016-03-12 10:13:22 +11:00
Connor Turland
c7075dab48 pundit: fix queries 2016-03-12 10:10:31 +11:00
Connor Turland
0095a8daf4 pundit: syntax error 2016-03-12 10:06:00 +11:00
Connor Turland
fc1a7fd23d api: adjust serializers 2016-03-12 10:05:42 +11:00
Connor Turland
623b3c7ad7 can load maps 2016-03-12 09:54:23 +11:00
Connor Turland
77d39d6649 redid so they won't interfere 2016-03-12 09:48:07 +11:00
Connor Turland
450db5eb8d changes for pundit 2016-03-12 09:37:32 +11:00
Connor Turland
669b337d04 changes for api 2016-03-12 09:37:18 +11:00
Connor Turland
e6017c4129 Merge remote-tracking branch 'origin/feature/pundit' into feature/api.pundit 2016-03-12 07:19:19 +11:00
Devin Howard
eb56755068 implement five policies into their controllers 2016-03-11 22:10:31 +08:00
Devin Howard
7395811ba5 handle unauthorized with baaaaad 403 2016-03-11 21:35:48 +08:00
Devin Howard
73b82801cc consistent permissions 2016-03-11 21:32:18 +08:00
Devin Howard
615eaf580e mapping policy 2016-03-11 21:30:54 +08:00
Devin Howard
d8cc588efb basics of admin_override policy function 2016-03-11 21:25:24 +08:00
Connor Turland
ccfba03fdb clean up duplicate code 2016-03-11 17:26:54 +11:00
Connor Turland
059591b78b first pass at important API endpoints, token auth 2016-03-11 17:16:04 +11:00
Connor Turland
ef60aefe88 fix js bug 2016-03-11 07:59:22 +11:00
Connor Turland
616dc9ed0e messages weren't being displayed in order 2016-03-01 12:55:00 +13:00
Connor Turland
26025d6ee9 store the right number of mappers in conversation 2016-03-01 12:30:49 +13:00
Connor Turland
dd457d8362 remove npm debug 2016-03-01 12:26:09 +13:00
Connor Turland
bd5c88fb0b display initial state of call to new mapper 2016-03-01 12:25:38 +13:00
Devin Howard
2e6493fd23 Merge pull request #478 from metamaps/feature/cleanup
remove unneeded https stuff & more
2016-02-29 16:51:49 +08:00
Connor Turland
4e92d4c2c5 change video border width 2016-02-29 17:05:36 +13:00
Connor Turland
d50923b6bd fix js bug 2016-02-29 17:05:11 +13:00
Connor Turland
c6fea78054 merge develop 2016-02-29 13:58:47 +13:00
Devin Howard
e64a16f1b8 main#home view simplify for only unauthenticated users 2016-02-28 18:55:48 +08:00
Devin Howard
ef5d85c2bf before_filter => before_action 2016-02-28 17:48:35 +08:00
Devin Howard
36c5ddab1f before_filter => before_action 2016-02-28 17:48:18 +08:00
Devin Howard
155eac41d8 @ symbols unneeded 2016-02-28 17:24:00 +08:00
Devin Howard
895b872bda remove unneeded https stuff 2016-02-28 17:15:09 +08:00
Devin Howard
25774d9f16 remove unneeded https stuff 2016-02-28 16:57:25 +08:00
Devin Howard
cbb6b648be implement main_policy (headless). also remove all @current references 2016-02-28 16:53:59 +08:00
Devin Howard
3ed6ffbdba @record/@user in topic/synapse policy 2016-02-28 13:29:33 +08:00
Devin Howard
1e01ff8bc9 map policy 2016-02-28 13:28:28 +08:00
Devin Howard
cec6d3bfcd handle pundit errors with http 403 2016-02-28 13:24:55 +08:00
Devin Howard
bc7db85c8c update map index views 2016-02-28 13:14:34 +08:00
Devin Howard
bbc36de628 update maps spec 2016-02-28 12:30:41 +08:00
Devin Howard
8ef847bd6d factor maps#index into 4 separate functions 2016-02-28 12:30:41 +08:00
Devin Howard
baca4aac83 synapse policy 2016-02-28 12:30:41 +08:00
Devin Howard
52facb9c1d topic policy 2016-02-28 12:30:41 +08:00
Devin Howard
66f1d2ec0b install pundit 2016-02-28 12:30:41 +08:00
Devin Howard
8916ff20b6 Merge pull request #477 from metamaps/feature/metacode-icon-on-aws
metacode icons on aws (fixes #445)
2016-02-28 12:19:00 +08:00
Devin Howard
ba1427af45 update rspec for metacodes 2016-02-26 14:20:14 +08:00
Devin Howard
ac1d4f70b6 show old image on metacode edit form; tweak css of admin area 2016-02-26 14:06:37 +08:00
Connor Turland
f9b23499dc styling. add self to participants 2016-02-26 12:43:27 +13:00
Devin Howard
40cd1ebb5c modify metacodes to instead have two fields, and validate that only one is present. Manual icons can be entered through rake tasks or on the rails console or in db seed 2016-02-25 14:49:48 +08:00
Devin Howard
941b37b8e2 Merge pull request #476 from metamaps/feature/cleanup
cleanup some TODO items
2016-02-24 10:19:45 +08:00
Devin Howard
e1b2ddde7d add another TODO... 2016-02-23 19:04:39 +08:00
Devin Howard
09ceb8ceec move 4 global variables into Metamaps namespace 2016-02-23 19:04:30 +08:00
Devin Howard
59f84cfe20 cleanup TODO lines 2016-02-23 18:59:45 +08:00
Devin Howard
7a74668c8d tweaks to lightboxes view post-SSL 2016-02-23 18:56:50 +08:00
Devin Howard
295534e4ab migrate to using aws/paperclip for metacodes. RUN RAKE TASK ON PRODUCTION 2016-02-23 14:58:20 +08:00
Devin Howard
cb43ebce92 Merge pull request #474 from metamaps/feature/fix-synapse-mappings
don't need xloc or yloc for Synapse mappings
2016-02-22 12:33:05 +08:00
Devin Howard
b385efafa9 don't need xloc or yloc for Synapse mappings 2016-02-21 17:25:39 +08:00
Devin Howard
40a833b069 Merge pull request #473 from metamaps/feature/fix-invite-link
fix get_invite_link function. fixes #471
2016-02-21 15:22:34 +08:00
Devin Howard
bd6a5ee9c4 Merge pull request #472 from metamaps/feature/allow-embedding
allow embedding
2016-02-21 15:19:54 +08:00
Devin Howard
e629a9bf71 fix get_invite_link function. fixes #471 2016-02-19 18:09:46 +08:00
Devin Howard
7b9c6459e3 allow embedding 2016-02-19 09:23:39 +08:00
Devin Howard
5dc32186e8 Merge pull request #470 from metamaps/feature/remove-phantomjs
remove phantom js
2016-02-18 15:04:38 +08:00
Devin Howard
00c10c99d8 remove phantom js 2016-02-18 14:25:47 +08:00
Devin Howard
affb1672ae bite the bullet and link build icon to the jenkins job 2016-02-18 14:11:39 +08:00
Connor Turland
2f4b3b3761 call was ending in wrong situation 2016-02-17 13:49:48 +13:00
Connor Turland
d82288c9f2 fixed up call ending/starting events 2016-02-17 13:27:22 +13:00
Devin Howard
d61b6c1280 smarter db creation. don't use db:reset or db:setup.
This jenkins setup will load and migrate db without seeding.
2016-02-14 15:19:36 +08:00
Devin Howard
9ff6375e62 don't need to create synapse on canvas click 2016-02-14 15:19:36 +08:00
Devin Howard
dc1aa1e28e document synapse cancellation in cheatsheet 2016-02-14 15:19:36 +08:00
Devin Howard
9469b08ffa cancel synapse creation with esc, backspace, or delete 2016-02-14 15:19:35 +08:00
Devin Howard
056ef2b5b6 smoother synapse creation with clicks/tabs 2016-02-14 15:19:35 +08:00
Devin Howard
48863ce246 create synapse if you click away from the synapse title form 2016-02-14 15:19:35 +08:00
Devin Howard
f9bcd33344 update synapses specs; all specs pass again. all models/controllers tested 2016-02-09 14:25:39 +08:00
Devin Howard
0c81c8d9de topics controller spec 2016-02-09 13:42:24 +08:00
Devin Howard
7f50db1ae9 ok metacode spec done 2016-02-09 13:30:49 +08:00
Devin Howard
6d0dcec1ba mess with metacode tests 2016-02-09 12:43:34 +08:00
Devin Howard
f3f8bfbea8 remove map screenshot tests for now. maps controller spec passes 2016-02-09 11:59:19 +08:00
Devin Howard
43bdda61de maps controller spec passes, 3 pending 2016-02-09 11:48:07 +08:00
Devin Howard
374ac701c9 filling out map controller spec 2016-02-09 11:33:43 +08:00
Devin Howard
005250f330 typo 2016-02-09 11:26:42 +08:00
Devin Howard
7956e6d289 check map#contains matches json schema in spec 2016-02-09 11:20:39 +08:00
Devin Howard
0b98e446ca fiddle with maps_controller code style 2016-02-09 11:20:04 +08:00
Connor Turland
e29b683b38 new junto images 2016-02-09 09:14:33 +13:00
Devin Howard
451ed81010 remove tests that shouldn't be there 2016-02-08 12:01:59 +08:00
Devin Howard
17ee69b147 start fixing other controller specs 2016-02-08 11:56:46 +08:00
Devin Howard
80a6bcbca2 remove annoying rcov gem 2016-02-08 11:19:40 +08:00
Devin Howard
e460899ea3 testing simplecov and rcov stuff 2016-02-08 11:19:39 +08:00
Devin Howard
d64fe002dc suppress devise warnings on rspec tests 2016-02-08 11:19:38 +08:00
Devin Howard
cc99ed001d fix mapping_controller_spec.rb 2016-02-08 11:19:38 +08:00
Devin Howard
46013bc1b5 start speccing out mappings controller 2016-02-08 11:19:38 +08:00
Devin Howard
fa3a725df9 mapping spec 2016-02-08 11:19:37 +08:00
Devin Howard
b3f8f6652a simplecov added 2016-02-08 11:19:36 +08:00
Devin Howard
caa65c1170 metacode spec 2016-02-08 11:19:36 +08:00
Devin Howard
987cd7f5a0 Merge branch 'feature/xls.export' into release/v2.8 2016-02-08 09:58:09 +08:00
Devin Howard
f42b30e8b5 Merge branch 'feature/auto.synapse' into release/v2.8 2016-02-08 09:57:58 +08:00
Devin Howard
0ae8ea0ca5 implement csv/xls export 2016-02-07 13:12:18 +08:00
Devin Howard
83551e317e create synapse if you click away from the synapse title form 2016-02-06 13:03:47 +08:00
Devin Howard
786eeae72a Merge branch 'develop' into feature/realtime.video 2016-02-06 12:56:23 +08:00
Devin Howard
e4d53162a7 Merge branch 'master' into develop 2016-02-06 12:55:02 +08:00
Devin Howard
f9128dad7a vendor in gitignore 2016-02-06 12:52:38 +08:00
Devin Howard
9e28fa1ea7 public dir perms 2016-02-06 12:52:25 +08:00
Devin Howard
798035107f Merge branch 'master' into develop 2016-02-06 10:11:55 +08:00
Devin Howard
246c344959 add rake perms:fix task for public dir 2016-02-06 09:42:40 +08:00
Devin Howard
ea11ce69e5 update public dir, including 503.html' 2016-02-06 09:42:33 +08:00
Devin Howard
785e7dda4b create 503.html for server maintenance 2016-02-06 09:34:51 +08:00
Devin Howard
67da49c1be max height on search results so they scroll 2016-02-05 22:13:23 +08:00
Devin Howard
57a8b654ba smoother 'added by me' filtering 2016-02-05 21:25:20 +08:00
Devin Howard
3fe93be987 Merge branch 'master' into develop 2016-02-05 20:21:31 +08:00
Devin Howard
ef307f1d46 Merge pull request #459 from metamaps/fix/searchbox
searchbox fixes for master
2016-02-05 20:20:13 +08:00
Devin Howard
cd10ee97ee typo 2016-02-05 20:17:40 +08:00
Devin Howard
48ec4a024e mark 2.7.1 2016-02-05 20:12:05 +08:00
Devin Howard
6b9aa52224 well, the loading icon mostly works now too 2016-02-05 20:09:00 +08:00
Devin Howard
5f90843da2 gross, but it works. checkboxes in search results work 2016-02-05 20:02:57 +08:00
Devin Howard
c427e7fd7e mess with typeahead(val) calls. looks like the header is being destroyed during suggestion rendering, need a variable 2016-02-05 19:54:38 +08:00
Devin Howard
353872001f vertical align no results 2016-02-05 19:21:09 +08:00
Devin Howard
aabdaaf21b nicer icon positioning 2016-02-05 19:19:16 +08:00
Devin Howard
f1f56f9286 centre topic icons if there are results 2016-02-05 19:11:19 +08:00
Devin Howard
461b62628d fix minimizing search results 2016-02-05 19:06:57 +08:00
Devin Howard
3405bf5942 fix the problem where it always closes on you 2016-02-05 18:56:16 +08:00
Devin Howard
a05fe70eda topic headers on resultnoresults 2016-02-05 18:35:45 +08:00
Devin Howard
b3d321c7e9 topic icon <-- 2016-02-05 18:27:26 +08:00
Devin Howard
27e5830c4f move configure.sh into bin folder 2016-02-05 18:12:25 +08:00
Devin Howard
ed88445c6b update configure.sh 2016-02-05 18:12:00 +08:00
Devin Howard
821966c5db update schema.rb 2016-02-05 18:11:35 +08:00
Devin Howard
9a68a2d3c1 jenkins ruby versioning smarter 2016-02-05 18:02:30 +08:00
Devin Howard
8202fb38f3 Merge branch 'develop' into feature/realtime.video 2016-02-05 16:27:43 +08:00
Devin Howard
f2cbde50ca dos2unix on the whole repo 2016-02-05 11:43:15 +08:00
Devin Howard
3e28831595 Merge branch 'develop' into feature/realtime.video 2016-02-05 11:38:19 +08:00
Devin Howard
c80efac7de tag v2.8 2016-02-05 11:37:33 +08:00
Devin Howard
a1d2ef70b9 Merge pull request #451 from metamaps/feature/contributing.md.updates
Update CONTRIBUTING.md
2016-02-05 11:35:42 +08:00
Devin Howard
85290d0e70 Update CONTRIBUTING.md 2016-02-05 11:33:33 +08:00
Devin Howard
b43804bf80 Merge pull request #421 from metamaps/develop
Upgrade to Rails 4
2016-02-05 11:31:24 +08:00
Devin Howard
e73ade0442 tag v2.7 2016-02-05 11:29:05 +08:00
Devin Howard
9a548e261b Merge branch 'master' into develop 2016-02-04 18:10:07 +08:00
poietic
c8d6563f45 changed links from old uservoice url.
links to support forum were pointed towards our expired custom domain
from service, renamed them all so that they link up.
2016-01-29 16:00:30 -08:00
Devin Howard
5ec77b44cd add develop branch build status badge 2016-01-26 18:57:32 +08:00
Devin Howard
38f46bd8c4 add jenkins-test.sh script 2016-01-26 17:04:32 +08:00
Connor Turland
8e07c10ecc make sure the chat pane is closed for opening the next map 2016-01-26 15:29:32 +13:00
Connor Turland
1fa84e0d29 chat only displays on maps 2016-01-26 14:46:26 +13:00
Connor Turland
b80fabcbcf was just old copied code not a file in use 2016-01-26 14:14:33 +13:00
Devin Howard
c9ebfee968 default branch to develop in README.md 2016-01-25 17:19:53 +08:00
Devin Howard
8a74118cb1 Merge branch 'develop' into feature/realtime.video 2016-01-25 11:23:32 +08:00
Devin Howard
79431f8515 fix user seeds 2016-01-25 11:23:10 +08:00
Connor Turland
74d372b942 fix the scrolling in the chat messages box 2016-01-22 16:49:50 +13:00
Connor Turland
5d838303a8 broken gemfile.lock and pass recent migrations 2016-01-22 16:14:35 +13:00
Connor Turland
4557b8e305 merge develop 2016-01-22 14:59:09 +13:00
Devin Howard
cbd82b92fe Merge branch 'develop' of https://github.com/metamaps/metamaps_gen002 into develop 2016-01-20 10:19:03 +08:00
Devin Howard
8a8ac92a8f data safety 2016-01-20 10:18:44 +08:00
Devin Howard
0e7690f2af fix metacode asset path update db migration 2016-01-20 10:18:22 +08:00
Devin Howard
31f5d464f1 S3_BUCKET_NAME in .example-env 2016-01-19 22:14:35 +08:00
Devin Howard
3aea952e40 Merge branch 'develop' of https://github.com/metamaps/metamaps_gen002 into develop 2016-01-19 14:27:33 +08:00
Devin Howard
14a292331b two tweaks to help production deploy 2016-01-19 14:27:25 +08:00
Devin Howard
1e010c69c2 doc formatting 2016-01-17 10:17:02 +08:00
Devin Howard
c2a2fe4997 better readme for realtime server 2016-01-17 10:14:19 +08:00
Connor Turland
11fc7a01f3 fixes the issue where video feeds go black after first call 2016-01-09 16:11:28 +13:00
Connor Turland
fe76f340a0 change to the db name causes local dev issues
this should just remain similar to what it used to be
2016-01-09 12:10:33 +13:00
Devin Howard
678ec1bbab Update windows installer docs 2016-01-08 08:21:28 +08:00
mix irving
f3400d4654 install dotenv to help managed env vars 2016-01-08 08:21:28 +08:00
Devin Howard
0e7b01296a dotenv.load in application.rb now 2016-01-08 08:19:46 +08:00
Devin Howard
1c0f6f2e2a don't put RAILS_ENV into the .env file - chicken and egg
see https://github.com/bkeepers/dotenv/issues/19 for more info
2016-01-07 18:47:58 +08:00
Devin Howard
da03d59d46 comment out uninitialized variables 2016-01-07 18:36:37 +08:00
Devin Howard
e21096f00a initializers for .env 2016-01-07 18:34:24 +08:00
Devin Howard
c6b0ccdbdb database name configurable in .env 2016-01-07 18:29:15 +08:00
Devin Howard
a06a80eb43 Merge pull request #456 from metamaps/feature/rspec-tests
rspec tests
2016-01-07 16:09:40 +08:00
Devin Howard
4be263c223 prominence to rspec command 2016-01-07 16:06:35 +08:00
Devin Howard
4842856358 merge develop into rspec-tests 2016-01-07 16:04:23 +08:00
Devin Howard
4a1e4ef333 refactor user factories to handle codes better 2016-01-07 15:47:45 +08:00
Devin Howard
4469b29ec2 in user model 2016-01-07 15:32:19 +08:00
Devin Howard
61d914caba 80 columns on RspecTesting.md 2016-01-07 15:32:11 +08:00
Devin Howard
8550b68290 Merge branch 'feature/rspec-tests' of https://github.com/metamaps/metamaps_gen002 into feature/rspec-tests 2016-01-07 15:23:25 +08:00
Devin Howard
f4b2e34627 Merge pull request #455 from metamaps/feature/dotenv-for-reals
dotenv for reals
2016-01-07 12:10:47 +08:00
Devin Howard
7d7003a1bc get more hard headed about having development values in .example-env 2016-01-06 23:16:34 +08:00
Devin Howard
bf21dcc3e6 merge develop into rspec tests 2016-01-06 23:03:34 +08:00
Devin Howard
3cdab531a6 move more config into .example-env 2016-01-06 22:57:01 +08:00
Devin Howard
70f5a5db11 centralize config in .env file, which includes remaving database.yml.default and overriding that file's local changes in favour of env variables. In future, all instance config can go in .env 2016-01-06 22:36:29 +08:00
Devin Howard
062522bfdc remove unnecessary step from windows docs 2016-01-06 11:25:55 +08:00
Devin Howard
75d9339010 make mapping polymorphism migration handle mapping problems 2016-01-06 10:23:01 +08:00
Devin Howard
21aba2fe5e more modular database.yml.default 2015-12-24 16:36:58 +08:00
Devin Howard
844a52fc52 Merge pull request #450 from metamaps/feature/fix-searchbox
fix searchbox
2015-12-24 15:44:12 +08:00
Devin Howard
40561c629a fix handleResultClick on search box 2015-12-24 15:42:51 +08:00
Devin Howard
a45d0f7791 fix search box on authenticated homepage 2015-12-24 15:19:03 +08:00
Connor Turland
6db91ea703 broken funnnnnction 2015-12-23 11:34:52 +08:00
Connor Turland
26bc04262a broken funnnnnction 2015-12-22 22:28:03 -05:00
Connor Turland
5ad1504494 handle socketio reconnect situation 2015-12-22 18:05:13 -05:00
Connor Turland
64283850e3 add junto spinner for call in progress 2015-12-22 17:46:19 -05:00
Connor Turland
dfc94b4079 fix up styling on chat text input 2015-12-22 16:34:30 -05:00
Connor Turland
49dd2f2e92 merge develop 2015-12-22 13:16:03 -05:00
Connor Turland
8d85f8d308 videos positioning decently. chats loading more smoothly 2015-12-22 12:43:50 -05:00
Devin Howard
8394e0ce86 re-add regular uservoice code 2015-12-22 07:13:26 +08:00
Devin Howard
c58b2c805e syntax error 2015-12-21 21:38:02 +08:00
Devin Howard
d96e991de3 don't use // for heroku either 2015-12-21 21:29:15 +08:00
Devin Howard
6e10b4c508 make use of realtime.metamaps.cc server 2015-12-21 21:28:18 +08:00
Devin Howard
914ff46bb9 syntax error in development.rb 2015-12-21 11:40:30 +08:00
Devin Howard
7ea91273c8 remove random string spec helper function in favour of factory girl sequences 2015-12-21 10:59:20 +08:00
Devin Howard
61c03e2736 Merge pull request #448 from metamaps/feature/https-preparation
https preparation
2015-12-21 10:18:46 +08:00
Devin Howard
603b9dc52e remove uservoice code 2015-12-21 10:16:51 +08:00
Devin Howard
9a7ef25afc Merge branch 'develop' into feature/https-preparation 2015-12-20 22:28:43 +08:00
Devin Howard
888edae6f6 finish remove asset_path_icon whoops 2015-12-20 22:28:05 +08:00
Devin Howard
c79a5f0072 Merge branch 'develop' into feature/https-preparation 2015-12-20 22:24:47 +08:00
Devin Howard
96ec672779 Merge branch 'develop' into feature/rspec-tests 2015-12-20 22:24:39 +08:00
Devin Howard
df485002b1 remove redundant asset_path_icon function 2015-12-20 22:22:01 +08:00
Devin Howard
7930f1a216 one test in metacode spec 2015-12-20 22:20:51 +08:00
Devin Howard
fe8794e814 fix topic spec 2015-12-20 22:18:40 +08:00
Devin Howard
f85bf74b2e synapse desc validation 2015-12-20 21:55:10 +08:00
Devin Howard
d33f4bffb1 typekit https 2015-12-20 20:19:24 +08:00
Devin Howard
f35d4d51a9 s3 over https by default 2015-12-20 20:19:09 +08:00
Devin Howard
e2bf1d5eb1 try to make metamaps more tls friendly 2015-12-20 18:36:57 +08:00
Devin Howard
c7f7fa1d1b reorganize synapse spec pendingness 2015-12-18 09:35:56 +08:00
Devin Howard
63e4939592 remove TODO 2015-12-18 09:35:40 +08:00
Devin Howard
6bb8ac7e1f fix dumb errors - only 2 topic specs fail now 2015-12-18 09:33:16 +08:00
Devin Howard
ca282f7879 topic spec owner 2015-12-18 09:28:28 +08:00
Devin Howard
d2680fd9f3 permissions on synapse spec 2015-12-18 09:28:20 +08:00
Devin Howard
acd048bd0d can't properly use rspec on a boolean field validation 2015-12-18 09:28:08 +08:00
Devin Howard
4b22a856c3 synapse spec 2015-12-18 09:26:15 +08:00
Devin Howard
a4c309a677 finish topic spec 2015-12-18 09:26:07 +08:00
Devin Howard
c4be57e525 topic and synapse validate permission 2015-12-18 09:25:54 +08:00
Devin Howard
cf6411988d topic spec - need to add permissions and fix 2 failing tests 2015-12-17 23:45:38 +08:00
Devin Howard
9522c30273 finish map spec permissions 2015-12-17 23:20:53 +08:00
Devin Howard
006acac6b5 remove redundant authorize_to_view function 2015-12-17 23:20:19 +08:00
Devin Howard
d5f66487b7 update map spec - add authorize_to_delete. TODO: add other map authorize specs 2015-12-17 09:44:48 +08:00
Devin Howard
9e4a7b821f cleanup topic model a bit 2015-12-17 09:34:49 +08:00
Devin Howard
86b79c1e55 add brief testing docs 2015-12-17 09:34:34 +08:00
Devin Howard
696bac17e6 map spec 2015-12-17 09:16:02 +08:00
Devin Howard
2525a6fb65 add permission service, refactor map model a bit, add validations 2015-12-17 09:10:52 +08:00
Devin Howard
bfd4e4f228 add permission service, add validations to map.rb 2015-12-17 09:03:51 +08:00
Devin Howard
b3ba6d3a80 add shoulda-matchers gem 2015-12-17 08:53:45 +08:00
Devin Howard
1ff235f547 who needs routing specs bah 2015-12-16 22:36:41 +08:00
Devin Howard
4dbff85443 default value if no request.env in application controller passes the rspec test woot. Only 80 more tests to implement 2015-12-16 22:36:12 +08:00
Devin Howard
a93473f2c9 rubocop spec folder 2015-12-16 22:33:29 +08:00
Devin Howard
846d04dd0d rubocop style updates 2015-12-16 22:19:58 +08:00
Devin Howard
ae1117338a set up devise authentication more srsly. Still doesn't pass the test though haha 2015-12-16 22:16:02 +08:00
Devin Howard
be3924aa54 setup bare minimum devise authentication in tests 2015-12-16 21:32:50 +08:00
Devin Howard
6148f55e1c handle nil unsafe_uri in app conttroller function 2015-12-16 21:05:18 +08:00
Devin Howard
235d4f6c24 remove unneeded NEW tests, fix test.rb environment 2015-12-15 22:33:48 +08:00
Devin Howard
229b7d2cc5 Merge branch 'develop' into feature/rspec-tests 2015-12-15 22:12:30 +08:00
Devin Howard
b2aa2074a7 update generation calcuation code, incl. fix user signup bug 2015-12-15 12:33:22 +08:00
Connor Turland
a905094d4d inviting, joining, and leaving conversations 2015-12-14 02:28:13 -05:00
Connor Turland
8b090be0b3 convert to something more 'call' style 2015-12-12 19:00:51 -05:00
Connor Turland
be2997d7e4 fix bad tooltip placement 2015-12-12 11:31:54 -05:00
Connor Turland
eec7dcb9c3 make the messages box fill up all available space 2015-12-11 19:18:53 -05:00
Connor Turland
56e3fc753a use asset_path for link to sound files 2015-12-11 19:15:18 -05:00
Connor Turland
20aa78208e rename junto to erb file 2015-12-11 18:49:22 -05:00
Connor Turland
6c7ba76937 update to https for sockets 2015-12-11 18:45:51 -05:00
Connor Turland
92ddbbaf4f remove metacode asset path migration 2015-12-11 18:10:53 -05:00
Connor Turland
5f1ef5f5c8 remove extra code 2015-12-11 18:10:38 -05:00
Connor Turland
3c9d722945 accept or reject video offers 2015-12-11 17:29:17 -05:00
Connor Turland
089528c46d great progress 2015-12-11 14:23:41 -05:00
Devin Howard
1597665be5 merge develop with rails4 stuff 2015-12-07 13:58:42 +08:00
Devin Howard
b037c84f15 fix small error in user model
need to use the parent's generation to calculate generation!
2015-12-07 11:44:08 +08:00
Connor Turland
2929547736 position the chat box, and remove the old junto panel 2015-12-03 17:15:15 -05:00
Connor Turland
b958c6ff89 removed precompiled assets 2015-12-03 17:15:15 -05:00
Connor Turland
75554d58bf temp 2015-12-03 17:15:15 -05:00
Devin Howard
fa67ec0444 update Gemfile for rails 4 2015-12-03 17:14:04 -05:00
Devin Howard
519342a468 fix filter bug 2015-12-03 16:58:21 -05:00
Devin Howard
31fceab45d search box css fixes 2015-12-03 16:58:21 -05:00
Devin Howard
47a7e161ee fix error with mapper search rendering 2015-12-03 16:58:21 -05:00
Devin Howard
7336c262e3 fix up user model json output function 2015-12-03 16:58:21 -05:00
Devin Howard
48ea29b13e refactor search css into scss for clearer organization, plus do some fixes to the typeahead css 2015-12-03 16:58:20 -05:00
Devin Howard
38662fcda8 split search css out into its own file 2015-12-03 16:58:20 -05:00
Devin Howard
d3814708a9 gc tuning 2015-12-03 16:58:20 -05:00
Devin Howard
9575a62e67 add .ruby-gemset file - you may need to reinstall gems if using rvm 2015-12-03 16:58:20 -05:00
Devin Howard
cde6eaa564 Update windows installer docs 2015-12-03 16:58:20 -05:00
Devin Howard
7db75b8d6d more fixes 2015-12-03 16:57:30 -05:00
Devin Howard
43624caf88 get autocomplete working again with new typeahead.js, but not the CSS 2015-12-03 16:57:30 -05:00
Devin Howard
4139c2c84a syntax error 2015-12-03 16:57:30 -05:00
Connor Turland
53d7ccab56 fix cannot set readonly property highlight 2015-12-03 16:57:30 -05:00
Connor Turland
5b0e7ffcde switching metacode sets was being caught by Metamaps.Router.intercept 2015-12-03 16:57:30 -05:00
Connor Turland
5f14601c74 styling of the vertical tab selectors needed improvement 2015-12-03 16:57:30 -05:00
Connor Turland
1b60927641 had to update because jquery ui version changed 2015-12-03 16:57:30 -05:00
Connor Turland
dcbe24bb7e getting uploads working
followed what it said to do here: http://stackoverflow.com/questions/28374401/nameerror-uninitialized-constant-paperclipstorages3aws
2015-12-03 16:57:30 -05:00
Devin Howard
67d4a2aa34 sandi metz function simplification 2015-12-03 16:57:30 -05:00
Devin Howard
520fe095bd fix #465, metacode sort problem 2015-12-03 16:57:29 -05:00
Connor Turland
87389a88ed current_user can be nil 2015-12-03 16:57:29 -05:00
Devin Howard
f8814c060f reorganize documentation 2015-12-03 16:57:29 -05:00
Devin Howard
1874c67a66 reorganize metamaps-qa-steps a bit 2015-12-03 16:57:29 -05:00
Devin Howard
75700f06a9 make invite link use REQUEST_URI 2015-12-03 16:57:29 -05:00
Devin Howard
3e03e64845 css fixes for heroku 2015-12-03 16:57:29 -05:00
Devin Howard
f4456d06ef fix devise integration for rails 4 2015-12-03 16:57:29 -05:00
Devin Howard
dfaadc691e update WindowsInstallation.md 2015-12-03 16:57:29 -05:00
Devin Howard
20e698f69d devise locale text 2015-12-03 16:57:29 -05:00
Devin Howard
506f93e144 Gemfile.lock 2015-12-03 16:57:29 -05:00
Devin Howard
6df2f22080 update devise.rb with new changes 2015-12-03 16:57:29 -05:00
Devin Howard
3674aefb04 remove secrets.yml stuff because it doesn't work with heroku 2015-12-03 16:57:29 -05:00
Devin Howard
10b58399a7 ok put ruby back in Gemfile' 2015-12-03 16:57:28 -05:00
Devin Howard
ede4e7a509 fix references to Rails.application.secrets 2015-12-03 16:57:28 -05:00
Devin Howard
570fa931b7 use secrets.yml to allow overriding config variables 2015-12-03 16:57:28 -05:00
Devin Howard
dd02129b0d remove ruby from Gemfile in favour of .ruby-version 2015-12-03 16:57:28 -05:00
Devin Howard
d99ed6b627 migrate metacodes that started with /assets/icons to use amazonaws urls. Remove last migration I made 2015-12-03 16:57:28 -05:00
Connor Turland
d8da2d93fd updated files to use amazon assets 2015-12-03 16:57:28 -05:00
Devin Howard
8e427ea8f2 add secrets.yml.default 2015-12-03 16:57:28 -05:00
Devin Howard
2cbf1cad7f fix 2015-12-03 16:57:28 -05:00
Devin Howard
4b6e33f983 does this fix missing-map.png? 2015-12-03 16:57:28 -05:00
Devin Howard
204544dc22 metacode asset_path calls 2015-12-03 16:57:28 -05:00
Devin Howard
f0c0dc48d8 add highlight to typeahead 2015-12-03 16:57:28 -05:00
Devin Howard
0b96171aa3 bugfix 2015-12-03 16:57:27 -05:00
Devin Howard
4245703084 see if we can make missing-map.png show up 2015-12-03 16:57:27 -05:00
Devin Howard
89424dcd7f try to fix custom metacode icon path 2015-12-03 16:57:27 -05:00
Devin Howard
f63a242256 whoops again 2015-12-03 16:57:27 -05:00
Devin Howard
47205883a9 whoops 2015-12-03 16:57:27 -05:00
Devin Howard
f4987bffc0 change css files to use asset_data_uri 2015-12-03 16:57:27 -05:00
Devin Howard
684dcd8d33 only run metacode.icon through asset_path if the path doesn't start with http 2015-12-03 16:57:27 -05:00
Devin Howard
bdb5623a02 woot fix metacodes 2015-12-03 16:57:27 -05:00
Devin Howard
60898fadb2 binding_of_caller gem for devel debug 2015-12-03 16:57:27 -05:00
Devin Howard
d8dffad38a metacodes#index map in asset_path 2015-12-03 16:57:27 -05:00
Devin Howard
a972074306 environment assets config 2015-12-03 16:57:27 -05:00
Devin Howard
bd60f68cfe try to compile but not compress assets 2015-12-03 16:57:26 -05:00
Devin Howard
96f5e6ac35 add asset_path calls 2015-12-03 16:57:26 -05:00
Devin Howard
d3080906b1 add db migration to remove asset paths from metacodes 2015-12-03 16:57:26 -05:00
Devin Howard
29411cf1e5 asset_path 2015-12-03 16:57:26 -05:00
Devin Howard
c782c4d0bb remove binding.pry 2015-12-03 16:57:26 -05:00
Devin Howard
52b37e7ac6 asset_path in css erb files 2015-12-03 16:57:26 -05:00
Devin Howard
6a21b84a23 resume ignoring public/assets 2015-12-03 16:57:26 -05:00
Devin Howard
d52caac1d6 add indexes to schema 2015-12-03 16:57:26 -05:00
Devin Howard
4d7f509235 change some css to erb 2015-12-03 16:57:26 -05:00
Devin Howard
b9ac614057 asset_path doesn't work in models 2015-12-03 16:57:26 -05:00
Devin Howard
cef83e1f3d asset_path 2015-12-03 16:57:26 -05:00
Devin Howard
2505ce36a5 syntax 2015-12-03 16:57:25 -05:00
Devin Howard
235aa7a6b3 convert javascript to asset_path syntax 2015-12-03 16:57:25 -05:00
Devin Howard
6e9b0ac9ef rename js files to js.erb files 2015-12-03 16:57:25 -05:00
Devin Howard
3f5404b043 add missing indexes for speed 2015-12-03 16:57:25 -05:00
Devin Howard
53d77a0e5b fix migration for heroku 2015-12-03 16:57:25 -05:00
Devin Howard
5b882b1332 pry byebug 2015-12-03 16:57:25 -05:00
Devin Howard
566a0a3aa6 brute force prevent nil synapse descriptions 2015-12-03 16:57:25 -05:00
Devin Howard
617fe43f71 fix problem with mappings and forking maps 2015-12-03 16:57:25 -05:00
Devin Howard
1453a3c181 function naming 2015-12-03 16:57:25 -05:00
Devin Howard
840484178b fix mapping problem 2015-12-03 16:57:25 -05:00
Devin Howard
ae16f8f08d fix a few more mappable/topic/synapse things in JS 2015-12-03 16:57:24 -05:00
Devin Howard
3e8c971155 change from category/topic_id/synapse_id to mappable_type/mappable_id 2015-12-03 16:57:24 -05:00
Devin Howard
5dc53543f7 migrate to polymorphic mappings - DB MIGRATION 2015-12-03 16:57:24 -05:00
Devin Howard
a4f910b66d bg color on EXisting synapses heading 2015-12-03 16:57:24 -05:00
Devin Howard
379b37b445 fix typo + debug statements to make existingSynapse autocomplete work 2015-12-03 16:57:24 -05:00
Devin Howard
675bcadda0 deal with https://github.com/twitter/typeahead.js/issues/1195 2015-12-03 16:57:24 -05:00
Devin Howard
a7e512e25a working version of autocomplete that includes the new typeahead.js syntax. So much more complicated than before... 2015-12-03 16:57:24 -05:00
Devin Howard
bd9c275ada upgrade typeahead to 1.10 and new syntax 2015-12-03 16:57:24 -05:00
Devin Howard
4bc03e3d2a code tweaks to searchsynapses 2015-12-03 16:57:24 -05:00
Devin Howard
ff48b2456a Revert "upgrade typeahead to allow new syntax"
This reverts commit 347d77df82.
2015-12-03 16:57:24 -05:00
Devin Howard
8826dfdcf6 upgrade typeahead to allow new syntax 2015-12-03 16:57:24 -05:00
Devin Howard
e5c83a2a0c dependent destroy models for topics/maps/synapses on mappings 2015-12-03 16:57:23 -05:00
Devin Howard
0a63b5e79a fiddle with Gemfile 2015-12-03 16:57:23 -05:00
Devin Howard
b743476115 add qa steps file first draft 2015-12-03 16:57:23 -05:00
Devin Howard
b395bd0b50 replace the obvious spots with asset_path 2015-12-03 16:57:23 -05:00
Connor Turland
1a01d3b568 configuration for production environments like heroku 2015-12-03 16:57:23 -05:00
Connor Turland
8b7ec73f48 this enables the vagrant port forwarding 2015-12-03 16:57:23 -05:00
Devin Howard
50d9866939 fix problem with join route 2015-12-03 16:57:23 -05:00
Devin Howard
95e1806500 cancan => cancancan 2015-12-03 16:57:23 -05:00
Devin Howard
2369c9ce5e select metacodes with one query instead of n queries, move logic to application_helper 2015-12-03 16:57:23 -05:00
Devin Howard
7c28070978 fix other controllers needing create/update changed for rails 4 2015-12-03 16:57:23 -05:00
Devin Howard
919fc0a60f fiddle with topic and mapping controllers so they work again 2015-12-03 16:57:23 -05:00
Devin Howard
e34b5bd2ad fix best in place deprecation warnings in map info box 2015-12-03 16:57:22 -05:00
Devin Howard
7877e5bdbc delete_if threw errors, so convert things to arrays for it 2015-12-03 16:57:22 -05:00
Devin Howard
d4f72bac65 whoo new gems for development. binding.pry is so cool 2015-12-03 16:57:22 -05:00
Devin Howard
7d738b7abf fix map/mapping associations that I broke 2015-12-03 16:57:22 -05:00
Devin Howard
e9cb8561fa add required params to all controllers 2015-12-03 16:57:22 -05:00
Devin Howard
32311e3610 fix has_many relationships in map & mapping models for rails 4 2015-12-03 16:57:22 -05:00
Devin Howard
8bf2eb31f3 remove old jquery-ui file 2015-12-03 16:57:22 -05:00
Devin Howard
7b199983d8 add jquery_ui to gemfile 2015-12-03 16:57:22 -05:00
Devin Howard
371851cb89 remove attr_accessible 2015-12-03 16:57:22 -05:00
Devin Howard
13b70be653 secret_token => secret_key_base 2015-12-03 16:57:22 -05:00
Devin Howard
61159dc44c remove match method from routes.rb 2015-12-03 16:57:22 -05:00
Devin Howard
558ced62a8 asset precompiling simpler in rails 4 2015-12-03 16:57:22 -05:00
Devin Howard
62e96d574c some config changes for rails 4 found on the Internet 2015-12-03 16:57:21 -05:00
Devin Howard
562dd17b36 update Gemfile for rails 4 2015-12-03 16:57:21 -05:00
Connor Turland
3b89a2a13f Merge pull request #440 from metamaps/feature/fix.fork.filter.bug
fix filter bug
2015-11-30 11:10:57 -05:00
Devin Howard
8425e72101 fix filter bug 2015-11-30 10:01:33 +08:00
Devin Howard
8505d26182 search box css fixes 2015-11-28 23:03:48 +08:00
Devin Howard
6b6ad1b660 fix error with mapper search rendering 2015-11-28 22:07:57 +08:00
Devin Howard
3aaf501b03 fix up user model json output function 2015-11-28 21:51:28 +08:00
Devin Howard
9afc8bc7c4 refactor search css into scss for clearer organization, plus do some fixes to the typeahead css 2015-11-28 21:40:09 +08:00
Devin Howard
98e11c0a7d split search css out into its own file 2015-11-28 20:17:14 +08:00
Devin Howard
45e09a27bd gc tuning 2015-11-25 11:59:56 +08:00
Devin Howard
d3d0c97e7e add .ruby-gemset file - you may need to reinstall gems if using rvm 2015-11-23 18:22:34 +08:00
Devin Howard
94412b21d2 merge documentation changes 2015-11-23 09:54:36 +08:00
Devin Howard
f58412b715 Update windows installer docs 2015-11-20 14:34:05 +08:00
Devin Howard
1f82238362 more fixes 2015-11-08 23:14:53 +08:00
Devin Howard
7136f46ec3 get autocomplete working again with new typeahead.js, but not the CSS 2015-11-08 22:53:34 +08:00
Devin Howard
fe0d38ec67 syntax error 2015-11-07 01:34:08 +08:00
Connor Turland
53de063bfc fix cannot set readonly property highlight 2015-11-07 01:33:18 +08:00
Connor Turland
03ab04050d switching metacode sets was being caught by Metamaps.Router.intercept 2015-11-07 01:33:18 +08:00
Connor Turland
3216106660 styling of the vertical tab selectors needed improvement 2015-11-07 01:33:18 +08:00
Connor Turland
e29ab4bca3 had to update because jquery ui version changed 2015-11-07 01:33:18 +08:00
Connor Turland
1bbaa47b80 getting uploads working
followed what it said to do here: http://stackoverflow.com/questions/28374401/nameerror-uninitialized-constant-paperclipstorages3aws
2015-11-07 01:33:18 +08:00
Devin Howard
fa017a8559 sandi metz function simplification 2015-11-06 17:08:42 +08:00
Devin Howard
7ec7f9f892 fix #465, metacode sort problem 2015-11-04 17:22:46 +08:00
Connor Turland
86c467b2f1 current_user can be nil 2015-11-04 00:14:14 -05:00
Devin Howard
3eff850336 reorganize documentation 2015-11-04 11:41:04 +08:00
Devin Howard
6f8c18cd46 reorganize metamaps-qa-steps a bit 2015-11-04 11:40:52 +08:00
Devin Howard
660ee52292 make invite link use REQUEST_URI 2015-11-03 22:22:53 +08:00
Devin Howard
8b456f5a31 css fixes for heroku 2015-11-03 21:10:05 +08:00
Devin Howard
62ae38e70d fix devise integration for rails 4 2015-11-03 20:56:50 +08:00
Devin Howard
d9133b1e29 update WindowsInstallation.md 2015-11-03 19:10:21 +08:00
Devin Howard
9613145e99 devise locale text 2015-11-02 00:07:52 +08:00
Devin Howard
5b4bd9724b Gemfile.lock 2015-11-02 00:06:12 +08:00
Devin Howard
c86422dc68 update devise.rb with new changes 2015-11-02 00:05:57 +08:00
Devin Howard
6487202e6f remove secrets.yml stuff because it doesn't work with heroku 2015-10-30 14:30:24 +08:00
Devin Howard
8e19083035 ok put ruby back in Gemfile' 2015-10-30 14:21:47 +08:00
Devin Howard
e2a8e0331d fix references to Rails.application.secrets 2015-10-30 14:18:50 +08:00
Devin Howard
8e1ae0a1fc use secrets.yml to allow overriding config variables 2015-10-29 16:23:41 +08:00
Devin Howard
cda76a4bae remove ruby from Gemfile in favour of .ruby-version 2015-10-29 16:18:06 +08:00
Devin Howard
ddce6ad95c migrate metacodes that started with /assets/icons to use amazonaws urls. Remove last migration I made 2015-10-28 14:24:52 +08:00
Connor Turland
6e79b58e16 updated files to use amazon assets 2015-10-27 21:46:07 -07:00
Devin Howard
6f518be51d rspec tests rails4 Gemfile.lock 2015-10-27 18:23:25 +08:00
Devin Howard
6c4620afa6 more qa 2015-10-27 18:21:46 +08:00
Devin Howard
5c813beafe merge 2015-10-27 18:20:12 +08:00
Devin Howard
12c6765f8b add secrets.yml.default 2015-10-27 18:17:04 +08:00
Devin Howard
eea2bf30df fix 2015-10-27 18:16:35 +08:00
Devin Howard
43c851e6b4 does this fix missing-map.png? 2015-10-26 21:12:18 +08:00
Devin Howard
5ce460e967 metacode asset_path calls 2015-10-26 21:04:07 +08:00
Devin Howard
9916975e2e add highlight to typeahead 2015-10-26 21:01:13 +08:00
Devin Howard
fb848b29d5 bugfix 2015-10-26 20:41:37 +08:00
Devin Howard
9d6372c7b9 see if we can make missing-map.png show up 2015-10-26 20:16:49 +08:00
Devin Howard
b0327da649 try to fix custom metacode icon path 2015-10-26 18:28:25 +08:00
Devin Howard
20f4497064 whoops again 2015-10-26 12:39:40 +08:00
Devin Howard
06d06f8f55 whoops 2015-10-26 12:27:22 +08:00
Devin Howard
6c27623b80 change css files to use asset_data_uri 2015-10-26 12:22:40 +08:00
Devin Howard
6b8686c4e2 only run metacode.icon through asset_path if the path doesn't start with http 2015-10-26 12:12:07 +08:00
Devin Howard
6d4481979f woot fix metacodes 2015-10-26 11:53:54 +08:00
Devin Howard
3440826d51 binding_of_caller gem for devel debug 2015-10-26 11:53:50 +08:00
Devin Howard
0dbb37eaa4 metacodes#index map in asset_path 2015-10-25 17:14:56 +08:00
Devin Howard
e40f6ededc environment assets config 2015-10-25 17:09:57 +08:00
Devin Howard
ac0faae843 try to compile but not compress assets 2015-10-25 16:51:47 +08:00
Devin Howard
fcd866c05e add asset_path calls 2015-10-25 16:50:07 +08:00
Devin Howard
9de4492f04 add db migration to remove asset paths from metacodes 2015-10-25 16:37:45 +08:00
Devin Howard
da98a53a3e asset_path 2015-10-23 23:56:29 +08:00
Devin Howard
b00784731b remove binding.pry 2015-10-23 23:42:21 +08:00
Devin Howard
46dd54a1d7 asset_path in css erb files 2015-10-23 23:34:18 +08:00
Devin Howard
72e67c188a resume ignoring public/assets 2015-10-23 23:23:23 +08:00
Devin Howard
e572389c49 add indexes to schema 2015-10-23 23:22:54 +08:00
Devin Howard
1670235172 change some css to erb 2015-10-23 23:19:25 +08:00
Devin Howard
837abbe9ee asset_path doesn't work in models 2015-10-23 23:09:14 +08:00
Devin Howard
d539846c61 asset_path 2015-10-23 23:06:24 +08:00
Devin Howard
2e51c3c118 syntax 2015-10-23 23:01:02 +08:00
Devin Howard
b070bb9e46 convert javascript to asset_path syntax 2015-10-23 22:56:09 +08:00
Devin Howard
ad47275f72 rename js files to js.erb files 2015-10-23 22:51:16 +08:00
Devin Howard
e078b59503 add missing indexes for speed 2015-10-23 22:38:42 +08:00
Devin Howard
582ef63635 fix migration for heroku 2015-10-23 22:32:09 +08:00
Devin Howard
dc66ac10a9 pry byebug 2015-10-23 22:27:33 +08:00
Devin Howard
96871cadab brute force prevent nil synapse descriptions 2015-10-23 22:17:08 +08:00
Devin Howard
588b62b942 fix problem with mappings and forking maps 2015-10-23 22:07:44 +08:00
Devin Howard
eb7ba35e14 Merge pull request #411 from metamaps/rails4
Upgrade to rails 4?
2015-10-23 21:09:49 +08:00
Devin Howard
63db41698e function naming 2015-10-23 21:04:16 +08:00
Devin Howard
ddfb3aa98f fix mapping problem 2015-10-23 21:03:49 +08:00
Devin Howard
310222aef9 factories for synapse, topic, user 2015-10-19 15:23:49 +08:00
Devin Howard
e3a4207827 random_string helper function 2015-10-19 15:23:07 +08:00
Devin Howard
d913f50cf9 remove views specs and non-applicable routing specs 2015-10-12 17:19:16 +08:00
Devin Howard
25117cf0e6 add rspec scaffold tests and a test db environment 2015-10-12 11:45:59 +08:00
Devin Howard
16c47d75d4 delete test directory, add spec directory 2015-10-12 11:26:48 +08:00
Devin Howard
0d2ddbd9b6 add rspec to Gemfile 2015-10-12 11:24:30 +08:00
Devin Howard
053f035d31 move fixtures to seeds.rb 2015-10-12 11:22:55 +08:00
Devin Howard
85b3012cd9 fix a few more mappable/topic/synapse things in JS 2015-10-02 18:54:17 +08:00
Devin Howard
6d1e382d5c change from category/topic_id/synapse_id to mappable_type/mappable_id 2015-10-02 16:32:16 +08:00
Devin Howard
69f4b8c645 migrate to polymorphic mappings - DB MIGRATION 2015-10-02 16:22:16 +08:00
Devin Howard
c80569a449 bg color on EXisting synapses heading 2015-10-02 15:53:06 +08:00
Devin Howard
120edfc278 fix typo + debug statements to make existingSynapse autocomplete work 2015-10-02 15:46:48 +08:00
Devin Howard
80b2b1876a deal with https://github.com/twitter/typeahead.js/issues/1195 2015-10-02 14:39:17 +08:00
Devin Howard
a51777b0ba working version of autocomplete that includes the new typeahead.js syntax. So much more complicated than before... 2015-10-02 13:36:51 +08:00
Devin Howard
14eeb0cbe6 upgrade typeahead to 1.10 and new syntax 2015-10-01 14:55:26 +08:00
Devin Howard
d895bca1a4 code tweaks to searchsynapses 2015-10-01 12:33:38 +08:00
Devin Howard
b3b065e623 Revert "upgrade typeahead to allow new syntax"
This reverts commit 347d77df82.
2015-10-01 11:34:19 +08:00
Devin Howard
347d77df82 upgrade typeahead to allow new syntax 2015-10-01 11:14:25 +08:00
Devin Howard
b0efe6aea8 Merge branch 'develop' into rails4 2015-10-01 11:05:27 +08:00
Devin Howard
9e43cc2e96 dependent destroy models for topics/maps/synapses on mappings 2015-10-01 11:02:39 +08:00
Devin Howard
bb29e0e724 fiddle with Gemfile 2015-10-01 11:02:03 +08:00
Devin Howard
a8dc64a6fe Merge pull request #415 from metamaps/less-autocomplete
only autocomplete topic/synapse if the user types more than 2 characters
2015-10-01 00:08:43 +08:00
Devin Howard
a9b034637b only autocomplete topic/synapse if the user types more than 2 characters 2015-09-30 13:55:23 +08:00
Devin Howard
c0d29e54bd Merge branch 'rails4' of ssh://github.com/metamaps/metamaps_gen002 into rails4 2015-09-28 14:43:16 +08:00
Devin Howard
b9140e9b8d add qa steps file first draft 2015-09-28 14:43:09 +08:00
Devin Howard
8f8f40c0e4 replace the obvious spots with asset_path 2015-09-22 22:27:34 +08:00
Devin Howard
741c584651 Merge branch 'develop' into rails4 2015-09-20 13:55:21 +08:00
Devin Howard
7841f6c96b Merge pull request #412 from devvmh/dotenv_install
install dotenv to help managed env vars - author attribution to mix mix :)
2015-09-20 13:48:16 +08:00
Connor Turland
f5dbfd5d72 configuration for production environments like heroku 2015-09-19 14:10:43 -04:00
Connor Turland
869fb816e9 this enables the vagrant port forwarding 2015-09-19 13:16:07 -04:00
Devin Howard
1fbd16ac95 fix problem with join route 2015-09-19 20:46:10 +08:00
Devin Howard
b2e15c6483 cancan => cancancan 2015-09-19 20:25:07 +08:00
Devin Howard
086acb09af select metacodes with one query instead of n queries, move logic to application_helper 2015-09-19 20:17:56 +08:00
Devin Howard
62035ed015 fix other controllers needing create/update changed for rails 4 2015-09-19 20:05:36 +08:00
Devin Howard
e14001061c fiddle with topic and mapping controllers so they work again 2015-09-19 20:01:44 +08:00
Devin Howard
31015295f8 fix best in place deprecation warnings in map info box 2015-09-19 17:11:48 +08:00
Devin Howard
6692c28965 delete_if threw errors, so convert things to arrays for it 2015-09-19 17:08:12 +08:00
Devin Howard
1aa4d862a1 whoo new gems for development. binding.pry is so cool 2015-09-19 17:01:27 +08:00
Devin Howard
2f9b09db86 fix map/mapping associations that I broke 2015-09-19 16:48:24 +08:00
Devin Howard
c361349c20 add required params to all controllers 2015-09-19 16:26:34 +08:00
Devin Howard
a31a92b321 Merge branch 'develop' into rails4 2015-09-15 20:37:47 +08:00
Devin Howard
a8cef723a2 fix has_many relationships in map & mapping models for rails 4 2015-09-10 22:48:35 +08:00
Devin Howard
d67d098b2a remove old jquery-ui file 2015-09-10 22:40:45 +08:00
Devin Howard
8cf8277573 add jquery_ui to gemfile 2015-09-10 22:13:10 +08:00
Devin Howard
dc51d0080e remove attr_accessible 2015-09-10 22:12:50 +08:00
Devin Howard
f81fdbf8cc secret_token => secret_key_base 2015-09-10 22:12:39 +08:00
Devin Howard
7a73f3bc07 remove match method from routes.rb 2015-09-10 22:06:58 +08:00
Devin Howard
c250f5d395 asset precompiling simpler in rails 4 2015-09-10 22:03:39 +08:00
Devin Howard
3c0bdff823 some config changes for rails 4 found on the Internet 2015-09-10 17:43:58 +08:00
Devin Howard
5848af7765 update Gemfile for rails 4 2015-09-10 17:43:48 +08:00
Connor Turland
6767771d7d dont show the embedly share links 2015-08-03 14:12:47 -04:00
Connor Turland
5cd4db66c6 needed to update embedly 2015-08-03 14:02:30 -04:00
Devin Howard
3f5d2bd7f3 add gem install bundler to configure.sh 2015-05-09 23:22:23 -04:00
Connor Turland
499f6349e6 add ability for admin to delete any topics and synapses 2015-04-28 18:43:47 -04:00
mix irving
7a1b68960d install dotenv to help managed env vars 2015-03-09 08:50:24 +13:00
Connor Turland
9ce81df9f9 Merge pull request #406 from s01us/extract_mail_env
extract email settings into ENV ✂️
2015-03-07 15:01:53 -05:00
mix irving
c17cc39880 extract email settings into ENV ✂️ fixes #405 2015-03-04 11:30:23 +13:00
Connor Turland
8816031b20 Merge pull request #404 from s01us/add_ruby_version
add .ruby-version for rbenv support
2015-03-03 09:33:59 -05:00
mix irving
4d311cb371 add .reuby-version for rbenv support 2015-03-03 23:15:44 +13:00
Connor Turland
253ceb4b48 added imagemagick to vagrantfile 2015-02-19 19:03:22 -05:00
734 changed files with 57035 additions and 40628 deletions

1
.agignore Normal file
View file

@ -0,0 +1 @@
app/assets/javascripts/metamaps.secret.bundle.js

10
.babelrc Normal file
View file

@ -0,0 +1,10 @@
{
"presets": [
"react",
"es2015"
],
"plugins": [
"lodash",
"transform-class-properties"
]
}

View file

@ -1 +1,2 @@
https://github.com/heroku/heroku-buildpack-nodejs.git
https://github.com/heroku/heroku-buildpack-ruby.git

38
.codeclimate.yml Normal file
View file

@ -0,0 +1,38 @@
---
engines:
brakeman:
enabled: true
bundler-audit:
enabled: true
duplication:
enabled: true
config:
languages:
count_threshold: 3 # rule of three
ruby:
mass_threshold: 36 # default: 18
javascript:
mass_threshold: 80 # default: 40
eslint:
enabled: true
channel: "eslint-3"
fixme:
enabled: true
rubocop:
enabled: true
exclude_fingerprints:
- 74f18007b920e8d81148d2f6a2756534
ratings:
paths:
- 'Gemfile.lock'
- '**.erb'
- '**.rb'
- '**.js'
- '**.jsx'
exclude_paths:
- app/assets/images/
- app/assets/javascripts/lib/
- frontend/src/patched/
- db/
- script/
- spec/

3
.eslintignore Normal file
View file

@ -0,0 +1,3 @@
**/*{.,-}min.js
frontend/src/patched/*
app/assets/javascripts/lib/*

26
.eslintrc.js Normal file
View file

@ -0,0 +1,26 @@
module.exports = {
"sourceType": "module",
"parser": "babel-eslint",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
}
},
"extends": "standard",
"installedESLint": true,
"env": {
"es6": true,
"node": true
},
"plugins": [
"promise",
"standard",
"react"
],
"rules": {
"react/jsx-uses-react": [2],
"react/jsx-uses-vars": [2],
"space-before-function-paren": [2, "never"],
"yoda": [2, "never", { "exceptRange": true }]
}
}

56
.example-env Normal file
View file

@ -0,0 +1,56 @@
# Node JS env
export NODE_REALTIME_PORT='5000' # should match REALTIME_SERVER, below
# Rails env
export DB_USERNAME='postgres'
export DB_PASSWORD='3112'
export DB_HOST='localhost'
export DB_PORT='5432'
export DB_NAME='metamaps'
export REALTIME_SERVER='http://localhost:5000'
export MAILER_DEFAULT_URL='localhost:3000'
export DEVISE_MAILER_SENDER='team@metamaps.cc'
export DEVISE_SECRET_KEY='f71c467e526f23d614b3b08866cad4788c502bed869c282f06e73ee6c94675b62fe1f6d52fa7ba8196b33031f0d2f3b67e27ea07693c52ecebccb01700cad614'
export SECRET_KEY_BASE='267c8a84f63963282f45bc3010eaddf027abfab58fc759d6e239c8005f85ee99d6d01b1ab6394cdee9ca7f8c9213a0cf91d3d8d3350f096123e2caccbcc0924f'
# # you can safely leave these blank, unless you're deploying an instance, in
# # which case you'll need to set them up
#
# export S3_REGION
# export S3_BUCKET_NAME
# export AWS_ACCESS_KEY_ID
# export AWS_SECRET_ACCESS_KEY
#
# export SMTP_DOMAIN
# export SMTP_PASSWORD
# export SMTP_PORT
# export SMTP_SERVER
# export SMTP_USERNAME
# # send exception notifications to a slack incoming webhook
# export SLACK_EN_WEBHOOK_URL
# ruby garbage collection stuff
export RUBY_GC_TUNE=0 #set to 1 to enable GC test
export RUBY_GC_TOKEN=4f4380fc9a2857d1f008005a3eb86928
export RUBY_GC_HEAP_INIT_SLOTS=186426
export RUBY_GC_HEAP_FREE_SLOTS=559278
export RUBY_GC_HEAP_GROWTH_FACTOR=1.03
export RUBY_GC_HEAP_GROWTH_MAX_SLOTS=74570
export RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR=1.4
export RUBY_GC_MALLOC_LIMIT=32883406
export RUBY_GC_MALLOC_LIMIT_MAX=69055153
export RUBY_GC_MALLOC_LIMIT_GROWTH_FACTOR=1.68
export RUBY_GC_OLDMALLOC_LIMIT=32509481
export RUBY_GC_OLDMALLOC_LIMIT_MAX=68269910
export RUBY_GC_OLDMALLOC_LIMIT_GROWTH_FACTOR=1.4
## find the ENV currently in use in the app using :
## grep -rIso -P "(?<=ENV)(\.fetch\(|\[).[A-Z_]+.(\)|\])"
# for a uniq ordered list of env vars:
## grep -rIsoh -P "(?<=ENV)(\.fetch\(|\[).[A-Z_]+.(\)|\])" | grep -oP "[A-Z_]+" | sort -u > temp

26
.gitignore vendored
View file

@ -4,20 +4,32 @@
# or operating system, you probably want to add a global ignore instead:
# git config --global core.excludesfile ~/.gitignore_global
realtime/node_modules
config/database.yml
#public/assets
#assety stuff
public/assets
public/metamaps_mobile
public/api/index.html
vendor/
node_modules
npm-debug.log
app/assets/javascripts/webpacked
#secrets and config
.env
*.swp
# Ignore bundler config
.bundle
# Ignore the default SQLite database.
db/*.sqlite3
# Ignore all logfiles and tempfiles.
log/*.log
tmp
.tmp
coverage
.DS_Store
*/.DS_Store
.DS_Store?
.vagrant
gentle/
startserver.sh

1
.nvmrc Normal file
View file

@ -0,0 +1 @@
6.2.2

2
.rspec Normal file
View file

@ -0,0 +1,2 @@
--color
--require spec_helper

29
.rubocop.yml Normal file
View file

@ -0,0 +1,29 @@
AllCops:
TargetRubyVersion: 2.3
Exclude:
- 'db/**/*'
- 'tmp/**/*'
- 'bin/**/*'
- 'vendor/**/*'
- 'app/assets/javascripts/node_modules/**/*'
- 'Vagrantfile'
Rails:
Enabled: true
Metrics/LineLength:
Max: 120
Metrics/AbcSize:
Max: 16
Style/Documentation:
Enabled: false
Style/EmptyMethod:
EnforcedStyle: expanded
# I like this cop, but occasionally code is more readable without a guard clause,
# and I don't want to write rubocop:disable comments every time that happens
Style/GuardClause:
Enabled: false

1
.ruby-gemset Normal file
View file

@ -0,0 +1 @@
metamaps

1
.ruby-version Normal file
View file

@ -0,0 +1 @@
2.3.0

7
.simplecov Normal file
View file

@ -0,0 +1,7 @@
if ENV['COVERAGE'] == 'on'
SimpleCov.start 'rails' do
add_group 'Policies', 'app/policies'
add_group 'Services', 'app/services'
add_group 'Serializers', 'app/serializers'
end
end

25
.travis.yml Normal file
View file

@ -0,0 +1,25 @@
sudo: false
language: ruby
cache:
bundler: true
directories:
- app/assets/javascripts/node_modules
rvm:
- 2.3.0
before_script:
- echo "Rspec setup"
- export RAILS_ENV=test
- cp .example-env .env
- bundle exec rake db:create
- bundle exec rake db:schema:load
- echo "node setup"
- . $HOME/.nvm/nvm.sh
- nvm install stable
- nvm use stable
- npm install --no-optional
script:
- bundle exec rspec && bundle exec brakeman -q -z && npm test
addons:
code_climate:
repo_token: 479d3bf56798fbc7fff3fc8151a5ed09e8ac368fd5af332c437b9e07dbebb44e
postgresql: "9.4"

View file

@ -1,93 +0,0 @@
# Contributing to Metamaps
Active involvement from the community is essential to help make Metamaps as beneficial for communities as it can be. You can help by reporting bugs, fixing bugs, adding features, contributing new modules and by providing feedback.
## Reporting bugs and other issues
If you think you've encountered a bug, do the following:
1. Make sure you are working with the latest version of the Metamaps `master` branch.
2. Browse through the [issues][metamaps-issues] to check if
anyone else has already reported. If someone has, feel free to add more
information to that issue to help us solve it.
3. If no one has yet submitted the issue you are encountering, add it in! Please be sure
to include as much information as possible, include errors, warnings,
screenshots, links to a video showing the problem or code that can reproduce
the issue.
## Contributing code
Metamaps is made possible by open source
contributors like you. We're very interested in getting help from the greater
community, but before you start it's important that you become acquainted with
our workflow. Following these guidelines below will make collaboration much
smoother and increase the chances that we will accept your pull request without
hiccups.
### Development Process
Our development process is very similar to the approach
described in the well-known article [A Successful Git Branching Model by Vincent
Driessen][git-branching-model]. Here's an overview:
* Our `master` branch is the branch upon which
Metamaps developers should be basing their work on. The `master` branch is not guaranteed to be stable.
* All commits intended for `master` should take place on your own personal
fork, and be submitted via pull request when ready.
* Only maintainers can accept pull requests from forks into the core Metamaps.cc
repository.
* Please squash your commits into a single commit before making a pull request.
### Getting started
1. Make sure you have a [GitHub account](https://github.com/signup/free)
2. [Fork metamaps][fork-metamaps]
3. Keep your fork up to date. Metamaps is a fast moving project, and things are
changing all the time. It's important that any changes you make are based on
the most recent version of metamaps, since it's possible that something may
have changed that breaks your pull request or invalidates its need.
4. Make sure you have a [Contributor License Agreement](http://caa.metamaps.cc) on file.
5. Read on ...
### Contributor License Agreement
Before we can accept any contributions to Metamaps, we first require that all
individuals or companies agree to our Contributor License Agreement (CLA). The e-mail
address used in the pull request will be used to check if a CLA has already been
filed, so be sure to list all email addresses that you might use to submit your
pull requests when filling it out. Our CLA can be found [here](http://caa.metamaps.cc).
### Testing and Linting
TODO
### Branch grouping tokens
All pull requests submitted to Metamaps.cc should occur on a new branch. For these
branches, we at metamaps use a short token indicating the nature of the branch in
question followed by a solidus (`/`) and a kebab-cased string describing the
branch. We are using the following tokens:
**NOTE: Not sure the above is right, but also not sure what to change it to **
bug // bug fixes
wip // work in progress
feat // feature
Bug fixes follow a [slightly different format](#bug-fixes).
### Bug fixes
If you'd like to contribute a fix for a bug you've encountered, first read up on
[how to report a bug](#reporting-bugs-and-other-issues) and report it so we are
aware of the issue. By filing the issue first, we may be able to provide you
with some insight that guides you in the right direction.
[metamaps-issues]: https://github.com/metamaps/metamaps_gen002/issues
[git-branching-model]: http://nvie.com/posts/a-successful-git-branching-model/
[fork-metamaps]: https://github.com/metamaps/metamaps_gen002/fork
[cla]: http://metamaps.cc/cla

94
Gemfile
View file

@ -1,59 +1,57 @@
# frozen_string_literal: true
source 'https://rubygems.org'
ruby '2.1.3'
ruby '2.3.0'
gem 'rails', '3.2.17'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'rails', '~> 5.0.0'
gem 'active_model_serializers'
gem 'aws-sdk', '~> 2.7.0'
gem 'best_in_place'
gem 'delayed_job'
gem 'delayed_job_active_record'
gem 'devise'
gem 'redis'
gem 'pg'
gem 'cancan'
gem 'formula'
gem 'formtastic'
gem 'doorkeeper'
gem 'dotenv-rails'
gem 'exception_notification'
gem 'httparty'
gem 'json'
gem 'rails3-jquery-autocomplete'
gem 'best_in_place' #in-place editing
gem 'kaminari' # pagination
gem 'uservoice-ruby'
gem 'kaminari'
gem 'mailboxer'
gem 'paperclip'
gem 'aws-sdk'
gem 'pg'
gem 'puma'
gem 'pundit'
gem 'pundit_extra'
gem 'rack-attack'
gem 'rack-cors'
gem 'redis', '~> 3.3.3'
gem 'slack-notifier'
gem 'snorlax'
gem 'sucker_punch'
#gem 'therubyracer' #optional
#gem 'rb-readline'
# asset stuff
gem 'jquery-rails'
gem 'jquery-ui-rails'
gem 'sass-rails'
gem 'uglifier'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails'
gem 'coffee-rails', '~> 3.2.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer'
gem 'uglifier', '>= 1.0.3'
group :test do
gem 'brakeman', require: false
gem 'factory_bot_rails'
gem 'json-schema'
gem 'rspec-rails'
gem 'shoulda-matchers'
gem 'simplecov', require: false
end
group :production do #this is used on heroku
#gem 'rmagick'
group :development, :test do
gem 'better_errors'
gem 'binding_of_caller'
gem 'faker'
gem 'pry-byebug'
gem 'pry-rails'
gem 'rubocop', '~> 0.48.1' # match code climate https://github.com/tootsuite/mastodon/issues/1758
gem 'timecop'
gem 'tunemygc'
end
gem 'jquery-rails', '2.1.2'
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# To use Jbuilder templates for JSON
gem 'jbuilder', '0.8.2'
# Use unicorn as the web server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'

View file

@ -1,181 +1,350 @@
GEM
remote: https://rubygems.org/
specs:
actionmailer (3.2.17)
actionpack (= 3.2.17)
mail (~> 2.5.4)
actionpack (3.2.17)
activemodel (= 3.2.17)
activesupport (= 3.2.17)
builder (~> 3.0.0)
actioncable (5.0.5)
actionpack (= 5.0.5)
nio4r (>= 1.2, < 3.0)
websocket-driver (~> 0.6.1)
actionmailer (5.0.5)
actionpack (= 5.0.5)
actionview (= 5.0.5)
activejob (= 5.0.5)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (5.0.5)
actionview (= 5.0.5)
activesupport (= 5.0.5)
rack (~> 2.0)
rack-test (~> 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (5.0.5)
activesupport (= 5.0.5)
builder (~> 3.1)
erubis (~> 2.7.0)
journey (~> 1.0.4)
rack (~> 1.4.5)
rack-cache (~> 1.2)
rack-test (~> 0.6.1)
sprockets (~> 2.2.1)
activemodel (3.2.17)
activesupport (= 3.2.17)
builder (~> 3.0.0)
activerecord (3.2.17)
activemodel (= 3.2.17)
activesupport (= 3.2.17)
arel (~> 3.0.2)
tzinfo (~> 0.3.29)
activeresource (3.2.17)
activemodel (= 3.2.17)
activesupport (= 3.2.17)
activesupport (3.2.17)
i18n (~> 0.6, >= 0.6.4)
multi_json (~> 1.0)
arel (3.0.3)
aws-sdk (1.54.0)
aws-sdk-v1 (= 1.54.0)
aws-sdk-v1 (1.54.0)
json (~> 1.4)
nokogiri (>= 1.4.4)
bcrypt (3.1.7)
bcrypt (3.1.7-x86-mingw32)
best_in_place (2.1.0)
jquery-rails
rails (~> 3.1)
builder (3.0.4)
cancan (1.6.10)
climate_control (0.0.3)
activesupport (>= 3.0)
cocaine (0.5.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
active_model_serializers (0.10.6)
actionpack (>= 4.1, < 6)
activemodel (>= 4.1, < 6)
case_transform (>= 0.2)
jsonapi-renderer (>= 0.1.1.beta1, < 0.2)
activejob (5.0.5)
activesupport (= 5.0.5)
globalid (>= 0.3.6)
activemodel (5.0.5)
activesupport (= 5.0.5)
activerecord (5.0.5)
activemodel (= 5.0.5)
activesupport (= 5.0.5)
arel (~> 7.0)
activesupport (5.0.5)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (~> 0.7)
minitest (~> 5.1)
tzinfo (~> 1.1)
addressable (2.5.2)
public_suffix (>= 2.0.2, < 4.0)
arel (7.1.4)
ast (2.3.0)
aws-sdk (2.7.0)
aws-sdk-resources (= 2.7.0)
aws-sdk-core (2.7.0)
aws-sigv4 (~> 1.0)
jmespath (~> 1.0)
aws-sdk-resources (2.7.0)
aws-sdk-core (= 2.7.0)
aws-sigv4 (1.0.2)
bcrypt (3.1.11)
best_in_place (3.1.1)
actionpack (>= 3.2)
railties (>= 3.2)
better_errors (2.3.0)
coderay (>= 1.0.0)
erubi (>= 1.0.0)
rack (>= 0.9.0)
binding_of_caller (0.7.2)
debug_inspector (>= 0.0.1)
brakeman (3.7.2)
builder (3.2.3)
byebug (9.1.0)
carrierwave (1.1.0)
activemodel (>= 4.0.0)
activesupport (>= 4.0.0)
mime-types (>= 1.16)
case_transform (0.2)
activesupport
climate_control (0.2.0)
cocaine (0.5.8)
climate_control (>= 0.0.3, < 1.0)
coffee-rails (3.2.2)
coffee-script (>= 2.2.0)
railties (~> 3.2.0)
coffee-script (2.3.0)
coffee-script-source
execjs
coffee-script-source (1.8.0)
devise (3.4.0)
coderay (1.1.2)
concurrent-ruby (1.0.5)
debug_inspector (0.0.3)
delayed_job (4.1.3)
activesupport (>= 3.0, < 5.2)
delayed_job_active_record (4.1.2)
activerecord (>= 3.0, < 5.2)
delayed_job (>= 3.0, < 5)
devise (4.3.0)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 3.2.6, < 5)
railties (>= 4.1.0, < 5.2)
responders
thread_safe (~> 0.1)
warden (~> 1.2.3)
diff-lcs (1.3)
docile (1.1.5)
doorkeeper (4.2.6)
railties (>= 4.2)
dotenv (2.2.1)
dotenv-rails (2.2.1)
dotenv (= 2.2.1)
railties (>= 3.2, < 5.2)
erubi (1.6.1)
erubis (2.7.0)
execjs (2.2.1)
ezcrypto (0.7.2)
formtastic (3.0.0)
actionpack (>= 3.2.13)
formula (1.0.1)
rails (> 3.0.0)
hike (1.2.3)
i18n (0.6.11)
jbuilder (0.8.2)
exception_notification (4.2.2)
actionmailer (>= 4.0, < 6)
activesupport (>= 4.0, < 6)
execjs (2.7.0)
factory_bot (4.8.2)
activesupport (>= 3.0.0)
journey (1.0.4)
jquery-rails (2.1.2)
railties (>= 3.1.0, < 5.0)
thor (~> 0.14)
json (1.8.1)
kaminari (0.16.1)
actionpack (>= 3.0.0)
activesupport (>= 3.0.0)
mail (2.5.4)
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.25.1)
mini_portile (0.6.0)
multi_json (1.10.1)
nokogiri (1.6.3.1)
mini_portile (= 0.6.0)
nokogiri (1.6.3.1-x86-mingw32)
mini_portile (= 0.6.0)
oauth (0.4.7)
factory_bot_rails (4.8.2)
factory_bot (~> 4.8.2)
railties (>= 3.0.0)
faker (1.8.4)
i18n (~> 0.5)
ffi (1.9.18)
globalid (0.4.0)
activesupport (>= 4.2.0)
httparty (0.15.6)
multi_xml (>= 0.5.2)
i18n (0.9.3)
concurrent-ruby (~> 1.0)
jmespath (1.3.1)
jquery-rails (4.3.1)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
jquery-ui-rails (6.0.1)
railties (>= 3.2.16)
json (2.1.0)
json-schema (2.8.0)
addressable (>= 2.4)
jsonapi-renderer (0.1.3)
kaminari (1.0.1)
activesupport (>= 4.1.0)
kaminari-actionview (= 1.0.1)
kaminari-activerecord (= 1.0.1)
kaminari-core (= 1.0.1)
kaminari-actionview (1.0.1)
actionview
kaminari-core (= 1.0.1)
kaminari-activerecord (1.0.1)
activerecord
kaminari-core (= 1.0.1)
kaminari-core (1.0.1)
loofah (2.0.3)
nokogiri (>= 1.5.9)
mail (2.6.6)
mime-types (>= 1.16, < 4)
mailboxer (0.15.1)
carrierwave (>= 0.5.8)
rails (>= 5.0.0)
method_source (0.8.2)
mime-types (3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521)
mimemagic (0.3.2)
mini_portile2 (2.3.0)
minitest (5.11.1)
multi_xml (0.6.0)
nio4r (2.1.0)
nokogiri (1.8.1)
mini_portile2 (~> 2.3.0)
orm_adapter (0.5.0)
paperclip (4.2.0)
activemodel (>= 3.0.0)
activesupport (>= 3.0.0)
cocaine (~> 0.5.3)
paperclip (5.2.0)
activemodel (>= 4.2.0)
activesupport (>= 4.2.0)
cocaine (~> 0.5.5)
mime-types
pg (0.17.1)
pg (0.17.1-x86-mingw32)
polyglot (0.3.5)
rack (1.4.5)
rack-cache (1.2)
rack (>= 0.4)
rack-ssl (1.3.4)
mimemagic (~> 0.3.0)
parser (2.4.0.2)
ast (~> 2.3)
pg (0.21.0)
powerpack (0.1.1)
pry (0.10.4)
coderay (~> 1.1.0)
method_source (~> 0.8.1)
slop (~> 3.4)
pry-byebug (3.5.0)
byebug (~> 9.1)
pry (~> 0.10)
pry-rails (0.3.6)
pry (>= 0.10.4)
public_suffix (3.0.0)
puma (3.10.0)
pundit (1.1.0)
activesupport (>= 3.0.0)
pundit_extra (0.3.0)
rack (2.0.3)
rack-attack (5.0.1)
rack
rack-test (0.6.2)
rack-cors (1.0.1)
rack-test (0.6.3)
rack (>= 1.0)
rails (3.2.17)
actionmailer (= 3.2.17)
actionpack (= 3.2.17)
activerecord (= 3.2.17)
activeresource (= 3.2.17)
activesupport (= 3.2.17)
bundler (~> 1.0)
railties (= 3.2.17)
rails3-jquery-autocomplete (1.0.14)
rails (>= 3.0)
railties (3.2.17)
actionpack (= 3.2.17)
activesupport (= 3.2.17)
rack-ssl (~> 1.3.2)
rails (5.0.5)
actioncable (= 5.0.5)
actionmailer (= 5.0.5)
actionpack (= 5.0.5)
actionview (= 5.0.5)
activejob (= 5.0.5)
activemodel (= 5.0.5)
activerecord (= 5.0.5)
activesupport (= 5.0.5)
bundler (>= 1.3.0)
railties (= 5.0.5)
sprockets-rails (>= 2.0.0)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.0.3)
loofah (~> 2.0)
railties (5.0.5)
actionpack (= 5.0.5)
activesupport (= 5.0.5)
method_source
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (>= 0.14.6, < 2.0)
rake (10.3.2)
rdoc (3.12.2)
json (~> 1.4)
redis (3.1.0)
responders (1.1.1)
railties (>= 3.2, < 4.2)
sass (3.4.5)
sass-rails (3.2.6)
railties (~> 3.2.0)
sass (>= 3.1.10)
tilt (~> 1.3)
sprockets (2.2.2)
hike (~> 1.2)
multi_json (~> 1.0)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
thor (0.19.1)
thread_safe (0.3.4)
tilt (1.4.1)
treetop (1.4.15)
polyglot
polyglot (>= 0.3.1)
tzinfo (0.3.41)
uglifier (2.5.3)
execjs (>= 0.3.0)
json (>= 1.8.0)
uservoice-ruby (0.0.11)
ezcrypto (>= 0.7.2)
json (>= 1.7.5)
oauth (>= 0.4.7)
warden (1.2.3)
thor (>= 0.18.1, < 2.0)
rainbow (2.2.2)
rake
rake (12.3.0)
rb-fsevent (0.10.2)
rb-inotify (0.9.10)
ffi (>= 0.5.0, < 2)
redis (3.3.3)
responders (2.4.0)
actionpack (>= 4.2.0, < 5.3)
railties (>= 4.2.0, < 5.3)
rspec-core (3.6.0)
rspec-support (~> 3.6.0)
rspec-expectations (3.6.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.6.0)
rspec-mocks (3.6.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.6.0)
rspec-rails (3.6.1)
actionpack (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
rspec-core (~> 3.6.0)
rspec-expectations (~> 3.6.0)
rspec-mocks (~> 3.6.0)
rspec-support (~> 3.6.0)
rspec-support (3.6.0)
rubocop (0.48.1)
parser (>= 2.3.3.1, < 3.0)
powerpack (~> 0.1)
rainbow (>= 1.99.1, < 3.0)
ruby-progressbar (~> 1.7)
unicode-display_width (~> 1.0, >= 1.0.1)
ruby-progressbar (1.9.0)
sass (3.5.1)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
sass-rails (5.0.6)
railties (>= 4.0.0, < 6)
sass (~> 3.1)
sprockets (>= 2.8, < 4.0)
sprockets-rails (>= 2.0, < 4.0)
tilt (>= 1.1, < 3)
shoulda-matchers (3.1.2)
activesupport (>= 4.0.0)
simplecov (0.15.0)
docile (~> 1.1.0)
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.2)
slack-notifier (2.3.1)
slop (3.6.0)
snorlax (0.1.6)
rails (> 4.1)
sprockets (3.7.1)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-rails (3.2.1)
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
sucker_punch (2.0.3)
concurrent-ruby (~> 1.0.0)
thor (0.20.0)
thread_safe (0.3.6)
tilt (2.0.8)
timecop (0.9.1)
tunemygc (1.0.69)
tzinfo (1.2.4)
thread_safe (~> 0.1)
uglifier (3.2.0)
execjs (>= 0.3.0, < 3)
unicode-display_width (1.3.0)
warden (1.2.7)
rack (>= 1.0)
websocket-driver (0.6.5)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.2)
PLATFORMS
ruby
x86-mingw32
DEPENDENCIES
aws-sdk
active_model_serializers
aws-sdk (~> 2.7.0)
best_in_place
cancan
coffee-rails (~> 3.2.1)
better_errors
binding_of_caller
brakeman
delayed_job
delayed_job_active_record
devise
formtastic
formula
jbuilder (= 0.8.2)
jquery-rails (= 2.1.2)
doorkeeper
dotenv-rails
exception_notification
factory_bot_rails
faker
httparty
jquery-rails
jquery-ui-rails
json
json-schema
kaminari
mailboxer
paperclip
pg
rails (= 3.2.17)
rails3-jquery-autocomplete
redis
pry-byebug
pry-rails
puma
pundit
pundit_extra
rack-attack
rack-cors
rails (~> 5.0.0)
redis (~> 3.3.3)
rspec-rails
rubocop (~> 0.48.1)
sass-rails
uglifier (>= 1.0.3)
uservoice-ruby
shoulda-matchers
simplecov
slack-notifier
snorlax
sucker_punch
timecop
tunemygc
uglifier
RUBY VERSION
ruby 2.3.0p0
BUNDLED WITH
1.16.1

View file

@ -1,42 +0,0 @@
If you are doing an upgrade and or recent pull for changes you will need to change your default ruby package from 2.1.1 to ruby 2.1.2
install homebrew
\curl -sSL https://get.rvm.io | bash -s stable --rails
rvm install 2.1.3 --with-gcc=clang
rvm use 2.1.3
gem install lunchy
(http://www.moncefbelyamani.com/how-to-install-postgresql-on-a-mac-with-homebrew-and-lunchy/)
brew install postgresql
ln -sfv /usr/local/opt/postgresql/*.plist ~/Library/LaunchAgents
createuser metamaps -P -s -d
set a password
lunchy start postgres
cd into the metamaps directory
bundle install
copy the database.yml.default file and rename it database.yml
make sure the username and password match the POSTGRES username and password you set
http://nodejs.org/ hit install, download, open, install
rake db:create
rake db:schema:load
rake db:fixtures:load
rails s
( to start the server)

View file

@ -1 +1,3 @@
web: bundle exec rails server -p $PORT
web: bundle exec puma -p $PORT
worker: bundle exec rake jobs:work

View file

@ -1,77 +1,62 @@
Metamaps
=======
[![Join the chat at https://gitter.im/metamaps/metamaps_gen002](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/metamaps/metamaps_gen002?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Build Status](https://travis-ci.org/metamaps/metamaps.svg?branch=develop)](https://travis-ci.org/metamaps/metamaps)
[![Code Climate](https://codeclimate.com/github/metamaps/metamaps/badges/gpa.svg)](https://codeclimate.com/github/metamaps/metamaps)
Welcome to the Metamaps GitHub repo.
## What is Metamaps?
## About
Metamaps is a free and open-source technology for changemakers, innovators, educators and students. It enables individuals and communities to build and visualize their shared knowledge and unlock their collective intelligence.
Metamaps is a free and AGPL open source technology for changemakers, innovators, educators and students. It enables individuals and communities to build and visualize their shared knowledge and unlock their collective intelligence. You can find out about more about the project at the [blog][site-blog].
You can find a version of this software running at [metamaps.cc][site-beta], where the technology is being tested in an open beta.
You can find a version of this software running at [metamaps.cc][site-beta], where the technology is being tested in a private beta.
Metamaps is developed and maintained by a distributed, nomadic community comprised of technologists, artists and storytellers. You can get in touch by using whichever of these channels you prefer:
Metamaps is created and maintained by a distributed, nomadic community comprised of technologists, artists and storytellers. You can get in touch with us at team@metamaps.cc or @metamapps on twitter.
## How do I learn more?
- Contact: [team@metamaps.cc](mailto:team@metamaps.cc) or [@metamapps](https://twitter.com/metamapps) on Twitter
- User Documentation: [docs.metamaps.cc](https://docs.metamaps.cc)
- User Community: [hylo.com/c/metamaps](https://www.hylo.com/c/metamaps)
- To see what we're developing, or to weigh in on what you'd like to see developed, see our [Metamaps Feedback and Features](https://trello.com/b/uFOA6a2x/metamaps-feedback-feature-ideas-requests) board on trello
- To follow along with, or contribute,to our design process, see our [Metamaps Design](https://trello.com/b/8HlCikOX/metamaps-design) board on trello
- To follow along with, or contribute to, our development process, see our [Github Issues and Pull Requests](https://github.com/metamaps/metamaps/issues)
- Request an invite to the open beta [here](https://metamaps.cc/request)
To get connected with the community interested in Metamaps, join our [Google+ community][community].
## Installation
If you are on Mac or Ubuntu you can use the following instructions to quickly get a local copy of metamaps up and running using a Vagrant virtualbox. Don't be intimidated, it's easy!
```
git clone git@github.com:metamaps/metamaps_gen002.git
```
Now ensure you have VirtualBox and Vagrant installed on your computer
```
cd metamaps_gen002
./configure.sh
```
This will do all the setup steps to make Metamaps work with a bit of behind the scenes ninja magick.
To start servers which will run metamaps you can then run:
```
./bin/start
```
To stop them:
```
./bin/stop
```
With your webservers running, open a web browser and go to `http://localhost:3000`
You can sign in with the default account
email: `user@user.com`
password: `toolsplusconsciousness`
OR create a new account at `/join`, and use access code `qwertyui`
Start mapping and programming!
While we are still figuring out vagrant for Windows, there is an older set of instructions below
- [For Windows][windows-installation]
## Contributing
Cloning this repository directly is primarily for those wishing to contribute to our codebase. Check out our [contributing instructions][contributing] to get involved.
## Community
<!-- markdown hack to split two lists -->
- To send us a personal message get in touch with us via email, Twitter, or Hylo
- If you would like to report a bug, please check the [issues][contributing-issues] section in our [contributing instructions][contributing].
- To participate in discussions and a public forum about Metamaps, join the [Google+ community][community]
- For contributors, read more instructions in [CONTRIBUTING.md][contributing].
- If you would like to get set up as a developer, that's great! Read on for help getting your development environment set up.
## Installation for local use or development of Metamaps
First off is getting the code downloaded to your computer. You can download a zip file from github, but if you've got `git` you can just run `git clone https://github.com/metamaps/metamaps` in your terminal.
There are instructions for setup on various platforms, with particular support for Mac and Ubuntu, which can be found here:
- [Mac Install Walkthrough][mac-installation]
- [Ubuntu Install Walkthrough][ubuntu-installation]
If you prefer to isolate your install in a virtual machine, you may find it simpler to setup using Vagrant:
- [Vagrant installation][vagrant-installation]
We don't promise support for Windows, but at one point we had it running and we've kept those docs available for reference
- [Outdated Windows Walkthrough][windows-installation]
## Licensing information
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or(at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
The license can be read [here][license].
Copyright (c) 2015 Connor Turland
Copyright (c) 2017 Connor Turland
[site-blog]: http://blog.metamaps.cc
[site-beta]: http://metamaps.cc
[community]: https://plus.google.com/u/0/communities/115060009262157699234
[license]: https://github.com/metamaps/metamaps_gen002/blob/master/LICENSE
[contributing]: https://github.com/metamaps/metamaps_gen002/blob/master/CONTRIBUTING.md
[contributing-issues]: https://github.com/metamaps/metamaps_gen002/blob/master/CONTRIBUTING.md#reporting-bugs-and-other-issues
[windows-installation]: https://github.com/metamaps/metamaps_gen002/blob/master/WindowsInstallation.md
[license]: https://github.com/metamaps/metamaps/blob/develop/LICENSE
[contributing]: https://github.com/metamaps/metamaps/blob/develop/doc/CONTRIBUTING.md
[contributing-issues]: https://github.com/metamaps/metamaps/blob/develop/doc/CONTRIBUTING.md#reporting-bugs-and-other-issues
[mac-installation]: https://github.com/metamaps/metamaps/blob/develop/doc/MacInstallation.md
[ubuntu-installation]: https://github.com/metamaps/metamaps/blob/develop/doc/UbuntuInstallation.md
[vagrant-installation]: https://github.com/metamaps/metamaps/blob/develop/doc/VagrantInstallation.md
[windows-installation]: https://github.com/metamaps/metamaps/blob/develop/doc/WindowsInstallation.md

2
Rakefile Normal file → Executable file
View file

@ -1,4 +1,6 @@
#!/usr/bin/env rake
# frozen_string_literal: true
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.

View file

@ -1,114 +0,0 @@
Firstly this walkthrough is done with a 14.04 32bit install of Ubuntu.
All commands that I could are terminal based.
Lets check if all updates for the system are installed first
in terminal type
sudo apt-get update
now we need to install git
sudo apt-get install git
lets get our RVM installed (Ruby Version Manager) now this is fun because the package you will get from apt-get is outdated.
so we are going to use CURL to get RVM
sudo apt-get install curl
then lets install RVM with curl like this
curl -L get.rvm.io | bash -s stable
PATH=$PATH:$HOME/.rvm/bin
[[ -s "$HOME/.profile" ]] && source "$HOME/.profile"
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
source ~/.rvm/scripts/rvm
now we can actually install RVM
rvm requirements
running this will check your system for requirements as well so you will need to put your system password in.
alright now we can download metamaps from the master using git
git clone https://github.com/metamaps/metamaps_gen002.git
now there is a couple other things we are going to need which is nodejs, postgresql, libpq-dev and redis-server
sudo apt-get install nodejs
sudo apt-get install postgresql
sudo apt-get install libpq-dev
sudo apt-get install redis-server
Furthermore, if you want to be able to work on profile picture uploading, or use it
you'll need ImageMagick. On Ubuntu, you can just go find ImageMagick in the Ubuntu Software Centre
Install the specific version of ruby needed this will take some time
rvm install ruby-2.1.3
Now we also need to rename your database file which is in ./config/database.default.yml to database.yml
now run inside your metamaps_gen002 folder
bundle install
in your top lvl directory for metamaps this is a lengthy process so you might want to go and make a coffee or something :)
alright now we need to make sure your postgres password is the same as it is listed in the DB file so we are going to set it by
sudo -u postgres psql
Select postgres like this
\password postgres
set the password to 3112
Then to quit
\q
now we can run the rake install and db creation
rake db:create
rake db:schema:load
rake db:fixtures:load
Execute the server:
rails s
and dont forget to run the other server for realtime...
open a new terminal
navigate to ./realtime and run
sudo apt-get install npm
npm install
nodejs realtime-server.js
Now you're all set enjoy your personal server of metamaps :)
Navigate your browser to localhost:3000 once you have the server running
Sign in with the default account
email: user@user.com
password: toolsplusconsciousness
OR create a new account at /join, and use access code 'qwertyui'
Start mapping and programming!

20
Vagrantfile vendored
View file

@ -9,14 +9,16 @@ sudo apt-get install git curl -y
# rvm and ruby
su - vagrant -c 'curl -sSL https://rvm.io/mpapis.asc | gpg --import -'
su - vagrant -c 'curl -sSL https://get.rvm.io | bash -s stable --ruby=2.1.3'
su - vagrant -c 'curl -sSL https://get.rvm.io | bash -s stable --ruby=2.3.0'
# install some other deps
sudo apt-get install nodejs -y
sudo apt-get install npm -y
sudo apt-get install postgresql -y
sudo apt-get install libpq-dev -y
sudo apt-get install redis-server -y
# get imagemagick
sudo apt-get install imagemagick --fix-missing
# Install node
ln -fs /usr/bin/nodejs /usr/bin/node
@ -29,15 +31,15 @@ sudo -u postgres psql -c "ALTER USER postgres WITH PASSWORD '3112';"
SCRIPT
VAGRANTFILE_API_VERSION = "2"
VAGRANTFILE_API_VERSION = '2'
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "trusty64"
config.vm.box_url = "http://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box"
config.vm.box = 'trusty64'
config.vm.box_url = 'http://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box'
config.vm.network :forwarded_port, guest: 3000, host: 3000
config.vm.network :forwarded_port, guest: 5001, host: 5001
config.vm.network "private_network", ip: "10.0.1.11"
config.vm.synced_folder ".", "/vagrant", :nfs => true
config.vm.network :forwarded_port, guest: 5000, host: 5000
config.vm.network 'private_network', ip: '10.0.1.11'
config.vm.synced_folder '.', '/vagrant', nfs: true
config.vm.provision "shell", inline: $script
config.vm.provision 'shell', inline: $script
end

View file

@ -1,49 +0,0 @@
First off, Metamaps runs on Ruby On Rails. Ruby 2.1.3 and Rails 3.2. You'll need to get Ruby and Rails installed on your computer if you don't already have it. Go to here for Ruby http://rubyinstaller.org/downloads/
You'll also need GIT: http://git-scm.com/download/win
It uses postgreSQL 9.2 as a database. You can install that for your computer from here: http://www.enterprisedb.com/products-services-training/pgdownload . During installation you can choose whatever database password you like. Make sure to note it down!
Once you install those, open a 'command prompt with ruby'.
to install rails
gem install rails -v 3.2
also download node.js, which is also needed http://nodejs.org/download/
Navigate to the folder that you want to download the metamaps files to and run the following: (use your forked git repository address if it's different than this repo. You will also need to go to your Github account settings and add the SSH key that was placed in your clipboard earlier)
git clone https://github.com/metamaps/metamaps_gen002.git --branch develop
cd metamaps_gen002
Now you're in the main directory.
Install all the gems needed for Metamaps by running
bundle install
Setting up the database:
1) Copy /config/database.yml.default and rename the copy to /config/database.yml then edit database.yml with your text editor and set the password to whatever you chose when you set up the PostGres database.
2) In a terminal:
rake db:create
rake db:schema:load
rake db:fixtures:load
Running the server:
rails s
Navigate your browser to localhost:3000 once you have the server running
Sign in with the default account
email: user@user.com
password: toolsplusconsciousness
OR create a new account at /join, and use access code 'qwertyui'
Start mapping and programming!

View file

@ -0,0 +1,7 @@
// eslint-disable spaced-comment
// JS and CSS bundles
//= link_directory ../javascripts .js
//= link_directory ../stylesheets .css
// Other
//= link_tree ../images

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 322 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 543 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 854 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 780 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 466 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 B

BIN
app/assets/images/exploremaps_sprite.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

BIN
app/assets/images/junto.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

BIN
app/assets/images/junto.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 667 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 822 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 418 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 717 B

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 739 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 331 B

BIN
app/assets/images/user_sprite.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 421 B

View file

@ -0,0 +1,21 @@
/* global Metamaps */
/* erb variables from rails */
Metamaps.ServerData = Metamaps.ServerData || {}
Metamaps.ServerData['junto_spinner_darkgrey.gif'] = '<%= asset_path('junto_spinner_darkgrey.gif') %>'
Metamaps.ServerData['user.png'] = '<%= asset_path('user.png') %>'
Metamaps.ServerData['icons/wildcard.png'] = '<%= asset_path('icons/wildcard.png') %>'
Metamaps.ServerData['topic_description_signifier.png'] = '<%= asset_path('topic_description_signifier.png') %>'
Metamaps.ServerData['topic_link_signifier.png'] = '<%= asset_path('topic_link_signifier.png') %>'
Metamaps.ServerData['synapse16.png'] = '<%= asset_path('synapse16.png') %>'
Metamaps.ServerData['sounds/MM_sounds.mp3'] = '<%= asset_path 'sounds/MM_sounds.mp3' %>'
Metamaps.ServerData['sounds/MM_sounds.ogg'] = '<%= asset_path 'sounds/MM_sounds.ogg' %>'
Metamaps.ServerData['exploremaps_sprite.png'] = '<%= asset_path 'exploremaps_sprite.png' %>'
Metamaps.ServerData['map_control_sprite.png'] = '<%= asset_path 'map_control_sprite.png' %>'
Metamaps.ServerData['user_sprite.png'] = '<%= asset_path 'user_sprite.png' %>'
Metamaps.ServerData.Metacodes = <%= Metacode.all.to_json.gsub(%r[(icon.*?)(\"},)], '\1?purple=stupid\2').html_safe %>
Metamaps.ServerData.REALTIME_SERVER = '<%= ENV['REALTIME_SERVER'] %>'
Metamaps.ServerData.RAILS_ENV = '<%= ENV['RAILS_ENV'] %>'
Metamaps.ServerData.VERSION = '<%= METAMAPS_VERSION %>'
Metamaps.ServerData.BUILD = '<%= METAMAPS_BUILD %>'
Metamaps.ServerData.LAST_UPDATED = '<%= METAMAPS_LAST_UPDATED %>'

View file

@ -0,0 +1,23 @@
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
// GO AFTER THE REQUIRES BELOW.
//
/* eslint-disable spaced-comment */
//= require jquery
//= require jquery-ui
//= require jquery_ujs
//= require action_cable
//= require_directory ./lib
//= require ./cloudcarousel-secret
//= require ./metamaps.secret.bundle
//= require ./Metamaps.ServerData
//= require homepageVimeoFallback
/* eslint-enable spaced-comment */

View file

@ -1,28 +1,22 @@
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
// GO AFTER THE REQUIRES BELOW.
//
//= require jquery
//= require jquery-ui
//= require jquery_ujs
//= require ./orderedLibraries/underscore
//= require ./orderedLibraries/backbone
//= require_directory ./lib
//= require ./src/Metamaps.GlobalUI
//= require ./src/Metamaps.Router
//= require ./src/Metamaps.Backbone
//= require ./src/Metamaps.Views
//= require ./src/JIT
//= require ./src/Metamaps
//= require ./src/Metamaps.JIT
//= require_directory ./shims
//= require_directory ./require
//= require_directory ./famous
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
// GO AFTER THE REQUIRES BELOW.
//
/* eslint-disable spaced-comment */
//= require jquery
//= require jquery-ui
//= require jquery_ujs
//= require action_cable
//= require_directory ./lib
//= require ./webpacked/metamaps.bundle
//= require ./Metamaps.ServerData
//= require homepageVimeoFallback
/* eslint-enable spaced-comment */

View file

@ -0,0 +1,438 @@
//////////////////////////////////////////////////////////////////////////////////
// CloudCarousel V1.0.5
// (c) 2011 by R Cecco. <http://www.professorcloud.com>
// MIT License
//
// Reflection code based on plugin by Christophe Beyls <http://www.digitalia.be>
//
// Please retain this copyright header in all versions of the software
//////////////////////////////////////////////////////////////////////////////////
var matched, browser;
jQuery.uaMatch = function( ua ) {
ua = ua.toLowerCase();
var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) ||
/(webkit)[ \/]([\w.]+)/.exec( ua ) ||
/(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) ||
/(msie) ([\w.]+)/.exec( ua ) ||
ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua ) ||
[];
return {
browser: match[ 1 ] || "",
version: match[ 2 ] || "0"
};
};
matched = jQuery.uaMatch( navigator.userAgent );
browser = {};
if ( matched.browser ) {
browser[ matched.browser ] = true;
browser.version = matched.version;
}
// Chrome is Webkit, but Webkit is also Safari.
if ( browser.chrome ) {
browser.webkit = true;
} else if ( browser.webkit ) {
browser.safari = true;
}
jQuery.browser = browser;
(function($) {
// START Reflection object.
// Creates a reflection for underneath an image.
// IE uses an image with IE specific filter properties, other browsers use the Canvas tag.
// The position and size of the reflection gets updated by updateAll() in Controller.
function Reflection(img, reflHeight, opacity) {
var reflection, cntx, imageWidth = img.width, imageHeight = img.width, gradient, parent;
parent = $(img.parentNode);
this.element = reflection = parent.append("<canvas class='reflection' style='position:absolute'/>").find(':last')[0];
if ( !reflection.getContext && $.browser.msie) {
this.element = reflection = parent.append("<img class='reflection' style='position:absolute'/>").find(':last')[0];
reflection.src = img.src;
reflection.style.filter = "flipv progid:DXImageTransform.Microsoft.Alpha(opacity=" + (opacity * 100) + ", style=1, finishOpacity=0, startx=0, starty=0, finishx=0, finishy=" + (reflHeight / imageHeight * 100) + ")";
} else {
cntx = reflection.getContext("2d");
try {
$(reflection).attr({width: imageWidth, height: reflHeight});
cntx.save();
cntx.translate(0, imageHeight-1);
cntx.scale(1, -1);
cntx.drawImage(img, 0, 0, imageWidth, imageHeight);
cntx.restore();
cntx.globalCompositeOperation = "destination-out";
gradient = cntx.createLinearGradient(0, 0, 0, reflHeight);
gradient.addColorStop(0, "rgba(255, 255, 255, " + (1 - opacity) + ")");
gradient.addColorStop(1, "rgba(255, 255, 255, 1.0)");
cntx.fillStyle = gradient;
cntx.fillRect(0, 0, imageWidth, reflHeight);
} catch(e) {
return;
}
}
// Store a copy of the alt and title attrs into the reflection
$(reflection).attr({ 'alt': $(img).attr('alt'), title: $(img).attr('title')} );
} //END Reflection object
// START Item object.
// A wrapper object for items within the carousel.
var Item = function(imgIn, options)
{
this.orgWidth = imgIn.width;
this.orgHeight = imgIn.height;
this.image = imgIn;
this.reflection = null;
this.alt = imgIn.alt;
this.title = imgIn.title;
this.imageOK = false;
this.options = options;
this.imageOK = true;
if (this.options.reflHeight > 0)
{
this.reflection = new Reflection(this.image, this.options.reflHeight, this.options.reflOpacity);
}
$(this.image).css('position','absolute'); // Bizarre. This seems to reset image width to 0 on webkit!
};// END Item object
// Controller object.
// This handles moving all the items, dealing with mouse clicks etc.
var Controller = function(container, images, options)
{
var items = [], funcSin = Math.sin, funcCos = Math.cos, ctx=this;
this.controlTimer = 0;
this.stopped = false;
//this.imagesLoaded = 0;
this.container = container;
this.xRadius = options.xRadius;
this.yRadius = options.yRadius;
this.showFrontTextTimer = 0;
this.autoRotateTimer = 0;
if (options.xRadius === 0)
{
this.xRadius = ($(container).width()/2.3);
}
if (options.yRadius === 0)
{
this.yRadius = ($(container).height()/6);
}
this.xCentre = options.xPos;
this.yCentre = options.yPos;
this.frontIndex = 0; // Index of the item at the front
// Start with the first item at the front.
this.rotation = this.destRotation = Math.PI/2;
this.timeDelay = 1000/options.FPS;
// Turn on the infoBox
if(options.altBox !== null)
{
$(options.altBox).css('display','block');
$(options.titleBox).css('display','block');
}
// Turn on relative position for container to allow absolutely positioned elements
// within it to work.
$(container).css({ position:'relative', overflow:'hidden'} );
$(options.buttonLeft).css('display','inline');
$(options.buttonRight).css('display','inline');
// Setup the buttons.
$(options.buttonLeft).bind('mouseup',this,function(event){
event.data.rotate(-1);
return false;
});
$(options.buttonRight).bind('mouseup',this,function(event){
event.data.rotate(1);
return false;
});
// START METAMAPS CODE
// Add code that makes tab and shift+tab scroll through metacodes
$('.new_topic').bind('keydown',this,function(event){
if (event.keyCode == 9 && event.shiftKey) {
$(container).show()
event.data.rotate(-1);
event.preventDefault();
event.stopPropagation();
} else if (event.keyCode == 9) {
$(container).show()
event.data.rotate(1);
event.preventDefault();
event.stopPropagation();
}
});
// END METAMAPS CODE
// You will need this plugin for the mousewheel to work: http://plugins.jquery.com/project/mousewheel
if (options.mouseWheel)
{
// START METAMAPS CODE
/*$('body').bind('mousewheel',this,function(event, delta) {
if (Metamaps.Create.newTopic.beingCreated &&
!Metamaps.Create.isSwitchingSet &&
!Metamaps.Create.newTopic.pinned) {
event.data.rotate(delta);
return false;
}
});*/
// END METAMAPS CODE
// ORIGINAL CODE
// $(container).bind('mousewheel',this,function(event, delta) {
// event.data.rotate(delta);
// return false;
// });
//
}
$(container).unbind('mouseover click').bind('mouseover click',this,function(event){
clearInterval(event.data.autoRotateTimer); // Stop auto rotation if mouse over.
var text = $(event.target).attr('alt');
// If we have moved over a carousel item, then show the alt and title text.
if ( text !== undefined && text !== null )
{
clearTimeout(event.data.showFrontTextTimer);
$(options.altBox).html( ($(event.target).attr('alt') ));
//$(options.titleBox).html( ($(event.target).attr('title') ));
if ( options.bringToFront && event.type == 'click' )
{
$(options.titleBox).html( ($(event.target).attr('title') ));
// START METAMAPS CODE
Metamaps.Create.newTopic.metacode = $(event.target).attr('data-id');
// END METAMAPS CODE
var idx = $(event.target).data('itemIndex');
var frontIndex = event.data.frontIndex;
//var diff = idx - frontIndex;
var diff = (idx - frontIndex) % images.length;
if (Math.abs(diff) > images.length / 2) {
diff += (diff > 0 ? -images.length : images.length);
}
event.data.rotate(-diff);
}
}
});
// START METAMAPS CODE - initialize newTopic.metacode
var first = $(this.container).find('img').get(0)
Metamaps.Create.newTopic.metacode = $(first).data('id')
// END METAMAPS CODE
// If we have moved out of a carousel item (or the container itself),
// restore the text of the front item in 1 second.
$(container).bind('mouseout',this,function(event){
var context = event.data;
clearTimeout(context.showFrontTextTimer);
context.showFrontTextTimer = setTimeout( function(){context.showFrontText();},1000);
context.autoRotate(); // Start auto rotation.
});
// Prevent items from being selected as mouse is moved and clicked in the container.
$(container).bind('mousedown',this,function(event){
event.data.container.focus();
return false;
});
container.onselectstart = function () { return false; }; // For IE.
this.innerWrapper = $(container).wrapInner('<div style="position:absolute;width:100%;height:100%;"/>').children()[0];
// Shows the text from the front most item.
this.showFrontText = function()
{
if ( items[this.frontIndex] === undefined ) { return; } // Images might not have loaded yet.
// METAMAPS CODE
Metamaps.Create.newTopic.setMetacode($(items[this.frontIndex].image).attr('data-id'))
// NOT METAMAPS CODE
//$(options.titleBox).html( $(items[this.frontIndex].image).attr('title'));
//$(options.altBox).html( $(items[this.frontIndex].image).attr('alt'));
};
this.go = function()
{
if(this.controlTimer !== 0) { return; }
var context = this;
this.controlTimer = setTimeout( function(){context.updateAll();},this.timeDelay);
};
this.stop = function()
{
clearTimeout(this.controlTimer);
this.controlTimer = 0;
// METAMAPS CODE
$(container).hide()
// END METAMAPS CODE
};
// Starts the rotation of the carousel. Direction is the number (+-) of carousel items to rotate by.
this.rotate = function(direction)
{
this.frontIndex -= direction;
if (this.frontIndex == -1) this.frontIndex = items.length - 1;
this.frontIndex %= items.length;
this.destRotation += ( Math.PI / items.length ) * ( 2*direction );
this.showFrontText();
this.go();
};
this.autoRotate = function()
{
if ( options.autoRotate !== 'no' )
{
var dir = (options.autoRotate === 'right')? 1 : -1;
this.autoRotateTimer = setInterval( function(){ctx.rotate(dir); }, options.autoRotateDelay );
}
};
// This is the main loop function that moves everything.
this.updateAll = function()
{
var minScale = options.minScale; // This is the smallest scale applied to the furthest item.
var smallRange = (1-minScale) * 0.5;
var w,h,x,y,scale,item,sinVal;
var change = (this.destRotation - this.rotation);
var absChange = Math.abs(change);
this.rotation += change * options.speed;
if ( absChange < 0.001 ) { this.rotation = this.destRotation; }
var itemsLen = items.length;
var spacing = (Math.PI / itemsLen) * 2;
//var wrapStyle = null;
var radians = this.rotation;
var isMSIE = $.browser.msie;
// Turn off display. This can reduce repaints/reflows when making style and position changes in the loop.
// See http://dev.opera.com/articles/view/efficient-javascript/?page=3
this.innerWrapper.style.display = 'none';
var style;
var px = 'px', reflHeight;
var context = this;
for (var i = 0; i<itemsLen ;i++)
{
item = items[i];
sinVal = funcSin(radians);
scale = ((sinVal+1) * smallRange) + minScale;
x = this.xCentre + (( (funcCos(radians) * this.xRadius) - (item.orgWidth*0.5)) * scale);
y = this.yCentre + (( (sinVal * this.yRadius) ) * scale);
if (item.imageOK)
{
var img = item.image;
img.style.zIndex = "" + (scale * 100)>>0; // >>0 = Math.foor(). Firefox doesn't like fractional decimals in z-index.
w = img.width = item.orgWidth * scale;
h = img.height = item.orgHeight * scale;
img.style.left = x + px ;
img.style.top = y + px;
if (item.reflection !== null)
{
reflHeight = options.reflHeight * scale;
style = item.reflection.element.style;
style.left = x + px;
style.top = y + h + options.reflGap * scale + px;
style.width = w + px;
if (isMSIE)
{
style.filter.finishy = (reflHeight / h * 100);
}else
{
style.height = reflHeight + px;
}
}
}
radians += spacing;
}
// Turn display back on.
this.innerWrapper.style.display = 'block';
// If we have a preceptable change in rotation then loop again next frame.
if ( absChange >= 0.001 )
{
this.controlTimer = setTimeout( function(){context.updateAll();},this.timeDelay);
}else
{
// Otherwise just stop completely.
this.stop();
}
}; // END updateAll
// Create an Item object for each image
// func = function(){return;ctx.updateAll();} ;
// Check if images have loaded. We need valid widths and heights for the reflections.
this.checkImagesLoaded = function()
{
var i;
for(i=0;i<images.length;i++) {
if ( (images[i].width === undefined) || ( (images[i].complete !== undefined) && (!images[i].complete) ))
{
return;
}
}
for(i=0;i<images.length;i++) {
items.push( new Item( images[i], options ) );
$(images[i]).data('itemIndex',i);
}
// If all images have valid widths and heights, we can stop checking.
clearInterval(this.tt);
// METAMAPS COMMENT this.showFrontText();
this.autoRotate();
this.updateAll();
};
this.tt = setInterval( function(){ctx.checkImagesLoaded();},50);
}; // END Controller object
// The jQuery plugin part. Iterates through items specified in selector and inits a Controller class for each one.
$.fn.CloudCarousel = function(options) {
this.each( function() {
options = $.extend({}, {
reflHeight:0,
reflOpacity:0.5,
reflGap:0,
minScale:0.5,
xPos:0,
yPos:0,
xRadius:0,
yRadius:0,
altBox:null,
titleBox:null,
FPS: 30,
autoRotate: 'no',
autoRotateDelay: 1500,
speed:0.2,
mouseWheel: false,
bringToFront: false
},options );
// Create a Controller for each carousel.
$(this).data('cloudcarousel', new Controller( this, $('.cloudcarousel',$(this)), options) );
});
return this;
};
})(jQuery);

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,29 @@
/* global $ */
$(document).ready(function() {
if (window.location.pathname === '/') {
$.ajax({
type: 'GET',
url: 'https://i.vimeocdn.com/video/',
error: function(e) {
$('.homeVideo').hide()
$('.homeVideo').replaceWith($('<video/>', {
poster: '<%= asset_path('metamaps-intro-poster.webp') %>',
width: '560',
height: '315',
class: 'homeVideo',
controls: ''
}))
$('.homeVideo').append($('<source/>', {
src: 'https://metamaps.cc/videos/metamaps-intro.mp4',
type: 'video/mp4'
}))
$('.homeVideo').append(
'<p>You can watch our instruction video at ' +
'<a href="https://metamaps.cc/videos/metamaps-intro.mp4">' +
'https://metamaps.cc/videos/metamaps-intro.mp4</a>.'
)
}
})
}// if
})

View file

@ -0,0 +1,161 @@
// AjaxQ jQuery Plugin
// Copyright (c) 2012 Foliotek Inc.
// MIT License
// https://github.com/Foliotek/ajaxq
// Uses CommonJS, AMD or browser globals to create a jQuery plugin.
(function (factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['jquery'], factory);
} else if (typeof module === 'object' && module.exports) {
// Node/CommonJS
module.exports = factory(require('jquery'));
} else {
// Browser globals
factory(jQuery);
}
}(function ($) {
var queues = {};
var activeReqs = {};
// Register an $.ajaxq function, which follows the $.ajax interface, but allows a queue name which will force only one request per queue to fire.
// opts can be the regular $.ajax settings plainObject, or a callback returning the settings object, to be evaluated just prior to the actual call to $.ajax.
$.ajaxq = function(qname, opts) {
if (typeof opts === "undefined") {
throw ("AjaxQ: queue name is not provided");
}
// Will return a Deferred promise object extended with success/error/callback, so that this function matches the interface of $.ajax
var deferred = $.Deferred(),
promise = deferred.promise();
promise.success = promise.done;
promise.error = promise.fail;
promise.complete = promise.always;
// Check whether options are to be evaluated at call time or not.
var deferredOpts = typeof opts === 'function';
// Create a deep copy of the arguments, and enqueue this request.
var clonedOptions = !deferredOpts ? $.extend(true, {}, opts) : null;
enqueue(function() {
// Send off the ajax request now that the item has been removed from the queue
var jqXHR = $.ajax.apply(window, [deferredOpts ? opts() : clonedOptions]);
// Notify the returned deferred object with the correct context when the jqXHR is done or fails
// Note that 'always' will automatically be fired once one of these are called: http://api.jquery.com/category/deferred-object/.
jqXHR.done(function() {
deferred.resolve.apply(this, arguments);
});
jqXHR.fail(function() {
deferred.reject.apply(this, arguments);
});
jqXHR.always(dequeue); // make sure to dequeue the next request AFTER the done and fail callbacks are fired
return jqXHR;
});
return promise;
// If there is no queue, create an empty one and instantly process this item.
// Otherwise, just add this item onto it for later processing.
function enqueue(cb) {
if (!queues[qname]) {
queues[qname] = [];
var xhr = cb();
activeReqs[qname] = xhr;
}
else {
queues[qname].push(cb);
}
}
// Remove the next callback from the queue and fire it off.
// If the queue was empty (this was the last item), delete it from memory so the next one can be instantly processed.
function dequeue() {
if (!queues[qname]) {
return;
}
var nextCallback = queues[qname].shift();
if (nextCallback) {
var xhr = nextCallback();
activeReqs[qname] = xhr;
}
else {
delete queues[qname];
delete activeReqs[qname];
}
}
};
// Register a $.postq and $.getq method to provide shortcuts for $.get and $.post
// Copied from jQuery source to make sure the functions share the same defaults as $.get and $.post.
$.each( [ "getq", "postq" ], function( i, method ) {
$[ method ] = function( qname, url, data, callback, type ) {
if ( $.isFunction( data ) ) {
type = type || callback;
callback = data;
data = undefined;
}
return $.ajaxq(qname, {
type: method === "postq" ? "post" : "get",
url: url,
data: data,
success: callback,
dataType: type
});
};
});
var isQueueRunning = function(qname) {
return (queues.hasOwnProperty(qname) && queues[qname].length > 0) || activeReqs.hasOwnProperty(qname);
};
var isAnyQueueRunning = function() {
for (var i in queues) {
if (isQueueRunning(i)) return true;
}
return false;
};
$.ajaxq.isRunning = function(qname) {
if (qname) return isQueueRunning(qname);
else return isAnyQueueRunning();
};
$.ajaxq.getActiveRequest = function(qname) {
if (!qname) throw ("AjaxQ: queue name is required");
return activeReqs[qname];
};
$.ajaxq.abort = function(qname) {
if (!qname) throw ("AjaxQ: queue name is required");
var current = $.ajaxq.getActiveRequest(qname);
delete queues[qname];
delete activeReqs[qname];
if (current) current.abort();
};
$.ajaxq.clear = function(qname) {
if (!qname) {
for (var i in queues) {
if (queues.hasOwnProperty(i)) {
queues[i] = [];
}
}
}
else {
if (queues[qname]) {
queues[qname] = [];
}
}
};
}));

View file

@ -0,0 +1,685 @@
/*
* BestInPlace (for jQuery)
* version: 3.0.0.alpha (2014)
*
* By Bernat Farrero based on the work of Jan Varwig.
* Examples at http://bernatfarrero.com
*
* Licensed under the MIT:
* http://www.opensource.org/licenses/mit-license.php
*
* @requires jQuery
*
* Usage:
*
* Attention.
* The format of the JSON object given to the select inputs is the following:
* [["key", "value"],["key", "value"]]
* The format of the JSON object given to the checkbox inputs is the following:
* ["falseValue", "trueValue"]
*/
//= require jquery.autosize
function BestInPlaceEditor(e) {
'use strict';
this.element = e;
this.initOptions();
this.bindForm();
this.initPlaceHolder();
jQuery(this.activator).bind('click', {editor: this}, this.clickHandler);
}
BestInPlaceEditor.prototype = {
// Public Interface Functions //////////////////////////////////////////////
activate: function () {
'use strict';
var to_display;
if (this.isPlaceHolder()) {
to_display = "";
} else if (this.original_content) {
to_display = this.original_content;
} else {
switch (this.formType) {
case 'input':
case 'textarea':
if (this.display_raw) {
to_display = this.element.html().replace(/&amp;/gi, '&');
}
else {
var value = this.element.data('bipValue');
if (typeof value === 'undefined') {
to_display = '';
} else if (typeof value === 'string') {
to_display = this.element.data('bipValue').replace(/&amp;/gi, '&');
} else {
to_display = this.element.data('bipValue');
}
}
break;
case 'select':
to_display = this.element.html();
}
}
this.oldValue = this.isPlaceHolder() ? "" : this.element.html();
this.display_value = to_display;
jQuery(this.activator).unbind("click", this.clickHandler);
this.activateForm();
this.element.trigger(jQuery.Event("best_in_place:activate"));
},
abort: function () {
'use strict';
this.activateText(this.oldValue);
jQuery(this.activator).bind('click', {editor: this}, this.clickHandler);
this.element.trigger(jQuery.Event("best_in_place:abort"));
this.element.trigger(jQuery.Event("best_in_place:deactivate"));
},
abortIfConfirm: function () {
'use strict';
if (!this.useConfirm) {
this.abort();
return;
}
if (confirm(BestInPlaceEditor.defaults.locales[''].confirmMessage)) {
this.abort();
}
},
update: function () {
'use strict';
var editor = this,
value = this.getValue();
// Avoid request if no change is made
if (this.formType in {"input": 1, "textarea": 1} && value === this.oldValue) {
this.abort();
return true;
}
editor.ajax({
"type": this.requestMethod(),
"dataType": BestInPlaceEditor.defaults.ajaxDataType,
"data": editor.requestData(),
"success": function (data, status, xhr) {
editor.loadSuccessCallback(data, status, xhr);
},
"error": function (request, error) {
editor.loadErrorCallback(request, error);
}
});
switch (this.formType) {
case "select":
this.previousCollectionValue = value;
// search for the text for the span
$.each(this.values, function(index, arr){ if (String(arr[0]) === String(value)) editor.element.html(arr[1]); });
break;
case "checkbox":
$.each(this.values, function(index, arr){ if (String(arr[0]) === String(value)) editor.element.html(arr[1]); });
break;
default:
if (value !== "") {
if (this.display_raw) {
editor.element.html(value);
} else {
editor.element.text(value);
}
} else {
editor.element.html(this.placeHolder);
}
}
editor.element.data('bipValue', value);
editor.element.attr('data-bip-value', value);
editor.element.trigger(jQuery.Event("best_in_place:update"));
},
activateForm: function () {
'use strict';
alert(BestInPlaceEditor.defaults.locales[''].uninitializedForm);
},
activateText: function (value) {
'use strict';
this.element.html(value);
if (this.isPlaceHolder()) {
this.element.html(this.placeHolder);
}
},
// Helper Functions ////////////////////////////////////////////////////////
initOptions: function () {
// Try parent supplied info
'use strict';
var self = this;
self.element.parents().each(function () {
var $parent = jQuery(this);
self.url = self.url || $parent.data("bipUrl");
self.activator = self.activator || $parent.data("bipActivator");
self.okButton = self.okButton || $parent.data("bipOkButton");
self.okButtonClass = self.okButtonClass || $parent.data("bipOkButtonClass");
self.cancelButton = self.cancelButton || $parent.data("bipCancelButton");
self.cancelButtonClass = self.cancelButtonClass || $parent.data("bipCancelButtonClass");
self.skipBlur = self.skipBlur || $parent.data("bipSkipBlur");
});
// Load own attributes (overrides all others)
self.url = self.element.data("bipUrl") || self.url || document.location.pathname;
self.collection = self.element.data("bipCollection") || self.collection;
self.formType = self.element.data("bipType") || "input";
self.objectName = self.element.data("bipObject") || self.objectName;
self.attributeName = self.element.data("bipAttribute") || self.attributeName;
self.activator = self.element.data("bipActivator") || self.element;
self.okButton = self.element.data("bipOkButton") || self.okButton;
self.okButtonClass = self.element.data("bipOkButtonClass") || self.okButtonClass || BestInPlaceEditor.defaults.okButtonClass;
self.cancelButton = self.element.data("bipCancelButton") || self.cancelButton;
self.cancelButtonClass = self.element.data("bipCancelButtonClass") || self.cancelButtonClass || BestInPlaceEditor.defaults.cancelButtonClass;
self.skipBlur = self.element.data("bipSkipBlur") || self.skipBlur || BestInPlaceEditor.defaults.skipBlur;
self.isNewObject = self.element.data("bipNewObject");
self.dataExtraPayload = self.element.data("bipExtraPayload");
// Fix for default values of 0
if (self.element.data("bipPlaceholder") == null) {
self.placeHolder = BestInPlaceEditor.defaults.locales[''].placeHolder;
} else {
self.placeHolder = self.element.data("bipPlaceholder");
}
self.inner_class = self.element.data("bipInnerClass");
self.html_attrs = self.element.data("bipHtmlAttrs");
self.original_content = self.element.data("bipOriginalContent") || self.original_content;
// if set the input won't be satinized
self.display_raw = self.element.data("bip-raw");
self.useConfirm = self.element.data("bip-confirm");
if (self.formType === "select" || self.formType === "checkbox") {
self.values = self.collection;
self.collectionValue = self.element.data("bipValue") || self.collectionValue;
}
},
bindForm: function () {
'use strict';
this.activateForm = BestInPlaceEditor.forms[this.formType].activateForm;
this.getValue = BestInPlaceEditor.forms[this.formType].getValue;
},
initPlaceHolder: function () {
'use strict';
// TODO add placeholder for select and checkbox
if (this.element.html() === "") {
this.element.addClass('bip-placeholder');
this.element.html(this.placeHolder);
}
},
isPlaceHolder: function () {
'use strict';
// TODO: It only work when form is deactivated.
// Condition will fail when form is activated
return this.element.html() === "" || this.element.html() === this.placeHolder;
},
getValue: function () {
'use strict';
alert(BestInPlaceEditor.defaults.locales[''].uninitializedForm);
},
// Trim and Strips HTML from text
sanitizeValue: function (s) {
'use strict';
return jQuery.trim(s);
},
requestMethod: function() {
'use strict';
return this.isNewObject ? 'post' : BestInPlaceEditor.defaults.ajaxMethod;
},
/* Generate the data sent in the POST request */
requestData: function () {
'use strict';
// To prevent xss attacks, a csrf token must be defined as a meta attribute
var csrf_token = jQuery('meta[name=csrf-token]').attr('content'),
csrf_param = jQuery('meta[name=csrf-param]').attr('content');
var data = {}
data['_method'] = this.requestMethod()
data[this.objectName] = this.dataExtraPayload || {}
data[this.objectName][this.attributeName] = this.getValue()
if (csrf_param !== undefined && csrf_token !== undefined) {
data[csrf_param] = csrf_token
}
return jQuery.param(data);
},
ajax: function (options) {
'use strict';
options.url = this.url;
options.beforeSend = function (xhr) {
xhr.setRequestHeader("Accept", "application/json");
};
return jQuery.ajax(options);
},
// Handlers ////////////////////////////////////////////////////////////////
loadSuccessCallback: function (data, status, xhr) {
'use strict';
data = jQuery.trim(data);
//Update original content with current text.
if (this.display_raw) {
this.original_content = this.element.html();
} else {
this.original_content = this.element.text();
}
if (data && data !== "") {
var response = jQuery.parseJSON(data);
if (response !== null && response.hasOwnProperty("display_as")) {
this.element.data('bip-original-content', this.element.text());
this.element.html(response.display_as);
}
if (this.isNewObject && response && response[this.objectName]) {
if (response[this.objectName]["id"]) {
this.isNewObject = false
this.url += "/" + response[this.objectName]["id"] // in REST a POST /thing url should become PUT /thing/123
}
}
}
this.element.toggleClass('bip-placeholder', this.isPlaceHolder());
this.element.trigger(jQuery.Event("best_in_place:success"), [data, status, xhr]);
this.element.trigger(jQuery.Event("ajax:success"), [data, status, xhr]);
// Binding back after being clicked
jQuery(this.activator).bind('click', {editor: this}, this.clickHandler);
this.element.trigger(jQuery.Event("best_in_place:deactivate"));
if (this.collectionValue !== null && this.formType === "select") {
this.collectionValue = this.previousCollectionValue;
this.previousCollectionValue = null;
}
},
loadErrorCallback: function (request, error) {
'use strict';
this.activateText(this.oldValue);
this.element.trigger(jQuery.Event("best_in_place:error"), [request, error]);
this.element.trigger(jQuery.Event("ajax:error"), request, error);
// Binding back after being clicked
jQuery(this.activator).bind('click', {editor: this}, this.clickHandler);
this.element.trigger(jQuery.Event("best_in_place:deactivate"));
},
clickHandler: function (event) {
'use strict';
event.preventDefault();
event.data.editor.activate();
},
setHtmlAttributes: function () {
'use strict';
var formField = this.element.find(this.formType);
if (this.html_attrs) {
var attrs = this.html_attrs;
$.each(attrs, function (key, val) {
formField.attr(key, val);
});
}
},
placeButtons: function (output, field) {
'use strict';
if (field.okButton) {
output.append(
jQuery(document.createElement('input'))
.attr('type', 'submit')
.attr('class', field.okButtonClass)
.attr('value', field.okButton)
);
}
if (field.cancelButton) {
output.append(
jQuery(document.createElement('input'))
.attr('type', 'button')
.attr('class', field.cancelButtonClass)
.attr('value', field.cancelButton)
);
}
}
};
// Button cases:
// If no buttons, then blur saves, ESC cancels
// If just Cancel button, then blur saves, ESC or clicking Cancel cancels (careful of blur event!)
// If just OK button, then clicking OK saves (careful of blur event!), ESC or blur cancels
// If both buttons, then clicking OK saves, ESC or clicking Cancel or blur cancels
BestInPlaceEditor.forms = {
"input": {
activateForm: function () {
'use strict';
var output = jQuery(document.createElement('form'))
.addClass('form_in_place')
.attr('action', 'javascript:void(0);')
.attr('style', 'display:inline');
var input_elt = jQuery(document.createElement('input'))
.attr('type', 'text')
.attr('name', this.attributeName)
.val(this.display_value);
// Add class to form input
if (this.inner_class) {
input_elt.addClass(this.inner_class);
}
output.append(input_elt);
this.placeButtons(output, this);
this.element.html(output);
this.setHtmlAttributes();
this.element.find("input[type='text']")[0].select();
this.element.find("form").bind('submit', {editor: this}, BestInPlaceEditor.forms.input.submitHandler);
if (this.cancelButton) {
this.element.find("input[type='button']").bind('click', {editor: this}, BestInPlaceEditor.forms.input.cancelButtonHandler);
}
if (!this.okButton) {
this.element.find("input[type='text']").bind('blur', {editor: this}, BestInPlaceEditor.forms.input.inputBlurHandler);
}
this.element.find("input[type='text']").bind('keyup', {editor: this}, BestInPlaceEditor.forms.input.keyupHandler);
this.blurTimer = null;
this.userClicked = false;
},
getValue: function () {
'use strict';
return this.sanitizeValue(this.element.find("input").val());
},
// When buttons are present, use a timer on the blur event to give precedence to clicks
inputBlurHandler: function (event) {
'use strict';
if (event.data.editor.okButton) {
event.data.editor.blurTimer = setTimeout(function () {
if (!event.data.editor.userClicked) {
event.data.editor.abort();
}
}, 500);
} else {
if (event.data.editor.cancelButton) {
event.data.editor.blurTimer = setTimeout(function () {
if (!event.data.editor.userClicked) {
event.data.editor.update();
}
}, 500);
} else {
event.data.editor.update();
}
}
},
submitHandler: function (event) {
'use strict';
event.data.editor.userClicked = true;
clearTimeout(event.data.editor.blurTimer);
event.data.editor.update();
},
cancelButtonHandler: function (event) {
'use strict';
event.data.editor.userClicked = true;
clearTimeout(event.data.editor.blurTimer);
event.data.editor.abort();
event.stopPropagation(); // Without this, click isn't handled
},
keyupHandler: function (event) {
'use strict';
if (event.keyCode === 27) {
event.data.editor.abort();
event.stopImmediatePropagation();
}
}
},
"select": {
activateForm: function () {
'use strict';
var output = jQuery(document.createElement('form'))
.attr('action', 'javascript:void(0)')
.attr('style', 'display:inline'),
selected = '',
select_elt = jQuery(document.createElement('select'))
.attr('class', this.inner_class !== null ? this.inner_class : ''),
currentCollectionValue = this.collectionValue,
key, value,
a = this.values;
$.each(a, function(index, arr){
key = arr[0];
value = arr[1];
var option_elt = jQuery(document.createElement('option'))
.val(key)
.html(value);
if (currentCollectionValue) {
if (String(key) === String(currentCollectionValue)) option_elt.attr('selected', 'selected');
}
select_elt.append(option_elt);
});
output.append(select_elt);
this.element.html(output);
this.setHtmlAttributes();
this.element.find("select").bind('change', {editor: this}, BestInPlaceEditor.forms.select.blurHandler);
this.element.find("select").bind('blur', {editor: this}, BestInPlaceEditor.forms.select.blurHandler);
this.element.find("select").bind('keyup', {editor: this}, BestInPlaceEditor.forms.select.keyupHandler);
this.element.find("select")[0].focus();
// automatically click on the select so you
// don't have to click twice
try {
var e = document.createEvent("MouseEvents");
e.initMouseEvent("mousedown", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
this.element.find("select")[0].dispatchEvent(e);
}
catch(e) {
// browser doesn't support this, e.g. IE8
}
},
getValue: function () {
'use strict';
return this.sanitizeValue(this.element.find("select").val());
},
blurHandler: function (event) {
'use strict';
event.data.editor.update();
},
keyupHandler: function (event) {
'use strict';
if (event.keyCode === 27) {
event.data.editor.abort();
}
}
},
"checkbox": {
activateForm: function () {
'use strict';
this.collectionValue = !this.getValue();
this.setHtmlAttributes();
this.update();
},
getValue: function () {
'use strict';
return this.collectionValue;
}
},
"textarea": {
activateForm: function () {
'use strict';
// grab width and height of text
var width = this.element.css('width');
var height = this.element.css('height');
// construct form
var output = jQuery(document.createElement('form'))
.addClass('form_in_place')
.attr('action', 'javascript:void(0);')
.attr('style', 'display:inline');
var textarea_elt = jQuery(document.createElement('textarea'))
.attr('name', this.attributeName)
.val(this.sanitizeValue(this.display_value));
if (this.inner_class !== null) {
textarea_elt.addClass(this.inner_class);
}
output.append(textarea_elt);
this.placeButtons(output, this);
this.element.html(output);
this.setHtmlAttributes();
// set width and height of textarea
jQuery(this.element.find("textarea")[0]).css({'min-width': width, 'min-height': height});
jQuery(this.element.find("textarea")[0]).autosize();
this.element.find("textarea")[0].focus();
this.element.find("form").bind('submit', {editor: this}, BestInPlaceEditor.forms.textarea.submitHandler);
if (this.cancelButton) {
this.element.find("input[type='button']").bind('click', {editor: this}, BestInPlaceEditor.forms.textarea.cancelButtonHandler);
}
if (!this.skipBlur) {
this.element.find("textarea").bind('blur', {editor: this}, BestInPlaceEditor.forms.textarea.blurHandler);
}
this.element.find("textarea").bind('keyup', {editor: this}, BestInPlaceEditor.forms.textarea.keyupHandler);
this.blurTimer = null;
this.userClicked = false;
},
getValue: function () {
'use strict';
return this.sanitizeValue(this.element.find("textarea").val());
},
// When buttons are present, use a timer on the blur event to give precedence to clicks
blurHandler: function (event) {
'use strict';
if (event.data.editor.okButton) {
event.data.editor.blurTimer = setTimeout(function () {
if (!event.data.editor.userClicked) {
event.data.editor.abortIfConfirm();
}
}, 500);
} else {
if (event.data.editor.cancelButton) {
event.data.editor.blurTimer = setTimeout(function () {
if (!event.data.editor.userClicked) {
event.data.editor.update();
}
}, 500);
} else {
event.data.editor.update();
}
}
},
submitHandler: function (event) {
'use strict';
event.data.editor.userClicked = true;
clearTimeout(event.data.editor.blurTimer);
event.data.editor.update();
},
cancelButtonHandler: function (event) {
'use strict';
event.data.editor.userClicked = true;
clearTimeout(event.data.editor.blurTimer);
event.data.editor.abortIfConfirm();
event.stopPropagation(); // Without this, click isn't handled
},
keyupHandler: function (event) {
'use strict';
if (event.keyCode === 27) {
event.data.editor.abortIfConfirm();
}
}
}
};
BestInPlaceEditor.defaults = {
locales: {},
ajaxMethod: "put", //TODO Change to patch when support to 3.2 is dropped
ajaxDataType: 'text',
okButtonClass: '',
cancelButtonClass: '',
skipBlur: false
};
// Default locale
BestInPlaceEditor.defaults.locales[''] = {
confirmMessage: "Are you sure you want to discard your changes?",
uninitializedForm: "The form was not properly initialized. getValue is unbound",
placeHolder: '-'
};
jQuery.fn.best_in_place = function () {
'use strict';
function setBestInPlace(element) {
if (!element.data('bestInPlaceEditor')) {
element.data('bestInPlaceEditor', new BestInPlaceEditor(element));
return true;
}
}
jQuery(this.context).delegate(this.selector, 'click', function () {
var el = jQuery(this);
if (setBestInPlace(el)) {
el.click();
}
});
this.each(function () {
setBestInPlace(jQuery(this));
});
return this;
};

View file

@ -1,780 +0,0 @@
/*
BestInPlace (for jQuery)
version: 0.1.0 (01/01/2011)
@requires jQuery >= v1.4
@requires jQuery.purr to display pop-up windows
By Bernat Farrero based on the work of Jan Varwig.
Examples at http://bernatfarrero.com
Licensed under the MIT:
http://www.opensource.org/licenses/mit-license.php
Usage:
Attention.
The format of the JSON object given to the select inputs is the following:
[["key", "value"],["key", "value"]]
The format of the JSON object given to the checkbox inputs is the following:
["falseValue", "trueValue"]
*/
function BestInPlaceEditor(e) {
this.element = e;
this.initOptions();
this.bindForm();
this.initNil();
jQuery(this.activator).bind('click', {editor: this}, this.clickHandler);
}
BestInPlaceEditor.prototype = {
// Public Interface Functions //////////////////////////////////////////////
activate : function() {
var to_display = "";
if (this.isNil()) {
to_display = "";
}
else if (this.original_content) {
to_display = this.original_content;
}
else {
if (this.sanitize) {
to_display = this.element.text();
} else {
to_display = this.element.html();
}
}
this.oldValue = this.isNil() ? "" : this.element.html();
this.display_value = to_display;
jQuery(this.activator).unbind("click", this.clickHandler);
this.activateForm();
this.element.trigger(jQuery.Event("best_in_place:activate"));
},
abort : function() {
this.activateText(this.oldValue);
jQuery(this.activator).bind('click', {editor: this}, this.clickHandler);
this.element.trigger(jQuery.Event("best_in_place:abort"));
this.element.trigger(jQuery.Event("best_in_place:deactivate"));
},
abortIfConfirm : function () {
if (!this.useConfirm) {
this.abort();
return;
}
if (confirm("Are you sure you want to discard your changes?")) {
this.abort();
}
},
update : function() {
var editor = this;
if (this.formType in {"input":1, "textarea":1} && this.getValue() == this.oldValue)
{ // Avoid request if no change is made
this.abort();
return true;
}
editor.ajax({
"type" : "post",
"dataType" : "text",
"data" : editor.requestData(),
"success" : function(data){ editor.loadSuccessCallback(data); },
"error" : function(request, error){ editor.loadErrorCallback(request, error); }
});
if (this.formType == "select") {
var value = this.getValue();
this.previousCollectionValue = value;
jQuery.each(this.values, function(i, v) {
if (value == v[0]) {
editor.element.html(v[1]);
}
}
);
} else if (this.formType == "checkbox") {
editor.element.html(this.getValue() ? this.values[1] : this.values[0]);
} else {
if (this.getValue() !== "") {
editor.element.text(this.getValue());
} else {
editor.element.html(this.nil);
}
}
editor.element.trigger(jQuery.Event("best_in_place:update"));
},
activateForm : function() {
alert("The form was not properly initialized. activateForm is unbound");
},
activateText : function(value){
this.element.html(value);
if(this.isNil()) this.element.html(this.nil);
},
// Helper Functions ////////////////////////////////////////////////////////
initOptions : function() {
// Try parent supplied info
var self = this;
self.element.parents().each(function(){
$parent = jQuery(this);
self.url = self.url || $parent.attr("data-url");
self.collection = self.collection || $parent.attr("data-collection");
self.formType = self.formType || $parent.attr("data-type");
self.objectName = self.objectName || $parent.attr("data-object");
self.attributeName = self.attributeName || $parent.attr("data-attribute");
self.activator = self.activator || $parent.attr("data-activator");
self.okButton = self.okButton || $parent.attr("data-ok-button");
self.okButtonClass = self.okButtonClass || $parent.attr("data-ok-button-class");
self.cancelButton = self.cancelButton || $parent.attr("data-cancel-button");
self.cancelButtonClass = self.cancelButtonClass || $parent.attr("data-cancel-button-class");
self.nil = self.nil || $parent.attr("data-nil");
self.inner_class = self.inner_class || $parent.attr("data-inner-class");
self.html_attrs = self.html_attrs || $parent.attr("data-html-attrs");
self.original_content = self.original_content || $parent.attr("data-original-content");
self.collectionValue = self.collectionValue || $parent.attr("data-value");
});
// Try Rails-id based if parents did not explicitly supply something
self.element.parents().each(function(){
var res = this.id.match(/^(\w+)_(\d+)$/i);
if (res) {
self.objectName = self.objectName || res[1];
}
});
// Load own attributes (overrides all others)
self.url = self.element.attr("data-url") || self.url || document.location.pathname;
self.collection = self.element.attr("data-collection") || self.collection;
self.formType = self.element.attr("data-type") || self.formtype || "input";
self.objectName = self.element.attr("data-object") || self.objectName;
self.attributeName = self.element.attr("data-attribute") || self.attributeName;
self.activator = self.element.attr("data-activator") || self.element;
self.okButton = self.element.attr("data-ok-button") || self.okButton;
self.okButtonClass = self.element.attr("data-ok-button-class") || self.okButtonClass || "";
self.cancelButton = self.element.attr("data-cancel-button") || self.cancelButton;
self.cancelButtonClass = self.element.attr("data-cancel-button-class") || self.cancelButtonClass || "";
self.nil = self.element.attr("data-nil") || self.nil || "—";
self.inner_class = self.element.attr("data-inner-class") || self.inner_class || null;
self.html_attrs = self.element.attr("data-html-attrs") || self.html_attrs;
self.original_content = self.element.attr("data-original-content") || self.original_content;
self.collectionValue = self.element.attr("data-value") || self.collectionValue;
if (!self.element.attr("data-sanitize")) {
self.sanitize = true;
}
else {
self.sanitize = (self.element.attr("data-sanitize") == "true");
}
if (!self.element.attr("data-use-confirm")) {
self.useConfirm = true;
} else {
self.useConfirm = (self.element.attr("data-use-confirm") != "false");
}
if ((self.formType == "select" || self.formType == "checkbox") && self.collection !== null)
{
self.values = jQuery.parseJSON(self.collection);
}
},
bindForm : function() {
this.activateForm = BestInPlaceEditor.forms[this.formType].activateForm;
this.getValue = BestInPlaceEditor.forms[this.formType].getValue;
},
initNil: function() {
if (this.element.html() === "")
{
this.element.html(this.nil);
}
},
isNil: function() {
// TODO: It only work when form is deactivated.
// Condition will fail when form is activated
return this.element.html() === "" || this.element.html() === this.nil;
},
getValue : function() {
alert("The form was not properly initialized. getValue is unbound");
},
// Trim and Strips HTML from text
sanitizeValue : function(s) {
return jQuery.trim(s);
},
/* Generate the data sent in the POST request */
requestData : function() {
// To prevent xss attacks, a csrf token must be defined as a meta attribute
csrf_token = jQuery('meta[name=csrf-token]').attr('content');
csrf_param = jQuery('meta[name=csrf-param]').attr('content');
var data = "_method=put";
data += "&" + this.objectName + '[' + this.attributeName + ']=' + encodeURIComponent(this.getValue());
if (csrf_param !== undefined && csrf_token !== undefined) {
data += "&" + csrf_param + "=" + encodeURIComponent(csrf_token);
}
return data;
},
ajax : function(options) {
options.url = this.url;
options.beforeSend = function(xhr){ xhr.setRequestHeader("Accept", "application/json"); };
return jQuery.ajax(options);
},
// Handlers ////////////////////////////////////////////////////////////////
loadSuccessCallback : function(data) {
data = jQuery.trim(data);
if(data && data!=""){
var response = jQuery.parseJSON(jQuery.trim(data));
if (response !== null && response.hasOwnProperty("display_as")) {
this.element.attr("data-original-content", this.element.text());
this.original_content = this.element.text();
this.element.html(response["display_as"]);
}
this.element.trigger(jQuery.Event("best_in_place:success"), data);
this.element.trigger(jQuery.Event("ajax:success"), data);
} else {
this.element.trigger(jQuery.Event("best_in_place:success"));
this.element.trigger(jQuery.Event("ajax:success"));
}
// Binding back after being clicked
jQuery(this.activator).bind('click', {editor: this}, this.clickHandler);
this.element.trigger(jQuery.Event("best_in_place:deactivate"));
if (this.collectionValue !== null && this.formType == "select") {
this.collectionValue = this.previousCollectionValue;
this.previousCollectionValue = null;
}
},
loadErrorCallback : function(request, error) {
this.activateText(this.oldValue);
this.element.trigger(jQuery.Event("best_in_place:error"), [request, error]);
this.element.trigger(jQuery.Event("ajax:error"), request, error);
// Binding back after being clicked
jQuery(this.activator).bind('click', {editor: this}, this.clickHandler);
this.element.trigger(jQuery.Event("best_in_place:deactivate"));
},
clickHandler : function(event) {
event.preventDefault();
event.data.editor.activate();
},
setHtmlAttributes : function() {
var formField = this.element.find(this.formType);
if(this.html_attrs){
var attrs = jQuery.parseJSON(this.html_attrs);
for(var key in attrs){
formField.attr(key, attrs[key]);
}
}
}
};
// Button cases:
// If no buttons, then blur saves, ESC cancels
// If just Cancel button, then blur saves, ESC or clicking Cancel cancels (careful of blur event!)
// If just OK button, then clicking OK saves (careful of blur event!), ESC or blur cancels
// If both buttons, then clicking OK saves, ESC or clicking Cancel or blur cancels
BestInPlaceEditor.forms = {
"input" : {
activateForm : function() {
var output = jQuery(document.createElement('form'))
.addClass('form_in_place')
.attr('action', 'javascript:void(0);')
.attr('style', 'display:inline');
var input_elt = jQuery(document.createElement('input'))
.attr('type', 'text')
.attr('name', this.attributeName)
.val(this.display_value);
if(this.inner_class !== null) {
input_elt.addClass(this.inner_class);
}
output.append(input_elt);
if(this.okButton) {
output.append(
jQuery(document.createElement('input'))
.attr('type', 'submit')
.attr('class', this.okButtonClass)
.attr('value', this.okButton)
)
}
if(this.cancelButton) {
output.append(
jQuery(document.createElement('input'))
.attr('type', 'button')
.attr('class', this.cancelButtonClass)
.attr('value', this.cancelButton)
)
}
this.element.html(output);
this.setHtmlAttributes();
// START METAMAPS CODE
//this.element.find("input[type='text']")[0].select();
this.element.find("input[type='text']")[0].focus();
// END METAMAPS CODE
this.element.find("form").bind('submit', {editor: this}, BestInPlaceEditor.forms.input.submitHandler);
if (this.cancelButton) {
this.element.find("input[type='button']").bind('click', {editor: this}, BestInPlaceEditor.forms.input.cancelButtonHandler);
}
this.element.find("input[type='text']").bind('blur', {editor: this}, BestInPlaceEditor.forms.input.inputBlurHandler);
// START METAMAPS CODE
this.element.find("input[type='text']").bind('keydown', {editor: this}, BestInPlaceEditor.forms.input.keydownHandler);
// END METAMAPS CODE
this.element.find("input[type='text']").bind('keyup', {editor: this}, BestInPlaceEditor.forms.input.keyupHandler);
this.blurTimer = null;
this.userClicked = false;
},
getValue : function() {
return this.sanitizeValue(this.element.find("input").val());
},
// When buttons are present, use a timer on the blur event to give precedence to clicks
inputBlurHandler : function(event) {
if (event.data.editor.okButton) {
event.data.editor.blurTimer = setTimeout(function () {
if (!event.data.editor.userClicked) {
event.data.editor.abort();
}
}, 500);
} else {
if (event.data.editor.cancelButton) {
event.data.editor.blurTimer = setTimeout(function () {
if (!event.data.editor.userClicked) {
event.data.editor.update();
}
}, 500);
} else {
event.data.editor.update();
}
}
},
submitHandler : function(event) {
event.data.editor.userClicked = true;
clearTimeout(event.data.editor.blurTimer);
event.data.editor.update();
},
cancelButtonHandler : function(event) {
event.data.editor.userClicked = true;
clearTimeout(event.data.editor.blurTimer);
event.data.editor.abort();
event.stopPropagation(); // Without this, click isn't handled
},
keyupHandler : function(event) {
if (event.keyCode == 27) {
event.data.editor.abort();
}
// START METAMAPS CODE
else if (event.keyCode == 13 && !event.shiftKey) {
event.data.editor.update();
}
// END METAMAPS CODE
}
},
"date" : {
activateForm : function() {
var that = this,
output = jQuery(document.createElement('form'))
.addClass('form_in_place')
.attr('action', 'javascript:void(0);')
.attr('style', 'display:inline'),
input_elt = jQuery(document.createElement('input'))
.attr('type', 'text')
.attr('name', this.attributeName)
.attr('value', this.sanitizeValue(this.display_value));
if(this.inner_class !== null) {
input_elt.addClass(this.inner_class);
}
output.append(input_elt)
this.element.html(output);
this.setHtmlAttributes();
this.element.find('input')[0].select();
this.element.find("form").bind('submit', {editor: this}, BestInPlaceEditor.forms.input.submitHandler);
this.element.find("input").bind('keyup', {editor: this}, BestInPlaceEditor.forms.input.keyupHandler);
this.element.find('input')
.datepicker({
onClose: function() {
that.update();
}
})
.datepicker('show');
},
getValue : function() {
return this.sanitizeValue(this.element.find("input").val());
},
submitHandler : function(event) {
event.data.editor.update();
},
// START METAMAPS CODE
keydownHandler : function(event) {
if (event.keyCode == 13 && !event.shiftKey) {
event.preventDefault();
event.stopPropagation();
return false;
}
},
// END METAMAPS CODE
keyupHandler : function(event) {
if (event.keyCode == 27) {
event.data.editor.abort();
}
}
},
"select" : {
activateForm : function() {
var output = jQuery(document.createElement('form'))
.attr('action', 'javascript:void(0)')
.attr('style', 'display:inline');
selected = '',
oldValue = this.oldValue,
select_elt = jQuery(document.createElement('select'))
.attr('class', this.inned_class !== null ? this.inner_class : '' ),
currentCollectionValue = this.collectionValue;
jQuery.each(this.values, function (index, value) {
var option_elt = jQuery(document.createElement('option'))
// .attr('value', value[0])
.val(value[0])
.html(value[1]);
if(value[0] == currentCollectionValue) {
option_elt.attr('selected', 'selected');
}
select_elt.append(option_elt);
});
output.append(select_elt);
this.element.html(output);
this.setHtmlAttributes();
this.element.find("select").bind('change', {editor: this}, BestInPlaceEditor.forms.select.blurHandler);
this.element.find("select").bind('blur', {editor: this}, BestInPlaceEditor.forms.select.blurHandler);
this.element.find("select").bind('keyup', {editor: this}, BestInPlaceEditor.forms.select.keyupHandler);
this.element.find("select")[0].focus();
},
getValue : function() {
return this.sanitizeValue(this.element.find("select").val());
// return this.element.find("select").val();
},
blurHandler : function(event) {
event.data.editor.update();
},
keyupHandler : function(event) {
if (event.keyCode == 27) event.data.editor.abort();
}
},
"checkbox" : {
activateForm : function() {
this.collectionValue = !this.getValue();
this.setHtmlAttributes();
this.update();
},
getValue : function() {
return this.collectionValue;
}
},
"textarea" : {
activateForm : function() {
// grab width and height of text
width = this.element.css('width');
height = this.element.css('height');
// construct form
var output = jQuery(document.createElement('form'))
.attr('action', 'javascript:void(0)')
.attr('style', 'display:inline')
.append(jQuery(document.createElement('textarea'))
.val(this.sanitizeValue(this.display_value)));
if(this.okButton) {
output.append(
jQuery(document.createElement('input'))
.attr('type', 'submit')
.attr('value', this.okButton)
);
}
if(this.cancelButton) {
output.append(
jQuery(document.createElement('input'))
.attr('type', 'button')
.attr('value', this.cancelButton)
)
}
this.element.html(output);
this.setHtmlAttributes();
// set width and height of textarea
jQuery(this.element.find("textarea")[0]).css({ 'min-width': width, 'min-height': height });
jQuery(this.element.find("textarea")[0]).elastic();
this.element.find("textarea")[0].focus();
this.element.find("form").bind('submit', {editor: this}, BestInPlaceEditor.forms.textarea.submitHandler);
if (this.cancelButton) {
this.element.find("input[type='button']").bind('click', {editor: this}, BestInPlaceEditor.forms.textarea.cancelButtonHandler);
}
this.element.find("textarea").bind('blur', {editor: this}, BestInPlaceEditor.forms.textarea.blurHandler);
// START METAMAPS CODE
this.element.find("textarea").bind('keydown', {editor: this}, BestInPlaceEditor.forms.textarea.keydownHandler);
// END METAMAPS CODE
this.element.find("textarea").bind('keyup', {editor: this}, BestInPlaceEditor.forms.textarea.keyupHandler);
this.blurTimer = null;
this.userClicked = false;
},
getValue : function() {
return this.sanitizeValue(this.element.find("textarea").val());
},
// When buttons are present, use a timer on the blur event to give precedence to clicks
blurHandler : function(event) {
if (event.data.editor.okButton) {
event.data.editor.blurTimer = setTimeout(function () {
if (!event.data.editor.userClicked) {
event.data.editor.abortIfConfirm();
}
}, 500);
} else {
if (event.data.editor.cancelButton) {
event.data.editor.blurTimer = setTimeout(function () {
if (!event.data.editor.userClicked) {
event.data.editor.update();
}
}, 500);
} else {
event.data.editor.update();
}
}
},
submitHandler : function(event) {
event.data.editor.userClicked = true;
clearTimeout(event.data.editor.blurTimer);
event.data.editor.update();
},
cancelButtonHandler : function(event) {
event.data.editor.userClicked = true;
clearTimeout(event.data.editor.blurTimer);
event.data.editor.abortIfConfirm();
event.stopPropagation(); // Without this, click isn't handled
},
// START METAMAPS CODE
keydownHandler : function(event) {
if (event.keyCode == 13 && !event.shiftKey) {
event.preventDefault();
event.stopPropagation();
return false;
}
},
// END METAMAPS CODE
keyupHandler : function(event) {
if (event.keyCode == 27) {
event.data.editor.abortIfConfirm();
}
// START METAMAPS CODE
else if (event.keyCode == 13 && !event.shiftKey) {
event.data.editor.update();
}
// END METAMAPS CODE
}
}
};
jQuery.fn.best_in_place = function() {
function setBestInPlace(element) {
if (!element.data('bestInPlaceEditor')) {
element.data('bestInPlaceEditor', new BestInPlaceEditor(element));
return true;
}
}
jQuery(this.context).delegate(this.selector, 'click', function () {
var el = jQuery(this);
if (setBestInPlace(el))
el.click();
});
this.each(function () {
setBestInPlace(jQuery(this));
});
return this;
};
/**
* @name Elastic
* @descripton Elastic is Jquery plugin that grow and shrink your textareas automaticliy
* @version 1.6.5
* @requires Jquery 1.2.6+
*
* @author Jan Jarfalk
* @author-email jan.jarfalk@unwrongest.com
* @author-website http://www.unwrongest.com
*
* @licens MIT License - http://www.opensource.org/licenses/mit-license.php
*/
(function(jQuery){
if (typeof jQuery.fn.elastic !== 'undefined') return;
jQuery.fn.extend({
elastic: function() {
// We will create a div clone of the textarea
// by copying these attributes from the textarea to the div.
var mimics = [
'paddingTop',
'paddingRight',
'paddingBottom',
'paddingLeft',
'fontSize',
'lineHeight',
'fontFamily',
'width',
'fontWeight'];
return this.each( function() {
// Elastic only works on textareas
if ( this.type != 'textarea' ) {
return false;
}
var $textarea = jQuery(this),
$twin = jQuery('<div />').css({'position': 'absolute','display':'none','word-wrap':'break-word'}),
lineHeight = parseInt($textarea.css('line-height'),10) || parseInt($textarea.css('font-size'),'10'),
minheight = parseInt($textarea.css('height'),10) || lineHeight*3,
maxheight = parseInt($textarea.css('max-height'),10) || Number.MAX_VALUE,
goalheight = 0,
i = 0;
// Opera returns max-height of -1 if not set
if (maxheight < 0) { maxheight = Number.MAX_VALUE; }
// Append the twin to the DOM
// We are going to meassure the height of this, not the textarea.
$twin.appendTo($textarea.parent());
// Copy the essential styles (mimics) from the textarea to the twin
i = mimics.length;
while(i--){
$twin.css(mimics[i].toString(),$textarea.css(mimics[i].toString()));
}
// Sets a given height and overflow state on the textarea
function setHeightAndOverflow(height, overflow){
curratedHeight = Math.floor(parseInt(height,10));
if($textarea.height() != curratedHeight){
$textarea.css({'height': curratedHeight + 'px','overflow':overflow});
}
}
// This function will update the height of the textarea if necessary
function update() {
// Get curated content from the textarea.
var textareaContent = $textarea.val().replace(/&/g,'&amp;').replace(/ /g, '&nbsp;').replace(/<|>/g, '&gt;').replace(/\n/g, '<br />');
// Compare curated content with curated twin.
var twinContent = $twin.html().replace(/<br>/ig,'<br />');
if(textareaContent+'&nbsp;' != twinContent){
// Add an extra white space so new rows are added when you are at the end of a row.
$twin.html(textareaContent+'&nbsp;');
// Change textarea height if twin plus the height of one line differs more than 3 pixel from textarea height
if(Math.abs($twin.height() + lineHeight - $textarea.height()) > 3){
var goalheight = $twin.height()+lineHeight;
if(goalheight >= maxheight) {
setHeightAndOverflow(maxheight,'auto');
} else if(goalheight <= minheight) {
setHeightAndOverflow(minheight,'hidden');
} else {
setHeightAndOverflow(goalheight,'hidden');
}
}
}
}
// Hide scrollbars
$textarea.css({'overflow':'hidden'});
// Update textarea size on keyup, change, cut and paste
$textarea.bind('keyup change cut paste', function(){
update();
});
// Compact textarea on blur
// Lets animate this....
$textarea.bind('blur',function(){
if($twin.height() < maxheight){
if($twin.height() > minheight) {
$textarea.height($twin.height());
} else {
$textarea.height(minheight);
}
}
});
// And this line is to catch the browser paste event
$textarea.on("input paste", function(e){ setTimeout( update, 250); });
// Run update once when elastic is initialized
update();
});
}
});
})(jQuery);

View file

@ -0,0 +1,2 @@
!function(t){"use strict";var e=t.HTMLCanvasElement&&t.HTMLCanvasElement.prototype,o=t.Blob&&function(){try{return Boolean(new Blob)}catch(t){return!1}}(),n=o&&t.Uint8Array&&function(){try{return 100===new Blob([new Uint8Array(100)]).size}catch(t){return!1}}(),r=t.BlobBuilder||t.WebKitBlobBuilder||t.MozBlobBuilder||t.MSBlobBuilder,a=/^data:((.*?)(;charset=.*?)?)(;base64)?,/,i=(o||r)&&t.atob&&t.ArrayBuffer&&t.Uint8Array&&function(t){var e,i,l,u,b,c,d,B,f;if(e=t.match(a),!e)throw new Error("invalid data URI");for(i=e[2]?e[1]:"text/plain"+(e[3]||";charset=US-ASCII"),l=!!e[4],u=t.slice(e[0].length),b=l?atob(u):decodeURIComponent(u),c=new ArrayBuffer(b.length),d=new Uint8Array(c),B=0;B<b.length;B+=1)d[B]=b.charCodeAt(B);return o?new Blob([n?d:c],{type:i}):(f=new r,f.append(c),f.getBlob(i))};t.HTMLCanvasElement&&!e.toBlob&&(e.mozGetAsFile?e.toBlob=function(t,o,n){t(n&&e.toDataURL&&i?i(this.toDataURL(o,n)):this.mozGetAsFile("blob",o))}:e.toDataURL&&i&&(e.toBlob=function(t,e,o){t(i(this.toDataURL(e,o)))})),"function"==typeof define&&define.amd?define(function(){return i}):"object"==typeof module&&module.exports?module.exports=i:t.dataURLtoBlob=i}(window);
//# sourceMappingURL=canvas-to-blob.min.js.map

View file

@ -1,426 +1,431 @@
//////////////////////////////////////////////////////////////////////////////////
// CloudCarousel V1.0.5
// (c) 2011 by R Cecco. <http://www.professorcloud.com>
// MIT License
//
// Reflection code based on plugin by Christophe Beyls <http://www.digitalia.be>
//
// Please retain this copyright header in all versions of the software
//////////////////////////////////////////////////////////////////////////////////
var matched, browser;
jQuery.uaMatch = function( ua ) {
ua = ua.toLowerCase();
var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) ||
/(webkit)[ \/]([\w.]+)/.exec( ua ) ||
/(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) ||
/(msie) ([\w.]+)/.exec( ua ) ||
ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua ) ||
[];
return {
browser: match[ 1 ] || "",
version: match[ 2 ] || "0"
};
};
matched = jQuery.uaMatch( navigator.userAgent );
browser = {};
if ( matched.browser ) {
browser[ matched.browser ] = true;
browser.version = matched.version;
}
// Chrome is Webkit, but Webkit is also Safari.
if ( browser.chrome ) {
browser.webkit = true;
} else if ( browser.webkit ) {
browser.safari = true;
}
jQuery.browser = browser;
(function($) {
// START Reflection object.
// Creates a reflection for underneath an image.
// IE uses an image with IE specific filter properties, other browsers use the Canvas tag.
// The position and size of the reflection gets updated by updateAll() in Controller.
function Reflection(img, reflHeight, opacity) {
var reflection, cntx, imageWidth = img.width, imageHeight = img.width, gradient, parent;
parent = $(img.parentNode);
this.element = reflection = parent.append("<canvas class='reflection' style='position:absolute'/>").find(':last')[0];
if ( !reflection.getContext && $.browser.msie) {
this.element = reflection = parent.append("<img class='reflection' style='position:absolute'/>").find(':last')[0];
reflection.src = img.src;
reflection.style.filter = "flipv progid:DXImageTransform.Microsoft.Alpha(opacity=" + (opacity * 100) + ", style=1, finishOpacity=0, startx=0, starty=0, finishx=0, finishy=" + (reflHeight / imageHeight * 100) + ")";
} else {
cntx = reflection.getContext("2d");
try {
$(reflection).attr({width: imageWidth, height: reflHeight});
cntx.save();
cntx.translate(0, imageHeight-1);
cntx.scale(1, -1);
cntx.drawImage(img, 0, 0, imageWidth, imageHeight);
cntx.restore();
cntx.globalCompositeOperation = "destination-out";
gradient = cntx.createLinearGradient(0, 0, 0, reflHeight);
gradient.addColorStop(0, "rgba(255, 255, 255, " + (1 - opacity) + ")");
gradient.addColorStop(1, "rgba(255, 255, 255, 1.0)");
cntx.fillStyle = gradient;
cntx.fillRect(0, 0, imageWidth, reflHeight);
} catch(e) {
return;
}
}
// Store a copy of the alt and title attrs into the reflection
$(reflection).attr({ 'alt': $(img).attr('alt'), title: $(img).attr('title')} );
} //END Reflection object
// START Item object.
// A wrapper object for items within the carousel.
var Item = function(imgIn, options)
{
this.orgWidth = imgIn.width;
this.orgHeight = imgIn.height;
this.image = imgIn;
this.reflection = null;
this.alt = imgIn.alt;
this.title = imgIn.title;
this.imageOK = false;
this.options = options;
this.imageOK = true;
if (this.options.reflHeight > 0)
{
this.reflection = new Reflection(this.image, this.options.reflHeight, this.options.reflOpacity);
}
$(this.image).css('position','absolute'); // Bizarre. This seems to reset image width to 0 on webkit!
};// END Item object
// Controller object.
// This handles moving all the items, dealing with mouse clicks etc.
var Controller = function(container, images, options)
{
var items = [], funcSin = Math.sin, funcCos = Math.cos, ctx=this;
this.controlTimer = 0;
this.stopped = false;
//this.imagesLoaded = 0;
this.container = container;
this.xRadius = options.xRadius;
this.yRadius = options.yRadius;
this.showFrontTextTimer = 0;
this.autoRotateTimer = 0;
if (options.xRadius === 0)
{
this.xRadius = ($(container).width()/2.3);
}
if (options.yRadius === 0)
{
this.yRadius = ($(container).height()/6);
}
this.xCentre = options.xPos;
this.yCentre = options.yPos;
this.frontIndex = 0; // Index of the item at the front
// Start with the first item at the front.
this.rotation = this.destRotation = Math.PI/2;
this.timeDelay = 1000/options.FPS;
// Turn on the infoBox
if(options.altBox !== null)
{
$(options.altBox).css('display','block');
$(options.titleBox).css('display','block');
}
// Turn on relative position for container to allow absolutely positioned elements
// within it to work.
$(container).css({ position:'relative', overflow:'hidden'} );
$(options.buttonLeft).css('display','inline');
$(options.buttonRight).css('display','inline');
// Setup the buttons.
$(options.buttonLeft).bind('mouseup',this,function(event){
event.data.rotate(-1);
return false;
});
$(options.buttonRight).bind('mouseup',this,function(event){
event.data.rotate(1);
return false;
});
// Add code that makes tab and shift+tab scroll through metacodes
$('.new_topic').bind('keydown',this,function(event){
if (event.keyCode == 9 && event.shiftKey) {
event.data.rotate(-1);
event.preventDefault();
event.stopPropagation();
} else if (event.keyCode == 9) {
event.data.rotate(1);
event.preventDefault();
event.stopPropagation();
}
});
// You will need this plugin for the mousewheel to work: http://plugins.jquery.com/project/mousewheel
if (options.mouseWheel)
{
// START METAMAPS CODE
$('body').bind('mousewheel',this,function(event, delta) {
if (Metamaps.Create.newTopic.beingCreated && !Metamaps.Create.isSwitchingSet) {
event.data.rotate(delta);
return false;
}
});
// END METAMAPS CODE
/* ORIGINAL CODE
$(container).bind('mousewheel',this,function(event, delta) {
event.data.rotate(delta);
return false;
});
*/
}
$(container).bind('mouseover click',this,function(event){
clearInterval(event.data.autoRotateTimer); // Stop auto rotation if mouse over.
var text = $(event.target).attr('alt');
// If we have moved over a carousel item, then show the alt and title text.
if ( text !== undefined && text !== null )
{
clearTimeout(event.data.showFrontTextTimer);
$(options.altBox).html( ($(event.target).attr('alt') ));
//$(options.titleBox).html( ($(event.target).attr('title') ));
if ( options.bringToFront && event.type == 'click' )
{
$(options.titleBox).html( ($(event.target).attr('title') ));
// METAMAPS CODE
Metamaps.Create.newTopic.metacode = $(event.target).attr('data-id');
// NOT METAMAPS CODE
var idx = $(event.target).data('itemIndex');
var frontIndex = event.data.frontIndex;
//var diff = idx - frontIndex;
var diff = (idx - frontIndex) % images.length;
if (Math.abs(diff) > images.length / 2) {
diff += (diff > 0 ? -images.length : images.length);
}
event.data.rotate(-diff);
}
}
});
// If we have moved out of a carousel item (or the container itself),
// restore the text of the front item in 1 second.
$(container).bind('mouseout',this,function(event){
var context = event.data;
clearTimeout(context.showFrontTextTimer);
context.showFrontTextTimer = setTimeout( function(){context.showFrontText();},1000);
context.autoRotate(); // Start auto rotation.
});
// Prevent items from being selected as mouse is moved and clicked in the container.
$(container).bind('mousedown',this,function(event){
event.data.container.focus();
return false;
});
container.onselectstart = function () { return false; }; // For IE.
this.innerWrapper = $(container).wrapInner('<div style="position:absolute;width:100%;height:100%;"/>').children()[0];
// Shows the text from the front most item.
this.showFrontText = function()
{
if ( items[this.frontIndex] === undefined ) { return; } // Images might not have loaded yet.
// METAMAPS CODE
Metamaps.Create.newTopic.metacode = $(items[this.frontIndex].image).attr('data-id');
//$('img.cloudcarousel').css({"background":"none", "width":"","height":""});
//$(items[this.frontIndex].image).css({"width":"45px","height":"45px"});
// NOT METAMAPS CODE
$(options.titleBox).html( $(items[this.frontIndex].image).attr('title'));
$(options.altBox).html( $(items[this.frontIndex].image).attr('alt'));
};
this.go = function()
{
if(this.controlTimer !== 0) { return; }
var context = this;
this.controlTimer = setTimeout( function(){context.updateAll();},this.timeDelay);
};
this.stop = function()
{
clearTimeout(this.controlTimer);
this.controlTimer = 0;
};
// Starts the rotation of the carousel. Direction is the number (+-) of carousel items to rotate by.
this.rotate = function(direction)
{
this.frontIndex -= direction;
if (this.frontIndex == -1) this.frontIndex = items.length - 1;
this.frontIndex %= items.length;
this.destRotation += ( Math.PI / items.length ) * ( 2*direction );
this.showFrontText();
this.go();
};
this.autoRotate = function()
{
if ( options.autoRotate !== 'no' )
{
var dir = (options.autoRotate === 'right')? 1 : -1;
this.autoRotateTimer = setInterval( function(){ctx.rotate(dir); }, options.autoRotateDelay );
}
};
// This is the main loop function that moves everything.
this.updateAll = function()
{
var minScale = options.minScale; // This is the smallest scale applied to the furthest item.
var smallRange = (1-minScale) * 0.5;
var w,h,x,y,scale,item,sinVal;
var change = (this.destRotation - this.rotation);
var absChange = Math.abs(change);
this.rotation += change * options.speed;
if ( absChange < 0.001 ) { this.rotation = this.destRotation; }
var itemsLen = items.length;
var spacing = (Math.PI / itemsLen) * 2;
//var wrapStyle = null;
var radians = this.rotation;
var isMSIE = $.browser.msie;
// Turn off display. This can reduce repaints/reflows when making style and position changes in the loop.
// See http://dev.opera.com/articles/view/efficient-javascript/?page=3
this.innerWrapper.style.display = 'none';
var style;
var px = 'px', reflHeight;
var context = this;
for (var i = 0; i<itemsLen ;i++)
{
item = items[i];
sinVal = funcSin(radians);
scale = ((sinVal+1) * smallRange) + minScale;
x = this.xCentre + (( (funcCos(radians) * this.xRadius) - (item.orgWidth*0.5)) * scale);
y = this.yCentre + (( (sinVal * this.yRadius) ) * scale);
if (item.imageOK)
{
var img = item.image;
img.style.zIndex = "" + (scale * 100)>>0; // >>0 = Math.foor(). Firefox doesn't like fractional decimals in z-index.
w = img.width = item.orgWidth * scale;
h = img.height = item.orgHeight * scale;
img.style.left = x + px ;
img.style.top = y + px;
if (item.reflection !== null)
{
reflHeight = options.reflHeight * scale;
style = item.reflection.element.style;
style.left = x + px;
style.top = y + h + options.reflGap * scale + px;
style.width = w + px;
if (isMSIE)
{
style.filter.finishy = (reflHeight / h * 100);
}else
{
style.height = reflHeight + px;
}
}
}
radians += spacing;
}
// Turn display back on.
this.innerWrapper.style.display = 'block';
// If we have a preceptable change in rotation then loop again next frame.
if ( absChange >= 0.001 )
{
this.controlTimer = setTimeout( function(){context.updateAll();},this.timeDelay);
}else
{
// Otherwise just stop completely.
this.stop();
}
}; // END updateAll
// Create an Item object for each image
// func = function(){return;ctx.updateAll();} ;
// Check if images have loaded. We need valid widths and heights for the reflections.
this.checkImagesLoaded = function()
{
var i;
for(i=0;i<images.length;i++) {
if ( (images[i].width === undefined) || ( (images[i].complete !== undefined) && (!images[i].complete) ))
{
return;
}
}
for(i=0;i<images.length;i++) {
items.push( new Item( images[i], options ) );
$(images[i]).data('itemIndex',i);
}
// If all images have valid widths and heights, we can stop checking.
clearInterval(this.tt);
this.showFrontText();
this.autoRotate();
this.updateAll();
};
this.tt = setInterval( function(){ctx.checkImagesLoaded();},50);
}; // END Controller object
// The jQuery plugin part. Iterates through items specified in selector and inits a Controller class for each one.
$.fn.CloudCarousel = function(options) {
this.each( function() {
options = $.extend({}, {
reflHeight:0,
reflOpacity:0.5,
reflGap:0,
minScale:0.5,
xPos:0,
yPos:0,
xRadius:0,
yRadius:0,
altBox:null,
titleBox:null,
FPS: 30,
autoRotate: 'no',
autoRotateDelay: 1500,
speed:0.2,
mouseWheel: false,
bringToFront: false
},options );
// Create a Controller for each carousel.
$(this).data('cloudcarousel', new Controller( this, $('.cloudcarousel',$(this)), options) );
});
return this;
};
})(jQuery);
//////////////////////////////////////////////////////////////////////////////////
// CloudCarousel V1.0.5
// (c) 2011 by R Cecco. <http://www.professorcloud.com>
// MIT License
//
// Reflection code based on plugin by Christophe Beyls <http://www.digitalia.be>
//
// Please retain this copyright header in all versions of the software
//////////////////////////////////////////////////////////////////////////////////
var matched, browser;
jQuery.uaMatch = function( ua ) {
ua = ua.toLowerCase();
var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) ||
/(webkit)[ \/]([\w.]+)/.exec( ua ) ||
/(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) ||
/(msie) ([\w.]+)/.exec( ua ) ||
ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua ) ||
[];
return {
browser: match[ 1 ] || "",
version: match[ 2 ] || "0"
};
};
matched = jQuery.uaMatch( navigator.userAgent );
browser = {};
if ( matched.browser ) {
browser[ matched.browser ] = true;
browser.version = matched.version;
}
// Chrome is Webkit, but Webkit is also Safari.
if ( browser.chrome ) {
browser.webkit = true;
} else if ( browser.webkit ) {
browser.safari = true;
}
jQuery.browser = browser;
(function($) {
// START Reflection object.
// Creates a reflection for underneath an image.
// IE uses an image with IE specific filter properties, other browsers use the Canvas tag.
// The position and size of the reflection gets updated by updateAll() in Controller.
function Reflection(img, reflHeight, opacity) {
var reflection, cntx, imageWidth = img.width, imageHeight = img.width, gradient, parent;
parent = $(img.parentNode);
this.element = reflection = parent.append("<canvas class='reflection' style='position:absolute'/>").find(':last')[0];
if ( !reflection.getContext && $.browser.msie) {
this.element = reflection = parent.append("<img class='reflection' style='position:absolute'/>").find(':last')[0];
reflection.src = img.src;
reflection.style.filter = "flipv progid:DXImageTransform.Microsoft.Alpha(opacity=" + (opacity * 100) + ", style=1, finishOpacity=0, startx=0, starty=0, finishx=0, finishy=" + (reflHeight / imageHeight * 100) + ")";
} else {
cntx = reflection.getContext("2d");
try {
$(reflection).attr({width: imageWidth, height: reflHeight});
cntx.save();
cntx.translate(0, imageHeight-1);
cntx.scale(1, -1);
cntx.drawImage(img, 0, 0, imageWidth, imageHeight);
cntx.restore();
cntx.globalCompositeOperation = "destination-out";
gradient = cntx.createLinearGradient(0, 0, 0, reflHeight);
gradient.addColorStop(0, "rgba(255, 255, 255, " + (1 - opacity) + ")");
gradient.addColorStop(1, "rgba(255, 255, 255, 1.0)");
cntx.fillStyle = gradient;
cntx.fillRect(0, 0, imageWidth, reflHeight);
} catch(e) {
return;
}
}
// Store a copy of the alt and title attrs into the reflection
$(reflection).attr({ 'alt': $(img).attr('alt'), title: $(img).attr('title')} );
} //END Reflection object
// START Item object.
// A wrapper object for items within the carousel.
var Item = function(imgIn, options)
{
this.orgWidth = imgIn.width;
this.orgHeight = imgIn.height;
this.image = imgIn;
this.reflection = null;
this.alt = imgIn.alt;
this.title = imgIn.title;
this.imageOK = false;
this.options = options;
this.imageOK = true;
if (this.options.reflHeight > 0)
{
this.reflection = new Reflection(this.image, this.options.reflHeight, this.options.reflOpacity);
}
$(this.image).css('position','absolute'); // Bizarre. This seems to reset image width to 0 on webkit!
};// END Item object
// Controller object.
// This handles moving all the items, dealing with mouse clicks etc.
var Controller = function(container, images, options)
{
var items = [], funcSin = Math.sin, funcCos = Math.cos, ctx=this;
this.controlTimer = 0;
this.stopped = false;
//this.imagesLoaded = 0;
this.container = container;
this.xRadius = options.xRadius;
this.yRadius = options.yRadius;
this.showFrontTextTimer = 0;
this.autoRotateTimer = 0;
if (options.xRadius === 0)
{
this.xRadius = ($(container).width()/2.3);
}
if (options.yRadius === 0)
{
this.yRadius = ($(container).height()/6);
}
this.xCentre = options.xPos;
this.yCentre = options.yPos;
this.frontIndex = 0; // Index of the item at the front
// Start with the first item at the front.
this.rotation = this.destRotation = Math.PI/2;
this.timeDelay = 1000/options.FPS;
// Turn on the infoBox
if(options.altBox !== null)
{
$(options.altBox).css('display','block');
$(options.titleBox).css('display','block');
}
// Turn on relative position for container to allow absolutely positioned elements
// within it to work.
$(container).css({ position:'relative', overflow:'hidden'} );
$(options.buttonLeft).css('display','inline');
$(options.buttonRight).css('display','inline');
// Setup the buttons.
$(options.buttonLeft).bind('mouseup',this,function(event){
event.data.rotate(-1);
return false;
});
$(options.buttonRight).bind('mouseup',this,function(event){
event.data.rotate(1);
return false;
});
// START METAMAPS CODE
// Add code that makes tab and shift+tab scroll through metacodes
$('.new_topic').bind('keydown',this,function(event){
if (event.keyCode == 9) {
if (event.shiftKey) {
event.data.rotate(-1)
} else {
event.data.rotate(1)
}
event.preventDefault();
event.stopPropagation();
Metamaps.Create.newTopic.metacode = $(items[event.data.frontIndex].image).attr('data-id');
}
});
// END METAMAPS CODE
// You will need this plugin for the mousewheel to work: http://plugins.jquery.com/project/mousewheel
if (options.mouseWheel)
{
// START METAMAPS CODE
$('body').bind('mousewheel',this,function(event, delta) {
if (Metamaps.Create.newTopic.beingCreated &&
!Metamaps.Create.isSwitchingSet &&
!Metamaps.Create.newTopic.pinned) {
event.data.rotate(delta);
return false;
}
});
// END METAMAPS CODE
// ORIGINAL CODE
// $(container).bind('mousewheel',this,function(event, delta) {
// event.data.rotate(delta);
// return false;
// });
//
}
$(container).unbind('mouseover click').bind('mouseover click',this,function(event){
clearInterval(event.data.autoRotateTimer); // Stop auto rotation if mouse over.
var text = $(event.target).attr('alt');
// If we have moved over a carousel item, then show the alt and title text.
if ( text !== undefined && text !== null )
{
clearTimeout(event.data.showFrontTextTimer);
$(options.altBox).html( ($(event.target).attr('alt') ));
//$(options.titleBox).html( ($(event.target).attr('title') ));
if ( options.bringToFront && event.type == 'click' )
{
$(options.titleBox).html( ($(event.target).attr('title') ));
// START METAMAPS CODE
Metamaps.Create.newTopic.metacode = $(event.target).attr('data-id');
// END METAMAPS CODE
var idx = $(event.target).data('itemIndex');
var frontIndex = event.data.frontIndex;
//var diff = idx - frontIndex;
var diff = (idx - frontIndex) % images.length;
if (Math.abs(diff) > images.length / 2) {
diff += (diff > 0 ? -images.length : images.length);
}
event.data.rotate(-diff);
}
}
});
// START METAMAPS CODE - initialize newTopic.metacode
var first = $(this.container).find('img').get(0)
Metamaps.Create.newTopic.metacode = $(first).data('id')
// END METAMAPS CODE
// If we have moved out of a carousel item (or the container itself),
// restore the text of the front item in 1 second.
$(container).bind('mouseout',this,function(event){
var context = event.data;
clearTimeout(context.showFrontTextTimer);
context.showFrontTextTimer = setTimeout( function(){context.showFrontText();},1000);
context.autoRotate(); // Start auto rotation.
});
// Prevent items from being selected as mouse is moved and clicked in the container.
$(container).bind('mousedown',this,function(event){
event.data.container.focus();
return false;
});
container.onselectstart = function () { return false; }; // For IE.
this.innerWrapper = $(container).wrapInner('<div style="position:absolute;width:100%;height:100%;"/>').children()[0];
// Shows the text from the front most item.
this.showFrontText = function()
{
if ( items[this.frontIndex] === undefined ) { return; } // Images might not have loaded yet.
$(options.titleBox).html( $(items[this.frontIndex].image).attr('title'));
$(options.altBox).html( $(items[this.frontIndex].image).attr('alt'));
};
this.go = function()
{
if(this.controlTimer !== 0) { return; }
var context = this;
this.controlTimer = setTimeout( function(){context.updateAll();},this.timeDelay);
};
this.stop = function()
{
clearTimeout(this.controlTimer);
this.controlTimer = 0;
};
// Starts the rotation of the carousel. Direction is the number (+-) of carousel items to rotate by.
this.rotate = function(direction)
{
this.frontIndex -= direction;
if (this.frontIndex == -1) this.frontIndex = items.length - 1;
this.frontIndex %= items.length;
this.destRotation += ( Math.PI / items.length ) * ( 2*direction );
this.showFrontText();
this.go();
};
this.autoRotate = function()
{
if ( options.autoRotate !== 'no' )
{
var dir = (options.autoRotate === 'right')? 1 : -1;
this.autoRotateTimer = setInterval( function(){ctx.rotate(dir); }, options.autoRotateDelay );
}
};
// This is the main loop function that moves everything.
this.updateAll = function()
{
var minScale = options.minScale; // This is the smallest scale applied to the furthest item.
var smallRange = (1-minScale) * 0.5;
var w,h,x,y,scale,item,sinVal;
var change = (this.destRotation - this.rotation);
var absChange = Math.abs(change);
this.rotation += change * options.speed;
if ( absChange < 0.001 ) { this.rotation = this.destRotation; }
var itemsLen = items.length;
var spacing = (Math.PI / itemsLen) * 2;
//var wrapStyle = null;
var radians = this.rotation;
var isMSIE = $.browser.msie;
// Turn off display. This can reduce repaints/reflows when making style and position changes in the loop.
// See http://dev.opera.com/articles/view/efficient-javascript/?page=3
this.innerWrapper.style.display = 'none';
var style;
var px = 'px', reflHeight;
var context = this;
for (var i = 0; i<itemsLen ;i++)
{
item = items[i];
sinVal = funcSin(radians);
scale = ((sinVal+1) * smallRange) + minScale;
x = this.xCentre + (( (funcCos(radians) * this.xRadius) - (item.orgWidth*0.5)) * scale);
y = this.yCentre + (( (sinVal * this.yRadius) ) * scale);
if (item.imageOK)
{
var img = item.image;
img.style.zIndex = "" + (scale * 100)>>0; // >>0 = Math.foor(). Firefox doesn't like fractional decimals in z-index.
w = img.width = item.orgWidth * scale;
h = img.height = item.orgHeight * scale;
img.style.left = x + px ;
img.style.top = y + px;
if (item.reflection !== null)
{
reflHeight = options.reflHeight * scale;
style = item.reflection.element.style;
style.left = x + px;
style.top = y + h + options.reflGap * scale + px;
style.width = w + px;
if (isMSIE)
{
style.filter.finishy = (reflHeight / h * 100);
}else
{
style.height = reflHeight + px;
}
}
}
radians += spacing;
}
// Turn display back on.
this.innerWrapper.style.display = 'block';
// If we have a preceptable change in rotation then loop again next frame.
if ( absChange >= 0.001 )
{
this.controlTimer = setTimeout( function(){context.updateAll();},this.timeDelay);
}else
{
// Otherwise just stop completely.
this.stop();
}
}; // END updateAll
// Create an Item object for each image
// func = function(){return;ctx.updateAll();} ;
// Check if images have loaded. We need valid widths and heights for the reflections.
this.checkImagesLoaded = function()
{
var i;
for(i=0;i<images.length;i++) {
if ( (images[i].width === undefined) || ( (images[i].complete !== undefined) && (!images[i].complete) ))
{
return;
}
}
for(i=0;i<images.length;i++) {
items.push( new Item( images[i], options ) );
$(images[i]).data('itemIndex',i);
}
// If all images have valid widths and heights, we can stop checking.
clearInterval(this.tt);
this.showFrontText();
this.autoRotate();
this.updateAll();
};
this.tt = setInterval( function(){ctx.checkImagesLoaded();},50);
}; // END Controller object
// The jQuery plugin part. Iterates through items specified in selector and inits a Controller class for each one.
$.fn.CloudCarousel = function(options) {
this.each( function() {
options = $.extend({}, {
reflHeight:0,
reflOpacity:0.5,
reflGap:0,
minScale:0.5,
xPos:0,
yPos:0,
xRadius:0,
yRadius:0,
altBox:null,
titleBox:null,
FPS: 30,
autoRotate: 'no',
autoRotateDelay: 1500,
speed:0.2,
mouseWheel: false,
bringToFront: false
},options );
// Create a Controller for each carousel.
$(this).data('cloudcarousel', new Controller( this, $('.cloudcarousel',$(this)), options) );
});
return this;
};
})(jQuery);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,180 +0,0 @@
/**
* jquery.purr.js
* Copyright (c) 2008 Net Perspective (net-perspective.com)
* Licensed under the MIT License (http://www.opensource.org/licenses/mit-license.php)
*
* @author R.A. Ray
* @projectDescription jQuery plugin for dynamically displaying unobtrusive messages in the browser. Mimics the behavior of the MacOS program "Growl."
* @version 0.1.0
*
* @requires jquery.js (tested with 1.2.6)
*
* @param fadeInSpeed int - Duration of fade in animation in miliseconds
* default: 500
* @param fadeOutSpeed int - Duration of fade out animationin miliseconds
default: 500
* @param removeTimer int - Timeout, in miliseconds, before notice is removed once it is the top non-sticky notice in the list
default: 4000
* @param isSticky bool - Whether the notice should fade out on its own or wait to be manually closed
default: false
* @param usingTransparentPNG bool - Whether or not the notice is using transparent .png images in its styling
default: false
*/
( function( $ ) {
$.purr = function ( notice, options )
{
// Convert notice to a jQuery object
notice = $( notice );
// Add a class to denote the notice as not sticky
if ( !options.isSticky )
{
notice.addClass( 'not-sticky' );
};
// Get the container element from the page
var cont = document.getElementById( 'purr-container' );
// If the container doesn't yet exist, we need to create it
if ( !cont )
{
cont = '<div id="purr-container"></div>';
}
// Convert cont to a jQuery object
cont = $( cont );
// Add the container to the page
$( 'body' ).append( cont );
notify();
function notify ()
{
// Set up the close button
var close = document.createElement( 'a' );
$( close ).attr(
{
className: 'close',
href: '#close',
innerHTML: 'Close'
}
)
.appendTo( notice )
.click( function ()
{
removeNotice();
return false;
}
);
// Add the notice to the page and keep it hidden initially
notice.appendTo( cont )
.hide();
if ( jQuery.browser.msie && options.usingTransparentPNG )
{
// IE7 and earlier can't handle the combination of opacity and transparent pngs, so if we're using transparent pngs in our
// notice style, we'll just skip the fading in.
notice.show();
}
else
{
//Fade in the notice we just added
notice.fadeIn( options.fadeInSpeed );
}
// Set up the removal interval for the added notice if that notice is not a sticky
if ( !options.isSticky )
{
var topSpotInt = setInterval( function ()
{
// Check to see if our notice is the first non-sticky notice in the list
if ( notice.prevAll( '.not-sticky' ).length == 0 )
{
// Stop checking once the condition is met
clearInterval( topSpotInt );
// Call the close action after the timeout set in options
setTimeout( function ()
{
removeNotice();
}, options.removeTimer
);
}
}, 200 );
}
}
function removeNotice ()
{
// IE7 and earlier can't handle the combination of opacity and transparent pngs, so if we're using transparent pngs in our
// notice style, we'll just skip the fading out.
if ( jQuery.browser.msie && options.usingTransparentPNG )
{
notice.css( { opacity: 0 } )
.animate(
{
height: '0px'
},
{
duration: options.fadeOutSpeed,
complete: function ()
{
notice.remove();
}
}
);
}
else
{
// Fade the object out before reducing its height to produce the sliding effect
notice.animate(
{
opacity: '0'
},
{
duration: options.fadeOutSpeed,
complete: function ()
{
notice.animate(
{
height: '0px'
},
{
duration: options.fadeOutSpeed,
complete: function ()
{
notice.remove();
}
}
);
}
}
);
}
};
};
$.fn.purr = function ( options )
{
options = options || {};
options.fadeInSpeed = options.fadeInSpeed || 500;
options.fadeOutSpeed = options.fadeOutSpeed || 500;
options.removeTimer = options.removeTimer || 4000;
options.isSticky = options.isSticky || false;
options.usingTransparentPNG = options.usingTransparentPNG || false;
this.each( function()
{
new $.purr( this, options );
}
);
return this;
};
})( jQuery );

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,41 +0,0 @@
var USERVOICE;
if(USERVOICE == undefined) {
USERVOICE = {};
}
USERVOICE.load = function (name, id, email, sso_token) {
// Include the UserVoice JavaScript SDK (only needed once on a page)
UserVoice=window.UserVoice||[];(function(){var uv=document.createElement('script');uv.type='text/javascript';uv.async=true;uv.src='//widget.uservoice.com/wybK0nSMNuhlWkIKzTyWg.js';var s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(uv,s)})();
//
// UserVoice Javascript SDK developer documentation:
// https://www.uservoice.com/o/javascript-sdk
//
// Set colors
UserVoice.push(['set', {
accent_color: '#448dd6',
trigger_color: 'white',
trigger_background_color: 'rgba(46, 49, 51, 0.6)'
}]);
// Identify the user and pass traits
// To enable, replace sample data with actual user traits and uncomment the line
if (name) {
UserVoice.push(['setSSO', sso_token]);
UserVoice.push(['identify', {
'email': email, // Users email address
'name': name, // Users real name
'id': id, // Optional: Unique id of the user
}]);
}
// Add default trigger to the bottom-left corner of the window:
UserVoice.push(['addTrigger', { mode: 'contact', trigger_position: 'bottom-left' }]);
// Or, use your own custom trigger:
//UserVoice.push(['addTrigger', '#barometer_tab', { mode: 'contact' }]);
// Autoprompt for Satisfaction and SmartVote (only displayed under certain conditions)
UserVoice.push(['autoprompt', {}]);
};

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,36 +0,0 @@
/*
RequireJS 2.1.11 Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.
Available via the MIT or new BSD license.
see: http://github.com/jrburke/requirejs for details
*/
var requirejs,require,define;
(function(ca){function G(b){return"[object Function]"===M.call(b)}function H(b){return"[object Array]"===M.call(b)}function v(b,c){if(b){var d;for(d=0;d<b.length&&(!b[d]||!c(b[d],d,b));d+=1);}}function U(b,c){if(b){var d;for(d=b.length-1;-1<d&&(!b[d]||!c(b[d],d,b));d-=1);}}function s(b,c){return ga.call(b,c)}function j(b,c){return s(b,c)&&b[c]}function B(b,c){for(var d in b)if(s(b,d)&&c(b[d],d))break}function V(b,c,d,g){c&&B(c,function(c,h){if(d||!s(b,h))g&&"object"===typeof c&&c&&!H(c)&&!G(c)&&!(c instanceof
RegExp)?(b[h]||(b[h]={}),V(b[h],c,d,g)):b[h]=c});return b}function t(b,c){return function(){return c.apply(b,arguments)}}function da(b){throw b;}function ea(b){if(!b)return b;var c=ca;v(b.split("."),function(b){c=c[b]});return c}function C(b,c,d,g){c=Error(c+"\nhttp://requirejs.org/docs/errors.html#"+b);c.requireType=b;c.requireModules=g;d&&(c.originalError=d);return c}function ha(b){function c(a,e,b){var f,n,c,d,g,h,i,I=e&&e.split("/");n=I;var m=l.map,k=m&&m["*"];if(a&&"."===a.charAt(0))if(e){n=
I.slice(0,I.length-1);a=a.split("/");e=a.length-1;l.nodeIdCompat&&R.test(a[e])&&(a[e]=a[e].replace(R,""));n=a=n.concat(a);d=n.length;for(e=0;e<d;e++)if(c=n[e],"."===c)n.splice(e,1),e-=1;else if(".."===c)if(1===e&&(".."===n[2]||".."===n[0]))break;else 0<e&&(n.splice(e-1,2),e-=2);a=a.join("/")}else 0===a.indexOf("./")&&(a=a.substring(2));if(b&&m&&(I||k)){n=a.split("/");e=n.length;a:for(;0<e;e-=1){d=n.slice(0,e).join("/");if(I)for(c=I.length;0<c;c-=1)if(b=j(m,I.slice(0,c).join("/")))if(b=j(b,d)){f=b;
g=e;break a}!h&&(k&&j(k,d))&&(h=j(k,d),i=e)}!f&&h&&(f=h,g=i);f&&(n.splice(0,g,f),a=n.join("/"))}return(f=j(l.pkgs,a))?f:a}function d(a){z&&v(document.getElementsByTagName("script"),function(e){if(e.getAttribute("data-requiremodule")===a&&e.getAttribute("data-requirecontext")===i.contextName)return e.parentNode.removeChild(e),!0})}function g(a){var e=j(l.paths,a);if(e&&H(e)&&1<e.length)return e.shift(),i.require.undef(a),i.require([a]),!0}function u(a){var e,b=a?a.indexOf("!"):-1;-1<b&&(e=a.substring(0,
b),a=a.substring(b+1,a.length));return[e,a]}function m(a,e,b,f){var n,d,g=null,h=e?e.name:null,l=a,m=!0,k="";a||(m=!1,a="_@r"+(M+=1));a=u(a);g=a[0];a=a[1];g&&(g=c(g,h,f),d=j(p,g));a&&(g?k=d&&d.normalize?d.normalize(a,function(a){return c(a,h,f)}):c(a,h,f):(k=c(a,h,f),a=u(k),g=a[0],k=a[1],b=!0,n=i.nameToUrl(k)));b=g&&!d&&!b?"_unnormalized"+(Q+=1):"";return{prefix:g,name:k,parentMap:e,unnormalized:!!b,url:n,originalName:l,isDefine:m,id:(g?g+"!"+k:k)+b}}function q(a){var e=a.id,b=j(k,e);b||(b=k[e]=new i.Module(a));
return b}function r(a,e,b){var f=a.id,n=j(k,f);if(s(p,f)&&(!n||n.defineEmitComplete))"defined"===e&&b(p[f]);else if(n=q(a),n.error&&"error"===e)b(n.error);else n.on(e,b)}function w(a,e){var b=a.requireModules,f=!1;if(e)e(a);else if(v(b,function(e){if(e=j(k,e))e.error=a,e.events.error&&(f=!0,e.emit("error",a))}),!f)h.onError(a)}function x(){S.length&&(ia.apply(A,[A.length,0].concat(S)),S=[])}function y(a){delete k[a];delete W[a]}function F(a,e,b){var f=a.map.id;a.error?a.emit("error",a.error):(e[f]=
!0,v(a.depMaps,function(f,c){var d=f.id,g=j(k,d);g&&(!a.depMatched[c]&&!b[d])&&(j(e,d)?(a.defineDep(c,p[d]),a.check()):F(g,e,b))}),b[f]=!0)}function D(){var a,e,b=(a=1E3*l.waitSeconds)&&i.startTime+a<(new Date).getTime(),f=[],c=[],h=!1,k=!0;if(!X){X=!0;B(W,function(a){var i=a.map,m=i.id;if(a.enabled&&(i.isDefine||c.push(a),!a.error))if(!a.inited&&b)g(m)?h=e=!0:(f.push(m),d(m));else if(!a.inited&&(a.fetched&&i.isDefine)&&(h=!0,!i.prefix))return k=!1});if(b&&f.length)return a=C("timeout","Load timeout for modules: "+
f,null,f),a.contextName=i.contextName,w(a);k&&v(c,function(a){F(a,{},{})});if((!b||e)&&h)if((z||fa)&&!Y)Y=setTimeout(function(){Y=0;D()},50);X=!1}}function E(a){s(p,a[0])||q(m(a[0],null,!0)).init(a[1],a[2])}function K(a){var a=a.currentTarget||a.srcElement,e=i.onScriptLoad;a.detachEvent&&!Z?a.detachEvent("onreadystatechange",e):a.removeEventListener("load",e,!1);e=i.onScriptError;(!a.detachEvent||Z)&&a.removeEventListener("error",e,!1);return{node:a,id:a&&a.getAttribute("data-requiremodule")}}function L(){var a;
for(x();A.length;){a=A.shift();if(null===a[0])return w(C("mismatch","Mismatched anonymous define() module: "+a[a.length-1]));E(a)}}var X,$,i,N,Y,l={waitSeconds:7,baseUrl:"./",paths:{},bundles:{},pkgs:{},shim:{},config:{}},k={},W={},aa={},A=[],p={},T={},ba={},M=1,Q=1;N={require:function(a){return a.require?a.require:a.require=i.makeRequire(a.map)},exports:function(a){a.usingExports=!0;if(a.map.isDefine)return a.exports?p[a.map.id]=a.exports:a.exports=p[a.map.id]={}},module:function(a){return a.module?
a.module:a.module={id:a.map.id,uri:a.map.url,config:function(){return j(l.config,a.map.id)||{}},exports:a.exports||(a.exports={})}}};$=function(a){this.events=j(aa,a.id)||{};this.map=a;this.shim=j(l.shim,a.id);this.depExports=[];this.depMaps=[];this.depMatched=[];this.pluginMaps={};this.depCount=0};$.prototype={init:function(a,e,b,f){f=f||{};if(!this.inited){this.factory=e;if(b)this.on("error",b);else this.events.error&&(b=t(this,function(a){this.emit("error",a)}));this.depMaps=a&&a.slice(0);this.errback=
b;this.inited=!0;this.ignore=f.ignore;f.enabled||this.enabled?this.enable():this.check()}},defineDep:function(a,e){this.depMatched[a]||(this.depMatched[a]=!0,this.depCount-=1,this.depExports[a]=e)},fetch:function(){if(!this.fetched){this.fetched=!0;i.startTime=(new Date).getTime();var a=this.map;if(this.shim)i.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],t(this,function(){return a.prefix?this.callPlugin():this.load()}));else return a.prefix?this.callPlugin():this.load()}},load:function(){var a=
this.map.url;T[a]||(T[a]=!0,i.load(this.map.id,a))},check:function(){if(this.enabled&&!this.enabling){var a,e,b=this.map.id;e=this.depExports;var f=this.exports,c=this.factory;if(this.inited)if(this.error)this.emit("error",this.error);else{if(!this.defining){this.defining=!0;if(1>this.depCount&&!this.defined){if(G(c)){if(this.events.error&&this.map.isDefine||h.onError!==da)try{f=i.execCb(b,c,e,f)}catch(d){a=d}else f=i.execCb(b,c,e,f);this.map.isDefine&&void 0===f&&((e=this.module)?f=e.exports:this.usingExports&&
(f=this.exports));if(a)return a.requireMap=this.map,a.requireModules=this.map.isDefine?[this.map.id]:null,a.requireType=this.map.isDefine?"define":"require",w(this.error=a)}else f=c;this.exports=f;if(this.map.isDefine&&!this.ignore&&(p[b]=f,h.onResourceLoad))h.onResourceLoad(i,this.map,this.depMaps);y(b);this.defined=!0}this.defining=!1;this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}}else this.fetch()}},callPlugin:function(){var a=
this.map,b=a.id,d=m(a.prefix);this.depMaps.push(d);r(d,"defined",t(this,function(f){var d,g;g=j(ba,this.map.id);var J=this.map.name,u=this.map.parentMap?this.map.parentMap.name:null,p=i.makeRequire(a.parentMap,{enableBuildCallback:!0});if(this.map.unnormalized){if(f.normalize&&(J=f.normalize(J,function(a){return c(a,u,!0)})||""),f=m(a.prefix+"!"+J,this.map.parentMap),r(f,"defined",t(this,function(a){this.init([],function(){return a},null,{enabled:!0,ignore:!0})})),g=j(k,f.id)){this.depMaps.push(f);
if(this.events.error)g.on("error",t(this,function(a){this.emit("error",a)}));g.enable()}}else g?(this.map.url=i.nameToUrl(g),this.load()):(d=t(this,function(a){this.init([],function(){return a},null,{enabled:!0})}),d.error=t(this,function(a){this.inited=!0;this.error=a;a.requireModules=[b];B(k,function(a){0===a.map.id.indexOf(b+"_unnormalized")&&y(a.map.id)});w(a)}),d.fromText=t(this,function(f,c){var g=a.name,J=m(g),k=O;c&&(f=c);k&&(O=!1);q(J);s(l.config,b)&&(l.config[g]=l.config[b]);try{h.exec(f)}catch(j){return w(C("fromtexteval",
"fromText eval for "+b+" failed: "+j,j,[b]))}k&&(O=!0);this.depMaps.push(J);i.completeLoad(g);p([g],d)}),f.load(a.name,p,d,l))}));i.enable(d,this);this.pluginMaps[d.id]=d},enable:function(){W[this.map.id]=this;this.enabling=this.enabled=!0;v(this.depMaps,t(this,function(a,b){var c,f;if("string"===typeof a){a=m(a,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap);this.depMaps[b]=a;if(c=j(N,a.id)){this.depExports[b]=c(this);return}this.depCount+=1;r(a,"defined",t(this,function(a){this.defineDep(b,
a);this.check()}));this.errback&&r(a,"error",t(this,this.errback))}c=a.id;f=k[c];!s(N,c)&&(f&&!f.enabled)&&i.enable(a,this)}));B(this.pluginMaps,t(this,function(a){var b=j(k,a.id);b&&!b.enabled&&i.enable(a,this)}));this.enabling=!1;this.check()},on:function(a,b){var c=this.events[a];c||(c=this.events[a]=[]);c.push(b)},emit:function(a,b){v(this.events[a],function(a){a(b)});"error"===a&&delete this.events[a]}};i={config:l,contextName:b,registry:k,defined:p,urlFetched:T,defQueue:A,Module:$,makeModuleMap:m,
nextTick:h.nextTick,onError:w,configure:function(a){a.baseUrl&&"/"!==a.baseUrl.charAt(a.baseUrl.length-1)&&(a.baseUrl+="/");var b=l.shim,c={paths:!0,bundles:!0,config:!0,map:!0};B(a,function(a,b){c[b]?(l[b]||(l[b]={}),V(l[b],a,!0,!0)):l[b]=a});a.bundles&&B(a.bundles,function(a,b){v(a,function(a){a!==b&&(ba[a]=b)})});a.shim&&(B(a.shim,function(a,c){H(a)&&(a={deps:a});if((a.exports||a.init)&&!a.exportsFn)a.exportsFn=i.makeShimExports(a);b[c]=a}),l.shim=b);a.packages&&v(a.packages,function(a){var b,
a="string"===typeof a?{name:a}:a;b=a.name;a.location&&(l.paths[b]=a.location);l.pkgs[b]=a.name+"/"+(a.main||"main").replace(ja,"").replace(R,"")});B(k,function(a,b){!a.inited&&!a.map.unnormalized&&(a.map=m(b))});if(a.deps||a.callback)i.require(a.deps||[],a.callback)},makeShimExports:function(a){return function(){var b;a.init&&(b=a.init.apply(ca,arguments));return b||a.exports&&ea(a.exports)}},makeRequire:function(a,e){function g(f,c,d){var j,l;e.enableBuildCallback&&(c&&G(c))&&(c.__requireJsBuild=
!0);if("string"===typeof f){if(G(c))return w(C("requireargs","Invalid require call"),d);if(a&&s(N,f))return N[f](k[a.id]);if(h.get)return h.get(i,f,a,g);j=m(f,a,!1,!0);j=j.id;return!s(p,j)?w(C("notloaded",'Module name "'+j+'" has not been loaded yet for context: '+b+(a?"":". Use require([])"))):p[j]}L();i.nextTick(function(){L();l=q(m(null,a));l.skipMap=e.skipMap;l.init(f,c,d,{enabled:!0});D()});return g}e=e||{};V(g,{isBrowser:z,toUrl:function(b){var e,d=b.lastIndexOf("."),g=b.split("/")[0];if(-1!==
d&&(!("."===g||".."===g)||1<d))e=b.substring(d,b.length),b=b.substring(0,d);return i.nameToUrl(c(b,a&&a.id,!0),e,!0)},defined:function(b){return s(p,m(b,a,!1,!0).id)},specified:function(b){b=m(b,a,!1,!0).id;return s(p,b)||s(k,b)}});a||(g.undef=function(b){x();var c=m(b,a,!0),e=j(k,b);d(b);delete p[b];delete T[c.url];delete aa[b];U(A,function(a,c){a[0]===b&&A.splice(c,1)});e&&(e.events.defined&&(aa[b]=e.events),y(b))});return g},enable:function(a){j(k,a.id)&&q(a).enable()},completeLoad:function(a){var b,
c,f=j(l.shim,a)||{},d=f.exports;for(x();A.length;){c=A.shift();if(null===c[0]){c[0]=a;if(b)break;b=!0}else c[0]===a&&(b=!0);E(c)}c=j(k,a);if(!b&&!s(p,a)&&c&&!c.inited){if(l.enforceDefine&&(!d||!ea(d)))return g(a)?void 0:w(C("nodefine","No define call for "+a,null,[a]));E([a,f.deps||[],f.exportsFn])}D()},nameToUrl:function(a,b,c){var f,d,g;(f=j(l.pkgs,a))&&(a=f);if(f=j(ba,a))return i.nameToUrl(f,b,c);if(h.jsExtRegExp.test(a))f=a+(b||"");else{f=l.paths;a=a.split("/");for(d=a.length;0<d;d-=1)if(g=a.slice(0,
d).join("/"),g=j(f,g)){H(g)&&(g=g[0]);a.splice(0,d,g);break}f=a.join("/");f+=b||(/^data\:|\?/.test(f)||c?"":".js");f=("/"===f.charAt(0)||f.match(/^[\w\+\.\-]+:/)?"":l.baseUrl)+f}return l.urlArgs?f+((-1===f.indexOf("?")?"?":"&")+l.urlArgs):f},load:function(a,b){h.load(i,a,b)},execCb:function(a,b,c,d){return b.apply(d,c)},onScriptLoad:function(a){if("load"===a.type||ka.test((a.currentTarget||a.srcElement).readyState))P=null,a=K(a),i.completeLoad(a.id)},onScriptError:function(a){var b=K(a);if(!g(b.id))return w(C("scripterror",
"Script error for: "+b.id,a,[b.id]))}};i.require=i.makeRequire();return i}var h,x,y,D,K,E,P,L,q,Q,la=/(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,ma=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,R=/\.js$/,ja=/^\.\//;x=Object.prototype;var M=x.toString,ga=x.hasOwnProperty,ia=Array.prototype.splice,z=!!("undefined"!==typeof window&&"undefined"!==typeof navigator&&window.document),fa=!z&&"undefined"!==typeof importScripts,ka=z&&"PLAYSTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/,
Z="undefined"!==typeof opera&&"[object Opera]"===opera.toString(),F={},r={},S=[],O=!1;if("undefined"===typeof define){if("undefined"!==typeof requirejs){if(G(requirejs))return;r=requirejs;requirejs=void 0}"undefined"!==typeof require&&!G(require)&&(r=require,require=void 0);h=requirejs=function(b,c,d,g){var u,m="_";!H(b)&&"string"!==typeof b&&(u=b,H(c)?(b=c,c=d,d=g):b=[]);u&&u.context&&(m=u.context);(g=j(F,m))||(g=F[m]=h.s.newContext(m));u&&g.configure(u);return g.require(b,c,d)};h.config=function(b){return h(b)};
h.nextTick="undefined"!==typeof setTimeout?function(b){setTimeout(b,4)}:function(b){b()};require||(require=h);h.version="2.1.11";h.jsExtRegExp=/^\/|:|\?|\.js$/;h.isBrowser=z;x=h.s={contexts:F,newContext:ha};h({});v(["toUrl","undef","defined","specified"],function(b){h[b]=function(){var c=F._;return c.require[b].apply(c,arguments)}});if(z&&(y=x.head=document.getElementsByTagName("head")[0],D=document.getElementsByTagName("base")[0]))y=x.head=D.parentNode;h.onError=da;h.createNode=function(b){var c=
b.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script");c.type=b.scriptType||"text/javascript";c.charset="utf-8";c.async=!0;return c};h.load=function(b,c,d){var g=b&&b.config||{};if(z)return g=h.createNode(g,c,d),g.setAttribute("data-requirecontext",b.contextName),g.setAttribute("data-requiremodule",c),g.attachEvent&&!(g.attachEvent.toString&&0>g.attachEvent.toString().indexOf("[native code"))&&!Z?(O=!0,g.attachEvent("onreadystatechange",b.onScriptLoad)):
(g.addEventListener("load",b.onScriptLoad,!1),g.addEventListener("error",b.onScriptError,!1)),g.src=d,L=g,D?y.insertBefore(g,D):y.appendChild(g),L=null,g;if(fa)try{importScripts(d),b.completeLoad(c)}catch(j){b.onError(C("importscripts","importScripts failed for "+c+" at "+d,j,[c]))}};z&&!r.skipDataMain&&U(document.getElementsByTagName("script"),function(b){y||(y=b.parentNode);if(K=b.getAttribute("data-main"))return q=K,r.baseUrl||(E=q.split("/"),q=E.pop(),Q=E.length?E.join("/")+"/":"./",r.baseUrl=
Q),q=q.replace(R,""),h.jsExtRegExp.test(q)&&(q=K),r.deps=r.deps?r.deps.concat(q):[q],!0});define=function(b,c,d){var g,h;"string"!==typeof b&&(d=c,c=b,b=null);H(c)||(d=c,c=null);!c&&G(d)&&(c=[],d.length&&(d.toString().replace(la,"").replace(ma,function(b,d){c.push(d)}),c=(1===d.length?["require"]:["require","exports","module"]).concat(c)));if(O){if(!(g=L))P&&"interactive"===P.readyState||U(document.getElementsByTagName("script"),function(b){if("interactive"===b.readyState)return P=b}),g=P;g&&(b||
(b=g.getAttribute("data-requiremodule")),h=F[g.getAttribute("data-requirecontext")])}(h?h.defQueue:S).push([b,c,d])};define.amd={jQuery:!0};h.exec=function(b){return eval(b)};h(r)}})(this);

View file

@ -1,138 +0,0 @@
/*
* classList.js: Cross-browser full element.classList implementation.
* 2011-06-15
*
* By Eli Grey, http://eligrey.com
* Public Domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/
/*global self, document, DOMException */
/*! @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js*/
if (typeof document !== "undefined" && !("classList" in document.createElement("a"))) {
(function (view) {
"use strict";
var
classListProp = "classList"
, protoProp = "prototype"
, elemCtrProto = (view.HTMLElement || view.Element)[protoProp]
, objCtr = Object
, strTrim = String[protoProp].trim || function () {
return this.replace(/^\s+|\s+$/g, "");
}
, arrIndexOf = Array[protoProp].indexOf || function (item) {
var
i = 0
, len = this.length
;
for (; i < len; i++) {
if (i in this && this[i] === item) {
return i;
}
}
return -1;
}
// Vendors: please allow content code to instantiate DOMExceptions
, DOMEx = function (type, message) {
this.name = type;
this.code = DOMException[type];
this.message = message;
}
, checkTokenAndGetIndex = function (classList, token) {
if (token === "") {
throw new DOMEx(
"SYNTAX_ERR"
, "An invalid or illegal string was specified"
);
}
if (/\s/.test(token)) {
throw new DOMEx(
"INVALID_CHARACTER_ERR"
, "String contains an invalid character"
);
}
return arrIndexOf.call(classList, token);
}
, ClassList = function (elem) {
var
trimmedClasses = strTrim.call(elem.className)
, classes = trimmedClasses ? trimmedClasses.split(/\s+/) : []
, i = 0
, len = classes.length
;
for (; i < len; i++) {
this.push(classes[i]);
}
this._updateClassName = function () {
elem.className = this.toString();
};
}
, classListProto = ClassList[protoProp] = []
, classListGetter = function () {
return new ClassList(this);
}
;
// Most DOMException implementations don't allow calling DOMException's toString()
// on non-DOMExceptions. Error's toString() is sufficient here.
DOMEx[protoProp] = Error[protoProp];
classListProto.item = function (i) {
return this[i] || null;
};
classListProto.contains = function (token) {
token += "";
return checkTokenAndGetIndex(this, token) !== -1;
};
classListProto.add = function (token) {
token += "";
if (checkTokenAndGetIndex(this, token) === -1) {
this.push(token);
this._updateClassName();
}
};
classListProto.remove = function (token) {
token += "";
var index = checkTokenAndGetIndex(this, token);
if (index !== -1) {
this.splice(index, 1);
this._updateClassName();
}
};
classListProto.toggle = function (token) {
token += "";
if (checkTokenAndGetIndex(this, token) === -1) {
this.add(token);
} else {
this.remove(token);
}
};
classListProto.toString = function () {
return this.join(" ");
};
if (objCtr.defineProperty) {
var classListPropDesc = {
get: classListGetter
, enumerable: true
, configurable: true
};
try {
objCtr.defineProperty(elemCtrProto, classListProp, classListPropDesc);
} catch (ex) { // IE 8 doesn't support enumerable:true
if (ex.number === -0x7FF5EC54) {
classListPropDesc.enumerable = false;
objCtr.defineProperty(elemCtrProto, classListProp, classListPropDesc);
}
}
} else if (objCtr[protoProp].__defineGetter__) {
elemCtrProto.__defineGetter__(classListProp, classListGetter);
}
}(self));
}

View file

@ -1,23 +0,0 @@
if (!Function.prototype.bind) {
Function.prototype.bind = function (oThis) {
if (typeof this !== "function") {
// closest thing possible to the ECMAScript 5 internal IsCallable function
throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");
}
var aArgs = Array.prototype.slice.call(arguments, 1),
fToBind = this,
fNOP = function () {},
fBound = function () {
return fToBind.apply(this instanceof fNOP && oThis
? this
: oThis,
aArgs.concat(Array.prototype.slice.call(arguments)));
};
fNOP.prototype = this.prototype;
fBound.prototype = new fNOP();
return fBound;
};
}

View file

@ -1,13 +0,0 @@
// adds requestAnimationFrame functionality
// Source: http://strd6.com/2011/05/better-window-requestanimationframe-shim/
window.requestAnimationFrame || (window.requestAnimationFrame =
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.oRequestAnimationFrame ||
window.msRequestAnimationFrame ||
function(callback, element) {
return window.setTimeout(function() {
callback(+new Date());
}, 1000 / 60);
});

View file

@ -1,227 +0,0 @@
Metamaps.Backbone = {};
Metamaps.Backbone.Map = Backbone.Model.extend({
urlRoot: '/maps',
blacklist: ['created_at', 'updated_at', 'created_at_clean', 'updated_at_clean', 'user_name', 'contributor_count', 'topic_count', 'synapse_count', 'topics', 'synapses', 'mappings', 'mappers'],
toJSON: function (options) {
return _.omit(this.attributes, this.blacklist);
},
save: function (key, val, options) {
var attrs;
// Handle both `"key", value` and `{key: value}` -style arguments.
if (key == null || typeof key === 'object') {
attrs = key;
options = val;
} else {
(attrs = {})[key] = val;
}
var newOptions = options || {};
var s = newOptions.success;
newOptions.success = function (model, response, opt) {
if (s) s(model, response, opt);
model.trigger('saved');
};
return Backbone.Model.prototype.save.call(this, attrs, newOptions);
},
initialize: function () {
this.on('changeByOther', this.updateView);
this.on('saved', this.savedEvent);
},
savedEvent: function() {
Metamaps.Realtime.sendMapChange(this);
},
authorizeToEdit: function (mapper) {
if (mapper && (this.get('permission') === "commons" || this.get('user_id') === mapper.get('id'))) return true;
else return false;
},
authorizePermissionChange: function (mapper) {
if (mapper && this.get('user_id') === mapper.get('id')) return true;
else return false;
},
getUser: function () {
return Metamaps.Mapper.get(this.get('user_id'));
},
fetchContained: function () {
var bb = Metamaps.Backbone;
var that = this;
var start = function (data) {
that.set('mappers', new bb.MapperCollection(data.mappers));
that.set('topics', new bb.TopicCollection(data.topics));
that.set('synapses', new bb.SynapseCollection(data.synapses));
that.set('mappings', new bb.MappingCollection(data.mappings));
};
var e = $.ajax({
url: "/maps/" + this.id + "/contains.json",
success: start,
error: errorFunc,
async: false
});
},
getTopics: function () {
if (!this.get('topics')) {
this.fetchContained();
}
return this.get('topics');
},
getSynapses: function () {
if (!this.get('synapses')) {
this.fetchContained();
}
return this.get('synapses');
},
getMappings: function () {
if (!this.get('mappings')) {
this.fetchContained();
}
return this.get('mappings');
},
getMappers: function () {
if (!this.get('mappers')) {
this.fetchContained();
}
return this.get('mappers');
},
attrForCards: function () {
function capitalize(string) {
return string.charAt(0).toUpperCase() + string.slice(1);
}
var n = this.get('name');
var d = this.get('desc');
var maxNameLength = 32;
var maxDescLength = 118;
var truncatedName = n ? (n.length > maxNameLength ? n.substring(0, maxNameLength) + "..." : n) : "";
var truncatedDesc = d ? (d.length > maxDescLength ? d.substring(0, maxDescLength) + "..." : d) : "";
var obj = {
id: this.id,
name: truncatedName,
fullName: n,
desc: truncatedDesc,
permission: this.get("permission") ? capitalize(this.get("permission")) : "Commons",
editPermission: this.authorizeToEdit(Metamaps.Active.Mapper) ? 'canEdit' : 'cannotEdit',
contributor_count_number: '<span class="cCountColor">' + this.get('contributor_count') + '</span>',
contributor_count_string: this.get('contributor_count') == 1 ? ' contributor' : ' contributors',
topic_count_number: '<span class="tCountColor">' + this.get('topic_count') + '</span>',
topic_count_string: this.get('topic_count') == 1 ? ' topic' : ' topics',
synapse_count_number: '<span class="sCountColor">' + this.get('synapse_count') + '</span>',
synapse_count_string: this.get('synapse_count') == 1 ? ' synapse' : ' synapses',
screenshot: '<img src="' + this.get('screenshot_url') + '" />'
};
return obj;
},
updateView: function() {
var map = Metamaps.Active.Map;
var isActiveMap = this.id === map.id;
var authorized = map && map.authorizeToEdit(Metamaps.Active.Mapper) ? 'canEditMap' : '';
var commonsMap = map && map.get('permission') === 'commons' ? 'commonsMap' : '';
if (isActiveMap) {
Metamaps.Map.InfoBox.updateNameDescPerm(this.get('name'), this.get('desc'), this.get('permission'));
this.updateMapWrapper();
}
},
updateMapWrapper: function() {
var map = Metamaps.Active.Map;
var isActiveMap = this.id === map.id;
var authorized = map && map.authorizeToEdit(Metamaps.Active.Mapper) ? 'canEditMap' : '';
var commonsMap = map && map.get('permission') === 'commons' ? 'commonsMap' : '';
if (isActiveMap) {
$('.wrapper').removeClass('canEditMap commonsMap').addClass(authorized + ' ' + commonsMap);
}
}
});
Metamaps.Backbone.MapsCollection = Backbone.Collection.extend({
model: Metamaps.Backbone.Map,
initialize: function(models, options) {
this.id = options.id;
this.sortBy = options.sortBy;
if (options.mapperId) {
this.mapperId = options.mapperId;
}
// this.page represents the NEXT page to fetch
this.page = models.length > 0 ? (models.length < 20 ? "loadedAll" : 2) : 1;
},
url: function() {
if (!this.mapperId) {
return '/explore/' + this.id + '.json';
}
else {
return '/explore/mapper/' + this.mapperId + '.json';
}
},
comparator: function (a, b) {
a = a.get(this.sortBy);
b = b.get(this.sortBy);
var temp;
if (this.sortBy === 'name') {
a = a ? a.toLowerCase() : "";
b = b ? b.toLowerCase() : "";
}
else {
// this is for updated_at and created_at
temp = a;
a = b;
b = temp;
a = (new Date(a)).getTime();
b = (new Date(b)).getTime();
}
return a > b ? 1 : a < b ? -1 : 0;
},
getMaps: function (cb) {
var self = this;
Metamaps.Loading.show();
if (this.page != "loadedAll") {
var numBefore = this.length;
this.fetch({
remove: false,
silent: true,
data: { page: this.page },
success: function (collection, response, options) {
// you can pass additional options to the event you trigger here as well
if (collection.length - numBefore < 20) {
self.page = "loadedAll";
}
else self.page += 1;
self.trigger('successOnFetch', cb);
},
error: function (collection, response, options) {
// you can pass additional options to the event you trigger here as well
self.trigger('errorOnFetch');
}
});
}
else {
self.trigger('successOnFetch', cb);
}
}
});
Metamaps.Backbone.Mapper = Backbone.Model.extend({
urlRoot: '/users',
blacklist: ['created_at', 'updated_at'],
toJSON: function (options) {
return _.omit(this.attributes, this.blacklist);
},
prepareLiForFilter: function () {
var li = '';
li += '<li data-id="' + this.id.toString() + '">';
li += '<img src="' + this.get("image") + '" data-id="' + this.id.toString() + '"';
li += ' alt="' + this.get('name') + '" />';
li += '<p>' + this.get('name') + '</p></li>';
return li;
}
});
Metamaps.Backbone.MapperCollection = Backbone.Collection.extend({
model: Metamaps.Backbone.Mapper,
url: '/users'
});

View file

@ -1,661 +0,0 @@
var Metamaps = {}; // this variable declaration defines a Javascript object that will contain all the variables and functions used by us, broken down into 'sub-modules' that look something like this
/*
* unless you are on a page with the Javascript InfoVis Toolkit (Topic or Map) the only section in the metamaps
* object will be these
GlobalUI
Active
Maps
Mappers
Backbone
* all these get added when you are on a page with the Javascript Infovis Toolkit
Settings
Touch
Mouse
Selected
Metacodes
Topics
Synapses
Mappings
Create
TopicCard
SynapseCard
Visualize
Util
Realtime
Control
Filter
Listeners
Organize
Map
Mapper
Topic
Synapse
JIT
*/
Metamaps.Active = {
Map: null,
Topic: null,
Mapper: null
};
Metamaps.Maps = {};
$(document).ready(function () {
for (var prop in Metamaps) {
// this runs the init function within each sub-object on the Metamaps one
if (Metamaps.hasOwnProperty(prop) &&
Metamaps[prop].hasOwnProperty('init') &&
typeof (Metamaps[prop].init) == 'function'
) {
Metamaps[prop].init();
}
}
// initialize the famous ui
var callFamous = function(){
if (Metamaps.Famous) {
Metamaps.Famous.build();
}
else {
setTimeout(callFamous, 100);
}
}
callFamous();
});
Metamaps.GlobalUI = {
notifyTimeout: null,
lightbox: null,
init: function () {
var self = Metamaps.GlobalUI;
self.Search.init();
self.CreateMap.init();
self.Account.init();
//bind lightbox clicks
$('.openLightbox').click(function (event) {
self.openLightbox($(this).attr('data-open'));
event.preventDefault();
return false;
});
$('#lightbox_screen, #lightbox_close').click(self.closeLightbox);
// initialize global backbone models and collections
if (Metamaps.Active.Mapper) Metamaps.Active.Mapper = new Metamaps.Backbone.Mapper(Metamaps.Active.Mapper);
var myCollection = Metamaps.Maps.Mine ? Metamaps.Maps.Mine : [];
var mapperCollection = [];
var mapperOptionsObj = {id: 'mapper', sortBy: 'updated_at' };
if (Metamaps.Maps.Mapper) {
mapperCollection = Metamaps.Maps.Mapper.models;
mapperOptionsObj.mapperId = Metamaps.Maps.Mapper.id;
}
var featuredCollection = Metamaps.Maps.Featured ? Metamaps.Maps.Featured : [];
var activeCollection = Metamaps.Maps.Active ? Metamaps.Maps.Active : [];
Metamaps.Maps.Mine = new Metamaps.Backbone.MapsCollection(myCollection, {id: 'mine', sortBy: 'updated_at' });
// 'Mapper' refers to another mapper
Metamaps.Maps.Mapper = new Metamaps.Backbone.MapsCollection(mapperCollection, mapperOptionsObj);
Metamaps.Maps.Featured = new Metamaps.Backbone.MapsCollection(featuredCollection, {id: 'featured', sortBy: 'updated_at' });
Metamaps.Maps.Active = new Metamaps.Backbone.MapsCollection(activeCollection, {id: 'active', sortBy: 'updated_at' });
},
openLightbox: function (which) {
var self = Metamaps.GlobalUI;
$('.lightboxContent').hide();
$('#' + which).show();
self.lightbox = which;
$('#lightbox_overlay').show();
var heightOfContent = '-' + ($('#lightbox_main').height() / 2) + 'px';
// animate the content in from the bottom
$('#lightbox_main').animate({
'top': '50%',
'margin-top': heightOfContent
}, 200, 'easeOutCubic');
// fade the black overlay in
$('#lightbox_screen').animate({
'opacity': '0.42'
}, 200);
if (which == "switchMetacodes") {
Metamaps.Create.isSwitchingSet = true;
}
},
closeLightbox: function (event) {
var self = Metamaps.GlobalUI;
if (event) event.preventDefault();
// animate the lightbox content offscreen
$('#lightbox_main').animate({
'top': '100%',
'margin-top': '0'
}, 200, 'easeInCubic');
// fade the black overlay out
$('#lightbox_screen').animate({
'opacity': '0.0'
}, 200, function () {
$('#lightbox_overlay').hide();
});
if (self.lightbox === 'forkmap') Metamaps.GlobalUI.CreateMap.reset('fork_map');
if (self.lightbox === 'newmap') Metamaps.GlobalUI.CreateMap.reset('new_map');
if (Metamaps.Create && Metamaps.Create.isSwitchingSet) {
Metamaps.Create.cancelMetacodeSetSwitch();
}
self.lightbox = null;
},
notifyUser: function (message, leaveOpen) {
var self = Metamaps.GlobalUI;
Metamaps.Famous.toast.surf.setContent(message);
Metamaps.Famous.toast.show();
clearTimeout(self.notifyTimeOut);
if (!leaveOpen) {
self.notifyTimeOut = setTimeout(function () {
Metamaps.Famous.toast.hide();
}, 8000);
}
},
clearNotify: function() {
var self = Metamaps.GlobalUI;
clearTimeout(self.notifyTimeOut);
Metamaps.Famous.toast.hide();
},
shareInvite: function(inviteLink) {
window.prompt("To copy the invite link, press: Ctrl+C, Enter", inviteLink);
}
};
Metamaps.GlobalUI.CreateMap = {
newMap: null,
emptyMapForm: "",
emptyForkMapForm: "",
topicsToMap: [],
synapsesToMap: [],
init: function () {
var self = Metamaps.GlobalUI.CreateMap;
self.newMap = new Metamaps.Backbone.Map({ permission: 'commons' });
self.bindFormEvents();
self.emptyMapForm = $('#new_map').html();
},
bindFormEvents: function () {
var self = Metamaps.GlobalUI.CreateMap;
$('.new_map button.cancel').unbind().bind('click', function (event) {
event.preventDefault();
Metamaps.GlobalUI.closeLightbox();
});
$('.new_map button.submitMap').unbind().bind('click', self.submit);
// bind permission changer events on the createMap form
$('.permIcon').unbind().bind('click', self.switchPermission);
},
closeSuccess: function () {
$('#mapCreatedSuccess').fadeOut(300, function(){
$(this).remove();
});
},
generateSuccessMessage: function (id) {
var stringStart = "<div id='mapCreatedSuccess'><h6>SUCCESS!</h6>Your map has been created. Do you want to: <a id='mapGo' href='/maps/";
stringStart += id;
stringStart += "' onclick='Metamaps.GlobalUI.CreateMap.closeSuccess();'>Go to your new map</a>";
stringStart += "<span>OR</span><a id='mapStay' href='#' onclick='Metamaps.GlobalUI.CreateMap.closeSuccess(); return false;'>Stay on this ";
var page = Metamaps.Active.Map ? 'map' : 'page';
var stringEnd = "</a></div>";
return stringStart + page + stringEnd;
},
switchPermission: function () {
var self = Metamaps.GlobalUI.CreateMap;
self.newMap.set('permission', $(this).attr('data-permission'));
$(this).siblings('.permIcon').find('.mapPermIcon').removeClass('selected');
$(this).find('.mapPermIcon').addClass('selected');
var permText = $(this).find('.tip').html();
$(this).parents('.new_map').find('.permText').html(permText);
},
submit: function (event) {
if (event) event.preventDefault();
var self = Metamaps.GlobalUI.CreateMap;
if (Metamaps.GlobalUI.lightbox === 'forkmap') {
self.newMap.set('topicsToMap', self.topicsToMap);
self.newMap.set('synapsesToMap', self.synapsesToMap);
}
var formId = Metamaps.GlobalUI.lightbox === 'forkmap' ? '#fork_map' : '#new_map';
var $form = $(formId);
self.newMap.set('name', $form.find('#map_name').val());
self.newMap.set('desc', $form.find('#map_desc').val());
if (self.newMap.get('name').length===0){
self.throwMapNameError();
return;
}
self.newMap.save(null, {
success: self.success
// TODO add error message
});
Metamaps.GlobalUI.closeLightbox();
Metamaps.GlobalUI.notifyUser('Working...');
},
throwMapNameError: function () {
var self = Metamaps.GlobalUI.CreateMap;
var formId = Metamaps.GlobalUI.lightbox === 'forkmap' ? '#fork_map' : '#new_map';
var $form = $(formId);
var message = $("<div class='feedback_message'>Please enter a map name...</div>");
$form.find('#map_name').after(message);
setTimeout(function(){
message.fadeOut('fast', function(){
message.remove();
});
}, 5000);
},
success: function (model) {
var self = Metamaps.GlobalUI.CreateMap;
//push the new map onto the collection of 'my maps'
Metamaps.Maps.Mine.add(model);
var formId = Metamaps.GlobalUI.lightbox === 'forkmap' ? '#fork_map' : '#new_map';
var form = $(formId);
Metamaps.GlobalUI.clearNotify();
$('#wrapper').append(self.generateSuccessMessage(model.id));
},
reset: function (id) {
var self = Metamaps.GlobalUI.CreateMap;
var form = $('#' + id);
if (id === "fork_map") {
self.topicsToMap = [];
self.synapsesToMap = [];
form.html(self.emptyForkMapForm);
}
else {
form.html(self.emptyMapForm);
}
self.bindFormEvents();
self.newMap = new Metamaps.Backbone.Map({ permission: 'commons' });
return false;
},
};
Metamaps.GlobalUI.Account = {
isOpen: false,
changing: false,
init: function () {
var self = Metamaps.GlobalUI.Account;
$('.sidebarAccountIcon').click(self.toggleBox);
$('.sidebarAccountBox').click(function(event){
event.stopPropagation();
});
$('body').click(self.close);
},
toggleBox: function (event) {
var self = Metamaps.GlobalUI.Account;
if (self.isOpen) self.close();
else self.open();
event.stopPropagation();
},
open: function () {
var self = Metamaps.GlobalUI.Account;
Metamaps.Realtime.close();
Metamaps.Filter.close();
$('.sidebarAccountIcon .tooltipsUnder').addClass('hide');
if (!self.isOpen && !self.changing) {
self.changing = true;
$('.sidebarAccountBox').fadeIn(200, function () {
self.changing = false;
self.isOpen = true;
$('.sidebarAccountBox #user_email').focus();
});
}
},
close: function () {
var self = Metamaps.GlobalUI.Account;
$('.sidebarAccountIcon .tooltipsUnder').removeClass('hide');
if (!self.changing) {
self.changing = true;
$('.sidebarAccountBox #user_email').blur();
$('.sidebarAccountBox').fadeOut(200, function () {
self.changing = false;
self.isOpen = false;
});
}
}
};
Metamaps.GlobalUI.Search = {
locked: false,
isOpen: false,
timeOut: null,
changing: false,
optionsInitialized: false,
init: function () {
var self = Metamaps.GlobalUI.Search;
var loader = new CanvasLoader('searchLoading');
loader.setColor('#4fb5c0'); // default is '#000000'
loader.setDiameter(24); // default is 40
loader.setDensity(41); // default is 40
loader.setRange(0.9); // default is 1.3
loader.show(); // Hidden by default
// bind the hover events
$(".sidebarSearch").hover(function () {
self.open()
}, function () {
self.close(800, false)
});
$('.sidebarSearchIcon').click(function (e) {
$('.sidebarSearchField').focus();
});
$('.sidebarSearch').click(function (e) {
e.stopPropagation();
});
$('body').click(function (e) {
self.close(0, false);
});
// open if the search is closed and user hits ctrl+/
// close if they hit ESC
$('body').bind('keyup', function (e) {
switch (e.which) {
case 191:
if ((e.ctrlKey && !self.isOpen) || (e.ctrlKey && self.locked)) {
self.open(true); // true for focus
}
break;
case 27:
if (self.isOpen) {
self.close(0, true);
}
break;
default:
break; //console.log(e.which);
}
});
self.startTypeahead();
},
lock: function() {
var self = Metamaps.GlobalUI.Search;
self.locked = true;
},
unlock: function() {
var self = Metamaps.GlobalUI.Search;
self.locked = false;
},
open: function (focus) {
var self = Metamaps.GlobalUI.Search;
clearTimeout(self.timeOut);
if (!self.isOpen && !self.changing && !self.locked) {
self.changing = true;
$('.sidebarSearch .twitter-typeahead, .sidebarSearch .tt-hint, .sidebarSearchField').animate({
width: '400px'
}, 300, function () {
if (focus) $('.sidebarSearchField').focus();
$('.sidebarSearchField, .sidebarSearch .tt-hint').css({
padding: '7px 10px 3px 10px',
width: '380px'
});
self.changing = false;
self.isOpen = true;
});
}
},
close: function (closeAfter, bypass) {
var self = Metamaps.GlobalUI.Search;
self.timeOut = setTimeout(function () {
if (!self.locked && !self.changing && self.isOpen && (bypass || $('.sidebarSearchField').val() == '')) {
self.changing = true;
$('.sidebarSearchField, .sidebarSearch .tt-hint').css({
padding: '7px 0 3px 0',
width: '400px'
});
$('.sidebarSearch .twitter-typeahead, .sidebarSearch .tt-hint, .sidebarSearchField').animate({
width: '0'
}, 300, function () {
$('.sidebarSearchField').typeahead('setQuery', '');
$('.sidebarSearchField').blur();
self.changing = false;
self.isOpen = false;
});
}
}, closeAfter);
},
startTypeahead: function () {
var self = Metamaps.GlobalUI.Search;
var mapheader = Metamaps.Active.Mapper ? '<div class="searchMapsHeader searchHeader"><h3 class="search-heading">Maps</h3><input type="checkbox" class="limitToMe" id="limitMapsToMe"></input><label for="limitMapsToMe" class="limitToMeLabel">added by me</label><div class="minimizeResults minimizeMapResults"></div><div class="clearfloat"></div></div>' : '<div class="searchMapsHeader searchHeader"><h3 class="search-heading">Maps</h3><div class="minimizeResults minimizeMapResults"></div><div class="clearfloat"></div></div>';
var topicheader = Metamaps.Active.Mapper ? '<div class="searchTopicsHeader searchHeader"><h3 class="search-heading">Topics</h3><input type="checkbox" class="limitToMe" id="limitTopicsToMe"></input><label for="limitTopicsToMe" class="limitToMeLabel">added by me</label><div class="minimizeResults minimizeTopicResults"></div><div class="clearfloat"></div></div>' : '<div class="searchTopicsHeader searchHeader"><h3 class="search-heading">Topics</h3><div class="minimizeResults minimizeTopicResults"></div><div class="clearfloat"></div></div>';
var mapperheader = '<div class="searchMappersHeader searchHeader"><h3 class="search-heading">Mappers</h3><div class="minimizeResults minimizeMapperResults"></div><div class="clearfloat"></div></div>';
var topics = {
name: 'topics',
limit: 9999,
dupChecker: function (datum1, datum2) {
return false;
},
template: $('#topicSearchTemplate').html(),
remote: {
url: '/search/topics?term=%QUERY',
replace: function () {
var q = '/search/topics?term=' + $('.sidebarSearchField').val();
if (Metamaps.Active.Mapper && $("#limitTopicsToMe").is(':checked')) {
q += "&user=" + Metamaps.Active.Mapper.id.toString();
}
return q;
},
filter: function (dataset) {
if (dataset.length == 0) {
dataset.push({
value: "No results",
label: "No results",
typeImageURL: "/assets/icons/wildcard.png",
rtype: "noresult"
});
}
return dataset;
}
},
engine: Hogan,
header: topicheader
};
var maps = {
name: 'maps',
limit: 9999,
dupChecker: function (datum1, datum2) {
return false;
},
template: $('#mapSearchTemplate').html(),
remote: {
url: '/search/maps?term=%QUERY',
replace: function () {
var q = '/search/maps?term=' + $('.sidebarSearchField').val();
if (Metamaps.Active.Mapper && $("#limitMapsToMe").is(':checked')) {
q += "&user=" + Metamaps.Active.Mapper.id.toString();
}
return q;
},
filter: function (dataset) {
if (dataset.length == 0) {
dataset.push({
value: "No results",
label: "No results",
rtype: "noresult"
});
}
return dataset;
}
},
engine: Hogan,
header: mapheader
};
var mappers = {
name: 'mappers',
limit: 9999,
dupChecker: function (datum1, datum2) {
return false;
},
template: $('#mapperSearchTemplate').html(),
remote: {
url: '/search/mappers?term=%QUERY',
filter: function (dataset) {
if (dataset.length == 0) {
dataset.push({
profile: "/assets/user.png",
value: "No results",
label: "No results",
rtype: "noresult"
});
}
return dataset;
}
},
engine: Hogan,
header: mapperheader
};
$('.sidebarSearchField').typeahead([topics, maps, mappers]);
//Set max height of the search results box to prevent it from covering bottom left footer
$('.sidebarSearchField').bind('typeahead:suggestionsRendered', function (event) {
self.initSearchOptions();
self.hideLoader();
var h = $(window).height();
$(".tt-dropdown-menu").css('max-height', h - 100);
});
$(window).resize(function () {
var h = $(window).height();
$(".tt-dropdown-menu").css('max-height', h - 100);
});
// tell the autocomplete to launch a new tab with the topic, map, or mapper you clicked on
$('.sidebarSearchField').bind('typeahead:selected', self.handleResultClick);
// don't do it, if they clicked on a 'addToMap' button
$('.sidebarSearch button.addToMap').click(function (event) {
event.stopPropagation();
});
// make sure that when you click on 'limit to me' or 'toggle section' it works
$('.sidebarSearchField').bind('typeahead:queryChanged', function(){
if ($(this).val() === "") {
self.hideLoader();
}
else {
self.showLoader();
}
});
},
handleResultClick: function (event, datum, dataset) {
var self = Metamaps.GlobalUI.Search;
self.hideLoader();
if (datum.rtype != "noresult") {
self.close(0, true);
var win;
if (dataset == "topics") {
Metamaps.Router.topics(datum.id);
} else if (dataset == "maps") {
Metamaps.Router.maps(datum.id);
} else if (dataset == "mappers") {
Metamaps.Router.explore("mapper", datum.id);
}
}
},
initSearchOptions: function () {
var self = Metamaps.GlobalUI.Search;
function toggleResultSet(set) {
var s = $('.tt-dataset-' + set + ' .tt-suggestions');
if (s.css('height') == '0px') {
s.css({
'height': 'auto',
'overflow': 'visible'
});
$(this).removeClass('maximizeResults').addClass('minimizeResults');
} else {
s.css({
'height': '0',
'overflow': 'hidden'
});
$(this).removeClass('minimizeResults').addClass('maximizeResults');
}
}
$('.limitToMe').unbind().bind("change", function (e) {
// set the value of the search equal to itself to retrigger the autocomplete event
self.isOpen = false;
$('.sidebarSearchField').typeahead('setQuery', $('.sidebarSearchField').val());
setTimeout(function () {
self.isOpen = true;
}, 2000);
});
// when the user clicks minimize section, hide the results for that section
$('.minimizeMapperResults').unbind().click(function (e) {
toggleResultSet.call(this, 'mappers');
});
$('.minimizeTopicResults').unbind().click(function (e) {
toggleResultSet.call(this, 'topics');
});
$('.minimizeMapResults').unbind().click(function (e) {
toggleResultSet.call(this, 'maps');
});
},
hideLoader: function () {
$('#searchLoading').hide();
},
showLoader: function () {
$('#searchLoading').show();
}
};

File diff suppressed because it is too large Load diff

View file

@ -1,262 +0,0 @@
(function () {
Metamaps.currentPage = "";
var Router = Backbone.Router.extend({
routes: {
"": "home", // #home
"explore/:section": "explore", // #explore/active
"explore/:section/:id": "explore", // #explore/mapper/1234
"maps/:id": "maps" // #maps/7
},
home: function () {
clearTimeout(Metamaps.routerTimeoutId);
if (Metamaps.Active.Mapper) document.title = 'Explore Active Maps | Metamaps';
else document.title = 'Home | Metamaps';
Metamaps.currentSection = "";
Metamaps.currentPage = "";
$('.wrapper').removeClass('mapPage topicPage');
var classes = Metamaps.Active.Mapper ? "homePage explorePage" : "homePage";
$('.wrapper').addClass(classes);
var navigate = function() {
Metamaps.routerTimeoutId = setTimeout(function() {
Metamaps.Router.navigate("");
}, 300);
};
// all this only for the logged in home page
if (Metamaps.Active.Mapper) {
Metamaps.Famous.yield.hide();
Metamaps.Famous.explore.set('active');
Metamaps.Famous.maps.resetScroll(); // sets the scroll back to the top
Metamaps.Famous.explore.show();
Metamaps.Famous.maps.show();
Metamaps.GlobalUI.Search.open();
Metamaps.GlobalUI.Search.lock();
Metamaps.Views.exploreMaps.setCollection( Metamaps.Maps.Active );
if (Metamaps.Maps.Active.length === 0) {
Metamaps.Maps.Active.getMaps(navigate); // this will trigger an explore maps render
}
else {
Metamaps.Views.exploreMaps.render(navigate);
}
}
// logged out home page
else {
Metamaps.Famous.yield.show();
Metamaps.Famous.explore.hide();
Metamaps.GlobalUI.Search.unlock();
Metamaps.GlobalUI.Search.close(0, true);
Metamaps.Famous.maps.hide();
Metamaps.routerTimeoutId = setTimeout(navigate, 500);
}
Metamaps.Famous.viz.hide();
Metamaps.Map.end();
Metamaps.Topic.end();
Metamaps.Active.Map = null;
Metamaps.Active.Topic = null;
},
explore: function (section, id) {
clearTimeout(Metamaps.routerTimeoutId);
// just capitalize the variable section
// either 'featured', 'mapper', or 'active'
var capitalize = section.charAt(0).toUpperCase() + section.slice(1);
if (section === "featured" || section === "active") {
document.title = 'Explore ' + capitalize + ' Maps | Metamaps';
}
else if (section === "mapper") {
$.ajax({
url: "/users/" + id + ".json",
success: function (response) {
document.title = response.name + ' | Metamaps';
},
error: function () {
}
});
}
else if (section === "mine") {
document.title = 'Explore My Maps | Metamaps';
}
$('.wrapper').removeClass('homePage mapPage topicPage');
$('.wrapper').addClass('explorePage');
Metamaps.currentSection = "explore";
Metamaps.currentPage = section;
// this will mean it's a mapper page being loaded
if (id) {
if (Metamaps.Maps.Mapper.mapperId !== id) {
// empty the collection if we are trying to load the maps
// collection of a different mapper than we had previously
Metamaps.Maps.Mapper.reset();
Metamaps.Maps.Mapper.page = 1;
}
Metamaps.Maps.Mapper.mapperId = id;
}
Metamaps.Views.exploreMaps.setCollection( Metamaps.Maps[capitalize] );
var navigate = function(){
var path = "/explore/" + Metamaps.currentPage;
// alter url if for mapper profile page
if (Metamaps.currentPage == "mapper") {
path += "/" + Metamaps.Maps.Mapper.mapperId;
}
Metamaps.Router.navigate(path);
};
var navigateTimeout = function() {
Metamaps.routerTimeoutId = setTimeout(navigate, 300);
};
if (Metamaps.Maps[capitalize].length === 0) {
Metamaps.Loading.show();
setTimeout(function(){
Metamaps.Maps[capitalize].getMaps(navigate); // this will trigger an explore maps render
}, 300); // wait 300 milliseconds till the other animations are done to do the fetch
}
else {
if (id) {
Metamaps.Views.exploreMaps.fetchUserThenRender(navigateTimeout);
}
else {
Metamaps.Views.exploreMaps.render(navigateTimeout);
}
}
Metamaps.GlobalUI.Search.open();
Metamaps.GlobalUI.Search.lock();
Metamaps.Famous.yield.hide();
Metamaps.Famous.maps.resetScroll(); // sets the scroll back to the top
Metamaps.Famous.maps.show();
Metamaps.Famous.explore.set(section, id);
Metamaps.Famous.explore.show();
Metamaps.Famous.viz.hide();
Metamaps.Map.end();
Metamaps.Topic.end();
Metamaps.Active.Map = null;
Metamaps.Active.Topic = null;
},
maps: function (id) {
clearTimeout(Metamaps.routerTimeoutId);
document.title = 'Map ' + id + ' | Metamaps';
Metamaps.currentSection = "map";
Metamaps.currentPage = id;
$('.wrapper').removeClass('homePage explorePage topicPage');
$('.wrapper').addClass('mapPage');
// another class will be added to wrapper if you
// can edit this map '.canEditMap'
Metamaps.Famous.yield.hide();
Metamaps.Famous.maps.hide();
Metamaps.Famous.explore.hide();
// clear the visualization, if there was one, before showing its div again
if (Metamaps.Visualize.mGraph) {
Metamaps.Visualize.mGraph.graph.empty();
Metamaps.Visualize.mGraph.plot();
Metamaps.JIT.centerMap(Metamaps.Visualize.mGraph.canvas);
}
Metamaps.Famous.viz.show();
Metamaps.Topic.end();
Metamaps.Active.Topic = null;
Metamaps.GlobalUI.Search.unlock();
Metamaps.GlobalUI.Search.close(0, true);
Metamaps.Loading.show();
Metamaps.Map.end();
Metamaps.Map.launch(id);
},
topics: function (id) {
clearTimeout(Metamaps.routerTimeoutId);
document.title = 'Topic ' + id + ' | Metamaps';
Metamaps.currentSection = "topic";
Metamaps.currentPage = id;
$('.wrapper').removeClass('homePage explorePage mapPage');
$('.wrapper').addClass('topicPage');
Metamaps.Famous.yield.hide();
Metamaps.Famous.maps.hide();
Metamaps.Famous.explore.hide();
// clear the visualization, if there was one, before showing its div again
if (Metamaps.Visualize.mGraph) {
Metamaps.Visualize.mGraph.graph.empty();
Metamaps.Visualize.mGraph.plot();
Metamaps.JIT.centerMap(Metamaps.Visualize.mGraph.canvas);
}
Metamaps.Famous.viz.show();
Metamaps.Map.end();
Metamaps.Active.Map = null;
Metamaps.GlobalUI.Search.unlock();
Metamaps.GlobalUI.Search.close(0, true);
Metamaps.Topic.end();
Metamaps.Topic.launch(id);
}
});
Metamaps.Router = new Router();
Metamaps.Router.intercept = function (evt) {
var segments;
var href = {
prop: $(this).prop("href"),
attr: $(this).attr("href")
};
var root = location.protocol + "//" + location.host + Backbone.history.options.root;
if (href.prop && href.prop === root) href.attr = "";
if (href.prop && href.prop.slice(0, root.length) === root) {
evt.preventDefault();
segments = href.attr.split('/');
segments.splice(0,1); // pop off the element created by the first /
if (href.attr === "") Metamaps.Router.home();
else {
Metamaps.Router[segments[0]](segments[1], segments[2]);
}
}
};
Metamaps.Router.init = function () {
Backbone.history.start({
silent: true,
pushState: true,
root: '/'
});
$(document).on("click", "a:not([data-bypass])", Metamaps.Router.intercept);
};
})();

View file

@ -1,133 +0,0 @@
(function () {
Metamaps.Views = {};
var initialized = false;
Metamaps.Views.init = function () {
Metamaps.Views.MapperCard = Backbone.View.extend({
template: Hogan.compile( $('#mapperCardTemplate').html() ),
tagNamea: "div",
className: "mapper",
render: function () {
this.$el.html( this.template.render(this.model) );
return this;
}
});
Metamaps.Views.MapCard = Backbone.View.extend({
template: Hogan.compile( $('#mapCardTemplate').html() ),
tagName: "div",
className: "map",
id: function() {
return this.model.id;
},
initialize: function () {
this.listenTo(this.model, "change", this.render);
},
render: function () {
this.$el.html( this.template.render(this.model.attrForCards()) );
return this;
}
});
var mapsWrapper = Backbone.View.extend({
initialize: function (opts) {
},
setCollection: function (collection) {
if (this.collection) this.stopListening(this.collection);
this.collection = collection;
this.listenTo(this.collection, 'add', this.render);
this.listenTo(this.collection, 'successOnFetch', this.handleSuccess);
this.listenTo(this.collection, 'errorOnFetch', this.handleError);
},
render: function (mapperObj, cb) {
var that = this;
if (typeof mapperObj === "function") {
var cb = mapperObj;
mapperObj = null;
}
this.el.innerHTML = "";
// in case it is a page where we have to display the mapper card
if (mapperObj) {
var view = new Metamaps.Views.MapperCard({ model: mapperObj });
that.el.appendChild( view.render().el );
}
this.collection.each(function (map) {
var view = new Metamaps.Views.MapCard({ model: map });
that.el.appendChild( view.render().el );
});
this.$el.append('<div class="clearfloat"></div>');
var m = Metamaps.Famous.maps.surf;
m.setContent(this.el);
var updateHeight = function(){
var height = $(that.el).height() + 32 + 56;
m.setSize([undefined, height]);
Metamaps.Famous.maps.lock = false;
if (cb) cb();
};
if (!initialized) {
m.deploy(m._currTarget);
initialized = true;
setTimeout(updateHeight, 100);
} else {
setTimeout(updateHeight, 100);
}
Metamaps.Loading.hide();
},
handleSuccess: function (cb) {
var that = this;
if (this.collection && this.collection.id === "mapper") {
this.fetchUserThenRender(cb);
}
else {
this.render(cb);
}
},
handleError: function () {
console.log('error loading maps!'); //TODO
},
fetchUserThenRender: function (cb) {
var that = this;
// first load the mapper object and then call the render function
$.ajax({
url: "/users/" + this.collection.mapperId + "/details.json",
success: function (response) {
that.render(response, cb);
},
error: function () {
that.render(cb);
}
});
}
});
Metamaps.Views.exploreMaps = new mapsWrapper();
};
})();

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,12 @@
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the top of the
* compiled file, but it's generally better to create a new file per style scope.
*
*= require ./special
*/

View file

@ -0,0 +1,109 @@
#metacodeSelector {
display: none;
}
.metacodeSelect {
border-top: 1px solid #DDD;
padding: 0;
background: #FFF;
.metacodeFilterInput {
width: 100px;
outline: none;
border: 0;
padding: 8px;
font-size: 14px;
line-height: 14px;
color: #424242;
font-family: 'din-medium', helvetica, sans-serif;
}
.metacodeList {
list-style: none;
background: #FFF;
li {
padding: 8px;
cursor: pointer;
&:hover, &.keySelect {
background: #4CAF50;
}
}
img {
width: 24px;
height: 24px;
display: inline-block;
vertical-align: middle;
padding-right: 6px;
}
}
}
.selectedMetacode {
float: left;
background: #FFF;
border-top-left-radius: 2px;
border-bottom-left-radius: 2px;
padding: 5px 10px 5px 6px;
vertical-align: top;
border-right: 1px solid #DDD;
cursor: pointer;
}
.selectedMetacode:hover, .selectedMetacode.isBeingSelected {
background: #EDEDED;
}
.selectedMetacode img {
width: 24px;
height: 24px;
display: inline-block;
vertical-align: middle;
}
.selectedMetacode span {
vertical-align: middle;
}
.selectedMetacode .downArrow {
display: inline-block;
vertical-align: middle;
width: 0;
height: 0;
border-style: solid;
border-width: 8px 6px 0 6px;
border-color: #777 transparent transparent transparent;
margin-left: 2px;
margin-top: 4px;
}
.new_topic {
margin: 0;
margin-top: -17px;
white-space: nowrap;
}
#new_topic .twitter-typeahead {
position: relative !important;
top: 0;
left: 0;
}
.new_topic #topic_name,
.new_topic .tt-hint {
border-radius: none;
border-top-right-radius: 2px;
border-bottom-right-radius: 2px;
}
.openMetacodeSwitcher {
top: -16px;
left: -16px;
}
#metacodeImg {
height: 120px;
width: 380px;
display: none;
position: absolute !important;
top: -30px;
z-index: -1;
}
#metacodeImgTitle {
display: none;
float: left;
width: 120px;
text-align: center;
margin-left: 110px;
}

View file

@ -1,63 +0,0 @@
.allMetacodes {
float:left;
}
.allMetacodes span {
margin:4px 8px;
color:#67AF9F;
}
.editMetacodes {
z-index:12;
width:auto;
color: #67AF9F;
padding:10px;
float:left;
}
.editMetacodes ul {
display:block;
}
.editMetacodes ul li {
clear:both;
list-style-type:none;
display:block;
padding:3px;
}
.editMetacodes ul img {
width:40px;
height:40px;
float:left;
}
.editMetacodes ul p {
float:left;
display: block;
margin: 0;
background: none;
padding: 10px 4px 2px 4px;
}
.editMetacodes #filters-one {
float:left;
}
.editMetacodes #filters-two {
float:left;
}
.editMetacodes #filters-three {
float:left;
}
.editMetacodes #filters-four {
float:left;
}
.editMetacodes li.toggledOff {
opacity: 0.4;
}

View file

@ -0,0 +1,187 @@
.allMetacodes {
float:left;
span {
margin:4px 8px;
color:#67AF9F;
}
}
.editMetacodes {
z-index:12;
width:auto;
color: #67AF9F;
padding:10px;
float:left;
ul {
display:block;
}
ul li {
clear:both;
list-style-type:none;
display:block;
padding:3px;
}
ul img {
width:40px;
height:40px;
float:left;
}
ul p {
float:left;
display: block;
margin: 0;
background: none;
padding: 10px 4px 2px 4px;
}
#filters-one {
float:left;
}
#filters-two {
float:left;
}
#filters-three {
float:left;
}
#filters-four {
float:left;
}
li.toggledOff {
opacity: 0.6;
}
}
.centerContent {
width: 760px;
margin: 0 auto;
padding: 80px 0 60px 20px;
background: rgba(125, 125, 125, 0.4);
overflow: hidden;
position: relative;
.metacodeSetsDescription {
width: 314px;
}
td.metacodeSetDesc {
width: 314px;
word-wrap: break-word;
}
.metacodeSetImage {
width: 36px;
height: 36px;
float: left;
}
tr {
display: table-row;
}
tr:nth-child(odd) {
background: rgba(125, 125, 125, 0.2);
}
tr:nth-child(even) {
background: rgba(125, 125, 125, 0.3);
}
th,
td {
padding: 10px;
}
td.iconURL {
max-width: 415px;
word-wrap: break-word;
}
.field {
margin: 15px 0 5px;
}
label {
float: left;
width: 100px;
margin-right: 15px;
margin-top: 0px;
}
input[type="text"] {
width: 336px;
height: 32px;
font-size: 15px;
direction: ltr;
-webkit-appearance: none;
appearance: none;
display: inline-block;
margin: 0;
padding: 0 8px;
background: #fff;
border: 1px solid #d9d9d9;
border-top: 1px solid #c0c0c0;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
-webkit-border-radius: 1px;
-moz-border-radius: 1px;
border-radius: 1px;
font: -webkit-small-control;
color: initial;
letter-spacing: normal;
word-spacing: normal;
text-transform: none;
text-indent: 0px;
text-shadow: none;
display: inline-block;
text-align: start;
font-family: arial;
}
textarea:hover,
input[type="text"]:hover {
border: 1px solid #b9b9b9;
border-top: 1px solid #a0a0a0;
-webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
-moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}
textarea {
padding: 8px;
border: 1px solid #d9d9d9;
border-top: 1px solid #c0c0c0;
resize: none;
font: -webkit-small-control;
letter-spacing: normal;
word-spacing: normal;
text-transform: none;
text-indent: 0px;
text-shadow: none;
text-align: start;
font-family: arial;
font-size: 15px;
line-height: 17px;
width: 318px;
}
.allMetacodes {
padding: 5px 0;
}
a.button {
margin-right: 20px;
line-height: 40px;
}
a.button,
input.add {
float: left;
margin-top: 5px;
height: 40px;
font-size: 17px;
width: auto;
padding: 0 30px;
cursor: pointer;
font-weight: normal;
}
a.button:hover,
input.add:hover {
-webkit-box-shadow: none;
box-shadow: none;
}
}

View file

@ -0,0 +1,134 @@
.centerContent {
position: relative;
margin: 0 auto;
width: auto;
max-width: 800px;
overflow: hidden;
box-shadow: 0 1px 3px rgba(0,0,0,.12),0 1px 2px rgba(0,0,0,.24);
background: #fff;
box-sizing: border-box;
padding: 15px;
font-family: 'din-regular', sans-serif;
}
.centerContent .page-header {
margin-bottom: 20px;
padding-bottom: 8px;
border-bottom: 1px solid #DCDCDC;
}
.centerContent .form-group {
margin-bottom: 20px;
}
.centerContent .inline-button {
display: inline-block;
}
.centerContent.showApp p {
margin-bottom: 20px;
}
.centerContent a {
color: #4fb5c0;
}
.centerContent a:hover {
text-decoration: underline;
}
.centerContent a.button {
color: #FFFFFF;
}
.centerContent a.button:hover {
text-decoration: none;
}
.centerContent th {
text-align: left;
}
.centerContent td {
padding-right: 20px;
padding-bottom: 20px;
}
.centerContent .link-button {
line-height: 32px;
color: #FFFFFF;
}
.centerContent .button-margin {
margin-bottom: 20px;
}
.centerContent .button-margin-top {
margin-top: 20px;
}
.centerContent a.red-button, .centerContent button.red-button,
.centerContent input[type="submit"].red-button {
color: #c04f4f;
background: transparent;
text-transform: none;
}
.centerContent .red-button:hover {
background: transparent;
color: #9A3E3E !important;
}
.centerContent input[type="text"] {
font-family: 'din-medium', helvetica, sans-serif;
width: 400px;
height: 32px;
font-size: 14px;
direction: ltr;
-webkit-appearance: none;
appearance: none;
display: inline-block;
margin: 0;
padding: 0 8px;
background: #fff;
border: 1px solid #d9d9d9;
border-top: 1px solid #c0c0c0;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
-webkit-border-radius: 1px;
-moz-border-radius: 1px;
border-radius: 2px;
color: #424242;
letter-spacing: normal;
word-spacing: normal;
text-transform: none;
text-indent: 0px;
text-shadow: none;
display: inline-block;
text-align: start;
}
.centerContent textarea {
color: #424242;
padding: 8px;
border: 1px solid #d9d9d9;
border-top: 1px solid #c0c0c0;
resize: none;
letter-spacing: normal;
word-spacing: normal;
text-transform: none;
text-indent: 0px;
text-shadow: none;
text-align: start;
font-family: 'din-medium', helvetica, sans-serif;
font-size: 14px;
line-height: 17px;
width: 400px;
box-sizing: border-box;
border-radius: 2px;
}
.centerContent.withPadding {
margin-top: 1em;
margin-bottom: 1em;
}

Some files were not shown because too many files have changed in this diff Show more