1/** 2 * Encapsulates methods for the application in order to 3 * avoid namespace pollution. 4 * 5 * @constructor 6 */ 7var VrApplication = function () { 8 9 this.initFileInput = function () { 10 //Bootstrap4 fileupload 11 bsCustomFileInput.init(); 12 }; 13 14 this.initSpinner = function () { 15 $(".vr-app input.spinner").inputSpinner(); 16 // Remove the class spinner when it exists 17 // Call toggle only with fields with the class spinner, so toggle can only remove the class 18 $(".vr-app input.spinner").toggleClass("spinner"); 19 }; 20 21 this.initTinyMce = function () { 22 tinymce.remove('.vr-app textarea.tinymce-enabled-opt-in:not([readonly])'); 23 tinymce.remove('.vr-app textarea.tinymce-enabled-opt-in-basic:not([readonly])'); 24 var tinyMceSettings = { 25 selector: '.vr-app textarea.tinymce-enabled-opt-in:not([readonly])', 26 content_style: 'body{font-size: 14px !important;line-height: 20px; font-family: "Helvetica Neue",Helvetica,Arial,sans-serif !important;}', 27 language_url: '/o/vr-portlet/portlet/common/tinymce/i18n/de.js', 28 plugins: [ 29 'advlist autoresize autolink lists link charmap preview', 30 'searchreplace wordcount visualblocks visualchars fullscreen', 31 'directionality paste textcolor colorpicker textpattern image' 32 ], 33 menubar: 'insert format', 34 toolbar: 'undo redo | styleselect | bold italic underline strikethrough | alignleft aligncenter alignright al
34ignjustify | bullist numlist outdent indent | link | language |', 35 content_langs: [ 36 { title: 'englisch', code: 'en' } 37 ], 38 statusbar: false, 39 autoresize_bottom_margin: 0, 40 entity_encoding: 'raw', 41 remove_script_host: false, 42 relative_urls: false, 43 setup: function (editor) { 44 editor.on('change', function () { 45 tinymce.triggerSave(); 46 }); 47 } 48 }; 49 var tinymceSettingsBasic = { 50 selector: '.vr-app textarea.tinymce-enabled-opt-in-basic:not([readonly])', 51 content_style: 'body{font-size: 14px !important;line-height: 20px; font-family: "Helvetica Neue",Helvetica,Arial,sans-serif !important;}', 52 language_url: '/o/vr-portlet/portlet/common/tinymce/i18n/de.js', 53 plugins: [ 54 'advlist autoresize autolink lists link charmap preview', 55 'searchreplace wordcount visualblocks visualchars fullscreen', 56 'directionality paste textcolor colorpicker textpattern image' 57 ], 58 menubar: '', 59 toolbar: 'undo redo | bold italic | bullist numlist | link | blockquote | superscript subscript code |', 60 statusbar: false, 61 autoresize_bottom_margin: 0, 62 entity_encoding: 'raw', 63 remove_script_host: false, 64 relative_urls: false, 65 setup: function (editor) { 66 editor.on('change', function () { 67 tinymce.triggerSave(); 68 }); 69 } 70 } 71 if ($('.vr-app textarea.tinymce-enabled-opt-in-basic:not([readonly])').length > 0) { 72 tinymce.init(tinymceSettingsBasic); 73 } 74 if ($('.vr-app textarea.tinymce-enabled-opt-in:not([readonly])').length > 0 && $('#tinyMceConfigLink').length > 0) { 75 $.ajax({ 76 method: "GET", 77 dataType: "json", 78 url: $('#tinyMceConfigLink').val(), 79 success: function (data, textStatus, jqXHR) { 80 if (data.customNewlineEnabled === true) tinyMceSettings.forced_root_block = false; 81 if (data.tableEnabled === true) { 82 tinyMceSettings.plugins = tinyMceSettings.plugins + " table"; 83 tinyMceSettings.toolbar = tinyMceSettings.toolbar + " table |"; 84 } 85 if (data.codeEnabled === true) { 86 tinyMceSettings.plugins = tinyMceSettings.plugins + " code"; 87 tinyMceSettings.toolbar = tinyMceSettings.toolbar + " code |"; 88 } 89 for (var prop in data.languages) { 90 if (Object.prototype.hasOwnProperty.call(data.languages, prop)) { 91 tinyMceSettings.content_langs.push({title: data.languages[prop], code: prop}); 92 } 93 } 94 tinymce.init(tinyMceSettings); 95 }, 96 error: function (jqXHR, textStatus, errorThrown) { 97 tinymce.init(tinyMceSettings); 98 } 99 }); 100 } 101 }; 102 103 this.initTinyMceDisabled = function () { 104 tinymce.remove('.vr-app textarea.tinymce-enabled-opt-in[readonly]'); 105 var tinyMceSettings = { 106 selector: '.vr-app textarea.tinymce-enabled-opt-in[readonly]', 107 content_style: 'body{font-size: 14px !important;line-height: 20px; font-family: "Helvetica Neue",Helvetica,Arial,sans-serif !important;}', 108 language_url: '/o/vr-portlet/portlet/common/tinymce/i18n/de.js', 109 plugins: [], 110 menubar: '', 111 toolbar: '', 112 statusbar: false, 113 autoresize_bottom_margin: 0, 114 entity_encoding: 'raw', 115 remove_script_host: false, 116 relative_urls: false, 117 readonly: 1 118 }; 119 120 tinymce.init(tinyMceSettings); 121 }; 122 123 this.preventDoubleSubmit = function () { 124 125 $(".double-submit-safe").on('submit', function(e) { 126 $(this).find(':button[type=submit]').on('click', function (e) { 127 e.preventDefault(); 128 }); 129 }); 130 }; 131 132 this.initLanguageSwitch = function () { 133 134 $("#language-select").change(function() { 135 window.location = $(this).find(":selected").val(); 136 }); 137 } 138}; 139 140$(window).on("load",function () { 141 142 /** 143 * Make application functions available under the global 144 * variable 'vrApp'. 145 * 146 * @type {VrApplication} 147 */ 148 var vrAppReady = new VrApplication(); 149 150 vrAppReady.initFileInput(); 151 vrAppReady.initSpinner(); 152 vrAppReady.initTinyMce(); 153 vrAppReady.initTinyMceDisabled(); 154 vrAppReady.preventDoubleSubmit(); 155 vrAppReady.initLanguageSwitch(); 156}); 157 158Liferay.on('endNavigate', function (event) { 159 160 /** 161 * Make application functions available under the global 162 * variable 'vrApp'. 163 * 164 * @type {VrApplication} 165 */ 166 var vrAppEndNavigate = new VrApplication(); 167 168 vrAppEndNavigate.initFileInput(); 169 vrAppEndNavigate.initSpinner(); 170 vrAppEndNavigate.initTinyMce(); 171 vrAppEndNavigate.initTinyMceDisabled(); 172 vrAppEndNavigate.preventDoubleSubmit(); 173 vrAppEndNavigate.initLanguageSwitch(); 174}); 175 176DataTable.defaults.column.orderSequence = ['asc', 'desc']; 177DataTable.ext.errMode = 'throw';
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.