Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Bump Spark apps
Browse files Browse the repository at this point in the history
  • Loading branch information
spark-bot committed May 29, 2015
1 parent 8f07673 commit e6dc0f4
Show file tree
Hide file tree
Showing 88 changed files with 4,131 additions and 2,407 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,14 @@ define(["exports", "components/fxos-mvc/dist/mvc", "gaia-component", "js/view/ma

MainController.prototype.main = function () {
this.view.render();
this.listController.main();
this.dialog = document.querySelector("fxos-dev-mode-dialog");

// fxos-dev-mode-dialog checks and emit event 'enabled' when
// device dev mode perf is set to true. Continue to load
// list of apps inside dialog enabled event handler.
this.dialog.addEventListener("enabled", function () {
this.listController.main();
}.bind(this));
};

return MainController;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
define(["exports"], function (exports) {
"use strict";

(function (window) {
"use strict";

var template = "<style>\n.modal-dialog {\n background: #2d2d2d;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n overflow: hidden;\n z-index: 100;\n}\n.modal-dialog > section {\n color: #FAFAFA;\n padding: 80px 25px 0;\n -moz-box-sizing: padding-box;\n font-size: 22px;\n line-height: 30px;\n font-weight: 300;\n width: 100%;\n display: inline-block;\n overflow-y: scroll;\n max-height: 100%;\n vertical-align: middle;\n}\n.modal-dialog h1 {\n font-size: 19px;\n font-weight: 400;\n line-height: 28px;\n color: #fff;\n margin: 0;\n padding-top: 10px;\n}\n/* Menu & buttons setup */\n.modal-dialog menu {\n padding: 15px;\n background: #4d4d4d;\n display: flex;\n overflow: hidden;\n position: absolute;\n left: 0;\n right: 0;\n bottom: 0;\n margin: 0;\n}\n.modal-dialog p {\n word-wrap: break-word;\n margin: 10px 0 0;\n padding: 10px 0;\n border-top: 0.1rem solid #686868;\n line-height: 30px;\n}\n.modal-dialog p > span {\n padding-top: 25px;\n display: block;\n}\n.modal-dialog menu button {\n font-family: sans-serif;\n font-style: italic;\n width: 100%;\n height: 40px;\n margin: 0 0 10px;\n padding: 0 2px;\n font-size: 16px;\n line-height: 40px;\n -moz-box-sizing: border-box;\n display: inline-block;\n vertical-align: middle;\n background: #d8d8d8;\n border: none;\n border-radius: 20px;\n color: #333;\n text-align: center;\n -moz-margin-end: 10px;\n}\n/* Pressed */\n.modal-dialog menu button:active {\n background: #00aacc;\n color: #fff;\n}\n.modal-dialog menu button:last-child {\n -moz-margin-end: 0;\n}\n.hidden {\n display: none;\n}\n</style>\n<div class=\"modal-dialog hidden\">\n <section>\n <h1>Developer Mode not enabled</h1>\n <p>To gain access to this and other customization features,\n you must enable Developer Mode.\n <span>Click Continue to go to Settings app and enable Developer Mode.</span>\n </p>\n </section>\n <menu>\n <button class=\"cancel\">Cancel</button>\n <button class=\"continue\">Continue</button>\n </menu>\n</div>";

var proto = Object.create(HTMLElement.prototype);

proto.createdCallback = function () {
var _this = this;
this.shadow = this.createShadowRoot();
this.shadow.innerHTML = template;
this.modalDialog = this.shadow.querySelector(".modal-dialog");
this.cancelButton = this.shadow.querySelector(".cancel");
this.continueButton = this.shadow.querySelector(".continue");

this.cancelButton.addEventListener("click", this.handleCancel.bind(this));
this.continueButton.addEventListener("click", this.handleContinue.bind(this));

// If dev mode perf is enabled emit 'enabled' event else
// show the confirm modal dialog
navigator.getFeature("dom.apps.developer_mode").then(function (enabled) {
if (enabled) {
// Emit Enabled Event
_this.dispatchEvent(new CustomEvent("enabled"));
} else {
_this.modalDialog.classList.remove("hidden");
}
});
};

proto.handleCancel = function (e) {
window.close();
};

proto.handleContinue = function (e) {
// Invoke Settings activity
// XXX: Bug 1163889
window.alert("Open Settings App once Bug 1163889 is resolved. Until then run script" + " at https://github.com/fxos/lightsaber#enable-developer-mode");
};

try {
document.registerElement("fxos-dev-mode-dialog", { prototype: proto });
} catch (e) {
if (e.name !== "NotSupportedError") {
throw e;
}
}
})(window);
});
4 changes: 2 additions & 2 deletions distros/spark/apps/customizer-launcher/js/view/main_view.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
define(["exports", "components/fxos-mvc/dist/mvc", "components/gaia-header/dist/gaia-header"], function (exports, _componentsFxosMvcDistMvc, _componentsGaiaHeaderDistGaiaHeader) {
define(["exports", "components/fxos-mvc/dist/mvc", "components/gaia-header/dist/gaia-header", "js/element/fxos-dev-mode-dialog"], function (exports, _componentsFxosMvcDistMvc, _componentsGaiaHeaderDistGaiaHeader, _jsElementFxosDevModeDialog) {
"use strict";

var _extends = function (child, parent) {
Expand Down Expand Up @@ -26,7 +26,7 @@ define(["exports", "components/fxos-mvc/dist/mvc", "components/gaia-header/dist/
};

MainView.prototype.template = function () {
var string = "\n <gaia-header>\n <h1>Customizer Launcher</h1>\n </gaia-header>";
var string = "\n <gaia-header>\n <h1>Customizer Launcher</h1>\n </gaia-header>\n <fxos-dev-mode-dialog></fxos-dev-mode-dialog>";
return string;
};

Expand Down
3 changes: 2 additions & 1 deletion distros/spark/apps/customizer-launcher/manifest.webapp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
},
"permissions": {
"webapps-manage": {},
"tcp-socket": {}
"tcp-socket": {},
"feature-detection": {}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gaia-dialog",
"version": "0.0.6",
"version": "0.0.7",
"homepage": "https://github.com/gaia-components/gaia-dialog",
"authors": [
"Wilson Page <wilsonpage@me.com>"
Expand All @@ -18,6 +18,6 @@
],
"dependencies": {
"gaia-text-input": "gaia-components/gaia-text-input",
"gaia-icons": "gaia-components/gaia-icons#~0.7.4"
"gaia-icons": "gaia-components/gaia-icons#~0.8.0"
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gaia-header",
"version": "0.8.2",
"version": "0.8.3",
"homepage": "https://github.com/gaia-components/gaia-header",
"authors": [
"Wilson Page <wilsonpage@me.com>"
Expand All @@ -18,7 +18,7 @@
"README.md"
],
"dependencies": {
"gaia-icons": "gaia-components/gaia-icons#~0.7.11",
"gaia-icons": "gaia-components/gaia-icons#~0.8.0",
"gaia-component": "gaia-components/gaia-component#~0.3.0",
"font-fit": "gaia-components/font-fit#~0.3.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,14 @@ c(require,exports,module);}:function(c){var m={exports:{}};c(function(n){
return w[n];},m.exports,m);w[n]=m.exports;};})('font-fit',this));

},{}],2:[function(require,module,exports){
/* jshint node:true */
/* globals define */
;(function(define){'use strict';define(function(require,exports,module){
;(function(define){define(function(require,exports,module){
'use strict';

/**
* Locals
*/

var textContent = Object.getOwnPropertyDescriptor(Node.prototype,
'textContent');
var textContent = Object.getOwnPropertyDescriptor(Node.prototype, 'textContent');
var innerHTML = Object.getOwnPropertyDescriptor(Element.prototype, 'innerHTML');
var removeAttribute = Element.prototype.removeAttribute;
var setAttribute = Element.prototype.setAttribute;
Expand Down Expand Up @@ -180,7 +179,7 @@ exports.register = function(name, props) {

// Merge base getter/setter attributes with the user's,
// then define the property descriptors on the prototype.
var descriptors = mixin(props.attrs || {}, base.descriptors);
var descriptors = Object.assign(props.attrs || {}, base.descriptors);

// Store the orginal descriptors somewhere
// a little more private and delete the original
Expand Down Expand Up @@ -295,9 +294,7 @@ var base = {
if (this.lightStyle) { this.appendChild(this.lightStyle); }
},

get: function() {
return textContent.get();
}
get: textContent.get
},

innerHTML: {
Expand Down Expand Up @@ -330,8 +327,9 @@ var defaultPrototype = createProto(HTMLElement.prototype, base.properties);
function getBaseProto(proto) {
if (!proto) { return defaultPrototype; }
proto = proto.prototype || proto;
return !proto.GaiaComponent ?
createProto(proto, base.properties) : proto;
return !proto.GaiaComponent
? createProto(proto, base.properties)
: proto;
}

/**
Expand All @@ -343,7 +341,7 @@ function getBaseProto(proto) {
* @return {Object}
*/
function createProto(proto, props) {
return mixin(Object.create(proto), props);
return Object.assign(Object.create(proto), props);
}

/**
Expand Down Expand Up @@ -421,11 +419,11 @@ function processCss(template, name) {
* @param {String} css
*/
function injectGlobalCss(css) {
if (!css) {return;}
if (!css) return;
var style = document.createElement('style');
style.innerHTML = css.trim();
headReady().then(function() {
document.head.appendChild(style);
headReady().then(() => {
document.head.appendChild(style)
});
}

Expand All @@ -436,7 +434,7 @@ function injectGlobalCss(css) {
* @private
*/
function headReady() {
return new Promise(function(resolve) {
return new Promise(resolve => {
if (document.head) { return resolve(); }
window.addEventListener('load', function fn() {
window.removeEventListener('load', fn);
Expand Down Expand Up @@ -516,22 +514,6 @@ function addDirObserver() {
}
}

/**
* Copy the values of all properties from
* source object `target` to a target object `source`.
* It will return the target object.
*
* @param {Object} target
* @param {Object} source
* @returns {Object}
*/
function mixin(target, source) {
for (var key in source) {
target[key] = source[key];
}
return target;
}

});})(typeof define=='function'&&define.amd?define
:(function(n,w){'use strict';return typeof module=='object'?function(c){
c(require,exports,module);}:function(c){var m={exports:{}};c(function(n){
Expand Down Expand Up @@ -578,12 +560,12 @@ c(require,exports,module);}:function(c){var m={exports:{}};c(function(n){
return w[n];},m.exports,m);w[n]=m.exports;};})('gaia-icons',this));

},{}],4:[function(require,module,exports){
/* globals define */
;(function(define){'use strict';define(function(require,exports,module){

/**
* Dependencies
*/

var component = require('gaia-component');
var fontFit = require('font-fit');

Expand Down Expand Up @@ -636,11 +618,11 @@ const MINIMUM_FONT_SIZE_CENTERED = 20;
* This is the minimum font size that we can take
* when the header title is not centered in the window.
*/
const MINIMUM_FONT_SIZE_UNCENTERED = 18;
const MINIMUM_FONT_SIZE_UNCENTERED = 16;

/**
* This is the maximum font size that we can use for
* the heade title.
* This is the maximum font-size
* for the header title.
*/
const MAXIMUM_FONT_SIZE = 23;

Expand Down Expand Up @@ -671,7 +653,8 @@ module.exports = component.register('gaia-header', {
};

// Events
this.els.actionButton.addEventListener('click', e => this.onActionButtonClick(e));
this.els.actionButton.addEventListener('click',
e => this.onActionButtonClick(e));
this.observer = new MutationObserver(this.onMutation.bind(this));

// Properties
Expand Down Expand Up @@ -856,7 +839,8 @@ module.exports = component.register('gaia-header', {

// Return existing unresolved
// promise, or make a new one
return this.unresolved[key] = this.unresolved[key] || new Promise((resolve) => {
if (this.unresolved[key]) { return this.unresolved[key]; }
this.unresolved[key] = new Promise((resolve) => {
this.pending[key] = this.nextTick(() => {
var styles = this._titleStyles;
var els = this.els.titles;
Expand Down Expand Up @@ -1033,9 +1017,8 @@ module.exports = component.register('gaia-header', {
* @private
*/
getWidth: function() {
var value = this.notFlush
? this.clientWidth
: window.innerWidth;
var value = this.notFlush ?
this.clientWidth : window.innerWidth;

debug('get width', value);
return value;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* globals define */
;(function(define){'use strict';define(function(require,exports,module){

/**
* Dependencies
*/

var component = require('gaia-component');
var fontFit = require('font-fit');

Expand Down Expand Up @@ -56,11 +56,11 @@ const MINIMUM_FONT_SIZE_CENTERED = 20;
* This is the minimum font size that we can take
* when the header title is not centered in the window.
*/
const MINIMUM_FONT_SIZE_UNCENTERED = 18;
const MINIMUM_FONT_SIZE_UNCENTERED = 16;

/**
* This is the maximum font size that we can use for
* the heade title.
* This is the maximum font-size
* for the header title.
*/
const MAXIMUM_FONT_SIZE = 23;

Expand Down Expand Up @@ -91,7 +91,8 @@ module.exports = component.register('gaia-header', {
};

// Events
this.els.actionButton.addEventListener('click', e => this.onActionButtonClick(e));
this.els.actionButton.addEventListener('click',
e => this.onActionButtonClick(e));
this.observer = new MutationObserver(this.onMutation.bind(this));

// Properties
Expand Down Expand Up @@ -276,7 +277,8 @@ module.exports = component.register('gaia-header', {

// Return existing unresolved
// promise, or make a new one
return this.unresolved[key] = this.unresolved[key] || new Promise((resolve) => {
if (this.unresolved[key]) { return this.unresolved[key]; }
this.unresolved[key] = new Promise((resolve) => {
this.pending[key] = this.nextTick(() => {
var styles = this._titleStyles;
var els = this.els.titles;
Expand Down Expand Up @@ -453,9 +455,8 @@ module.exports = component.register('gaia-header', {
* @private
*/
getWidth: function() {
var value = this.notFlush
? this.clientWidth
: window.innerWidth;
var value = this.notFlush ?
this.clientWidth : window.innerWidth;

debug('get width', value);
return value;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gaia-icons",
"version": "0.7.12",
"version": "0.8.0",
"homepage": "https://github.com/wilsonpage/gaia-icons",
"authors": [
"Wilson Page <wilsonpage@me.com>"
Expand Down
Binary file not shown.

Large diffs are not rendered by default.

Loading

0 comments on commit e6dc0f4

Please sign in to comment.