diff --git a/.eslintignore b/.eslintignore index 25422889..2e1f92d3 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,6 +1,5 @@ vendor/ !/vendor/vendor.js -/modules/** !/modules/default/** !/modules/node_helper !/modules/node_helper/** diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 7025dd7c..ee3b7219 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -3,57 +3,47 @@ Contribution Policy for MagicMirror² Thanks for contributing to MagicMirror²! -We hold our code to standard, and these standards are documented below. +We hold our code to standard, and these standards are documented below. -First, before you run the linters, you will need to install them all **and** install the development dependencies: +If you wish to run both linters, use `grunt` without any arguments. -```bash -(sudo) npm install -g jscs stylelint html-validator-cli -npm install -``` +### JavaScript: Run ESLint -### JavaScript: Run JSCS +We use [ESLint](http://eslint.org) on our JavaScript files. -We use [JSCS](http://jscs.info) on our JavaScript files. +Our ESLint configuration is in our .eslintrc.json and .eslintignore files. -Our JSCS configuration is in our .jscsrc file. - -To run JSCS, use `npm run jscs`. +To run ESLint, use `grunt eslint`. ### CSS: Run StyleLint We use [StyleLint](http://stylelint.io) to lint our CSS. Our configuration is in our .stylelintrc file. -To run StyleLint, use `npm run stylelint`. +To run StyleLint, use `grunt stylelint`. -### HTML: Run HTML Validator - -We use [NU Validator](https://validator.w3.org/nu) to validate our HTML. The configuration is in the command in the package.json file. - -To run HTML Validator, use `npm run htmlvalidator`. - -## Submitting Issues +### Submitting Issues Please only submit reproducible issues. -If you're not sure if it's a real bug or if it's just you, please open a topic on the forum: https://forum.magicmirror.builders/category/15/bug-hunt - Problems installing or configuring your MagicMirror? Check out: https://forum.magicmirror.builders/category/10/troubleshooting +If you're not sure if it's a real bug or if it's just you, please open a topic on the forum: [https://forum.magicmirror.builders/category/15/bug-hunt](https://forum.magicmirror.builders/category/15/bug-hunt) +Problems installing or configuring your MagicMirror? Check out: [https://forum.magicmirror.builders/category/10/troubleshooting](https://forum.magicmirror.builders/category/10/troubleshooting) When submitting a new issue, please supply the following information: -**Platform** [ Raspberry Pi 2/3, Windows, Mac OS X, Linux, Etc ... ]: +**Platform**: Place your platform here... give us your web browser/Electron version *and* your hardware (Raspberry Pi 2/3, Windows, Mac, Linux, System V UNIX). -**Node Version** [ 0.12.13 or later ]: +**Node Version**: Make sure it's version 0.12.13 or later. -**MagicMirror Version** [ V1 / V2-Beta ]: +**MagicMirror Version**: Now that the versions have split, tell us if you are using the PHP version (v1) or the newer JavaScript version (v2). -**Description:** Provide a detailed description about the issue and include specific details to help us understand the problem. Adding screenshots will help describing the problem. +**Description**: Provide a detailed description about the issue and include specific details to help us understand the problem. Adding screenshots will help describing the problem. -**Steps to Reproduce:** List the step by step process to reproduce the issue. +**Steps to Reproduce**: List the step by step process to reproduce the issue. -**Expected Results:** Describe what you expected to see. +**Expected Results**: Describe what you expected to see. -**Actual Results:** Describe what you actually saw. +**Actual Results**: Describe what you actually saw. -**Configuration:** What does the used config.js file look like? (Don't forget to remove any sensitive information.) +**Configuration**: What does the used config.js file look like? Don't forget to remove any sensitive information! -**Additional Notes:** Provide any other relevant notes not previously mentioned (optional) +**Additional Notes**: Provide any other relevant notes not previously mentioned. This is optional. diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 6d039bf1..736795d7 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,21 +1,24 @@ Please only submit reproducible issues. -If you're not sure if it's a real bug or if it's just you, please open a topic on the forum: https://forum.magicmirror.builders/category/15/bug-hunt - Problems installing or configuring your MagicMirror? Check out: https://forum.magicmirror.builders/category/10/troubleshooting +If you're not sure if it's a real bug or if it's just you, please open a topic on the forum: [https://forum.magicmirror.builders/category/15/bug-hunt](https://forum.magicmirror.builders/category/15/bug-hunt) +Problems installing or configuring your MagicMirror? Check out: [https://forum.magicmirror.builders/category/10/troubleshooting](https://forum.magicmirror.builders/category/10/troubleshooting) -**Platform** [ Raspberry Pi 2/3, Windows, Mac OS X, Linux, Etc ... ]: +When submitting a new issue, please supply the following information: -**Node Version** [ 0.12.13 or later ]: +**Platform**: Place your platform here... give us your web browser/Electron version *and* your hardware (Raspberry Pi 2/3, Windows, Mac, Linux, System V UNIX). -**MagicMirror Version** [ V1 / V2-Beta ]: +**Node Version**: Make sure it's version 0.12.13 or later. -**Description:** Provide a detailed description about the issue and include specific details to help us understand the problem. Adding screenshots will help describing the problem. +**MagicMirror Version**: Now that the versions have split, tell us if you are using the PHP version (v1) or the newer JavaScript version (v2). -**Steps to Reproduce:** List the step by step process to reproduce the issue. +**Description**: Provide a detailed description about the issue and include specific details to help us understand the problem. Adding screenshots will help describing the problem. -**Expected Results:** Describe what you expected to see. +**Steps to Reproduce**: List the step by step process to reproduce the issue. -**Actual Results:** Describe what you actually saw. +**Expected Results**: Describe what you expected to see. -**Configuration:** What does the used config.js file look like? (Don't forget to remove any sensitive information.) +**Actual Results**: Describe what you actually saw. -**Additional Notes:** Provide any other relevant notes not previously mentioned (optional) +**Configuration**: What does the used config.js file look like? Don't forget to remove any sensitive information! + +**Additional Notes**: Provide any other relevant notes not previously mentioned. This is optional. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 1ac9aaa1..215950e0 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,9 +1,7 @@ -> Please send your PR's the develop branch. -> Don't forget to add the change to changelog.md. +> Please send your pull requests the develop branch. +> Don't forget to add the change to CHANGELOG.md. -* Does the pull request solve a **related** issue? [yes | no] +* Does the pull request solve a **related** issue? * If so, can you reference the issue? -* What does the pull request accomplish? (please list) +* What does the pull request accomplish? Use a list if needed. * If it includes major visual changes please add screenshots. - - diff --git a/.stylelintrc b/.stylelintrc index 02300404..db05c713 100644 --- a/.stylelintrc +++ b/.stylelintrc @@ -1,4 +1,5 @@ { "extends": "stylelint-config-standard", - "font-family-name-quotes": "double-where-recommended" -} \ No newline at end of file + "font-family-name-quotes": "double-where-recommended", + "block-no-empty": false +} diff --git a/CHANGELOG.md b/CHANGELOG.md index c76d0362..20f95c84 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,11 +2,30 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## [2.0.5] - 2016-09-20 + +### Added +- Added ability to remove tags from the beginning or end of newsfeed items in 'newsfeed.js'. +- Added ability to define "the day after tomorrow" for calendar events (Definition for German and Dutch already included). +- Added CII Badge (we are compliant with the CII Best Practices) +- Add support for doing http basic auth when loading calendars +- Add the abilty to turn off and on the date display in the Clock Module + +### Fixed +- Fix typo in installer. +- Add message to unsupported Pi error to mention that Pi Zeros must use server only mode, as ARMv6 is unsupported. Closes #374. +- Fix API url for weather API. + +### Updated +- Force fullscreen when kioskmode is active. +- Update the .github templates and information with more modern information. +- Update the Gruntfile with a more functional StyleLint implementation. + ## [2.0.4] - 2016-08-07 ### Added - Brazilian Portuguese Translation. -- Option to enable Kios mode. +- Option to enable Kiosk mode. - Added ability to start the app with Dev Tools. - Added ability to turn off the date display in `clock.js` when in analog mode. - Greek Translation @@ -71,4 +90,4 @@ It includes (but is not limited to) the following features: ## [1.0.0] - 2014-02-16 ### Initial release of MagicMirror. -This was part of the blogpost: http://michaelteeuw.nl/post/83916869600/magic-mirror-part-vi-production-of-the +This was part of the blogpost: [http://michaelteeuw.nl/post/83916869600/magic-mirror-part-vi-production-of-the](http://michaelteeuw.nl/post/83916869600/magic-mirror-part-vi-production-of-the) diff --git a/Gruntfile.js b/Gruntfile.js index ac499fe3..e5bc690b 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -8,21 +8,60 @@ module.exports = function(grunt) { }, target: ["js/*.js", "modules/default/*.js", "serveronly/*.js", "*.js"] }, - postcss: { - lint: { + stylelint: { + simple: { options: { - processors: [ - require("stylelint")({"extends": "stylelint-config-standard", "font-family-name-quotes": "double-where-recommended"}), - require("postcss-reporter")({ clearMessages: true }) - ] + configFile: ".stylelintrc" }, - dist: { - src: "**/**/**/**/**/**/**/**.css" + src: ["css/main.css", "modules/default/calendar/calendar.css", "modules/default/clock/clock_styles.css", "modules/default/currentweather/currentweather.css", "modules/default/weatherforcast/weatherforcast.css"] + } + }, + jsonlint: { + main: { + src: ["package.json", ".eslintrc.json", ".stylelint"], + options: { + reporter: "jshint" } } + }, + markdownlint: { + all: { + options: { + config: { + "default": true, + "line-length": false, + "blanks-around-headers": false, + "no-duplicate-header": false, + "no-inline-html": false, + "MD010": false, + "MD001": false, + "MD031": false, + "MD040": false, + "MD002": false, + "MD029": false, + "MD041": false, + "MD032": false, + "MD036": false, + "MD037": false, + "MD009": false, + "MD018": false, + "MD012": false, + "MD026": false, + "MD036": false, + "MD038": false + } + }, + src: ["README.md", "CHANGELOG.md", "LICENSE.md", "modules/README.md", "modules/default/**/*.md", "!modules/default/calendar/vendor/ical.js/readme.md"] + } + }, + yamllint: { + all: [".travis.yml"] } }); grunt.loadNpmTasks("grunt-eslint"); - grunt.loadNpmTasks("grunt-postcss"); - grunt.registerTask("default", ["eslint", "postcss:lint"]); + grunt.loadNpmTasks("grunt-stylelint"); + grunt.loadNpmTasks("grunt-jsonlint"); + grunt.loadNpmTasks("grunt-yamllint"); + grunt.loadNpmTasks("grunt-markdownlint"); + grunt.registerTask("default", ["eslint", "stylelint", "jsonlint", "markdownlint", "yamllint"]); }; \ No newline at end of file diff --git a/README.md b/README.md index 5d5f7176..d86cca7c 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@

Dependency Status devDependency Status - Node Version + License Travis Known Vulnerabilities @@ -24,17 +24,17 @@ MagicMirror² focuses on a modular plugin system and uses [Electron](http://elec ## Usage -#### Raspberry Pi Support +### Raspberry Pi Support Electron, the app wrapper around MagicMirror², only supports the Raspberry Pi 2 & 3. The Raspberry Pi 1 is currently **not** supported. If you want to run this on a Raspberry Pi 1, use the [server only](#server-only) feature and setup a fullscreen browser yourself. -#### Automatic Installer (Raspberry Pi Only!) +### Automatic Installer (Raspberry Pi Only!) Execute the following command on your Raspberry Pi to install MagicMirror²: ```` curl -sL https://raw.githubusercontent.com/MichMich/MagicMirror/master/installers/raspberry.sh | bash ```` -#### Manual Installation +### Manual Installation 1. Download and install the latest Node.js version. 2. Clone the repository and check out the beta branch: `git clone https://github.com/MichMich/MagicMirror` @@ -45,23 +45,23 @@ curl -sL https://raw.githubusercontent.com/MichMich/MagicMirror/master/installer **Note:** if you want to debug on Raspberry Pi you can use `npm start dev` which will start the MagicMirror app with Dev Tools enabled. -#### Server Only +### Server Only In some cases, you want to start the application without an actual app window. In this case, execute the following command from the MagicMirror folder: `node serveronly`. This will start the server, after which you can open the application in your browser of choice. -#### Raspberry Configuration & Auto Start. +### Raspberry Configuration & Auto Start. The following wiki links are helpful in the configuration of your MagicMirror² operating system: - [Configuring the Raspberry Pi](https://github.com/MichMich/MagicMirror/wiki/Configuring-the-Raspberry-Pi) - [Auto Starting MagicMirror](https://github.com/MichMich/MagicMirror/wiki/Auto-Starting-MagicMirror) -#### Updating you MagicMirror² +### Updating your MagicMirror² If you want to update your MagicMirror² to the latest version, use your terminal to go to your Magic Mirror folder and type the following command: -```` +```bash git pull -```` +``` If you changed nothing more than the config or the modules, this should work without any problems. Type `git status` to see your changes, if there are any, you can reset them with `git reset --hard`. After that, git pull should be possible. diff --git a/css/main.css b/css/main.css index 93d6a7ee..7ae902d6 100644 --- a/css/main.css +++ b/css/main.css @@ -1,10 +1,10 @@ html { cursor: none; - overflow:hidden; + overflow: hidden; } -::-webkit-scrollbar { - display: none; +::-webkit-scrollbar { + display: none; } body { diff --git a/installers/raspberry.sh b/installers/raspberry.sh index 824bf7cc..ce37e86f 100644 --- a/installers/raspberry.sh +++ b/installers/raspberry.sh @@ -28,6 +28,7 @@ ARM=$(uname -m) if [ "$ARM" != "armv7l" ]; then echo -e "\e[91mSorry, your Raspberry Pi is not supported." echo -e "\e[91mPlease run MagicMirror on a Raspberry Pi 2 or 3." + echo -e "\e[91mIf this is a Pi Zero, you are in the same boat as the original Raspberry Pi. You must run in server only mode." exit; fi @@ -68,7 +69,7 @@ else NODE_INSTALL=true fi -# Install or upgare node if nessecery. +# Install or upgrade node if necessary. if $NODE_INSTALL; then echo -e "\e[96mInstalling Node.js ...\e[90m" diff --git a/js/electron.js b/js/electron.js index 0a72aee9..75dc47fd 100644 --- a/js/electron.js +++ b/js/electron.js @@ -1,3 +1,5 @@ +/* jshint esversion: 6 */ + "use strict"; const Server = require(__dirname + "/server.js"); @@ -28,17 +30,30 @@ function createWindow() { mainWindow.loadURL("http://localhost:" + config.port); // Open the DevTools if run with "npm start dev" - if(process.argv[2] == "dev"){ + if(process.argv[2] == "dev") { mainWindow.webContents.openDevTools(); } - // Emitted when the window is closed. + // Set responders for window events. mainWindow.on("closed", function() { - // Dereference the window object, usually you would store windows - // in an array if your app supports multi windows, this is the time - // when you should delete the corresponding element. mainWindow = null; }); + + if (config.kioskmode) { + mainWindow.on("blur", function() { + mainWindow.focus(); + }); + + mainWindow.on("leave-full-screen", function() { + mainWindow.setFullScreen(true); + }); + + mainWindow.on("resize", function() { + setTimeout(function() { + mainWindow.reload(); + }, 1000); + }); + } } // This method will be called when Electron has finished @@ -50,11 +65,7 @@ app.on("ready", function() { // Quit when all windows are closed. app.on("window-all-closed", function() { - // On OS X it is common for applications and their menu bar - // to stay active until the user quits explicitly with Cmd + Q - if (process.platform !== "darwin") { - app.quit(); - } + createWindow(); }); app.on("activate", function() { diff --git a/modules/README.md b/modules/README.md index 39072db5..f4a8debd 100644 --- a/modules/README.md +++ b/modules/README.md @@ -4,7 +4,7 @@ This document describes the way to develop your own MagicMirror² modules. ## Module structure -All modules are loaded in de `modules` folder. The default modules are grouped together in the `modules/default` folder. Your module should be placed in a subfolder of `modules`. Note that any file or folder your create in the `modules` folder will be ignored by git, allowing you to upgrade the MagicMirror² without the loss of your files. +All modules are loaded in the `modules` folder. The default modules are grouped together in the `modules/default` folder. Your module should be placed in a subfolder of `modules`. Note that any file or folder your create in the `modules` folder will be ignored by git, allowing you to upgrade the MagicMirror² without the loss of your files. A module can be placed in one single folder. Or multiple modules can be grouped in a subfoler. Note that name of the module must be unique. Even when a module with a similar name is placed in a different folder, they can't be loaded at the same time. diff --git a/modules/default/calendar/README.md b/modules/default/calendar/README.md index 05d12de8..936abdde 100644 --- a/modules/default/calendar/README.md +++ b/modules/default/calendar/README.md @@ -173,7 +173,7 @@ config: { symbol The symbol to show in front of an event. This property is optional.
-
Possible values: See Font Awsome website. +
Possible values: See Font Awesome website. @@ -183,5 +183,13 @@ config: { 'Birthday' + + user + The username for HTTP Basic authentication. + + + pass + The password for HTTP Basic authentication. + diff --git a/modules/default/calendar/calendar.js b/modules/default/calendar/calendar.js index c90153a0..3151467a 100644 --- a/modules/default/calendar/calendar.js +++ b/modules/default/calendar/calendar.js @@ -64,7 +64,7 @@ Module.register("calendar",{ for (var c in this.config.calendars) { var calendar = this.config.calendars[c]; calendar.url = calendar.url.replace("webcal://", "http://"); - this.addCalendar(calendar.url); + this.addCalendar(calendar.url, calendar.user, calendar.pass); } this.calendarData = {}; @@ -150,6 +150,16 @@ Module.register("calendar",{ timeWrapper.innerHTML = this.translate("TODAY"); } else if (event.startDate - now < one_day && event.startDate - now > 0) { timeWrapper.innerHTML = this.translate("TOMORROW"); + } else if (event.startDate - now < 2*one_day && event.startDate - now > 0) { + /*Provide ability to show "the day after tomorrow" instead of "in a day" + *if "DAYAFTERTOMORROW" is configured in a language's translation .json file, + *,which can be found in MagicMirror/translations/ + */ + if (this.translate('DAYAFTERTOMORROW') !== 'DAYAFTERTOMORROW') { + timeWrapper.innerHTML = this.translate("DAYAFTERTOMORROW"); + } else { + timeWrapper.innerHTML = moment(event.startDate, "x").fromNow(); + } } else { /* Check to see if the user displays absolute or relative dates with their events * Also check to see if an event is happening within an 'urgency' time frameElement @@ -275,12 +285,14 @@ Module.register("calendar",{ * * argument url sting - Url to add. */ - addCalendar: function(url) { + addCalendar: function(url, user, pass) { this.sendSocketNotification("ADD_CALENDAR", { url: url, maximumEntries: this.config.maximumEntries, maximumNumberOfDays: this.config.maximumNumberOfDays, - fetchInterval: this.config.fetchInterval + fetchInterval: this.config.fetchInterval, + user: user, + pass: pass }); }, diff --git a/modules/default/calendar/calendarfetcher.js b/modules/default/calendar/calendarfetcher.js index f7f68b7e..214e2e5a 100644 --- a/modules/default/calendar/calendarfetcher.js +++ b/modules/default/calendar/calendarfetcher.js @@ -8,7 +8,7 @@ var ical = require("./vendor/ical.js"); var moment = require("moment"); -var CalendarFetcher = function(url, reloadInterval, maximumEntries, maximumNumberOfDays) { +var CalendarFetcher = function(url, reloadInterval, maximumEntries, maximumNumberOfDays, user, pass) { var self = this; var reloadTimer = null; @@ -29,7 +29,16 @@ var CalendarFetcher = function(url, reloadInterval, maximumEntries, maximumNumbe headers: { 'User-Agent': 'Mozilla/5.0 (Node.js 6.0.0) MagicMirror/v2 (https://github.com/MichMich/MagicMirror/)' } + }; + + if (user && pass) { + opts.auth = { + user: user, + pass: pass, + sendImmediately: true + } } + ical.fromURL(url, opts, function(err, data) { if (err) { fetchFailedCallback(self, err); @@ -239,4 +248,4 @@ var CalendarFetcher = function(url, reloadInterval, maximumEntries, maximumNumbe }; -module.exports = CalendarFetcher; \ No newline at end of file +module.exports = CalendarFetcher; diff --git a/modules/default/calendar/node_helper.js b/modules/default/calendar/node_helper.js index 47a0231b..a1b8db09 100644 --- a/modules/default/calendar/node_helper.js +++ b/modules/default/calendar/node_helper.js @@ -25,7 +25,7 @@ module.exports = NodeHelper.create({ socketNotificationReceived: function(notification, payload) { if (notification === "ADD_CALENDAR") { //console.log('ADD_CALENDAR: '); - this.createFetcher(payload.url, payload.fetchInterval, payload.maximumEntries, payload.maximumNumberOfDays); + this.createFetcher(payload.url, payload.fetchInterval, payload.maximumEntries, payload.maximumNumberOfDays, payload.user, payload.pass); } }, @@ -37,7 +37,7 @@ module.exports = NodeHelper.create({ * attribute reloadInterval number - Reload interval in milliseconds. */ - createFetcher: function(url, fetchInterval, maximumEntries, maximumNumberOfDays) { + createFetcher: function(url, fetchInterval, maximumEntries, maximumNumberOfDays, user, pass) { var self = this; if (!validUrl.isUri(url)) { @@ -48,7 +48,7 @@ module.exports = NodeHelper.create({ var fetcher; if (typeof self.fetchers[url] === "undefined") { console.log("Create new calendar fetcher for url: " + url + " - Interval: " + fetchInterval); - fetcher = new CalendarFetcher(url, fetchInterval, maximumEntries, maximumNumberOfDays); + fetcher = new CalendarFetcher(url, fetchInterval, maximumEntries, maximumNumberOfDays, user, pass); fetcher.onReceive(function(fetcher) { //console.log('Broadcast events.'); diff --git a/modules/default/clock/README.md b/modules/default/clock/README.md index c7ec6bcb..6eca1efb 100644 --- a/modules/default/clock/README.md +++ b/modules/default/clock/README.md @@ -66,6 +66,13 @@ The following properties can be configured:
Default value: false + + showDate + Turn off or on the Date section.
+
Possible values: true or false +
Default value: true + + displayType Display a digital clock, analog clock, or both together.
@@ -109,4 +116,4 @@ The following properties can be configured: - + \ No newline at end of file diff --git a/modules/default/clock/clock.js b/modules/default/clock/clock.js index e3415375..db41d7e0 100644 --- a/modules/default/clock/clock.js +++ b/modules/default/clock/clock.js @@ -15,6 +15,7 @@ Module.register("clock",{ showPeriod: true, showPeriodUpper: false, clockBold: false, + showDate: true, /* specific to the analog clock */ analogSize: '200px', @@ -85,7 +86,9 @@ Module.register("clock",{ timeString = moment().format("h:mm"); } } + if(this.config.showDate){ dateWrapper.innerHTML = moment().format("dddd, LL"); + } timeWrapper.innerHTML = timeString; secondsWrapper.innerHTML = moment().format("ss"); if (this.config.showPeriodUpper) { @@ -224,4 +227,4 @@ Module.register("clock",{ // Return the wrapper to the dom. return wrapper; } -}); +}); \ No newline at end of file diff --git a/modules/default/clock/clock_styles.css b/modules/default/clock/clock_styles.css index 6020e579..1df9bf83 100644 --- a/modules/default/clock/clock_styles.css +++ b/modules/default/clock/clock_styles.css @@ -1,74 +1,68 @@ -#analog { -} - -#digital { -} - .clockCircle { - margin: 0 auto; - position: relative; - border-radius: 50%; - background-size: 100%; + margin: 0 auto; + position: relative; + border-radius: 50%; + background-size: 100%; } .clockFace { - width: 100%; - height: 100%; + width: 100%; + height: 100%; } -.clockFace:after { - position: absolute; - top: 50%; - left: 50%; - width: 6px; - height: 6px; - margin: -3px 0 0 -3px; - background: white; - border-radius: 3px; - content: ""; - display: block; +.clockFace::after { + position: absolute; + top: 50%; + left: 50%; + width: 6px; + height: 6px; + margin: -3px 0 0 -3px; + background: white; + border-radius: 3px; + content: ""; + display: block; } .clockHour { - width: 0; - height: 0; - position: absolute; - top: 50%; - left: 50%; - margin: -2px 0 -2px -25%; /* numbers much match negative length & thickness */ - padding: 2px 0 2px 25%; /* indicator length & thickness */ - background: white; - -webkit-transform-origin: 100% 50%; - -ms-transform-origin: 100% 50%; - transform-origin: 100% 50%; - border-radius: 3px 0 0 3px; + width: 0; + height: 0; + position: absolute; + top: 50%; + left: 50%; + margin: -2px 0 -2px -25%; /* numbers much match negative length & thickness */ + padding: 2px 0 2px 25%; /* indicator length & thickness */ + background: white; + -webkit-transform-origin: 100% 50%; + -ms-transform-origin: 100% 50%; + transform-origin: 100% 50%; + border-radius: 3px 0 0 3px; } .clockMinute { - width: 0; - height: 0; - position: absolute; - top: 50%; - left: 50%; - margin: -35% -2px 0; /* numbers must match negative length & thickness */ - padding: 35% 2px 0; /* indicator length & thickness */ - background: white; - -webkit-transform-origin: 50% 100%; - -ms-transform-origin: 50% 100%; - transform-origin: 50% 100%; - border-radius: 3px 0 0 3px; + width: 0; + height: 0; + position: absolute; + top: 50%; + left: 50%; + margin: -35% -2px 0; /* numbers must match negative length & thickness */ + padding: 35% 2px 0; /* indicator length & thickness */ + background: white; + -webkit-transform-origin: 50% 100%; + -ms-transform-origin: 50% 100%; + transform-origin: 50% 100%; + border-radius: 3px 0 0 3px; } .clockSecond { - width: 0; - height: 0; - position: absolute; - top: 50%; - left: 50%; - margin: -38% -1px 0 0; /* numbers must match negative length & thickness */ - padding: 38% 1px 0 0; /* indicator length & thickness */ - background: #888888; - -webkit-transform-origin: 50% 100%; - -ms-transform-origin: 50% 100%; - transform-origin: 50% 100%; + width: 0; + height: 0; + position: absolute; + top: 50%; + left: 50%; + margin: -38% -1px 0 0; /* numbers must match negative length & thickness */ + padding: 38% 1px 0 0; /* indicator length & thickness */ + background: #888; + -webkit-transform-origin: 50% 100%; + -ms-transform-origin: 50% 100%; + transform-origin: 50% 100%; } diff --git a/modules/default/currentweather/currentweather.js b/modules/default/currentweather/currentweather.js index db3d5de2..5265b099 100644 --- a/modules/default/currentweather/currentweather.js +++ b/modules/default/currentweather/currentweather.js @@ -164,7 +164,7 @@ Module.register("currentweather",{ * Calls processWeather on succesfull response. */ updateWeather: function() { - var url = this.config.apiBase + this.config.apiVersion + "/" + this.config.weatherEndpoint + '/' + this.getParams(); + var url = this.config.apiBase + this.config.apiVersion + "/" + this.config.weatherEndpoint + this.getParams(); var self = this; var retry = true; diff --git a/modules/default/newsfeed/README.md b/modules/default/newsfeed/README.md index 882ef94a..951fa51c 100644 --- a/modules/default/newsfeed/README.md +++ b/modules/default/newsfeed/README.md @@ -98,7 +98,7 @@ The following properties can be configured: animationSpeed Speed of the update animation. (Milliseconds)

Possible values:0 - 5000 -
Default value: 2000 (2.5 seconds) +
Default value: 2000 (2 seconds) @@ -108,7 +108,37 @@ The following properties can be configured:
Default value: 0 - + removeStartTags: false, + removeEndTags: false, + startTags: [], + endTags: [] + + + + removeStartTags + Some newsfeeds feature tags at the beginning of their titles or descriptions, such as [VIDEO]. + This setting allows for the removal of specified tags from the beginning of an item's description and/or title.
+
Possible values:'title', 'description', 'both' + + + + startTags + List the tags you would like to have removed at the beginning of the feed item
+
Possible values: ['TAG'] or ['TAG1','TAG2',...] + + + + removeEndTags + Remove specified tags from the end of an item's description and/or title.
+
Possible values:'title', 'description', 'both' + + + + endTags + List the tags you would like to have removed at the end of the feed item
+
Possible values: ['TAG'] or ['TAG1','TAG2',...] + + diff --git a/modules/default/newsfeed/newsfeed.js b/modules/default/newsfeed/newsfeed.js index a9664085..7d8d08c7 100644 --- a/modules/default/newsfeed/newsfeed.js +++ b/modules/default/newsfeed/newsfeed.js @@ -24,7 +24,12 @@ Module.register("newsfeed",{ reloadInterval: 5 * 60 * 1000, // every 5 minutes updateInterval: 10 * 1000, animationSpeed: 2.5 * 1000, - maxNewsItems: 0 // 0 for unlimited + maxNewsItems: 0, // 0 for unlimited + removeStartTags: '', + removeEndTags: '', + startTags: [], + endTags: [] + }, // Define required scripts. @@ -96,11 +101,54 @@ Module.register("newsfeed",{ wrapper.appendChild(sourceAndTimestamp); } + //Remove selected tags from the beginning of rss feed items (title or description) + + if (this.config.removeStartTags == 'title' || 'both') { + + for (f=0; f