From 2f2f6e64fe7197835ef559a2c1fbe92264ecacc0 Mon Sep 17 00:00:00 2001 From: Raymon Johnstone Date: Wed, 14 May 2014 14:42:15 -0400 Subject: [PATCH 1/7] Changes to PAG for external pages to load in a new tab --- Gemfile | 2 +- Gemfile.lock | 6 +++ Gemfile~ | 6 +-- app/views/main/paq.html.erb | 7 ++++ app/views/main/paq.html.erb~ | 78 ++++++++++++++++++++++++++++++++++++ 5 files changed, 95 insertions(+), 4 deletions(-) create mode 100644 app/views/main/paq.html.erb~ diff --git a/Gemfile b/Gemfile index 65988ca4..9e2acc35 100644 --- a/Gemfile +++ b/Gemfile @@ -14,7 +14,7 @@ gem 'formtastic' gem 'json' gem 'rails3-jquery-autocomplete' gem 'best_in_place' -#gem 'therubyracer' #optional +gem 'therubyracer' #optional #gem 'rb-readline' # Gems used only for assets and not required diff --git a/Gemfile.lock b/Gemfile.lock index efec0f57..f2b9ec81 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -64,6 +64,7 @@ GEM railties (>= 3.1.0, < 5.0) thor (~> 0.14) json (1.8.1) + libv8 (3.16.14.3) mail (2.5.4) mime-types (~> 1.16) treetop (~> 1.4.8) @@ -101,6 +102,7 @@ GEM rdoc (3.12.2) json (~> 1.4) redis (2.2.2) + ref (1.0.5) sass (3.2.7) sass-rails (3.2.3) railties (~> 3.2.0.beta) @@ -111,6 +113,9 @@ GEM multi_json (~> 1.0) rack (~> 1.0) tilt (~> 1.1, != 1.3.0) + therubyracer (0.12.1) + libv8 (~> 3.16.14.0) + ref thor (0.19.1) tilt (1.4.1) treetop (1.4.15) @@ -142,4 +147,5 @@ DEPENDENCIES rails3-jquery-autocomplete redis sass-rails + therubyracer uglifier (>= 1.0.3) diff --git a/Gemfile~ b/Gemfile~ index 23495a03..7b0b3fa7 100644 --- a/Gemfile~ +++ b/Gemfile~ @@ -1,6 +1,6 @@ source 'https://rubygems.org' -gem 'rails', '3.2.11' +gem 'rails', '3.2.17' # Bundle edge Rails instead: # gem 'rails', :git => 'git://github.com/rails/rails.git' @@ -14,8 +14,8 @@ gem 'formtastic' gem 'json' gem 'rails3-jquery-autocomplete' gem 'best_in_place' -#gem 'therubyracer' #optional -#gem 'rb-readline' +gem 'therubyracer' #optional +gem 'rb-readline' # Gems used only for assets and not required # in production environments by default. diff --git a/app/views/main/paq.html.erb b/app/views/main/paq.html.erb index 16fc1f53..a4c5081e 100644 --- a/app/views/main/paq.html.erb +++ b/app/views/main/paq.html.erb @@ -28,6 +28,13 @@

First and foremost, metamaps bring people together into a shared knowledge environment. Topics and maps "in the commons" invite collaborative editing and shared insight. As new content and connections are made throughout the system, all users benefit from collective intelligence. Other distinguishing factors on the platform include a focus on real-time collaboration, a flexible visual categorization system via metacode icons, no built-in structural biases, and an intuitive search tool to find content. As the project evolves, we will be building in powerful network and graph analysis techniques which are not currently offered in other mind mapping apps.

Is this an open source project?
+

One of the core principles of our work is the enhancement of the pool of commons resources such as open source technology and shared knowledge. Our basic application framework is licensed as GPL open source on Github for anyone to build on, and this public platform is freely accessible online.

+ +
How can I find out more about the project?
+

Reading here is a great first step. We also suggest browsing our blog, visiting the Google+ community, or getting in touch by submitting feedback through the site. We occasionally host online and in person meetups where you can interact with other mappers and see how people are using the platform. The story continues to unfold, and we'd be glad for you to take part.

+ +
How can I participate, or support the project?
+

We welcome contributions in many forms. One of the easiest and best things you can do is to keep on mapping your ideas into the commons on the platform! If you're a developer interested in advancing the technology, contact us and take a look around our Github. Designers and others with professional skills can get in touch about opportunities for freelance collaboration through our innovative Open Value Network organizational structure for business development opportunities. Financial contributions are greatly appreciated in support of our work, and can be made by supporting us on Flattr or donating BitCoin. All financial contributions are transparently recorded in our value accounting system.

One of the core principles of our work is the enhancement of the pool of commons resources such as open source technology and shared knowledge. Our basic application framework is licensed as GPL open source on Github for anyone to build on, and this public platform is freely accessible online.

How can I find out more about the project?
diff --git a/app/views/main/paq.html.erb~ b/app/views/main/paq.html.erb~ new file mode 100644 index 00000000..8162df8a --- /dev/null +++ b/app/views/main/paq.html.erb~ @@ -0,0 +1,78 @@ +<%# + # @file + # Located at / + # Shows 3 most recently created topics, synapses, and maps. + #%> + +<% content_for :title, "Possibly Asked Questions | Metamaps" %> + +

+ P(ossibly)AQ +

+ +
+ +
Who may use Metamaps.cc?
+

You! We are currently in "beta" mode, meaning that the application is undergoing continuous testing and refinement. During this time, we welcome participants of all ages in this trial process with the understanding that things are evolving, and may hold a few surprises! Request an invite if you'd like to explore and build with us - feedback is always welcome.

+ +
What does it take to learn to Metamap?
+

While the interface may not seem familiar at first, we've designed it to be both intuitive and empowering after a bit of practice. There are only a handful of basic functions, like adding topics and drawing "synapse" connections, that are needed get you going! A handy cheat sheet is available on the canvas for reference while mapping, and we also have an online manual and video tutorials to grasp more advanced functionality. But overall - the best way to learn is to start mapping, and to connect with other mappers in our online community.

+ +
What is the platform being used for currently?
+

Firstly, check out our featured maps! At a basic level, metamaps are great for laying out complex ideas and scenarios. We're seeing maps of creative brainstorms, product design, personal research and learning, project management, and narrative storylines. Some users have been capturing live workshop event documentation, or organizing study groups. We're using it ourselves to organize collaboration and develop strategies for the project. We'd love to see what else you can come up with.

+ +
Who made this up? Why?
+

The Metamaps.cc project was launched as an emergent collaboration between designer Gavin Keech, architect Ishan Shapiro, and web developer Connor Turland over the years 2010-12, with input and inspiration from many other peers and projects. Its design draws from the fields of computational cognition, collective intelligence, and human-computer interaction. We continue to design and develop optimal, novel ways to connect people and ideas through visual information.

+ +
How is MM different from other "mind mapping" apps?
+

First and foremost, metamaps bring people together into a shared knowledge environment. Topics and maps "in the commons" invite collaborative editing and shared insight. As new content and connections are made throughout the system, all users benefit from collective intelligence. Other distinguishing factors on the platform include a focus on real-time collaboration, a flexible visual categorization system via metacode icons, no built-in structural biases, and an intuitive search tool to find content. As the project evolves, we will be building in powerful network and graph analysis techniques which are not currently offered in other mind mapping apps.

+ +
Is this an open source project?
+<<<<<<< HEAD +

One of the core principles of our work is the enhancement of the pool of commons resources such as open source technology and shared knowledge. Our basic application framework is licensed as GPL open source on Github for anyone to build on, and this public platform is freely accessible online.

+ +
How can I find out more about the project?
+

Reading here is a great first step. We also suggest browsing our blog, visiting the Google+ community, or getting in touch by submitting feedback through the site. We occasionally host online and in person meetups where you can interact with other mappers and see how people are using the platform. The story continues to unfold, and we'd be glad for you to take part.

+ +
How can I participate, or support the project?
+

We welcome contributions in many forms. One of the easiest and best things you can do is to keep on mapping your ideas into the commons on the platform! If you're a developer interested in advancing the technology, contact us and take a look around our Github. Designers and others with professional skills can get in touch about opportunities for freelance collaboration through our innovative Open Value Network organizational structure for business development opportunities. Financial contributions are greatly appreciated in support of our work, and can be made by supporting us on Flattr or donating BitCoin. All financial contributions are transparently recorded in our value accounting system.

+======= +

One of the core principles of our work is the enhancement of the pool of commons resources such as open source technology and shared knowledge. Our basic application framework is licensed as GPL open source on Github for anyone to build on, and this public platform is freely accessible online.

+ +
How can I find out more about the project?
+

Reading here is a great first step. We also suggest browsing our blog, visiting the Google+ community, or getting in touch by submitting feedback through the site. We occasionally host online and in person meetups where you can interact with other mappers and see how people are using the platform. The story continues to unfold, and we'd be glad for you to take part.

+ +
How can I participate, or support the project?
+

We welcome contributions in many forms. One of the easiest and best things you can do is to keep on mapping your ideas into the commons on the platform! If you're a developer interested in advancing the technology, contact us and take a look around our Github. Designers and others with professional skills can get in touch about opportunities for freelance collaboration through our innovative Open Value Network organizational structure for business development opportunities. Financial contributions are greatly appreciated in support of our work, and can be made by supporting us on Flattr or donating BitCoin. All financial contributions are transparently recorded in our value accounting system.

+>>>>>>> 3a3e6abfe23b8563b5ea6e4d6cf612aa42cafc4f + +
Are you making money from it? Do you plan to?
+

The Metamaps.cc project has been bootstrapped through our own pockets, lots of time, and more recently, a couple of small grants which are going into supporting our small team to bring it to the next level. Some of us have used Metamaps.cc as a tool for our own freelance consulting practice, and we are looking at creating hosted and customized instances for different clients as one potential business model. We realize that in order to get the free and open public platform to where we want it to be, we have to be able to support ourselves to continue doing this work.

+ +
I'd like to have a new / different feature. Where can I make suggestions and requests?
+

New features and functions are continually added to the platform as we seek to optimize the experience there for all users. If you find that something is calling out for addition or improvement, send us a note via feedback form or in the online community. The more detail and context you can provide, the better!

+ +
I made a cool map...want to check it out?
+

Yes! Send us the link via feedback form or flag us on social media. We're always curious what mappers are able to do with the platform, and we'd love to pass great examples around so that others can see.

+ +
Someone else changed my cool map (or favorite topic) without asking me...sad face :(
+

If your map / topic was set to Commons permission for editing, than any other logged-in user on the site will be able to make changes. We consider this a feature, not a bug, which encourages collaborative maps and an evolving collective knowledge garden. You can easily avoid unwanted changes by setting your permissions to Public, which others may still view and copy to another version if they wish. Courtesy, care, and the benefit of the doubt will go a long ways towards maintaining a happy, healthy, and productive communal atmosphere on Metamaps.cc

+ +
+ + From 64f3bf8bbe2b25fc88f27e4b21bbbf20e7c7d57c Mon Sep 17 00:00:00 2001 From: Raymon Johnstone Date: Wed, 14 May 2014 15:21:17 -0400 Subject: [PATCH 2/7] Filter ScrollBar update fixed --- app/assets/javascripts/application.js | 2 +- app/assets/javascripts/application.js~ | 804 ++++++++++++++++++ .../scroll/jquery.mCustomScrollbar.min.js | 2 +- .../scroll/jquery.mCustomScrollbar.min.js~ | 1 + 4 files changed, 807 insertions(+), 2 deletions(-) create mode 100644 app/assets/javascripts/application.js~ create mode 100644 app/assets/javascripts/scroll/jquery.mCustomScrollbar.min.js~ diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index dcf5ab0a..53af30e3 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -455,7 +455,7 @@ var labelType, useGradients, nativeTextSupport, animate, json, Mconsole = null, //$(".scroll").mCustomScrollbar(); // initialize scroll bar for filter by metacode, then hide it and position it correctly again - $("#filter_by_metacode").mCustomScrollbar(); + $("#filter_by_metacode").mCustomScrollbar({advanced: { updateOnContentResize: true }}); $('.sidebarFilterBox').hide().css({ position:'absolute', top: '35px', diff --git a/app/assets/javascripts/application.js~ b/app/assets/javascripts/application.js~ new file mode 100644 index 00000000..dcf5ab0a --- /dev/null +++ b/app/assets/javascripts/application.js~ @@ -0,0 +1,804 @@ +// 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 autocomplete-rails-uncompressed +// +//= require jquery +//= require jquery-ui +//= require jquery.purr +//= require jquery.lettering +//= require jquery.textillate +//= require jquery.roundabout.min +//= require best_in_place +//= require jquery_ujs +//= require_tree . + +// other options are 'graph' +var viewMode = "list"; + +var labelType, useGradients, nativeTextSupport, animate, json, Mconsole = null, gType, tempNode = null, tempInit = false, tempNode2 = null, metacodeIMGinit = false, goRealtime = false, mapid = null, mapperm = false, touchPos, touchDragNode, mouseIsDown = false; + + $(document).ready(function() { + + function bindMainMenuHover() { + + var menuIsOpen = false + + // controls the sliding hover of the bottom left menu + var sliding1 = false; + var lT; + + var closeMenu = function() { + lT = setTimeout(function() { + if (! sliding1) { + sliding1 = true; + // $('.footer .menu').animate({ + // height: '0px' + // }, 300, function() { + // sliding1 = false; + // menuIsOpen = false; + // }); + $('.footer').css('border-top-right-radius','5px'); + $('.logo').animate({ + 'background-position-x':'-10px' + }, 200); + $('.footer .menu').fadeOut(200, function() { + sliding1 = false; + menuIsOpen = false; + }); + } + },500); + } + + var openMenu = function() { + clearTimeout(lT); + if (! sliding1) { + sliding1 = true; + + // $('.footer .menu').animate({ + // height: listLength + 'px' + // }, 300, function() { + // sliding1 = false; + // }); + $('.footer').css('border-top-right-radius','0'); + $('.logo').animate({ + 'background-position-x':'-7px' + }, 200); + $('.footer .menu').fadeIn(200, function() { + sliding1 = false; + }); + } + } + // bind the hover events + $(".logo").hover(openMenu, closeMenu); + + // when on touch screen, make touching on the logo do what hovering does on desktop + $("#mainTitle a").bind('touchend', function(evt) { + if (!menuIsOpen) { + openMenu(); + evt.preventDefault(); + evt.stopPropagation(); + } + }); + } + + function bindSearchHover() { + + var searchIsOpen = false + + // controls the sliding hover of the search + var sliding1 = false; + var lT; + + var openSearch = function() { + clearTimeout(lT); + if (!sliding1 && !searchIsOpen) { + hideCards(); + sliding1 = true; + $('.sidebarSearch .twitter-typeahead, .sidebarSearch .tt-hint, .sidebarSearchField').animate({ + width: '200px' + }, 200, function() { + $('.sidebarSearchField, .sidebarSearch .tt-hint').css({padding:'5px 10px', width:'180px'}); + $('.sidebarSearchField').focus(); + sliding1 = false + searchIsOpen = true; + }); + } + } + var closeSearch = function(closeAfter) { + lT = setTimeout(function() { + if (!sliding1 && searchIsOpen && $('.sidebarSearchField').val() == '') { + sliding1 = true; + $('.sidebarSearchField, .sidebarSearch .tt-hint').css({padding:'5px 0', width:'200px'}); + $('.sidebarSearch .twitter-typeahead, .sidebarSearch .tt-hint, .sidebarSearchField').animate({ + width: '0' + }, 200, function() { + $('.sidebarSearchField').typeahead('setQuery',''); + sliding1 = false; + searchIsOpen = false; + }); + } + },closeAfter); + } + + // bind the hover events + $(".sidebarSearch").hover(function(){ openSearch() }, function() { closeSearch(800) }); + + $('.sidebarSearchIcon').click(function(e) { + $('.sidebarSearchField').focus(); + }); + $('.sidebarSearch').click(function(e) { + e.stopPropagation(); + }); + $('body').click(function(e) { + closeSearch(0); + }); + + // if the search is closed and user hits SHIFT+S + $('body').bind('keyup', function(e) { + switch(e.which) { + case 83: + if (e.shiftKey && !searchIsOpen) { + openSearch(); + } + break; + default: break; //console.log(e.which); + } + }); + + // initialize the search box autocomplete results + var mapheader = userid ? '

Maps

' : '

Maps

'; + var topicheader = userid ? '

Topics

' : '

Topics

'; + $('.sidebarSearchField').typeahead([ + { + name: 'topics', + dupChecker: function (datum1,datum2) { + return false; + }, + template: $('.topicTemplate').html(), + remote: { + url: '/search/topics?term=%QUERY', + replace: function () { + var q = '/search/topics?term=' + $('.sidebarSearchField').val(); + if ($("#limitTopicsToMe").is(':checked')) { + q += "&user=" + userid.toString(); + } + return q; + }, + filter: function(dataset) { + if (dataset.length == 0) { + dataset.push({ + value: "No results", + label: "No results", + typeImageURL: "/assets/wildcard.png", + rtype: "noresult" + }); + } + return dataset; + } + }, + engine: Hogan, + header: topicheader + }, + { + name: 'maps', + dupChecker: function (datum1,datum2) { + return false; + }, + template: $('.mapTemplate').html(), + remote: { + url: '/search/maps?term=%QUERY', + replace: function () { + var q = '/search/maps?term=' + $('.sidebarSearchField').val(); + if ($("#limitMapsToMe").is(':checked')) { + q += "&user=" + userid.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 + }, + { + name: 'mappers', + dupChecker: function (datum1,datum2) { + return false; + }, + template: $('.mapperTemplate').html(), + remote: { + url: '/search/mappers?term=%QUERY', + filter: function(dataset) { + if (dataset.length == 0) { + dataset.push({ + value: "No results", + label: "No results", + rtype: "noresult" + }); + } + return dataset; + } + }, + engine: Hogan, + header: '

Mappers

' + } + ]); + // tell the autocomplete to launch a new tab with the topic, map, or mapper you clicked on + $('.sidebarSearchField').bind('typeahead:selected', function (event, datum, dataset) { + console.log(event); + if (datum.rtype != "noresult") { + var win; + if (dataset == "topics") { + win=window.open('/topics/' + datum.id, '_blank'); + } + else if (dataset == "maps") { + win=window.open('/maps/' + datum.id, '_blank'); + } + else if (dataset == "mappers") { + win=window.open('/maps/mappers/' + datum.id, '_blank'); + } + win.focus(); + closeSearch(0); + } + }); + + + var checkboxChangeInit = false, minimizeInit = false; + + $('.sidebarSearchField').bind('keyup', function () { + + // when the user selects 'added by me' resend the query with their userid attached + if (!checkboxChangeInit) { + $('.limitToMe').bind("change", function(e) { + // set the value of the search equal to itself to retrigger the autocomplete event + searchIsOpen = false; + $('.sidebarSearchField').typeahead('setQuery',$('.sidebarSearchField').val()); + setTimeout(function() { searchIsOpen = true; }, 2000); + }); + checkboxChangeInit = true; + } + + // when the user clicks minimize section, hide the results for that section + if (!minimizeInit) { + $('.minimizeMapperResults').click(function(e) { + var s = $('.tt-dataset-mappers .tt-suggestions'); + console.log(s.css('height')); + if (s.css('height') == '0px') { + $('.tt-dataset-mappers .tt-suggestions').css({'height':'auto','overflow':'visible'}); + $(this).removeClass('maximizeResults').addClass('minimizeResults'); + } else { + $('.tt-dataset-mappers .tt-suggestions').css({'height':'0','overflow':'hidden'}); + $(this).removeClass('minimizeResults').addClass('maximizeResults'); + } + }); + $('.minimizeTopicResults').click(function(e) { + var s = $('.tt-dataset-topics .tt-suggestions'); + console.log(s.css('height')); + if (s.css('height') == '0px') { + s.css({'height':'auto','border-top':'none','overflow':'visible'}); + $(this).removeClass('maximizeResults').addClass('minimizeResults'); + } else { + s.css({'height':'0','border-top':'1px solid rgb(56, 56, 56)','overflow':'hidden'}); + $(this).removeClass('minimizeResults').addClass('maximizeResults'); + } + }); + $('.minimizeMapResults').click(function(e) { + var s = $('.tt-dataset-maps .tt-suggestions'); + console.log(s.css('height')); + if (s.css('height') == '0px') { + s.css({'height':'auto','border-top':'none','overflow':'visible'}); + $(this).removeClass('maximizeResults').addClass('minimizeResults'); + } else { + s.css({'height':'0','border-top':'1px solid rgb(56, 56, 56)','overflow':'hidden'}); + $(this).removeClass('minimizeResults').addClass('maximizeResults'); + } + }); + minimizeInit = true; + } + }); + + // + + $('.sidebarSearch button.addToMap').click(function(event){ + event.stopPropagation(); + }); + } // end bindSearchHover + + function bindAccountHover() { + + var accountIsOpen = false + + // controls the sliding hover of the bottom left menu + var sliding1 = false; + var lT; + + var closeAccount = function() { + lT = setTimeout(function() { + if (! sliding1) { + sliding1 = true; + $('.sidebarAccountIcon').css('background-color','#0F1519'); + $('.sidebarAccountBox').fadeOut(200, function() { + sliding1 = false; + accountIsOpen = false; + }); + } + },300); + } + + var openAccount = function() { + clearTimeout(lT); + if (! sliding1) { + sliding1 = true; + + // hide the other two + $('.sidebarFilterBox').hide(); + $('.sidebarWandBox').hide(); + $('.sidebarFilterIcon').css('background-color','#0F1519'); + $('.sidebarWandIcon').css('background-color','#0F1519'); + + $('.sidebarAccountIcon').css('background-color','#000'); + $('.sidebarAccountBox').fadeIn(200, function() { + sliding1 = false; + accountIsOpen = true; + }); + } + } + // bind the hover events + $(".sidebarAccount").hover(openAccount, closeAccount); + } // end bindAccountHover + + // bind hover events + bindMainMenuHover(); + bindSearchHover(); + bindAccountHover(); + + // disable right click events on the new topic and new synapse input fields + $('#new_topic, #new_synapse').bind('contextmenu', function(e){ + return false; + }); + + // initialize the autocomplete results for the metacode spinner + $('#topic_name').typeahead([ + { + name: 'topic_autocomplete', + limit: 8, + template: '{{type}}

{{label}}

{{originator}}
', + remote: { + url: '/topics/autocomplete_topic?term=%QUERY' + }, + engine: Hogan + } + ]); + // tell the autocomplete to submit the form with the topic you clicked on if you pick from the autocomplete + $('#topic_name').bind('typeahead:selected', function (event, datum, dataset) { + $('#topic_grabTopic').val(datum.id); + event.preventDefault(); + event.stopPropagation(); + }); + // bind keyboard handlers + $('#topic_name').bind('keyup', function(e) { + switch(e.which) { + case 13: + $('.new_topic').submit(); + break; + default: break; + } + }); + + // initialize the autocomplete results for the metacode spinner + $('#synapse_desc').typeahead([ + { + name: 'synapse_autocomplete', + template: "{{label}}", + remote: { + url: '/search/synapses?term=%QUERY' + }, + engine: Hogan + }, + { + name: 'existing_synapses', + limit: 50, + template: $('.synapseTemplate').html(), + remote: { + url: '/search/synapses', + replace: function () { + var q = '/search/synapses?topic1id=' + $('#synapse_topic1id').val() + '&topic2id=' + $('#synapse_topic2id').val(); + return q; + } + }, + engine: Hogan, + header: "

Existing Synapses

" + }, + ]); + // tell the autocomplete to submit the form with the topic you clicked on if you pick from the autocomplete + $('#synapse_desc').bind('typeahead:selected', function (event, datum, dataset) { + if (datum.id) { // if they clicked on an existing synapse get it + $('#synapse_grabSynapse').val(datum.id); + } + event.preventDefault(); + event.stopPropagation(); + }); + // bind keyboard handlers + $('#synapse_desc').bind('keyup', function(e) { + switch(e.which) { + case 13: + $('.new_synapse').submit(); + break; + default: break; + } + }); + + // when either form submits, don't leave the page + $('.new_topic, .new_synapse').bind('submit', function(event, data){ + event.preventDefault(); + }); + + + //$(".scroll").mCustomScrollbar(); + + // initialize scroll bar for filter by metacode, then hide it and position it correctly again + $("#filter_by_metacode").mCustomScrollbar(); + $('.sidebarFilterBox').hide().css({ + position:'absolute', + top: '35px', + right: '-36px' + }); + + // initialize metacode spinner and then hide it + $("#metacodeImg").CloudCarousel( { + titleBox: $('#metacodeImgTitle'), + yRadius:40, + xPos: 150, + yPos: 40, + speed:0.3, + mouseWheel:true, + bringToFront: true + }); + $('.new_topic').hide(); + + + $('.notice.metamaps').delay(10000).fadeOut('fast'); + $('.alert.metamaps').delay(10000).fadeOut('fast'); + + $('#center-container').bind('contextmenu', function(e){ + return false; + }); + + addHoverForSettings(); + + //bind best_in_place ajax callbacks + $('.best_in_place_desc').bind("ajax:success", function() { + $(this).parents('.CardOnGraph').find('.scroll').mCustomScrollbar("update"); + }); + $('.best_in_place_link').bind("ajax:success", function() { + var link = $(this).html(); + $(this).parents('.CardOnGraph').find('.go-link').attr('href', link); + }); + + //bind lightbox clicks + $('.openLightbox').click(function(event) { + openLightbox($(this).attr('data-open')); + event.preventDefault(); + return false; + }); + + // bind permission changer events + $('.permIcon').click(function() { + $(this).siblings('#map_permission').val( $(this).attr('data-permission') ); + $(this).siblings('.permIcon').find('.mapPermIcon').removeClass('selected'); + $(this).find('.mapPermIcon').addClass('selected'); + }); + + // bind keyboard handlers + $('body').bind('keyup', function(e) { + switch(e.which) { + case 13: enterKeyHandler(e); break; + case 27: escKeyHandler(); break; + default: break; //console.log(e.which); + } + }); + +}); // end document.ready + +function addHoverForSettings() { + // controls the sliding hover of the settings for cards + $(".permActivator").unbind('mouseover'); + $(".permActivator").unbind('mouseout'); + var sliding2 = false; + var lT1,lT2; + $(".permActivator").bind('mouseover', + function () { + clearTimeout(lT2); + that = this; + lT1 = setTimeout(function() { + if (! sliding2) { + sliding2 = true; + $(that).animate({ + width: '203px', + height: '37px' + }, 300, function() { + sliding2 = false; + }); + } + }, 300); + }); + + $(".permActivator").bind('mouseout', + function () { + clearTimeout(lT1); + that = this; + lT2 = setTimeout(function() { + if (! sliding2) { + sliding2 = true; + $(that).animate({ + height: '16px', + width: '16px' + }, 300, function() { + sliding2 = false; + }); + } + },800); + } + ); + + $('.best_in_place_permission').unbind("ajax:success"); + //bind best_in_place ajax callbacks + $('.best_in_place_permission').bind("ajax:success", function() { + var permission = $(this).html(); + var el = $(this).parents('.cardSettings').find('.mapPerm'); + el.attr('title', permission); + if (permission == "commons") el.html("co"); + else if (permission == "public") el.html("pu"); + else if (permission == "private") el.html("pr"); + }); +} + +// this is to save the layout of a map +function saveLayoutAll() { + $('.sidebarSave .tip').html('Saving...'); + var coor = ""; + if (gType == "arranged" || gType == "chaotic") { + Mconsole.graph.eachNode(function(n) { + coor = coor + n.getData("mappingid") + '/' + n.pos.x + '/' + n.pos.y + ','; + }); + coor = coor.slice(0, -1); + $('#map_coordinates').val(coor); + $('#saveMapLayout').submit(); + } +} + +// this is to update the location coordinate of a single node on a map +function saveLayout(id) { + var n = Mconsole.graph.getNode(id); + $('#map_coordinates').val(n.getData("mappingid") + '/' + n.pos.x + '/' + n.pos.y); + $('#saveMapLayout').submit(); + dragged = 0; + //$('.wandSaveLayout').html('Saved!'); + //setTimeout(function(){$('.wandSaveLayout').html('Save Layout')},1500); +} + +// this is to save your console to a map +function saveToMap() { + var nodes_data = "", synapses_data = ""; + var synapses_array = new Array(); + Mconsole.graph.eachNode(function(n) { + //don't add to the map if it was filtered out + if (categoryVisible[n.getData('metacode')] == false) { + return; + } + + var x, y; + if (n.pos.x && n.pos.y) { + x = n.pos.x; + y = n.pos.y; + } else { + var x = Math.cos(n.pos.theta) * n.pos.rho; + var y = Math.sin(n.pos.theta) * n.pos.rho; + } + nodes_data += n.id + '/' + x + '/' + y + ','; + n.eachAdjacency(function(adj) { + synapses_array.push(adj.getData("id")); + }); + }); + + //get unique values only + synapses_array = $.grep(synapses_array, function(value, key){ + return $.inArray(value, synapses_array) === key; + }); + + synapses_data = synapses_array.join(); + nodes_data = nodes_data.slice(0, -1); + + $('#map_topicsToMap').val(nodes_data); + $('#map_synapsesToMap').val(synapses_data); + openLightbox('forkmap'); +} + +function fetchRelatives(node) { + var myA = $.ajax({ + type: "Get", + url: "/topics/" + node.id + "?format=json", + success: function(data) { + if (gType == "centered") { + Mconsole.busy = true; + Mconsole.op.sum(data, { + type: 'fade', + duration: 500, + hideLabels: false + }); + Mconsole.graph.eachNode(function (n) { + n.eachAdjacency(function (a) { + if (!a.getData('showDesc')) { + a.setData('alpha', 0.4, 'start'); + a.setData('alpha', 0.4, 'current'); + a.setData('alpha', 0.4, 'end'); + } + }); + }); + Mconsole.busy = false; + } + else { + Mconsole.op.sum(data, { + type: 'nothing', + }); + Mconsole.plot(); + } + /*Mconsole.op.contract(node, { + type: 'replot' + }); + Mconsole.op.expand(node, { + type: 'animate', + transition: $jit.Trans.Elastic.easeOut, + duration: 1000 + });*/ + }, + error: function(){ + alert('failure'); + } + }); +} + +// @param node = JIT node object +// @param metacode = STRING like "Idea", "Action", etc. +function updateMetacode(node, metacode) { + var mdata = { "topic": { "metacode": metacode } }; + $.ajax({ + type: "PUT", + dataType: 'json', + url: "/topics/" + node.id, + data: mdata, + success: function(data) { + $('.CardOnGraph').find('.metacodeTitle').text(metacode); + $('.CardOnGraph').find('.metacodeImage').css('background-image', 'url(' + imgArray[metacode].src + ')'); + node.setData("metacode", metacode); + Mconsole.plot(); + $('.metacodeTitle').removeClass('minimize'); // this line flips the pull up arrow to a drop down arrow + $('.metacodeSelect').hide(); + setTimeout(function() { $('.metacodeTitle').hide(); $('.showcard .icon').css('z-index','1'); }, 500); + }, + error: function(){ + alert('failed to update metacode'); + } + }); +} + +function updateTopicPermission(node, permission) { + var mdata = { "topic": { "permission": permission } }; + $.ajax({ + type: "PUT", + dataType: 'json', + url: "/topics/" + node.id, + data: mdata, + success: function(data) { + $('.showcard .mapPerm').removeClass('co pu pr minimize').addClass( permission.substring(0,2) ); + $('.permissionSelect').remove(); + node.setData("permission", permission); + }, + error: function(){ + alert('failed to update permission'); + } + }); +} + +function updateSynapsePermission(edge, permission) { + var mdata = { "synapse": { "permission": permission } }; + $.ajax({ + type: "PUT", + dataType: 'json', + url: "/synapses/" + edge.data.$id, + data: mdata, + success: function(data) { + $('#edit_synapse .mapPerm').removeClass('co pu pr minimize').addClass( permission.substring(0,2) ); + $('#edit_synapse .permissionSelect').remove(); + edge.setData("permission", permission); + }, + error: function(){ + alert('failed to update permission'); + } + }); +} + +function updateMapPermission(mapid, permission) { + var mdata = { "map": { "permission": permission } }; + $.ajax({ + type: "PUT", + dataType: 'json', + url: "/maps/" + mapid, + data: mdata, + success: function(data) { + $('.mapPermission').removeClass('commons public private minimize').addClass( permission ); + $('.mapPermission .permissionSelect').remove(); + }, + error: function(){ + alert('failed to update permission'); + } + }); +} + +function MconsoleReset() { + + var tX = Mconsole.canvas.translateOffsetX; + var tY = Mconsole.canvas.translateOffsetY; + Mconsole.canvas.translate(-tX,-tY); + + var mX = Mconsole.canvas.scaleOffsetX; + var mY = Mconsole.canvas.scaleOffsetY; + Mconsole.canvas.scale((1/mX),(1/mY)); +} + +function openNodeShowcard(node) { + //populate the card that's about to show with the right topics data + populateShowCard(node); + + $('.showcard').fadeIn('fast'); + var s = $('.showcard').find('.scroll'); + s.height( s.height() ).mCustomScrollbar(); + //node.setData('dim', 1, 'current'); + MetamapsModel.showcardInUse = node.id; +} + +function openLightbox(which) { + $('.lightboxContent').hide(); + $('#' + which).show(); + + $('#lightbox_overlay').show(); + $('#lightbox_main').css('margin-top', '-' + ($('#lightbox_main').height() / 2) + 'px' ); +} + +function cancelMapCreate(id) { + + $('#lightbox_overlay').hide(); + + var form = $('#' + id); + + form.find('#map_name').val(''); + form.find('#map_desc').val(''); + form.find('#map_permission').val('commons'); + + if (id == "fork_map") { + form.find('#map_topicsToMap').val('0'); + form.find('#map_synapsesToMap').val('0'); + } + form.find('.mapPermIcon').removeClass('selected'); + form.find('.mapCommonsIcon').addClass('selected'); + + return false; +} diff --git a/app/assets/javascripts/scroll/jquery.mCustomScrollbar.min.js b/app/assets/javascripts/scroll/jquery.mCustomScrollbar.min.js index 94da2581..7a20d615 100644 --- a/app/assets/javascripts/scroll/jquery.mCustomScrollbar.min.js +++ b/app/assets/javascripts/scroll/jquery.mCustomScrollbar.min.js @@ -1 +1 @@ -(function(c){var b={init:function(e){var f={set_width:false,set_height:false,horizontalScroll:false,scrollInertia:950,mouseWheel:true,mouseWheelPixels:"auto",autoDraggerLength:true,autoHideScrollbar:false,alwaysShowScrollbar:false,snapAmount:null,snapOffset:0,scrollButtons:{enable:false,scrollType:"continuous",scrollSpeed:"auto",scrollAmount:40},advanced:{updateOnBrowserResize:true,updateOnContentResize:false,autoExpandHorizontalScroll:false,autoScrollOnFocus:true,normalizeMouseWheelDelta:false},contentTouchScroll:true,callbacks:{onScrollStart:function(){},onScroll:function(){},onTotalScroll:function(){},onTotalScrollBack:function(){},onTotalScrollOffset:0,onTotalScrollBackOffset:0,whileScrolling:function(){}},theme:"light"},e=c.extend(true,f,e);return this.each(function(){var m=c(this);if(e.set_width){m.css("width",e.set_width)}if(e.set_height){m.css("height",e.set_height)}if(!c(document).data("mCustomScrollbar-index")){c(document).data("mCustomScrollbar-index","1")}else{var t=parseInt(c(document).data("mCustomScrollbar-index"));c(document).data("mCustomScrollbar-index",t+1)}m.wrapInner("
").addClass("mCustomScrollbar _mCS_"+c(document).data("mCustomScrollbar-index"));var g=m.children(".mCustomScrollBox");if(e.horizontalScroll){g.addClass("mCSB_horizontal").wrapInner("
");var k=g.children(".mCSB_h_wrapper");k.wrapInner("
").children(".mCSB_container").css({width:k.children().outerWidth(),position:"relative"}).unwrap()}else{g.wrapInner("
")}var o=g.children(".mCSB_container");if(c.support.touch){o.addClass("mCS_touch")}o.after("
");var l=g.children(".mCSB_scrollTools"),h=l.children(".mCSB_draggerContainer"),q=h.children(".mCSB_dragger");if(e.horizontalScroll){q.data("minDraggerWidth",q.width())}else{q.data("minDraggerHeight",q.height())}if(e.scrollButtons.enable){if(e.horizontalScroll){l.prepend("").append("")}else{l.prepend("").append("")}}g.bind("scroll",function(){if(!m.is(".mCS_disabled")){g.scrollTop(0).scrollLeft(0)}});m.data({mCS_Init:true,mCustomScrollbarIndex:c(document).data("mCustomScrollbar-index"),horizontalScroll:e.horizontalScroll,scrollInertia:e.scrollInertia,scrollEasing:"mcsEaseOut",mouseWheel:e.mouseWheel,mouseWheelPixels:e.mouseWheelPixels,autoDraggerLength:e.autoDraggerLength,autoHideScrollbar:e.autoHideScrollbar,alwaysShowScrollbar:e.alwaysShowScrollbar,snapAmount:e.snapAmount,snapOffset:e.snapOffset,scrollButtons_enable:e.scrollButtons.enable,scrollButtons_scrollType:e.scrollButtons.scrollType,scrollButtons_scrollSpeed:e.scrollButtons.scrollSpeed,scrollButtons_scrollAmount:e.scrollButtons.scrollAmount,autoExpandHorizontalScroll:e.advanced.autoExpandHorizontalScroll,autoScrollOnFocus:e.advanced.autoScrollOnFocus,normalizeMouseWheelDelta:e.advanced.normalizeMouseWheelDelta,contentTouchScroll:e.contentTouchScroll,onScrollStart_Callback:e.callbacks.onScrollStart,onScroll_Callback:e.callbacks.onScroll,onTotalScroll_Callback:e.callbacks.onTotalScroll,onTotalScrollBack_Callback:e.callbacks.onTotalScrollBack,onTotalScroll_Offset:e.callbacks.onTotalScrollOffset,onTotalScrollBack_Offset:e.callbacks.onTotalScrollBackOffset,whileScrolling_Callback:e.callbacks.whileScrolling,bindEvent_scrollbar_drag:false,bindEvent_content_touch:false,bindEvent_scrollbar_click:false,bindEvent_mousewheel:false,bindEvent_buttonsContinuous_y:false,bindEvent_buttonsContinuous_x:false,bindEvent_buttonsPixels_y:false,bindEvent_buttonsPixels_x:false,bindEvent_focusin:false,bindEvent_autoHideScrollbar:false,mCSB_buttonScrollRight:false,mCSB_buttonScrollLeft:false,mCSB_buttonScrollDown:false,mCSB_buttonScrollUp:false});if(e.horizontalScroll){if(m.css("max-width")!=="none"){if(!e.advanced.updateOnContentResize){e.advanced.updateOnContentResize=true}}}else{if(m.css("max-height")!=="none"){var s=false,r=parseInt(m.css("max-height"));if(m.css("max-height").indexOf("%")>=0){s=r,r=m.parent().height()*s/100}m.css("overflow","hidden");g.css("max-height",r)}}m.mCustomScrollbar("update");if(e.advanced.updateOnBrowserResize){var i,j=c(window).width(),u=c(window).height();c(window).bind("resize."+m.data("mCustomScrollbarIndex"),function(){if(i){clearTimeout(i)}i=setTimeout(function(){if(!m.is(".mCS_disabled")&&!m.is(".mCS_destroyed")){var w=c(window).width(),v=c(window).height();if(j!==w||u!==v){if(m.css("max-height")!=="none"&&s){g.css("max-height",m.parent().height()*s/100)}m.mCustomScrollbar("update");j=w;u=v}}},150)})}if(e.advanced.updateOnContentResize){var p;if(e.horizontalScroll){var n=o.outerWidth()}else{var n=o.outerHeight()}p=setInterval(function(){if(e.horizontalScroll){if(e.advanced.autoExpandHorizontalScroll){o.css({position:"absolute",width:"auto"}).wrap("
").css({width:o.outerWidth(),position:"relative"}).unwrap()}var v=o.outerWidth()}else{var v=o.outerHeight()}if(v!=n){m.mCustomScrollbar("update");n=v}},300)}})},update:function(){var n=c(this),k=n.children(".mCustomScrollBox"),q=k.children(".mCSB_container");q.removeClass("mCS_no_scrollbar");n.removeClass("mCS_disabled mCS_destroyed");k.scrollTop(0).scrollLeft(0);var y=k.children(".mCSB_scrollTools"),o=y.children(".mCSB_draggerContainer"),m=o.children(".mCSB_dragger");if(n.data("horizontalScroll")){var A=y.children(".mCSB_buttonLeft"),t=y.children(".mCSB_buttonRight"),f=k.width();if(n.data("autoExpandHorizontalScroll")){q.css({position:"absolute",width:"auto"}).wrap("
").css({width:q.outerWidth(),position:"relative"}).unwrap()}var z=q.outerWidth()}else{var w=y.children(".mCSB_buttonUp"),g=y.children(".mCSB_buttonDown"),r=k.height(),i=q.outerHeight()}if(i>r&&!n.data("horizontalScroll")){y.css("display","block");var s=o.height();if(n.data("autoDraggerLength")){var u=Math.round(r/i*s),l=m.data("minDraggerHeight");if(u<=l){m.css({height:l})}else{if(u>=s-10){var p=s-10;m.css({height:p})}else{m.css({height:u})}}m.children(".mCSB_dragger_bar").css({"line-height":m.height()+"px"})}var B=m.height(),x=(i-r)/(s-B);n.data("scrollAmount",x).mCustomScrollbar("scrolling",k,q,o,m,w,g,A,t);var D=Math.abs(q.position().top);n.mCustomScrollbar("scrollTo",D,{scrollInertia:0,trigger:"internal"})}else{if(z>f&&n.data("horizontalScroll")){y.css("display","block");var h=o.width();if(n.data("autoDraggerLength")){var j=Math.round(f/z*h),C=m.data("minDraggerWidth");if(j<=C){m.css({width:C})}else{if(j>=h-10){var e=h-10;m.css({width:e})}else{m.css({width:j})}}}var v=m.width(),x=(z-f)/(h-v);n.data("scrollAmount",x).mCustomScrollbar("scrolling",k,q,o,m,w,g,A,t);var D=Math.abs(q.position().left);n.mCustomScrollbar("scrollTo",D,{scrollInertia:0,trigger:"internal"})}else{k.unbind("mousewheel focusin");if(n.data("horizontalScroll")){m.add(q).css("left",0)}else{m.add(q).css("top",0)}if(n.data("alwaysShowScrollbar")){if(!n.data("horizontalScroll")){m.css({height:o.height()})}else{if(n.data("horizontalScroll")){m.css({width:o.width()})}}}else{y.css("display","none");q.addClass("mCS_no_scrollbar")}n.data({bindEvent_mousewheel:false,bindEvent_focusin:false})}}},scrolling:function(i,q,n,k,A,f,D,w){var l=c(this);if(!l.data("bindEvent_scrollbar_drag")){var o,p,C,z,e;if(c.support.pointer){C="pointerdown";z="pointermove";e="pointerup"}else{if(c.support.msPointer){C="MSPointerDown";z="MSPointerMove";e="MSPointerUp"}}if(c.support.pointer||c.support.msPointer){k.bind(C,function(K){K.preventDefault();l.data({on_drag:true});k.addClass("mCSB_dragger_onDrag");var J=c(this),M=J.offset(),I=K.originalEvent.pageX-M.left,L=K.originalEvent.pageY-M.top;if(I0&&L0){o=L;p=I}});c(document).bind(z+"."+l.data("mCustomScrollbarIndex"),function(K){K.preventDefault();if(l.data("on_drag")){var J=k,M=J.offset(),I=K.originalEvent.pageX-M.left,L=K.originalEvent.pageY-M.top;G(o,p,L,I)}}).bind(e+"."+l.data("mCustomScrollbarIndex"),function(x){l.data({on_drag:false});k.removeClass("mCSB_dragger_onDrag")})}else{k.bind("mousedown touchstart",function(K){K.preventDefault();K.stopImmediatePropagation();var J=c(this),N=J.offset(),I,M;if(K.type==="touchstart"){var L=K.originalEvent.touches[0]||K.originalEvent.changedTouches[0];I=L.pageX-N.left;M=L.pageY-N.top}else{l.data({on_drag:true});k.addClass("mCSB_dragger_onDrag");I=K.pageX-N.left;M=K.pageY-N.top}if(I0&&M0){o=M;p=I}}).bind("touchmove",function(K){K.preventDefault();K.stopImmediatePropagation();var N=K.originalEvent.touches[0]||K.originalEvent.changedTouches[0],J=c(this),M=J.offset(),I=N.pageX-M.left,L=N.pageY-M.top;G(o,p,L,I)});c(document).bind("mousemove."+l.data("mCustomScrollbarIndex"),function(K){if(l.data("on_drag")){var J=k,M=J.offset(),I=K.pageX-M.left,L=K.pageY-M.top;G(o,p,L,I)}}).bind("mouseup."+l.data("mCustomScrollbarIndex"),function(x){l.data({on_drag:false});k.removeClass("mCSB_dragger_onDrag")})}l.data({bindEvent_scrollbar_drag:true})}function G(J,K,L,I){if(l.data("horizontalScroll")){l.mCustomScrollbar("scrollTo",(k.position().left-(K))+I,{moveDragger:true,trigger:"internal"})}else{l.mCustomScrollbar("scrollTo",(k.position().top-(J))+L,{moveDragger:true,trigger:"internal"})}}if(c.support.touch&&l.data("contentTouchScroll")){if(!l.data("bindEvent_content_touch")){var m,E,s,t,v,F,H;q.bind("touchstart",function(x){x.stopImmediatePropagation();m=x.originalEvent.touches[0]||x.originalEvent.changedTouches[0];E=c(this);s=E.offset();v=m.pageX-s.left;t=m.pageY-s.top;F=t;H=v});q.bind("touchmove",function(x){x.preventDefault();x.stopImmediatePropagation();m=x.originalEvent.touches[0]||x.originalEvent.changedTouches[0];E=c(this).parent();s=E.offset();v=m.pageX-s.left;t=m.pageY-s.top;if(l.data("horizontalScroll")){l.mCustomScrollbar("scrollTo",H-v,{trigger:"internal"})}else{l.mCustomScrollbar("scrollTo",F-t,{trigger:"internal"})}})}}if(!l.data("bindEvent_scrollbar_click")){n.bind("click",function(I){var x=(I.pageY-n.offset().top)*l.data("scrollAmount"),y=c(I.target);if(l.data("horizontalScroll")){x=(I.pageX-n.offset().left)*l.data("scrollAmount")}if(y.hasClass("mCSB_draggerContainer")||y.hasClass("mCSB_draggerRail")){l.mCustomScrollbar("scrollTo",x,{trigger:"internal",scrollEasing:"draggerRailEase"})}});l.data({bindEvent_scrollbar_click:true})}if(l.data("mouseWheel")){if(!l.data("bindEvent_mousewheel")){i.bind("mousewheel",function(K,M){var J,I=l.data("mouseWheelPixels"),x=Math.abs(q.position().top),L=k.position().top,y=n.height()-k.height();if(l.data("normalizeMouseWheelDelta")){if(M<0){M=-1}else{M=1}}if(I==="auto"){I=100+Math.round(l.data("scrollAmount")/2)}if(l.data("horizontalScroll")){L=k.position().left;y=n.width()-k.width();x=Math.abs(q.position().left)}if((M>0&&L!==0)||(M<0&&L!==y)){K.preventDefault();K.stopImmediatePropagation()}J=x-(M*I);l.mCustomScrollbar("scrollTo",J,{trigger:"internal"})});l.data({bindEvent_mousewheel:true})}}if(l.data("scrollButtons_enable")){if(l.data("scrollButtons_scrollType")==="pixels"){if(l.data("horizontalScroll")){w.add(D).unbind("mousedown touchstart MSPointerDown pointerdown mouseup MSPointerUp pointerup mouseout MSPointerOut pointerout touchend",j,h);l.data({bindEvent_buttonsContinuous_x:false});if(!l.data("bindEvent_buttonsPixels_x")){w.bind("click",function(x){x.preventDefault();r(Math.abs(q.position().left)+l.data("scrollButtons_scrollAmount"))});D.bind("click",function(x){x.preventDefault();r(Math.abs(q.position().left)-l.data("scrollButtons_scrollAmount"))});l.data({bindEvent_buttonsPixels_x:true})}}else{f.add(A).unbind("mousedown touchstart MSPointerDown pointerdown mouseup MSPointerUp pointerup mouseout MSPointerOut pointerout touchend",j,h);l.data({bindEvent_buttonsContinuous_y:false});if(!l.data("bindEvent_buttonsPixels_y")){f.bind("click",function(x){x.preventDefault();r(Math.abs(q.position().top)+l.data("scrollButtons_scrollAmount"))});A.bind("click",function(x){x.preventDefault();r(Math.abs(q.position().top)-l.data("scrollButtons_scrollAmount"))});l.data({bindEvent_buttonsPixels_y:true})}}function r(x){if(!k.data("preventAction")){k.data("preventAction",true);l.mCustomScrollbar("scrollTo",x,{trigger:"internal"})}}}else{if(l.data("horizontalScroll")){w.add(D).unbind("click");l.data({bindEvent_buttonsPixels_x:false});if(!l.data("bindEvent_buttonsContinuous_x")){w.bind("mousedown touchstart MSPointerDown pointerdown",function(y){y.preventDefault();var x=B();l.data({mCSB_buttonScrollRight:setInterval(function(){l.mCustomScrollbar("scrollTo",Math.abs(q.position().left)+x,{trigger:"internal",scrollEasing:"easeOutCirc"})},17)})});var j=function(x){x.preventDefault();clearInterval(l.data("mCSB_buttonScrollRight"))};w.bind("mouseup touchend MSPointerUp pointerup mouseout MSPointerOut pointerout",j);D.bind("mousedown touchstart MSPointerDown pointerdown",function(y){y.preventDefault();var x=B();l.data({mCSB_buttonScrollLeft:setInterval(function(){l.mCustomScrollbar("scrollTo",Math.abs(q.position().left)-x,{trigger:"internal",scrollEasing:"easeOutCirc"})},17)})});var h=function(x){x.preventDefault();clearInterval(l.data("mCSB_buttonScrollLeft"))};D.bind("mouseup touchend MSPointerUp pointerup mouseout MSPointerOut pointerout",h);l.data({bindEvent_buttonsContinuous_x:true})}}else{f.add(A).unbind("click");l.data({bindEvent_buttonsPixels_y:false});if(!l.data("bindEvent_buttonsContinuous_y")){f.bind("mousedown touchstart MSPointerDown pointerdown",function(y){y.preventDefault();var x=B();l.data({mCSB_buttonScrollDown:setInterval(function(){l.mCustomScrollbar("scrollTo",Math.abs(q.position().top)+x,{trigger:"internal",scrollEasing:"easeOutCirc"})},17)})});var u=function(x){x.preventDefault();clearInterval(l.data("mCSB_buttonScrollDown"))};f.bind("mouseup touchend MSPointerUp pointerup mouseout MSPointerOut pointerout",u);A.bind("mousedown touchstart MSPointerDown pointerdown",function(y){y.preventDefault();var x=B();l.data({mCSB_buttonScrollUp:setInterval(function(){l.mCustomScrollbar("scrollTo",Math.abs(q.position().top)-x,{trigger:"internal",scrollEasing:"easeOutCirc"})},17)})});var g=function(x){x.preventDefault();clearInterval(l.data("mCSB_buttonScrollUp"))};A.bind("mouseup touchend MSPointerUp pointerup mouseout MSPointerOut pointerout",g);l.data({bindEvent_buttonsContinuous_y:true})}}function B(){var x=l.data("scrollButtons_scrollSpeed");if(l.data("scrollButtons_scrollSpeed")==="auto"){x=Math.round((l.data("scrollInertia")+100)/40)}return x}}}if(l.data("autoScrollOnFocus")){if(!l.data("bindEvent_focusin")){i.bind("focusin",function(){i.scrollTop(0).scrollLeft(0);var x=c(document.activeElement);if(x.is("input,textarea,select,button,a[tabindex],area,object")){var J=q.position().top,y=x.position().top,I=i.height()-x.outerHeight();if(l.data("horizontalScroll")){J=q.position().left;y=x.position().left;I=i.width()-x.outerWidth()}if(J+y<0||J+y>I){l.mCustomScrollbar("scrollTo",y,{trigger:"internal"})}}});l.data({bindEvent_focusin:true})}}if(l.data("autoHideScrollbar")&&!l.data("alwaysShowScrollbar")){if(!l.data("bindEvent_autoHideScrollbar")){i.bind("mouseenter",function(x){i.addClass("mCS-mouse-over");d.showScrollbar.call(i.children(".mCSB_scrollTools"))}).bind("mouseleave touchend",function(x){i.removeClass("mCS-mouse-over");if(x.type==="mouseleave"){d.hideScrollbar.call(i.children(".mCSB_scrollTools"))}});l.data({bindEvent_autoHideScrollbar:true})}}},scrollTo:function(e,f){var i=c(this),o={moveDragger:false,trigger:"external",callbacks:true,scrollInertia:i.data("scrollInertia"),scrollEasing:i.data("scrollEasing")},f=c.extend(o,f),p,g=i.children(".mCustomScrollBox"),k=g.children(".mCSB_container"),r=g.children(".mCSB_scrollTools"),j=r.children(".mCSB_draggerContainer"),h=j.children(".mCSB_dragger"),t=draggerSpeed=f.scrollInertia,q,s,m,l;if(!k.hasClass("mCS_no_scrollbar")){i.data({mCS_trigger:f.trigger});if(i.data("mCS_Init")){f.callbacks=false}if(e||e===0){if(typeof(e)==="number"){if(f.moveDragger){p=e;if(i.data("horizontalScroll")){e=h.position().left*i.data("scrollAmount")}else{e=h.position().top*i.data("scrollAmount")}draggerSpeed=0}else{p=e/i.data("scrollAmount")}}else{if(typeof(e)==="string"){var v;if(e==="top"){v=0}else{if(e==="bottom"&&!i.data("horizontalScroll")){v=k.outerHeight()-g.height()}else{if(e==="left"){v=0}else{if(e==="right"&&i.data("horizontalScroll")){v=k.outerWidth()-g.width()}else{if(e==="first"){v=i.find(".mCSB_container").find(":first")}else{if(e==="last"){v=i.find(".mCSB_container").find(":last")}else{v=i.find(e)}}}}}}if(v.length===1){if(i.data("horizontalScroll")){e=v.position().left}else{e=v.position().top}p=e/i.data("scrollAmount")}else{p=e=v}}}if(i.data("horizontalScroll")){if(i.data("onTotalScrollBack_Offset")){s=-i.data("onTotalScrollBack_Offset")}if(i.data("onTotalScroll_Offset")){l=g.width()-k.outerWidth()+i.data("onTotalScroll_Offset")}if(p<0){p=e=0;clearInterval(i.data("mCSB_buttonScrollLeft"));if(!s){q=true}}else{if(p>=j.width()-h.width()){p=j.width()-h.width();e=g.width()-k.outerWidth();clearInterval(i.data("mCSB_buttonScrollRight"));if(!l){m=true}}else{e=-e}}var n=i.data("snapAmount");if(n){e=Math.round(e/n)*n-i.data("snapOffset")}d.mTweenAxis.call(this,h[0],"left",Math.round(p),draggerSpeed,f.scrollEasing);d.mTweenAxis.call(this,k[0],"left",Math.round(e),t,f.scrollEasing,{onStart:function(){if(f.callbacks&&!i.data("mCS_tweenRunning")){u("onScrollStart")}if(i.data("autoHideScrollbar")&&!i.data("alwaysShowScrollbar")){d.showScrollbar.call(r)}},onUpdate:function(){if(f.callbacks){u("whileScrolling")}},onComplete:function(){if(f.callbacks){u("onScroll");if(q||(s&&k.position().left>=s)){u("onTotalScrollBack")}if(m||(l&&k.position().left<=l)){u("onTotalScroll")}}h.data("preventAction",false);i.data("mCS_tweenRunning",false);if(i.data("autoHideScrollbar")&&!i.data("alwaysShowScrollbar")){if(!g.hasClass("mCS-mouse-over")){d.hideScrollbar.call(r)}}}})}else{if(i.data("onTotalScrollBack_Offset")){s=-i.data("onTotalScrollBack_Offset")}if(i.data("onTotalScroll_Offset")){l=g.height()-k.outerHeight()+i.data("onTotalScroll_Offset")}if(p<0){p=e=0;clearInterval(i.data("mCSB_buttonScrollUp"));if(!s){q=true}}else{if(p>=j.height()-h.height()){p=j.height()-h.height();e=g.height()-k.outerHeight();clearInterval(i.data("mCSB_buttonScrollDown"));if(!l){m=true}}else{e=-e}}var n=i.data("snapAmount");if(n){e=Math.round(e/n)*n-i.data("snapOffset")}d.mTweenAxis.call(this,h[0],"top",Math.round(p),draggerSpeed,f.scrollEasing);d.mTweenAxis.call(this,k[0],"top",Math.round(e),t,f.scrollEasing,{onStart:function(){if(f.callbacks&&!i.data("mCS_tweenRunning")){u("onScrollStart")}if(i.data("autoHideScrollbar")&&!i.data("alwaysShowScrollbar")){d.showScrollbar.call(r)}},onUpdate:function(){if(f.callbacks){u("whileScrolling")}},onComplete:function(){if(f.callbacks){u("onScroll");if(q||(s&&k.position().top>=s)){u("onTotalScrollBack")}if(m||(l&&k.position().top<=l)){u("onTotalScroll")}}h.data("preventAction",false);i.data("mCS_tweenRunning",false);if(i.data("autoHideScrollbar")&&!i.data("alwaysShowScrollbar")){if(!g.hasClass("mCS-mouse-over")){d.hideScrollbar.call(r)}}}})}if(i.data("mCS_Init")){i.data({mCS_Init:false})}}}function u(w){if(i.data("mCustomScrollbarIndex")){this.mcs={top:k.position().top,left:k.position().left,draggerTop:h.position().top,draggerLeft:h.position().left,topPct:Math.round((100*Math.abs(k.position().top))/Math.abs(k.outerHeight()-g.height())),leftPct:Math.round((100*Math.abs(k.position().left))/Math.abs(k.outerWidth()-g.width()))};switch(w){case"onScrollStart":i.data("mCS_tweenRunning",true).data("onScrollStart_Callback").call(i,this.mcs);break;case"whileScrolling":i.data("whileScrolling_Callback").call(i,this.mcs);break;case"onScroll":i.data("onScroll_Callback").call(i,this.mcs);break;case"onTotalScrollBack":i.data("onTotalScrollBack_Callback").call(i,this.mcs);break;case"onTotalScroll":i.data("onTotalScroll_Callback").call(i,this.mcs);break}}}},stop:function(){var g=c(this),e=g.children().children(".mCSB_container"),f=g.children().children().children().children(".mCSB_dragger");d.mTweenAxisStop.call(this,e[0]);d.mTweenAxisStop.call(this,f[0])},disable:function(e){var j=c(this),f=j.children(".mCustomScrollBox"),h=f.children(".mCSB_container"),g=f.children(".mCSB_scrollTools"),i=g.children().children(".mCSB_dragger");f.unbind("mousewheel focusin mouseenter mouseleave touchend");h.unbind("touchstart touchmove");if(e){if(j.data("horizontalScroll")){i.add(h).css("left",0)}else{i.add(h).css("top",0)}}g.css("display","none");h.addClass("mCS_no_scrollbar");j.data({bindEvent_mousewheel:false,bindEvent_focusin:false,bindEvent_content_touch:false,bindEvent_autoHideScrollbar:false}).addClass("mCS_disabled")},destroy:function(){var e=c(this);e.removeClass("mCustomScrollbar _mCS_"+e.data("mCustomScrollbarIndex")).addClass("mCS_destroyed").children().children(".mCSB_container").unwrap().children().unwrap().siblings(".mCSB_scrollTools").remove();c(document).unbind("mousemove."+e.data("mCustomScrollbarIndex")+" mouseup."+e.data("mCustomScrollbarIndex")+" MSPointerMove."+e.data("mCustomScrollbarIndex")+" MSPointerUp."+e.data("mCustomScrollbarIndex"));c(window).unbind("resize."+e.data("mCustomScrollbarIndex"))}},d={showScrollbar:function(){this.stop().animate({opacity:1},"fast")},hideScrollbar:function(){this.stop().animate({opacity:0},"fast")},mTweenAxis:function(g,i,h,f,o,y){var y=y||{},v=y.onStart||function(){},p=y.onUpdate||function(){},w=y.onComplete||function(){};var n=t(),l,j=0,r=g.offsetTop,s=g.style;if(i==="left"){r=g.offsetLeft}var m=h-r;q();e();function t(){if(window.performance&&window.performance.now){return window.performance.now()}else{if(window.performance&&window.performance.webkitNow){return window.performance.webkitNow()}else{if(Date.now){return Date.now()}else{return new Date().getTime()}}}}function x(){if(!j){v.call()}j=t()-n;u();if(j>=g._time){g._time=(j>g._time)?j+l-(j-g._time):j+l-1;if(g._time0){g.currVal=k(g._time,r,m,f,o);s[i]=Math.round(g.currVal)+"px"}else{s[i]=h+"px"}p.call()}function e(){l=1000/60;g._time=j+l;_request=(!window.requestAnimationFrame)?function(z){u();return setTimeout(z,0.01)}:window.requestAnimationFrame;g._id=_request(x)}function q(){if(g._id==null){return}if(!window.requestAnimationFrame){clearTimeout(g._id)}else{window.cancelAnimationFrame(g._id)}g._id=null}function k(B,A,F,E,C){switch(C){case"linear":return F*B/E+A;break;case"easeOutQuad":B/=E;return -F*B*(B-2)+A;break;case"easeInOutQuad":B/=E/2;if(B<1){return F/2*B*B+A}B--;return -F/2*(B*(B-2)-1)+A;break;case"easeOutCubic":B/=E;B--;return F*(B*B*B+1)+A;break;case"easeOutQuart":B/=E;B--;return -F*(B*B*B*B-1)+A;break;case"easeOutQuint":B/=E;B--;return F*(B*B*B*B*B+1)+A;break;case"easeOutCirc":B/=E;B--;return F*Math.sqrt(1-B*B)+A;break;case"easeOutSine":return F*Math.sin(B/E*(Math.PI/2))+A;break;case"easeOutExpo":return F*(-Math.pow(2,-10*B/E)+1)+A;break;case"mcsEaseOut":var D=(B/=E)*B,z=D*B;return A+F*(0.499999999999997*z*D+-2.5*D*D+5.5*z+-6.5*D+4*B);break;case"draggerRailEase":B/=E/2;if(B<1){return F/2*B*B*B+A}B-=2;return F/2*(B*B*B+2)+A;break}}},mTweenAxisStop:function(e){if(e._id==null){return}if(!window.requestAnimationFrame){clearTimeout(e._id)}else{window.cancelAnimationFrame(e._id)}e._id=null},rafPolyfill:function(){var f=["ms","moz","webkit","o"],e=f.length;while(--e>-1&&!window.requestAnimationFrame){window.requestAnimationFrame=window[f[e]+"RequestAnimationFrame"];window.cancelAnimationFrame=window[f[e]+"CancelAnimationFrame"]||window[f[e]+"CancelRequestAnimationFrame"]}}};d.rafPolyfill.call();c.support.touch=!!("ontouchstart" in window);c.support.pointer=window.navigator.pointerEnabled;c.support.msPointer=window.navigator.msPointerEnabled;var a=("https:"==document.location.protocol)?"https:":"http:";c.event.special.mousewheel||document.write(' diff --git a/app/views/users/REMOVED~ b/app/views/users/REMOVED~ new file mode 100644 index 00000000..e69de29b diff --git a/app/views/users/edit.html.erb b/app/views/users/edit.html.erb index 5de14fc8..d98d6d96 100644 --- a/app/views/users/edit.html.erb +++ b/app/views/users/edit.html.erb @@ -5,58 +5,10 @@ #%> <% content_for :title, @user.name + "'s Settings | Metamaps" %> - +<%= formula_form_for @user, url: user_url do |form| %>

Your Settings

-<%= formula_form_for @user, url: user_url do |form| %> -

Choose Active Metacodes

-
Show AllHide All
-
-
-
    - <% $i = 0 %> - <% @m = Metacode.order("name").all %> - <% while $i < (Metacode.all.length / 4) do %> -
  • class="toggledOff"<% end %> > - <%= @m[$i].name %> -

    <%= @m[$i].name.downcase %>

    -
    -
  • - <% $i += 1 %> - <% end %> -
-
    - <% while $i < (Metacode.all.length / 4 * 2) do %> -
  • class="toggledOff"<% end %> > - <%= @m[$i].name %> -

    <%= @m[$i].name.downcase %>

    -
    -
  • - <% $i += 1 %> - <% end %> -
-
    - <% while $i < (Metacode.all.length / 4 * 3) do %> -
  • class="toggledOff"<% end %> > - <%= @m[$i].name %> -

    <%= @m[$i].name.downcase %>

    -
    -
  • - <% $i += 1 %> - <% end %> -
-
    - <% while $i < Metacode.all.length do %> -
  • class="toggledOff"<% end %> > - <%= @m[$i].name %> -

    <%= @m[$i].name.downcase %>

    -
    -
  • - <% $i += 1 %> - <% end %> -
-
-
+

Edit Account

<%= form.input :name, label: "Name", class: "name" %> <%= form.input :email, label: "Email", class: "email" %> @@ -65,51 +17,3 @@ <%= form.submit "Update", class: "update" %> <% end %> - diff --git a/app/views/users/edit.html.erb~ b/app/views/users/edit.html.erb~ new file mode 100644 index 00000000..8576aa0e --- /dev/null +++ b/app/views/users/edit.html.erb~ @@ -0,0 +1,20 @@ +<%# + # @file + # /users/:id/edit + # User edit form + #%> + +<% content_for :title, @user.name + "'s Settings | Metamaps" %> + +

Your Settings

+ + +

Edit Account

+ <%= form.input :name, label: "Name", class: "name" %> + <%= form.input :email, label: "Email", class: "email" %> + <%= form.input :password, label: "Password", class: "password" %> + <%= hidden_field(:metacodes, :value, {:value => 0}) %> + <%= form.submit "Update", class: "update" %> +<% end %> + + From 0e25fb4cdb4dfbc873a42ce7cb521eec9849acdf Mon Sep 17 00:00:00 2001 From: Raymon Johnstone Date: Wed, 14 May 2014 16:51:16 -0400 Subject: [PATCH 4/7] removed backup files as well as further mods for settings page --- app/controllers/users_controller.rb | 4 +- app/controllers/users_controller.rb~ | 26 +++ app/views/users/edit.html.erb | 1 - app/views/users/edit.html.erb~ | 3 +- config/initializers/devise.rb~ | 244 +++++++++++++++++++++++++++ 5 files changed, 273 insertions(+), 5 deletions(-) create mode 100644 app/controllers/users_controller.rb~ create mode 100644 config/initializers/devise.rb~ diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index a554b810..7fb6b110 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -16,8 +16,8 @@ class UsersController < ApplicationController @user = current_user @user.attributes = params[:user] - @m = params[:metacodes][:value] - @user.settings.metacodes=@m.split(',') + #@m = params[:metacodes][:value] + #@user.settings.metacodes=@m.split(',') @user.save diff --git a/app/controllers/users_controller.rb~ b/app/controllers/users_controller.rb~ new file mode 100644 index 00000000..799e3cc9 --- /dev/null +++ b/app/controllers/users_controller.rb~ @@ -0,0 +1,26 @@ +class UsersController < ApplicationController + + before_filter :require_user, only: [:edit, :update] + + respond_to :html, :json + + # GET /user/edit + def edit + @user = current_user + + respond_with(@user) + end + + # PUT /user + def update + @user = current_user + @user.attributes = params[:user] + + + @user.save + + respond_with(@user, location: session[:previous_url]) do |format| + end + end + +end diff --git a/app/views/users/edit.html.erb b/app/views/users/edit.html.erb index d98d6d96..e2a4072b 100644 --- a/app/views/users/edit.html.erb +++ b/app/views/users/edit.html.erb @@ -13,7 +13,6 @@ <%= form.input :name, label: "Name", class: "name" %> <%= form.input :email, label: "Email", class: "email" %> <%= form.input :password, label: "Password", class: "password" %> - <%= hidden_field(:metacodes, :value, {:value => 0}) %> <%= form.submit "Update", class: "update" %> <% end %> diff --git a/app/views/users/edit.html.erb~ b/app/views/users/edit.html.erb~ index 8576aa0e..d98d6d96 100644 --- a/app/views/users/edit.html.erb~ +++ b/app/views/users/edit.html.erb~ @@ -5,7 +5,7 @@ #%> <% content_for :title, @user.name + "'s Settings | Metamaps" %> - +<%= formula_form_for @user, url: user_url do |form| %>

Your Settings

@@ -17,4 +17,3 @@ <%= form.submit "Update", class: "update" %> <% end %> - diff --git a/config/initializers/devise.rb~ b/config/initializers/devise.rb~ new file mode 100644 index 00000000..7b8b7510 --- /dev/null +++ b/config/initializers/devise.rb~ @@ -0,0 +1,244 @@ +# Use this hook to configure devise mailer, warden hooks and so forth. +# Many of these configuration options can be set straight in your model. +Devise.setup do |config| + # ==> Mailer Configuration + # Configure the e-mail address which will be shown in Devise::Mailer, + # note that it will be overwritten if you use your own mailer class with default "from" parameter. + config.mailer_sender = "team@metamaps.cc" + + # Configure the class responsible to send e-mails. + # config.mailer = "Devise::Mailer" + + if Rails.env.production? + #config.secret_key = 'd91ba0da95749174ee2b8922034783cbde4945409ed28b13383e18e72844beb74467f8199e9e216f0687cd2290c6e46bf74da24486d14bba3671d76c5b10c753' + end + + # ==> ORM configuration + # Load and configure the ORM. Supports :active_record (default) and + # :mongoid (bson_ext recommended) by default. Other ORMs may be + # available as additional gems. + require 'devise/orm/active_record' + + # ==> Configuration for any authentication mechanism + # Configure which keys are used when authenticating a user. The default is + # just :email. You can configure it to use [:username, :subdomain], so for + # authenticating a user, both parameters are required. Remember that those + # parameters are used only when authenticating and not when retrieving from + # session. If you need permissions, you should implement that in a before filter. + # You can also supply a hash where the value is a boolean determining whether + # or not authentication should be aborted when the value is not present. + # config.authentication_keys = [ :email ] + + # Configure parameters from the request object used for authentication. Each entry + # given should be a request method and it will automatically be passed to the + # find_for_authentication method and considered in your model lookup. For instance, + # if you set :request_keys to [:subdomain], :subdomain will be used on authentication. + # The same considerations mentioned for authentication_keys also apply to request_keys. + # config.request_keys = [] + + # Configure which authentication keys should be case-insensitive. + # These keys will be downcased upon creating or modifying a user and when used + # to authenticate or find a user. Default is :email. + config.case_insensitive_keys = [ :email ] + + # Configure which authentication keys should have whitespace stripped. + # These keys will have whitespace before and after removed upon creating or + # modifying a user and when used to authenticate or find a user. Default is :email. + config.strip_whitespace_keys = [ :email ] + + # Tell if authentication through request.params is enabled. True by default. + # It can be set to an array that will enable params authentication only for the + # given strategies, for example, `config.params_authenticatable = [:database]` will + # enable it only for database (email + password) authentication. + # config.params_authenticatable = true + + # Tell if authentication through HTTP Basic Auth is enabled. False by default. + # It can be set to an array that will enable http authentication only for the + # given strategies, for example, `config.http_authenticatable = [:token]` will + # enable it only for token authentication. + # config.http_authenticatable = false + + # If http headers should be returned for AJAX requests. True by default. + # config.http_authenticatable_on_xhr = true + + # The realm used in Http Basic Authentication. "Application" by default. + # config.http_authentication_realm = "Application" + + # It will change confirmation, password recovery and other workflows + # to behave the same regardless if the e-mail provided was right or wrong. + # Does not affect registerable. + # config.paranoid = true + + # By default Devise will store the user in session. You can skip storage for + # :http_auth and :token_auth by adding those symbols to the array below. + # Notice that if you are skipping storage for all authentication paths, you + # may want to disable generating routes to Devise's sessions controller by + # passing :skip => :sessions to `devise_for` in your config/routes.rb + config.skip_session_storage = [:http_auth] + + # ==> Configuration for :database_authenticatable + # For bcrypt, this is the cost for hashing the password and defaults to 10. If + # using other encryptors, it sets how many times you want the password re-encrypted. + # + # Limiting the stretches to just one in testing will increase the performance of + # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use + # a value less than 10 in other environments. + config.stretches = Rails.env.test? ? 1 : 10 + + # Setup a pepper to generate the encrypted password. + # config.pepper = "640ad415cb5292ac9ddbfa6ad7d9653d1537f1184e4037c2453db3eccb98e1c82facc6d3de7bf9d4c41d9967d41194c6e120f36f430e195ba840cd00e02dea59" + + # ==> Configuration for :confirmable + # A period that the user is allowed to access the website even without + # confirming his account. For instance, if set to 2.days, the user will be + # able to access the website for two days without confirming his account, + # access will be blocked just in the third day. Default is 0.days, meaning + # the user cannot access the website without confirming his account. + # config.allow_unconfirmed_access_for = 2.days + + # A period that the user is allowed to confirm their account before their + # token becomes invalid. For example, if set to 3.days, the user can confirm + # their account within 3 days after the mail was sent, but on the fourth day + # their account can't be confirmed with the token any more. + # Default is nil, meaning there is no restriction on how long a user can take + # before confirming their account. + # config.confirm_within = 3.days + + # If true, requires any email changes to be confirmed (exactly the same way as + # initial account confirmation) to be applied. Requires additional unconfirmed_email + # db field (see migrations). Until confirmed new email is stored in + # unconfirmed email column, and copied to email column on successful confirmation. + config.reconfirmable = true + + # Defines which key will be used when confirming an account + # config.confirmation_keys = [ :email ] + + # ==> Configuration for :rememberable + # The time the user will be remembered without asking for credentials again. + config.remember_for = 2.weeks + + # If true, extends the user's remember period when remembered via cookie. + # config.extend_remember_period = false + + # Options to be passed to the created cookie. For instance, you can set + # :secure => true in order to force SSL only cookies. + # config.rememberable_options = {} + + # ==> Configuration for :validatable + # Range for password length. Default is 8..128. + config.password_length = 8..128 + + # Email regex used to validate email formats. It simply asserts that + # an one (and only one) @ exists in the given string. This is mainly + # to give user feedback and not to assert the e-mail validity. + # config.email_regexp = /\A[^@]+@[^@]+\z/ + + # ==> Configuration for :timeoutable + # The time you want to timeout the user session without activity. After this + # time the user will be asked for credentials again. Default is 30 minutes. + # config.timeout_in = 30.minutes + + # If true, expires auth token on session timeout. + # config.expire_auth_token_on_timeout = false + + # ==> Configuration for :lockable + # Defines which strategy will be used to lock an account. + # :failed_attempts = Locks an account after a number of failed attempts to sign in. + # :none = No lock strategy. You should handle locking by yourself. + # config.lock_strategy = :failed_attempts + + # Defines which key will be used when locking and unlocking an account + # config.unlock_keys = [ :email ] + + # Defines which strategy will be used to unlock an account. + # :email = Sends an unlock link to the user email + # :time = Re-enables login after a certain amount of time (see :unlock_in below) + # :both = Enables both strategies + # :none = No unlock strategy. You should handle unlocking by yourself. + # config.unlock_strategy = :both + + # Number of authentication tries before locking an account if lock_strategy + # is failed attempts. + # config.maximum_attempts = 20 + + # Time interval to unlock the account if :time is enabled as unlock_strategy. + # config.unlock_in = 1.hour + + # ==> Configuration for :recoverable + # + # Defines which key will be used when recovering the password for an account + # config.reset_password_keys = [ :email ] + + # Time interval you can reset your password with a reset password key. + # Don't put a too small interval or your users won't have the time to + # change their passwords. + config.reset_password_within = 24.hours + + # ==> Configuration for :encryptable + # Allow you to use another encryption algorithm besides bcrypt (default). You can use + # :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1, + # :authlogic_sha512 (then you should set stretches above to 20 for default behavior) + # and :restful_authentication_sha1 (then you should set stretches to 10, and copy + # REST_AUTH_SITE_KEY to pepper) + # config.encryptor = :sha512 + + # ==> Configuration for :token_authenticatable + # Defines name of the authentication token params key + # config.token_authentication_key = :auth_token + + # ==> Scopes configuration + # Turn scoped views on. Before rendering "sessions/new", it will first check for + # "users/sessions/new". It's turned off by default because it's slower if you + # are using only default views. + config.scoped_views = true + + # Configure the default scope given to Warden. By default it's the first + # devise role declared in your routes (usually :user). + # config.default_scope = :user + + # Set this configuration to false if you want /users/sign_out to sign out + # only the current scope. By default, Devise signs out all scopes. + # config.sign_out_all_scopes = false + + # ==> Navigation configuration + # Lists the formats that should be treated as navigational. Formats like + # :html, should redirect to the sign in page when the user does not have + # access, but formats like :xml or :json, should return 401. + # + # If you have any extra navigational formats, like :iphone or :mobile, you + # should add them to the navigational formats lists. + # + # The "*/*" below is required to match Internet Explorer requests. + # config.navigational_formats = ["*/*", :html] + + # The default HTTP method used to sign out a resource. Default is :delete. + config.sign_out_via = :delete + + # ==> OmniAuth + # Add a new OmniAuth provider. Check the wiki for more information on setting + # up on your models and hooks. + # config.omniauth :github, 'APP_ID', 'APP_SECRET', :scope => 'user,public_repo' + + # ==> Warden configuration + # If you want to use other strategies, that are not supported by Devise, or + # change the failure app, you can configure them inside the config.warden block. + # + # config.warden do |manager| + # manager.intercept_401 = false + # manager.default_strategies(:scope => :user).unshift :some_external_strategy + # end + + # ==> Mountable engine configurations + # When using Devise inside an engine, let's call it `MyEngine`, and this engine + # is mountable, there are some extra configurations to be taken into account. + # The following options are available, assuming the engine is mounted as: + # + # mount MyEngine, at: "/my_engine" + # + # The router that invoked `devise_for`, in the example above, would be: + # config.router_name = :my_engine + # + # When using omniauth, Devise cannot automatically set Omniauth path, + # so you need to do it manually. For the users scope, it would be: + # config.omniauth_path_prefix = "/my_engine/users/auth" +end From dc6295328a903df61ce9cdc0ce83a59e225421b9 Mon Sep 17 00:00:00 2001 From: Raymon Johnstone Date: Thu, 15 May 2014 18:28:30 -0400 Subject: [PATCH 5/7] Fixed issue where setting your settings would log you out. --- app/controllers/users_controller.rb | 4 +++- app/controllers/users_controller.rb~ | 7 +++++-- app/views/users/REMOVED | 4 ++++ app/views/users/edit.html.erb | 1 + app/views/users/edit.html.erb~ | 2 +- config/initializers/devise.rb~ | 4 ++-- 6 files changed, 16 insertions(+), 6 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 7fb6b110..203ee909 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -20,7 +20,9 @@ class UsersController < ApplicationController #@user.settings.metacodes=@m.split(',') @user.save - + + sign_in(@user, :bypass => true) + respond_with(@user, location: session[:previous_url]) do |format| end end diff --git a/app/controllers/users_controller.rb~ b/app/controllers/users_controller.rb~ index 799e3cc9..7e2ea491 100644 --- a/app/controllers/users_controller.rb~ +++ b/app/controllers/users_controller.rb~ @@ -16,9 +16,12 @@ class UsersController < ApplicationController @user = current_user @user.attributes = params[:user] - - @user.save + #@m = params[:metacodes][:value] + #@user.settings.metacodes=@m.split(',') + @user.save + + respond_with(@user, location: session[:previous_url]) do |format| end end diff --git a/app/views/users/REMOVED b/app/views/users/REMOVED index 64aba5e9..3307ca1a 100644 --- a/app/views/users/REMOVED +++ b/app/views/users/REMOVED @@ -95,3 +95,7 @@ $(document).ready(function() { }); + +FROM USERS CONTROLLER> +@m = params[:metacodes][:value] + @user.settings.metacodes=@m.split(',') diff --git a/app/views/users/edit.html.erb b/app/views/users/edit.html.erb index e2a4072b..1e21f9ff 100644 --- a/app/views/users/edit.html.erb +++ b/app/views/users/edit.html.erb @@ -14,5 +14,6 @@ <%= form.input :email, label: "Email", class: "email" %> <%= form.input :password, label: "Password", class: "password" %> <%= form.submit "Update", class: "update" %> + <% end %> diff --git a/app/views/users/edit.html.erb~ b/app/views/users/edit.html.erb~ index d98d6d96..0477ee56 100644 --- a/app/views/users/edit.html.erb~ +++ b/app/views/users/edit.html.erb~ @@ -13,7 +13,7 @@ <%= form.input :name, label: "Name", class: "name" %> <%= form.input :email, label: "Email", class: "email" %> <%= form.input :password, label: "Password", class: "password" %> - <%= hidden_field(:metacodes, :value, {:value => 0}) %> <%= form.submit "Update", class: "update" %> + <% :bypass=>true to sign_in(@user) %> <% end %> diff --git a/config/initializers/devise.rb~ b/config/initializers/devise.rb~ index 7b8b7510..8d8712bd 100644 --- a/config/initializers/devise.rb~ +++ b/config/initializers/devise.rb~ @@ -122,7 +122,7 @@ Devise.setup do |config| # Options to be passed to the created cookie. For instance, you can set # :secure => true in order to force SSL only cookies. - # config.rememberable_options = {} + config.rememberable_options = true # ==> Configuration for :validatable # Range for password length. Default is 8..128. @@ -198,7 +198,7 @@ Devise.setup do |config| # Set this configuration to false if you want /users/sign_out to sign out # only the current scope. By default, Devise signs out all scopes. - # config.sign_out_all_scopes = false + # config.sign_out_all_scopes = true # ==> Navigation configuration # Lists the formats that should be treated as navigational. Formats like From b9b226fea67d1dd06b736c88dbd29cfbaf26ca04 Mon Sep 17 00:00:00 2001 From: Raymon Johnstone Date: Sat, 17 May 2014 16:04:23 -0400 Subject: [PATCH 6/7] removed extra files --- app/assets/javascripts/application.js~ | 804 ------------------ .../scroll/jquery.mCustomScrollbar.min.js~ | 1 - app/views/main/paq.html.erb~ | 78 -- app/views/users/REMOVED | 101 --- app/views/users/REMOVED~ | 0 config/database.yml.default | 21 - 6 files changed, 1005 deletions(-) delete mode 100644 app/assets/javascripts/application.js~ delete mode 100644 app/assets/javascripts/scroll/jquery.mCustomScrollbar.min.js~ delete mode 100644 app/views/main/paq.html.erb~ delete mode 100644 app/views/users/REMOVED delete mode 100644 app/views/users/REMOVED~ delete mode 100644 config/database.yml.default diff --git a/app/assets/javascripts/application.js~ b/app/assets/javascripts/application.js~ deleted file mode 100644 index dcf5ab0a..00000000 --- a/app/assets/javascripts/application.js~ +++ /dev/null @@ -1,804 +0,0 @@ -// 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 autocomplete-rails-uncompressed -// -//= require jquery -//= require jquery-ui -//= require jquery.purr -//= require jquery.lettering -//= require jquery.textillate -//= require jquery.roundabout.min -//= require best_in_place -//= require jquery_ujs -//= require_tree . - -// other options are 'graph' -var viewMode = "list"; - -var labelType, useGradients, nativeTextSupport, animate, json, Mconsole = null, gType, tempNode = null, tempInit = false, tempNode2 = null, metacodeIMGinit = false, goRealtime = false, mapid = null, mapperm = false, touchPos, touchDragNode, mouseIsDown = false; - - $(document).ready(function() { - - function bindMainMenuHover() { - - var menuIsOpen = false - - // controls the sliding hover of the bottom left menu - var sliding1 = false; - var lT; - - var closeMenu = function() { - lT = setTimeout(function() { - if (! sliding1) { - sliding1 = true; - // $('.footer .menu').animate({ - // height: '0px' - // }, 300, function() { - // sliding1 = false; - // menuIsOpen = false; - // }); - $('.footer').css('border-top-right-radius','5px'); - $('.logo').animate({ - 'background-position-x':'-10px' - }, 200); - $('.footer .menu').fadeOut(200, function() { - sliding1 = false; - menuIsOpen = false; - }); - } - },500); - } - - var openMenu = function() { - clearTimeout(lT); - if (! sliding1) { - sliding1 = true; - - // $('.footer .menu').animate({ - // height: listLength + 'px' - // }, 300, function() { - // sliding1 = false; - // }); - $('.footer').css('border-top-right-radius','0'); - $('.logo').animate({ - 'background-position-x':'-7px' - }, 200); - $('.footer .menu').fadeIn(200, function() { - sliding1 = false; - }); - } - } - // bind the hover events - $(".logo").hover(openMenu, closeMenu); - - // when on touch screen, make touching on the logo do what hovering does on desktop - $("#mainTitle a").bind('touchend', function(evt) { - if (!menuIsOpen) { - openMenu(); - evt.preventDefault(); - evt.stopPropagation(); - } - }); - } - - function bindSearchHover() { - - var searchIsOpen = false - - // controls the sliding hover of the search - var sliding1 = false; - var lT; - - var openSearch = function() { - clearTimeout(lT); - if (!sliding1 && !searchIsOpen) { - hideCards(); - sliding1 = true; - $('.sidebarSearch .twitter-typeahead, .sidebarSearch .tt-hint, .sidebarSearchField').animate({ - width: '200px' - }, 200, function() { - $('.sidebarSearchField, .sidebarSearch .tt-hint').css({padding:'5px 10px', width:'180px'}); - $('.sidebarSearchField').focus(); - sliding1 = false - searchIsOpen = true; - }); - } - } - var closeSearch = function(closeAfter) { - lT = setTimeout(function() { - if (!sliding1 && searchIsOpen && $('.sidebarSearchField').val() == '') { - sliding1 = true; - $('.sidebarSearchField, .sidebarSearch .tt-hint').css({padding:'5px 0', width:'200px'}); - $('.sidebarSearch .twitter-typeahead, .sidebarSearch .tt-hint, .sidebarSearchField').animate({ - width: '0' - }, 200, function() { - $('.sidebarSearchField').typeahead('setQuery',''); - sliding1 = false; - searchIsOpen = false; - }); - } - },closeAfter); - } - - // bind the hover events - $(".sidebarSearch").hover(function(){ openSearch() }, function() { closeSearch(800) }); - - $('.sidebarSearchIcon').click(function(e) { - $('.sidebarSearchField').focus(); - }); - $('.sidebarSearch').click(function(e) { - e.stopPropagation(); - }); - $('body').click(function(e) { - closeSearch(0); - }); - - // if the search is closed and user hits SHIFT+S - $('body').bind('keyup', function(e) { - switch(e.which) { - case 83: - if (e.shiftKey && !searchIsOpen) { - openSearch(); - } - break; - default: break; //console.log(e.which); - } - }); - - // initialize the search box autocomplete results - var mapheader = userid ? '

Maps

' : '

Maps

'; - var topicheader = userid ? '

Topics

' : '

Topics

'; - $('.sidebarSearchField').typeahead([ - { - name: 'topics', - dupChecker: function (datum1,datum2) { - return false; - }, - template: $('.topicTemplate').html(), - remote: { - url: '/search/topics?term=%QUERY', - replace: function () { - var q = '/search/topics?term=' + $('.sidebarSearchField').val(); - if ($("#limitTopicsToMe").is(':checked')) { - q += "&user=" + userid.toString(); - } - return q; - }, - filter: function(dataset) { - if (dataset.length == 0) { - dataset.push({ - value: "No results", - label: "No results", - typeImageURL: "/assets/wildcard.png", - rtype: "noresult" - }); - } - return dataset; - } - }, - engine: Hogan, - header: topicheader - }, - { - name: 'maps', - dupChecker: function (datum1,datum2) { - return false; - }, - template: $('.mapTemplate').html(), - remote: { - url: '/search/maps?term=%QUERY', - replace: function () { - var q = '/search/maps?term=' + $('.sidebarSearchField').val(); - if ($("#limitMapsToMe").is(':checked')) { - q += "&user=" + userid.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 - }, - { - name: 'mappers', - dupChecker: function (datum1,datum2) { - return false; - }, - template: $('.mapperTemplate').html(), - remote: { - url: '/search/mappers?term=%QUERY', - filter: function(dataset) { - if (dataset.length == 0) { - dataset.push({ - value: "No results", - label: "No results", - rtype: "noresult" - }); - } - return dataset; - } - }, - engine: Hogan, - header: '

Mappers

' - } - ]); - // tell the autocomplete to launch a new tab with the topic, map, or mapper you clicked on - $('.sidebarSearchField').bind('typeahead:selected', function (event, datum, dataset) { - console.log(event); - if (datum.rtype != "noresult") { - var win; - if (dataset == "topics") { - win=window.open('/topics/' + datum.id, '_blank'); - } - else if (dataset == "maps") { - win=window.open('/maps/' + datum.id, '_blank'); - } - else if (dataset == "mappers") { - win=window.open('/maps/mappers/' + datum.id, '_blank'); - } - win.focus(); - closeSearch(0); - } - }); - - - var checkboxChangeInit = false, minimizeInit = false; - - $('.sidebarSearchField').bind('keyup', function () { - - // when the user selects 'added by me' resend the query with their userid attached - if (!checkboxChangeInit) { - $('.limitToMe').bind("change", function(e) { - // set the value of the search equal to itself to retrigger the autocomplete event - searchIsOpen = false; - $('.sidebarSearchField').typeahead('setQuery',$('.sidebarSearchField').val()); - setTimeout(function() { searchIsOpen = true; }, 2000); - }); - checkboxChangeInit = true; - } - - // when the user clicks minimize section, hide the results for that section - if (!minimizeInit) { - $('.minimizeMapperResults').click(function(e) { - var s = $('.tt-dataset-mappers .tt-suggestions'); - console.log(s.css('height')); - if (s.css('height') == '0px') { - $('.tt-dataset-mappers .tt-suggestions').css({'height':'auto','overflow':'visible'}); - $(this).removeClass('maximizeResults').addClass('minimizeResults'); - } else { - $('.tt-dataset-mappers .tt-suggestions').css({'height':'0','overflow':'hidden'}); - $(this).removeClass('minimizeResults').addClass('maximizeResults'); - } - }); - $('.minimizeTopicResults').click(function(e) { - var s = $('.tt-dataset-topics .tt-suggestions'); - console.log(s.css('height')); - if (s.css('height') == '0px') { - s.css({'height':'auto','border-top':'none','overflow':'visible'}); - $(this).removeClass('maximizeResults').addClass('minimizeResults'); - } else { - s.css({'height':'0','border-top':'1px solid rgb(56, 56, 56)','overflow':'hidden'}); - $(this).removeClass('minimizeResults').addClass('maximizeResults'); - } - }); - $('.minimizeMapResults').click(function(e) { - var s = $('.tt-dataset-maps .tt-suggestions'); - console.log(s.css('height')); - if (s.css('height') == '0px') { - s.css({'height':'auto','border-top':'none','overflow':'visible'}); - $(this).removeClass('maximizeResults').addClass('minimizeResults'); - } else { - s.css({'height':'0','border-top':'1px solid rgb(56, 56, 56)','overflow':'hidden'}); - $(this).removeClass('minimizeResults').addClass('maximizeResults'); - } - }); - minimizeInit = true; - } - }); - - // - - $('.sidebarSearch button.addToMap').click(function(event){ - event.stopPropagation(); - }); - } // end bindSearchHover - - function bindAccountHover() { - - var accountIsOpen = false - - // controls the sliding hover of the bottom left menu - var sliding1 = false; - var lT; - - var closeAccount = function() { - lT = setTimeout(function() { - if (! sliding1) { - sliding1 = true; - $('.sidebarAccountIcon').css('background-color','#0F1519'); - $('.sidebarAccountBox').fadeOut(200, function() { - sliding1 = false; - accountIsOpen = false; - }); - } - },300); - } - - var openAccount = function() { - clearTimeout(lT); - if (! sliding1) { - sliding1 = true; - - // hide the other two - $('.sidebarFilterBox').hide(); - $('.sidebarWandBox').hide(); - $('.sidebarFilterIcon').css('background-color','#0F1519'); - $('.sidebarWandIcon').css('background-color','#0F1519'); - - $('.sidebarAccountIcon').css('background-color','#000'); - $('.sidebarAccountBox').fadeIn(200, function() { - sliding1 = false; - accountIsOpen = true; - }); - } - } - // bind the hover events - $(".sidebarAccount").hover(openAccount, closeAccount); - } // end bindAccountHover - - // bind hover events - bindMainMenuHover(); - bindSearchHover(); - bindAccountHover(); - - // disable right click events on the new topic and new synapse input fields - $('#new_topic, #new_synapse').bind('contextmenu', function(e){ - return false; - }); - - // initialize the autocomplete results for the metacode spinner - $('#topic_name').typeahead([ - { - name: 'topic_autocomplete', - limit: 8, - template: '{{type}}

{{label}}

{{originator}}
', - remote: { - url: '/topics/autocomplete_topic?term=%QUERY' - }, - engine: Hogan - } - ]); - // tell the autocomplete to submit the form with the topic you clicked on if you pick from the autocomplete - $('#topic_name').bind('typeahead:selected', function (event, datum, dataset) { - $('#topic_grabTopic').val(datum.id); - event.preventDefault(); - event.stopPropagation(); - }); - // bind keyboard handlers - $('#topic_name').bind('keyup', function(e) { - switch(e.which) { - case 13: - $('.new_topic').submit(); - break; - default: break; - } - }); - - // initialize the autocomplete results for the metacode spinner - $('#synapse_desc').typeahead([ - { - name: 'synapse_autocomplete', - template: "{{label}}", - remote: { - url: '/search/synapses?term=%QUERY' - }, - engine: Hogan - }, - { - name: 'existing_synapses', - limit: 50, - template: $('.synapseTemplate').html(), - remote: { - url: '/search/synapses', - replace: function () { - var q = '/search/synapses?topic1id=' + $('#synapse_topic1id').val() + '&topic2id=' + $('#synapse_topic2id').val(); - return q; - } - }, - engine: Hogan, - header: "

Existing Synapses

" - }, - ]); - // tell the autocomplete to submit the form with the topic you clicked on if you pick from the autocomplete - $('#synapse_desc').bind('typeahead:selected', function (event, datum, dataset) { - if (datum.id) { // if they clicked on an existing synapse get it - $('#synapse_grabSynapse').val(datum.id); - } - event.preventDefault(); - event.stopPropagation(); - }); - // bind keyboard handlers - $('#synapse_desc').bind('keyup', function(e) { - switch(e.which) { - case 13: - $('.new_synapse').submit(); - break; - default: break; - } - }); - - // when either form submits, don't leave the page - $('.new_topic, .new_synapse').bind('submit', function(event, data){ - event.preventDefault(); - }); - - - //$(".scroll").mCustomScrollbar(); - - // initialize scroll bar for filter by metacode, then hide it and position it correctly again - $("#filter_by_metacode").mCustomScrollbar(); - $('.sidebarFilterBox').hide().css({ - position:'absolute', - top: '35px', - right: '-36px' - }); - - // initialize metacode spinner and then hide it - $("#metacodeImg").CloudCarousel( { - titleBox: $('#metacodeImgTitle'), - yRadius:40, - xPos: 150, - yPos: 40, - speed:0.3, - mouseWheel:true, - bringToFront: true - }); - $('.new_topic').hide(); - - - $('.notice.metamaps').delay(10000).fadeOut('fast'); - $('.alert.metamaps').delay(10000).fadeOut('fast'); - - $('#center-container').bind('contextmenu', function(e){ - return false; - }); - - addHoverForSettings(); - - //bind best_in_place ajax callbacks - $('.best_in_place_desc').bind("ajax:success", function() { - $(this).parents('.CardOnGraph').find('.scroll').mCustomScrollbar("update"); - }); - $('.best_in_place_link').bind("ajax:success", function() { - var link = $(this).html(); - $(this).parents('.CardOnGraph').find('.go-link').attr('href', link); - }); - - //bind lightbox clicks - $('.openLightbox').click(function(event) { - openLightbox($(this).attr('data-open')); - event.preventDefault(); - return false; - }); - - // bind permission changer events - $('.permIcon').click(function() { - $(this).siblings('#map_permission').val( $(this).attr('data-permission') ); - $(this).siblings('.permIcon').find('.mapPermIcon').removeClass('selected'); - $(this).find('.mapPermIcon').addClass('selected'); - }); - - // bind keyboard handlers - $('body').bind('keyup', function(e) { - switch(e.which) { - case 13: enterKeyHandler(e); break; - case 27: escKeyHandler(); break; - default: break; //console.log(e.which); - } - }); - -}); // end document.ready - -function addHoverForSettings() { - // controls the sliding hover of the settings for cards - $(".permActivator").unbind('mouseover'); - $(".permActivator").unbind('mouseout'); - var sliding2 = false; - var lT1,lT2; - $(".permActivator").bind('mouseover', - function () { - clearTimeout(lT2); - that = this; - lT1 = setTimeout(function() { - if (! sliding2) { - sliding2 = true; - $(that).animate({ - width: '203px', - height: '37px' - }, 300, function() { - sliding2 = false; - }); - } - }, 300); - }); - - $(".permActivator").bind('mouseout', - function () { - clearTimeout(lT1); - that = this; - lT2 = setTimeout(function() { - if (! sliding2) { - sliding2 = true; - $(that).animate({ - height: '16px', - width: '16px' - }, 300, function() { - sliding2 = false; - }); - } - },800); - } - ); - - $('.best_in_place_permission').unbind("ajax:success"); - //bind best_in_place ajax callbacks - $('.best_in_place_permission').bind("ajax:success", function() { - var permission = $(this).html(); - var el = $(this).parents('.cardSettings').find('.mapPerm'); - el.attr('title', permission); - if (permission == "commons") el.html("co"); - else if (permission == "public") el.html("pu"); - else if (permission == "private") el.html("pr"); - }); -} - -// this is to save the layout of a map -function saveLayoutAll() { - $('.sidebarSave .tip').html('Saving...'); - var coor = ""; - if (gType == "arranged" || gType == "chaotic") { - Mconsole.graph.eachNode(function(n) { - coor = coor + n.getData("mappingid") + '/' + n.pos.x + '/' + n.pos.y + ','; - }); - coor = coor.slice(0, -1); - $('#map_coordinates').val(coor); - $('#saveMapLayout').submit(); - } -} - -// this is to update the location coordinate of a single node on a map -function saveLayout(id) { - var n = Mconsole.graph.getNode(id); - $('#map_coordinates').val(n.getData("mappingid") + '/' + n.pos.x + '/' + n.pos.y); - $('#saveMapLayout').submit(); - dragged = 0; - //$('.wandSaveLayout').html('Saved!'); - //setTimeout(function(){$('.wandSaveLayout').html('Save Layout')},1500); -} - -// this is to save your console to a map -function saveToMap() { - var nodes_data = "", synapses_data = ""; - var synapses_array = new Array(); - Mconsole.graph.eachNode(function(n) { - //don't add to the map if it was filtered out - if (categoryVisible[n.getData('metacode')] == false) { - return; - } - - var x, y; - if (n.pos.x && n.pos.y) { - x = n.pos.x; - y = n.pos.y; - } else { - var x = Math.cos(n.pos.theta) * n.pos.rho; - var y = Math.sin(n.pos.theta) * n.pos.rho; - } - nodes_data += n.id + '/' + x + '/' + y + ','; - n.eachAdjacency(function(adj) { - synapses_array.push(adj.getData("id")); - }); - }); - - //get unique values only - synapses_array = $.grep(synapses_array, function(value, key){ - return $.inArray(value, synapses_array) === key; - }); - - synapses_data = synapses_array.join(); - nodes_data = nodes_data.slice(0, -1); - - $('#map_topicsToMap').val(nodes_data); - $('#map_synapsesToMap').val(synapses_data); - openLightbox('forkmap'); -} - -function fetchRelatives(node) { - var myA = $.ajax({ - type: "Get", - url: "/topics/" + node.id + "?format=json", - success: function(data) { - if (gType == "centered") { - Mconsole.busy = true; - Mconsole.op.sum(data, { - type: 'fade', - duration: 500, - hideLabels: false - }); - Mconsole.graph.eachNode(function (n) { - n.eachAdjacency(function (a) { - if (!a.getData('showDesc')) { - a.setData('alpha', 0.4, 'start'); - a.setData('alpha', 0.4, 'current'); - a.setData('alpha', 0.4, 'end'); - } - }); - }); - Mconsole.busy = false; - } - else { - Mconsole.op.sum(data, { - type: 'nothing', - }); - Mconsole.plot(); - } - /*Mconsole.op.contract(node, { - type: 'replot' - }); - Mconsole.op.expand(node, { - type: 'animate', - transition: $jit.Trans.Elastic.easeOut, - duration: 1000 - });*/ - }, - error: function(){ - alert('failure'); - } - }); -} - -// @param node = JIT node object -// @param metacode = STRING like "Idea", "Action", etc. -function updateMetacode(node, metacode) { - var mdata = { "topic": { "metacode": metacode } }; - $.ajax({ - type: "PUT", - dataType: 'json', - url: "/topics/" + node.id, - data: mdata, - success: function(data) { - $('.CardOnGraph').find('.metacodeTitle').text(metacode); - $('.CardOnGraph').find('.metacodeImage').css('background-image', 'url(' + imgArray[metacode].src + ')'); - node.setData("metacode", metacode); - Mconsole.plot(); - $('.metacodeTitle').removeClass('minimize'); // this line flips the pull up arrow to a drop down arrow - $('.metacodeSelect').hide(); - setTimeout(function() { $('.metacodeTitle').hide(); $('.showcard .icon').css('z-index','1'); }, 500); - }, - error: function(){ - alert('failed to update metacode'); - } - }); -} - -function updateTopicPermission(node, permission) { - var mdata = { "topic": { "permission": permission } }; - $.ajax({ - type: "PUT", - dataType: 'json', - url: "/topics/" + node.id, - data: mdata, - success: function(data) { - $('.showcard .mapPerm').removeClass('co pu pr minimize').addClass( permission.substring(0,2) ); - $('.permissionSelect').remove(); - node.setData("permission", permission); - }, - error: function(){ - alert('failed to update permission'); - } - }); -} - -function updateSynapsePermission(edge, permission) { - var mdata = { "synapse": { "permission": permission } }; - $.ajax({ - type: "PUT", - dataType: 'json', - url: "/synapses/" + edge.data.$id, - data: mdata, - success: function(data) { - $('#edit_synapse .mapPerm').removeClass('co pu pr minimize').addClass( permission.substring(0,2) ); - $('#edit_synapse .permissionSelect').remove(); - edge.setData("permission", permission); - }, - error: function(){ - alert('failed to update permission'); - } - }); -} - -function updateMapPermission(mapid, permission) { - var mdata = { "map": { "permission": permission } }; - $.ajax({ - type: "PUT", - dataType: 'json', - url: "/maps/" + mapid, - data: mdata, - success: function(data) { - $('.mapPermission').removeClass('commons public private minimize').addClass( permission ); - $('.mapPermission .permissionSelect').remove(); - }, - error: function(){ - alert('failed to update permission'); - } - }); -} - -function MconsoleReset() { - - var tX = Mconsole.canvas.translateOffsetX; - var tY = Mconsole.canvas.translateOffsetY; - Mconsole.canvas.translate(-tX,-tY); - - var mX = Mconsole.canvas.scaleOffsetX; - var mY = Mconsole.canvas.scaleOffsetY; - Mconsole.canvas.scale((1/mX),(1/mY)); -} - -function openNodeShowcard(node) { - //populate the card that's about to show with the right topics data - populateShowCard(node); - - $('.showcard').fadeIn('fast'); - var s = $('.showcard').find('.scroll'); - s.height( s.height() ).mCustomScrollbar(); - //node.setData('dim', 1, 'current'); - MetamapsModel.showcardInUse = node.id; -} - -function openLightbox(which) { - $('.lightboxContent').hide(); - $('#' + which).show(); - - $('#lightbox_overlay').show(); - $('#lightbox_main').css('margin-top', '-' + ($('#lightbox_main').height() / 2) + 'px' ); -} - -function cancelMapCreate(id) { - - $('#lightbox_overlay').hide(); - - var form = $('#' + id); - - form.find('#map_name').val(''); - form.find('#map_desc').val(''); - form.find('#map_permission').val('commons'); - - if (id == "fork_map") { - form.find('#map_topicsToMap').val('0'); - form.find('#map_synapsesToMap').val('0'); - } - form.find('.mapPermIcon').removeClass('selected'); - form.find('.mapCommonsIcon').addClass('selected'); - - return false; -} diff --git a/app/assets/javascripts/scroll/jquery.mCustomScrollbar.min.js~ b/app/assets/javascripts/scroll/jquery.mCustomScrollbar.min.js~ deleted file mode 100644 index abeddf20..00000000 --- a/app/assets/javascripts/scroll/jquery.mCustomScrollbar.min.js~ +++ /dev/null @@ -1 +0,0 @@ -(function(c){var b={init:function(e){var f={set_width:false,set_height:false,horizontalScroll:false,scrollInertia:950,mouseWheel:true,mouseWheelPixels:"auto",autoDraggerLength:true,autoHideScrollbar:false,alwaysShowScrollbar:false,snapAmount:null,snapOffset:0,scrollButtons:{enable:false,scrollType:"continuous",scrollSpeed:"auto",scrollAmount:40},advanced:{updateOnBrowserResize:true,updateOnContentResize:true,autoExpandHorizontalScroll:false,autoScrollOnFocus:true,normalizeMouseWheelDelta:false},contentTouchScroll:true,callbacks:{onScrollStart:function(){},onScroll:function(){},onTotalScroll:function(){},onTotalScrollBack:function(){},onTotalScrollOffset:0,onTotalScrollBackOffset:0,whileScrolling:function(){}},theme:"light"},e=c.extend(true,f,e);return this.each(function(){var m=c(this);if(e.set_width){m.css("width",e.set_width)}if(e.set_height){m.css("height",e.set_height)}if(!c(document).data("mCustomScrollbar-index")){c(document).data("mCustomScrollbar-index","1")}else{var t=parseInt(c(document).data("mCustomScrollbar-index"));c(document).data("mCustomScrollbar-index",t+1)}m.wrapInner("
").addClass("mCustomScrollbar _mCS_"+c(document).data("mCustomScrollbar-index"));var g=m.children(".mCustomScrollBox");if(e.horizontalScroll){g.addClass("mCSB_horizontal").wrapInner("
");var k=g.children(".mCSB_h_wrapper");k.wrapInner("
").children(".mCSB_container").css({width:k.children().outerWidth(),position:"relative"}).unwrap()}else{g.wrapInner("
")}var o=g.children(".mCSB_container");if(c.support.touch){o.addClass("mCS_touch")}o.after("
");var l=g.children(".mCSB_scrollTools"),h=l.children(".mCSB_draggerContainer"),q=h.children(".mCSB_dragger");if(e.horizontalScroll){q.data("minDraggerWidth",q.width())}else{q.data("minDraggerHeight",q.height())}if(e.scrollButtons.enable){if(e.horizontalScroll){l.prepend("").append("")}else{l.prepend("").append("")}}g.bind("scroll",function(){if(!m.is(".mCS_disabled")){g.scrollTop(0).scrollLeft(0)}});m.data({mCS_Init:true,mCustomScrollbarIndex:c(document).data("mCustomScrollbar-index"),horizontalScroll:e.horizontalScroll,scrollInertia:e.scrollInertia,scrollEasing:"mcsEaseOut",mouseWheel:e.mouseWheel,mouseWheelPixels:e.mouseWheelPixels,autoDraggerLength:e.autoDraggerLength,autoHideScrollbar:e.autoHideScrollbar,alwaysShowScrollbar:e.alwaysShowScrollbar,snapAmount:e.snapAmount,snapOffset:e.snapOffset,scrollButtons_enable:e.scrollButtons.enable,scrollButtons_scrollType:e.scrollButtons.scrollType,scrollButtons_scrollSpeed:e.scrollButtons.scrollSpeed,scrollButtons_scrollAmount:e.scrollButtons.scrollAmount,autoExpandHorizontalScroll:e.advanced.autoExpandHorizontalScroll,autoScrollOnFocus:e.advanced.autoScrollOnFocus,normalizeMouseWheelDelta:e.advanced.normalizeMouseWheelDelta,contentTouchScroll:e.contentTouchScroll,onScrollStart_Callback:e.callbacks.onScrollStart,onScroll_Callback:e.callbacks.onScroll,onTotalScroll_Callback:e.callbacks.onTotalScroll,onTotalScrollBack_Callback:e.callbacks.onTotalScrollBack,onTotalScroll_Offset:e.callbacks.onTotalScrollOffset,onTotalScrollBack_Offset:e.callbacks.onTotalScrollBackOffset,whileScrolling_Callback:e.callbacks.whileScrolling,bindEvent_scrollbar_drag:false,bindEvent_content_touch:false,bindEvent_scrollbar_click:false,bindEvent_mousewheel:false,bindEvent_buttonsContinuous_y:false,bindEvent_buttonsContinuous_x:false,bindEvent_buttonsPixels_y:false,bindEvent_buttonsPixels_x:false,bindEvent_focusin:false,bindEvent_autoHideScrollbar:false,mCSB_buttonScrollRight:false,mCSB_buttonScrollLeft:false,mCSB_buttonScrollDown:false,mCSB_buttonScrollUp:false});if(e.horizontalScroll){if(m.css("max-width")!=="none"){if(!e.advanced.updateOnContentResize){e.advanced.updateOnContentResize=true}}}else{if(m.css("max-height")!=="none"){var s=false,r=parseInt(m.css("max-height"));if(m.css("max-height").indexOf("%")>=0){s=r,r=m.parent().height()*s/100}m.css("overflow","hidden");g.css("max-height",r)}}m.mCustomScrollbar("update");if(e.advanced.updateOnBrowserResize){var i,j=c(window).width(),u=c(window).height();c(window).bind("resize."+m.data("mCustomScrollbarIndex"),function(){if(i){clearTimeout(i)}i=setTimeout(function(){if(!m.is(".mCS_disabled")&&!m.is(".mCS_destroyed")){var w=c(window).width(),v=c(window).height();if(j!==w||u!==v){if(m.css("max-height")!=="none"&&s){g.css("max-height",m.parent().height()*s/100)}m.mCustomScrollbar("update");j=w;u=v}}},150)})}if(e.advanced.updateOnContentResize){var p;if(e.horizontalScroll){var n=o.outerWidth()}else{var n=o.outerHeight()}p=setInterval(function(){if(e.horizontalScroll){if(e.advanced.autoExpandHorizontalScroll){o.css({position:"absolute",width:"auto"}).wrap("
").css({width:o.outerWidth(),position:"relative"}).unwrap()}var v=o.outerWidth()}else{var v=o.outerHeight()}if(v!=n){m.mCustomScrollbar("update");n=v}},300)}})},update:function(){var n=c(this),k=n.children(".mCustomScrollBox"),q=k.children(".mCSB_container");q.removeClass("mCS_no_scrollbar");n.removeClass("mCS_disabled mCS_destroyed");k.scrollTop(0).scrollLeft(0);var y=k.children(".mCSB_scrollTools"),o=y.children(".mCSB_draggerContainer"),m=o.children(".mCSB_dragger");if(n.data("horizontalScroll")){var A=y.children(".mCSB_buttonLeft"),t=y.children(".mCSB_buttonRight"),f=k.width();if(n.data("autoExpandHorizontalScroll")){q.css({position:"absolute",width:"auto"}).wrap("
").css({width:q.outerWidth(),position:"relative"}).unwrap()}var z=q.outerWidth()}else{var w=y.children(".mCSB_buttonUp"),g=y.children(".mCSB_buttonDown"),r=k.height(),i=q.outerHeight()}if(i>r&&!n.data("horizontalScroll")){y.css("display","block");var s=o.height();if(n.data("autoDraggerLength")){var u=Math.round(r/i*s),l=m.data("minDraggerHeight");if(u<=l){m.css({height:l})}else{if(u>=s-10){var p=s-10;m.css({height:p})}else{m.css({height:u})}}m.children(".mCSB_dragger_bar").css({"line-height":m.height()+"px"})}var B=m.height(),x=(i-r)/(s-B);n.data("scrollAmount",x).mCustomScrollbar("scrolling",k,q,o,m,w,g,A,t);var D=Math.abs(q.position().top);n.mCustomScrollbar("scrollTo",D,{scrollInertia:0,trigger:"internal"})}else{if(z>f&&n.data("horizontalScroll")){y.css("display","block");var h=o.width();if(n.data("autoDraggerLength")){var j=Math.round(f/z*h),C=m.data("minDraggerWidth");if(j<=C){m.css({width:C})}else{if(j>=h-10){var e=h-10;m.css({width:e})}else{m.css({width:j})}}}var v=m.width(),x=(z-f)/(h-v);n.data("scrollAmount",x).mCustomScrollbar("scrolling",k,q,o,m,w,g,A,t);var D=Math.abs(q.position().left);n.mCustomScrollbar("scrollTo",D,{scrollInertia:0,trigger:"internal"})}else{k.unbind("mousewheel focusin");if(n.data("horizontalScroll")){m.add(q).css("left",0)}else{m.add(q).css("top",0)}if(n.data("alwaysShowScrollbar")){if(!n.data("horizontalScroll")){m.css({height:o.height()})}else{if(n.data("horizontalScroll")){m.css({width:o.width()})}}}else{y.css("display","none");q.addClass("mCS_no_scrollbar")}n.data({bindEvent_mousewheel:false,bindEvent_focusin:false})}}},scrolling:function(i,q,n,k,A,f,D,w){var l=c(this);if(!l.data("bindEvent_scrollbar_drag")){var o,p,C,z,e;if(c.support.pointer){C="pointerdown";z="pointermove";e="pointerup"}else{if(c.support.msPointer){C="MSPointerDown";z="MSPointerMove";e="MSPointerUp"}}if(c.support.pointer||c.support.msPointer){k.bind(C,function(K){K.preventDefault();l.data({on_drag:true});k.addClass("mCSB_dragger_onDrag");var J=c(this),M=J.offset(),I=K.originalEvent.pageX-M.left,L=K.originalEvent.pageY-M.top;if(I0&&L0){o=L;p=I}});c(document).bind(z+"."+l.data("mCustomScrollbarIndex"),function(K){K.preventDefault();if(l.data("on_drag")){var J=k,M=J.offset(),I=K.originalEvent.pageX-M.left,L=K.originalEvent.pageY-M.top;G(o,p,L,I)}}).bind(e+"."+l.data("mCustomScrollbarIndex"),function(x){l.data({on_drag:false});k.removeClass("mCSB_dragger_onDrag")})}else{k.bind("mousedown touchstart",function(K){K.preventDefault();K.stopImmediatePropagation();var J=c(this),N=J.offset(),I,M;if(K.type==="touchstart"){var L=K.originalEvent.touches[0]||K.originalEvent.changedTouches[0];I=L.pageX-N.left;M=L.pageY-N.top}else{l.data({on_drag:true});k.addClass("mCSB_dragger_onDrag");I=K.pageX-N.left;M=K.pageY-N.top}if(I0&&M0){o=M;p=I}}).bind("touchmove",function(K){K.preventDefault();K.stopImmediatePropagation();var N=K.originalEvent.touches[0]||K.originalEvent.changedTouches[0],J=c(this),M=J.offset(),I=N.pageX-M.left,L=N.pageY-M.top;G(o,p,L,I)});c(document).bind("mousemove."+l.data("mCustomScrollbarIndex"),function(K){if(l.data("on_drag")){var J=k,M=J.offset(),I=K.pageX-M.left,L=K.pageY-M.top;G(o,p,L,I)}}).bind("mouseup."+l.data("mCustomScrollbarIndex"),function(x){l.data({on_drag:false});k.removeClass("mCSB_dragger_onDrag")})}l.data({bindEvent_scrollbar_drag:true})}function G(J,K,L,I){if(l.data("horizontalScroll")){l.mCustomScrollbar("scrollTo",(k.position().left-(K))+I,{moveDragger:true,trigger:"internal"})}else{l.mCustomScrollbar("scrollTo",(k.position().top-(J))+L,{moveDragger:true,trigger:"internal"})}}if(c.support.touch&&l.data("contentTouchScroll")){if(!l.data("bindEvent_content_touch")){var m,E,s,t,v,F,H;q.bind("touchstart",function(x){x.stopImmediatePropagation();m=x.originalEvent.touches[0]||x.originalEvent.changedTouches[0];E=c(this);s=E.offset();v=m.pageX-s.left;t=m.pageY-s.top;F=t;H=v});q.bind("touchmove",function(x){x.preventDefault();x.stopImmediatePropagation();m=x.originalEvent.touches[0]||x.originalEvent.changedTouches[0];E=c(this).parent();s=E.offset();v=m.pageX-s.left;t=m.pageY-s.top;if(l.data("horizontalScroll")){l.mCustomScrollbar("scrollTo",H-v,{trigger:"internal"})}else{l.mCustomScrollbar("scrollTo",F-t,{trigger:"internal"})}})}}if(!l.data("bindEvent_scrollbar_click")){n.bind("click",function(I){var x=(I.pageY-n.offset().top)*l.data("scrollAmount"),y=c(I.target);if(l.data("horizontalScroll")){x=(I.pageX-n.offset().left)*l.data("scrollAmount")}if(y.hasClass("mCSB_draggerContainer")||y.hasClass("mCSB_draggerRail")){l.mCustomScrollbar("scrollTo",x,{trigger:"internal",scrollEasing:"draggerRailEase"})}});l.data({bindEvent_scrollbar_click:true})}if(l.data("mouseWheel")){if(!l.data("bindEvent_mousewheel")){i.bind("mousewheel",function(K,M){var J,I=l.data("mouseWheelPixels"),x=Math.abs(q.position().top),L=k.position().top,y=n.height()-k.height();if(l.data("normalizeMouseWheelDelta")){if(M<0){M=-1}else{M=1}}if(I==="auto"){I=100+Math.round(l.data("scrollAmount")/2)}if(l.data("horizontalScroll")){L=k.position().left;y=n.width()-k.width();x=Math.abs(q.position().left)}if((M>0&&L!==0)||(M<0&&L!==y)){K.preventDefault();K.stopImmediatePropagation()}J=x-(M*I);l.mCustomScrollbar("scrollTo",J,{trigger:"internal"})});l.data({bindEvent_mousewheel:true})}}if(l.data("scrollButtons_enable")){if(l.data("scrollButtons_scrollType")==="pixels"){if(l.data("horizontalScroll")){w.add(D).unbind("mousedown touchstart MSPointerDown pointerdown mouseup MSPointerUp pointerup mouseout MSPointerOut pointerout touchend",j,h);l.data({bindEvent_buttonsContinuous_x:false});if(!l.data("bindEvent_buttonsPixels_x")){w.bind("click",function(x){x.preventDefault();r(Math.abs(q.position().left)+l.data("scrollButtons_scrollAmount"))});D.bind("click",function(x){x.preventDefault();r(Math.abs(q.position().left)-l.data("scrollButtons_scrollAmount"))});l.data({bindEvent_buttonsPixels_x:true})}}else{f.add(A).unbind("mousedown touchstart MSPointerDown pointerdown mouseup MSPointerUp pointerup mouseout MSPointerOut pointerout touchend",j,h);l.data({bindEvent_buttonsContinuous_y:false});if(!l.data("bindEvent_buttonsPixels_y")){f.bind("click",function(x){x.preventDefault();r(Math.abs(q.position().top)+l.data("scrollButtons_scrollAmount"))});A.bind("click",function(x){x.preventDefault();r(Math.abs(q.position().top)-l.data("scrollButtons_scrollAmount"))});l.data({bindEvent_buttonsPixels_y:true})}}function r(x){if(!k.data("preventAction")){k.data("preventAction",true);l.mCustomScrollbar("scrollTo",x,{trigger:"internal"})}}}else{if(l.data("horizontalScroll")){w.add(D).unbind("click");l.data({bindEvent_buttonsPixels_x:false});if(!l.data("bindEvent_buttonsContinuous_x")){w.bind("mousedown touchstart MSPointerDown pointerdown",function(y){y.preventDefault();var x=B();l.data({mCSB_buttonScrollRight:setInterval(function(){l.mCustomScrollbar("scrollTo",Math.abs(q.position().left)+x,{trigger:"internal",scrollEasing:"easeOutCirc"})},17)})});var j=function(x){x.preventDefault();clearInterval(l.data("mCSB_buttonScrollRight"))};w.bind("mouseup touchend MSPointerUp pointerup mouseout MSPointerOut pointerout",j);D.bind("mousedown touchstart MSPointerDown pointerdown",function(y){y.preventDefault();var x=B();l.data({mCSB_buttonScrollLeft:setInterval(function(){l.mCustomScrollbar("scrollTo",Math.abs(q.position().left)-x,{trigger:"internal",scrollEasing:"easeOutCirc"})},17)})});var h=function(x){x.preventDefault();clearInterval(l.data("mCSB_buttonScrollLeft"))};D.bind("mouseup touchend MSPointerUp pointerup mouseout MSPointerOut pointerout",h);l.data({bindEvent_buttonsContinuous_x:true})}}else{f.add(A).unbind("click");l.data({bindEvent_buttonsPixels_y:false});if(!l.data("bindEvent_buttonsContinuous_y")){f.bind("mousedown touchstart MSPointerDown pointerdown",function(y){y.preventDefault();var x=B();l.data({mCSB_buttonScrollDown:setInterval(function(){l.mCustomScrollbar("scrollTo",Math.abs(q.position().top)+x,{trigger:"internal",scrollEasing:"easeOutCirc"})},17)})});var u=function(x){x.preventDefault();clearInterval(l.data("mCSB_buttonScrollDown"))};f.bind("mouseup touchend MSPointerUp pointerup mouseout MSPointerOut pointerout",u);A.bind("mousedown touchstart MSPointerDown pointerdown",function(y){y.preventDefault();var x=B();l.data({mCSB_buttonScrollUp:setInterval(function(){l.mCustomScrollbar("scrollTo",Math.abs(q.position().top)-x,{trigger:"internal",scrollEasing:"easeOutCirc"})},17)})});var g=function(x){x.preventDefault();clearInterval(l.data("mCSB_buttonScrollUp"))};A.bind("mouseup touchend MSPointerUp pointerup mouseout MSPointerOut pointerout",g);l.data({bindEvent_buttonsContinuous_y:true})}}function B(){var x=l.data("scrollButtons_scrollSpeed");if(l.data("scrollButtons_scrollSpeed")==="auto"){x=Math.round((l.data("scrollInertia")+100)/40)}return x}}}if(l.data("autoScrollOnFocus")){if(!l.data("bindEvent_focusin")){i.bind("focusin",function(){i.scrollTop(0).scrollLeft(0);var x=c(document.activeElement);if(x.is("input,textarea,select,button,a[tabindex],area,object")){var J=q.position().top,y=x.position().top,I=i.height()-x.outerHeight();if(l.data("horizontalScroll")){J=q.position().left;y=x.position().left;I=i.width()-x.outerWidth()}if(J+y<0||J+y>I){l.mCustomScrollbar("scrollTo",y,{trigger:"internal"})}}});l.data({bindEvent_focusin:true})}}if(l.data("autoHideScrollbar")&&!l.data("alwaysShowScrollbar")){if(!l.data("bindEvent_autoHideScrollbar")){i.bind("mouseenter",function(x){i.addClass("mCS-mouse-over");d.showScrollbar.call(i.children(".mCSB_scrollTools"))}).bind("mouseleave touchend",function(x){i.removeClass("mCS-mouse-over");if(x.type==="mouseleave"){d.hideScrollbar.call(i.children(".mCSB_scrollTools"))}});l.data({bindEvent_autoHideScrollbar:true})}}},scrollTo:function(e,f){var i=c(this),o={moveDragger:false,trigger:"external",callbacks:true,scrollInertia:i.data("scrollInertia"),scrollEasing:i.data("scrollEasing")},f=c.extend(o,f),p,g=i.children(".mCustomScrollBox"),k=g.children(".mCSB_container"),r=g.children(".mCSB_scrollTools"),j=r.children(".mCSB_draggerContainer"),h=j.children(".mCSB_dragger"),t=draggerSpeed=f.scrollInertia,q,s,m,l;if(!k.hasClass("mCS_no_scrollbar")){i.data({mCS_trigger:f.trigger});if(i.data("mCS_Init")){f.callbacks=false}if(e||e===0){if(typeof(e)==="number"){if(f.moveDragger){p=e;if(i.data("horizontalScroll")){e=h.position().left*i.data("scrollAmount")}else{e=h.position().top*i.data("scrollAmount")}draggerSpeed=0}else{p=e/i.data("scrollAmount")}}else{if(typeof(e)==="string"){var v;if(e==="top"){v=0}else{if(e==="bottom"&&!i.data("horizontalScroll")){v=k.outerHeight()-g.height()}else{if(e==="left"){v=0}else{if(e==="right"&&i.data("horizontalScroll")){v=k.outerWidth()-g.width()}else{if(e==="first"){v=i.find(".mCSB_container").find(":first")}else{if(e==="last"){v=i.find(".mCSB_container").find(":last")}else{v=i.find(e)}}}}}}if(v.length===1){if(i.data("horizontalScroll")){e=v.position().left}else{e=v.position().top}p=e/i.data("scrollAmount")}else{p=e=v}}}if(i.data("horizontalScroll")){if(i.data("onTotalScrollBack_Offset")){s=-i.data("onTotalScrollBack_Offset")}if(i.data("onTotalScroll_Offset")){l=g.width()-k.outerWidth()+i.data("onTotalScroll_Offset")}if(p<0){p=e=0;clearInterval(i.data("mCSB_buttonScrollLeft"));if(!s){q=true}}else{if(p>=j.width()-h.width()){p=j.width()-h.width();e=g.width()-k.outerWidth();clearInterval(i.data("mCSB_buttonScrollRight"));if(!l){m=true}}else{e=-e}}var n=i.data("snapAmount");if(n){e=Math.round(e/n)*n-i.data("snapOffset")}d.mTweenAxis.call(this,h[0],"left",Math.round(p),draggerSpeed,f.scrollEasing);d.mTweenAxis.call(this,k[0],"left",Math.round(e),t,f.scrollEasing,{onStart:function(){if(f.callbacks&&!i.data("mCS_tweenRunning")){u("onScrollStart")}if(i.data("autoHideScrollbar")&&!i.data("alwaysShowScrollbar")){d.showScrollbar.call(r)}},onUpdate:function(){if(f.callbacks){u("whileScrolling")}},onComplete:function(){if(f.callbacks){u("onScroll");if(q||(s&&k.position().left>=s)){u("onTotalScrollBack")}if(m||(l&&k.position().left<=l)){u("onTotalScroll")}}h.data("preventAction",false);i.data("mCS_tweenRunning",false);if(i.data("autoHideScrollbar")&&!i.data("alwaysShowScrollbar")){if(!g.hasClass("mCS-mouse-over")){d.hideScrollbar.call(r)}}}})}else{if(i.data("onTotalScrollBack_Offset")){s=-i.data("onTotalScrollBack_Offset")}if(i.data("onTotalScroll_Offset")){l=g.height()-k.outerHeight()+i.data("onTotalScroll_Offset")}if(p<0){p=e=0;clearInterval(i.data("mCSB_buttonScrollUp"));if(!s){q=true}}else{if(p>=j.height()-h.height()){p=j.height()-h.height();e=g.height()-k.outerHeight();clearInterval(i.data("mCSB_buttonScrollDown"));if(!l){m=true}}else{e=-e}}var n=i.data("snapAmount");if(n){e=Math.round(e/n)*n-i.data("snapOffset")}d.mTweenAxis.call(this,h[0],"top",Math.round(p),draggerSpeed,f.scrollEasing);d.mTweenAxis.call(this,k[0],"top",Math.round(e),t,f.scrollEasing,{onStart:function(){if(f.callbacks&&!i.data("mCS_tweenRunning")){u("onScrollStart")}if(i.data("autoHideScrollbar")&&!i.data("alwaysShowScrollbar")){d.showScrollbar.call(r)}},onUpdate:function(){if(f.callbacks){u("whileScrolling")}},onComplete:function(){if(f.callbacks){u("onScroll");if(q||(s&&k.position().top>=s)){u("onTotalScrollBack")}if(m||(l&&k.position().top<=l)){u("onTotalScroll")}}h.data("preventAction",false);i.data("mCS_tweenRunning",false);if(i.data("autoHideScrollbar")&&!i.data("alwaysShowScrollbar")){if(!g.hasClass("mCS-mouse-over")){d.hideScrollbar.call(r)}}}})}if(i.data("mCS_Init")){i.data({mCS_Init:false})}}}function u(w){if(i.data("mCustomScrollbarIndex")){this.mcs={top:k.position().top,left:k.position().left,draggerTop:h.position().top,draggerLeft:h.position().left,topPct:Math.round((100*Math.abs(k.position().top))/Math.abs(k.outerHeight()-g.height())),leftPct:Math.round((100*Math.abs(k.position().left))/Math.abs(k.outerWidth()-g.width()))};switch(w){case"onScrollStart":i.data("mCS_tweenRunning",true).data("onScrollStart_Callback").call(i,this.mcs);break;case"whileScrolling":i.data("whileScrolling_Callback").call(i,this.mcs);break;case"onScroll":i.data("onScroll_Callback").call(i,this.mcs);break;case"onTotalScrollBack":i.data("onTotalScrollBack_Callback").call(i,this.mcs);break;case"onTotalScroll":i.data("onTotalScroll_Callback").call(i,this.mcs);break}}}},stop:function(){var g=c(this),e=g.children().children(".mCSB_container"),f=g.children().children().children().children(".mCSB_dragger");d.mTweenAxisStop.call(this,e[0]);d.mTweenAxisStop.call(this,f[0])},disable:function(e){var j=c(this),f=j.children(".mCustomScrollBox"),h=f.children(".mCSB_container"),g=f.children(".mCSB_scrollTools"),i=g.children().children(".mCSB_dragger");f.unbind("mousewheel focusin mouseenter mouseleave touchend");h.unbind("touchstart touchmove");if(e){if(j.data("horizontalScroll")){i.add(h).css("left",0)}else{i.add(h).css("top",0)}}g.css("display","none");h.addClass("mCS_no_scrollbar");j.data({bindEvent_mousewheel:false,bindEvent_focusin:false,bindEvent_content_touch:false,bindEvent_autoHideScrollbar:false}).addClass("mCS_disabled")},destroy:function(){var e=c(this);e.removeClass("mCustomScrollbar _mCS_"+e.data("mCustomScrollbarIndex")).addClass("mCS_destroyed").children().children(".mCSB_container").unwrap().children().unwrap().siblings(".mCSB_scrollTools").remove();c(document).unbind("mousemove."+e.data("mCustomScrollbarIndex")+" mouseup."+e.data("mCustomScrollbarIndex")+" MSPointerMove."+e.data("mCustomScrollbarIndex")+" MSPointerUp."+e.data("mCustomScrollbarIndex"));c(window).unbind("resize."+e.data("mCustomScrollbarIndex"))}},d={showScrollbar:function(){this.stop().animate({opacity:1},"fast")},hideScrollbar:function(){this.stop().animate({opacity:0},"fast")},mTweenAxis:function(g,i,h,f,o,y){var y=y||{},v=y.onStart||function(){},p=y.onUpdate||function(){},w=y.onComplete||function(){};var n=t(),l,j=0,r=g.offsetTop,s=g.style;if(i==="left"){r=g.offsetLeft}var m=h-r;q();e();function t(){if(window.performance&&window.performance.now){return window.performance.now()}else{if(window.performance&&window.performance.webkitNow){return window.performance.webkitNow()}else{if(Date.now){return Date.now()}else{return new Date().getTime()}}}}function x(){if(!j){v.call()}j=t()-n;u();if(j>=g._time){g._time=(j>g._time)?j+l-(j-g._time):j+l-1;if(g._time0){g.currVal=k(g._time,r,m,f,o);s[i]=Math.round(g.currVal)+"px"}else{s[i]=h+"px"}p.call()}function e(){l=1000/60;g._time=j+l;_request=(!window.requestAnimationFrame)?function(z){u();return setTimeout(z,0.01)}:window.requestAnimationFrame;g._id=_request(x)}function q(){if(g._id==null){return}if(!window.requestAnimationFrame){clearTimeout(g._id)}else{window.cancelAnimationFrame(g._id)}g._id=null}function k(B,A,F,E,C){switch(C){case"linear":return F*B/E+A;break;case"easeOutQuad":B/=E;return -F*B*(B-2)+A;break;case"easeInOutQuad":B/=E/2;if(B<1){return F/2*B*B+A}B--;return -F/2*(B*(B-2)-1)+A;break;case"easeOutCubic":B/=E;B--;return F*(B*B*B+1)+A;break;case"easeOutQuart":B/=E;B--;return -F*(B*B*B*B-1)+A;break;case"easeOutQuint":B/=E;B--;return F*(B*B*B*B*B+1)+A;break;case"easeOutCirc":B/=E;B--;return F*Math.sqrt(1-B*B)+A;break;case"easeOutSine":return F*Math.sin(B/E*(Math.PI/2))+A;break;case"easeOutExpo":return F*(-Math.pow(2,-10*B/E)+1)+A;break;case"mcsEaseOut":var D=(B/=E)*B,z=D*B;return A+F*(0.499999999999997*z*D+-2.5*D*D+5.5*z+-6.5*D+4*B);break;case"draggerRailEase":B/=E/2;if(B<1){return F/2*B*B*B+A}B-=2;return F/2*(B*B*B+2)+A;break}}},mTweenAxisStop:function(e){if(e._id==null){return}if(!window.requestAnimationFrame){clearTimeout(e._id)}else{window.cancelAnimationFrame(e._id)}e._id=null},rafPolyfill:function(){var f=["ms","moz","webkit","o"],e=f.length;while(--e>-1&&!window.requestAnimationFrame){window.requestAnimationFrame=window[f[e]+"RequestAnimationFrame"];window.cancelAnimationFrame=window[f[e]+"CancelAnimationFrame"]||window[f[e]+"CancelRequestAnimationFrame"]}}};d.rafPolyfill.call();c.support.touch=!!("ontouchstart" in window);c.support.pointer=window.navigator.pointerEnabled;c.support.msPointer=window.navigator.msPointerEnabled;var a=("https:"==document.location.protocol)?"https:":"http:";c.event.special.mousewheel||document.write(' diff --git a/app/views/users/REMOVED b/app/views/users/REMOVED deleted file mode 100644 index 3307ca1a..00000000 --- a/app/views/users/REMOVED +++ /dev/null @@ -1,101 +0,0 @@ -<%= formula_form_for @user, url: user_url do |form| %> -

Choose Active Metacodes

-
Show AllHide All
-
-
-
    - <% $i = 0 %> - <% @m = Metacode.order("name").all %> - <% while $i < (Metacode.all.length / 4) do %> -
  • class="toggledOff"<% end %> > - <%= @m[$i].name %> -

    <%= @m[$i].name.downcase %>

    -
    -
  • - <% $i += 1 %> - <% end %> -
-
    - <% while $i < (Metacode.all.length / 4 * 2) do %> -
  • class="toggledOff"<% end %> > - <%= @m[$i].name %> -

    <%= @m[$i].name.downcase %>

    -
    -
  • - <% $i += 1 %> - <% end %> -
-
    - <% while $i < (Metacode.all.length / 4 * 3) do %> -
  • class="toggledOff"<% end %> > - <%= @m[$i].name %> -

    <%= @m[$i].name.downcase %>

    -
    -
  • - <% $i += 1 %> - <% end %> -
-
    - <% while $i < Metacode.all.length do %> -
  • class="toggledOff"<% end %> > - <%= @m[$i].name %> -

    <%= @m[$i].name.downcase %>

    -
    -
  • - <% $i += 1 %> - <% end %> -
-
-
- - -FROM USERS CONTROLLER> -@m = params[:metacodes][:value] - @user.settings.metacodes=@m.split(',') diff --git a/app/views/users/REMOVED~ b/app/views/users/REMOVED~ deleted file mode 100644 index e69de29b..00000000 diff --git a/config/database.yml.default b/config/database.yml.default deleted file mode 100644 index 6705ca8f..00000000 --- a/config/database.yml.default +++ /dev/null @@ -1,21 +0,0 @@ -development: - min_messages: WARNING - adapter: postgresql - host: 127.0.0.1 - port: 5432 - encoding: unicode - database: metamap002_development - pool: 5 - username: postgres - password: "3112" - -production: - min_messages: WARNING - adapter: postgresql - host: ec2-107-21-107-194.compute-1.amazonaws.com - port: 5432 - encoding: unicode - database: ddcrn2lgphjk9k - pool: 5 - username: qqpckkahytovwv - password: "njeP6cMA8EjM9ukHk9s3ReOdy7" From 2a59d67d793138a3b7972cb322d4fe4cf1ce2ec5 Mon Sep 17 00:00:00 2001 From: Raymon Johnstone Date: Sat, 17 May 2014 16:10:44 -0400 Subject: [PATCH 7/7] removed extra files --- Gemfile~ | 47 - app/assets/stylesheets/application.css~ | 2381 ----------------- app/controllers/users_controller.rb~ | 29 - app/views/users/edit.html.erb~ | 19 - config/initializers/devise.rb~ | 244 -- .../node_modules/uglify-js/package.json~ | 24 - 6 files changed, 2744 deletions(-) delete mode 100644 Gemfile~ delete mode 100644 app/assets/stylesheets/application.css~ delete mode 100644 app/controllers/users_controller.rb~ delete mode 100644 app/views/users/edit.html.erb~ delete mode 100644 config/initializers/devise.rb~ delete mode 100644 realtime/node_modules/socket.io/node_modules/socket.io-client/node_modules/uglify-js/package.json~ diff --git a/Gemfile~ b/Gemfile~ deleted file mode 100644 index 7b0b3fa7..00000000 --- a/Gemfile~ +++ /dev/null @@ -1,47 +0,0 @@ -source 'https://rubygems.org' - -gem 'rails', '3.2.17' - -# Bundle edge Rails instead: -# gem 'rails', :git => 'git://github.com/rails/rails.git' - -gem 'devise' -gem 'redis' -gem 'pg' -gem 'cancan' -gem 'formula' -gem 'formtastic' -gem 'json' -gem 'rails3-jquery-autocomplete' -gem 'best_in_place' -gem 'therubyracer' #optional -gem 'rb-readline' - -# 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' -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' diff --git a/app/assets/stylesheets/application.css~ b/app/assets/stylesheets/application.css~ deleted file mode 100644 index dd32e08c..00000000 --- a/app/assets/stylesheets/application.css~ +++ /dev/null @@ -1,2381 +0,0 @@ -/* - * 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_self - *= require_tree ../../../vendor/assets/stylesheets - *= require_tree . - *= require base - *= require ForceDirected - *= require jquery.mCustomScrollbar - *= require jquery-ui - *= require animate -*/ - -@font-face { - font-family: 'LatoLight'; - src: url('/assets/Fonts/Lato-Lig-webfont.eot'); - src: url('/assets/Fonts/Lato-Lig-webfont.eot?#iefix') format('embedded-opentype'), - url('/assets/Fonts/Lato-Lig-webfont.woff') format('woff'), - url('/assets/Fonts/Lato-Lig-webfont.ttf') format('truetype'), - url('/assets/Fonts/Lato-Lig-webfont.svg#LatoLight') format('svg'); - font-weight: normal; - font-style: normal; - -} - -@font-face { - font-family: 'LatoRegular'; - src: url('/assets/Fonts/Lato-Reg-webfont.eot'); - src: url('/assets/Fonts/Lato-Reg-webfont.eot?#iefix') format('embedded-opentype'), - url('/assets/Fonts/Lato-Reg-webfont.woff') format('woff'), - url('/assets/Fonts/Lato-Reg-webfont.ttf') format('truetype'), - url('/assets/Fonts/Lato-Reg-webfont.svg#LatoRegular') format('svg'); - font-weight: normal; - font-style: normal; - -} - -@font-face { - font-family: 'LatoItalic'; - src: url('/assets/Fonts/Lato-RegIta-webfont.eot'); - src: url('/assets/Fonts/Lato-RegIta-webfont.eot?#iefix') format('embedded-opentype'), - url('/assets/Fonts/Lato-RegIta-webfont.woff') format('woff'), - url('/assets/Fonts/Lato-RegIta-webfont.ttf') format('truetype'), - url('/assets/Fonts/Lato-RegIta-webfont.svg#LatoItalic') format('svg'); - font-weight: normal; - font-style: normal; - -} - -@font-face { - font-family: 'LatoBold'; - src: url('/assets/Fonts/Lato-Bol-webfont.eot'); - src: url('/assets/Fonts/Lato-Bol-webfont.eot?#iefix') format('embedded-opentype'), - url('/assets/Fonts/Lato-Bol-webfont.woff') format('woff'), - url('/assets/Fonts/Lato-Bol-webfont.ttf') format('truetype'), - url('/assets/Fonts/Lato-Bol-webfont.svg#LatoBold') format('svg'); - font-weight: normal; - font-style: normal; - -} - -/* clear styles */ -html, body, div, h1, h2, h3, h4, h5, h6, -ul, ol, dl, li, dt, dd, p, blockquote, -pre, form, fieldset, table, th, td, legend { - margin: 0; - padding: 0; - } - -img { - border:0; - padding:0; - margin:0; - display:block; - text-indent:-9999px; -} - -html, -body, -.main, -.wrapper, -#container { - height: 100%; - overflow:hidden; -} - -/* scrollbar override */ -.maps > div > div.mCS_no_scrollbar { - padding-right: 0px !important; -} -.mCSB_container { - margin-right: 15px !important; -} - -/* forgot password fix */ -.forgotPassword input[type="submit"] { - padding: 0 5px; - width: auto; -} - -html { -} - -body { - background: url(background2-for-repeating.jpg); - - font-family: 'LatoLight', helvetica, sans-serif; - color:#FFF; -} - -body.mapBody { - -} - -h1,h2,h3,h4,h5,h6 { - font-weight:normal; -} - -h1 { - display:block; - text-align:left; - font-family: "vinyl",sans-serif; -} - -h2 { - display:block; - text-align:center; - font-family: "katarine-web",sans-serif; - background: url('black_bg.png'); - font-size:24px; - line-height:35px; -} - -a { - color:#69a3a4; - text-decoration:none; -} - -button.button, a.button, input[type="submit"] { -border: none; --webkit-box-shadow: 0 1px 2px rgba(0,0,0,.2); -box-shadow: 0 1px 2px rgba(0,0,0,.2); -border: none; -border-bottom-left-radius: 0; -border-top-left-radius: 0; -height: 30px; -outline: none; -padding: 0 0; -width: 60px; --webkit-box-shadow: none; -box-shadow: none; -background: #AEA9FD; -vertical-align: top; -color: black; -margin: 0px; -cursor: pointer; -display: inline-block; -font-weight: bold; -line-height: 29px; -min-width: 54px; -text-align: center; -text-decoration: none; --webkit-border-radius: 2px; -border-radius: 2px; --webkit-user-select: none; -} - -button.button:hover, a.button:hover, input[type="submit"]:hover { - background: #B6B2FD; -} - -/* - * Utility - */ - -.clearfloat { - clear:both; -} - -.leaveSpace { - display:block; - height:50px; -} - -.hidden { - display: none; -} - -/* - * Layout stuffs - */ - -#barometer_tab { - display:none; -} - -#saveMapLayout { - display:none; -} - -#error_explanation { - background: #612127; - padding: 30px; - color: #FFF; -} -#error_explanation h2 { - display:none; -} - -#error_explanation ul { - list-style:none; -} - -.profile { - height:100%; - margin-bottom:50px; -} - -.centeredProfile { - margin:0 auto; - display: block; - width: 830px; -} - -.requestInvite { - display:block; - margin:-720px auto 0; -} - -.new_session, -.new_user { - display: block; - width: 350px; - position:absolute; - left:50%; - top:0; - margin:200px 0 0 -195px; - background: url('bg.png'); - padding: 20px; - border-radius: 5px; - color: #000; - border:1px solid #000; - box-shadow: 6px 6px 8px rgba(0,0,0,0.4); -} - -.edit_user{ - display: block; - width: 200px; - position:absolute; - left:70%; - top:25%; - margin:50px 0 0 -420px; - padding: 20px; - border-radius: 15px; - color: #000; - border:2px solid #000; -} - - -#closenewtopic, -#closenewsynapse { - position:absolute; - top: 3px; - right:3px; -} - -.anypage .new_topic { - /* start it off screen while it initializes the spinner, then it will be hidden with jquery */ - top:-1000px; - left:-1000px; - display: block; - position: absolute; - width:300px; - margin:-40px 0 0 -50px; -} -.anypage .new_synapse { - display: none; - position: absolute; -} - -#new_topic .twitter-typeahead { - position:absolute !important; - top:40px; - left:50px; - z-index:9999; - width:202px; - height: 37px; - font-family: ':atp'; -} - -.anypage #topic_name, .anypage .tt-hint { - width:190px; -background: rgba(0,0,0,0.8); -height: 25px; -margin: 0; -padding: 5px 5px; -border: 1px solid black; -outline: none; -font-size: 25px; -line-height: 35px; -color: rgba(255,255,255,0.7); -font-family: 'LatoLight'; -} - -#metacodeImg { - height:120px; -} - -#metacodeImgTitle { - color:#FFF; - float:left; - width:120px; - text-align:center; - margin-left:90px; - font-family: 'LatoRegular'; -} - -/* synapse autocomplete */ - -.new_topic #topic_name, .new_topic .tt-hint { -width: 190px; -background: rgba(0,0,0,0.8); -height: 25px; -margin: 0; -padding: 5px 5px; -border: 1px solid black; -outline: none; -font-size: 18px; -line-height: 35px; -color: white; -font-family: 'LatoRegular'; -} - -.new_synapse #synapse_desc, .new_synapse .tt-hint { -width: 200px; -background: rgba(0,0,0,0.8); -height: 18px; -margin: 0; -padding: 5px 5px; -border: 1px solid black; -outline: none; -font-size: 16px; -line-height: 20px; -color: rgba(255,255,255,0.7); -font-family: 'LatoRegular'; -} - -label, select, input, textarea { - display:block; -} - -label { - margin-top:10px; - margin-bottom:4px; -} - -input[type="submit"] { - margin-top:5px; -} - -#user_remember_me { - margin-top:11px; -} -#user_remember_me, label[for="user_remember_me"] { - float:left; -} - -.contentarea p, -.contentarea ul, -.contentarea ol, -.contentarea table { - font-size:14px; - line-height:1.55em; - padding:0.5em 0 -} - -.contentarea ul li { - padding:0.2em 0; -} - -.contentarea ol li { - padding:0.2em 0; -} - -.contentarea ul { - margin:0 0 0 1em; -} - -.contentarea ol { - margin:0 0 0 1.3em; -} - -.main { - /*overflow:hidden; */ -} - -#infovis-canvas { - -webkit-touch-callout: none; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} - -/* --- top options --*/ - -.notice.metamaps, .alert.metamaps { -position: absolute; -margin: 5px 0 0 45px; -background: #0F1519; -padding: 10px 10px 9px 10px; -border-radius: 5px; -z-index: 1; -} - -.headertop { - display:block; - position:fixed; - top:20px; - z-index:10; - border-radius:5px; - margin: 10px 0px 10px 10px; - background:#111614; - padding:5px 10px; - box-shadow: 6px 6px 8px rgba(0,0,0,0.4); -} - -.headertop .tab { - background: url(tab.png) no-repeat 0 0; - position:absolute; - top:-11px; - right:-2px; - display:block; - width:45px; - height:15px; - cursor:move; -} - -.headertop button, .headertop input { - height: 30px; - background: none; - color: #717474; - font-family: 'LatoLight'; - font-size: 17px; - border: none; - border-right:1px solid #717474; - cursor: pointer; - margin:3px 0; - clear:both; - float:right; -} - -.headertop button:hover, .headertop input:hover { - border-right: 1px solid #6d7310; - color: #6d7310; -} - -.wrapper { - display:block; - height:100%; - margin:0 0; -} - - -/* bottom right corner stuffs */ - -.wrapper div.index { - position: fixed; - bottom: 5px; - right: 0px; - z-index: 9999; - width: auto; - padding: 1px 10px 0px 10px; - font-family: "vinyl",sans-serif; - font-style:italic; - height: 35px; - font-size: 30px; - line-height: 38px; - border-right:none; - border-bottom-left-radius:5px; - border-top-left-radius:5px; - background: #0F1519; -} -.wrapper div.index .openCheatsheet { - position:absolute; - top:0; - left:-41px; - background: #0F1519 url('MMCCicon_help.png') no-repeat center center; - background-size: 27px 27px; - border-radius:5px; - height:36px; - width:36px; - cursor:pointer; -} -.wrapper div.index .openCheatsheet:hover { - -} -.wrapper div.index span { - float:left; -} -.wrapper div.index span.mapName { - text-transform:uppercase; - margin-right:9px; -} -.wrapper div.index span.mapInfo { - width: 24px; - height: 24px; - line-height: 24px; - text-align: center; - margin-top: 5px; - font-size: 27px; - background: url('MMCCicon_info.png') no-repeat center center; - background-size:24px 24px; -} - -.wrapper h1.index { - position: fixed; - bottom: 5px; - right: 0; - z-index: 9999; - width: auto; - padding: 1px 10px 0px 20px; - text-transform:uppercase; - font-style:italic; - height: 35px; - font-size: 30px; - line-height: 38px; - border-right:none; - border-bottom-left-radius:5px; - border-top-left-radius:5px; - background: #0F1519; -} - -/* account */ - -.sidebarAccount { -position:absolute; -top:5px; -right:0; -z-index:200; -width: 35px; -height:35px; -} - -.sidebarAccountIcon { -position:absolute; -width: 35px; -height: 35px; -background: #0F1519 url('MMCCicon_mapper.png') no-repeat center center; -background-size: 24px 24px; -cursor:pointer; -} -.sidebarAccountBox { - position:absolute; - display:none; - height:auto; - background: #000; - top: 35px; - right:0; - padding: 10px; - border: 1px solid black; - min-width:120px; - font-family: 'LatoLight', helvetica, sans-serif; -} -.sidebarAccountBox.loggedin { - width:auto; -} -.sidebarAccountBox.loggedout { - width:200px; -} - -.sidebarAccountBox h3 { - font-family: 'vinyl', helvetica, sans-serif; - text-transform:uppercase; - font-style:italic; -} -.sidebarAccountBox ul { - list-style:none; -} -.sidebarAccountBox li.accountIcon { -padding: 0; -background-size: 18px 18px; -background-repeat: no-repeat; -background-position: 0px 6px; -font-size: 18px; -line-height: 20px; -} -li.accountIcon:hover { -background-position: 4px 6px; -} -li.accountMaps { - background-image: url('MMCCicon_map.png'); -} -li.accountSettings { - background-image: url('MMCCicon_settings.png'); -} -li.accountInvite{ - background-image: url('MMCCicon_invite.png'); -} -li.accountLogout { - background-image: url('MMCCicon_logout.png'); -} -li.accountIcon a { - display:block; - padding: 6px 0 6px 25px; -} - -li.accountInvite span { - display: block; - padding: 6px 0 6px 25px; -} - -.sidebarAccountBox a { - color:white; -} - -.sidebarAccountBox input[type="email"], .sidebarAccountBox input[type="password"] { -width: 200px; -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; -} - -.sidebarAccountBox input[type="email"]:hover, .sidebarAccountBox input[type="password"]: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); -} - -.sidebarAccountBox .links a { - display:block; - margin-top:5px; -} - -/* Save To New Map */ - -.sidebarFork { -position:absolute; -top:5px; -right:71px; -z-index:200; -width: 35px; -height:35px; -border-right:1px solid black; -} - -.sidebarForkIcon { -position:absolute; -width: 35px; -height: 35px; -background: #0F1519 url('MMCCicon_save_new_map.png') no-repeat center center; -background-size: 28px 28px; -cursor:pointer; -} -.sidebarForkIcon:hover { - background-color: black; -} -.sidebarForkBox { - position:absolute; - display:none; - height:auto; - width:182px; - background: #000; - top: 35px; - right:-36px; - padding: 10px; - border: 1px solid black; - font-family: 'LatoLight', helvetica, sans-serif; -} - -.sidebarFork .hoverForTip:hover .tip { - display:block; -} - -.sidebarFork .tip { -display: none; -position: absolute; -background: black; -text-align: center; -top: 36px; -right: 0; -color: white; -border-radius: 4px; -font-size: 15px !important; -font-family: 'LatoRegular'; -line-height: 17px; -padding: 3px 5px 2px; -z-index: 100; -} - -/* end Save To New Map */ - -/* Save Layout */ - -.sidebarSave{ -position:absolute; -top:5px; -right:107px; -z-index:200; -width: 35px; -height:35px; -border-right:1px solid black; -} - -.sidebarSaveIcon { -position:absolute; -width: 35px; -height: 35px; -background: #0F1519 url('MMCCicon_save_layout.png') no-repeat center center; -background-size: 22px 22px; -cursor:pointer; -} -.sidebarSaveIcon:hover { - background-color: black; -} -.sidebarSaveBox { - position:absolute; - display:none; - height:auto; - width:182px; - background: #000; - top: 35px; - right:-36px; - padding: 10px; - border: 1px solid black; - font-family: 'LatoLight', helvetica, sans-serif; -} - -.sidebarSave .hoverForTip:hover .tip { - display:block; -} - -.sidebarSave .tip { -display: none; -position: absolute; -background: black; -text-align: center; -top: 36px; -right: 0; -color: white; -border-radius: 4px; -font-size: 15px !important; -font-family: 'LatoRegular'; -line-height: 17px; -padding: 3px 5px 2px; -z-index: 100; -} - -/* Filter */ - -.sidebarFilter { -position:absolute; -top:5px; -right:35px; -z-index:200; -width: 35px; -height:35px; -border-right:1px solid black; -} -.sidebarFilter.loggedout { - right:35px; -} - -.sidebarFilterIcon { -position:absolute; -width: 35px; -height: 35px; -background: #0F1519 url('MMCCicon_filter2.png') no-repeat center center; -background-size: 28px 28px; -cursor:pointer; -} -.sidebarFilterIcon:hover { - background-color: black; -} - -/* we set a few of these params off screen to begin with, so that when we initialize the scroll bar it works, but then - we hide the element and position it correctly */ -.sidebarFilterBox { - position:fixed; - top: -1000px; - right:-1000px; - display:block; - /* - position:absolute; - top: 35px; - right:-72px; - display:none; - */ - height:auto; - width:260px; - background: #000; - padding: 10px; - border: 1px solid black; - font-family: 'LatoLight', helvetica, sans-serif; - text-align:center; -} - -h3.filterByMetacode { -margin-bottom: 10px; -text-align: left; -float:left; -} -.sidebarFilterBox span { -float: left; -background: #15bad4; -padding: 1px 4px; -border-radius: 2px; -margin-left: 5px; -cursor: pointer; -} - -.sidebarFilterBox #filter_by_metacode { - height:270px; - overflow:hidden; -} -.sidebarFilterBox ul { - list-style:none; -} -.sidebarFilterBox li { - float:left; - width:61px; - height:70px; - cursor:pointer; -} -.sidebarFilterBox li:hover { -background-color: rgba(255,255,255,0.1); -} -.sidebarFilterBox li img { - width:45px; - height:45px; - margin:0 auto; -} -.sidebarFilterBox li p { - font-size:11px; - line-height:11px; - font-family:arial, sans-serif; -} - -.sidebarFilterBox li.toggledOff { - opacity: 0.4; -} - -/* end filter by metacode */ - -/* collaborate */ - -.sidebarCollaborate { -position:absolute; -top:5px; -right:143px; -z-index:200; -width: 35px; -height:35px; -border-right:1px solid black; -} - -.sidebarCollaborateIcon { -position:absolute; -width: 35px; -height: 35px; -background: #0F1519 url('MMCCicon_realtime_junto.png') no-repeat 0px 1px; -background-size: 36px 36px; -cursor:pointer; -} -.sidebarCollaborateIcon:hover, .sidebarCollaborateIcon.blue:hover{ -background-color: black; -} -.sidebarCollaborateIcon.blue { -background: #0F1519 url('MMCCicon_realtime_blue.png') no-repeat center center; -background-size: 26px 25px; -} -.sidebarCollaborateBox { - position:absolute; - display:none; - height:auto; - width:auto; - background: #000; - top: 36px; - right:0; - padding: 10px; - border: 1px solid black; - min-width:120px; - font-family: 'LatoLight', helvetica, sans-serif; -} - -.sidebarCollaborate .hoverForTip:hover .tip { - display:block; -} - -.sidebarCollaborate .tip { -display: none; -position: absolute; -background: black; -text-align: center; -top: 36px; -right: 0; -color: white; -border-radius: 4px; -font-size: 15px !important; -font-family: 'LatoRegular'; -line-height: 17px; -padding: 3px 5px 2px; -z-index: 100; -} - -/* end collaborate */ - -/* search */ - -.sidebarSearch { -position:absolute; -top:5px; -left:0; -height: 35px; -z-index:200; -} - -.sidebarSearchIcon { -float:left; -width: 35px; -height: 35px; -background: #0F1519 url('search_icon_32x32.png') no-repeat center center; -background-size: 25px 25px; -cursor:pointer; -} - -.sidebarSearch .twitter-typeahead { - float:left; -} - -.sidebarSearchField, .sidebarSearch .tt-hint { - height:25px; - padding:5px 0; - width:0px; - margin: 0; - border: 0; - outline: none; - font-size: 18px; - line-height:35px; - background:#0F1519; - color: rgba(255,255,255,0.6); - font-family: 'LatoRegular'; -} - -.sidebarSearch .tt-dropdown-menu { -left:-35px !important; -background: #0F1519; -min-width: 440px; -} - -.sidebarSearch .tt-dropdown-menu h3 { - font-family:'vinyl',helvetica,sans-serif; - text-transform:uppercase; - font-style:italic; - font-size:20px; - line-height:20px; - margin: 10px 0 3px 10px; - float:left; -} -.sidebarSearch .tt-dropdown-menu .limitToMe { - float:left; - width: 15px; - height: 15px; - margin-top: 11px; - margin-left: 15px; -} -.sidebarSearch .tt-dropdown-menu .limitToMeLabel { - float:left; - margin-top: 11px; -} -.sidebarSearch .tt-dropdown-menu .minimizeResults { - float:right; - width:35px; - height:35px; - background: url('/assets/MMCCicon_minimize_arrow.png') no-repeat center center; - background-size: 25px 25px; - cursor:pointer; -} -.sidebarSearch .tt-dropdown-menu .maximizeResults { - float:right; - width:35px; - height:35px; - background: url('/assets/MMCCicon_maximize_arrow.png') no-repeat center center; - background-size: 25px 25px; - cursor:pointer; -} - - -.sidebarSearch .tt-suggestions { - font-family:'LatoLight', helvetica, sans-serif; - overflow:visible; -} - - -.sidebarSearch .tt-suggestion { - background: #2A343C; -} - -.sidebarSearch .tt-is-under-cursor { - background:#0E161D; -} - -.sidebarSearch .tt-dataset-maps .tt-is-under-cursor .resultmap, .sidebarSearch .tt-dataset-topics .tt-is-under-cursor .resulttopic { - min-height: 57px; -} - -.sidebarSearch .tt-suggestion .icon { - float:left; - width:36px; - height:36px; - margin-right:5px; -} -.sidebarSearch .topicMetacode { - float:left; - margin-right:5px; - max-width:70px; -} -.sidebarSearch .tt-dataset-topics .topicIcon { - width:36px; - height:36px; -} -.sidebarSearch .tt-dataset-topics .tt-is-under-cursor .topicIcon { - margin:0 auto; - padding-left:2px -} -.sidebarSearch .tt-dataset-topics .metacodeTip { - display:none; -} -.sidebarSearch .tt-dataset-topics .tt-is-under-cursor .metacodeTip { - display: block; - font-family: 'vinyl'; - text-transform: uppercase; - font-style: italic; - font-size: 13px; - margin: 0 5px 0 2px; - text-align: center; -} - - -.sidebarSearch .tt-dataset-mappers .tt-suggestion .icon { - width:28px; - height:28px; - padding:4px; -} - -.sidebarSearch .resultText { - width: 250px; - display: block; - float: left; -} - -.sidebarSearch .resultTitle { - font-weight:normal; - font-family: 'LatoRegular'; - font-size:18px; - line-height:22px; - width:100%; - padding-top:8px; -} -.sidebarSearch .resultDesc { - font-family: 'LatoItalic'; - font-size:14px; - line-height:16px; - width:100%; - padding: 3px 0 6px 0; -} - -.sidebarSearch .tip { - display:none; -} - -.sidebarSearch div.autoOptions { - width: 122px; - float: right; - position:relative; - display:none; -} -.sidebarSearch .tt-is-under-cursor .autoOptions { - display:block; -} -.sidebarSearch .tt-suggestion .resultnoresult .autoOptions { - display:none; -} - -.sidebarSearch .autoOptions button, .sidebarSearch .autoOptions a, .sidebarSearch .autoOptions div { - position: absolute; - padding: 0; - margin: 0; - border: none; - outline: none; -} - -.sidebarSearch button.addToMap { -width: 20px; -height: 20px; -background: url(/assets/MMCCicon_add.png) no-repeat center center; -background-size: 18px 18px; -top: 30px; -left: 84px; -cursor: pointer; -} - -.sidebarSearch a.goTo { -width: 20px; -height: 20px; -background: url(/assets/MMCCicon_pop-out.png) no-repeat center center; -background-size: 18px 18px; -top: 7px; -left: 84px; -} - -.sidebarSearch div.mapCount { -width: 20px; -height: 20px; -background: url(/assets/MMCCicon_map.png) no-repeat 0px center; -background-size: 14px 14px; -top: 7px; -left: 39px; -padding-left: 18px; -font-size: 12px; -line-height: 20px; -} - -.sidebarSearch div.topicCount { -width: 20px; -height: 20px; -background: url(/assets/MMCCicon_topic.png) no-repeat 0px center; -background-size: 14px 14px; -top: 7px; -left: 39px; -padding-left: 18px; -font-size: 12px; -line-height: 20px; -} - -.sidebarSearch div.synapseCount { -width: 20px; -height: 20px; -background: url(/assets/MMCCicon_synapse.png) no-repeat 0px center; -background-size: 15px 15px; -top: 30px; -left: 38px; -padding-left: 19px; -font-size: 12px; -line-height: 20px; -} - -.sidebarSearch div.topicOriginatorIcon { - width: 20px; - height: 20px; - background: url(/assets/MMCCicon_mapper.png) no-repeat center center; - background-size: 17px 17px; - top: 7px; - left: 13px; -} -.sidebarSearch .tip { - position: absolute; - background: white; - width: auto; - bottom: 0; - left: 23px; - color: black; - white-space: nowrap; - border-radius: 4px; - font-size:15px !important; - font-family:'LatoRegular'; - line-height:17px; - padding: 3px 5px 2px; - z-index:100; -} -.sidebarSearch .mapCount .tip,.sidebarSearch .synapseCount .tip, .sidebarSearch .topicCount .tip { - left:-3px; - bottom:24px; -} -.sidebarSearch .hoverForTip:hover .tip { - display:block; -} -.sidebarSearch .mapContributorsIcon .mapContributors { - left:0; - bottom:21px; - white-space:normal; - width:200px; -} - -.sidebarSearch div.mapContributorsIcon { -height: 20px; -background: url(/assets/MMCCicon_mapper.png) no-repeat 0px center; -background-size: 17px 17px; -top: 7px; -right: 85px; -padding-left: 19px; -font-size: 12px; -line-height: 20px; -padding-right: 5px; -} - -.sidebarSearch div.topicPermission, .sidebarSearch div.mapPermission { -width: 20px; -height: 20px; -background-size: 19px 19px !important; -top: 30px; -left: 13px; -} -.sidebarSearch div.topicPermission.commons, .sidebarSearch div.mapPermission.commons { - background: url(/assets/MMCCicon_commons.png) no-repeat center center; -} -.sidebarSearch div.topicPermission.public, .sidebarSearch div.mapPermission.public { - background: url(/assets/MMCCicon_public.png) no-repeat center center; -} -.sidebarSearch div.topicPermission.private, .sidebarSearch div.mapPermission.private { - background: url(/assets/MMCCicon_private.png) no-repeat center center; -} - -.sidebarSearch .tt-dataset-mappers a.goTo { - top:7px; -} -.sidebarSearch .tt-dataset-mappers div.mapCount { - top:8px; -} - -/* end search */ - -.nodemargin { - padding-top:120px; -} - -.divider { - margin: 20px 50px 20px 50px; - border-bottom:2px solid #FFF; -} - -.empty { - margin-left:50px; -} - -#menus { - margin:0 7px; -} - -#cards { - height:100%; - width:805px; - margin:0 auto; -} - -#cards p.empty { - margin-left:50px; -} - -/* right click menu */ - -.rightclickmenu { - position:absolute; - background:white; - z-index: 20; - border-radius: 2px; - color: black; -} - -.rightclickmenu ul { - padding: 2px; -} - -.rightclickmenu ul li { - list-style: none; -padding: 3px 10px 3px 30px; -font-family: arial, sans-serif; -font-size: 17px; -line-height: 17px; -background-repeat: no-repeat; -background-size: 20px 20px; -background-position: 5px 2px; -} -.rightclickmenu ul li:nth-child(odd){ - background-color: #FFF; -} -.rightclickmenu ul li:nth-child(even){ - background-color: #EEE; -} -.rightclickmenu ul li:hover { - background-color: #BBB; - background-position: 7px 2px; - cursor:pointer; -} -.rightclickmenu .rc-delete { - background-image: url(MMCCicon_delete_black.png); -} -.rightclickmenu .rc-remove { - background-image: url(MMCCicon_remove_from_map_black.png); -} -.rightclickmenu .rc-hide { - background-image: url(MMCCicon_hide.png); -} -.rightclickmenu .rc-center { - background-image: url(MMCCicon_center.png); -} -.rightclickmenu .rc-popout { - background-image: url(MMCCicon_pop-out_black.png); -} -.rightclickmenu .rc-permission { - background-image: url(MMCCicon_edit_permission_black.png); - position:relative; -} - -.rightclickmenu .rc-permission ul { - display:none; - background:white; - top: 0; - left:100%; - position:absolute; - border-bottom-left-radius: 2px; - border-bottom-right-radius: 2px; - border-top-right-radius: 2px; -} -.rightclickmenu .rc-permission:hover ul { - display:block; -} -.rightclickmenu .rc-permission .toCommons { - background-image: url(MMCCicon_commons.png); -} -.rightclickmenu .rc-permission .toPublic { - background-image: url(MMCCicon_public.png); -} -.rightclickmenu .rc-permission .toPrivate { - background-image: url(MMCCicon_private.png); -} - -.rightclickmenu p { - padding:7px; -} - -/* end right click menu */ - -/* topic autocomplete */ - -#new_topic .tt-suggestion.tt-is-under-cursor { -background: #0E161D; -} - -#new_topic .tt-suggestion { -padding: 5px; -font-family: 'LatoLight'; -background: #2A343C; -} - -#new_topic .autocompleteSection { - float:left; - -} - -#new_topic .topicTitle { - width:130px; - line-height:22px; -} -#new_topic .topicPermission { - width:20px; - height:20px; - background-repeat:no-repeat; - background-position:center center; - background-size:16px 16px; -} -#new_topic .topicPermission.commons { - background-image:url(MMCCicon_commons.png); -} -#new_topic .topicPermission.public { - background-image:url(MMCCicon_public.png); -} -#new_topic .topicPermission.private { - background-image:url(MMCCicon_private.png); -} -#new_topic .topicOriginatorIcon { - position:relative; - width:20px; - height:20px; - background-repeat:no-repeat; - background-position:center center; - background-size:16px 16px; - background-image:url(MMCCicon_mapper.png); -} -#new_topic .topicOriginatorIcon:hover .tip { - display:block; -} -#new_topic .tip { - display:none; - position: absolute; - background: white; - width: auto; - top: 0; - left: 23px; - color: black; - white-space: nowrap; - border-radius: 4px; - font-size:15px !important; - font-family:'LatoRegular'; - line-height:15px; - padding: 2px 5px 2px; - z-index:100; -} - -/* topic autocomplete */ - -#new_synapse .tt-dropdown-menu { - width: 212px; - background:#2A343C; -} - -#new_synapse .tt-dropdown-menu h3 { -font-family: 'vinyl',helvetica,sans-serif; -text-transform: uppercase; -font-style: italic; -font-size: 14pxpx; -line-height: 16px; -margin: 3px; -} - -#new_synapse .tt-suggestion.tt-is-under-cursor { - background: #0E161D; -} - -#new_synapse .tt-suggestion { - padding: 5px; - font-family: 'LatoLight'; -} - -#new_synapse .autocompleteSection { - float:left; -} - -#new_synapse .synapseDesc { - width:162px; - line-height:22px; -} -#new_synapse .synapsePermission { - width:20px; - height:20px; - background-repeat:no-repeat; - background-position:center center; - background-size:16px 16px; -} -#new_synapse .synapsePermission.commons { - background-image:url(MMCCicon_commons.png); -} -#new_synapse .synapsePermission.public { - background-image:url(MMCCicon_public.png); -} -#new_synapse .synapsePermission.private { - background-image:url(MMCCicon_private.png); -} -#new_synapse .synapseOriginatorIcon { - position:relative; - width:20px; - height:20px; - background-repeat:no-repeat; - background-position:center center; - background-size:16px 16px; - background-image:url(MMCCicon_mapper.png); -} -#new_synapse .synapseOriginatorIcon:hover .tip { - display:block; -} -#new_synapse .tip { - display:none; - position: absolute; - background: white; - width: auto; - top: 0; - left: 23px; - color: black; - white-space: nowrap; - border-radius: 4px; - font-size:15px !important; - font-family:'LatoRegular'; - line-height:15px; - padding: 2px 5px 2px; - z-index:100; -} - -#new_synapse .tt-suggestion .resultnoresult .synapsePermission, #new_synapse .tt-suggestion .resultnoresult .synapseOriginatorIcon { - display:none; -} - - -/* map info box */ - -.wrapper div.mapInfoBox { - display:none; - position:absolute; - bottom:40px; - right:3px; - background:#0F1519; - border-radius:5px; - width:320px; - height:auto; - padding:10px; - font-family:'LatoLight'; - font-size:15px; - line-height:17px; - font-style:normal; - text-align:center; -} - -.mapInfoName { - padding-bottom:10px; - margin-bottom:10px; - background: url(mapInfoLine.png) no-repeat bottom center; -} -.mapInfoName, .mapInfoStat { - font-size:25px; - line-height:27px; -} -.wrapper div.mapInfoName span, .wrapper div.mapInfoDesc span { - float:none !important; - padding-bottom: 10px; -} - -div.mapInfoStat { - padding-left: 29px; -} -.infoStatIcon { -float: left; -width: 25px; -padding: 6px 0px 7px 45px; -height: 27px; -background-repeat: no-repeat; -text-align: left; -font-size: 20px; -line-height: 27px; -} -.mapContributors { -background-image: url(MMCCicon_mapper.png); -background-position: 16px 6px; -background-size: 27px 27px; -position:relative; -} -.infoStatIcon .tip { -display: none; -position: absolute; -background: white; -min-width: 180px; -max-width:250px; -text-align:center; -color: black; -border-radius: 4px; -font-size: 15px !important; -font-family: 'LatoRegular'; -line-height: 17px; -padding: 3px 5px 2px; -z-index: 100; -} -.mapContributors .tip { - top: 38px; - left: 6px; -} -.mapInfoBox .mapPermission .tip { - top: 0; - right: 32px; -} -.mapInfoBox .hoverForTip:hover .tip { - display:block; -} - -.mapTopics { -background-image: url(MMCCicon_topic.png); -background-position: 16px 6px; -background-size: 27px 27px; -} -.mapSynapses { -background-image: url(MMCCicon_synapse.png); -background-position: 18px 6px; -background-size: 27px 27px; -} -.mapInfoBox .mapPermission { -background-position: 0 center; -background-size: 30px 30px; -width: 30px; -height: 30px; -padding: 0; -margin: 5px 30px 5px 10px; -position: relative; -} -.mapInfoBox .mapPermission.commons { - background-image:url(MMCCicon_commons.png); -} -.mapInfoBox .mapPermission.public { - background-image:url(MMCCicon_public.png); -} -.mapInfoBox .mapPermission.private { - background-image:url(MMCCicon_private.png); -} - -.yourMap .mapPermission:hover { - background-image: url(/assets/MMCCicon_maximize_arrow.png); - cursor:pointer; -} -.yourMap .mapPermission.minimize { - background-image: url(MMCCicon_minimize_arrow.png) !important; - cursor: pointer; -} -.mapInfoBox .mapPermission .permissionSelect { - list-style: none; - width: 30px; - height: 60px; - position: relative; - top: 30px; -} -.mapInfoBox .mapPermission .permissionSelect li { - width: 30px; - height: 30px; - background-repeat: no-repeat; - background-position: center center; - background-size: 30px 30px; -} -.mapInfoBox .mapPermission .permissionSelect .commons { - background-image: url(MMCCicon_commons.png); -} -.mapInfoBox .mapPermission .permissionSelect .public { - background-image: url(MMCCicon_public.png); -} -.mapInfoBox .mapPermission .permissionSelect .private { - background-image: url(MMCCicon_private.png); -} -.mapInfoBox .mapPermission .permissionSelect .commons:hover { - background-image: url(MMCCicon_commons_black.png); -} -.mapInfoBox .mapPermission .permissionSelect .public:hover { - background-image: url(MMCCicon_public_black.png); -} -.mapInfoBox .mapPermission .permissionSelect .private:hover { - background-image: url(MMCCicon_private_black.png); -} - -.mapInfoBox .mapInfoDesc { - font-style: italic; - color: #BBB; - padding-bottom:5px; - margin: 5px 0 8px; - background: url(mapInfoLine.png) no-repeat bottom center; -} - -.mapInfoBox .mapInfoMeta p { - margin:4px 0; - font-size:14px; - font-style: italic; - color:#BBB; -} - - - - -/* lightboxes */ - -#lightbox_overlay { - top: 0; - left: 0; - width: 100%; - height: 100%; - position: fixed; - z-index: 1000000; - display:none; -} - -#lightbox_main { - width: 550px; - height: auto; - margin: 0 auto; - z-index: 2; - position: relative; - top:50%; - background-color: transparent; - color:black; -} - -#lightbox_screen { - top: 0; - left: 0; - z-index: 1; - width: 100%; - position: absolute; - background-color: #000; - opacity: 0.42; - filter: alpha(opacity=42); - -moz-opacity: 0.42; -} - -#lightbox_overlay #lightbox_main #lightbox_header { -padding: 6px 5px 1px 0; -background-color: #333; -font-weight: bold; -height: 18px; -border: solid 2px #000; -} - -#lightbox_overlay #lightbox_main a#lightbox_close { - /*background-image: url(../images/barometer_close.png);*/ - cursor: pointer; - height: 42px; - outline-color: -moz-use-text-color; - outline-style: none; - outline-width: medium; - overflow: hidden; - position: absolute; - top: -23px; - right: -22px; - width: 42px; - z-index: 4; - border: none; -} - -#lightbox_content { - background: white url(metacode-watermark.png) 443px -30px no-repeat; - padding: 20px; - border-radius:5px; -} - -.lightboxContent h3 { - font-style: italic; - text-transform: uppercase; - font-family: 'vinyl'; - font-size: 30px; - line-height:35px; - color:black; -} -.lightboxContent h3.forCreateMap { - text-align:center; -} - -.lightboxContent { - display:none; -} - -.openLightbox { - cursor:pointer; -} - -#about > p { - color: #000; - font-size: 16px; - line-height: 24px; - margin:10px 0; -} - -#about ul { - list-style:none; -} -#about ul li { - display:inline-block; - padding:5px; -} -#about li a { - color:#097A51; -} - -/* invite */ - -#invite { - color:black; -} - -#invite p { - margin:10px 0; - line-height:24px; -} - -#invite .green { - text-align:center; - display:block; - color:#097A51; -} - -/* new map */ -.new_map { - color:black; -} - -.new_map .inputGroup { - margin: 15px 0 5px; -} - -.new_map label { - float:left; - width: 100px; - text-align: right; - margin-right: 15px; -} - -.new_map 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; -} -.new_map input[type="text"]:hover, .new_map textarea: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); -} - -.new_map 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; -} - -.new_map .permIcon { - float:left; - width:92px; - height: 85px; - position:relative; -} -.new_map .mapPermIcon { - width:60px; - height:60px; - background-size: 48px 48px; - background-position: center center; - background-repeat: no-repeat; - margin:0 auto; - cursor:pointer; -} -.new_map .mapCommonsIcon { - background-image: url(MMCCicon_commons.png); -} -.new_map .mapPublicIcon { - background-image: url(MMCCicon_public.png); -} -.new_map .mapPrivateIcon { - background-image: url(MMCCicon_private.png); -} -.new_map .mapCommonsIcon.selected, .new_map .mapCommonsIcon:hover { - background-image: url(MMCCicon_commons_black.png); -} -.new_map .mapPublicIcon.selected, .new_map .mapPublicIcon:hover { - background-image: url(MMCCicon_public_black.png); -} -.new_map .mapPrivateIcon.selected, .new_map .mapPrivateIcon:hover { - background-image: url(MMCCicon_private_black.png); -} - -.new_map .permIcon h4 { - font-style:italic; - font-family: 'Vinyl'; - text-transform:uppercase; - font-size:18px; - line-height:20px; - color:black; - text-align:center; -} - -.new_map .tip { - display:none; - position: absolute; - background: black; - width: 150px; - top: 85px; - left: -29px; - color: white; - border-radius: 4px; - font-size:15px !important; - font-family:'LatoRegular'; - line-height:17px; - padding: 3px 5px 2px; - z-index:100; - text-align:center; -} -.new_map .hoverForTip:hover .tip { - display:block; -} - -.permText { - width: 360px; - margin: 0 auto; - text-align: center; -} - -.buttonWrapper { - margin: 10px 0 0 131px; - width: 254px; -} - -.onConsole .new_map button { - margin-right: 20px; -} - -.onConsole .new_map button, .onConsole .new_map input.add { - float: left; - margin-top: 5px; - height: 40px; - font-family: 'LatoItalic'; - font-size: 17px; - width: auto; - padding: 0 30px; - cursor:pointer; - font-weight:normal; -} -.onConsole .new_map button:hover, .onConsole .new_map input.add:hover { - -webkit-box-shadow: none; - box-shadow: none; -} - -/* Cheatsheet */ - -.cheatsheetColumn { - float:left; - width:245px; - line-height: 17px; -font-size: 12px; -font-family: arial; -} -.cheatsheetColumn.cOne { - margin-right:10px; -} - -#cheatsheet h4 { -text-decoration: underline; -font-size: 20px; -font-family: 'vinyl'; -margin-top: 15px; -font-style: italic; -} - -#cheatsheet .csItem { -margin: 5px 0; -} - -#cheatsheet .csTitle { -font-weight: bold; -} - - - - -/* FAQ */ - -#wrapper > div.FAQ { -width: 700px; -margin: 0 auto; -padding: 20px 0 20px 20px; -background: rgba(0,0,0,0.4); -color: white; -height: 100%; -overflow: hidden; -position: relative; -} - -.FAQ .question { -display: block; -background: rgba(0,0,0,0.4); -padding: 10px 45px 10px 10px; -font-weight: bold; -margin-bottom: 10px; -margin-right: 20px; -line-height:24px; -position:relative; -cursor:pointer; -} - -.FAQ .answer { -padding: 0 30px; -margin-bottom: 20px; -line-height: 24px; -margin-right: 20px; -} -.FAQ .answer.off { - display:none; -} - -.FAQ .switch { -position:absolute; -top:0; -right:0; -width: 35px; -height: 44px; -background-repeat: no-repeat; -background-position:center center; -background-image: url('/assets/MMCCicon_maximize_arrow.png'); -background-size: 25px 25px; -cursor: pointer; -} -.FAQ .minimizeAnswer { -background-image: url('/assets/MMCCicon_minimize_arrow.png') !important; -} - -/* request */ - -#wrapper .requestInvite { - width: 700px; - margin: 0 auto; - padding: 20px; - background: rgba(0,0,0,0.4); - color: white; - height: 100%; - overflow: hidden; -} - - -/* --- styling the logo button ---*/ - -.footer { - display: block; - position: fixed; - bottom: 5px; - height: 35px; - z-index: 15000; - border-bottom-right-radius:5px; - border-top-right-radius:5px; - background: #0F1519; -} - -.addMap { -position: absolute; -right: -49px; -top: 0px; -width: 44px; -height: 35px; -background: #0F1519 url('MMCCicon_add_map.png') no-repeat 3px -4px; -background-size: 40px 40px; -border-radius: 5px; -cursor:pointer; -} -.addMap:hover { - -} - -.logo { - z-index:12; - display:block; - width: 136px; -background: url(menu_icon_32.png) no-repeat -10px 8px; -padding: 5px 0px 1px 15px; -background-size: 22px 20px; -} - -#mainTitle { - padding: 0 5px; -} - -#mainTitle a { - color:#FFF; - font-family: "vinyl",sans-serif; - font-style: italic; - text-transform:uppercase; - font-weight: 400; - font-size:30px; - line-height:30px; -} - -.footer .menu { - display:none; - position:absolute; - border:none; - bottom:35px; - left:-1px; - height:123px; - z-index:12; - width:122px; - color: white; - white-space: nowrap; - text-align: center; - font-size: 16px; - overflow: hidden; - padding: 0 0 0 30px; - margin: 0; - background: #0F1519 url(beta_gen002.png) no-repeat 6px 12px; -} - -.footer ul li { - margin:0; - clear:both; - float:none; - list-style-type:none; - display:block; - padding:0; - text-align:center; - font-family:'vinyl'; - font-style:italic; - height:30px; - line-height:34px; - font-size:17px; - cursor:pointer; -} -.footer ul li:hover { - -} - -li.meta a, li.tutorial a, li.exploreMaps a { - display:block; -} - -li.meta, li.tutorial, li.exploreMaps { - border-top:1px solid white; -} - -.footer ul li a { - color: #FFF; -} - -.home_bg { - display:block; - height:100%; -} - - -/* home page */ - -div#preloaded-images { - position: absolute; - overflow: hidden; - left: -9999px; - top: -9999px; -} - -.home_content { - width: 830px; - margin:0 auto; -} - -span.blue { - color: #36bbe8; -} - -.home_desc { -font-family: 'LatoLight'; -font-size: 32px; -margin: 40px 20px 25px; -text-align:center; -} -.home_desc .welcomeTo { - text-transform: uppercase; - font-size: 50px; - font-family: 'Vinyl'; - font-style: italic; -} - -.home_content .request { - margin-right:17px !important; -} -.home_content .request, .home_content .learnmore { -margin: 5px auto; -background: white; -height: 40px; -font-family: 'Vinyl'; -font-size: 18px; -font-style: italic; -width: 135px; -padding: 0 15px; -cursor: pointer; -color:black; -line-height:44px; -font-weight: normal; -text-transform: uppercase; -} -.home_content .request:hover, .home_content .learnmore:hover { -background: white; --webkit-box-shadow: none; -box-shadow: none; -} - -.metamapsIs { - -} -.metamapsIs .swapWord { - display: block; -} - -#homeMapImage { - margin:5px auto; -} - -.featuredMaps { - margin: 15px 0; - font-size:20px; - line-height:20px; - text-align:center; -} - -#homeMap { - width:738px; - margin: 0 auto; - height:265px; - position:relative; - overflow:hidden; -} -#homeFigure { - height: 265px; - width:1290px; - margin:0; -} -#homeFigure figure { - float:left; - margin:10px !important; - overflow:hidden; -} - -#homeMap .mapPerm { -height: 40px; -background-repeat: no-repeat; -background-position: 7px center; -background-size: 27px 27px; -position: relative; -padding-left:40px; -line-height:40px; -} -#homeMap .mapPerm.co { -background-image: url(MMCCicon_commons.png); -} -#homeMap .mapPerm.pu { -background-image: url(MMCCicon_public.png); -} -#homeMap .mapPerm.pr { -background-image: url(MMCCicon_private.png); -} - -.mapContains { - position:absolute; - height:40px; - line-height:40px; - bottom:0; - width:100%; -} -.mapContains span { - display:inline-block; - text-align:left; - padding-left: 27px; -} - -.mapContains .topicCount { - background-image: url(MMCCicon_topic.png); - background-size: 20px 20px; - background-repeat: no-repeat; -background-position: 5px center; -line-height: 40px; -width:72px; -} -.mapContains .synapseCount { - background-image: url(MMCCicon_synapse_black.png); - background-size: 20px 20px; - background-repeat: no-repeat; -background-position: 5px center; -line-height: 40px; -width:95px; -} - - -#homeFigure figure .littleOverlay { -position: absolute; -top: 100%; -width: 100%; -z-index: 2; -background: rgba(255, 255, 255, 0); -transition: .6s; -border-radius:5px; -} - -#homeFigure figure:hover .littleOverlay { - /*top: 0; - background: rgba(255,255,255, 0.9); - bottom: 0; */ -} - - -#homeMap .map, #homeMap .mapCard { - height:226px; -} - -.socialIcons { - position:fixed; - bottom: 0px; - height: 37px; - right:0px; -} -.socialIcons a { - float:left; - height:30px; - width:30px; - margin: 0 7px 7px 0px; - background-repeat:no-repeat; - background-size:30px 30px; -} -.socialIcons .twitter { - background-image: url('MMSocial-51.png'); -} -.socialIcons .google { - background-image: url('MMSocial-52.png'); -} -.socialIcons .wordpress { - background-image: url('MMSocial-53.png'); -} - - -.contact { - text-align: center; - margin: 1em 0 1em 0; -} - -.contact a { - color: #36bbe8; -} - -#edit_synapse label, -#edit_synapse_left, -#edit_synapse_right { - display: inline-block; -} - -#edit_synapse label.left { - margin-right: 0.5em; -} - -.templates { - display:none; -} diff --git a/app/controllers/users_controller.rb~ b/app/controllers/users_controller.rb~ deleted file mode 100644 index 7e2ea491..00000000 --- a/app/controllers/users_controller.rb~ +++ /dev/null @@ -1,29 +0,0 @@ -class UsersController < ApplicationController - - before_filter :require_user, only: [:edit, :update] - - respond_to :html, :json - - # GET /user/edit - def edit - @user = current_user - - respond_with(@user) - end - - # PUT /user - def update - @user = current_user - @user.attributes = params[:user] - - #@m = params[:metacodes][:value] - #@user.settings.metacodes=@m.split(',') - - @user.save - - - respond_with(@user, location: session[:previous_url]) do |format| - end - end - -end diff --git a/app/views/users/edit.html.erb~ b/app/views/users/edit.html.erb~ deleted file mode 100644 index 0477ee56..00000000 --- a/app/views/users/edit.html.erb~ +++ /dev/null @@ -1,19 +0,0 @@ -<%# - # @file - # /users/:id/edit - # User edit form - #%> - -<% content_for :title, @user.name + "'s Settings | Metamaps" %> -<%= formula_form_for @user, url: user_url do |form| %> -

Your Settings

- - -

Edit Account

- <%= form.input :name, label: "Name", class: "name" %> - <%= form.input :email, label: "Email", class: "email" %> - <%= form.input :password, label: "Password", class: "password" %> - <%= form.submit "Update", class: "update" %> - <% :bypass=>true to sign_in(@user) %> -<% end %> - diff --git a/config/initializers/devise.rb~ b/config/initializers/devise.rb~ deleted file mode 100644 index 8d8712bd..00000000 --- a/config/initializers/devise.rb~ +++ /dev/null @@ -1,244 +0,0 @@ -# Use this hook to configure devise mailer, warden hooks and so forth. -# Many of these configuration options can be set straight in your model. -Devise.setup do |config| - # ==> Mailer Configuration - # Configure the e-mail address which will be shown in Devise::Mailer, - # note that it will be overwritten if you use your own mailer class with default "from" parameter. - config.mailer_sender = "team@metamaps.cc" - - # Configure the class responsible to send e-mails. - # config.mailer = "Devise::Mailer" - - if Rails.env.production? - #config.secret_key = 'd91ba0da95749174ee2b8922034783cbde4945409ed28b13383e18e72844beb74467f8199e9e216f0687cd2290c6e46bf74da24486d14bba3671d76c5b10c753' - end - - # ==> ORM configuration - # Load and configure the ORM. Supports :active_record (default) and - # :mongoid (bson_ext recommended) by default. Other ORMs may be - # available as additional gems. - require 'devise/orm/active_record' - - # ==> Configuration for any authentication mechanism - # Configure which keys are used when authenticating a user. The default is - # just :email. You can configure it to use [:username, :subdomain], so for - # authenticating a user, both parameters are required. Remember that those - # parameters are used only when authenticating and not when retrieving from - # session. If you need permissions, you should implement that in a before filter. - # You can also supply a hash where the value is a boolean determining whether - # or not authentication should be aborted when the value is not present. - # config.authentication_keys = [ :email ] - - # Configure parameters from the request object used for authentication. Each entry - # given should be a request method and it will automatically be passed to the - # find_for_authentication method and considered in your model lookup. For instance, - # if you set :request_keys to [:subdomain], :subdomain will be used on authentication. - # The same considerations mentioned for authentication_keys also apply to request_keys. - # config.request_keys = [] - - # Configure which authentication keys should be case-insensitive. - # These keys will be downcased upon creating or modifying a user and when used - # to authenticate or find a user. Default is :email. - config.case_insensitive_keys = [ :email ] - - # Configure which authentication keys should have whitespace stripped. - # These keys will have whitespace before and after removed upon creating or - # modifying a user and when used to authenticate or find a user. Default is :email. - config.strip_whitespace_keys = [ :email ] - - # Tell if authentication through request.params is enabled. True by default. - # It can be set to an array that will enable params authentication only for the - # given strategies, for example, `config.params_authenticatable = [:database]` will - # enable it only for database (email + password) authentication. - # config.params_authenticatable = true - - # Tell if authentication through HTTP Basic Auth is enabled. False by default. - # It can be set to an array that will enable http authentication only for the - # given strategies, for example, `config.http_authenticatable = [:token]` will - # enable it only for token authentication. - # config.http_authenticatable = false - - # If http headers should be returned for AJAX requests. True by default. - # config.http_authenticatable_on_xhr = true - - # The realm used in Http Basic Authentication. "Application" by default. - # config.http_authentication_realm = "Application" - - # It will change confirmation, password recovery and other workflows - # to behave the same regardless if the e-mail provided was right or wrong. - # Does not affect registerable. - # config.paranoid = true - - # By default Devise will store the user in session. You can skip storage for - # :http_auth and :token_auth by adding those symbols to the array below. - # Notice that if you are skipping storage for all authentication paths, you - # may want to disable generating routes to Devise's sessions controller by - # passing :skip => :sessions to `devise_for` in your config/routes.rb - config.skip_session_storage = [:http_auth] - - # ==> Configuration for :database_authenticatable - # For bcrypt, this is the cost for hashing the password and defaults to 10. If - # using other encryptors, it sets how many times you want the password re-encrypted. - # - # Limiting the stretches to just one in testing will increase the performance of - # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use - # a value less than 10 in other environments. - config.stretches = Rails.env.test? ? 1 : 10 - - # Setup a pepper to generate the encrypted password. - # config.pepper = "640ad415cb5292ac9ddbfa6ad7d9653d1537f1184e4037c2453db3eccb98e1c82facc6d3de7bf9d4c41d9967d41194c6e120f36f430e195ba840cd00e02dea59" - - # ==> Configuration for :confirmable - # A period that the user is allowed to access the website even without - # confirming his account. For instance, if set to 2.days, the user will be - # able to access the website for two days without confirming his account, - # access will be blocked just in the third day. Default is 0.days, meaning - # the user cannot access the website without confirming his account. - # config.allow_unconfirmed_access_for = 2.days - - # A period that the user is allowed to confirm their account before their - # token becomes invalid. For example, if set to 3.days, the user can confirm - # their account within 3 days after the mail was sent, but on the fourth day - # their account can't be confirmed with the token any more. - # Default is nil, meaning there is no restriction on how long a user can take - # before confirming their account. - # config.confirm_within = 3.days - - # If true, requires any email changes to be confirmed (exactly the same way as - # initial account confirmation) to be applied. Requires additional unconfirmed_email - # db field (see migrations). Until confirmed new email is stored in - # unconfirmed email column, and copied to email column on successful confirmation. - config.reconfirmable = true - - # Defines which key will be used when confirming an account - # config.confirmation_keys = [ :email ] - - # ==> Configuration for :rememberable - # The time the user will be remembered without asking for credentials again. - config.remember_for = 2.weeks - - # If true, extends the user's remember period when remembered via cookie. - # config.extend_remember_period = false - - # Options to be passed to the created cookie. For instance, you can set - # :secure => true in order to force SSL only cookies. - config.rememberable_options = true - - # ==> Configuration for :validatable - # Range for password length. Default is 8..128. - config.password_length = 8..128 - - # Email regex used to validate email formats. It simply asserts that - # an one (and only one) @ exists in the given string. This is mainly - # to give user feedback and not to assert the e-mail validity. - # config.email_regexp = /\A[^@]+@[^@]+\z/ - - # ==> Configuration for :timeoutable - # The time you want to timeout the user session without activity. After this - # time the user will be asked for credentials again. Default is 30 minutes. - # config.timeout_in = 30.minutes - - # If true, expires auth token on session timeout. - # config.expire_auth_token_on_timeout = false - - # ==> Configuration for :lockable - # Defines which strategy will be used to lock an account. - # :failed_attempts = Locks an account after a number of failed attempts to sign in. - # :none = No lock strategy. You should handle locking by yourself. - # config.lock_strategy = :failed_attempts - - # Defines which key will be used when locking and unlocking an account - # config.unlock_keys = [ :email ] - - # Defines which strategy will be used to unlock an account. - # :email = Sends an unlock link to the user email - # :time = Re-enables login after a certain amount of time (see :unlock_in below) - # :both = Enables both strategies - # :none = No unlock strategy. You should handle unlocking by yourself. - # config.unlock_strategy = :both - - # Number of authentication tries before locking an account if lock_strategy - # is failed attempts. - # config.maximum_attempts = 20 - - # Time interval to unlock the account if :time is enabled as unlock_strategy. - # config.unlock_in = 1.hour - - # ==> Configuration for :recoverable - # - # Defines which key will be used when recovering the password for an account - # config.reset_password_keys = [ :email ] - - # Time interval you can reset your password with a reset password key. - # Don't put a too small interval or your users won't have the time to - # change their passwords. - config.reset_password_within = 24.hours - - # ==> Configuration for :encryptable - # Allow you to use another encryption algorithm besides bcrypt (default). You can use - # :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1, - # :authlogic_sha512 (then you should set stretches above to 20 for default behavior) - # and :restful_authentication_sha1 (then you should set stretches to 10, and copy - # REST_AUTH_SITE_KEY to pepper) - # config.encryptor = :sha512 - - # ==> Configuration for :token_authenticatable - # Defines name of the authentication token params key - # config.token_authentication_key = :auth_token - - # ==> Scopes configuration - # Turn scoped views on. Before rendering "sessions/new", it will first check for - # "users/sessions/new". It's turned off by default because it's slower if you - # are using only default views. - config.scoped_views = true - - # Configure the default scope given to Warden. By default it's the first - # devise role declared in your routes (usually :user). - # config.default_scope = :user - - # Set this configuration to false if you want /users/sign_out to sign out - # only the current scope. By default, Devise signs out all scopes. - # config.sign_out_all_scopes = true - - # ==> Navigation configuration - # Lists the formats that should be treated as navigational. Formats like - # :html, should redirect to the sign in page when the user does not have - # access, but formats like :xml or :json, should return 401. - # - # If you have any extra navigational formats, like :iphone or :mobile, you - # should add them to the navigational formats lists. - # - # The "*/*" below is required to match Internet Explorer requests. - # config.navigational_formats = ["*/*", :html] - - # The default HTTP method used to sign out a resource. Default is :delete. - config.sign_out_via = :delete - - # ==> OmniAuth - # Add a new OmniAuth provider. Check the wiki for more information on setting - # up on your models and hooks. - # config.omniauth :github, 'APP_ID', 'APP_SECRET', :scope => 'user,public_repo' - - # ==> Warden configuration - # If you want to use other strategies, that are not supported by Devise, or - # change the failure app, you can configure them inside the config.warden block. - # - # config.warden do |manager| - # manager.intercept_401 = false - # manager.default_strategies(:scope => :user).unshift :some_external_strategy - # end - - # ==> Mountable engine configurations - # When using Devise inside an engine, let's call it `MyEngine`, and this engine - # is mountable, there are some extra configurations to be taken into account. - # The following options are available, assuming the engine is mounted as: - # - # mount MyEngine, at: "/my_engine" - # - # The router that invoked `devise_for`, in the example above, would be: - # config.router_name = :my_engine - # - # When using omniauth, Devise cannot automatically set Omniauth path, - # so you need to do it manually. For the users scope, it would be: - # config.omniauth_path_prefix = "/my_engine/users/auth" -end diff --git a/realtime/node_modules/socket.io/node_modules/socket.io-client/node_modules/uglify-js/package.json~ b/realtime/node_modules/socket.io/node_modules/socket.io-client/node_modules/uglify-js/package.json~ deleted file mode 100644 index e4cb23d5..00000000 --- a/realtime/node_modules/socket.io/node_modules/socket.io-client/node_modules/uglify-js/package.json~ +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name" : "uglify-js", - - "description" : "JavaScript parser and compressor/beautifier toolkit", - - "author" : { - "name" : "Mihai Bazon", - "email" : "mihai.bazon@gmail.com", - "url" : "http://mihai.bazon.net/blog" - }, - - "version" : "1.2.3", - - "main" : "./uglify-js.js", - - "bin" : { - "uglifyjs" : "./bin/uglifyjs" - }, - - "repository": { - "type": "git", - "url": "git@github.com:mishoo/UglifyJS.git" - } -}