Loading...

google-caja-discuss@googlegroups.com

[Prev] Thread [Next]  |  [Prev] Date [Next]

[Caja] [google-caja] r4841 committed - Deleted wiki page HostTools through web user interface. google-caja Wed Apr 04 13:01:33 2012

Revision: 4841
Author:   [EMAIL PROTECTED]
Date:     Wed Apr  4 13:07:56 2012
Log:      Deleted wiki page HostTools through web user interface.
http://code.google.com/p/google-caja/source/detail?r=4841

Deleted:
 /wiki/HostTools.wiki

=======================================
--- /wiki/HostTools.wiki        Fri Apr  8 13:23:17 2011
+++ /dev/null
@@ -1,73 +0,0 @@
-#summary Library for host pages.
-#labels Deprecated
-
-host-tools.js is a library for Caja gadget/module host pages.
-
-It provides a single global variable, !HostTools, which is a constructor with no parameters. You generally only need one !HostTools object per page, but it's not a singleton just in case.
-
-If you're using caja.js, then `caja.hostTools` is an instance of !HostTools; see HostingModules for configuration information.
-
-If you're not using caja.js, you construct HostTools yourself; and see CajaRuntimeFiles for information on what JS files host-tools.js depends on.
-
-== !HostTools object ==
-
-{{{
-    var hostTools = new HostTools();
-}}}
-
-The methods of !HostTools objects are:
-
- * setBaseURL(_url_) -- Specify a URL (string) which module loading should be relative to. The default is `document.location.toString()` (though it ought to be the base URL of the page instead).
-
- * setCajolerService(_url_) -- Specify the URL to the cajoling service. The default is `"http://caja.appspot.com/cajole"`. You should change this to your own server if you don't want to rely on ours, or are testing and cajoling content from `http://localhost`.
-
- * getLoad() -- Return a module loading function (`load`(_moduleID_) => _moduleFunction_) configured according to the above settings. Usually `Sandbox.run` is used instead.
-
- * Sandbox() -- Constructor for Sandbox objects.
-
-In the typical case, you don't need to do any configuration and can just create Sandboxes.
-
-== Sandbox object ==
-
-{{{
-    var sandbox = new hostTools.Sandbox();
-}}}
-
-A Sandbox object manages particular authorities a module will receive. In particular, for gadgets (modules which control portions of a HTML document), there is one Sandbox per gadget.
-
-The methods/properties of Sandbox objects are:
-
- * attach(_vdocBody_`[`, _options_`]`) -- Grant access to a particular portion of the page. _vdocBody_ should be a HTML DOM element, such as a `<div>`. _options_ is an optional object; currently the only significant property is `valija`, which may be given a value of `false` to disable loading Valija in the sandbox, which is not usually of interest. It is not recommended to `attach` the same Sandbox more than once; the consequences are not well considered.
-
- * imports -- This property is the imports object which will be given to loaded modules. You can add objects of your own to it to give additional authority/communication channels to the module, or instantiate modules with it if you've loaded them by other means.
-
- * run(_moduleID_) -- Load and instantiate the specified module with the current imports. Unless otherwise configured (not currently possible), the module ID is a relative URL to uncajoled HTML or !JavaScript.
-
- * runCajoledModuleString(_moduleSource_) -- Load and instantiate the module whose _cajoled_ form is the provided string. *THIS IS NOT A SAFE EVAL. DO NOT PROVIDE UNTRUSTED INPUT.* The purpose of this operation is to allow pages which include cajoled HTML in their source to also embed the cajoled !JavaScript.
-
-== Complete example ==
-
-With `caja.js`:
-
-{{{
-<div id="theGadget"></div>
-<script type="text/javascript">
-    loadCaja(function (caja) {
-        var sandbox = new caja.hostTools.Sandbox();
-        sandbox.attach(document.getElementById("theGadget"));
-        sandbox.run("http://www.thinkfu.com/trivial.html");
-    });
-</script>
-}}}
-
-Without `caja.js`:
-
-{{{
-<div id="theGadget"></div>
-<script type="text/javascript">
-    var hostTools = new HostTools();
-    var sandbox = new hostTools.Sandbox();
-    sandbox.attach(document.getElementById("theGadget"));
-    sandbox.run("http://www.thinkfu.com/trivial.html");
-</script>
-}}}