diff --git a/modules/system/assets/ui/js/chart.bar.js b/modules/system/assets/ui/js/chart.bar.js index b3ec2ec43..9ec2fae9a 100644 --- a/modules/system/assets/ui/js/chart.bar.js +++ b/modules/system/assets/ui/js/chart.bar.js @@ -116,7 +116,7 @@ if (!data) $this.data('oc.barChart', new BarChart(this, options)) }) - } + } $.fn.barChart.Constructor = BarChart diff --git a/modules/system/assets/ui/js/chart.line.js b/modules/system/assets/ui/js/chart.line.js index 7eb885bb7..f89b412fa 100644 --- a/modules/system/assets/ui/js/chart.line.js +++ b/modules/system/assets/ui/js/chart.line.js @@ -87,7 +87,7 @@ this.chartOptions = $.extend({}, this.chartOptions, parsedOptions) - this.options = options, + this.options = options this.$el = $(element) this.fullDataSet = [] this.resetZoomLink = $(options.resetZoomLink) diff --git a/modules/system/assets/ui/js/chart.meter.js b/modules/system/assets/ui/js/chart.meter.js index 91aa80d09..cb7816235 100644 --- a/modules/system/assets/ui/js/chart.meter.js +++ b/modules/system/assets/ui/js/chart.meter.js @@ -54,7 +54,7 @@ else data.update(option) }) - } + } $.fn.goalMeter.Constructor = GoalMeter diff --git a/modules/system/assets/ui/js/chart.pie.js b/modules/system/assets/ui/js/chart.pie.js index f795e1d52..b478cefe8 100644 --- a/modules/system/assets/ui/js/chart.pie.js +++ b/modules/system/assets/ui/js/chart.pie.js @@ -11,7 +11,7 @@ * * Dependences: * - Raphaƫl (raphael-min.js) - * - October chart utilities (october.chartutils.js) + * - October chart utilities (chart.utils.js) */ +function ($) { "use strict"; @@ -119,7 +119,7 @@ if (!data) $this.data('oc.pieChart', new PieChart(this, options)) }) - } + } $.fn.pieChart.Constructor = PieChart diff --git a/modules/system/assets/ui/js/chart.utils.js b/modules/system/assets/ui/js/chart.utils.js index fca7b357d..36d869b34 100644 --- a/modules/system/assets/ui/js/chart.utils.js +++ b/modules/system/assets/ui/js/chart.utils.js @@ -3,6 +3,7 @@ */ +function ($) { "use strict"; + var ChartUtils = function() {} ChartUtils.prototype.defaultValueColor = '#b8b8b8'; diff --git a/modules/system/assets/ui/js/checkbox.balloon.js b/modules/system/assets/ui/js/checkbox.balloon.js index 70abb314d..013802bca 100644 --- a/modules/system/assets/ui/js/checkbox.balloon.js +++ b/modules/system/assets/ui/js/checkbox.balloon.js @@ -41,7 +41,7 @@ if (!data) $this.data('oc.balloon-selector', (data = new BalloonSelector(this, options))) }) - } + } $.fn.balloonSelector.Constructor = BalloonSelector diff --git a/modules/system/assets/ui/js/checkbox.js b/modules/system/assets/ui/js/checkbox.js index b33334b81..55a82a90e 100644 --- a/modules/system/assets/ui/js/checkbox.js +++ b/modules/system/assets/ui/js/checkbox.js @@ -3,14 +3,14 @@ * */ -(function($){ +(function($) { - $(document).on('keydown', 'div.custom-checkbox', function(e){ + $(document).on('keydown', 'div.custom-checkbox', function(e) { if (e.keyCode == 32) e.preventDefault() }) - $(document).on('keyup', 'div.custom-checkbox', function(e){ + $(document).on('keyup', 'div.custom-checkbox', function(e) { if (e.keyCode == 32) { var $cb = $('input', this) diff --git a/modules/system/assets/ui/js/datepicker.js b/modules/system/assets/ui/js/datepicker.js index 2ed5f369f..179ea2f43 100644 --- a/modules/system/assets/ui/js/datepicker.js +++ b/modules/system/assets/ui/js/datepicker.js @@ -12,6 +12,7 @@ */ +function ($) { "use strict"; + var Base = $.oc.foundation.base, BaseProto = Base.prototype diff --git a/modules/system/assets/ui/js/drag.scroll.js b/modules/system/assets/ui/js/drag.scroll.js index 30852eff7..2e38d6458 100644 --- a/modules/system/assets/ui/js/drag.scroll.js +++ b/modules/system/assets/ui/js/drag.scroll.js @@ -419,7 +419,7 @@ data[option].apply(data, methodArgs) } }) - } + } $.fn.dragScroll.Constructor = DragScroll diff --git a/modules/system/assets/ui/js/drag.sort.js b/modules/system/assets/ui/js/drag.sort.js index a1c84e63b..f7a2e8175 100644 --- a/modules/system/assets/ui/js/drag.sort.js +++ b/modules/system/assets/ui/js/drag.sort.js @@ -8,6 +8,7 @@ */ +function ($) { "use strict"; + var Base = $.oc.foundation.base, BaseProto = Base.prototype @@ -204,7 +205,7 @@ if (!data) $this.data('oc.sortable', (data = new Sortable(this, options))) if (typeof option == 'string') data[option].apply(data, args) }) - } + } $.fn.sortable.Constructor = Sortable diff --git a/modules/system/assets/ui/js/drag.value.js b/modules/system/assets/ui/js/drag.value.js index ffe9ebcd3..636abf1e5 100644 --- a/modules/system/assets/ui/js/drag.value.js +++ b/modules/system/assets/ui/js/drag.value.js @@ -131,7 +131,7 @@ // IE if (document.selection) { el.focus() - sel = document.selection.createRange() + var sel = document.selection.createRange() sel.text = insertValue el.focus() } diff --git a/modules/system/assets/ui/js/filter.js b/modules/system/assets/ui/js/filter.js index 2bf876415..a7a1c8e2d 100644 --- a/modules/system/assets/ui/js/filter.js +++ b/modules/system/assets/ui/js/filter.js @@ -20,7 +20,7 @@ var FilterWidget = function (element, options) { - var $el = this.$el = $(element); + this.$el = $(element); this.options = options || {} this.scopeValues = {} @@ -427,7 +427,7 @@ }) return result ? result : this - } + } $.fn.filterWidget.Constructor = FilterWidget diff --git a/modules/system/assets/ui/js/flashmessage.js b/modules/system/assets/ui/js/flashmessage.js index 2fdcecc18..dabf1b4b5 100644 --- a/modules/system/assets/ui/js/flashmessage.js +++ b/modules/system/assets/ui/js/flashmessage.js @@ -27,7 +27,7 @@ $(document.body).append($element) - setTimeout(function(){ + setTimeout(function() { $element.addClass('in') }, 1) diff --git a/modules/system/assets/ui/js/foundation.baseclass.js b/modules/system/assets/ui/js/foundation.baseclass.js index bbdb56c3b..1de394811 100644 --- a/modules/system/assets/ui/js/foundation.baseclass.js +++ b/modules/system/assets/ui/js/foundation.baseclass.js @@ -51,8 +51,7 @@ this.proxiedMethods = {} } - Base.prototype.dispose = function() - { + Base.prototype.dispose = function() { for (var key in this.proxiedMethods) { this.proxiedMethods[key] = null } diff --git a/modules/system/assets/ui/js/foundation.controlutils.js b/modules/system/assets/ui/js/foundation.controlutils.js index d3b3ceb38..8292e76b9 100644 --- a/modules/system/assets/ui/js/foundation.controlutils.js +++ b/modules/system/assets/ui/js/foundation.controlutils.js @@ -40,7 +40,7 @@ $.oc.foundation.controlUtils = ControlUtils; $(document).on('ajaxBeforeReplace', function(ev){ - // Automatically displose controls in an element + // Automatically dispose controls in an element // before the element contents is replaced. // The ajaxBeforeReplace event is triggered in // framework.js diff --git a/modules/system/assets/ui/js/input.hotkey.js b/modules/system/assets/ui/js/input.hotkey.js index f6d6fedcc..b78d6729a 100644 --- a/modules/system/assets/ui/js/input.hotkey.js +++ b/modules/system/assets/ui/js/input.hotkey.js @@ -195,7 +195,7 @@ if (!data) $this.data('oc.hotkey', (data = new HotKey(this, options))) if (typeof option == 'string') data[option].apply(data, args) }) - } + } $.fn.hotKey.Constructor = HotKey @@ -210,7 +210,7 @@ // HOTKEY DATA-API // ============== - $(document).render(function(){ + $(document).render(function() { $('[data-hotkey]').hotKey() }) diff --git a/modules/system/assets/ui/js/input.monitor.js b/modules/system/assets/ui/js/input.monitor.js index ebbb1be50..df85ec44d 100644 --- a/modules/system/assets/ui/js/input.monitor.js +++ b/modules/system/assets/ui/js/input.monitor.js @@ -9,7 +9,7 @@ BaseProto = Base.prototype var ChangeMonitor = function (element, options) { - var $el = this.$el = $(element); + this.$el = $(element); this.paused = false this.options = options || {} @@ -135,7 +135,7 @@ if (!data) $this.data('oc.changeMonitor', (data = new ChangeMonitor(this, options))) }) - } + } $.fn.changeMonitor.Constructor = ChangeMonitor diff --git a/modules/system/assets/ui/js/input.preset.js b/modules/system/assets/ui/js/input.preset.js index 4a364d86d..1228d1467 100644 --- a/modules/system/assets/ui/js/input.preset.js +++ b/modules/system/assets/ui/js/input.preset.js @@ -305,7 +305,8 @@ // INPUT CONVERTER DATA-API // =============== - $(document).render(function(){ + $(document).render(function() { $('[data-input-preset]').inputPreset() }) + }(window.jQuery); \ No newline at end of file diff --git a/modules/system/assets/ui/js/input.trigger.js b/modules/system/assets/ui/js/input.trigger.js index 9a760e8d9..ea596be77 100644 --- a/modules/system/assets/ui/js/input.trigger.js +++ b/modules/system/assets/ui/js/input.trigger.js @@ -157,7 +157,7 @@ if (!data) $this.data('oc.triggerOn', (data = new TriggerOn(this, options))) }) - } + } $.fn.triggerOn.Constructor = TriggerOn diff --git a/modules/system/assets/ui/js/list.sortable.js b/modules/system/assets/ui/js/list.sortable.js index ed0e91865..534115f3d 100644 --- a/modules/system/assets/ui/js/list.sortable.js +++ b/modules/system/assets/ui/js/list.sortable.js @@ -41,6 +41,7 @@ */ +function ($) { "use strict"; + var Base = $.oc.foundation.base, BaseProto = Base.prototype, listSortableIdCounter = 0, @@ -94,6 +95,8 @@ } ListSortable.prototype.unregisterListHandlers = function(list) { + var $list = $(list) + $list.off('dragstart', '> li', this.proxy(this.onDragStart)) $list.off('dragover', '> li', this.proxy(this.onDragOver)) $list.off('dragenter', '> li', this.proxy(this.onDragEnter)) @@ -138,7 +141,7 @@ ListSortable.prototype.elementBelongsToManagedList = function(element) { for (var i=this.lists.length-1; i >= 0; i--) { var list = this.lists[i], - children = [].slice.call(list.children) // Converts HTMLCollection to array + children = [].slice.call(list.children); // Converts HTMLCollection to array if (children.indexOf(element) !== -1) { return true @@ -442,7 +445,7 @@ } } }) - } + } $.fn.listSortable.Constructor = ListSortable diff --git a/modules/system/assets/ui/js/loader.base.js b/modules/system/assets/ui/js/loader.base.js index b75c8f554..637361c0b 100644 --- a/modules/system/assets/ui/js/loader.base.js +++ b/modules/system/assets/ui/js/loader.base.js @@ -19,7 +19,7 @@ var LoadIndicator = function (element, options) { - var $el = this.$el = $(element) + this.$el = $(element) this.options = options || {} this.tally = 0 @@ -93,7 +93,7 @@ } } }) - } + } $.fn.loadIndicator.Constructor = LoadIndicator diff --git a/modules/system/assets/ui/js/loader.cursor.js b/modules/system/assets/ui/js/loader.cursor.js index 723adb89d..878c0ffb2 100644 --- a/modules/system/assets/ui/js/loader.cursor.js +++ b/modules/system/assets/ui/js/loader.cursor.js @@ -39,9 +39,7 @@ if (this.counter > 1) return - var self = this, - $window = $(window); - + var self = this; if (event !== undefined && event.clientY !== undefined) { self.indicator.css({ @@ -73,7 +71,7 @@ } } - $(document).ready(function(){ + $(document).ready(function() { $.oc.cursorLoadIndicator = new CursorLoadIndicator(); }) diff --git a/modules/system/assets/ui/js/popover.js b/modules/system/assets/ui/js/popover.js index ca8f6f8e2..c2954ae4e 100644 --- a/modules/system/assets/ui/js/popover.js +++ b/modules/system/assets/ui/js/popover.js @@ -386,7 +386,7 @@ data[option].apply(data, methodArgs) } }) - } + } $.fn.ocPopover.Constructor = Popover diff --git a/modules/system/assets/ui/storm-min.js b/modules/system/assets/ui/storm-min.js index 437094048..8149d8704 100644 --- a/modules/system/assets/ui/storm-min.js +++ b/modules/system/assets/ui/storm-min.js @@ -2534,8 +2534,7 @@ if($.oc.foundation===undefined) $.oc.foundation={} $.oc.foundation._proxyCounter=0 var Base=function(){this.proxiedMethods={}} -Base.prototype.dispose=function() -{for(var key in this.proxiedMethods){this.proxiedMethods[key]=null} +Base.prototype.dispose=function(){for(var key in this.proxiedMethods){this.proxiedMethods[key]=null} this.proxiedMethods=null} Base.prototype.proxy=function(method){if(method.ocProxyId===undefined){$.oc.foundation._proxyCounter++ method.ocProxyId=$.oc.foundation._proxyCounter} @@ -2868,7 +2867,7 @@ if(typeof option=='string')data[option].apply(data,args)})} $.fn.toolbar.Constructor=Toolbar $.fn.toolbar.noConflict=function(){$.fn.toolbar=old return this} -$(document).on('render',function(){$('[data-control=toolbar]').toolbar()})}(window.jQuery);+function($){"use strict";var FilterWidget=function(element,options){var $el=this.$el=$(element);this.options=options||{} +$(document).on('render',function(){$('[data-control=toolbar]').toolbar()})}(window.jQuery);+function($){"use strict";var FilterWidget=function(element,options){this.$el=$(element);this.options=options||{} this.scopeValues={} this.$activeScope=null this.activeScopeName=null @@ -3186,7 +3185,7 @@ extraOptions.closeOnSelect=false $element.on('select2:closing',function(){$('.select2-dropdown.select-no-dropdown:first .select2-results__option--highlighted').removeClass('select2-results__option--highlighted') $('.select2-dropdown.select-no-dropdown:first .select2-results__option:first').addClass('select2-results__option--highlighted')})}} $element.select2($.extend({},selectOptions,extraOptions))})}) -$(document).on('disable','select.custom-select',function(event,status){if($(this).data('select2')!=null){$(this).select2('enable',!status)}})})(jQuery);+function($){"use strict";var LoadIndicator=function(element,options){var $el=this.$el=$(element) +$(document).on('disable','select.custom-select',function(event,status){if($(this).data('select2')!=null){$(this).select2('enable',!status)}})})(jQuery);+function($){"use strict";var LoadIndicator=function(element,options){this.$el=$(element) this.options=options||{} this.tally=0 this.show()} @@ -3234,7 +3233,7 @@ return this.counter++ if(this.counter>1) return -var self=this,$window=$(window);if(event!==undefined&&event.clientY!==undefined){self.indicator.css({left:event.clientX+15,top:event.clientY+15})} +var self=this;if(event!==undefined&&event.clientY!==undefined){self.indicator.css({left:event.clientX+15,top:event.clientY+15})} this.indicator.removeClass('hide') $(window).on('mousemove.cursorLoadIndicator',function(e){self.indicator.css({left:e.clientX+15,top:e.clientY+15,})})} CursorLoadIndicator.prototype.hide=function(force){if(Modernizr.touch) @@ -3578,7 +3577,8 @@ this.defaultDataSetOptions={shadowSize:0} var parsedOptions={} try{parsedOptions=JSON.parse(JSON.stringify(eval("({"+options.chartOptions+"})")));}catch(e){throw new Error('Error parsing the data-chart-options attribute value. '+e);} this.chartOptions=$.extend({},this.chartOptions,parsedOptions) -this.options=options,this.$el=$(element) +this.options=options +this.$el=$(element) this.fullDataSet=[] this.resetZoomLink=$(options.resetZoomLink) this.$el.trigger('oc.chartLineInit',[this]) @@ -3737,7 +3737,7 @@ $.fn.rowLink.Constructor=RowLink $.fn.rowLink.noConflict=function(){$.fn.rowLink=old return this} $(document).render(function(){$('[data-control="rowlink"]').rowLink()})}(window.jQuery);+function($){"use strict";var Base=$.oc.foundation.base,BaseProto=Base.prototype -var ChangeMonitor=function(element,options){var $el=this.$el=$(element);this.paused=false +var ChangeMonitor=function(element,options){this.$el=$(element);this.paused=false this.options=options||{} $.oc.foundation.controlUtils.markDisposable(element) Base.call(this) @@ -3999,7 +3999,7 @@ $editorArea.codeEditor('getEditorObject').insert(this.textValue)} DragValue.prototype.handleClickContentEditable=function(){var sel,range,html;if(window.getSelection){sel=window.getSelection();if(sel.getRangeAt&&sel.rangeCount){range=sel.getRangeAt(0);range.deleteContents();range.insertNode(document.createTextNode(this.textValue));}} else if(document.selection&&document.selection.createRange){document.selection.createRange().text=this.textValue;}} DragValue.prototype.insertAtCaret=function(el,insertValue){if(document.selection){el.focus() -sel=document.selection.createRange() +var sel=document.selection.createRange() sel.text=insertValue el.focus()} else if(el.selectionStart||el.selectionStart=='0'){var startPos=el.selectionStart,endPos=el.selectionEnd,scrollTop=el.scrollTop @@ -6542,7 +6542,8 @@ $list.on('dragenter','> li',this.proxy(this.onDragEnter)) $list.on('dragleave','> li',this.proxy(this.onDragLeave)) $list.on('drop','> li',this.proxy(this.onDragDrop)) $list.on('dragend','> li',this.proxy(this.onDragEnd))} -ListSortable.prototype.unregisterListHandlers=function(list){$list.off('dragstart','> li',this.proxy(this.onDragStart)) +ListSortable.prototype.unregisterListHandlers=function(list){var $list=$(list) +$list.off('dragstart','> li',this.proxy(this.onDragStart)) $list.off('dragover','> li',this.proxy(this.onDragOver)) $list.off('dragenter','> li',this.proxy(this.onDragEnter)) $list.off('dragleave','> li',this.proxy(this.onDragLeave)) @@ -6559,8 +6560,7 @@ this.unregisterHandlers() this.options=null this.lists=[] BaseProto.dispose.call(this)} -ListSortable.prototype.elementBelongsToManagedList=function(element){for(var i=this.lists.length-1;i>=0;i--){var list=this.lists[i],children=[].slice.call(list.children) -if(children.indexOf(element)!==-1){return true}} +ListSortable.prototype.elementBelongsToManagedList=function(element){for(var i=this.lists.length-1;i>=0;i--){var list=this.lists[i],children=[].slice.call(list.children);if(children.indexOf(element)!==-1){return true}} return false} ListSortable.prototype.isDragStartAllowed=function(element){return true} ListSortable.prototype.elementIsPlaceholder=function(element){return element.getAttribute('class')==='list-sortable-placeholder'}