Permalink
Browse files

merged npapi branch into next and cleaned up merge issues

  • Loading branch information...
2 parents 1a16d8f + dc80540 commit 87787814f6ca6ba86287ea28eb4177481cab9edd Dan Silivestru committed Jul 11, 2012
@@ -24,7 +24,8 @@ module.exports = function (src, baton) {
'cp -r ' + _c.ASSETS + "images " + _c.DEPLOY + "chromestore/ &&" +
'cp -r ' + _c.ASSETS + "themes " + _c.DEPLOY + "chromestore/ &&" +
'cp ' + _c.EXT + "chromestore/manifest.json " + _c.DEPLOY + "chromestore/manifest.json &&" +
- 'cp ' + _c.EXT + "chromestore/controllers/Background.js " + _c.DEPLOY + "chromestore/controllers/Background.js";
+ 'cp ' + _c.EXT + "chromestore/controllers/Background.js " + _c.DEPLOY + "chromestore/controllers/Background.js" +
+ 'cp ' + _c.EXT + "chromestore/views/background.html " + _c.DEPLOY + "chromestore/views/background.html";
childProcess.exec(copy, function () {
var css = _c.ASSETS + "ripple.css",
View
@@ -22,7 +22,8 @@ module.exports = function (src, baton) {
var copy = 'cp -r ' + _c.EXT + "chromium " + _c.DEPLOY + " && " +
'cp -r ' + _c.ASSETS + "images " + _c.DEPLOY + "chromium/ &&" +
- 'cp -r ' + _c.ASSETS + "themes " + _c.DEPLOY + "chromium/";
+ 'cp -r ' + _c.ASSETS + "themes " + _c.DEPLOY + "chromium/" +
+ 'cp -r ' + _c.ROOT + "plugins " + _c.DEPLOY + "chromium/";
childProcess.exec(copy, function () {
var css = _c.ASSETS + "ripple.css",
@@ -0,0 +1,23 @@
+<!--
+ * Copyright 2011 Research In Motion Limited.
+ *
+ * Licensed 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.
+-->
+<html>
+ <head>
+ <script type="text/javascript" src="../controllers/jquery.js"></script>
+ <script type="text/javascript" src="../controllers/Background.js"></script>
+ </head>
+ <body>
+ </body>
+</html>
@@ -56,6 +56,8 @@ tinyHippos.Background = (function () {
xhr.send();
chrome.extension.onRequest.addListener(function (request, sender, sendResponse) {
+ var xhr, postData, data, plugin;
+console.log(request);
switch (request.action) {
case "isEnabled":
console.log("isEnabled? ==> " + request.tabURL);
@@ -67,16 +69,16 @@ tinyHippos.Background = (function () {
sendResponse();
break;
case "userAgent":
- console.log("user agent ==> " + userAgent);
+ console.log("user agent ==> " + request.data);
userAgent = request.data;
break;
case "version":
sendResponse(version);
break;
case "xhr":
- var xhr = new XMLHttpRequest(),
- postData = new FormData(),
- data = JSON.parse(request.data);
+ xhr = new XMLHttpRequest();
+ postData = new FormData();
+ data = JSON.parse(request.data);
console.log("xhr ==> " + data.url);
@@ -99,8 +101,29 @@ tinyHippos.Background = (function () {
}
});
break;
+ case "services":
+ console.log("services", request.data);
+ if (request.data === '"start"') {
+ plugin = document.getElementById("pluginRippleBD");
+ console.log("plugin", plugin);
+ if (plugin) {
+ console.log("return from startBD", plugin.startBD(9910));
+ sendResponse();
+ }
+ }
+ else if (request.data === '"stop"') {
+ xhr = new XMLHTTPRequest();
+ try {
+ xhr.open("GET", "http://127.0.0.1:9910/ripple/shutdown", false);
+ xhr.send();
+ }
+ catch (e) {
+ console.log(e);
+ }
+ }
+ break;
default:
- throw {name: "MethodNotImplemented", message: "Requested action is not supported!"};
+ throw {name: "MethodNotImplemented", message: "Requested action is not supported! "};
break;
};
});
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2011 Research In Motion Limited.
+ *
+ * Licensed 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.
+ */
if (!document.getElementById("emulator-booting") && !document.getElementById("tinyhippos-injected")) {
var script = document.createElement("script");
script.id = "tinyhippos-injected";
@@ -2,6 +2,10 @@
"version": "",
"name": "Ripple Emulator (Beta)",
"background_page":"views/background.html",
+ "plugins": [
+ { "path": "plugins/npRippleBD.dll" },
+ { "path": "plugins/RippleBD.plugin" }
+ ],
"icons":{
"16":"images/Icon_16x16.png",
"128":"images/Icon_128x128.png",
@@ -19,5 +19,6 @@
<script type="text/javascript" src="../controllers/Background.js"></script>
</head>
<body>
+ <embed type="application/x-ripplebd" id="pluginRippleBD" hidden="true" width="0" height="0" />
</body>
</html>
View
@@ -63,6 +63,19 @@ var omgwtf = require('ripple/omgwtf'),
}
};
+ //HACK: need to find a better way to do this since it's
+ //WebWorks specific!!!
+ window.onunload = function () {
+ var bus = require('ripple/bus');
+ bus.ajax(
+ "GET",
+ "http://127.0.0.1:9910/ripple/shutdown",
+ null,
+ null,
+ null
+ );
+ };
+
jWorkflow.order(omgwtf.initialize, omgwtf)
.andThen(appcache.initialize, appcache)
.andThen(db.initialize, db)
@@ -14,9 +14,29 @@
* limitations under the License.
*/
var tooltip = require('ripple/ui/plugins/tooltip'),
- settings = require('ripple/ui/plugins/settings-dialog');
+ settings = require('ripple/ui/plugins/settings-dialog'),
+ bus = require('ripple/bus');
function handleBuild() {
+ bus.ajax(
+ "GET",
+ "http://127.0.0.1:9910/ripple/about",
+ null,
+ function () {
+ doBuild();
+ },
+ function (error) {
+ if (error.code === 0 || error.code === 404) {
+ startServices(function () {
+ doBuild();
+ });
+ }
+ }
+ );
+
+}
+
+function doBuild() {
var node = $(this),
action = node.attr('id').split("-")[2];
@@ -32,6 +52,16 @@ function handleBuild() {
}
}
+function startServices(callBack) {
+ var action = "start";
+ bus.send("services", action, function () {
+ if (typeof callBack === "function") {
+ callBack();
+ }
+ $("#options-menu-services").show();
+ });
+}
+
module.exports = {
panel: {
domId: "build-container",
@@ -52,5 +82,7 @@ module.exports = {
$("#options-menu-build-warning").show();
tooltip.create("#options-menu-build-warning", "Remote Web Inspector should be disabled when packaging for App World release");
}
+
+ startServices();
}
};
@@ -21,6 +21,9 @@
</section>
</section>
<section class="info ui-widget-content ui-corner-all" style="display: none;">
+ <section id="options-menu-services" class="ui-text-fail irrelevant">
+ The Build and Deploy services are currently running at: http://127.0.0.1:9910
+ </section>
<button id="options-menu-build" class="not-ready ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only">
<span class="ui-button-text">Package</span>
</button>

0 comments on commit 8778781

Please sign in to comment.