From 94c3abe4436748116c347cf4ff27b142c1d9333b Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 28 Nov 2015 16:26:31 -0500 Subject: [PATCH] update script loading --- dashboard-ui/apiclient/events.js | 80 +------------------------ dashboard-ui/css/site.css | 10 ++++ dashboard-ui/css/userimage.css | 10 ---- dashboard-ui/scripts/extensions.js | 14 +---- dashboard-ui/scripts/librarybrowser.js | 26 +------- dashboard-ui/scripts/mediacontroller.js | 14 +++-- dashboard-ui/scripts/mediaplayer.js | 4 +- dashboard-ui/scripts/site.js | 65 +++++++++++++------- 8 files changed, 67 insertions(+), 156 deletions(-) delete mode 100644 dashboard-ui/css/userimage.css diff --git a/dashboard-ui/apiclient/events.js b/dashboard-ui/apiclient/events.js index 06b85f58d2..6d99c8d267 100644 --- a/dashboard-ui/apiclient/events.js +++ b/dashboard-ui/apiclient/events.js @@ -17,82 +17,4 @@ } }; -})(window); - -//(function () { - -// function useJqueryEvents(elems, eventName) { - -// eventName = eventName.type || eventName; - -// if (typeof eventName == 'string') { -// if (eventName.indexOf('page') == 0) { -// return true; -// } -// if (eventName.indexOf('loadercreate') == 0) { -// return true; -// } -// } else { -// return true; -// } - -// //console.log('bean: ' + eventName); -// return false; -// } - -// $.fn.jTrigger = $.fn.trigger; -// $.fn.jOn = $.fn.on; -// $.fn.jOff = $.fn.off; - -// $.fn.off = function (eventName, selector, fn, ex1, ex2, ex3) { - -// if (arguments.length > 3 || useJqueryEvents(this, eventName)) { -// this.jOff(eventName, selector, fn, ex1, ex2, ex3); -// return this; -// } - -// for (var i = 0, length = this.length; i < length; i++) { -// bean.off(this[i], eventName, selector, fn); -// } -// return this; -// }; - -// $.fn.on = function (eventName, selector, fn, ex1, ex2, ex3) { - -// if (arguments.length > 3 || useJqueryEvents(this, eventName)) { -// this.jOn(eventName, selector, fn, ex1, ex2, ex3); -// return this; -// } - -// for (var i = 0, length = this.length; i < length; i++) { -// bean.on(this[i], eventName, selector, fn); -// } -// return this; -// }; - -// $.fn.trigger = function (eventName, params) { - -// if (useJqueryEvents(this, eventName)) { -// this.jTrigger(eventName, params); -// return this; -// } - -// var i, length; - -// // Need to push an extra param to make the argument order consistent with jquery -// var newParams = []; -// newParams.push({}); - -// if (params && params.length) { -// for (i = 0, length = params.length; i < length; i++) { -// newParams.push(params[i]); -// } -// } - -// for (i = 0, length = this.length; i < length; i++) { -// bean.fire(this[i], eventName, newParams); -// } -// return this; -// }; - -//})(); \ No newline at end of file +})(window); \ No newline at end of file diff --git a/dashboard-ui/css/site.css b/dashboard-ui/css/site.css index 57a71d06c6..b8e9cf9c7b 100644 --- a/dashboard-ui/css/site.css +++ b/dashboard-ui/css/site.css @@ -1614,3 +1614,13 @@ progress { .scheduledTaskPaperIconItem paper-progress { display: inline-block; } + +.imageDropZone { + border: 2px dashed #bbb; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; + padding: 25px; + text-align: center; + color: #bbb; +} diff --git a/dashboard-ui/css/userimage.css b/dashboard-ui/css/userimage.css deleted file mode 100644 index aaa249816b..0000000000 --- a/dashboard-ui/css/userimage.css +++ /dev/null @@ -1,10 +0,0 @@ -/* User Image */ -.imageDropZone { - border: 2px dashed #bbb; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; - border-radius: 5px; - padding: 25px; - text-align: center; - color: #bbb; -} diff --git a/dashboard-ui/scripts/extensions.js b/dashboard-ui/scripts/extensions.js index b924cf0045..7334b17792 100644 --- a/dashboard-ui/scripts/extensions.js +++ b/dashboard-ui/scripts/extensions.js @@ -1,16 +1,4 @@ -$.fn.checked = function (value) { - if (value === true || value === false) { - // Set the value of the checkbox - return $(this).each(function () { - this.checked = value; - }); - } else { - // Return check state - return this.length && this[0].checked; - } -}; - -function getWindowLocationSearch(win) { +function getWindowLocationSearch(win) { var search = (win || window).location.search; diff --git a/dashboard-ui/scripts/librarybrowser.js b/dashboard-ui/scripts/librarybrowser.js index 6df67a1cc0..9d862d1b6c 100644 --- a/dashboard-ui/scripts/librarybrowser.js +++ b/dashboard-ui/scripts/librarybrowser.js @@ -1,4 +1,4 @@ -var LibraryBrowser = (function (window, document, $, screen) { +var LibraryBrowser = (function (window, document, screen) { // Regular Expressions for parsing tags and attributes var SURROGATE_PAIR_REGEXP = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g, @@ -2839,7 +2839,7 @@ document.body.appendChild(dlg); dlg.addEventListener('iron-overlay-closed', function () { - $(dlg).remove(); + dlg.parentNode.removeChild(dlg); }); require(['components/paperdialoghelper'], function () { @@ -3539,26 +3539,6 @@ } }, - renderBudget: function (elem, item) { - - if (item.Budget) { - - elem.show().html(Globalize.translate('ValueBudget', '$' + item.Budget)); - } else { - elem.hide(); - } - }, - - renderRevenue: function (elem, item) { - - if (item.Revenue) { - - elem.show().html(Globalize.translate('ValueRevenue', '$' + item.Revenue)); - } else { - elem.hide(); - } - }, - renderAwardSummary: function (elem, item) { if (item.AwardSummary) { elem.show().html(Globalize.translate('ValueAwards', item.AwardSummary)); @@ -3615,4 +3595,4 @@ return libraryBrowser; -})(window, document, jQuery, screen); \ No newline at end of file +})(window, document, screen); \ No newline at end of file diff --git a/dashboard-ui/scripts/mediacontroller.js b/dashboard-ui/scripts/mediacontroller.js index a2d127ee81..a942a02202 100644 --- a/dashboard-ui/scripts/mediacontroller.js +++ b/dashboard-ui/scripts/mediacontroller.js @@ -1,4 +1,4 @@ -(function ($, window) { +(function (window) { var currentDisplayInfo; function mirrorItem(info) { @@ -238,7 +238,9 @@ var keys = new bindKeys(self); - $(window).on("keydown", keys.keyBinding).on("keypress", keys.keyPrevent).on("keyup", keys.keyPrevent); + window.addEventListener('keydown', keys.keyBinding); + window.addEventListener('keypress', keys.keyPrevent); + window.addEventListener('keyup', keys.keyPrevent); self.registerPlayer = function (player) { @@ -253,11 +255,11 @@ }; function onBeforePlaybackStart(e, state) { - $(self).trigger('beforeplaybackstart', [state, this]); + Events.trigger(self, 'beforeplaybackstart', [state, this]); } function onPlaybackStop(e, state) { - $(self).trigger('playbackstop', [state, this]); + Events.trigger(self, 'playbackstop', [state, this]); } self.getPlayerInfo = function () { @@ -278,7 +280,7 @@ function triggerPlayerChange(newPlayer, newTarget) { - $(self).trigger('playerchange', [newPlayer, newTarget]); + Events.trigger(self, 'playerchange', [newPlayer, newTarget]); } self.setActivePlayer = function (player, targetInfo) { @@ -1033,4 +1035,4 @@ mirrorIfEnabled(info); }); -})(jQuery, window); \ No newline at end of file +})(this); \ No newline at end of file diff --git a/dashboard-ui/scripts/mediaplayer.js b/dashboard-ui/scripts/mediaplayer.js index cb47271af0..8587793cc8 100644 --- a/dashboard-ui/scripts/mediaplayer.js +++ b/dashboard-ui/scripts/mediaplayer.js @@ -1,4 +1,4 @@ -(function (document, setTimeout, clearTimeout, screen, $, setInterval, window) { +(function (document, setTimeout, clearTimeout, screen, setInterval, window) { function mediaPlayer() { @@ -1997,4 +1997,4 @@ window.MediaController.setActivePlayer(window.MediaPlayer, window.MediaPlayer.getTargets()[0]); -})(document, setTimeout, clearTimeout, screen, $, setInterval, window); \ No newline at end of file +})(document, setTimeout, clearTimeout, screen, setInterval, window); \ No newline at end of file diff --git a/dashboard-ui/scripts/site.js b/dashboard-ui/scripts/site.js index 34a04bf288..8b60c5d1e3 100644 --- a/dashboard-ui/scripts/site.js +++ b/dashboard-ui/scripts/site.js @@ -365,7 +365,7 @@ var Dashboard = { options.id = options.id || "notification" + new Date().getTime() + parseInt(Math.random()); - if (!$(".footer").length) { + if (!document.querySelector(".footer")) { var footerHtml = '