Skip to content
Snippets Groups Projects
Commit fbd09871 authored by Bryce Johnson's avatar Bryce Johnson
Browse files

Remove turbolinks.

parent e3a5f1df
No related branches found
No related tags found
No related merge requests found
Showing
with 30 additions and 37 deletions
/* eslint-disable func-names, space-before-function-paren, max-len, no-var, one-var, no-restricted-syntax, vars-on-top, no-use-before-define, no-param-reassign, new-cap, no-underscore-dangle, wrap-iife, one-var-declaration-per-line, quotes, prefer-arrow-callback, consistent-return, prefer-template, no-mixed-operators */
/* global Mousetrap */
/* global Turbolinks */
/* global ShortcutsNavigation */
/* global sidebar */
 
Loading
Loading
@@ -80,7 +79,7 @@
ShortcutsIssuable.prototype.editIssue = function() {
var $editBtn;
$editBtn = $('.issuable-edit');
return Turbolinks.visit($editBtn.attr('href'));
return gl.utils.visitUrl($editBtn.attr('href'));
};
 
ShortcutsIssuable.prototype.openSidebarDropdown = function(name) {
Loading
Loading
Loading
Loading
@@ -40,7 +40,7 @@
.on('click', sidebarToggleSelector, () => this.toggleSidebar())
.on('click', pinnedToggleSelector, () => this.togglePinnedState())
.on('click', 'html, body', (e) => this.handleClickEvent(e))
.on('page:change', () => this.renderState())
.on('DOMContentLoaded', () => this.renderState())
.on('todo:toggle', (e, count) => this.updateTodoCount(count));
this.renderState();
}
Loading
Loading
Loading
Loading
@@ -89,7 +89,7 @@
destroy() {
this.cancel();
document.removeEventListener('visibilitychange', this.handleVisibilityChange);
$(document).off('visibilitychange').off('page:before-unload');
$(document).off('visibilitychange').off('beforeunload');
}
 
/* private */
Loading
Loading
@@ -111,8 +111,9 @@
}
 
initPageUnloadHandling() {
// TODO: Consider refactoring in light of turbolinks removal.
// prevent interval continuing after page change, when kept in cache by Turbolinks
$(document).on('page:before-unload', () => this.cancel());
$(document).on('beforeunload', () => this.cancel());
}
 
handleVisibilityChange(e) {
Loading
Loading
/* eslint-disable class-methods-use-this, no-new, func-names, prefer-template, no-unneeded-ternary, object-shorthand, space-before-function-paren, comma-dangle, quote-props, consistent-return, no-else-return, no-param-reassign, max-len */
/* global UsersSelect */
/* global Turbolinks */
 
((global) => {
class Todos {
Loading
Loading
@@ -34,7 +33,7 @@
 
$('form.filter-form').on('submit', function (event) {
event.preventDefault();
Turbolinks.visit(this.action + '&' + $(this).serialize());
gl.utils.visitUrl(this.action + '&' + $(this).serialize());
});
}
 
Loading
Loading
@@ -142,7 +141,7 @@
};
url = gl.utils.mergeUrlParams(pageParams, url);
}
return Turbolinks.visit(url);
return gl.utils.visitUrl(url);
}
}
 
Loading
Loading
@@ -156,7 +155,7 @@
e.preventDefault();
return window.open(todoLink, '_blank');
} else {
return Turbolinks.visit(todoLink);
return gl.utils.visitUrl(todoLink);
}
}
}
Loading
Loading
/* eslint-disable func-names, space-before-function-paren, wrap-iife, max-len, quotes, consistent-return, no-var, one-var, one-var-declaration-per-line, no-else-return, prefer-arrow-callback, max-len */
/* global Turbolinks */
(function() {
this.TreeView = (function() {
function TreeView() {
Loading
Loading
@@ -15,7 +15,7 @@
e.preventDefault();
return window.open(path, '_blank');
} else {
return Turbolinks.visit(path);
return gl.utils.visitUrl(path);
}
}
});
Loading
Loading
@@ -57,7 +57,7 @@
} else if (e.which === 13) {
path = $('.tree-item.selected .tree-item-file-name a').attr('href');
if (path) {
return Turbolinks.visit(path);
return gl.utils.visitUrl(path);
}
}
});
Loading
Loading
Loading
Loading
@@ -149,7 +149,6 @@ content on the Users#show page.
new_state = new_state.replace(/\/+$/, '');
new_state += this._location.search + this._location.hash;
history.replaceState({
turbolinks: true,
url: new_state
}, document.title, new_state);
return new_state;
Loading
Loading
Loading
Loading
@@ -13,6 +13,8 @@
gl.VueGlPagination = Vue.extend({
props: {
 
// TODO: Consider refactoring in light of turbolinks removal.
/**
This function will take the information given by the pagination component
And make a new Turbolinks call
Loading
Loading
@@ -20,7 +22,7 @@
Here is an example `change` method:
 
change(pagenum, apiScope) {
Turbolinks.visit(`?scope=${apiScope}&p=${pagenum}`);
gl.utils.visitUrl(`?scope=${apiScope}&p=${pagenum}`);
},
*/
 
Loading
Loading
/* global Vue, Turbolinks, gl */
/* global Vue, gl */
/* eslint-disable no-param-reassign */
 
((gl) => {
Loading
Loading
@@ -36,7 +36,7 @@
},
methods: {
change(pagenum, apiScope) {
Turbolinks.visit(`?scope=${apiScope}&p=${pagenum}`);
gl.utils.visitUrl(`?scope=${apiScope}&p=${pagenum}`);
},
author(pipeline) {
if (!pipeline.commit) return { avatar_url: '', web_url: '', username: '' };
Loading
Loading
Loading
Loading
@@ -7,12 +7,12 @@
window.removeEventListener('beforeunload', removeIntervals);
window.removeEventListener('focus', startIntervals);
window.removeEventListener('blur', removeIntervals);
document.removeEventListener('page:fetch', removeAll);
document.removeEventListener('beforeunload', removeAll);
};
 
window.addEventListener('beforeunload', removeIntervals);
window.addEventListener('focus', startIntervals);
window.addEventListener('blur', removeIntervals);
document.addEventListener('page:fetch', removeAll);
document.addEventListener('beforeunload', removeAll);
};
})(window.gl || (window.gl = {}));
Loading
Loading
@@ -31,7 +31,6 @@
@import "framework/modal.scss";
@import "framework/nav.scss";
@import "framework/pagination.scss";
@import "framework/progress.scss";
@import "framework/panels.scss";
@import "framework/selects.scss";
@import "framework/sidebar.scss";
Loading
Loading
html.turbolinks-progress-bar::before {
background-color: $progress-color!important;
height: 2px!important;
box-shadow: 0 0 10px $progress-color, 0 0 5px $progress-color;
}
module JavascriptHelper
def page_specific_javascript_tag(js)
javascript_include_tag asset_path(js), { "data-turbolinks-track" => true }
javascript_include_tag asset_path(js)
end
end
Loading
Loading
@@ -6,4 +6,4 @@
- providers.each do |provider|
%span.light
- has_icon = provider_has_icon?(provider)
= link_to provider_image_tag(provider), omniauth_authorize_path(:user, provider), method: :post, class: (has_icon ? 'oauth-image-link' : 'btn'), "data-no-turbolink" => "true"
= link_to provider_image_tag(provider), omniauth_authorize_path(:user, provider), method: :post, class: (has_icon ? 'oauth-image-link' : 'btn')
Loading
Loading
@@ -82,7 +82,7 @@
rather than Git. Please convert
= link_to 'them to Git,', 'https://www.atlassian.com/git/tutorials/migrating-overview'
and go through the
= link_to 'import flow', status_import_bitbucket_path, 'data-no-turbolink' => 'true'
= link_to 'import flow', status_import_bitbucket_path
again.
 
.js-importer-status{ data: { jobs_import_path: "#{jobs_import_bitbucket_path}", import_path: "#{import_bitbucket_path}" } }
Loading
Loading
@@ -33,6 +33,8 @@
- if content_for?(:page_specific_javascripts)
= yield :page_specific_javascripts
 
= yield :scripts_body_top
= csrf_meta_tags
 
- unless browser.safari?
Loading
Loading
Loading
Loading
@@ -4,9 +4,6 @@
%body{ class: "#{user_application_theme}", data: { page: body_data_page, project: "#{@project.path if @project}", group: "#{@group.path if @group}" } }
= Gon::Base.render_data
 
-# Ideally this would be inside the head, but turbolinks only evaluates page-specific JS in the body.
= yield :scripts_body_top
= render "layouts/header/default", title: header_title
= render 'layouts/page', sidebar: sidebar, nav: nav
 
Loading
Loading
Loading
Loading
@@ -82,7 +82,7 @@
= link_to unlink_profile_account_path(provider: provider), method: :delete, class: 'provider-btn' do
Disconnect
- else
= link_to omniauth_authorize_path(:user, provider), method: :post, class: 'provider-btn not-active', "data-no-turbolink" => "true" do
= link_to omniauth_authorize_path(:user, provider), method: :post, class: 'provider-btn not-active' do
Connect
%hr
- if current_user.can_change_username?
Loading
Loading
Loading
Loading
@@ -108,10 +108,10 @@
= render "projects/commit/change", type: 'cherry-pick', commit: @merge_request.merge_commit, title: @merge_request.title
 
:javascript
var merge_request;
merge_request = new MergeRequest({
action: "#{controller.action_name}"
$(function () {
new MergeRequest({
action: "#{controller.action_name}"
});
});
 
var mrRefreshWidgetUrl = "#{mr_widget_refresh_url(@merge_request)}";
Loading
Loading
@@ -50,7 +50,7 @@
= icon('github', text: 'GitHub')
%div
- if bitbucket_import_enabled?
= link_to status_import_bitbucket_path, class: "btn import_bitbucket #{'how_to_import_link' unless bitbucket_import_configured?}", "data-no-turbolink" => "true" do
= link_to status_import_bitbucket_path, class: "btn import_bitbucket #{'how_to_import_link' unless bitbucket_import_configured?}" do
= icon('bitbucket', text: 'Bitbucket')
- unless bitbucket_import_configured?
= render 'bitbucket_import_modal'
Loading
Loading
Loading
Loading
@@ -91,5 +91,5 @@
new SubscriptionSelect();
$('form.filter-form').on('submit', function (event) {
event.preventDefault();
Turbolinks.visit(this.action + '&' + $(this).serialize());
gl.utils.visitUrl(this.action + '&' + $(this).serialize());
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment