-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
194 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.idea | ||
node_modules | ||
.DS_Store | ||
npm-debug.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.DS_Store | ||
node_modules | ||
*.orig | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* About popup | ||
*******************************/ | ||
|
||
.p-zb-about {} | ||
.p-zb-about__container { | ||
width: 360px; | ||
height: 140px; | ||
background: #fff url(about.png) 10px 50% no-repeat; | ||
color: #000; | ||
box-sizing: border-box; | ||
overflow: hidden; | ||
padding: 10px; | ||
padding-left: 120px; | ||
border: 4px solid #A9A9A9; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
goog.provide('zb.popups.About'); | ||
goog.require('zb.ext.about.popups.templates.about'); | ||
goog.require('zb.layers.CutePopup'); | ||
goog.require('zb.packageInfo'); | ||
|
||
|
||
|
||
/** | ||
* @extends {zb.layers.CutePopup} | ||
* @constructor | ||
*/ | ||
zb.popups.About = function() { | ||
goog.base(this); | ||
this._addContainerClass('p-zb-about'); | ||
this._keyProcessCounter = 0; | ||
}; | ||
goog.inherits(zb.popups.About, zb.layers.CutePopup); | ||
|
||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
zb.popups.About.prototype._renderTemplate = function() { | ||
return zb.ext.about.popups.templates.about(this._getTemplateData(), this._getTemplateOptions()); | ||
}; | ||
|
||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
zb.popups.About.prototype._processKey = function() { | ||
if (this._keyProcessCounter > 0) { | ||
this.close(0); | ||
} | ||
this._keyProcessCounter++; | ||
return true; | ||
}; | ||
|
||
|
||
/** | ||
* @type {zb.ext.about.popups.templates.AboutOut} | ||
* @protected | ||
*/ | ||
zb.popups.About.prototype._exported; | ||
|
||
|
||
/** | ||
* @type {number} | ||
* @private | ||
*/ | ||
zb.popups.About.prototype._keyProcessCounter; | ||
|
||
|
||
/** | ||
* @param {Array.<zb.device.input.Keys>} seq | ||
*/ | ||
zb.popups.About.setKeySequence = function(seq) { | ||
zb.popups.About._sequence = seq; | ||
zb.popups.About._currentPosition = 0; | ||
}; | ||
|
||
|
||
/** | ||
* @param {zb.device.input.Keys} zbKey | ||
*/ | ||
zb.popups.About.processKey = function(zbKey) { | ||
var seq = zb.popups.About._sequence; | ||
zb.popups.About._currentPosition = zb.popups.About._currentPosition || 0; | ||
if (seq[zb.popups.About._currentPosition] !== zbKey) { | ||
zb.popups.About._currentPosition = 0; | ||
} else if (zb.popups.About._currentPosition === seq.length - 1) { | ||
app.showChildLayer(zb.popups.About); | ||
} else { | ||
zb.popups.About._currentPosition++; | ||
} | ||
}; | ||
|
||
|
||
/** | ||
* @type {number} | ||
* @private | ||
*/ | ||
zb.popups.About._currentPosition; | ||
|
||
|
||
/** | ||
* Default value is '1235789' like Z | ||
* @type {Array.<zb.device.input.Keys>} | ||
*/ | ||
zb.popups.About._sequence = [ | ||
zb.device.input.Keys.DIGIT_1, | ||
zb.device.input.Keys.DIGIT_2, | ||
zb.device.input.Keys.DIGIT_3, | ||
zb.device.input.Keys.DIGIT_5, | ||
zb.device.input.Keys.DIGIT_7, | ||
zb.device.input.Keys.DIGIT_8, | ||
zb.device.input.Keys.DIGIT_9 | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{{$ zb.ext.about.popups.templates.about }} | ||
|
||
<div class="zb-center"> | ||
<div class="zb-center__cell"> | ||
<div class="zb-center__container p-zb-about__container" data-export-id="{{@content}}"> | ||
Application name: {{- zb.packageInfo.name }}<br> | ||
Application version: {{- zb.packageInfo.version }}<br> | ||
Zombiebox version: {{- zb.packageInfo.dependencies.zombiebox }}<br> | ||
Zombiebox in web: http://zombiebox.net/ | ||
</div> | ||
</div> | ||
</div> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"name": "zombiebox-extension-about", | ||
"version": "0.1.0", | ||
"main": "zombiebox-extension.js" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
|
||
Integration | ||
------- | ||
|
||
Add code like this to your application.js | ||
|
||
```javascript | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
yourApp.Application.prototype.processKey = function(zbKey, e) { | ||
zb.popups.About.processKey(zbKey); | ||
|
||
return goog.base(this, 'processKey', zbKey, e); | ||
}; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
var path = require('path'); | ||
|
||
|
||
/** | ||
* @implements {IZBAddon} | ||
*/ | ||
var extension = function() { | ||
|
||
}; | ||
|
||
|
||
/** | ||
* @return {string} | ||
*/ | ||
extension.prototype.getName = function() { | ||
return 'about'; | ||
}; | ||
|
||
|
||
/** | ||
* @return {string} | ||
*/ | ||
extension.prototype.getPublicDir = function() { | ||
return path.join(__dirname, 'lib'); | ||
}; | ||
|
||
|
||
/** | ||
* @return {Object} | ||
*/ | ||
extension.prototype.getConfig = function() { | ||
return {}; | ||
}; | ||
|
||
|
||
/** | ||
* @type {IZBAddon} | ||
*/ | ||
module.exports = extension; |