compass-jquery-plugin 0.3.2.3 → 0.3.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +54 -37
- data/VERSION.yml +1 -1
- data/lib/handle_attributes.rb +4 -4
- data/lib/handle_js_files.rb +5 -5
- data/lib/jqtouch_theme.rb +2 -2
- data/lib/jquery/dynatree.rb +2 -2
- data/lib/jquery/emulators.rb +1 -1
- data/lib/jquery/flash_messages.rb +6 -6
- data/lib/jquery/graphics.rb +5 -0
- data/lib/jquery/gridify/assertions.rb +1 -1
- data/lib/jquery/gridify/grid.rb +76 -59
- data/lib/jquery/gridify/grid_column.rb +73 -67
- data/lib/jquery/gridify/grid_finder.rb +79 -79
- data/lib/jquery/gridify/grid_options.rb +154 -149
- data/lib/jquery/gridify/grid_view.rb +143 -143
- data/lib/jquery/gridify.rb +25 -25
- data/lib/jquery/ical/calendar.rb +2 -2
- data/lib/jquery/ical/event.rb +48 -44
- data/lib/jquery/ical/helpers/ui_event_helper.rb +3 -3
- data/lib/jquery/jqgrid/jqgrid.rb +58 -58
- data/lib/jquery/jqgrid.rb +1 -1
- data/lib/jquery/jqtouch.rb +1 -1
- data/lib/jquery/jquery.rb +117 -117
- data/lib/jquery/jquery_auto_complete.rb +9 -9
- data/lib/jquery/jquery_json_response.rb +12 -12
- data/lib/jquery/jquery_selector_assertions.rb +55 -53
- data/lib/jquery/jstree.rb +2 -2
- data/lib/jquery/mobile.rb +1 -1
- data/lib/jquery/ribbon.rb +2 -2
- data/lib/jquery/secret_sauce/controller/ui_dialog_controls.rb +5 -5
- data/lib/jquery/secret_sauce/controller/ui_grid_controls.rb +5 -5
- data/lib/jquery/secret_sauce/helpers/ui_dialog_helper.rb +1 -1
- data/lib/jquery/secret_sauce/helpers/ui_form_helper.rb +39 -39
- data/lib/jquery/secret_sauce/helpers/ui_grid_helper.rb +74 -74
- data/lib/jquery/secret_sauce/model/find_for_grid.rb +21 -21
- data/lib/jquery/secret_sauce.rb +1 -1
- data/lib/jquery/tools.rb +1 -1
- data/lib/jquery_mobile_theme.rb +2 -2
- data/lib/jquery_ui_theme.rb +12 -12
- data/templates/dynatree/config/initializers/dynatree.rb +3 -3
- data/templates/dynatree/jquery/dynatree/aero.scss +16 -16
- data/templates/dynatree/jquery/dynatree/aqua.scss +16 -16
- data/templates/dynatree/jquery/dynatree/crystal.scss +16 -16
- data/templates/dynatree/jquery/dynatree/xp.scss +17 -17
- data/templates/dynatree/jquery.dynatree.js +2926 -2912
- data/templates/emulators/config/initializers/emulators.rb +6 -6
- data/templates/graphics/config/initializers/graphics.rb +5 -0
- data/templates/graphics/jquery/ganttView.scss +89 -0
- data/templates/graphics/jquery.ganttView.js +1669 -0
- data/templates/graphics/jquery.ganttView.min.js +70 -0
- data/templates/{jquery → graphics}/jquery.sparkline.js +466 -438
- data/templates/{jquery → graphics}/jquery.sparkline.min.js +0 -0
- data/templates/graphics/manifest.rb +9 -0
- data/templates/jqgrid/config/initializers/jqgrid.rb +1 -1
- data/templates/jqgrid/i18n/jqgrid/locale-ar.js +131 -125
- data/templates/jqgrid/i18n/jqgrid/locale-bg.js +135 -131
- data/templates/jqgrid/i18n/jqgrid/locale-bg1251.js +135 -131
- data/templates/jqgrid/i18n/jqgrid/locale-cat.js +132 -126
- data/templates/jqgrid/i18n/jqgrid/locale-cn.js +137 -131
- data/templates/jqgrid/i18n/jqgrid/locale-cs.js +133 -127
- data/templates/jqgrid/i18n/jqgrid/locale-da.js +132 -126
- data/templates/jqgrid/i18n/jqgrid/locale-de.js +138 -132
- data/templates/jqgrid/i18n/jqgrid/locale-el.js +131 -125
- data/templates/jqgrid/i18n/jqgrid/locale-en.js +133 -127
- data/templates/jqgrid/i18n/jqgrid/locale-es.js +133 -127
- data/templates/jqgrid/i18n/jqgrid/locale-fa.js +19 -16
- data/templates/jqgrid/i18n/jqgrid/locale-fi.js +132 -126
- data/templates/jqgrid/i18n/jqgrid/locale-fr.js +131 -125
- data/templates/jqgrid/i18n/jqgrid/locale-gl.js +131 -125
- data/templates/jqgrid/i18n/jqgrid/locale-he.js +132 -126
- data/templates/jqgrid/i18n/jqgrid/locale-hu.js +133 -127
- data/templates/jqgrid/i18n/jqgrid/locale-is.js +131 -125
- data/templates/jqgrid/i18n/jqgrid/locale-it.js +8 -1
- data/templates/jqgrid/i18n/jqgrid/locale-ja.js +139 -136
- data/templates/jqgrid/i18n/jqgrid/locale-nl.js +4 -1
- data/templates/jqgrid/i18n/jqgrid/locale-no.js +14 -1
- data/templates/jqgrid/i18n/jqgrid/locale-pl.js +132 -126
- data/templates/jqgrid/i18n/jqgrid/locale-pt-br.js +132 -126
- data/templates/jqgrid/i18n/jqgrid/locale-pt.js +130 -124
- data/templates/jqgrid/i18n/jqgrid/locale-ro.js +144 -138
- data/templates/jqgrid/i18n/jqgrid/locale-ru.js +132 -126
- data/templates/jqgrid/i18n/jqgrid/locale-sk.js +132 -126
- data/templates/jqgrid/i18n/jqgrid/locale-sr.js +133 -127
- data/templates/jqgrid/i18n/jqgrid/locale-sv.js +132 -126
- data/templates/jqgrid/i18n/jqgrid/locale-tr.js +131 -125
- data/templates/jqgrid/i18n/jqgrid/locale-ua.js +132 -126
- data/templates/jqgrid/jquery.jqGrid.js +12735 -10444
- data/templates/jqgrid/jquery.jqGrid.min.js +477 -469
- data/templates/jqgrid/public/stylesheets/ellipsis-xbl.xml +12 -10
- data/templates/jqtouch/config/initializers/jqtouch.rb +3 -3
- data/templates/jqtouch/jquery/touch/jqtouch.scss +1 -1
- data/templates/jqtouch/jquery.jqtouch.js +10025 -10043
- data/templates/jquery/config/initializers/jquery.rb +2 -4
- data/templates/jquery/history.adapter.jquery.js +71 -0
- data/templates/jquery/history.adapter.jquery.min.js +4 -0
- data/templates/jquery/history.html4.js +690 -0
- data/templates/jquery/history.html4.min.js +21 -0
- data/templates/jquery/history.js +1297 -0
- data/templates/jquery/history.min.js +29 -0
- data/templates/jquery/i18n/jquery.ui/datepicker-af.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-ar-DZ.js +19 -19
- data/templates/jquery/i18n/jquery.ui/datepicker-ar.js +19 -19
- data/templates/jquery/i18n/jquery.ui/datepicker-az.js +19 -19
- data/templates/jquery/i18n/jquery.ui/datepicker-bg.js +8 -8
- data/templates/jquery/i18n/jquery.ui/datepicker-bs.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-ca.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-cs.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-da.js +14 -14
- data/templates/jquery/i18n/jquery.ui/datepicker-de.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-el.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-en-AU.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-en-GB.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-en-NZ.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-eo.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-es.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-et.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-eu.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-fa.js +18 -18
- data/templates/jquery/i18n/jquery.ui/datepicker-fi.js +15 -15
- data/templates/jquery/i18n/jquery.ui/datepicker-fo.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-fr-CH.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-fr.js +22 -22
- data/templates/jquery/i18n/jquery.ui/datepicker-gl.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-he.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-hr.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-hu.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-hu.min.js +1 -1
- data/templates/jquery/i18n/jquery.ui/datepicker-hy.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-id.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-is.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-it.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-ja.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-ko.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-kz.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-lt.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-lv.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-ml.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-ms.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-nl.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-no.js +16 -16
- data/templates/jquery/i18n/jquery.ui/datepicker-no.min.js +2 -2
- data/templates/jquery/i18n/jquery.ui/datepicker-pl.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-pt-BR.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-pt.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-rm.js +18 -18
- data/templates/jquery/i18n/jquery.ui/datepicker-ro.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-ru.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-sk.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-sl.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-sq.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-sr-SR.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-sr.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-sv.js +14 -14
- data/templates/jquery/i18n/jquery.ui/datepicker-ta.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-th.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-tr.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-uk.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-vi.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-zh-CN.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-zh-HK.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-zh-TW.js +20 -20
- data/templates/jquery/{partials → jquery/ui}/_flash_messages.scss +0 -0
- data/templates/jquery/jquery/ui/_theme.scss +14 -13
- data/templates/jquery/jquery/ui/contextMenu/configure.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu/copy.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu/cut.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu/delete.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu/edit.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu/exit.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu/new.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu/paste.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu/rename.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu/show.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu/trash.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu.scss +16 -10
- data/templates/jquery/jquery-ui.js +11839 -23066
- data/templates/jquery/jquery-ui.min.js +401 -795
- data/templates/jquery/jquery.bgiframe.js +27 -25
- data/templates/jquery/jquery.contextMenu.js +209 -196
- data/templates/jquery/jquery.cookie.js +3 -1
- data/templates/jquery/jquery.dotimeout.js +236 -228
- data/templates/jquery/jquery.dst.js +154 -151
- data/templates/jquery/jquery.farbtastic.js +293 -293
- data/templates/jquery/jquery.flashMessages.js +26 -0
- data/templates/jquery/jquery.flashMessages.min.js +1 -0
- data/templates/jquery/jquery.form.js +803 -786
- data/templates/jquery/jquery.haml.js +248 -247
- data/templates/jquery/jquery.hotkeys.js +89 -89
- data/templates/jquery/jquery.js +8141 -8106
- data/templates/jquery/jquery.layout.js +2451 -2415
- data/templates/jquery/jquery.min.js +167 -166
- data/templates/jquery/jquery.mousewheel.js +62 -54
- data/templates/jquery/jquery.offline.js +171 -171
- data/templates/jquery/jquery.pngFix.js +76 -76
- data/templates/jquery/jquery.replacetext.js +83 -83
- data/templates/jquery/jquery.themeswitchertool.js +202 -177
- data/templates/jquery/jquery.tmpl.js +478 -473
- data/templates/jquery/jquery.tmplPlus.js +82 -81
- data/templates/jquery/jrails.js +178 -175
- data/templates/jquery/json.js +77 -7
- data/templates/jquery/json2.js +480 -0
- data/templates/jquery/json2.min.js +7 -0
- data/templates/jquery/lib/tasks/haml.rake +2 -2
- data/templates/jquery/manifest.rb +21 -17
- data/templates/jstree/jquery.jstree.js +5967 -4536
- data/templates/mobile/config/initializers/mobile.rb +1 -1
- data/templates/mobile/jquery/mobile/_base.scss +944 -927
- data/templates/mobile/jquery/mobile/default.scss +61 -48
- data/templates/mobile/jquery/mobile/valencia.scss +56 -42
- data/templates/mobile/jquery.mobile.js +4461 -4347
- data/templates/mobile/jquery.mobile.min.js +11 -2
- data/templates/mobile/lib/tasks/jquery.mobile.rake +12 -12
- data/templates/ribbon/config/initializers/ribbon.rb +2 -2
- data/templates/ribbon/jquery.ribbon.js +50 -29
- data/templates/secret_sauce/secret_sauce.js +8 -8
- data/templates/tools/flowplayer.js +945 -1
- data/templates/tools/jquery.tools.js +4645 -4335
- data/templates/tools/jquery.tools.min.js +37 -37
- data/templates/tools/lib/tasks/jquery.tools.rake +4 -4
- data/templates/tools/swfobject.js +813 -773
- metadata +33 -21
- data/templates/jquery/haml.js +0 -506
- data/templates/jquery/haml.min.js +0 -5
- data/templates/jquery/jquery/ui/contextMenu/door.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu/page_white_copy.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu/page_white_delete.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu/page_white_edit.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu/page_white_new.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu/page_white_paste.png +0 -0
- data/templates/jquery/jquery.compat-1.3.js +0 -291
- data/templates/jquery/jquery.compat-1.3.min.js +0 -6
- data/templates/jquery/jquery.flash_messages.js +0 -5
- data/templates/jquery/jquery.flash_messages.min.js +0 -1
- data/templates/jquery/jquery.history.js +0 -194
- data/templates/jquery/jquery.history.min.js +0 -5
|
@@ -29,184 +29,184 @@
|
|
|
29
29
|
|
|
30
30
|
(function($) {
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
// modified getJSON which uses ifModified: true
|
|
43
|
-
function getJSON(url, data, fn) {
|
|
44
|
-
if (jQuery.isFunction(data)) {
|
|
45
|
-
fn = data;
|
|
46
|
-
data = null;
|
|
32
|
+
var prefix = "offline.jquery:",
|
|
33
|
+
mostRecent = null,
|
|
34
|
+
requesting = {};
|
|
35
|
+
|
|
36
|
+
// Allow the user to explicitly turn off localStorage
|
|
37
|
+
// before loading this plugin
|
|
38
|
+
if (typeof $.support.localStorage === "undefined") {
|
|
39
|
+
$.support.localStorage = !!window.localStorage;
|
|
47
40
|
}
|
|
48
41
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
requesting[requestingKey] = true;
|
|
55
|
-
|
|
56
|
-
return jQuery.ajax({
|
|
57
|
-
type: "GET",
|
|
58
|
-
url: url,
|
|
59
|
-
data: data,
|
|
60
|
-
success: function(responseData, text) {
|
|
61
|
-
delete requesting[requestingKey];
|
|
62
|
-
|
|
63
|
-
// handle lack of response (error callback isn't called in this case)
|
|
64
|
-
if (undefined === responseData) {
|
|
65
|
-
if (!window.navigator.onLine) {
|
|
66
|
-
// requeue the request for the next time we come online
|
|
67
|
-
mostRecent = function() {
|
|
68
|
-
getJSON(url, data, fn);
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
return;
|
|
42
|
+
// modified getJSON which uses ifModified: true
|
|
43
|
+
function getJSON(url, data, fn) {
|
|
44
|
+
if (jQuery.isFunction(data)) {
|
|
45
|
+
fn = data;
|
|
46
|
+
data = null;
|
|
72
47
|
}
|
|
73
48
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
error: function() {
|
|
77
|
-
delete requesting[requestingKey];
|
|
78
|
-
},
|
|
79
|
-
dataType: "json",
|
|
80
|
-
ifModified: true
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
if ($.support.localStorage) {
|
|
85
|
-
// If localStorage is available, define jQuery.retrieveJSON
|
|
86
|
-
// and jQuery.clearJSON to operate in terms of the offline
|
|
87
|
-
// cache
|
|
88
|
-
// If the user comes online, run the most recent request
|
|
89
|
-
// that was queued due to the user being offline
|
|
90
|
-
$(window).bind("online", function() {
|
|
91
|
-
if (mostRecent) {
|
|
92
|
-
mostRecent();
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
// If the user goes offline, hide any loading bar
|
|
97
|
-
// the user may have created
|
|
98
|
-
$(window).bind("offline", function() {
|
|
99
|
-
jQuery.event.trigger("ajaxStop");
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
$.retrieveJSON = function(url, data, fn) {
|
|
103
|
-
// allow jQuery.retrieveJSON(url, fn)
|
|
104
|
-
if ($.isFunction(data)) {
|
|
105
|
-
fn = data;
|
|
106
|
-
data = {};
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
// remember when this request started so we can report
|
|
110
|
-
// the time when a follow-up Ajax request completes.
|
|
111
|
-
// this is especially important when the user comes
|
|
112
|
-
// back online, since retrieveDate may be minutes,
|
|
113
|
-
// hours or even days before the Ajax request finally
|
|
114
|
-
// completes
|
|
115
|
-
var retrieveDate = new Date;
|
|
116
|
-
|
|
117
|
-
// get a String value for the data passed in, and then
|
|
118
|
-
// use it to calculate a cache key
|
|
119
|
-
var param = $.param(data),
|
|
120
|
-
key = prefix + url + ":" + param,
|
|
121
|
-
text = localStorage[key],
|
|
122
|
-
dateString = localStorage[key + ":date"],
|
|
123
|
-
date = new Date(Date.parse(dateString));
|
|
124
|
-
|
|
125
|
-
function cleanupLocalStorage() {
|
|
126
|
-
// take all date keys and remove the oldest half
|
|
127
|
-
var dateKeys = [];
|
|
128
|
-
for (var i = 0; i < localStorage.length; ++i) {
|
|
129
|
-
var key = localStorage.key(i);
|
|
130
|
-
if (/:date$/.test(key)) {
|
|
131
|
-
dateKeys.push(key);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
dateKeys.sort(function(a, b) {
|
|
135
|
-
var date_a = localStorage[a], date_b = localStorage[b];
|
|
136
|
-
return date_a < date_b ? -1 : (date_a > date_b ? +1 : 0);
|
|
137
|
-
});
|
|
138
|
-
for (var i = 0; i < dateKeys.length / 2; ++i) {
|
|
139
|
-
var key = dateKeys[i];
|
|
140
|
-
delete localStorage[key];
|
|
141
|
-
delete localStorage[key.substr(0, key.length - 5)]; // :date
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
// create a function that will make an Ajax request and
|
|
146
|
-
// store the result in the cache. This function will be
|
|
147
|
-
// deferred until later if the user is offline
|
|
148
|
-
function getData() {
|
|
149
|
-
getJSON(url, data, function(json, status) {
|
|
150
|
-
if ( status == 'notmodified' ) {
|
|
151
|
-
// Just return if the response has a 304 status code
|
|
49
|
+
var requestingKey = url + "?" + $.param(data || {});
|
|
50
|
+
if (requesting[requestingKey]) {
|
|
152
51
|
return false;
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
requesting[requestingKey] = true;
|
|
55
|
+
|
|
56
|
+
return jQuery.ajax({
|
|
57
|
+
type: "GET",
|
|
58
|
+
url: url,
|
|
59
|
+
data: data,
|
|
60
|
+
success: function(responseData, text) {
|
|
61
|
+
delete requesting[requestingKey];
|
|
62
|
+
|
|
63
|
+
// handle lack of response (error callback isn't called in this case)
|
|
64
|
+
if (undefined === responseData) {
|
|
65
|
+
if (!window.navigator.onLine) {
|
|
66
|
+
// requeue the request for the next time we come online
|
|
67
|
+
mostRecent = function() {
|
|
68
|
+
getJSON(url, data, fn);
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
return;
|
|
164
72
|
}
|
|
73
|
+
|
|
74
|
+
fn(responseData, text);
|
|
75
|
+
},
|
|
76
|
+
error: function() {
|
|
77
|
+
delete requesting[requestingKey];
|
|
78
|
+
},
|
|
79
|
+
dataType: "json",
|
|
80
|
+
ifModified: true
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if ($.support.localStorage) {
|
|
85
|
+
// If localStorage is available, define jQuery.retrieveJSON
|
|
86
|
+
// and jQuery.clearJSON to operate in terms of the offline
|
|
87
|
+
// cache
|
|
88
|
+
// If the user comes online, run the most recent request
|
|
89
|
+
// that was queued due to the user being offline
|
|
90
|
+
$(window).bind("online", function() {
|
|
91
|
+
if (mostRecent) {
|
|
92
|
+
mostRecent();
|
|
165
93
|
}
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
// If this is a follow-up request, create an object
|
|
169
|
-
// containing both the original time of the cached
|
|
170
|
-
// data and the time that the data was originally
|
|
171
|
-
// retrieved from the cache. With this information,
|
|
172
|
-
// users of jQuery Offline can provide the user
|
|
173
|
-
// with improved feedback if the lag is large
|
|
174
|
-
var data = text && { cachedAt: date, retrievedAt: retrieveDate };
|
|
175
|
-
fn(json, status, data);
|
|
176
94
|
});
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
95
|
+
|
|
96
|
+
// If the user goes offline, hide any loading bar
|
|
97
|
+
// the user may have created
|
|
98
|
+
$(window).bind("offline", function() {
|
|
99
|
+
jQuery.event.trigger("ajaxStop");
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
$.retrieveJSON = function(url, data, fn) {
|
|
103
|
+
// allow jQuery.retrieveJSON(url, fn)
|
|
104
|
+
if ($.isFunction(data)) {
|
|
105
|
+
fn = data;
|
|
106
|
+
data = {};
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// remember when this request started so we can report
|
|
110
|
+
// the time when a follow-up Ajax request completes.
|
|
111
|
+
// this is especially important when the user comes
|
|
112
|
+
// back online, since retrieveDate may be minutes,
|
|
113
|
+
// hours or even days before the Ajax request finally
|
|
114
|
+
// completes
|
|
115
|
+
var retrieveDate = new Date;
|
|
116
|
+
|
|
117
|
+
// get a String value for the data passed in, and then
|
|
118
|
+
// use it to calculate a cache key
|
|
119
|
+
var param = $.param(data),
|
|
120
|
+
key = prefix + url + ":" + param,
|
|
121
|
+
text = localStorage[key],
|
|
122
|
+
dateString = localStorage[key + ":date"],
|
|
123
|
+
date = new Date(Date.parse(dateString));
|
|
124
|
+
|
|
125
|
+
function cleanupLocalStorage() {
|
|
126
|
+
// take all date keys and remove the oldest half
|
|
127
|
+
var dateKeys = [];
|
|
128
|
+
for (var i = 0; i < localStorage.length; ++i) {
|
|
129
|
+
var key = localStorage.key(i);
|
|
130
|
+
if (/:date$/.test(key)) {
|
|
131
|
+
dateKeys.push(key);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
dateKeys.sort(function(a, b) {
|
|
135
|
+
var date_a = localStorage[a], date_b = localStorage[b];
|
|
136
|
+
return date_a < date_b ? -1 : (date_a > date_b ? +1 : 0);
|
|
137
|
+
});
|
|
138
|
+
for (var i = 0; i < dateKeys.length / 2; ++i) {
|
|
139
|
+
var key = dateKeys[i];
|
|
140
|
+
delete localStorage[key];
|
|
141
|
+
delete localStorage[key.substr(0, key.length - 5)]; // :date
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// create a function that will make an Ajax request and
|
|
146
|
+
// store the result in the cache. This function will be
|
|
147
|
+
// deferred until later if the user is offline
|
|
148
|
+
function getData() {
|
|
149
|
+
getJSON(url, data, function(json, status) {
|
|
150
|
+
if (status == 'notmodified') {
|
|
151
|
+
// Just return if the response has a 304 status code
|
|
152
|
+
return false;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
while (true) {
|
|
156
|
+
try {
|
|
157
|
+
localStorage[key] = JSON.stringify(json);
|
|
158
|
+
localStorage[key + ":date"] = new Date;
|
|
159
|
+
break;
|
|
160
|
+
} catch (e) {
|
|
161
|
+
if (e.name == "QUOTA_EXCEEDED_ERR" || e.name ==
|
|
162
|
+
"NS_ERROR_DOM_QUOTA_REACHED") {
|
|
163
|
+
cleanupLocalStorage();
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// If this is a follow-up request, create an object
|
|
169
|
+
// containing both the original time of the cached
|
|
170
|
+
// data and the time that the data was originally
|
|
171
|
+
// retrieved from the cache. With this information,
|
|
172
|
+
// users of jQuery Offline can provide the user
|
|
173
|
+
// with improved feedback if the lag is large
|
|
174
|
+
var data = text && { cachedAt: date, retrievedAt: retrieveDate };
|
|
175
|
+
fn(json, status, data);
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
// If there is anything in the cache, call the callback
|
|
180
|
+
// right away, with the "cached" status string
|
|
181
|
+
if (text) {
|
|
182
|
+
var response = fn($.parseJSON(text), "cached", { cachedAt: date });
|
|
183
|
+
if (response === false) return false;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
// If the user is online, make the Ajax request right away;
|
|
187
|
+
// otherwise, make it the most recent callback so it will
|
|
188
|
+
// get triggered when the user comes online
|
|
189
|
+
if (window.navigator.onLine) {
|
|
190
|
+
getData();
|
|
191
|
+
} else {
|
|
192
|
+
mostRecent = getData;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
return true;
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
// jQuery.clearJSON is simply a wrapper around deleting the
|
|
199
|
+
// localStorage for a URL/data pair
|
|
200
|
+
$.clearJSON = function(url, data) {
|
|
201
|
+
var param = $.param(data || {});
|
|
202
|
+
delete localStorage[prefix + url + ":" + param];
|
|
203
|
+
delete localStorage[prefix + url + ":" + param + ":date"];
|
|
204
|
+
};
|
|
205
|
+
} else {
|
|
206
|
+
// If localStorage is unavailable, just make all requests
|
|
207
|
+
// regular Ajax requests.
|
|
208
|
+
$.retrieveJSON = getJSON;
|
|
209
|
+
$.clearJSON = $.noop;
|
|
210
|
+
}
|
|
211
211
|
|
|
212
212
|
})(jQuery);
|
|
@@ -31,81 +31,81 @@
|
|
|
31
31
|
|
|
32
32
|
(function($) {
|
|
33
33
|
|
|
34
|
-
jQuery.fn.pngFix = function(settings) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
};
|
|
34
|
+
jQuery.fn.pngFix = function(settings) {
|
|
35
|
+
|
|
36
|
+
// Settings
|
|
37
|
+
settings = jQuery.extend({
|
|
38
|
+
blankgif: '/images/jquery/ui/pngFix/blank.gif'
|
|
39
|
+
}, settings);
|
|
40
|
+
|
|
41
|
+
var ie55 = (navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion) == 4 && navigator.appVersion.indexOf("MSIE 5.5") != -1);
|
|
42
|
+
var ie6 = (navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion) == 4 && navigator.appVersion.indexOf("MSIE 6.0") != -1);
|
|
43
|
+
|
|
44
|
+
if (jQuery.browser.msie && (ie55 || ie6)) {
|
|
45
|
+
|
|
46
|
+
//fix images with png-source
|
|
47
|
+
jQuery(this).find("img[@src$=.png]").each(function() {
|
|
48
|
+
|
|
49
|
+
jQuery(this).attr('width', jQuery(this).width());
|
|
50
|
+
jQuery(this).attr('height', jQuery(this).height());
|
|
51
|
+
|
|
52
|
+
var prevStyle = '';
|
|
53
|
+
var strNewHTML = '';
|
|
54
|
+
var imgId = (jQuery(this).attr('id')) ? 'id="' + jQuery(this).attr('id') + '" ' : '';
|
|
55
|
+
var imgClass = (jQuery(this).attr('class')) ? 'class="' + jQuery(this).attr('class') + '" ' : '';
|
|
56
|
+
var imgTitle = (jQuery(this).attr('title')) ? 'title="' + jQuery(this).attr('title') + '" ' : '';
|
|
57
|
+
var imgAlt = (jQuery(this).attr('alt')) ? 'alt="' + jQuery(this).attr('alt') + '" ' : '';
|
|
58
|
+
var imgAlign = (jQuery(this).attr('align')) ? 'float:' + jQuery(this).attr('align') + ';' : '';
|
|
59
|
+
var imgHand = (jQuery(this).parent().attr('href')) ? 'cursor:hand;' : '';
|
|
60
|
+
if (this.style.border) {
|
|
61
|
+
prevStyle += 'border:' + this.style.border + ';';
|
|
62
|
+
this.style.border = '';
|
|
63
|
+
}
|
|
64
|
+
if (this.style.padding) {
|
|
65
|
+
prevStyle += 'padding:' + this.style.padding + ';';
|
|
66
|
+
this.style.padding = '';
|
|
67
|
+
}
|
|
68
|
+
if (this.style.margin) {
|
|
69
|
+
prevStyle += 'margin:' + this.style.margin + ';';
|
|
70
|
+
this.style.margin = '';
|
|
71
|
+
}
|
|
72
|
+
var imgStyle = (this.style.cssText);
|
|
73
|
+
|
|
74
|
+
strNewHTML += '<span ' + imgId + imgClass + imgTitle + imgAlt;
|
|
75
|
+
strNewHTML += 'style="position:relative;white-space:pre-line;display:inline-block;background:transparent;' + imgAlign + imgHand;
|
|
76
|
+
strNewHTML += 'width:' + jQuery(this).width() + 'px;' + 'height:' + jQuery(this).height() + 'px;';
|
|
77
|
+
strNewHTML += 'filter:progid:DXImageTransform.Microsoft.AlphaImageLoader' + '(src=\'' + jQuery(this).attr('src') + '\', sizingMethod=\'scale\');';
|
|
78
|
+
strNewHTML += imgStyle + '"></span>';
|
|
79
|
+
if (prevStyle != '') {
|
|
80
|
+
strNewHTML = '<span style="position:relative;display:inline-block;' + prevStyle + imgHand + 'width:' + jQuery(this).width() + 'px;' + 'height:' + jQuery(this).height() + 'px;' + '">' + strNewHTML + '</span>';
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
jQuery(this).hide();
|
|
84
|
+
jQuery(this).after(strNewHTML);
|
|
85
|
+
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
// fix css background pngs
|
|
89
|
+
jQuery(this).find("*").each(function() {
|
|
90
|
+
var bgIMG = jQuery(this).css('background-image');
|
|
91
|
+
if (bgIMG.indexOf(".png") != -1) {
|
|
92
|
+
var iebg = bgIMG.split('url("')[1].split('")')[0];
|
|
93
|
+
jQuery(this).css('background-image', 'none');
|
|
94
|
+
jQuery(this).get(0).runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + iebg + "',sizingMethod='scale')";
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
//fix input with png-source
|
|
99
|
+
jQuery(this).find("input[@src$=.png]").each(function() {
|
|
100
|
+
var bgIMG = jQuery(this).attr('src');
|
|
101
|
+
jQuery(this).get(0).runtimeStyle.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader' + '(src=\'' + bgIMG + '\', sizingMethod=\'scale\');';
|
|
102
|
+
jQuery(this).attr('src', settings.blankgif)
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
return jQuery;
|
|
108
|
+
|
|
109
|
+
};
|
|
110
110
|
|
|
111
111
|
})(jQuery);
|