You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ripple.apache.org by gt...@apache.org on 2013/11/01 02:27:10 UTC

git commit: Removed chrome extension building

Updated Branches:
  refs/heads/next 65eab48da -> a5287cc8f


Removed chrome extension building

Cleaned up lint and removed the extension building. Also removed the
cleanBody stuff as that only matters in the extension since we don't
inject ripple into the current document in hosted.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ripple/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ripple/commit/a5287cc8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ripple/tree/a5287cc8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ripple/diff/a5287cc8

Branch: refs/heads/next
Commit: a5287cc8f6345d776c00ae26268540c3c0683bc8
Parents: 65eab48
Author: Gord Tanner <gt...@gmail.com>
Authored: Thu Oct 31 21:26:21 2013 -0400
Committer: Gord Tanner <gt...@gmail.com>
Committed: Thu Oct 31 21:26:21 2013 -0400

----------------------------------------------------------------------
 build/build.js                                  | 16 +---
 build/lint.js                                   |  2 +-
 build/targets/chrome.extension.js               | 80 -------------------
 build/targets/rim.chrome.extension.js           | 81 --------------------
 lib/client/bootstrap.js                         | 15 ----
 .../cordova/3.0.0/bridge/inappbrowser.js        |  7 +-
 .../platform/cordova/3.0.0/spec/config.js       |  2 +-
 lib/server/emulate.js                           |  2 -
 lib/server/emulate/cordovaProject.js            | 10 +--
 lib/server/emulate/hosted.js                    |  6 +-
 lib/server/emulate/static.js                    |  2 +-
 11 files changed, 16 insertions(+), 207 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ripple/blob/a5287cc8/build/build.js
----------------------------------------------------------------------
diff --git a/build/build.js b/build/build.js
index 2925065..67c4001 100644
--- a/build/build.js
+++ b/build/build.js
@@ -25,7 +25,6 @@ var fs = require('fs'),
     clean = require('./clean'),
     _c = require('./conf'),
     compress = require('./compress'),
-    chromeExt = require('./targets/chrome.extension'),
     hosted = require('./targets/hosted');
 
 function _done(error) {
@@ -54,19 +53,8 @@ module.exports = _handle(function (ext, opts) {
     opts = opts || {};
 
     var build = jWorkflow.order(clean)
-                         .andThen(pack);
-
-    switch (ext) {
-    case 'chrome.extension':
-        build.andThen(chromeExt);
-        break;
-    case 'hosted':
-        build.andThen(hosted);
-        break;
-    default:
-        build.andThen(chromeExt)
-             .andThen(hosted);
-    }
+                         .andThen(pack)
+                         .andThen(hosted);
 
     if (opts.compress) {
         build.andThen(compress);

http://git-wip-us.apache.org/repos/asf/incubator-ripple/blob/a5287cc8/build/lint.js
----------------------------------------------------------------------
diff --git a/build/lint.js b/build/lint.js
index 4535974..338f364 100644
--- a/build/lint.js
+++ b/build/lint.js
@@ -52,7 +52,7 @@ function _lintCSS(files, done) {
 }
 
 module.exports = function (done, files) {
-    var cssDirs = ["assets/client/ripple.css", "targets/chrome.extension/styles", "lib/client", "assets/server", "test"];
+    var cssDirs = ["assets/client/ripple.css", "lib/client", "assets/server", "test"];
     _lintJS(files && files.length > 0 ? files : ["."], function (jscode) {
         _lintCSS(files && files.length > 0 ? files : cssDirs, function (csscode) {
             done((jscode === 0 && csscode === 0) ? 0 : 1);

http://git-wip-us.apache.org/repos/asf/incubator-ripple/blob/a5287cc8/build/targets/chrome.extension.js
----------------------------------------------------------------------
diff --git a/build/targets/chrome.extension.js b/build/targets/chrome.extension.js
deleted file mode 100644
index 6b92a78..0000000
--- a/build/targets/chrome.extension.js
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-var childProcess = require('child_process'),
-    fs = require('fs'),
-    path = require('path'),
-    utils = require('./../utils'),
-    _c = require('./../conf');
-
-module.exports = function (src, baton) {
-    baton.take();
-
-    var copy = 'cp -r ' + _c.EXT + "chrome.extension " + _c.DEPLOY + "chrome.extension/ && " +
-               'cp -r ' + _c.ASSETS + "client/images " + _c.DEPLOY + "chrome.extension/ &&" +
-               'cp -r ' + _c.ASSETS + "client/themes " + _c.DEPLOY + "chrome.extension/ &&" +
-               'cp ' + _c.EXT + "chrome.extension/manifest.json " + _c.DEPLOY + "chrome.extension/manifest.json &&" +
-               'cp ' + _c.EXT + "chrome.extension/controllers/Background.js " + _c.DEPLOY + "chrome.extension/controllers/Background.js &&" +
-               'cp ' + _c.EXT + "chrome.extension/controllers/PopUp.js " + _c.DEPLOY + "chrome.extension/controllers/PopUp.js &&" +
-               'cp ' + _c.EXT + "chrome.extension/views/background.html " + _c.DEPLOY + "chrome.extension/views/background.html &&" +
-               'cp ' + _c.EXT + "chrome.extension/views/popup.html " + _c.DEPLOY + "chrome.extension/views/popup.html";
-
-    childProcess.exec(copy, function () {
-        var css = _c.ASSETS + "client/ripple.css",
-            cssDeploy = _c.DEPLOY + "chrome.extension/ripple.css",
-            manifest = _c.DEPLOY + "chrome.extension/manifest.json",
-            manifestJSON = JSON.parse(fs.readFileSync(manifest, "utf-8")),
-            js = _c.DEPLOY + "chrome.extension/ripple.js",
-            bootstrap = _c.DEPLOY + "chrome.extension/bootstrap.js",
-            htmlui = _c.DEPLOY + "chrome.extension/ui.html",
-            resourceList = [],
-            doc = src.html.replace(/#OVERLAY_VIEWS#/g, src.overlays)
-                          .replace(/#PANEL_VIEWS#/g, src.panels)
-                          .replace(/#DIALOG_VIEWS#/g, src.dialogs)
-                          .replace(_c.SPACES_AND_TABS, " ")
-                          .replace(/'/g, _c.ESCAPED_QUOTES);
-
-        fs.writeFileSync(cssDeploy, fs.readFileSync(css, "utf-8") + src.skins);
-
-        fs.writeFileSync(htmlui, doc, "utf-8");
-
-        fs.writeFileSync(bootstrap,
-                         "window.th_panel = {" + "LAYOUT_HTML: '" + doc + "'};" +
-                         fs.readFileSync(bootstrap, "utf-8"));
-
-        fs.writeFileSync(js,
-            src.js +
-            "ripple('bootstrap').bootstrap();"
-        );
-
-        utils.collect(_c.DEPLOY + "/chrome.extension", resourceList, function () {
-            return true;
-        });
-
-        manifestJSON.version = src.info.version;
-        manifestJSON.web_accessible_resources = resourceList.map(function (p) {
-            return p.replace(path.normalize(_c.DEPLOY + "/chrome.extension/"), '');
-        });
-
-        fs.writeFileSync(manifest, JSON.stringify(manifestJSON), "utf-8");
-
-        baton.pass(src);
-    });
-};

http://git-wip-us.apache.org/repos/asf/incubator-ripple/blob/a5287cc8/build/targets/rim.chrome.extension.js
----------------------------------------------------------------------
diff --git a/build/targets/rim.chrome.extension.js b/build/targets/rim.chrome.extension.js
deleted file mode 100644
index a723df0..0000000
--- a/build/targets/rim.chrome.extension.js
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-var childProcess = require('child_process'),
-    utils = require('./../utils'),
-    fs = require('fs'),
-    path = require('path'),
-    _c = require('./../conf'),
-    _EXT_DIR = "rim.chrome.extension";
-
-module.exports = function (src, baton) {
-    baton.take();
-
-    var copy = 'cp -r ' + _c.EXT + "chrome.extension " + _c.DEPLOY + _EXT_DIR + " && " +
-               'cp -rf ' + _c.EXT + _EXT_DIR + " " + _c.DEPLOY + " && " +
-               'cp -r ' + _c.ASSETS + "client/images " + _c.DEPLOY + _EXT_DIR + "/ &&" +
-               'cp -r ' + _c.ASSETS + "client/themes " + _c.DEPLOY + _EXT_DIR + "/" +
-               'cp -r ' + _c.ROOT + "services " + _c.DEPLOY + _EXT_DIR + "/" +
-               'cp -r ' + _c.ROOT + "plugins " + _c.DEPLOY + _EXT_DIR + "/";
-
-    childProcess.exec(copy, function () {
-        var css = _c.ASSETS + "client/ripple.css",
-            cssDeploy = _c.DEPLOY + _EXT_DIR + "/ripple.css",
-            manifest = _c.DEPLOY + _EXT_DIR + "/manifest.json",
-            updatesSrc = _c.EXT + _EXT_DIR + "/updates.xml",
-            updatesDeploy = _c.DEPLOY + _EXT_DIR + "/updates.xml",
-            js = _c.DEPLOY + _EXT_DIR + "/ripple.js",
-            bootstrap = _c.DEPLOY + _EXT_DIR + "/bootstrap.js",
-            manifestJSON = JSON.parse(fs.readFileSync(manifest, "utf-8")),
-            resourceList = [],
-            doc = src.html.replace(/#OVERLAY_VIEWS#/g, src.overlays)
-                          .replace(/#PANEL_VIEWS#/g, src.panels)
-                          .replace(/#DIALOG_VIEWS#/g, src.dialogs)
-                          .replace(_c.SPACES_AND_TABS, " ")
-                          .replace(/'/g, _c.ESCAPED_QUOTES);
-
-        fs.writeFileSync(cssDeploy, fs.readFileSync(css, "utf-8") + src.skins);
-
-        fs.writeFileSync(updatesDeploy, fs.readFileSync(updatesSrc, "utf-8")
-                         .replace(new RegExp('version=""', 'g'), 'version="' + src.info.version + '"'));
-
-        fs.writeFileSync(bootstrap,
-                         "window.th_panel = {" + "LAYOUT_HTML: '" + doc + "'};" +
-                         fs.readFileSync(bootstrap, "utf-8"));
-
-        fs.writeFileSync(js,
-            src.js +
-            "ripple('bootstrap').bootstrap();"
-        );
-
-        utils.collect(_c.DEPLOY + _EXT_DIR, resourceList, function () {
-            return true;
-        });
-
-        manifestJSON.version = src.info.version;
-        manifestJSON.web_accessible_resources = resourceList.map(function (p) {
-            return p.replace(path.normalize(_c.DEPLOY + _EXT_DIR + "/"), '');
-        });
-
-        fs.writeFileSync(manifest, JSON.stringify(manifestJSON), "utf-8");
-
-        baton.pass(src);
-    });
-};

http://git-wip-us.apache.org/repos/asf/incubator-ripple/blob/a5287cc8/lib/client/bootstrap.js
----------------------------------------------------------------------
diff --git a/lib/client/bootstrap.js b/lib/client/bootstrap.js
index 56cbe09..0551508 100644
--- a/lib/client/bootstrap.js
+++ b/lib/client/bootstrap.js
@@ -39,18 +39,6 @@ function _createFrame(src) {
     return frame;
 }
 
-function _cleanBody() {
-    ripple('utils').forEach(document.body.children, function (child) {
-        if (child && child.id && !child.id.match(/ui|tooltip|bus/)) {
-            document.body.removeChild(child);
-        }
-
-        document.body.removeAttribute("style");
-        document.body.removeAttribute("id");
-        document.body.removeAttribute("class");
-    });
-}
-
 function _post(src) {
     var event = ripple('event'),
         frame = _createFrame(src);
@@ -66,9 +54,6 @@ function _post(src) {
 
         event.trigger("TinyHipposLoaded");
 
-        _cleanBody();
-        id = window.setInterval(_cleanBody, 20);
-
         window.setTimeout(function () {
             window.clearInterval(id);
         }, 1200);

http://git-wip-us.apache.org/repos/asf/incubator-ripple/blob/a5287cc8/lib/client/platform/cordova/3.0.0/bridge/inappbrowser.js
----------------------------------------------------------------------
diff --git a/lib/client/platform/cordova/3.0.0/bridge/inappbrowser.js b/lib/client/platform/cordova/3.0.0/bridge/inappbrowser.js
index e8833bb..5eed1f1 100644
--- a/lib/client/platform/cordova/3.0.0/bridge/inappbrowser.js
+++ b/lib/client/platform/cordova/3.0.0/bridge/inappbrowser.js
@@ -19,8 +19,7 @@
  *
  */
 
-var emulatorBridge = ripple('emulatorBridge'),
-    event = ripple('event'),
+var event = ripple('event'),
     ui = ripple('ui'),
     browser = ripple("ui/plugins/browser");
 
@@ -48,11 +47,11 @@ module.exports = {
         event.once("browser-close", trigger('exit'));
     },
 
-    show: function (win, fail, args) {
+    show: function () {
         ui.showOverlay("inappbrowser");
     },
 
-    close: function (win, fail, args) {
+    close: function () {
         browser.hide();
     },
 

http://git-wip-us.apache.org/repos/asf/incubator-ripple/blob/a5287cc8/lib/client/platform/cordova/3.0.0/spec/config.js
----------------------------------------------------------------------
diff --git a/lib/client/platform/cordova/3.0.0/spec/config.js b/lib/client/platform/cordova/3.0.0/spec/config.js
index 64373be..1fca3f6 100644
--- a/lib/client/platform/cordova/3.0.0/spec/config.js
+++ b/lib/client/platform/cordova/3.0.0/spec/config.js
@@ -45,7 +45,7 @@ module.exports = {
             return {
                 origin: r.attributes.origin.value,
                 subdomains: r.attributes.subdomains.value
-            }
+            };
         });
 
         return widgetInfo;

http://git-wip-us.apache.org/repos/asf/incubator-ripple/blob/a5287cc8/lib/server/emulate.js
----------------------------------------------------------------------
diff --git a/lib/server/emulate.js b/lib/server/emulate.js
index b0575e4..53f1742 100644
--- a/lib/server/emulate.js
+++ b/lib/server/emulate.js
@@ -22,8 +22,6 @@ var proxy = require('./proxy'),
     server = require('./index'),
     colors = require('colors'),
     express = require('express'),
-    fs = require('fs'),
-    path = require('path'),
     cordovaProject = require('./emulate/cordovaProject'),
     hosted = require('./emulate/hosted'),
     static = require('./emulate/static');

http://git-wip-us.apache.org/repos/asf/incubator-ripple/blob/a5287cc8/lib/server/emulate/cordovaProject.js
----------------------------------------------------------------------
diff --git a/lib/server/emulate/cordovaProject.js b/lib/server/emulate/cordovaProject.js
index 00874b5..ef3ef99 100644
--- a/lib/server/emulate/cordovaProject.js
+++ b/lib/server/emulate/cordovaProject.js
@@ -8,7 +8,7 @@ function buildPaths(opts) {
 
     try {
         //look for the .cordova folder
-        fs.statSync(path.join(paths.orig, ".cordova"))
+        fs.statSync(path.join(paths.orig, ".cordova"));
         console.log("Cordova 3.0 Project detected...");
         var platforms = fs.readdirSync(path.join(paths.orig, "platforms"));
         if (platforms.indexOf('android') >= 0) {
@@ -48,10 +48,10 @@ module.exports = {
                 if (userAgent.match(/Android/)) { pth = paths.android; req.staticPlatform = "android"; }
                 else if (userAgent.match(/iPhone/)) { pth = paths.ios; req.staticPlatform = "ios"; }
                 else if (userAgent.match(/iPad/)) { pth = paths.ios; req.staticPlatform = "ios"; }
-                else if (userAgent.match(/BB10/)) { pth = paths.blackberry; req.staticPlatform = "blackberry" }
-                else if (userAgent.match(/PlayBook/)) { pth = paths.blackberry; req.staticPlatform = "blackberry" }
-                else if (userAgent.match(/BlackBerry/)) { pth = paths.blackberry; req.staticPlatform = "blackberry" }
-                else { pth = paths.android; req.staticPlatform = "android" }
+                else if (userAgent.match(/BB10/)) { pth = paths.blackberry; req.staticPlatform = "blackberry"; }
+                else if (userAgent.match(/PlayBook/)) { pth = paths.blackberry; req.staticPlatform = "blackberry"; }
+                else if (userAgent.match(/BlackBerry/)) { pth = paths.blackberry; req.staticPlatform = "blackberry"; }
+                else { pth = paths.android; req.staticPlatform = "android"; }
             }
 
             req.staticSource = pth;

http://git-wip-us.apache.org/repos/asf/incubator-ripple/blob/a5287cc8/lib/server/emulate/hosted.js
----------------------------------------------------------------------
diff --git a/lib/server/emulate/hosted.js b/lib/server/emulate/hosted.js
index d6e94a7..ccd2fe8 100644
--- a/lib/server/emulate/hosted.js
+++ b/lib/server/emulate/hosted.js
@@ -123,7 +123,7 @@ function remoteInjection(opts) {
     };
 }
 
-function localInjection(opts) {
+function localInjection() {
     function inject(file, req, res) {
         fs.readFile(file, "utf-8", function (err, data) {
             if (err) { throw new Error(err); }
@@ -158,7 +158,7 @@ function localInjection(opts) {
         } else {
             next();
         }
-    };
+    }
 
     return function (req, res, next) {
         if (req.query.enableripple && req.staticPlatform) {
@@ -170,7 +170,7 @@ function localInjection(opts) {
         else {
             handle(req, res, next);
         }
-    }
+    };
 }
 
 module.exports = {

http://git-wip-us.apache.org/repos/asf/incubator-ripple/blob/a5287cc8/lib/server/emulate/static.js
----------------------------------------------------------------------
diff --git a/lib/server/emulate/static.js b/lib/server/emulate/static.js
index 09e56bb..bd7ac61 100644
--- a/lib/server/emulate/static.js
+++ b/lib/server/emulate/static.js
@@ -1,7 +1,7 @@
 var express = require('express');
 
 module.exports = {
-    inject: function (opts) {
+    inject: function () {
         return function (req, res, next) {
             express.static(req.staticSource)(req, res, next);
         };