Skip to content

Commit

Permalink
0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
trave committed Sep 6, 2018
1 parent e8878f8 commit b2d2a61
Show file tree
Hide file tree
Showing 10 changed files with 194 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.idea
node_modules
.DS_Store
npm-debug.log
4 changes: 4 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.DS_Store
node_modules
*.orig
.idea
Empty file removed README.md
Empty file.
15 changes: 15 additions & 0 deletions lib/about.css
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;
}
98 changes: 98 additions & 0 deletions lib/about.js
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
];
12 changes: 12 additions & 0 deletions lib/about.jst
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>
Binary file added lib/about.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions package.json
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"
}
17 changes: 17 additions & 0 deletions readme.md
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);
};
```
39 changes: 39 additions & 0 deletions zombiebox-extension.js
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;

0 comments on commit b2d2a61

Please sign in to comment.