Commit 9d63bd1e63669eac7955bf1c0620198154bfba4f
Exists in
master
and in
4 other branches
Merge branch 'feature/turbolinks' of /home/git/repositories/gitlab/gitlabhq
Showing
5 changed files
with
23 additions
and
0 deletions
Show diff stats
Gemfile
Gemfile.lock
... | ... | @@ -232,6 +232,9 @@ GEM |
232 | 232 | jquery-rails (2.1.3) |
233 | 233 | railties (>= 3.1.0, < 5.0) |
234 | 234 | thor (~> 0.14) |
235 | + jquery-turbolinks (1.0.0) | |
236 | + railties (>= 3.1.0) | |
237 | + turbolinks | |
235 | 238 | jquery-ui-rails (2.0.2) |
236 | 239 | jquery-rails |
237 | 240 | railties (>= 3.1.0) |
... | ... | @@ -461,6 +464,8 @@ GEM |
461 | 464 | treetop (1.4.12) |
462 | 465 | polyglot |
463 | 466 | polyglot (>= 0.3.1) |
467 | + turbolinks (1.1.1) | |
468 | + coffee-rails | |
464 | 469 | tzinfo (0.3.37) |
465 | 470 | uglifier (1.3.0) |
466 | 471 | execjs (>= 0.3.0) |
... | ... | @@ -521,6 +526,7 @@ DEPENDENCIES |
521 | 526 | httparty |
522 | 527 | jquery-atwho-rails (= 0.1.7) |
523 | 528 | jquery-rails (= 2.1.3) |
529 | + jquery-turbolinks | |
524 | 530 | jquery-ui-rails (= 2.0.2) |
525 | 531 | kaminari (~> 0.14.1) |
526 | 532 | launchy |
... | ... | @@ -564,5 +570,6 @@ DEPENDENCIES |
564 | 570 | test_after_commit |
565 | 571 | therubyracer |
566 | 572 | thin |
573 | + turbolinks | |
567 | 574 | uglifier (~> 1.3.0) |
568 | 575 | webmock | ... | ... |
app/assets/javascripts/application.js
app/assets/javascripts/main.js.coffee
... | ... | @@ -41,6 +41,14 @@ window.linkify = (str) -> |
41 | 41 | exp = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig |
42 | 42 | return str.replace(exp,"<a href='$1'>$1</a>") |
43 | 43 | |
44 | +window.startSpinner = -> | |
45 | + $('.turbolink-spinner').fadeIn() | |
46 | + | |
47 | +window.stopSpinner = -> | |
48 | + $('.turbolink-spinner').fadeOut() | |
49 | + | |
50 | +document.addEventListener("page:fetch", startSpinner) | |
51 | +document.addEventListener("page:receive", stopSpinner) | |
44 | 52 | |
45 | 53 | $ -> |
46 | 54 | # Click a .one_click_select field, select the contents | ... | ... |
app/views/layouts/_head_panel.html.haml
... | ... | @@ -9,6 +9,10 @@ |
9 | 9 | %h1.project_name= title |
10 | 10 | %ul.nav |
11 | 11 | %li |
12 | + %a | |
13 | + %div.hide.turbolink-spinner | |
14 | + %i.icon-refresh.icon-spin | |
15 | + %li | |
12 | 16 | = render "layouts/search" |
13 | 17 | %li |
14 | 18 | = link_to public_root_path, title: "Public area", class: 'has_bottom_tooltip', 'data-original-title' => 'Public area' do | ... | ... |