X-Git-Url: https://git.donarmstrong.com/?p=x_full.git;a=blobdiff_plain;f=.mozilla%2Ffirefox%2Fdefault%2Fextensions%2Fitsalltext%40docwhat.gerf.org%2Fchrome%2Fcontent%2FAPI.js;fp=.mozilla%2Ffirefox%2Fdefault%2Fextensions%2Fitsalltext%40docwhat.gerf.org%2Fchrome%2Fcontent%2FAPI.js;h=0000000000000000000000000000000000000000;hp=2e862cd6ee0551872146df4cb650bf5c90e84f5f;hb=de3411215abf07131881782d5299fabf3d65cfda;hpb=cdb077134ec3e62704a2f6ee949755c7a140b87f
diff --git a/.mozilla/firefox/default/extensions/itsalltext@docwhat.gerf.org/chrome/content/API.js b/.mozilla/firefox/default/extensions/itsalltext@docwhat.gerf.org/chrome/content/API.js
deleted file mode 100644
index 2e862cd..0000000
--- a/.mozilla/firefox/default/extensions/itsalltext@docwhat.gerf.org/chrome/content/API.js
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- This file is used to allow external editors to work inside your chrome XUL.
-
- ***** How To Use This API *****
- Add this script line to your .xul file:
-
-
- If "It's All Text!" isn't installed in the browser, it will fail safely.
- It only generates an info message in the error console.
-
- You then have two choices. You can call ItsAllTextopenEditor() directly
- via JavaScript or you can add one or two attributes to a XUL element and
- it'll automatically be set up right.
-
- The suggested method is to add the correct attributes to your XUL button
- or menuitem and let "It's All Text!" do it for you.
-
- Attributes:
- 'itsalltext-control' -- This should be set to the id of the textbox
- that you want to edit when command is executed
- on this XUL element. This is required.
- 'itsalltext-extension' -- This is the file extension. Include the
- leading dot character. Example: '.css'
- It defaults to '.txt' and is optional.
-
- If you don't want this XUL element to be visible unless "It's All Text!"
- is installed, then you should set it's CSS style display to 'none'.
-
- Example using attributes (recommended method):
-
-
-
-
-
- Example calling openEditor() directly:
- if(some_condition && ItsAllText) {
- ItsAllText.openEditor('id-of-textarea', '.extension');
- }
-
- */
-
-(function () {
- /* Load up the main It's All Text! file */
- var objScriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"].getService(Components.interfaces.mozIJSSubScriptLoader);
- objScriptLoader.loadSubScript('chrome://itsalltext/content/itsalltext.js');
-
- var onload = function (event) {
- /* Start watching the document, but force it. */
- ItsAllText.monitor.watch(document, true);
-
- /* Turn on all the hidden CSS */
- var nodes = [];
- var nodesIter = document.evaluate("//node()[@itsalltext-control]",
- document, null,
- XPathResult.UNORDERED_NODE_ITERATOR_TYPE, null);
-
- var node = nodesIter.iterateNext();
- while (node) {
- nodes.push(node);
- node = nodesIter.iterateNext();
- }
- var command = function(event) {
- ItsAllText.openEditor( this.getAttribute("itsalltext-control"),
- this.getAttribute("itsalltext-extension") );
- return false;
- };
- for(i in nodes) {
- node = nodes[i];
- node.addEventListener('command', command, true);
- node.style.display = '-moz-box';
- }
-
- };
- window.addEventListener("load", onload, true);
-})();
-
-/**
- * This is part of the public XUL API.
- * Use this to open an editor for a specific textarea or textbox with
- * the id 'id'. The file will have the extension 'extension'. Include
- * the leading dot in the extension.
- * @param {String} id The id of textarea or textbody that should be opened in the editor.
- * @param {String} extension The extension of the file used as a temporary file. Example: '.css' (optional)
- */
-ItsAllText.openEditor = function(id, extension) {
- var node = document.getElementById(id);
- /* The only way I can adjust the background of the textbox is
- * to turn off the -moz-appearance attribute.
- */
- node.style.MozAppearance = 'none';
- var cache_object = node && ItsAllText.getCacheObj(node);
- if(!cache_object) { return; }
- cache_object.edit(extension);
-};
-