switch so that backbone router is opt-in, not opt-out (#610)

This commit is contained in:
Connor Turland 2016-08-16 10:25:07 -04:00 committed by GitHub
parent 03e98e617b
commit b58f55353a
21 changed files with 58 additions and 58 deletions

View file

@ -263,6 +263,6 @@
pushState: true, pushState: true,
root: '/' root: '/'
}) })
$(document).on('click', 'a:not([data-bypass])', Metamaps.Router.intercept) $(document).on('click', 'a[data-router="true"]', Metamaps.Router.intercept)
} }
})() })()

View file

@ -1,6 +1,6 @@
<%= link_to 'Metacode Sets', metacode_sets_path, { :class => 'button', 'data-bypass' => 'true' }%> <%= link_to 'Metacode Sets', metacode_sets_path, { :class => 'button' }%>
<%= link_to 'New Set', new_metacode_set_path, { :class => 'button', 'data-bypass' => 'true' }%> <%= link_to 'New Set', new_metacode_set_path, { :class => 'button' }%>
<%= link_to 'Metacodes', metacodes_path, { :class => 'button', 'data-bypass' => 'true' }%> <%= link_to 'Metacodes', metacodes_path, { :class => 'button' }%>
<%= link_to 'New Metacode', new_metacode_path, { :class => 'button', 'data-bypass' => 'true' }%> <%= link_to 'New Metacode', new_metacode_path, { :class => 'button' }%>
<div class='clearfloat'></div> <div class='clearfloat'></div>
<br /> <br />

View file

@ -30,7 +30,7 @@
<div class="form-group"> <div class="form-group">
<div class="col-sm-offset-2 col-sm-10"> <div class="col-sm-offset-2 col-sm-10">
<%= f.submit t('doorkeeper.applications.buttons.submit'), class: "btn btn-primary" %> <%= f.submit t('doorkeeper.applications.buttons.submit'), class: "btn btn-primary" %>
<%= link_to t('doorkeeper.applications.buttons.cancel'), oauth_applications_path, :class => "button link-button red-button", :data => { :bypass => 'true' } %> <%= link_to t('doorkeeper.applications.buttons.cancel'), oauth_applications_path, :class => "button link-button red-button" %>
</div> </div>
</div> </div>
<% end %> <% end %>

View file

@ -15,14 +15,14 @@
<tbody> <tbody>
<% @applications.each do |application| %> <% @applications.each do |application| %>
<tr id="application_<%= application.id %>"> <tr id="application_<%= application.id %>">
<td><%= link_to application.name, oauth_application_path(application), :data => { :bypass => 'true' } %></td> <td><%= link_to application.name, oauth_application_path(application) %></td>
<td><%= application.redirect_uri %></td> <td><%= application.redirect_uri %></td>
<td><%= render 'delete_form', application: application %></td> <td><%= render 'delete_form', application: application %></td>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>
</table> </table>
<%= link_to t('.new'), new_oauth_application_path, class: 'button link-button', :data => { :bypass => 'true' } %> <%= link_to t('.new'), new_oauth_application_path, class: 'button link-button' %>
</div> </div>
</div> </div>
<%= render 'script' %> <%= render 'script' %>

View file

@ -1,6 +1,6 @@
<div id="yield"> <div id="yield">
<div class="centerContent"> <div class="centerContent">
<%= link_to t('doorkeeper.applications.buttons.back'), oauth_applications_path(), class: 'button link-button button-margin', :data => { :bypass => 'true' } %> <%= link_to t('doorkeeper.applications.buttons.back'), oauth_applications_path(), class: 'button link-button button-margin' %>
<div class="page-header"> <div class="page-header">
<h2><%= t('.title') %></h2> <h2><%= t('.title') %></h2>
</div> </div>

View file

@ -1,7 +1,7 @@
<div id="yield"> <div id="yield">
<div class="centerContent showApp"> <div class="centerContent showApp">
<%= link_to t('doorkeeper.applications.buttons.back'), oauth_applications_path(), class: 'button link-button button-margin', :data => { :bypass => 'true' } %> <%= link_to t('doorkeeper.applications.buttons.back'), oauth_applications_path(), class: 'button link-button button-margin' %>
<div class="page-header"> <div class="page-header">
<h2><%= t('.title', name: @application.name) %></h2> <h2><%= t('.title', name: @application.name) %></h2>
@ -23,13 +23,13 @@
<code><%= uri %></code> <code><%= uri %></code>
</td> </td>
<td> <td>
<%= link_to t('doorkeeper.applications.buttons.authorize'), oauth_authorization_path(client_id: @application.uid, redirect_uri: uri, response_type: 'code'), class: 'button link-button', target: '_blank', :data => { :bypass => 'true' } %> <%= link_to t('doorkeeper.applications.buttons.authorize'), oauth_authorization_path(client_id: @application.uid, redirect_uri: uri, response_type: 'code'), class: 'button link-button', target: '_blank' %>
</td> </td>
</tr> </tr>
<% end %> <% end %>
</table> </table>
<div class="inline-button"><%= link_to t('doorkeeper.applications.buttons.edit'), edit_oauth_application_path(@application), class: 'button link-button', :data => { :bypass => 'true' } %></div> <div class="inline-button"><%= link_to t('doorkeeper.applications.buttons.edit'), edit_oauth_application_path(@application), class: 'button link-button' %></div>
<div class="inline-button"><%= render 'delete_form', application: @application, submit_btn_css: 'button red-button' %></div> <div class="inline-button"><%= render 'delete_form', application: @application, submit_btn_css: 'button red-button' %></div>
</div> </div>

View file

@ -10,12 +10,12 @@
<ul> <ul>
<li class="accountListItem accountSettings"> <li class="accountListItem accountSettings">
<div class="accountIcon"></div> <div class="accountIcon"></div>
<%= link_to "Account", edit_user_url(account), :data => { :bypass => 'true'} %> <%= link_to "Account", edit_user_url(account) %>
</li> </li>
<% if account.admin %> <% if account.admin %>
<li class="accountListItem accountAdmin"> <li class="accountListItem accountAdmin">
<div class="accountIcon"></div> <div class="accountIcon"></div>
<%= link_to "Admin", metacodes_path, :data => { :bypass => 'true'} %> <%= link_to "Admin", metacodes_path %>
</li> </li>
<% end %> <% end %>
<li class="accountListItem accountInvite openLightbox" data-open="invite"> <li class="accountListItem accountInvite openLightbox" data-open="invite">
@ -24,7 +24,7 @@
</li> </li>
<li class="accountListItem accountLogout"> <li class="accountListItem accountLogout">
<div class="accountIcon"></div> <div class="accountIcon"></div>
<%= link_to "Sign Out", "/logout", id: "Logout", :data => { :bypass => 'true'} %> <%= link_to "Sign Out", "/logout", id: "Logout" %>
</li> </li>
</ul> </ul>
<% else %> <% else %>
@ -47,8 +47,7 @@
<div class="clearfloat"></div> <div class="clearfloat"></div>
<div class="accountForgotPass"> <div class="accountForgotPass">
<%- if devise_mapping.recoverable? && controller_name != 'passwords' %> <%- if devise_mapping.recoverable? && controller_name != 'passwords' %>
<%= link_to "Forgot password?", new_password_path(resource_name), <%= link_to "Forgot password?", new_password_path(resource_name) %>
:data => { :bypass => 'true'} %>
<% end -%> <% end -%>
</div> </div>
<% end %> <% end %>

View file

@ -57,7 +57,7 @@
</a> </a>
</li> </li>
<li> <li>
<a id="lightbox_term" data-bypass="true" href="https://metamaps.cc/maps/331" target="_blank"> <a id="lightbox_term" href="https://metamaps.cc/maps/331" target="_blank">
<div class="lightboxAboutIcon"></div> <div class="lightboxAboutIcon"></div>
terms terms
</a> </a>

View file

@ -8,7 +8,7 @@
<ul> <ul>
<% if not current_user %> <% if not current_user %>
<li> <li>
<%= link_to "Home", root_path, :data => { :bypass => 'true'} %> <%= link_to "Home", root_path %>
</li> </li>
<% end %> <% end %>
<% if current_user %> <% if current_user %>
@ -18,34 +18,34 @@
<span><%= current_user.name %></span> <span><%= current_user.name %></span>
</li> </li>
<li> <li>
<%= link_to "My Maps", explore_mine_path %> <%= link_to "My Maps", explore_mine_path, :data => { :router => 'true'} %>
</li> </li>
<li> <li>
<%= link_to "Shared With Me", explore_shared_path %> <%= link_to "Shared With Me", explore_shared_path, :data => { :router => 'true'} %>
</li> </li>
<% end %> <% end %>
<li> <li>
<%= link_to "Recently Active", explore_active_path %> <%= link_to "Recently Active", explore_active_path, :data => { :router => 'true'} %>
</li> </li>
<% if not current_user %> <% if not current_user %>
<li> <li>
<%= link_to "Featured Maps", explore_featured_path %> <%= link_to "Featured Maps", explore_featured_path, :data => { :router => 'true'} %>
</li> </li>
<% end %> <% end %>
<% if not current_user %> <% if not current_user %>
<li> <li>
<%= link_to "Request Invite", request_path, :data => { :bypass => 'true'} %> <%= link_to "Request Invite", request_path %>
</li> </li>
<li> <li>
<%= link_to "Login", new_user_session_path, :data => { :bypass => 'true'} %> <%= link_to "Login", new_user_session_path %>
</li> </li>
<% end %> <% end %>
<% if current_user %> <% if current_user %>
<li> <li>
<%= link_to "Account", edit_user_url(current_user), :data => { :bypass => 'true'} %> <%= link_to "Account", edit_user_url(current_user) %>
</li> </li>
<li> <li>
<%= link_to "Sign Out", "/logout", id: "Logout", :data => { :bypass => 'true'} %> <%= link_to "Sign Out", "/logout", id: "Logout" %>
</li> </li>
<% end %> <% end %>
</ul> </ul>

View file

@ -47,7 +47,7 @@
</script> </script>
<script type="text/template" id="mapCardTemplate"> <script type="text/template" id="mapCardTemplate">
<a href="/maps/{{id}}"> <a href="/maps/{{id}}" data-router="true">
<div class="permission {{editPermission}}"> <!-- must be canEdit or cannotEdit --> <div class="permission {{editPermission}}"> <!-- must be canEdit or cannotEdit -->
<div class="mapCard"> <div class="mapCard">
<span class="title" title="{{fullName}}"> <span class="title" title="{{fullName}}">
@ -248,7 +248,7 @@
<div class="metacodeSelect">{{{metacode_select}}}</div> <div class="metacodeSelect">{{{metacode_select}}}</div>
</div> </div>
<div class="linkItem contributor"> <div class="linkItem contributor">
<a href="/explore/mapper/{{userid}}"><img src="<%= asset_path('user.png') %>" class="contributorIcon" width="32" height="32" /></a> <a href="/explore/mapper/{{userid}}" target="_blank"><img src="<%= asset_path('user.png') %>" class="contributorIcon" width="32" height="32" /></a>
<div class="contributorName">{{username}}</div> <div class="contributorName">{{username}}</div>
</div> </div>
<div class="linkItem mapCount"> <div class="linkItem mapCount">
@ -258,7 +258,7 @@
<div class="tip"><ul>{{{inmaps}}}</ul></div> <div class="tip"><ul>{{{inmaps}}}</ul></div>
</div> </div>
<a href="/topics/{{id}}" class="linkItem synapseCount"> <a href="/topics/{{id}}" target="_blank" class="linkItem synapseCount">
<div class="synapseCountIcon"></div> <div class="synapseCountIcon"></div>
{{synapse_count}} {{synapse_count}}
<div class="tip">Click to see this topics synapses</div> <div class="tip">Click to see this topics synapses</div>

View file

@ -4,7 +4,7 @@
<div class="upperLeftUI"> <div class="upperLeftUI">
<!-- home button --> <!-- home button -->
<div class="homeButton"> <div class="homeButton">
<a href="<%= root_url %>" <% if !current_user || appsPage %><%= 'data-bypass=true' %><% end %>>METAMAPS</a> <a href="<%= root_url %>" <% if current_user && !appsPage %><%= 'data-router=true' %><% end %>>METAMAPS</a>
</div> <!-- end homeButton --> </div> <!-- end homeButton -->
<!-- search box --> <!-- search box -->
@ -39,7 +39,7 @@
<% if current_user %> <% if current_user %>
<!-- create new map --> <!-- create new map -->
<a href="<%= new_map_path %>" data-bypass="true" target="_blank" class="addMap upperRightEl upperRightIcon"> <a href="<%= new_map_path %>" target="_blank" class="addMap upperRightEl upperRightIcon">
<div class="tooltipsUnder"> <div class="tooltipsUnder">
Create New Map Create New Map
</div> </div>

View file

@ -21,8 +21,8 @@
<h3>Who finds it useful?</h3> <h3>Who finds it useful?</h3>
<p>Designers, inventors, artists, educators, strategists, consultants, facilitators, entrepreneurs, systems thinkers, changemakers, analysts, students, researchers... maybe you!</p> <p>Designers, inventors, artists, educators, strategists, consultants, facilitators, entrepreneurs, systems thinkers, changemakers, analysts, students, researchers... maybe you!</p>
<button type="button" class="button learnMoreCTA" onclick="Metamaps.GlobalUI.openLightbox('about');">LEARN MORE</button> <button type="button" class="button learnMoreCTA" onclick="Metamaps.GlobalUI.openLightbox('about');">LEARN MORE</button>
<a href="/explore/featured" class="exploreFeaturedCTA">EXPLORE FEATURED MAPS</a> <a href="/explore/featured" data-router="true" class="exploreFeaturedCTA">EXPLORE FEATURED MAPS</a>
<a href="/request" class="requestInviteCTA" data-bypass="true">REQUEST INVITE</a> <a href="/request" class="requestInviteCTA">REQUEST INVITE</a>
</div> </div>
<div class="clearfloat"></div> <div class="clearfloat"></div>
</div> </div>

View file

@ -83,7 +83,7 @@
<div class="actions"> <div class="actions">
<%= link_to 'Cancel', metacode_sets_path, <%= link_to 'Cancel', metacode_sets_path,
{ :class => 'button', 'data-bypass' => 'true' } %> { :class => 'button' } %>
<%= f.submit :class => 'add', :onclick => "return Metamaps.Admin.validate();" %> <%= f.submit :class => 'add', :onclick => "return Metamaps.Admin.validate();" %>
</div> </div>
<% end %> <% end %>

View file

@ -14,11 +14,11 @@
<td> <td>
<%= metacode_set.name %><br /> <%= metacode_set.name %><br />
<%= link_to 'Edit', <%= link_to 'Edit',
edit_metacode_set_path(metacode_set), :data => { :bypass => 'true'} %> edit_metacode_set_path(metacode_set) %>
<br /> <br />
<%= link_to 'Delete', <%= link_to 'Delete',
metacode_set, method: :delete, metacode_set, method: :delete,
data: { confirm: 'Are you sure?', bypass: 'true' } %> data: { confirm: 'Are you sure?' } %>
</td> </td>
<td class='metacodeSetDesc'><%= metacode_set.desc %></td> <td class='metacodeSetDesc'><%= metacode_set.desc %></td>
<td> <td>

View file

@ -37,7 +37,7 @@
<div class="clearfloat"></div> <div class="clearfloat"></div>
</div> </div>
<div class="actions"> <div class="actions">
<%= link_to 'Cancel', metacodes_path, { :class => 'button', 'data-bypass' => 'true' } %> <%= link_to 'Cancel', metacodes_path, { :class => 'button' } %>
<%= f.submit :class => 'add' %> <%= f.submit :class => 'add' %>
</div> </div>
<% end %> <% end %>

View file

@ -23,7 +23,7 @@
<td></td> <td></td>
<% end %> <% end %>
<td><%= image_tag metacode.icon, width: 40 %></td> <td><%= image_tag metacode.icon, width: 40 %></td>
<td><%= link_to 'Edit', edit_metacode_path(metacode), :data => { :bypass => 'true'} %></td> <td><%= link_to 'Edit', edit_metacode_path(metacode) %></td>
</tr> </tr>
<% end %> <% end %>
</table> </table>

View file

@ -153,42 +153,42 @@
<div id="moreResources"> <div id="moreResources">
<p>For more information about Metamaps.cc, visit our Knowledge Base or skip directly to a section by clicking on one of the categories below.</p> <p>For more information about Metamaps.cc, visit our Knowledge Base or skip directly to a section by clicking on one of the categories below.</p>
<div class="resourcesColumnOne resourcesColumn"> <div class="resourcesColumnOne resourcesColumn">
<a href="http://metamapscc.uservoice.com/forums/262715-general" target="_blank" data-bypass="true" class="button">Feedback Forums</a> <a href="http://metamapscc.uservoice.com/forums/262715-general" target="_blank" class="button">Feedback Forums</a>
<ul> <ul>
<li> <li>
<a href="http://metamapscc.uservoice.com/knowledgebase/topics/61031-getting-started" target="_blank" data-bypass="true">Getting Started</a> <a href="http://metamapscc.uservoice.com/knowledgebase/topics/61031-getting-started" target="_blank">Getting Started</a>
</li> </li>
<li> <li>
<a href="http://metamapscc.uservoice.com/knowledgebase/topics/63372-key-fundamentals" target="_blank" data-bypass="true">Key Fundamentals</a> <a href="http://metamapscc.uservoice.com/knowledgebase/topics/63372-key-fundamentals" target="_blank">Key Fundamentals</a>
</li> </li>
<li> <li>
<a href="http://metamapscc.uservoice.com/knowledgebase/topics/61033-best-practices" target="_blank" data-bypass="true">Best Practices</a> <a href="http://metamapscc.uservoice.com/knowledgebase/topics/61033-best-practices" target="_blank">Best Practices</a>
</li> </li>
<li> <li>
<a href="http://metamapscc.uservoice.com/knowledgebase/topics/63377-general-troubleshooting" target="_blank" data-bypass="true">General Troubleshooting</a> <a href="http://metamapscc.uservoice.com/knowledgebase/topics/63377-general-troubleshooting" target="_blank">General Troubleshooting</a>
</li> </li>
<li> <li>
<a href="http://metamapscc.uservoice.com/knowledgebase/topics/63443-applications-use-cases" target="_blank" data-bypass="true">Applications & Use Cases</a> <a href="http://metamapscc.uservoice.com/knowledgebase/topics/63443-applications-use-cases" target="_blank">Applications & Use Cases</a>
</li> </li>
</ul> </ul>
</div> </div>
<div class="resourcesColumnTwo resourcesColumn"> <div class="resourcesColumnTwo resourcesColumn">
<a href="http://metamapscc.uservoice.com/knowledgebase" target="_blank" data-bypass="true" class="button">KNOWLEDGE BASE</a> <a href="http://metamapscc.uservoice.com/knowledgebase" target="_blank" class="button">KNOWLEDGE BASE</a>
<ul> <ul>
<li> <li>
<a href="http://metamapscc.uservoice.com/knowledgebase/topics/63440-general-questions" target="_blank" data-bypass="true">General Questions</a> <a href="http://metamapscc.uservoice.com/knowledgebase/topics/63440-general-questions" target="_blank">General Questions</a>
</li> </li>
<li> <li>
<a href="http://metamapscc.uservoice.com/knowledgebase/topics/63375-getting-involved" target="_blank" data-bypass="true">Getting Involved</a> <a href="http://metamapscc.uservoice.com/knowledgebase/topics/63375-getting-involved" target="_blank">Getting Involved</a>
</li> </li>
<li> <li>
<a href="http://metamapscc.uservoice.com/knowledgebase/topics/63376-project-organization-governance" target="_blank" data-bypass="true">Organization & Governance</a> <a href="http://metamapscc.uservoice.com/knowledgebase/topics/63376-project-organization-governance" target="_blank">Organization & Governance</a>
</li> </li>
<li> <li>
<a href="http://metamapscc.uservoice.com/knowledgebase/topics/63378-technical-infrastructure" target="_blank" data-bypass="true">Technical Infrastructure</a> <a href="http://metamapscc.uservoice.com/knowledgebase/topics/63378-technical-infrastructure" target="_blank">Technical Infrastructure</a>
</li> </li>
<li> <li>
<a href="http://metamapscc.uservoice.com/knowledgebase/topics/63587-theory-references" target="_blank" data-bypass="true">References & Key Theory</a> <a href="http://metamapscc.uservoice.com/knowledgebase/topics/63587-theory-references" target="_blank">References & Key Theory</a>
</li> </li>
</ul> </ul>
</div> </div>

View file

@ -19,9 +19,9 @@
<div id="metacodeSwitchTabs"> <div id="metacodeSwitchTabs">
<ul> <ul>
<% allMetacodeSets.each do |m| %> <% allMetacodeSets.each do |m| %>
<li><a href="#metacodeSwitchTabs<%= m.id %>" data-set-id="<%= m.id %>" data-bypass="true"><%= m.name %></a></li> <li><a href="#metacodeSwitchTabs<%= m.id %>" data-set-id="<%= m.id %>"><%= m.name %></a></li>
<% end %> <% end %>
<li><a href="#metacodeSwitchTabsCustom" data-set-id="custom" data-bypass="true" id="metacodeSetCustom">CUSTOM SELECTION</a></li> <li><a href="#metacodeSwitchTabsCustom" data-set-id="custom" id="metacodeSetCustom">CUSTOM SELECTION</a></li>
</ul> </ul>
<% allMetacodeSets.each_with_index do |m, localindex| %> <% allMetacodeSets.each_with_index do |m, localindex| %>
<div id="metacodeSwitchTabs<%= m.id %>" <div id="metacodeSwitchTabs<%= m.id %>"

View file

@ -23,7 +23,7 @@
<div><%= f.submit "Sign up!" %></div> <div><%= f.submit "Sign up!" %></div>
<div class = "smallText"><br />Don't have an access code?<br /><a href="/request" data-bypass="true">Request an Invite</a></div> <div class = "smallText"><br />Don't have an access code?<br /><a href="/request">Request an Invite</a></div>
<% end %> <% end %>
</div> </div>

View file

@ -24,8 +24,7 @@
<div class="clearfloat"></div> <div class="clearfloat"></div>
<div class="accountForgotPass"> <div class="accountForgotPass">
<%- if devise_mapping.recoverable? && controller_name != 'passwords' %> <%- if devise_mapping.recoverable? && controller_name != 'passwords' %>
<%= link_to "Forgot password?", new_password_path(resource_name), <%= link_to "Forgot password?", new_password_path(resource_name) %>
:data => { :bypass => 'true'} %>
<% end -%> <% end -%>
</div> </div>
<% end %> <% end %>

View file

@ -39,21 +39,25 @@ class Header extends Component {
<MapLink show={signedIn && explore} <MapLink show={signedIn && explore}
href="/explore/mine" href="/explore/mine"
linkClass={activeClass("my")} linkClass={activeClass("my")}
data-router="true"
text="My Maps" text="My Maps"
/> />
<MapLink show={signedIn && explore} <MapLink show={signedIn && explore}
href="/explore/shared" href="/explore/shared"
linkClass={activeClass("shared")} linkClass={activeClass("shared")}
data-router="true"
text="Shared With Me" text="Shared With Me"
/> />
<MapLink show={explore} <MapLink show={explore}
href={signedIn ? "/" : "/explore/active"} href={signedIn ? "/" : "/explore/active"}
linkClass={activeClass("active")} linkClass={activeClass("active")}
data-router="true"
text="Recently Active" text="Recently Active"
/> />
<MapLink show={!signedIn && explore} <MapLink show={!signedIn && explore}
href="/explore/featured" href="/explore/featured"
linkClass={activeClass("featured")} linkClass={activeClass("featured")}
data-router="true"
text="Featured Maps" text="Featured Maps"
/> />
@ -68,13 +72,11 @@ class Header extends Component {
<MapLink show={apps} <MapLink show={apps}
href="/oauth/applications" href="/oauth/applications"
linkClass={"activeMaps exploreMapsButton" + (section == "registered" ? " active" : "")} linkClass={"activeMaps exploreMapsButton" + (section == "registered" ? " active" : "")}
data-bypass="true"
text="Registered Apps" text="Registered Apps"
/> />
<MapLink show={apps} <MapLink show={apps}
href="/oauth/applications" href="/oauth/applications"
linkClass={"activeMaps exploreMapsButton" + (section == "authorized" ? " active" : "")} linkClass={"activeMaps exploreMapsButton" + (section == "authorized" ? " active" : "")}
data-bypass="true"
text="Authorized Apps" text="Authorized Apps"
/> />
</div> </div>