rewrite init
9
.editorconfig
Normal file
@ -0,0 +1,9 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
indent_style = tab
|
||||
indent_size = 4
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
5
.eslintrc.js
Normal file
@ -0,0 +1,5 @@
|
||||
module.exports = {
|
||||
extends: [
|
||||
'@nextcloud'
|
||||
]
|
||||
};
|
19
.gitignore
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
.DS_Store
|
||||
node_modules/
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
# Editor directories and files
|
||||
.idea
|
||||
.vscode
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
|
||||
.marginalia
|
||||
|
||||
js/
|
||||
build/
|
||||
coverage/
|
1
.npmignore
Normal file
@ -0,0 +1 @@
|
||||
node_modules
|
113
CHANGELOG.md
@ -1,113 +0,0 @@
|
||||
## 0.7.0 - 2020-02
|
||||
### Fixed
|
||||
- Nextcloud 19-20 compatibility
|
||||
[]() @ ()
|
||||
- New Radio-Browser API endpoint
|
||||
[]() @ ()
|
||||
|
||||
## 0.6.6 - 2020-02
|
||||
### Added
|
||||
- French translation
|
||||
[#92](https://git.project-insanity.org/onny/nextcloud-app-radio/issues/92) @lftsy (Marc Leurent)
|
||||
### Fixed
|
||||
- js/main.js: Fixed typo (Countires => Countries)
|
||||
[!2](https://git.project-insanity.org/onny/nextcloud-app-radio/merge_requests/2) @robin.vonbuelow (Robin von Bülow)
|
||||
- Support for Nextcloud 18
|
||||
[#98](https://git.project-insanity.org/onny/nextcloud-app-radio/issues/98) @onny (Jonas Heinrich)
|
||||
|
||||
## 0.6.5 - 2019-05
|
||||
### Added
|
||||
- Smooth audio fade-in/out when changing stations
|
||||
[#80](https://git.project-insanity.org/onny/nextcloud-app-radio/issues/80) @onny
|
||||
- Implement category section
|
||||
[#35](https://git.project-insanity.org/onny/nextcloud-app-radio/issues/35) @onny
|
||||
### Fixed
|
||||
- Prevent list from jumping back to top when adding station to favorites
|
||||
[#85](https://git.project-insanity.org/onny/nextcloud-app-radio/issues/85) @onny
|
||||
- Continous scrolling fails while searching
|
||||
[#47](https://git.project-insanity.org/onny/nextcloud-app-radio/issues/47) @onny
|
||||
|
||||
## 0.6.4 – 2019-01
|
||||
### Added
|
||||
- Support for Nextcloud 15
|
||||
[#82](https://git.project-insanity.org/onny/nextcloud-app-radio/issues/82) @onny
|
||||
### Fixed
|
||||
- Fix issue removing broken radio stations from fav
|
||||
[#76](https://git.project-insanity.org/onny/nextcloud-app-radio/issues/76) @onny
|
||||
|
||||
## 0.6.3 – 2018-09-08
|
||||
### Fixed
|
||||
- Fix table size issues for mobile clients
|
||||
[#72](https://git.project-insanity.org/onny/nextcloud-app-radio/issues/72) @onny
|
||||
- Include custom User-Agent header
|
||||
[#75](https://git.project-insanity.org/onny/nextcloud-app-radio/issues/75) @onny
|
||||
- Fix loading all favorites
|
||||
[#58](https://git.project-insanity.org/onny/nextcloud-app-radio/issues/58) @onny
|
||||
- Remember favorite stations sort order
|
||||
[#64](https://git.project-insanity.org/onny/nextcloud-app-radio/issues/64) @onny
|
||||
- Split up javascript file
|
||||
[#67](https://git.project-insanity.org/onny/nextcloud-app-radio/issues/67) @onny
|
||||
|
||||
## 0.6.2 – 2018-08-11
|
||||
### Added
|
||||
- Remember last menu state
|
||||
[#26](https://git.project-insanity.org/onny/nextcloud-app-radio/issues/26) @onny
|
||||
- Navigation by hash location
|
||||
[#63](https://git.project-insanity.org/onny/nextcloud-app-radio/issues/63) @onny
|
||||
- Add icon categories
|
||||
[#](https://git.project-insanity.org/onny/nextcloud-app-radio/commit/b7e711955b90f388a5e340ab582461fd39df8969) @onny
|
||||
- Add volume icon
|
||||
[#](https://git.project-insanity.org/onny/nextcloud-app-radio/commit/07ce3e5aebd5e5b5bf91e3aae996441ae9268402) @onny
|
||||
- Remember volume state
|
||||
[#66](https://git.project-insanity.org/onny/nextcloud-app-radio/issues/66) @onny
|
||||
- German translation
|
||||
[#38](https://git.project-insanity.org/onny/nextcloud-app-radio/issues/38) @onny
|
||||
- Add donation info to README
|
||||
[#70](https://git.project-insanity.org/onny/nextcloud-app-radio/issues/70) @onny
|
||||
- Toggle audio mute click on volume icon
|
||||
[#69](https://git.project-insanity.org/onny/nextcloud-app-radio/issues/69) @onny
|
||||
|
||||
### Fixed
|
||||
- Fix styling issue (overflow hidden) player area
|
||||
[#65](https://git.project-insanity.org/onny/nextcloud-app-radio/issues/65) @onny
|
||||
- Fix styling issue colum width on Chrome browsers
|
||||
[#37](https://git.project-insanity.org/onny/nextcloud-app-radio/issues/37) @onny
|
||||
- Don't scroll to top when clicking on station
|
||||
[#62](https://git.project-insanity.org/onny/nextcloud-app-radio/issues/62) @onny
|
||||
- Fix Nextcloud 14 compatibility
|
||||
[#57](https://git.project-insanity.org/onny/nextcloud-app-radio/issues/57) @onny
|
||||
[#61](https://git.project-insanity.org/onny/nextcloud-app-radio/issues/61) @onny
|
||||
- Fix play/pause toggle favicon
|
||||
[#59](https://git.project-insanity.org/onny/nextcloud-app-radio/issues/59) @onny
|
||||
- Preload images
|
||||
[#68](https://git.project-insanity.org/onny/nextcloud-app-radio/issues/68) @onny
|
||||
|
||||
## 0.6.1 – 2018-08-11
|
||||
### Changed
|
||||
- Display station metadata
|
||||
[#53](https://git.project-insanity.org/onny/nextcloud-app-radio/commit/9908231b7a24f21b1ab74d3aaa086eafa135e395) @onny
|
||||
|
||||
### Fixed
|
||||
- Fix loading favorites
|
||||
[#54](https://git.project-insanity.org/onny/nextcloud-app-radio/commit/d17b7720ced885d327ec5f74c066ef1862b49bd6) @onny
|
||||
|
||||
## 0.6.0 – 2017-08-11
|
||||
### Added
|
||||
- Display station metadata
|
||||
[#22](https://git.project-insanity.org/onny/nextcloud-app-radio/commit/c62ee87b490de39ed27e43dec4dfff221bff40b1) @onny
|
||||
- Add changelog file
|
||||
[#28](https://git.project-insanity.org/onny/nextcloud-app-radio/commit/04b1bbf49c8d7eb95e9e5d08e9e3b4b7cdc7f4ee) @onny
|
||||
- Continious scrolling
|
||||
[#13](https://git.project-insanity.org/onny/nextcloud-app-radio/commit/c8e86558d0a1ceeea21f801f6e2391ab70046a4e) @onny
|
||||
- Loading animation
|
||||
[#25](https://git.project-insanity.org/onny/nextcloud-app-radio/commit/9624b4dc4c5770df93b548736c1be43b96d6dea5) @onny
|
||||
- Display info messages, station not found / no favorites
|
||||
[#20](https://git.project-insanity.org/onny/nextcloud-app-radio/commit/fba5aa6c8b913a63c4a726d4cbabf1c94331d9f0) @onny
|
||||
|
||||
### Fixed
|
||||
- Fix missing background color for first td in table row
|
||||
[#32](https://git.project-insanity.org/onny/nextcloud-app-radio/commit/9e5b7961009ca7842f8a025de59cb3acaae2bea1) @onny
|
||||
|
||||
## 0.5.0 – 2017-08-06
|
||||
### Added
|
||||
- First release
|
662
COPYING
@ -1,7 +1,661 @@
|
||||
Copyright 2018 Jonas Heinrich
|
||||
GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
Version 3, 19 November 2007
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
Preamble
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
The GNU Affero General Public License is a free, copyleft license for
|
||||
software and other kinds of works, specifically designed to ensure
|
||||
cooperation with the community in the case of network server software.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
our General Public Licenses are intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
Developers that use our General Public Licenses protect your rights
|
||||
with two steps: (1) assert copyright on the software, and (2) offer
|
||||
you this License which gives you legal permission to copy, distribute
|
||||
and/or modify the software.
|
||||
|
||||
A secondary benefit of defending all users' freedom is that
|
||||
improvements made in alternate versions of the program, if they
|
||||
receive widespread use, become available for other developers to
|
||||
incorporate. Many developers of free software are heartened and
|
||||
encouraged by the resulting cooperation. However, in the case of
|
||||
software used on network servers, this result may fail to come about.
|
||||
The GNU General Public License permits making a modified version and
|
||||
letting the public access it on a server without ever releasing its
|
||||
source code to the public.
|
||||
|
||||
The GNU Affero General Public License is designed specifically to
|
||||
ensure that, in such cases, the modified source code becomes available
|
||||
to the community. It requires the operator of a network server to
|
||||
provide the source code of the modified version running there to the
|
||||
users of that server. Therefore, public use of a modified version, on
|
||||
a publicly accessible server, gives the public access to the source
|
||||
code of the modified version.
|
||||
|
||||
An older license, called the Affero General Public License and
|
||||
published by Affero, was designed to accomplish similar goals. This is
|
||||
a different license, not a version of the Affero GPL, but Affero has
|
||||
released a new version of the Affero GPL which permits relicensing under
|
||||
this license.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU Affero General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Remote Network Interaction; Use with the GNU General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, if you modify the
|
||||
Program, your modified version must prominently offer all users
|
||||
interacting with it remotely through a computer network (if your version
|
||||
supports such interaction) an opportunity to receive the Corresponding
|
||||
Source of your version by providing access to the Corresponding Source
|
||||
from a network server at no charge, through some standard or customary
|
||||
means of facilitating copying of software. This Corresponding Source
|
||||
shall include the Corresponding Source for any work covered by version 3
|
||||
of the GNU General Public License that is incorporated pursuant to the
|
||||
following paragraph.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the work with which it is combined will remain governed by version
|
||||
3 of the GNU General Public License.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU Affero General Public License from time to time. Such new versions
|
||||
will be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU Affero General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU Affero General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU Affero General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If your software can interact with users remotely through a computer
|
||||
network, you should also make sure that it provides a way for users to
|
||||
get its source. For example, if your program is a web application, its
|
||||
interface could display a "Source" link that leads users to an archive
|
||||
of the code. There are many ways you could offer source, and different
|
||||
solutions will be better for different programs; see section 13 for the
|
||||
specific requirements.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU AGPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
52
Makefile
Normal file
@ -0,0 +1,52 @@
|
||||
all: dev-setup lint build-js-production test
|
||||
|
||||
# Dev env management
|
||||
dev-setup: clean clean-dev npm-init
|
||||
|
||||
npm-init:
|
||||
npm ci
|
||||
|
||||
npm-update:
|
||||
npm update
|
||||
|
||||
# Building
|
||||
build-js:
|
||||
npm run dev
|
||||
|
||||
build-js-production:
|
||||
npm run build
|
||||
|
||||
watch-js:
|
||||
npm run watch
|
||||
|
||||
# Testing
|
||||
test:
|
||||
npm run test
|
||||
|
||||
test-watch:
|
||||
npm run test:watch
|
||||
|
||||
test-coverage:
|
||||
npm run test:coverage
|
||||
|
||||
# Linting
|
||||
lint:
|
||||
npm run lint
|
||||
|
||||
lint-fix:
|
||||
npm run lint:fix
|
||||
|
||||
# Style linting
|
||||
stylelint:
|
||||
npm run stylelint
|
||||
|
||||
stylelint-fix:
|
||||
npm run stylelint:fix
|
||||
|
||||
# Cleaning
|
||||
clean:
|
||||
rm -f js/*
|
||||
|
||||
clean-dev:
|
||||
rm -rf node_modules
|
||||
|
60
README.md
@ -1,55 +1,7 @@
|
||||
# Nextcloud Radio app
|
||||
This experimental app uses the radio-browser.info api and offers radio stations right in your Nextcloud!
|
||||
# Vue example app for Nextcloud
|
||||
|
||||
[![](https://git.project-insanity.org/onny/nextcloud-app-radio/raw/master/screenshot.png)](https://git.project-insanity.org/onny/nextcloud-app-radio/raw/master/screenshot.png)
|
||||
|
||||
## Features
|
||||
|
||||
- [x] Browse hundreds of radio stations world wide and play them directly
|
||||
- [x] Save stations to your favorites list
|
||||
- [x] Smooth playback with audio transitions
|
||||
- [x] Explore new stations in the category section
|
||||
|
||||
## Maintainers
|
||||
* [Jonas Heinrich](https://github.com/onny)
|
||||
|
||||
## Installation
|
||||
|
||||
* **From the appstore:** The most recent and stable version of the app can be found in the [official appstore](https://apps.nextcloud.com/apps/radio).
|
||||
* **Using git:** In your `nextcloud/apps/` directory, run `git clone https://git.project-insanity.org/onny/nextcloud-app-radio.git radio`. Then go to the Apps manager tab in your Nextcloud web interface, and enable the Radio app.
|
||||
* **Using the zip archive:** Download the latest [tar.bz2 archive](https://git.project-insanity.org/onny/nextcloud-app-radio/repository/archive.tar.bz2?ref=master), extract the directory inside your `nextcloud/apps/` directory, and rename it to `radio`. For stable releases, you can also download one of the [releases](https://git.project-insanity.org/onny/nextcloud-app-radio/) tar.bz2 archives. Then go to the Apps manager tab in your Nextcloud web interface, and enable the Radio app.
|
||||
* **Using package manager:** For ArchLinux, there is an [AUR package](https://aur.archlinux.org/packages/nextcloud-app-radio-git/) available.
|
||||
|
||||
## Testing
|
||||
Can be easily tested using Docker:
|
||||
```
|
||||
docker build -t nextcloud-testing https://git.project-insanity.org/onny/docker-nextcloud.git
|
||||
docker run -v /tmp/nextcloud-app-radio:/opt/nextcloud/apps/radio -d --name nextcloud -p 80:80 nextcloud-testing
|
||||
```
|
||||
First part of -v is the path to the cloned or downloaded nextcloud radio app. Debug running container it with:
|
||||
```
|
||||
docker exec -i -t 665b4a1e17b6 /bin/bash
|
||||
```
|
||||
Where -t specifies the container id. If you further need to access the sqlite-database, logs or files inside the data folder of Nextcloud, that you also have to share this folder with the host:
|
||||
```
|
||||
docker run -v /tmp/dockerdata:/data/data -v /tmp/nextcloud-app-radio:/opt/nextcloud/apps/radio -d --name nextcloud -p 80:80 rootlogin/nextcloud
|
||||
```
|
||||
|
||||
## Reporting bugs
|
||||
You can report bugs in the public gitlab repository [here](https://git.project-insanity.org/onny/nextcloud-app-radio/issues) and for discussion you can find a section for the app in the offical Nextcloud forums [here](https://help.nextcloud.com/c/apps/radio).
|
||||
|
||||
## Adding translations
|
||||
For now only German translations are provided, so please submit your translations if possible :) It's really easy, just `git clone` this repo and copy the translation files in `l10n` according to your locale. Merge requests go to [this radio repository](https://git.project-insanity.org/onny/nextcloud-app-radio).
|
||||
|
||||
## Adding radio stations
|
||||
This app uses a public and open database of radio stations as its backend, so any station you add in [radio-browser.info](http://www.radio-browser.info/) (no account required), will be also available in this app. Feel free to contribute :)
|
||||
|
||||
## Credits
|
||||
* [radio-browser.info](http://www.radio-browser.info/) database api as backend for this app
|
||||
* Python example code to query stream metadata, took from [here](https://anton.logvinenko.name/en/blog/how-to-get-title-from-audio-stream-with-python.html).
|
||||
|
||||
## Donation
|
||||
If you like this app and want to support my work, you can donate to this Bitcoin address:
|
||||
```
|
||||
19mpmuNczGDgdxaBLBn3REEpQLPPcJHZB6
|
||||
```
|
||||
1. ☁ Clone this into your `apps` folder of your Nextcloud
|
||||
2. 👩💻 In a terminal, run the command `make dev-setup` to install the dependencies
|
||||
3. 🏗 Then to build the Javascript whenever you make changes, run `make build-js`
|
||||
4. ✅ Enable the app through the app management of your Nextcloud
|
||||
5. 🎉 Partytime!
|
||||
|
@ -1,14 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (c) 2011, Frank Karlitschek <karlitschek@kde.org>
|
||||
* Copyright (c) 2012, Florian Hülsmann <fh@cbix.de>
|
||||
* This file is licensed under the Affero General Public License version 3 or later.
|
||||
* See the COPYING-README file.
|
||||
*/
|
||||
|
||||
OCP\User::checkAdminUser();
|
||||
OCP\JSON::callCheck();
|
||||
|
||||
OCP\Config::setSystemValue( 'somesetting', $_GET['somesetting'] );
|
||||
|
||||
echo 'true';
|
@ -1,34 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* ownCloud - App Template plugin
|
||||
*
|
||||
* @author Frank Karlitschek
|
||||
* @author Florian Hülsmann
|
||||
* @copyright 2011 Frank Karlitschek karlitschek@kde.org
|
||||
* @copyright 2012 Florian Hülsmann fh@cbix.de
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3 of the License, or any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
$g = \OC::$server->getURLGenerator();
|
||||
|
||||
OC::$server->getNavigationManager()->add( array(
|
||||
'id' => 'radio',
|
||||
'order' => 74,
|
||||
'href' => $g->linkTo( 'apps', 'radio' ),
|
||||
'icon' => $g->imagePath( 'radio', 'radio.png' ),
|
||||
'name' => 'Radio'
|
||||
));
|
@ -1,34 +0,0 @@
|
||||
<database>
|
||||
<name>*dbname*</name>
|
||||
<create>true</create>
|
||||
<overwrite>false</overwrite>
|
||||
<charset>utf8</charset>
|
||||
<table>
|
||||
<name>*dbprefix*radio_stations</name>
|
||||
<declaration>
|
||||
<field>
|
||||
<name>id</name>
|
||||
<type>integer</type>
|
||||
<notnull>true</notnull>
|
||||
<autoincrement>true</autoincrement>
|
||||
<unsigned>true</unsigned>
|
||||
<primary>true</primary>
|
||||
<length>8</length>
|
||||
</field>
|
||||
<field>
|
||||
<name>stationid</name>
|
||||
<type>text</type>
|
||||
<length>200</length>
|
||||
<default></default>
|
||||
<notnull>true</notnull>
|
||||
</field>
|
||||
<field>
|
||||
<name>user_id</name>
|
||||
<type>text</type>
|
||||
<length>200</length>
|
||||
<default></default>
|
||||
<notnull>true</notnull>
|
||||
</field>
|
||||
</declaration>
|
||||
</table>
|
||||
</database>
|
17
appinfo/info.xml
Executable file → Normal file
@ -3,13 +3,12 @@
|
||||
xsi:noNamespaceSchemaLocation="https://apps.nextcloud.com/schema/apps/info.xsd">
|
||||
<id>radio</id>
|
||||
<name>Radio</name>
|
||||
<summary>Radio listening app</summary>
|
||||
<description>Listening to your favorite radio stations in Nextcloud</description>
|
||||
<version>0.7.0</version>
|
||||
<licence>agpl</licence>
|
||||
<author>Jonas Heinrich</author>
|
||||
<documentation>
|
||||
<admin>https://git.project-insanity.org/onny/nextcloud-app-radio</admin>
|
||||
</documentation>
|
||||
<version>1.0</version>
|
||||
<licence>MIT</licence>
|
||||
<author mail="onny@project-insanity.org" >Jonas Heinrich</author>
|
||||
<namespace>radio</namespace>
|
||||
<category>multimedia</category>
|
||||
<website>https://git.project-insanity.org/onny/nextcloud-app-radio</website>
|
||||
<bugs>https://git.project-insanity.org/onny/nextcloud-app-radio/issues</bugs>
|
||||
@ -17,4 +16,10 @@
|
||||
<dependencies>
|
||||
<nextcloud min-version="19" max-version="20"/>
|
||||
</dependencies>
|
||||
<navigations>
|
||||
<navigation>
|
||||
<name>Radio</name>
|
||||
<route>radio.page.index</route>
|
||||
</navigation>
|
||||
</navigations>
|
||||
</info>
|
||||
|
@ -1,26 +1,29 @@
|
||||
<?php
|
||||
|
||||
|
||||
/** @var $this \OCP\Route\IRouter */
|
||||
$this->create('radio_index', '/')
|
||||
->actionInclude('radio/index.php');
|
||||
/**
|
||||
* @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>
|
||||
*
|
||||
* @author John Molakvoæ <skjnldsv@protonmail.com>
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
return [
|
||||
'resources' => [
|
||||
'station' => ['url' => '/stations'],
|
||||
'station_api' => ['url' => '/api/0.1/stations']
|
||||
],
|
||||
'routes' => [
|
||||
['name' => 'page#index', 'url' => '/', 'verb' => 'GET'],
|
||||
['name' => 'page#favorites', 'url' => '/', 'verb' => 'GET'],
|
||||
['name' => 'page#recent', 'url' => '/', 'verb' => 'GET'],
|
||||
['name' => 'page#categories', 'url' => '/', 'verb' => 'GET'],
|
||||
['name' => 'page#top', 'url' => '/', 'verb' => 'GET'],
|
||||
['name' => 'settings#getMenuState', 'url' => '/getMenuState', 'verb' => 'GET'],
|
||||
['name' => 'settings#getVolumeState', 'url' => '/getVolumeState', 'verb' => 'GET'],
|
||||
['name' => 'settings#saveMenuState', 'url' => '/saveMenuState', 'verb' => 'POST'],
|
||||
['name' => 'settings#saveVolumeState', 'url' => '/saveVolumeState', 'verb' => 'POST'],
|
||||
['name' => 'station_api#preflighted_cors', 'url' => '/api/0.1/{path}',
|
||||
'verb' => 'OPTIONS', 'requirements' => ['path' => '.+']]
|
||||
['name' => 'page#mail', 'url' => '/mail', 'verb' => 'GET'],
|
||||
]
|
||||
];
|
||||
|
11
babel.config.js
Normal file
@ -0,0 +1,11 @@
|
||||
module.exports = {
|
||||
plugins: ['@babel/plugin-syntax-dynamic-import'],
|
||||
presets: [
|
||||
[
|
||||
'@babel/preset-env',
|
||||
{
|
||||
modules: false
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
13
composer.json
Normal file
@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "onny/radio",
|
||||
"description": "Lint config for onny/radio",
|
||||
"license": "MIT",
|
||||
"config": {
|
||||
"optimize-autoloader": true,
|
||||
"classmap-authoritative": true
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "find . -name \\*.php -not -path './vendor/*' -exec php -l \"{}\" \\;"
|
||||
}
|
||||
}
|
||||
|
@ -1,24 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace OCA\Radio\Controller;
|
||||
|
||||
use Closure;
|
||||
|
||||
use OCP\AppFramework\Http;
|
||||
use OCP\AppFramework\Http\DataResponse;
|
||||
|
||||
use OCA\Radio\Service\NotFoundException;
|
||||
|
||||
|
||||
trait Errors {
|
||||
|
||||
protected function handleNotFound (Closure $callback) {
|
||||
try {
|
||||
return new DataResponse($callback());
|
||||
} catch(NotFoundException $e) {
|
||||
$message = ['message' => $e->getMessage()];
|
||||
return new DataResponse($message, Http::STATUS_NOT_FOUND);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
<?php
|
||||
namespace OCA\Radio\Controller;
|
||||
|
||||
use OCP\IRequest;
|
||||
use OCP\AppFramework\Http\TemplateResponse;
|
||||
use OCP\AppFramework\Controller;
|
||||
|
||||
class PageController extends Controller {
|
||||
|
||||
public function __construct($AppName, IRequest $request){
|
||||
parent::__construct($AppName, $request);
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @NoCSRFRequired
|
||||
*/
|
||||
public function index() {
|
||||
return new TemplateResponse('radio', 'main');
|
||||
}
|
||||
|
||||
}
|
@ -1,87 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace OCA\Radio\Controller;
|
||||
|
||||
use \OCP\AppFramework\Controller;
|
||||
use \OCP\AppFramework\Http\TemplateResponse;
|
||||
use \OCP\IRequest;
|
||||
use \OCA\Radio\Service\ConfigService;
|
||||
|
||||
class SettingsController extends Controller {
|
||||
|
||||
private $userId;
|
||||
private $appConfig;
|
||||
|
||||
public function __construct($appName, IRequest $request, ConfigService $appConfig, $userId) {
|
||||
parent::__construct($appName, $request);
|
||||
$this->userId = $userId;
|
||||
$this->appConfig = $appConfig;
|
||||
}
|
||||
|
||||
/**
|
||||
* Save order for current user
|
||||
*
|
||||
* @NoAdminRequired
|
||||
* @return array response
|
||||
*/
|
||||
public function getMenuState() {
|
||||
$menu_state = $this->appConfig->getUserValue('menu_state', $this->userId);
|
||||
$response = array(
|
||||
'status' => 'success',
|
||||
'data' => array('message' => 'User order saved successfully.'),
|
||||
'menu_state' => $menu_state
|
||||
);
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Save order for current user
|
||||
*
|
||||
* @NoAdminRequired
|
||||
* @param $menu_state string
|
||||
* @return array response
|
||||
*/
|
||||
public function saveMenuState($menu_state) {
|
||||
$this->appConfig->setUserValue('menu_state', $this->userId, $menu_state);
|
||||
$response = array(
|
||||
'status' => 'success',
|
||||
'data' => array('message' => 'User order saved successfully.'),
|
||||
'menu_state' => $menu_state
|
||||
);
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Save volume for current user
|
||||
*
|
||||
* @NoAdminRequired
|
||||
* @return array response
|
||||
*/
|
||||
public function getVolumeState() {
|
||||
$volume_state = $this->appConfig->getUserValue('volume_state', $this->userId);
|
||||
$response = array(
|
||||
'status' => 'success',
|
||||
'data' => array('message' => 'User volume saved successfully.'),
|
||||
'volume_state' => $volume_state
|
||||
);
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Save volume for current user
|
||||
*
|
||||
* @NoAdminRequired
|
||||
* @param $menu_state string
|
||||
* @return array response
|
||||
*/
|
||||
public function saveVolumeState($volume_state) {
|
||||
$this->appConfig->setUserValue('volume_state', $this->userId, $volume_state);
|
||||
$response = array(
|
||||
'status' => 'success',
|
||||
'data' => array('message' => 'User volume saved successfully.'),
|
||||
'volume_state' => $volume_state
|
||||
);
|
||||
return $response;
|
||||
}
|
||||
|
||||
}
|
@ -1,84 +0,0 @@
|
||||
<?php
|
||||
namespace OCA\Radio\Controller;
|
||||
|
||||
use OCP\IRequest;
|
||||
use OCP\AppFramework\Http\DataResponse;
|
||||
use OCP\AppFramework\ApiController;
|
||||
|
||||
use OCA\Radio\Service\StationService;
|
||||
|
||||
class StationApiController extends ApiController {
|
||||
|
||||
private $service;
|
||||
private $userId;
|
||||
|
||||
use Errors;
|
||||
|
||||
public function __construct($AppName, IRequest $request,
|
||||
StationService $service, $UserId){
|
||||
parent::__construct($AppName, $request);
|
||||
$this->service = $service;
|
||||
$this->userId = $UserId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @CORS
|
||||
* @NoCSRFRequired
|
||||
* @NoAdminRequired
|
||||
*/
|
||||
public function index() {
|
||||
return new DataResponse($this->service->findAll($this->userId));
|
||||
}
|
||||
|
||||
/**
|
||||
* @CORS
|
||||
* @NoCSRFRequired
|
||||
* @NoAdminRequired
|
||||
*
|
||||
* @param int $id
|
||||
*/
|
||||
public function show($id) {
|
||||
return $this->handleNotFound(function () use ($id) {
|
||||
return $this->service->find($id, $this->userId);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @CORS
|
||||
* @NoCSRFRequired
|
||||
* @NoAdminRequired
|
||||
*
|
||||
* @param string $stationid
|
||||
*/
|
||||
public function create($stationid) {
|
||||
return $this->service->create($stationid, $this->userId);
|
||||
}
|
||||
|
||||
/**
|
||||
* @CORS
|
||||
* @NoCSRFRequired
|
||||
* @NoAdminRequired
|
||||
*
|
||||
* @param int $id
|
||||
* @param string $stationid
|
||||
*/
|
||||
public function update($id, $stationid) {
|
||||
return $this->handleNotFound(function () use ($id, $stationid) {
|
||||
return $this->service->update($id, $stationid, $this->userId);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @CORS
|
||||
* @NoCSRFRequired
|
||||
* @NoAdminRequired
|
||||
*
|
||||
* @param int $id
|
||||
*/
|
||||
public function destroy($id) {
|
||||
return $this->handleNotFound(function () use ($id) {
|
||||
return $this->service->delete($id, $this->userId);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
@ -1,74 +0,0 @@
|
||||
<?php
|
||||
namespace OCA\Radio\Controller;
|
||||
|
||||
use OCP\IRequest;
|
||||
use OCP\AppFramework\Http\DataResponse;
|
||||
use OCP\AppFramework\Controller;
|
||||
|
||||
use OCA\Radio\Service\StationService;
|
||||
|
||||
class StationController extends Controller {
|
||||
|
||||
private $service;
|
||||
private $userId;
|
||||
|
||||
use Errors;
|
||||
|
||||
public function __construct($AppName, IRequest $request,
|
||||
StationService $service, $UserId){
|
||||
parent::__construct($AppName, $request);
|
||||
$this->service = $service;
|
||||
$this->userId = $UserId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
*/
|
||||
public function index() {
|
||||
return new DataResponse($this->service->findAll($this->userId));
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
*
|
||||
* @param int $id
|
||||
*/
|
||||
public function show($id) {
|
||||
return $this->handleNotFound(function () use ($id) {
|
||||
return $this->service->find($id, $this->userId);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
*
|
||||
* @param string $stationid
|
||||
*/
|
||||
public function create($stationid) {
|
||||
return $this->service->create($stationid, $this->userId);
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
*
|
||||
* @param int $id
|
||||
* @param string $stationid
|
||||
*/
|
||||
public function update($id, $stationid) {
|
||||
return $this->handleNotFound(function () use ($id, $stationid) {
|
||||
return $this->service->update($id, $stationid, $this->userId);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
*
|
||||
* @param int $id
|
||||
*/
|
||||
public function destroy($id) {
|
||||
return $this->handleNotFound(function () use ($id) {
|
||||
return $this->service->delete($id, $this->userId);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
24
css/icons.scss
Normal file
@ -0,0 +1,24 @@
|
||||
|
||||
/**
|
||||
* @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>
|
||||
*
|
||||
* @author John Molakvoæ <skjnldsv@protonmail.com>
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
@include icon-black-white('vueexample', 'app', 1);
|
512
css/main.css
@ -1,512 +0,0 @@
|
||||
#playbutton{
|
||||
height:50px;
|
||||
width: 50px;
|
||||
margin: 10px;
|
||||
border: none;
|
||||
background-size: 100%;
|
||||
background-position: center;
|
||||
/* display: inline; */
|
||||
float: left;
|
||||
-webkit-transition: background-image 0.4s ease-in-out;
|
||||
transition: background-image 0.4s ease-in-out;
|
||||
}
|
||||
|
||||
.buffering {
|
||||
-webkit-animation:spin 4s linear infinite;
|
||||
-moz-animation:spin 4s linear infinite;
|
||||
animation:spin 4s linear infinite;
|
||||
background: url('../img/wheel.png') no-repeat;
|
||||
-webkit-transition: background-image 0.4s ease-in-out;
|
||||
transition: background-image 0.4s ease-in-out;
|
||||
}
|
||||
|
||||
@-moz-keyframes spin { 100% { -moz-transform: rotate(360deg); } }
|
||||
@-webkit-keyframes spin { 100% { -webkit-transform: rotate(360deg); } }
|
||||
@keyframes spin { 100% { -webkit-transform: rotate(360deg); transform:rotate(360deg); } }
|
||||
|
||||
#station_metadata{
|
||||
margin: 5px 20px;
|
||||
padding-left: 5px;
|
||||
white-space:nowrap;
|
||||
overflow:hidden;
|
||||
}
|
||||
|
||||
.play{
|
||||
background: url('../img/play.png') no-repeat;
|
||||
}
|
||||
.pause{
|
||||
background: url('../img/pause.png') no-repeat;
|
||||
}
|
||||
|
||||
.icon-stationfav {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
/* margin-right: 5px;
|
||||
margin-bottom: 5px;
|
||||
position: absolute; */
|
||||
background-image: url('../img/star.svg');
|
||||
background-repeat: no-repeat;
|
||||
/* background-size: contain; */
|
||||
background-position: center;
|
||||
line-height: 100%;
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
background-size: 16px 16px;
|
||||
opacity: 0.3;
|
||||
}
|
||||
|
||||
.starred {
|
||||
background-image: url('../img/starred.svg');
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.icon-stationfav:hover {
|
||||
background-image: url('../img/starred.svg');
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
/* SETTINGS */
|
||||
#files-setting-showhidden {
|
||||
padding-bottom: 8px;
|
||||
}
|
||||
|
||||
/* FILE TABLE */
|
||||
#filestable {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#filestable tbody tr {
|
||||
background-color: #fff;
|
||||
height: 51px;
|
||||
}
|
||||
|
||||
/* fit app list view heights */
|
||||
#content {
|
||||
padding-top: 25px;
|
||||
}
|
||||
|
||||
.app-files #app-content>.viewcontainer {
|
||||
min-height: 0%;
|
||||
}
|
||||
|
||||
.app-files #app-content {
|
||||
transition: background-color 0.3s ease;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
/* icons for sidebar */
|
||||
.nav-icon-files {
|
||||
background-image: url('../img/folder.svg?v=1');
|
||||
}
|
||||
.nav-icon-recent {
|
||||
background-image: url('../img/recent.svg?v=1');
|
||||
}
|
||||
.nav-icon-favorites {
|
||||
background-image: url('../img/star.svg?v=1');
|
||||
}
|
||||
.nav-icon-sharingin,
|
||||
.nav-icon-sharingout {
|
||||
background-image: url('../img/share.svg?v=1');
|
||||
}
|
||||
.nav-icon-sharinglinks {
|
||||
background-image: url('../img/public.svg?v=1');
|
||||
}
|
||||
.nav-icon-extstoragemounts {
|
||||
background-image: url('../img/external.svg?v=1');
|
||||
}
|
||||
.nav-icon-trashbin {
|
||||
background-image: url('../img/delete.svg?v=1');
|
||||
}
|
||||
.nav-icon-systemtagsfilter {
|
||||
background-image: url('../img/systemtags.svg?v=1');
|
||||
}
|
||||
|
||||
#app-navigation .nav-files a.nav-icon-files {
|
||||
width: auto;
|
||||
}
|
||||
/* button needs overrides due to navigation styles */
|
||||
#app-navigation .nav-files a.new {
|
||||
width: 40px;
|
||||
height: 32px;
|
||||
padding: 0 10px;
|
||||
margin: 0;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#app-navigation .nav-files a.new.hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#app-navigation .nav-files a.new.disabled {
|
||||
opacity: 0.3;
|
||||
}
|
||||
|
||||
#filestable tbody tr {
|
||||
transition: background-color 0.3s ease;
|
||||
background-color: #fff;
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
#filestable tbody tr:hover,
|
||||
#filestable tbody tr:focus,
|
||||
#filestable tbody .name:focus,
|
||||
#filestable tbody tr:active,
|
||||
#filestable tbody tr.highlighted,
|
||||
#filestable tbody tr.highlighted .name:focus,
|
||||
#filestable tbody tr.selected,
|
||||
#filestable tbody tr.searchresult,
|
||||
#filestable tbody tr.rowhighlight,
|
||||
table tr.mouseOver {
|
||||
transition: background-color 0.3s ease;
|
||||
background-color: #f8f8f8;
|
||||
}
|
||||
|
||||
tbody a { color:#000; }
|
||||
|
||||
span.conflict-path, span.extension, span.uploading, td.date {
|
||||
color: #999;
|
||||
}
|
||||
span.conflict-path, span.extension {
|
||||
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=70)";
|
||||
filter: alpha(opacity=70);
|
||||
opacity: .7;
|
||||
-webkit-transition: opacity 300ms;
|
||||
-moz-transition: opacity 300ms;
|
||||
-o-transition: opacity 300ms;
|
||||
transition: opacity 300ms;
|
||||
vertical-align: top;
|
||||
}
|
||||
tr:hover span.conflict-path,
|
||||
tr:focus span.conflict-path,
|
||||
tr:hover span.extension,
|
||||
tr:focus span.extension {
|
||||
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
|
||||
filter: alpha(opacity=100);
|
||||
opacity: 1;
|
||||
color: #777;
|
||||
}
|
||||
|
||||
table th, table th a {
|
||||
color: #999;
|
||||
}
|
||||
table.multiselect th a {
|
||||
color: #000;
|
||||
}
|
||||
table th .columntitle {
|
||||
display: block;
|
||||
padding: 15px;
|
||||
height: 50px;
|
||||
box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
vertical-align: middle;
|
||||
}
|
||||
table th .columntitle.name {
|
||||
padding-left: 5px;
|
||||
padding-right: 80px;
|
||||
margin-left: 100px;
|
||||
}
|
||||
|
||||
table th,
|
||||
table td {
|
||||
border-bottom: 1px solid #eee;
|
||||
text-align: left;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
table th#headerName {
|
||||
position: relative;
|
||||
width: 9999px; /* not really sure why this works better than 100% … table styling */
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#headerName-container {
|
||||
position: relative;
|
||||
height: 50px;
|
||||
}
|
||||
.has-favorites #headerName-container {
|
||||
padding-left: 50px;
|
||||
}
|
||||
|
||||
table th#headerSize, table td.filesize {
|
||||
text-align: right;
|
||||
}
|
||||
table th#headerDate, table td.date,
|
||||
table th.column-last, table td.column-last {
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
/* this can not be just width, both need to be set … table styling */
|
||||
min-width: 130px;
|
||||
max-width: 130px;
|
||||
}
|
||||
|
||||
table thead th {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
table td.filename a.name {
|
||||
position:relative; /* Firefox needs to explicitly have this default set … */
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
display: block;
|
||||
height: 50px;
|
||||
line-height: 50px;
|
||||
padding: 0;
|
||||
}
|
||||
table td.filename .thumbnail {
|
||||
display: inline-block;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
margin-left: 10px;
|
||||
margin-top: 9px;
|
||||
cursor: pointer;
|
||||
float: left;
|
||||
position: absolute;
|
||||
z-index: 4;
|
||||
background-repeat: no-repeat;
|
||||
background-size: contain;
|
||||
background-position: center;
|
||||
}
|
||||
|
||||
table td.filename .nametext, .uploadtext, .modified, .column-last>span:first-child { float:left; padding:0px 0; }
|
||||
|
||||
.modified, .column-last>span:first-child {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
/*width: 110px;*/
|
||||
}
|
||||
|
||||
table td.filename .nametext {
|
||||
position: absolute;
|
||||
left: 60px;
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
max-width: 800px;
|
||||
height: 100%;
|
||||
}
|
||||
.has-favorites #fileList td.filename a.name {
|
||||
left: 0px;
|
||||
margin-right: 0px;
|
||||
}
|
||||
|
||||
#fileList tr.animate-opacity {
|
||||
-webkit-transition:opacity 250ms;
|
||||
-moz-transition:opacity 250ms;
|
||||
-o-transition:opacity 250ms;
|
||||
transition:opacity 250ms;
|
||||
}
|
||||
|
||||
table td.filename .nametext .innernametext {
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 1500px) {
|
||||
table td.filename .nametext .innernametext {
|
||||
max-width: 790px;
|
||||
}
|
||||
.with-app-sidebar table td.filename .nametext .innernametext {
|
||||
max-width: 390px;
|
||||
}
|
||||
}
|
||||
@media only screen and (min-width: 1366px) and (max-width: 1500px) {
|
||||
table td.filename .nametext .innernametext {
|
||||
max-width: 660px;
|
||||
}
|
||||
.with-app-sidebar table td.filename .nametext .innernametext {
|
||||
max-width: 290px;
|
||||
}
|
||||
}
|
||||
@media only screen and (min-width: 1200px) and (max-width: 1366px) {
|
||||
table td.filename .nametext .innernametext {
|
||||
max-width: 500px;
|
||||
}
|
||||
.with-app-sidebar table td.filename .nametext .innernametext {
|
||||
max-width: 230px;
|
||||
}
|
||||
}
|
||||
@media only screen and (min-width: 1100px) and (max-width: 1200px) {
|
||||
table td.filename .nametext .innernametext {
|
||||
max-width: 400px;
|
||||
}
|
||||
.with-app-sidebar table td.filename .nametext .innernametext {
|
||||
max-width: 230px;
|
||||
}
|
||||
}
|
||||
@media only screen and (min-width: 1000px) and (max-width: 1100px) {
|
||||
table td.filename .nametext .innernametext {
|
||||
max-width: 310px;
|
||||
}
|
||||
.with-app-sidebar table td.filename .nametext .innernametext {
|
||||
max-width: 230px;
|
||||
}
|
||||
}
|
||||
@media only screen and (min-width: 768px) and (max-width: 1000px) {
|
||||
table td.filename .nametext .innernametext {
|
||||
max-width: 240px;
|
||||
}
|
||||
.with-app-sidebar table td.filename .nametext .innernametext {
|
||||
max-width: 230px;
|
||||
}
|
||||
}
|
||||
|
||||
#fileList tr td.filename {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
-webkit-transition:background-image 500ms; -moz-transition:background-image 500ms; -o-transition:background-image 500ms; transition:background-image 500ms;
|
||||
}
|
||||
|
||||
#fileList tr td.filename a.name label {
|
||||
position: absolute;
|
||||
width: 80%;
|
||||
height: 50px;
|
||||
}
|
||||
|
||||
.busy .fileactions, .busy .action {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
/* force show the loading icon, not only on hover */
|
||||
#fileList .icon-loading-small {
|
||||
-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
|
||||
filter:alpha(opacity=100);
|
||||
opacity: 1 !important;
|
||||
display: inline !important;
|
||||
}
|
||||
|
||||
.summary {
|
||||
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=30)";
|
||||
filter: alpha(opacity=30);
|
||||
opacity: .3;
|
||||
/* add whitespace to bottom of files list to correctly show dropdowns */
|
||||
height: 300px;
|
||||
}
|
||||
.summary:hover,
|
||||
.summary:focus,
|
||||
.summary,
|
||||
table tr.summary td {
|
||||
background-color: transparent;
|
||||
}
|
||||
.mask {
|
||||
z-index: 50;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: #fff;
|
||||
background-repeat: no-repeat no-repeat;
|
||||
background-position: 50%;
|
||||
opacity: 0.7;
|
||||
filter: alpha(opacity=70);
|
||||
transition: opacity 100ms;
|
||||
-moz-transition: opacity 100ms;
|
||||
-o-transition: opacity 100ms;
|
||||
-ms-transition: opacity 100ms;
|
||||
-webkit-transition: opacity 100ms;
|
||||
}
|
||||
.mask.transparent{
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
#app-content {
|
||||
z-index: 500;
|
||||
background-color: var(--color-main-background);
|
||||
position: relative;
|
||||
flex-basis: 100vw;
|
||||
min-height: 100%;
|
||||
}
|
||||
|
||||
#content {
|
||||
z-index: 500;
|
||||
background-color: var(--color-main-background);
|
||||
position: relative;
|
||||
flex-basis: 100vw;
|
||||
min-height: 100%;
|
||||
}
|
||||
|
||||
table td {
|
||||
padding: 0 0px;
|
||||
font-style: normal;
|
||||
background-position: 8px center;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
#fileList {
|
||||
table-layout: fixed;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
#fileList tr td.favcolumn {
|
||||
padding: 0 15px;
|
||||
position: relative;
|
||||
width: 0.1%;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
#fileList tr td.filename {
|
||||
position: relative;
|
||||
width: 99.9%;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
#app-settings {
|
||||
overflow: hidden;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
#volumeicon {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
background-size: contain;
|
||||
background-repeat: no-repeat;
|
||||
position: relative;
|
||||
left: 75px;
|
||||
top: 14px;
|
||||
}
|
||||
#volumeicon.full {
|
||||
background-image: url('../img/sound_full.png');
|
||||
}
|
||||
#volumeicon.mid {
|
||||
background-image: url('../img/sound_mid.png');
|
||||
}
|
||||
#volumeicon.silent {
|
||||
background-image: url('../img/sound_silent.png');
|
||||
}
|
||||
|
||||
#volumeslider{
|
||||
width: 170px;
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
left: 40px;
|
||||
top: -7px;
|
||||
}
|
||||
|
||||
#station_metadata {
|
||||
margin-top: -3px;
|
||||
}
|
||||
|
||||
#preload-01 { background: url('../img/sound_mid.png') no-repeat -9999px -9999px; }
|
||||
#preload-02 { background: url('../img/sound_silent.png') no-repeat -9999px -9999px; }
|
||||
#preload-03 { background: url('../img/pause.png') no-repeat -9999px -9999px; }
|
||||
#preload-04 { background: url('../img/wheel.png') no-repeat -9999px -9999px; }
|
||||
|
||||
.icon-stationfav-disabled {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
line-height: 100%;
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
background-size: 16px 16px;
|
||||
opacity: 0;
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
<?php
|
||||
namespace OCA\Radio\Db;
|
||||
|
||||
use JsonSerializable;
|
||||
|
||||
use OCP\AppFramework\Db\Entity;
|
||||
|
||||
class Station extends Entity implements JsonSerializable {
|
||||
|
||||
protected $stationid;
|
||||
protected $userId;
|
||||
|
||||
public function jsonSerialize() {
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'stationid' => $this->stationid,
|
||||
|
||||
];
|
||||
}
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
<?php
|
||||
namespace OCA\Radio\Db;
|
||||
|
||||
use OCP\IDBConnection;
|
||||
use OCP\AppFramework\Db\Mapper;
|
||||
|
||||
class StationMapper extends Mapper {
|
||||
|
||||
public function __construct(IDBConnection $db) {
|
||||
parent::__construct($db, 'radio_stations', '\OCA\Radio\Db\Station');
|
||||
}
|
||||
|
||||
public function find($id, $userId) {
|
||||
$sql = 'SELECT * FROM *PREFIX*radio_stations WHERE id = ? AND user_id = ?';
|
||||
return $this->findEntity($sql, [$id, $userId]);
|
||||
}
|
||||
|
||||
public function findAll($userId) {
|
||||
$sql = 'SELECT * FROM *PREFIX*radio_stations WHERE user_id = ?';
|
||||
return $this->findEntities($sql, [$userId]);
|
||||
}
|
||||
|
||||
}
|
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB |
@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16" version="1"><path d="M1.457 1.997c-.25 0-.46.21-.46.46v11.08c0 .26.202.46.46.46h13.08c.258 0 .46-.2.46-.46V4.46c0-.25-.21-.463-.46-.463h-6.54l-2-2z" fill-rule="evenodd"/></svg>
|
Before Width: | Height: | Size: 239 B |
@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" version="1.1" height="16"><path fill="#0082c9" d="m1.5 2c-0.25 0-0.5 0.25-0.5 0.5v11c0 0.26 0.24 0.5 0.5 0.5h13c0.26 0 0.5-0.241 0.5-0.5v-9c0-0.25-0.25-0.5-0.5-0.5h-6.5l-2-2z"/></svg>
|
Before Width: | Height: | Size: 255 B |
BIN
img/pause.png
Before Width: | Height: | Size: 22 KiB |
BIN
img/play.png
Before Width: | Height: | Size: 24 KiB |
BIN
img/radio.png
Before Width: | Height: | Size: 985 B |
@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16" version="1"><path color="#000" fill="none" d="M-62.897-32.993h163.31v97.986h-163.31z"/><path style="text-decoration-color:#000;isolation:auto;mix-blend-mode:normal;block-progression:tb;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-transform:none" d="M8 0C3.594 0 0 3.594 0 8c0 4.406 3.594 8 8 8 4.406 0 8-3.594 8-8 0-4.406-3.594-8-8-8zm0 2c3.326 0 6 2.674 6 6s-2.674 6-6 6-6-2.674-6-6 2.674-6 6-6zm-.44.932a.617.617 0 0 0-.605.613l-.852 4.44V8C5.92 8.755 6.44 9 7.02 9.352h.005l2.998 1.58c.653.502 1.407-.476.754-.98L9 8.01V8l-.81-4.45a.617.617 0 0 0-.63-.618z" color="#000" white-space="normal"/></svg>
|
Before Width: | Height: | Size: 693 B |
Before Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 1.8 KiB |
@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" height="22" width="22"><path d="M11.017.06l2.946 7.384L22 8.077l-6.11 5.082L17.77 21l-6.72-4.242-6.876 4.213 1.957-7.703L0 8.03l7.932-.52z" opacity=".5"/></svg>
|
Before Width: | Height: | Size: 200 B |
@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" height="22" width="22"><path fill="#FC0" d="M11.017.06l2.946 7.384L22 8.077l-6.11 5.082L17.77 21l-6.72-4.242-6.876 4.213 1.957-7.703L0 8.03l7.932-.52z"/></svg>
|
Before Width: | Height: | Size: 199 B |
@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16" version="1" viewBox="0 0 16 16"><path color="#000" fill="none" d="M-62.897-32.993h163.31v97.986h-163.31z"/><path d="M6.186.96L1.38.975c-.273 0-.347.21-.348.346l-.015 4.802 8.723 8.722a.498.498 0 0 0 .71 0l4.456-4.457a.5.5 0 0 0 .002-.71v.01L6.54 1.318 6.186.964zM4.02 2.814a1.144 1.144 0 0 1 1.143 1.144A1.144 1.144 0 0 1 4.02 5.1a1.144 1.144 0 0 1-1.145-1.143A1.144 1.144 0 0 1 4.02 2.813z" fill="#000"/></svg>
|
Before Width: | Height: | Size: 474 B |
BIN
img/wheel.png
Before Width: | Height: | Size: 36 KiB |
BIN
img/wheel.xcf
15
js/admin.js
@ -1,15 +0,0 @@
|
||||
$(document).ready(function(){
|
||||
|
||||
|
||||
|
||||
$('#somesetting').blur(function(event){
|
||||
event.preventDefault();
|
||||
var post = $( "#somesetting" ).serialize();
|
||||
$.post( OC.filePath('radio', 'ajax', 'seturl.php') , post, function(data){
|
||||
$('#radio .msg').text('Finished saving: ' + data);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
});
|
2498
js/howler-2.1.2.js
306
js/main.js
@ -1,306 +0,0 @@
|
||||
var MODULE = (function (radio) {
|
||||
|
||||
$(document).ready(function () {
|
||||
|
||||
var version = "0.7.0";
|
||||
var current_stationid = "";
|
||||
var searchTimeout = null;
|
||||
var scheduled = false;
|
||||
|
||||
// Scroll event handler
|
||||
$(window).scroll(function(){
|
||||
var station_list = $("#app-content-files");
|
||||
if ( ( $(window).scrollTop() + $(window).height() ) == $(document).height() ) {
|
||||
if(!station_list.data("didfire")) {
|
||||
station_list.data("didfire", true);
|
||||
|
||||
var hashurl = window.location.hash;
|
||||
radio.radio_query(hashurl);
|
||||
|
||||
var ref = station_list;
|
||||
setTimeout(function(){
|
||||
ref.data("didfire", false);
|
||||
}, 500);
|
||||
};
|
||||
};
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
/* ==============
|
||||
// ACTIONS //
|
||||
/===============*/
|
||||
|
||||
radio.schedule_get_metadata = function(stationid){
|
||||
radio.scheduled = true;
|
||||
var stationid = radio.current_stationid;
|
||||
req = $.get('https://onny.project-insanity.org/getmetadata/'+stationid, function(data) {
|
||||
if (data.hasOwnProperty('metadata')) {
|
||||
var metadata = data['metadata'].toString();
|
||||
if (metadata != $("#station_metadata").text()) {
|
||||
$("#station_metadata").html(metadata);
|
||||
var element = document.getElementById('station_metadata');
|
||||
if (radio.isElementOverflowing(element)) {
|
||||
radio.wrapContentsInMarquee(element);
|
||||
};
|
||||
};
|
||||
setTimeout(function(){radio.schedule_get_metadata(stationid);}, 10000);
|
||||
} else {
|
||||
radio.scheduled = false;
|
||||
};
|
||||
}).fail(function(){
|
||||
radio.scheduled = false;
|
||||
});
|
||||
};
|
||||
|
||||
radio.action_favorite = function(stationid){
|
||||
var exists = false;
|
||||
var baseUrl = OC.generateUrl('/apps/radio');
|
||||
$.get(baseUrl + '/stations', function ( data ) {
|
||||
for (var station in data) {
|
||||
if (data[station]["stationid"] == stationid){
|
||||
exists = true;
|
||||
};
|
||||
};
|
||||
if (exists == true) {
|
||||
$.ajax({
|
||||
url: baseUrl + '/stations/' + data[station]["id"],
|
||||
method: 'DELETE'
|
||||
}).done(function(){
|
||||
console.log("delete ", stationid);
|
||||
$( "tr[data-src='#station/"+stationid+"']").find('.icon-stationfav').removeClass('starred');
|
||||
});
|
||||
} else {
|
||||
var station = {
|
||||
"stationid": stationid
|
||||
};
|
||||
$.ajax({
|
||||
url: baseUrl + '/stations',
|
||||
method: 'POST',
|
||||
contentType: 'application/json',
|
||||
data: JSON.stringify(station)
|
||||
}).done(function(){
|
||||
$( "tr[data-src='#station/"+stationid+"']" ).find('.icon-stationfav').addClass('starred');
|
||||
});
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
radio.parse_results = function(data){
|
||||
|
||||
var baseUrl = OC.generateUrl('/apps/radio');
|
||||
$.get(baseUrl + '/stations', function ( fav_stations ) {
|
||||
|
||||
if (data.length == 0) {
|
||||
$('#filestable').hide();
|
||||
$('#emptycontent').addClass('hidden');
|
||||
$('.nofilterresults').removeClass('hidden');
|
||||
$('.loading').addClass('hidden');
|
||||
} else {
|
||||
$('#emptycontent').addClass('hidden');
|
||||
$('#filestable').show();
|
||||
$('.nofilterresults').addClass('hidden');
|
||||
$('.loading').addClass('hidden');
|
||||
};
|
||||
|
||||
$.each(data, function(i, station) {
|
||||
if (typeof station['stationuuid'] == "undefined") {
|
||||
var entry_type = "folder";
|
||||
var isstarred = false;
|
||||
var hashurl = window.location.hash + "/" + station['name'];
|
||||
} else {
|
||||
var entry_type = "station";
|
||||
var isstarred = false;
|
||||
for (var fav_station in fav_stations) {
|
||||
if (fav_stations[fav_station]["stationid"] == station['stationuuid']) {
|
||||
isstarred = true;
|
||||
break;
|
||||
}
|
||||
};
|
||||
var hashurl = '#station/'+station['stationuuid'];
|
||||
}
|
||||
radio.render_entry(entry_type, isstarred, hashurl, station['favicon'], station['name']);
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
radio.action_load_favorites = function(){
|
||||
var stations = []
|
||||
var baseUrl = OC.generateUrl('/apps/radio');
|
||||
|
||||
$.get(baseUrl + '/stations', function ( data ) {
|
||||
for (var station in data) {
|
||||
stations.push(data[station]["stationid"]);
|
||||
};
|
||||
if (stations.length == 0) {
|
||||
$('#filestable').hide();
|
||||
$('#emptycontent').removeClass('hidden');
|
||||
$('.loading').addClass('hidden');
|
||||
} else {
|
||||
console.log(stations);
|
||||
radio.query_stations(stations);
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
radio.query_stations = function(station_ids){
|
||||
var station_array = [];
|
||||
var station_array_new = [];
|
||||
|
||||
station_ids.forEach(function (station_id, idx) {
|
||||
var url = "https://de1.api.radio-browser.info/json/stations/byid/"+station_ids[idx];
|
||||
$.getJSON( url , {"User-Agent": "Nextcloud Radio/"+radio.version }, function( data ) {
|
||||
|
||||
if (data.length === 0) {
|
||||
station_array = station_array.concat([{'id': station_id, 'name': 'Broken radio station entry :(', 'favicon': '', 'url': ''}])
|
||||
} else {
|
||||
station_array = station_array.concat(data);
|
||||
};
|
||||
|
||||
if (station_ids.length == station_array.length){
|
||||
|
||||
// sorting results array
|
||||
station_ids.forEach( function (station_id) {
|
||||
station_array.forEach( function (station) {
|
||||
if (station_id === station['id']) {
|
||||
station_array_new = station_array_new.concat(station);
|
||||
};
|
||||
});
|
||||
});
|
||||
|
||||
radio.parse_results(station_array_new);
|
||||
};
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
radio.radio_query = function(hashurl){
|
||||
var offset = $('tbody > tr').length;
|
||||
var query = "";
|
||||
var api_baseurl = "https://de1.api.radio-browser.info/json/";
|
||||
switch (hashurl) {
|
||||
case "#top":
|
||||
var query_url = "stations/topclick";
|
||||
break;
|
||||
case "#recent":
|
||||
var query_url = "stations/lastchange";
|
||||
break;
|
||||
case (hashurl.match(/^#categories/) || {}).input:
|
||||
var query_url = hashurl.substring(12);
|
||||
if (query_url.split("/").length == 2) {
|
||||
var subcategory = query_url.split("/")[1];
|
||||
switch (query_url.split("/")[0]) {
|
||||
case "countries":
|
||||
var query_url = "stations/bycountryexact/"+subcategory;
|
||||
break;
|
||||
case "states":
|
||||
var query_url = "stations/bystateexact/"+subcategory;
|
||||
break;
|
||||
case "languages":
|
||||
var query_url = "stations/bylanguageexact/"+subcategory;
|
||||
break;
|
||||
case "tags":
|
||||
var query_url = "stations/bytagsexact/"+subcategory;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case (hashurl.match(/^#search/) || {}).input:
|
||||
var query_url = "stations/search";
|
||||
var query = hashurl.substring(8);
|
||||
break;
|
||||
};
|
||||
console.log(query_url);
|
||||
$.ajax({
|
||||
method: "POST",
|
||||
url: api_baseurl + query_url,
|
||||
data: {
|
||||
name: query,
|
||||
limit: 20,
|
||||
"User-Agent": "Nextcloud Radio/"+radio.version,
|
||||
offset: offset
|
||||
},
|
||||
dataType: 'json',
|
||||
}).success( function(data){
|
||||
if (data.length) {
|
||||
radio.parse_results(data);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// Search function
|
||||
new OCA.Search(function (query) {
|
||||
$('#app-navigation').find('li').removeClass("active");
|
||||
$("tbody > tr").remove();
|
||||
var hashurl = "#search/"+query;
|
||||
history.pushState("", "", hashurl);
|
||||
radio.radio_query(hashurl);
|
||||
}, function (arg) {
|
||||
console.log("quit search dialog");
|
||||
});
|
||||
|
||||
radio.render_entry = function(entry_type, starred, hashurl, iconurl, title){
|
||||
if (entry_type == "folder") {
|
||||
var icon_class = "icon-stationfav-disabled";
|
||||
var icon = "icon-filetype-folder";
|
||||
} else {
|
||||
var icon_class = "icon-stationfav";
|
||||
var icon = '" style="background-image:url('+iconurl+'); background-size: 32px;';
|
||||
}
|
||||
if (starred) {
|
||||
var starred = "starred";
|
||||
} else {
|
||||
var starred = "";
|
||||
}
|
||||
$('tbody').append('<tr data-src="'+hashurl+'">\
|
||||
<td class="favcolumn">\
|
||||
<a href="#" class="favorite">\
|
||||
<span class="'+icon_class+' '+starred+'"></span>\
|
||||
<span class="hidden-visually">Favorite</span>\
|
||||
</a>\
|
||||
</td>\
|
||||
<td class="filename">\
|
||||
<label for="select-files-3">\
|
||||
<div class="thumbnail '+icon+'"></div>\
|
||||
</label>\
|
||||
<a class="name" href="#">\
|
||||
<span class="nametext"><span class="innernametext">'+title+'</span></span>\
|
||||
</a>\
|
||||
</td>\
|
||||
</tr>')
|
||||
}
|
||||
|
||||
radio.action_load_categories = function (){
|
||||
|
||||
$('#emptycontent').addClass('hidden');
|
||||
$('#filestable').show();
|
||||
$('.nofilterresults').addClass('hidden');
|
||||
$('.loading').addClass('hidden');
|
||||
|
||||
var categories = [{
|
||||
'hashurl': '#categories/countries',
|
||||
'name': 'Countries'
|
||||
},{
|
||||
'hashurl': '#categories/states',
|
||||
'name': 'States'
|
||||
},{
|
||||
'hashurl': '#categories/languages',
|
||||
'name': 'Languages'
|
||||
},{
|
||||
'hashurl': '#categories/tags',
|
||||
'name': 'Tags'
|
||||
}];
|
||||
|
||||
categories.forEach(function(category_entry) {
|
||||
radio.render_entry("folder", false, category_entry["hashurl"], false, category_entry["name"]);
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
return radio;
|
||||
}(MODULE || {}));
|
112
js/navigation.js
@ -1,112 +0,0 @@
|
||||
var MODULE = (function (radio) {
|
||||
|
||||
/* Click on menus */
|
||||
$('#app-navigation ul a').click(function(e) {
|
||||
e.preventDefault();
|
||||
radio.action_navigate($(this).attr('href'));
|
||||
});
|
||||
|
||||
/* Click on a radio station (table entry) and play it */
|
||||
$('body').on('click', '.filename', function(e) {
|
||||
e.preventDefault();
|
||||
var entry_src = $(this).parent().attr('data-src');
|
||||
if (entry_src.substring(0,9) == "#station/") {
|
||||
var stationid = entry_src.substring(9);
|
||||
var stationname = $(this).parent().find('.nametext').text();
|
||||
radio.action_play(stationid, stationname);
|
||||
} else {
|
||||
radio.action_navigate(entry_src);
|
||||
}
|
||||
});
|
||||
|
||||
/* Save station to favorites */
|
||||
$('body').on('click', '.favorite', function(e) {
|
||||
e.preventDefault();
|
||||
var entry_src = $(this).parent().parent().attr('data-src');
|
||||
var stationid = entry_src.substring(9);
|
||||
radio.action_favorite(stationid);
|
||||
});
|
||||
|
||||
radio.action_load_menu_state = function() {
|
||||
var baseUrl = OC.generateUrl('/apps/radio/getMenuState');
|
||||
$.get(baseUrl, function ( data ) {
|
||||
if ("menu_state" in data) {
|
||||
var hashurl = data["menu_state"];
|
||||
}
|
||||
radio.action_navigate(hashurl);
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
radio.action_save_menu_state = function(hashurl) {
|
||||
var baseUrl = OC.generateUrl('/apps/radio/saveMenuState');
|
||||
var settings = {
|
||||
"menu_state": hashurl
|
||||
};
|
||||
$.ajax({
|
||||
url: baseUrl,
|
||||
method: 'POST',
|
||||
contentType: 'application/json',
|
||||
data: JSON.stringify(settings)
|
||||
}).done(function(data){
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
radio.action_navigate = function(hashurl) {
|
||||
$('#filestable').hide();
|
||||
$('#emptycontent').addClass('hidden');
|
||||
$('.nofilterresults').addClass('hidden');
|
||||
$('.loading').removeClass('hidden');
|
||||
$('#app-navigation').find('li').removeClass("active");
|
||||
$("tbody > tr").remove();
|
||||
|
||||
history.pushState("", "", hashurl);
|
||||
radio.action_save_menu_state(hashurl)
|
||||
|
||||
clearTimeout(radio.searchTimeout);
|
||||
radio.searchTimeout = setTimeout(function(){
|
||||
switch (hashurl) {
|
||||
case "#top":
|
||||
$('li.nav-files').addClass('active');
|
||||
radio.radio_query(hashurl);
|
||||
break;
|
||||
case "#recent":
|
||||
$('li.nav-recent').addClass('active');
|
||||
radio.radio_query(hashurl);
|
||||
break;
|
||||
case "#favorites":
|
||||
$('li.nav-favorites').addClass('active');
|
||||
radio.action_load_favorites();
|
||||
break;
|
||||
case "#categories":
|
||||
$('li.nav-categories').addClass('active');
|
||||
radio.action_load_categories();
|
||||
break;
|
||||
case (hashurl.match(/^#categories/) || {}).input:
|
||||
$('li.nav-categories').addClass('active');
|
||||
radio.radio_query(hashurl);
|
||||
break;
|
||||
case (hashurl.match(/^#search/) || {}).input:
|
||||
radio.radio_query(hashurl);
|
||||
break;
|
||||
}
|
||||
}, 500);
|
||||
};
|
||||
|
||||
// On app start, load top list
|
||||
if(window.location.hash) {
|
||||
var hashurl = window.location.hash;
|
||||
radio.action_navigate(hashurl);
|
||||
} else {
|
||||
radio.action_load_menu_state();
|
||||
};
|
||||
|
||||
window.addEventListener('hashchange', function(event) {
|
||||
var hashurl = "#" + event.newURL.split("#")[1];
|
||||
console.log(hashurl);
|
||||
radio.action_navigate(hashurl);
|
||||
}, false);
|
||||
|
||||
return radio;
|
||||
}(MODULE || {}));
|
194
js/player.js
@ -1,194 +0,0 @@
|
||||
var MODULE = (function (radio) {
|
||||
|
||||
var last_volume = 0;
|
||||
|
||||
var sound = new Howl({
|
||||
src: "https://blog.project-insanity.org/106fm",
|
||||
html5: true,
|
||||
volume: 0
|
||||
});
|
||||
|
||||
radio.isElementOverflowing = function(element) {
|
||||
var overflowX = element.offsetWidth < element.scrollWidth,
|
||||
overflowY = element.offsetHeight < element.scrollHeight;
|
||||
|
||||
return (overflowX || overflowY);
|
||||
}
|
||||
|
||||
radio.wrapContentsInMarquee = function(element) {
|
||||
var marquee = document.createElement('marquee'),
|
||||
contents = element.innerText;
|
||||
|
||||
marquee.innerText = contents;
|
||||
element.innerHTML = '';
|
||||
element.appendChild(marquee);
|
||||
}
|
||||
|
||||
/* Playbutton click */
|
||||
$('#playbutton').click(function() {
|
||||
if (typeof radio.sound !== "undefined") {
|
||||
if (radio.sound.playing()) {
|
||||
radio.sound.pause();
|
||||
} else {
|
||||
radio.sound.play();
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
radio.action_play = function(stationid, stationname){
|
||||
$('#playbutton').attr("class", "buffering");
|
||||
$('#player').attr('data-id',stationid);
|
||||
$("#station_metadata").html("Playing: "+stationname);
|
||||
/* dirty fix missing background color for first td */
|
||||
$('tbody tr').css("background-color", "white");
|
||||
$(this).parent().css("background-color", "#f8f8f8");
|
||||
|
||||
var element = document.getElementById('station_metadata');
|
||||
if (radio.isElementOverflowing(element)) {
|
||||
radio.wrapContentsInMarquee(element);
|
||||
};
|
||||
if (!radio.scheduled){
|
||||
radio.schedule_get_metadata(stationid);
|
||||
};
|
||||
if (typeof radio.sound !== "undefined") {
|
||||
var volume_state = $('#volumeslider').slider('value');
|
||||
radio.sound.fade(volume_state, 0, 500);
|
||||
};
|
||||
$.ajax({
|
||||
method: "GET",
|
||||
url: "https://de1.api.radio-browser.info/json/url/"+stationid,
|
||||
dataType: 'json',
|
||||
success: function(data){
|
||||
var streamurl = data['url'];
|
||||
radio.sound = new Howl({
|
||||
src: streamurl,
|
||||
html5: true,
|
||||
volume: 0,
|
||||
onfade: function() {
|
||||
if (this.volume() == 0) {
|
||||
this.unload();
|
||||
}
|
||||
},
|
||||
onplay: function() {
|
||||
$('#playbutton').attr("class", "pause");
|
||||
},
|
||||
onpause: function() {
|
||||
$('#playbutton').attr("class", "play");
|
||||
},
|
||||
onload: function() {
|
||||
$('#playbutton').attr("class", "buffering");
|
||||
}
|
||||
});
|
||||
sound_id = radio.sound.play();
|
||||
radio.sound.once('play', function() {
|
||||
var volume_state = $('#volumeslider').slider('value');
|
||||
radio.sound.fade(0, volume_state, 1000);
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
radio.debounce = function(func, wait, immediate) {
|
||||
var timeout;
|
||||
return function() {
|
||||
var context = this,
|
||||
args = arguments;
|
||||
var later = function() {
|
||||
timeout = null;
|
||||
if (!immediate) func.apply(context, args);
|
||||
};
|
||||
var callNow = immediate && !timeout;
|
||||
clearTimeout(timeout);
|
||||
timeout = setTimeout(later, wait);
|
||||
if (callNow) func.apply(context, args);
|
||||
};
|
||||
};
|
||||
|
||||
// Volume slider
|
||||
$('#volumeslider').slider({
|
||||
orientation: "horizontal",
|
||||
value: 0.5,
|
||||
min: 0,
|
||||
max: 1,
|
||||
range: 'min',
|
||||
animate: true,
|
||||
step: .05,
|
||||
change: function(e, ui) {
|
||||
if (typeof radio.sound !== "undefined") {
|
||||
radio.sound.volume(ui.value);
|
||||
}
|
||||
if (ui.value < 0.1) {
|
||||
$("#volumeicon").removeClass();
|
||||
$("#volumeicon").attr("class","silent");
|
||||
}
|
||||
if (ui.value > 0.5) {
|
||||
$("#volumeicon").removeClass();
|
||||
$("#volumeicon").attr("class","full");
|
||||
}
|
||||
if (ui.value <= 0.5 && ui.value >= 0.1) {
|
||||
$("#volumeicon").removeClass();
|
||||
$("#volumeicon").attr("class","mid");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$("#volumeslider").on("slidestop", radio.debounce(function(e, ui) {
|
||||
radio.save_volume_state(ui.value);
|
||||
}, 700)
|
||||
);
|
||||
|
||||
$("#volumeicon").on("click", function(e) {
|
||||
var current_volume = $('#volumeslider').slider('value');
|
||||
if (current_volume > 0) {
|
||||
last_volume = current_volume;
|
||||
$('#volumeslider').slider('value',0);
|
||||
radio.save_volume_state(0);
|
||||
} else {
|
||||
if (!last_volume == 0) {
|
||||
$('#volumeslider').slider('value',last_volume);
|
||||
radio.save_volume_state(last_volume);
|
||||
} else {
|
||||
$('#volumeslider').slider('value',1);
|
||||
radio.save_volume_state(1);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
radio.load_volume_state = function(){
|
||||
var volume_state = 0;
|
||||
var baseUrl = OC.generateUrl('/apps/radio/getVolumeState');
|
||||
$.get(baseUrl, function ( data ) {
|
||||
if ("volume_state" in data) {
|
||||
volume_state = data["volume_state"];
|
||||
if (volume_state == "") {
|
||||
last_volume = 1;
|
||||
$('#volumeslider').slider('value',1);
|
||||
} else {
|
||||
last_volume = volume_state;
|
||||
$('#volumeslider').slider('value',Number(volume_state));
|
||||
}
|
||||
}
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
radio.save_volume_state = function(volume_state) {
|
||||
var baseUrl = OC.generateUrl('/apps/radio/saveVolumeState');
|
||||
var settings = {
|
||||
"volume_state": volume_state
|
||||
};
|
||||
$.ajax({
|
||||
url: baseUrl,
|
||||
method: 'POST',
|
||||
contentType: 'application/json',
|
||||
data: JSON.stringify(settings)
|
||||
}).done(function(data){
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
// Load volume state
|
||||
radio.load_volume_state();
|
||||
|
||||
return radio;
|
||||
}(MODULE || {}));
|
@ -1,9 +0,0 @@
|
||||
OC.L10N.register(
|
||||
"radio",
|
||||
{
|
||||
"Top" : "Best bewertet",
|
||||
"Recent" : "Neu hinzugekommen",
|
||||
"Favorites" : "Favoriten",
|
||||
"Categories" : "Kategorien"
|
||||
},
|
||||
"nplurals=2; plural=(n != 1);");
|
@ -1,7 +0,0 @@
|
||||
{ "translations": {
|
||||
"Top" : "Best bewertet",
|
||||
"Recent" : "Neu hinzugekommen",
|
||||
"Favorites" : "Favoriten",
|
||||
"Categories" : "Kategorien"
|
||||
},"pluralForm" :"nplurals=2; plural=(n != 1);"
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
OC.L10N.register(
|
||||
"radio",
|
||||
{
|
||||
"Top" : "Top",
|
||||
"Recent" : "Añadido recientemente",
|
||||
"Favorites" : "Favoritos",
|
||||
"Categories" : "Categorías"
|
||||
},
|
||||
"nplurals=2; plural=(n != 1);");
|
@ -1,7 +0,0 @@
|
||||
{ "translations": {
|
||||
"Top" : "Top",
|
||||
"Recent" : "Añadido recientemente",
|
||||
"Favorites" : "Favoritos",
|
||||
"Categories" : "Categorías"
|
||||
},"pluralForm" :"nplurals=2; plural=(n != 1);"
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
OC.L10N.register(
|
||||
"radio",
|
||||
{
|
||||
"Top" : "Top",
|
||||
"Recent" : "Ajouts récents",
|
||||
"Favorites" : "Favoris",
|
||||
"Categories" : "Catégories"
|
||||
},
|
||||
"nplurals=2; plural=(n != 1);");
|
@ -1,7 +0,0 @@
|
||||
{ "translations": {
|
||||
"Top" : "Top",
|
||||
"Recent" : "Ajouts récents",
|
||||
"Favorites" : "Favoris",
|
||||
"Categories" : "Catégories"
|
||||
},"pluralForm" :"nplurals=2; plural=(n != 1);"
|
||||
}
|
52
lib/Controller/PageController.php
Normal file
@ -0,0 +1,52 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>
|
||||
*
|
||||
* @author John Molakvoæ <skjnldsv@protonmail.com>
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
namespace OCA\Radio\Controller;
|
||||
|
||||
use OCP\IRequest;
|
||||
use OCP\AppFramework\Http\TemplateResponse;
|
||||
use OCP\AppFramework\Controller;
|
||||
use OCP\Util;
|
||||
|
||||
class PageController extends Controller {
|
||||
|
||||
protected $appName;
|
||||
|
||||
public function __construct($appName, IRequest $request) {
|
||||
parent::__construct($appName, $request);
|
||||
$this->appName = $appName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @NoCSRFRequired
|
||||
*/
|
||||
public function index() {
|
||||
Util::addScript($this->appName, 'radio-main');
|
||||
Util::addStyle($this->appName, 'icons');
|
||||
|
||||
$response = new TemplateResponse($this->appName, 'main');
|
||||
return $response;
|
||||
}
|
||||
}
|
11538
package-lock.json
generated
81
package.json
@ -1,19 +1,76 @@
|
||||
{
|
||||
"name": "nextcloud-app-radio",
|
||||
"version": "0.7.0",
|
||||
"description": "Radio app for Nextcloud",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
"name": "radio",
|
||||
"description": "A simple Nextcloud app using vue-components",
|
||||
"version": "1.0.0",
|
||||
"author": "Jonas Heinrich <onny@project-insanity.org>",
|
||||
"contributors": [
|
||||
"Jonas Heinrich <onny@project-insanity.org>"
|
||||
],
|
||||
"keywords": [
|
||||
"nextcloud",
|
||||
"radio"
|
||||
],
|
||||
"bugs": {
|
||||
"url": "https://git.project-insanity.org/onny/nextcloud-app-radio/-/issues"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://git.project-insanity.org/onny/nextcloud-app-radio.git"
|
||||
"url": "https://git.project-insanity.org/onny/nextcloud-app-radio",
|
||||
"type": "git"
|
||||
},
|
||||
"homepage": "https://git.project-insanity.org/onny/nextcloud-app-radio",
|
||||
"license": "mit",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build": "NODE_ENV=production webpack --progress --hide-modules --config webpack.js",
|
||||
"dev": "NODE_ENV=development webpack --progress --config webpack.js",
|
||||
"watch": "NODE_ENV=development webpack --progress --watch --config webpack.js",
|
||||
"lint": "eslint --ext .js,.vue src",
|
||||
"lint:fix": "eslint --ext .js,.vue src --fix",
|
||||
"stylelint": "stylelint src",
|
||||
"stylelint:fix": "stylelint src --fix"
|
||||
},
|
||||
"author": "Jonas Heinrich",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"howler": "^2.2.0",
|
||||
"jquery": "^3.5.1"
|
||||
"@nextcloud/l10n": "^1.4.1",
|
||||
"@nextcloud/vue": "^2.7.0",
|
||||
"vue": "^2.6.12"
|
||||
},
|
||||
"browserslist": [
|
||||
"extends @nextcloud/browserslist-config"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=10.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.11.6",
|
||||
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
||||
"@babel/preset-env": "^7.11.5",
|
||||
"@nextcloud/browserslist-config": "^1.0.0",
|
||||
"@nextcloud/eslint-config": "^2.2.0",
|
||||
"@nextcloud/eslint-plugin": "^1.5.0",
|
||||
"@nextcloud/webpack-vue-config": "^1.1.0",
|
||||
"@vue/test-utils": "^1.1.0",
|
||||
"babel-eslint": "^10.1.0",
|
||||
"babel-loader": "^8.1.0",
|
||||
"css-loader": "^3.6.0",
|
||||
"eslint": "^6.8.0",
|
||||
"eslint-config-standard": "^14.1.1",
|
||||
"eslint-import-resolver-webpack": "^0.13.0",
|
||||
"eslint-loader": "^4.0.2",
|
||||
"eslint-plugin-import": "^2.22.1",
|
||||
"eslint-plugin-node": "^11.1.0",
|
||||
"eslint-plugin-promise": "^4.2.1",
|
||||
"eslint-plugin-standard": "^4.0.1",
|
||||
"eslint-plugin-vue": "^6.2.2",
|
||||
"node-sass": "^4.14.1",
|
||||
"sass-loader": "^8.0.2",
|
||||
"stylelint": "^13.7.2",
|
||||
"stylelint-config-recommended-scss": "^4.2.0",
|
||||
"stylelint-scss": "^3.18.0",
|
||||
"stylelint-webpack-plugin": "^2.1.0",
|
||||
"vue-loader": "^15.9.3",
|
||||
"vue-template-compiler": "^2.6.12",
|
||||
"webpack": "^4.44.2",
|
||||
"webpack-cli": "^3.3.12",
|
||||
"webpack-merge": "^5.2.0"
|
||||
}
|
||||
}
|
||||
|
BIN
screenshot.png
Before Width: | Height: | Size: 69 KiB |
@ -1,25 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace OCA\Radio\Service;
|
||||
|
||||
use \OCP\IConfig;
|
||||
|
||||
class ConfigService {
|
||||
|
||||
private $config;
|
||||
private $appName;
|
||||
|
||||
public function __construct(IConfig $config, $appName) {
|
||||
$this->config = $config;
|
||||
$this->appName = $appName;
|
||||
}
|
||||
|
||||
public function getUserValue($key, $userId) {
|
||||
return $this->config->getUserValue($userId, $this->appName, $key);
|
||||
}
|
||||
|
||||
public function setUserValue($key, $userId, $value) {
|
||||
$this->config->setUserValue($userId, $this->appName, $key, $value);
|
||||
}
|
||||
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace OCA\OwnNotes\Service;
|
||||
|
||||
|
||||
class NotFoundException extends ServiceException {}
|
@ -1,7 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace OCA\OwnNotes\Service;
|
||||
|
||||
use Exception;
|
||||
|
||||
class ServiceException extends Exception {}
|
@ -1,74 +0,0 @@
|
||||
<?php
|
||||
namespace OCA\Radio\Service;
|
||||
|
||||
use Exception;
|
||||
|
||||
use OCP\AppFramework\Db\DoesNotExistException;
|
||||
use OCP\AppFramework\Db\MultipleObjectsReturnedException;
|
||||
|
||||
use OCA\Radio\Db\Station;
|
||||
use OCA\Radio\Db\StationMapper;
|
||||
|
||||
|
||||
class StationService {
|
||||
|
||||
private $mapper;
|
||||
|
||||
public function __construct(StationMapper $mapper){
|
||||
$this->mapper = $mapper;
|
||||
}
|
||||
|
||||
public function findAll($userId) {
|
||||
return $this->mapper->findAll($userId);
|
||||
}
|
||||
|
||||
private function handleException ($e) {
|
||||
if ($e instanceof DoesNotExistException ||
|
||||
$e instanceof MultipleObjectsReturnedException) {
|
||||
throw new NotFoundException($e->getMessage());
|
||||
} else {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
public function find($id, $userId) {
|
||||
try {
|
||||
return $this->mapper->find($id, $userId);
|
||||
|
||||
// in order to be able to plug in different storage backends like files
|
||||
// for instance it is a good idea to turn storage related exceptions
|
||||
// into service related exceptions so controllers and service users
|
||||
// have to deal with only one type of exception
|
||||
} catch(Exception $e) {
|
||||
$this->handleException($e);
|
||||
}
|
||||
}
|
||||
|
||||
public function create($stationid, $userId) {
|
||||
$station = new Station();
|
||||
$station->setStationid($stationid);
|
||||
$station->setUserId($userId);
|
||||
return $this->mapper->insert($station);
|
||||
}
|
||||
|
||||
public function update($id, $stationid, $userId) {
|
||||
try {
|
||||
$station = $this->mapper->find($id, $userId);
|
||||
$station->setStationid($stationid);
|
||||
return $this->mapper->update($station);
|
||||
} catch(Exception $e) {
|
||||
$this->handleException($e);
|
||||
}
|
||||
}
|
||||
|
||||
public function delete($id, $userId) {
|
||||
try {
|
||||
$station = $this->mapper->find($id, $userId);
|
||||
$this->mapper->delete($station);
|
||||
return $station;
|
||||
} catch(Exception $e) {
|
||||
$this->handleException($e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
72
src/App.vue
Normal file
@ -0,0 +1,72 @@
|
||||
<template>
|
||||
<Content :class="{'icon-loading': loading}" app-name="Radio">
|
||||
<AppNavigation>
|
||||
<template id="app-radio-navigation" #list>
|
||||
<AppNavigationItem icon="icon-folder" title="Top" />
|
||||
<AppNavigationItem icon="icon-recent" title="Recent" />
|
||||
<AppNavigationItem icon="icon-favorites" title="Favorites" />
|
||||
<AppNavigationItem icon="icon-folder" title="Categories" />
|
||||
<AppNavigationItem title="First pinned item"
|
||||
icon="icon-category-enabled"
|
||||
:pinned="true" />
|
||||
</template>
|
||||
</AppNavigation>
|
||||
<AppContent>
|
||||
<Breadcrumbs>
|
||||
<Breadcrumb title="Home" href="/" />
|
||||
<Breadcrumb title="Top" href="/Top" />
|
||||
</Breadcrumbs>
|
||||
</AppContent>
|
||||
</Content>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Content from '@nextcloud/vue/dist/Components/Content'
|
||||
import AppContent from '@nextcloud/vue/dist/Components/AppContent'
|
||||
import AppNavigation from '@nextcloud/vue/dist/Components/AppNavigation'
|
||||
import AppNavigationItem from '@nextcloud/vue/dist/Components/AppNavigationItem'
|
||||
import Breadcrumbs from '@nextcloud/vue/dist/Components/Breadcrumbs'
|
||||
import Breadcrumb from '@nextcloud/vue/dist/Components/Breadcrumb'
|
||||
|
||||
export default {
|
||||
name: 'App',
|
||||
components: {
|
||||
Content,
|
||||
AppContent,
|
||||
AppNavigation,
|
||||
AppNavigationItem,
|
||||
Breadcrumbs,
|
||||
Breadcrumb,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
date: Date.now() + 86400000 * 3,
|
||||
date2: Date.now() + 86400000 * 3 + Math.floor(Math.random() * 86400000 / 2),
|
||||
show: true,
|
||||
starred: false,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
addOption(val) {
|
||||
this.options.push(val)
|
||||
this.select.push(val)
|
||||
},
|
||||
previous(data) {
|
||||
console.debug(data)
|
||||
},
|
||||
next(data) {
|
||||
console.debug(data)
|
||||
},
|
||||
close(data) {
|
||||
console.debug(data)
|
||||
},
|
||||
newButtonAction(e) {
|
||||
console.debug(e)
|
||||
},
|
||||
log(e) {
|
||||
console.debug(e)
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
33
src/main.js
Normal file
@ -0,0 +1,33 @@
|
||||
/**
|
||||
* @copyright Copyright (c) 2018 John Molakvoæ <skjnldsv@protonmail.com>
|
||||
*
|
||||
* @author John Molakvoæ <skjnldsv@protonmail.com>
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
import Vue from 'vue'
|
||||
import { translate, translatePlural } from '@nextcloud/l10n'
|
||||
|
||||
import App from './App'
|
||||
|
||||
Vue.prototype.t = translate
|
||||
Vue.prototype.n = translatePlural
|
||||
|
||||
export default new Vue({
|
||||
el: '#content',
|
||||
render: h => h(App),
|
||||
})
|
32
stylelint.config.js
Normal file
@ -0,0 +1,32 @@
|
||||
module.exports = {
|
||||
extends: 'stylelint-config-recommended-scss',
|
||||
rules: {
|
||||
indentation: 'tab',
|
||||
'selector-type-no-unknown': null,
|
||||
'number-leading-zero': null,
|
||||
'rule-empty-line-before': [
|
||||
'always',
|
||||
{
|
||||
ignore: ['after-comment', 'inside-block'],
|
||||
}
|
||||
],
|
||||
'declaration-empty-line-before': [
|
||||
'never',
|
||||
{
|
||||
ignore: ['after-declaration'],
|
||||
},
|
||||
],
|
||||
'comment-empty-line-before': null,
|
||||
'selector-type-case': null,
|
||||
'selector-list-comma-newline-after': null,
|
||||
'no-descending-specificity': null,
|
||||
'string-quotes': 'single',
|
||||
'selector-pseudo-element-no-unknown': [
|
||||
true,
|
||||
{
|
||||
ignorePseudoElements: ['v-deep'],
|
||||
},
|
||||
],
|
||||
},
|
||||
plugins: ['stylelint-scss'],
|
||||
}
|
81
templates/main.php
Executable file → Normal file
@ -1,80 +1 @@
|
||||
<?php
|
||||
style('radio', 'main');
|
||||
script('radio', 'main');
|
||||
script('radio', 'navigation');
|
||||
script('radio', 'howler-2.1.2');
|
||||
script('radio', 'player');
|
||||
?>
|
||||
|
||||
<div id="content" class="app-radio" role="main">
|
||||
<div id="app-navigation">
|
||||
<ul class="with-icon">
|
||||
<li data-id="files" class="nav-files">
|
||||
<a href="#top" class="nav-icon-files svg">
|
||||
<?php p($l->t('Top')); ?>
|
||||
</a>
|
||||
</li>
|
||||
<li data-id="recent" class="nav-recent">
|
||||
<a href="#recent" class="nav-icon-recent svg">
|
||||
<?php p($l->t('Recent')); ?>
|
||||
</a>
|
||||
</li>
|
||||
<li data-id="favorites" class="nav-favorites">
|
||||
<a href="#favorites" class="nav-icon-favorites svg">
|
||||
<?php p($l->t('Favorites')); ?>
|
||||
</a>
|
||||
</li>
|
||||
<li data-id="categories" class="nav-categories">
|
||||
<a href="#categories" class="nav-icon-systemtagsfilter svg">
|
||||
<?php p($l->t('Categories')); ?>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div id="app-settings">
|
||||
<button id="playbutton" class="play"></button>
|
||||
<div id="volumeicon" class="full"></div>
|
||||
<div id="volumeslider"></div>
|
||||
<p id="station_metadata"></p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="app-content">
|
||||
<div id="app-content-files" class="viewcontainer">
|
||||
|
||||
<div class="nofilterresults emptycontent hidden">
|
||||
<div class="icon-search"></div>
|
||||
<h2><?php p($l->t('No stations found with this name')); ?></h2>
|
||||
<p></p>
|
||||
</div>
|
||||
|
||||
<div class="loading emptycontent hidden">
|
||||
</div>
|
||||
|
||||
<div id="emptycontent" class="hidden">
|
||||
<div class="icon-starred"></div>
|
||||
<h2><?php p($l->t('No favorites yet')); ?></h2>
|
||||
<p><?php p($l->t('Stations you mark as favorite will show up here')); ?></p>
|
||||
</div>
|
||||
|
||||
<table id="filestable" data-preview-x="32" data-preview-y="32">
|
||||
<thead>
|
||||
<tr>
|
||||
<th id='headerName' class=" column-name" colspan="2">
|
||||
<div id="headerName-container">
|
||||
<a class="name sort columntitle" data-sort="name"><span>Name</span><span class="sort-indicator"></span></a>
|
||||
</div>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="fileList">
|
||||
</tbody>
|
||||
<tfoot>
|
||||
</tfoot>
|
||||
</table>
|
||||
|
||||
<div id="preload-01"></div>
|
||||
<div id="preload-02"></div>
|
||||
<div id="preload-03"></div>
|
||||
<div id="preload-04"></div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- closing app-content -->
|
||||
<div id="vue-content"></div>
|
||||
|
3
webpack.js
Normal file
@ -0,0 +1,3 @@
|
||||
const webpackConfig = require('@nextcloud/webpack-vue-config')
|
||||
|
||||
module.exports = webpackConfig
|