@oat-sa/tao-core-ui 1.58.1 → 1.58.2

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 (233) hide show
  1. package/dist/actionbar.js +386 -395
  2. package/dist/adder.js +21 -19
  3. package/dist/animable/absorbable/absorbable.js +204 -213
  4. package/dist/animable/absorbable/css/absorb.css +1 -0
  5. package/dist/animable/absorbable/css/absorb.css.map +1 -1
  6. package/dist/animable/pulsable/pulsable.js +168 -177
  7. package/dist/autocomplete/css/autocomplete.css +1 -0
  8. package/dist/autocomplete/css/autocomplete.css.map +1 -1
  9. package/dist/autocomplete.js +68 -66
  10. package/dist/badge/badge.js +188 -197
  11. package/dist/badge/css/badge.css +1 -0
  12. package/dist/badge/css/badge.css.map +1 -1
  13. package/dist/breadcrumbs.js +275 -284
  14. package/dist/btngrouper.js +5 -5
  15. package/dist/bulkActionPopup.js +490 -495
  16. package/dist/button.js +283 -291
  17. package/dist/cascadingComboBox.js +249 -258
  18. package/dist/ckeditor/ckConfigurator.js +26 -19
  19. package/dist/ckeditor/dtdHandler.js +11 -9
  20. package/dist/class/selector.js +441 -450
  21. package/dist/component/resizable.js +1 -1
  22. package/dist/component/windowed.js +285 -294
  23. package/dist/component.js +419 -428
  24. package/dist/contextualPopup.js +417 -426
  25. package/dist/dashboard.js +300 -309
  26. package/dist/datalist.js +753 -762
  27. package/dist/datatable/filterStrategy/multiple.js +1 -1
  28. package/dist/datatable/filterStrategy/single.js +1 -1
  29. package/dist/datatable.js +1527 -1550
  30. package/dist/dateRange/dateRange.js +393 -402
  31. package/dist/datetime/picker.js +665 -672
  32. package/dist/deleter.js +368 -377
  33. package/dist/destination/selector.js +286 -295
  34. package/dist/dialog/alert.js +3 -3
  35. package/dist/dialog/confirm.js +1 -1
  36. package/dist/dialog/confirmDelete.js +216 -225
  37. package/dist/dialog.js +650 -654
  38. package/dist/disabler.js +8 -8
  39. package/dist/documentViewer/providers/pdfViewer/fallback/viewer.js +166 -175
  40. package/dist/documentViewer/providers/pdfViewer/pdfjs/findBar.js +518 -527
  41. package/dist/documentViewer/providers/pdfViewer/pdfjs/pageView.js +380 -389
  42. package/dist/documentViewer/providers/pdfViewer/pdfjs/searchEngine.js +539 -548
  43. package/dist/documentViewer/providers/pdfViewer/pdfjs/viewer.js +369 -378
  44. package/dist/documentViewer/providers/pdfViewer.js +184 -193
  45. package/dist/documentViewer.js +292 -301
  46. package/dist/dropdown.js +383 -392
  47. package/dist/durationer.js +5 -5
  48. package/dist/dynamicComponent.js +597 -598
  49. package/dist/feedback.js +356 -362
  50. package/dist/figure/FigureStateActive.js +117 -108
  51. package/dist/filesender.js +2 -2
  52. package/dist/filter.js +230 -239
  53. package/dist/form/dropdownForm.js +355 -357
  54. package/dist/form/form.js +919 -690
  55. package/dist/form/simpleForm.js +1 -1
  56. package/dist/form/validator/renderer.js +233 -235
  57. package/dist/form/validator/validator.js +257 -189
  58. package/dist/form/widget/definitions.js +1 -1
  59. package/dist/form/widget/providers/checkBox.js +254 -259
  60. package/dist/form/widget/providers/comboBox.js +187 -192
  61. package/dist/form/widget/providers/default.js +8 -9
  62. package/dist/form/widget/providers/hidden.js +170 -179
  63. package/dist/form/widget/providers/hiddenBox.js +262 -267
  64. package/dist/form/widget/providers/radioBox.js +216 -225
  65. package/dist/form/widget/providers/textArea.js +187 -196
  66. package/dist/form/widget/providers/textBox.js +2 -3
  67. package/dist/form/widget/widget.js +473 -475
  68. package/dist/formValidator/formValidator.js +1 -1
  69. package/dist/formValidator/highlighters/message.js +1 -1
  70. package/dist/generis/form/form.js +314 -323
  71. package/dist/generis/validator/validator.js +209 -218
  72. package/dist/generis/widget/checkBox/checkBox.js +218 -227
  73. package/dist/generis/widget/comboBox/comboBox.js +179 -188
  74. package/dist/generis/widget/hiddenBox/hiddenBox.js +220 -229
  75. package/dist/generis/widget/textBox/textBox.js +169 -178
  76. package/dist/generis/widget/widget.js +246 -255
  77. package/dist/groupedComboBox.js +222 -231
  78. package/dist/groupvalidator.js +2 -2
  79. package/dist/highlighter.js +967 -958
  80. package/dist/image/ImgStateActive/helper.js +7 -5
  81. package/dist/image/ImgStateActive/initHelper.js +49 -43
  82. package/dist/image/ImgStateActive/initMediaEditor.js +24 -20
  83. package/dist/image/ImgStateActive/mediaSizer.js +14 -12
  84. package/dist/image/ImgStateActive.js +72 -70
  85. package/dist/incrementer.js +6 -6
  86. package/dist/inplacer.js +6 -6
  87. package/dist/itemButtonList/css/item-button-list.css +1 -0
  88. package/dist/itemButtonList/css/item-button-list.css.map +1 -1
  89. package/dist/itemButtonList.js +439 -435
  90. package/dist/keyNavigation/navigableDomElement.js +51 -38
  91. package/dist/keyNavigation/navigator.js +85 -70
  92. package/dist/listbox.js +460 -469
  93. package/dist/liststyler.js +8 -8
  94. package/dist/loadingButton/loadingButton.js +209 -218
  95. package/dist/lock.js +476 -485
  96. package/dist/login/login.js +475 -484
  97. package/dist/maths/calculator/basicCalculator.js +235 -244
  98. package/dist/maths/calculator/calculatorComponent.js +3 -3
  99. package/dist/maths/calculator/core/board.js +772 -781
  100. package/dist/maths/calculator/core/expression.js +476 -485
  101. package/dist/maths/calculator/core/labels.js +228 -237
  102. package/dist/maths/calculator/core/tokenizer.js +1 -1
  103. package/dist/maths/calculator/core/tokens.js +163 -170
  104. package/dist/maths/calculator/plugins/keyboard/templateKeyboard/templateKeyboard.js +244 -253
  105. package/dist/maths/calculator/plugins/screen/simpleScreen/simpleScreen.js +279 -288
  106. package/dist/maths/calculator/scientificCalculator.js +327 -336
  107. package/dist/mediaEditor/mediaEditorComponent.js +238 -245
  108. package/dist/mediaEditor/plugins/mediaAlignment/helper.js +7 -7
  109. package/dist/mediaEditor/plugins/mediaAlignment/mediaAlignmentComponent.js +229 -235
  110. package/dist/mediaEditor/plugins/mediaDimension/mediaDimensionComponent.js +580 -589
  111. package/dist/mediaplayer/players/html5.js +666 -675
  112. package/dist/mediaplayer/players/youtube.js +419 -424
  113. package/dist/mediaplayer/support.js +11 -10
  114. package/dist/mediaplayer/utils/reminder.js +14 -13
  115. package/dist/mediaplayer/utils/timeObserver.js +10 -11
  116. package/dist/mediaplayer/youtubeManager.js +164 -145
  117. package/dist/mediaplayer.js +1565 -1520
  118. package/dist/mediasizer.js +669 -678
  119. package/dist/modal.js +10 -17
  120. package/dist/pageSizeSelector.js +219 -228
  121. package/dist/pagination/providers/pages.js +280 -289
  122. package/dist/pagination/providers/simple.js +192 -201
  123. package/dist/previewer.js +30 -30
  124. package/dist/progressbar.js +4 -4
  125. package/dist/report.js +347 -356
  126. package/dist/resource/filters.js +271 -280
  127. package/dist/resource/list.js +1264 -1273
  128. package/dist/resource/selector.js +865 -874
  129. package/dist/resource/tree.js +1483 -1492
  130. package/dist/resourcemgr/fileBrowser.js +564 -569
  131. package/dist/resourcemgr/filePreview.js +16 -16
  132. package/dist/resourcemgr/fileSelector.js +515 -524
  133. package/dist/resourcemgr/util/updatePermissions.js +2 -2
  134. package/dist/resourcemgr.js +306 -315
  135. package/dist/searchModal/advancedSearch.js +796 -767
  136. package/dist/searchModal.js +114 -91
  137. package/dist/switch/switch.js +298 -307
  138. package/dist/tabs.js +598 -575
  139. package/dist/taskQueue/status.js +312 -321
  140. package/dist/taskQueue/table.js +375 -384
  141. package/dist/taskQueue/taskQueueModel.js +488 -472
  142. package/dist/taskQueueButton/taskable.js +264 -273
  143. package/dist/taskQueueButton/treeButton.js +189 -198
  144. package/dist/themeLoader.js +24 -23
  145. package/dist/themes.js +1 -1
  146. package/dist/toggler.js +3 -3
  147. package/dist/tooltip.js +295 -304
  148. package/dist/transformer.js +2 -2
  149. package/dist/tristateCheckboxGroup.js +311 -320
  150. package/dist/uploader.js +687 -696
  151. package/dist/validator/Report.js +1 -1
  152. package/dist/validator/Validator.js +3 -3
  153. package/dist/validator/validators.js +9 -9
  154. package/dist/validator.js +240 -230
  155. package/dist/waitForMedia.js +1 -1
  156. package/package.json +3 -3
  157. package/src/animable/absorbable/css/absorb.css +1 -0
  158. package/src/animable/absorbable/css/absorb.css.map +1 -1
  159. package/src/autocomplete/css/autocomplete.css +1 -0
  160. package/src/autocomplete/css/autocomplete.css.map +1 -1
  161. package/src/badge/css/badge.css +1 -0
  162. package/src/badge/css/badge.css.map +1 -1
  163. package/src/ckeditor/ckConfigurator.js +4 -0
  164. package/src/itemButtonList/css/item-button-list.css +1 -0
  165. package/src/itemButtonList/css/item-button-list.css.map +1 -1
  166. package/src/.DS_Store +0 -0
  167. package/src/css/basic.css +0 -7826
  168. package/src/css/basic.css.map +0 -1
  169. package/src/css/ckeditor/skins/tao/css/dialog.css +0 -950
  170. package/src/css/ckeditor/skins/tao/css/dialog.css.map +0 -1
  171. package/src/css/ckeditor/skins/tao/css/editor.css +0 -1850
  172. package/src/css/ckeditor/skins/tao/css/editor.css.map +0 -1
  173. package/src/scss/.DS_Store +0 -0
  174. package/src/scss/basic.scss +0 -16
  175. package/src/scss/ckeditor/skins/tao/scss/dialog.scss +0 -763
  176. package/src/scss/ckeditor/skins/tao/scss/editor.scss +0 -111
  177. package/src/scss/ckeditor/skins/tao/scss/inc/_ck-icons.scss +0 -59
  178. package/src/scss/ckeditor/skins/tao/scss/inc/_colorpanel.scss +0 -118
  179. package/src/scss/ckeditor/skins/tao/scss/inc/_elementspath.scss +0 -69
  180. package/src/scss/ckeditor/skins/tao/scss/inc/_mainui.scss +0 -194
  181. package/src/scss/ckeditor/skins/tao/scss/inc/_menu.scss +0 -181
  182. package/src/scss/ckeditor/skins/tao/scss/inc/_panel.scss +0 -200
  183. package/src/scss/ckeditor/skins/tao/scss/inc/_presets.scss +0 -32
  184. package/src/scss/ckeditor/skins/tao/scss/inc/_reset.scss +0 -101
  185. package/src/scss/ckeditor/skins/tao/scss/inc/_richcombo.scss +0 -213
  186. package/src/scss/ckeditor/skins/tao/scss/inc/_tao.scss +0 -59
  187. package/src/scss/ckeditor/skins/tao/scss/inc/_toolbar.scss +0 -301
  188. package/src/scss/font/source-sans-pro/source-sans-pro-italic.eot +0 -0
  189. package/src/scss/font/source-sans-pro/source-sans-pro-italic.eot.b64 +0 -1
  190. package/src/scss/font/source-sans-pro/source-sans-pro-italic.woff +0 -0
  191. package/src/scss/font/source-sans-pro/source-sans-pro-italic.woff.b64 +0 -1
  192. package/src/scss/font/source-sans-pro/source-sans-pro-regular.eot +0 -0
  193. package/src/scss/font/source-sans-pro/source-sans-pro-regular.eot.b64 +0 -1
  194. package/src/scss/font/source-sans-pro/source-sans-pro-regular.woff +0 -0
  195. package/src/scss/font/source-sans-pro/source-sans-pro-regular.woff.b64 +0 -1
  196. package/src/scss/font/source-sans-pro/source-sans-pro-semibold-italic.eot +0 -0
  197. package/src/scss/font/source-sans-pro/source-sans-pro-semibold-italic.eot.b64 +0 -1
  198. package/src/scss/font/source-sans-pro/source-sans-pro-semibold-italic.woff +0 -0
  199. package/src/scss/font/source-sans-pro/source-sans-pro-semibold-italic.woff.b64 +0 -1
  200. package/src/scss/font/source-sans-pro/source-sans-pro-semibold.eot +0 -0
  201. package/src/scss/font/source-sans-pro/source-sans-pro-semibold.eot.b64 +0 -1
  202. package/src/scss/font/source-sans-pro/source-sans-pro-semibold.woff +0 -0
  203. package/src/scss/font/source-sans-pro/source-sans-pro-semibold.woff.b64 +0 -1
  204. package/src/scss/font/tao/tao.eot +0 -0
  205. package/src/scss/font/tao/tao.svg +0 -235
  206. package/src/scss/font/tao/tao.ttf +0 -0
  207. package/src/scss/font/tao/tao.woff +0 -0
  208. package/src/scss/inc/_base.scss +0 -496
  209. package/src/scss/inc/_bootstrap.scss +0 -6
  210. package/src/scss/inc/_buttons.scss +0 -114
  211. package/src/scss/inc/_colors.scss +0 -88
  212. package/src/scss/inc/_feedback.scss +0 -150
  213. package/src/scss/inc/_flex-grid.scss +0 -15
  214. package/src/scss/inc/_fonts.scss +0 -4
  215. package/src/scss/inc/_forms.scss +0 -827
  216. package/src/scss/inc/_functions.scss +0 -283
  217. package/src/scss/inc/_grid.scss +0 -66
  218. package/src/scss/inc/_jquery.nouislider.scss +0 -254
  219. package/src/scss/inc/_normalize.scss +0 -528
  220. package/src/scss/inc/_report.scss +0 -68
  221. package/src/scss/inc/_secondary-properties.scss +0 -89
  222. package/src/scss/inc/_select2.scss +0 -634
  223. package/src/scss/inc/_toolbars.scss +0 -155
  224. package/src/scss/inc/_tooltip.scss +0 -312
  225. package/src/scss/inc/_variables.scss +0 -21
  226. package/src/scss/inc/base/_highlight.scss +0 -5
  227. package/src/scss/inc/base/_list-style.scss +0 -59
  228. package/src/scss/inc/base/_svg.scss +0 -3
  229. package/src/scss/inc/base/_table.scss +0 -63
  230. package/src/scss/inc/fonts/_source-sans-pro.scss +0 -29
  231. package/src/scss/inc/fonts/_tao-icon-classes.scss +0 -226
  232. package/src/scss/inc/fonts/_tao-icon-def.scss +0 -12
  233. package/src/scss/inc/fonts/_tao-icon-vars.scss +0 -240
@@ -1,438 +1,429 @@
1
1
  define(['jquery', 'lodash', 'core/eventifier', 'ui/documentViewer/providers/pdfViewer/pdfjs/areaBroker', 'ui/documentViewer/providers/pdfViewer/pdfjs/findBar', 'ui/documentViewer/providers/pdfViewer/pdfjs/wrapper', 'handlebars', 'i18n', 'lib/dompurify/purify'], function ($$1, _, eventifier, areaBroker, findBarFactory, wrapperFactory, Handlebars, __, DOMPurify) { 'use strict';
2
2
 
3
- $$1 = $$1 && Object.prototype.hasOwnProperty.call($$1, 'default') ? $$1['default'] : $$1;
4
- _ = _ && Object.prototype.hasOwnProperty.call(_, 'default') ? _['default'] : _;
5
- eventifier = eventifier && Object.prototype.hasOwnProperty.call(eventifier, 'default') ? eventifier['default'] : eventifier;
6
- areaBroker = areaBroker && Object.prototype.hasOwnProperty.call(areaBroker, 'default') ? areaBroker['default'] : areaBroker;
7
- findBarFactory = findBarFactory && Object.prototype.hasOwnProperty.call(findBarFactory, 'default') ? findBarFactory['default'] : findBarFactory;
8
- wrapperFactory = wrapperFactory && Object.prototype.hasOwnProperty.call(wrapperFactory, 'default') ? wrapperFactory['default'] : wrapperFactory;
9
- Handlebars = Handlebars && Object.prototype.hasOwnProperty.call(Handlebars, 'default') ? Handlebars['default'] : Handlebars;
10
- __ = __ && Object.prototype.hasOwnProperty.call(__, 'default') ? __['default'] : __;
11
- DOMPurify = DOMPurify && Object.prototype.hasOwnProperty.call(DOMPurify, 'default') ? DOMPurify['default'] : DOMPurify;
12
-
3
+ $$1 = $$1 && Object.prototype.hasOwnProperty.call($$1, 'default') ? $$1['default'] : $$1;
4
+ _ = _ && Object.prototype.hasOwnProperty.call(_, 'default') ? _['default'] : _;
5
+ eventifier = eventifier && Object.prototype.hasOwnProperty.call(eventifier, 'default') ? eventifier['default'] : eventifier;
6
+ areaBroker = areaBroker && Object.prototype.hasOwnProperty.call(areaBroker, 'default') ? areaBroker['default'] : areaBroker;
7
+ findBarFactory = findBarFactory && Object.prototype.hasOwnProperty.call(findBarFactory, 'default') ? findBarFactory['default'] : findBarFactory;
8
+ wrapperFactory = wrapperFactory && Object.prototype.hasOwnProperty.call(wrapperFactory, 'default') ? wrapperFactory['default'] : wrapperFactory;
9
+ Handlebars = Handlebars && Object.prototype.hasOwnProperty.call(Handlebars, 'default') ? Handlebars['default'] : Handlebars;
10
+ __ = __ && Object.prototype.hasOwnProperty.call(__, 'default') ? __['default'] : __;
11
+ DOMPurify = DOMPurify && Object.prototype.hasOwnProperty.call(DOMPurify, 'default') ? DOMPurify['default'] : DOMPurify;
12
+
13
+ function _typeof(obj) {
14
+ "@babel/helpers - typeof";
15
+
16
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
17
+ return typeof obj;
18
+ } : function (obj) {
19
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
20
+ }, _typeof(obj);
21
+ }
22
+
23
+ function Helpers0 (hb) {
24
+ //register a i18n helper
25
+ hb.registerHelper('__', function (key) {
26
+ return __(key);
27
+ });
13
28
  /**
14
- * This program is free software; you can redistribute it and/or
15
- * modify it under the terms of the GNU General Public License
16
- * as published by the Free Software Foundation; under version 2
17
- * of the License (non-upgradable).
18
- *
19
- * This program is distributed in the hope that it will be useful,
20
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
21
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22
- * GNU General Public License for more details.
23
- *
24
- * You should have received a copy of the GNU General Public License
25
- * along with this program; if not, write to the Free Software
26
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
27
- *
28
- * Copyright (c) 2013-2019 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT);
29
+ * Register dompurify helper
29
30
  *
31
+ * https://github.com/cure53/DOMPurify
32
+ * with config SAFE_FOR_TEMPLATES: true
33
+ * to make output safe for template systems
34
+ */
35
+
36
+ hb.registerHelper('dompurify', function (context) {
37
+ return DOMPurify.sanitize(context);
38
+ });
39
+ /**
40
+ * Register join helper
30
41
  *
42
+ * Example :
43
+ * var values = {a:v1, b:v2, c:v3};
44
+ * Using {{{join attributes '=' ' ' '"'}}} will return : a="v1" b="v2" c="v3"
45
+ * Using {{{join values null ' or ' '*'}}} will return : *v1* or *v2* or *v3*
31
46
  */
32
- function Helpers0 (hb) {
33
- //register a i18n helper
34
- hb.registerHelper('__', function (key) {
35
- return __(key);
36
- });
37
- /**
38
- * Register dompurify helper
39
- *
40
- * https://github.com/cure53/DOMPurify
41
- * with config SAFE_FOR_TEMPLATES: true
42
- * to make output safe for template systems
43
- */
44
47
 
45
- hb.registerHelper('dompurify', function (context) {
46
- return DOMPurify.sanitize(context);
47
- });
48
- /**
49
- * Register join helper
50
- *
51
- * Example :
52
- * var values = {a:v1, b:v2, c:v3};
53
- * Using {{{join attributes '=' ' ' '"'}}} will return : a="v1" b="v2" c="v3"
54
- * Using {{{join values null ' or ' '*'}}} will return : *v1* or *v2* or *v3*
55
- */
48
+ hb.registerHelper('join', function (arr, keyValueGlue, fragmentGlue, wrapper) {
49
+ var fragments = [];
50
+ keyValueGlue = typeof keyValueGlue === 'string' ? keyValueGlue : undefined;
51
+ fragmentGlue = typeof fragmentGlue === 'string' ? fragmentGlue : ' ';
52
+ wrapper = typeof wrapper === 'string' ? wrapper : '"';
56
53
 
57
- hb.registerHelper('join', function (arr, keyValueGlue, fragmentGlue, wrapper) {
58
- var fragments = [];
59
- keyValueGlue = typeof keyValueGlue === 'string' ? keyValueGlue : undefined;
60
- fragmentGlue = typeof fragmentGlue === 'string' ? fragmentGlue : ' ';
61
- wrapper = typeof wrapper === 'string' ? wrapper : '"';
62
-
63
- _.forIn(arr, function (value, key) {
64
- var fragment = '';
65
-
66
- if (value !== null || value !== undefined) {
67
- if (typeof value === 'boolean') {
68
- value = value ? 'true' : 'false';
69
- } else if (typeof value === 'object') {
70
- value = _.values(value).join(' ');
71
- }
72
- } else {
73
- value = '';
74
- }
54
+ _.forIn(arr, function (value, key) {
55
+ var fragment = '';
75
56
 
76
- if (keyValueGlue !== undefined) {
77
- fragment += key + keyValueGlue;
57
+ if (value !== null || value !== undefined) {
58
+ if (typeof value === 'boolean') {
59
+ value = value ? 'true' : 'false';
60
+ } else if (_typeof(value) === 'object') {
61
+ value = _.values(value).join(' ');
78
62
  }
63
+ } else {
64
+ value = '';
65
+ }
79
66
 
80
- fragment += wrapper + value + wrapper;
81
- fragments.push(fragment);
82
- });
83
-
84
- return fragments.join(fragmentGlue);
85
- }); //register a classic "for loop" helper
86
- //it also adds a local variable "i" as the index in each iteration loop
87
-
88
- hb.registerHelper('for', function (startIndex, stopIndex, increment, options) {
89
- var ret = '';
90
- startIndex = parseInt(startIndex);
91
- stopIndex = parseInt(stopIndex);
92
- increment = parseInt(increment);
93
-
94
- for (var i = startIndex; i < stopIndex; i += increment) {
95
- ret += options.fn(_.extend({}, this, {
96
- i: i
97
- }));
67
+ if (keyValueGlue !== undefined) {
68
+ fragment += key + keyValueGlue;
98
69
  }
99
70
 
100
- return ret;
71
+ fragment += wrapper + value + wrapper;
72
+ fragments.push(fragment);
101
73
  });
102
- hb.registerHelper('equal', function (var1, var2, options) {
103
- if (var1 == var2) {
104
- return options.fn(this);
105
- } else {
106
- return options.inverse(this);
107
- }
108
- }); // register a "get property" helper
109
- // it gets the named property from the provided context
110
74
 
111
- hb.registerHelper('property', function (name, context) {
112
- return context[name] || '';
113
- }); // register an 'includes' helper
114
- // it checks if value is in array
75
+ return fragments.join(fragmentGlue);
76
+ }); //register a classic "for loop" helper
77
+ //it also adds a local variable "i" as the index in each iteration loop
115
78
 
116
- hb.registerHelper('includes', function (haystack, needle, options) {
117
- if (_.contains(haystack, needle)) {
118
- return options.fn(this);
119
- }
120
- });
121
- }
79
+ hb.registerHelper('for', function (startIndex, stopIndex, increment, options) {
80
+ var ret = '';
81
+ startIndex = parseInt(startIndex);
82
+ stopIndex = parseInt(stopIndex);
83
+ increment = parseInt(increment);
122
84
 
123
- if (!Helpers0.__initialized) {
124
- Helpers0(Handlebars);
125
- Helpers0.__initialized = true;
126
- }
127
- var Template = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
128
- this.compilerInfo = [4,'>= 1.0.0'];
129
- helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
130
- var buffer = "", stack1, helper, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, self=this;
131
-
132
- function program1(depth0,data) {
133
-
134
- var buffer = "", helper, options;
135
- buffer += "\n <input type=\"checkbox\" id=\"fit-to-width\" data-control=\"fit-to-width\" value=\"1\" checked /> <label for=\"fit-to-width\">"
136
- + escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, "Fit to width", options) : helperMissing.call(depth0, "__", "Fit to width", options)))
137
- + "</label>\n ";
138
- return buffer;
85
+ for (var i = startIndex; i < stopIndex; i += increment) {
86
+ ret += options.fn(_.extend({}, this, {
87
+ i: i
88
+ }));
139
89
  }
140
90
 
141
- buffer += "<div class=\"pdf-bar\">\n <div class=\"pdf-actions\">\n <button class=\"small navigation\" data-control=\"pdf-page-prev\" data-direction=\"-1\" title=\""
142
- + escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, "Previous page", options) : helperMissing.call(depth0, "__", "Previous page", options)))
143
- + "\"><span class=\"icon icon-step-backward\"></span><span class=\"text\">"
144
- + escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, "Previous", options) : helperMissing.call(depth0, "__", "Previous", options)))
145
- + "</span></button>\n <button class=\"small navigation\" data-control=\"pdf-page-next\" data-direction=\"1\" title=\""
146
- + escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, "Next page", options) : helperMissing.call(depth0, "__", "Next page", options)))
147
- + "\"><span class=\"icon icon-step-forward\"></span><span class=\"text\">"
148
- + escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, "Next", options) : helperMissing.call(depth0, "__", "Next", options)))
149
- + "</span></button>\n ";
150
- stack1 = helpers['if'].call(depth0, (depth0 && depth0.fitToWidth), {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});
151
- if(stack1 || stack1 === 0) { buffer += stack1; }
152
- buffer += "\n </div>\n <div class=\"pdf-info\">\n <label for=\"pdf-page-num\">"
153
- + escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, "Page", options) : helperMissing.call(depth0, "__", "Page", options)))
154
- + ":</label>\n <input class=\"info\" id=\"pdf-page-num\" data-control=\"pdf-page-num\" value=\"1\" />\n <label>"
155
- + escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, "of", options) : helperMissing.call(depth0, "__", "of", options)))
156
- + "</label>\n <span class=\"info\" data-control=\"pdf-page-count\">1</span>\n </div>\n</div>\n<div class=\"pdf-container\"></div>\n";
157
- return buffer;
158
- });
159
- function viewerTpl(data, options, asString) {
160
- var html = Template(data, options);
161
- return (asString || true) ? html : $(html);
91
+ return ret;
92
+ });
93
+ hb.registerHelper('equal', function (var1, var2, options) {
94
+ if (var1 == var2) {
95
+ return options.fn(this);
96
+ } else {
97
+ return options.inverse(this);
98
+ }
99
+ }); // register a "get property" helper
100
+ // it gets the named property from the provided context
101
+
102
+ hb.registerHelper('property', function (name, context) {
103
+ return context[name] || '';
104
+ }); // register an 'includes' helper
105
+ // it checks if value is in array
106
+
107
+ hb.registerHelper('includes', function (haystack, needle, options) {
108
+ if (_.contains(haystack, needle)) {
109
+ return options.fn(this);
110
+ }
111
+ });
112
+ }
113
+
114
+ if (!Helpers0.__initialized) {
115
+ Helpers0(Handlebars);
116
+ Helpers0.__initialized = true;
117
+ }
118
+ var Template = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
119
+ this.compilerInfo = [4,'>= 1.0.0'];
120
+ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
121
+ var buffer = "", stack1, helper, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, self=this;
122
+
123
+ function program1(depth0,data) {
124
+
125
+ var buffer = "", helper, options;
126
+ buffer += "\n <input type=\"checkbox\" id=\"fit-to-width\" data-control=\"fit-to-width\" value=\"1\" checked /> <label for=\"fit-to-width\">"
127
+ + escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, "Fit to width", options) : helperMissing.call(depth0, "__", "Fit to width", options)))
128
+ + "</label>\n ";
129
+ return buffer;
162
130
  }
163
131
 
132
+ buffer += "<div class=\"pdf-bar\">\n <div class=\"pdf-actions\">\n <button class=\"small navigation\" data-control=\"pdf-page-prev\" data-direction=\"-1\" title=\""
133
+ + escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, "Previous page", options) : helperMissing.call(depth0, "__", "Previous page", options)))
134
+ + "\"><span class=\"icon icon-step-backward\"></span><span class=\"text\">"
135
+ + escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, "Previous", options) : helperMissing.call(depth0, "__", "Previous", options)))
136
+ + "</span></button>\n <button class=\"small navigation\" data-control=\"pdf-page-next\" data-direction=\"1\" title=\""
137
+ + escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, "Next page", options) : helperMissing.call(depth0, "__", "Next page", options)))
138
+ + "\"><span class=\"icon icon-step-forward\"></span><span class=\"text\">"
139
+ + escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, "Next", options) : helperMissing.call(depth0, "__", "Next", options)))
140
+ + "</span></button>\n ";
141
+ stack1 = helpers['if'].call(depth0, (depth0 && depth0.fitToWidth), {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});
142
+ if(stack1 || stack1 === 0) { buffer += stack1; }
143
+ buffer += "\n </div>\n <div class=\"pdf-info\">\n <label for=\"pdf-page-num\">"
144
+ + escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, "Page", options) : helperMissing.call(depth0, "__", "Page", options)))
145
+ + ":</label>\n <input class=\"info\" id=\"pdf-page-num\" data-control=\"pdf-page-num\" value=\"1\" />\n <label>"
146
+ + escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, "of", options) : helperMissing.call(depth0, "__", "of", options)))
147
+ + "</label>\n <span class=\"info\" data-control=\"pdf-page-count\">1</span>\n </div>\n</div>\n<div class=\"pdf-container\"></div>\n";
148
+ return buffer;
149
+ });
150
+ function viewerTpl(data, options, asString) {
151
+ var html = Template(data, options);
152
+ return (asString || true) ? html : $(html);
153
+ }
154
+
155
+ /**
156
+ * This program is free software; you can redistribute it and/or
157
+ * modify it under the terms of the GNU General Public License
158
+ * as published by the Free Software Foundation; under version 2
159
+ * of the License (non-upgradable).
160
+ *
161
+ * This program is distributed in the hope that it will be useful,
162
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
163
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
164
+ * GNU General Public License for more details.
165
+ *
166
+ * You should have received a copy of the GNU General Public License
167
+ * along with this program; if not, write to the Free Software
168
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
169
+ *
170
+ * Copyright (c) 2016 (original work) Open Assessment Technologies SA ;
171
+ */
172
+ /**
173
+ * Enable/disable an element
174
+ * @param {jQuery} $element
175
+ * @param {Boolean} enabled
176
+ */
177
+
178
+ function toggleState($element, enabled) {
179
+ if (enabled) {
180
+ $element.removeAttr('disabled');
181
+ } else {
182
+ $element.attr('disabled', true);
183
+ }
184
+ }
185
+ /**
186
+ * Wraps the component that use the PDF.js lib to render a PDF.
187
+ * @param {jQuery} $container
188
+ * @param {Object} config
189
+ * @param {Object} config.PDFJS - The PDFJS entry point
190
+ * @param {Boolean} [config.fitToWidth] - Fit the page to the available width, a scroll bar may appear
191
+ * @param {Boolean} [config.allowSearch] - Allow to search within the displayed PDF
192
+ * @param {Boolean} [config.caseSensitiveSearch] - Use a case sensitive search when the search feature is available
193
+ * @param {Boolean} [config.highlightAllMatches] - Highlight all matches to see all of them at a glance
194
+ * @returns {Object}
195
+ */
196
+
197
+
198
+ function pdfjsViewerFactory($container, config) {
199
+ var template = viewerTpl(config);
200
+ var events = eventifier();
201
+ var controls = {};
202
+ var broker = null;
203
+ var findBar = null;
204
+ var pdfConfig = null;
205
+ var pdf = null;
206
+ var PDFJS = null;
207
+ var enabled = true;
164
208
  /**
165
- * This program is free software; you can redistribute it and/or
166
- * modify it under the terms of the GNU General Public License
167
- * as published by the Free Software Foundation; under version 2
168
- * of the License (non-upgradable).
169
- *
170
- * This program is distributed in the hope that it will be useful,
171
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
172
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
173
- * GNU General Public License for more details.
174
- *
175
- * You should have received a copy of the GNU General Public License
176
- * along with this program; if not, write to the Free Software
177
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
178
- *
179
- * Copyright (c) 2016 (original work) Open Assessment Technologies SA ;
180
- */
181
- /**
182
- * Enable/disable an element
183
- * @param {jQuery} $element
184
- * @param {Boolean} enabled
209
+ * Will update the displayed controls according to the current PDF
185
210
  */
186
211
 
187
- function toggleState($element, enabled) {
188
- if (enabled) {
189
- $element.removeAttr('disabled');
190
- } else {
191
- $element.attr('disabled', true);
212
+ function updateControls() {
213
+ var page = pdf.getPage();
214
+ var pageCount = pdf.getPageCount();
215
+
216
+ if (page !== parseInt(controls.$pageNum.val(), 10)) {
217
+ controls.$pageNum.val(page);
192
218
  }
219
+
220
+ toggleState(controls.$pagePrev, enabled && page > 1);
221
+ toggleState(controls.$pageNext, enabled && page < pageCount);
222
+ toggleState(controls.$pageNum, enabled && pageCount > 1);
193
223
  }
194
224
  /**
195
- * Wraps the component that use the PDF.js lib to render a PDF.
196
- * @param {jQuery} $container
197
- * @param {Object} config
198
- * @param {Object} config.PDFJS - The PDFJS entry point
199
- * @param {Boolean} [config.fitToWidth] - Fit the page to the available width, a scroll bar may appear
200
- * @param {Boolean} [config.allowSearch] - Allow to search within the displayed PDF
201
- * @param {Boolean} [config.caseSensitiveSearch] - Use a case sensitive search when the search feature is available
202
- * @param {Boolean} [config.highlightAllMatches] - Highlight all matches to see all of them at a glance
203
- * @returns {Object}
225
+ * Enables the controls
204
226
  */
205
227
 
206
228
 
207
- function pdfjsViewerFactory($container, config) {
208
- var template = viewerTpl(config);
209
- var events = eventifier();
210
- var controls = {};
211
- var broker = null;
212
- var findBar = null;
213
- var pdfConfig = null;
214
- var pdf = null;
215
- var PDFJS = null;
216
- var enabled = true;
229
+ function enable() {
217
230
  /**
218
- * Will update the displayed controls according to the current PDF
231
+ * Requests an enabling
232
+ * @event enable
219
233
  */
234
+ events.trigger('enable');
235
+ }
236
+ /**
237
+ * Disable the controls
238
+ */
220
239
 
221
- function updateControls() {
222
- var page = pdf.getPage();
223
- var pageCount = pdf.getPageCount();
224
-
225
- if (page !== parseInt(controls.$pageNum.val(), 10)) {
226
- controls.$pageNum.val(page);
227
- }
228
240
 
229
- toggleState(controls.$pagePrev, enabled && page > 1);
230
- toggleState(controls.$pageNext, enabled && page < pageCount);
231
- toggleState(controls.$pageNum, enabled && pageCount > 1);
232
- }
241
+ function disable() {
233
242
  /**
234
- * Enables the controls
243
+ * Requests a disabling
244
+ * @event disable
235
245
  */
246
+ events.trigger('disable');
247
+ }
248
+ /**
249
+ * Will refresh the page
250
+ */
236
251
 
237
252
 
238
- function enable() {
239
- /**
240
- * Requests an enabling
241
- * @event enable
242
- */
243
- events.trigger('enable');
244
- }
253
+ function refresh() {
245
254
  /**
246
- * Disable the controls
255
+ * Requests a page refresh
256
+ * @event refresh
247
257
  */
258
+ events.trigger('refresh');
259
+ }
260
+ /**
261
+ * Go to a particular page
262
+ * @param page
263
+ */
248
264
 
249
265
 
250
- function disable() {
251
- /**
252
- * Requests a disabling
253
- * @event disable
254
- */
255
- events.trigger('disable');
256
- }
266
+ function jumpPage(page) {
257
267
  /**
258
- * Will refresh the page
268
+ * Requests a page change
269
+ * @event setpage
270
+ * @param {Number} pageNum
259
271
  */
272
+ events.trigger('setpage', page);
273
+ }
274
+ /**
275
+ * Move the current page by step
276
+ * @param step
277
+ */
260
278
 
261
279
 
262
- function refresh() {
263
- /**
264
- * Requests a page refresh
265
- * @event refresh
266
- */
267
- events.trigger('refresh');
268
- }
269
- /**
270
- * Go to a particular page
271
- * @param page
272
- */
280
+ function movePage(step) {
281
+ jumpPage(pdf.getPage() + step);
282
+ }
273
283
 
284
+ config = config || {};
285
+ PDFJS = config.PDFJS;
286
+ pdfConfig = _.merge({
287
+ events: events
288
+ }, _.pick(config, ['PDFJS', 'fitToWidth']));
274
289
 
275
- function jumpPage(page) {
276
- /**
277
- * Requests a page change
278
- * @event setpage
279
- * @param {Number} pageNum
280
- */
281
- events.trigger('setpage', page);
282
- }
290
+ if (!_.isPlainObject(PDFJS)) {
291
+ throw new TypeError('You must provide the entry point to the PDF.js library! [config.PDFJS is missing]');
292
+ }
293
+
294
+ return {
283
295
  /**
284
- * Move the current page by step
285
- * @param step
296
+ * Loads and displays the document
297
+ * @param {String} url
298
+ * @returns {Promise}
286
299
  */
300
+ load: function load(url) {
301
+ // PDF.js installed
302
+ $container.html(template); // Disable the streaming mode: the file needs to be fully loaded before display.
303
+ // This will prevent "Bad offset" error under Chrome and IE, but will slow down the first display.
304
+ // Other approach would be to provide a range loader callback, but need a lot of work.
305
+
306
+ PDFJS.PDFJS.disableRange = true;
307
+ events.on('enable', function () {
308
+ enabled = true;
309
+ updateControls();
310
+ }).on('disable', function () {
311
+ enabled = false;
312
+ updateControls();
313
+ }).on('loaded', function () {
314
+ controls.$pageCount.html(pdf.getPageCount());
315
+ enable();
316
+ }).on('pagechange rendered', function () {
317
+ updateControls();
318
+ });
319
+ broker = areaBroker($container, {
320
+ bar: $$1('.pdf-bar', $container),
321
+ actions: $$1('.pdf-actions', $container),
322
+ info: $$1('.pdf-info', $container),
323
+ content: $$1('.pdf-container', $container)
324
+ });
325
+ controls = {
326
+ $navigation: $container.find('.navigation'),
327
+ $pagePrev: $container.find('[data-control="pdf-page-prev"]'),
328
+ $pageNext: $container.find('[data-control="pdf-page-next"]'),
329
+ $pageNum: $container.find('[data-control="pdf-page-num"]'),
330
+ $pageCount: $container.find('[data-control="pdf-page-count"]'),
331
+ $fitToWidth: $container.find('[data-control="fit-to-width"]')
332
+ };
333
+ pdf = wrapperFactory(broker.getContentArea(), pdfConfig);
334
+
335
+ if (config.allowSearch) {
336
+ findBar = findBarFactory({
337
+ events: events,
338
+ areaBroker: broker,
339
+ textManager: pdf.getTextManager(),
340
+ caseSensitive: config.caseSensitiveSearch,
341
+ highlightAll: config.highlightAllMatches
342
+ });
343
+ }
287
344
 
345
+ this.setSize($container.width(), $container.height());
346
+ controls.$fitToWidth.on('change', function () {
347
+ pdfConfig.fitToWidth = controls.$fitToWidth.is(':checked');
348
+ refresh();
349
+ });
350
+ controls.$navigation.on('click', function () {
351
+ movePage(parseInt($$1(this).data('direction'), 10) || 1);
352
+ });
353
+ controls.$pageNum.on('change', function () {
354
+ jumpPage(parseInt(controls.$pageNum.val(), 10) || pdf.getPage());
355
+ }).on('keydown', function (event) {
356
+ switch (event.keyCode) {
357
+ case 38:
358
+ movePage(1);
359
+ event.stopPropagation();
360
+ event.preventDefault();
361
+ break;
362
+
363
+ case 40:
364
+ movePage(-1);
365
+ event.stopPropagation();
366
+ event.preventDefault();
367
+ break;
368
+ }
369
+ });
370
+ disable();
371
+ return pdf.load(url);
372
+ },
288
373
 
289
- function movePage(step) {
290
- jumpPage(pdf.getPage() + step);
291
- }
292
-
293
- config = config || {};
294
- PDFJS = config.PDFJS;
295
- pdfConfig = _.merge({
296
- events: events
297
- }, _.pick(config, ['PDFJS', 'fitToWidth']));
298
-
299
- if (!_.isPlainObject(PDFJS)) {
300
- throw new TypeError('You must provide the entry point to the PDF.js library! [config.PDFJS is missing]');
301
- }
374
+ /**
375
+ * Destroys the component
376
+ */
377
+ unload: function unload() {
378
+ disable();
302
379
 
303
- return {
304
- /**
305
- * Loads and displays the document
306
- * @param {String} url
307
- * @returns {Promise}
308
- */
309
- load: function load(url) {
310
- // PDF.js installed
311
- $container.html(template); // Disable the streaming mode: the file needs to be fully loaded before display.
312
- // This will prevent "Bad offset" error under Chrome and IE, but will slow down the first display.
313
- // Other approach would be to provide a range loader callback, but need a lot of work.
314
-
315
- PDFJS.PDFJS.disableRange = true;
316
- events.on('enable', function () {
317
- enabled = true;
318
- updateControls();
319
- }).on('disable', function () {
320
- enabled = false;
321
- updateControls();
322
- }).on('loaded', function () {
323
- controls.$pageCount.html(pdf.getPageCount());
324
- enable();
325
- }).on('pagechange rendered', function () {
326
- updateControls();
327
- });
328
- broker = areaBroker($container, {
329
- bar: $$1('.pdf-bar', $container),
330
- actions: $$1('.pdf-actions', $container),
331
- info: $$1('.pdf-info', $container),
332
- content: $$1('.pdf-container', $container)
333
- });
334
- controls = {
335
- $navigation: $container.find('.navigation'),
336
- $pagePrev: $container.find('[data-control="pdf-page-prev"]'),
337
- $pageNext: $container.find('[data-control="pdf-page-next"]'),
338
- $pageNum: $container.find('[data-control="pdf-page-num"]'),
339
- $pageCount: $container.find('[data-control="pdf-page-count"]'),
340
- $fitToWidth: $container.find('[data-control="fit-to-width"]')
341
- };
342
- pdf = wrapperFactory(broker.getContentArea(), pdfConfig);
343
-
344
- if (config.allowSearch) {
345
- findBar = findBarFactory({
346
- events: events,
347
- areaBroker: broker,
348
- textManager: pdf.getTextManager(),
349
- caseSensitive: config.caseSensitiveSearch,
350
- highlightAll: config.highlightAllMatches
351
- });
352
- }
380
+ if (findBar) {
381
+ findBar.destroy();
382
+ }
353
383
 
354
- this.setSize($container.width(), $container.height());
355
- controls.$fitToWidth.on('change', function () {
356
- pdfConfig.fitToWidth = controls.$fitToWidth.is(':checked');
357
- refresh();
358
- });
359
- controls.$navigation.on('click', function () {
360
- movePage(parseInt($$1(this).data('direction'), 10) || 1);
361
- });
362
- controls.$pageNum.on('change', function () {
363
- jumpPage(parseInt(controls.$pageNum.val(), 10) || pdf.getPage());
364
- }).on('keydown', function (event) {
365
- switch (event.keyCode) {
366
- case 38:
367
- movePage(1);
368
- event.stopPropagation();
369
- event.preventDefault();
370
- break;
371
-
372
- case 40:
373
- movePage(-1);
374
- event.stopPropagation();
375
- event.preventDefault();
376
- break;
377
- }
378
- });
379
- disable();
380
- return pdf.load(url);
381
- },
382
-
383
- /**
384
- * Destroys the component
385
- */
386
- unload: function unload() {
387
- disable();
388
-
389
- if (findBar) {
390
- findBar.destroy();
391
- }
384
+ if (pdf) {
385
+ pdf.destroy();
386
+ }
392
387
 
393
- if (pdf) {
394
- pdf.destroy();
395
- }
388
+ events.removeAllListeners();
389
+ $container.empty();
390
+ controls = {};
391
+ pdfConfig = null;
392
+ pdf = null;
393
+ findBar = null;
394
+ broker = null;
395
+ },
396
396
 
397
- events.removeAllListeners();
398
- $container.empty();
399
- controls = {};
400
- pdfConfig = null;
401
- pdf = null;
402
- findBar = null;
403
- broker = null;
404
- },
405
-
406
- /**
407
- * Sets the size of the component
408
- * @param {Number} width
409
- * @param {Number} height
410
- */
411
- setSize: function setSize(width, height) {
412
- var contentHeight, $bar, $content; // only adjust the action bar width, and let the PDF viewer manage its size with the remaining space
413
-
414
- if (pdf) {
415
- $bar = broker.getBarArea();
416
- $content = broker.getContentArea();
417
- contentHeight = height - $bar.outerHeight();
418
- $bar.width(width);
419
- $content.width(width).height(contentHeight);
420
- /**
421
- * Notifies a resize
422
- * @event resized
423
- * @param {Number} width
424
- * @param {Number} height
425
- * @param {Number} contentHeight
426
- */
427
-
428
- events.trigger('resized', width, height, contentHeight); // force the repaint of the current page, the PDF wrapper will take care of its container's size
429
-
430
- return pdf.refresh();
431
- }
397
+ /**
398
+ * Sets the size of the component
399
+ * @param {Number} width
400
+ * @param {Number} height
401
+ */
402
+ setSize: function setSize(width, height) {
403
+ var contentHeight, $bar, $content; // only adjust the action bar width, and let the PDF viewer manage its size with the remaining space
404
+
405
+ if (pdf) {
406
+ $bar = broker.getBarArea();
407
+ $content = broker.getContentArea();
408
+ contentHeight = height - $bar.outerHeight();
409
+ $bar.width(width);
410
+ $content.width(width).height(contentHeight);
411
+ /**
412
+ * Notifies a resize
413
+ * @event resized
414
+ * @param {Number} width
415
+ * @param {Number} height
416
+ * @param {Number} contentHeight
417
+ */
418
+
419
+ events.trigger('resized', width, height, contentHeight); // force the repaint of the current page, the PDF wrapper will take care of its container's size
420
+
421
+ return pdf.refresh();
432
422
  }
433
- };
434
- }
423
+ }
424
+ };
425
+ }
435
426
 
436
- return pdfjsViewerFactory;
427
+ return pdfjsViewerFactory;
437
428
 
438
429
  });