From 02208745906df28f74c11ce06762811d9d0bfcd3 Mon Sep 17 00:00:00 2001 From: Connor Turland Date: Mon, 5 Mar 2018 13:40:03 -0500 Subject: [PATCH] cleanup template js files --- views/doorkeeper/applications/_script.js | 3 -- views/doorkeeper/applications/edit.js | 1 - views/doorkeeper/applications/index.js | 1 - views/doorkeeper/applications/new.js | 1 - views/doorkeeper/applications/show.js | 1 - .../authorized_applications/_script.js | 3 -- views/explore/active.js | 14 ++------ views/explore/featured.js | 14 ++------ views/explore/mapper.js | 20 ++++-------- views/explore/mine.js | 14 ++------ views/explore/shared.js | 14 ++------ views/explore/starred.js | 14 ++------ views/layouts/application.js | 1 - views/maps/show.js | 32 ++++++++----------- views/notifications/index.js | 3 -- views/notifications/show.js | 3 -- views/topics/show.js | 18 +++++------ views/users/edit.js | 4 --- views/users/passwords/edit.js | 3 -- views/users/passwords/new.js | 3 -- 20 files changed, 42 insertions(+), 125 deletions(-) delete mode 100644 views/doorkeeper/applications/_script.js delete mode 100644 views/doorkeeper/authorized_applications/_script.js diff --git a/views/doorkeeper/applications/_script.js b/views/doorkeeper/applications/_script.js deleted file mode 100644 index 284a98a2..00000000 --- a/views/doorkeeper/applications/_script.js +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/views/doorkeeper/applications/edit.js b/views/doorkeeper/applications/edit.js index 2fcd0cbe..bf5f7f4d 100644 --- a/views/doorkeeper/applications/edit.js +++ b/views/doorkeeper/applications/edit.js @@ -17,4 +17,3 @@ class MyComponent extends Component { } export default MyComponent -{ render 'script' } diff --git a/views/doorkeeper/applications/index.js b/views/doorkeeper/applications/index.js index 43fa694b..3340fe39 100644 --- a/views/doorkeeper/applications/index.js +++ b/views/doorkeeper/applications/index.js @@ -35,4 +35,3 @@ class MyComponent extends Component { } export default MyComponent -{ render 'script' } diff --git a/views/doorkeeper/applications/new.js b/views/doorkeeper/applications/new.js index 6bf279de..7e0165a2 100644 --- a/views/doorkeeper/applications/new.js +++ b/views/doorkeeper/applications/new.js @@ -18,4 +18,3 @@ class MyComponent extends Component { } export default MyComponent -{ render 'script' } diff --git a/views/doorkeeper/applications/show.js b/views/doorkeeper/applications/show.js index cdb0b379..4534b26f 100644 --- a/views/doorkeeper/applications/show.js +++ b/views/doorkeeper/applications/show.js @@ -44,4 +44,3 @@ class MyComponent extends Component { } export default MyComponent -{ render 'script' } diff --git a/views/doorkeeper/authorized_applications/_script.js b/views/doorkeeper/authorized_applications/_script.js deleted file mode 100644 index 284a98a2..00000000 --- a/views/doorkeeper/authorized_applications/_script.js +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/views/explore/active.js b/views/explore/active.js index a575044c..45c10cb6 100644 --- a/views/explore/active.js +++ b/views/explore/active.js @@ -1,11 +1,3 @@ - - - +Metamaps.currentSection = "explore"; +Metamaps.currentPage = "active"; +Metamaps.ServerData.Active = { @maps.to_json.html_safe }; diff --git a/views/explore/featured.js b/views/explore/featured.js index 73cbc1e0..4289d9a8 100644 --- a/views/explore/featured.js +++ b/views/explore/featured.js @@ -1,11 +1,3 @@ - - - +Metamaps.currentSection = "explore"; +Metamaps.currentPage = "featured"; +Metamaps.ServerData.Featured = { @maps.to_json.html_safe }; diff --git a/views/explore/mapper.js b/views/explore/mapper.js index 4d7a580e..c9c2a2ae 100644 --- a/views/explore/mapper.js +++ b/views/explore/mapper.js @@ -1,14 +1,6 @@ - - - +Metamaps.currentSection = "explore"; +Metamaps.currentPage = "mapper"; +Metamaps.ServerData.Mapper = { + models: { @maps.to_json.html_safe }, + mapperId: { params[:id] } +}; diff --git a/views/explore/mine.js b/views/explore/mine.js index 80c6d8c9..cd7e59dc 100644 --- a/views/explore/mine.js +++ b/views/explore/mine.js @@ -1,11 +1,3 @@ - - - +Metamaps.currentPage = "mine"; +Metamaps.currentSection = "explore"; +Metamaps.ServerData.Mine = { @maps.to_json.html_safe }; diff --git a/views/explore/shared.js b/views/explore/shared.js index eea80dd3..4b49b871 100644 --- a/views/explore/shared.js +++ b/views/explore/shared.js @@ -1,11 +1,3 @@ - - - +Metamaps.currentPage = "shared"; +Metamaps.currentSection = "explore"; +Metamaps.ServerData.Shared = { @maps.to_json.html_safe }; diff --git a/views/explore/starred.js b/views/explore/starred.js index 11470867..8bab8e56 100644 --- a/views/explore/starred.js +++ b/views/explore/starred.js @@ -1,11 +1,3 @@ - - - +Metamaps.currentPage = "starred"; +Metamaps.currentSection = "explore"; +Metamaps.ServerData.Starred = { @maps.to_json.html_safe }; diff --git a/views/layouts/application.js b/views/layouts/application.js index cb8debb6..69078282 100644 --- a/views/layouts/application.js +++ b/views/layouts/application.js @@ -12,7 +12,6 @@ { render :partial => 'maps/newtopic' } { end } { render :partial => 'maps/newsynapse' } - { # for populating the change metacode list on the topic card } { render :partial => 'shared/metacodeoptions' } { end } { render :partial => 'layouts/foot' } diff --git a/views/maps/show.js b/views/maps/show.js index 676902fe..da27599a 100644 --- a/views/maps/show.js +++ b/views/maps/show.js @@ -1,19 +1,13 @@ - - - - - +Metamaps.currentSection = "map"; +Metamaps.currentPage = { @map.id.to_s }; +Metamaps.ServerData = Metamaps.ServerData || {} +Metamaps.ServerData.ActiveMap = { @map.to_json.html_safe }; +Metamaps.ServerData.Mappers = { @allmappers.to_json.html_safe }; +Metamaps.ServerData.Collaborators = { @allcollaborators.to_json.html_safe }; +Metamaps.ServerData.Topics = { @alltopics.to_json(user: current_user).html_safe }; +Metamaps.ServerData.Synapses = { @allsynapses.to_json.html_safe }; +Metamaps.ServerData.Mappings = { @allmappings.to_json.html_safe }; +Metamaps.ServerData.Messages = { @allmessages.to_json.html_safe }; +Metamaps.ServerData.Stars = { @allstars.to_json.html_safe }; +Metamaps.ServerData.requests = { @allrequests.to_json.html_safe }; +Metamaps.ServerData.VisualizeType = "ForceDirected"; diff --git a/views/notifications/index.js b/views/notifications/index.js index f3fea97d..0c4f8797 100644 --- a/views/notifications/index.js +++ b/views/notifications/index.js @@ -1,6 +1,3 @@ - - - import React, { Component } from react class MyComponent extends Component { diff --git a/views/notifications/show.js b/views/notifications/show.js index 8d40239e..d825d9a6 100644 --- a/views/notifications/show.js +++ b/views/notifications/show.js @@ -1,6 +1,3 @@ - - - import React, { Component } from react class MyComponent extends Component { diff --git a/views/topics/show.js b/views/topics/show.js index 1a2c9cb8..e2dc0c3f 100644 --- a/views/topics/show.js +++ b/views/topics/show.js @@ -1,10 +1,8 @@ - +Metamaps.currentSection = "topic" +Metamaps.currentPage = { @topic.id.to_s } +Metamaps.ServerData = Metamaps.ServerData || {} +Metamaps.ServerData.ActiveTopic = { @topic.to_json(user: current_user).html_safe } +Metamaps.ServerData.Creators = { @allcreators.to_json.html_safe } +Metamaps.ServerData.Topics = { @alltopics.to_json(user: current_user).html_safe } +Metamaps.ServerData.Synapses = { @allsynapses.to_json.html_safe } +Metamaps.ServerData.VisualizeType = "RGraph" diff --git a/views/users/edit.js b/views/users/edit.js index 31a0e3ca..3558afab 100644 --- a/views/users/edit.js +++ b/views/users/edit.js @@ -1,7 +1,3 @@ - - - - import React, { Component } from react class MyComponent extends Component { diff --git a/views/users/passwords/edit.js b/views/users/passwords/edit.js index a55f3ec9..3d931b81 100644 --- a/views/users/passwords/edit.js +++ b/views/users/passwords/edit.js @@ -1,6 +1,3 @@ - - - import React, { Component } from react class MyComponent extends Component { diff --git a/views/users/passwords/new.js b/views/users/passwords/new.js index c8a6bc11..7e7c1cc7 100644 --- a/views/users/passwords/new.js +++ b/views/users/passwords/new.js @@ -1,6 +1,3 @@ - - - import React, { Component } from react class MyComponent extends Component {