better_styles 0.0.0.338 → 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/README.md +4 -9
- data/lib/better_styles/engine.rb +1 -1
- data/lib/better_styles/version.rb +1 -1
- metadata +148 -100
- data/app/helpers/better_styles/support_helper.rb +0 -33
- data/assets/fonts/betterfonts/betterwork-icons.eot +0 -0
- data/assets/fonts/betterfonts/betterwork-icons.svg +0 -368
- data/assets/fonts/betterfonts/betterwork-icons.ttf +0 -0
- data/assets/fonts/betterfonts/betterwork-icons.woff +0 -0
- data/assets/fonts/betterfonts/icomoon.eot +0 -0
- data/assets/fonts/betterfonts/icomoon.svg +0 -461
- data/assets/fonts/betterfonts/icomoon.ttf +0 -0
- data/assets/fonts/betterfonts/icomoon.woff +0 -0
- data/assets/fonts/betterfonts/magicons-regular-webfont.eot +0 -0
- data/assets/fonts/betterfonts/magicons-regular-webfont.svg +0 -461
- data/assets/fonts/betterfonts/magicons-regular-webfont.ttf +0 -0
- data/assets/fonts/betterfonts/magicons-regular-webfont.woff +0 -0
- data/assets/fonts/betterfonts/newmagicons-regular-webfont.eot +0 -0
- data/assets/fonts/betterfonts/newmagicons-regular-webfont.svg +0 -199
- data/assets/fonts/betterfonts/newmagicons-regular-webfont.ttf +0 -0
- data/assets/fonts/betterfonts/newmagicons-regular-webfont.woff +0 -0
- data/assets/fonts/betterfonts/orderlifticons-webfont.eot +0 -0
- data/assets/fonts/betterfonts/orderlifticons-webfont.svg +0 -172
- data/assets/fonts/betterfonts/orderlifticons-webfont.ttf +0 -0
- data/assets/fonts/betterfonts/orderlifticons-webfont.woff +0 -0
- data/assets/images/better/arrows/arrow-round1-a.png +0 -0
- data/assets/images/better/arrows/arrow-round1-b.png +0 -0
- data/assets/images/better/arrows/arrow-round2-a.png +0 -0
- data/assets/images/better/arrows/arrow-round2-b.png +0 -0
- data/assets/images/better/arrows/arrow1-a.png +0 -0
- data/assets/images/better/arrows/arrow1-b.png +0 -0
- data/assets/images/better/arrows/arrow1.png +0 -0
- data/assets/images/better/arrows/arrow2-1.png +0 -0
- data/assets/images/better/arrows/arrow2-2.png +0 -0
- data/assets/images/better/arrows/arrow2-a.png +0 -0
- data/assets/images/better/arrows/arrow2-b.png +0 -0
- data/assets/images/better/arrows/arrow3-a.png +0 -0
- data/assets/images/better/arrows/arrow3-b.png +0 -0
- data/assets/images/better/arrows/arrow4-a.png +0 -0
- data/assets/images/better/arrows/arrow4-b.png +0 -0
- data/assets/images/better/arrows/arrow5-a.png +0 -0
- data/assets/images/better/arrows/arrow5-b.png +0 -0
- data/assets/images/better/arrows/arrow6-a.png +0 -0
- data/assets/images/better/arrows/arrow6-b.png +0 -0
- data/assets/images/better/helper/blank_10.png +0 -0
- data/assets/images/better/helper/crossed.png +0 -0
- data/assets/images/better/helper/white_10.png +0 -0
- data/assets/javascripts/better_styles.js.coffee +0 -4
- data/assets/javascripts/betterjs/forms/check_switch.js.coffee +0 -25
- data/assets/javascripts/betterjs/helper.js.coffee +0 -74
- data/assets/javascripts/betterjs/navigations/aside_link.js.coffee +0 -9
- data/assets/javascripts/betterjs/navigations/nav_list.js.coffee +0 -19
- data/assets/javascripts/betterjs/rails_ext/rails-ujs.js +0 -479
- data/assets/javascripts/betterjs/render_eco.js.coffee +0 -9
- data/assets/javascripts/betterjs/templates/fixed_aside_to_header.js.coffee +0 -6
- data/assets/javascripts/betterjs/templates/icon_aside.js.coffee +0 -12
- data/assets/javascripts/betterjs/templates/scroll_to_fix_aside.js +0 -32
- data/assets/javascripts/betterjs/twbs_ext/affix_2_1_0.js +0 -103
- data/assets/javascripts/betterjs/twbs_ext/affix_3_3_7.js +0 -162
- data/assets/javascripts/betterjs/twbs_ext/affix_ext.js +0 -131
- data/assets/stylesheets/better/content/_box.scss +0 -46
- data/assets/stylesheets/better/content/_buttons.scss +0 -22
- data/assets/stylesheets/better/content/_check_switch.scss +0 -78
- data/assets/stylesheets/better/content/_divider.scss +0 -65
- data/assets/stylesheets/better/content/_helpers.scss +0 -85
- data/assets/stylesheets/better/content/_pix.scss +0 -70
- data/assets/stylesheets/better/content/_typography.scss +0 -44
- data/assets/stylesheets/better/icons/bettericons.scss +0 -419
- data/assets/stylesheets/better/icons/icomoon.scss +0 -1392
- data/assets/stylesheets/better/icons/magicons.scss +0 -705
- data/assets/stylesheets/better/icons/orderlifticons.scss +0 -300
- data/assets/stylesheets/better/layout/_corset.scss +0 -57
- data/assets/stylesheets/better/layout/_fullpage_table.scss +0 -185
- data/assets/stylesheets/better/layout/_positioning.scss +0 -62
- data/assets/stylesheets/better/layout/_section.scss +0 -220
- data/assets/stylesheets/better/lib/_helpers.scss +0 -67
- data/assets/stylesheets/better/lib/_media_querries.scss +0 -46
- data/assets/stylesheets/better/lib/_nav.scss +0 -31
- data/assets/stylesheets/better/lib/_shadows.scss +0 -247
- data/assets/stylesheets/better/lib/_text.scss +0 -66
- data/assets/stylesheets/better/navigations/_aside_lnk.scss +0 -100
- data/assets/stylesheets/better/navigations/_nav_list.scss +0 -177
- data/assets/stylesheets/better/templates/_fixed_aside_to_header.scss +0 -89
- data/assets/stylesheets/better/templates/_icon_aside.scss +0 -404
- data/assets/stylesheets/better/templates/_scroll_to_fix_aside.scss +0 -104
- data/assets/stylesheets/better/variables/_color.scss +0 -121
- data/assets/stylesheets/better/variables/_typography.scss +0 -60
- data/assets/stylesheets/better/variables/_vars.scss +0 -57
- data/assets/stylesheets/better_styles.scss +0 -44
- data/assets/stylesheets/better_styles_min.scss +0 -43
@@ -1,479 +0,0 @@
|
|
1
|
-
(function($, undefined) {
|
2
|
-
|
3
|
-
/**
|
4
|
-
* Unobtrusive scripting adapter for jQuery
|
5
|
-
* https://github.com/rails/jquery-ujs
|
6
|
-
*
|
7
|
-
* Requires jQuery 1.8.0 or later.
|
8
|
-
*
|
9
|
-
* Released under the MIT license
|
10
|
-
|
11
|
-
# changed to work better with divided and splitted buttons .. twetzel
|
12
|
-
|
13
|
-
*
|
14
|
-
*/
|
15
|
-
|
16
|
-
// Cut down on the number of issues from people inadvertently including jquery_ujs twice
|
17
|
-
// by detecting and raising an error when it happens.
|
18
|
-
if ( $.rails !== undefined ) {
|
19
|
-
$.error('jquery-ujs has already been loaded!');
|
20
|
-
}
|
21
|
-
|
22
|
-
// Shorthand to make it a little easier to call public rails functions from within rails.js
|
23
|
-
var rails;
|
24
|
-
var $document = $(document);
|
25
|
-
|
26
|
-
$.rails = rails = {
|
27
|
-
// Link elements bound by jquery-ujs
|
28
|
-
linkClickSelector: 'a[data-confirm], a[data-method], a[data-remote], a[data-disable-with], a[data-disable]',
|
29
|
-
|
30
|
-
// Button elements bound by jquery-ujs
|
31
|
-
buttonClickSelector: 'button[data-remote]:not(form button), button[data-confirm]:not(form button)',
|
32
|
-
|
33
|
-
// Select elements bound by jquery-ujs
|
34
|
-
inputChangeSelector: 'select[data-remote], input[data-remote], textarea[data-remote]',
|
35
|
-
|
36
|
-
// Form elements bound by jquery-ujs
|
37
|
-
formSubmitSelector: 'form',
|
38
|
-
|
39
|
-
// Form input elements bound by jquery-ujs
|
40
|
-
formInputClickSelector: 'form input[type=submit], form input[type=image], form button[type=submit], form button:not([type]), input[type=submit][form], input[type=image][form], button[type=submit][form], button[form]:not([type])',
|
41
|
-
|
42
|
-
// Form input elements disabled during form submission
|
43
|
-
disableSelector: 'input[data-disable-with]:enabled, button[data-disable-with]:enabled, textarea[data-disable-with]:enabled, input[data-disable]:enabled, button[data-disable]:enabled, textarea[data-disable]:enabled',
|
44
|
-
|
45
|
-
// Form input elements re-enabled after form submission
|
46
|
-
enableSelector: 'input[data-disable-with]:disabled, button[data-disable-with]:disabled, textarea[data-disable-with]:disabled, input[data-disable]:disabled, button[data-disable]:disabled, textarea[data-disable]:disabled',
|
47
|
-
|
48
|
-
// Form required input elements
|
49
|
-
requiredInputSelector: 'input[name][required]:not([disabled]),textarea[name][required]:not([disabled])',
|
50
|
-
|
51
|
-
// Form file input elements
|
52
|
-
fileInputSelector: 'input[type=file]',
|
53
|
-
|
54
|
-
// Link onClick disable selector with possible reenable after remote submission
|
55
|
-
linkDisableSelector: 'a[data-disable-with], a[data-disable]',
|
56
|
-
|
57
|
-
// Button onClick disable selector with possible reenable after remote submission
|
58
|
-
buttonDisableSelector: 'button[data-remote][data-disable-with], button[data-remote][data-disable]',
|
59
|
-
|
60
|
-
// Make sure that every Ajax request sends the CSRF token
|
61
|
-
CSRFProtection: function(xhr) {
|
62
|
-
var token = $('meta[name="csrf-token"]').attr('content');
|
63
|
-
if (token) xhr.setRequestHeader('X-CSRF-Token', token);
|
64
|
-
},
|
65
|
-
|
66
|
-
// making sure that all forms have actual up-to-date token(cached forms contain old one)
|
67
|
-
refreshCSRFTokens: function(){
|
68
|
-
var csrfToken = $('meta[name=csrf-token]').attr('content');
|
69
|
-
var csrfParam = $('meta[name=csrf-param]').attr('content');
|
70
|
-
$('form input[name="' + csrfParam + '"]').val(csrfToken);
|
71
|
-
},
|
72
|
-
|
73
|
-
// Triggers an event on an element and returns false if the event result is false
|
74
|
-
fire: function(obj, name, data) {
|
75
|
-
var event = $.Event(name);
|
76
|
-
obj.trigger(event, data);
|
77
|
-
return event.result !== false;
|
78
|
-
},
|
79
|
-
|
80
|
-
// Default confirm dialog, may be overridden with custom confirm dialog in $.rails.confirm
|
81
|
-
confirm: function(message) {
|
82
|
-
return confirm(message);
|
83
|
-
},
|
84
|
-
|
85
|
-
// Default ajax function, may be overridden with custom function in $.rails.ajax
|
86
|
-
ajax: function(options) {
|
87
|
-
return $.ajax(options);
|
88
|
-
},
|
89
|
-
|
90
|
-
// Default way to get an element's href. May be overridden at $.rails.href.
|
91
|
-
href: function(element) {
|
92
|
-
return element.attr('href');
|
93
|
-
},
|
94
|
-
|
95
|
-
// Submits "remote" forms and links with ajax
|
96
|
-
handleRemote: function(element) {
|
97
|
-
var method, url, data, elCrossDomain, crossDomain, withCredentials, dataType, options;
|
98
|
-
|
99
|
-
if (rails.fire(element, 'ajax:before')) {
|
100
|
-
elCrossDomain = element.data('cross-domain');
|
101
|
-
crossDomain = elCrossDomain === undefined ? null : elCrossDomain;
|
102
|
-
withCredentials = element.data('with-credentials') || null;
|
103
|
-
dataType = element.data('type') || ($.ajaxSettings && $.ajaxSettings.dataType);
|
104
|
-
|
105
|
-
if (element.is('form')) {
|
106
|
-
method = element.attr('method');
|
107
|
-
url = element.attr('action');
|
108
|
-
data = element.serializeArray();
|
109
|
-
// memoized value from clicked submit button
|
110
|
-
var button = element.data('ujs:submit-button');
|
111
|
-
if (button) {
|
112
|
-
data.push(button);
|
113
|
-
element.data('ujs:submit-button', null);
|
114
|
-
}
|
115
|
-
} else if (element.is(rails.inputChangeSelector)) {
|
116
|
-
method = element.data('method');
|
117
|
-
url = element.data('url');
|
118
|
-
data = element.serialize();
|
119
|
-
if (element.data('params')) data = data + "&" + element.data('params');
|
120
|
-
} else if (element.is(rails.buttonClickSelector)) {
|
121
|
-
method = element.data('method') || 'get';
|
122
|
-
url = element.data('url');
|
123
|
-
data = element.serialize();
|
124
|
-
if (element.data('params')) data = data + "&" + element.data('params');
|
125
|
-
} else {
|
126
|
-
method = element.data('method');
|
127
|
-
url = rails.href(element);
|
128
|
-
data = element.data('params') || null;
|
129
|
-
}
|
130
|
-
|
131
|
-
options = {
|
132
|
-
type: method || 'GET', data: data, dataType: dataType,
|
133
|
-
// stopping the "ajax:beforeSend" event will cancel the ajax request
|
134
|
-
beforeSend: function(xhr, settings) {
|
135
|
-
if (settings.dataType === undefined) {
|
136
|
-
xhr.setRequestHeader('accept', '*/*;q=0.5, ' + settings.accepts.script);
|
137
|
-
}
|
138
|
-
if (rails.fire(element, 'ajax:beforeSend', [xhr, settings])) {
|
139
|
-
element.trigger('ajax:send', xhr);
|
140
|
-
} else {
|
141
|
-
return false;
|
142
|
-
}
|
143
|
-
},
|
144
|
-
success: function(data, status, xhr) {
|
145
|
-
element.trigger('ajax:success', [data, status, xhr]);
|
146
|
-
},
|
147
|
-
complete: function(xhr, status) {
|
148
|
-
element.trigger('ajax:complete', [xhr, status]);
|
149
|
-
},
|
150
|
-
error: function(xhr, status, error) {
|
151
|
-
element.trigger('ajax:error', [xhr, status, error]);
|
152
|
-
},
|
153
|
-
crossDomain: crossDomain
|
154
|
-
};
|
155
|
-
|
156
|
-
// There is no withCredentials for IE6-8 when
|
157
|
-
// "Enable native XMLHTTP support" is disabled
|
158
|
-
if (withCredentials) {
|
159
|
-
options.xhrFields = {
|
160
|
-
withCredentials: withCredentials
|
161
|
-
};
|
162
|
-
}
|
163
|
-
|
164
|
-
// Only pass url to `ajax` options if not blank
|
165
|
-
if (url) { options.url = url; }
|
166
|
-
|
167
|
-
return rails.ajax(options);
|
168
|
-
} else {
|
169
|
-
return false;
|
170
|
-
}
|
171
|
-
},
|
172
|
-
|
173
|
-
// Handles "data-method" on links such as:
|
174
|
-
// <a href="/users/5" data-method="delete" rel="nofollow" data-confirm="Are you sure?">Delete</a>
|
175
|
-
handleMethod: function(link) {
|
176
|
-
var href = rails.href(link),
|
177
|
-
method = link.data('method'),
|
178
|
-
target = link.attr('target'),
|
179
|
-
csrfToken = $('meta[name=csrf-token]').attr('content'),
|
180
|
-
csrfParam = $('meta[name=csrf-param]').attr('content'),
|
181
|
-
form = $('<form method="post" action="' + href + '"></form>'),
|
182
|
-
metadataInput = '<input name="_method" value="' + method + '" type="hidden" />';
|
183
|
-
|
184
|
-
if (csrfParam !== undefined && csrfToken !== undefined) {
|
185
|
-
metadataInput += '<input name="' + csrfParam + '" value="' + csrfToken + '" type="hidden" />';
|
186
|
-
}
|
187
|
-
|
188
|
-
if (target) { form.attr('target', target); }
|
189
|
-
|
190
|
-
form.hide().append(metadataInput).appendTo('body');
|
191
|
-
form.submit();
|
192
|
-
},
|
193
|
-
|
194
|
-
// Helper function that returns form elements that match the specified CSS selector
|
195
|
-
// If form is actually a "form" element this will return associated elements outside the from that have
|
196
|
-
// the html form attribute set
|
197
|
-
formElements: function(form, selector) {
|
198
|
-
return form.is('form') ? $(form[0].elements).filter(selector) : form.find(selector);
|
199
|
-
},
|
200
|
-
|
201
|
-
/* Disables form elements:
|
202
|
-
- Caches element value in 'ujs:enable-with' data store
|
203
|
-
- Replaces element text with value of 'data-disable-with' attribute
|
204
|
-
- Sets disabled property to true
|
205
|
-
*/
|
206
|
-
disableFormElements: function(form) {
|
207
|
-
rails.formElements(form, rails.disableSelector).each(function() {
|
208
|
-
rails.disableFormElement($(this));
|
209
|
-
});
|
210
|
-
},
|
211
|
-
|
212
|
-
disableFormElement: function(element) {
|
213
|
-
var method, replacement;
|
214
|
-
|
215
|
-
method = element.is('button') ? 'html' : 'val';
|
216
|
-
replacement = element.data('disable-with');
|
217
|
-
|
218
|
-
element.data('ujs:enable-with', element[method]());
|
219
|
-
if (replacement !== undefined) {
|
220
|
-
// element[method](replacement);
|
221
|
-
if ( element.hasClass("btn-splited") || element.hasClass("btn-divided") ) {
|
222
|
-
element.children("*:not(.icn):first").html(replacement);
|
223
|
-
} else {
|
224
|
-
element[method](replacement);
|
225
|
-
}
|
226
|
-
}
|
227
|
-
|
228
|
-
element.prop('disabled', true);
|
229
|
-
element.addClass("disabled");
|
230
|
-
},
|
231
|
-
|
232
|
-
/* Re-enables disabled form elements:
|
233
|
-
- Replaces element text with cached value from 'ujs:enable-with' data store (created in `disableFormElements`)
|
234
|
-
- Sets disabled property to false
|
235
|
-
*/
|
236
|
-
enableFormElements: function(form) {
|
237
|
-
rails.formElements(form, rails.enableSelector).each(function() {
|
238
|
-
rails.enableFormElement($(this));
|
239
|
-
});
|
240
|
-
},
|
241
|
-
|
242
|
-
enableFormElement: function(element) {
|
243
|
-
var method = element.is('button') ? 'html' : 'val';
|
244
|
-
if ( element.data('ujs:enable-with') ) {
|
245
|
-
// element[method](element.data('ujs:enable-with'));
|
246
|
-
if ( element.hasClass("btn-splited") || element.hasClass("btn-divided") ) {
|
247
|
-
element.children("*:not(.icn):first").html(element.data('ujs:enable-with'));
|
248
|
-
} else {
|
249
|
-
element[method](element.data('ujs:enable-with'));
|
250
|
-
}
|
251
|
-
}
|
252
|
-
element.prop('disabled', false);
|
253
|
-
element.removeClass("disabled");
|
254
|
-
},
|
255
|
-
|
256
|
-
/* For 'data-confirm' attribute:
|
257
|
-
- Fires `confirm` event
|
258
|
-
- Shows the confirmation dialog
|
259
|
-
- Fires the `confirm:complete` event
|
260
|
-
|
261
|
-
Returns `true` if no function stops the chain and user chose yes; `false` otherwise.
|
262
|
-
Attaching a handler to the element's `confirm` event that returns a `falsy` value cancels the confirmation dialog.
|
263
|
-
Attaching a handler to the element's `confirm:complete` event that returns a `falsy` value makes this function
|
264
|
-
return false. The `confirm:complete` event is fired whether or not the user answered true or false to the dialog.
|
265
|
-
*/
|
266
|
-
allowAction: function(element) {
|
267
|
-
var message = element.data('confirm'),
|
268
|
-
answer = false, callback;
|
269
|
-
if (!message) { return true; }
|
270
|
-
|
271
|
-
if (rails.fire(element, 'confirm')) {
|
272
|
-
answer = rails.confirm(message);
|
273
|
-
callback = rails.fire(element, 'confirm:complete', [answer]);
|
274
|
-
}
|
275
|
-
return answer && callback;
|
276
|
-
},
|
277
|
-
|
278
|
-
// Helper function which checks for blank inputs in a form that match the specified CSS selector
|
279
|
-
blankInputs: function(form, specifiedSelector, nonBlank) {
|
280
|
-
var inputs = $(), input, valueToCheck,
|
281
|
-
selector = specifiedSelector || 'input,textarea',
|
282
|
-
allInputs = form.find(selector);
|
283
|
-
|
284
|
-
allInputs.each(function() {
|
285
|
-
input = $(this);
|
286
|
-
valueToCheck = input.is('input[type=checkbox],input[type=radio]') ? input.is(':checked') : input.val();
|
287
|
-
// If nonBlank and valueToCheck are both truthy, or nonBlank and valueToCheck are both falsey
|
288
|
-
if (!valueToCheck === !nonBlank) {
|
289
|
-
|
290
|
-
// Don't count unchecked required radio if other radio with same name is checked
|
291
|
-
if (input.is('input[type=radio]') && allInputs.filter('input[type=radio]:checked[name="' + input.attr('name') + '"]').length) {
|
292
|
-
return true; // Skip to next input
|
293
|
-
}
|
294
|
-
|
295
|
-
inputs = inputs.add(input);
|
296
|
-
}
|
297
|
-
});
|
298
|
-
return inputs.length ? inputs : false;
|
299
|
-
},
|
300
|
-
|
301
|
-
// Helper function which checks for non-blank inputs in a form that match the specified CSS selector
|
302
|
-
nonBlankInputs: function(form, specifiedSelector) {
|
303
|
-
return rails.blankInputs(form, specifiedSelector, true); // true specifies nonBlank
|
304
|
-
},
|
305
|
-
|
306
|
-
// Helper function, needed to provide consistent behavior in IE
|
307
|
-
stopEverything: function(e) {
|
308
|
-
$(e.target).trigger('ujs:everythingStopped');
|
309
|
-
e.stopImmediatePropagation();
|
310
|
-
return false;
|
311
|
-
},
|
312
|
-
|
313
|
-
// replace element's html with the 'data-disable-with' after storing original html
|
314
|
-
// and prevent clicking on it
|
315
|
-
disableElement: function(element) {
|
316
|
-
|
317
|
-
console.log("***")
|
318
|
-
console.log("disableElement !")
|
319
|
-
console.log("***")
|
320
|
-
|
321
|
-
var replacement = element.data('disable-with');
|
322
|
-
|
323
|
-
element.data('ujs:enable-with', element.html()); // store enabled state
|
324
|
-
element.addClass("disabled");
|
325
|
-
if (replacement !== undefined) {
|
326
|
-
if ( element.hasClass("btn-splited") || element.hasClass("btn-divided") ) {
|
327
|
-
element.children("*:not(.icn):first").html(replacement);
|
328
|
-
} else {
|
329
|
-
element.html(replacement);
|
330
|
-
}
|
331
|
-
}
|
332
|
-
|
333
|
-
element.bind('click.railsDisable', function(e) { // prevent further clicking
|
334
|
-
return rails.stopEverything(e);
|
335
|
-
});
|
336
|
-
},
|
337
|
-
|
338
|
-
// restore element to its original state which was disabled by 'disableElement' above
|
339
|
-
enableElement: function(element) {
|
340
|
-
element.removeClass("disabled");
|
341
|
-
if (element.data('ujs:enable-with') !== undefined) {
|
342
|
-
// element.html(element.data('ujs:enable-with')); // set to old enabled state
|
343
|
-
if ( element.hasClass("btn-splited") || element.hasClass("btn-divided") ) {
|
344
|
-
element.children("*:not(.icn):first").html(element.data('ujs:enable-with'));
|
345
|
-
} else {
|
346
|
-
element.html(element.data('ujs:enable-with'));
|
347
|
-
}
|
348
|
-
element.removeData('ujs:enable-with'); // clean up cache
|
349
|
-
}
|
350
|
-
element.unbind('click.railsDisable'); // enable element
|
351
|
-
}
|
352
|
-
};
|
353
|
-
|
354
|
-
if (rails.fire($document, 'rails:attachBindings')) {
|
355
|
-
|
356
|
-
$.ajaxPrefilter(function(options, originalOptions, xhr){ if ( !options.crossDomain ) { rails.CSRFProtection(xhr); }});
|
357
|
-
|
358
|
-
$document.delegate(rails.linkDisableSelector, 'ajax:complete', function() {
|
359
|
-
rails.enableElement($(this));
|
360
|
-
});
|
361
|
-
|
362
|
-
$document.delegate(rails.buttonDisableSelector, 'ajax:complete', function() {
|
363
|
-
rails.enableFormElement($(this));
|
364
|
-
});
|
365
|
-
|
366
|
-
$document.delegate(rails.linkClickSelector, 'click.rails', function(e) {
|
367
|
-
var link = $(this), method = link.data('method'), data = link.data('params'), metaClick = e.metaKey || e.ctrlKey;
|
368
|
-
if (!rails.allowAction(link)) return rails.stopEverything(e);
|
369
|
-
|
370
|
-
if (!metaClick && link.is(rails.linkDisableSelector)) rails.disableElement(link);
|
371
|
-
|
372
|
-
if (link.data('remote') !== undefined) {
|
373
|
-
if (metaClick && (!method || method === 'GET') && !data) { return true; }
|
374
|
-
|
375
|
-
var handleRemote = rails.handleRemote(link);
|
376
|
-
// response from rails.handleRemote() will either be false or a deferred object promise.
|
377
|
-
if (handleRemote === false) {
|
378
|
-
rails.enableElement(link);
|
379
|
-
} else {
|
380
|
-
handleRemote.error( function() { rails.enableElement(link); } );
|
381
|
-
}
|
382
|
-
return false;
|
383
|
-
|
384
|
-
} else if (link.data('method')) {
|
385
|
-
rails.handleMethod(link);
|
386
|
-
return false;
|
387
|
-
}
|
388
|
-
});
|
389
|
-
|
390
|
-
$document.delegate(rails.buttonClickSelector, 'click.rails', function(e) {
|
391
|
-
var button = $(this);
|
392
|
-
|
393
|
-
if (!rails.allowAction(button)) return rails.stopEverything(e);
|
394
|
-
|
395
|
-
if (button.is(rails.buttonDisableSelector)) rails.disableFormElement(button);
|
396
|
-
|
397
|
-
var handleRemote = rails.handleRemote(button);
|
398
|
-
// response from rails.handleRemote() will either be false or a deferred object promise.
|
399
|
-
if (handleRemote === false) {
|
400
|
-
rails.enableFormElement(button);
|
401
|
-
} else {
|
402
|
-
handleRemote.error( function() { rails.enableFormElement(button); } );
|
403
|
-
}
|
404
|
-
return false;
|
405
|
-
});
|
406
|
-
|
407
|
-
$document.delegate(rails.inputChangeSelector, 'change.rails', function(e) {
|
408
|
-
var link = $(this);
|
409
|
-
if (!rails.allowAction(link)) return rails.stopEverything(e);
|
410
|
-
|
411
|
-
rails.handleRemote(link);
|
412
|
-
return false;
|
413
|
-
});
|
414
|
-
|
415
|
-
$document.delegate(rails.formSubmitSelector, 'submit.rails', function(e) {
|
416
|
-
var form = $(this),
|
417
|
-
remote = form.data('remote') !== undefined,
|
418
|
-
blankRequiredInputs,
|
419
|
-
nonBlankFileInputs;
|
420
|
-
|
421
|
-
if (!rails.allowAction(form)) return rails.stopEverything(e);
|
422
|
-
|
423
|
-
// skip other logic when required values are missing or file upload is present
|
424
|
-
if (form.attr('novalidate') == undefined) {
|
425
|
-
blankRequiredInputs = rails.blankInputs(form, rails.requiredInputSelector);
|
426
|
-
if (blankRequiredInputs && rails.fire(form, 'ajax:aborted:required', [blankRequiredInputs])) {
|
427
|
-
return rails.stopEverything(e);
|
428
|
-
}
|
429
|
-
}
|
430
|
-
|
431
|
-
if (remote) {
|
432
|
-
nonBlankFileInputs = rails.nonBlankInputs(form, rails.fileInputSelector);
|
433
|
-
if (nonBlankFileInputs) {
|
434
|
-
// slight timeout so that the submit button gets properly serialized
|
435
|
-
// (make it easy for event handler to serialize form without disabled values)
|
436
|
-
setTimeout(function(){ rails.disableFormElements(form); }, 13);
|
437
|
-
var aborted = rails.fire(form, 'ajax:aborted:file', [nonBlankFileInputs]);
|
438
|
-
|
439
|
-
// re-enable form elements if event bindings return false (canceling normal form submission)
|
440
|
-
if (!aborted) { setTimeout(function(){ rails.enableFormElements(form); }, 13); }
|
441
|
-
|
442
|
-
return aborted;
|
443
|
-
}
|
444
|
-
|
445
|
-
rails.handleRemote(form);
|
446
|
-
return false;
|
447
|
-
|
448
|
-
} else {
|
449
|
-
// slight timeout so that the submit button gets properly serialized
|
450
|
-
setTimeout(function(){ rails.disableFormElements(form); }, 13);
|
451
|
-
}
|
452
|
-
});
|
453
|
-
|
454
|
-
$document.delegate(rails.formInputClickSelector, 'click.rails', function(event) {
|
455
|
-
var button = $(this);
|
456
|
-
|
457
|
-
if (!rails.allowAction(button)) return rails.stopEverything(event);
|
458
|
-
|
459
|
-
// register the pressed submit button
|
460
|
-
var name = button.attr('name'),
|
461
|
-
data = name ? {name:name, value:button.val()} : null;
|
462
|
-
|
463
|
-
button.closest('form').data('ujs:submit-button', data);
|
464
|
-
});
|
465
|
-
|
466
|
-
$document.delegate(rails.formSubmitSelector, 'ajax:send.rails', function(event) {
|
467
|
-
if (this == event.target) rails.disableFormElements($(this));
|
468
|
-
});
|
469
|
-
|
470
|
-
$document.delegate(rails.formSubmitSelector, 'ajax:complete.rails', function(event) {
|
471
|
-
if (this == event.target) rails.enableFormElements($(this));
|
472
|
-
});
|
473
|
-
|
474
|
-
$(function(){
|
475
|
-
rails.refreshCSRFTokens();
|
476
|
-
});
|
477
|
-
}
|
478
|
-
|
479
|
-
})( jQuery );
|
@@ -1,12 +0,0 @@
|
|
1
|
-
$ ->
|
2
|
-
|
3
|
-
$("body").on "click", ".app-logo .toggl", (e) ->
|
4
|
-
e.preventDefault()
|
5
|
-
$("body").toggleClass("with_open_aside")
|
6
|
-
false
|
7
|
-
|
8
|
-
$("body").on "click", ".into-aside-toggl", (e) ->
|
9
|
-
e.preventDefault()
|
10
|
-
$(@).toggleClass("btn-warning")
|
11
|
-
$("body").toggleClass("with_info_aside")
|
12
|
-
false
|
@@ -1,32 +0,0 @@
|
|
1
|
-
//= require betterjs/twbs_ext/affix_2_1_0
|
2
|
-
|
3
|
-
jQuery(function() {
|
4
|
-
|
5
|
-
$('#aside').affix({
|
6
|
-
offset: {
|
7
|
-
top: function () {
|
8
|
-
offset = getInt( $("body").css("padding-top") );
|
9
|
-
return (this.top = $("#aside").offset().top - offset)
|
10
|
-
}
|
11
|
-
}
|
12
|
-
});
|
13
|
-
|
14
|
-
$('#aside_toggle').affix({
|
15
|
-
offset: {
|
16
|
-
top: function () {
|
17
|
-
if ( $("body").hasClass("fixed-nav") ) {
|
18
|
-
var neededTop = $("#aside").offset().top - 50;
|
19
|
-
} else {
|
20
|
-
var neededTop = $("#aside").offset().top;
|
21
|
-
}
|
22
|
-
return (this.top = neededTop)
|
23
|
-
}
|
24
|
-
}
|
25
|
-
});
|
26
|
-
|
27
|
-
$("body").on( "click", "#aside_toggle", function(e){
|
28
|
-
e.preventDefault();
|
29
|
-
$('body').toggleClass("with_aside");
|
30
|
-
});
|
31
|
-
|
32
|
-
});
|
@@ -1,103 +0,0 @@
|
|
1
|
-
/* ==========================================================
|
2
|
-
* bootstrap-affix.js v2.1.0
|
3
|
-
* http://twitter.github.com/bootstrap/javascript.html#affix
|
4
|
-
* ==========================================================
|
5
|
-
* Copyright 2012 Twitter, Inc.
|
6
|
-
*
|
7
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
-
* you may not use this file except in compliance with the License.
|
9
|
-
* You may obtain a copy of the License at
|
10
|
-
*
|
11
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
12
|
-
*
|
13
|
-
* Unless required by applicable law or agreed to in writing, software
|
14
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
-
* See the License for the specific language governing permissions and
|
17
|
-
* limitations under the License.
|
18
|
-
* ========================================================== */
|
19
|
-
|
20
|
-
|
21
|
-
!function ($) {
|
22
|
-
|
23
|
-
"use strict"; // jshint ;_;
|
24
|
-
|
25
|
-
|
26
|
-
/* AFFIX CLASS DEFINITION
|
27
|
-
* ====================== */
|
28
|
-
|
29
|
-
var Affix = function (element, options) {
|
30
|
-
this.options = $.extend({}, $.fn.affix.defaults, options)
|
31
|
-
this.$window = $(window).on('scroll.affix.data-api', $.proxy(this.checkPosition, this))
|
32
|
-
this.$element = $(element)
|
33
|
-
this.checkPosition()
|
34
|
-
}
|
35
|
-
|
36
|
-
Affix.prototype.checkPosition = function () {
|
37
|
-
if (!this.$element.is(':visible')) return
|
38
|
-
|
39
|
-
var scrollHeight = $(document).height()
|
40
|
-
, scrollTop = this.$window.scrollTop()
|
41
|
-
, position = this.$element.offset()
|
42
|
-
, offset = this.options.offset
|
43
|
-
, offsetBottom = offset.bottom
|
44
|
-
, offsetTop = offset.top
|
45
|
-
, reset = 'affix affix-top affix-bottom'
|
46
|
-
, affix
|
47
|
-
|
48
|
-
if (typeof offset != 'object') offsetBottom = offsetTop = offset
|
49
|
-
if (typeof offsetTop == 'function') offsetTop = offset.top()
|
50
|
-
if (typeof offsetBottom == 'function') offsetBottom = offset.bottom()
|
51
|
-
|
52
|
-
affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ?
|
53
|
-
false : offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ?
|
54
|
-
'bottom' : offsetTop != null && scrollTop <= offsetTop ?
|
55
|
-
'top' : false
|
56
|
-
|
57
|
-
if (this.affixed === affix) return
|
58
|
-
|
59
|
-
this.affixed = affix
|
60
|
-
this.unpin = affix == 'bottom' ? position.top - scrollTop : null
|
61
|
-
this.$element.removeClass(reset).addClass('affix' + (affix ? '-' + affix : ''))
|
62
|
-
}
|
63
|
-
|
64
|
-
|
65
|
-
/* AFFIX PLUGIN DEFINITION
|
66
|
-
* ======================= */
|
67
|
-
|
68
|
-
$.fn.affix = function (option) {
|
69
|
-
return this.each(function () {
|
70
|
-
var $this = $(this)
|
71
|
-
, data = $this.data('affix')
|
72
|
-
, options = typeof option == 'object' && option
|
73
|
-
if (!data) $this.data('affix', (data = new Affix(this, options)))
|
74
|
-
if (typeof option == 'string') data[option]()
|
75
|
-
})
|
76
|
-
}
|
77
|
-
|
78
|
-
$.fn.affix.Constructor = Affix
|
79
|
-
|
80
|
-
$.fn.affix.defaults = {
|
81
|
-
offset: 0
|
82
|
-
}
|
83
|
-
|
84
|
-
|
85
|
-
/* AFFIX DATA-API
|
86
|
-
* ============== */
|
87
|
-
|
88
|
-
$(window).on('load', function () {
|
89
|
-
$('[data-spy="affix"]').each(function () {
|
90
|
-
var $spy = $(this)
|
91
|
-
, data = $spy.data()
|
92
|
-
|
93
|
-
data.offset = data.offset || {}
|
94
|
-
|
95
|
-
data.offsetBottom && (data.offset.bottom = data.offsetBottom)
|
96
|
-
data.offsetTop && (data.offset.top = data.offsetTop)
|
97
|
-
|
98
|
-
$spy.affix(data)
|
99
|
-
})
|
100
|
-
})
|
101
|
-
|
102
|
-
|
103
|
-
}(window.jQuery);
|