PK
H: chrome/PK
H:F1o~ ~ chrome/externalapp.jarPK
g9 content/PK
g9 content/externalapp/PK
81; content/externalapp/contents.rdf
chrome://externalapp/content/externalappCTOverlay.xul
chrome://externalapp/content/externalappOverlay.xul
PK
G:H) H) " content/externalapp/externalapp.jsfunction ExternalApplicationButtons()
{
this._init();
}
ExternalApplicationButtons.prototype={
_wm: null,
_current:null,
set currentElement(aElement)
{
if(this._current){
if(this._current.database)
this._current.database.RemoveDataSource(this._ds);
this._current.ref="";
if(this._current != aElement && this._current.builder)
this._current.builder.rebuild();
}
if(aElement){
aElement.database.AddDataSource(this._ds);
aElement.ref=this._ref;
aElement.builder.rebuild();
}
this._current=aElement;
},
get _uri(){
const directoryService=Components.classes['@mozilla.org/file/directory_service;1']
.getService(Components.interfaces.nsIProperties);
var file = directoryService.get('ProfD',
Components.interfaces.nsILocalFile);
file.append("externalapp.rdf");
if(!file.exists())
file.create(file.NORMAL_FILE_TYPE,0666);
return this.getURLFromFile(file);
},
getURLFromFile:function(aFile){
const ioService=Components.classes['@mozilla.org/network/io-service;1']
.getService(Components.interfaces.nsIIOService);
return ioService.newFileURI(aFile).spec;
},
get _ref()
{
return "urn:externalapp:buttons";
},
settings : function()
{
window.open("chrome://externalapp/content/settings.xul","_blank","chrome,modal");
},
properties : function(name)
{
window.open("chrome://externalapp/content/properties.xul",name,"chrome,modal");
},
get _ns(){
return "http://forums.mozillazine.org/rdf/externalapp#";
},
_arc:function(aName){
return this._rdfService.GetResource(this._ns + aName);
},
_getArguments :function(aStr){
var arguments=[];
var addressbar =this.address;
var selectedtext=this.selected;
var clipboard =this.clipboard;
var argumentstext=aStr.split(/\s/);
while(argumentstext.length > 0){
var text= argumentstext.shift();
text=text.replace(/\\\\/g , "%backslash%");
text=text.replace(/\\s/g , " ");
text=text.replace(/\\a/g , "\a");
text=text.replace(/\\e/g , "\e");
text=text.replace(/\\f/g , "\f");
text=text.replace(/\\n/g , "\n");
text=text.replace(/\\r/g , "\r");
text=text.replace(/\\t/g , "\t");
text=text.replace(/\\v/g , "\v");
text=text.replace(/\\/g , "");
text=text.replace(/%backslash%/g , "\\");
text=text.replace(/%addressbar%/g , addressbar);
text=text.replace(/%selectedtext%/g , selectedtext);
text=text.replace(/%clipboard%/g , clipboard);
if(text !="") arguments.push(text);
}
return arguments;
},
_launch :function(path,aArg){
try{
if(!path)
return false;
var file = Components.classes['@mozilla.org/file/local;1']
.createInstance(Components.interfaces.nsILocalFile);
var process = Components.classes['@mozilla.org/process/util;1']
.createInstance(Components.interfaces.nsIProcess);
file.initWithPath(path);
if(! file.exists())
return false;
if(! file.isExecutable() || path.match(/\.lnk$/i)){
file.launch();
return true;
}
process.init(file);
var arguments=this._getArguments(aArg);
process.run(false, arguments, arguments.length);
return true;
}catch(e){ alert(e);return false;}
return false; // avoid JavaScript Error.
},
get clipboard(){
try{
var pastetext="";
var clip = Components.classes["@mozilla.org/widget/clipboard;1"]
.createInstance(Components.interfaces.nsIClipboard);
if (!clip) return "";
var trans = Components.classes["@mozilla.org/widget/transferable;1"]
.createInstance(Components.interfaces.nsITransferable);
if (!trans) return "";
trans.addDataFlavor("text/unicode");
clip.getData(trans,clip.kGlobalClipboard);
var str=new Object();
var strLength=new Object();
trans.getTransferData("text/unicode",str,strLength);
if (str) str=str.value.QueryInterface(Components.interfaces.nsISupportsString);
if (str) pastetext=str.data.substring(0,strLength.value / 2);
return pastetext;
}catch(e){}
return "";
},
get selected(){
try{
var selectedtext="";
var focusedWindow = document.commandDispatcher.focusedWindow;
if (!focusedWindow || focusedWindow == window)
focusedWindow=window._content;
selectedtext = focusedWindow.getSelection().toString();
return selectedtext;
}catch(e){}
return "";
},
get address(){
var urlbar=document.getElementById("urlbar");
return ( urlbar ) ? urlbar.value:"";
},
launch : function(aPath,aArg){
if(! this._launch(aPath,aArg))
this.settings();
},
invalidateWindows : function(){
try{
this._flush();
var browserWindows=this._wm.getZOrderDOMWindowEnumerator('navigator:browser',true);
while(browserWindows.hasMoreElements())
{
var browserWindow=browserWindows.getNext();
if("ExternalAppRebuild" in browserWindow.top)
browserWindow.top.setTimeout(ExternalAppRebuild,0);
}
}catch(e){ return;}
},
///////////RDF//////////
_rdfService : null,
_ds : null,
_container : null,
_init: function(){
//// INIT this.Datasource////////
this._rdfService = Components.classes["@mozilla.org/rdf/rdf-service;1"]
.getService(Components.interfaces.nsIRDFService);
this._wm = Components.classes['@mozilla.org/appshell/window-mediator;1']
.getService(Components.interfaces.nsIWindowMediator);
this._ds=this._rdfService.GetDataSourceBlocking( this._uri );
//// INIT this.Container ///////
this._container = Components.classes["@mozilla.org/rdf/container;1"]
.getService(Components.interfaces.nsIRDFContainer);
var RDFCUtils = Components.classes['@mozilla.org/rdf/container-utils;1']
.getService(Components.interfaces.nsIRDFContainerUtils);
var ContainerResource=this._rdfService.GetResource("urn:externalapp:buttons");
if( RDFCUtils.IsContainer(this._ds,ContainerResource ) )
this._container.Init(this._ds, ContainerResource);
else this._container=RDFCUtils.MakeSeq(this._ds,ContainerResource);
},
clearData: function(){
var resources=this._container.GetElements();
var resource=null;
while(resources.hasMoreElements()){
resource=resources.getNext();
resource=resource.QueryInterface(Components.interfaces.nsIRDFNode);
this._container.RemoveElement(resource,false);
this._unassert(this._ds,resource);
}
this.invalidateWindows();
},
appendData : function (){
var fp = Components.classes["@mozilla.org/filepicker;1"]
.createInstance(Components.interfaces.nsIFilePicker);
fp.init(window, 'Externe Anwendung', Components.interfaces.nsIFilePicker.modeOpen);
fp.appendFilters(Components.interfaces.nsIFilePicker.filterApps);
fp.appendFilters(Components.interfaces.nsIFilePicker.filterAll);
var ret = fp.show();
if (ret != Components.interfaces.nsIFilePicker.returnOK) return;
var file = fp.file.QueryInterface(Components.interfaces.nsILocalFile);
this.appendDataFromFile(file)
},
_apendData: function(aResource,label,path,tooltiptext,image,key,arguments){
this._ds.Assert(aResource, this._arc("label"), this._rdfService.GetLiteral(label), true);
this._ds.Assert(aResource, this._arc("path"), this._rdfService.GetLiteral(path), true);
this._ds.Assert(aResource, this._arc("tooltiptext"), this._rdfService.GetLiteral(tooltiptext), true);
this._ds.Assert(aResource, this._arc("image"), this._rdfService.GetLiteral(image), true);
this._ds.Assert(aResource, this._arc("key"), this._rdfService.GetLiteral(key), true);
this._ds.Assert(aResource, this._arc("arguments"), this._rdfService.GetLiteral(arguments), true);
},
_flush:function(){
this._ds.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource)
.Flush();
},
getProperty: function(aResource,aProp)
{
var node=this._ds.GetTarget(aResource,this._arc(aProp),true);
if(node)
return node.QueryInterface(Components.interfaces.nsIRDFLiteral).Value;
else
return "";
},
updateData: function(aURI,label,path,tooltiptext,image,key,arguments){
var resource=this._rdfService.GetResource(aURI);
this._unassert(this._ds,resource);
this._apendData(resource,label,path,tooltiptext,image,key,arguments);
},
appendDataFromFile : function(aFile){
var size = nsPreferences.getIntPref('externalapp.default.iconsize',16);
var prefix = nsPreferences.copyUnicharPref('externalapp.default.tooltiptext_prefix',"Verkn\u00FCpfung mit ");
var path = aFile.path;
var image = "moz-icon:"+this.getURLFromFile(aFile)+"?size="+ size.toString();
var label = aFile.leafName;
var tooltiptext = prefix+label;
if(label.match(/(.+)\.[a-zA-Z0-9]+$/))
label=RegExp.$1;
var itemResource=this._rdfService.GetResource("urn:externalapp:"+this.IDmaker());
if (this._container.IndexOf(itemResource)==-1)
this._container.AppendElement(itemResource);
else
this._unassert(this._ds,itemResource);
this._apendData(itemResource,label,path,tooltiptext,image,"","");
this.invalidateWindows();
},
removeData : function(resid){
var itemResource=this._rdfService.GetResource(resid);
if(this._container.IndexOf(itemResource)<0) return;
this._container.RemoveElement(itemResource,true);
this._unassert(this._ds,itemResource);
this.invalidateWindows();
},
move :function(FromURI,ToURI){
var FromResource=this._rdfService.GetResource(FromURI);
var ToResource=this._rdfService.GetResource(ToURI);
var FromIndex=this._container.IndexOf(FromResource);
var ToIndex=this._container.IndexOf(ToResource);
if(FromIndex<0) return;
if(ToIndex<0) return;
this._container.RemoveElement(FromResource,true);
this._container.InsertElementAt(FromResource,ToIndex,true);
this.invalidateWindows();
},
//////Utilities////////////////
_unassert: function (dsource,node)
{
var props=dsource.ArcLabelsOut(node);
while(props.hasMoreElements()){
var prop=props.getNext();
var target=dsource.GetTarget(node,prop,true);
dsource.Unassert(node,prop,target);
}
},
IDmaker : function()
{
var d= new Date();
return d.getTime().toString();
}
};
PK
wVn1@@ , content/externalapp/externalappCTOverlay.xul
PK
An1c c * content/externalapp/externalappOverlay.xul
%browserDTD;
%externalappDTD;
]>
PK ND9Ӽ* 9 ! content/externalapp/properties.jsWmo6
NZQ,K6ٰ֢MWIBQH9qI9$ͧZTPiU}겂Z1iv(Y6u3!L0uHF$5g2DX9iyjFRHϏzpKw'N^_@o^{KєR*JG' {t\?i4N8i깣IP\;7tUGiu2VfTYr*6ٮÒGvd
|0]o&=Hp᠅N(:h _=o3dLLDZ^:似8 8&.5+/5sUSQP݁cVw uZVѼaRY nWXy)*:MlY]caw:q7eއUܛ]W{,)oNa$qHr έhm$pHSe|f \n4lŋ-h⡪p8C~W^,!B&w4V$&IGw-S0_
G:_nb8ȾMcoک[gBo5գE4:dKf5ؖ5x=PɜrfdB.YɟHLb%r?gEc2XYa0`*~e8fv>2z6 fYAMߪ:"_O[~듕#EWݦ+ĖNu08;J?St둲-*^UjkŰ`ej¬#$\Vv16cq|$J,F>RĬQMyx [վK
!ćkP&rPK ND9Gl% " content/externalapp/properties.xulXm8' :>дXNBHCNn6f8mwWyqs}Y^tV3<3;mrR\3r>$0Sc-g$*QrAE.xW%6:JB(ʪ
Zd*͙
.;go_x
RN\_ AL`TGQ9jF2KT_a.4*`W9Uf!Hgb!W,UtXO={RVuZk^0_K/-8+\p8nRŨb4q|-PU'Yh|_~.7Mѵ:y!o6G_2ebE-͜J_͖T(̜s-LGe]$e͋TÂ
/ּ7(L+FR9z~%y}q:-i-D1r^RQ[#ͮbZb&VB$I3B3Dh\fg$_k%&5{ae|m ndXe}p}?Fj:/\3=qm³.S=HB]o~[ ?}ΎN:mC*5{S)h;gY#,FX!'϶cE'GA2n>2v:8^<\Y)); eWO-顕ܐM85ofp=e8R+נ}W|b[*;ەXM5Wdc_mpGeg[Ĵw\"Km@p+ZJqOp{xzZZWRy kȪycpnĊ `+;a'D>v^Z=Y$2im/s״Dck\#`+dv8cFY=r$EOVYl#Phrg?jf$$c|駏y37$KEccUćqjOJҠ1f8;8&~"ذ:U{/iaYHb&_7_MM˭a{$9B1l1FoYOcA7UOO`{+fp>!A:JYe?1S\}ǏȖ|`6iP|GcU-M;ֿxNn)etst` 9Po=
sՖ~IןZ˩]GޟG$4m1l +- C08rA7Z
lH~;eG<ZmMc. rM&0p.ru(&ؼ[vx7.v6h.tKpk٘x"xJ~R?vؖӧCx\(AU3aGd>#PK ND9ĭ~> 1 content/externalapp/settings.xulUmo6_qlh@>Ė.̀`Z 鰠+F:l(R Oa}G8J']&yw{H.lKnyeMIY,O=45 U³%Qh{-7pWA(2 xrgUޟ^^}8cw40\syE.>be|o6wJk[WؕS($
@EC\Xc{~{ܕuu{;ewjHjJ-L24.>@ 8O{n "Umg{7$(k~dqohY0t=I[ߣLV
'>c$
Zr&E`i7oms=a7+0?,ByJYPUaa lp<1ճ/i^R!H0PFḩ hƅuum,m-a,*A('p<:e5{R13
N u|`9Mņvt$2Ӎq}3(=Rt~ͷp&ISkM[>%ô;o]ҠWtݬ*rxRaۥGH˥IѾiPK
.=^ license.txtThe following liscense applies to all files
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this archive 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.
*
* Contributor(s):
*
* 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.
PK
g9 locale/PK
g9
locale/fr-FR/PK
g9 locale/fr-FR/externalapp/PK
1. . % locale/fr-FR/externalapp/contents.rdf
PK
9M$ ( locale/fr-FR/externalapp/externalapp.dtd
PK
.W5 skin/PK
.W5
skin/classic/PK
g9 skin/classic/externalapp/PK
`0&X2 2 % skin/classic/externalapp/contents.rdf
PK
Wu:1 &