diff --git a/dashboard-ui/bower_components/iron-a11y-keys-behavior/.bower.json b/dashboard-ui/bower_components/iron-a11y-keys-behavior/.bower.json index 75f9aadbc3..845de2758a 100644 --- a/dashboard-ui/bower_components/iron-a11y-keys-behavior/.bower.json +++ b/dashboard-ui/bower_components/iron-a11y-keys-behavior/.bower.json @@ -29,14 +29,14 @@ "web-component-tester": "*", "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" }, - "homepage": "https://github.com/polymerelements/iron-a11y-keys-behavior", + "homepage": "https://github.com/PolymerElements/iron-a11y-keys-behavior", "_release": "1.0.6", "_resolution": { "type": "version", "tag": "v1.0.6", "commit": "af5c98b1cf9b3d180a6326c99ac9c7057eee647f" }, - "_source": "git://github.com/polymerelements/iron-a11y-keys-behavior.git", + "_source": "git://github.com/PolymerElements/iron-a11y-keys-behavior.git", "_target": "^1.0.0", - "_originalSource": "polymerelements/iron-a11y-keys-behavior" + "_originalSource": "PolymerElements/iron-a11y-keys-behavior" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/iron-flex-layout/.bower.json b/dashboard-ui/bower_components/iron-flex-layout/.bower.json index 842b1473f6..1f8ab2ef8f 100644 --- a/dashboard-ui/bower_components/iron-flex-layout/.bower.json +++ b/dashboard-ui/bower_components/iron-flex-layout/.bower.json @@ -25,14 +25,14 @@ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0", "iron-component-page": "polymerelements/iron-component-page#^1.0.0" }, - "homepage": "https://github.com/polymerelements/iron-flex-layout", + "homepage": "https://github.com/PolymerElements/iron-flex-layout", "_release": "1.0.4", "_resolution": { "type": "version", "tag": "v1.0.4", "commit": "dcfc54b0d358269bf0c72180b4ab090fc4931ecd" }, - "_source": "git://github.com/polymerelements/iron-flex-layout.git", + "_source": "git://github.com/PolymerElements/iron-flex-layout.git", "_target": "^1.0.0", - "_originalSource": "polymerelements/iron-flex-layout" + "_originalSource": "PolymerElements/iron-flex-layout" } \ No newline at end of file diff --git a/dashboard-ui/components/collectioneditor/collectioneditor.js b/dashboard-ui/components/collectioneditor/collectioneditor.js index cac02c5df9..6c182707b4 100644 --- a/dashboard-ui/components/collectioneditor/collectioneditor.js +++ b/dashboard-ui/components/collectioneditor/collectioneditor.js @@ -184,7 +184,7 @@ } } - function directoryBrowser() { + function collectioneditor() { var self = this; @@ -219,7 +219,7 @@ $(dlg).on('iron-overlay-closed', onDialogClosed); - PaperDialogHelper.openWithHash(dlg, 'directorybrowser'); + PaperDialogHelper.openWithHash(dlg, 'collectioneditor'); $('.btnCloseDialog', dlg).on('click', function () { @@ -229,5 +229,5 @@ }; } - return directoryBrowser; + return collectioneditor; }); \ No newline at end of file diff --git a/dashboard-ui/components/playlisteditor/playlisteditor.js b/dashboard-ui/components/playlisteditor/playlisteditor.js new file mode 100644 index 0000000000..ee8ee270bb --- /dev/null +++ b/dashboard-ui/components/playlisteditor/playlisteditor.js @@ -0,0 +1,238 @@ +define([], function () { + + var lastPlaylistId = ''; + + function redirectToPlaylist(id) { + + var context = getParameterByName('context'); + + ApiClient.getItem(Dashboard.getCurrentUserId(), id).done(function (item) { + + Dashboard.navigate(LibraryBrowser.getHref(item, context)); + + }); + } + + function onAddToPlaylistFormSubmit() { + + Dashboard.showLoadingMsg(); + + var panel = $(this).parents('paper-dialog')[0]; + + var playlistId = $('#selectPlaylistToAddTo', panel).val(); + + if (playlistId) { + lastPlaylistId = playlistId; + addToPlaylist(panel, playlistId); + } else { + createPlaylist(panel); + } + + return false; + } + + function createPlaylist(dlg) { + + var url = ApiClient.getUrl("Playlists", { + + Name: $('#txtNewPlaylistName', dlg).val(), + Ids: $('.fldSelectedItemIds', dlg).val() || '', + userId: Dashboard.getCurrentUserId() + + }); + + ApiClient.ajax({ + type: "POST", + url: url, + dataType: "json" + + }).done(function (result) { + + Dashboard.hideLoadingMsg(); + + var id = result.Id; + + PaperDialogHelper.close(dlg); + redirectToPlaylist(id); + }); + } + + function addToPlaylist(dlg, id) { + + var url = ApiClient.getUrl("Playlists/" + id + "/Items", { + + Ids: $('.fldSelectedItemIds', dlg).val() || '', + userId: Dashboard.getCurrentUserId() + }); + + ApiClient.ajax({ + type: "POST", + url: url + + }).done(function () { + + Dashboard.hideLoadingMsg(); + + PaperDialogHelper.close(dlg); + Dashboard.alert(Globalize.translate('MessageAddedToPlaylistSuccess')); + + }); + } + + function onDialogClosed() { + + $(this).remove(); + Dashboard.hideLoadingMsg(); + } + + function populatePlaylists(panel) { + + var select = $('#selectPlaylistToAddTo', panel); + + if (!select.length) { + + $('#txtNewPlaylistName', panel).val('').focus(); + return; + } + + Dashboard.showLoadingMsg(); + + $('.newPlaylistInfo', panel).hide(); + + var options = { + + Recursive: true, + IncludeItemTypes: "Playlist", + SortBy: 'SortName' + }; + + ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) { + + var html = ''; + + html += ''; + + html += result.Items.map(function (i) { + + return ''; + }); + + select.html(html).val('').trigger('change'); + + Dashboard.hideLoadingMsg(); + }); + } + + function getEditorHtml() { + + var html = ''; + + html += '
'; + + html += '
'; + + html += '
'; + html += '
'; + html += ''; + html += ''; + html += '
'; + + html += '
'; + + html += '
'; + html += ''; + html += '
'; + + html += '
'; + + // newPlaylistInfo + html += '
'; + + html += '
'; + html += '
'; + html += ''; + html += '
'; + + html += ''; + + html += '
'; + + return html; + } + + function initEditor(content, items) { + + $('#selectPlaylistToAddTo', content).on('change', function () { + + if (this.value) { + $('.newPlaylistInfo', content).hide(); + $('input', content).removeAttr('required'); + } else { + $('.newPlaylistInfo', content).show(); + $('input', content).attr('required', 'required'); + } + + }).trigger('change'); + + populatePlaylists(content); + + $('form', content).on('submit', onAddToPlaylistFormSubmit); + + $('.fldSelectedItemIds', content).val(items.join(',')); + + if (items.length) { + $('.fldSelectPlaylist', content).show(); + populatePlaylists(content); + } else { + $('.fldSelectPlaylist', content).hide(); + $('#selectPlaylistToAddTo', content).html('').val('').trigger('change'); + } + } + + function playlisteditor() { + + var self = this; + + self.show = function (items) { + + items = items || []; + + require(['components/paperdialoghelper'], function () { + + var dlg = PaperDialogHelper.createDialog({ + size: 'small' + }); + + var html = ''; + html += '

'; + html += ''; + + var title = Globalize.translate('HeaderAddToPlaylist'); + + html += '
' + title + '
'; + html += '

'; + + html += '
'; + html += getEditorHtml(); + html += '
'; + + dlg.innerHTML = html; + document.body.appendChild(dlg); + + var editorContent = dlg.querySelector('.editorContent'); + initEditor(editorContent, items); + + $(dlg).on('iron-overlay-closed', onDialogClosed); + + PaperDialogHelper.openWithHash(dlg, 'playlisteditor'); + + $('.btnCloseDialog', dlg).on('click', function () { + + PaperDialogHelper.close(dlg); + }); + }); + }; + } + + return playlisteditor; +}); \ No newline at end of file diff --git a/dashboard-ui/css/site.css b/dashboard-ui/css/site.css index 0d6b4e42e3..771b8f050a 100644 --- a/dashboard-ui/css/site.css +++ b/dashboard-ui/css/site.css @@ -430,7 +430,7 @@ fieldset { border: none; } -input:not(.paper-input):not(.likePaperText):not([type='checkbox']):not([type='radio']):not([type='file']) { +input:not(.paper-input):not(.likePaperText):not([type='checkbox']):not([type='radio']):not([type='file']):not([type='range']) { -webkit-appearance: none; -webkit-font-smoothing: antialiased; -webkit-rtl-ordering: logical; diff --git a/dashboard-ui/scripts/playlistmanager.js b/dashboard-ui/scripts/playlistmanager.js index a0adecfab5..74bfdf1a2e 100644 --- a/dashboard-ui/scripts/playlistmanager.js +++ b/dashboard-ui/scripts/playlistmanager.js @@ -1,215 +1,11 @@ (function ($, document) { - var lastPlaylistId = ''; - - function redirectToPlaylist(id) { - - var context = getParameterByName('context'); - - ApiClient.getItem(Dashboard.getCurrentUserId(), id).done(function (item) { - - Dashboard.navigate(LibraryBrowser.getHref(item, context)); - - }); - } - - function onAddToPlaylistFormSubmit() { - - Dashboard.showLoadingMsg(); - - var panel = $(this).parents('.newPlaylistPanel'); - - var playlistId = $('select.selectPlaylistToAddTo', panel).val(); - - if (playlistId) { - lastPlaylistId = playlistId; - addToPlaylist(panel, playlistId); - } else { - createPlaylist(panel); - } - - return false; - } - - function getNewPlaylistPanel() { - - Dashboard.showLoadingMsg(); - $('.newPlaylistPanel').panel('destroy').remove(); - - var html = '
'; - - html += '

' + Globalize.translate('HeaderAddToPlaylist') + '

'; - - html += '
'; - - html += '
'; - - var selectId = 'selectPlaylistToAddTo' + new Date().getTime(); - - html += '
'; - html += ''; - html += ''; - html += '
'; - - html += '
'; - - html += ''; - - html += '

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

'; - - html += '
'; - html += '
'; - - $(document.body).append(html); - - var elem = $('.newPlaylistPanel').panel({}).trigger('create').on("panelclose", function () { - - $(this).off("panelclose").remove(); - }); - - var select = $('#' + selectId, elem).on('change', function () { - - if (this.value) { - $('.fldNewPlaylist', elem).hide(); - $('input', elem).removeAttr('required'); - } else { - $('.fldNewPlaylist', elem).show(); - $('input', elem).attr('required', 'required'); - } - - }).trigger('change'); - - ApiClient.getItems(Dashboard.getCurrentUserId(), { - - IncludeItemTypes: 'Playlist', - recursive: true, - SortBy: 'SortName' - - }).done(function (result) { - - var selectHtml = ''; - selectHtml += result.Items.map(function (o) { - - return ''; - - }).join(''); - - select.html(selectHtml); - - select.val(lastPlaylistId || '').trigger('change'); - Dashboard.hideLoadingMsg(); - }); - - $('form', elem).on('submit', onAddToPlaylistFormSubmit); - - return elem; - } - - function showNewPlaylistPanel(items) { - - var panel = getNewPlaylistPanel().panel('toggle'); - - $('.fldSelectedItemIds', panel).val(items.join(',')); - - populatePlaylists(panel); - } - - function populatePlaylists(panel) { - - var select = $('select.selectPlaylistToAddTo', panel); - - if (!select.length) { - - $('#txtNewPlaylistName', panel).val('').focus(); - return; - } - - $('.newPlaylistInfo', panel).hide(); - - var options = { - - Recursive: true, - IncludeItemTypes: "Playlist", - SortBy: 'SortName' - }; - - ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) { - - var html = ''; - - html += ''; - - html += result.Items.map(function (i) { - - return ''; - }); - - select.html(html).val('').trigger('change'); - - }); - } - - function createPlaylist(panel) { - - var url = ApiClient.getUrl("Playlists", { - - Name: $('#txtNewPlaylistName', panel).val(), - Ids: $('.fldSelectedItemIds', panel).val() || '', - userId: Dashboard.getCurrentUserId() - - }); - - ApiClient.ajax({ - type: "POST", - url: url, - dataType: "json" - - }).done(function (result) { - - Dashboard.hideLoadingMsg(); - - var id = result.Id; - - panel.panel('toggle'); - redirectToPlaylist(id); - }); - } - - function addToPlaylist(panel, id) { - - var url = ApiClient.getUrl("Playlists/" + id + "/Items", { - - Ids: $('.fldSelectedItemIds', panel).val() || '', - userId: Dashboard.getCurrentUserId() - }); - - ApiClient.ajax({ - type: "POST", - url: url - - }).done(function () { - - Dashboard.hideLoadingMsg(); - - panel.panel('toggle'); - Dashboard.alert(Globalize.translate('MessageAddedToPlaylistSuccess')); - - }); - } - window.PlaylistManager = { showPanel: function (items) { - require(['jqmpanel'], function() { - showNewPlaylistPanel(items); + require(['playlisteditor'], function (playlisteditor) { + new playlisteditor().show(items); }); }, diff --git a/dashboard-ui/scripts/site.js b/dashboard-ui/scripts/site.js index 3472b84438..722c2d099e 100644 --- a/dashboard-ui/scripts/site.js +++ b/dashboard-ui/scripts/site.js @@ -2049,7 +2049,8 @@ var AppInfo = {}; velocity: "bower_components/velocity/velocity.min", tvguide: 'components/tvguide/tvguide', directorybrowser: 'components/directorybrowser/directorybrowser', - collectioneditor: 'components/collectioneditor/collectioneditor' + collectioneditor: 'components/collectioneditor/collectioneditor', + playlisteditor: 'components/playlisteditor/playlisteditor' }; if (Dashboard.isRunningInCordova()) { diff --git a/dashboard-ui/thirdparty/jquerymobile-1.4.5/jqm.slider.css b/dashboard-ui/thirdparty/jquerymobile-1.4.5/jqm.slider.css index 0e36f50b29..ea7ac46f53 100644 --- a/dashboard-ui/thirdparty/jquerymobile-1.4.5/jqm.slider.css +++ b/dashboard-ui/thirdparty/jquerymobile-1.4.5/jqm.slider.css @@ -83,7 +83,7 @@ div.ui-slider:after { clear: both; } input.ui-slider-input { - display: block; + display: none; float: left; font-size: 14px; font-weight: bold; @@ -115,7 +115,7 @@ input.ui-slider-input { border-width: 1px; border-style: solid; height: 15px; - margin: 0 15px 0 68px; + margin: 0 15px 0 0; top: 6px; } .ui-slider-track.ui-mini { 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 cea22ba3f4..d99dd2294c 100644 --- a/dashboard-ui/thirdparty/jquerymobile-1.4.5/jqm.slider.js +++ b/dashboard-ui/thirdparty/jquerymobile-1.4.5/jqm.slider.js @@ -160,7 +160,7 @@ this.handle.bind("click", false); - this._handleFormReset(); + //this._handleFormReset(); this.refresh(undefined, undefined, true); },