Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release of 2.0.3. #373

Merged
merged 39 commits into from
Jul 12, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
0d94ef1
add maxNewsItems config
Sonaryr Jun 5, 2016
b0220e4
Update README to explain new parameter
Sonaryr Jun 5, 2016
2b8583e
Merge pull request #355 from Sonaryr/add-max-newsitems-parameter
MichMich Jun 6, 2016
831e7cd
Update CHANGELOG.md
MichMich Jun 6, 2016
58a59b6
Merge pull request #356 from MichMich/master
MichMich Jun 6, 2016
fed6e1e
Update CHANGELOG.md
MichMich Jun 6, 2016
3735342
Create zh_cn.js
simonsmh Jun 7, 2016
f2749ff
Create zh_tw.json
simonsmh Jun 7, 2016
44347db
Rename zh_cn.js to zh_cn.json
simonsmh Jun 7, 2016
f932858
Update translations.js
simonsmh Jun 7, 2016
4b29698
Create ja.json
simonsmh Jun 7, 2016
51ac07c
Update translations.js
simonsmh Jun 7, 2016
abdbcbb
Update ja.json
simonsmh Jun 7, 2016
ceb7ed0
Merge pull request #359 from simonsmh/patch-1
MichMich Jun 7, 2016
8d9bf5c
Update CHANGELOG.md
MichMich Jun 7, 2016
271aab9
Polish translation
matt08 Jun 9, 2016
f6e2073
Added polish translation
matt08 Jun 9, 2016
50e41d1
Update CHANGELOG.md
matt08 Jun 9, 2016
479ceb1
Merge pull request #361 from matt08/patch-2
MichMich Jun 9, 2016
b44dcc9
Not display title and/or message if they are not provided (alert module)
gzot Jun 24, 2016
ccdc981
small fix
gzot Jun 27, 2016
1b9daa0
Fix #300
gzot Jun 27, 2016
491bbac
Merge pull request #365 from gzot/develop
MichMich Jun 27, 2016
00a11f4
Removed 'null' setting
KirAsh4 Jul 1, 2016
1a417cc
CHANGELOG update
KirAsh4 Jul 1, 2016
61ace7b
CHANGELOG update
KirAsh4 Jul 1, 2016
1bb7226
Merge pull request #366 from KirAsh4/upstream-dev
MichMich Jul 1, 2016
ea6e9af
Change Requirements.
MichMich Jul 9, 2016
5e94c8b
Analog clock addition
KirAsh4 Jul 8, 2016
8f02cb8
Analog clock addition
KirAsh4 Jul 9, 2016
a9540ff
Analog clock addition
KirAsh4 Jul 9, 2016
279582f
Analog clock addition
KirAsh4 Jul 9, 2016
66a9138
Analog clock addition
KirAsh4 Jul 9, 2016
35ec98c
Analog clock addition
KirAsh4 Jul 9, 2016
c105523
Switched to SVG graphics for scalability
KirAsh4 Jul 9, 2016
fcb503e
Switched to SVG graphics for scalability
KirAsh4 Jul 9, 2016
e223d75
Fixed README typo
KirAsh4 Jul 10, 2016
36eb899
Merge pull request #372 from KirAsh4/upstream-dev
MichMich Jul 10, 2016
1f558d4
Add version number for 2.0.3 release.
MichMich Jul 12, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ language: node_js
node_js:
- "6"
- "5.1"
- "4"
- "0.12"
before_script:
- npm install grunt-cli -g
script: grunt
script: grunt
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [2.0.3] - 2016-07-12
### Added
- Add max newsitems parameter to the newsfeed module.
- Translations for Simplified Chinese, Traditional Chinese and Japanese.
- Polish Translation
- Add an analog clock in addition to the digital one.

### Fixed
- Edit Alert Module to display title & message if they are provided in the notification (Issue #300)
- Removed 'null' reference from updateModuleContent(). This fixes recent Edge and Internet Explorer browser displays (Issue #319)

### Changed
- Added default string to calendar titleReplace.

## [2.0.2] - 2016-06-05
### Added
- Norwegian Translations (nb and nn)
Expand Down
2 changes: 1 addition & 1 deletion js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ var MM = (function() {
var moduleWrapper = document.getElementById(module.identifier);
var contentWrapper = moduleWrapper.getElementsByClassName("module-content")[0];

contentWrapper.innerHTML = null;
contentWrapper.innerHTML = "";
contentWrapper.appendChild(content);
};

Expand Down
29 changes: 26 additions & 3 deletions modules/default/alert/alert.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,20 @@ Module.register("alert",{
},
show_notification: function(message) {
if (this.config.effect == "slide") {this.config.effect = this.config.effect + "-" + this.config.position;}
message = "<span class='thin' style='line-height: 35px; font-size:24px' color='#4A4A4A'>" + message.title + "</span><br /><span class='light' style='font-size:28px;line-height: 30px;'>" + message.message + "</span>";

msg = "";
if (message.title) {
msg += "<span class='thin' style='line-height: 35px; font-size:24px' color='#4A4A4A'>" + message.title + "</span>";
}
if (message.message){
if (msg != ""){
msg+= "<br />";
}
msg += "<span class='light' style='font-size:28px;line-height: 30px;'>" + message.message + "</span>";
}

new NotificationFx({
message: message,
message: msg,
layout: "growl",
effect: this.config.effect,
ttl: this.config.display_time
Expand Down Expand Up @@ -67,7 +78,19 @@ Module.register("alert",{
this.hide_alert(sender);
}

message = "<span class='light' style='line-height: 35px; font-size:30px' color='#4A4A4A'>" + params.title + "</span><br /><span class='thin' style='font-size:22px;line-height: 30px;'>" + params.message + "</span>";
//Display title and message only if they are provided in notification parameters
message ="";
if (params.title) {
message += "<span class='light' style='line-height: 35px; font-size:30px' color='#4A4A4A'>" + params.title + "</span>"
}
if (params.message) {
if (message != ""){
message += "<br />";
}

message += "<span class='thin' style='font-size:22px;line-height: 30px;'>" + params.message + "</span>";
}

//Store alert in this.alerts
this.alerts[sender.name] = new NotificationFx({
message: image + message,
Expand Down
35 changes: 35 additions & 0 deletions modules/default/clock/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,40 @@ The following properties can be configured:
<br><b>Default value:</b> <code>false</code>
</td>
</tr>
<tr>
<td><code>displayType</code></td>
<td>Display a digital clock, analog clock, or both together.<br>
<br><b>Possible values:</b> <code>digital</code>, <code>analog</code>, or <code>both</code>
<br><b>Default value:</b> <code>digital</code>
</td>
</tr>
<tr>
<td><code>analogSize</code></td>
<td><strong>Specific to the analog clock.</strong> Defines how large the analog display is.<br>
<br><b>Possible values:</b> A positive number of pixels</code>
<br><b>Default value:</b> <code>200px</code>
</td>
</tr>
<tr>
<td><code>analogFace</code></td>
<td><strong>Specific to the analog clock.</strong> Specifies which clock face to use.<br>
<br><b>Possible values:</b> <code>simple</code> for a simple border, <code>none</code> for no face or border, or <code>face-###</code> (where ### is currently a value between 001 and 012, inclusive)
<br><b>Default value:</b> <code>simple</code>
</td>
</tr>
<tr>
<td><code>secondsColor</code></td>
<td><strong>Specific to the analog clock.</strong> Specifies what color to make the 'seconds' hand.<br>
<br><b>Possible values:</b> <code>any HTML RGB Color</code>
<br><b>Default value:</b> <code>#888888</code>
</td>
</tr>
<tr>
<td><code>analogPlacement</code></td>
<td><strong>Specific to the analog clock. <em>(requires displayType set to <code>'both'</code>)</em></strong> Specifies where the analog clock is in relation to the digital clock<br>
<br><b>Possible values:</b> <code>top</code>, <code>right</code>, <code>bottom</code>, or <code>left</code>
<br><b>Default value:</b> <code>bottom</code>
</td>
</tr>
</tbody>
</table>
142 changes: 137 additions & 5 deletions modules/default/clock/clock.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,51 @@
Module.register("clock",{
// Module config defaults.
defaults: {
displayType: 'digital', // options: digital, analog, both

timeFormat: config.timeFormat,
displaySeconds: true,
showPeriod: true,
showPeriodUpper: false,
clockBold: false
clockBold: false,

/* specific to the analog clock */
analogSize: '200px',
analogFace: 'simple', // options: 'none', 'simple', 'face-###' (where ### is 001 to 012 inclusive)
analogPlacement: 'bottom', // options: top, bottom, left, right
secondsColor: '#888888',
},
// Define required scripts.
getScripts: function() {
return ["moment.js"];
},
// Define styles.
getStyles: function() {
return ["clock_styles.css"];
},
// Define start sequence.
start: function() {
Log.info("Starting module: " + this.name);

// Schedule update interval.
var self = this;
setInterval(function() {
self.updateDom();
}, 1000);

// Set locale.
moment.locale(config.language);

},
// Override dom generator.
getDom: function() {
// Create wrappers.

var wrapper = document.createElement("div");

/************************************
* Create wrappers for DIGITAL clock
*/

var dateWrapper = document.createElement("div");
var timeWrapper = document.createElement("div");
var secondsWrapper = document.createElement("sup");
Expand Down Expand Up @@ -72,15 +92,127 @@ Module.register("clock",{
} else {
periodWrapper.innerHTML = moment().format("a");
}
// Combine wrappers.
wrapper.appendChild(dateWrapper);
wrapper.appendChild(timeWrapper);
if (this.config.displaySeconds) {
timeWrapper.appendChild(secondsWrapper);
}
if (this.config.showPeriod && this.config.timeFormat !== 24) {
timeWrapper.appendChild(periodWrapper);
}
if (this.config.displaySeconds) {
timeWrapper.appendChild(secondsWrapper);
}
if (this.config.showPeriod && this.config.timeFormat !== 24) {
timeWrapper.appendChild(periodWrapper);
}

/****************************************************************
* Create wrappers for ANALOG clock, only if specified in config
*/

if (this.config.displayType !== 'digital') {
// If it isn't 'digital', then an 'analog' clock was also requested

// Calculate the degree offset for each hand of the clock
var now = moment(),
second = now.seconds() * 6,
minute = now.minute() * 6 + second / 60,
hour = ((now.hours() % 12) / 12) * 360 + 90 + minute / 12;

// Create wrappers
var wrapper = document.createElement("div");
var clockCircle = document.createElement("div");
clockCircle.className = "clockCircle";
clockCircle.style.width = this.config.analogSize;
clockCircle.style.height = this.config.analogSize;

if (this.config.analogFace != '' && this.config.analogFace != 'simple' && this.config.analogFace != 'none') {
clockCircle.style.background = "url("+ this.data.path + "faces/" + this.config.analogFace + ".svg)";
clockCircle.style.backgroundSize = "100%";
} else if (this.config.analogFace != 'none') {
clockCircle.style.border = "2px solid white";
}
var clockFace = document.createElement("div");
clockFace.className = "clockFace";

var clockHour = document.createElement("div");
clockHour.id = "clockHour";
clockHour.style.transform = "rotate(" + hour + "deg)";
clockHour.className = "clockHour";
var clockMinute = document.createElement("div");
clockMinute.id = "clockMinute";
clockMinute.style.transform = "rotate(" + minute + "deg)";
clockMinute.className = "clockMinute";

// Combine analog wrappers
clockFace.appendChild(clockHour);
clockFace.appendChild(clockMinute);

if (this.config.displaySeconds) {
var clockSecond = document.createElement("div");
clockSecond.id = "clockSecond";
clockSecond.style.transform = "rotate(" + second + "deg)";
clockSecond.className = "clockSecond";
clockSecond.style.backgroundColor = this.config.secondsColor;
clockFace.appendChild(clockSecond);
}
clockCircle.appendChild(clockFace);
}

/*******************************************
* Combine wrappers, check for .displayType
*/

if (this.config.displayType === 'digital') {
// Display only a digital clock
wrapper.appendChild(dateWrapper);
wrapper.appendChild(timeWrapper);
} else if (this.config.displayType === 'analog') {
// Display only an analog clock
dateWrapper.style.textAlign = "center";
dateWrapper.style.paddingBottom = "15px";
wrapper.appendChild(dateWrapper);
wrapper.appendChild(clockCircle);
} else {
// Both clocks have been configured, check position
var placement = this.config.analogPlacement;

analogWrapper = document.createElement("div");
analogWrapper.id = "analog";
analogWrapper.style.cssFloat = "none";
analogWrapper.appendChild(clockCircle);
digitalWrapper = document.createElement("div");
digitalWrapper.id = "digital";
digitalWrapper.style.cssFloat = "none";
digitalWrapper.appendChild(dateWrapper);
digitalWrapper.appendChild(timeWrapper);

if (placement === 'left' || placement === 'right') {
digitalWrapper.style.display = "inline-block";
digitalWrapper.style.verticalAlign = "top";
analogWrapper.style.display = "inline-block";
if (placement === 'left') {
analogWrapper.style.padding = "0 20px 0 0";
wrapper.appendChild(analogWrapper);
wrapper.appendChild(digitalWrapper);
} else {
analogWrapper.style.padding = "0 0 0 20px";
wrapper.appendChild(digitalWrapper);
wrapper.appendChild(analogWrapper);
}
} else {
digitalWrapper.style.textAlign = "center";
if (placement === 'top') {
analogWrapper.style.padding = "0 0 20px 0";
wrapper.appendChild(analogWrapper);
wrapper.appendChild(digitalWrapper);
} else {
analogWrapper.style.padding = "20px 0 0 0";
wrapper.appendChild(digitalWrapper);
wrapper.appendChild(analogWrapper);
}
}
}

// Return the wrapper to the dom.
return wrapper;
}
Expand Down
74 changes: 74 additions & 0 deletions modules/default/clock/clock_styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#analog {
}

#digital {
}

.clockCircle {
margin: 0 auto;
position: relative;
border-radius: 50%;
background-size: 100%;
}

.clockFace {
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;
}

.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;
}

.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;
}

.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%;
}
1 change: 1 addition & 0 deletions modules/default/clock/faces/face-001.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions modules/default/clock/faces/face-002.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading