diff --git a/dashboard-ui/autoorganizelog.html b/dashboard-ui/autoorganizelog.html index 3639141499..07b1246478 100644 --- a/dashboard-ui/autoorganizelog.html +++ b/dashboard-ui/autoorganizelog.html @@ -12,7 +12,6 @@
${TabActivityLog} ${TabTV} - ${TabSmartMatches}
diff --git a/dashboard-ui/autoorganizetv.html b/dashboard-ui/autoorganizetv.html index 615f5b5f53..e9d2d44d80 100644 --- a/dashboard-ui/autoorganizetv.html +++ b/dashboard-ui/autoorganizetv.html @@ -11,7 +11,6 @@
${TabActivityLog} ${TabTV} - ${TabSmartMatches}
diff --git a/dashboard-ui/channelitems.html b/dashboard-ui/channelitems.html index 4f90e05667..bb61eb997d 100644 --- a/dashboard-ui/channelitems.html +++ b/dashboard-ui/channelitems.html @@ -4,7 +4,7 @@ Emby -
+
@@ -14,29 +14,6 @@
- -
-
- - -
-

- ${HeaderFilters} -

- -
- ${OptionPlayed} - ${OptionUnplayed} - ${OptionResumable} - ${OptionFavorite} - ${OptionLikes} - ${OptionDislikes} -
- -
- -
-
diff --git a/dashboard-ui/components/fileorganizer/fileorganizer.template.html b/dashboard-ui/components/fileorganizer/fileorganizer.template.html index 5001448491..e9f6f4b436 100644 --- a/dashboard-ui/components/fileorganizer/fileorganizer.template.html +++ b/dashboard-ui/components/fileorganizer/fileorganizer.template.html @@ -22,8 +22,8 @@
${LabelEndingEpisodeNumberHelp}
-
-
+
+
${OptionRememberOrganizeCorrection}

diff --git a/dashboard-ui/components/filterdialog/filterdialog.js b/dashboard-ui/components/filterdialog/filterdialog.js new file mode 100644 index 0000000000..856afa572b --- /dev/null +++ b/dashboard-ui/components/filterdialog/filterdialog.js @@ -0,0 +1,85 @@ +define(['paperdialoghelper', 'events', 'paper-checkbox'], function (paperDialogHelper, events) { + + function updateFilterControls(context, query) { + + $('.chkStandardFilter', context).each(function () { + + var filters = "," + (query.Filters || ""); + var filterName = this.getAttribute('data-filter'); + + this.checked = filters.indexOf(',' + filterName) != -1; + + }); + } + + function triggerChange(instance) { + + events.trigger(instance, 'filterchange'); + } + + function bindEvents(instance, context, query) { + + $('.chkStandardFilter', context).on('change', function () { + + var filterName = this.getAttribute('data-filter'); + var filters = query.Filters || ""; + + filters = (',' + filters).replace(',' + filterName, '').substring(1); + + if (this.checked) { + filters = filters ? (filters + ',' + filterName) : filterName; + } + + query.StartIndex = 0; + query.Filters = filters; + triggerChange(instance); + }); + } + + return function (options) { + + var self = this; + + self.show = function () { + return new Promise(function (resolve, reject) { + + var xhr = new XMLHttpRequest(); + xhr.open('GET', 'components/filterdialog/filterdialog.template.html', true); + + xhr.onload = function (e) { + + var template = this.response; + var dlg = paperDialogHelper.createDialog({ + removeOnClose: true, + modal: false, + enableHistory: false, + entryAnimationDuration: 160, + exitAnimationDuration: 200 + }); + + dlg.classList.add('ui-body-b'); + dlg.classList.add('background-theme-b'); + + dlg.classList.add('formDialog'); + + var html = ''; + + html += Globalize.translateDocument(template); + + dlg.innerHTML = html; + document.body.appendChild(dlg); + + paperDialogHelper.open(dlg); + + dlg.addEventListener('iron-overlay-closed', resolve); + + updateFilterControls(dlg, options.query); + bindEvents(self, dlg, options.query); + } + + xhr.send(); + }); + }; + + }; +}); \ No newline at end of file diff --git a/dashboard-ui/components/filterdialog/filterdialog.template.html b/dashboard-ui/components/filterdialog/filterdialog.template.html new file mode 100644 index 0000000000..dca574fb8a --- /dev/null +++ b/dashboard-ui/components/filterdialog/filterdialog.template.html @@ -0,0 +1,14 @@ +
+

+ ${HeaderFilters} +

+ +
+ ${OptionPlayed} + ${OptionUnplayed} + ${OptionResumable} + ${OptionFavorite} + ${OptionLikes} + ${OptionDislikes} +
+
\ No newline at end of file diff --git a/dashboard-ui/gamegenres.html b/dashboard-ui/gamegenres.html index a2fd9ab122..74a0ddcf6e 100644 --- a/dashboard-ui/gamegenres.html +++ b/dashboard-ui/gamegenres.html @@ -4,7 +4,7 @@ Emby -
+
${TabSuggestions} ${TabGames} @@ -20,41 +20,6 @@
-
-
- - - -
- -
- - -
- -
-
-
- - ${HeaderFilters} - - - - - - - - - -
- -
-
-
-
diff --git a/dashboard-ui/gamestudios.html b/dashboard-ui/gamestudios.html index f25d2045a9..f018a8ffb3 100644 --- a/dashboard-ui/gamestudios.html +++ b/dashboard-ui/gamestudios.html @@ -4,7 +4,7 @@ Emby -
+
${TabSuggestions} ${TabGames} @@ -19,41 +19,6 @@
- -
-
- - - -
- -
- - -
- -
-
-
- - ${HeaderFilters} - - - - - - - - - -
- -
-
-
diff --git a/dashboard-ui/mypreferencesmenu.html b/dashboard-ui/mypreferencesmenu.html index 64fad7208c..e1e33228ee 100644 --- a/dashboard-ui/mypreferencesmenu.html +++ b/dashboard-ui/mypreferencesmenu.html @@ -61,28 +61,29 @@
- -
+
+

+

${HeaderAdmin}

diff --git a/dashboard-ui/scripts/addpluginpage.js b/dashboard-ui/scripts/addpluginpage.js index f0093d2022..d7173a0fb9 100644 --- a/dashboard-ui/scripts/addpluginpage.js +++ b/dashboard-ui/scripts/addpluginpage.js @@ -274,9 +274,9 @@ Dashboard.showLoadingMsg(); - var page = $(this).parents('#addPluginPage'); + var page = $(this).parents('#addPluginPage')[0]; - $('#btnInstall', page).buttonEnabled(false); + page.querySelector('#btnInstall').disabled = true; var name = getParameterByName('name'); var guid = getParameterByName('guid'); diff --git a/dashboard-ui/scripts/channelitems.js b/dashboard-ui/scripts/channelitems.js index a2ce4557fa..642860333c 100644 --- a/dashboard-ui/scripts/channelitems.js +++ b/dashboard-ui/scripts/channelitems.js @@ -103,11 +103,10 @@ startIndex: query.StartIndex, limit: query.Limit, totalRecordCount: result.TotalRecordCount, - viewButton: true, showLimit: false, updatePageSizeSetting: false, - viewIcon: 'filter-list', - sortButton: true + sortButton: true, + filterButton: true }); page.querySelector('.listTopPaging').innerHTML = pagingHtml; @@ -140,6 +139,10 @@ reloadItems(page); }); + $('.btnFilter', page).on('click', function () { + showFilterMenu(page); + }); + // On callback make sure to set StartIndex = 0 $('.btnSort', page).on('click', function () { showSortMenu(page); @@ -153,6 +156,22 @@ }); } + function showFilterMenu(page) { + + require(['components/filterdialog/filterdialog'], function (filterDialogFactory) { + + var filterDialog = new filterDialogFactory({ + query: getQuery() + }); + + Events.on(filterDialog, 'filterchange', function () { + reloadItems(page); + }); + + filterDialog.show(); + }); + } + function showSortMenu(page) { var sortFields = getPageData().sortFields; @@ -213,15 +232,6 @@ function updateFilterControls(page) { var query = getQuery(); - $('.chkStandardFilter', page).each(function () { - - var filters = "," + (query.Filters || ""); - var filterName = this.getAttribute('data-filter'); - - this.checked = filters.indexOf(',' + filterName) != -1; - - }); - $('.alphabetPicker', page).alphaValue(query.NameStartsWith); } @@ -229,24 +239,6 @@ var page = this; - $('.chkStandardFilter', this).on('change', function () { - - var query = getQuery(); - var filterName = this.getAttribute('data-filter'); - var filters = query.Filters || ""; - - filters = (',' + filters).replace(',' + filterName, '').substring(1); - - if (this.checked) { - filters = filters ? (filters + ',' + filterName) : filterName; - } - - query.StartIndex = 0; - query.Filters = filters; - - reloadItems(page); - }); - $('.alphabetPicker', this).on('alphaselect', function (e, character) { var query = getQuery(); diff --git a/dashboard-ui/scripts/gamegenrepage.js b/dashboard-ui/scripts/gamegenrepage.js index 5b33d40b91..9c4f4b1fc1 100644 --- a/dashboard-ui/scripts/gamegenrepage.js +++ b/dashboard-ui/scripts/gamegenrepage.js @@ -30,12 +30,9 @@ startIndex: query.StartIndex, limit: query.Limit, totalRecordCount: result.TotalRecordCount, - viewButton: true, showLimit: false })); - updateFilterControls(page); - html = LibraryBrowser.getPosterViewHtml({ items: result.Items, shape: "backdrop", @@ -66,39 +63,7 @@ }); } - function updateFilterControls(page) { - - $('#selectPageSize', page).val(query.Limit); - } - - $(document).on('pageinit', "#gameGenresPage", function () { - - var page = this; - - $('.chkStandardFilter', this).on('change', function () { - - var filterName = this.getAttribute('data-filter'); - var filters = query.Filters || ""; - - filters = (',' + filters).replace(',' + filterName, '').substring(1); - - if (this.checked) { - filters = filters ? (filters + ',' + filterName) : filterName; - } - - query.StartIndex = 0; - query.Filters = filters; - - reloadItems(page); - }); - - $('#selectPageSize', page).on('change', function () { - query.Limit = parseInt(this.value); - query.StartIndex = 0; - reloadItems(page); - }); - - }).on('pagebeforeshow', "#gameGenresPage", function () { + $(document).on('pagebeforeshow', "#gameGenresPage", function () { query.ParentId = LibraryMenu.getTopParentId(); @@ -113,8 +78,6 @@ LibraryBrowser.loadSavedQueryValues(getSavedQueryKey(), query); reloadItems(this); - - updateFilterControls(this); }); })(jQuery, document); \ No newline at end of file diff --git a/dashboard-ui/scripts/gamestudiospage.js b/dashboard-ui/scripts/gamestudiospage.js index f297413c97..779d5092ac 100644 --- a/dashboard-ui/scripts/gamestudiospage.js +++ b/dashboard-ui/scripts/gamestudiospage.js @@ -31,12 +31,9 @@ startIndex: query.StartIndex, limit: query.Limit, totalRecordCount: result.TotalRecordCount, - viewButton: true, showLimit: false })); - updateFilterControls(page); - html = LibraryBrowser.getPosterViewHtml({ items: result.Items, shape: "backdrop", @@ -45,7 +42,6 @@ showItemCounts: true, centerText: true, lazy: true - }); var elem = page.querySelector('#items'); @@ -68,39 +64,7 @@ }); } - function updateFilterControls(page) { - - $('#selectPageSize', page).val(query.Limit); - } - - $(document).on('pageinit', "#gameStudiosPage", function () { - - var page = this; - - $('.chkStandardFilter', this).on('change', function () { - - var filterName = this.getAttribute('data-filter'); - var filters = query.Filters || ""; - - filters = (',' + filters).replace(',' + filterName, '').substring(1); - - if (this.checked) { - filters = filters ? (filters + ',' + filterName) : filterName; - } - - query.StartIndex = 0; - query.Filters = filters; - - reloadItems(page); - }); - - $('#selectPageSize', page).on('change', function () { - query.Limit = parseInt(this.value); - query.StartIndex = 0; - reloadItems(page); - }); - - }).on('pagebeforeshow', "#gameStudiosPage", function () { + $(document).on('pagebeforeshow', "#gameStudiosPage", function () { query.ParentId = LibraryMenu.getTopParentId(); @@ -115,8 +79,6 @@ LibraryBrowser.loadSavedQueryValues(getSavedQueryKey(), query); reloadItems(this); - - updateFilterControls(this); }); })(jQuery, document); \ No newline at end of file diff --git a/dashboard-ui/scripts/librarybrowser.js b/dashboard-ui/scripts/librarybrowser.js index 43d3c0d352..4f439e6855 100644 --- a/dashboard-ui/scripts/librarybrowser.js +++ b/dashboard-ui/scripts/librarybrowser.js @@ -2821,7 +2821,7 @@ html += ''; } - if (showControls || options.viewButton || options.sortButton || options.addLayoutButton) { + if (showControls || options.viewButton || options.filterButton || options.sortButton || options.addLayoutButton) { html += '
'; @@ -2849,6 +2849,11 @@ html += ''; } + if (options.filterButton) { + + html += ''; + } + html += '
'; if (showControls && options.showLimit) { diff --git a/dashboard-ui/scripts/mediaplayer.js b/dashboard-ui/scripts/mediaplayer.js index 8078b4dd6d..05902d0e16 100644 --- a/dashboard-ui/scripts/mediaplayer.js +++ b/dashboard-ui/scripts/mediaplayer.js @@ -652,143 +652,142 @@ self.createStreamInfo = function (type, item, mediaSource, startPosition) { - var deferred = $.Deferred(); + return new Promise(function (resolve, reject) { - var mediaUrl; - var contentType; - var startTimeTicksOffset = 0; + var mediaUrl; + var contentType; + var startTimeTicksOffset = 0; - var startPositionInSeekParam = startPosition ? (startPosition / 10000000) : 0; - var seekParam = startPositionInSeekParam ? '#t=' + startPositionInSeekParam : ''; - var playMethod = 'Transcode'; + var startPositionInSeekParam = startPosition ? (startPosition / 10000000) : 0; + var seekParam = startPositionInSeekParam ? '#t=' + startPositionInSeekParam : ''; + var playMethod = 'Transcode'; - if (type == 'Video') { + if (type == 'Video') { - contentType = 'video/' + mediaSource.Container; + contentType = 'video/' + mediaSource.Container; - if (mediaSource.enableDirectPlay) { - mediaUrl = mediaSource.Path; + if (mediaSource.enableDirectPlay) { + mediaUrl = mediaSource.Path; - playMethod = 'DirectPlay'; + playMethod = 'DirectPlay'; - } else { + } else { - if (mediaSource.SupportsDirectStream) { + if (mediaSource.SupportsDirectStream) { - var directOptions = { - Static: true, - mediaSourceId: mediaSource.Id, - deviceId: ApiClient.deviceId(), - api_key: ApiClient.accessToken() - }; + var directOptions = { + Static: true, + mediaSourceId: mediaSource.Id, + deviceId: ApiClient.deviceId(), + api_key: ApiClient.accessToken() + }; - if (mediaSource.LiveStreamId) { - directOptions.LiveStreamId = mediaSource.LiveStreamId; - } - - mediaUrl = ApiClient.getUrl('Videos/' + item.Id + '/stream.' + mediaSource.Container, directOptions); - mediaUrl += seekParam; - - playMethod = 'DirectStream'; - } else if (mediaSource.SupportsTranscoding) { - - mediaUrl = ApiClient.getUrl(mediaSource.TranscodingUrl); - - if (mediaSource.TranscodingSubProtocol == 'hls') { - - mediaUrl += seekParam; - contentType = 'application/x-mpegURL'; - - } else { - - // Reports of stuttering with h264 stream copy in IE - if (mediaUrl.indexOf('.mkv') == -1) { - mediaUrl += '&EnableAutoStreamCopy=false'; + if (mediaSource.LiveStreamId) { + directOptions.LiveStreamId = mediaSource.LiveStreamId; } - startTimeTicksOffset = startPosition || 0; - contentType = 'video/' + mediaSource.TranscodingContainer; + mediaUrl = ApiClient.getUrl('Videos/' + item.Id + '/stream.' + mediaSource.Container, directOptions); + mediaUrl += seekParam; + + playMethod = 'DirectStream'; + } else if (mediaSource.SupportsTranscoding) { + + mediaUrl = ApiClient.getUrl(mediaSource.TranscodingUrl); + + if (mediaSource.TranscodingSubProtocol == 'hls') { + + mediaUrl += seekParam; + contentType = 'application/x-mpegURL'; + + } else { + + // Reports of stuttering with h264 stream copy in IE + if (mediaUrl.indexOf('.mkv') == -1) { + mediaUrl += '&EnableAutoStreamCopy=false'; + } + startTimeTicksOffset = startPosition || 0; + + contentType = 'video/' + mediaSource.TranscodingContainer; + } } } - } - - } else { - - contentType = 'audio/' + mediaSource.Container; - - if (mediaSource.enableDirectPlay) { - - mediaUrl = mediaSource.Path; - - playMethod = 'DirectPlay'; } else { - var isDirectStream = mediaSource.SupportsDirectStream; + contentType = 'audio/' + mediaSource.Container; - if (isDirectStream) { + if (mediaSource.enableDirectPlay) { - var outputContainer = (mediaSource.Container || '').toLowerCase(); + mediaUrl = mediaSource.Path; - var directOptions = { - Static: true, - mediaSourceId: mediaSource.Id, - deviceId: ApiClient.deviceId(), - api_key: ApiClient.accessToken() - }; + playMethod = 'DirectPlay'; - if (mediaSource.LiveStreamId) { - directOptions.LiveStreamId = mediaSource.LiveStreamId; - } + } else { - mediaUrl = ApiClient.getUrl('Audio/' + item.Id + '/stream.' + outputContainer, directOptions); - mediaUrl += seekParam; + var isDirectStream = mediaSource.SupportsDirectStream; - playMethod = 'DirectStream'; + if (isDirectStream) { - } else if (mediaSource.SupportsTranscoding) { + var outputContainer = (mediaSource.Container || '').toLowerCase(); - mediaUrl = ApiClient.getUrl(mediaSource.TranscodingUrl); + var directOptions = { + Static: true, + mediaSourceId: mediaSource.Id, + deviceId: ApiClient.deviceId(), + api_key: ApiClient.accessToken() + }; - if (mediaSource.TranscodingSubProtocol == 'hls') { + if (mediaSource.LiveStreamId) { + directOptions.LiveStreamId = mediaSource.LiveStreamId; + } + mediaUrl = ApiClient.getUrl('Audio/' + item.Id + '/stream.' + outputContainer, directOptions); mediaUrl += seekParam; - contentType = 'application/x-mpegURL'; - } else { - startTimeTicksOffset = startPosition || 0; - contentType = 'audio/' + mediaSource.TranscodingContainer; + playMethod = 'DirectStream'; + + } else if (mediaSource.SupportsTranscoding) { + + mediaUrl = ApiClient.getUrl(mediaSource.TranscodingUrl); + + if (mediaSource.TranscodingSubProtocol == 'hls') { + + mediaUrl += seekParam; + contentType = 'application/x-mpegURL'; + } else { + + startTimeTicksOffset = startPosition || 0; + contentType = 'audio/' + mediaSource.TranscodingContainer; + } } } } - } - var resultInfo = { - url: mediaUrl, - mimeType: contentType, - startTimeTicksOffset: startTimeTicksOffset, - startPositionInSeekParam: startPositionInSeekParam, - playMethod: playMethod - }; + var resultInfo = { + url: mediaUrl, + mimeType: contentType, + startTimeTicksOffset: startTimeTicksOffset, + startPositionInSeekParam: startPositionInSeekParam, + playMethod: playMethod + }; - if (playMethod == 'DirectPlay' && mediaSource.Protocol == 'File') { + if (playMethod == 'DirectPlay' && mediaSource.Protocol == 'File') { - require(['localassetmanager'], function () { + require(['localassetmanager'], function () { - LocalAssetManager.translateFilePath(resultInfo.url).then(function (path) { + LocalAssetManager.translateFilePath(resultInfo.url).then(function (path) { - resultInfo.url = path; - console.log('LocalAssetManager.translateFilePath: path: ' + resultInfo.url + ' result: ' + path); - deferred.resolveWith(null, [resultInfo]); + resultInfo.url = path; + console.log('LocalAssetManager.translateFilePath: path: ' + resultInfo.url + ' result: ' + path); + resolve(resultInfo); + }); }); - }); - } - else { - deferred.resolveWith(null, [resultInfo]); - } - - return deferred.promise(); + } + else { + resolve(resultInfo); + } + }); }; self.lastBitrateDetections = {}; diff --git a/dashboard-ui/scripts/mypreferencescommon.js b/dashboard-ui/scripts/mypreferencescommon.js index e353217527..a53361bd62 100644 --- a/dashboard-ui/scripts/mypreferencescommon.js +++ b/dashboard-ui/scripts/mypreferencescommon.js @@ -38,10 +38,10 @@ pageIdOn('pageshow', 'myPreferencesMenuPage', function () { } }); - if (AppInfo.isNativeApp && browserInfo.safari) { - page.querySelector('.userSection').classList.remove('hide'); + if (Dashboard.isConnectMode()) { + page.querySelector('.selectServer').classList.remove('hide'); } else { - page.querySelector('.userSection').classList.add('hide'); + page.querySelector('.selectServer').classList.add('hide'); } }); \ No newline at end of file diff --git a/dashboard-ui/scripts/site.js b/dashboard-ui/scripts/site.js index d85bbed325..0bd9e1235e 100644 --- a/dashboard-ui/scripts/site.js +++ b/dashboard-ui/scripts/site.js @@ -704,36 +704,7 @@ var Dashboard = { showUserFlyout: function () { - require(['jqmpanel'], function () { - var html = '
'; - - html += '

'; - - html += '

'; - - html += '
'; - - html += '

'; - - html += '

'; - - html += '
'; - html += '
'; - - $(document.body).append(html); - - var userFlyout = document.querySelector('#userFlyout'); - ImageLoader.lazyChildren(userFlyout); - - $(userFlyout).panel({}).panel("open").on("panelclose", function () { - - $(this).off("panelclose").remove(); - }); - - ConnectionManager.user(window.ApiClient).then(function (user) { - Dashboard.updateUserFlyout(userFlyout, user); - }); - }); + Dashboard.navigate('mypreferencesmenu.html?userId=' + ApiClient.getCurrentUserId()); }, updateUserFlyout: function (elem, user) { @@ -1971,6 +1942,7 @@ var AppInfo = {}; define("jstree", [bowerPath + "/jstree/dist/jstree.min", "css!thirdparty/jstree/themes/default/style.min.css"]); + define('jqm', ['thirdparty/jquerymobile-1.4.5/jquery.mobile.custom.js']); define("jqmbase", ['css!thirdparty/jquerymobile-1.4.5/jquery.mobile.custom.theme.css']); define("jqmicons", ['jqmbase', 'css!thirdparty/jquerymobile-1.4.5/jquery.mobile.custom.icons.css']); define("jqmtable", ['jqmbase', "thirdparty/jquerymobile-1.4.5/jqm.table", 'css!thirdparty/jquerymobile-1.4.5/jqm.table.css']); @@ -2141,8 +2113,6 @@ var AppInfo = {}; deps.push('scripts/mediacontroller'); deps.push('scripts/globalize'); - deps.push('jQuery'); - deps.push('paper-drawer-panel'); require(deps, function (events) { @@ -2196,26 +2166,14 @@ var AppInfo = {}; MediaBrowser[i] = connectionManagerExports[i]; } - // TODO: This needs to be deprecated, but it's used heavily - $.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; - } - }; - var promises = []; deps = []; deps.push('scripts/mediaplayer'); deps.push('emby-icons'); deps.push('paper-icon-button'); deps.push('paper-button'); - deps.push('thirdparty/jquerymobile-1.4.5/jquery.mobile.custom.js'); + deps.push('jQuery'); + promises.push(getRequirePromise(deps)); promises.push(Globalize.ensure()); @@ -2255,6 +2213,19 @@ var AppInfo = {}; require(depends, function () { + // TODO: This needs to be deprecated, but it's used heavily + $.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; + } + }; + // Don't like having to use jQuery here, but it takes care of making sure that embedded script executes $(mainDrawerPanelContent).html(Globalize.translateDocument(newHtml, 'html')); onAppReady(); @@ -2316,6 +2287,7 @@ var AppInfo = {}; deps.push('scripts/backdrops'); deps.push('scripts/librarymenu'); deps.push('scripts/librarybrowser'); + deps.push('jqm'); deps.push('css!css/card.css'); diff --git a/dashboard-ui/thirdparty/jquerymobile-1.4.5/jqm.slider.js b/dashboard-ui/thirdparty/jquerymobile-1.4.5/jqm.slider.js index 31026b9c88..a1bb63ba33 100644 --- a/dashboard-ui/thirdparty/jquerymobile-1.4.5/jqm.slider.js +++ b/dashboard-ui/thirdparty/jquerymobile-1.4.5/jqm.slider.js @@ -1,528 +1,5 @@ -(function () { +define(['jqmwidget'], function () { - if (jQuery.widget) { - return; - } - - /*! - * jQuery UI Widget c0ab71056b936627e8a7821f03c044aec6280a40 - * http://jqueryui.com - * - * Copyright 2013 jQuery Foundation and other contributors - * Released under the MIT license. - * http://jquery.org/license - * - * http://api.jqueryui.com/jQuery.widget/ - */ - (function ($, undefined) { - - var uuid = 0, - slice = Array.prototype.slice, - _cleanData = $.cleanData; - $.cleanData = function (elems) { - for (var i = 0, elem; (elem = elems[i]) != null; i++) { - try { - $(elem).triggerHandler("remove"); - // http://bugs.jquery.com/ticket/8235 - } catch (e) { } - } - _cleanData(elems); - }; - - $.widget = function (name, base, prototype) { - var fullName, existingConstructor, constructor, basePrototype, - // proxiedPrototype allows the provided prototype to remain unmodified - // so that it can be used as a mixin for multiple widgets (#8876) - proxiedPrototype = {}, - namespace = name.split(".")[0]; - - name = name.split(".")[1]; - fullName = namespace + "-" + name; - - if (!prototype) { - prototype = base; - base = $.Widget; - } - - // create selector for plugin - $.expr[":"][fullName.toLowerCase()] = function (elem) { - return !!$.data(elem, fullName); - }; - - $[namespace] = $[namespace] || {}; - existingConstructor = $[namespace][name]; - constructor = $[namespace][name] = function (options, element) { - // allow instantiation without "new" keyword - if (!this._createWidget) { - return new constructor(options, element); - } - - // allow instantiation without initializing for simple inheritance - // must use "new" keyword (the code above always passes args) - if (arguments.length) { - this._createWidget(options, element); - } - }; - // extend with the existing constructor to carry over any static properties - $.extend(constructor, existingConstructor, { - version: prototype.version, - // copy the object used to create the prototype in case we need to - // redefine the widget later - _proto: $.extend({}, prototype), - // track widgets that inherit from this widget in case this widget is - // redefined after a widget inherits from it - _childConstructors: [] - }); - - basePrototype = new base(); - // we need to make the options hash a property directly on the new instance - // otherwise we'll modify the options hash on the prototype that we're - // inheriting from - basePrototype.options = $.widget.extend({}, basePrototype.options); - $.each(prototype, function (prop, value) { - if (!$.isFunction(value)) { - proxiedPrototype[prop] = value; - return; - } - proxiedPrototype[prop] = (function () { - var _super = function () { - return base.prototype[prop].apply(this, arguments); - }, - _superApply = function (args) { - return base.prototype[prop].apply(this, args); - }; - return function () { - var __super = this._super, - __superApply = this._superApply, - returnValue; - - this._super = _super; - this._superApply = _superApply; - - returnValue = value.apply(this, arguments); - - this._super = __super; - this._superApply = __superApply; - - return returnValue; - }; - })(); - }); - constructor.prototype = $.widget.extend(basePrototype, { - // TODO: remove support for widgetEventPrefix - // always use the name + a colon as the prefix, e.g., draggable:start - // don't prefix for widgets that aren't DOM-based - widgetEventPrefix: existingConstructor ? (basePrototype.widgetEventPrefix || name) : name - }, proxiedPrototype, { - constructor: constructor, - namespace: namespace, - widgetName: name, - widgetFullName: fullName - }); - - // If this widget is being redefined then we need to find all widgets that - // are inheriting from it and redefine all of them so that they inherit from - // the new version of this widget. We're essentially trying to replace one - // level in the prototype chain. - if (existingConstructor) { - $.each(existingConstructor._childConstructors, function (i, child) { - var childPrototype = child.prototype; - - // redefine the child widget using the same prototype that was - // originally used, but inherit from the new version of the base - $.widget(childPrototype.namespace + "." + childPrototype.widgetName, constructor, child._proto); - }); - // remove the list of existing child constructors from the old constructor - // so the old child constructors can be garbage collected - delete existingConstructor._childConstructors; - } else { - base._childConstructors.push(constructor); - } - - $.widget.bridge(name, constructor); - - return constructor; - }; - - $.widget.extend = function (target) { - var input = slice.call(arguments, 1), - inputIndex = 0, - inputLength = input.length, - key, - value; - for (; inputIndex < inputLength; inputIndex++) { - for (key in input[inputIndex]) { - value = input[inputIndex][key]; - if (input[inputIndex].hasOwnProperty(key) && value !== undefined) { - // Clone objects - if ($.isPlainObject(value)) { - target[key] = $.isPlainObject(target[key]) ? - $.widget.extend({}, target[key], value) : - // Don't extend strings, arrays, etc. with objects - $.widget.extend({}, value); - // Copy everything else by reference - } else { - target[key] = value; - } - } - } - } - return target; - }; - - $.widget.bridge = function (name, object) { - - var fullName = object.prototype.widgetFullName || name; - $.fn[name] = function (options) { - var isMethodCall = typeof options === "string", - args = slice.call(arguments, 1), - returnValue = this; - - // allow multiple hashes to be passed on init - options = !isMethodCall && args.length ? - $.widget.extend.apply(null, [options].concat(args)) : - options; - - if (isMethodCall) { - this.each(function () { - var methodValue, - instance = $.data(this, fullName); - if (options === "instance") { - returnValue = instance; - return false; - } - if (!instance) { - return $.error("cannot call methods on " + name + " prior to initialization; " + - "attempted to call method '" + options + "'"); - } - if (!$.isFunction(instance[options]) || options.charAt(0) === "_") { - return $.error("no such method '" + options + "' for " + name + " widget instance"); - } - methodValue = instance[options].apply(instance, args); - if (methodValue !== instance && methodValue !== undefined) { - returnValue = methodValue && methodValue.jquery ? - returnValue.pushStack(methodValue.get()) : - methodValue; - return false; - } - }); - } else { - this.each(function () { - var instance = $.data(this, fullName); - if (instance) { - instance.option(options || {})._init(); - } else { - $.data(this, fullName, new object(options, this)); - } - }); - } - - return returnValue; - }; - }; - - $.Widget = function ( /* options, element */) { }; - $.Widget._childConstructors = []; - - $.Widget.prototype = { - widgetName: "widget", - widgetEventPrefix: "", - defaultElement: "
", - options: { - disabled: false, - - // callbacks - create: null - }, - _createWidget: function (options, element) { - element = $(element || this.defaultElement || this)[0]; - this.element = $(element); - this.uuid = uuid++; - this.eventNamespace = "." + this.widgetName + this.uuid; - this.options = $.widget.extend({}, - this.options, - this._getCreateOptions(), - options); - - this.bindings = $(); - this.hoverable = $(); - this.focusable = $(); - - if (element !== this) { - $.data(element, this.widgetFullName, this); - this._on(true, this.element, { - remove: function (event) { - if (event.target === element) { - this.destroy(); - } - } - }); - this.document = $(element.style ? - // element within the document - element.ownerDocument : - // element is window or document - element.document || element); - this.window = $(this.document[0].defaultView || this.document[0].parentWindow); - } - - this._create(); - this._trigger("create", null, this._getCreateEventData()); - this._init(); - }, - _getCreateOptions: $.noop, - _getCreateEventData: $.noop, - _create: $.noop, - _init: $.noop, - - destroy: function () { - this._destroy(); - // we can probably remove the unbind calls in 2.0 - // all event bindings should go through this._on() - this.element - .unbind(this.eventNamespace) - .removeData(this.widgetFullName) - // support: jquery <1.6.3 - // http://bugs.jquery.com/ticket/9413 - .removeData($.camelCase(this.widgetFullName)); - this.widget() - .unbind(this.eventNamespace) - .removeAttr("aria-disabled") - .removeClass( - this.widgetFullName + "-disabled " + - "ui-state-disabled"); - - // clean up events and states - this.bindings.unbind(this.eventNamespace); - this.hoverable.removeClass("ui-state-hover"); - this.focusable.removeClass("ui-state-focus"); - }, - _destroy: $.noop, - - widget: function () { - return this.element; - }, - - option: function (key, value) { - var options = key, - parts, - curOption, - i; - - if (arguments.length === 0) { - // don't return a reference to the internal hash - return $.widget.extend({}, this.options); - } - - if (typeof key === "string") { - // handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } } - options = {}; - parts = key.split("."); - key = parts.shift(); - if (parts.length) { - curOption = options[key] = $.widget.extend({}, this.options[key]); - for (i = 0; i < parts.length - 1; i++) { - curOption[parts[i]] = curOption[parts[i]] || {}; - curOption = curOption[parts[i]]; - } - key = parts.pop(); - if (value === undefined) { - return curOption[key] === undefined ? null : curOption[key]; - } - curOption[key] = value; - } else { - if (value === undefined) { - return this.options[key] === undefined ? null : this.options[key]; - } - options[key] = value; - } - } - - this._setOptions(options); - - return this; - }, - _setOptions: function (options) { - var key; - - for (key in options) { - this._setOption(key, options[key]); - } - - return this; - }, - _setOption: function (key, value) { - this.options[key] = value; - - if (key === "disabled") { - this.widget() - .toggleClass(this.widgetFullName + "-disabled", !!value); - this.hoverable.removeClass("ui-state-hover"); - this.focusable.removeClass("ui-state-focus"); - } - - return this; - }, - - enable: function () { - return this._setOptions({ disabled: false }); - }, - disable: function () { - return this._setOptions({ disabled: true }); - }, - - _on: function (suppressDisabledCheck, element, handlers) { - var delegateElement, - instance = this; - - // no suppressDisabledCheck flag, shuffle arguments - if (typeof suppressDisabledCheck !== "boolean") { - handlers = element; - element = suppressDisabledCheck; - suppressDisabledCheck = false; - } - - // no element argument, shuffle and use this.element - if (!handlers) { - handlers = element; - element = this.element; - delegateElement = this.widget(); - } else { - // accept selectors, DOM elements - element = delegateElement = $(element); - this.bindings = this.bindings.add(element); - } - - $.each(handlers, function (event, handler) { - function handlerProxy() { - // allow widgets to customize the disabled handling - // - disabled as an array instead of boolean - // - disabled class as method for disabling individual parts - if (!suppressDisabledCheck && - (instance.options.disabled === true || - $(this).hasClass("ui-state-disabled"))) { - return; - } - return (typeof handler === "string" ? instance[handler] : handler) - .apply(instance, arguments); - } - - // copy the guid so direct unbinding works - if (typeof handler !== "string") { - handlerProxy.guid = handler.guid = - handler.guid || handlerProxy.guid || $.guid++; - } - - var match = event.match(/^(\w+)\s*(.*)$/), - eventName = match[1] + instance.eventNamespace, - selector = match[2]; - if (selector) { - delegateElement.delegate(selector, eventName, handlerProxy); - } else { - element.bind(eventName, handlerProxy); - } - }); - }, - - _off: function (element, eventName) { - eventName = (eventName || "").split(" ").join(this.eventNamespace + " ") + this.eventNamespace; - element.unbind(eventName).undelegate(eventName); - }, - - _trigger: function (type, event, data) { - var prop, orig, - callback = this.options[type]; - - data = data || {}; - event = $.Event(event); - event.type = (type === this.widgetEventPrefix ? - type : - this.widgetEventPrefix + type).toLowerCase(); - // the original event may come from any element - // so we need to reset the target on the new event - event.target = this.element[0]; - - // copy original event properties over to the new event - orig = event.originalEvent; - if (orig) { - for (prop in orig) { - if (!(prop in event)) { - event[prop] = orig[prop]; - } - } - } - - this.element[0].dispatchEvent(new CustomEvent(event.type, { - bubbles: true, - detail: { - data: data, - originalEvent: event - } - })); - - //this.element.trigger(event, data); - return !($.isFunction(callback) && - callback.apply(this.element[0], [event].concat(data)) === false || - event.isDefaultPrevented()); - } - }; - - })(jQuery); - - (function ($, undefined) { - - $.extend($.Widget.prototype, { - _getCreateOptions: function () { - - var option, value, - elem = this.element[0], - options = {}; - - // - if (!this.element.data("defaults")) { - for (option in this.options) { - - value = this.element.data(option); - - if (value != null) { - options[option] = value; - } - } - } - - return options; - } - }); - - })(jQuery); - - (function ($, undefined) { - - - var originalWidget = $.widget - - $.widget = (function (orig) { - return function () { - var constructor = orig.apply(this, arguments), - name = constructor.prototype.widgetName; - - constructor.initSelector = ((constructor.prototype.initSelector !== undefined) ? - constructor.prototype.initSelector : "*[data-role='" + name + "']:not([data-role='none'])"); - - $.mobile.widgets[name] = constructor; - - return constructor; - }; - })($.widget); - - // Make sure $.widget still has bridge and extend methods - $.extend($.widget, originalWidget); - - })(jQuery); - - -})(); - -(function ($, window, undefined) { var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/; $.extend($.mobile, { @@ -557,10 +34,6 @@ }); -})(jQuery, this); - -(function ($, undefined) { - /*! * jQuery UI Core c0ab71056b936627e8a7821f03c044aec6280a40 * http://jqueryui.com @@ -1181,9 +654,6 @@ }, $.mobile.behaviors.formReset)); -})(jQuery); - -(function ($, undefined) { $.widget("mobile.rangeslider", $.extend({ options: { @@ -1441,11 +911,6 @@ }, $.mobile.behaviors.formReset)); -})(jQuery); - - -(function ($, undefined) { - var popup; function getPopup() { @@ -1559,4 +1024,4 @@ } }); -})(jQuery); +}); \ No newline at end of file diff --git a/dashboard-ui/thirdparty/jquerymobile-1.4.5/jqm.table.js b/dashboard-ui/thirdparty/jquerymobile-1.4.5/jqm.table.js index 04ec23fdb1..db3c6f9111 100644 --- a/dashboard-ui/thirdparty/jquerymobile-1.4.5/jqm.table.js +++ b/dashboard-ui/thirdparty/jquerymobile-1.4.5/jqm.table.js @@ -1,528 +1,5 @@ -(function () { +define(['jqmwidget'], function () { - if (jQuery.widget) { - return; - } - - /*! - * jQuery UI Widget c0ab71056b936627e8a7821f03c044aec6280a40 - * http://jqueryui.com - * - * Copyright 2013 jQuery Foundation and other contributors - * Released under the MIT license. - * http://jquery.org/license - * - * http://api.jqueryui.com/jQuery.widget/ - */ - (function ($, undefined) { - - var uuid = 0, - slice = Array.prototype.slice, - _cleanData = $.cleanData; - $.cleanData = function (elems) { - for (var i = 0, elem; (elem = elems[i]) != null; i++) { - try { - $(elem).triggerHandler("remove"); - // http://bugs.jquery.com/ticket/8235 - } catch (e) { } - } - _cleanData(elems); - }; - - $.widget = function (name, base, prototype) { - var fullName, existingConstructor, constructor, basePrototype, - // proxiedPrototype allows the provided prototype to remain unmodified - // so that it can be used as a mixin for multiple widgets (#8876) - proxiedPrototype = {}, - namespace = name.split(".")[0]; - - name = name.split(".")[1]; - fullName = namespace + "-" + name; - - if (!prototype) { - prototype = base; - base = $.Widget; - } - - // create selector for plugin - $.expr[":"][fullName.toLowerCase()] = function (elem) { - return !!$.data(elem, fullName); - }; - - $[namespace] = $[namespace] || {}; - existingConstructor = $[namespace][name]; - constructor = $[namespace][name] = function (options, element) { - // allow instantiation without "new" keyword - if (!this._createWidget) { - return new constructor(options, element); - } - - // allow instantiation without initializing for simple inheritance - // must use "new" keyword (the code above always passes args) - if (arguments.length) { - this._createWidget(options, element); - } - }; - // extend with the existing constructor to carry over any static properties - $.extend(constructor, existingConstructor, { - version: prototype.version, - // copy the object used to create the prototype in case we need to - // redefine the widget later - _proto: $.extend({}, prototype), - // track widgets that inherit from this widget in case this widget is - // redefined after a widget inherits from it - _childConstructors: [] - }); - - basePrototype = new base(); - // we need to make the options hash a property directly on the new instance - // otherwise we'll modify the options hash on the prototype that we're - // inheriting from - basePrototype.options = $.widget.extend({}, basePrototype.options); - $.each(prototype, function (prop, value) { - if (!$.isFunction(value)) { - proxiedPrototype[prop] = value; - return; - } - proxiedPrototype[prop] = (function () { - var _super = function () { - return base.prototype[prop].apply(this, arguments); - }, - _superApply = function (args) { - return base.prototype[prop].apply(this, args); - }; - return function () { - var __super = this._super, - __superApply = this._superApply, - returnValue; - - this._super = _super; - this._superApply = _superApply; - - returnValue = value.apply(this, arguments); - - this._super = __super; - this._superApply = __superApply; - - return returnValue; - }; - })(); - }); - constructor.prototype = $.widget.extend(basePrototype, { - // TODO: remove support for widgetEventPrefix - // always use the name + a colon as the prefix, e.g., draggable:start - // don't prefix for widgets that aren't DOM-based - widgetEventPrefix: existingConstructor ? (basePrototype.widgetEventPrefix || name) : name - }, proxiedPrototype, { - constructor: constructor, - namespace: namespace, - widgetName: name, - widgetFullName: fullName - }); - - // If this widget is being redefined then we need to find all widgets that - // are inheriting from it and redefine all of them so that they inherit from - // the new version of this widget. We're essentially trying to replace one - // level in the prototype chain. - if (existingConstructor) { - $.each(existingConstructor._childConstructors, function (i, child) { - var childPrototype = child.prototype; - - // redefine the child widget using the same prototype that was - // originally used, but inherit from the new version of the base - $.widget(childPrototype.namespace + "." + childPrototype.widgetName, constructor, child._proto); - }); - // remove the list of existing child constructors from the old constructor - // so the old child constructors can be garbage collected - delete existingConstructor._childConstructors; - } else { - base._childConstructors.push(constructor); - } - - $.widget.bridge(name, constructor); - - return constructor; - }; - - $.widget.extend = function (target) { - var input = slice.call(arguments, 1), - inputIndex = 0, - inputLength = input.length, - key, - value; - for (; inputIndex < inputLength; inputIndex++) { - for (key in input[inputIndex]) { - value = input[inputIndex][key]; - if (input[inputIndex].hasOwnProperty(key) && value !== undefined) { - // Clone objects - if ($.isPlainObject(value)) { - target[key] = $.isPlainObject(target[key]) ? - $.widget.extend({}, target[key], value) : - // Don't extend strings, arrays, etc. with objects - $.widget.extend({}, value); - // Copy everything else by reference - } else { - target[key] = value; - } - } - } - } - return target; - }; - - $.widget.bridge = function (name, object) { - - var fullName = object.prototype.widgetFullName || name; - $.fn[name] = function (options) { - var isMethodCall = typeof options === "string", - args = slice.call(arguments, 1), - returnValue = this; - - // allow multiple hashes to be passed on init - options = !isMethodCall && args.length ? - $.widget.extend.apply(null, [options].concat(args)) : - options; - - if (isMethodCall) { - this.each(function () { - var methodValue, - instance = $.data(this, fullName); - if (options === "instance") { - returnValue = instance; - return false; - } - if (!instance) { - return $.error("cannot call methods on " + name + " prior to initialization; " + - "attempted to call method '" + options + "'"); - } - if (!$.isFunction(instance[options]) || options.charAt(0) === "_") { - return $.error("no such method '" + options + "' for " + name + " widget instance"); - } - methodValue = instance[options].apply(instance, args); - if (methodValue !== instance && methodValue !== undefined) { - returnValue = methodValue && methodValue.jquery ? - returnValue.pushStack(methodValue.get()) : - methodValue; - return false; - } - }); - } else { - this.each(function () { - var instance = $.data(this, fullName); - if (instance) { - instance.option(options || {})._init(); - } else { - $.data(this, fullName, new object(options, this)); - } - }); - } - - return returnValue; - }; - }; - - $.Widget = function ( /* options, element */) { }; - $.Widget._childConstructors = []; - - $.Widget.prototype = { - widgetName: "widget", - widgetEventPrefix: "", - defaultElement: "
", - options: { - disabled: false, - - // callbacks - create: null - }, - _createWidget: function (options, element) { - element = $(element || this.defaultElement || this)[0]; - this.element = $(element); - this.uuid = uuid++; - this.eventNamespace = "." + this.widgetName + this.uuid; - this.options = $.widget.extend({}, - this.options, - this._getCreateOptions(), - options); - - this.bindings = $(); - this.hoverable = $(); - this.focusable = $(); - - if (element !== this) { - $.data(element, this.widgetFullName, this); - this._on(true, this.element, { - remove: function (event) { - if (event.target === element) { - this.destroy(); - } - } - }); - this.document = $(element.style ? - // element within the document - element.ownerDocument : - // element is window or document - element.document || element); - this.window = $(this.document[0].defaultView || this.document[0].parentWindow); - } - - this._create(); - this._trigger("create", null, this._getCreateEventData()); - this._init(); - }, - _getCreateOptions: $.noop, - _getCreateEventData: $.noop, - _create: $.noop, - _init: $.noop, - - destroy: function () { - this._destroy(); - // we can probably remove the unbind calls in 2.0 - // all event bindings should go through this._on() - this.element - .unbind(this.eventNamespace) - .removeData(this.widgetFullName) - // support: jquery <1.6.3 - // http://bugs.jquery.com/ticket/9413 - .removeData($.camelCase(this.widgetFullName)); - this.widget() - .unbind(this.eventNamespace) - .removeAttr("aria-disabled") - .removeClass( - this.widgetFullName + "-disabled " + - "ui-state-disabled"); - - // clean up events and states - this.bindings.unbind(this.eventNamespace); - this.hoverable.removeClass("ui-state-hover"); - this.focusable.removeClass("ui-state-focus"); - }, - _destroy: $.noop, - - widget: function () { - return this.element; - }, - - option: function (key, value) { - var options = key, - parts, - curOption, - i; - - if (arguments.length === 0) { - // don't return a reference to the internal hash - return $.widget.extend({}, this.options); - } - - if (typeof key === "string") { - // handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } } - options = {}; - parts = key.split("."); - key = parts.shift(); - if (parts.length) { - curOption = options[key] = $.widget.extend({}, this.options[key]); - for (i = 0; i < parts.length - 1; i++) { - curOption[parts[i]] = curOption[parts[i]] || {}; - curOption = curOption[parts[i]]; - } - key = parts.pop(); - if (value === undefined) { - return curOption[key] === undefined ? null : curOption[key]; - } - curOption[key] = value; - } else { - if (value === undefined) { - return this.options[key] === undefined ? null : this.options[key]; - } - options[key] = value; - } - } - - this._setOptions(options); - - return this; - }, - _setOptions: function (options) { - var key; - - for (key in options) { - this._setOption(key, options[key]); - } - - return this; - }, - _setOption: function (key, value) { - this.options[key] = value; - - if (key === "disabled") { - this.widget() - .toggleClass(this.widgetFullName + "-disabled", !!value); - this.hoverable.removeClass("ui-state-hover"); - this.focusable.removeClass("ui-state-focus"); - } - - return this; - }, - - enable: function () { - return this._setOptions({ disabled: false }); - }, - disable: function () { - return this._setOptions({ disabled: true }); - }, - - _on: function (suppressDisabledCheck, element, handlers) { - var delegateElement, - instance = this; - - // no suppressDisabledCheck flag, shuffle arguments - if (typeof suppressDisabledCheck !== "boolean") { - handlers = element; - element = suppressDisabledCheck; - suppressDisabledCheck = false; - } - - // no element argument, shuffle and use this.element - if (!handlers) { - handlers = element; - element = this.element; - delegateElement = this.widget(); - } else { - // accept selectors, DOM elements - element = delegateElement = $(element); - this.bindings = this.bindings.add(element); - } - - $.each(handlers, function (event, handler) { - function handlerProxy() { - // allow widgets to customize the disabled handling - // - disabled as an array instead of boolean - // - disabled class as method for disabling individual parts - if (!suppressDisabledCheck && - (instance.options.disabled === true || - $(this).hasClass("ui-state-disabled"))) { - return; - } - return (typeof handler === "string" ? instance[handler] : handler) - .apply(instance, arguments); - } - - // copy the guid so direct unbinding works - if (typeof handler !== "string") { - handlerProxy.guid = handler.guid = - handler.guid || handlerProxy.guid || $.guid++; - } - - var match = event.match(/^(\w+)\s*(.*)$/), - eventName = match[1] + instance.eventNamespace, - selector = match[2]; - if (selector) { - delegateElement.delegate(selector, eventName, handlerProxy); - } else { - element.bind(eventName, handlerProxy); - } - }); - }, - - _off: function (element, eventName) { - eventName = (eventName || "").split(" ").join(this.eventNamespace + " ") + this.eventNamespace; - element.unbind(eventName).undelegate(eventName); - }, - - _trigger: function (type, event, data) { - var prop, orig, - callback = this.options[type]; - - data = data || {}; - event = $.Event(event); - event.type = (type === this.widgetEventPrefix ? - type : - this.widgetEventPrefix + type).toLowerCase(); - // the original event may come from any element - // so we need to reset the target on the new event - event.target = this.element[0]; - - // copy original event properties over to the new event - orig = event.originalEvent; - if (orig) { - for (prop in orig) { - if (!(prop in event)) { - event[prop] = orig[prop]; - } - } - } - - this.element[0].dispatchEvent(new CustomEvent(event.type, { - bubbles: true, - detail: { - data: data, - originalEvent: event - } - })); - - //this.element.trigger(event, data); - return !($.isFunction(callback) && - callback.apply(this.element[0], [event].concat(data)) === false || - event.isDefaultPrevented()); - } - }; - - })(jQuery); - - (function ($, undefined) { - - $.extend($.Widget.prototype, { - _getCreateOptions: function () { - - var option, value, - elem = this.element[0], - options = {}; - - // - if (!this.element.data("defaults")) { - for (option in this.options) { - - value = this.element.data(option); - - if (value != null) { - options[option] = value; - } - } - } - - return options; - } - }); - - })(jQuery); - - (function ($, undefined) { - - - var originalWidget = $.widget - - $.widget = (function (orig) { - return function () { - var constructor = orig.apply(this, arguments), - name = constructor.prototype.widgetName; - - constructor.initSelector = ((constructor.prototype.initSelector !== undefined) ? - constructor.prototype.initSelector : "*[data-role='" + name + "']:not([data-role='none'])"); - - $.mobile.widgets[name] = constructor; - - return constructor; - }; - })($.widget); - - // Make sure $.widget still has bridge and extend methods - $.extend($.widget, originalWidget); - - })(jQuery); - - -})(); - -(function ($, window, undefined) { var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/; $.extend($.mobile, { @@ -557,165 +34,158 @@ }); -})(jQuery, this); -(function ($, undefined) { + $.widget("mobile.table", { + options: { + enhanced: false + }, - $.widget("mobile.table", { - options: { - enhanced: false - }, + _create: function () { + if (!this.options.enhanced) { + this.element.addClass("ui-table"); + } - _create: function () { - if (!this.options.enhanced) { - this.element.addClass("ui-table"); - } + // extend here, assign on refresh > _setHeaders + $.extend(this, { - // extend here, assign on refresh > _setHeaders - $.extend(this, { + // Expose headers and allHeaders properties on the widget + // headers references the THs within the first TR in the table + headers: undefined, - // Expose headers and allHeaders properties on the widget - // headers references the THs within the first TR in the table - headers: undefined, + // allHeaders references headers, plus all THs in the thead, which may + // include several rows, or not + allHeaders: undefined + }); - // allHeaders references headers, plus all THs in the thead, which may - // include several rows, or not - allHeaders: undefined - }); + this._refresh(true); + }, - this._refresh(true); - }, + _setHeaders: function () { + var trs = this.element.find("thead tr"); - _setHeaders: function () { - var trs = this.element.find("thead tr"); + this.headers = this.element.find("tr:eq(0)").children(); + this.allHeaders = this.headers.add(trs.children()); + }, - this.headers = this.element.find("tr:eq(0)").children(); - this.allHeaders = this.headers.add(trs.children()); - }, + refresh: function () { + this._refresh(); + }, - refresh: function () { - this._refresh(); - }, + rebuild: $.noop, - rebuild: $.noop, - - _refresh: function ( /* create */) { - var table = this.element, + _refresh: function ( /* create */) { + var table = this.element, trs = table.find("thead tr"); - // updating headers on refresh (fixes #5880) - this._setHeaders(); + // updating headers on refresh (fixes #5880) + this._setHeaders(); - // Iterate over the trs - trs.each(function () { - var columnCount = 0; + // Iterate over the trs + trs.each(function () { + var columnCount = 0; - // Iterate over the children of the tr - $(this).children().each(function () { - var span = parseInt(this.getAttribute("colspan"), 10), + // Iterate over the children of the tr + $(this).children().each(function () { + var span = parseInt(this.getAttribute("colspan"), 10), selector = ":nth-child(" + (columnCount + 1) + ")", j; - this.setAttribute("data-colstart", columnCount + 1); + this.setAttribute("data-colstart", columnCount + 1); - if (span) { - for (j = 0; j < span - 1; j++) { - columnCount++; - selector += ", :nth-child(" + (columnCount + 1) + ")"; - } - } + if (span) { + for (j = 0; j < span - 1; j++) { + columnCount++; + selector += ", :nth-child(" + (columnCount + 1) + ")"; + } + } - // Store "cells" data on header as a reference to all cells in the - // same column as this TH - $(this).data("cells", table.find("tr").not(trs.eq(0)).not(this).children(selector)); + // Store "cells" data on header as a reference to all cells in the + // same column as this TH + $(this).data("cells", table.find("tr").not(trs.eq(0)).not(this).children(selector)); - columnCount++; - }); - }); - } - }); - -})(jQuery); + columnCount++; + }); + }); + } + }); -(function ($, undefined) { + $.widget("mobile.table", $.mobile.table, { + options: { + mode: "reflow" + }, - $.widget("mobile.table", $.mobile.table, { - options: { - mode: "reflow" - }, + _create: function () { + this._super(); - _create: function () { - this._super(); + // If it's not reflow mode, return here. + if (this.options.mode !== "reflow") { + return; + } - // If it's not reflow mode, return here. - if (this.options.mode !== "reflow") { - return; - } + if (!this.options.enhanced) { + this.element.addClass("ui-table-reflow"); - if (!this.options.enhanced) { - this.element.addClass("ui-table-reflow"); + this._updateReflow(); + } + }, - this._updateReflow(); - } - }, + rebuild: function () { + this._super(); - rebuild: function () { - this._super(); + if (this.options.mode === "reflow") { + this._refresh(false); + } + }, - if (this.options.mode === "reflow") { - this._refresh(false); - } - }, + _refresh: function (create) { + this._super(create); + if (!create && this.options.mode === "reflow") { + this._updateReflow(); + } + }, - _refresh: function (create) { - this._super(create); - if (!create && this.options.mode === "reflow") { - this._updateReflow(); - } - }, - - _updateReflow: function () { - var table = this, + _updateReflow: function () { + var table = this, opts = this.options; - // get headers in reverse order so that top-level headers are appended last - $(table.allHeaders.get().reverse()).each(function () { - var cells = $(this).data("cells"), + // get headers in reverse order so that top-level headers are appended last + $(table.allHeaders.get().reverse()).each(function () { + var cells = $(this).data("cells"), colstart = $.mobile.getAttribute(this, "colstart"), hierarchyClass = cells.not(this).filter("thead th").length && " ui-table-cell-label-top", contents = $(this).clone().contents(), iteration, filter; - if (contents.length > 0) { + if (contents.length > 0) { - if (hierarchyClass) { - iteration = parseInt(this.getAttribute("colspan"), 10); - filter = ""; + if (hierarchyClass) { + iteration = parseInt(this.getAttribute("colspan"), 10); + filter = ""; - if (iteration) { - filter = "td:nth-child(" + iteration + "n + " + (colstart) + ")"; - } + if (iteration) { + filter = "td:nth-child(" + iteration + "n + " + (colstart) + ")"; + } - table._addLabels(cells.filter(filter), + table._addLabels(cells.filter(filter), "ui-table-cell-label" + hierarchyClass, contents); - } else { - table._addLabels(cells, "ui-table-cell-label", contents); - } + } else { + table._addLabels(cells, "ui-table-cell-label", contents); + } - } - }); - }, + } + }); + }, - _addLabels: function (cells, label, contents) { - if (contents.length === 1 && contents[0].nodeName.toLowerCase() === "abbr") { - contents = contents.eq(0).attr("title"); - } - // .not fixes #6006 - cells + _addLabels: function (cells, label, contents) { + if (contents.length === 1 && contents[0].nodeName.toLowerCase() === "abbr") { + contents = contents.eq(0).attr("title"); + } + // .not fixes #6006 + cells .not(":has(b." + label + ")") .prepend($("").append(contents)); - } - }); + } + }); -})(jQuery); \ No newline at end of file +}); \ No newline at end of file diff --git a/dashboard-ui/thirdparty/jquerymobile-1.4.5/jqm.widget.js b/dashboard-ui/thirdparty/jquerymobile-1.4.5/jqm.widget.js index 83864e58ea..37a20e8715 100644 --- a/dashboard-ui/thirdparty/jquerymobile-1.4.5/jqm.widget.js +++ b/dashboard-ui/thirdparty/jquerymobile-1.4.5/jqm.widget.js @@ -1,8 +1,4 @@ -(function () { - - if (jQuery.widget) { - return; - } +define(['jqm'], function () { /*! * jQuery UI Widget c0ab71056b936627e8a7821f03c044aec6280a40 @@ -498,7 +494,7 @@ (function ($, undefined) { - var originalWidget = $.widget + var originalWidget = $.widget; $.widget = (function (orig) { return function () { @@ -519,5 +515,4 @@ })(jQuery); - -})(); \ No newline at end of file +}); \ No newline at end of file