Nickolay - Scope.Provider-0.02
Name
Scope.Provider.IFrame - scope provider, which uses the iframe.
SYNOPSIS
var provider = new Scope.Provider.IFrame()
provider.setup(function () {
if (provider.scope.SOME_GLOBAL == 'some_value') {
...
}
provider.runCode(text, callback)
...
provider.runScript(url, callback)
...
provider.cleanup()
})
DESCRIPTION
Scope.Provider.IFrame
is an implementation of the scope provider, which uses the iframe,
to create a new scope.
ISA
DOES
GETTING HELP
This extension is supported via github issues tracker: http://github.com/SamuraiJack/Scope-Provider/issues
For general Joose questions you can also visit #joose on irc.freenode.org or the forum at: http://joose.it/forum
SEE ALSO
Web page of this module: http://github.com/SamuraiJack/Scope-Provider/
General documentation for Joose: http://openjsan.org/go/?l=Joose
BUGS
All complex software has bugs lurking in it, and this module is no exception.
Please report any bugs through the web interface at http://github.com/SamuraiJack/Scope-Provider/issues
AUTHORS
Nickolay Platonov nplatonov@cpan.org
COPYRIGHT AND LICENSE
This software is Copyright (c) 2010 by Nickolay Platonov nplatonov@cpan.org.
This is free software, licensed under:
The GNU Lesser General Public License, Version 3, June 2007
Class('Scope.Provider.IFrame', { isa : Scope.Provider, does : Scope.Provider.Role.WithDOM, have : { sourceURL : '/jsan/Scope/Provider/static/stub.html', iframe : null }, methods : { getDocument : function () { return this.iframe.contentWindow.document }, setup : function (callback) { var me = this var doc = this.parentWindow.document var iframe = this.iframe = doc.createElement('iframe') var subCallback = function () { callback(me) } if (iframe.attachEvent) iframe.attachEvent('onload', subCallback) else iframe.onload = subCallback iframe.src = this.sourceURL doc.body.appendChild(iframe) this.scope = iframe.contentWindow }, cleanup : function () { var iframe = this.iframe iframe.onload = null this.parentWindow.document.body.removeChild(iframe) } } }) /** Name ==== Scope.Provider.IFrame - scope provider, which uses the iframe. SYNOPSIS ======== var provider = new Scope.Provider.IFrame() provider.setup(function () { if (provider.scope.SOME_GLOBAL == 'some_value') { ... } provider.runCode(text, callback) ... provider.runScript(url, callback) ... provider.cleanup() }) DESCRIPTION =========== `Scope.Provider.IFrame` is an implementation of the scope provider, which uses the iframe, to create a new scope. ISA === [Scope.Provider](../Provider.html) DOES ==== [Scope.Provider.Role.WithDOM](/doc/s/sa/samuraijack/Scope/Provider/002/lib/Scope/Provider/Role/WithDOM.html) GETTING HELP ============ This extension is supported via github issues tracker: <http://github.com/SamuraiJack/Scope-Provider/issues> For general Joose questions you can also visit [#joose](http://webchat.freenode.net/?randomnick=1&channels=joose&prompt=1) on irc.freenode.org or the forum at: <http://joose.it/forum> SEE ALSO ======== Web page of this module: <http://github.com/SamuraiJack/Scope-Provider/> General documentation for Joose: <http://openjsan.org/go/?l=Joose> BUGS ==== All complex software has bugs lurking in it, and this module is no exception. Please report any bugs through the web interface at <http://github.com/SamuraiJack/Scope-Provider/issues> AUTHORS ======= Nickolay Platonov <nplatonov@cpan.org> COPYRIGHT AND LICENSE ===================== This software is Copyright (c) 2010 by Nickolay Platonov <nplatonov@cpan.org>. This is free software, licensed under: The GNU Lesser General Public License, Version 3, June 2007 */