Skip to content

Commit

Permalink
Merge pull request #9 from plouc/mozaik-2
Browse files Browse the repository at this point in the history
Add support for Mozaik v2
  • Loading branch information
Raphaël Benitte committed Aug 1, 2017
2 parents ac36eb2 + c6ba5ea commit 9b61b14
Show file tree
Hide file tree
Showing 54 changed files with 6,237 additions and 494 deletions.
5 changes: 1 addition & 4 deletions .babelrc
@@ -1,6 +1,3 @@
{
"presets": [
"es2015",
"react"
]
"presets": ["@mozaik/babel-preset"]
}
63 changes: 0 additions & 63 deletions .eslintrc

This file was deleted.

11 changes: 11 additions & 0 deletions .eslintrc.yml
@@ -0,0 +1,11 @@
parser: babel-eslint
parserOptions:
ecmaVersion: 6
sourceType: module
ecmaFeatures:
jsx: true
env:
browser: true
extends:
- eslint:recommended
- plugin:react/recommended
File renamed without changes.
1 change: 1 addition & 0 deletions ISSUE_TEMPLATE.md → .github/ISSUE_TEMPLATE.md
Expand Up @@ -2,6 +2,7 @@ item | info | notes
----------------------------|------------|---------------------------------------------------------------------------------------------
**node** version | | *output from `node --version`*
**npm** version | | *output from `npm --version`*
**yarn** version | | *output from `yarn --version`*
**mozaik-ext-time** version | | *available in project's `package.json`*
**mozaik** version | | *available in project's `package.json`*
**mozaik-demo** version | | *version of the demo used, depends on which method you used to setup your Mozaïk dashboard*
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
@@ -1,3 +1,5 @@
/lib
/es
.DS_Store
node_modules
npm-debug.log*
Expand Down
34 changes: 27 additions & 7 deletions .npmignore
@@ -1,9 +1,29 @@
test
preview
# Doc
/preview

# config
.babelrc
.eslintrc.yml
.gitignore
.npmignore
.travis.yml
.eslintrc
npm-debug.log*
.nyc_output
coverage

# Logs
*.log*

# Non transpiled source code
/src

# Tests
/test
/.nyc_output
/coverage

# GitHub
/.github

# OSX
.DS_Store
ISSUE_TEMPLATE.md

# IDE
.idea
15 changes: 7 additions & 8 deletions .travis.yml
@@ -1,12 +1,11 @@
language: node_js
node_js:
- '0.12'
- '4'
- '5'
before_install:
- npm install -g npm
- '6'
- '7'
- '8'
script:
- npm run eslint
- npm run test-cover
- yarn run lint
- yarn run fmt:check
- yarn run test:cover
after_success:
- npm run coveralls
- yarn run coverage
2 changes: 1 addition & 1 deletion LICENSE.md
@@ -1,4 +1,4 @@
Copyright (c) 2015-2016 Raphaël Benitte
Copyright (c) 2016-today Raphaël Benitte

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
Expand Down
113 changes: 90 additions & 23 deletions README.md
Expand Up @@ -7,11 +7,14 @@
[![Coverage Status][coverage-image]][coverage-url]
![widget count][widget-count-image]

> :warning: This branch holds the code for Mozaïk v2, if you're looking for v1,
> please have a look at the [dedicated branch](https://github.com/plouc/mozaik-ext-time/tree/mozaik-1).
## Time — Clock

> Show analog clock from local or another timezone.
![clock](https://raw.githubusercontent.com/plouc/mozaik-ext-time/master/preview/time.clock.png)
![clock](https://raw.githubusercontent.com/plouc/mozaik-ext-time/mozaik-2/preview/time.clock.png)

### parameters

Expand All @@ -25,35 +28,99 @@ key | required | description

### usage

```javascript
{
type: 'time.clock',
info: 'date',
columns: 1, rows: 1, x: 0, y: 0
},
{
type: 'time.clock',
timezone: 'America/Los_Angeles',
info: 'timezone',
sunRise: '6:30',
sunSet: '17:43',
columns: 1, rows: 1, x: 1, y: 0
},
{
type: 'time.clock',
info: 'Time is money!',
columns: 1, rows: 1, x: 2, y: 0
}
``` yaml
#
# Displaying date info
#
- extension: time
widget: Clock
info: date
columns: 1
rows: 1
x: 0
y: 0

#
# Displaying timezone info
#
- extension: time
widget: Clock
info: timezone
timezone: America/Los_Angeles
columns: 1
rows: 1
x: 1
y: 0

#
# Displaying custom info
#
- extension: time
widget: Clock
info: Time is money!
columns: 1
rows: 1
x: 2
y: 0
```


## Time — DigitalClock

> Show digital clock from local or another timezone.
![clock](https://raw.githubusercontent.com/plouc/mozaik-ext-time/mozaik-2/preview/time.digital_clock.png)

### parameters

key | required | default | description
-----------------|----------|---------|------------------------------------------
`displayDate` | no | `true` | *Enable/disable date display.*
`displaySeconds` | no | `true` | *Enable/disable seconds display.*
`timezone` | no |  | *Name of the timezone, like `America/Los_Angeles`. See http://momentjs.com/timezone/ for possible values. Defaults to local time.*

### usage

``` yaml
- extension: time
widget: DigitalClock
columns: 1
rows: 1
x: 0
y: 0

#
# Disabling time seconds
#
- extension: time
widget: DigitalClock
displaySeconds: false
columns: 1
rows: 1
x: 1
y: 0

#
# Disabling date
#
- extension: time
widget: DigitalClock
displayDate: false
columns: 1
rows: 1
x: 2
y: 0
```


[license-image]: https://img.shields.io/github/license/plouc/mozaik-ext-time.svg?style=flat-square
[license-url]: https://github.com/plouc/mozaik-ext-time/blob/master/LICENSE.md
[travis-image]: https://img.shields.io/travis/plouc/mozaik-ext-time.svg?style=flat-square
[travis-url]: https://travis-ci.org/plouc/mozaik-ext-time
[npm-image]: https://img.shields.io/npm/v/mozaik-ext-time.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/mozaik-ext-time
[npm-image]: https://img.shields.io/npm/v/@mozaik/ext-time.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/@mozaik/ext-time
[gemnasium-image]: https://img.shields.io/gemnasium/plouc/mozaik-ext-time.svg?style=flat-square
[gemnasium-url]: https://gemnasium.com/plouc/mozaik-ext-time
[coverage-image]: https://img.shields.io/coveralls/plouc/mozaik-ext-time.svg?style=flat-square
[coverage-url]: https://coveralls.io/github/plouc/mozaik-ext-time
[widget-count-image]: https://img.shields.io/badge/widgets-x1-green.svg?style=flat-square
[widget-count-image]: https://img.shields.io/badge/widgets-x2-green.svg?style=flat-square

0 comments on commit 9b61b14

Please sign in to comment.