From 104584767b3afc346a6e61626d19e6b688110512 Mon Sep 17 00:00:00 2001 From: Oliver Wise Date: Mon, 4 Apr 2016 11:38:02 -0700 Subject: [PATCH] show update page on first install :see_no_evil: rename jpm script --- .jpmignore | 6 ++++++ README.md | 2 +- data/js/popup.js | 53 +++++++++++++++++++++++++++++++++++++++--------- index.js | 9 +++++++- package.json | 4 ++-- 5 files changed, 60 insertions(+), 14 deletions(-) diff --git a/.jpmignore b/.jpmignore index c8c2cc4..1f183d5 100644 --- a/.jpmignore +++ b/.jpmignore @@ -1,3 +1,9 @@ node_modules/ .git +.gitignore +**.swp +**.DS_Store !node_modules/ramda/* +node_modules/ramda/.eslintignore +node_modules/ramda/.jshintignore +node_modules/ramda/.eslintrc diff --git a/README.md b/README.md index d4dba25..2d2d771 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ Then open `data/popup.html` in a browser #### To run extension in the browser: ``` -npm run run +npm run jpm ``` #### How it currently works diff --git a/data/js/popup.js b/data/js/popup.js index 58b90e1..7e0549a 100644 --- a/data/js/popup.js +++ b/data/js/popup.js @@ -16300,7 +16300,10 @@ var ReactDOMOption = { } }); - nativeProps.children = content; + if (content) { + nativeProps.children = content; + } + return nativeProps; } @@ -22469,7 +22472,7 @@ module.exports = ReactUpdates; 'use strict'; -module.exports = '0.14.6'; +module.exports = '0.14.7'; },{}],88:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. @@ -23564,6 +23567,7 @@ var warning = require('fbjs/lib/warning'); */ var EventInterface = { type: null, + target: null, // currentTarget is set when dispatching; no use in copying it here currentTarget: emptyFunction.thatReturnsNull, eventPhase: null, @@ -23597,8 +23601,6 @@ function SyntheticEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEvent this.dispatchConfig = dispatchConfig; this.dispatchMarker = dispatchMarker; this.nativeEvent = nativeEvent; - this.target = nativeEventTarget; - this.currentTarget = nativeEventTarget; var Interface = this.constructor.Interface; for (var propName in Interface) { @@ -23609,7 +23611,11 @@ function SyntheticEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEvent if (normalize) { this[propName] = normalize(nativeEvent); } else { - this[propName] = nativeEvent[propName]; + if (propName === 'target') { + this.target = nativeEventTarget; + } else { + this[propName] = nativeEvent[propName]; + } } } @@ -27475,6 +27481,8 @@ module.exports = require('./lib/React'); },{"./lib/React":27}],160:[function(require,module,exports){ 'use strict'; +var has = Object.prototype.hasOwnProperty; + // // We store our EE objects in a plain object whose properties are event names. // If `Object.create(null)` is not supported we prefix the event names with a @@ -27490,7 +27498,7 @@ var prefix = typeof Object.create !== 'function' ? '~' : false; * * @param {Function} fn Event handler to be called. * @param {Mixed} context Context for function execution. - * @param {Boolean} once Only emit once + * @param {Boolean} [once=false] Only emit once * @api private */ function EE(fn, context, once) { @@ -27509,13 +27517,38 @@ function EE(fn, context, once) { function EventEmitter() { /* Nothing to set */ } /** - * Holds the assigned EventEmitters by name. + * Hold the assigned EventEmitters by name. * * @type {Object} * @private */ EventEmitter.prototype._events = undefined; +/** + * Return an array listing the events for which the emitter has registered + * listeners. + * + * @returns {Array} + * @api public + */ +EventEmitter.prototype.eventNames = function eventNames() { + var events = this._events + , names = [] + , name; + + if (!events) return names; + + for (name in events) { + if (has.call(events, name)) names.push(prefix ? name.slice(1) : name); + } + + if (Object.getOwnPropertySymbols) { + return names.concat(Object.getOwnPropertySymbols(events)); + } + + return names; +}; + /** * Return a list of assigned event listeners. * @@ -27601,8 +27634,8 @@ EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) { * Register a new EventListener for the given event. * * @param {String} event Name of the event. - * @param {Functon} fn Callback function. - * @param {Mixed} context The context of the function. + * @param {Function} fn Callback function. + * @param {Mixed} [context=this] The context of the function. * @api public */ EventEmitter.prototype.on = function on(event, fn, context) { @@ -27626,7 +27659,7 @@ EventEmitter.prototype.on = function on(event, fn, context) { * * @param {String} event Name of the event. * @param {Function} fn Callback function. - * @param {Mixed} context The context of the function. + * @param {Mixed} [context=this] The context of the function. * @api public */ EventEmitter.prototype.once = function once(event, fn, context) { diff --git a/index.js b/index.js index 255a91a..3b9972a 100644 --- a/index.js +++ b/index.js @@ -3,6 +3,7 @@ const { defer } = require('sdk/core/promise') var ss = require("sdk/simple-storage") var pageMod = require("sdk/page-mod") var data = require("sdk/self").data +var tabs = require('sdk/tabs') var { ToggleButton } = require('sdk/ui/button/toggle') var panels = require("sdk/panel") var self = require("sdk/self") @@ -92,7 +93,6 @@ function communication (worker){ worker.port.emit('exhibitionError', true) } }) - }) } @@ -155,5 +155,12 @@ function go(){ } } }) + + // installed for the first time? + if (!ss.storage.lastOpen) { + ss.storage.lastOpen = Date.now() + tabs.open('http://add-art.org/update') + } + } diff --git a/package.json b/package.json index 04656b8..945ad58 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "title": "Add-Art", "name": "add-art", - "version": "2.2.0", + "version": "2.2.2", "id" : "development@add-art.org", "description": "Replace ads with art.", "main": "index.js", @@ -12,7 +12,7 @@ "scripts": { "watch": "watchify -t [ babelify --presets react ] src/popup.js -o data/js/popup.js", "build": "browserify -t [ babelify --presets react ] src/popup.js -o data/js/popup.js", - "run" : "npm run build; jpm run" + "jpm" : "npm run build; jpm run" }, "license": "GPL-3.0", "keywords": [