• Register
  • Log In
  • Home
  • Quick Start
    • Configurator
    • Download YUI 3
  • Documentation
    • User Guides
    • Examples
    • API Docs
    • Environments
    • Tutorials
  • Community
    • Gallery
    • Blog
    • Forums
    • YUI Theater
    • Calendar
  • Contribute
    • YUI on GitHub »
    • File a Ticket
    • View Tickets
    • Dashboard
  • Other Projects
    • Shifter »
    • Yogi »
    • YUI 2
    • YUI Doc »
    • YUI Test
    • YUI Website
    • YUI Compressor »
    • YUI Builder »
    • YUI PHP Loader
    • Grid Builder »
    • Skin Builder »
  • YUI
  • >
  • Community
  • >
  • Gallery

Gallery

Modules

  • Home
  • Featured
  • Popular
  • New
  • All

Documentation

  • Yogi Documentation
  • Shifter Documentation
  • Developer Guide
  • Module Setup

Tag Cloud

Context Navigation

    YUI Library is not responsible for bugs or support with this module. It is available as a free service. For support please contact the module owner with the provided links.

    Bootstrap Engine (gallery-bootstrap-engine) on cdn

    Last Updated: 07/6/11
    + 0 -

    Caridy Patino

    YUI Contributor

    See 11 more by this user.

    Created: 05/1/11
    Last CDN Push: 10/27/11
    Build Tag: gallery-2011.10.27-17-03
    Project: YUI 3
    License: YUI BSD
    YUI Version: 3.3.0
    Free for use.

    Overview

    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.

    Usage

    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

    });

    Tests

    Run this test in your browser and report any issue.

    • http://caridy.name/sandbox/yui3-gallery/src/gallery-bootstrap-engine/tests/test_bootstrap.html

    Note: Make sure you include OS, Browser Version and the test result from YUI Console in your ticket.

    CHANGELOG

    Check the latest changes in this module.

    • http://github.com/caridy/yui3-gallery/tree/master/src/gallery-bootstrap-engine/
    • Tags:
    • caridy
    • Download
    • Docs
    • Homepage
    • Bugs
    • Source
    • Example
    • Forum
    • History

    Few facts about this example:

    • "container" represents the placeholder (selector) for the dynamic iframe hosting the bootstrap object.
    • "iframe" represents the element (node) for the dynamic iframe hosting the bootstrap object.

    Code Sample

    <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