Skip to content

Commit

Permalink
ui bridging under way
Browse files Browse the repository at this point in the history
  • Loading branch information
asutherland committed Jan 29, 2012
1 parent 12c1820 commit d32330a
Show file tree
Hide file tree
Showing 6 changed files with 129 additions and 1 deletion.
39 changes: 39 additions & 0 deletions data/aboutNosy.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<base href="resource://aboutnosy/" />
<title>about:nosy</title>
<style type="text/css">
html {
font-family: "Lucida Grande", Verdana, sans-serif;
font-size: 9pt;
}
:focus { outline: none; }
a[href] { text-decoration: none }
</style>
<link rel="shortcut icon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAAXNSR0IArs4c6QAAASBQTFRFAAAABAQECAgIEhISExMTFBQUFRUVFxcXGhoaHBwcHh4eHx8fIiIiIyMjJSUlJiYmJycnKSkpLy8vMDAwMjIyNjY2Nzc3ODg4PDw8Pz8/QUFBR0dHS0tLT09PUFBQVFRUWVlZWlpaXl5eYGBgZmZmaGhobGxsbW1tb29vdHR0dnZ2e3t7fHx8fX19fn5+AJn/hYWFiIiIjo6OZpn/l5eXmZmZoKCgpKSkpaWlpqamp6enqKioq6urrq6usLCwsrKytbW1ubm5vb29vr6+wMDAwcHBxcXFyMjIzs7O09PT1tbW19fX3d3d4ODg4+Pj5OTk6Ojo6enp6+vr7Ozs7e3t7u7u7+/v8fHx9vb29/f3+Pj4+fn5+vr6/f39/v7+////eXVP6wAAAQBJREFUOMu903szQlEUh+EjcXKLJIQQURRC7pcUuXehopLzfv9vYZ/L0Eh7M4z1x2/PrHlm7X3WzNFQlIYWsM/OYPpIAW68LxZoxHQ91oDzWbdvv9rzCM3eBxMQ2bLA2lShEFwHT6p6N89yEjIz1gRKA08mGDyD9BCMbebF6Pv+JkuHNiC5YqarAmUX3C64J3Iwd2CM1BxQ8+ZbJoBx7Ier8ctFHMBeWGTcfEMCQtfPux7RnAxm34EREFmP6nq0Diej3aEL0Tzte5V9P6RWpRukMlx0wIaoLzbYtYMUfKz6j0E7/j5oz98DO/8HqP4LNdgW1Tkl4NMVrU0l+Okj5fUGYrk6y74FcmEAAAAASUVORK5CYII=" />
<script type="text/javascript" src="lib/require.js"></script>
<script>
require({
baseUrl: "resource://aboutnosy/",
paths: {
"text": "lib/text",
},
packages: [
{ name: "aboutnosy", location: "lib/aboutnosy" },

{ name: "wmsy", location: "deps/lib/wmsy" },
],
ready: function() {
require(["aboutnosy/ui/app"],
function(mainModule) {
mainModule.main(document);
});
},
});
</script>
</head>
<body id="body" style="border: 0; padding: 0; margin: 0;">
</body>
</html>
47 changes: 47 additions & 0 deletions data/lib/aboutnosy/ui/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */

/**
* The wmsy UI for about:nosy
**/

define(
[
'wmsy/wmsy',
'aboutnosy/memfrobrep',
'text!./app.css',
'exports'
],
function(
$wmsy,
$memfrobrep,
$_css,
exports
) {

var wy = exports.wy =
new $wmsy.WmsyDomain({id: "app", domain: "app", css: $_css});

function NosyApp() {


}
NosyApp.prototype = {
};

function hookupChromeBridge() {
}

exports.main = function(doc) {
var app = new NosyApp();

var rootObj = {
};

// bind the UI into existence.
var binder = wy.wrapElement(doc.getElementById("body"));
binder.bind({type: "root", obj: rootObj});
};

}); // end define
43 changes: 42 additions & 1 deletion lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,46 @@
* - Data collection only occurs when an "about:nosy" page is being displayed.
**/

const $protocol = require('./jetpack-protocol/index');
const $protocol = require('./jetpack-protocol/index'),
$pagemod = require('page-mod'),
$self = require('self'),
$memfrob = require('./memfrob');

const TRUE_NOSY_URL = self.data.url('aboutNosy.html'),
BRIDGE_SCRIPT_URL = self.data.url('bridge.js');

function newClient(uiWorker) {
}

function deadClient(uiWorker) {
}

exports.main = function() {
// - create the about:nosy mapping
$protocol.about('nosy', {
onRequest: function(request, response) {
// this will still look like about:nosy in the URL bar, but the
// data comes from the "resource://" path.
response.uri = TRUE_NOSY_URL;
}
});

// - create the page-mod communication bridge
pageMod.PageMod({
include: ['about:nosy'],
contentScriptWhen: 'start',
contentSCriptFile: BRIDGE_SCRIPT_URL,
onAttach: function onAttach(uiWorker) {
var frobber = new $memfrob.MemTreeFrobber();

newClient(uiWorker);

uiWorker.on('uiReq', function(message) {
});

uiWorker.on('detach', function() {
deadClient(uiWorker);
});
},
});
};
1 change: 1 addition & 0 deletions lib/memfrob.js
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,7 @@ function MemTreeFrobber() {

this._generation = 0;
}
exports.MemTreeFrobber = MemTreeFrobber;
MemTreeFrobber.prototype = {
_issueStatId: function() {
return this._nextStatId++;
Expand Down
Binary file added resources/icon/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/icon/favicon.xcf
Binary file not shown.

0 comments on commit d32330a

Please sign in to comment.