[Notice] Announcing the End of Demo Server [Read me]

Merge branch 'enhance/change-spinner' into 'next'
from pull-request 1492 * refs/heads/enhance/change-spinner: loading-ui: replace spinner ui to progressbar lib: add npregress js library Reviewed-by: 백기선
@c6e41f6c8a7a9edc0c0647dfcc6d768bb21ec7cd
--- app/views/common/scripts.scala.html
+++ app/views/common/scripts.scala.html
... | ... | @@ -49,12 +49,6 @@ |
49 | 49 |
</script> |
50 | 50 |
@**<!-- //yobi.ui.Toast -->**@ |
51 | 51 |
|
52 |
-@**<!-- //yobi.ui.Spinner -->**@ |
|
53 |
-<div id="yobiSpinner" class="yobiSpinner"> |
|
54 |
- <div class="spinContainer"></div> |
|
55 |
-</div> |
|
56 |
-@**<!-- //yobi.ui.Spinner -->**@ |
|
57 |
- |
|
58 | 52 |
@if(UserApp.currentUser.isAnonymous){ |
59 | 53 |
@common.loginDialog() |
60 | 54 |
} |
... | ... | @@ -73,7 +67,6 @@ |
73 | 67 |
<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/rgbcolor.js")"></script> |
74 | 68 |
<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/humanize.js")"></script> |
75 | 69 |
<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/validate.js")"></script> |
76 |
-<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/spin.js")"></script> |
|
77 | 70 |
<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/xss.js")"></script> |
78 | 71 |
<script type="text/javascript" src="@routes.Assets.at("javascripts/common/yobi.Attachments.js")"></script> |
79 | 72 |
<script type="text/javascript" src="@routes.Assets.at("javascripts/common/yobi.Files.js")"></script> |
... | ... | @@ -86,7 +79,6 @@ |
86 | 79 |
<script type="text/javascript" src="@routes.Assets.at("javascripts/common/yobi.ui.Dialog.js")"></script> |
87 | 80 |
<script type="text/javascript" src="@routes.Assets.at("javascripts/common/yobi.ui.Toast.js")"></script> |
88 | 81 |
<script type="text/javascript" src="@routes.Assets.at("javascripts/common/yobi.ui.Tabs.js")"></script> |
89 |
-<script type="text/javascript" src="@routes.Assets.at("javascripts/common/yobi.ui.Spinner.js")"></script> |
|
90 | 82 |
<script type="text/javascript" src="@routes.Assets.at("javascripts/common/yobi.OriginalMessage.js")"></script> |
91 | 83 |
|
92 | 84 |
<script type="text/javascript"> |
--- app/views/git/clone.scala.html
+++ app/views/git/clone.scala.html
... | ... | @@ -42,8 +42,7 @@ |
42 | 42 |
</div> |
43 | 43 |
<script type="text/javascript"> |
44 | 44 |
$(function(){ |
45 |
- yobi.ui.Spinner.show(); |
|
46 |
- |
|
45 |
+ NProgress.start(); |
|
47 | 46 |
setTimeout(function(){ |
48 | 47 |
var cloneUrl = "@routes.PullRequestApp.doClone(project.originalProject.owner, project.originalProject.name)"; |
49 | 48 |
var cloneParam = {owner:"@project.owner", name:"@project.name", projectScope:"@project.projectScope.name"}; |
--- app/views/git/list.scala.html
+++ app/views/git/list.scala.html
... | ... | @@ -55,10 +55,10 @@ |
55 | 55 |
// show spinners |
56 | 56 |
$(document).on({ |
57 | 57 |
"pjax:send": function(){ |
58 |
- yobi.ui.Spinner.show(); |
|
58 |
+ NProgress.start(); |
|
59 | 59 |
}, |
60 | 60 |
"pjax:complete": function(){ |
61 |
- yobi.ui.Spinner.hide(); |
|
61 |
+ NProgress.done(); |
|
62 | 62 |
} |
63 | 63 |
}); |
64 | 64 |
}); |
--- app/views/layout.scala.html
+++ app/views/layout.scala.html
... | ... | @@ -33,7 +33,12 @@ |
33 | 33 |
<link rel="stylesheet" type="text/css" media="all" href="@routes.Assets.at("javascripts/lib/select2/select2.css")"/> |
34 | 34 |
<link rel="stylesheet" type="text/css" media="all" href="@routes.Assets.at("javascripts/lib/pikaday/pikaday.css")" /> |
35 | 35 |
<link rel="stylesheet" type="text/css" media="all" href="@routes.Assets.at("stylesheets/yobi.css")"> |
36 |
+<link rel='stylesheet' href="@routes.Assets.at("javascripts/lib/nprogress/nprogress.css")"/> |
|
36 | 37 |
|
38 |
+<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/nprogress/nprogress.js")"></script> |
|
39 |
+<script type="text/javascript"> |
|
40 |
+ NProgress.configure({ minimum: 0.6 }); |
|
41 |
+</script> |
|
37 | 42 |
<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/jquery/jquery-1.9.0.js")"></script> |
38 | 43 |
<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/jquery/jquery.browser.js")"></script> |
39 | 44 |
<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/jquery/jquery.pjax.js")"></script> |
--- public/javascripts/common/yobi.CommentForm.js
+++ public/javascripts/common/yobi.CommentForm.js
... | ... | @@ -67,7 +67,7 @@ |
67 | 67 |
} |
68 | 68 |
|
69 | 69 |
elements.commentForm.data("onsubmit", true); |
70 |
- yobi.ui.Spinner.show(); |
|
70 |
+ NProgress.start(); |
|
71 | 71 |
return true; |
72 | 72 |
} |
73 | 73 |
|
... | ... | @@ -98,7 +98,7 @@ |
98 | 98 |
*/ |
99 | 99 |
function onKeydownWindow(evt){ |
100 | 100 |
if (isEscapeKeyPressed(evt) && isOnSubmit()){ |
101 |
- yobi.ui.Spinner.hide(); |
|
101 |
+ NProgress.done(); |
|
102 | 102 |
elements.commentForm.data("onsubmit", false); |
103 | 103 |
} |
104 | 104 |
} |
--- public/javascripts/common/yobi.ui.Spinner.js
... | ... | @@ -1,125 +0,0 @@ |
1 | -/** | |
2 | - * Yobi, Project Hosting SW | |
3 | - * | |
4 | - * Copyright 2014 NAVER Corp. | |
5 | - * http://yobi.io | |
6 | - * | |
7 | - * @author Jihan Kim | |
8 | - * | |
9 | - * Licensed under the Apache License, Version 2.0 (the "License"); | |
10 | - * you may not use this file except in compliance with the License. | |
11 | - * You may obtain a copy of the License at | |
12 | - * | |
13 | - * http://www.apache.org/licenses/LICENSE-2.0 | |
14 | - * | |
15 | - * Unless required by applicable law or agreed to in writing, software | |
16 | - * distributed under the License is distributed on an "AS IS" BASIS, | |
17 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
18 | - * See the License for the specific language governing permissions and | |
19 | - * limitations under the License. | |
20 | - */ | |
21 | -/** | |
22 | - * Method: | |
23 | - * yobi.ui.Spinner.show() | |
24 | - * yobi.ui.Spinner.hide() | |
25 | - * | |
26 | - * @requires spin.js (http://fgnass.github.io/spin.js) | |
27 | - */ | |
28 | -(function(ns){ | |
29 | - | |
30 | - var oNS = $yobi.createNamespace(ns); | |
31 | - oNS.container[oNS.name] = (function(htOptions){ | |
32 | - | |
33 | - var htVar = {}; | |
34 | - var htElement = {}; | |
35 | - | |
36 | - /** | |
37 | - * Initialize | |
38 | - * @param htOptions | |
39 | - * @private | |
40 | - */ | |
41 | - function _init(htOptions){ | |
42 | - _initVar(htOptions); | |
43 | - _initElement(); | |
44 | - } | |
45 | - | |
46 | - /** | |
47 | - * Initialize Variables | |
48 | - * @param htOptions | |
49 | - * @private | |
50 | - */ | |
51 | - function _initVar(htOptions){ | |
52 | - htVar.htOptions = $.extend({ // -- Default Options | |
53 | - "lines" : 11, // The number of lines to draw | |
54 | - "length" : 26, // The length of each line | |
55 | - "width" : 7, // The line thickness | |
56 | - "radius" : 19, // The radius of the inner circle | |
57 | - "corners" : 1, // Corner roundness (0..1) | |
58 | - "rotate" : 0, // The rotation offset | |
59 | - "direction": -1, // 1: clockwise, -1: counterclockwise | |
60 | - "color" : "#bbb", // #rgb or #rrggbb or array of colors | |
61 | - "speed" : 1.5, // Rounds per second | |
62 | - "trail" : 66, // Afterglow percentage | |
63 | - "shadow" : false, // Whether to render a shadow | |
64 | - "hwaccel" : true, // Whether to use hardware acceleration | |
65 | - "className": "spinner", // The CSS class to assign to the spinner | |
66 | - "zIndex" : 2e9, // The z-index (defaults to 2000000000) | |
67 | - "top" : "auto", // Top position relative to parent in px | |
68 | - "left" : "auto" // Left position relative to parent in px | |
69 | - }, htOptions); | |
70 | - | |
71 | - htVar.oSpinner = new Spinner(htVar.htOptions); | |
72 | - } | |
73 | - | |
74 | - /** | |
75 | - * Initialize Elements | |
76 | - * @private | |
77 | - */ | |
78 | - function _initElement(){ | |
79 | - htElement.welWrapper = $("#yobiSpinner"); | |
80 | - htElement.welContainer = htElement.welWrapper.find(".spinContainer"); | |
81 | - } | |
82 | - | |
83 | - /** | |
84 | - * Show spinner | |
85 | - * @private | |
86 | - */ | |
87 | - function _showSpinner(htOptions){ | |
88 | - var bUseDimmer = (htOptions && typeof htOptions.bUseDimmer !== "undefined") ? | |
89 | - htOptions.bUseDimmer : false; | |
90 | - var sBackground = bUseDimmer ? "rgba(0,0,0,0.4)": "transparent"; | |
91 | - | |
92 | - htVar.oSpinner.spin(); | |
93 | - htElement.welContainer.append(htVar.oSpinner.el); | |
94 | - | |
95 | - htElement.welWrapper.css("background", sBackground); | |
96 | - htElement.welWrapper.show(); | |
97 | - } | |
98 | - | |
99 | - /** | |
100 | - * Hide spinner | |
101 | - * @private | |
102 | - */ | |
103 | - function _hideSpinner(){ | |
104 | - htElement.welWrapper.hide(); | |
105 | - htVar.oSpinner.stop(); | |
106 | - } | |
107 | - | |
108 | - _init(htOptions || {}); | |
109 | - | |
110 | - // public interfaces | |
111 | - return { | |
112 | - "show": _showSpinner, | |
113 | - "hide": _hideSpinner | |
114 | - }; | |
115 | - })(); | |
116 | - | |
117 | -})("yobi.ui.Spinner"); | |
118 | - | |
119 | -$(document).ready(function(){ | |
120 | - if(navigator.userAgent.indexOf("Safari") > -1){ | |
121 | - $(window).on("beforeunload", function(){ | |
122 | - yobi.ui.Spinner.hide(); | |
123 | - }); | |
124 | - } | |
125 | -}); |
+++ public/javascripts/lib/nprogress/nprogress.css
... | ... | @@ -0,0 +1,70 @@ |
1 | +/* Make clicks pass-through */ | |
2 | +#nprogress { | |
3 | + pointer-events: none; | |
4 | +} | |
5 | + | |
6 | +#nprogress .bar { | |
7 | + background: #27abe1; | |
8 | + | |
9 | + position: fixed; | |
10 | + z-index: 1031; | |
11 | + top: 0px; | |
12 | + left: 0; | |
13 | + | |
14 | + width: 100%; | |
15 | + height: 3px; | |
16 | +} | |
17 | + | |
18 | +/* Fancy blur effect */ | |
19 | +#nprogress .peg { | |
20 | + display: block; | |
21 | + position: absolute; | |
22 | + right: 0px; | |
23 | + width: 3px; | |
24 | + height: 100%; | |
25 | + box-shadow: 0 0 10px #fe6431, 0 0 5px #f3f3f3; | |
26 | + opacity: 1.0; | |
27 | +} | |
28 | + | |
29 | +/* Remove these to get rid of the spinner */ | |
30 | +#nprogress .spinner { | |
31 | + display: block; | |
32 | + position: fixed; | |
33 | + z-index: 1031; | |
34 | + top: 12px; | |
35 | + left: 15px; | |
36 | +} | |
37 | + | |
38 | +#nprogress .spinner-icon { | |
39 | + width: 15px; | |
40 | + height: 15px; | |
41 | + box-sizing: border-box; | |
42 | + | |
43 | + border: solid 3px transparent; | |
44 | + border-top-color: #29d; | |
45 | + border-left-color: #29d; | |
46 | + border-radius: 50%; | |
47 | + | |
48 | + -webkit-animation: nprogress-spinner 400ms linear infinite; | |
49 | + animation: nprogress-spinner 400ms linear infinite; | |
50 | +} | |
51 | + | |
52 | +.nprogress-custom-parent { | |
53 | + overflow: hidden; | |
54 | + position: relative; | |
55 | +} | |
56 | + | |
57 | +.nprogress-custom-parent #nprogress .spinner, | |
58 | +.nprogress-custom-parent #nprogress .bar { | |
59 | + position: absolute; | |
60 | +} | |
61 | + | |
62 | +@-webkit-keyframes nprogress-spinner { | |
63 | + 0% { -webkit-transform: rotate(0deg); } | |
64 | + 100% { -webkit-transform: rotate(360deg); } | |
65 | +} | |
66 | +@keyframes nprogress-spinner { | |
67 | + 0% { transform: rotate(0deg); } | |
68 | + 100% { transform: rotate(360deg); } | |
69 | +} | |
70 | + |
+++ public/javascripts/lib/nprogress/nprogress.js
... | ... | @@ -0,0 +1,476 @@ |
1 | +/* NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress | |
2 | + * @license MIT */ | |
3 | + | |
4 | +;(function(root, factory) { | |
5 | + | |
6 | + if (typeof define === 'function' && define.amd) { | |
7 | + define(factory); | |
8 | + } else if (typeof exports === 'object') { | |
9 | + module.exports = factory(); | |
10 | + } else { | |
11 | + root.NProgress = factory(); | |
12 | + } | |
13 | + | |
14 | +})(this, function() { | |
15 | + var NProgress = {}; | |
16 | + | |
17 | + NProgress.version = '0.1.6'; | |
18 | + | |
19 | + var Settings = NProgress.settings = { | |
20 | + minimum: 0.08, | |
21 | + easing: 'ease', | |
22 | + positionUsing: '', | |
23 | + speed: 200, | |
24 | + trickle: true, | |
25 | + trickleRate: 0.02, | |
26 | + trickleSpeed: 800, | |
27 | + showSpinner: true, | |
28 | + barSelector: '[role="bar"]', | |
29 | + spinnerSelector: '[role="spinner"]', | |
30 | + parent: 'body', | |
31 | + template: '<div class="bar" role="bar"><div class="peg"></div></div><div class="spinner" role="spinner"><div class="spinner-icon"></div></div>' | |
32 | + }; | |
33 | + | |
34 | + /** | |
35 | + * Updates configuration. | |
36 | + * | |
37 | + * NProgress.configure({ | |
38 | + * minimum: 0.1 | |
39 | + * }); | |
40 | + */ | |
41 | + NProgress.configure = function(options) { | |
42 | + var key, value; | |
43 | + for (key in options) { | |
44 | + value = options[key]; | |
45 | + if (value !== undefined && options.hasOwnProperty(key)) Settings[key] = value; | |
46 | + } | |
47 | + | |
48 | + return this; | |
49 | + }; | |
50 | + | |
51 | + /** | |
52 | + * Last number. | |
53 | + */ | |
54 | + | |
55 | + NProgress.status = null; | |
56 | + | |
57 | + /** | |
58 | + * Sets the progress bar status, where `n` is a number from `0.0` to `1.0`. | |
59 | + * | |
60 | + * NProgress.set(0.4); | |
61 | + * NProgress.set(1.0); | |
62 | + */ | |
63 | + | |
64 | + NProgress.set = function(n) { | |
65 | + var started = NProgress.isStarted(); | |
66 | + | |
67 | + n = clamp(n, Settings.minimum, 1); | |
68 | + NProgress.status = (n === 1 ? null : n); | |
69 | + | |
70 | + var progress = NProgress.render(!started), | |
71 | + bar = progress.querySelector(Settings.barSelector), | |
72 | + speed = Settings.speed, | |
73 | + ease = Settings.easing; | |
74 | + | |
75 | + progress.offsetWidth; /* Repaint */ | |
76 | + | |
77 | + queue(function(next) { | |
78 | + // Set positionUsing if it hasn't already been set | |
79 | + if (Settings.positionUsing === '') Settings.positionUsing = NProgress.getPositioningCSS(); | |
80 | + | |
81 | + // Add transition | |
82 | + css(bar, barPositionCSS(n, speed, ease)); | |
83 | + | |
84 | + if (n === 1) { | |
85 | + // Fade out | |
86 | + css(progress, { | |
87 | + transition: 'none', | |
88 | + opacity: 1 | |
89 | + }); | |
90 | + progress.offsetWidth; /* Repaint */ | |
91 | + | |
92 | + setTimeout(function() { | |
93 | + css(progress, { | |
94 | + transition: 'all ' + speed + 'ms linear', | |
95 | + opacity: 0 | |
96 | + }); | |
97 | + setTimeout(function() { | |
98 | + NProgress.remove(); | |
99 | + next(); | |
100 | + }, speed); | |
101 | + }, speed); | |
102 | + } else { | |
103 | + setTimeout(next, speed); | |
104 | + } | |
105 | + }); | |
106 | + | |
107 | + return this; | |
108 | + }; | |
109 | + | |
110 | + NProgress.isStarted = function() { | |
111 | + return typeof NProgress.status === 'number'; | |
112 | + }; | |
113 | + | |
114 | + /** | |
115 | + * Shows the progress bar. | |
116 | + * This is the same as setting the status to 0%, except that it doesn't go backwards. | |
117 | + * | |
118 | + * NProgress.start(); | |
119 | + * | |
120 | + */ | |
121 | + NProgress.start = function() { | |
122 | + if (!NProgress.status) NProgress.set(0); | |
123 | + | |
124 | + var work = function() { | |
125 | + setTimeout(function() { | |
126 | + if (!NProgress.status) return; | |
127 | + NProgress.trickle(); | |
128 | + work(); | |
129 | + }, Settings.trickleSpeed); | |
130 | + }; | |
131 | + | |
132 | + if (Settings.trickle) work(); | |
133 | + | |
134 | + return this; | |
135 | + }; | |
136 | + | |
137 | + /** | |
138 | + * Hides the progress bar. | |
139 | + * This is the *sort of* the same as setting the status to 100%, with the | |
140 | + * difference being `done()` makes some placebo effect of some realistic motion. | |
141 | + * | |
142 | + * NProgress.done(); | |
143 | + * | |
144 | + * If `true` is passed, it will show the progress bar even if its hidden. | |
145 | + * | |
146 | + * NProgress.done(true); | |
147 | + */ | |
148 | + | |
149 | + NProgress.done = function(force) { | |
150 | + if (!force && !NProgress.status) return this; | |
151 | + | |
152 | + return NProgress.inc(0.3 + 0.5 * Math.random()).set(1); | |
153 | + }; | |
154 | + | |
155 | + /** | |
156 | + * Increments by a random amount. | |
157 | + */ | |
158 | + | |
159 | + NProgress.inc = function(amount) { | |
160 | + var n = NProgress.status; | |
161 | + | |
162 | + if (!n) { | |
163 | + return NProgress.start(); | |
164 | + } else { | |
165 | + if (typeof amount !== 'number') { | |
166 | + amount = (1 - n) * clamp(Math.random() * n, 0.1, 0.95); | |
167 | + } | |
168 | + | |
169 | + n = clamp(n + amount, 0, 0.994); | |
170 | + return NProgress.set(n); | |
171 | + } | |
172 | + }; | |
173 | + | |
174 | + NProgress.trickle = function() { | |
175 | + return NProgress.inc(Math.random() * Settings.trickleRate); | |
176 | + }; | |
177 | + | |
178 | + /** | |
179 | + * Waits for all supplied jQuery promises and | |
180 | + * increases the progress as the promises resolve. | |
181 | + * | |
182 | + * @param $promise jQUery Promise | |
183 | + */ | |
184 | + (function() { | |
185 | + var initial = 0, current = 0; | |
186 | + | |
187 | + NProgress.promise = function($promise) { | |
188 | + if (!$promise || $promise.state() == "resolved") { | |
189 | + return this; | |
190 | + } | |
191 | + | |
192 | + if (current == 0) { | |
193 | + NProgress.start(); | |
194 | + } | |
195 | + | |
196 | + initial++; | |
197 | + current++; | |
198 | + | |
199 | + $promise.always(function() { | |
200 | + current--; | |
201 | + if (current == 0) { | |
202 | + initial = 0; | |
203 | + NProgress.done(); | |
204 | + } else { | |
205 | + NProgress.set((initial - current) / initial); | |
206 | + } | |
207 | + }); | |
208 | + | |
209 | + return this; | |
210 | + }; | |
211 | + | |
212 | + })(); | |
213 | + | |
214 | + /** | |
215 | + * (Internal) renders the progress bar markup based on the `template` | |
216 | + * setting. | |
217 | + */ | |
218 | + | |
219 | + NProgress.render = function(fromStart) { | |
220 | + if (NProgress.isRendered()) return document.getElementById('nprogress'); | |
221 | + | |
222 | + addClass(document.documentElement, 'nprogress-busy'); | |
223 | + | |
224 | + var progress = document.createElement('div'); | |
225 | + progress.id = 'nprogress'; | |
226 | + progress.innerHTML = Settings.template; | |
227 | + | |
228 | + var bar = progress.querySelector(Settings.barSelector), | |
229 | + perc = fromStart ? '-100' : toBarPerc(NProgress.status || 0), | |
230 | + parent = document.querySelector(Settings.parent), | |
231 | + spinner; | |
232 | + | |
233 | + css(bar, { | |
234 | + transition: 'all 0 linear', | |
235 | + transform: 'translate3d(' + perc + '%,0,0)' | |
236 | + }); | |
237 | + | |
238 | + if (!Settings.showSpinner) { | |
239 | + spinner = progress.querySelector(Settings.spinnerSelector); | |
240 | + spinner && removeElement(spinner); | |
241 | + } | |
242 | + | |
243 | + if (parent != document.body) { | |
244 | + addClass(parent, 'nprogress-custom-parent'); | |
245 | + } | |
246 | + | |
247 | + parent.appendChild(progress); | |
248 | + return progress; | |
249 | + }; | |
250 | + | |
251 | + /** | |
252 | + * Removes the element. Opposite of render(). | |
253 | + */ | |
254 | + | |
255 | + NProgress.remove = function() { | |
256 | + removeClass(document.documentElement, 'nprogress-busy'); | |
257 | + removeClass(document.querySelector(Settings.parent), 'nprogress-custom-parent') | |
258 | + var progress = document.getElementById('nprogress'); | |
259 | + progress && removeElement(progress); | |
260 | + }; | |
261 | + | |
262 | + /** | |
263 | + * Checks if the progress bar is rendered. | |
264 | + */ | |
265 | + | |
266 | + NProgress.isRendered = function() { | |
267 | + return !!document.getElementById('nprogress'); | |
268 | + }; | |
269 | + | |
270 | + /** | |
271 | + * Determine which positioning CSS rule to use. | |
272 | + */ | |
273 | + | |
274 | + NProgress.getPositioningCSS = function() { | |
275 | + // Sniff on document.body.style | |
276 | + var bodyStyle = document.body.style; | |
277 | + | |
278 | + // Sniff prefixes | |
279 | + var vendorPrefix = ('WebkitTransform' in bodyStyle) ? 'Webkit' : | |
280 | + ('MozTransform' in bodyStyle) ? 'Moz' : | |
281 | + ('msTransform' in bodyStyle) ? 'ms' : | |
282 | + ('OTransform' in bodyStyle) ? 'O' : ''; | |
283 | + | |
284 | + if (vendorPrefix + 'Perspective' in bodyStyle) { | |
285 | + // Modern browsers with 3D support, e.g. Webkit, IE10 | |
286 | + return 'translate3d'; | |
287 | + } else if (vendorPrefix + 'Transform' in bodyStyle) { | |
288 | + // Browsers without 3D support, e.g. IE9 | |
289 | + return 'translate'; | |
290 | + } else { | |
291 | + // Browsers without translate() support, e.g. IE7-8 | |
292 | + return 'margin'; | |
293 | + } | |
294 | + }; | |
295 | + | |
296 | + /** | |
297 | + * Helpers | |
298 | + */ | |
299 | + | |
300 | + function clamp(n, min, max) { | |
301 | + if (n < min) return min; | |
302 | + if (n > max) return max; | |
303 | + return n; | |
304 | + } | |
305 | + | |
306 | + /** | |
307 | + * (Internal) converts a percentage (`0..1`) to a bar translateX | |
308 | + * percentage (`-100%..0%`). | |
309 | + */ | |
310 | + | |
311 | + function toBarPerc(n) { | |
312 | + return (-1 + n) * 100; | |
313 | + } | |
314 | + | |
315 | + | |
316 | + /** | |
317 | + * (Internal) returns the correct CSS for changing the bar's | |
318 | + * position given an n percentage, and speed and ease from Settings | |
319 | + */ | |
320 | + | |
321 | + function barPositionCSS(n, speed, ease) { | |
322 | + var barCSS; | |
323 | + | |
324 | + if (Settings.positionUsing === 'translate3d') { | |
325 | + barCSS = { transform: 'translate3d('+toBarPerc(n)+'%,0,0)' }; | |
326 | + } else if (Settings.positionUsing === 'translate') { | |
327 | + barCSS = { transform: 'translate('+toBarPerc(n)+'%,0)' }; | |
328 | + } else { | |
329 | + barCSS = { 'margin-left': toBarPerc(n)+'%' }; | |
330 | + } | |
331 | + | |
332 | + barCSS.transition = 'all '+speed+'ms '+ease; | |
333 | + | |
334 | + return barCSS; | |
335 | + } | |
336 | + | |
337 | + /** | |
338 | + * (Internal) Queues a function to be executed. | |
339 | + */ | |
340 | + | |
341 | + var queue = (function() { | |
342 | + var pending = []; | |
343 | + | |
344 | + function next() { | |
345 | + var fn = pending.shift(); | |
346 | + if (fn) { | |
347 | + fn(next); | |
348 | + } | |
349 | + } | |
350 | + | |
351 | + return function(fn) { | |
352 | + pending.push(fn); | |
353 | + if (pending.length == 1) next(); | |
354 | + }; | |
355 | + })(); | |
356 | + | |
357 | + /** | |
358 | + * (Internal) Applies css properties to an element, similar to the jQuery | |
359 | + * css method. | |
360 | + * | |
361 | + * While this helper does assist with vendor prefixed property names, it | |
362 | + * does not perform any manipulation of values prior to setting styles. | |
363 | + */ | |
364 | + | |
365 | + var css = (function() { | |
366 | + var cssPrefixes = [ 'Webkit', 'O', 'Moz', 'ms' ], | |
367 | + cssProps = {}; | |
368 | + | |
369 | + function camelCase(string) { | |
370 | + return string.replace(/^-ms-/, 'ms-').replace(/-([\da-z])/gi, function(match, letter) { | |
371 | + return letter.toUpperCase(); | |
372 | + }); | |
373 | + } | |
374 | + | |
375 | + function getVendorProp(name) { | |
376 | + var style = document.body.style; | |
377 | + if (name in style) return name; | |
378 | + | |
379 | + var i = cssPrefixes.length, | |
380 | + capName = name.charAt(0).toUpperCase() + name.slice(1), | |
381 | + vendorName; | |
382 | + while (i--) { | |
383 | + vendorName = cssPrefixes[i] + capName; | |
384 | + if (vendorName in style) return vendorName; | |
385 | + } | |
386 | + | |
387 | + return name; | |
388 | + } | |
389 | + | |
390 | + function getStyleProp(name) { | |
391 | + name = camelCase(name); | |
392 | + return cssProps[name] || (cssProps[name] = getVendorProp(name)); | |
393 | + } | |
394 | + | |
395 | + function applyCss(element, prop, value) { | |
396 | + prop = getStyleProp(prop); | |
397 | + element.style[prop] = value; | |
398 | + } | |
399 | + | |
400 | + return function(element, properties) { | |
401 | + var args = arguments, | |
402 | + prop, | |
403 | + value; | |
404 | + | |
405 | + if (args.length == 2) { | |
406 | + for (prop in properties) { | |
407 | + value = properties[prop]; | |
408 | + if (value !== undefined && properties.hasOwnProperty(prop)) applyCss(element, prop, value); | |
409 | + } | |
410 | + } else { | |
411 | + applyCss(element, args[1], args[2]); | |
412 | + } | |
413 | + } | |
414 | + })(); | |
415 | + | |
416 | + /** | |
417 | + * (Internal) Determines if an element or space separated list of class names contains a class name. | |
418 | + */ | |
419 | + | |
420 | + function hasClass(element, name) { | |
421 | + var list = typeof element == 'string' ? element : classList(element); | |
422 | + return list.indexOf(' ' + name + ' ') >= 0; | |
423 | + } | |
424 | + | |
425 | + /** | |
426 | + * (Internal) Adds a class to an element. | |
427 | + */ | |
428 | + | |
429 | + function addClass(element, name) { | |
430 | + var oldList = classList(element), | |
431 | + newList = oldList + name; | |
432 | + | |
433 | + if (hasClass(oldList, name)) return; | |
434 | + | |
435 | + // Trim the opening space. | |
436 | + element.className = newList.substring(1); | |
437 | + } | |
438 | + | |
439 | + /** | |
440 | + * (Internal) Removes a class from an element. | |
441 | + */ | |
442 | + | |
443 | + function removeClass(element, name) { | |
444 | + var oldList = classList(element), | |
445 | + newList; | |
446 | + | |
447 | + if (!hasClass(element, name)) return; | |
448 | + | |
449 | + // Replace the class name. | |
450 | + newList = oldList.replace(' ' + name + ' ', ' '); | |
451 | + | |
452 | + // Trim the opening and closing spaces. | |
453 | + element.className = newList.substring(1, newList.length - 1); | |
454 | + } | |
455 | + | |
456 | + /** | |
457 | + * (Internal) Gets a space separated list of the class names on the element. | |
458 | + * The list is wrapped with a single space on each end to facilitate finding | |
459 | + * matches within the list. | |
460 | + */ | |
461 | + | |
462 | + function classList(element) { | |
463 | + return (' ' + (element.className || '') + ' ').replace(/\s+/gi, ' '); | |
464 | + } | |
465 | + | |
466 | + /** | |
467 | + * (Internal) Removes an element from the DOM. | |
468 | + */ | |
469 | + | |
470 | + function removeElement(element) { | |
471 | + element && element.parentNode && element.parentNode.removeChild(element); | |
472 | + } | |
473 | + | |
474 | + return NProgress; | |
475 | +}); | |
476 | + |
--- public/javascripts/lib/spin.js
... | ... | @@ -1,349 +0,0 @@ |
1 | -//fgnass.github.com/spin.js#v1.3 | |
2 | - | |
3 | -/** | |
4 | - * Copyright (c) 2011-2013 Felix Gnass | |
5 | - * Licensed under the MIT license | |
6 | - */ | |
7 | -(function(root, factory) { | |
8 | - | |
9 | - /* CommonJS */ | |
10 | - if (typeof exports == 'object') module.exports = factory() | |
11 | - | |
12 | - /* AMD module */ | |
13 | - else if (typeof define == 'function' && define.amd) define(factory) | |
14 | - | |
15 | - /* Browser global */ | |
16 | - else root.Spinner = factory() | |
17 | -} | |
18 | -(this, function() { | |
19 | - "use strict"; | |
20 | - | |
21 | - var prefixes = ['webkit', 'Moz', 'ms', 'O'] /* Vendor prefixes */ | |
22 | - , animations = {} /* Animation rules keyed by their name */ | |
23 | - , useCssAnimations /* Whether to use CSS animations or setTimeout */ | |
24 | - | |
25 | - /** | |
26 | - * Utility function to create elements. If no tag name is given, | |
27 | - * a DIV is created. Optionally properties can be passed. | |
28 | - */ | |
29 | - function createEl(tag, prop) { | |
30 | - var el = document.createElement(tag || 'div') | |
31 | - , n | |
32 | - | |
33 | - for(n in prop) el[n] = prop[n] | |
34 | - return el | |
35 | - } | |
36 | - | |
37 | - /** | |
38 | - * Appends children and returns the parent. | |
39 | - */ | |
40 | - function ins(parent /* child1, child2, ...*/) { | |
41 | - for (var i=1, n=arguments.length; i<n; i++) | |
42 | - parent.appendChild(arguments[i]) | |
43 | - | |
44 | - return parent | |
45 | - } | |
46 | - | |
47 | - /** | |
48 | - * Insert a new stylesheet to hold the @keyframe or VML rules. | |
49 | - */ | |
50 | - var sheet = (function() { | |
51 | - var el = createEl('style', {type : 'text/css'}) | |
52 | - ins(document.getElementsByTagName('head')[0], el) | |
53 | - return el.sheet || el.styleSheet | |
54 | - }()) | |
55 | - | |
56 | - /** | |
57 | - * Creates an opacity keyframe animation rule and returns its name. | |
58 | - * Since most mobile Webkits have timing issues with animation-delay, | |
59 | - * we create separate rules for each line/segment. | |
60 | - */ | |
61 | - function addAnimation(alpha, trail, i, lines) { | |
62 | - var name = ['opacity', trail, ~~(alpha*100), i, lines].join('-') | |
63 | - , start = 0.01 + i/lines * 100 | |
64 | - , z = Math.max(1 - (1-alpha) / trail * (100-start), alpha) | |
65 | - , prefix = useCssAnimations.substring(0, useCssAnimations.indexOf('Animation')).toLowerCase() | |
66 | - , pre = prefix && '-' + prefix + '-' || '' | |
67 | - | |
68 | - if (!animations[name]) { | |
69 | - sheet.insertRule( | |
70 | - '@' + pre + 'keyframes ' + name + '{' + | |
71 | - '0%{opacity:' + z + '}' + | |
72 | - start + '%{opacity:' + alpha + '}' + | |
73 | - (start+0.01) + '%{opacity:1}' + | |
74 | - (start+trail) % 100 + '%{opacity:' + alpha + '}' + | |
75 | - '100%{opacity:' + z + '}' + | |
76 | - '}', sheet.cssRules.length) | |
77 | - | |
78 | - animations[name] = 1 | |
79 | - } | |
80 | - | |
81 | - return name | |
82 | - } | |
83 | - | |
84 | - /** | |
85 | - * Tries various vendor prefixes and returns the first supported property. | |
86 | - */ | |
87 | - function vendor(el, prop) { | |
88 | - var s = el.style | |
89 | - , pp | |
90 | - , i | |
91 | - | |
92 | - if(s[prop] !== undefined) return prop | |
93 | - prop = prop.charAt(0).toUpperCase() + prop.slice(1) | |
94 | - for(i=0; i<prefixes.length; i++) { | |
95 | - pp = prefixes[i]+prop | |
96 | - if(s[pp] !== undefined) return pp | |
97 | - } | |
98 | - } | |
99 | - | |
100 | - /** | |
101 | - * Sets multiple style properties at once. | |
102 | - */ | |
103 | - function css(el, prop) { | |
104 | - for (var n in prop) | |
105 | - el.style[vendor(el, n)||n] = prop[n] | |
106 | - | |
107 | - return el | |
108 | - } | |
109 | - | |
110 | - /** | |
111 | - * Fills in default values. | |
112 | - */ | |
113 | - function merge(obj) { | |
114 | - for (var i=1; i < arguments.length; i++) { | |
115 | - var def = arguments[i] | |
116 | - for (var n in def) | |
117 | - if (obj[n] === undefined) obj[n] = def[n] | |
118 | - } | |
119 | - return obj | |
120 | - } | |
121 | - | |
122 | - /** | |
123 | - * Returns the absolute page-offset of the given element. | |
124 | - */ | |
125 | - function pos(el) { | |
126 | - var o = { x:el.offsetLeft, y:el.offsetTop } | |
127 | - while((el = el.offsetParent)) | |
128 | - o.x+=el.offsetLeft, o.y+=el.offsetTop | |
129 | - | |
130 | - return o | |
131 | - } | |
132 | - | |
133 | - // Built-in defaults | |
134 | - | |
135 | - var defaults = { | |
136 | - lines: 12, // The number of lines to draw | |
137 | - length: 7, // The length of each line | |
138 | - width: 5, // The line thickness | |
139 | - radius: 10, // The radius of the inner circle | |
140 | - rotate: 0, // Rotation offset | |
141 | - corners: 1, // Roundness (0..1) | |
142 | - color: '#000', // #rgb or #rrggbb | |
143 | - direction: 1, // 1: clockwise, -1: counterclockwise | |
144 | - speed: 1, // Rounds per second | |
145 | - trail: 100, // Afterglow percentage | |
146 | - opacity: 1/4, // Opacity of the lines | |
147 | - fps: 20, // Frames per second when using setTimeout() | |
148 | - zIndex: 2e9, // Use a high z-index by default | |
149 | - className: 'spinner', // CSS class to assign to the element | |
150 | - top: 'auto', // center vertically | |
151 | - left: 'auto', // center horizontally | |
152 | - position: 'relative' // element position | |
153 | - } | |
154 | - | |
155 | - /** The constructor */ | |
156 | - function Spinner(o) { | |
157 | - if (typeof this == 'undefined') return new Spinner(o) | |
158 | - this.opts = merge(o || {}, Spinner.defaults, defaults) | |
159 | - } | |
160 | - | |
161 | - // Global defaults that override the built-ins: | |
162 | - Spinner.defaults = {} | |
163 | - | |
164 | - merge(Spinner.prototype, { | |
165 | - | |
166 | - /** | |
167 | - * Adds the spinner to the given target element. If this instance is already | |
168 | - * spinning, it is automatically removed from its previous target b calling | |
169 | - * stop() internally. | |
170 | - */ | |
171 | - spin: function(target) { | |
172 | - this.stop() | |
173 | - | |
174 | - var self = this | |
175 | - , o = self.opts | |
176 | - , el = self.el = css(createEl(0, {className: o.className}), {position: o.position, width: 0, zIndex: o.zIndex}) | |
177 | - , mid = o.radius+o.length+o.width | |
178 | - , ep // element position | |
179 | - , tp // target position | |
180 | - | |
181 | - if (target) { | |
182 | - target.insertBefore(el, target.firstChild||null) | |
183 | - tp = pos(target) | |
184 | - ep = pos(el) | |
185 | - css(el, { | |
186 | - left: (o.left == 'auto' ? tp.x-ep.x + (target.offsetWidth >> 1) : parseInt(o.left, 10) + mid) + 'px', | |
187 | - top: (o.top == 'auto' ? tp.y-ep.y + (target.offsetHeight >> 1) : parseInt(o.top, 10) + mid) + 'px' | |
188 | - }) | |
189 | - } | |
190 | - | |
191 | - el.setAttribute('role', 'progressbar') | |
192 | - self.lines(el, self.opts) | |
193 | - | |
194 | - if (!useCssAnimations) { | |
195 | - // No CSS animation support, use setTimeout() instead | |
196 | - var i = 0 | |
197 | - , start = (o.lines - 1) * (1 - o.direction) / 2 | |
198 | - , alpha | |
199 | - , fps = o.fps | |
200 | - , f = fps/o.speed | |
201 | - , ostep = (1-o.opacity) / (f*o.trail / 100) | |
202 | - , astep = f/o.lines | |
203 | - | |
204 | - ;(function anim() { | |
205 | - i++; | |
206 | - for (var j = 0; j < o.lines; j++) { | |
207 | - alpha = Math.max(1 - (i + (o.lines - j) * astep) % f * ostep, o.opacity) | |
208 | - | |
209 | - self.opacity(el, j * o.direction + start, alpha, o) | |
210 | - } | |
211 | - self.timeout = self.el && setTimeout(anim, ~~(1000/fps)) | |
212 | - })() | |
213 | - } | |
214 | - return self | |
215 | - }, | |
216 | - | |
217 | - /** | |
218 | - * Stops and removes the Spinner. | |
219 | - */ | |
220 | - stop: function() { | |
221 | - var el = this.el | |
222 | - if (el) { | |
223 | - clearTimeout(this.timeout) | |
224 | - if (el.parentNode) el.parentNode.removeChild(el) | |
225 | - this.el = undefined | |
226 | - } | |
227 | - return this | |
228 | - }, | |
229 | - | |
230 | - /** | |
231 | - * Internal method that draws the individual lines. Will be overwritten | |
232 | - * in VML fallback mode below. | |
233 | - */ | |
234 | - lines: function(el, o) { | |
235 | - var i = 0 | |
236 | - , start = (o.lines - 1) * (1 - o.direction) / 2 | |
237 | - , seg | |
238 | - | |
239 | - function fill(color, shadow) { | |
240 | - return css(createEl(), { | |
241 | - position: 'absolute', | |
242 | - width: (o.length+o.width) + 'px', | |
243 | - height: o.width + 'px', | |
244 | - background: color, | |
245 | - boxShadow: shadow, | |
246 | - transformOrigin: 'left', | |
247 | - transform: 'rotate(' + ~~(360/o.lines*i+o.rotate) + 'deg) translate(' + o.radius+'px' +',0)', | |
248 | - borderRadius: (o.corners * o.width>>1) + 'px' | |
249 | - }) | |
250 | - } | |
251 | - | |
252 | - for (; i < o.lines; i++) { | |
253 | - seg = css(createEl(), { | |
254 | - position: 'absolute', | |
255 | - top: 1+~(o.width/2) + 'px', | |
256 | - transform: o.hwaccel ? 'translate3d(0,0,0)' : '', | |
257 | - opacity: o.opacity, | |
258 | - animation: useCssAnimations && addAnimation(o.opacity, o.trail, start + i * o.direction, o.lines) + ' ' + 1/o.speed + 's linear infinite' | |
259 | - }) | |
260 | - | |
261 | - if (o.shadow) ins(seg, css(fill('#000', '0 0 4px ' + '#000'), {top: 2+'px'})) | |
262 | - | |
263 | - ins(el, ins(seg, fill(o.color, '0 0 1px rgba(0,0,0,.1)'))) | |
264 | - } | |
265 | - return el | |
266 | - }, | |
267 | - | |
268 | - /** | |
269 | - * Internal method that adjusts the opacity of a single line. | |
270 | - * Will be overwritten in VML fallback mode below. | |
271 | - */ | |
272 | - opacity: function(el, i, val) { | |
273 | - if (i < el.childNodes.length) el.childNodes[i].style.opacity = val | |
274 | - } | |
275 | - | |
276 | - }) | |
277 | - | |
278 | - | |
279 | - function initVML() { | |
280 | - | |
281 | - /* Utility function to create a VML tag */ | |
282 | - function vml(tag, attr) { | |
283 | - return createEl('<' + tag + ' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">', attr) | |
284 | - } | |
285 | - | |
286 | - // No CSS transforms but VML support, add a CSS rule for VML elements: | |
287 | - sheet.addRule('.spin-vml', 'behavior:url(#default#VML)') | |
288 | - | |
289 | - Spinner.prototype.lines = function(el, o) { | |
290 | - var r = o.length+o.width | |
291 | - , s = 2*r | |
292 | - | |
293 | - function grp() { | |
294 | - return css( | |
295 | - vml('group', { | |
296 | - coordsize: s + ' ' + s, | |
297 | - coordorigin: -r + ' ' + -r | |
298 | - }), | |
299 | - { width: s, height: s } | |
300 | - ) | |
301 | - } | |
302 | - | |
303 | - var margin = -(o.width+o.length)*2 + 'px' | |
304 | - , g = css(grp(), {position: 'absolute', top: margin, left: margin}) | |
305 | - , i | |
306 | - | |
307 | - function seg(i, dx, filter) { | |
308 | - ins(g, | |
309 | - ins(css(grp(), {rotation: 360 / o.lines * i + 'deg', left: ~~dx}), | |
310 | - ins(css(vml('roundrect', {arcsize: o.corners}), { | |
311 | - width: r, | |
312 | - height: o.width, | |
313 | - left: o.radius, | |
314 | - top: -o.width>>1, | |
315 | - filter: filter | |
316 | - }), | |
317 | - vml('fill', {color: o.color, opacity: o.opacity}), | |
318 | - vml('stroke', {opacity: 0}) // transparent stroke to fix color bleeding upon opacity change | |
319 | - ) | |
320 | - ) | |
321 | - ) | |
322 | - } | |
323 | - | |
324 | - if (o.shadow) | |
325 | - for (i = 1; i <= o.lines; i++) | |
326 | - seg(i, -2, 'progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)') | |
327 | - | |
328 | - for (i = 1; i <= o.lines; i++) seg(i) | |
329 | - return ins(el, g) | |
330 | - } | |
331 | - | |
332 | - Spinner.prototype.opacity = function(el, i, val, o) { | |
333 | - var c = el.firstChild | |
334 | - o = o.shadow && o.lines || 0 | |
335 | - if (c && i+o < c.childNodes.length) { | |
336 | - c = c.childNodes[i+o]; c = c && c.firstChild; c = c && c.firstChild | |
337 | - if (c) c.opacity = val | |
338 | - } | |
339 | - } | |
340 | - } | |
341 | - | |
342 | - var probe = css(createEl('group'), {behavior: 'url(#default#VML)'}) | |
343 | - | |
344 | - if (!vendor(probe, 'transform') && probe.adj) initVML() | |
345 | - else useCssAnimations = vendor(probe, 'animation') | |
346 | - | |
347 | - return Spinner | |
348 | - | |
349 | -})); |
--- public/javascripts/service/yobi.code.Browser.js
+++ public/javascripts/service/yobi.code.Browser.js
... | ... | @@ -157,7 +157,7 @@ |
157 | 157 |
|
158 | 158 |
function _requestFolderList(){ |
159 | 159 |
if(htVar.aPathQueue.length === 0){ |
160 |
- yobi.ui.Spinner.hide(); |
|
160 |
+ NProgress.done(); |
|
161 | 161 |
htVar.aWelList.forEach(function(welList){ |
162 | 162 |
welList.css("display", "block"); |
163 | 163 |
}); |
... | ... | @@ -184,11 +184,11 @@ |
184 | 184 |
var nNewDepth = nParentDepth + 1; |
185 | 185 |
_setIndentByDepth(nNewDepth); |
186 | 186 |
|
187 |
- yobi.ui.Spinner.show(); |
|
187 |
+ NProgress.start(); |
|
188 | 188 |
$.ajax(sURL, { |
189 | 189 |
"success": function(oRes){ |
190 | 190 |
if(_isListExistsByPath(sTargetPath)){ |
191 |
- yobi.ui.Spinner.hide(); |
|
191 |
+ NProgress.done(); |
|
192 | 192 |
return; |
193 | 193 |
} |
194 | 194 |
|
... | ... | @@ -212,10 +212,10 @@ |
212 | 212 |
}); |
213 | 213 |
} |
214 | 214 |
|
215 |
- yobi.ui.Spinner.hide(); |
|
215 |
+ NProgress.done(); |
|
216 | 216 |
}, |
217 | 217 |
"error" : function(){ |
218 |
- yobi.ui.Spinner.hide(); |
|
218 |
+ NProgress.done(); |
|
219 | 219 |
} |
220 | 220 |
}); |
221 | 221 |
} |
--- public/javascripts/service/yobi.code.Diff.js
+++ public/javascripts/service/yobi.code.Diff.js
... | ... | @@ -142,7 +142,8 @@ |
142 | 142 |
|
143 | 143 |
if(htElement.welBtnAccept.length > 0 && htElement.welBtnAccept.data("requestAs")){ |
144 | 144 |
htElement.welBtnAccept.data("requestAs").on("beforeRequest", function(){ |
145 |
- yobi.ui.Spinner.show({"bUseDimmer": true}); |
|
145 |
+ htElement.welBtnAccept.attr('disabled','disabled'); |
|
146 |
+ NProgress.start(); |
|
146 | 147 |
}); |
147 | 148 |
} |
148 | 149 |
|
--- public/javascripts/service/yobi.git.View.js
+++ public/javascripts/service/yobi.git.View.js
... | ... | @@ -121,7 +121,8 @@ |
121 | 121 |
|
122 | 122 |
if(htElement.welBtnAccept.length > 0 && htElement.welBtnAccept.data("requestAs")){ |
123 | 123 |
htElement.welBtnAccept.data("requestAs").on("beforeRequest", function(){ |
124 |
- yobi.ui.Spinner.show({"bUseDimmer": true}); |
|
124 |
+ htElement.welBtnAccept.attr('disabled','disabled'); |
|
125 |
+ NProgress.start(); |
|
125 | 126 |
}); |
126 | 127 |
} |
127 | 128 |
} |
--- public/javascripts/service/yobi.git.Write.js
+++ public/javascripts/service/yobi.git.Write.js
... | ... | @@ -131,7 +131,7 @@ |
131 | 131 |
|
132 | 132 |
_showMergeResult({"message" : Messages("pullRequest.is.merging")}); |
133 | 133 |
|
134 |
- yobi.ui.Spinner.show(); |
|
134 |
+ NProgress.start(); |
|
135 | 135 |
|
136 | 136 |
$.ajax(vars.mergeResultURL, { |
137 | 137 |
"data": data |
... | ... | @@ -139,7 +139,7 @@ |
139 | 139 |
.done(_onSuccessMergeResult) |
140 | 140 |
.fail(_onErrorMergeResult) |
141 | 141 |
.always(function(){ |
142 |
- yobi.ui.Spinner.hide(); |
|
142 |
+ NProgress.done(); |
|
143 | 143 |
}); |
144 | 144 |
} |
145 | 145 |
|
--- public/javascripts/service/yobi.issue.LabelEditor.js
+++ public/javascripts/service/yobi.issue.LabelEditor.js
... | ... | @@ -614,7 +614,7 @@ |
614 | 614 |
"project.id" : elements.editCategoryForm.data("projectId") |
615 | 615 |
}; |
616 | 616 |
|
617 |
- yobi.ui.Spinner.show(); |
|
617 |
+ NProgress.start(); |
|
618 | 618 |
|
619 | 619 |
$.ajax(elements.editCategoryForm.data("categoryUpdateUri"), { |
620 | 620 |
"method": "put", |
... | ... | @@ -625,7 +625,7 @@ |
625 | 625 |
_showError(res, "label.category.edit"); |
626 | 626 |
}).always(function(){ |
627 | 627 |
elements.editCategoryForm.modal("hide"); |
628 |
- yobi.ui.Spinner.hide(); |
|
628 |
+ NProgress.done(); |
|
629 | 629 |
}); |
630 | 630 |
} |
631 | 631 |
|
... | ... | @@ -679,7 +679,7 @@ |
679 | 679 |
return false; |
680 | 680 |
} |
681 | 681 |
|
682 |
- yobi.ui.Spinner.show(); |
|
682 |
+ NProgress.start(); |
|
683 | 683 |
|
684 | 684 |
$.ajax(elements.editLabelForm.data("updateUri"), { |
685 | 685 |
"method": "put", |
... | ... | @@ -690,7 +690,7 @@ |
690 | 690 |
_showError(res, "label.edit"); |
691 | 691 |
}).always(function(){ |
692 | 692 |
elements.editLabelForm.modal("hide"); |
693 |
- yobi.ui.Spinner.hide(); |
|
693 |
+ NProgress.done(); |
|
694 | 694 |
}); |
695 | 695 |
} |
696 | 696 |
|
--- public/javascripts/service/yobi.issue.List.js
+++ public/javascripts/service/yobi.issue.List.js
... | ... | @@ -227,11 +227,11 @@ |
227 | 227 |
} |
228 | 228 |
|
229 | 229 |
function _onBeforeLoadIssueList(){ |
230 |
- yobi.ui.Spinner.show(); |
|
230 |
+ NProgress.start(); |
|
231 | 231 |
} |
232 | 232 |
|
233 | 233 |
function _onLoadIssueList(){ |
234 |
- yobi.ui.Spinner.hide(); |
|
234 |
+ NProgress.done(); |
|
235 | 235 |
|
236 | 236 |
_initElement(htInitialOptions); |
237 | 237 |
_initPagination(); |
--- public/javascripts/service/yobi.organization.New.js
+++ public/javascripts/service/yobi.organization.New.js
... | ... | @@ -89,7 +89,7 @@ |
89 | 89 |
$('span.warning').hide(); |
90 | 90 |
$('span.msg').html(aErrors[0].message).show(); |
91 | 91 |
} else { |
92 |
- yobi.ui.Spinner.show(); |
|
92 |
+ NProgress.start(); |
|
93 | 93 |
} |
94 | 94 |
} |
95 | 95 |
|
--- public/javascripts/service/yobi.organization.Setting.js
+++ public/javascripts/service/yobi.organization.Setting.js
... | ... | @@ -104,7 +104,7 @@ |
104 | 104 |
$('span.warning').hide(); |
105 | 105 |
$('span.msg').html(aErrors[0].message).show(); |
106 | 106 |
} else { |
107 |
- yobi.ui.Spinner.show(); |
|
107 |
+ NProgress.start(); |
|
108 | 108 |
} |
109 | 109 |
} |
110 | 110 |
|
--- public/javascripts/service/yobi.project.New.js
+++ public/javascripts/service/yobi.project.New.js
... | ... | @@ -158,7 +158,7 @@ |
158 | 158 |
return false; |
159 | 159 |
} |
160 | 160 |
|
161 |
- yobi.ui.Spinner.show(); |
|
161 |
+ NProgress.start(); |
|
162 | 162 |
} |
163 | 163 |
|
164 | 164 |
/** |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?