This commit is contained in:
mgalli%geckonnection.com 2006-04-06 22:17:40 +00:00
Родитель 019703327c
Коммит 7a3dc1a516
4 изменённых файлов: 316 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>
<xsl:output method="html" />
<xsl:template match="/">
<body bgcolor="white">
<script>
function _IG_RegisterOnloadHandler(refName) {
//
}
</script>
<xsl:for-each select="/Module/Content" >
<xsl:value-of select="." /> </xsl:for-each>
</body>
</xsl:template>
</xsl:stylesheet>

Просмотреть файл

@ -0,0 +1,154 @@
function rssfetch(refTab,targetDoc, targetElement) {
//http://rss.slashdot.org/Slashdot/slashdot
//http://del.icio.us/rss/taboca
var testLoad=new blenderObject();
//testLoad.xmlSet("http://rss.slashdot.org/Slashdot/slashdot");
testLoad.xmlSet("http://del.icio.us/rss/tag/"+gRSSTag);
//testLoad.xslSet("chrome://minimo/content/rssview/rss_template.xml");
testLoad.xslSet("chrome://minimo/content/rssview/rss_template_html.xml");
testLoad.refTab=refTab;
//testLoad.setTargetDocument(document.getElementById("container-output").contentDocument);
//testLoad.setTargetElement(document.getElementById("container-output").contentDocument.getElementsByTagName("treeitem").item(ii));
testLoad.setTargetDocument(targetDoc);
//testLoad.setTargetElement(getBrowser().selectedBrowser.contentDocument.getElementsByTagName("body").item(0));
testLoad.setTargetElement(targetElement);
testLoad.run();
}
function modulefetchpage(targetDoc, targetElement) {
var testLoad=new blenderObject();
testLoad.xmlSet(document.location.search.split("?url=")[1]);
testLoad.xslSet("module_template_html.xml");
testLoad.setTargetDocument(targetDoc);
testLoad.setTargetElement(targetElement);
testLoad.run();
}
////
/// loads the XSL style and data-source and mix them into a new doc.
//
function blenderObject() {
this.xmlRef=document.implementation.createDocument("","",null);
this.xslRef=document.implementation.createDocument("http://www.w3.org/1999/XSL/Transform","stylesheet",null);
this.xmlUrl="";
this.xslUrl="";
this.refTab=null;
var myThis=this;
var lambda=function thisScopeFunction() { myThis.xmlLoaded(); }
var omega=function thisScopeFunction2() { myThis.xslLoaded(); }
this.xmlRef.addEventListener("load",lambda,false);
this.xslRef.addEventListener("load",omega,false);
this.xmlLoadedState=false;
this.xslLoadedState=false;
}
blenderObject.prototype.xmlLoaded = function () {
this.xmlLoadedState=true;
//serialXML=new XMLSerializer();
//alert(serialXML.serializeToString(this.xmlRef));
this.apply();
}
blenderObject.prototype.xslLoaded = function () {
this.xslLoadedState=true;
this.apply();
}
blenderObject.prototype.xmlSet = function (urlstr) {
this.xmlUrl=urlstr;
}
blenderObject.prototype.xslSet = function (urlstr) {
this.xslUrl=urlstr;
}
blenderObject.prototype.setTargetDocument = function (targetDoc) {
this.targetDocument=targetDoc;
}
blenderObject.prototype.setTargetElement = function (targetEle) {
this.targetElement=targetEle;
}
blenderObject.prototype.apply = function () {
if(this.xmlLoadedState&&this.xslLoadedState) {
var xsltProcessor = new XSLTProcessor();
var htmlFragment=null;
var htmlResultDocument =null;
try {
xsltProcessor.importStylesheet(this.xslRef);
htmlFragment = xsltProcessor.transformToFragment(this.xmlRef, this.targetDocument);
// htmlResultDocument = xsltProcessor.transformToDocument(this.xmlRef);
} catch (e) {
}
serialXML=new XMLSerializer();
var textXML=null;
textXML=serialXML.serializeToString(htmlFragment );
// this.targetElement.appendChild(htmlFragment.firstChild);
newReplaced=textXML.replace(/&lt;/g,"<");
newReplaced=newReplaced.replace(/&gt;/g,">");
newReplaced=newReplaced.replace(/&amp;/g,"&");
this.targetDocument.getElementById("contentmodule").style.height=window.innerHeight+"px";
this.targetDocument.getElementById("contentmodule").style.width=window.innerWidth+"px";
this.targetDocument.getElementById("contentmodule").contentDocument.write(newReplaced);
this.targetDocument.getElementById("contentmodule").contentDocument.close();
/*
* Updates the page title if pagetitle generated ID exists.
* Check the rss_*.xml templates for additional details..
*/
if(document.getElementById("pagetitle")) {
document.title=document.getElementById("pagetitle").innerHTML;
}
}
}
blenderObject.prototype.run = function () {
try {
//this.xmlRef.load(this.xmlUrl);
req = new XMLHttpRequest();
req.open('GET', this.xmlUrl, false);
req.send(null);
if(req.status == 200) {
this.xmlRef=req.responseXML;
this.xmlLoadedState=true;
}
} catch (e) {
alert(e);
}
try {
this.xslRef.load(this.xslUrl);
} catch (e) {
alert(e);
}
}

Просмотреть файл

@ -0,0 +1,58 @@
<?xml version="1.0"?> <!-- -*- Mode: HTML -*- -->
<!-- ***** BEGIN LICENSE BLOCK *****
Version: MPL 1.1/GPL 2.0/LGPL 2.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (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.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is Mozilla Communicator client code, released
March 31, 1998.
The Initial Developer of the Original Code is
Netscape Communications Corporation.
Portions created by the Initial Developer are Copyright (C) 1998-2000
the Initial Developer. All Rights Reserved.
Contributor(s):
Marcio S. Galli, mgalli@geckonnection.com
Alternatively, the contents of this file may be used under the terms of
either the GNU General Public License Version 2 or later (the "GPL"), or
the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
in which case the provisions of the GPL or the LGPL are applicable instead
of those above. If you wish to allow use of your version of this file only
under the terms of either the GPL or the LGPL, and not to allow others to
use your version of this file under the terms of the MPL, indicate your
decision by deleting the provisions above and replace them with the notice
and other provisions required by the GPL or the LGPL. If you do not delete
the provisions above, a recipient may use your version of this file under
the terms of any one of the MPL, the GPL or the LGPL.
***** END LICENSE BLOCK ***** -->
<?xml-stylesheet href="chrome://minimo/skin/rssload/rssload.css" type="text/css"?>
<!DOCTYPE rss [
<!ENTITY % rssDTD SYSTEM "chrome://minimo/locale/rssload.dtd" >
%rssDTD;
]>
<rss xmlns:html="http://www.w3.org/1999/xhtml"
xmlns:xlink="http://www.w3.org/1999/xlink">
<html:head>
<html:link rel="icon" href="chrome://minimo/skin/rssfavicon.png" type="image/png" />
<html:title>Google Module</html:title>
</html:head>
<html:body onload='modulefetchpage(document,document.body)' />
<html:iframe id='contentmodule' width="100%" height="100%" frameborder='no' src="about:blank" />
<html:script src="moduleload.js" />
</rss>

Просмотреть файл

@ -0,0 +1,81 @@
<?xml version="1.0"?> <!-- -*- Mode: HTML -*- -->
<!-- ***** BEGIN LICENSE BLOCK *****
- Version: MPL 1.1/GPL 2.0/LGPL 2.1
-
- The contents of this file are subject to the Mozilla Public License Version
- 1.1 (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.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS IS" basis,
- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- for the specific language governing rights and limitations under the
- License.
-
- The Original Code is Mozilla Communicator client code, released
- March 31, 1998.
-
- The Initial Developer of the Original Code is
- Netscape Communications Corporation.
- Portions created by the Initial Developer are Copyright (C) 1998-2000
- the Initial Developer. All Rights Reserved.
-
- Contributor(s):
- Marcio S. Galli, mgalli@geckonnection.com
-
- Alternatively, the contents of this file may be used under the terms of
- either the GNU General Public License Version 2 or later (the "GPL"), or
- the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- in which case the provisions of the GPL or the LGPL are applicable instead
- of those above. If you wish to allow use of your version of this file only
- under the terms of either the GPL or the LGPL, and not to allow others to
- use your version of this file under the terms of the MPL, indicate your
- decision by deleting the provisions above and replace them with the notice
- and other provisions required by the GPL or the LGPL. If you do not delete
- the provisions above, a recipient may use your version of this file under
- the terms of any one of the MPL, the GPL or the LGPL.
-
- ***** END LICENSE BLOCK ***** -->
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<link rel="icon" type="image/gif" href="chrome://minimo/skin/rssicon.gif" />
<title>RSS mode</title>
<style>
div.item {
font-family:verdana;
font-size:74%;
-moz-border-radius:4px;
background-color:#ffffff;
margin:4px;
}
div.item a {
text-decoration:none;
color:black;
}
html {
background-color:#dddddd;
}
body {
padding:0px;margin:0px;
}
div.loading {
display:block;
font-family:verdana;
font-size:74%;
}
</style>
</head>
<body>
</body>
</html>