Changes between Initial Version and Version 1 of Website/Lokaler Editor


Ignore:
Timestamp:
May 28, 2014, 11:05:18 AM (10 years ago)
Author:
sven
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Website/Lokaler Editor

    v1 v1  
     1= Lokaler Editor von Heribert =
     2Heribert hat für den schnellen Zugriff in seinem Browser das [[https://addons.mozilla.org/de/firefox/addon/dafizilla-viewsourcewith/|Firefox-Plugin ViewSourceWith]] installiert.
     3
     4== Konfigurationsscript (Mapping) ==
     5Konfiguration für ''Server pages mapping list'':
     6
     7{{{
     8// You receive the object data containing the following elements
     9// data.uri         the URI data
     10//                  see nsIURL at http://www.xulplanet.com/references/xpcomref/comps/c_networkstandardurl1.html
     11// data.localPath   the localPath defined in urlMapper dialog (should be empty or null)
     12// data.domainFilter the domainFilter defined in urlMapper dialog
     13// data.pageSourcePath the path to page source retrieved by browser
     14// data.line        the line number, useful when called from JS console
     15// data.column      the column number, useful when called from JS console
     16var localPath = data.localPath;
     17var uri = data.uri.spec;
     18var dirSep = top.window.navigator.platform.indexOf("Win") < 0 ? "/" : "\\";
     19// Contains the file name(s) to open
     20var arFiles = new Array();
     21
     22// t29v6: Lokalen Pfad aus Metaelement rauslesen
     23try {
     24  doc = gBrowser.contentDocument;
     25//  localfile = doc.defaultView.jQuery("meta[name='t29.localfile']").attr("content");
     26  localfile = doc.getElementById("localFileSource").getAttribute("content");
     27  arFiles.push(localfile);
     28  return arFiles;
     29} catch(e) {
     30 // alert("Konnte Quelltext nicht lokalisieren, versuche Standardverfahren");
     31} // end try catch
     32
     33var re = new RegExp(data.domainFilter, "g");
     34var fileName = re.exec(uri);
     35// Try to append extra paths
     36if (fileName) {
     37    fileName = uri.substring(re.lastIndex);
     38    // remove the text following query (?), ref (#), param (;)
     39    fileName = fileName.replace(/[#?;].*$/, "");
     40    // Under Windows adjust path separators
     41    if (dirSep == "\\") {
     42        fileName = fileName.replace(/\//g, dirSep);
     43    }
     44} else {
     45    fileName = data.uri.fileName;
     46}
     47// You can open more than one file simply returning
     48// their full pathnames in array shown below
     49// By default only two files are returned having the same name to requested one
     50// Suppose your localPath points to ~/vsw/htdocs/vsw
     51// The browser points to:
     52// http://dafizilla.sourceforge.net/viewsourcewith/faq.php
     53// The file name in URL is faq.php so the local file is:
     54// ~/vsw/htdocs/vsw/faq.php
     55
     56// comment line below if you don't want to open the temporary file
     57//arFiles.push(data.pageSourcePath);
     58if(fileName.substr(-1) == "\\") {
     59    fileName += "index.shtml";
     60}
     61
     62
     63arFiles.push(localPath + dirSep + fileName);
     64
     65return arFiles;
     66 
     67}}}
© 2008 - 2013 technikum29 • Sven Köppel • Some rights reserved
Powered by Trac
Expect where otherwise noted, content on this site is licensed under a Creative Commons 3.0 License