• 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

    Build Tag: gallery-2011.11.17-14-56

    Return to MakeNode

    Y.Something= Y.Base.create(
        'something', 
        Y.Widget, 
        [Y.MakeNode], 
        {
     
            renderUI: function () {
                // _makeNode will use the default _TEMPLATE property if none is provided
                this.get('contentBox').append(this._makeNode());
                // _locateNodes will produce properties _labelNode and _iconNode 
                // via the CSS classNames listed in _CLASS_NAMES
                this._locateNodes();
            },
            // The previous code for renderUI is so frequent that MakeNode will add it automatically
            // if it doesn't find any explicit renderUI method in the class or the ones it inherits from.
     
     
            // This _uiSetXxxx methods will be called automatically when the Xxxx attribute changes.
            // There has to be one of this for each attribute listed in _ATTRS_2_UI
            _uiSetLabel: function (value) {
                // _labelNode was produced by _locateNodes
                this._labelNode.setContent(value || '');
            },
            _uiSetIcon: function (value) {
                value = value || 'none';
     
                // MakeNode will create the hash _classNames from _CLASS_NAMES using the values 
                // in that array as keys (for example, 'icon') and the full className as the value
                // (for example: "yui3-something-icon").
                var newName = this._classNames.icon + '-' + value;
                this.get('boundingBox').replaceClass(
                    this._prevIconClassName, 
                    newName
                );
                this._prevIconClassName = newName;
            },
     
            // These are the event listeners for the events listed below in _EVENTS.
            // Default listeners are 'after' event listeners (Y.after) so, by default, the functions
            // start with '_after', then the element it is bound to, with the initial capitalized
            // and then the event type, with the initial capitalized.
            // If a before event is set (Y.on) the listener would be, for example _beforeFormSubmit
            // For delegated events (Y.delegate), it might be:  _delegateListItemClick
            _afterBoundingBoxClick: function (ev) {
     
            },
            _afterBoundingBoxMousedown: function (ev) {
     
            },
            _afterDocumentMouseup: function (ev) {
     
            }
        },
        {
            // This is the default template that _makeNode will use.  
            // You can have several templates if you want any other, just pass it as the first argument to _makeNode.
            // The placeholder {c} will use the className generated for that key in _CLASS_NAMES.
            // The {@} placeholder will read the value of the attribute mentioned.
            _TEMPLATE: '<span class="{c icon}"></span><span class="{c label}">{@ label}</span>',
     
            // MakeNode will generate classNames using ClassNameManager
            _CLASS_NAMES: ['label','icon'],
     
            // MakeNode will set event listeners for nodes listed here and link each type of event 
            // to the method whose name is listed.  Nodes are usually identified by the keys of their classNames
            // as listed in _CLASS_NAMES.  There are also several 'virtual' nodes, such as those used here:
            // boundingBox and document (the document the widget is in) or 
            // THIS the widget itself and Y the Y instance for events broadcast.
            // Event listeners are expected to comply with a naming convention but can be overridden, 
            // along with a series of other alternatives (using before event listeners instead of after, or event delegation)
            _EVENTS: {
                boundingBox: ['click','mousedown' ],
                document: 'mouseup'
                /* Should there be a form whose submittal I might want to supervise, I might do:
                form: {
                	when:'before',
                	type: 'submit'
                }
                */
                /*
                Should I want to use a particular function name, I can do that, for example, 
                for a click on the element with the className key of icon, it would go:
                icon: {
                	type: 'click',
                	fn: '_onIconClick'
                }
                */
            }, 
            ATTRS: {
                label: {
                    value: '',
                    validator: Lang.isString
                },
                icon: {
                    value: null,
                    validator: function(value) {
                        return Lang.isString(value) || Lang.isNull(value);
                    }
                }
            },
     
            // Attributes listed here will have methods named _uiSetXxxx handling any change in them.
            _ATTRS_2_UI: {
                BIND: ['label', 'icon'],
                SYNC: ['label', 'icon']
            }
        }
    );
     

    Build Output

    /home/y/libexec/ant/bin/ant all
    Buildfile: build.xml
         [echo] Starting Build For gallery-makenode
         [echo] Ant Properties
         [echo]     Home : /home/y/libexec/ant
         [echo]     Ant Version : Apache Ant version 1.7.1 compiled on June 27 2008
         [echo]     Build File : /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-makenode/build.xml
         [echo] Local Build Properties
         [echo]     version : 3
         [echo]     srcdir : /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery
         [echo]     builddir : ../../../builder/componentbuild
         [echo]     component : gallery-makenode
         [echo]     component.basefilename : gallery-makenode
         [echo]     component.basedir : /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-makenode
         [echo]     component.builddir : /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-makenode/build_tmp
         [echo] Global Build Properties
         [echo]     global.build.base : /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/build
         [echo]     global.build.component : /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/build/gallery-makenode
         [echo]     global.build.component.assets : /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/build/gallery-makenode/assets
    
    clean:
    
    init:
        [mkdir] Created dir: /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-makenode/build_tmp
         [echo] Starting Build For gallery-makenode
         [echo] Ant Properties
         [echo]     Home : /home/y/libexec/ant
         [echo]     Ant Version : Apache Ant version 1.7.1 compiled on June 27 2008
         [echo]     Build File : /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-makenode/build.xml
         [echo] Local Build Properties
         [echo]     version : 3
         [echo]     srcdir : /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery
         [echo]     builddir : ../../../builder/componentbuild
         [echo]     component : gallery-makenode
         [echo]     component.basefilename : gallery-makenode
         [echo]     component.basedir : /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-makenode
         [echo]     component.builddir : /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-makenode/build_tmp
         [echo] Global Build Properties
         [echo]     global.build.base : /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/build
         [echo]     global.build.component : /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/build/gallery-makenode
         [echo]     global.build.component.assets : /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/build/gallery-makenode/assets
    
    -lint-server:
         [echo] Starting Build For gallery-makenode
         [echo] Ant Properties
         [echo]     Home : /home/y/libexec/ant
         [echo]     Ant Version : Apache Ant version 1.7.1 compiled on June 27 2008
         [echo]     Build File : /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-makenode/build.xml
         [echo] Local Build Properties
         [echo]     version : 3
         [echo]     srcdir : /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery
         [echo]     builddir : ../../../builder/componentbuild
         [echo]     component : gallery-makenode
         [echo]     component.basefilename : gallery-makenode
         [echo]     component.basedir : /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-makenode
         [echo]     component.builddir : /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-makenode/build_tmp
         [echo] Global Build Properties
         [echo]     global.build.base : /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/build
         [echo]     global.build.component : /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/build/gallery-makenode
         [echo]     global.build.component.assets : /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/build/gallery-makenode/assets
    
    -node:
         [echo] For faster builds, install Node.js.
    
    -concatdebug:
         [echo] Concatenating
         [echo]     Source Files : gallery-makenode.js
         [echo]     In Source Dir : /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-makenode/js
         [echo]     To : /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-makenode/build_tmp/gallery-makenode-debug.js
         [copy] Copying 1 file to /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-makenode/build_tmp/ant
       [delete] Deleting directory /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-makenode/build_tmp/ant
    
    -registerdebug:
         [echo] Wrapping /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-makenode/build_tmp/gallery-makenode-debug.js in YUI.add module
         [copy] Copying 1 file to /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-makenode/build_tmp
    
    -prependdebug:
    
    -appenddebug:
    
    builddebug:
    
    -createcore:
         [copy] Copying 1 file to /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-makenode/build_tmp
    
    -loggerregex:
         [echo] Replacing Logger Statements in /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-makenode/build_tmp/gallery-makenode.js
    
    buildcore:
    
    -rollupjs:
    
    -concatskins:
    
    -buildskins:
    
    -rollupcss:
    
    buildskins:
    
    -buildlangs:
    
    -rolluplangs:
    
    buildlangs:
    
    build:
    
    minify:
    [yuicompressor] Compressing /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-makenode/build_tmp/gallery-makenode.js
    [yuicompressor] 
    [yuicompressor] [WARNING] Invalid hint syntax: use strict
    [yuicompressor] add("gallery-makenode",function(Y){ ---> "use strict" <--- ;if(Y.version==="3.4.0"){
    [yuicompressor] 
    [yuicompressor] [WARNING] The symbol DUPLICATE is declared but is apparently never used.
    [yuicompressor] This code can probably be written in a more compact way.
    [yuicompressor] ="boundingBox",Lang=Y.Lang, ---> DUPLICATE <--- =' for "{name}" defined in class {recentDef} also defined in class {prevDef}',parsingRegExp=/^(?:([ t]+)|("[^"\]*(?:\.[^"\]*)*")|(true)|(false)|(null)|([-+]?[0-9]*(?:.[0-9]+)?))/,quotesRegExp=/\"/g
    [yuicompressor] Compressed to /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-makenode/build_tmp/gallery-makenode-min.js
    
    lint:
         [echo] Using Rhino. Install nodejs to improve jslint speed, or skip with -Dlint.skip=true
         [java] Running JSLint on : /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-makenode/build_tmp/gallery-makenode-debug.js
         [java] - OK
         [java] Running JSLint on : /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-makenode/build_tmp/gallery-makenode-min.js
         [java] - OK
         [java] Running JSLint on : /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-makenode/build_tmp/gallery-makenode.js
         [java] - OK
    
    local:
    
    deploybuild:
         [copy] Copying 3 files to /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/build/gallery-makenode
         [copy] Copying /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-makenode/build_tmp/gallery-makenode.js to /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/build/gallery-makenode/gallery-makenode.js
         [copy] Copying /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-makenode/build_tmp/gallery-makenode-debug.js to /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/build/gallery-makenode/gallery-makenode-debug.js
         [copy] Copying /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-makenode/build_tmp/gallery-makenode-min.js to /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/build/gallery-makenode/gallery-makenode-min.js
    
    deployassets:
    
    deployskins:
    
    deploylang:
    
    deploydocs:
    
    deploy:
    
    all:
    
    BUILD SUCCESSFUL
    Total time: 4 seconds

    © 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