author | williamt <williamt> | 2007-01-05 10:06:01 (UTC) |
---|---|---|
committer | williamt <williamt> | 2007-01-05 10:06:01 (UTC) |
commit | c4b3096e166a0a9a60fd27c8f2dc06e688f13172 (patch) (side-by-side diff) | |
tree | e5f234745835e28d56e5d5b7d6146886d04b3436 /src/chrome | |
download | foxri-c4b3096e166a0a9a60fd27c8f2dc06e688f13172.zip foxri-c4b3096e166a0a9a60fd27c8f2dc06e688f13172.tar.gz foxri-c4b3096e166a0a9a60fd27c8f2dc06e688f13172.tar.bz2 |
Initial revision
20 files changed, 414 insertions, 0 deletions
diff --git a/src/chrome/content/aim_logo.gif b/src/chrome/content/aim_logo.gif Binary files differnew file mode 100755 index 0000000..9d5bffe --- a/dev/null +++ b/src/chrome/content/aim_logo.gif diff --git a/src/chrome/content/email_icon.gif b/src/chrome/content/email_icon.gif Binary files differnew file mode 100755 index 0000000..1c62b57 --- a/dev/null +++ b/src/chrome/content/email_icon.gif diff --git a/src/chrome/content/feed-icon-14x14.png b/src/chrome/content/feed-icon-14x14.png Binary files differnew file mode 100755 index 0000000..b3c949d --- a/dev/null +++ b/src/chrome/content/feed-icon-14x14.png diff --git a/src/chrome/content/feed-icon-28x28.png b/src/chrome/content/feed-icon-28x28.png Binary files differnew file mode 100755 index 0000000..d64c669 --- a/dev/null +++ b/src/chrome/content/feed-icon-28x28.png diff --git a/src/chrome/content/foxri.xul b/src/chrome/content/foxri.xul new file mode 100755 index 0000000..dc1cc37 --- a/dev/null +++ b/src/chrome/content/foxri.xul @@ -0,0 +1,32 @@ +<?xml version="1.0"?>
+<?xml-stylesheet href="foxri.css" type="text/css"?>
+
+
+<overlay id="foxri" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+
+
+<!--
+<script type="application/x-javascript" src="chrome://foxri/content/xrdsHandler.js"/>
+-->
+
+<script>
+function xriFix(event)
+{
+ var txt = gURLBar.value;
+ if (/^(=|@|!)\S+/.test(txt)) {
+ gURLBar.value = "xri://" + txt;
+ }
+}
+</script>
+
+
+ <toolbaritem id="urlbar-container">
+ <textbox id="urlbar" ontextentered="xriFix(); return handleURLBarCommand(param);" />
+ </toolbaritem>
+
+ <toolbaritem id="go-container">
+ <toolbarbutton id="go-button" oncommand="xriFix(); return handleURLBarCommand(event);" />
+ </toolbaritem>
+
+</overlay>
+
diff --git a/src/chrome/content/foxri_explorer.css b/src/chrome/content/foxri_explorer.css new file mode 100755 index 0000000..9e68e95 --- a/dev/null +++ b/src/chrome/content/foxri_explorer.css @@ -0,0 +1,124 @@ +
+
+* {
+ margin: 0;
+ padding: 0;
+}
+
+
+body {
+ background-color: #b1d8ff;
+ font-family: Trebuchet MS, Verdana, Helvetica, Arial, sans-serif;
+}
+
+
+a {
+ text-decoration: none;
+}
+
+a:link, a:visited {
+ color: #D65B5B; /* inames.net logo color */
+}
+
+a:hover {
+ border-bottom: 1px dashed #555A5C;
+}
+
+a img {
+ border: none;
+ text-decoration: none;
+}
+
+
+h1,h2,h3,h4,h5,h6,p {
+ margin-left: 100px;
+}
+
+h1 {
+ margin: 0 100px;
+ padding: 0;
+ color: #D65B5B; /* inames.net logo color */
+}
+
+h3 {
+ margin: 0 100px;
+ padding: 0;
+ color: #666666;
+}
+
+h3 strong {
+ color: #FF0000; /* inames.net logo color */
+}
+
+
+.service {
+ background-color: #ffffff; /* inames.net */
+ color: #333333;
+
+ margin: 20px 100px;
+ padding: 10px 150px;
+ min-height: 100px;
+ background-repeat: no-repeat;
+ background-position: 15px 10px;
+
+ -moz-border-radius: 10px;
+}
+
+
+.srv_skype {
+ background-image: url(chrome://foxri/content/skype_logo.png);
+}
+
+.srv_aim {
+ background-image: url(chrome://foxri/content/aim_logo.gif);
+}
+
+.srv_yahoo {
+ background-image: url(chrome://foxri/content/yahoo_logo.gif);
+}
+
+.srv_msn {
+ background-image: url(chrome://foxri/content/msn_logo.gif);
+}
+
+.srv_jabber {
+ background-image: url(chrome://foxri/content/jabber_logo.gif);
+}
+
+.srv_openid {
+ background-image: url(chrome://foxri/content/openid_logo.png);
+}
+
+.srv_i-contact {
+ background-image: url(chrome://foxri/content/i-contact_logo.gif);
+}
+
+.srv_i-forwarding {
+ background-image: url(chrome://foxri/content/i-forwarding_logo.gif);
+}
+
+.srv_authn-saml {
+ background-image: url(chrome://foxri/content/i-sso_logo.gif);
+}
+
+.srv_email {
+ background-image: url(chrome://foxri/content/email_icon.gif);
+}
+
+.srv_feed {
+ background-image: url(chrome://foxri/content/feed-icon-28x28.png);
+}
+
+.service a {
+ color: #D65B5B; /* inames.net logo color */
+}
+
+
+div a:hover {
+ text-decoration: none;
+ border: none;
+}
+
+.error {
+ color: #FF5B5B;
+}
diff --git a/src/chrome/content/i-contact_logo.gif b/src/chrome/content/i-contact_logo.gif Binary files differnew file mode 100755 index 0000000..9775919 --- a/dev/null +++ b/src/chrome/content/i-contact_logo.gif diff --git a/src/chrome/content/i-forwarding_logo.gif b/src/chrome/content/i-forwarding_logo.gif Binary files differnew file mode 100755 index 0000000..125b1de --- a/dev/null +++ b/src/chrome/content/i-forwarding_logo.gif diff --git a/src/chrome/content/i-sso_logo.gif b/src/chrome/content/i-sso_logo.gif Binary files differnew file mode 100755 index 0000000..f948dd6 --- a/dev/null +++ b/src/chrome/content/i-sso_logo.gif diff --git a/src/chrome/content/icn_sso_lg.gif b/src/chrome/content/icn_sso_lg.gif Binary files differnew file mode 100755 index 0000000..f948dd6 --- a/dev/null +++ b/src/chrome/content/icn_sso_lg.gif diff --git a/src/chrome/content/jabber_logo.gif b/src/chrome/content/jabber_logo.gif Binary files differnew file mode 100755 index 0000000..01628d1 --- a/dev/null +++ b/src/chrome/content/jabber_logo.gif diff --git a/src/chrome/content/msn_logo.gif b/src/chrome/content/msn_logo.gif Binary files differnew file mode 100755 index 0000000..19dd647 --- a/dev/null +++ b/src/chrome/content/msn_logo.gif diff --git a/src/chrome/content/openid_logo.png b/src/chrome/content/openid_logo.png Binary files differnew file mode 100755 index 0000000..51d3654 --- a/dev/null +++ b/src/chrome/content/openid_logo.png diff --git a/src/chrome/content/skype_add_large.png b/src/chrome/content/skype_add_large.png Binary files differnew file mode 100755 index 0000000..2cfb5dc --- a/dev/null +++ b/src/chrome/content/skype_add_large.png diff --git a/src/chrome/content/skype_call.png b/src/chrome/content/skype_call.png Binary files differnew file mode 100755 index 0000000..bbb9807 --- a/dev/null +++ b/src/chrome/content/skype_call.png diff --git a/src/chrome/content/skype_call_large.png b/src/chrome/content/skype_call_large.png Binary files differnew file mode 100755 index 0000000..65ce0dd --- a/dev/null +++ b/src/chrome/content/skype_call_large.png diff --git a/src/chrome/content/skype_chat_large.png b/src/chrome/content/skype_chat_large.png Binary files differnew file mode 100755 index 0000000..9642d8a --- a/dev/null +++ b/src/chrome/content/skype_chat_large.png diff --git a/src/chrome/content/skype_logo.png b/src/chrome/content/skype_logo.png Binary files differnew file mode 100755 index 0000000..a190417 --- a/dev/null +++ b/src/chrome/content/skype_logo.png diff --git a/src/chrome/content/xrdsHandler.js b/src/chrome/content/xrdsHandler.js new file mode 100755 index 0000000..d4b0d35 --- a/dev/null +++ b/src/chrome/content/xrdsHandler.js @@ -0,0 +1,258 @@ +
+const nsISupports = Components.interfaces.nsISupports;
+const nsIChannel = Components.interfaces.nsIChannel;
+const nsIContentHandler = Components.interfaces.nsIContentHandler;
+const nsIDOMWindow = Components.interfaces.nsIDOMWindow;
+const nsIInterfaceRequestor = Components.interfaces.nsIInterfaceRequestor;
+const nsIStreamListener = Components.interfaces.nsIStreamListener;
+const nsIRequestObserver = Components.interfaces.nsIRequestObserver;
+const nsIURILoader = Components.interfaces.nsIURILoader;
+const nsIURIContentListener = Components.interfaces.nsIURIContentListener;
+
+
+
+
+var g_xrdsHandler = null;
+
+
+
+
+
+
+XrdsContentHandler.prototype = {
+
+ /** browser window */
+ contentWindow: null,
+
+ /** XRDS buffer */
+ buf: null,
+
+ scriptableInStream: null,
+
+ init: function(contentWin) {
+ dump("XrdsContentHandler.init()\n");
+ this.contentWindow = contentWin;
+
+ var uriLoader = Components.classes["@mozilla.org/uriloader;1"]
+ .getService(Components.interfaces.nsIURILoader);
+ uriLoader.registerContentListener(this);
+ dump("XrdsContentHandler.init() returning\n");
+ },
+
+ close: function() {
+ this.contentWindow = null;
+ var uriLoader = Components.classes["@mozilla.org/uriloader;1"]
+ .getService(Components.interfaces.nsIURILoader);
+ uriLoader.unRegisterContentListener(g_xrdsHandler);
+ },
+
+ /* nsISupports */
+ QueryInterface : function(iid) {
+ dump("xrdsCH ... ");
+ if (iid.equals(nsISupports)) {
+ dump("QI(nsISupports)\n");
+ }
+ else if (iid.equals(nsIContentHandler)) {
+ dump("QI(nsIContentHandler)\n");
+ }
+ else if (iid.equals(nsIStreamListener)) {
+ dump("QI(nsIStreamListener)\n");
+ }
+ else if (iid.equals(nsIRequestObserver)) {
+ dump("QI(nsIRequestObserver)\n");
+ }
+ else if (iid.equals(Components.interfaces.nsIURIContentListener)) {
+ dump("QI(nsIURIContentListener)\n");
+ }
+ else if (iid.equals(nsIFactory)) {
+ dump("QI(nsIFactory)\n");
+ }
+ else {
+ dump("QI(" + iid + ") - IDONTKNOW!!!!!\n");
+ }
+
+ if (!iid.equals(nsISupports) &&
+// !iid.equals(nsIContentHandler) &&
+ !iid.equals(nsIURIContentListener) &&
+ !iid.equals(nsIStreamListener) &&
+// !iid.equals(nsIRequestObserver) &&
+ !iid.equals(nsIFactory))
+ throw Components.results.NS_ERROR_NO_INTERFACE;
+
+ dump("QI returning this..\n");
+ return this;
+ },
+
+
+ /* nsIURIContentListener */
+ loadCookie: null,
+
+ parentContentListener: null,
+
+ onStartURIOpen: function(uri)
+ {
+ dump("xrdsCH onStartURIOpen '" + uri + "'");
+ // ignore and don't abort
+ return false;
+ },
+
+ doContent: function(contentType, isContentPreferred, request, contentHandler)
+ {
+ dump("doContent called\n");
+ // forward the doContent to our content area webshell
+ var docShell = this.contentWindow.docShell;
+ var contentListener;
+ try {
+ contentListener =
+ docShell.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
+ .getInterface(Components.interfaces.nsIURIContentListener);
+ } catch (ex) {
+ dump(ex);
+ }
+
+ dump("no content listener from docShell!\n");
+ if (!contentListener) return false;
+
+ var rv = contentListener.doContent(contentType, isContentPreferred, request, contentHandler);
+
+ if (rv) {
+ dump("docShell wants to handle the load..\n");
+ }
+ else {
+ dump("docShell does NOT want to handle the load..\n");
+
+ contentHandler = contentHandler.value;
+ }
+
+ return rv;
+
+ },
+
+ isPreferred: function(contentType, desiredContentType)
+ {
+ dump("isPreferred '" + contentType + "'\n");
+ switch(contentType) {
+ case "application/xrds+xml":
+ case "application/xrd+xml":
+ dump("yes!!!\n");
+ return true;
+ }
+ dump("erm.. nope!\n");
+ return false;
+ },
+
+ canHandleContent: function(contentType, isContentPreferred, desiredContentType)
+ {
+ dump("canHandleContent '" + contentType + "'\n");
+ return this.isPreferred(contentType, desiredContentType);
+ },
+
+
+
+ /* nsIRequestObserver */
+ onStartRequest: function(request, ctx)
+ {
+ dump("xrdsContentHandler - onStartRequest\n");
+ },
+
+ onStopRequest: function(request, ctx, status)
+ {
+ dump("xrdsContentHandler - onStopRequest\n");
+ this.scriptableInStream.close();
+ },
+
+
+ /* nsIStreamListener */
+ onDataAvailable: function(request, domWindow, inputStream, offset, count)
+ {
+ dump("onDataAvailable, offset=" + offset + ", count=" + count + "\n");
+ if (offset == 0) {
+ this.scriptableInStream.init(inputStream);
+ }
+
+ buf += this.scriptableInStream.read(count);
+
+ if (!request.isPending()) {
+ dump("request finished, buf = " + buf + "\n");
+ var html = domWindow.document.createElement("html");
+ html.createTextNode(buf);
+ this.scriptableInStream = null;
+ }
+ else {
+ dump("request pending...\n");
+ }
+ },
+
+ /* nsIContentHandler */
+
+ handleContent : function(contentType, context, request)
+ {
+ dump("handleContent " + contentType + "\n");
+ var parentWin;
+ try {
+ parentWin = context.getInterface(nsIDOMWindow);
+ }
+ catch (e) {
+ alert("no parent!!!"); // XXX
+ return;
+ }
+
+ dump("getting channel\n");
+ var channel = request.QueryInterface(nsIChannel);
+ if (!channel) {
+ dump("no channel!!!\n");
+ return;
+ }
+
+ if (this.scriptableInStream) {
+ dump("Hey! You can't possibly be reusing this handler?!\n");
+ return;
+ }
+
+ dump("making scriptableInStream\n");
+ this.scriptableInStream = Components.classes["@mozilla.org/scriptableinputstream;1"]
+ .createInstance(Components.interfaces.nsIScriptableInputStream);
+
+ buf = '';
+
+ }
+
+};
+
+
+function XrdsContentHandler(contentWindow)
+{
+ this.init(contentWindow);
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+function foxri_startup() {
+ // our XRDS content-handler also does nsIURIContentListener
+ var xrdsHandler = new XrdsContentHandler(getBrowser());
+ g_xrdsHandler = xrdsHandler;
+
+}
+
+
+function foxri_shutdown() {
+ if (!g_xrdsHandler)
+ return;
+
+ g_xrdsHandler.close();
+}
+
+
+
+
+foxri_startup();
diff --git a/src/chrome/content/yahoo_logo.gif b/src/chrome/content/yahoo_logo.gif Binary files differnew file mode 100755 index 0000000..34e6cd2 --- a/dev/null +++ b/src/chrome/content/yahoo_logo.gif |