campbellhay-bureau 4.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +4 -0
- data/campbellhay-bureau.gemspec +14 -0
- data/gempush +8 -0
- data/lib/_static/_test.txt +1 -0
- data/lib/_static/css/main.css +586 -0
- data/lib/_static/css/plugin.asmselect.css +63 -0
- data/lib/_static/css/ui-darkness/images/ui-bg_flat_30_cccccc_40x100.png +0 -0
- data/lib/_static/css/ui-darkness/images/ui-bg_flat_50_5c5c5c_40x100.png +0 -0
- data/lib/_static/css/ui-darkness/images/ui-bg_glass_20_555555_1x400.png +0 -0
- data/lib/_static/css/ui-darkness/images/ui-bg_glass_40_0078a3_1x400.png +0 -0
- data/lib/_static/css/ui-darkness/images/ui-bg_glass_40_ffc73d_1x400.png +0 -0
- data/lib/_static/css/ui-darkness/images/ui-bg_gloss-wave_25_333333_500x100.png +0 -0
- data/lib/_static/css/ui-darkness/images/ui-bg_highlight-soft_80_eeeeee_1x100.png +0 -0
- data/lib/_static/css/ui-darkness/images/ui-bg_inset-soft_25_000000_1x100.png +0 -0
- data/lib/_static/css/ui-darkness/images/ui-bg_inset-soft_30_f58400_1x100.png +0 -0
- data/lib/_static/css/ui-darkness/images/ui-icons_222222_256x240.png +0 -0
- data/lib/_static/css/ui-darkness/images/ui-icons_4b8e0b_256x240.png +0 -0
- data/lib/_static/css/ui-darkness/images/ui-icons_a83300_256x240.png +0 -0
- data/lib/_static/css/ui-darkness/images/ui-icons_cccccc_256x240.png +0 -0
- data/lib/_static/css/ui-darkness/images/ui-icons_ffffff_256x240.png +0 -0
- data/lib/_static/css/ui-darkness/jquery-ui-1.9.1.custom.css +378 -0
- data/lib/_static/css/ui-darkness/jquery-ui-1.9.1.custom.min.css +5 -0
- data/lib/_static/img/backend_small_icons.png +0 -0
- data/lib/_static/img/btn.png +0 -0
- data/lib/_static/img/btn_old.png +0 -0
- data/lib/_static/img/file.png +0 -0
- data/lib/_static/img/handle.png +0 -0
- data/lib/_static/img/help/clone-button.png +0 -0
- data/lib/_static/img/help/create-button.png +0 -0
- data/lib/_static/img/help/delete-button.png +0 -0
- data/lib/_static/img/help/delete-warning.png +0 -0
- data/lib/_static/img/help/document.png +0 -0
- data/lib/_static/img/help/edit-button.png +0 -0
- data/lib/_static/img/help/form.png +0 -0
- data/lib/_static/img/help/image-dimensions.png +0 -0
- data/lib/_static/img/help/list.png +0 -0
- data/lib/_static/img/help/logout.png +0 -0
- data/lib/_static/img/help/move-button.png +0 -0
- data/lib/_static/img/help/overview.png +0 -0
- data/lib/_static/img/help/preview-button.png +0 -0
- data/lib/_static/img/help/relationships.png +0 -0
- data/lib/_static/img/help/reload-button.png +0 -0
- data/lib/_static/img/help/save-or-cancel.png +0 -0
- data/lib/_static/img/help/search.png +0 -0
- data/lib/_static/img/help/sub-section.png +0 -0
- data/lib/_static/img/help/x-list.png +0 -0
- data/lib/_static/img/placeholder.nutshell.jpg +0 -0
- data/lib/_static/img/placeholder.stash_thumb.gif +0 -0
- data/lib/_static/img/small-loader.gif +0 -0
- data/lib/_static/img/underwood_btn.png +0 -0
- data/lib/_static/js/addon.timepicker.js +20 -0
- data/lib/_static/js/jquery-ui-1.9.1.custom.js +8364 -0
- data/lib/_static/js/jquery-ui-1.9.1.custom.min.js +6 -0
- data/lib/_static/js/main.js +347 -0
- data/lib/_static/js/plugin.asmselect.js +407 -0
- data/lib/_static/js/plugin.form.js +23 -0
- data/lib/_static/js/plugin.mapolygon.js +3 -0
- data/lib/_static/js/plugin.quickmask.js +68 -0
- data/lib/_static/js/plugin.quicksearch.js +1 -0
- data/lib/_static/js/plugin.speechify.js +4 -0
- data/lib/_static/js/plugin.underwood.js +4 -0
- data/lib/_templates/_test.txt +1 -0
- data/lib/_templates/head.html +23 -0
- data/lib/_templates/help.html +104 -0
- data/lib/_templates/layout.html +13 -0
- data/lib/bureau/adapter.rb +114 -0
- data/lib/bureau.rb +122 -0
- data/lib/mongo_bureau.rb +214 -0
- data/lib/sequel_bureau_adapter.rb +188 -0
- data/test/spec_bureau.rb +123 -0
- data/test/spec_bureau_adapter.rb +71 -0
- metadata +126 -0
@@ -0,0 +1,407 @@
|
|
1
|
+
/*
|
2
|
+
* Alternate Select Multiple (asmSelect) 1.0.4a beta - jQuery Plugin
|
3
|
+
* http://www.ryancramer.com/projects/asmselect/
|
4
|
+
*
|
5
|
+
* Copyright (c) 2009 by Ryan Cramer - http://www.ryancramer.com
|
6
|
+
*
|
7
|
+
* Dual licensed under the MIT (MIT-LICENSE.txt)
|
8
|
+
* and GPL (GPL-LICENSE.txt) licenses.
|
9
|
+
*
|
10
|
+
*/
|
11
|
+
|
12
|
+
(function($) {
|
13
|
+
|
14
|
+
$.fn.asmSelect = function(customOptions) {
|
15
|
+
|
16
|
+
var options = {
|
17
|
+
|
18
|
+
listType: 'ol', // Ordered list 'ol', or unordered list 'ul'
|
19
|
+
sortable: false, // Should the list be sortable?
|
20
|
+
highlight: false, // Use the highlight feature?
|
21
|
+
animate: false, // Animate the the adding/removing of items in the list?
|
22
|
+
addItemTarget: 'bottom', // Where to place new selected items in list: top or bottom
|
23
|
+
hideWhenAdded: false, // Hide the option when added to the list? works only in FF
|
24
|
+
debugMode: false, // Debug mode keeps original select visible
|
25
|
+
|
26
|
+
removeLabel: 'remove', // Text used in the "remove" link
|
27
|
+
highlightAddedLabel: 'Added: ', // Text that precedes highlight of added item
|
28
|
+
highlightRemovedLabel: 'Removed: ', // Text that precedes highlight of removed item
|
29
|
+
|
30
|
+
containerClass: 'asmContainer', // Class for container that wraps this widget
|
31
|
+
selectClass: 'asmSelect', // Class for the newly created <select>
|
32
|
+
optionDisabledClass: 'asmOptionDisabled', // Class for items that are already selected / disabled
|
33
|
+
listClass: 'asmList', // Class for the list ($ol)
|
34
|
+
listSortableClass: 'asmListSortable', // Another class given to the list when it is sortable
|
35
|
+
listItemClass: 'asmListItem', // Class for the <li> list items
|
36
|
+
listItemLabelClass: 'asmListItemLabel', // Class for the label text that appears in list items
|
37
|
+
removeClass: 'asmListItemRemove', // Class given to the "remove" link
|
38
|
+
highlightClass: 'asmHighlight' // Class given to the highlight <span>
|
39
|
+
|
40
|
+
};
|
41
|
+
|
42
|
+
$.extend(options, customOptions);
|
43
|
+
|
44
|
+
return this.each(function(index) {
|
45
|
+
|
46
|
+
var $original = $(this); // the original select multiple
|
47
|
+
var $container; // a container that is wrapped around our widget
|
48
|
+
var $select; // the new select we have created
|
49
|
+
var $ol; // the list that we are manipulating
|
50
|
+
var buildingSelect = false; // is the new select being constructed right now?
|
51
|
+
var ieClick = false; // in IE, has a click event occurred? ignore if not
|
52
|
+
var ignoreOriginalChangeEvent = false; // originalChangeEvent bypassed when this is true
|
53
|
+
|
54
|
+
function init() {
|
55
|
+
|
56
|
+
// initialize the alternate select multiple
|
57
|
+
|
58
|
+
// this loop ensures uniqueness, in case of existing asmSelects placed by ajax (1.0.3)
|
59
|
+
while($("#" + options.containerClass + index).size() > 0) index++;
|
60
|
+
|
61
|
+
$select = $("<select></select>")
|
62
|
+
.addClass(options.selectClass)
|
63
|
+
.attr('name', options.selectClass + index)
|
64
|
+
.attr('id', options.selectClass + index);
|
65
|
+
|
66
|
+
$selectRemoved = $("<select></select>");
|
67
|
+
|
68
|
+
$ol = $("<" + options.listType + "></" + options.listType + ">")
|
69
|
+
.addClass(options.listClass)
|
70
|
+
.attr('id', options.listClass + index);
|
71
|
+
|
72
|
+
$container = $("<div></div>")
|
73
|
+
.addClass(options.containerClass)
|
74
|
+
.attr('id', options.containerClass + index);
|
75
|
+
|
76
|
+
buildSelect();
|
77
|
+
|
78
|
+
$select.change(selectChangeEvent)
|
79
|
+
.click(selectClickEvent);
|
80
|
+
|
81
|
+
$original.change(originalChangeEvent)
|
82
|
+
.wrap($container).before($select).before($ol);
|
83
|
+
|
84
|
+
if(options.sortable) makeSortable();
|
85
|
+
|
86
|
+
if($.browser.msie && $.browser.version < 8) $ol.css('display', 'inline-block'); // Thanks Matthew Hutton
|
87
|
+
}
|
88
|
+
|
89
|
+
function makeSortable() {
|
90
|
+
|
91
|
+
// make any items in the selected list sortable
|
92
|
+
// requires jQuery UI sortables, draggables, droppables
|
93
|
+
|
94
|
+
$ol.sortable({
|
95
|
+
items: 'li.' + options.listItemClass,
|
96
|
+
handle: '.' + options.listItemLabelClass,
|
97
|
+
axis: 'y',
|
98
|
+
update: function(e, data) {
|
99
|
+
|
100
|
+
var updatedOptionId;
|
101
|
+
|
102
|
+
$(this).children("li").each(function(n) {
|
103
|
+
|
104
|
+
$option = $('#' + $(this).attr('rel'));
|
105
|
+
|
106
|
+
if($(this).is(".ui-sortable-helper")) {
|
107
|
+
updatedOptionId = $option.attr('id');
|
108
|
+
return;
|
109
|
+
}
|
110
|
+
|
111
|
+
$original.append($option);
|
112
|
+
});
|
113
|
+
|
114
|
+
if(updatedOptionId) triggerOriginalChange(updatedOptionId, 'sort');
|
115
|
+
}
|
116
|
+
|
117
|
+
}).addClass(options.listSortableClass);
|
118
|
+
}
|
119
|
+
|
120
|
+
function selectChangeEvent(e) {
|
121
|
+
|
122
|
+
// an item has been selected on the regular select we created
|
123
|
+
// check to make sure it's not an IE screwup, and add it to the list
|
124
|
+
|
125
|
+
if($.browser.msie && $.browser.version < 7 && !ieClick) return;
|
126
|
+
var id = $(this).children("option:selected").slice(0,1).attr('rel');
|
127
|
+
addListItem(id);
|
128
|
+
ieClick = false;
|
129
|
+
triggerOriginalChange(id, 'add'); // for use by user-defined callbacks
|
130
|
+
}
|
131
|
+
|
132
|
+
function selectClickEvent() {
|
133
|
+
|
134
|
+
// IE6 lets you scroll around in a select without it being pulled down
|
135
|
+
// making sure a click preceded the change() event reduces the chance
|
136
|
+
// if unintended items being added. there may be a better solution?
|
137
|
+
|
138
|
+
ieClick = true;
|
139
|
+
}
|
140
|
+
|
141
|
+
function originalChangeEvent(e) {
|
142
|
+
|
143
|
+
// select or option change event manually triggered
|
144
|
+
// on the original <select multiple>, so rebuild ours
|
145
|
+
|
146
|
+
if(ignoreOriginalChangeEvent) {
|
147
|
+
ignoreOriginalChangeEvent = false;
|
148
|
+
return;
|
149
|
+
}
|
150
|
+
|
151
|
+
$select.empty();
|
152
|
+
$ol.empty();
|
153
|
+
buildSelect();
|
154
|
+
|
155
|
+
// opera has an issue where it needs a force redraw, otherwise
|
156
|
+
// the items won't appear until something else forces a redraw
|
157
|
+
if($.browser.opera) $ol.hide().fadeIn("fast");
|
158
|
+
}
|
159
|
+
|
160
|
+
function buildSelect() {
|
161
|
+
|
162
|
+
// build or rebuild the new select that the user
|
163
|
+
// will select items from
|
164
|
+
|
165
|
+
buildingSelect = true;
|
166
|
+
|
167
|
+
// add a first option to be the home option / default selectLabel
|
168
|
+
$select.prepend("<option>" + $original.attr('title') + "</option>");
|
169
|
+
|
170
|
+
$original.children("option").each(function(n) {
|
171
|
+
|
172
|
+
var $t = $(this);
|
173
|
+
var id;
|
174
|
+
|
175
|
+
if(!$t.attr('id')) $t.attr('id', 'asm' + index + 'option' + n);
|
176
|
+
id = $t.attr('id');
|
177
|
+
|
178
|
+
if($t.is(":selected")) {
|
179
|
+
addListItem(id);
|
180
|
+
addSelectOption(id, true);
|
181
|
+
} else {
|
182
|
+
addSelectOption(id);
|
183
|
+
}
|
184
|
+
});
|
185
|
+
|
186
|
+
if(!options.debugMode) $original.hide(); // IE6 requires this on every buildSelect()
|
187
|
+
selectFirstItem();
|
188
|
+
buildingSelect = false;
|
189
|
+
}
|
190
|
+
|
191
|
+
function addSelectOption(optionId, disabled) {
|
192
|
+
|
193
|
+
// add an <option> to the <select>
|
194
|
+
// used only by buildSelect()
|
195
|
+
|
196
|
+
if(disabled == undefined) var disabled = false;
|
197
|
+
|
198
|
+
var $O = $('#' + optionId);
|
199
|
+
var $option = $("<option>" + $O.text() + "</option>")
|
200
|
+
.val($O.val())
|
201
|
+
.attr('rel', optionId);
|
202
|
+
|
203
|
+
if(disabled) disableSelectOption($option);
|
204
|
+
|
205
|
+
$select.append($option);
|
206
|
+
}
|
207
|
+
|
208
|
+
function selectFirstItem() {
|
209
|
+
|
210
|
+
// select the firm item from the regular select that we created
|
211
|
+
|
212
|
+
$select.children(":eq(0)").attr("selected", true);
|
213
|
+
}
|
214
|
+
|
215
|
+
function disableSelectOption($option) {
|
216
|
+
|
217
|
+
// make an option disabled, indicating that it's already been selected
|
218
|
+
// because safari is the only browser that makes disabled items look 'disabled'
|
219
|
+
// we apply a class that reproduces the disabled look in other browsers
|
220
|
+
|
221
|
+
$option.addClass(options.optionDisabledClass)
|
222
|
+
.attr("selected", false)
|
223
|
+
.attr("disabled", true);
|
224
|
+
|
225
|
+
if(options.hideWhenAdded) $option.hide();
|
226
|
+
if($.browser.msie) $select.hide().show(); // this forces IE to update display
|
227
|
+
}
|
228
|
+
|
229
|
+
function enableSelectOption($option) {
|
230
|
+
|
231
|
+
// given an already disabled select option, enable it
|
232
|
+
|
233
|
+
$option.removeClass(options.optionDisabledClass)
|
234
|
+
.attr("disabled", false);
|
235
|
+
|
236
|
+
if(options.hideWhenAdded) $option.show();
|
237
|
+
if($.browser.msie) $select.hide().show(); // this forces IE to update display
|
238
|
+
}
|
239
|
+
|
240
|
+
function addListItem(optionId) {
|
241
|
+
|
242
|
+
// add a new item to the html list
|
243
|
+
|
244
|
+
var $O = $('#' + optionId);
|
245
|
+
|
246
|
+
if(!$O) return; // this is the first item, selectLabel
|
247
|
+
|
248
|
+
var $removeLink = $("<a></a>")
|
249
|
+
.attr("href", "#")
|
250
|
+
.addClass(options.removeClass)
|
251
|
+
.prepend(options.removeLabel)
|
252
|
+
.click(function() {
|
253
|
+
dropListItem($(this).parent('li').attr('rel'));
|
254
|
+
return false;
|
255
|
+
});
|
256
|
+
|
257
|
+
var $itemLabel = $("<span></span>")
|
258
|
+
.addClass(options.listItemLabelClass)
|
259
|
+
.html($O.html());
|
260
|
+
|
261
|
+
var $item = $("<li></li>")
|
262
|
+
.attr('rel', optionId)
|
263
|
+
.addClass(options.listItemClass)
|
264
|
+
.append($itemLabel)
|
265
|
+
.append($removeLink)
|
266
|
+
.hide();
|
267
|
+
|
268
|
+
if(!buildingSelect) {
|
269
|
+
if($O.is(":selected")) return; // already have it
|
270
|
+
$O.attr('selected', true);
|
271
|
+
}
|
272
|
+
|
273
|
+
if(options.addItemTarget == 'top' && !buildingSelect) {
|
274
|
+
$ol.prepend($item);
|
275
|
+
if(options.sortable) $original.prepend($O);
|
276
|
+
} else {
|
277
|
+
$ol.append($item);
|
278
|
+
if(options.sortable) $original.append($O);
|
279
|
+
}
|
280
|
+
|
281
|
+
addListItemShow($item);
|
282
|
+
|
283
|
+
disableSelectOption($("[rel=" + optionId + "]", $select));
|
284
|
+
|
285
|
+
if(!buildingSelect) {
|
286
|
+
setHighlight($item, options.highlightAddedLabel);
|
287
|
+
selectFirstItem();
|
288
|
+
if(options.sortable) $ol.sortable("refresh");
|
289
|
+
}
|
290
|
+
|
291
|
+
}
|
292
|
+
|
293
|
+
function addListItemShow($item) {
|
294
|
+
|
295
|
+
// reveal the currently hidden item with optional animation
|
296
|
+
// used only by addListItem()
|
297
|
+
|
298
|
+
if(options.animate && !buildingSelect) {
|
299
|
+
$item.animate({
|
300
|
+
opacity: "show",
|
301
|
+
height: "show"
|
302
|
+
}, 100, "swing", function() {
|
303
|
+
$item.animate({
|
304
|
+
height: "+=2px"
|
305
|
+
}, 50, "swing", function() {
|
306
|
+
$item.animate({
|
307
|
+
height: "-=2px"
|
308
|
+
}, 25, "swing");
|
309
|
+
});
|
310
|
+
});
|
311
|
+
} else {
|
312
|
+
$item.show();
|
313
|
+
}
|
314
|
+
}
|
315
|
+
|
316
|
+
function dropListItem(optionId, highlightItem) {
|
317
|
+
|
318
|
+
// remove an item from the html list
|
319
|
+
|
320
|
+
if(highlightItem == undefined) var highlightItem = true;
|
321
|
+
var $O = $('#' + optionId);
|
322
|
+
|
323
|
+
$O.attr('selected', false);
|
324
|
+
$item = $ol.children("li[rel=" + optionId + "]");
|
325
|
+
|
326
|
+
dropListItemHide($item);
|
327
|
+
enableSelectOption($("[rel=" + optionId + "]", options.removeWhenAdded ? $selectRemoved : $select));
|
328
|
+
|
329
|
+
if(highlightItem) setHighlight($item, options.highlightRemovedLabel);
|
330
|
+
|
331
|
+
triggerOriginalChange(optionId, 'drop');
|
332
|
+
|
333
|
+
}
|
334
|
+
|
335
|
+
function dropListItemHide($item) {
|
336
|
+
|
337
|
+
// remove the currently visible item with optional animation
|
338
|
+
// used only by dropListItem()
|
339
|
+
|
340
|
+
if(options.animate && !buildingSelect) {
|
341
|
+
|
342
|
+
$prevItem = $item.prev("li");
|
343
|
+
|
344
|
+
$item.animate({
|
345
|
+
opacity: "hide",
|
346
|
+
height: "hide"
|
347
|
+
}, 100, "linear", function() {
|
348
|
+
$prevItem.animate({
|
349
|
+
height: "-=2px"
|
350
|
+
}, 50, "swing", function() {
|
351
|
+
$prevItem.animate({
|
352
|
+
height: "+=2px"
|
353
|
+
}, 100, "swing");
|
354
|
+
});
|
355
|
+
$item.remove();
|
356
|
+
});
|
357
|
+
|
358
|
+
} else {
|
359
|
+
$item.remove();
|
360
|
+
}
|
361
|
+
}
|
362
|
+
|
363
|
+
function setHighlight($item, label) {
|
364
|
+
|
365
|
+
// set the contents of the highlight area that appears
|
366
|
+
// directly after the <select> single
|
367
|
+
// fade it in quickly, then fade it out
|
368
|
+
|
369
|
+
if(!options.highlight) return;
|
370
|
+
|
371
|
+
$select.next("#" + options.highlightClass + index).remove();
|
372
|
+
|
373
|
+
var $highlight = $("<span></span>")
|
374
|
+
.hide()
|
375
|
+
.addClass(options.highlightClass)
|
376
|
+
.attr('id', options.highlightClass + index)
|
377
|
+
.html(label + $item.children("." + options.listItemLabelClass).slice(0,1).text());
|
378
|
+
|
379
|
+
$select.after($highlight);
|
380
|
+
|
381
|
+
$highlight.fadeIn("fast", function() {
|
382
|
+
setTimeout(function() { $highlight.fadeOut("slow"); }, 50);
|
383
|
+
});
|
384
|
+
}
|
385
|
+
|
386
|
+
function triggerOriginalChange(optionId, type) {
|
387
|
+
|
388
|
+
// trigger a change event on the original select multiple
|
389
|
+
// so that other scripts can pick them up
|
390
|
+
|
391
|
+
ignoreOriginalChangeEvent = true;
|
392
|
+
$option = $("#" + optionId);
|
393
|
+
|
394
|
+
$original.trigger('change', [{
|
395
|
+
'option': $option,
|
396
|
+
'value': $option.val(),
|
397
|
+
'id': optionId,
|
398
|
+
'item': $ol.children("[rel=" + optionId + "]"),
|
399
|
+
'type': type
|
400
|
+
}]);
|
401
|
+
}
|
402
|
+
|
403
|
+
init();
|
404
|
+
});
|
405
|
+
};
|
406
|
+
|
407
|
+
})(jQuery);
|
@@ -0,0 +1,23 @@
|
|
1
|
+
/*!
|
2
|
+
* jQuery Form Plugin
|
3
|
+
* version: 4.2.2
|
4
|
+
* Requires jQuery v1.7.2 or later
|
5
|
+
* Project repository: https://github.com/jquery-form/form
|
6
|
+
|
7
|
+
* Copyright 2017 Kevin Morris
|
8
|
+
* Copyright 2006 M. Alsup
|
9
|
+
|
10
|
+
* Dual licensed under the LGPL-2.1+ or MIT licenses
|
11
|
+
* https://github.com/jquery-form/form#license
|
12
|
+
|
13
|
+
* This library is free software; you can redistribute it and/or
|
14
|
+
* modify it under the terms of the GNU Lesser General Public
|
15
|
+
* License as published by the Free Software Foundation; either
|
16
|
+
* version 2.1 of the License, or (at your option) any later version.
|
17
|
+
* This library is distributed in the hope that it will be useful,
|
18
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
19
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
20
|
+
* Lesser General Public License for more details.
|
21
|
+
*/
|
22
|
+
!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof module&&module.exports?module.exports=function(t,r){return void 0===r&&(r="undefined"!=typeof window?require("jquery"):require("jquery")(t)),e(r),r}:e(jQuery)}(function(e){"use strict";function t(t){var r=t.data;t.isDefaultPrevented()||(t.preventDefault(),e(t.target).closest("form").ajaxSubmit(r))}function r(t){var r=t.target,a=e(r);if(!a.is("[type=submit],[type=image]")){var n=a.closest("[type=submit]");if(0===n.length)return;r=n[0]}var i=r.form;if(i.clk=r,"image"===r.type)if(void 0!==t.offsetX)i.clk_x=t.offsetX,i.clk_y=t.offsetY;else if("function"==typeof e.fn.offset){var o=a.offset();i.clk_x=t.pageX-o.left,i.clk_y=t.pageY-o.top}else i.clk_x=t.pageX-r.offsetLeft,i.clk_y=t.pageY-r.offsetTop;setTimeout(function(){i.clk=i.clk_x=i.clk_y=null},100)}function a(){if(e.fn.ajaxSubmit.debug){var t="[jquery.form] "+Array.prototype.join.call(arguments,"");window.console&&window.console.log?window.console.log(t):window.opera&&window.opera.postError&&window.opera.postError(t)}}var n=/\r?\n/g,i={};i.fileapi=void 0!==e('<input type="file">').get(0).files,i.formdata=void 0!==window.FormData;var o=!!e.fn.prop;e.fn.attr2=function(){if(!o)return this.attr.apply(this,arguments);var e=this.prop.apply(this,arguments);return e&&e.jquery||"string"==typeof e?e:this.attr.apply(this,arguments)},e.fn.ajaxSubmit=function(t,r,n,s){function u(r){var a,n,i=e.param(r,t.traditional).split("&"),o=i.length,s=[];for(a=0;a<o;a++)i[a]=i[a].replace(/\+/g," "),n=i[a].split("="),s.push([decodeURIComponent(n[0]),decodeURIComponent(n[1])]);return s}function c(r){function n(e){var t=null;try{e.contentWindow&&(t=e.contentWindow.document)}catch(e){a("cannot get iframe.contentWindow document: "+e)}if(t)return t;try{t=e.contentDocument?e.contentDocument:e.document}catch(r){a("cannot get iframe.contentDocument: "+r),t=e.document}return t}function i(){function t(){try{var e=n(v).readyState;a("state = "+e),e&&"uninitialized"===e.toLowerCase()&&setTimeout(t,50)}catch(e){a("Server abort: ",e," (",e.name,")"),s(L),j&&clearTimeout(j),j=void 0}}var r=p.attr2("target"),i=p.attr2("action"),o=p.attr("enctype")||p.attr("encoding")||"multipart/form-data";w.setAttribute("target",m),l&&!/post/i.test(l)||w.setAttribute("method","POST"),i!==f.url&&w.setAttribute("action",f.url),f.skipEncodingOverride||l&&!/post/i.test(l)||p.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"}),f.timeout&&(j=setTimeout(function(){T=!0,s(A)},f.timeout));var u=[];try{if(f.extraData)for(var c in f.extraData)f.extraData.hasOwnProperty(c)&&(e.isPlainObject(f.extraData[c])&&f.extraData[c].hasOwnProperty("name")&&f.extraData[c].hasOwnProperty("value")?u.push(e('<input type="hidden" name="'+f.extraData[c].name+'">',k).val(f.extraData[c].value).appendTo(w)[0]):u.push(e('<input type="hidden" name="'+c+'">',k).val(f.extraData[c]).appendTo(w)[0]));f.iframeTarget||h.appendTo(D),v.attachEvent?v.attachEvent("onload",s):v.addEventListener("load",s,!1),setTimeout(t,15);try{w.submit()}catch(e){document.createElement("form").submit.apply(w)}}finally{w.setAttribute("action",i),w.setAttribute("enctype",o),r?w.setAttribute("target",r):p.removeAttr("target"),e(u).remove()}}function s(t){if(!x.aborted&&!X){if((O=n(v))||(a("cannot access response document"),t=L),t===A&&x)return x.abort("timeout"),void S.reject(x,"timeout");if(t===L&&x)return x.abort("server abort"),void S.reject(x,"error","server abort");if(O&&O.location.href!==f.iframeSrc||T){v.detachEvent?v.detachEvent("onload",s):v.removeEventListener("load",s,!1);var r,i="success";try{if(T)throw"timeout";var o="xml"===f.dataType||O.XMLDocument||e.isXMLDoc(O);if(a("isXml="+o),!o&&window.opera&&(null===O.body||!O.body.innerHTML)&&--C)return a("requeing onLoad callback, DOM not available"),void setTimeout(s,250);var u=O.body?O.body:O.documentElement;x.responseText=u?u.innerHTML:null,x.responseXML=O.XMLDocument?O.XMLDocument:O,o&&(f.dataType="xml"),x.getResponseHeader=function(e){return{"content-type":f.dataType}[e.toLowerCase()]},u&&(x.status=Number(u.getAttribute("status"))||x.status,x.statusText=u.getAttribute("statusText")||x.statusText);var c=(f.dataType||"").toLowerCase(),l=/(json|script|text)/.test(c);if(l||f.textarea){var p=O.getElementsByTagName("textarea")[0];if(p)x.responseText=p.value,x.status=Number(p.getAttribute("status"))||x.status,x.statusText=p.getAttribute("statusText")||x.statusText;else if(l){var m=O.getElementsByTagName("pre")[0],g=O.getElementsByTagName("body")[0];m?x.responseText=m.textContent?m.textContent:m.innerText:g&&(x.responseText=g.textContent?g.textContent:g.innerText)}}else"xml"===c&&!x.responseXML&&x.responseText&&(x.responseXML=q(x.responseText));try{M=N(x,c,f)}catch(e){i="parsererror",x.error=r=e||i}}catch(e){a("error caught: ",e),i="error",x.error=r=e||i}x.aborted&&(a("upload aborted"),i=null),x.status&&(i=x.status>=200&&x.status<300||304===x.status?"success":"error"),"success"===i?(f.success&&f.success.call(f.context,M,"success",x),S.resolve(x.responseText,"success",x),d&&e.event.trigger("ajaxSuccess",[x,f])):i&&(void 0===r&&(r=x.statusText),f.error&&f.error.call(f.context,x,i,r),S.reject(x,"error",r),d&&e.event.trigger("ajaxError",[x,f,r])),d&&e.event.trigger("ajaxComplete",[x,f]),d&&!--e.active&&e.event.trigger("ajaxStop"),f.complete&&f.complete.call(f.context,x,i),X=!0,f.timeout&&clearTimeout(j),setTimeout(function(){f.iframeTarget?h.attr("src",f.iframeSrc):h.remove(),x.responseXML=null},100)}}}var u,c,f,d,m,h,v,x,y,b,T,j,w=p[0],S=e.Deferred();if(S.abort=function(e){x.abort(e)},r)for(c=0;c<g.length;c++)u=e(g[c]),o?u.prop("disabled",!1):u.removeAttr("disabled");(f=e.extend(!0,{},e.ajaxSettings,t)).context=f.context||f,m="jqFormIO"+(new Date).getTime();var k=w.ownerDocument,D=p.closest("body");if(f.iframeTarget?(b=(h=e(f.iframeTarget,k)).attr2("name"))?m=b:h.attr2("name",m):(h=e('<iframe name="'+m+'" src="'+f.iframeSrc+'" />',k)).css({position:"absolute",top:"-1000px",left:"-1000px"}),v=h[0],x={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(t){var r="timeout"===t?"timeout":"aborted";a("aborting upload... "+r),this.aborted=1;try{v.contentWindow.document.execCommand&&v.contentWindow.document.execCommand("Stop")}catch(e){}h.attr("src",f.iframeSrc),x.error=r,f.error&&f.error.call(f.context,x,r,t),d&&e.event.trigger("ajaxError",[x,f,r]),f.complete&&f.complete.call(f.context,x,r)}},(d=f.global)&&0==e.active++&&e.event.trigger("ajaxStart"),d&&e.event.trigger("ajaxSend",[x,f]),f.beforeSend&&!1===f.beforeSend.call(f.context,x,f))return f.global&&e.active--,S.reject(),S;if(x.aborted)return S.reject(),S;(y=w.clk)&&(b=y.name)&&!y.disabled&&(f.extraData=f.extraData||{},f.extraData[b]=y.value,"image"===y.type&&(f.extraData[b+".x"]=w.clk_x,f.extraData[b+".y"]=w.clk_y));var A=1,L=2,F=e("meta[name=csrf-token]").attr("content"),E=e("meta[name=csrf-param]").attr("content");E&&F&&(f.extraData=f.extraData||{},f.extraData[E]=F),f.forceSync?i():setTimeout(i,10);var M,O,X,C=50,q=e.parseXML||function(e,t){return window.ActiveXObject?((t=new ActiveXObject("Microsoft.XMLDOM")).async="false",t.loadXML(e)):t=(new DOMParser).parseFromString(e,"text/xml"),t&&t.documentElement&&"parsererror"!==t.documentElement.nodeName?t:null},_=e.parseJSON||function(e){return window.eval("("+e+")")},N=function(t,r,a){var n=t.getResponseHeader("content-type")||"",i=("xml"===r||!r)&&n.indexOf("xml")>=0,o=i?t.responseXML:t.responseText;return i&&"parsererror"===o.documentElement.nodeName&&e.error&&e.error("parsererror"),a&&a.dataFilter&&(o=a.dataFilter(o,r)),"string"==typeof o&&(("json"===r||!r)&&n.indexOf("json")>=0?o=_(o):("script"===r||!r)&&n.indexOf("javascript")>=0&&e.globalEval(o)),o};return S}if(!this.length)return a("ajaxSubmit: skipping submit process - no element selected"),this;var l,f,d,p=this;"function"==typeof t?t={success:t}:"string"==typeof t||!1===t&&arguments.length>0?(t={url:t,data:r,dataType:n},"function"==typeof s&&(t.success=s)):void 0===t&&(t={}),l=t.method||t.type||this.attr2("method"),(d=(d="string"==typeof(f=t.url||this.attr2("action"))?e.trim(f):"")||window.location.href||"")&&(d=(d.match(/^([^#]+)/)||[])[1]),t=e.extend(!0,{url:d,success:e.ajaxSettings.success,type:l||e.ajaxSettings.type,iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},t);var m={};if(this.trigger("form-pre-serialize",[this,t,m]),m.veto)return a("ajaxSubmit: submit vetoed via form-pre-serialize trigger"),this;if(t.beforeSerialize&&!1===t.beforeSerialize(this,t))return a("ajaxSubmit: submit aborted via beforeSerialize callback"),this;var h=t.traditional;void 0===h&&(h=e.ajaxSettings.traditional);var v,g=[],x=this.formToArray(t.semantic,g,t.filtering);if(t.data){var y=e.isFunction(t.data)?t.data(x):t.data;t.extraData=y,v=e.param(y,h)}if(t.beforeSubmit&&!1===t.beforeSubmit(x,this,t))return a("ajaxSubmit: submit aborted via beforeSubmit callback"),this;if(this.trigger("form-submit-validate",[x,this,t,m]),m.veto)return a("ajaxSubmit: submit vetoed via form-submit-validate trigger"),this;var b=e.param(x,h);v&&(b=b?b+"&"+v:v),"GET"===t.type.toUpperCase()?(t.url+=(t.url.indexOf("?")>=0?"&":"?")+b,t.data=null):t.data=b;var T=[];if(t.resetForm&&T.push(function(){p.resetForm()}),t.clearForm&&T.push(function(){p.clearForm(t.includeHidden)}),!t.dataType&&t.target){var j=t.success||function(){};T.push(function(r,a,n){var i=arguments,o=t.replaceTarget?"replaceWith":"html";e(t.target)[o](r).each(function(){j.apply(this,i)})})}else t.success&&(e.isArray(t.success)?e.merge(T,t.success):T.push(t.success));if(t.success=function(e,r,a){for(var n=t.context||this,i=0,o=T.length;i<o;i++)T[i].apply(n,[e,r,a||p,p])},t.error){var w=t.error;t.error=function(e,r,a){var n=t.context||this;w.apply(n,[e,r,a,p])}}if(t.complete){var S=t.complete;t.complete=function(e,r){var a=t.context||this;S.apply(a,[e,r,p])}}var k=e("input[type=file]:enabled",this).filter(function(){return""!==e(this).val()}).length>0,D="multipart/form-data",A=p.attr("enctype")===D||p.attr("encoding")===D,L=i.fileapi&&i.formdata;a("fileAPI :"+L);var F,E=(k||A)&&!L;!1!==t.iframe&&(t.iframe||E)?t.closeKeepAlive?e.get(t.closeKeepAlive,function(){F=c(x)}):F=c(x):F=(k||A)&&L?function(r){for(var a=new FormData,n=0;n<r.length;n++)a.append(r[n].name,r[n].value);if(t.extraData){var i=u(t.extraData);for(n=0;n<i.length;n++)i[n]&&a.append(i[n][0],i[n][1])}t.data=null;var o=e.extend(!0,{},e.ajaxSettings,t,{contentType:!1,processData:!1,cache:!1,type:l||"POST"});t.uploadProgress&&(o.xhr=function(){var r=e.ajaxSettings.xhr();return r.upload&&r.upload.addEventListener("progress",function(e){var r=0,a=e.loaded||e.position,n=e.total;e.lengthComputable&&(r=Math.ceil(a/n*100)),t.uploadProgress(e,a,n,r)},!1),r}),o.data=null;var s=o.beforeSend;return o.beforeSend=function(e,r){t.formData?r.data=t.formData:r.data=a,s&&s.call(this,e,r)},e.ajax(o)}(x):e.ajax(t),p.removeData("jqxhr").data("jqxhr",F);for(var M=0;M<g.length;M++)g[M]=null;return this.trigger("form-submit-notify",[this,t]),this},e.fn.ajaxForm=function(n,i,o,s){if(("string"==typeof n||!1===n&&arguments.length>0)&&(n={url:n,data:i,dataType:o},"function"==typeof s&&(n.success=s)),n=n||{},n.delegation=n.delegation&&e.isFunction(e.fn.on),!n.delegation&&0===this.length){var u={s:this.selector,c:this.context};return!e.isReady&&u.s?(a("DOM not ready, queuing ajaxForm"),e(function(){e(u.s,u.c).ajaxForm(n)}),this):(a("terminating; zero elements found by selector"+(e.isReady?"":" (DOM not ready)")),this)}return n.delegation?(e(document).off("submit.form-plugin",this.selector,t).off("click.form-plugin",this.selector,r).on("submit.form-plugin",this.selector,n,t).on("click.form-plugin",this.selector,n,r),this):this.ajaxFormUnbind().on("submit.form-plugin",n,t).on("click.form-plugin",n,r)},e.fn.ajaxFormUnbind=function(){return this.off("submit.form-plugin click.form-plugin")},e.fn.formToArray=function(t,r,a){var n=[];if(0===this.length)return n;var o,s=this[0],u=this.attr("id"),c=t||void 0===s.elements?s.getElementsByTagName("*"):s.elements;if(c&&(c=e.makeArray(c)),u&&(t||/(Edge|Trident)\//.test(navigator.userAgent))&&(o=e(':input[form="'+u+'"]').get()).length&&(c=(c||[]).concat(o)),!c||!c.length)return n;e.isFunction(a)&&(c=e.map(c,a));var l,f,d,p,m,h,v;for(l=0,h=c.length;l<h;l++)if(m=c[l],(d=m.name)&&!m.disabled)if(t&&s.clk&&"image"===m.type)s.clk===m&&(n.push({name:d,value:e(m).val(),type:m.type}),n.push({name:d+".x",value:s.clk_x},{name:d+".y",value:s.clk_y}));else if((p=e.fieldValue(m,!0))&&p.constructor===Array)for(r&&r.push(m),f=0,v=p.length;f<v;f++)n.push({name:d,value:p[f]});else if(i.fileapi&&"file"===m.type){r&&r.push(m);var g=m.files;if(g.length)for(f=0;f<g.length;f++)n.push({name:d,value:g[f],type:m.type});else n.push({name:d,value:"",type:m.type})}else null!==p&&void 0!==p&&(r&&r.push(m),n.push({name:d,value:p,type:m.type,required:m.required}));if(!t&&s.clk){var x=e(s.clk),y=x[0];(d=y.name)&&!y.disabled&&"image"===y.type&&(n.push({name:d,value:x.val()}),n.push({name:d+".x",value:s.clk_x},{name:d+".y",value:s.clk_y}))}return n},e.fn.formSerialize=function(t){return e.param(this.formToArray(t))},e.fn.fieldSerialize=function(t){var r=[];return this.each(function(){var a=this.name;if(a){var n=e.fieldValue(this,t);if(n&&n.constructor===Array)for(var i=0,o=n.length;i<o;i++)r.push({name:a,value:n[i]});else null!==n&&void 0!==n&&r.push({name:this.name,value:n})}}),e.param(r)},e.fn.fieldValue=function(t){for(var r=[],a=0,n=this.length;a<n;a++){var i=this[a],o=e.fieldValue(i,t);null===o||void 0===o||o.constructor===Array&&!o.length||(o.constructor===Array?e.merge(r,o):r.push(o))}return r},e.fieldValue=function(t,r){var a=t.name,i=t.type,o=t.tagName.toLowerCase();if(void 0===r&&(r=!0),r&&(!a||t.disabled||"reset"===i||"button"===i||("checkbox"===i||"radio"===i)&&!t.checked||("submit"===i||"image"===i)&&t.form&&t.form.clk!==t||"select"===o&&-1===t.selectedIndex))return null;if("select"===o){var s=t.selectedIndex;if(s<0)return null;for(var u=[],c=t.options,l="select-one"===i,f=l?s+1:c.length,d=l?s:0;d<f;d++){var p=c[d];if(p.selected&&!p.disabled){var m=p.value;if(m||(m=p.attributes&&p.attributes.value&&!p.attributes.value.specified?p.text:p.value),l)return m;u.push(m)}}return u}return e(t).val().replace(n,"\r\n")},e.fn.clearForm=function(t){return this.each(function(){e("input,select,textarea",this).clearFields(t)})},e.fn.clearFields=e.fn.clearInputs=function(t){var r=/^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i;return this.each(function(){var a=this.type,n=this.tagName.toLowerCase();r.test(a)||"textarea"===n?this.value="":"checkbox"===a||"radio"===a?this.checked=!1:"select"===n?this.selectedIndex=-1:"file"===a?/MSIE/.test(navigator.userAgent)?e(this).replaceWith(e(this).clone(!0)):e(this).val(""):t&&(!0===t&&/hidden/.test(a)||"string"==typeof t&&e(this).is(t))&&(this.value="")})},e.fn.resetForm=function(){return this.each(function(){var t=e(this),r=this.tagName.toLowerCase();switch(r){case"input":this.checked=this.defaultChecked;case"textarea":return this.value=this.defaultValue,!0;case"option":case"optgroup":var a=t.parents("select");return a.length&&a[0].multiple?"option"===r?this.selected=this.defaultSelected:t.find("option").resetForm():a.resetForm(),!0;case"select":return t.find("option").each(function(e){if(this.selected=this.defaultSelected,this.defaultSelected&&!t[0].multiple)return t[0].selectedIndex=e,!1}),!0;case"label":var n=e(t.attr("for")),i=t.find("input,select,textarea");return n[0]&&i.unshift(n[0]),i.resetForm(),!0;case"form":return("function"==typeof this.reset||"object"==typeof this.reset&&!this.reset.nodeType)&&this.reset(),!0;default:return t.find("form,input,label,select,textarea").resetForm(),!0}})},e.fn.enable=function(e){return void 0===e&&(e=!0),this.each(function(){this.disabled=!e})},e.fn.selected=function(t){return void 0===t&&(t=!0),this.each(function(){var r=this.type;if("checkbox"===r||"radio"===r)this.checked=t;else if("option"===this.tagName.toLowerCase()){var a=e(this).parent("select");t&&a[0]&&"select-one"===a[0].type&&a.find("option").selected(!1),this.selected=t}})},e.fn.ajaxSubmit.debug=!1});
|
23
|
+
//# sourceMappingURL=jquery.form.min.js.map
|
@@ -0,0 +1,3 @@
|
|
1
|
+
// Copyright (c) 2010 - 2017 Mickael Riga - See MIT_LICENCE for details
|
2
|
+
// Version 2
|
3
|
+
function clear_canvas(context){context.clearRect(0,0,context.canvas.width,context.canvas.height);var w=context.canvas.width;context.canvas.width=1;context.canvas.width=w};(function($){$.fn.mapolygon=function(callback){return this.each(function(){var $$=$(this);var wrapper=$$.wrap("<div class='mapolygon_wrapper' />").parent().css({position:'relative'});var canvas=$("<canvas />").css({position:'absolute',left:'0px',top:'0px',cursor:'crosshair'}).bind('adapt.mapolygon',function(){$(this).attr('width',$$.width()).attr('height',$$.height())});wrapper.append(canvas);canvas.trigger('adapt.mapolygon');if(canvas.get(0).getContext){var ctx=canvas.get(0).getContext('2d')}$$.data().dots=[];$$.bind("show.mapolygon",function(e,dots){if(ctx){canvas.trigger('adapt.mapolygon');clear_canvas(ctx);ctx.fillStyle="rgba(0,0,255,0.5)";ctx.strokeStyle="rgba(0,0,255,0.5)";if(dots.length==2){ctx.fillRect((dots[0]*$$.width())-1,(dots[1]*$$.height())-1,3,3)}else{ctx.beginPath();for(i=0;i<dots.length;i+=2){ctx.lineTo(dots[i]*$$.width(),dots[i+1]*$$.height())}}ctx.fill();ctx.stroke()}else{for(i=0;i<dots.length;i+=2){$('.mapolygon',wrapper).remove();var dot=$("<div class='mapolygon_dot' />").css({position:'absolute',width:'1px',height:'1px',left:dots[i]*$$.width()+'px',top:dots[i+1]*$$.height()+'px',border:'2px solid blue',backgroundColor:'white'});wrapper.append(dot)}}});$$.bind("reset.mapolygon",function(){$$.data().dots=[];clear_canvas(ctx);$('.mapolygon',wrapper).remove()});$$.bind("enable.mapolygon",function(){$$.data().active=true});$$.bind("disable.mapolygon",function(){$$.data().active=false;$$.trigger('reset.mapolygon')});canvas.click(function(e){if($$.data().active){var pX=(e.pageX-$$.offset().left)/$$.width();var pY=(e.pageY-$$.offset().top)/$$.height();$$.data().dots.push(pX,pY);$$.trigger("show.mapolygon",[$$.data().dots]);if(callback){callback($$.data().dots,this)}}return false});$$.trigger('enable.mapolygon');$(window).resize(function(){$$.trigger("show.mapolygon",[$$.data().dots])})})}})(jQuery);
|
@@ -0,0 +1,68 @@
|
|
1
|
+
;(function($) {
|
2
|
+
|
3
|
+
$.fn.quickmask = function() {
|
4
|
+
return this.each(function() {
|
5
|
+
var mask = $(this).css({overflow: 'hidden'});
|
6
|
+
var target = mask.children(':first');
|
7
|
+
mask.mousemove(function(e) {
|
8
|
+
var mask_width = mask.width();
|
9
|
+
var mask_height = mask.height();
|
10
|
+
var target_width = target.width();
|
11
|
+
var target_height = target.height();
|
12
|
+
if (target_width>mask_width) {
|
13
|
+
var left = (e.pageX - mask.offset().left) * (target_width-mask_width) / mask_width;
|
14
|
+
mask.scrollLeft(left);
|
15
|
+
}
|
16
|
+
if (target_height>mask_height) {
|
17
|
+
var top = (e.pageY - mask.offset().top) * (target_height-mask_height) / mask_height;
|
18
|
+
mask.scrollTop(top);
|
19
|
+
}
|
20
|
+
});
|
21
|
+
});
|
22
|
+
};
|
23
|
+
|
24
|
+
function is_touch_device() {
|
25
|
+
try {
|
26
|
+
document.createEvent("TouchEvent");
|
27
|
+
return true;
|
28
|
+
} catch (e) {
|
29
|
+
return false;
|
30
|
+
}
|
31
|
+
}
|
32
|
+
|
33
|
+
$.fn.frise = function() {
|
34
|
+
var opts = {
|
35
|
+
zone_width: 100,
|
36
|
+
low_speed: 20,
|
37
|
+
high_speed: 40
|
38
|
+
};
|
39
|
+
|
40
|
+
return this.each(function() {
|
41
|
+
var $this = $(this).css({overflow: 'hidden'});
|
42
|
+
var target = $this.children(':first');
|
43
|
+
var frise_interval;
|
44
|
+
var frise_speed;
|
45
|
+
var frise_direction;
|
46
|
+
var frise_move = function() {
|
47
|
+
$this.scrollLeft($this.scrollLeft()+frise_speed*frise_direction);
|
48
|
+
};
|
49
|
+
$this
|
50
|
+
.mouseenter(function() { frise_interval = setInterval(frise_move, 50); })
|
51
|
+
.mouseleave(function() { clearInterval(frise_interval); })
|
52
|
+
.mousemove(function(e) {
|
53
|
+
var e_pageX = e.pageX - $this.offset().left;
|
54
|
+
if (e_pageX>0 && e_pageX<opts.zone_width) {
|
55
|
+
frise_speed = opts.low_speed;
|
56
|
+
frise_direction = -1;
|
57
|
+
} else if (e_pageX>($this.width()-opts.zone_width) && e_pageX<$this.width()) {
|
58
|
+
frise_speed = opts.low_speed;
|
59
|
+
frise_direction = 1;
|
60
|
+
} else {
|
61
|
+
frise_speed = 0;
|
62
|
+
}
|
63
|
+
});
|
64
|
+
});
|
65
|
+
|
66
|
+
};
|
67
|
+
|
68
|
+
})(jQuery);
|
@@ -0,0 +1 @@
|
|
1
|
+
(function($,h,j,k){$.fn.quicksearch=function(d,f){var g,cache,rowcache,jq_results,val='',e=this,options=$.extend({delay:100,selector:null,stripeRows:null,loader:null,noResults:'',bind:'keyup',onBefore:function(){return},onAfter:function(){return},show:function(){this.style.display=""},hide:function(){this.style.display="none"},prepareQuery:function(a){return a.toLowerCase().split(' ')},testQuery:function(a,b,c){for(var i=0;i<a.length;i+=1){if(b.indexOf(a[i])===-1){return false}}return true}},f);this.go=function(){var i=0,noresults=true,query=options.prepareQuery(val),val_empty=(val.replace(' ','').length===0);for(var i=0,len=rowcache.length;i<len;i++){if(val_empty||options.testQuery(query,cache[i],rowcache[i])){options.show.apply(rowcache[i]);noresults=false}else{options.hide.apply(rowcache[i])}}if(noresults){this.results(false)}else{this.results(true);this.stripe()}this.loader(false);options.onAfter();return this};this.stripe=function(){if(typeof options.stripeRows==="object"&&options.stripeRows!==null){var a=options.stripeRows.join(' ');var b=options.stripeRows.length;jq_results.not(':hidden').each(function(i){$(this).removeClass(a).addClass(options.stripeRows[i%b])})}return this};this.strip_html=function(a){var b=a.replace(new RegExp('<[^<]+\>','g'),"");b=$.trim(b.toLowerCase());return b};this.results=function(a){if(typeof options.noResults==="string"&&options.noResults!==""){if(a){$(options.noResults).hide()}else{$(options.noResults).show()}}return this};this.loader=function(a){if(typeof options.loader==="string"&&options.loader!==""){(a)?$(options.loader).show():$(options.loader).hide()}return this};this.cache=function(){jq_results=$(d);if(typeof options.noResults==="string"&&options.noResults!==""){jq_results=jq_results.not(options.noResults)}var t=(typeof options.selector==="string")?jq_results.find(options.selector):$(d).not(options.noResults);cache=t.map(function(){return e.strip_html(this.innerHTML)});rowcache=jq_results.map(function(){return this});return this.go()};this.trigger=function(){this.loader(true);options.onBefore();h.clearTimeout(g);g=h.setTimeout(function(){e.go()},options.delay);return this};this.cache();this.results(true);this.stripe();this.loader(false);return this.each(function(){$(this).bind(options.bind,function(){val=$(this).val();e.trigger()})})}}(jQuery,this,document));
|
@@ -0,0 +1,4 @@
|
|
1
|
+
// (c) 2009 - 2011 Mickael Riga - See MIT_LICENSE file for details
|
2
|
+
// Speechify.js version 3
|
3
|
+
// Use jQuery 1.6.2
|
4
|
+
;(function($){$.fn.speechify=function(c){if(c){var d=c.pointer_offset;delete c.pointer_offset}var f={color:'white',backgroundColor:'black',padding:'5px',fontFamily:'sans-serif',fontSize:'11px',fontWeight:'normal','border-radius':'5px','-moz-border-radius':'5px','-webkit-border-radius':'5px'};var g=$.extend({},f,c);var h=$("<div id='speechify_wrapper'><div id='speechify'></div><div id='speechify_spike'></div></div>");$("body").append(h);h.css('position','absolute');var i=$('#speechify').css(g).css('border','0px');$('#speechify_spike').css({position:'relative',width:'0px',height:'0px',left:i.css('padding-left'),borderStyle:'solid',borderWidth:i.css('padding-left'),borderColor:i.css('background-color')+' transparent transparent transparent'});h.hide();var j=$(this);j.live({'mouseenter.speechify':function(){if(this.title!=''){$(this).data('title',this.title);this.title=''}if($(this).data('title')){i.html($(this).data('title'));h.show()}},'mouseleave.speechify':function(){h.hide()},'mousemove.speechify':function(e){if(d){var a=$(window).height()-e.pageY+d.bottom;var b=e.pageX+d.left}else{var a=$(window).height()-$(this).offset().top;var b=e.pageX-(parseInt(i.css('padding-left'))*2)}h.css({bottom:a+"px",left:b+"px"})},'click.speechify':function(){h.hide()}})};$.speechify=function(a){$('*[title]').speechify(a)}})(jQuery);
|
@@ -0,0 +1,4 @@
|
|
1
|
+
// Copyright (c) 2010-11 Mickael Riga - See MIT_LICENCE for details
|
2
|
+
// Version 0.2.2
|
3
|
+
;(function($){$.fn.underwood=function(l){var m={toolbar:"title paragraph bold italic link mailto unlink source",title_block:'<h3>',paragraph_block:'<p>',sanitize:true,css_href:null};var n=$.extend({},m,l);if(document.designMode||document.contentEditable){return this.each(function(){$(this).parents('form').unbind('submit.underwood').bind('submit.underwood',function(){$(this).find('iframe.underwood_iframe').each(function(){disable_design_mode(this,true)})});enable_design_mode($(this))})}function enable_design_mode(a){var b=document.createElement("iframe");b.frameBorder=0;b.frameMargin=0;b.framePadding=0;b.height=200;b.className="underwood_iframe";if(a.attr('name'))b.rel=a.attr('name');a.after(b);var c;if(n.css_href){c="<link rel='stylesheet' href='"+n.css_href+"' type='text/css' media='screen' charset='utf-8' />"}else{c=" <style type='text/css'> .underwood_frame_body {font-family:sans-serif;font-size:12px;margin:0;padding:10px;} .underwood_frame_body p {border:1px #DDD solid;padding:2px;} </style>"}var d=a.val();if($.trim(d)=='')d='<br>';var e="<html><head>"+c+"</head><body class='underwood_frame_body'>"+d+"</body></html>";try_enable_design_mode(b,e,function(){$(b).prevAll('.underwood_toolbar').remove().end().before(toolbar(b));a.remove()})}function try_enable_design_mode(a,b,c){try{a.contentWindow.document.open();a.contentWindow.document.write(b);a.contentWindow.document.close()}catch(error){console.log(error)}if(document.contentEditable){a.contentWindow.document.designMode="On";c();return true}else if(document.designMode!=null){try{a.contentWindow.document.designMode="on";c();return true}catch(error){console.log(error)}}setTimeout(function(){try_enable_design_mode(a,b,c)},250);return false}function toolbar(e){var f=$("<div class='underwood_toolbar'></div>");var g=n.toolbar.split(' ');for(var i in g){var h=g[i];var j=h.charAt(0).toUpperCase()+h.substr(1).toLowerCase();var k="<a href='#' class='underwood_btn underwood_btn_"+h+"' title='"+j+"'>"+j+"</a>";f.append($(k))}$('.underwood_btn_title',f).click(function(){exec_command(e,"formatblock",n.title_block);return false});$('.underwood_btn_paragraph',f).click(function(){exec_command(e,"formatblock",n.paragraph_block);return false});$('.underwood_btn_bold',f).click(function(){exec_command(e,'bold');return false});$('.underwood_btn_italic',f).click(function(){exec_command(e,'italic');return false});$('.underwood_btn_link',f).click(function(){var a=prompt("URL:","http://");var b=confirm('Open in a new window? (press cancel to open in the same window)')?'_blank':'_self';if(a){exec_command(e,'CreateLink',a);var c=e.contentWindow;var d=c.getSelection();d.focusNode.parentNode.target=b}return false});$('.underwood_btn_mailto',f).click(function(){var a='mailto:'+prompt("Email address:");if(a)exec_command(e,'CreateLink',a);return false});$('.underwood_btn_unlink',f).click(function(){exec_command(e,'unlink');return false});$('.underwood_btn_image',f).click(function(){var a=prompt("Image URL:");if(a)exec_command(e,'InsertImage',a);return false});$('.underwood_btn_source',f).click(function(){var a=disable_design_mode(e);var b=$("<a href='#' class='underwood_btn underwood_btn_back'>Back to Rich Text Editor</a>");f.empty().append(b);b.click(function(){enable_design_mode(a);return false}).hover(function(){$(this).css('opacity',0.6)},function(){$(this).css('opacity',1)});return false});$('.underwood_btn',f).hover(function(){$(this).css('opacity',0.6)},function(){$(this).css('opacity',1)});return f}function exec_command(a,b,c){a.contentWindow.focus();try{a.contentWindow.document.execCommand(b,false,c)}catch(e){console.log(e)}a.contentWindow.focus()}function sanitize_this(s){s=n.sanitize?s.replace(/(<\/?font[^>]*>|style=.[^'"]*['"])/g,''):s;return(s.match(/(>|^)[^<]+(<|$)/)||s.match(/<(object|iframe|img)/))?s:''};function disable_design_mode(a,b){var c=a.contentWindow.document.getElementsByTagName("body")[0].innerHTML;if(b==true)var d=$('<input type="hidden" />');else var d=$('<textarea cols="40" rows="10"></textarea>');d.val(sanitize_this(c));t=d.get(0);t.className="underwood_textarea_copy";if(a.rel)t.name=a.rel;$(a).before(d);if(b!=true)$(a).remove();return d}function create_targeted_link(a,b,c){selected=a.contentWindow.document.getSelection().getRangeAt(0);var d=a.contentWindow.document.createElement('a');d.href=b;d.target=c;if(selected.toString()==''){d.innerHTML=b;selected.insertNode(d)}else{selected.surroundContents(d)}}}})(jQuery);
|
4
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
works
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
|
2
|
+
<title>Bureau</title>
|
3
|
+
|
4
|
+
<link rel="stylesheet" href="%s/_static/css/plugin.asmselect.css" type="text/css" media="screen" charset="utf-8" />
|
5
|
+
<link rel="stylesheet" href="%s/_static/css/main.css" type="text/css" media="screen" charset="utf-8" />
|
6
|
+
<link rel="stylesheet" href="%s/_static/css/ui-darkness/jquery-ui-1.9.1.custom.css" type="text/css" media="screen" charset="utf-8" />
|
7
|
+
|
8
|
+
<script type="text/javascript" charset="utf-8">
|
9
|
+
cms_path = '%s';
|
10
|
+
</script>
|
11
|
+
<script type="text/javascript" src="//code.jquery.com/jquery-1.8.2.min.js"></script>
|
12
|
+
<script type="text/javascript" src="%s/_static/js/jquery-ui-1.9.1.custom.min.js"></script>
|
13
|
+
<script type="text/javascript" src="%s/_static/js/addon.timepicker.js"></script>
|
14
|
+
<script type="text/javascript" src="%s/_static/js/plugin.form.js"></script>
|
15
|
+
<script type="text/javascript" src="%s/_static/js/plugin.underwood.js"></script>
|
16
|
+
<script type="text/javascript" src="%s/_static/js/plugin.quicksearch.js"></script>
|
17
|
+
<script type="text/javascript" src="%s/_static/js/plugin.speechify.js"></script>
|
18
|
+
<script type="text/javascript" src="%s/_static/js/plugin.quickmask.js"></script>
|
19
|
+
<script type="text/javascript" src="%s/_static/js/plugin.asmselect.js"></script>
|
20
|
+
<script type="text/javascript" src="%s/_static/js/plugin.mapolygon.js"></script>
|
21
|
+
<script type="text/javascript" src="%s/_static/js/main.js"></script>
|
22
|
+
|
23
|
+
%s
|