├── .gitignore ├── README.md ├── background.html ├── fonts ├── Roboto-300 │ ├── Roboto-300.eot │ ├── Roboto-300.svg │ ├── Roboto-300.ttf │ ├── Roboto-300.woff │ └── Roboto-300.woff2 ├── Roboto-500 │ ├── LICENSE.txt │ ├── Roboto-500.eot │ ├── Roboto-500.svg │ ├── Roboto-500.ttf │ ├── Roboto-500.woff │ └── Roboto-500.woff2 ├── Roboto-700 │ ├── LICENSE.txt │ ├── Roboto-700.eot │ ├── Roboto-700.svg │ ├── Roboto-700.ttf │ ├── Roboto-700.woff │ └── Roboto-700.woff2 ├── Roboto-regular │ ├── LICENSE.txt │ ├── Roboto-regular.eot │ ├── Roboto-regular.svg │ ├── Roboto-regular.ttf │ ├── Roboto-regular.woff │ └── Roboto-regular.woff2 └── icons.woff2 ├── img ├── default_album.png ├── default_artist.png ├── eq_paused.png ├── eq_playing.gif ├── icon-128.png ├── icon-16.png ├── icon-19.png ├── icon-38.png ├── icon-48.png ├── notification_ff.png ├── notification_pp.png ├── promo-large.png ├── promo-medium.png └── promo-small.png ├── manifest.json ├── options.html ├── popup.html ├── privacy.md ├── scripts ├── angular.min.js ├── background.js ├── controllers.js ├── directives.js ├── enums.js ├── jquery.js ├── loader.js ├── material.min.js ├── md5.js ├── options.js ├── popup.js ├── protocols │ ├── global.js │ ├── gmusic │ │ ├── constants.js │ │ ├── interface.js │ │ └── status.js │ ├── pandora │ │ ├── constants.js │ │ ├── interface.js │ │ └── status.js │ ├── songza │ │ ├── constants.js │ │ ├── interface.js │ │ └── status.js │ └── spotify │ │ ├── constants.js │ │ ├── interface.js │ │ └── status.js └── scrobble.js ├── styles ├── chrome-bootstrap.css ├── fonts.css ├── material.red-blue.min.css └── popup.css └── templates ├── albums.html ├── artist.html ├── artists.html ├── controls-left.html ├── controls-right.html ├── current_playlist.html ├── loading.html ├── options.html ├── playlist.html ├── playlists.html ├── recents.html ├── search.html └── stations.html /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | img/sprites.psd 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## MiniPlay - control music streaming sites from anywhere in Chrome 2 | [MiniPlay](https://chrome.google.com/webstore/detail/miniplay/dfddfiedihbijfeacjamchlliogmjjnd) adds a miniplayer and global keyboard shortcuts to various music players, including Spotify, Google Play Music, Pandora, and Songza. 3 | 4 | ### Features 5 | 6 | - Control playback from a popup 7 | - Global (Chrome-wide) shortcuts 8 | - Rich notifications 9 | - Last.fm scrobbling 10 | 11 | The extension does not collect any information. 12 | -------------------------------------------------------------------------------- /background.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /fonts/Roboto-300/Roboto-300.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jchen1/MiniPlay/a6a5695c3b8229bc311f76876409779ce15d854a/fonts/Roboto-300/Roboto-300.eot -------------------------------------------------------------------------------- /fonts/Roboto-300/Roboto-300.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jchen1/MiniPlay/a6a5695c3b8229bc311f76876409779ce15d854a/fonts/Roboto-300/Roboto-300.ttf -------------------------------------------------------------------------------- /fonts/Roboto-300/Roboto-300.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jchen1/MiniPlay/a6a5695c3b8229bc311f76876409779ce15d854a/fonts/Roboto-300/Roboto-300.woff -------------------------------------------------------------------------------- /fonts/Roboto-300/Roboto-300.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jchen1/MiniPlay/a6a5695c3b8229bc311f76876409779ce15d854a/fonts/Roboto-300/Roboto-300.woff2 -------------------------------------------------------------------------------- /fonts/Roboto-500/LICENSE.txt: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright [yyyy] [name of copyright owner] 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | -------------------------------------------------------------------------------- /fonts/Roboto-500/Roboto-500.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jchen1/MiniPlay/a6a5695c3b8229bc311f76876409779ce15d854a/fonts/Roboto-500/Roboto-500.eot -------------------------------------------------------------------------------- /fonts/Roboto-500/Roboto-500.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jchen1/MiniPlay/a6a5695c3b8229bc311f76876409779ce15d854a/fonts/Roboto-500/Roboto-500.ttf -------------------------------------------------------------------------------- /fonts/Roboto-500/Roboto-500.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jchen1/MiniPlay/a6a5695c3b8229bc311f76876409779ce15d854a/fonts/Roboto-500/Roboto-500.woff -------------------------------------------------------------------------------- /fonts/Roboto-500/Roboto-500.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jchen1/MiniPlay/a6a5695c3b8229bc311f76876409779ce15d854a/fonts/Roboto-500/Roboto-500.woff2 -------------------------------------------------------------------------------- /fonts/Roboto-700/LICENSE.txt: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright [yyyy] [name of copyright owner] 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | -------------------------------------------------------------------------------- /fonts/Roboto-700/Roboto-700.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jchen1/MiniPlay/a6a5695c3b8229bc311f76876409779ce15d854a/fonts/Roboto-700/Roboto-700.eot -------------------------------------------------------------------------------- /fonts/Roboto-700/Roboto-700.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jchen1/MiniPlay/a6a5695c3b8229bc311f76876409779ce15d854a/fonts/Roboto-700/Roboto-700.ttf -------------------------------------------------------------------------------- /fonts/Roboto-700/Roboto-700.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jchen1/MiniPlay/a6a5695c3b8229bc311f76876409779ce15d854a/fonts/Roboto-700/Roboto-700.woff -------------------------------------------------------------------------------- /fonts/Roboto-700/Roboto-700.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jchen1/MiniPlay/a6a5695c3b8229bc311f76876409779ce15d854a/fonts/Roboto-700/Roboto-700.woff2 -------------------------------------------------------------------------------- /fonts/Roboto-regular/LICENSE.txt: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright [yyyy] [name of copyright owner] 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | -------------------------------------------------------------------------------- /fonts/Roboto-regular/Roboto-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jchen1/MiniPlay/a6a5695c3b8229bc311f76876409779ce15d854a/fonts/Roboto-regular/Roboto-regular.eot -------------------------------------------------------------------------------- /fonts/Roboto-regular/Roboto-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jchen1/MiniPlay/a6a5695c3b8229bc311f76876409779ce15d854a/fonts/Roboto-regular/Roboto-regular.ttf -------------------------------------------------------------------------------- /fonts/Roboto-regular/Roboto-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jchen1/MiniPlay/a6a5695c3b8229bc311f76876409779ce15d854a/fonts/Roboto-regular/Roboto-regular.woff -------------------------------------------------------------------------------- /fonts/Roboto-regular/Roboto-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jchen1/MiniPlay/a6a5695c3b8229bc311f76876409779ce15d854a/fonts/Roboto-regular/Roboto-regular.woff2 -------------------------------------------------------------------------------- /fonts/icons.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jchen1/MiniPlay/a6a5695c3b8229bc311f76876409779ce15d854a/fonts/icons.woff2 -------------------------------------------------------------------------------- /img/default_album.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jchen1/MiniPlay/a6a5695c3b8229bc311f76876409779ce15d854a/img/default_album.png -------------------------------------------------------------------------------- /img/default_artist.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jchen1/MiniPlay/a6a5695c3b8229bc311f76876409779ce15d854a/img/default_artist.png -------------------------------------------------------------------------------- /img/eq_paused.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jchen1/MiniPlay/a6a5695c3b8229bc311f76876409779ce15d854a/img/eq_paused.png -------------------------------------------------------------------------------- /img/eq_playing.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jchen1/MiniPlay/a6a5695c3b8229bc311f76876409779ce15d854a/img/eq_playing.gif -------------------------------------------------------------------------------- /img/icon-128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jchen1/MiniPlay/a6a5695c3b8229bc311f76876409779ce15d854a/img/icon-128.png -------------------------------------------------------------------------------- /img/icon-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jchen1/MiniPlay/a6a5695c3b8229bc311f76876409779ce15d854a/img/icon-16.png -------------------------------------------------------------------------------- /img/icon-19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jchen1/MiniPlay/a6a5695c3b8229bc311f76876409779ce15d854a/img/icon-19.png -------------------------------------------------------------------------------- /img/icon-38.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jchen1/MiniPlay/a6a5695c3b8229bc311f76876409779ce15d854a/img/icon-38.png -------------------------------------------------------------------------------- /img/icon-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jchen1/MiniPlay/a6a5695c3b8229bc311f76876409779ce15d854a/img/icon-48.png -------------------------------------------------------------------------------- /img/notification_ff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jchen1/MiniPlay/a6a5695c3b8229bc311f76876409779ce15d854a/img/notification_ff.png -------------------------------------------------------------------------------- /img/notification_pp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jchen1/MiniPlay/a6a5695c3b8229bc311f76876409779ce15d854a/img/notification_pp.png -------------------------------------------------------------------------------- /img/promo-large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jchen1/MiniPlay/a6a5695c3b8229bc311f76876409779ce15d854a/img/promo-large.png -------------------------------------------------------------------------------- /img/promo-medium.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jchen1/MiniPlay/a6a5695c3b8229bc311f76876409779ce15d854a/img/promo-medium.png -------------------------------------------------------------------------------- /img/promo-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jchen1/MiniPlay/a6a5695c3b8229bc311f76876409779ce15d854a/img/promo-small.png -------------------------------------------------------------------------------- /manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "manifest_version": 2, 3 | 4 | "name": "MiniPlay", 5 | "short_name": "MiniPlay", 6 | "description": "Control Google Music, Pandora, and Spotify with a popup and keyboard shortcuts.", 7 | "version": "0.7.3", 8 | 9 | "icons": { 10 | "16": "img/icon-16.png", 11 | "48": "img/icon-48.png", 12 | "128": "img/icon-128.png" }, 13 | 14 | "author": "Jeff Chen", 15 | 16 | "homepage_url": "https://github.com/iambald/MiniPlay", 17 | 18 | "background": { 19 | "page": "background.html" 20 | }, 21 | 22 | "content_security_policy": "script-src 'self' https://ssl.google-analytics.com; object-src 'self'", 23 | 24 | "browser_action": { 25 | "default_icon": { 26 | "19": "img/icon-19.png", 27 | "38": "img/icon-38.png" 28 | }, 29 | "default_title": "MiniPlay", 30 | "default_popup": "popup.html" 31 | }, 32 | 33 | "permissions": [ 34 | "notifications", 35 | "storage", 36 | "tabs", 37 | "*://play.google.com/music*", 38 | "*://*.pandora.com/*", 39 | "*://songza.com/*", 40 | "*://play.spotify.com/*" 41 | ], 42 | 43 | "content_scripts": [ 44 | { 45 | "matches": ["*://play.google.com/music*", "*://*.pandora.com/*", "*://songza.com/*", "*://play.spotify.com/*"], 46 | "js": ["scripts/loader.js"] 47 | } 48 | ], 49 | 50 | "options_page": "options.html", 51 | 52 | "commands": { 53 | "play": { 54 | "suggested_key": { 55 | "default": "MediaPlayPause" 56 | }, 57 | "description": "Play/Pause", 58 | "global": true 59 | }, 60 | "ff": { 61 | "suggested_key": { 62 | "default": "MediaNextTrack" 63 | }, 64 | "description": "Play next song", 65 | "global": true 66 | }, 67 | "rew": { 68 | "suggested_key": { 69 | "default": "MediaPrevTrack" 70 | }, 71 | "description": "Play previous song", 72 | "global": true 73 | }, 74 | "up": { 75 | "description": "Thumbs up" 76 | }, 77 | "down": { 78 | "description": "Thumbs down" 79 | }, 80 | "shuffle": { 81 | "description": "Shuffle songs" 82 | }, 83 | "repeat": { 84 | "description": "Repeat songs" 85 | } 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /options.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | MiniPlay Options 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 27 |
28 |
29 |
30 |

31 | Settings 32 |

33 |
34 |
35 |
36 |

37 | Notifications 38 |

39 |
40 | 44 |
45 |
46 |
47 |

48 | Shortcuts 49 |

50 |
51 | 55 |
56 |

57 | Modify keybindings 58 |

59 |
60 |
61 |

62 | Last.fm 63 |

64 |
65 | 69 |
70 |

71 | Authorize Last.fm account 72 |

73 | You appear to be logged in. If you are having problems scrobbling, reauthorizing may fix the issue. 74 |

75 |

76 |
77 |
78 |
79 | 92 | 113 |
114 |
115 | 116 | 117 | -------------------------------------------------------------------------------- /popup.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 103 | 104 | 105 | 106 | 107 | -------------------------------------------------------------------------------- /privacy.md: -------------------------------------------------------------------------------- 1 | # Privacy Policy 2 | 3 | I built MiniPlay as an Open Source app. This SERVICE is provided by at no cost and is intended for use as is. 4 | 5 | This page is used to inform visitors regarding my policies with the collection, use, and disclosure of Personal Information if anyone decided to use my Service. 6 | 7 | If you choose to use my Service, then you agree to the collection and use of information in relation to this policy. The Personal Information that I collect is used for providing and improving the Service. I will not use or share your information with anyone except as described in this Privacy Policy. 8 | 9 | ## Information Collection and Use 10 | 11 | No Personal Information is collected. 12 | 13 | ## Log Data 14 | 15 | No data is externally logged. 16 | 17 | ## Cookies 18 | 19 | Cookies are files with a small amount of data that are commonly used as anonymous unique identifiers. These are sent to your browser from the websites that you visit and are stored on your device’s internal memory. 20 | 21 | This Service does not use these “cookies” explicitly. However, the app may use third party code and libraries that use “cookies” to collect information and improve their services. You have the option to either accept or refuse these cookies and know when a cookie is being sent to your device. If you choose to refuse our cookies, you may not be able to use some portions of this Service. 22 | 23 | ## Service Providers 24 | 25 | I may employ third-party companies and individuals due to the following reasons: 26 | 27 | - To facilitate our Service; 28 | - To provide the Service on our behalf; 29 | - To perform Service-related services; or 30 | - To assist us in analyzing how our Service is used. 31 | - I want to inform users of this Service that these third parties have access to your Personal Information. The reason is to perform the tasks assigned to them on our behalf. However, they are obligated not to disclose or use the information for any other purpose. 32 | 33 | ## Security 34 | 35 | No method of transmission over the internet, or method of electronic storage is 100% secure and reliable, and I cannot guarantee its absolute security. 36 | 37 | ## Links to Other Sites 38 | 39 | This Service may contain links to other sites. If you click on a third-party link, you will be directed to that site. Note that these external sites are not operated by me. Therefore, I strongly advise you to review the Privacy Policy of these websites. I have no control over and assume no responsibility for the content, privacy policies, or practices of any third-party sites or services. 40 | 41 | ## Children’s Privacy 42 | 43 | These Services do not address anyone under the age of 13. I do not knowingly collect personally identifiable information from children under 13. In the case I discover that a child under 13 has provided me with personal information, I immediately delete this from our servers. If you are a parent or guardian and you are aware that your child has provided us with personal information, please contact me so that I will be able to do necessary actions. 44 | 45 | ## Changes to This Privacy Policy 46 | 47 | I may update our Privacy Policy from time to time. Thus, you are advised to review this page periodically for any changes. I will notify you of any changes by posting the new Privacy Policy on this page. These changes are effective immediately after they are posted on this page. 48 | 49 | ## Contact Us 50 | 51 | If you have any questions or suggestions about my Privacy Policy, do not hesitate to contact me at privacy@jeff.yt. 52 | -------------------------------------------------------------------------------- /scripts/background.js: -------------------------------------------------------------------------------- 1 | //background tab, always running 2 | 3 | chrome.storage.local.set({ last_notification: "" }); 4 | 5 | var interface_port = null, 6 | popup_port = null; 7 | var loader_ports = {}; 8 | 9 | chrome.runtime.onConnect.addListener(function (port) { 10 | if (port.name == "loader") { 11 | port.id = port.sender.tab.id; 12 | loader_ports[port.id] = port; 13 | port.onMessage.addListener(function (msg) { 14 | if (msg.protocol) { 15 | chrome.tabs.executeScript(port.id, { file: "scripts/enums.js" }); 16 | chrome.tabs.executeScript(port.id, { 17 | file: "scripts/protocols/global.js", 18 | }); 19 | chrome.tabs.executeScript(port.id, { 20 | file: "scripts/protocols/" + msg.protocol + "/constants.js", 21 | }); 22 | chrome.tabs.executeScript(port.id, { 23 | file: "scripts/protocols/" + msg.protocol + "/status.js", 24 | }); 25 | chrome.tabs.executeScript(port.id, { 26 | file: "scripts/protocols/" + msg.protocol + "/interface.js", 27 | }); 28 | } 29 | }); 30 | port.onDisconnect.addListener(function () { 31 | loader_ports[port.id] = null; 32 | }); 33 | } 34 | if (port.name == "interface" && !interface_port) { 35 | interface_port = port; 36 | interface_port.id = port.sender.tab.id; 37 | port.onMessage.addListener(function (msg) { 38 | if (msg.scrobble == true) { 39 | scrobble(msg.oldValue); 40 | } 41 | if (msg.notify == true) { 42 | create_notification(msg.newValue); 43 | now_playing(msg.newValue); 44 | } 45 | }); 46 | if (popup_port) { 47 | popup_port.postMessage({ type: "connect", id: interface_port.id }); 48 | } 49 | 50 | port.onDisconnect.addListener(function () { 51 | interface_port = null; 52 | }); 53 | } else if (port.name == "popup") { 54 | popup_port = port; 55 | port.onDisconnect.addListener(function () { 56 | popup_port = null; 57 | }); 58 | if (interface_port) { 59 | popup_port.postMessage({ type: "connect", id: interface_port.id }); 60 | } 61 | } 62 | }); 63 | 64 | function notify_helper(details, url) { 65 | chrome.notifications.create( 66 | "", 67 | { 68 | type: "basic", 69 | title: details.title, 70 | message: details.artist, 71 | contextMessage: details.album, 72 | iconUrl: url, 73 | buttons: [ 74 | { 75 | title: "Play/Pause", 76 | iconUrl: "img/notification_pp.png", 77 | }, 78 | { 79 | title: "Next song", 80 | iconUrl: "img/notification_ff.png", 81 | }, 82 | ], 83 | }, 84 | function (id) { 85 | chrome.storage.local.get("last_notification", function (data) { 86 | if (data["last_notification"]) { 87 | chrome.notifications.clear( 88 | data["last_notification"], 89 | function (cleared) {} 90 | ); 91 | } 92 | chrome.storage.local.set({ last_notification: id }); 93 | }); 94 | } 95 | ); 96 | } 97 | 98 | function create_notification(details) { 99 | chrome.storage.sync.get("notifications-enabled", function (ans) { 100 | if (ans["notifications-enabled"] === true) { 101 | var xhr = new XMLHttpRequest(); 102 | xhr.open("GET", details.album_art); 103 | xhr.responseType = "blob"; 104 | xhr.onload = function () { 105 | notify_helper(details, window.URL.createObjectURL(this.response)); 106 | }; 107 | xhr.onerror = function () { 108 | notify_helper(details, "img/default_album.png"); 109 | }; 110 | xhr.send(null); 111 | } 112 | }); 113 | } 114 | 115 | chrome.notifications.onClicked.addListener(function (id) { 116 | chrome.storage.local.get("lastfm_fail_id", function (data) { 117 | if (data["lastfm_fail_id"] === id) { 118 | chrome.tabs.create({ url: chrome.extension.getURL("options.html") }); 119 | } else if (interface_port) { 120 | chrome.tabs.update(interface_port.id, { highlighted: true }); 121 | } 122 | }); 123 | }); 124 | 125 | chrome.notifications.onButtonClicked.addListener(function (id, buttonIndex) { 126 | chrome.storage.local.get("last_notification", function (data) { 127 | if (data["last_notification"] == id && interface_port) { 128 | switch (buttonIndex) { 129 | case 0: // Play/Pause 130 | interface_port.postMessage({ action: "send_command", type: "play" }); 131 | break; 132 | case 1: // Next 133 | interface_port.postMessage({ action: "send_command", type: "ff" }); 134 | break; 135 | } 136 | } 137 | }); 138 | }); 139 | 140 | chrome.runtime.onInstalled.addListener(function (details) { 141 | if (details.reason == "install") { 142 | chrome.storage.sync.get( 143 | ["notifications-enabled", "shortcuts-enabled", "scrobbling-enabled"], 144 | function (data) { 145 | if (data["notifications-enabled"] === undefined) { 146 | chrome.storage.sync.set({ "notifications-enabled": true }); 147 | } 148 | if (data["shortcuts-enabled"] === undefined) { 149 | chrome.storage.sync.set({ "shortcuts-enabled": true }); 150 | } 151 | if (data["scrobbling-enabled"] === undefined) { 152 | chrome.storage.sync.set({ "scrobbling-enabled": true }); 153 | } 154 | chrome.tabs.create({ url: chrome.extension.getURL("options.html") }); 155 | } 156 | ); 157 | } 158 | 159 | if (details.reason == "install" || details.reason == "update") { 160 | chrome.tabs.query({}, function (tabs) { 161 | tabs.forEach(function (tab) { 162 | if ( 163 | tab.url.search("http") >= 0 && 164 | tab.url.search("chrome.google.com/webstore") == -1 165 | ) { 166 | chrome.tabs.executeScript(tab.id, { file: "scripts/loader.js" }); 167 | } 168 | }); 169 | }); 170 | } 171 | }); 172 | 173 | chrome.commands.onCommand.addListener(function (command) { 174 | chrome.storage.sync.get("shortcuts-enabled", function (sync) { 175 | if (sync["shortcuts-enabled"] === true && interface_port != null) { 176 | interface_port.postMessage({ action: "send_command", type: command }); 177 | } 178 | }); 179 | }); 180 | -------------------------------------------------------------------------------- /scripts/controllers.js: -------------------------------------------------------------------------------- 1 | var controller = popupApp.controller('PopupController', ['$scope', function($scope) { 2 | $scope.StateEnum = StateEnum; 3 | $scope.RepeatEnum = RepeatEnum; 4 | $scope.ThumbEnum = ThumbEnum; 5 | $scope.StatusEnum = StatusEnum; 6 | 7 | $scope.background_port = null; 8 | $scope.interface_port = null; 9 | 10 | $scope.colors = { 11 | gmusic: '#ef6c00', 12 | pandora: '#455774', 13 | spotify: '#84bd00', 14 | none: 'rgb(244, 67, 54)' 15 | }; 16 | 17 | $scope.status = { 18 | vol_pressed: false, 19 | playlist_pressed: false, 20 | slider_dragging: false, 21 | displayed_content: '', 22 | scrolling_busy: false, 23 | drawer_open: false, 24 | current_color: $scope.colors.none 25 | }; 26 | 27 | $scope.music_status = { 28 | state: StateEnum.NO_TAB, 29 | title: 'No music tab found', 30 | artist: '', 31 | album: '', 32 | album_art: 'img/default_album.png', 33 | shuffle: false, 34 | repeat: RepeatEnum.NONE, 35 | current_time: '', 36 | total_time: '', 37 | current_time_s: 0, 38 | total_time_s: 0, 39 | status: StatusEnum.PAUSED, 40 | disabled: {}, 41 | volume: 100, 42 | thumb: ThumbEnum.NONE, 43 | artist_id: '', 44 | album_id: '', 45 | protocol: 'gmusic' 46 | }; 47 | 48 | $scope.data = { 49 | playlists: { 50 | recent_playlists: [], 51 | auto_playlists: [], 52 | my_playlists: [] 53 | }, 54 | recent: [], 55 | stations: { 56 | recent_stations: [], 57 | my_stations: [] 58 | }, 59 | artists: [], 60 | albums: [], 61 | playlist: [], 62 | current_playlist: [], 63 | loading: [], 64 | '': [], 65 | last_history: [], 66 | query: '', 67 | search: { 68 | artists: [], 69 | albums: [], 70 | songs: [] 71 | }, 72 | artist: { 73 | albums: [], 74 | songs: [] 75 | }, 76 | title: '', 77 | subtitle: '', 78 | view_stack: [] 79 | } 80 | 81 | $scope.settings = {}; 82 | 83 | $scope.counts = {}; 84 | 85 | $scope.repeat_icon = function() { 86 | return ($scope.music_status.repeat == RepeatEnum.ONE) ? 'repeat_one' : 'repeat'; 87 | }; 88 | 89 | $scope.menu_icon = function() { 90 | return ($scope.status.displayed_content == '' || $scope.status.displayed_content == 'current_playlist') ? 'menu' : 'arrow_back'; 91 | }; 92 | 93 | $scope.menu_icon_click = function() { 94 | if ($scope.music_status.protocol == 'gmusic') { 95 | if ($scope.status.displayed_content == '' || $scope.status.displayed_content == 'current_playlist') { 96 | $scope.status.drawer_open = true; 97 | } 98 | else { 99 | $scope.status.drawer_open = false; 100 | 101 | if ($scope.data.view_stack.length > 0) { 102 | var old_view = $scope.data.view_stack.pop(); 103 | $scope.status.displayed_content = old_view.content; 104 | $scope.data.title = old_view.title; 105 | $scope.data.subtitle = old_view.subtitle; 106 | } 107 | else { 108 | $scope.status.displayed_content = ''; 109 | } 110 | } 111 | } 112 | else { 113 | // todo: something?? 114 | } 115 | }; 116 | 117 | $scope.volume_icon = function() { 118 | if ($scope.music_status.volume == 0) { 119 | return 'volume_mute'; 120 | } 121 | else if ($scope.music_status.volume < 50) { 122 | return 'volume_down'; 123 | } 124 | else { 125 | return 'volume_up'; 126 | } 127 | } 128 | 129 | $scope.status_icon = function() { 130 | return ($scope.music_status.status == StatusEnum.PAUSED) ? 'play_arrow' : 'pause'; 131 | } 132 | 133 | $scope.should_show_art = function() { 134 | return ($scope.status.playlist_pressed == false && $scope.status.displayed_content.length == 0); 135 | } 136 | 137 | $scope.album_art_background = function() { 138 | return ($scope.music_status.state == StateEnum.PLAYING ? '' : 'linear-gradient(to bottom, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0)), no-repeat ') + 'url(' + $scope.music_status.album_art + ')'; 139 | }; 140 | 141 | $scope.artist_background = function(image) { 142 | return 'url(' + image + ') center / cover'; 143 | } 144 | 145 | $scope.status_title = function() { 146 | return ($scope.music_status.status == StatusEnum.PAUSED) ? 'Play' : 'Pause'; 147 | } 148 | 149 | $scope.search = function() { 150 | if ($scope.interface_port) { 151 | $scope.interface_port.postMessage( 152 | { 153 | action: 'search', 154 | query: $scope.data.query 155 | }); 156 | $scope.data.title = 'Search: ' + $scope.data.query; 157 | $scope.status.displayed_content = 'loading'; 158 | $scope.status.playlist_pressed = false; 159 | $scope.status.drawer_open = false; 160 | } 161 | } 162 | 163 | $scope.set_state = function(state) { 164 | $scope.music_status.state = state; 165 | switch (state) { 166 | case StateEnum.NO_TAB: 167 | $scope.music_status.album_art = 'img/default_album.png'; 168 | $scope.music_status.title = 'No music tab found'; 169 | $scope.music_status.artist = ''; 170 | $scope.music_status.album = ''; 171 | break; 172 | case StateEnum.NO_SONG: 173 | $scope.music_status.album_art = 'img/default_album.png'; 174 | $scope.music_status.title = 'No song selected'; 175 | $scope.music_status.artist = ''; 176 | $scope.music_status.album = ''; 177 | break; 178 | case StateEnum.PLAYING: 179 | // do nothing 180 | break; 181 | } 182 | }; 183 | 184 | $scope.set_disabled = function(disabled) { 185 | $scope.music_status.disabled = {}; 186 | for (var i = 0; i < disabled.length; i++) { 187 | $scope.music_status.disabled[disabled[i]] = true; 188 | } 189 | } 190 | 191 | $scope.playlist_click = function(id) { 192 | if ($scope.interface_port) { 193 | $scope.interface_port.postMessage( 194 | { 195 | action: 'data_click', 196 | click_type: 'playlist', 197 | id: id, 198 | history: $scope.data.last_history 199 | }); 200 | } 201 | } 202 | 203 | $scope.playlist_button_pressed = function() { 204 | $scope.status.playlist_pressed=!$scope.status.playlist_pressed; 205 | if ($scope.status.playlist_pressed) { 206 | $scope.status.displayed_content = 'current_playlist'; 207 | } 208 | else { 209 | $scope.status.displayed_content = ''; 210 | } 211 | } 212 | 213 | $scope.settings_click = function($event) { 214 | $scope.status.displayed_content = 'options'; 215 | $scope.status.drawer_open = false; 216 | $scope.data.title = 'options'; 217 | } 218 | 219 | $scope.data_click = function(type, data) { 220 | var old_content = $scope.status.displayed_content; 221 | if ($scope.interface_port && $scope.music_status.protocol == 'gmusic') { 222 | $scope.status.displayed_content = 'loading'; 223 | switch (type) { 224 | case 'recent': 225 | $scope.status.displayed_content = ''; 226 | case 'album': 227 | case 'artist': 228 | $scope.interface_port.postMessage( 229 | { 230 | action: 'data_click', 231 | click_type: type, 232 | index: data.index, 233 | id: data.id, 234 | history: $scope.data.last_history, 235 | }); 236 | if (type != 'recent') $scope.data.view_stack.push({ 237 | content: old_content, 238 | title: $scope.data.title, 239 | subtitle: $scope.data.subtitle 240 | }); 241 | break; 242 | case 'recent_station': 243 | case 'my_station': 244 | $scope.interface_port.postMessage( 245 | { 246 | action: 'data_click', 247 | click_type: 'station', 248 | station_type: type, 249 | index: data.index, 250 | history: $scope.data.last_history, 251 | }); 252 | $scope.status.displayed_content = ''; 253 | break; 254 | case 'recent_playlist': 255 | case 'auto_playlist': 256 | case 'my_playlist': 257 | $scope.interface_port.postMessage( 258 | { 259 | action: 'data_click', 260 | click_type: 'playlists', 261 | playlist_type: type, 262 | index: data.index, 263 | history: $scope.data.last_history, 264 | }); 265 | $scope.status.displayed_content = ''; 266 | break; 267 | } 268 | } 269 | } 270 | 271 | $scope.drawer_click = function(clicked) { 272 | if ($scope.interface_port) { 273 | $scope.interface_port.postMessage( 274 | { 275 | action: 'get_' + clicked, 276 | offset: 0 277 | }); 278 | } 279 | 280 | if (clicked != 'library') { 281 | $scope.status.displayed_content = 'loading'; 282 | $scope.data.title = clicked; 283 | $scope.data.view_stack.length = 0; 284 | } 285 | else { 286 | $scope.status.displayed_content = ''; 287 | } 288 | 289 | $scope.status.playlist_pressed = false; 290 | 291 | $scope.status.drawer_open = false; 292 | } 293 | 294 | $scope.album_art_click = function() { 295 | if ($scope.interface_port) { 296 | chrome.tabs.update($scope.interface_port.id, {highlighted: true}); 297 | chrome.tabs.get($scope.interface_port.id, function (tab) { 298 | chrome.windows.update(tab.windowId, {focused: true}); 299 | }); 300 | } 301 | } 302 | 303 | $scope.clear_stack = function() { 304 | $scope.data.view_stack.length = 0; 305 | $scope.status.displayed_content = ''; 306 | $scope.data.title = ''; 307 | $scope.data.subtitle = ''; 308 | } 309 | 310 | $scope.scroll_data = function(content_type) { 311 | if ($scope.interface_port) { 312 | $scope.interface_port.postMessage( 313 | { 314 | action: 'get_' + content_type, 315 | offset: (content_type == 'stations' ? 0 : $scope.data[content_type].length) 316 | }); 317 | } 318 | $scope.status.scrolling_busy = true; 319 | } 320 | 321 | $scope.lastfm_auth = function() { 322 | chrome.runtime.sendMessage({type: 'auth'}, function (response) {}); 323 | } 324 | 325 | $scope.launch_settings = function() { 326 | chrome.tabs.create({url: "chrome://extensions/configureCommands"}); 327 | } 328 | 329 | $scope.should_disable_scroll = function() { 330 | if ($scope.status.scrolling_busy) return true; 331 | 332 | 333 | if ($scope.status.displayed_content == 'stations') { 334 | // TODO 335 | } 336 | else { 337 | return $scope.counts[$scope.status.displayed_content] == $scope.data[$scope.status.displayed_content].length; 338 | } 339 | } 340 | 341 | $scope.is_song_playing = function(song) { 342 | return (song.title == $scope.music_status.title && 343 | song.artist == $scope.music_status.artist && 344 | song.album == $scope.music_status.album); 345 | } 346 | 347 | $scope.is_drawer_open = function() { 348 | return $('.mdl-layout__drawer').hasClass('is-visible'); 349 | } 350 | 351 | $scope.handle_key = function($event) { 352 | if (!$('.mdl-layout__drawer').hasClass('is-visible') && $event.keyCode == 32) { 353 | $scope.music_status.status = !$scope.music_status.status; 354 | if ($scope.interface_port) { 355 | $scope.interface_port.postMessage( 356 | { 357 | action: 'send_command', 358 | type: 'play' 359 | }); 360 | } 361 | } 362 | else if (!$('.mdl-layout__drawer').hasClass('is-visible') && $event.keyCode == 8) { 363 | if ($scope.data.view_stack.length > 0) { 364 | var old_view = $scope.data.view_stack.pop(); 365 | $scope.status.displayed_content = old_view.content; 366 | $scope.data.title = old_view.title; 367 | $scope.data.subtitle = old_view.subtitle; 368 | } 369 | else { 370 | $scope.status.displayed_content = ''; 371 | } 372 | } 373 | } 374 | 375 | $scope.change_color = function(new_color) { 376 | var old_color = $scope.status.current_color; 377 | for (var i = 0; i < document.styleSheets.length; i++) { 378 | if (document.styleSheets[i].href) { 379 | $.each(document.styleSheets[i].cssRules, function(index, rule) { 380 | if (rule && rule.style && rule.cssText.indexOf(old_color) != -1) { 381 | rule.style.cssText = rule.style.cssText.replace(old_color, new_color); 382 | } 383 | }); 384 | } 385 | } 386 | $scope.status.current_color = new_color; 387 | } 388 | 389 | $scope.$on('$includeContentLoaded', function (event, src) { 390 | componentHandler.upgradeDom(); 391 | 392 | if (src == 'templates/options.html') { 393 | chrome.storage.sync.get(['shortcuts-enabled', 'notifications-enabled', 'scrobbling-enabled', 'lastfm_sessionID'], function(data) { 394 | $scope.$apply(function() { 395 | $.extend($scope.settings, data); 396 | }); 397 | }); 398 | } 399 | }); 400 | 401 | var init = function () { 402 | $scope.background_port = chrome.runtime.connect({name: "popup"}); 403 | 404 | $scope.background_port.onMessage.addListener(function(msg) { 405 | if (msg.type == 'connect') { 406 | $scope.interface_port = chrome.tabs.connect(msg.id, {name: "popup"}); 407 | $scope.interface_port.id = msg.id; 408 | $scope.interface_port.onDisconnect.addListener(function() { 409 | $scope.interface_port = null; 410 | $scope.$apply(function() { 411 | $scope.set_state(StateEnum.NO_TAB); 412 | }); 413 | }); 414 | $scope.interface_port.onMessage.addListener(route_interface_msg); 415 | $scope.$apply(function() { 416 | $scope.set_state(StateEnum.NO_SONG); 417 | }); 418 | } 419 | }); 420 | 421 | chrome.storage.onChanged.addListener(function(changes, area) { 422 | $scope.$apply(function() { 423 | if (area == 'sync') { 424 | if (changes['notifications-enabled']) { 425 | $scope.settings['notifications-enabled'] = changes['notifications-enabled'].newValue; 426 | } 427 | if (changes['shortcuts-enabled']) { 428 | $scope.settings['shortcuts-enabled'] = changes['shortcuts-enabled'].newValue; 429 | } 430 | if (changes['scrobbling-enabled']) { 431 | $scope.settings['scrobbling-enabled'] = changes['scrobbling-enabled'].newValue; 432 | } 433 | if (changes['lastfm_sessionID']) { 434 | $scope.settings['lastfm_sessionID'] = changes['lastfm_sessionID'].newValue; 435 | } 436 | } 437 | }); 438 | }); 439 | 440 | function setupAnalytics() { 441 | var _gaq = _gaq || []; 442 | _gaq.push(['_setAccount', 'UA-48472705-1']); 443 | _gaq.push(['_trackPageview']); 444 | 445 | var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; 446 | ga.src = 'https://ssl.google-analytics.com/ga.js'; 447 | var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); 448 | } 449 | 450 | function route_interface_msg(msg) { 451 | if (msg.type === 'status') { 452 | update(msg.data); 453 | } 454 | else { 455 | if (msg.type === 'artists' || msg.type === 'albums') { 456 | $scope.data[msg.type] = $scope.data[msg.type].slice(0, msg.offset).concat(msg.data); 457 | $scope.status.scrolling_busy = false; 458 | $scope.counts[msg.type] = msg.count; 459 | } 460 | else if (msg.type === 'playlists') { 461 | $scope.data.playlists.my_playlists = $scope.data.playlists.my_playlists.slice(0, msg.offset).concat(msg.data.my_playlists); 462 | $scope.data.playlists.auto_playlists = msg.data.auto_playlists; 463 | $scope.data.playlists.recent_playlists = msg.data.recent_playlists; 464 | $scope.status.scrolling_busy = false; 465 | $scope.counts.playlists = msg.count; 466 | } 467 | else if (msg.type === 'search') { 468 | $scope.data.search = msg.data; 469 | } 470 | else if (msg.type === 'artist') { 471 | $scope.data.artist = msg.data; 472 | $scope.data.title = msg.title; 473 | } 474 | else if (msg.type === 'playlist') { 475 | $scope.data.playlist = msg.data; 476 | $scope.data.title = msg.title; 477 | $scope.data.subtitle = msg.subtitle; 478 | } 479 | else { 480 | $scope.data[msg.type] = msg.data; 481 | } 482 | $scope.data.last_history = msg.history; 483 | $scope.status.displayed_content = msg.type; 484 | } 485 | } 486 | 487 | function update(response) { 488 | if (chrome.extension.lastError) { 489 | $scope.$apply(function() { 490 | $scope.set_state(StateEnum.NO_TAB); 491 | }); 492 | } 493 | else { 494 | $.extend($scope.music_status, response); 495 | if (response.title === '') { 496 | $scope.$apply(function() { 497 | $scope.set_state(StateEnum.NO_SONG); 498 | $scope.change_color($scope.colors[response.protocol]); 499 | }); 500 | } 501 | else { 502 | $scope.$apply(function() { 503 | $scope.set_state(StateEnum.PLAYING); 504 | $scope.change_color($scope.colors[response.protocol]); 505 | 506 | if ($scope.status.slider_dragging === true) { 507 | response.current_time_s = $scope.current_time_s; 508 | response.current_time = $scope.current_time; 509 | } 510 | 511 | $scope.set_disabled(response.disabled_buttons); 512 | 513 | for (var i = 0; response.playlist && i < response.playlist.length; i++) { 514 | if (response.playlist[i].title && 515 | ($scope.data.current_playlist.length <= i || 516 | response.playlist[i].title != $scope.data.current_playlist[i].title || 517 | response.playlist[i].currently_playing != $scope.data.current_playlist[i].currently_playing)) { 518 | $scope.data.current_playlist[i] = response.playlist[i]; 519 | $scope.data.current_playlist[i].index = i; 520 | } 521 | } 522 | }); 523 | } 524 | } 525 | } 526 | 527 | // setupAnalytics(); 528 | } 529 | 530 | init(); 531 | }]); 532 | -------------------------------------------------------------------------------- /scripts/directives.js: -------------------------------------------------------------------------------- 1 | popupApp.directive('mpSlider', function() { 2 | var secondsToHms = function(d) { 3 | d = Number(d); 4 | var h = Math.floor(d / 3600); 5 | var m = Math.floor(d % 3600 / 60); 6 | var s = Math.floor(d % 3600 % 60); 7 | return ((h > 0 ? h + ":" : "") + (m > 0 ? (h > 0 && m < 10 ? "0" : "") + m + ":" : "0:") + (s < 10 ? "0" : "") + s); 8 | }; 9 | 10 | return { 11 | restrict: 'C', 12 | link: function (scope, element, attrs) { 13 | $(element).on('mouseup', function() { 14 | if (scope.interface_port) { 15 | scope.interface_port.postMessage( 16 | { 17 | action: 'send_command', 18 | type: 'slider', 19 | position: $(element).val() / $(element).attr('max') 20 | }); 21 | } 22 | }).on('input', function() { 23 | $('#current-time').html(secondsToHms($(element).val())); 24 | }); 25 | 26 | scope.$watch(function() { 27 | return attrs.value; 28 | }, function() { 29 | if (element[0].MaterialSlider) { 30 | element[0].MaterialSlider.change(element[0].getAttribute('value')); 31 | } 32 | $(element).hide().show(0); // Force reflow 33 | }); 34 | 35 | scope.$watch(function() { 36 | return scope.music_status.disabled['slider']; 37 | }, function(value) { 38 | if (value === true) { 39 | $(element).add($(element).parent()).on('mousedown mouseup', false); 40 | } 41 | else { 42 | $(element).add($(element).parent()).off('mousedown mouseup', true); 43 | } 44 | }); 45 | } 46 | } 47 | }); 48 | 49 | popupApp.directive('mdlSwitch', function() { 50 | return { 51 | restrict: 'A', 52 | link: function (scope, element, attrs) { 53 | scope.$watch(attrs.ngModel, function(newValue, oldValue) { 54 | var mdl_switch = element[0].parentElement.MaterialSwitch; 55 | var func = (newValue) ? 'on' : 'off'; 56 | var attr = element[0].getAttribute('ng-model').split('"')[1]; 57 | 58 | if (mdl_switch) mdl_switch[func](); 59 | 60 | console.log(attr + ', ' + newValue); 61 | 62 | if (typeof(newValue) !== 'undefined') { 63 | var new_setting = {}; 64 | new_setting[attr] = newValue; 65 | chrome.storage.sync.set(new_setting); 66 | } 67 | }); 68 | } 69 | } 70 | }) 71 | 72 | popupApp.directive('mpVolslider', function() { 73 | return { 74 | restrict: 'C', 75 | link: function (scope, element, attrs) { 76 | $(element).on('input', function(event) { 77 | if (scope.interface_port) { 78 | scope.interface_port.postMessage( 79 | { 80 | action: 'send_command', 81 | type: 'vslider', 82 | position: $(element).val() / $(element).attr('max') 83 | }); 84 | } 85 | }); 86 | 87 | scope.$watch(function() { 88 | return attrs.value; 89 | }, function() { 90 | if (element[0].MaterialSlider) { 91 | element[0].MaterialSlider.change(); 92 | } 93 | $(element).hide().show(0); // Force reflow 94 | }); 95 | } 96 | } 97 | }); 98 | 99 | popupApp.directive('mpScrollIf', function() { 100 | var getScrollingParent = function(element) { 101 | element = element.parentElement; 102 | while (element) { 103 | if (element.scrollHeight !== element.clientHeight) { 104 | return element; 105 | } 106 | element = element.parentElement; 107 | } 108 | return null; 109 | }; 110 | 111 | return { 112 | restrict: 'A', 113 | link: function (scope, element, attrs) { 114 | scope.$watch(function() { 115 | return scope.$eval(attrs.mpScrollIf); 116 | }, function(value) { 117 | if (value) { 118 | var sp = getScrollingParent(element[0]); 119 | if (sp) { 120 | sp.scrollTop = $(element[0]).offset().top - $(element[0]).height(); 121 | } 122 | } 123 | }); 124 | } 125 | } 126 | }); 127 | 128 | popupApp.directive('infiniteScroll', [ 129 | '$rootScope', '$window', '$timeout', function($rootScope, $window, $timeout) { 130 | return { 131 | link: function(scope, elem, attrs) { 132 | var checkWhenEnabled, handler, scrollDistance, scrollEnabled; 133 | $window = angular.element($window); 134 | $elem = $(elem); 135 | scrollDistance = 0; 136 | if (attrs.infiniteScrollDistance != null) { 137 | scope.$watch(attrs.infiniteScrollDistance, function(value) { 138 | return scrollDistance = parseInt(value, 10); 139 | }); 140 | } 141 | scrollEnabled = true; 142 | checkWhenEnabled = false; 143 | if (attrs.infiniteScrollDisabled != null) { 144 | scope.$watch(attrs.infiniteScrollDisabled, function(value) { 145 | scrollEnabled = !value; 146 | if (scrollEnabled && checkWhenEnabled) { 147 | checkWhenEnabled = false; 148 | return handler(); 149 | } 150 | }); 151 | } 152 | handler = function() { 153 | var remaining = $elem.prop('scrollHeight') - $elem.height() - $elem.scrollTop(); 154 | 155 | var shouldScroll = remaining <= $elem.height() * scrollDistance; 156 | if (shouldScroll && scrollEnabled) { 157 | if ($rootScope.$$phase) { 158 | return scope.$eval(attrs.infiniteScroll); 159 | } else { 160 | return scope.$apply(attrs.infiniteScroll); 161 | } 162 | } else if (shouldScroll) { 163 | return checkWhenEnabled = true; 164 | } 165 | }; 166 | $elem.on('scroll', handler); 167 | scope.$on('$destroy', function() { 168 | return $elem.off('scroll', handler); 169 | }); 170 | return $timeout((function() { 171 | if (attrs.infiniteScrollImmediateCheck) { 172 | if (scope.$eval(attrs.infiniteScrollImmediateCheck)) { 173 | return handler(); 174 | } 175 | } else { 176 | return handler(); 177 | } 178 | }), 0); 179 | } 180 | }; 181 | } 182 | ]); 183 | 184 | popupApp.directive('focusMe', function($parse) { 185 | return { 186 | link: function(scope, element, attrs) { 187 | var model = $parse(attrs.focusMe); 188 | scope.$watch(model, function(value) { 189 | if (value === true) { 190 | element[0].focus(); 191 | } 192 | else { 193 | element[0].blur(); 194 | } 195 | }); 196 | } 197 | }; 198 | }); 199 | 200 | popupApp.directive('mpControl', function() { 201 | return { 202 | restrict: 'A', 203 | link: function (scope, elements, attrs) { 204 | $(elements).on('click', function(event) { 205 | if (scope.interface_port) { 206 | scope.interface_port.postMessage( 207 | { 208 | action: 'send_command', 209 | type: event.currentTarget.getAttribute('id') 210 | }); 211 | event.stopPropagation(); 212 | } 213 | }); 214 | } 215 | } 216 | }); 217 | -------------------------------------------------------------------------------- /scripts/enums.js: -------------------------------------------------------------------------------- 1 | const StateEnum = { 2 | NO_TAB : 0, 3 | NO_SONG : 1, 4 | PLAYING : 2 5 | } 6 | 7 | const RepeatEnum = { 8 | NONE : 0, 9 | ONE : 1, 10 | ALL : 2 11 | } 12 | 13 | const ThumbEnum = { 14 | NONE : 0, 15 | UP : 5, 16 | DOWN : 1 17 | } 18 | 19 | const StatusEnum = { 20 | PAUSED : 0, 21 | PLAYING : 1 22 | } -------------------------------------------------------------------------------- /scripts/loader.js: -------------------------------------------------------------------------------- 1 | // Finds which interface script to use 2 | function load() { 3 | var urls = { 4 | gmusic: "play.google.com/music", 5 | pandora: "pandora.com", 6 | songza: "songza.com", 7 | spotify: "play.spotify.com" 8 | }; 9 | 10 | var background_port = chrome.runtime.connect({name: "loader"}); 11 | for (var protocol in urls) { 12 | if (urls.hasOwnProperty(protocol) && document.URL.search(urls[protocol]) > 0) { 13 | background_port.postMessage({"protocol": protocol}); 14 | } 15 | } 16 | } 17 | 18 | load(); 19 | -------------------------------------------------------------------------------- /scripts/md5.js: -------------------------------------------------------------------------------- 1 | var MD5=function(e){function t(e,t){return e<>>32-t}function n(e,t){var n,r,i,s,o;i=e&2147483648;s=t&2147483648;n=e&1073741824;r=t&1073741824;o=(e&1073741823)+(t&1073741823);if(n&r){return o^2147483648^i^s}if(n|r){if(o&1073741824){return o^3221225472^i^s}else{return o^1073741824^i^s}}else{return o^i^s}}function r(e,t,n){return e&t|~e&n}function i(e,t,n){return e&n|t&~n}function s(e,t,n){return e^t^n}function o(e,t,n){return t^(e|~n)}function u(e,i,s,o,u,a,f){e=n(e,n(n(r(i,s,o),u),f));return n(t(e,a),i)}function a(e,r,s,o,u,a,f){e=n(e,n(n(i(r,s,o),u),f));return n(t(e,a),r)}function f(e,r,i,o,u,a,f){e=n(e,n(n(s(r,i,o),u),f));return n(t(e,a),r)}function l(e,r,i,s,u,a,f){e=n(e,n(n(o(r,i,s),u),f));return n(t(e,a),r)}function c(e){var t;var n=e.length;var r=n+8;var i=(r-r%64)/64;var s=(i+1)*16;var o=Array(s-1);var u=0;var a=0;while(a>>29;return o}function h(e){var t="",n="",r,i;for(i=0;i<=3;i++){r=e>>>i*8&255;n="0"+r.toString(16);t=t+n.substr(n.length-2,2)}return t}function p(e){e=e.replace(/\r\n/g,"\n");var t="";for(var n=0;n127&&r<2048){t+=String.fromCharCode(r>>6|192);t+=String.fromCharCode(r&63|128)}else{t+=String.fromCharCode(r>>12|224);t+=String.fromCharCode(r>>6&63|128);t+=String.fromCharCode(r&63|128)}}return t}var d=Array();var v,m,g,y,b,w,E,S,x;var T=7,N=12,C=17,k=22;var L=5,A=9,O=14,M=20;var _=4,D=11,P=16,H=23;var B=6,j=10,F=15,I=21;e=p(e);d=c(e);w=1732584193;E=4023233417;S=2562383102;x=271733878;for(v=0;vJeff Chen."); 29 | 30 | $('#enable-shortcuts').click(function() { 31 | chrome.storage.sync.set( 32 | { 33 | 'shortcuts-enabled' : $('#enable-shortcuts').is(':checked') 34 | }); 35 | }); 36 | 37 | 38 | $('#enable-notifications').click(function() { 39 | chrome.storage.sync.set( 40 | { 41 | 'notifications-enabled' : $('#enable-notifications').is(':checked') 42 | }); 43 | }); 44 | 45 | $('#enable-scrobbling').click(function() { 46 | var a = $('#enable-scrobbling').is(':checked'); 47 | chrome.storage.sync.set( 48 | { 49 | 'scrobbling-enabled' : a 50 | }); 51 | if (a) { 52 | $('#login').show(); 53 | } 54 | else { 55 | $('#login').hide(); 56 | $('#auth').hide(); 57 | chrome.storage.sync.remove(['lastfm_sessionID', 'lastfm_token']); 58 | } 59 | }) 60 | 61 | $('#login a').click(function () { 62 | chrome.runtime.sendMessage({type: 'auth'}, function (response) {}); 63 | }) 64 | 65 | $('.menu a').click(function(ev) { 66 | ev.preventDefault(); 67 | var selected = 'selected'; 68 | 69 | $('.mainview > *').removeClass(selected); 70 | $('.menu li').removeClass(selected); 71 | setTimeout(function() { 72 | $('.mainview > *:not(.selected)').css('display', 'none'); 73 | }, 100); 74 | 75 | $(ev.currentTarget).parent().addClass(selected); 76 | var currentView = $($(ev.currentTarget).attr('href')); 77 | currentView.css('display', 'block'); 78 | setTimeout(function() { 79 | currentView.addClass(selected); 80 | }, 0); 81 | 82 | setTimeout(function() { 83 | $('body')[0].scrollTop = 0; 84 | }, 200); 85 | }); 86 | 87 | $('#launch_modal').click(function(ev) { 88 | ev.preventDefault(); 89 | var modal = $('.overlay').clone(); 90 | $(modal).removeAttr('style'); 91 | $(modal).find('button, .close-button').click(function() { 92 | $(modal).addClass('transparent'); 93 | setTimeout(function() { 94 | $(modal).remove(); 95 | }, 1000); 96 | }); 97 | 98 | $(modal).click(function() { 99 | $(modal).find('.page').addClass('pulse'); 100 | $(modal).find('.page').on('webkitAnimationEnd', function() { 101 | $(this).removeClass('pulse'); 102 | }); 103 | }); 104 | $(modal).find('.page').click(function(ev) { 105 | ev.stopPropagation(); 106 | }); 107 | $('body').append(modal); 108 | }); 109 | 110 | $('.mainview > *:not(.selected)').css('display', 'none'); 111 | }); 112 | -------------------------------------------------------------------------------- /scripts/popup.js: -------------------------------------------------------------------------------- 1 | var popupApp = angular.module('app', []); 2 | 3 | popupApp.config(['$compileProvider', function ($compileProvider) { 4 | $compileProvider.imgSrcSanitizationWhitelist(/^\s*(https?|local|data|chrome-extension):/); 5 | }]); 6 | -------------------------------------------------------------------------------- /scripts/protocols/global.js: -------------------------------------------------------------------------------- 1 | var background_port = null; 2 | var popup_port = null; 3 | var old_status = null; 4 | 5 | var routes = {}; 6 | 7 | function update() { 8 | if (background_port && typeof(background_port) !== 'undefined') { 9 | old_status = JSON.parse(JSON.stringify(music_status)); 10 | music_status.update(); 11 | var msg = create_background_msg(old_status, music_status); 12 | if (msg != null) { 13 | background_port.postMessage(msg); 14 | } 15 | if (popup_port) { 16 | popup_port.postMessage({ 17 | 'type': 'status', 18 | 'data': music_status 19 | }); 20 | } 21 | } 22 | } 23 | 24 | function create_background_msg(oldValue, newValue) { 25 | var msg = {scrobble: false, notify: false}; 26 | msg.oldValue = oldValue; 27 | msg.newValue = newValue; 28 | if (oldValue !== undefined && (oldValue.title != newValue.title || 29 | oldValue.artist != newValue.artist || oldValue.album_art != newValue.album_art)) { 30 | msg.scrobble = true; 31 | if (newValue.title != '') { 32 | msg.notify = true; 33 | } 34 | return msg; 35 | } 36 | else { 37 | return null; 38 | } 39 | } 40 | 41 | function route(name, callback) { 42 | routes[name] = callback; 43 | } 44 | 45 | function handle_message(msg) { 46 | if (routes[msg.action] !== undefined) { 47 | routes[msg.action](msg); 48 | } 49 | } 50 | 51 | function global_init() { 52 | background_port = chrome.runtime.connect({name: "interface"}); 53 | 54 | route('update_status', update); 55 | 56 | background_port.onMessage.addListener(handle_message); 57 | 58 | chrome.runtime.onConnect.addListener(function(port) { 59 | if (port.name == 'popup') { 60 | popup_port = port; 61 | port.onDisconnect.addListener(function() { 62 | popup_port = null; 63 | }); 64 | port.onMessage.addListener(handle_message); 65 | update(); 66 | } 67 | }); 68 | 69 | window.setInterval(update, 1000); 70 | } 71 | 72 | document.addEventListener('DOMContentLoaded', global_init); 73 | if (document.readyState != 'loading') { 74 | global_init(); 75 | } 76 | 77 | -------------------------------------------------------------------------------- /scripts/protocols/gmusic/constants.js: -------------------------------------------------------------------------------- 1 | var artist_map = [ 2 | { 3 | name: 'name', 4 | selector: 'a', 5 | property: 'innerText', 6 | if_null: '' 7 | }, 8 | { 9 | name: 'id', 10 | attribute: 'data-id' 11 | }, 12 | { 13 | name: 'image', 14 | selector: 'img', 15 | property: 'src', 16 | if_null: 'img/default_artist.png' 17 | }]; 18 | 19 | var album_map = [ 20 | { 21 | name: 'title', 22 | selector: '.title', 23 | property: 'innerText', 24 | if_null: '' 25 | }, 26 | { 27 | name: 'artist', 28 | selector: '.sub-title', 29 | property: 'innerText', 30 | if_null: '' 31 | }, 32 | { 33 | name: 'id', 34 | attribute: 'data-id' 35 | }, 36 | { 37 | name: 'image', 38 | selector: 'img', 39 | property: 'src', 40 | if_null: 'img/default_album.png' 41 | }]; 42 | 43 | var station_map = [ 44 | { 45 | name: 'id', 46 | attribute: 'data-id' 47 | }, 48 | { 49 | name: 'title', 50 | selector: '.title', 51 | property: 'innerText', 52 | if_null: '' 53 | }, 54 | { 55 | name: 'image', 56 | selector: 'img', 57 | property: 'src', 58 | if_null: 'img/default_album.png' 59 | }]; 60 | 61 | var recent_map = [ 62 | { 63 | name: 'id', 64 | attribute: 'data-id' 65 | }, 66 | { 67 | name: 'title', 68 | selector: '#details a.card-title', 69 | property: 'innerText', 70 | if_null: '' 71 | }, 72 | { 73 | name: 'subtitle', 74 | selector: '#details a.card-subtitle', 75 | property: 'innerText', 76 | if_null: '' 77 | }, 78 | { 79 | name: 'image', 80 | selector: 'img', 81 | property: 'src', 82 | if_null: 'img/default_album.png' 83 | }]; 84 | 85 | var playlist_map = [ 86 | { 87 | name: 'id', 88 | attribute: 'data-id' 89 | }, 90 | { 91 | name: 'title', 92 | selector: '.title', 93 | property: 'innerText', 94 | if_null: '' 95 | }, 96 | { 97 | name: 'image', 98 | selector: 'img', 99 | property: 'src', 100 | if_null: 'img/default_album.png' 101 | }]; 102 | 103 | var song_map = [ 104 | { 105 | name: 'id', 106 | attribute: 'data-id' 107 | }, 108 | { 109 | name: 'title', 110 | selector: 'td[data-col="title"] span', 111 | property: 'innerText', 112 | if_null: '' 113 | }, 114 | { 115 | name: 'artist', 116 | selector: 'td[data-col="artist"] span a', 117 | property: 'innerText', 118 | if_null: '' 119 | }, 120 | { 121 | name: 'album', 122 | selector: 'td[data-col="album"] span a', 123 | property: 'innerText', 124 | if_null: '' 125 | }, 126 | { 127 | name: 'total_time', 128 | selector: 'td[data-col="duration"] span', 129 | property: 'innerText', 130 | if_null: '0:00' 131 | }, 132 | { 133 | name: 'album_art', 134 | selector: 'td[data-col="title"] span img', 135 | property: 'src', 136 | if_null: 'img/default_album.png' 137 | }]; 138 | -------------------------------------------------------------------------------- /scripts/protocols/gmusic/interface.js: -------------------------------------------------------------------------------- 1 | // Interfaces with the Google Play Music tab 2 | var load_listeners = []; 3 | var history_funcs = []; 4 | 5 | function update_slider(position, slidername) { 6 | //position is in % 7 | var slider = document 8 | .getElementById(slidername) 9 | .getElementsByTagName("paper-progress")[0]; 10 | 11 | var newWidth = Math.round(position * slider.offsetWidth); 12 | var rect = slider.getBoundingClientRect(); 13 | 14 | slider.dispatchEvent( 15 | new MouseEvent("mousedown", { 16 | clientX: newWidth + rect.left + slider.clientLeft - slider.scrollLeft, 17 | clientY: rect.top + slider.clientTop - slider.scrollTop, 18 | }) 19 | ); 20 | } 21 | 22 | function send_command(message) { 23 | var button = null; 24 | switch (message.type) { 25 | case "play": 26 | button = document.querySelector( 27 | 'paper-icon-button[data-id="play-pause"]' 28 | ); 29 | break; 30 | case "rew": 31 | button = document.querySelector('paper-icon-button[data-id="rewind"]'); 32 | break; 33 | case "ff": 34 | button = document.querySelector('paper-icon-button[data-id="forward"]'); 35 | break; 36 | case "up": 37 | button = document.querySelector('paper-icon-button[data-rating="5"]'); 38 | break; 39 | case "down": 40 | button = document.querySelector('paper-icon-button[data-rating="1"]'); 41 | break; 42 | case "shuffle": 43 | button = document.querySelector('paper-icon-button[data-id="shuffle"]'); 44 | break; 45 | case "repeat": 46 | button = document.querySelector('paper-icon-button[data-id="repeat"]'); 47 | break; 48 | case "slider": 49 | update_slider(message.position, "material-player-progress"); 50 | break; 51 | case "vslider": 52 | update_slider(message.position, "material-vslider"); 53 | break; 54 | case "playlist": 55 | button = document.querySelector( 56 | '.song-table > tbody > .song-row[data-id="' + 57 | message.id + 58 | '"] > td[data-col="song-details"] button' 59 | ); 60 | break; 61 | case "playlist-button": 62 | // Toggle the playlist to set it up for viewing 63 | if ( 64 | !document 65 | .querySelector("#queue-overlay") 66 | .classList.contains("sj-opened") 67 | ) { 68 | document.querySelector("#queue").click(); 69 | window.setTimeout(function () { 70 | document.querySelector("#queue").click(); 71 | }, 100); 72 | } 73 | break; 74 | } 75 | if (button !== null) { 76 | button.click(); 77 | } 78 | window.setTimeout(function () { 79 | update(); 80 | }, 30); 81 | } 82 | 83 | function go_to_url(url, callback) { 84 | var hash_index = window.location.href.search("#"); 85 | if (window.location.href.substring(hash_index) != url) { 86 | document.getElementById("loading-overlay").style.display = "block"; 87 | 88 | load_listeners.push({ 89 | callback: callback, 90 | called: false, 91 | }); 92 | 93 | window.location.href = window.location.href.substring(0, hash_index) + url; 94 | } else { 95 | callback(); 96 | } 97 | } 98 | 99 | function click(selector, callback) { 100 | document.getElementById("loading-overlay").style.display = "block"; 101 | 102 | load_listeners.push({ 103 | callback: callback, 104 | called: false, 105 | }); 106 | 107 | if (document.querySelector(selector) == null) { 108 | console.log(selector); 109 | } 110 | document.querySelector(selector).click(); 111 | } 112 | 113 | function parse_raw_data(raw_data, start_index, map) { 114 | var data = []; 115 | for (var i = 0; i < raw_data.length; i++) { 116 | var item = {}; 117 | item.index = i + start_index; 118 | 119 | map.forEach(function (key) { 120 | if (key.selector) { 121 | item[key.name] = raw_data[i].querySelector(key.selector); 122 | item[key.name] = 123 | item[key.name] == null ? key.if_null : item[key.name][key.property]; 124 | } else if (key.attribute) { 125 | item[key.name] = raw_data[i].getAttribute(key.attribute); 126 | } 127 | }); 128 | 129 | data.push(item); 130 | } 131 | 132 | return data; 133 | } 134 | 135 | function restore_state(history, msg, cb) { 136 | var history = history.slice(0); 137 | 138 | if (history.length == 0) { 139 | cb(msg); 140 | } else { 141 | var next_state = history.shift(); 142 | if (next_state.type == "selector") { 143 | click(next_state.selector, function () { 144 | restore_state(history, msg, cb); 145 | }); 146 | } else if (next_state.type == "url") { 147 | go_to_url(next_state.url, function () { 148 | restore_state(history, msg, cb); 149 | }); 150 | } else if (next_state.type == "func") { 151 | history_funcs[next_state.id](function () { 152 | restore_state(history, msg, cb); 153 | }); 154 | } else { 155 | console.log("bad state " + next_state); 156 | } 157 | } 158 | } 159 | 160 | function scroll_to_index(cluster, desired_start_index, cb) { 161 | var cards = document.querySelectorAll(".lane-content > .material-card"); 162 | var scroll_step = 163 | desired_start_index > 0 164 | ? cards[parseInt(cluster.getAttribute("data-col-count"))].offsetTop - 165 | cards[0].offsetTop 166 | : 0; 167 | var scroll_event = document.createEvent("HTMLEvents"); 168 | scroll_event.initEvent("scroll", false, true); 169 | 170 | var observer = new MutationObserver(function (mutations) { 171 | mutations.forEach(function (mutation) { 172 | if (mutation.attributeName === "data-start-index") { 173 | var current_idx = cluster.getAttribute("data-start-index"); 174 | if ( 175 | cluster.getAttribute("data-end-index") != 176 | cluster.getAttribute("data-row-count") && 177 | desired_start_index != current_idx 178 | ) { 179 | document.querySelector("#mainContainer").scrollTop += scroll_step; 180 | document.querySelector("#mainContainer").dispatchEvent(scroll_event); 181 | } else { 182 | cb(observer); 183 | } 184 | } 185 | }); 186 | }); 187 | 188 | observer.observe(cluster, { attributes: true }); 189 | 190 | cluster.setAttribute( 191 | "data-start-index", 192 | cluster.getAttribute("data-end-index") + 1 193 | ); 194 | document.querySelector("#mainContainer").scrollTop = 0; 195 | document.querySelector("#mainContainer").dispatchEvent(scroll_event); 196 | 197 | return observer; 198 | } 199 | 200 | function get_artists(msg) { 201 | var history = [ 202 | { 203 | type: "url", 204 | url: "#/artists", 205 | }, 206 | ]; 207 | 208 | restore_state(history, msg, function (msg) { 209 | var cluster = document.querySelector(".material-card-grid"); 210 | var desired_start_index = Math.floor( 211 | msg.offset / parseInt(cluster.getAttribute("data-col-count")) 212 | ); 213 | 214 | var cards = document.querySelectorAll(".lane-content > .material-card"); 215 | var scroll_step = 216 | desired_start_index > 0 217 | ? cards[parseInt(cluster.getAttribute("data-col-count"))].offsetTop 218 | : 0; 219 | 220 | var parse_data = function (observer) { 221 | var raw_artists = document.querySelectorAll( 222 | ".lane-content > .material-card" 223 | ); 224 | var offset = 225 | cluster.getAttribute("data-col-count") * 226 | cluster.getAttribute("data-start-index"); 227 | var artists = parse_raw_data(raw_artists, offset, artist_map); 228 | 229 | if (popup_port) { 230 | popup_port.postMessage({ 231 | type: "artists", 232 | data: artists, 233 | offset: offset, 234 | history: history, 235 | count: parseInt(document.querySelector("#countSummary").innerText), 236 | }); 237 | } 238 | 239 | if (observer != null) observer.disconnect(); 240 | }; 241 | 242 | scroll_to_index(cluster, desired_start_index, parse_data); 243 | }); 244 | } 245 | 246 | function get_albums(msg) { 247 | var history = [ 248 | { 249 | type: "url", 250 | url: "#/albums", 251 | }, 252 | ]; 253 | 254 | restore_state(history, msg, function (msg) { 255 | var cluster = document.querySelector(".material-card-grid"); 256 | var desired_start_index = Math.floor( 257 | msg.offset / parseInt(cluster.getAttribute("data-col-count")) 258 | ); 259 | 260 | var cards = document.querySelectorAll(".lane-content > .material-card"); 261 | var scroll_step = 262 | desired_start_index > 0 263 | ? cards[parseInt(cluster.getAttribute("data-col-count"))].offsetTop - 264 | cards[0].offsetTop + 265 | 4 266 | : 0; 267 | 268 | var parse_data = function (observer) { 269 | var raw_albums = document.querySelectorAll( 270 | ".lane-content > .material-card" 271 | ); 272 | var start_offset = 273 | cluster.getAttribute("data-col-count") * 274 | cluster.getAttribute("data-start-index"); 275 | var albums = parse_raw_data(raw_albums, start_offset, album_map); 276 | 277 | if (popup_port) { 278 | popup_port.postMessage({ 279 | type: "albums", 280 | data: albums, 281 | offset: start_offset, 282 | count: parseInt(document.querySelector("#countSummary").innerText), 283 | history: history, 284 | }); 285 | } 286 | if (observer != null) observer.disconnect(); 287 | }; 288 | 289 | scroll_to_index(cluster, desired_start_index, parse_data); 290 | }); 291 | } 292 | 293 | function get_stations(msg) { 294 | var history = [ 295 | { 296 | type: "url", 297 | url: "#/wms", 298 | }, 299 | ]; 300 | 301 | restore_state(history, msg, function (msg) { 302 | var raw_recent_stations = document.querySelectorAll( 303 | ".g-content .my-recent-stations-cluster-wrapper .lane-content .material-card" 304 | ); 305 | var raw_my_stations = document.querySelectorAll( 306 | ".g-content .section-header+.cluster .lane-content .material-card" 307 | ); 308 | 309 | var recent_stations = parse_raw_data(raw_recent_stations, 0, station_map); 310 | var my_stations = parse_raw_data(raw_my_stations, 0, station_map); 311 | 312 | var stations = { 313 | recent_stations: recent_stations, 314 | my_stations: my_stations, 315 | }; 316 | 317 | if (popup_port) { 318 | popup_port.postMessage({ 319 | type: "stations", 320 | data: stations, 321 | history: history, 322 | }); 323 | } 324 | }); 325 | } 326 | 327 | function get_album_art(art) { 328 | return !art || art == "https://undefined" 329 | ? "img/default_album.png" 330 | : art.substring(0, art.search("=") + 1) + "s320"; 331 | } 332 | 333 | function get_time(time) { 334 | return time 335 | .split(":") 336 | .map(function (num, index, arr) { 337 | return parseInt(num, 10) * Math.pow(60, arr.length - index - 1); 338 | }) 339 | .reduce(function (a, b) { 340 | return a + b; 341 | }); 342 | } 343 | 344 | function get_recent(msg) { 345 | var history = [ 346 | { 347 | type: "url", 348 | url: "#/recents", 349 | }, 350 | ]; 351 | 352 | restore_state(history, msg, function (msg) { 353 | var raw_recent = document.querySelectorAll(".gpm-card-grid sj-card"); 354 | 355 | var recent = parse_raw_data(raw_recent, 0, recent_map); 356 | 357 | if (popup_port) { 358 | popup_port.postMessage({ 359 | type: "recent", 360 | data: recent, 361 | history: history, 362 | }); 363 | } 364 | }); 365 | } 366 | 367 | function search(msg) { 368 | var history = [ 369 | { 370 | type: "url", 371 | url: "#/sr/" + encodeURIComponent(msg.query), 372 | }, 373 | ]; 374 | restore_state(history, msg, function (msg) { 375 | var artists = [], 376 | albums = [], 377 | songs = []; 378 | 379 | var raw_artists = document.querySelectorAll( 380 | '.cluster[data-type="srar"] .material-card' 381 | ); 382 | var raw_albums = document.querySelectorAll( 383 | '.cluster[data-type="sral"] .material-card' 384 | ); 385 | var raw_songs = document.querySelectorAll( 386 | '.cluster[data-type="srs"] .song-row' 387 | ); 388 | 389 | var artists = parse_raw_data(raw_artists, 0, artist_map); 390 | var albums = parse_raw_data(raw_albums, 0, album_map); 391 | var songs = parse_raw_data(raw_songs, 0, song_map); 392 | 393 | var search = { 394 | artists: artists, 395 | albums: albums, 396 | songs: songs, 397 | }; 398 | 399 | if (popup_port) { 400 | popup_port.postMessage({ 401 | type: "search", 402 | data: search, 403 | history: history, 404 | }); 405 | } 406 | }); 407 | } 408 | 409 | // TODO: use all four images in the playlist instead of just one 410 | function get_playlists(msg) { 411 | var history = [ 412 | { 413 | type: "url", 414 | url: "#/wmp", 415 | }, 416 | ]; 417 | 418 | restore_state(history, msg, function (msg) { 419 | var recent_playlists = [], 420 | auto_playlists = [], 421 | my_playlists = []; 422 | 423 | var raw_playlists = document.querySelectorAll(".g-content .cluster"); 424 | 425 | var raw_recent_playlists = raw_playlists[0].querySelectorAll( 426 | ".lane-content .material-card" 427 | ); 428 | var raw_auto_playlists = raw_playlists[1].querySelectorAll( 429 | ".lane-content .material-card" 430 | ); 431 | 432 | recent_playlists = parse_raw_data(raw_recent_playlists, 0, playlist_map); 433 | auto_playlists = parse_raw_data(raw_auto_playlists, 0, playlist_map); 434 | 435 | var cluster = document.querySelector(".material-card-grid"); 436 | var desired_start_index = Math.floor( 437 | msg.offset / parseInt(cluster.getAttribute("data-col-count")) 438 | ); 439 | 440 | var cards = cluster.querySelectorAll(".lane-content > .material-card"); 441 | var scroll_step = 442 | desired_start_index > 0 443 | ? cards[parseInt(cluster.getAttribute("data-col-count"))].offsetTop - 444 | cards[0].offsetTop + 445 | 4 446 | : 0; 447 | 448 | var parse_data = function (observer) { 449 | var raw_my_playlists = raw_playlists[2].querySelectorAll( 450 | ".lane-content .material-card" 451 | ); 452 | var start_offset = 453 | cluster.getAttribute("data-col-count") * 454 | cluster.getAttribute("data-start-index"); 455 | my_playlists = parse_raw_data( 456 | raw_my_playlists, 457 | start_offset, 458 | playlist_map 459 | ); 460 | 461 | var playlists = { 462 | recent_playlists: recent_playlists, 463 | auto_playlists: auto_playlists, 464 | my_playlists: my_playlists, 465 | }; 466 | 467 | if (popup_port) { 468 | popup_port.postMessage({ 469 | type: "playlists", 470 | data: playlists, 471 | offset: start_offset, 472 | count: parseInt(document.querySelector("#countSummary").innerText), 473 | history: history, 474 | }); 475 | } 476 | if (observer != null) observer.disconnect(); 477 | }; 478 | 479 | // TODO: does the scroll work properly for playlists 480 | // (playlists start scrolling later) 481 | scroll_to_index(cluster, desired_start_index, parse_data); 482 | }); 483 | } 484 | 485 | function data_click(msg) { 486 | restore_state(msg.history, msg, function (msg) { 487 | if (msg.click_type == "album") { 488 | var url = "#/album/" + msg.id; 489 | 490 | var parse_album = function () { 491 | var raw_songs = document.querySelectorAll( 492 | "#music-content .song-table .song-row" 493 | ); 494 | var songs = parse_raw_data(raw_songs, 0, song_map); 495 | if (popup_port) { 496 | popup_port.postMessage({ 497 | type: "playlist", 498 | data: songs, 499 | history: [ 500 | { 501 | type: "url", 502 | url: url, 503 | }, 504 | ], 505 | title: document.querySelector("#mainContainer .title").firstChild 506 | .nodeValue, 507 | subtitle: document.querySelector("#mainContainer .creator-name") 508 | .innerText, 509 | }); 510 | } 511 | }; 512 | go_to_url(url, parse_album); 513 | } else if (msg.click_type == "artist") { 514 | var url = "#/artist/" + msg.id; 515 | var parse_artist = function () { 516 | var raw_songs = document.querySelectorAll( 517 | "#music-content .song-table .song-row" 518 | ); 519 | var raw_albums = document.querySelectorAll( 520 | '.cluster[data-type="saral"] .material-card' 521 | ); 522 | 523 | var songs = parse_raw_data(raw_songs, 0, song_map); 524 | var albums = parse_raw_data(raw_albums, 0, album_map); 525 | var artist = { 526 | songs: songs, 527 | albums: albums, 528 | }; 529 | 530 | if (popup_port) { 531 | popup_port.postMessage({ 532 | type: "artist", 533 | data: artist, 534 | history: [ 535 | { 536 | type: "url", 537 | url: url, 538 | }, 539 | ], 540 | title: document.querySelector("#mainContainer .name").innerText, 541 | }); 542 | } 543 | }; 544 | 545 | go_to_url(url, parse_artist); 546 | } else if (msg.click_type == "playlist") { 547 | document 548 | .querySelector( 549 | '.song-table > tbody > .song-row[data-id="' + msg.id + '"] button' 550 | ) 551 | .click(); 552 | 553 | window.setTimeout(function () { 554 | update(); 555 | }, 30); 556 | } else if (msg.click_type == "playlists") { 557 | var idx = 0; 558 | switch (msg.playlist_type) { 559 | case "recent_playlist": 560 | idx = 0; 561 | break; 562 | case "auto_playlist": 563 | idx = 1; 564 | break; 565 | case "my_playlist": 566 | idx = 2; 567 | break; 568 | } 569 | var raw_playlists = document 570 | .querySelectorAll(".g-content .cluster") 571 | [idx].querySelectorAll(".lane-content .material-card"); 572 | 573 | if (msg.playlist_type != "my_playlist") { 574 | raw_playlists[msg.index] 575 | .querySelector(".play-button-container") 576 | .click(); 577 | } else { 578 | go_to_url("#/pl/" + msg.id, function () { 579 | document.querySelector('paper-fab[data-id="play"]').click(); 580 | window.setTimeout(function () { 581 | update(); 582 | }, 30); 583 | }); 584 | } 585 | } 586 | 587 | // TODO do this without going to the album page... 588 | else if (msg.click_type == "recent") { 589 | var card = document.querySelectorAll("gpm-card-grid sj-card")[msg.index]; 590 | var url = 591 | card.getAttribute("data-type") + "/" + card.getAttribute("data-id"); 592 | go_to_url("#/" + url, function () { 593 | document.querySelector('paper-fab[data-id="play"]').click(); 594 | window.setTimeout(function () { 595 | update(); 596 | }, 30); 597 | }); 598 | } else if (msg.click_type == "station") { 599 | var stations; 600 | if (msg.station_type == "my_station") { 601 | stations = document.querySelectorAll( 602 | ".g-content .section-header+.cluster .lane-content .material-card" 603 | ); 604 | } else if (msg.station_type == "recent_station") { 605 | stations = document.querySelectorAll( 606 | ".g-content .my-recent-stations-cluster-wrapper .lane-content .material-card" 607 | ); 608 | } 609 | stations[msg.index].querySelector(".play-button-container").click(); 610 | 611 | window.setTimeout(function () { 612 | update(); 613 | }, 30); 614 | } 615 | }); 616 | } 617 | 618 | function init() { 619 | route("get_artists", get_artists); 620 | route("get_albums", get_albums); 621 | route("get_playlists", get_playlists); 622 | route("get_stations", get_stations); 623 | route("get_recent", get_recent); 624 | route("search", search); 625 | route("data_click", data_click); 626 | route("send_command", send_command); 627 | 628 | var trigger = document.getElementById("loading-overlay"); 629 | var observer = new MutationObserver(function (mutations) { 630 | mutations.forEach(function (mutation) { 631 | if ( 632 | mutation.attributeName === "style" && 633 | window.getComputedStyle(trigger).getPropertyValue("display") === "none" 634 | ) { 635 | load_listeners.forEach(function (listener) { 636 | if (listener.called === false) { 637 | listener.called = true; 638 | listener.callback(); 639 | } 640 | }); 641 | 642 | load_listeners = load_listeners.filter(function (listener) { 643 | return listener.called === false; 644 | }); 645 | } 646 | }); 647 | }); 648 | 649 | observer.observe(trigger, { attributes: true }); 650 | } 651 | 652 | document.addEventListener("DOMContentLoaded", init); 653 | if (document.readyState != "loading") { 654 | init(); 655 | } 656 | -------------------------------------------------------------------------------- /scripts/protocols/gmusic/status.js: -------------------------------------------------------------------------------- 1 | var music_status = { 2 | disabled_buttons: [], 3 | artist: "", 4 | album: "", 5 | album_art: "", 6 | title: "", 7 | current_time: "", 8 | total_time: "", 9 | current_time_s: 0, 10 | total_time_s: 0, 11 | thumb: "", 12 | repeat: "", 13 | shuffle: "", 14 | status: "", 15 | volume: "", 16 | playlist: [], 17 | artist_id: "", 18 | album_id: "", 19 | protocol: "gmusic", 20 | 21 | get_time: function (time) { 22 | return time 23 | .split(":") 24 | .map(function (num, index, arr) { 25 | return parseInt(num, 10) * Math.pow(60, arr.length - index - 1); 26 | }) 27 | .reduce(function (a, b) { 28 | return a + b; 29 | }); 30 | }, 31 | 32 | get_thumb: function () { 33 | if ( 34 | document 35 | .querySelector('paper-icon-button[data-rating="5"]') 36 | .getAttribute("title") === "Undo thumb-up" 37 | ) { 38 | return ThumbEnum.UP; 39 | } else if ( 40 | document 41 | .querySelector('paper-icon-button[data-rating="1"]') 42 | .getAttribute("title") === "Undo thumb-down" 43 | ) { 44 | return ThumbEnum.DOWN; 45 | } else { 46 | return ThumbEnum.NONE; 47 | } 48 | }, 49 | 50 | get_shuffle: function () { 51 | return document 52 | .querySelector('paper-icon-button[data-id="shuffle"]') 53 | .classList.contains("active"); 54 | }, 55 | 56 | get_repeat: function () { 57 | switch ( 58 | document 59 | .querySelector('paper-icon-button[data-id="repeat"]') 60 | .getAttribute("title") 61 | .split(" ")[1] 62 | ) { 63 | case "Off.": 64 | return RepeatEnum.NONE; 65 | case "Current": 66 | return RepeatEnum.ONE; 67 | case "All": 68 | return RepeatEnum.ALL; 69 | } 70 | }, 71 | 72 | get_playlist: function () { 73 | var playlist_root = document.querySelector( 74 | "#queueContainer > .queue-song-table > .song-table > tbody" 75 | ); 76 | if (!playlist_root) { 77 | return []; 78 | } 79 | 80 | var playlist_count = playlist_root.getAttribute("data-count"); 81 | var playlist_arr = playlist_root.querySelectorAll(".song-row"); 82 | var playlist = []; 83 | 84 | for (var i = 0; i < playlist_count; i++) { 85 | var playlist_item = playlist_arr[i]; 86 | if (playlist_item == null) continue; 87 | 88 | var item = {}; 89 | item.title = playlist_item.querySelector(".song-title").innerText; 90 | item.artist = playlist_item.querySelector( 91 | 'td[data-col="artist"] > span > a' 92 | ).innerText; 93 | item.album = playlist_item.querySelector( 94 | 'td[data-col="album"] > span > a' 95 | ).innerText; 96 | item.album_art = playlist_item 97 | .querySelector("span > img") 98 | .getAttribute("src"); 99 | item.total_time = playlist_item.querySelector( 100 | 'td[data-col="duration"] > span' 101 | ).innerText; 102 | item.total_time_s = this.get_time(item.total_time); 103 | 104 | item.play_count = playlist_item.querySelector( 105 | 'td[data-col="play-count"] > span' 106 | ); 107 | if (item.play_count == null) item.play_count = "0"; 108 | 109 | item.currently_playing = playlist_item.classList.contains( 110 | "currently-playing" 111 | ); 112 | 113 | item.id = playlist_item.getAttribute("data-id"); 114 | 115 | playlist.push(item); 116 | } 117 | 118 | return playlist; 119 | }, 120 | 121 | update: function () { 122 | this.title = document.querySelector("#currently-playing-title"); 123 | this.title = this.title == null ? "" : this.title.innerText; 124 | 125 | this.artist = document.querySelector("#player-artist"); 126 | this.artist = this.artist == null ? "" : this.artist.innerText; 127 | 128 | this.artist_id = document.querySelector("#player-artist"); 129 | this.artist_id = 130 | this.artist_id == null ? "" : this.artist_id.getAttribute("data-id"); 131 | 132 | this.album = document.querySelector(".player-album"); 133 | this.album = this.album == null ? "" : this.album.innerText; 134 | 135 | this.album_id = document.querySelector(".player-album"); 136 | this.album_id = 137 | this.album_id == null ? "" : this.album_id.getAttribute("data-id"); 138 | 139 | this.album_art = document.querySelector("#playerBarArt"); 140 | this.album_art = get_album_art( 141 | this.album_art == null 142 | ? "https://undefined" 143 | : this.album_art.getAttribute("src") 144 | ); 145 | 146 | this.current_time = document.querySelector("#time_container_current"); 147 | this.current_time = 148 | this.current_time == null ? "" : this.current_time.innerText; 149 | 150 | this.total_time = document.querySelector("#time_container_duration"); 151 | this.total_time = this.total_time == null ? "" : this.total_time.innerText; 152 | 153 | this.current_time_s = this.get_time(this.current_time); 154 | this.total_time_s = this.get_time(this.total_time); 155 | this.thumb = this.get_thumb(); 156 | this.shuffle = this.get_shuffle(); 157 | this.repeat = this.get_repeat(); 158 | this.status = 159 | document 160 | .querySelector('paper-icon-button[data-id="play-pause"]') 161 | .getAttribute("title") == "Pause" 162 | ? StatusEnum.PLAYING 163 | : StatusEnum.PAUSED; 164 | this.volume = parseInt( 165 | document.querySelector("#material-vslider").getAttribute("aria-valuenow") 166 | ); 167 | this.playlist = this.get_playlist(); 168 | return this; 169 | }, 170 | }; 171 | -------------------------------------------------------------------------------- /scripts/protocols/pandora/constants.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jchen1/MiniPlay/a6a5695c3b8229bc311f76876409779ce15d854a/scripts/protocols/pandora/constants.js -------------------------------------------------------------------------------- /scripts/protocols/pandora/interface.js: -------------------------------------------------------------------------------- 1 | // Interfaces with the Pandora tab 2 | 3 | function update_slider(position) { //position is in % 4 | var button = document.getElementsByClassName('volumeButton')[0]; 5 | var evt = document.createEvent('MouseEvents'); 6 | evt.initMouseEvent( 'mouseover', true, false); 7 | button.dispatchEvent(evt); 8 | 9 | var slider = document.getElementsByClassName('volumeBackground')[0]; 10 | var newWidth = Math.round(position * 82) + 43; 11 | var rect = slider.getBoundingClientRect(); 12 | 13 | slider.dispatchEvent(new MouseEvent('click', { 14 | clientX: newWidth + rect.left + slider.clientLeft - slider.scrollLeft, 15 | clientY: rect.top + slider.clientTop - slider.scrollTop, 16 | bubbles: true 17 | })); 18 | 19 | evt = document.createEvent('MouseEvents'); 20 | evt.initMouseEvent( 'mouseout', true, false); 21 | button.dispatchEvent(evt); 22 | } 23 | 24 | function send_command(message) { 25 | var button = null; 26 | switch (message.type) { 27 | case 'play': 28 | button = document.querySelector('.playButton'); 29 | if (getComputedStyle(button).display === "none") { 30 | button = document.querySelector('.pauseButton'); 31 | } 32 | break; 33 | case 'ff': 34 | button = document.querySelector('.skipButton'); break; 35 | case 'up': 36 | button = document.querySelector('.thumbUpButton'); break; 37 | case 'down': 38 | button = document.querySelector('.thumbDownButton'); break; 39 | case 'vslider': 40 | update_slider(message.position); break; 41 | } 42 | if (button !== null) { 43 | button.click(); 44 | } 45 | window.setTimeout( function() { 46 | update(); 47 | }, 30); 48 | } 49 | 50 | function init() { 51 | route('send_command', send_command); 52 | } 53 | 54 | document.addEventListener('DOMContentLoaded', init); 55 | if (document.readyState != 'loading') { 56 | init(); 57 | } 58 | -------------------------------------------------------------------------------- /scripts/protocols/pandora/status.js: -------------------------------------------------------------------------------- 1 | var music_status = { 2 | 3 | disabled_buttons : ['rew', 'repeat', 'shuffle', 'slider'], 4 | artist : '', 5 | album : '', 6 | album_art : '', 7 | title : '', 8 | current_time : '', 9 | total_time : '', 10 | current_time_s : 0, 11 | total_time_s: 0, 12 | thumb : '', 13 | repeat : RepeatEnum.NONE, 14 | shuffle : false, 15 | status : '', 16 | volume : '', 17 | protocol : 'pandora', 18 | 19 | get_time : function (time) { 20 | return time.split(':').map(function(num, index, arr) { 21 | return Math.abs(parseInt(num, 10) * Math.pow(60, arr.length - index - 1)); 22 | }).reduce(function(a, b) { return a + b; }); 23 | }, 24 | 25 | get_album_art : function () { 26 | var array = document.querySelectorAll('.slidesForeground .art'); 27 | for (var i = 0; i < array.length; i++) { 28 | var item = array[i]; 29 | if (getComputedStyle(item).display == 'inline') { 30 | return item.getAttribute('src'); 31 | } 32 | } 33 | return 'img/default_album.png'; 34 | }, 35 | 36 | get_thumb : function () { 37 | if (document.querySelector('.thumbUpButton').classList.contains('indicator')) { 38 | return ThumbEnum.UP; 39 | } 40 | else if (document.querySelector('.thumbDownButton').classList.contains('indicator')) { 41 | return ThumbEnum.DOWN; 42 | } 43 | else { 44 | return ThumbEnum.NONE; 45 | } 46 | }, 47 | 48 | update : function() { 49 | this.title = document.querySelector('.playerBarSong').innerText; 50 | this.artist = document.querySelector('.playerBarArtist').innerText; 51 | this.album = document.querySelector('.playerBarAlbum').innerText; 52 | this.album_art = this.get_album_art(); 53 | this.current_time = document.querySelector('.elapsedTime').innerText; 54 | this.total_time = document.querySelector('.remainingTime').innerText; 55 | this.current_time_s = this.get_time(this.current_time); 56 | this.total_time_s = this.current_time_s + this.get_time(this.total_time); 57 | this.thumb = this.get_thumb(); 58 | this.volume = (parseInt(getComputedStyle(document.querySelector('.volumeKnob')).left, 10) - 20) / 82 * 100; 59 | this.status = (getComputedStyle(document.querySelector('.playButton')).display == "none") ? StatusEnum.PLAYING : StatusEnum.PAUSED; 60 | return this; 61 | } 62 | }; 63 | -------------------------------------------------------------------------------- /scripts/protocols/songza/constants.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jchen1/MiniPlay/a6a5695c3b8229bc311f76876409779ce15d854a/scripts/protocols/songza/constants.js -------------------------------------------------------------------------------- /scripts/protocols/songza/interface.js: -------------------------------------------------------------------------------- 1 | // Interfaces with the songza tab 2 | 3 | function update_slider(position) { //position is in % 4 | $('#volume-control-slider-input').val(100 * position); 5 | var changeEvent = document.createEvent("HTMLEvents"); 6 | changeEvent.initEvent("change", true, true); 7 | document.getElementById("volume-control-slider-input").dispatchEvent(changeEvent); 8 | } 9 | 10 | function send_command(message) { 11 | var $button = null; 12 | switch (message.type) { 13 | case 'play': 14 | $button = $('.player-wrapper').hasClass('player-state-play') ? $('.ui-icon-ios7-pause') : $('.ui-icon-ios7-play'); 15 | break; 16 | case 'ff': 17 | $button = $('.ui-icon-ios7-fastforward'); break; 18 | case 'up': 19 | $button = $('.ui-icon-thumb-up'); break; 20 | case 'down': 21 | $button = $('.ui-icon-thumb-down'); break; 22 | case 'vslider': 23 | update_slider(message.position); break; 24 | } 25 | if ($button !== null) { 26 | $button.click(); 27 | } 28 | window.setTimeout( function() { 29 | update(); 30 | }, 30); 31 | } 32 | 33 | $(function() { 34 | route('send_command', send_command); 35 | }); 36 | -------------------------------------------------------------------------------- /scripts/protocols/songza/status.js: -------------------------------------------------------------------------------- 1 | var music_status = { 2 | disabled_buttons: ["rew", "repeat", "shuffle", "slider"], 3 | artist: "", 4 | album: "", 5 | album_art: "", 6 | title: "", 7 | current_time: "", 8 | total_time: "", 9 | current_time_s: 0, 10 | total_time_s: 0, 11 | thumb: ThumbEnum.NONE, 12 | repeat: RepeatEnum.NONE, 13 | shuffle: false, 14 | status: "", 15 | volume: "", 16 | protocol: "songza", 17 | 18 | get_time: function (time) { 19 | return time 20 | .split(":") 21 | .map(function (num, index, arr) { 22 | return parseInt(num, 10) * Math.pow(60, arr.length - index - 1); 23 | }) 24 | .reduce(function (a, b) { 25 | return a + b; 26 | }); 27 | }, 28 | 29 | get_album: function () { 30 | var album = $(".miniplayer-info-album-title").text(); 31 | return album.length > 5 ? album.substring(5) : ""; 32 | }, 33 | 34 | get_album_art: function () { 35 | var art = $(".fullplayer-song-wrapper.active > .fullplayer-album-art").attr( 36 | "src" 37 | ); 38 | return art == "https://undefined" ? "img/default_album.png" : art; 39 | }, 40 | 41 | get_thumb: function () { 42 | if ($(".thumb-up").hasClass("voted")) { 43 | return ThumbEnum.UP; 44 | } else if ($(".thumb-down").hasClass("voted")) { 45 | return ThumbEnum.DOWN; 46 | } else { 47 | return ThumbEnum.NONE; 48 | } 49 | }, 50 | 51 | update: function () { 52 | this.title = $(".miniplayer-info-track-title > a").text(); 53 | this.artist = $(".miniplayer-info-artist-name > a").text(); 54 | this.album = this.get_album(); 55 | this.album_art = this.get_album_art(); 56 | this.current_time_s = parseFloat( 57 | $(".miniplayer-timeline-current-time").css("width") 58 | ); 59 | this.total_time_s = parseInt($(".miniplayer-timeline").css("width")); 60 | this.thumb = this.get_thumb(); 61 | this.status = $(".player-wrapper").hasClass("player-state-play") 62 | ? StatusEnum.PLAYING 63 | : StatusEnum.PAUSED; 64 | this.volume = parseFloat($("#volume-control-slider-input").val()); 65 | return this; 66 | }, 67 | }; 68 | -------------------------------------------------------------------------------- /scripts/protocols/spotify/constants.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jchen1/MiniPlay/a6a5695c3b8229bc311f76876409779ce15d854a/scripts/protocols/spotify/constants.js -------------------------------------------------------------------------------- /scripts/protocols/spotify/interface.js: -------------------------------------------------------------------------------- 1 | // Interfaces with the spotify tab 2 | 3 | //TODO: fix 4 | function update_slider(position, slider) { //position is in % 5 | var slider; 6 | if (slider == 'slider') { 7 | slider = document.getElementById('app-player').contentWindow.document.getElementById('bar-click'); 8 | } 9 | else if (slider == 'vslider') { 10 | var button = document.getElementById('app-player').contentWindow.document.getElementById('volume-show'); 11 | var evt = document.createEvent('MouseEvents'); 12 | evt.initMouseEvent('mouseover', true, false); 13 | button.dispatchEvent(evt); 14 | slider = document.getElementById('app-player').contentWindow.document.getElementById('volume-click'); 15 | } 16 | var newWidth = Math.round(position * slider.offsetWidth); 17 | var rect = slider.getBoundingClientRect(); 18 | 19 | slider.dispatchEvent(new MouseEvent('mousedown', { 20 | clientX: newWidth + rect.left + slider.clientLeft - slider.scrollLeft, 21 | clientY: rect.top + slider.clientTop - slider.scrollTop, 22 | bubbles: true 23 | })); 24 | 25 | slider.dispatchEvent(new MouseEvent('mouseup', { 26 | clientX: newWidth + rect.left + slider.clientLeft - slider.scrollLeft, 27 | clientY: rect.top + slider.clientTop - slider.scrollTop, 28 | bubbles: true 29 | })); 30 | } 31 | 32 | function send_command(message) { 33 | var iframe = document.querySelector('#app-player').contentDocument; 34 | var button = null; 35 | switch (message.type) { 36 | case 'play': 37 | button = iframe.querySelector('#play-pause'); break; 38 | case 'rew': 39 | button = iframe.querySelector('#previous'); break; 40 | case 'ff': 41 | button = iframe.querySelector('#next'); break; 42 | case 'shuffle': 43 | button = iframe.querySelector('#shuffle'); break; 44 | case 'repeat': 45 | button = iframe.querySelector('#repeat'); break; 46 | case 'slider': 47 | update_slider(message.position, 'slider'); break; 48 | case 'vslider': 49 | update_slider(message.position, 'vslider'); break; 50 | } 51 | if (button !== null) { 52 | button.click(); 53 | } 54 | window.setTimeout( function() { 55 | update(); 56 | }, 30); 57 | } 58 | 59 | function init() { 60 | route('send_command', send_command); 61 | } 62 | 63 | document.addEventListener('DOMContentLoaded', init); 64 | if (document.readyState != 'loading') { 65 | init(); 66 | } 67 | -------------------------------------------------------------------------------- /scripts/protocols/spotify/status.js: -------------------------------------------------------------------------------- 1 | var music_status = { 2 | 3 | disabled_buttons : ['up', 'down'], 4 | artist : '', 5 | album : '', 6 | album_art : '', 7 | title : '', 8 | current_time : '', 9 | total_time : '', 10 | current_time_s : 0, 11 | total_time_s: 0, 12 | thumb : ThumbEnum.NONE, 13 | repeat : 'NO_REPEAT', 14 | shuffle : false, 15 | status : '', 16 | volume : '', 17 | protocol : 'spotify', 18 | 19 | get_time : function (time) { 20 | return time.split(':').map(function(num, index, arr) { 21 | return Math.abs(parseInt(num, 10) * Math.pow(60, arr.length - index - 1)); 22 | }).reduce(function(a, b) { return a + b; }); 23 | }, 24 | 25 | get_album_art : function () { 26 | var url = getComputedStyle(document.querySelector('#app-player').contentDocument.querySelector('.sp-image-img'))['background-image']; 27 | return url ? url.substring(url.search('http'), url.indexOf(')') - 1) : 'img/default_album.png'; 28 | }, 29 | 30 | update : function() { 31 | var iframe = document.querySelector('#app-player').contentDocument; 32 | this.title = iframe.querySelector('#track-name > a').innerText; 33 | this.artist = iframe.querySelector('#track-artist > a').innerText; 34 | this.album_art = this.get_album_art(); 35 | this.current_time = iframe.querySelector('#track-current').innerText; 36 | this.total_time = iframe.querySelector('#track-length').innerText; 37 | this.current_time_s = this.get_time(this.current_time); 38 | this.total_time_s = this.get_time(this.total_time); 39 | this.repeat = iframe.querySelector('#repeat').classList.contains('active') ? RepeatEnum.ALL : RepeatEnum.NONE; 40 | this.shuffle = iframe.querySelector('#shuffle').classList.contains('active'); 41 | this.status = (iframe.querySelector('#play-pause').classList.contains('playing')) ? StatusEnum.PLAYING : StatusEnum.PAUSED; 42 | this.volume = parseFloat(getComputedStyle(iframe.querySelector('#vol-position')).left, 10) / 108 * 100; 43 | return this; 44 | } 45 | }; 46 | -------------------------------------------------------------------------------- /scripts/scrobble.js: -------------------------------------------------------------------------------- 1 | var api_key = "2aa5bd89dfc1b94205cc65b55556ef0e"; 2 | var api_secret = "80bec7945eb422b6030391d85896174a"; 3 | var api_url = "https://ws.audioscrobbler.com/2.0/?"; 4 | 5 | function auth() { 6 | var params = { 7 | method: "auth.gettoken", 8 | api_key: api_key, 9 | }; 10 | 11 | var api_sig = get_signature(params); 12 | 13 | $.get(api_url + get_query_string(params), function (data) { 14 | if ($(data).find("lfm").attr("status") == "ok") { 15 | var token = $(data).find("token").text(); 16 | chrome.storage.sync.set({ lastfm_token: token }); 17 | chrome.tabs.create({ 18 | url: 19 | "https://www.last.fm/api/auth/?api_key=" + 20 | api_key + 21 | "&token=" + 22 | token, 23 | }); 24 | } else { 25 | chrome.storage.sync.remove("lastfm_token"); 26 | } 27 | }); 28 | } 29 | 30 | function get_session_id(cb) { 31 | chrome.storage.sync.get( 32 | ["lastfm_token", "lastfm_sessionID"], 33 | function (data) { 34 | if (data["lastfm_token"] === undefined) { 35 | auth(); 36 | cb(""); 37 | } else if ( 38 | data["lastfm_sessionID"] !== undefined && 39 | data["lastfm_sessionID"].length > 0 40 | ) { 41 | cb(data["lastfm_sessionID"]); 42 | } else { 43 | var params = { 44 | method: "auth.getsession", 45 | api_key: api_key, 46 | token: data["lastfm_token"], 47 | }; 48 | $.get(api_url + get_query_string(params), function (xml) { 49 | if ($(xml).find("lfm").attr("status") == "ok") { 50 | var key = $(xml).find("key").text(); 51 | chrome.storage.sync.set({ lastfm_sessionID: key }); 52 | cb(key); 53 | } else { 54 | chrome.storage.sync.remove("lastfm_sessionID"); 55 | auth(); 56 | cb(""); 57 | } 58 | }); 59 | } 60 | } 61 | ); 62 | } 63 | 64 | function now_playing(details) { 65 | chrome.storage.sync.get("scrobbling-enabled", function (response) { 66 | if ( 67 | response["scrobbling-enabled"] == true && 68 | !(details === undefined || details.title === "") 69 | ) { 70 | get_session_id(function (session_id) { 71 | if (session_id !== "") { 72 | var params = { 73 | method: "track.updateNowPlaying", 74 | artist: details.artist, 75 | track: details.title, 76 | album: details.album, 77 | sk: session_id, 78 | api_key: api_key, 79 | }; 80 | params.api_sig = get_signature(params); 81 | $.post(api_url, params).error(function (data) { 82 | var status = $(data).find("lfm").attr("status"); 83 | if (status != "ok") { 84 | var code = $(data.responseXML).find("error").attr("code"); 85 | if (code == "9" || code == "4") { 86 | fail_auth(); 87 | } else { 88 | fail_scrobble($(data.responseXML).find("error").text()); 89 | } 90 | } 91 | }); 92 | } else { 93 | fail_auth(); 94 | } 95 | }); 96 | } 97 | }); 98 | } 99 | 100 | function scrobble(details) { 101 | chrome.storage.sync.get("scrobbling-enabled", function (response) { 102 | if (response["scrobbling-enabled"] == true) { 103 | if (details === undefined || details.title === "") { 104 | return; 105 | } 106 | 107 | if ( 108 | details.total_time_s > 30 && 109 | (details.current_time_s >= 240 || 110 | 2 * details.current_time_s >= details.total_time_s) 111 | ) { 112 | get_session_id(function (session_id) { 113 | if (session_id != "") { 114 | var params = { 115 | method: "track.scrobble", 116 | "artist[0]": details.artist, 117 | "track[0]": details.title, 118 | "timestamp[0]": Math.round( 119 | new Date().getTime() / 1000 - details.total_time_s 120 | ), 121 | "album[0]": details.album, 122 | sk: session_id, 123 | api_key: api_key, 124 | }; 125 | params.api_sig = get_signature(params); 126 | 127 | $.post(api_url, params).error(function (data) { 128 | var status = $(data.responseXML).find("lfm").attr("status"); 129 | if (status != "ok") { 130 | var code = $(data.responseXML).find("error").attr("code"); 131 | if (code == "9" || code == "4") { 132 | fail_auth(); 133 | } else { 134 | fail_scrobble($(data.responseXML).find("error").text()); 135 | } 136 | } 137 | }); 138 | } else { 139 | fail_auth(); 140 | } 141 | }); 142 | } 143 | } 144 | }); 145 | } 146 | 147 | function get_signature(params) { 148 | var keys = Object.keys(params); 149 | var string = ""; 150 | 151 | keys.sort(); 152 | keys.forEach(function (key) { 153 | string += key + params[key]; 154 | }); 155 | 156 | string += api_secret; 157 | 158 | return MD5(string); 159 | } 160 | 161 | function get_query_string(params) { 162 | var parts = new Array(), 163 | keys = new Array(); 164 | var o = ""; 165 | 166 | for (var x in params) { 167 | parts.push(x + "=" + encodeURIComponent(params[x])); 168 | keys.push(x); 169 | } 170 | 171 | keys.sort(); 172 | 173 | for (i = 0; i < keys.length; i++) { 174 | if (keys[i] == "format" || keys[i] == "callback") { 175 | continue; 176 | } 177 | o = o + keys[i] + params[keys[i]]; 178 | } 179 | 180 | return parts.join("&") + "&api_sig=" + get_signature(params); 181 | } 182 | 183 | function fail_auth() { 184 | chrome.notifications.create( 185 | "lastfm_fail", 186 | { 187 | type: "basic", 188 | title: "Last.fm authentication failed!", 189 | message: "Click here to reauthenticate.", 190 | iconUrl: "../img/icon-128.png", 191 | }, 192 | function (id) { 193 | chrome.storage.local.set({ lastfm_fail_id: id }); 194 | } 195 | ); 196 | } 197 | 198 | function fail_scrobble(msg) { 199 | chrome.notifications.create( 200 | "lastfm_fail_scrobble", 201 | { 202 | type: "basic", 203 | title: "Last.fm scrobbling failed!", 204 | message: msg, 205 | iconUrl: "../img/icon-128.png", 206 | }, 207 | function (id) { 208 | chrome.storage.local.set({ lastfm_fail_id: id }); 209 | } 210 | ); 211 | } 212 | 213 | chrome.runtime.onMessage.addListener(function (message, sender, sendResponse) { 214 | if (message.type == "auth") { 215 | auth(); 216 | } else if (message.type == "session") { 217 | get_session_id(sendResponse); 218 | } 219 | }); 220 | -------------------------------------------------------------------------------- /styles/chrome-bootstrap.css: -------------------------------------------------------------------------------- 1 | .chrome-bootstrap{font-family:'Droid Sans','Droid Sans Fallback','Lucida Grande',sans-serif;font-size:12px;color:#303942;cursor:default;margin:0}.chrome-bootstrap a{border:0;color:#15C;cursor:pointer;text-decoration:underline;font-weight:400}.chrome-bootstrap a:focus,.chrome-bootstrap a:hover{outline:0}.chrome-bootstrap ol,.chrome-bootstrap ul{padding:0}.chrome-bootstrap li{list-style-type:none}.chrome-bootstrap dd,.chrome-bootstrap dl,.chrome-bootstrap dt{margin:0}.chrome-bootstrap button{cursor:pointer}.chrome-bootstrap h1,.chrome-bootstrap h2,.chrome-bootstrap h3,.chrome-bootstrap h4{-webkit-user-select:none;font-weight:400;line-height:1}.chrome-bootstrap h1 small,.chrome-bootstrap h2 small,.chrome-bootstrap h3 small,.chrome-bootstrap h4 small{font-size:15px;margin:0 10px;color:#53637D}.chrome-bootstrap h1{-webkit-margin-after:1em;-webkit-margin-before:21px;-webkit-margin-start:23px;height:18px;font-size:18px}.chrome-bootstrap h1 a{color:#5C6166;text-decoration:none}.chrome-bootstrap h3{color:#000;font-size:1.2em;margin-bottom:.8em}.chrome-bootstrap h4{font-size:1em;margin-bottom:5px}.chrome-bootstrap .frame .navigation{height:100%;-webkit-margin-start:0;position:fixed;-webkit-margin-end:15px;width:155px;z-index:3}.chrome-bootstrap .frame .content,.chrome-bootstrap .frame .view{width:738px;overflow-x:hidden}.chrome-bootstrap .frame .content{padding-top:55px}.chrome-bootstrap .frame .content p{text-align:justify}.chrome-bootstrap .frame .with_controls .content{padding-top:104px}.chrome-bootstrap .frame .view{-webkit-margin-start:155px}.chrome-bootstrap .frame .view a{font:inherit}.chrome-bootstrap .frame .mainview>*{-webkit-margin-start:-20px;-webkit-transition:margin 100ms,opacity 100ms;opacity:0;z-index:0;position:absolute;top:0;display:block}.chrome-bootstrap .frame .mainview>.selected{-webkit-margin-start:0;-webkit-transition:margin 200ms,opacity 200ms;-webkit-transition-delay:100ms;z-index:1;opacity:1}.chrome-bootstrap header{position:fixed;background-image:-webkit-linear-gradient(#fff,#fff 40%,rgba(255,255,255,.92));width:738px;z-index:2}.chrome-bootstrap header h1{padding:21px 0 13px;margin:0;border-bottom:1px solid #EEE}.chrome-bootstrap header .corner{position:absolute;right:0;top:21px}.chrome-bootstrap header .corner input[type=text]{width:210px}.chrome-bootstrap header .corner.cancelable .delete{opacity:1;top:4px;right:5px}.chrome-bootstrap section{-webkit-padding-start:18px;margin-bottom:24px;margin-top:8px;max-width:600px}.chrome-bootstrap section h3{-webkit-margin-start:-18px}.chrome-bootstrap section .row{display:block;margin:.65em 0}.chrome-bootstrap .controls{-webkit-padding-end:3px;-webkit-padding-start:4px;-webkit-transition:padding 100ms,height 100ms,opacity 100ms;border-bottom:1px solid #EEE;display:-webkit-box;overflow:hidden;padding:13px 0;position:relative}.chrome-bootstrap .controls .text{display:inline-block;margin-top:4px}.chrome-bootstrap .controls .spacer{-webkit-box-flex:1}.chrome-bootstrap ol.pagination li{margin:0 2px;display:inline-block;line-height:25px}.chrome-bootstrap ol.pagination a{width:25px;height:24px;text-align:center;display:block;background:#F0F6FE;text-decoration:none}.chrome-bootstrap ol.pagination a.selected,.chrome-bootstrap ol.pagination a:hover{background:#8AAAED;color:#FFF}.chrome-bootstrap .alert{border-radius:3px;background:rgba(147,184,252,.2);display:block;position:relative;padding:10px 30px 10px 10px;line-height:17px}.chrome-bootstrap .alert .delete{top:5px;right:6px;opacity:1}.chrome-bootstrap ul.tags li{background:#8AAAED;color:#FFF;border-radius:3px;position:relative;display:inline-block;padding:2px 5px}.chrome-bootstrap ul.tags li a{color:#FFF;text-decoration:none}.chrome-bootstrap ul.tags li a:hover{text-decoration:underline}.chrome-bootstrap ul.tags li .delete{opacity:1;position:relative;display:inline-block;width:13px;height:12px;top:1px;background-position-y:-1px}.chrome-bootstrap ul.menu{-webkit-margin-before:1em;-webkit-margin-after:2em;-webkit-margin-start:0;-webkit-margin-end:0;-webkit-padding-start:40px;list-style-type:none;padding:0}.chrome-bootstrap ul.menu li{-webkit-border-start:6px solid transparent;-webkit-padding-start:18px;-webkit-user-select:none;display:list-item;text-align:-webkit-match-parent}.chrome-bootstrap ul.menu li.selected{-webkit-border-start-color:#4e5764}.chrome-bootstrap ul.menu li.selected a{color:#464E5A}.chrome-bootstrap ul.menu li a{border:0;color:#999;cursor:pointer;font:inherit;line-height:29px;margin:0;padding:0;text-decoration:none;display:block}.chrome-bootstrap .arrow_collapse{border-top:5px solid transparent;border-bottom:5px solid transparent;border-left:6px solid #999;-webkit-margin-end:4px;top:1px}.chrome-bootstrap .arrow_expand{border-left:5px solid transparent;border-right:5px solid transparent;border-top:7px solid #999;-webkit-margin-end:4px}.chrome-bootstrap .arrow{width:0;height:0;position:relative;display:inline-block}.chrome-bootstrap .delete{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAAiElEQVR42r2RsQrDMAxEBRdl8SDcX8lQPGg1GBI6lvz/h7QyRRXV0qUULwfvwZ1tenw5PxToRPWMC52eA9+WDnlh3HFQ/xBQl86NFYJqeGflkiogrOvVlIFhqURFVho3x1moGAa3deMs+LS30CAhBN5nNxeT5hbJ1zwmji2k+aF6NENIPf/hs54f0sZFUVAMigAAAABJRU5ErkJggg==);background-repeat:no-repeat;display:block;opacity:0;height:14px;width:14px;-webkit-transition:150ms opacity;background-color:transparent;text-indent:-5000px;position:absolute}.chrome-bootstrap .delete:hover{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAAqklEQVR4XqWRMQ6DMAxF/1Fyilyj2SmIBUG5QcTCyJA5Z8jGhlBPgRi4TmoDraVmKFJlWYrlp/g5QfwRlwEVNWVa4WzfH9jK6kCkEkBjwxOhLghheMWMELUAqqwQ4OCbnE4LJnhr5IYdqQt4DJQjhe9u4vBBmnxHHNzRFkDGjHDo0VuTAqy2vAG4NkvXXDHxbGsIGlj3e835VFNtdugma/Jk0eXq0lP//5svi4PtO01oFfYAAAAASUVORK5CYII=)}.chrome-bootstrap .highlightable li{position:relative;padding:2px 0}.chrome-bootstrap .highlightable li a:not(.action):focus,.chrome-bootstrap .highlightable li:hover>a:not(.action){background-color:#F0F6FE;color:#555}.chrome-bootstrap .highlightable li:hover>.action{opacity:.7}.chrome-bootstrap .highlightable li a{padding:5px;display:block;position:relative;z-index:0;text-decoration:none}.chrome-bootstrap .highlightable li dt{font-size:105%;margin-bottom:3px}.chrome-bootstrap .highlightable li dd{color:#999;overflow:hidden;white-space:nowrap;font-size:10px;margin-top:5px}.chrome-bootstrap .highlightable li .tags{float:left;margin-top:-1px;font-size:12px}.chrome-bootstrap .highlightable li .tags li:last-child{margin-right:5px}.chrome-bootstrap .highlightable li .tags li:hover>a:not(.action){background:#8AAAED;color:#FFF}.chrome-bootstrap .highlightable li .tags li a{padding:0}.chrome-bootstrap .highlightable li .action{-webkit-appearance:none;background:#8AAAED;border:0;border-radius:2px;color:#fff;opacity:0;margin-top:0;font-size:10px;padding:1px 6px;position:absolute;top:8px;right:32px;-webkit-transition:150ms opacity;cursor:pointer}.chrome-bootstrap .highlightable li .action:hover{opacity:1}.chrome-bootstrap .highlightable li .highlightable{-webkit-margin-start:30px}.chrome-bootstrap .highlightable.editable .delete{position:absolute;top:7px;right:5px}.chrome-bootstrap .highlightable.editable li:hover>.delete{opacity:1}.chrome-bootstrap .match{background:#f2f37b;display:inline-block;margin:0 1px}.chrome-bootstrap button,.chrome-bootstrap input[type=button],.chrome-bootstrap input[type=checkbox],.chrome-bootstrap input[type=radio],.chrome-bootstrap select{-webkit-appearance:none;-webkit-user-select:none;background-image:-webkit-linear-gradient(#ededed,#ededed 38%,#dedede);border:1px solid rgba(0,0,0,.25);border-radius:2px;box-shadow:0 1px 0 rgba(0,0,0,.08),inset 0 1px 2px rgba(255,255,255,.75);color:#444;font:inherit;margin:0 1px 0 0;text-shadow:0 1px 0 #F0F0F0}.chrome-bootstrap button.small{padding:1px 5px 2px;min-height:1em}.chrome-bootstrap input[type=checkbox]:checked::before{-webkit-user-select:none;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAALCAYAAACprHcmAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9wDBhYcG79aGIsAAACbSURBVBjTjdFBCkFhFAXgj4fp24PBy0SZ2ICRXRgYGb2xlKzBSEo2YgsiKWVoZgFKMjD5X/2Ux6lb99bpnNO5lKMR5i8MsEQHkhJiEzlS9HCqfiFWMUIt3AfsC3KKLCL30Qr7HfM4Ro4h6rhiEqmusIMKuphGqo+ogSPGcbYLzh91vdkXSHDDBk+0gxussS3rNcMCs+D6E18/9gLPPhbDshfzLgAAAABJRU5ErkJggg==);background-size:100% 100%;content:'';display:block;height:100%;width:100%}.chrome-bootstrap html[dir=rtl] input[type=checkbox]:checked::before{-webkit-transform:scaleX(-1)}.chrome-bootstrap input[type=radio]:checked::before{background-color:#666;border-radius:100%;bottom:3px;content:'';display:block;left:3px;position:absolute;right:3px;top:3px}.chrome-bootstrap select{-webkit-appearance:none;-webkit-padding-end:20px;-webkit-padding-start:6px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAAICAYAAAAbQcSUAAAAWklEQVQokWNgoAOIAuI0PDiKaJMSgYCZmfkbkPkfHYPEQfJEG/b//3+FBQsWLGRjY/uJbBCIDxIHyRNtGDYDyTYI3UA+Pr4vFBmEbODbt2+bKDYIyUBWYtQBAIRzRP/XKJ//AAAAAElFTkSuQmCC),-webkit-linear-gradient(#ededed,#ededed 38%,#dedede);background-position:right center;background-repeat:no-repeat;min-height:2em;min-width:4em}.chrome-bootstrap html[dir=rtl] select{background-position:center left}.chrome-bootstrap input[type=checkbox]{bottom:2px;height:13px;position:relative;vertical-align:middle;width:13px}.chrome-bootstrap input[type=radio]{border-radius:100%;bottom:3px;height:15px;position:relative;vertical-align:middle;width:15px}.chrome-bootstrap button{-webkit-padding-end:10px;-webkit-padding-start:10px;min-height:2em;min-width:4em}.chrome-bootstrap input[type=search],.chrome-bootstrap input[type=text]{border:1px solid #BFBFBF;border-radius:2px;box-sizing:border-box;color:#444;font:inherit;margin:0;min-height:2em;padding:3px;padding-bottom:4px}.chrome-bootstrap .checkbox,.chrome-bootstrap .radio{margin:.65em 0}.chrome-bootstrap button:focus,.chrome-bootstrap input[type=checkbox]:focus,.chrome-bootstrap input[type=password]:focus,.chrome-bootstrap input[type=radio]:focus,.chrome-bootstrap input[type=search]:focus,.chrome-bootstrap input[type=text]:focus,.chrome-bootstrap select:focus{-webkit-transition:border-color 200ms;border-color:#4d90fe;outline:0}.chrome-bootstrap button:disabled,.chrome-bootstrap select:disabled{background-image:-webkit-linear-gradient(#f1f1f1,#f1f1f1 38%,#e6e6e6);border-color:rgba(80,80,80,.2);box-shadow:0 1px 0 rgba(80,80,80,.08),inset 0 1px 2px rgba(255,255,255,.75);color:#aaa;cursor:default}.chrome-bootstrap select:disabled{background-image:-webkit-image-set(url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAAICAYAAAAbQcSUAAAAAXNSR0IArs4c6QAAAAd0SU1FB9sLAxYEBKriBmwAAAAGYktHRAD/AP8A/6C9p5MAAAAJcEhZcwAACxMAAAsTAQCanBgAAABLSURBVCiRY2CgA4gC4jQ8OIpokxKBoKGh4T8uDJIn2rD///8rLFiwYCE2g0DiIHkSfIndQLIMwmYgRQYhG/j27dsmig1CMpCVGHUAo8FcsHfxfXQAAAAASUVORK5CYII=) 1 x),-webkit-linear-gradient(#f1f1f1,#f1f1f1 38%,#e6e6e6)}.chrome-bootstrap input[type=checkbox]:disabled,.chrome-bootstrap input[type=radio]:disabled{opacity:.75}.chrome-bootstrap input[type=search]:disabled,.chrome-bootstrap input[type=text]:disabled{color:#999}.chrome-bootstrap button:hover:enabled,.chrome-bootstrap input[type=checkbox]:hover:enabled,.chrome-bootstrap input[type=radio]:hover:enabled,.chrome-bootstrap select:hover:enabled{background-image:-webkit-linear-gradient(#f0f0f0,#f0f0f0 38%,#e0e0e0);border-color:rgba(0,0,0,.3);box-shadow:0 1px 0 rgba(0,0,0,.12),inset 0 1px 2px rgba(255,255,255,.95);color:#000}.chrome-bootstrap select:hover:enabled{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAAICAYAAAAbQcSUAAAAWklEQVQokWNgoAOIAuI0PDiKaJMSgYCZmfkbkPkfHYPEQfJEG/b//3+FBQsWLGRjY/uJbBCIDxIHyRNtGDYDyTYI3UA+Pr4vFBmEbODbt2+bKDYIyUBWYtQBAIRzRP/XKJ//AAAAAElFTkSuQmCC),-webkit-linear-gradient(#f0f0f0,#f0f0f0 38%,#e0e0e0)}.chrome-bootstrap button:active:enabled,.chrome-bootstrap input[type=checkbox]:active:enabled,.chrome-bootstrap input[type=radio]:active:enabled,.chrome-bootstrap select:active:enabled{background-image:-webkit-linear-gradient(#e7e7e7,#e7e7e7 38%,#d7d7d7);box-shadow:none;text-shadow:none}.chrome-bootstrap select:active:enabled{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAAICAYAAAAbQcSUAAAAWklEQVQokWNgoAOIAuI0PDiKaJMSgYCZmfkbkPkfHYPEQfJEG/b//3+FBQsWLGRjY/uJbBCIDxIHyRNtGDYDyTYI3UA+Pr4vFBmEbODbt2+bKDYIyUBWYtQBAIRzRP/XKJ//AAAAAElFTkSuQmCC),-webkit-linear-gradient(#e7e7e7,#e7e7e7 38%,#d7d7d7)}.chrome-bootstrap .overlay{-webkit-box-align:center;-webkit-box-orient:vertical;-webkit-box-pack:center;-webkit-transition:opacity .2s;background-color:rgba(255,255,255,.75);bottom:0;display:-webkit-box;left:0;overflow:auto;padding:20px;position:fixed;right:0;top:0;z-index:5;opacity:1}.chrome-bootstrap .overlay.transparent{opacity:0}.chrome-bootstrap .overlay.transparent .page{-webkit-transform:scale(0.99) translateY(-20px)}.chrome-bootstrap .overlay .page{-webkit-border-radius:3px;-webkit-box-orient:vertical;-webkit-transition:200ms -webkit-transform;background:#fff;box-shadow:0 4px 23px 5px rgba(0,0,0,.2),0 2px 6px rgba(0,0,0,.15);color:#333;display:-webkit-box;min-width:400px;padding:0;position:relative;overflow:hidden}@-webkit-keyframes pulse{0%{-webkit-transform:scale(1)}40%,60%{-webkit-transform:scale(1.02)}100%{-webkit-transform:scale(1)}}.chrome-bootstrap .overlay .page.pulse{-webkit-animation-duration:180ms;-webkit-animation-iteration-count:1;-webkit-animation-name:pulse;-webkit-animation-timing-function:ease-in-out}.chrome-bootstrap .overlay .page h1{-webkit-padding-end:24px;-webkit-user-select:none;color:#333;font-size:120%;margin:0;padding:14px 17px;text-shadow:#fff 0 1px 2px}.chrome-bootstrap .overlay .page ul li{padding:5px 0}.chrome-bootstrap .overlay .page ul.tags li{padding:2px 5px}.chrome-bootstrap .overlay .page .content-area{-webkit-box-flex:1;overflow:auto;padding:6px 17px}.chrome-bootstrap .overlay .page .close-button{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAQAAAC1QeVaAAAAUklEQVR4XqXPYQrAIAhAYW/gXd8NJxTopVqsGEhtf+L9/ERU2k/HSMFQpKcYJeNFI9Be0LCMij8cYyjj5EHIivGBkwLfrbX3IF8PqumVmnDpEG+eDsKibPG2JwAAAABJRU5ErkJggg==);background-position:center;background-repeat:no-repeat;height:14px;position:absolute;right:7px;top:7px;width:14px}.chrome-bootstrap .overlay .page .close-button:hover{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAQAAAC1QeVaAAAAnUlEQVR4XoWQQQ6CQAxFewjkJkMCyXgJPMk7AiYczyBeZEAX6AKctGIaN+bt+trk9wtGQc/IkhnoKGxqqiWxOSZalapWFZ6VrIUDExsN0a5JRBq9LoVOR0eEQMoEhKizXhhsn0p1sCWVo7CwOf1RytPL8CPvwuBUoHL6ugeK30CVD1TqK7V/hdpe+VNChhOzV8xWny/+xosHF8578W/Hmc1OOC3wmwAAAABJRU5ErkJggg==)}.chrome-bootstrap .overlay .page .action-area{-webkit-box-align:center;-webkit-box-orient:horizontal;-webkit-box-pack:end;display:-webkit-box;padding:14px 17px}.chrome-bootstrap .overlay .page .action-area-right{display:-webkit-box}.chrome-bootstrap .overlay .page .button-strip{-webkit-box-orient:horizontal;display:-webkit-box}.chrome-bootstrap .overlay .page .button-strip button{-webkit-margin-start:10px;display:block} -------------------------------------------------------------------------------- /styles/fonts.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'Material Icons'; 3 | font-style: normal; 4 | font-weight: 400; 5 | src: local('Material Icons'), local('MaterialIcons-Regular'), url(../fonts/icons.woff2) format('woff2'); 6 | } 7 | 8 | .material-icons { 9 | font-family: 'Material Icons'; 10 | font-weight: normal; 11 | font-style: normal; 12 | font-size: 24px; 13 | line-height: 1; 14 | letter-spacing: normal; 15 | text-transform: none; 16 | display: inline-block; 17 | white-space: nowrap; 18 | word-wrap: normal; 19 | direction: ltr; 20 | -webkit-font-feature-settings: 'liga'; 21 | -webkit-font-smoothing: antialiased; 22 | } 23 | 24 | 25 | @font-face { 26 | font-family: 'Roboto'; 27 | font-weight: 300; 28 | font-style: normal; 29 | src: url('../fonts/Roboto-300/Roboto-300.eot'); 30 | src: url('../fonts/Roboto-300/Roboto-300.eot?#iefix') format('embedded-opentype'), 31 | local('Roboto Light'), 32 | local('Roboto-300'), 33 | url('../fonts/Roboto-300/Roboto-300.woff2') format('woff2'), 34 | url('../fonts/Roboto-300/Roboto-300.woff') format('woff'), 35 | url('../fonts/Roboto-300/Roboto-300.ttf') format('truetype'), 36 | url('../fonts/Roboto-300/Roboto-300.svg#Roboto') format('svg'); 37 | } 38 | 39 | @font-face { 40 | font-family: 'Roboto'; 41 | font-weight: 400; 42 | font-style: normal; 43 | src: url('../fonts/Roboto-regular/Roboto-regular.eot'); 44 | src: url('../fonts/Roboto-regular/Roboto-regular.eot?#iefix') format('embedded-opentype'), 45 | local('Roboto Light'), 46 | local('Roboto-regular'), 47 | url('../fonts/Roboto-regular/Roboto-regular.woff2') format('woff2'), 48 | url('../fonts/Roboto-regular/Roboto-regular.woff') format('woff'), 49 | url('../fonts/Roboto-regular/Roboto-regular.ttf') format('truetype'), 50 | url('../fonts/Roboto-regular/Roboto-regular.svg#Roboto') format('svg'); 51 | } 52 | 53 | @font-face { 54 | font-family: 'Roboto'; 55 | font-weight: 500; 56 | font-style: normal; 57 | src: url('../fonts/Roboto-500/Roboto-500.eot'); 58 | src: url('../fonts/Roboto-500/Roboto-500.eot?#iefix') format('embedded-opentype'), 59 | local('Roboto Light'), 60 | local('Roboto-500'), 61 | url('../fonts/Roboto-500/Roboto-500.woff2') format('woff2'), 62 | url('../fonts/Roboto-500/Roboto-500.woff') format('woff'), 63 | url('../fonts/Roboto-500/Roboto-500.ttf') format('truetype'), 64 | url('../fonts/Roboto-500/Roboto-500.svg#Roboto') format('svg'); 65 | } 66 | 67 | @font-face { 68 | font-family: 'Roboto'; 69 | font-weight: 700; 70 | font-style: normal; 71 | src: url('../fonts/Roboto-700/Roboto-700.eot'); 72 | src: url('../fonts/Roboto-700/Roboto-700.eot?#iefix') format('embedded-opentype'), 73 | local('Roboto Light'), 74 | local('Roboto-700'), 75 | url('../fonts/Roboto-700/Roboto-700.woff2') format('woff2'), 76 | url('../fonts/Roboto-700/Roboto-700.woff') format('woff'), 77 | url('../fonts/Roboto-700/Roboto-700.ttf') format('truetype'), 78 | url('../fonts/Roboto-700/Roboto-700.svg#Roboto') format('svg'); 79 | } 80 | -------------------------------------------------------------------------------- /styles/popup.css: -------------------------------------------------------------------------------- 1 | #popup { 2 | font-family: 'Roboto', arial, sans-serif; 3 | width: 320px; 4 | height: 460px; 5 | background-color: #e5e5e5; 6 | position: absolute; 7 | cursor: default; 8 | -webkit-user-select: none; 9 | } 10 | 11 | body { 12 | margin: 0; 13 | min-width: 320px; 14 | min-height: 460px; 15 | overflow: hidden; 16 | } 17 | 18 | .album-art { 19 | height: 320px; 20 | width: 320px; 21 | background: 22 | linear-gradient( 23 | to bottom, 24 | rgba(0, 0, 0, 0.6), 25 | rgba(0, 0, 0, 0)), 26 | no-repeat url(../img/default_album.png); 27 | background-size: 320px 320px; 28 | position: relative; 29 | z-index: 1; 30 | } 31 | 32 | #art-controls { 33 | position: absolute; 34 | bottom: 0; 35 | width: 100%; 36 | height: 50px; 37 | background: 38 | linear-gradient( 39 | to top, 40 | rgba(0, 0, 0, 0.5), 41 | rgba(0, 0, 0, 0)); 42 | } 43 | 44 | #art-controls > i { 45 | font-size: 18px; 46 | color: white; 47 | position: absolute; 48 | bottom: 15; 49 | } 50 | 51 | #repeat { 52 | left: 15; 53 | } 54 | 55 | #shuffle { 56 | right: 15; 57 | } 58 | 59 | #playlist { 60 | display: flex; 61 | } 62 | 63 | .playlist-table { 64 | width: 100%; 65 | border: none; 66 | } 67 | 68 | #playlist th { 69 | color: #212121; 70 | padding-bottom: 0; 71 | height: 36px; 72 | text-transform: uppercase; 73 | } 74 | 75 | #playlist th > i { 76 | font-size: 18px; 77 | display: inline-block; 78 | margin-bottom: 4px; 79 | } 80 | 81 | #song_header { 82 | text-indent: 55; 83 | } 84 | 85 | #playlist tr { 86 | outline: none; 87 | height: 30; 88 | transition-duration: 0.1s; 89 | } 90 | 91 | .song-row td { 92 | height: 64px; 93 | line-height: 64px; 94 | max-height: 64px; 95 | min-height: 64px; 96 | border-bottom: none; 97 | font-size: #616161; 98 | padding: 0; 99 | text-indent: 8px; 100 | cursor: pointer; 101 | white-space: nowrap; 102 | overflow: hidden; 103 | border: none; 104 | } 105 | 106 | .song-row .song-info { 107 | display: block; 108 | position: relative; 109 | overflow: hidden; 110 | } 111 | 112 | .playlist-table img { 113 | height: 48; 114 | width: 48; 115 | padding: 8 8 8 0; 116 | float: left; 117 | } 118 | 119 | .song-indicator { 120 | height: 48; 121 | width: 48; 122 | padding: 8 0; 123 | float: left; 124 | background-size: 40px 40px; 125 | background-repeat: no-repeat; 126 | background-position: center; 127 | float: none; 128 | background-image: url('../img/eq_paused.png'); 129 | position: absolute; 130 | left: 0; 131 | top: 0; 132 | } 133 | 134 | .song-indicator[disabled] { 135 | display: none; 136 | } 137 | 138 | .song-indicator-active { 139 | background-image: url('../img/eq_playing.gif'); 140 | } 141 | 142 | .playlist-table .song-details-span { 143 | display: block; 144 | position: relative; 145 | overflow: hidden; 146 | line-height: 20px; 147 | width: 100%; 148 | padding-left: 16px; 149 | } 150 | 151 | .playlist-table .song-details { 152 | display: inline-block; 153 | vertical-align: top; 154 | position: absolute; 155 | margin-top: 12px; 156 | } 157 | 158 | .playlist-table .song-title { 159 | color: #212121; 160 | line-height: 20px; 161 | height: 20px; 162 | font-size: 15px; 163 | } 164 | 165 | .playlist-table .song-artist-album { 166 | line-height: 16px; 167 | height: 16px; 168 | font-size: 13px; 169 | margin-top: 4px; 170 | color: #616161; 171 | } 172 | 173 | .playlist-table .song-title, .playlist-table .song-artist-album { 174 | text-overflow: ellipsis; 175 | max-width: 175px; 176 | overflow: hidden; 177 | white-space: nowrap; 178 | } 179 | 180 | .playlist-table .duration { 181 | text-align: right; 182 | vertical-align: middle; 183 | width: 60px; 184 | } 185 | 186 | .playlist-table .play-count { 187 | text-align: right; 188 | vertical-align: middle; 189 | width: 50px; 190 | } 191 | 192 | header { 193 | height: 70px; 194 | } 195 | 196 | #song-info { 197 | overflow: hidden; 198 | white-space: nowrap; 199 | padding: 11 0 0 20; 200 | } 201 | 202 | .mdl-layout__drawer-button > i { 203 | padding-top: 11px; 204 | } 205 | 206 | #title { 207 | z-index: 1; 208 | padding: 5 20 10 0; 209 | position: relative; 210 | } 211 | 212 | #subtitle { 213 | z-index: 1; 214 | font-size: 12px; 215 | font-weight: 300; 216 | position: relative; 217 | padding-right: 20; 218 | } 219 | 220 | #subtitle a { 221 | color: white; 222 | text-decoration: none; 223 | font-weight: 300; 224 | } 225 | 226 | #title, #subtitle div { 227 | width: 220px; 228 | overflow: hidden; 229 | text-overflow: ellipsis; 230 | } 231 | 232 | #current-time, #total-time { 233 | font-size: 11px; 234 | color: rgba(0, 0, 0, 0.870588); 235 | position: absolute; 236 | bottom: 0; 237 | z-index: 2; 238 | } 239 | 240 | #current-time { 241 | left: 10; 242 | } 243 | 244 | #total-time { 245 | right: 10; 246 | } 247 | 248 | #slider-wrapper { 249 | width: 372; 250 | margin: -8 0 0 -26; 251 | z-index: 1; 252 | top: 0; 253 | position: absolute; 254 | } 255 | 256 | #controls { 257 | position: absolute; 258 | left: 0px; 259 | bottom: 0; 260 | background-color: #fafafa; 261 | width: 100%; 262 | height: 70px; 263 | display: flex; 264 | flex-flow: row nowrap; 265 | justify-content: space-between; 266 | align-items: center; 267 | } 268 | 269 | #controls-left { 270 | display: flex; 271 | justify-content: flex-start; 272 | align-items: center; 273 | margin-left: 10px; 274 | } 275 | 276 | #controls-left > button { 277 | margin: 1 5; 278 | } 279 | 280 | #controls-right { 281 | display: flex; 282 | justify-content: flex-end; 283 | align-items: center; 284 | margin: 0 10 0 50; 285 | } 286 | 287 | #controls-right i, #top-controls i { 288 | font-size: 18px; 289 | } 290 | 291 | #controls button { 292 | outline: none; 293 | border: none; 294 | margin: 1px; 295 | z-index: 2; 296 | box-shadow: none!important; 297 | } 298 | 299 | #vol-wrapper { 300 | width: 150; 301 | margin: 0 -10 0 -20; 302 | } 303 | 304 | #vol-slider[disabled], #vol-up { 305 | display: none; 306 | } 307 | 308 | .thumb[disabled] { 309 | display: none; 310 | } 311 | 312 | #list-content { 313 | height: 320; 314 | width: 320; 315 | background-color: white; 316 | position: absolute; 317 | bottom: 70; 318 | left: 0; 319 | overflow: auto; 320 | } 321 | 322 | #list-loader { 323 | position: absolute; 324 | top: 146; /* 320/2 - height/2 */ 325 | left: 146; 326 | } 327 | 328 | .end-loading { 329 | left: 146; 330 | margin: 10 0 10 0; 331 | } 332 | 333 | #list-none { 334 | display: none; 335 | } 336 | 337 | #version { 338 | padding-left: 16px; 339 | color: #aaa; 340 | font-size: 12px; 341 | } 342 | 343 | #options h3 { 344 | font-size: 16px; 345 | line-height: 24px; 346 | margin: 10px 0; 347 | } 348 | 349 | #options p { 350 | line-height: 1.4; 351 | margin: 10px 0; 352 | } 353 | 354 | .mdl-layout__drawer { 355 | overflow-y: hidden; 356 | } 357 | 358 | .card-table { 359 | display: flex; 360 | flex-wrap: wrap; 361 | margin-right: -5; 362 | width: 100%; 363 | } 364 | 365 | .card-image.mdl-card { 366 | flex: 0 0 auto; 367 | width: calc(50% - 10px); 368 | margin: 5; 369 | display: flex; 370 | } 371 | 372 | .card-image > .mdl-card__actions { 373 | height: 54px; 374 | padding: 8px; 375 | background: rgba(0, 0, 0, 0.8); 376 | } 377 | 378 | .card-image__filename { 379 | color: white; 380 | font-size: 11px; 381 | font-weight: 500; 382 | overflow: hidden; 383 | position: absolute; 384 | padding: 8; 385 | bottom: 0; 386 | right: 0; 387 | text-align: right; 388 | } 389 | 390 | .search-container { 391 | padding: 0 16; 392 | color: #757575; 393 | } 394 | 395 | .search-container i { 396 | font-size: 18px; 397 | position: absolute; 398 | margin-top: 26px; 399 | } 400 | 401 | .search { 402 | margin-bottom: 0; 403 | padding-left: 28px; 404 | } 405 | 406 | .mdl-layout__drawer .mdl-navigation { 407 | padding-top: 0; 408 | } 409 | 410 | .mdl-layout__drawer { 411 | overflow-x: hidden; 412 | } 413 | 414 | .art-control-active { 415 | color: rgb(244, 67, 54)!important; 416 | } 417 | 418 | .mdl-layout__drawer .mdl-navigation__link .material-icons { 419 | padding-right: 10px; 420 | font-size: 18px; 421 | transform: translateY(4px); 422 | } 423 | 424 | .settings-group { 425 | padding: 10 16; 426 | border-bottom: 1px solid #757575; 427 | } 428 | 429 | .close-button { 430 | margin: 4px; 431 | position: absolute; 432 | right: 10px; 433 | top: 11px; 434 | z-index: 2; 435 | cursor: pointer; 436 | } 437 | -------------------------------------------------------------------------------- /templates/albums.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 13 | 14 | 15 |
5 | 6 | 7 |
8 |
{{album.title}}
9 |
{{album.artist}}
10 |
11 |
12 |
16 | 17 |
18 | -------------------------------------------------------------------------------- /templates/artist.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | Albums 4 | Top Songs 5 |
6 |
7 | 8 | 9 | 10 | 19 | 20 | 21 |
11 | 12 | 13 |
14 |
{{album.title}}
15 |
{{album.artist}}
16 |
17 |
18 |
22 |
23 | 24 |
25 | 26 | 27 | 28 | 29 | 32 | 33 | 34 | 35 | 36 | 46 | 49 | 50 | 51 |
Song 30 | schedule 31 |
37 | 38 | 39 |
40 |
{{song.title}}
41 |
{{song.artist}} - {{song.album}}
42 |
43 |
44 |
45 |
47 | {{song.total_time}} 48 |
52 |
53 |
54 | 55 | -------------------------------------------------------------------------------- /templates/artists.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 | {{artist.name}} 6 |
7 |
8 |
9 | 10 |
11 | -------------------------------------------------------------------------------- /templates/controls-left.html: -------------------------------------------------------------------------------- 1 | 4 | 7 | 10 | -------------------------------------------------------------------------------- /templates/controls-right.html: -------------------------------------------------------------------------------- 1 | 4 | 7 | 10 |

11 | 12 |

13 | 16 | 19 | -------------------------------------------------------------------------------- /templates/current_playlist.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 22 | 25 | 26 | 27 |
Song 6 | schedule 7 |
13 | 14 | 15 |
16 |
{{song.title}}
17 |
{{song.artist}} - {{song.album}}
18 |
19 |
20 |
21 |
23 | {{song.total_time}} 24 |
28 | -------------------------------------------------------------------------------- /templates/loading.html: -------------------------------------------------------------------------------- 1 |
2 | -------------------------------------------------------------------------------- /templates/options.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 7 |
8 |
9 | 13 | Modify keybindings 14 |
15 |
16 | 20 |

21 | Authorize Last.fm account 22 |

23 | You appear to be logged in. If you are having problems scrobbling, reauthorizing may fix the issue. 24 |

25 |

26 |
27 |
28 | -------------------------------------------------------------------------------- /templates/playlist.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 22 | 25 | 26 | 27 |
Song 6 | schedule 7 |
13 | 14 | 15 |
16 |
{{song.title}}
17 |
{{song.artist}} - {{song.album}}
18 |
19 |
20 |
21 |
23 | {{song.total_time}} 24 |
28 | -------------------------------------------------------------------------------- /templates/playlists.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | Recent 4 | Auto 5 | Yours 6 |
7 |
8 | 9 | 10 | 11 | 19 | 20 | 21 |
12 | 13 | 14 |
15 |
{{playlist.title}}
16 |
17 |
18 |
22 |
23 | 24 |
25 | 26 | 27 | 28 | 36 | 37 | 38 |
29 | 30 | 31 |
32 |
{{playlist.title}}
33 |
34 |
35 |
39 |
40 | 41 |
42 | 43 | 44 | 45 | 53 | 54 | 55 |
46 | 47 | 48 |
49 |
{{playlist.title}}
50 |
51 |
52 |
56 |
57 |
58 |
59 | 60 | -------------------------------------------------------------------------------- /templates/recents.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 13 | 14 | 15 |
5 | 6 | 7 |
8 |
{{item.title}}
9 |
{{item.subtitle}}
10 |
11 |
12 |
16 | -------------------------------------------------------------------------------- /templates/search.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | Artists 4 | Albums 5 | Songs 6 |
7 |
8 |
9 |
10 |
11 |
12 | {{artist.name}} 13 |
14 |
15 |
16 |
17 | 18 |
19 | 20 | 21 | 22 | 31 | 32 | 33 |
23 | 24 | 25 |
26 |
{{album.title}}
27 |
{{album.artist}}
28 |
29 |
30 |
34 |
35 | 36 |
37 | 38 | 39 | 40 | 41 | 44 | 45 | 46 | 47 | 48 | 58 | 61 | 62 | 63 |
Song 42 | schedule 43 |
49 | 50 | 51 |
52 |
{{song.title}}
53 |
{{song.artist}} - {{song.album}}
54 |
55 |
56 |
57 |
59 | {{song.total_time}} 60 |
64 |
65 |
66 | 67 | -------------------------------------------------------------------------------- /templates/stations.html: -------------------------------------------------------------------------------- 1 |
2 | 6 |
7 | 8 | 9 | 10 | 18 | 19 | 20 |
11 | 12 | 13 |
14 |
{{station.title}}
15 |
16 |
17 |
21 |
22 | 23 |
24 | 25 | 26 | 27 | 35 | 36 | 37 |
28 | 29 | 30 |
31 |
{{station.title}}
32 |
33 |
34 |
38 |
39 |
40 | 41 |
42 | --------------------------------------------------------------------------------