1"use strict"; 2 3(function (jQuery) { 4 jQuery.extend({ 5 htmlEncode: function (value) { 6 return value ? $('<div />').text(value).html() : ''; 7 }, 8 9 htmlDecode: function (value) { 10 return value ? $('<div />').html(value).text() : ''; 11 }, 12 13 inContainer: function ($container, element) { 14 return $container && $container.length !== 0 && ($.contains($container[0], element) || $container[0] === element); 15 }, 16 17 bindIframeLoadEvent: function (iframe, callback) { 18 $(iframe).on('load', function () { 19 // when we remove iframe from dom the request stops, but in IE load event fires 20 if (!iframe.parentNode) { 21 return; 22 } 23 // fixing Opera 10.53 24 try { 25 var contentDocument = iframe.contentDocument; 26 if (contentDocument && contentDocument.body && contentDocument.body.innerHTML == "false") { 27 // In Opera event is fired second time when body.innerHTML changed from false 28 // to server response approx. after 1 sec when we upload file with iframe 29 return; 30 } 31 } 32 catch (ex) { 33 // supress the exception; 34 } 35 callback(); 36 }); 37 } 38 39 }); 40})(jQuery); 41 42 43(function (jQuery) { 44 jQuery.fn.extend({ 45 center: function (host) { 46 47 var $host = host ? jQuery(host) : jQuery(window); 48 49 return this.each(function () { 50 var $this = jQuery(this); 51 var top = ($host.height() - $this.outerHeight(true)) / 2 + $host.scrollTop(); 52 top = top > 0 ? top : 0; 53 var left = ($host.width() - $this.outerWidth(true)) / 2 + $host.scrollLeft(); 54 left = left > 0 ? left : 0; 55 $this.css({ position: "absolute", margin: 0, top: top + "px", left: left + "px" }); 56 return $this; 57 }); 58 }, 59 60 // Parse style and remove properties with style rebuilding style. 61 // Example: jQueryElement.removeCssProperties("height", "width", "left"); 62 removeCssProperties: function () { 63 var propertyNames = arguments; 64 return this.each(function () { 65 var $this = jQuery(this); 66 jQuery.grep(propertyNames, function (propertyName) { 67 propertyName = propertyName.trim(); 68 var style = $this.attr('style'); 69 if (style) { 70 return $this.attr('style', 71 jQuery.grep($this.attr('style').split(";"), 72 function (cssPropertyName) { 73 if (cssPropertyName.toLowerCase().indexOf(propertyName.toLowerCase() + ':') < 0) { 74 return cssPropertyName; 75 } 76 return ""; 77 } 78 ).join(";")); 79 } 80 else { 81 return $this; 82 } 83 }); 84 }); 85 }, 86 87 inlineStyle: function (prop) { 88 return this.prop("style")[prop]; 89 }, 90 91 quickHighlight: function(highlightColor) { 92 var highlightBg = highlightColor || "#ffff66"; 93 this.stop(true, true); 94 var originalBg = this.css("backgroundColor"); 95 var removeCssPropertyProxy = this.inlineStyle("backgroundColor") ? undefined : $.proxy(function() { this.removeCssProperties("background-color"); }, this); 96 var proxy = $.proxy(function () { this.animate({ backgroundColor: originalBg }, { duration: 1000, easing: "easeInOutBounce", complete: removeCssPropertyProxy }); }, this); 97 return this.animate({ backgroundColor: highlightBg }, { duration: 600, easing: "easeInOutBounce", complete: proxy }); 98 } 99 100 });
101})(jQuery); 102 103 104if (typeof dnn === "undefined" || dnn === null) { dnn = {}; }; //var dnn = dnn || {}; 105 106// the semi-colon before function invocation is a safety net against concatenated 107// scripts and/or other plugins which may not be closed properly. 108(function ($, window, document, undefined) { 109 110 // undefined is used here as the undefined global variable in ECMAScript 3 is 111 // mutable (ie. it can be changed by someone else). undefined isn't really being 112 // passed in so we can ensure the value of it is truly undefined. In ES5, undefined 113 // can no longer be modified. 114 115 // window and document are passed through as local variables rather than globals 116 // as this (slightly) quickens the resolution process and can be more efficiently 117 // minified (especially when both are regularly referenced in your plugin). 118 119 var pluginName = 'prefixInput'; 120 121 // Prefixes user input with specified text 122 // Example: jQueryElement.inputPrefix("Http://"); 123 // Depends on dnn.extensions.js 124 // The actual plugin constructor 125 var PrefixInput = this.PrefixInput = function (element, options) { 126 this.element = element; 127 this.options = options; 128 129 this.$element = $(this.element); 130 131 if (this.$element.is("[type=text]")) { 132 this.init(); 133 } 134 135 }; 136 137 PrefixInput.prototype = { 138 139 constructor: PrefixInput, 140 141 init: function () { 142 // Place initialization logic here 143 // You already have access to the DOM element and the options via the instance, 144 // e.g., this.element and this.options 145 this.options = $.extend({}, PrefixInput.defaults(), this.options); 146 147 this.$this = $(this); 148 149 this.prefix = this.options.prefix; 150 151 var onKeyUpHandler = $.proxy(this._onKeyUp, this); 152 var onBlurHandler = $.proxy(this._onBlur, this); 153 var onFocusInHandler = $.proxy(this._onFocus, this); 154 var onPasteHandler = function () { setTimeout($.proxy(onKeyUpHandler, this), 0); }; 155 156 this.$element.on("keyup." + pluginName, onKeyUpHandler) 157 .on("blur." + pluginName, onBlurHandler) 158 .on("focusin." + pluginName, onFocusInHandler) 159 .on("paste." + pluginName, onPasteHandler); 160 161 }, 162 163 _onKeyUp: function (e) { 164 this._prependPrefix(); 165 }, 166 167 _onFocus: function (e) { 168 this._prependPrefix(); 169 }, 170 171 _onBlur: function (e) { 172 if (this.element.value.trim() === this.prefix) { 173 this.element.value = ""; 174 } 175 }, 176 177 _prependPrefix: function() { 178 var val = this.element.value; 179 if ((!val.ltrim().startsWith(this.prefix) && val !== "" && !this.prefix.startsWith(val)) || val === "") { 180 this.element.value = this.prefix + this.element.value; 181 } 182 } 183 184 }; 185 186 PrefixInput._defaults = { ignoreLeadingSpaces: true }; 187 188 PrefixInput.defaults = function (settings) { 189 if (typeof settings !== "undefined") { 190 $.extend(PrefixInput._defaults, settings); 191 } 192 return PrefixInput._defaults; 193 }; 194 195 $.fn[pluginName] = function (option) { 196 197 // get the arguments 198 var args = $.makeArray(arguments); 199 var params = args.slice(1); 200 201 return this.each(function () { 202 var $this = $(this); 203 var instance = $this.data(pluginName); 204 if (!instance) { 205 var options = $.extend({}, typeof option === "object" && option); 206 $this.data(pluginName, (instance = new PrefixInput(this, options))); 207 } 208 if (typeof option === "string") { 209 instance[option].apply(instance, params); 210 } 211 }); 212 213 }; 214 215}).apply(dnn, [jQuery, window, document]); 216 217 218// the semi-colon before function invocation is a safety net against concatenated 219// scripts and/or other plugins which may not be closed properly. 220(function ($, window, document, undefined) { 221 222 // undefined is used here as the undefined global variable in ECMAScript 3 is 223 // mutable (ie. it can be changed by someone else). undefined isn't really being 224 // passed in so we can ensure the value of it is truly undefined. In ES5, undefined 225 // can no longer be modified. 226 227 // window and document are passed through as local variables rather than globals 228 // as this (slightly) quickens the resolution process and can be more efficiently 229 // minified (especially when both are regularly referenced in your plugin). 230 231 var pluginName = 'resizer'; 232 233 // Prefixes user input with specified text 234 // Example: jQueryElement.inputPrefix("Http://"); 235 // Depends on dnn.extensions.js 236 // The actual plugin constructor 237 var Resizer = this.Resizer = function (element, options) { 238 this.element = element; 239 this.options = options; 240 this.init(); 241 }; 242 243 Resizer.prototype = { 244 245 constructor: Resizer, 246 247 init: function () { 248 // Place initialization logic here 249 // You already have access to the DOM element and the options via the instance, 250 // e.g., this.element and this.options 251 this.options = $.extend({}, Resizer.defaults(), this.options); 252 253 this.$element = $(this.element);
254 this.$this = $(this); 255 256 this.$container = $(this.options.container); 257 258 this.$element.on("mousedown.resizer", $.proxy(this._onMouseDown, this)); 259 this._onMouseUpHandler = $.proxy(this._onMouseUp, this); 260 261 this._minSize = this._getSize(); 262 263 this._onMouseMoveHandler = $.proxy(this._onMouseMove, this); 264 }, 265 266 _onMouseMove: function (eventObject) { 267 if (this._resizeThrottle) { 268 clearTimeout(this._resizeThrottle); 269 } 270 this._resizeThrottle = setTimeout($.proxy(this._resize, this, eventObject), 0); 271 }, 272 273 _resize: function (eventObject) { 274 var currentPosition = this._getMousePosition(eventObject); 275 var offsetX = currentPosition.x - this._initialPosition.x; 276 //offsetX = this.options.rl ? -offsetX : offsetX; 277 var offsetY = currentPosition.y - this._initialPosition.y; 278 var newSize = { width: this._initialSize.width + offsetX, height: this._initialSize.height + offsetY }; 279 this._setSize(newSize); 280 }, 281 282 _getSize: function () { 283 return { width: this.$container.width(), height: this.$container.height() }; 284 }, 285 286 _setSize: function (size) { 287 if (size.width < this._minSize.width) { 288 size.width = this._minSize.width; 289 } 290 if (size.height < this._minSize.height) { 291 size.height = this._minSize.height; 292 } 293 this.$container.css(size); 294 this.$this.trigger("resized", [size]); 295 }, 296 297 _getMousePosition: function (eventObject) { 298 return { x: eventObject.clientX, y: eventObject.clientY }; 299 }, 300 301 _onMouseUp: function (eventObject) { 302 eventObject.preventDefault(); 303 eventObject.stopPropagation(); 304 if (this._resizeThrottle) { 305 clearTimeout(this._resizeThrottle); 306 delete (this._resizeThrottle); 307 } 308 var $allElements = $('*'); 309 if ($allElements.hasClass(this.options.unselectableClass)) { 310 $allElements.removeClass(this.options.unselectableClass); 311 } 312 $(document).off('mousemove.resizer', this._onMouseMoveHandler); 313 $(document).off("mouseup.resizer", this._onMouseUpHandler); 314 //var ctx = typeof ($(document).data('events').mouseup) == "object"; 315 this.$this.trigger("completed", this); 316 }, 317 318 _onMouseDown: function (eventObject) { 319 eventObject.preventDefault(); 320 eventObject.stopPropagation(); 321 this._initialPosition = this._getMousePosition(eventObject); 322 this._initialSize = this._getSize(); 323 $('*').addClass(this.options.unselectableClass); 324 //var ctx = typeof ($(document).data('events').mouseup) == "object"; 325 $(document).on("mouseup.resizer", this._onMouseUpHandler); 326 $(document).on("mousemove.resizer", this._onMouseMoveHandler); 327 } 328 329 }; 330 331 Resizer._defaults = { unselectableClass: "dnn-unselectable" }; 332 333 Resizer.defaults = function (settings) { 334 if (typeof settings !== "undefined") { 335 $.extend(Resizer._defaults, settings); 336 } 337 return Resizer._defaults; 338 }; 339 340 $.fn[pluginName] = function (option) { 341 342 // get the arguments 343 var args = $.makeArray(arguments); 344 var params = args.slice(1); 345 346 return this.each(function () { 347 var $this = $(this); 348 var instance = $this.data(pluginName); 349 if (!instance) { 350 var options = $.extend({}, typeof option === "object" && option); 351 $this.data(pluginName, (instance = new Resizer(this, options))); 352 } 353 if (typeof option === "string") { 354 instance[option].apply(instance, params); 355 } 356 }); 357 358 }; 359 360}).apply(dnn, [jQuery, window, document]);
vendor: 2 bytes, line 361
361
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.