Caridy Patino![]()
Bootstrap Engine for Plug and Play widgets. This class is meant to be used in conjunction with the Injection Engine (gallery-bootstrap-engine). It facilitates the use of an iframe as a sandbox to execute certain tasks and/or a presentation element.
BootstrapEngine extends Base, here is the syntax to create a engine obj:
// Call the "use" method, passing in "gallery-bootstrap-engine". This will
// load the bootstrap engine module and all the required dependencies.
YUI().use('gallery-bootstrap-engine', function(Y) {new (Y.Base.create('custom-bootstrap-engine', Y.BootstrapEngine, [], {
/**
* Basic initialization routine, usually to create markup, new objects and attributes, etc.
*
* @method _init
* @protected
*/
_init: function () {
// create the markup based on Y.one('body') which represents the iframe body
// enhance the host page markup using this.get('HOST').one('body') which represents
// the body of the host page
},/**
* Defines the binding logic for the bootstrap engine, listening for some attributes
* that might change, and defining the set of events that can be exposed to the injection engine.
* It also can define the set of events that can be exposed to the HOST doc.
* @method _bind
* @protected
*/
_bind: function () {
// bind some stuff if needed before calling ready
},/**
* Bootstrap is ready, let's do something awesome.
*
* @method _ready
* @protected
*/
_ready: function () {
this.doSomething();
},
doSomething: function() {
// doing something awesome
}
}, {
ATTRS: {
tete: {
value: 1
},
lolo: {
value: 'an string'
},
simple: {
writeOnce: true
}
}
}))(); // finishing the initialization routine});
Run this test in your browser and report any issue.
Note: Make sure you include OS, Browser Version and the test result from YUI Console in your ticket.
Check the latest changes in this module.
Few facts about this example:
<script src="http://yui.yahooapis.com/3.3.0/build/yui/yui-min.js"></script>YUI({
//Last Gallery Build of this module
gallery: 'gallery-2011.10.27-17-03'
}).use('gallery-bootstrap-engine', function(Y) {
new (Y.Base.create('custom-bootstrap-engine', Y.BootstrapEngine, [], {
/**
* Basic initialization routine, usually to create markup, new objects and attributes, etc.
*
* @method _init
* @protected
*/
_init: function () {
// create the markup based on Y.one('body') which represents the iframe body
// enhance the host page markup using this.get('HOST').one('body') which represents
// the body of the host page
},
/**
* Defines the binding logic for the bootstrap engine, listening for some attributes
* that might change, and defining the set of events that can be exposed to the injection engine.
* It also can define the set of events that can be exposed to the HOST doc.
* @method _bind
* @protected
*/
_bind: function () {
// bind some stuff if needed before calling ready
},
/**
* Bootstrap is ready, let's do something awesome.
*
* @method _ready
* @protected
*/
_ready: function () {
this.doSomething();
},
doSomething: function() {
// doing something awesome
}
}, {
ATTRS: {
tete: {
value: 1
},
lolo: {
value: 'an string'
},
simple: {
writeOnce: true
}
}
}))(); // finishing the initialization routine
});
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info