nail_polish 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.rdoc +29 -0
- data/Rakefile +23 -0
- data/app/assets/javascripts/nail_polish/app.js +58 -0
- data/app/assets/javascripts/nail_polish/events/flasher.js +17 -0
- data/app/assets/javascripts/nail_polish/events/redirector.js +3 -0
- data/app/assets/javascripts/nail_polish/events.js +28 -0
- data/app/assets/javascripts/nail_polish/nail_polish.js +25 -0
- data/app/assets/javascripts/nail_polish/overrides/auth_token_adder.js +44 -0
- data/app/assets/javascripts/nail_polish/overrides/for_backbone.js +14 -0
- data/app/assets/javascripts/nail_polish/overrides/function_bind.js +6 -0
- data/app/assets/javascripts/nail_polish/overrides/global_publisher_adder.js +28 -0
- data/app/assets/javascripts/nail_polish/presenter.js +43 -0
- data/app/assets/javascripts/nail_polish/presenters/collection.js +11 -0
- data/app/assets/javascripts/nail_polish/router.js +78 -0
- data/app/assets/javascripts/nail_polish/utils/text.js +36 -0
- data/app/assets/javascripts/nail_polish/view/parent_finder.js +46 -0
- data/app/assets/javascripts/nail_polish/view.js +80 -0
- data/app/assets/javascripts/nail_polish/widget/flash.js +36 -0
- data/app/assets/javascripts/nail_polish/widget/modal.js +40 -0
- data/app/assets/javascripts/nail_polish.js +21 -0
- data/app/assets/javascripts/nail_polish_legacy_base.js +2 -0
- data/app/assets/javascripts/nail_polish_modern_base.js +2 -0
- data/app/assets/javascripts/nail_polish_widgets.js +2 -0
- data/app/assets/javascripts/vendor/backbone.js +1571 -0
- data/app/assets/javascripts/vendor/jquery-1.8.3.js +9472 -0
- data/app/assets/javascripts/vendor/jquery.cookie.js +94 -0
- data/app/assets/javascripts/vendor/underscore.js +1200 -0
- data/app/assets/javascripts/vendor/zepto.cookie.js +22 -0
- data/app/assets/javascripts/vendor/zepto.js +1355 -0
- data/config/initializers/nail_polish.rb +1 -0
- data/config/routes.rb +2 -0
- data/lib/nail_polish/engine.rb +4 -0
- data/lib/nail_polish/version.rb +3 -0
- data/lib/nail_polish.rb +7 -0
- data/lib/tasks/nail_polish_tasks.rake +4 -0
- metadata +207 -0
@@ -0,0 +1,94 @@
|
|
1
|
+
/*!
|
2
|
+
* jQuery Cookie Plugin v1.3.1
|
3
|
+
* https://github.com/carhartl/jquery-cookie
|
4
|
+
*
|
5
|
+
* Copyright 2013 Klaus Hartl
|
6
|
+
* Released under the MIT license
|
7
|
+
*/
|
8
|
+
(function (factory) {
|
9
|
+
if (typeof define === 'function' && define.amd) {
|
10
|
+
// AMD. Register as anonymous module.
|
11
|
+
define(['jquery'], factory);
|
12
|
+
} else {
|
13
|
+
// Browser globals.
|
14
|
+
factory(jQuery);
|
15
|
+
}
|
16
|
+
}(function ($) {
|
17
|
+
|
18
|
+
var pluses = /\+/g;
|
19
|
+
|
20
|
+
function raw(s) {
|
21
|
+
return s;
|
22
|
+
}
|
23
|
+
|
24
|
+
function decoded(s) {
|
25
|
+
return decodeURIComponent(s.replace(pluses, ' '));
|
26
|
+
}
|
27
|
+
|
28
|
+
function converted(s) {
|
29
|
+
if (s.indexOf('"') === 0) {
|
30
|
+
// This is a quoted cookie as according to RFC2068, unescape
|
31
|
+
s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
|
32
|
+
}
|
33
|
+
try {
|
34
|
+
return config.json ? JSON.parse(s) : s;
|
35
|
+
} catch(er) {}
|
36
|
+
}
|
37
|
+
|
38
|
+
var config = $.fn.cookie = function (key, value, options) {
|
39
|
+
|
40
|
+
// write
|
41
|
+
if (value !== undefined) {
|
42
|
+
options = $.extend({}, config.defaults, options);
|
43
|
+
|
44
|
+
if (typeof options.expires === 'number') {
|
45
|
+
var days = options.expires, t = options.expires = new Date();
|
46
|
+
t.setDate(t.getDate() + days);
|
47
|
+
}
|
48
|
+
|
49
|
+
value = config.json ? JSON.stringify(value) : String(value);
|
50
|
+
|
51
|
+
return (document.cookie = [
|
52
|
+
config.raw ? key : encodeURIComponent(key),
|
53
|
+
'=',
|
54
|
+
config.raw ? value : encodeURIComponent(value),
|
55
|
+
options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
|
56
|
+
options.path ? '; path=' + options.path : '',
|
57
|
+
options.domain ? '; domain=' + options.domain : '',
|
58
|
+
options.secure ? '; secure' : ''
|
59
|
+
].join(''));
|
60
|
+
}
|
61
|
+
|
62
|
+
// read
|
63
|
+
var decode = config.raw ? raw : decoded;
|
64
|
+
var cookies = document.cookie.split('; ');
|
65
|
+
var result = key ? undefined : {};
|
66
|
+
for (var i = 0, l = cookies.length; i < l; i++) {
|
67
|
+
var parts = cookies[i].split('=');
|
68
|
+
var name = decode(parts.shift());
|
69
|
+
var cookie = decode(parts.join('='));
|
70
|
+
|
71
|
+
if (key && key === name) {
|
72
|
+
result = converted(cookie);
|
73
|
+
break;
|
74
|
+
}
|
75
|
+
|
76
|
+
if (!key) {
|
77
|
+
result[name] = converted(cookie);
|
78
|
+
}
|
79
|
+
}
|
80
|
+
|
81
|
+
return result;
|
82
|
+
};
|
83
|
+
|
84
|
+
config.defaults = {};
|
85
|
+
|
86
|
+
$.removeCookie = function (key, options) {
|
87
|
+
if ($.cookie(key) !== undefined) {
|
88
|
+
$.cookie(key, '', $.extend(options, { expires: -1 }));
|
89
|
+
return true;
|
90
|
+
}
|
91
|
+
return false;
|
92
|
+
};
|
93
|
+
|
94
|
+
}));
|