diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 11a24567..bd7fbc0e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -87,7 +87,7 @@ If you'd like to contribute a fix for a bug you've encountered, first read up on aware of the issue. By filing the issue first, we may be able to provide you with some insight that guides you in the right direction. -[metamaps-issues]: https://github.com/Connoropolous/metamaps_gen002/issues +[metamaps-issues]: https://github.com/metamaps/metamaps_gen002/issues [git-branching-model]: http://nvie.com/posts/a-successful-git-branching-model/ -[fork-metamaps]: https://github.com/Connoropolous/metamaps_gen002/fork +[fork-metamaps]: https://github.com/metamaps/metamaps_gen002/fork [cla]: http://metamaps.cc/cla diff --git a/LiveSiteUpdatesNotes.txt b/LiveSiteUpdatesNotes.txt index ad2ae9dd..ea00eb2a 100644 --- a/LiveSiteUpdatesNotes.txt +++ b/LiveSiteUpdatesNotes.txt @@ -1,3 +1,9 @@ +make sure that devise key is correct + + +make sure that AWS bucket is set to the metamaps-production bucket + + make sure that root individuals have same 'joinedwithcode' as 'code' User.all.each do |u| diff --git a/README.md b/README.md index af6e92c4..afb5c9a3 100644 --- a/README.md +++ b/README.md @@ -47,9 +47,9 @@ Copyright (c) 2014 Connor Turland [site-blog]: http://blog.metamaps.cc [site-beta]: http://metamaps.cc [community]: https://plus.google.com/u/0/communities/115060009262157699234 -[license]: https://github.com/Connoropolous/metamaps_gen002/blob/master/LICENSE -[contributing]: https://github.com/Connoropolous/metamaps_gen002/blob/master/CONTRIBUTING.md -[contributing-issues]: https://github.com/Connoropolous/metamaps_gen002/blob/master/CONTRIBUTING.md#reporting-bugs-and-other-issues -[windows-installation]: https://github.com/Connoropolous/metamaps_gen002/blob/master/WindowsInstallation.md -[mac-installation]: https://github.com/Connoropolous/metamaps_gen002/blob/master/MacInstallation.md -[ubuntu-installation]: https://github.com/Connoropolous/metamaps_gen002/blob/master/UbuntuInstallation.md +[license]: https://github.com/metamaps/metamaps_gen002/blob/master/LICENSE +[contributing]: https://github.com/metamaps/metamaps_gen002/blob/master/CONTRIBUTING.md +[contributing-issues]: https://github.com/metamaps/metamaps_gen002/blob/master/CONTRIBUTING.md#reporting-bugs-and-other-issues +[windows-installation]: https://github.com/metamaps/metamaps_gen002/blob/master/WindowsInstallation.md +[mac-installation]: https://github.com/metamaps/metamaps_gen002/blob/master/MacInstallation.md +[ubuntu-installation]: https://github.com/metamaps/metamaps_gen002/blob/master/UbuntuInstallation.md diff --git a/UbuntuInstallation.md b/UbuntuInstallation.md index f5292f58..14eb3c0c 100644 --- a/UbuntuInstallation.md +++ b/UbuntuInstallation.md @@ -38,7 +38,7 @@ running this will check your system for requirements as well so you will need to alright now we can download metamaps from the master using git - git clone https://github.com/Connoropolous/metamaps_gen002.git + git clone https://github.com/metamaps/metamaps_gen002.git now there is a couple other things we are going to need which is phantomjs, nodejs, postgresql, libpq-dev and redis-server diff --git a/WindowsInstallation.md b/WindowsInstallation.md index 4b39ce45..42364b44 100644 --- a/WindowsInstallation.md +++ b/WindowsInstallation.md @@ -13,7 +13,7 @@ also download node.js, which is also needed http://nodejs.org/download/ Navigate to the folder that you want to download the metamaps files to and run the following: (use your forked git repository address if it's different than this repo. You will also need to go to your Github account settings and add the SSH key that was placed in your clipboard earlier) - git clone https://github.com/Connoropolous/metamaps_gen002.git --branch develop + git clone https://github.com/metamaps/metamaps_gen002.git --branch develop cd metamaps_gen002 Now you're in the main directory. diff --git a/app/assets/images/.DS_Store b/app/assets/images/.DS_Store index dc778d51..a709ceac 100644 Binary files a/app/assets/images/.DS_Store and b/app/assets/images/.DS_Store differ diff --git a/app/assets/images/delete_mapinfo.png b/app/assets/images/delete_mapinfo.png deleted file mode 100644 index e6316c2e..00000000 Binary files a/app/assets/images/delete_mapinfo.png and /dev/null differ diff --git a/app/assets/images/homepage_bg_fade.png b/app/assets/images/homepage_bg_fade.png new file mode 100644 index 00000000..df9c2e63 Binary files /dev/null and b/app/assets/images/homepage_bg_fade.png differ diff --git a/app/assets/images/partner_logos.png b/app/assets/images/partner_logos.png new file mode 100644 index 00000000..f53b06c7 Binary files /dev/null and b/app/assets/images/partner_logos.png differ diff --git a/app/assets/images/profile_card_sprite.png b/app/assets/images/profile_card_sprite.png new file mode 100644 index 00000000..2b6eb216 Binary files /dev/null and b/app/assets/images/profile_card_sprite.png differ diff --git a/app/assets/images/remove_mapinfo_sprite.png b/app/assets/images/remove_mapinfo_sprite.png new file mode 100644 index 00000000..ba7f4b81 Binary files /dev/null and b/app/assets/images/remove_mapinfo_sprite.png differ diff --git a/app/assets/images/user.png b/app/assets/images/user.png old mode 100755 new mode 100644 index 67239052..e7b41d48 Binary files a/app/assets/images/user.png and b/app/assets/images/user.png differ diff --git a/app/assets/images/video-screen.png b/app/assets/images/video-screen.png new file mode 100644 index 00000000..751df9a9 Binary files /dev/null and b/app/assets/images/video-screen.png differ diff --git a/app/assets/javascripts/src/Metamaps.Backbone.js b/app/assets/javascripts/src/Metamaps.Backbone.js index 7ed0adfe..2909f5d8 100644 --- a/app/assets/javascripts/src/Metamaps.Backbone.js +++ b/app/assets/javascripts/src/Metamaps.Backbone.js @@ -89,10 +89,20 @@ Metamaps.Backbone.Map = Backbone.Model.extend({ function capitalize(string) { return string.charAt(0).toUpperCase() + string.slice(1); } + + var n = this.get('name'); + var d = this.get('desc'); + + var maxNameLength = 32; + var maxDescLength = 118; + var truncatedName = n ? (n.length > maxNameLength ? n.substring(0, maxNameLength) + "..." : n) : ""; + var truncatedDesc = d ? (d.length > maxDescLength ? d.substring(0, maxDescLength) + "..." : d) : ""; + var obj = { id: this.id, - name: this.get('name'), - desc: this.get('desc'), + name: truncatedName, + fullName: n, + desc: truncatedDesc, permission: this.get("permission") ? capitalize(this.get("permission")) : "Commons", editPermission: this.authorizeToEdit(Metamaps.Active.Mapper) ? 'canEdit' : 'cannotEdit', contributor_count_number: '' + this.get('contributor_count') + '', @@ -131,11 +141,20 @@ Metamaps.Backbone.MapsCollection = Backbone.Collection.extend({ this.id = options.id; this.sortBy = options.sortBy; + if (options.mapperId) { + this.mapperId = options.mapperId; + } + // this.page represents the NEXT page to fetch this.page = models.length > 0 ? (models.length < 20 ? "loadedAll" : 2) : 1; }, url: function() { - return '/explore/' + this.id + '.json'; + if (!this.mapperId) { + return '/explore/' + this.id + '.json'; + } + else { + return '/explore/mapper/' + this.mapperId + '.json'; + } }, comparator: function (a, b) { a = a.get(this.sortBy); diff --git a/app/assets/javascripts/src/Metamaps.GlobalUI.js b/app/assets/javascripts/src/Metamaps.GlobalUI.js index f2129224..4e106a00 100644 --- a/app/assets/javascripts/src/Metamaps.GlobalUI.js +++ b/app/assets/javascripts/src/Metamaps.GlobalUI.js @@ -92,10 +92,18 @@ Metamaps.GlobalUI = { if (Metamaps.Active.Mapper) Metamaps.Active.Mapper = new Metamaps.Backbone.Mapper(Metamaps.Active.Mapper); var myCollection = Metamaps.Maps.Mine ? Metamaps.Maps.Mine : []; + var mapperCollection = []; + var mapperOptionsObj = {id: 'mapper', sortBy: 'updated_at' }; + if (Metamaps.Maps.Mapper) { + mapperCollection = Metamaps.Maps.Mapper.models; + mapperOptionsObj.mapperId = Metamaps.Maps.Mapper.id; + } var featuredCollection = Metamaps.Maps.Featured ? Metamaps.Maps.Featured : []; var activeCollection = Metamaps.Maps.Active ? Metamaps.Maps.Active : []; - Metamaps.Maps.Mine = new Metamaps.Backbone.MapsCollection(myCollection, {id: 'mine', sortBy: 'name' }); - Metamaps.Maps.Featured = new Metamaps.Backbone.MapsCollection(featuredCollection, {id: 'featured', sortBy: 'name' }); + Metamaps.Maps.Mine = new Metamaps.Backbone.MapsCollection(myCollection, {id: 'mine', sortBy: 'updated_at' }); + // 'Mapper' refers to another mapper + Metamaps.Maps.Mapper = new Metamaps.Backbone.MapsCollection(mapperCollection, mapperOptionsObj); + Metamaps.Maps.Featured = new Metamaps.Backbone.MapsCollection(featuredCollection, {id: 'featured', sortBy: 'updated_at' }); Metamaps.Maps.Active = new Metamaps.Backbone.MapsCollection(activeCollection, {id: 'active', sortBy: 'updated_at' }); }, openLightbox: function (which) { @@ -602,8 +610,7 @@ Metamaps.GlobalUI.Search = { } else if (dataset == "maps") { Metamaps.Router.maps(datum.id); } else if (dataset == "mappers") { - win = window.open('/maps/mappers/' + datum.id, '_blank'); - win.focus(); + Metamaps.Router.explore("mapper", datum.id); } } }, diff --git a/app/assets/javascripts/src/Metamaps.JIT.js b/app/assets/javascripts/src/Metamaps.JIT.js index dff655ce..51240234 100644 --- a/app/assets/javascripts/src/Metamaps.JIT.js +++ b/app/assets/javascripts/src/Metamaps.JIT.js @@ -112,8 +112,10 @@ Metamaps.JIT = { }); if (self.vizData.length == 0) { + Metamaps.Famous.viz.showInstructions(); Metamaps.Visualize.loadLater = true; } + else Metamaps.Famous.viz.hideInstructions(); Metamaps.Visualize.render(); }, // prepareVizData @@ -378,11 +380,21 @@ Metamaps.JIT = { if(e.ctrlKey){ Metamaps.Visualize.mGraph.busy = false; Metamaps.Mouse.boxEndCoordinates = eventInfo.getPos(); - Metamaps.JIT.zoomToBox(e); + + var bS = Metamaps.Mouse.boxStartCoordinates; + var bE = Metamaps.Mouse.boxEndCoordinates; + if (Math.abs(bS.x - bE.x) > 20 && Math.abs(bS.y - bE.y) > 20) { + Metamaps.JIT.zoomToBox(e); + return; + } + else { + Metamaps.Mouse.boxStartCoordinates = null; + Metamaps.Mouse.boxEndCoordinates = null; + } //console.log('called zoom to box'); - return; } - else if (e.shiftKey) { + + if (e.shiftKey) { Metamaps.Visualize.mGraph.busy = false; Metamaps.Mouse.boxEndCoordinates = eventInfo.getPos(); Metamaps.JIT.selectWithBox(e); @@ -1127,11 +1139,18 @@ Metamaps.JIT = { sY = -1 * sY; eY = -1 * eY - Metamaps.Synapses.each(function(synapse) { - var fromNodeX = synapse.get('edge').nodeFrom.pos.x; - var fromNodeY = -1 * synapse.get('edge').nodeFrom.pos.y; - var toNodeX = synapse.get('edge').nodeTo.pos.x; - var toNodeY = -1 * synapse.get('edge').nodeTo.pos.y; + var edgesToToggle = []; + Metamaps.Synapses.each(function(synapse) { + var e = synapse.get('edge'); + if (edgesToToggle.indexOf(e) === -1) { + edgesToToggle.push(e); + } + }); + edgesToToggle.forEach(function(edge) { + var fromNodeX = edge.nodeFrom.pos.x; + var fromNodeY = -1 * edge.nodeFrom.pos.y; + var toNodeX = edge.nodeTo.pos.x; + var toNodeY = -1 * edge.nodeTo.pos.y; var maxX = fromNodeX; var maxY = fromNodeY; @@ -1207,21 +1226,18 @@ Metamaps.JIT = { //The test synapse was selected! - // make sure the edge hasn't been hidden from the page - var node1id = synapse.get('edge').nodeFrom.id; - var node2id = synapse.get('edge').nodeTo.id; - var edge = Metamaps.Visualize.mGraph.graph.getAdjacence(node1id, node2id); - if(selectTest){ + if(selectTest){ + // shiftKey = toggleSelect, otherwise if(e.shiftKey){ - if(Metamaps.Selected.Edges.indexOf(synapse.get('edge')) != -1 ){ - Metamaps.Control.deselectEdge(synapse.get('edge')); + if(Metamaps.Selected.Edges.indexOf(edge) != -1 ){ + Metamaps.Control.deselectEdge(edge); } else{ - if (edge) Metamaps.Control.selectEdge(synapse.get('edge')); + Metamaps.Control.selectEdge(edge); } } else{ - if (edge) Metamaps.Control.selectEdge(synapse.get('edge')); + Metamaps.Control.selectEdge(edge); } } }); @@ -1322,9 +1338,9 @@ Metamaps.JIT = { var disabled = authorized ? "" : "disabled"; - if (Metamaps.Active.Map) menustring += '
  • Hide until refresh
  • '; - if (Metamaps.Active.Map && Metamaps.Active.Mapper) menustring += '
  • Remove from map
  • '; - if (Metamaps.Active.Map && Metamaps.Active.Mapper) menustring += '
  • Delete
  • '; + if (Metamaps.Active.Map) menustring += '
  • Hide until refresh
    Ctrl+H
  • '; + if (Metamaps.Active.Map && Metamaps.Active.Mapper) menustring += '
  • Remove from map
    Ctrl+M
  • '; + if (Metamaps.Active.Map && Metamaps.Active.Mapper) menustring += '
  • Delete
    Ctrl+D
  • '; if (Metamaps.Active.Topic) { @@ -1337,6 +1353,8 @@ Metamaps.JIT = {
  • private
  • \ '; + menustring += '
  • '; + menustring += '
  • Change permissions' + options + '
  • '; var metacodeOptions = $('#metacodeOptions').html(); @@ -1344,6 +1362,11 @@ Metamaps.JIT = { menustring += '
  • Change metacode' + metacodeOptions + '
  • '; } if (Metamaps.Active.Topic) { + + if (!Metamaps.Active.Mapper) { + menustring += '
  • '; + } + // set up the get sibling menu as a "lazy load" // only fill in the submenu when they hover over the get siblings list item var siblingMenu = '