im_reader 1.0.0

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.
Files changed (45) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +11 -0
  3. data/Gemfile +9 -0
  4. data/Gemfile.lock +44 -0
  5. data/LICENSE.txt +21 -0
  6. data/README.md +110 -0
  7. data/Rakefile +8 -0
  8. data/app/assets/fonts/im_reader/icons.ttf +0 -0
  9. data/app/assets/fonts/im_reader/icons.woff +0 -0
  10. data/app/assets/fonts/im_reader/icons.woff2 +0 -0
  11. data/app/assets/images/im_reader/logo_colore.svg +26 -0
  12. data/app/assets/javascripts/im_reader/epub.min.js +1 -0
  13. data/app/assets/javascripts/im_reader/jszip.min.js +13 -0
  14. data/app/assets/javascripts/im_reader/reader.js +144 -0
  15. data/app/assets/javascripts/im_reader/semantic/progress.js +793 -0
  16. data/app/assets/javascripts/im_reader/semantic/sidebar.js +1022 -0
  17. data/app/assets/javascripts/im_reader/semantic-ui.js +2 -0
  18. data/app/assets/stylesheets/im_reader/reader.scss +127 -0
  19. data/app/assets/stylesheets/im_reader/semantic/button.scss +3172 -0
  20. data/app/assets/stylesheets/im_reader/semantic/colors.scss +15 -0
  21. data/app/assets/stylesheets/im_reader/semantic/container.scss +154 -0
  22. data/app/assets/stylesheets/im_reader/semantic/grid.scss +2029 -0
  23. data/app/assets/stylesheets/im_reader/semantic/header.scss +719 -0
  24. data/app/assets/stylesheets/im_reader/semantic/icon.scss +2587 -0
  25. data/app/assets/stylesheets/im_reader/semantic/item.scss +482 -0
  26. data/app/assets/stylesheets/im_reader/semantic/menu.scss +2054 -0
  27. data/app/assets/stylesheets/im_reader/semantic/progress.scss +517 -0
  28. data/app/controllers/im_reader/application_controller.rb +8 -0
  29. data/app/controllers/im_reader/epub_reader_controller.rb +62 -0
  30. data/app/views/im_reader/epub_reader/show.html.erb +38 -0
  31. data/app/views/layouts/im_reader/epub_reader.html.erb +23 -0
  32. data/config/locales/de.yml +10 -0
  33. data/config/locales/en.yml +10 -0
  34. data/config/locales/es.yml +10 -0
  35. data/config/locales/fr.yml +10 -0
  36. data/config/locales/pt.yml +10 -0
  37. data/config/routes.rb +4 -0
  38. data/im_reader.gemspec +33 -0
  39. data/lib/im_reader/engine.rb +32 -0
  40. data/lib/im_reader/version.rb +5 -0
  41. data/lib/im_reader.rb +8 -0
  42. data/sig/im_reader.rbs +4 -0
  43. data/spec/im_reader_spec.rb +11 -0
  44. data/spec/spec_helper.rb +15 -0
  45. metadata +115 -0
@@ -0,0 +1,793 @@
1
+ /*!
2
+ * # Semantic UI 2.1.4 - Progress
3
+ * http://github.com/semantic-org/semantic-ui/
4
+ *
5
+ *
6
+ * Copyright 2015 Contributors
7
+ * Released under the MIT license
8
+ * http://opensource.org/licenses/MIT
9
+ *
10
+ */
11
+
12
+ ;(function ( $, window, document, undefined ) {
13
+
14
+ "use strict";
15
+
16
+ $.fn.progress = function(parameters) {
17
+ var
18
+ $allModules = $(this),
19
+
20
+ moduleSelector = $allModules.selector || '',
21
+
22
+ time = new Date().getTime(),
23
+ performance = [],
24
+
25
+ query = arguments[0],
26
+ methodInvoked = (typeof query == 'string'),
27
+ queryArguments = [].slice.call(arguments, 1),
28
+
29
+ returnedValue
30
+ ;
31
+
32
+ $allModules
33
+ .each(function() {
34
+ var
35
+ settings = ( $.isPlainObject(parameters) )
36
+ ? $.extend(true, {}, $.fn.progress.settings, parameters)
37
+ : $.extend({}, $.fn.progress.settings),
38
+
39
+ className = settings.className,
40
+ metadata = settings.metadata,
41
+ namespace = settings.namespace,
42
+ selector = settings.selector,
43
+ error = settings.error,
44
+
45
+ eventNamespace = '.' + namespace,
46
+ moduleNamespace = 'module-' + namespace,
47
+
48
+ $module = $(this),
49
+ $bar = $(this).find(selector.bar),
50
+ $progress = $(this).find(selector.progress),
51
+ $label = $(this).find(selector.label),
52
+
53
+ element = this,
54
+ instance = $module.data(moduleNamespace),
55
+
56
+ animating = false,
57
+ transitionEnd,
58
+ module
59
+ ;
60
+
61
+ module = {
62
+
63
+ initialize: function() {
64
+ module.debug('Initializing progress bar', settings);
65
+
66
+ module.set.duration();
67
+ module.set.transitionEvent();
68
+
69
+ module.read.metadata();
70
+ module.read.settings();
71
+
72
+ module.instantiate();
73
+ },
74
+
75
+ instantiate: function() {
76
+ module.verbose('Storing instance of progress', module);
77
+ instance = module;
78
+ $module
79
+ .data(moduleNamespace, module)
80
+ ;
81
+ },
82
+ destroy: function() {
83
+ module.verbose('Destroying previous progress for', $module);
84
+ clearInterval(instance.interval);
85
+ module.remove.state();
86
+ $module.removeData(moduleNamespace);
87
+ instance = undefined;
88
+ },
89
+
90
+ reset: function() {
91
+ module.set.percent(0);
92
+ },
93
+
94
+ complete: function() {
95
+ if(module.percent === undefined || module.percent < 100) {
96
+ module.set.percent(100);
97
+ }
98
+ },
99
+
100
+ read: {
101
+ metadata: function() {
102
+ var
103
+ data = {
104
+ percent : $module.data(metadata.percent),
105
+ total : $module.data(metadata.total),
106
+ value : $module.data(metadata.value)
107
+ }
108
+ ;
109
+ if(data.percent) {
110
+ module.debug('Current percent value set from metadata', data.percent);
111
+ module.set.percent(data.percent);
112
+ }
113
+ if(data.total) {
114
+ module.debug('Total value set from metadata', data.total);
115
+ module.set.total(data.total);
116
+ }
117
+ if(data.value) {
118
+ module.debug('Current value set from metadata', data.value);
119
+ module.set.value(data.value);
120
+ module.set.progress(data.value);
121
+ }
122
+ },
123
+ settings: function() {
124
+ if(settings.total !== false) {
125
+ module.debug('Current total set in settings', settings.total);
126
+ module.set.total(settings.total);
127
+ }
128
+ if(settings.value !== false) {
129
+ module.debug('Current value set in settings', settings.value);
130
+ module.set.value(settings.value);
131
+ module.set.progress(module.value);
132
+ }
133
+ if(settings.percent !== false) {
134
+ module.debug('Current percent set in settings', settings.percent);
135
+ module.set.percent(settings.percent);
136
+ }
137
+ }
138
+ },
139
+
140
+ increment: function(incrementValue) {
141
+ var
142
+ maxValue,
143
+ startValue,
144
+ newValue
145
+ ;
146
+ if( module.has.total() ) {
147
+ startValue = module.get.value();
148
+ incrementValue = incrementValue || 1;
149
+
150
+ newValue = startValue + incrementValue;
151
+ maxValue = module.get.total();
152
+
153
+ module.debug('Incrementing value', startValue, newValue, maxValue);
154
+ if(newValue > maxValue ) {
155
+ module.debug('Value cannot increment above total', maxValue);
156
+ newValue = maxValue;
157
+ }
158
+ }
159
+ else {
160
+ startValue = module.get.percent();
161
+ incrementValue = incrementValue || module.get.randomValue();
162
+
163
+ newValue = startValue + incrementValue;
164
+ maxValue = 100;
165
+
166
+ module.debug('Incrementing percentage by', startValue, newValue);
167
+ if(newValue > maxValue ) {
168
+ module.debug('Value cannot increment above 100 percent');
169
+ newValue = maxValue;
170
+ }
171
+ }
172
+ module.set.progress(newValue);
173
+ },
174
+ decrement: function(decrementValue) {
175
+ var
176
+ total = module.get.total(),
177
+ startValue,
178
+ newValue
179
+ ;
180
+ if(total) {
181
+ startValue = module.get.value();
182
+ decrementValue = decrementValue || 1;
183
+ newValue = startValue - decrementValue;
184
+ module.debug('Decrementing value by', decrementValue, startValue);
185
+ }
186
+ else {
187
+ startValue = module.get.percent();
188
+ decrementValue = decrementValue || module.get.randomValue();
189
+ newValue = startValue - decrementValue;
190
+ module.debug('Decrementing percentage by', decrementValue, startValue);
191
+ }
192
+
193
+ if(newValue < 0) {
194
+ module.debug('Value cannot decrement below 0');
195
+ newValue = 0;
196
+ }
197
+ module.set.progress(newValue);
198
+ },
199
+
200
+ has: {
201
+ total: function() {
202
+ return (module.get.total() !== false);
203
+ }
204
+ },
205
+
206
+ get: {
207
+ text: function(templateText) {
208
+ var
209
+ value = module.value || 0,
210
+ total = module.total || 0,
211
+ percent = (animating)
212
+ ? module.get.displayPercent()
213
+ : module.percent || 0,
214
+ left = (module.total > 0)
215
+ ? (total - value)
216
+ : (100 - percent)
217
+ ;
218
+ templateText = templateText || '';
219
+ templateText = templateText
220
+ .replace('{value}', value)
221
+ .replace('{total}', total)
222
+ .replace('{left}', left)
223
+ .replace('{percent}', percent)
224
+ ;
225
+ module.debug('Adding variables to progress bar text', templateText);
226
+ return templateText;
227
+ },
228
+
229
+
230
+ randomValue: function() {
231
+ module.debug('Generating random increment percentage');
232
+ return Math.floor((Math.random() * settings.random.max) + settings.random.min);
233
+ },
234
+
235
+ numericValue: function(value) {
236
+ return (typeof value === 'string')
237
+ ? (value.replace(/[^\d.]/g, '') !== '')
238
+ ? +(value.replace(/[^\d.]/g, ''))
239
+ : false
240
+ : value
241
+ ;
242
+ },
243
+
244
+ transitionEnd: function() {
245
+ var
246
+ element = document.createElement('element'),
247
+ transitions = {
248
+ 'transition' :'transitionend',
249
+ 'OTransition' :'oTransitionEnd',
250
+ 'MozTransition' :'transitionend',
251
+ 'WebkitTransition' :'webkitTransitionEnd'
252
+ },
253
+ transition
254
+ ;
255
+ for(transition in transitions){
256
+ if( element.style[transition] !== undefined ){
257
+ return transitions[transition];
258
+ }
259
+ }
260
+ },
261
+
262
+ // gets current displayed percentage (if animating values this is the intermediary value)
263
+ displayPercent: function() {
264
+ var
265
+ barWidth = $bar.width(),
266
+ totalWidth = $module.width(),
267
+ minDisplay = parseInt($bar.css('min-width'), 10),
268
+ displayPercent = (barWidth > minDisplay)
269
+ ? (barWidth / totalWidth * 100)
270
+ : module.percent
271
+ ;
272
+ return (settings.precision > 0)
273
+ ? Math.round(displayPercent * (10 * settings.precision)) / (10 * settings.precision)
274
+ : Math.round(displayPercent)
275
+ ;
276
+ },
277
+
278
+ percent: function() {
279
+ return module.percent || 0;
280
+ },
281
+ value: function() {
282
+ return module.value || 0;
283
+ },
284
+ total: function() {
285
+ return module.total || false;
286
+ }
287
+ },
288
+
289
+ is: {
290
+ success: function() {
291
+ return $module.hasClass(className.success);
292
+ },
293
+ warning: function() {
294
+ return $module.hasClass(className.warning);
295
+ },
296
+ error: function() {
297
+ return $module.hasClass(className.error);
298
+ },
299
+ active: function() {
300
+ return $module.hasClass(className.active);
301
+ },
302
+ visible: function() {
303
+ return $module.is(':visible');
304
+ }
305
+ },
306
+
307
+ remove: {
308
+ state: function() {
309
+ module.verbose('Removing stored state');
310
+ delete module.total;
311
+ delete module.percent;
312
+ delete module.value;
313
+ },
314
+ active: function() {
315
+ module.verbose('Removing active state');
316
+ $module.removeClass(className.active);
317
+ },
318
+ success: function() {
319
+ module.verbose('Removing success state');
320
+ $module.removeClass(className.success);
321
+ },
322
+ warning: function() {
323
+ module.verbose('Removing warning state');
324
+ $module.removeClass(className.warning);
325
+ },
326
+ error: function() {
327
+ module.verbose('Removing error state');
328
+ $module.removeClass(className.error);
329
+ }
330
+ },
331
+
332
+ set: {
333
+ barWidth: function(value) {
334
+ if (value < 0) {
335
+ module.error(error.tooLow, value);
336
+ }
337
+ else {
338
+ if (value > 100)
339
+ $bar.css('width', '100%')
340
+ else
341
+ $bar.css('width', value + '%')
342
+ ;
343
+ $module
344
+ .attr('data-percent', parseInt(value, 10))
345
+ ;
346
+ }
347
+ },
348
+ duration: function(duration) {
349
+ duration = duration || settings.duration;
350
+ duration = (typeof duration == 'number')
351
+ ? duration + 'ms'
352
+ : duration
353
+ ;
354
+ module.verbose('Setting progress bar transition duration', duration);
355
+ $bar
356
+ .css({
357
+ 'transition-duration': duration
358
+ })
359
+ ;
360
+ },
361
+ percent: function(percent) {
362
+ percent = (typeof percent == 'string')
363
+ ? +(percent.replace('%', ''))
364
+ : percent
365
+ ;
366
+ // round display percentage
367
+ percent = (settings.precision > 0)
368
+ ? Math.round(percent * (10 * settings.precision)) / (10 * settings.precision)
369
+ : Math.round(percent)
370
+ ;
371
+ module.percent = percent;
372
+ if( !module.has.total() ) {
373
+ module.value = (settings.precision > 0)
374
+ ? Math.round( (percent / 100) * module.total * (10 * settings.precision)) / (10 * settings.precision)
375
+ : Math.round( (percent / 100) * module.total * 10) / 10
376
+ ;
377
+ if(settings.limitValues) {
378
+ module.value = (module.value > 100)
379
+ ? 100
380
+ : (module.value < 0)
381
+ ? 0
382
+ : module.value
383
+ ;
384
+ }
385
+ }
386
+ module.set.barWidth(percent);
387
+ module.set.labelInterval();
388
+ module.set.labels();
389
+ settings.onChange.call(element, percent, module.value, module.total);
390
+ },
391
+ labelInterval: function() {
392
+ var
393
+ animationCallback = function() {
394
+ module.verbose('Bar finished animating, removing continuous label updates');
395
+ clearInterval(module.interval);
396
+ animating = false;
397
+ module.set.labels();
398
+ }
399
+ ;
400
+ clearInterval(module.interval);
401
+ $bar.one(transitionEnd + eventNamespace, animationCallback);
402
+ module.timer = setTimeout(animationCallback, settings.duration + 100);
403
+ animating = true;
404
+ module.interval = setInterval(module.set.labels, settings.framerate);
405
+ },
406
+ labels: function() {
407
+ module.verbose('Setting both bar progress and outer label text');
408
+ module.set.barLabel();
409
+ module.set.state();
410
+ },
411
+ label: function(text) {
412
+ text = text || '';
413
+ if(text) {
414
+ text = module.get.text(text);
415
+ module.debug('Setting label to text', text);
416
+ $label.text(text);
417
+ }
418
+ },
419
+ state: function(percent) {
420
+ percent = (percent !== undefined)
421
+ ? percent
422
+ : module.percent
423
+ ;
424
+ if(percent === 100) {
425
+ if(settings.autoSuccess && !(module.is.warning() || module.is.error())) {
426
+ module.set.success();
427
+ module.debug('Automatically triggering success at 100%');
428
+ }
429
+ else {
430
+ module.verbose('Reached 100% removing active state');
431
+ module.remove.active();
432
+ }
433
+ }
434
+ else if(percent > 0) {
435
+ module.verbose('Adjusting active progress bar label', percent);
436
+ module.set.active();
437
+ }
438
+ else {
439
+ module.remove.active();
440
+ module.set.label(settings.text.active);
441
+ }
442
+ },
443
+ barLabel: function(text) {
444
+ if(text !== undefined) {
445
+ $progress.text( module.get.text(text) );
446
+ }
447
+ else if(settings.label == 'ratio' && module.total) {
448
+ module.debug('Adding ratio to bar label');
449
+ $progress.text( module.get.text(settings.text.ratio) );
450
+ }
451
+ else if(settings.label == 'percent') {
452
+ module.debug('Adding percentage to bar label');
453
+ $progress.text( module.get.text(settings.text.percent) );
454
+ }
455
+ },
456
+ active: function(text) {
457
+ text = text || settings.text.active;
458
+ module.debug('Setting active state');
459
+ if(settings.showActivity && !module.is.active() ) {
460
+ $module.addClass(className.active);
461
+ }
462
+ module.remove.warning();
463
+ module.remove.error();
464
+ module.remove.success();
465
+ if(text) {
466
+ module.set.label(text);
467
+ }
468
+ settings.onActive.call(element, module.value, module.total);
469
+ },
470
+ success : function(text) {
471
+ text = text || settings.text.success;
472
+ module.debug('Setting success state');
473
+ $module.addClass(className.success);
474
+ module.remove.active();
475
+ module.remove.warning();
476
+ module.remove.error();
477
+ module.complete();
478
+ if(text) {
479
+ module.set.label(text);
480
+ }
481
+ settings.onSuccess.call(element, module.total);
482
+ },
483
+ warning : function(text) {
484
+ text = text || settings.text.warning;
485
+ module.debug('Setting warning state');
486
+ $module.addClass(className.warning);
487
+ module.remove.active();
488
+ module.remove.success();
489
+ module.remove.error();
490
+ module.complete();
491
+ if(text) {
492
+ module.set.label(text);
493
+ }
494
+ settings.onWarning.call(element, module.value, module.total);
495
+ },
496
+ error : function(text) {
497
+ text = text || settings.text.error;
498
+ module.debug('Setting error state');
499
+ $module.addClass(className.error);
500
+ module.remove.active();
501
+ module.remove.success();
502
+ module.remove.warning();
503
+ module.complete();
504
+ if(text) {
505
+ module.set.label(text);
506
+ }
507
+ settings.onError.call(element, module.value, module.total);
508
+ },
509
+ transitionEvent: function() {
510
+ transitionEnd = module.get.transitionEnd();
511
+ },
512
+ total: function(totalValue) {
513
+ module.total = totalValue;
514
+ },
515
+ value: function(value) {
516
+ module.value = value;
517
+ },
518
+ progress: function(value) {
519
+ var
520
+ numericValue = module.get.numericValue(value),
521
+ percentComplete
522
+ ;
523
+ if(numericValue === false) {
524
+ module.error(error.nonNumeric, value);
525
+ }
526
+ if( module.has.total() ) {
527
+ module.set.value(numericValue);
528
+ percentComplete = (numericValue / module.total) * 100;
529
+ module.debug('Calculating percent complete from total', percentComplete);
530
+ module.set.percent( percentComplete );
531
+ }
532
+ else {
533
+ percentComplete = numericValue;
534
+ module.debug('Setting value to exact percentage value', percentComplete);
535
+ module.set.percent( percentComplete );
536
+ }
537
+ }
538
+ },
539
+
540
+ setting: function(name, value) {
541
+ module.debug('Changing setting', name, value);
542
+ if( $.isPlainObject(name) ) {
543
+ $.extend(true, settings, name);
544
+ }
545
+ else if(value !== undefined) {
546
+ settings[name] = value;
547
+ }
548
+ else {
549
+ return settings[name];
550
+ }
551
+ },
552
+ internal: function(name, value) {
553
+ if( $.isPlainObject(name) ) {
554
+ $.extend(true, module, name);
555
+ }
556
+ else if(value !== undefined) {
557
+ module[name] = value;
558
+ }
559
+ else {
560
+ return module[name];
561
+ }
562
+ },
563
+ debug: function() {
564
+ if(settings.debug) {
565
+ if(settings.performance) {
566
+ module.performance.log(arguments);
567
+ }
568
+ else {
569
+ module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
570
+ module.debug.apply(console, arguments);
571
+ }
572
+ }
573
+ },
574
+ verbose: function() {
575
+ if(settings.verbose && settings.debug) {
576
+ if(settings.performance) {
577
+ module.performance.log(arguments);
578
+ }
579
+ else {
580
+ module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
581
+ module.verbose.apply(console, arguments);
582
+ }
583
+ }
584
+ },
585
+ error: function() {
586
+ module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
587
+ module.error.apply(console, arguments);
588
+ },
589
+ performance: {
590
+ log: function(message) {
591
+ var
592
+ currentTime,
593
+ executionTime,
594
+ previousTime
595
+ ;
596
+ if(settings.performance) {
597
+ currentTime = new Date().getTime();
598
+ previousTime = time || currentTime;
599
+ executionTime = currentTime - previousTime;
600
+ time = currentTime;
601
+ performance.push({
602
+ 'Name' : message[0],
603
+ 'Arguments' : [].slice.call(message, 1) || '',
604
+ 'Element' : element,
605
+ 'Execution Time' : executionTime
606
+ });
607
+ }
608
+ clearTimeout(module.performance.timer);
609
+ module.performance.timer = setTimeout(module.performance.display, 500);
610
+ },
611
+ display: function() {
612
+ var
613
+ title = settings.name + ':',
614
+ totalTime = 0
615
+ ;
616
+ time = false;
617
+ clearTimeout(module.performance.timer);
618
+ $.each(performance, function(index, data) {
619
+ totalTime += data['Execution Time'];
620
+ });
621
+ title += ' ' + totalTime + 'ms';
622
+ if(moduleSelector) {
623
+ title += ' \'' + moduleSelector + '\'';
624
+ }
625
+ if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
626
+ console.groupCollapsed(title);
627
+ if(console.table) {
628
+ console.table(performance);
629
+ }
630
+ else {
631
+ $.each(performance, function(index, data) {
632
+ console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
633
+ });
634
+ }
635
+ console.groupEnd();
636
+ }
637
+ performance = [];
638
+ }
639
+ },
640
+ invoke: function(query, passedArguments, context) {
641
+ var
642
+ object = instance,
643
+ maxDepth,
644
+ found,
645
+ response
646
+ ;
647
+ passedArguments = passedArguments || queryArguments;
648
+ context = element || context;
649
+ if(typeof query == 'string' && object !== undefined) {
650
+ query = query.split(/[\. ]/);
651
+ maxDepth = query.length - 1;
652
+ $.each(query, function(depth, value) {
653
+ var camelCaseValue = (depth != maxDepth)
654
+ ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
655
+ : query
656
+ ;
657
+ if( $.isPlainObject( object[camelCaseValue] ) && (depth != maxDepth) ) {
658
+ object = object[camelCaseValue];
659
+ }
660
+ else if( object[camelCaseValue] !== undefined ) {
661
+ found = object[camelCaseValue];
662
+ return false;
663
+ }
664
+ else if( $.isPlainObject( object[value] ) && (depth != maxDepth) ) {
665
+ object = object[value];
666
+ }
667
+ else if( object[value] !== undefined ) {
668
+ found = object[value];
669
+ return false;
670
+ }
671
+ else {
672
+ module.error(error.method, query);
673
+ return false;
674
+ }
675
+ });
676
+ }
677
+ if ( $.isFunction( found ) ) {
678
+ response = found.apply(context, passedArguments);
679
+ }
680
+ else if(found !== undefined) {
681
+ response = found;
682
+ }
683
+ if($.isArray(returnedValue)) {
684
+ returnedValue.push(response);
685
+ }
686
+ else if(returnedValue !== undefined) {
687
+ returnedValue = [returnedValue, response];
688
+ }
689
+ else if(response !== undefined) {
690
+ returnedValue = response;
691
+ }
692
+ return found;
693
+ }
694
+ };
695
+
696
+ if(methodInvoked) {
697
+ if(instance === undefined) {
698
+ module.initialize();
699
+ }
700
+ module.invoke(query);
701
+ }
702
+ else {
703
+ if(instance !== undefined) {
704
+ instance.invoke('destroy');
705
+ }
706
+ module.initialize();
707
+ }
708
+ })
709
+ ;
710
+
711
+ return (returnedValue !== undefined)
712
+ ? returnedValue
713
+ : this
714
+ ;
715
+ };
716
+
717
+ $.fn.progress.settings = {
718
+
719
+ name : 'Progress',
720
+ namespace : 'progress',
721
+
722
+ debug : false,
723
+ verbose : false,
724
+ performance : true,
725
+
726
+ random : {
727
+ min : 2,
728
+ max : 5
729
+ },
730
+
731
+ duration : 300,
732
+
733
+ autoSuccess : true,
734
+ showActivity : true,
735
+ limitValues : true,
736
+
737
+ label : 'percent',
738
+ precision : 0,
739
+ framerate : (1000 / 30), /// 30 fps
740
+
741
+ percent : false,
742
+ total : false,
743
+ value : false,
744
+
745
+ onChange : function(percent, value, total){},
746
+ onSuccess : function(total){},
747
+ onActive : function(value, total){},
748
+ onError : function(value, total){},
749
+ onWarning : function(value, total){},
750
+
751
+ error : {
752
+ method : 'The method you called is not defined.',
753
+ nonNumeric : 'Progress value is non numeric',
754
+ tooHigh : 'Value specified is above 100%',
755
+ tooLow : 'Value specified is below 0%'
756
+ },
757
+
758
+ regExp: {
759
+ variable: /\{\$*[A-z0-9]+\}/g
760
+ },
761
+
762
+ metadata: {
763
+ percent : 'percent',
764
+ total : 'total',
765
+ value : 'value'
766
+ },
767
+
768
+ selector : {
769
+ bar : '> .bar',
770
+ label : '> .label',
771
+ progress : '.bar > .progress'
772
+ },
773
+
774
+ text : {
775
+ active : false,
776
+ error : false,
777
+ success : false,
778
+ warning : false,
779
+ percent : '{percent}%',
780
+ ratio : '{value} of {total}'
781
+ },
782
+
783
+ className : {
784
+ active : 'active',
785
+ error : 'error',
786
+ success : 'success',
787
+ warning : 'warning'
788
+ }
789
+
790
+ };
791
+
792
+
793
+ })( jQuery, window , document );