| 1 | = Lokaler Editor von Heribert = |
| 2 | Heribert 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) == |
| 5 | Konfiguration 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 |
| 16 | var localPath = data.localPath; |
| 17 | var uri = data.uri.spec; |
| 18 | var dirSep = top.window.navigator.platform.indexOf("Win") < 0 ? "/" : "\\"; |
| 19 | // Contains the file name(s) to open |
| 20 | var arFiles = new Array(); |
| 21 | |
| 22 | // t29v6: Lokalen Pfad aus Metaelement rauslesen |
| 23 | try { |
| 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 | |
| 33 | var re = new RegExp(data.domainFilter, "g"); |
| 34 | var fileName = re.exec(uri); |
| 35 | // Try to append extra paths |
| 36 | if (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); |
| 58 | if(fileName.substr(-1) == "\\") { |
| 59 | fileName += "index.shtml"; |
| 60 | } |
| 61 | |
| 62 | |
| 63 | arFiles.push(localPath + dirSep + fileName); |
| 64 | |
| 65 | return arFiles; |
| 66 | |
| 67 | }}} |