From 20d1e9132d43911b386f213cdec96055e855baa1 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 22 Jul 2016 15:48:47 -0400 Subject: [PATCH] use checkbox instead of toggle button --- .../emby-webcomponents/listview/listview.js | 74 +++--- .../paper-toggle-button/.bower.json | 48 ---- .../paper-toggle-button/.gitignore | 1 - .../paper-toggle-button/.travis.yml | 24 -- .../paper-toggle-button/CONTRIBUTING.md | 72 ----- .../paper-toggle-button/bower.json | 39 --- .../paper-toggle-button/demo/index.html | 83 ------ .../paper-toggle-button/hero.svg | 22 -- .../paper-toggle-button/index.html | 26 -- .../paper-toggle-button.html | 250 ------------------ .../paper-toggle-button/test/basic.html | 90 ------- .../paper-toggle-button/test/index.html | 24 -- dashboard-ui/log.html | 7 +- dashboard-ui/plugincatalog.html | 7 +- dashboard-ui/scripts/logpage.js | 18 +- dashboard-ui/scripts/plugincatalogpage.js | 2 +- dashboard-ui/scripts/site.js | 3 +- .../thirdparty/paper-button-style.css | 12 - 18 files changed, 56 insertions(+), 746 deletions(-) delete mode 100644 dashboard-ui/bower_components/paper-toggle-button/.bower.json delete mode 100644 dashboard-ui/bower_components/paper-toggle-button/.gitignore delete mode 100644 dashboard-ui/bower_components/paper-toggle-button/.travis.yml delete mode 100644 dashboard-ui/bower_components/paper-toggle-button/CONTRIBUTING.md delete mode 100644 dashboard-ui/bower_components/paper-toggle-button/bower.json delete mode 100644 dashboard-ui/bower_components/paper-toggle-button/demo/index.html delete mode 100644 dashboard-ui/bower_components/paper-toggle-button/hero.svg delete mode 100644 dashboard-ui/bower_components/paper-toggle-button/index.html delete mode 100644 dashboard-ui/bower_components/paper-toggle-button/paper-toggle-button.html delete mode 100644 dashboard-ui/bower_components/paper-toggle-button/test/basic.html delete mode 100644 dashboard-ui/bower_components/paper-toggle-button/test/index.html diff --git a/dashboard-ui/bower_components/emby-webcomponents/listview/listview.js b/dashboard-ui/bower_components/emby-webcomponents/listview/listview.js index af081437e0..ec64b305aa 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/listview/listview.js +++ b/dashboard-ui/bower_components/emby-webcomponents/listview/listview.js @@ -105,14 +105,36 @@ define(['itemHelper', 'mediaInfo', 'indicators', 'connectionManager', 'layoutMan return null; } - function getListViewHtml(items, options) { + function getTextLinesHtml(textlines, isLargeStyle) { - if (arguments.length == 1) { - options = items; - items = options.items; + var html = ''; + + for (var i = 0, length = textlines.length; i < length; i++) { + + if (i === 0) { + if (isLargeStyle) { + html += '

'; + } else { + html += '
'; + } + } else { + html += '
'; + } + html += (textlines[i] || ' '); + if (i === 0 && isLargeStyle) { + html += '

'; + } else { + html += ''; + } } - var index = 0; + return html; + } + + function getListViewHtml(options) { + + var items = options.items; + var groupTitle = ''; var action = options.action || 'link'; @@ -125,7 +147,9 @@ define(['itemHelper', 'mediaInfo', 'indicators', 'connectionManager', 'layoutMan var outerHtml = ''; - outerHtml += items.map(function (item) { + for (var i = 0, length = items.length; i < length; i++) { + + var item = items[i]; var html = ''; @@ -139,7 +163,7 @@ define(['itemHelper', 'mediaInfo', 'indicators', 'connectionManager', 'layoutMan html += ''; } - if (index == 0) { + if (i == 0) { html += '

'; } else { @@ -173,7 +197,7 @@ define(['itemHelper', 'mediaInfo', 'indicators', 'connectionManager', 'layoutMan var collectionIdData = options.collectionId ? (' data-collectionid="' + options.collectionId + '"') : ''; var playlistIdData = options.playlistId ? (' data-playlistid="' + options.playlistId + '"') : ''; - html += '<' + outerTagName + ' class="' + cssClass + '" data-index="' + index + '"' + playlistItemId + ' data-action="' + action + '" data-isfolder="' + item.IsFolder + '" data-id="' + item.Id + '" data-serverid="' + item.ServerId + '" data-mediatype="' + item.MediaType + '" data-type="' + item.Type + '"' + positionTicksData + collectionIdData + playlistIdData + '>'; + html += '<' + outerTagName + ' class="' + cssClass + '" data-index="' + i + '"' + playlistItemId + ' data-action="' + action + '" data-isfolder="' + item.IsFolder + '" data-id="' + item.Id + '" data-serverid="' + item.ServerId + '" data-mediatype="' + item.MediaType + '" data-type="' + item.Type + '"' + positionTicksData + collectionIdData + playlistIdData + '>'; if (!clickEntireItem && options.dragHandle) { html += ''; @@ -238,14 +262,6 @@ define(['itemHelper', 'mediaInfo', 'indicators', 'connectionManager', 'layoutMan } } - var lineCount = textlines.length; - if (!enableSideMediaInfo) { - lineCount++; - } - if (enableOverview && item.Overview) { - lineCount++; - } - cssClass = 'listItemBody'; if (!clickEntireItem) { cssClass += ' itemAction'; @@ -255,25 +271,7 @@ define(['itemHelper', 'mediaInfo', 'indicators', 'connectionManager', 'layoutMan var moreIcon = appHost.moreIcon == 'dots-horiz' ? '' : ''; - for (var i = 0, textLinesLength = textlines.length; i < textLinesLength; i++) { - - if (i == 0 && isLargeStyle) { - html += '

'; - } - else if (i == 0) { - html += '
'; - } else { - html += '
'; - } - html += textlines[i] || ' '; - if (i == 0 && isLargeStyle) { - html += '

'; - } else if (i == 0) { - html += ''; - } else { - html += ''; - } - } + html += getTextLinesHtml(textlines, isLargeStyle); if (!enableSideMediaInfo) { html += '
' + mediaInfo.getPrimaryMediaInfoHtml(item) + '
'; @@ -308,10 +306,8 @@ define(['itemHelper', 'mediaInfo', 'indicators', 'connectionManager', 'layoutMan html += ''; - index++; - return html; - - }).join(''); + outerHtml += html; + } return outerHtml; } diff --git a/dashboard-ui/bower_components/paper-toggle-button/.bower.json b/dashboard-ui/bower_components/paper-toggle-button/.bower.json deleted file mode 100644 index d3bb5bf44e..0000000000 --- a/dashboard-ui/bower_components/paper-toggle-button/.bower.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "paper-toggle-button", - "version": "1.0.14", - "description": "A material design toggle button control", - "authors": [ - "The Polymer Authors" - ], - "keywords": [ - "web-components", - "polymer", - "toggle", - "control" - ], - "private": true, - "repository": { - "type": "git", - "url": "git://github.com/PolymerElements/paper-toggle-button" - }, - "license": "http://polymer.github.io/LICENSE.txt", - "homepage": "https://github.com/PolymerElements/paper-toggle-button", - "ignore": [], - "dependencies": { - "polymer": "Polymer/polymer#^1.1.0", - "iron-checked-element-behavior": "PolymerElements/iron-checked-element-behavior#^1.0.0", - "paper-behaviors": "PolymerElements/paper-behaviors#^1.0.0", - "paper-ripple": "PolymerElements/paper-ripple#^1.0.0", - "paper-styles": "PolymerElements/paper-styles#^1.0.0" - }, - "devDependencies": { - "iron-component-page": "PolymerElements/iron-component-page#^1.0.0", - "iron-demo-helpers": "PolymerElements/iron-demo-helpers#^1.0.0", - "iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0", - "iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0", - "test-fixture": "PolymerElements/test-fixture#^1.0.0", - "web-component-tester": "Polymer/web-component-tester#^3.3.0", - "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" - }, - "main": "paper-toggle-button.html", - "_release": "1.0.14", - "_resolution": { - "type": "version", - "tag": "v1.0.14", - "commit": "131f32adf5ce831f94be7f80c436865b44d7cd95" - }, - "_source": "git://github.com/PolymerElements/paper-toggle-button.git", - "_target": "~1.0.5", - "_originalSource": "PolymerElements/paper-toggle-button" -} \ No newline at end of file diff --git a/dashboard-ui/bower_components/paper-toggle-button/.gitignore b/dashboard-ui/bower_components/paper-toggle-button/.gitignore deleted file mode 100644 index 8d4ae2536a..0000000000 --- a/dashboard-ui/bower_components/paper-toggle-button/.gitignore +++ /dev/null @@ -1 +0,0 @@ -bower_components diff --git a/dashboard-ui/bower_components/paper-toggle-button/.travis.yml b/dashboard-ui/bower_components/paper-toggle-button/.travis.yml deleted file mode 100644 index f5f84ae269..0000000000 --- a/dashboard-ui/bower_components/paper-toggle-button/.travis.yml +++ /dev/null @@ -1,24 +0,0 @@ -language: node_js -sudo: false -before_script: - - npm install web-component-tester - - npm install bower - - 'export PATH=$PWD/node_modules/.bin:$PATH' - - bower install - - npm install polylint - - polylint -env: - global: - - secure: T4tEkegUT5RhgMTQAUxtXQROsEEIGYyQZ3MzrEX9Xf8XjCYk7pZmK50UXuHa61xO5F5M1bQV0mu4lPcl41Nzws3GKOmKrprbwdhLGfJY5DsqRr6rVnWKvCf57T1jXciEbr17dQyW0kqP41m4LSvNRRJwxv52bk9Nxu22X1HMrD0= - - secure: rKcth+F7zQJu/nMxEdxRDgyNAR/IQVuduPEmrgbUShIsbN48QoI+Bwdqj38NPpKj8LdVE8pgpuiN7FkQ8cipsQNiXTp5cl9t9k/gKGmXfsKE0K85H4bHYoPv6OH2bSyRuUzVlFWQH4FVNXGdDLwSLV/4VQT4+P19MTZRSm4oG1A= -node_js: 4 -addons: - firefox: latest - apt: - sources: - - google-chrome - packages: - - google-chrome-stable -script: - - xvfb-run wct - - "if [ \"${TRAVIS_PULL_REQUEST}\" = \"false\" ]; then wct -s 'default'; fi" diff --git a/dashboard-ui/bower_components/paper-toggle-button/CONTRIBUTING.md b/dashboard-ui/bower_components/paper-toggle-button/CONTRIBUTING.md deleted file mode 100644 index 7b10141565..0000000000 --- a/dashboard-ui/bower_components/paper-toggle-button/CONTRIBUTING.md +++ /dev/null @@ -1,72 +0,0 @@ - - -# Polymer Elements -## Guide for Contributors - -Polymer Elements are built in the open, and the Polymer authors eagerly encourage any and all forms of community contribution. When contributing, please follow these guidelines: - -### Filing Issues - -**If you are filing an issue to request a feature**, please provide a clear description of the feature. It can be helpful to describe answers to the following questions: - - 1. **Who will use the feature?** _“As someone filling out a form…”_ - 2. **When will they use the feature?** _“When I enter an invalid value…”_ - 3. **What is the user’s goal?** _“I want to be visually notified that the value needs to be corrected…”_ - -**If you are filing an issue to report a bug**, please provide: - - 1. **A clear description of the bug and related expectations.** Consider using the following example template for reporting a bug: - - ```markdown - The `paper-foo` element causes the page to turn pink when clicked. - - ## Expected outcome - - The page stays the same color. - - ## Actual outcome - - The page turns pink. - - ## Steps to reproduce - - 1. Put a `paper-foo` element in the page. - 2. Open the page in a web browser. - 3. Click the `paper-foo` element. - ``` - - 2. **A reduced test case that demonstrates the problem.** If possible, please include the test case as a JSBin. Start with this template to easily import and use relevant Polymer Elements: [http://jsbin.com/cagaye](http://jsbin.com/cagaye/edit?html,output). - - 3. **A list of browsers where the problem occurs.** This can be skipped if the problem is the same across all browsers. - -### Submitting Pull Requests - -**Before creating a pull request**, please ensure that an issue exists for the corresponding change in the pull request that you intend to make. **If an issue does not exist, please create one per the guidelines above**. The goal is to discuss the design and necessity of the proposed change with Polymer authors and community before diving into a pull request. - -When submitting pull requests, please provide: - - 1. **A reference to the corresponding issue** or issues that will be closed by the pull request. Please refer to these issues using the following syntax: - - ```markdown - (For a single issue) - Fixes #20 - - (For multiple issues) - Fixes #32, #40 - ``` - - 2. **A succinct description of the design** used to fix any related issues. For example: - - ```markdown - This fixes #20 by removing styles that leaked which would cause the page to turn pink whenever `paper-foo` is clicked. - ``` - - 3. **At least one test for each bug fixed or feature added** as part of the pull request. Pull requests that fix bugs or add features without accompanying tests will not be considered. - -If a proposed change contains multiple commits, please [squash commits](https://www.google.com/url?q=http://blog.steveklabnik.com/posts/2012-11-08-how-to-squash-commits-in-a-github-pull-request) to as few as is necessary to succinctly express the change. A Polymer author can help you squash commits, so don’t be afraid to ask us if you need help with that! diff --git a/dashboard-ui/bower_components/paper-toggle-button/bower.json b/dashboard-ui/bower_components/paper-toggle-button/bower.json deleted file mode 100644 index c6d1723a89..0000000000 --- a/dashboard-ui/bower_components/paper-toggle-button/bower.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "paper-toggle-button", - "version": "1.0.14", - "description": "A material design toggle button control", - "authors": [ - "The Polymer Authors" - ], - "keywords": [ - "web-components", - "polymer", - "toggle", - "control" - ], - "private": true, - "repository": { - "type": "git", - "url": "git://github.com/PolymerElements/paper-toggle-button" - }, - "license": "http://polymer.github.io/LICENSE.txt", - "homepage": "https://github.com/PolymerElements/paper-toggle-button", - "ignore": [], - "dependencies": { - "polymer": "Polymer/polymer#^1.1.0", - "iron-checked-element-behavior": "PolymerElements/iron-checked-element-behavior#^1.0.0", - "paper-behaviors": "PolymerElements/paper-behaviors#^1.0.0", - "paper-ripple": "PolymerElements/paper-ripple#^1.0.0", - "paper-styles": "PolymerElements/paper-styles#^1.0.0" - }, - "devDependencies": { - "iron-component-page": "PolymerElements/iron-component-page#^1.0.0", - "iron-demo-helpers": "PolymerElements/iron-demo-helpers#^1.0.0", - "iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0", - "iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0", - "test-fixture": "PolymerElements/test-fixture#^1.0.0", - "web-component-tester": "Polymer/web-component-tester#^3.3.0", - "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" - }, - "main": "paper-toggle-button.html" -} diff --git a/dashboard-ui/bower_components/paper-toggle-button/demo/index.html b/dashboard-ui/bower_components/paper-toggle-button/demo/index.html deleted file mode 100644 index dd071c8110..0000000000 --- a/dashboard-ui/bower_components/paper-toggle-button/demo/index.html +++ /dev/null @@ -1,83 +0,0 @@ - - - - - paper-toggle-button demo - - - - - - - - - - - - - - - -
-

Toggle buttons can be checked and disabled

- - - - -

Toggle buttons can hide the ripple effect using the noink attribute

- - - - -

Toggle buttons can be styled using custom properties

- - - -
- - diff --git a/dashboard-ui/bower_components/paper-toggle-button/hero.svg b/dashboard-ui/bower_components/paper-toggle-button/hero.svg deleted file mode 100644 index 21607b2828..0000000000 --- a/dashboard-ui/bower_components/paper-toggle-button/hero.svg +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/dashboard-ui/bower_components/paper-toggle-button/index.html b/dashboard-ui/bower_components/paper-toggle-button/index.html deleted file mode 100644 index 487bb5c38a..0000000000 --- a/dashboard-ui/bower_components/paper-toggle-button/index.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/dashboard-ui/bower_components/paper-toggle-button/paper-toggle-button.html b/dashboard-ui/bower_components/paper-toggle-button/paper-toggle-button.html deleted file mode 100644 index 3c3752170e..0000000000 --- a/dashboard-ui/bower_components/paper-toggle-button/paper-toggle-button.html +++ /dev/null @@ -1,250 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/dashboard-ui/bower_components/paper-toggle-button/test/basic.html b/dashboard-ui/bower_components/paper-toggle-button/test/basic.html deleted file mode 100644 index 43e028c81f..0000000000 --- a/dashboard-ui/bower_components/paper-toggle-button/test/basic.html +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - paper-toggle-button basic tests - - - - - - - - - - - - - - - - - - - - diff --git a/dashboard-ui/bower_components/paper-toggle-button/test/index.html b/dashboard-ui/bower_components/paper-toggle-button/test/index.html deleted file mode 100644 index 513f309c38..0000000000 --- a/dashboard-ui/bower_components/paper-toggle-button/test/index.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - paper-toggle-button tests - - - - - - - diff --git a/dashboard-ui/log.html b/dashboard-ui/log.html index 2e1c9497fa..4c10db42ec 100644 --- a/dashboard-ui/log.html +++ b/dashboard-ui/log.html @@ -4,9 +4,12 @@
- ${LabelEnableDebugLogging} +
-
+
diff --git a/dashboard-ui/plugincatalog.html b/dashboard-ui/plugincatalog.html index bff0e0816b..bd55ad8182 100644 --- a/dashboard-ui/plugincatalog.html +++ b/dashboard-ui/plugincatalog.html @@ -1,4 +1,4 @@ -
+
@@ -10,7 +10,10 @@
- ${OptionDisplayAdultContent} +
diff --git a/dashboard-ui/scripts/logpage.js b/dashboard-ui/scripts/logpage.js index 72097c6be2..bc4b40390b 100644 --- a/dashboard-ui/scripts/logpage.js +++ b/dashboard-ui/scripts/logpage.js @@ -1,4 +1,4 @@ -define(['datetime', 'jQuery', 'paper-fab', 'paper-item-body', 'paper-icon-item'], function (datetime, $) { +define(['datetime', 'listViewStyle'], function (datetime) { return function (view, params) { @@ -33,13 +33,13 @@ logUrl += "&api_key=" + apiClient.accessToken(); var logHtml = ''; - logHtml += ''; + logHtml += ''; return logHtml; @@ -64,7 +64,7 @@ html += '
'; - $('.serverLogs', view).html(html); + view.querySelector('.serverLogs').innerHTML = html; Dashboard.hideLoadingMsg(); }); diff --git a/dashboard-ui/scripts/plugincatalogpage.js b/dashboard-ui/scripts/plugincatalogpage.js index 57ede75460..c3f6707883 100644 --- a/dashboard-ui/scripts/plugincatalogpage.js +++ b/dashboard-ui/scripts/plugincatalogpage.js @@ -208,7 +208,7 @@ html += "
"; if (plugin.avgRating) { - html += ''; + html += 'star'; html += plugin.avgRating.toFixed(1); } diff --git a/dashboard-ui/scripts/site.js b/dashboard-ui/scripts/site.js index 5c13e9b216..508f51e9aa 100644 --- a/dashboard-ui/scripts/site.js +++ b/dashboard-ui/scripts/site.js @@ -1665,7 +1665,6 @@ var AppInfo = {}; define("paper-button", ["html!" + bowerPath + "/paper-button/paper-button.html"]); define("paper-icon-button", ["html!" + bowerPath + "/paper-icon-button/paper-icon-button.html"]); - define("paper-toggle-button", ['webcomponentsjs', "html!" + bowerPath + "/paper-toggle-button/paper-toggle-button.html"]); define("paper-textarea", ['webcomponentsjs', "html!" + bowerPath + "/paper-input/paper-textarea.html"]); define("paper-item", ["html!" + bowerPath + "/paper-item/paper-item.html"]); @@ -2481,7 +2480,7 @@ var AppInfo = {}; defineRoute({ path: '/log.html', - dependencies: ['paper-toggle-button'], + dependencies: ['emby-checkbox'], roles: 'admin', controller: 'scripts/logpage' }); diff --git a/dashboard-ui/thirdparty/paper-button-style.css b/dashboard-ui/thirdparty/paper-button-style.css index f1098e28c5..7e8706f54b 100644 --- a/dashboard-ui/thirdparty/paper-button-style.css +++ b/dashboard-ui/thirdparty/paper-button-style.css @@ -404,18 +404,6 @@ div.dialogHeader { padding-bottom: 100px; } -.paper-toggle-button-0 .toggle-label.paper-toggle-button { - color: inherit; -} - -paper-toggle-button #toggleButton, paper-toggle-button[checked] #toggleBar { - background-color: #52B54B; -} - -paper-toggle-button paper-ripple { - color: #52B54B; -} - .formDialog.background-theme-b { background-color: #181818; }