You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by he...@apache.org on 2016/02/01 18:52:19 UTC

[01/51] [abbrv] [partial] brooklyn-ui git commit: move subdir from incubator up a level as it is promoted to its own repo (first non-incubator commit!)

Repository: brooklyn-ui
Updated Branches:
  refs/heads/master [created] 18b073a95


http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/js/view/entity-sensors.js
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/js/view/entity-sensors.js b/src/main/webapp/assets/js/view/entity-sensors.js
new file mode 100644
index 0000000..282c622
--- /dev/null
+++ b/src/main/webapp/assets/js/view/entity-sensors.js
@@ -0,0 +1,539 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+*/
+/**
+ * Render entity sensors tab.
+ *
+ * @type {*}
+ */
+define([
+    "underscore", "jquery", "backbone", "brooklyn-utils", "zeroclipboard", "view/viewutils", 
+    "model/sensor-summary", "text!tpl/apps/sensors.html", "text!tpl/apps/sensor-name.html",
+    "jquery-datatables", "datatables-extensions", "underscore", "jquery", "backbone", "uri",
+], function (_, $, Backbone, Util, ZeroClipboard, ViewUtils, SensorSummary, SensorsHtml, SensorNameHtml) {
+
+    // TODO consider extracting all such usages to a shared ZeroClipboard wrapper?
+    ZeroClipboard.config({ moviePath: '//cdnjs.cloudflare.com/ajax/libs/zeroclipboard/1.3.1/ZeroClipboard.swf' });
+    
+    var sensorHtml = _.template(SensorsHtml),
+        sensorNameHtml = _.template(SensorNameHtml);
+
+    var EntitySensorsView = Backbone.View.extend({
+        template: sensorHtml,
+        sensorMetadata:{},
+        refreshActive:true,
+        zeroClipboard: null,
+
+        events:{
+            /* mouseup might technically be preferred, as moving out then releasing wouldn't
+             * normally be expected to trigger the action; however this introduces complexity
+             * as mouseup seems possibly to fire even if a widget has mouseoutted;
+             * also i note many other places (including backbone examples) seem to use click
+             * perhaps for this very reason.  worth exploring, but as a low priority. */
+            'click .refresh': 'updateSensorsNow',
+            'click .filterEmpty':'toggleFilterEmpty',
+            'click .toggleAutoRefresh':'toggleAutoRefresh',
+            'click #sensors-table div.secret-info':'toggleSecrecyVisibility',
+            
+            'mouseup .valueOpen':'valueOpen',
+            'mouseover #sensors-table tbody tr':'noteFloatMenuActive',
+            'mouseout #sensors-table tbody tr':'noteFloatMenuSeemsInactive',
+            'mouseover .floatGroup':'noteFloatMenuActive',
+            'mouseout .floatGroup':'noteFloatMenuSeemsInactive',
+            'mouseover .clipboard-item':'noteFloatMenuActiveCI',
+            'mouseout .clipboard-item':'noteFloatMenuSeemsInactiveCI',
+            'mouseover .hasFloatLeft':'showFloatLeft',
+            'mouseover .hasFloatDown':'enterFloatDown',
+            'mouseout .hasFloatDown':'exitFloatDown',
+            'mouseup .light-popup-menu-item':'closeFloatMenuNow'
+
+            // these have no effect: you must register on the zeroclipboard object, below
+            // (presumably the same for the .clipboard-item event listeners above, but unconfirmed)
+//            'mouseup .clipboard-item':'closeFloatMenuNow',
+//            'mouseup .global-zeroclipboard-container object':'closeFloatMenuNow',
+        },
+
+        initialize:function () {
+            _.bindAll(this);
+            this.$el.html(this.template());
+
+            var $table = this.$('#sensors-table'),
+                that = this;
+            this.table = ViewUtils.myDataTable($table, {
+                "fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
+                    $(nRow).attr('id', aData[0]);
+                    $('td',nRow).each(function(i,v){
+                        if (i==1) $(v).attr('class','sensor-value');
+                    });
+                    return nRow;
+                },
+                "aoColumnDefs": [
+                                 { // name (with tooltip)
+                                     "mRender": function ( data, type, row ) {
+                                         // name (column 1) should have tooltip title
+                                         var actions = that.getSensorActions(data.name);
+                                         // if data.description or .type is absent we get an error in html rendering (js)
+                                         // unless we set it explicitly (there is probably a nicer way to do this however?)
+                                         var context = _.extend(data, { 
+                                             description: data['description'], type: data['type']});
+                                         return sensorNameHtml(context);
+                                     },
+                                     "aTargets": [ 1 ]
+                                 },
+                                 { // value
+                                     "mRender": function ( data, type, row ) {
+                                         var escapedValue = Util.toDisplayString(data);
+                                         if (type!='display')
+                                             return escapedValue;
+                                         
+                                         var hasEscapedValue = (escapedValue!=null && (""+escapedValue).length > 0);
+                                             sensorName = row[0],
+                                             actions = that.getSensorActions(sensorName);
+                                         
+                                         // NB: the row might not yet exist
+                                         var $row = $('tr[id="'+sensorName+'"]');
+                                         
+                                         // datatables doesn't seem to expose any way to modify the html in place for a cell,
+                                         // so we rebuild
+                                         
+                                         var result = "<span class='value'>"+(hasEscapedValue ? escapedValue : '')+"</span>";
+
+                                         var isSecret = Util.isSecret(sensorName);
+                                         if (isSecret) {
+                                            result += "<span class='secret-indicator'>(hidden)</span>";
+                                         }
+                                         
+                                         if (actions.open)
+                                             result = "<a href='"+actions.open+"'>" + result + "</a>";
+                                         if (escapedValue==null || escapedValue.length < 3)
+                                             // include whitespace so we can click on it, if it's really small
+                                             result += "&nbsp;&nbsp;&nbsp;&nbsp;";
+
+                                         var existing = $row.find('.dynamic-contents');
+                                         // for the json url, use the full url (relative to window.location.href)
+                                         var jsonUrl = actions.json ? new URI(actions.json).resolve(new URI(window.location.href)).toString() : null;
+                                         // prefer to update in place, so menus don't disappear, also more efficient
+                                         // (but if menu is changed, we do recreate it)
+                                         if (existing.length>0) {
+                                             if (that.checkFloatMenuUpToDate($row, actions.open, '.actions-open', 'open-target') &&
+                                                 that.checkFloatMenuUpToDate($row, escapedValue, '.actions-copy') &&
+                                                 that.checkFloatMenuUpToDate($row, actions.json, '.actions-json-open', 'open-target') &&
+                                                 that.checkFloatMenuUpToDate($row, jsonUrl, '.actions-json-copy', 'copy-value')) {
+//                                                 log("updating in place "+sensorName)
+                                                 existing.html(result);
+                                                 return $row.find('td.sensor-value').html();
+                                             }
+                                         }
+                                         
+                                         // build the menu - either because it is the first time, or the actions are stale
+//                                         log("creating "+sensorName);
+                                         
+                                         var downMenu = "";
+                                         if (actions.open)
+                                             downMenu += "<div class='light-popup-menu-item valueOpen actions-open' open-target='"+actions.open+"'>" +
+                                             		"Open</div>";
+                                         if (hasEscapedValue) downMenu +=
+                                             "<div class='light-popup-menu-item handy valueCopy actions-copy clipboard-item'>Copy Value</div>";
+                                         if (actions.json) downMenu +=
+                                             "<div class='light-popup-menu-item handy valueOpen actions-json-open' open-target='"+actions.json+"'>" +
+                                                 "Open REST Link</div>";
+                                         if (actions.json && hasEscapedValue) downMenu +=
+                                             "<div class='light-popup-menu-item handy valueCopy actions-json-copy clipboard-item' copy-value='"+
+                                                 jsonUrl+"'>Copy REST Link</div>";
+                                         if (downMenu=="") {
+//                                             log("no actions for "+sensorName);
+                                             downMenu += 
+                                                 "<div class='light-popup-menu-item'>(no actions)</div>";
+                                         }
+                                         downMenu = "<div class='floatDown'><div class='light-popup'><div class='light-popup-body'>"
+                                             + downMenu +
+                                             "</div></div></div>";
+                                         result = "<span class='hasFloatLeft dynamic-contents'>" + result +
+                                         		"</span>" +
+                                         		"<div class='floatLeft'><span class='icon-chevron-down hasFloatDown'></span>" +
+                                         		downMenu +
+                                         		"</div>";
+                                         result = "<div class='floatGroup"+
+                                            (isSecret ? " secret-info" : "")+
+                                            "'>" + result + "</div>";
+                                         // also see updateFloatMenus which wires up the JS for these classes
+                                         
+                                         return result;
+                                     },
+                                     "aTargets": [ 2 ]
+                                 },
+                                 // ID in column 0 is standard (assumed in ViewUtils)
+                                 { "bVisible": false,  "aTargets": [ 0 ] }
+                             ]            
+            });
+            
+            this.zeroClipboard = new ZeroClipboard();
+            this.zeroClipboard.on( "dataRequested" , function(client) {
+                try {
+                    // the zeroClipboard instance is a singleton so check our scope first
+                    if (!$(this).closest("#sensors-table").length) return;
+                    var text = $(this).attr('copy-value');
+                    if (!text) text = $(this).closest('.floatGroup').find('.value').text();
+
+//                    log("Copying sensors text '"+text+"' to clipboard");
+                    client.setText(text);
+                    
+                    // show the word "copied" for feedback;
+                    // NB this occurs on mousedown, due to how flash plugin works
+                    // (same style of feedback and interaction as github)
+                    // the other "clicks" are now triggered by *mouseup*
+                    var $widget = $(this);
+                    var oldHtml = $widget.html();
+                    $widget.html('<b>Copied!</b>');
+                    // use a timeout to restore because mouseouts can leave corner cases (see history)
+                    setTimeout(function() { $widget.html(oldHtml); }, 600);
+                } catch (e) {
+                    log("Zeroclipboard failure; falling back to prompt mechanism");
+                    log(e);
+                    Util.promptCopyToClipboard(text);
+                }
+            });
+            // these seem to arrive delayed sometimes, so we also work with the clipboard-item class events
+            this.zeroClipboard.on( "mouseover", function() { that.noteFloatMenuZeroClipboardItem(true, this); } );
+            this.zeroClipboard.on( "mouseout", function() { that.noteFloatMenuZeroClipboardItem(false, this); } );
+            this.zeroClipboard.on( "mouseup", function() { that.closeFloatMenuNow(); } );
+            
+            ViewUtils.addFilterEmptyButton(this.table);
+            ViewUtils.addAutoRefreshButton(this.table);
+            ViewUtils.addRefreshButton(this.table);
+            this.loadSensorMetadata();
+            this.updateSensorsPeriodically();
+            this.toggleFilterEmpty();
+            return this;
+        },
+
+        beforeClose: function () {
+            if (this.zeroClipboard) {
+                this.zeroClipboard.destroy();
+            }
+        },
+
+        /* getting the float menu to pop-up and go away with all the right highlighting
+         * is ridiculous. this is pretty good, but still not perfect. it seems some events
+         * just don't fire, others occur out of order, and the root cause is that when
+         * the SWF object (which has to accept the click, for copy to work) gets focus,
+         * its ancestors *lose* focus - we have to suppress the event which makes the
+         * float group disappear.  i have left logging in, commented out, for more debugging.
+         * there are notes that ZeroClipboard 2.0 will support hover properly.
+         * 
+         * see git commit history and review comments in https://github.com/brooklyncentral/brooklyn/pull/1171
+         * for more information.
+         */
+        floatMenuActive: false,
+        lastFloatMenuRowId: null,
+        lastFloatFocusInTextForEventUnmangling: null,
+        updateFloatMenus: function() {
+            $('#sensors-table *[rel="tooltip"]').tooltip();
+            this.zeroClipboard.clip( $('.valueCopy') );
+        },
+        showFloatLeft: function(event) {
+            this.noteFloatMenuFocusChange(true, event, "show-left");
+            this.showFloatLeftOf($(event.currentTarget));
+        },
+        showFloatLeftOf: function($hasFloatLeft) {
+            $hasFloatLeft.next('.floatLeft').show(); 
+        },
+        enterFloatDown: function(event) {
+            this.noteFloatMenuFocusChange(true, event, "show-down");
+//            log("entering float down");
+            var fdTarget = $(event.currentTarget);
+//            log( fdTarget );
+            this.floatDownFocus = fdTarget;
+            var that = this;
+            setTimeout(function() {
+                that.showFloatDownOf( fdTarget );
+            }, 200);
+        },
+        exitFloatDown: function(event) {
+//            log("exiting float down");
+            this.floatDownFocus = null;
+        },
+        showFloatDownOf: function($hasFloatDown) {
+            if ($hasFloatDown != this.floatDownFocus) {
+//                log("float down did not hover long enough");
+                return;
+            }
+            var down = $hasFloatDown.next('.floatDown');
+            down.show();
+            $('.light-popup', down).show(2000); 
+        },
+        noteFloatMenuActive: function(focus) { 
+            this.noteFloatMenuFocusChange(true, focus, "menu");
+            
+            // remove dangling zc events (these don't always get removed, apparent bug in zc event framework)
+            // this causes it to flash sometimes but that's better than leaving the old item highlighted
+            if (focus.toElement && $(focus.toElement).hasClass('clipboard-item')) {
+                // don't remove it
+            } else {
+                var zc = $(focus.target).closest('.floatGroup').find('div.zeroclipboard-is-hover');
+                zc.removeClass('zeroclipboard-is-hover');
+            }
+        },
+        noteFloatMenuSeemsInactive: function(focus) { this.noteFloatMenuFocusChange(false, focus, "menu"); },
+        noteFloatMenuActiveCI: function(focus) { this.noteFloatMenuFocusChange(true, focus, "menu-clip-item"); },
+        noteFloatMenuSeemsInactiveCI: function(focus) { this.noteFloatMenuFocusChange(false, focus, "menu-clip-item"); },
+        noteFloatMenuZeroClipboardItem: function(seemsActive,focus) { 
+            this.noteFloatMenuFocusChange(seemsActive, focus, "clipboard");
+            if (seemsActive) {
+                // make the table row highlighted (as the default hover event is lost)
+                // we remove it when the float group goes away
+                $(focus).closest('tr').addClass('zeroclipboard-is-hover');
+            } else {
+                // sometimes does not get removed by framework - though this doesn't seem to help
+                // as you can see by logging this before and after:
+//                log(""+$(focus).attr('class'))
+                // the problem is that the framework seems sometime to trigger this event before adding the class
+                // see in noteFloatMenuActive where we do a different check
+                $(focus).removeClass('zeroclipboard-is-hover');
+            }
+        },
+        noteFloatMenuFocusChange: function(seemsActive, focus, caller) {
+//            log(""+new Date().getTime()+" note active "+caller+" "+seemsActive);
+            var delayCheckFloat = true;
+            var focusRowId = null;
+            var focusElement = null;
+            if (focus) {
+                focusElement = focus.target ? focus.target : focus;
+                if (seemsActive) {
+                    this.lastFloatFocusInTextForEventUnmangling = $(focusElement).text();
+                    focusRowId = focus.target ? $(focus.target).closest('tr').attr('id') : $(focus).closest('tr').attr('id');
+                    if (this.floatMenuActive && focusRowId==this.lastFloatMenuRowId) {
+                        // lastFloatMenuRowId has not changed, when moving within a floatgroup
+                        // (but we still get mouseout events when the submenu changes)
+//                        log("redundant mousein from "+ focusRowId );
+                        return;
+                    }
+                } else {
+                    // on mouseout, skip events which are bogus
+                    // first, if the toElement is in the same floatGroup
+                    focusRowId = focus.toElement ? $(focus.toElement).closest('tr').attr('id') : null;
+                    if (focusRowId==this.lastFloatMenuRowId) {
+                        // lastFloatMenuRowId has not changed, when moving within a floatgroup
+                        // (but we still get mouseout events when the submenu changes)
+//                        log("skipping, internal mouseout from "+ focusRowId );
+                        return;
+                    }
+                    // check (a) it is the 'out' event corresponding to the most recent 'in'
+                    // (because there is a race where it can say  in1, in2, out1 rather than in1, out2, in2
+                    if ($(focusElement).text() != this.lastFloatFocusInTextForEventUnmangling) {
+//                        log("skipping, not most recent mouseout from "+ focusRowId );
+                        return;
+                    }
+                    if (focus.toElement) {
+                        if ($(focus.toElement).hasClass('global-zeroclipboard-container')) {
+//                            log("skipping out, as we are moving to clipboard container");
+                            return;
+                        }
+                        if (focus.toElement.name && focus.toElement.name=="global-zeroclipboard-flash-bridge") {
+//                            log("skipping out, as we are moving to clipboard movie");
+                            return;                            
+                        }
+                    }
+                } 
+            }           
+//            log( "moving to "+focusRowId );
+            if (seemsActive && focusRowId) {
+//                log("setting lastFloat when "+this.floatMenuActive + ", from "+this.lastFloatMenuRowId );
+                if (this.lastFloatMenuRowId != focusRowId) {
+                    if (this.lastFloatMenuRowId) {
+                        // the floating menu has changed, hide the old
+//                        log("hiding old menu on float-focus change");
+                        this.closeFloatMenuNow();
+                    }
+                }
+                // now show the new, if possible (might happen multiple times, but no matter
+                if (focusElement) {
+//                    log("ensuring row "+focusRowId+" is showing on change");
+                    this.showFloatLeftOf($(focusElement).closest('tr').find('.hasFloatLeft'));
+                    this.lastFloatMenuRowId = focusRowId;
+                } else {
+                    this.lastFloatMenuRowId = null;
+                }
+            }
+            this.floatMenuActive = seemsActive;
+            if (!seemsActive) {
+                this.scheduleCheckFloatMenuNeedsHiding(delayCheckFloat);
+            }
+        },
+        scheduleCheckFloatMenuNeedsHiding: function(delayCheckFloat) {
+            if (delayCheckFloat) {
+                this.checkTime = new Date().getTime()+299;
+                setTimeout(this.checkFloatMenuNeedsHiding, 300);
+            } else {
+                this.checkTime = new Date().getTime()-1;
+                this.checkFloatMenuNeedsHiding();
+            }
+        },
+        closeFloatMenuNow: function() {
+//            log("closing float menu due do direct call (eg click)");
+            this.checkTime = new Date().getTime()-1;
+            this.floatMenuActive = false;
+            this.checkFloatMenuNeedsHiding();
+        },
+        checkFloatMenuNeedsHiding: function() {
+//            log(""+new Date().getTime()+" checking float menu - "+this.floatMenuActive);
+            if (new Date().getTime() <= this.checkTime) {
+//                log("aborting check as another one scheduled");
+                return;
+            }
+            
+            // we use a flag to determine whether to hide the float menu
+            // because the embedded zero-clipboard flash objects cause floatGroup 
+            // to get a mouseout event when the "Copy" menu item is hovered
+            if (!this.floatMenuActive) {
+//                log("HIDING FLOAT MENU")
+                $('.floatLeft').hide(); 
+                $('.floatDown').hide();
+                $('.zeroclipboard-is-hover').removeClass('zeroclipboard-is-hover');
+                lastFloatMenuRowId = null;
+            } else {
+//                log("we're still in")
+            }
+        },
+        valueOpen: function(event) {
+            window.open($(event.target).attr('open-target'),'_blank');
+        },
+
+        render: function() {
+            return this;
+        },
+        checkFloatMenuUpToDate: function($row, actionValue, actionSelector, actionAttribute) {
+            if (typeof actionValue === 'undefined' || actionValue==null || actionValue=="") {
+                if ($row.find(actionSelector).length==0) return true;
+            } else {
+                if (actionAttribute) {
+                    if ($row.find(actionSelector).attr(actionAttribute)==actionValue) return true;
+                } else {
+                    if ($row.find(actionSelector).length>0) return true;
+                }
+            }
+            return false;
+        },
+
+        /**
+         * Returns the actions loaded to view.sensorMetadata[name].actions
+         * for the given name, or an empty object.
+         */
+        getSensorActions: function(sensorName) {
+            var allMetadata = this.sensorMetadata || {};
+            var metadata = allMetadata[sensorName] || {};
+            return metadata.actions || {};
+        },
+
+        toggleFilterEmpty: function() {
+            ViewUtils.toggleFilterEmpty(this.$('#sensors-table'), 2);
+            return this;
+        },
+
+        toggleAutoRefresh: function() {
+            ViewUtils.toggleAutoRefresh(this);
+            return this;
+        },
+
+        enableAutoRefresh: function(isEnabled) {
+            this.refreshActive = isEnabled;
+            return this;
+        },
+        
+        toggleSecrecyVisibility: function(event) {
+            $(event.target).closest('.secret-info').toggleClass('secret-revealed');
+        },
+        
+        /**
+         * Loads current values for all sensors on an entity and updates sensors table.
+         */
+        isRefreshActive: function() { return this.refreshActive; },
+        updateSensorsNow:function () {
+            var that = this;
+            ViewUtils.get(that, that.model.getSensorUpdateUrl(), that.updateWithData,
+                    { enablement: that.isRefreshActive });
+        },
+        updateSensorsPeriodically:function () {
+            var that = this;
+            ViewUtils.getRepeatedlyWithDelay(that, that.model.getSensorUpdateUrl(), function(data) { that.updateWithData(data); },
+                    { enablement: that.isRefreshActive });
+        },
+        updateWithData: function (data) {
+            var that = this;
+            $table = that.$('#sensors-table');
+            var options = {};
+            if (that.fullRedraw) {
+                options.refreshAllRows = true;
+                that.fullRedraw = false;
+            }
+            ViewUtils.updateMyDataTable($table, data, function(value, name) {
+                var metadata = that.sensorMetadata[name];
+                if (metadata==null) {                        
+                    // kick off reload metadata when this happens (new sensor for which no metadata known)
+                    // but only if we haven't loaded metadata for a while
+                    metadata = { 'name':name };
+                    that.sensorMetadata[name] = metadata; 
+                    that.loadSensorMetadataIfStale(name, 10000);
+                };
+                return [name, metadata, value];
+            }, options);
+            
+            that.updateFloatMenus();
+        },
+
+        /**
+         * Loads all information about an entity's sensors. Populates view.sensorMetadata object
+         * with a map of sensor names to description, actions and type (e.g. java.lang.Long).
+         */
+        loadSensorMetadata: function() {
+            var url = this.model.getLinkByName('sensors'),
+                that = this;
+            that.lastSensorMetadataLoadTime = new Date().getTime();
+            $.get(url, function (data) {
+                _.each(data, function(sensor) {
+                    var actions = {};
+                    _.each(sensor.links, function(v, k) {
+                        if (k.slice(0, 7) == "action:") {
+                            actions[k.slice(7)] = v;
+                        }
+                    });
+                    that.sensorMetadata[sensor.name] = {
+                        name: sensor.name,
+                        description: sensor.description,
+                        actions: actions,
+                        type: sensor.type
+                    };
+                });
+                that.fullRedraw = true;
+                that.updateSensorsNow();
+                that.table.find('*[rel="tooltip"]').tooltip();
+            });
+            return this;
+        },
+        
+        loadSensorMetadataIfStale: function(sensorName, recency) {
+            var that = this;
+            if (!that.lastSensorMetadataLoadTime || that.lastSensorMetadataLoadTime + recency < new Date().getTime()) {
+//                log("reloading metadata because new sensor "+sensorName+" identified")
+                that.loadSensorMetadata();
+            }
+        }
+    });
+
+    return EntitySensorsView;
+});


[30/51] [abbrv] [partial] brooklyn-ui git commit: move subdir from incubator up a level as it is promoted to its own repo (first non-incubator commit!)

Posted by he...@apache.org.
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/swagger-ui/css/screen.css
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/swagger-ui/css/screen.css b/brooklyn-ui/src/main/webapp/assets/swagger-ui/css/screen.css
deleted file mode 100644
index fab69d6..0000000
--- a/brooklyn-ui/src/main/webapp/assets/swagger-ui/css/screen.css
+++ /dev/null
@@ -1,1301 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/* Original style from softwaremaniacs.org (c) Ivan Sagalaev <Ma...@SoftwareManiacs.Org> */
-.swagger-section pre code {
-  display: block;
-  padding: 0.5em;
-  background: #F0F0F0;
-}
-.swagger-section pre code,
-.swagger-section pre .subst,
-.swagger-section pre .tag .title,
-.swagger-section pre .lisp .title,
-.swagger-section pre .clojure .built_in,
-.swagger-section pre .nginx .title {
-  color: black;
-}
-.swagger-section pre .string,
-.swagger-section pre .title,
-.swagger-section pre .constant,
-.swagger-section pre .parent,
-.swagger-section pre .tag .value,
-.swagger-section pre .rules .value,
-.swagger-section pre .rules .value .number,
-.swagger-section pre .preprocessor,
-.swagger-section pre .ruby .symbol,
-.swagger-section pre .ruby .symbol .string,
-.swagger-section pre .aggregate,
-.swagger-section pre .template_tag,
-.swagger-section pre .django .variable,
-.swagger-section pre .smalltalk .class,
-.swagger-section pre .addition,
-.swagger-section pre .flow,
-.swagger-section pre .stream,
-.swagger-section pre .bash .variable,
-.swagger-section pre .apache .tag,
-.swagger-section pre .apache .cbracket,
-.swagger-section pre .tex .command,
-.swagger-section pre .tex .special,
-.swagger-section pre .erlang_repl .function_or_atom,
-.swagger-section pre .markdown .header {
-  color: #800;
-}
-.swagger-section pre .comment,
-.swagger-section pre .annotation,
-.swagger-section pre .template_comment,
-.swagger-section pre .diff .header,
-.swagger-section pre .chunk,
-.swagger-section pre .markdown .blockquote {
-  color: #888;
-}
-.swagger-section pre .number,
-.swagger-section pre .date,
-.swagger-section pre .regexp,
-.swagger-section pre .literal,
-.swagger-section pre .smalltalk .symbol,
-.swagger-section pre .smalltalk .char,
-.swagger-section pre .go .constant,
-.swagger-section pre .change,
-.swagger-section pre .markdown .bullet,
-.swagger-section pre .markdown .link_url {
-  color: #080;
-}
-.swagger-section pre .label,
-.swagger-section pre .javadoc,
-.swagger-section pre .ruby .string,
-.swagger-section pre .decorator,
-.swagger-section pre .filter .argument,
-.swagger-section pre .localvars,
-.swagger-section pre .array,
-.swagger-section pre .attr_selector,
-.swagger-section pre .important,
-.swagger-section pre .pseudo,
-.swagger-section pre .pi,
-.swagger-section pre .doctype,
-.swagger-section pre .deletion,
-.swagger-section pre .envvar,
-.swagger-section pre .shebang,
-.swagger-section pre .apache .sqbracket,
-.swagger-section pre .nginx .built_in,
-.swagger-section pre .tex .formula,
-.swagger-section pre .erlang_repl .reserved,
-.swagger-section pre .prompt,
-.swagger-section pre .markdown .link_label,
-.swagger-section pre .vhdl .attribute,
-.swagger-section pre .clojure .attribute,
-.swagger-section pre .coffeescript .property {
-  color: #88F;
-}
-.swagger-section pre .keyword,
-.swagger-section pre .id,
-.swagger-section pre .phpdoc,
-.swagger-section pre .title,
-.swagger-section pre .built_in,
-.swagger-section pre .aggregate,
-.swagger-section pre .css .tag,
-.swagger-section pre .javadoctag,
-.swagger-section pre .phpdoc,
-.swagger-section pre .yardoctag,
-.swagger-section pre .smalltalk .class,
-.swagger-section pre .winutils,
-.swagger-section pre .bash .variable,
-.swagger-section pre .apache .tag,
-.swagger-section pre .go .typename,
-.swagger-section pre .tex .command,
-.swagger-section pre .markdown .strong,
-.swagger-section pre .request,
-.swagger-section pre .status {
-  font-weight: bold;
-}
-.swagger-section pre .markdown .emphasis {
-  font-style: italic;
-}
-.swagger-section pre .nginx .built_in {
-  font-weight: normal;
-}
-.swagger-section pre .coffeescript .javascript,
-.swagger-section pre .javascript .xml,
-.swagger-section pre .tex .formula,
-.swagger-section pre .xml .javascript,
-.swagger-section pre .xml .vbscript,
-.swagger-section pre .xml .css,
-.swagger-section pre .xml .cdata {
-  opacity: 0.5;
-}
-.swagger-section .swagger-ui-wrap {
-  line-height: 1;
-  font-family: "Droid Sans", sans-serif;
-  max-width: 960px;
-  margin-left: auto;
-  margin-right: auto;
-}
-.swagger-section .swagger-ui-wrap b,
-.swagger-section .swagger-ui-wrap strong {
-  font-family: "Droid Sans", sans-serif;
-  font-weight: bold;
-}
-.swagger-section .swagger-ui-wrap q,
-.swagger-section .swagger-ui-wrap blockquote {
-  quotes: none;
-}
-.swagger-section .swagger-ui-wrap p {
-  line-height: 1.4em;
-  padding: 0 0 10px;
-  color: #333333;
-}
-.swagger-section .swagger-ui-wrap q:before,
-.swagger-section .swagger-ui-wrap q:after,
-.swagger-section .swagger-ui-wrap blockquote:before,
-.swagger-section .swagger-ui-wrap blockquote:after {
-  content: none;
-}
-.swagger-section .swagger-ui-wrap .heading_with_menu h1,
-.swagger-section .swagger-ui-wrap .heading_with_menu h2,
-.swagger-section .swagger-ui-wrap .heading_with_menu h3,
-.swagger-section .swagger-ui-wrap .heading_with_menu h4,
-.swagger-section .swagger-ui-wrap .heading_with_menu h5,
-.swagger-section .swagger-ui-wrap .heading_with_menu h6 {
-  display: block;
-  clear: none;
-  float: left;
-  -moz-box-sizing: border-box;
-  -webkit-box-sizing: border-box;
-  -ms-box-sizing: border-box;
-  box-sizing: border-box;
-  width: 60%;
-}
-.swagger-section .swagger-ui-wrap table {
-  border-collapse: collapse;
-  border-spacing: 0;
-}
-.swagger-section .swagger-ui-wrap table thead tr th {
-  padding: 5px;
-  font-size: 0.9em;
-  color: #666666;
-  border-bottom: 1px solid #999999;
-}
-.swagger-section .swagger-ui-wrap table tbody tr:last-child td {
-  border-bottom: none;
-}
-.swagger-section .swagger-ui-wrap table tbody tr.offset {
-  background-color: #f0f0f0;
-}
-.swagger-section .swagger-ui-wrap table tbody tr td {
-  padding: 6px;
-  font-size: 0.9em;
-  border-bottom: 1px solid #cccccc;
-  vertical-align: top;
-  line-height: 1.3em;
-}
-.swagger-section .swagger-ui-wrap ol {
-  margin: 0px 0 10px;
-  padding: 0 0 0 18px;
-  list-style-type: decimal;
-}
-.swagger-section .swagger-ui-wrap ol li {
-  padding: 5px 0px;
-  font-size: 0.9em;
-  color: #333333;
-}
-.swagger-section .swagger-ui-wrap ol,
-.swagger-section .swagger-ui-wrap ul {
-  list-style: none;
-}
-.swagger-section .swagger-ui-wrap h1 a,
-.swagger-section .swagger-ui-wrap h2 a,
-.swagger-section .swagger-ui-wrap h3 a,
-.swagger-section .swagger-ui-wrap h4 a,
-.swagger-section .swagger-ui-wrap h5 a,
-.swagger-section .swagger-ui-wrap h6 a {
-  text-decoration: none;
-}
-.swagger-section .swagger-ui-wrap h1 a:hover,
-.swagger-section .swagger-ui-wrap h2 a:hover,
-.swagger-section .swagger-ui-wrap h3 a:hover,
-.swagger-section .swagger-ui-wrap h4 a:hover,
-.swagger-section .swagger-ui-wrap h5 a:hover,
-.swagger-section .swagger-ui-wrap h6 a:hover {
-  text-decoration: underline;
-}
-.swagger-section .swagger-ui-wrap h1 span.divider,
-.swagger-section .swagger-ui-wrap h2 span.divider,
-.swagger-section .swagger-ui-wrap h3 span.divider,
-.swagger-section .swagger-ui-wrap h4 span.divider,
-.swagger-section .swagger-ui-wrap h5 span.divider,
-.swagger-section .swagger-ui-wrap h6 span.divider {
-  color: #aaaaaa;
-}
-.swagger-section .swagger-ui-wrap a {
-  color: #547f00;
-}
-.swagger-section .swagger-ui-wrap a img {
-  border: none;
-}
-.swagger-section .swagger-ui-wrap article,
-.swagger-section .swagger-ui-wrap aside,
-.swagger-section .swagger-ui-wrap details,
-.swagger-section .swagger-ui-wrap figcaption,
-.swagger-section .swagger-ui-wrap figure,
-.swagger-section .swagger-ui-wrap footer,
-.swagger-section .swagger-ui-wrap header,
-.swagger-section .swagger-ui-wrap hgroup,
-.swagger-section .swagger-ui-wrap menu,
-.swagger-section .swagger-ui-wrap nav,
-.swagger-section .swagger-ui-wrap section,
-.swagger-section .swagger-ui-wrap summary {
-  display: block;
-}
-.swagger-section .swagger-ui-wrap pre {
-  font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
-  background-color: #fcf6db;
-  border: 1px solid #e5e0c6;
-  padding: 10px;
-}
-.swagger-section .swagger-ui-wrap pre code {
-  line-height: 1.6em;
-  background: none;
-}
-.swagger-section .swagger-ui-wrap .content > .content-type > div > label {
-  clear: both;
-  display: block;
-  color: #0F6AB4;
-  font-size: 1.1em;
-  margin: 0;
-  padding: 15px 0 5px;
-}
-.swagger-section .swagger-ui-wrap .content pre {
-  font-size: 12px;
-  margin-top: 5px;
-  padding: 5px;
-}
-.swagger-section .swagger-ui-wrap .icon-btn {
-  cursor: pointer;
-}
-.swagger-section .swagger-ui-wrap .info_title {
-  padding-bottom: 10px;
-  font-weight: bold;
-  font-size: 25px;
-}
-.swagger-section .swagger-ui-wrap .footer {
-  margin-top: 20px;
-}
-.swagger-section .swagger-ui-wrap p.big,
-.swagger-section .swagger-ui-wrap div.big p {
-  font-size: 1em;
-  margin-bottom: 10px;
-}
-.swagger-section .swagger-ui-wrap form.fullwidth ol li.string input,
-.swagger-section .swagger-ui-wrap form.fullwidth ol li.url input,
-.swagger-section .swagger-ui-wrap form.fullwidth ol li.text textarea,
-.swagger-section .swagger-ui-wrap form.fullwidth ol li.numeric input {
-  width: 500px !important;
-}
-.swagger-section .swagger-ui-wrap .info_license {
-  padding-bottom: 5px;
-}
-.swagger-section .swagger-ui-wrap .info_tos {
-  padding-bottom: 5px;
-}
-.swagger-section .swagger-ui-wrap .message-fail {
-  color: #cc0000;
-}
-.swagger-section .swagger-ui-wrap .info_url {
-  padding-bottom: 5px;
-}
-.swagger-section .swagger-ui-wrap .info_email {
-  padding-bottom: 5px;
-}
-.swagger-section .swagger-ui-wrap .info_name {
-  padding-bottom: 5px;
-}
-.swagger-section .swagger-ui-wrap .info_description {
-  padding-bottom: 10px;
-  font-size: 15px;
-}
-.swagger-section .swagger-ui-wrap .markdown ol li,
-.swagger-section .swagger-ui-wrap .markdown ul li {
-  padding: 3px 0px;
-  line-height: 1.4em;
-  color: #333333;
-}
-.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.string input,
-.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.url input,
-.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.numeric input {
-  display: block;
-  padding: 4px;
-  width: auto;
-  clear: both;
-}
-.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.string input.title,
-.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.url input.title,
-.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.numeric input.title {
-  font-size: 1.3em;
-}
-.swagger-section .swagger-ui-wrap table.fullwidth {
-  width: 100%;
-}
-.swagger-section .swagger-ui-wrap .model-signature {
-  font-family: "Droid Sans", sans-serif;
-  font-size: 1em;
-  line-height: 1.5em;
-}
-.swagger-section .swagger-ui-wrap .model-signature .signature-nav a {
-  text-decoration: none;
-  color: #AAA;
-}
-.swagger-section .swagger-ui-wrap .model-signature .signature-nav a:hover {
-  text-decoration: underline;
-  color: black;
-}
-.swagger-section .swagger-ui-wrap .model-signature .signature-nav .selected {
-  color: black;
-  text-decoration: none;
-}
-.swagger-section .swagger-ui-wrap .model-signature .propType {
-  color: #5555aa;
-}
-.swagger-section .swagger-ui-wrap .model-signature pre:hover {
-  background-color: #ffffdd;
-}
-.swagger-section .swagger-ui-wrap .model-signature pre {
-  font-size: .85em;
-  line-height: 1.2em;
-  overflow: auto;
-  max-height: 200px;
-  cursor: pointer;
-}
-.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav {
-  display: block;
-  margin: 0;
-  padding: 0;
-}
-.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav li:last-child {
-  padding-right: 0;
-  border-right: none;
-}
-.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav li {
-  float: left;
-  margin: 0 5px 5px 0;
-  padding: 2px 5px 2px 0;
-  border-right: 1px solid #ddd;
-}
-.swagger-section .swagger-ui-wrap .model-signature .propOpt {
-  color: #555;
-}
-.swagger-section .swagger-ui-wrap .model-signature .snippet small {
-  font-size: 0.75em;
-}
-.swagger-section .swagger-ui-wrap .model-signature .propOptKey {
-  font-style: italic;
-}
-.swagger-section .swagger-ui-wrap .model-signature .description .strong {
-  font-weight: bold;
-  color: #000;
-  font-size: .9em;
-}
-.swagger-section .swagger-ui-wrap .model-signature .description div {
-  font-size: 0.9em;
-  line-height: 1.5em;
-  margin-left: 1em;
-}
-.swagger-section .swagger-ui-wrap .model-signature .description .stronger {
-  font-weight: bold;
-  color: #000;
-}
-.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper {
-  border-spacing: 0;
-  position: absolute;
-  background-color: #ffffff;
-  border: 1px solid #bbbbbb;
-  display: none;
-  font-size: 11px;
-  max-width: 400px;
-  line-height: 30px;
-  color: black;
-  padding: 5px;
-  margin-left: 10px;
-}
-.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper th {
-  text-align: center;
-  background-color: #eeeeee;
-  border: 1px solid #bbbbbb;
-  font-size: 11px;
-  color: #666666;
-  font-weight: bold;
-  padding: 5px;
-  line-height: 15px;
-}
-.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper .optionName {
-  font-weight: bold;
-}
-.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown > p:first-child,
-.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown > p:last-child {
-  display: inline;
-}
-.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown > p:not(:first-child):before {
-  display: block;
-  content: '';
-}
-.swagger-section .swagger-ui-wrap .model-signature .description span:last-of-type.propDesc.markdown > p:only-child {
-  margin-right: -3px;
-}
-.swagger-section .swagger-ui-wrap .model-signature .propName {
-  font-weight: bold;
-}
-.swagger-section .swagger-ui-wrap .model-signature .signature-container {
-  clear: both;
-}
-.swagger-section .swagger-ui-wrap .body-textarea {
-  width: 300px;
-  height: 100px;
-  border: 1px solid #aaa;
-}
-.swagger-section .swagger-ui-wrap .markdown p code,
-.swagger-section .swagger-ui-wrap .markdown li code {
-  font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
-  background-color: #f0f0f0;
-  color: black;
-  padding: 1px 3px;
-}
-.swagger-section .swagger-ui-wrap .required {
-  font-weight: bold;
-}
-.swagger-section .swagger-ui-wrap input.parameter {
-  width: 300px;
-  border: 1px solid #aaa;
-}
-.swagger-section .swagger-ui-wrap h1 {
-  color: black;
-  font-size: 1.5em;
-  line-height: 1.3em;
-  padding: 10px 0 10px 0;
-  font-family: "Droid Sans", sans-serif;
-  font-weight: bold;
-}
-.swagger-section .swagger-ui-wrap .heading_with_menu {
-  float: none;
-  clear: both;
-  overflow: hidden;
-  display: block;
-}
-.swagger-section .swagger-ui-wrap .heading_with_menu ul {
-  display: block;
-  clear: none;
-  float: right;
-  -moz-box-sizing: border-box;
-  -webkit-box-sizing: border-box;
-  -ms-box-sizing: border-box;
-  box-sizing: border-box;
-  margin-top: 10px;
-}
-.swagger-section .swagger-ui-wrap h2 {
-  color: black;
-  font-size: 1.3em;
-  padding: 10px 0 10px 0;
-}
-.swagger-section .swagger-ui-wrap h2 a {
-  color: black;
-}
-.swagger-section .swagger-ui-wrap h2 span.sub {
-  font-size: 0.7em;
-  color: #999999;
-  font-style: italic;
-}
-.swagger-section .swagger-ui-wrap h2 span.sub a {
-  color: #777777;
-}
-.swagger-section .swagger-ui-wrap span.weak {
-  color: #666666;
-}
-.swagger-section .swagger-ui-wrap .message-success {
-  color: #89BF04;
-}
-.swagger-section .swagger-ui-wrap caption,
-.swagger-section .swagger-ui-wrap th,
-.swagger-section .swagger-ui-wrap td {
-  text-align: left;
-  font-weight: normal;
-  vertical-align: middle;
-}
-.swagger-section .swagger-ui-wrap .code {
-  font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
-}
-.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.text textarea {
-  font-family: "Droid Sans", sans-serif;
-  height: 250px;
-  padding: 4px;
-  display: block;
-  clear: both;
-}
-.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.select select {
-  display: block;
-  clear: both;
-}
-.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean {
-  float: none;
-  clear: both;
-  overflow: hidden;
-  display: block;
-}
-.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean label {
-  display: block;
-  float: left;
-  clear: none;
-  margin: 0;
-  padding: 0;
-}
-.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean input {
-  display: block;
-  float: left;
-  clear: none;
-  margin: 0 5px 0 0;
-}
-.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.required label {
-  color: black;
-}
-.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li label {
-  display: block;
-  clear: both;
-  width: auto;
-  padding: 0 0 3px;
-  color: #666666;
-}
-.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li label abbr {
-  padding-left: 3px;
-  color: #888888;
-}
-.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li p.inline-hints {
-  margin-left: 0;
-  font-style: italic;
-  font-size: 0.9em;
-  margin: 0;
-}
-.swagger-section .swagger-ui-wrap form.formtastic fieldset.buttons {
-  margin: 0;
-  padding: 0;
-}
-.swagger-section .swagger-ui-wrap span.blank,
-.swagger-section .swagger-ui-wrap span.empty {
-  color: #888888;
-  font-style: italic;
-}
-.swagger-section .swagger-ui-wrap .markdown h3 {
-  color: #547f00;
-}
-.swagger-section .swagger-ui-wrap .markdown h4 {
-  color: #666666;
-}
-.swagger-section .swagger-ui-wrap .markdown pre {
-  font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
-  background-color: #fcf6db;
-  border: 1px solid #e5e0c6;
-  padding: 10px;
-  margin: 0 0 10px 0;
-}
-.swagger-section .swagger-ui-wrap .markdown pre code {
-  line-height: 1.6em;
-}
-.swagger-section .swagger-ui-wrap div.gist {
-  margin: 20px 0 25px 0 !important;
-}
-.swagger-section .swagger-ui-wrap ul#resources {
-  font-family: "Droid Sans", sans-serif;
-  font-size: 0.9em;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource {
-  border-bottom: 1px solid #dddddd;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource:hover div.heading h2 a,
-.swagger-section .swagger-ui-wrap ul#resources li.resource.active div.heading h2 a {
-  color: black;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource:hover div.heading ul.options li a,
-.swagger-section .swagger-ui-wrap ul#resources li.resource.active div.heading ul.options li a {
-  color: #555555;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource:last-child {
-  border-bottom: none;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading {
-  border: 1px solid transparent;
-  float: none;
-  clear: both;
-  overflow: hidden;
-  display: block;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options {
-  overflow: hidden;
-  padding: 0;
-  display: block;
-  clear: none;
-  float: right;
-  margin: 14px 10px 0 0;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li {
-  float: left;
-  clear: none;
-  margin: 0;
-  padding: 2px 10px;
-  border-right: 1px solid #dddddd;
-  color: #666666;
-  font-size: 0.9em;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a {
-  color: #aaaaaa;
-  text-decoration: none;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:hover {
-  text-decoration: underline;
-  color: black;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:hover,
-.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:active,
-.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a.active {
-  text-decoration: underline;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li:first-child,
-.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li.first {
-  padding-left: 0;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li:last-child,
-.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li.last {
-  padding-right: 0;
-  border-right: none;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options:first-child,
-.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options.first {
-  padding-left: 0;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 {
-  color: #999999;
-  padding-left: 0;
-  display: block;
-  clear: none;
-  float: left;
-  font-family: "Droid Sans", sans-serif;
-  font-weight: bold;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a {
-  color: #999999;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a:hover {
-  color: black;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation {
-  float: none;
-  clear: both;
-  overflow: hidden;
-  display: block;
-  margin: 0 0 10px;
-  padding: 0;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading {
-  float: none;
-  clear: both;
-  overflow: hidden;
-  display: block;
-  margin: 0;
-  padding: 0;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 {
-  display: block;
-  clear: none;
-  float: left;
-  width: auto;
-  margin: 0;
-  padding: 0;
-  line-height: 1.1em;
-  color: black;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path {
-  padding-left: 10px;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a {
-  color: black;
-  text-decoration: none;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a:hover {
-  text-decoration: underline;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.http_method a {
-  text-transform: uppercase;
-  text-decoration: none;
-  color: white;
-  display: inline-block;
-  width: 50px;
-  font-size: 0.7em;
-  text-align: center;
-  padding: 7px 0 4px;
-  -moz-border-radius: 2px;
-  -webkit-border-radius: 2px;
-  -o-border-radius: 2px;
-  -ms-border-radius: 2px;
-  -khtml-border-radius: 2px;
-  border-radius: 2px;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span {
-  margin: 0;
-  padding: 0;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options {
-  overflow: hidden;
-  padding: 0;
-  display: block;
-  clear: none;
-  float: right;
-  margin: 6px 10px 0 0;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li {
-  float: left;
-  clear: none;
-  margin: 0;
-  padding: 2px 10px;
-  font-size: 0.9em;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li a {
-  text-decoration: none;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li.access {
-  color: black;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content {
-  border-top: none;
-  padding: 10px;
-  -moz-border-radius-bottomleft: 6px;
-  -webkit-border-bottom-left-radius: 6px;
-  -o-border-bottom-left-radius: 6px;
-  -ms-border-bottom-left-radius: 6px;
-  -khtml-border-bottom-left-radius: 6px;
-  border-bottom-left-radius: 6px;
-  -moz-border-radius-bottomright: 6px;
-  -webkit-border-bottom-right-radius: 6px;
-  -o-border-bottom-right-radius: 6px;
-  -ms-border-bottom-right-radius: 6px;
-  -khtml-border-bottom-right-radius: 6px;
-  border-bottom-right-radius: 6px;
-  margin: 0 0 20px;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content h4 {
-  font-size: 1.1em;
-  margin: 0;
-  padding: 15px 0 5px;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header {
-  float: none;
-  clear: both;
-  overflow: hidden;
-  display: block;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header a {
-  padding: 4px 0 0 10px;
-  display: inline-block;
-  font-size: 0.9em;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header input.submit {
-  display: block;
-  clear: none;
-  float: left;
-  padding: 6px 8px;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header span.response_throbber {
-  background-image: url('../images/throbber.gif');
-  width: 128px;
-  height: 16px;
-  display: block;
-  clear: none;
-  float: right;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content form input[type='text'].error {
-  outline: 2px solid black;
-  outline-color: #cc0000;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content form select[name='parameterContentType'] {
-  max-width: 300px;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.response div.block pre {
-  font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
-  padding: 10px;
-  font-size: 0.9em;
-  max-height: 400px;
-  overflow-y: auto;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading {
-  background-color: #f9f2e9;
-  border: 1px solid #f0e0ca;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading h3 span.http_method a {
-  background-color: #c5862b;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li {
-  border-right: 1px solid #dddddd;
-  border-right-color: #f0e0ca;
-  color: #c5862b;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li a {
-  color: #c5862b;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content {
-  background-color: #faf5ee;
-  border: 1px solid #f0e0ca;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content h4 {
-  color: #c5862b;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content div.sandbox_header a {
-  color: #dcb67f;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading {
-  background-color: #fcffcd;
-  border: 1px solid black;
-  border-color: #ffd20f;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading h3 span.http_method a {
-  text-transform: uppercase;
-  background-color: #ffd20f;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li {
-  border-right: 1px solid #dddddd;
-  border-right-color: #ffd20f;
-  color: #ffd20f;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li a {
-  color: #ffd20f;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content {
-  background-color: #fcffcd;
-  border: 1px solid black;
-  border-color: #ffd20f;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content h4 {
-  color: #ffd20f;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content div.sandbox_header a {
-  color: #6fc992;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading {
-  background-color: #f5e8e8;
-  border: 1px solid #e8c6c7;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading h3 span.http_method a {
-  text-transform: uppercase;
-  background-color: #a41e22;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li {
-  border-right: 1px solid #dddddd;
-  border-right-color: #e8c6c7;
-  color: #a41e22;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li a {
-  color: #a41e22;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content {
-  background-color: #f7eded;
-  border: 1px solid #e8c6c7;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content h4 {
-  color: #a41e22;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content div.sandbox_header a {
-  color: #c8787a;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading {
-  background-color: #e7f6ec;
-  border: 1px solid #c3e8d1;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading h3 span.http_method a {
-  background-color: #10a54a;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li {
-  border-right: 1px solid #dddddd;
-  border-right-color: #c3e8d1;
-  color: #10a54a;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li a {
-  color: #10a54a;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content {
-  background-color: #ebf7f0;
-  border: 1px solid #c3e8d1;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content h4 {
-  color: #10a54a;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content div.sandbox_header a {
-  color: #6fc992;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading {
-  background-color: #FCE9E3;
-  border: 1px solid #F5D5C3;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading h3 span.http_method a {
-  background-color: #D38042;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li {
-  border-right: 1px solid #dddddd;
-  border-right-color: #f0cecb;
-  color: #D38042;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li a {
-  color: #D38042;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content {
-  background-color: #faf0ef;
-  border: 1px solid #f0cecb;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content h4 {
-  color: #D38042;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content div.sandbox_header a {
-  color: #dcb67f;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading {
-  background-color: #e7f0f7;
-  border: 1px solid #c3d9ec;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading h3 span.http_method a {
-  background-color: #0f6ab4;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li {
-  border-right: 1px solid #dddddd;
-  border-right-color: #c3d9ec;
-  color: #0f6ab4;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li a {
-  color: #0f6ab4;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content {
-  background-color: #ebf3f9;
-  border: 1px solid #c3d9ec;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content h4 {
-  color: #0f6ab4;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content div.sandbox_header a {
-  color: #6fa5d2;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading {
-  background-color: #e7f0f7;
-  border: 1px solid #c3d9ec;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading h3 span.http_method a {
-  background-color: #0f6ab4;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading ul.options li {
-  border-right: 1px solid #dddddd;
-  border-right-color: #c3d9ec;
-  color: #0f6ab4;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading ul.options li a {
-  color: #0f6ab4;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content {
-  background-color: #ebf3f9;
-  border: 1px solid #c3d9ec;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content h4 {
-  color: #0f6ab4;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content div.sandbox_header a {
-  color: #6fa5d2;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content,
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content,
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content,
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content,
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content,
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content {
-  border-top: none;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li:last-child,
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li:last-child,
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li:last-child,
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li:last-child,
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li:last-child,
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li:last-child,
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li.last,
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li.last,
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li.last,
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li.last,
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li.last,
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li.last {
-  padding-right: 0;
-  border-right: none;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a:hover,
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a:active,
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a.active {
-  text-decoration: underline;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li:first-child,
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li.first {
-  padding-left: 0;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations:first-child,
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations.first {
-  padding-left: 0;
-}
-.swagger-section .swagger-ui-wrap p#colophon {
-  margin: 0 15px 40px 15px;
-  padding: 10px 0;
-  font-size: 0.8em;
-  border-top: 1px solid #dddddd;
-  font-family: "Droid Sans", sans-serif;
-  color: #999999;
-  font-style: italic;
-}
-.swagger-section .swagger-ui-wrap p#colophon a {
-  text-decoration: none;
-  color: #547f00;
-}
-.swagger-section .swagger-ui-wrap h3 {
-  color: black;
-  font-size: 1.1em;
-  padding: 10px 0 10px 0;
-}
-.swagger-section .swagger-ui-wrap .markdown ol,
-.swagger-section .swagger-ui-wrap .markdown ul {
-  font-family: "Droid Sans", sans-serif;
-  margin: 5px 0 10px;
-  padding: 0 0 0 18px;
-  list-style-type: disc;
-}
-.swagger-section .swagger-ui-wrap form.form_box {
-  background-color: #ebf3f9;
-  border: 1px solid #c3d9ec;
-  padding: 10px;
-}
-.swagger-section .swagger-ui-wrap form.form_box label {
-  color: #0f6ab4 !important;
-}
-.swagger-section .swagger-ui-wrap form.form_box input[type=submit] {
-  display: block;
-  padding: 10px;
-}
-.swagger-section .swagger-ui-wrap form.form_box p.weak {
-  font-size: 0.8em;
-}
-.swagger-section .swagger-ui-wrap form.form_box p {
-  font-size: 0.9em;
-  padding: 0 0 15px;
-  color: #7e7b6d;
-}
-.swagger-section .swagger-ui-wrap form.form_box p a {
-  color: #646257;
-}
-.swagger-section .swagger-ui-wrap form.form_box p strong {
-  color: black;
-}
-.swagger-section .swagger-ui-wrap .operation-status td.markdown > p:last-child {
-  padding-bottom: 0;
-}
-.swagger-section .title {
-  font-style: bold;
-}
-.swagger-section .secondary_form {
-  display: none;
-}
-.swagger-section .main_image {
-  display: block;
-  margin-left: auto;
-  margin-right: auto;
-}
-.swagger-section .oauth_body {
-  margin-left: 100px;
-  margin-right: 100px;
-}
-.swagger-section .oauth_submit {
-  text-align: center;
-}
-.swagger-section .api-popup-dialog {
-  z-index: 10000;
-  position: absolute;
-  width: 500px;
-  background: #FFF;
-  padding: 20px;
-  border: 1px solid #ccc;
-  border-radius: 5px;
-  display: none;
-  font-size: 13px;
-  color: #777;
-}
-.swagger-section .api-popup-dialog .api-popup-title {
-  font-size: 24px;
-  padding: 10px 0;
-}
-.swagger-section .api-popup-dialog .api-popup-title {
-  font-size: 24px;
-  padding: 10px 0;
-}
-.swagger-section .api-popup-dialog p.error-msg {
-  padding-left: 5px;
-  padding-bottom: 5px;
-}
-.swagger-section .api-popup-dialog button.api-popup-authbtn {
-  height: 30px;
-}
-.swagger-section .api-popup-dialog button.api-popup-cancel {
-  height: 30px;
-}
-.swagger-section .api-popup-scopes {
-  padding: 10px 20px;
-}
-.swagger-section .api-popup-scopes li {
-  padding: 5px 0;
-  line-height: 20px;
-}
-.swagger-section .api-popup-scopes .api-scope-desc {
-  padding-left: 20px;
-  font-style: italic;
-}
-.swagger-section .api-popup-scopes li input {
-  position: relative;
-  top: 2px;
-}
-.swagger-section .api-popup-actions {
-  padding-top: 10px;
-}
-.swagger-section .access {
-  float: right;
-}
-.swagger-section .auth {
-  float: right;
-}
-.swagger-section .api-ic {
-  height: 18px;
-  vertical-align: middle;
-  display: inline-block;
-  background: url(../images/explorer_icons.png) no-repeat;
-}
-.swagger-section .api-ic .api_information_panel {
-  position: relative;
-  margin-top: 20px;
-  margin-left: -5px;
-  background: #FFF;
-  border: 1px solid #ccc;
-  border-radius: 5px;
-  display: none;
-  font-size: 13px;
-  max-width: 300px;
-  line-height: 30px;
-  color: black;
-  padding: 5px;
-}
-.swagger-section .api-ic .api_information_panel p .api-msg-enabled {
-  color: green;
-}
-.swagger-section .api-ic .api_information_panel p .api-msg-disabled {
-  color: red;
-}
-.swagger-section .api-ic:hover .api_information_panel {
-  position: absolute;
-  display: block;
-}
-.swagger-section .ic-info {
-  background-position: 0 0;
-  width: 18px;
-  margin-top: -6px;
-  margin-left: 4px;
-}
-.swagger-section .ic-warning {
-  background-position: -60px 0;
-  width: 18px;
-  margin-top: -6px;
-  margin-left: 4px;
-}
-.swagger-section .ic-error {
-  background-position: -30px 0;
-  width: 18px;
-  margin-top: -6px;
-  margin-left: 4px;
-}
-.swagger-section .ic-off {
-  background-position: -90px 0;
-  width: 58px;
-  margin-top: -4px;
-  cursor: pointer;
-}
-.swagger-section .ic-on {
-  background-position: -160px 0;
-  width: 58px;
-  margin-top: -4px;
-  cursor: pointer;
-}
-.swagger-section #header {
-  background-color: #89bf04;
-  padding: 14px;
-}
-.swagger-section #header a#logo {
-  font-size: 1.5em;
-  font-weight: bold;
-  text-decoration: none;
-  background: transparent url(../images/logo_small.png) no-repeat left center;
-  padding: 20px 0 20px 40px;
-  color: white;
-}
-.swagger-section #header form#api_selector {
-  display: block;
-  clear: none;
-  float: right;
-}
-.swagger-section #header form#api_selector .input {
-  display: block;
-  clear: none;
-  float: left;
-  margin: 0 10px 0 0;
-}
-.swagger-section #header form#api_selector .input input#input_apiKey {
-  width: 200px;
-}
-.swagger-section #header form#api_selector .input input#input_baseUrl {
-  width: 400px;
-}
-.swagger-section #header form#api_selector .input a#explore {
-  display: block;
-  text-decoration: none;
-  font-weight: bold;
-  padding: 6px 8px;
-  font-size: 0.9em;
-  color: white;
-  background-color: #547f00;
-  -moz-border-radius: 4px;
-  -webkit-border-radius: 4px;
-  -o-border-radius: 4px;
-  -ms-border-radius: 4px;
-  -khtml-border-radius: 4px;
-  border-radius: 4px;
-}
-.swagger-section #header form#api_selector .input a#explore:hover {
-  background-color: #547f00;
-}
-.swagger-section #header form#api_selector .input input {
-  font-size: 0.9em;
-  padding: 3px;
-  margin: 0;
-}
-.swagger-section #content_message {
-  margin: 10px 15px;
-  font-style: italic;
-  color: #999999;
-}
-.swagger-section #message-bar {
-  min-height: 30px;
-  text-align: center;
-  padding-top: 10px;
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/swagger-ui/css/style.css
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/swagger-ui/css/style.css b/brooklyn-ui/src/main/webapp/assets/swagger-ui/css/style.css
deleted file mode 100644
index 8f7410b..0000000
--- a/brooklyn-ui/src/main/webapp/assets/swagger-ui/css/style.css
+++ /dev/null
@@ -1,269 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-.swagger-section #header a#logo {
-  font-size: 1.5em;
-  font-weight: bold;
-  text-decoration: none;
-  background: transparent url(../images/logo.png) no-repeat left center;
-  padding: 20px 0 20px 40px;
-}
-#text-head {
-  font-size: 80px;
-  font-family: 'Roboto', sans-serif;
-  color: #ffffff;
-  float: right;
-  margin-right: 20%;
-}
-.navbar-fixed-top .navbar-nav {
-  height: auto;
-}
-.navbar-fixed-top .navbar-brand {
-  height: auto;
-}
-.navbar-header {
-  height: auto;
-}
-.navbar-inverse {
-  background-color: #000;
-  border-color: #000;
-}
-#navbar-brand {
-  margin-left: 20%;
-}
-.navtext {
-  font-size: 10px;
-}
-.h1,
-h1 {
-  font-size: 60px;
-}
-.navbar-default .navbar-header .navbar-brand {
-  color: #a2dfee;
-}
-/* tag titles */
-.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a {
-  color: #393939;
-  font-family: 'Arvo', serif;
-  font-size: 1.5em;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a:hover {
-  color: black;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 {
-  color: #525252;
-  padding-left: 0px;
-  display: block;
-  clear: none;
-  float: left;
-  font-family: 'Arvo', serif;
-  font-weight: bold;
-}
-.navbar-default .navbar-collapse,
-.navbar-default .navbar-form {
-  border-color: #0A0A0A;
-}
-.container1 {
-  width: 1500px;
-  margin: auto;
-  margin-top: 0;
-  background-image: url('../images/shield.png');
-  background-repeat: no-repeat;
-  background-position: -40px -20px;
-  margin-bottom: 210px;
-}
-.container-inner {
-  width: 1200px;
-  margin: auto;
-  background-color: rgba(223, 227, 228, 0.75);
-  padding-bottom: 40px;
-  padding-top: 40px;
-  border-radius: 15px;
-}
-.header-content {
-  padding: 0;
-  width: 1000px;
-}
-.title1 {
-  font-size: 80px;
-  font-family: 'Vollkorn', serif;
-  color: #404040;
-  text-align: center;
-  padding-top: 40px;
-  padding-bottom: 100px;
-}
-#icon {
-  margin-top: -18px;
-}
-.subtext {
-  font-size: 25px;
-  font-style: italic;
-  color: #08b;
-  text-align: right;
-  padding-right: 250px;
-}
-.bg-primary {
-  background-color: #00468b;
-}
-.navbar-default .nav > li > a,
-.navbar-default .nav > li > a:focus {
-  color: #08b;
-}
-.navbar-default .nav > li > a,
-.navbar-default .nav > li > a:hover {
-  color: #08b;
-}
-.navbar-default .nav > li > a,
-.navbar-default .nav > li > a:focus:hover {
-  color: #08b;
-}
-.text-faded {
-  font-size: 25px;
-  font-family: 'Vollkorn', serif;
-}
-.section-heading {
-  font-family: 'Vollkorn', serif;
-  font-size: 45px;
-  padding-bottom: 10px;
-}
-hr {
-  border-color: #00468b;
-  padding-bottom: 10px;
-}
-.description {
-  margin-top: 20px;
-  padding-bottom: 200px;
-}
-.description li {
-  font-family: 'Vollkorn', serif;
-  font-size: 25px;
-  color: #525252;
-  margin-left: 28%;
-  padding-top: 5px;
-}
-.gap {
-  margin-top: 200px;
-}
-.troubleshootingtext {
-  color: rgba(255, 255, 255, 0.7);
-  padding-left: 30%;
-}
-.troubleshootingtext li {
-  list-style-type: circle;
-  font-size: 25px;
-  padding-bottom: 5px;
-}
-.overlay {
-  position: absolute;
-  top: 0;
-  left: 0;
-  width: 100%;
-  height: 100%;
-  z-index: 1000;
-}
-.block.response_body.json:hover {
-  cursor: pointer;
-}
-.backdrop {
-  color: blue;
-}
-#myModal {
-  height: 100%;
-}
-.modal-backdrop {
-  bottom: 0;
-  position: fixed;
-}
-.curl {
-  padding: 10px;
-  font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
-  font-size: 0.9em;
-  max-height: 400px;
-  margin-top: 5px;
-  overflow-y: auto;
-  background-color: #fcf6db;
-  border: 1px solid #e5e0c6;
-  border-radius: 4px;
-}
-.curl_title {
-  font-size: 1.1em;
-  margin: 0;
-  padding: 15px 0 5px;
-  font-family: 'Open Sans', 'Helvetica Neue', Arial, sans-serif;
-  font-weight: 500;
-  line-height: 1.1;
-}
-.footer {
-  display: none;
-}
-.swagger-section .swagger-ui-wrap h2 {
-  padding: 0;
-}
-h2 {
-  margin: 0;
-  margin-bottom: 5px;
-}
-.markdown p {
-  font-size: 15px;
-  font-family: 'Arvo', serif;
-}
-.swagger-section .swagger-ui-wrap .code {
-  font-size: 15px;
-  font-family: 'Arvo', serif;
-}
-.swagger-section .swagger-ui-wrap b {
-  font-family: 'Arvo', serif;
-}
-#signin:hover {
-  cursor: pointer;
-}
-.dropdown-menu {
-  padding: 15px;
-}
-.navbar-right .dropdown-menu {
-  left: 0;
-  right: auto;
-}
-#signinbutton {
-  width: 100%;
-  height: 32px;
-  font-size: 13px;
-  font-weight: bold;
-  color: #08b;
-}
-.navbar-default .nav > li .details {
-  color: #000000;
-  text-transform: none;
-  font-size: 15px;
-  font-weight: normal;
-  font-family: 'Open Sans', sans-serif;
-  font-style: italic;
-  line-height: 20px;
-  top: -2px;
-}
-.navbar-default .nav > li .details:hover {
-  color: black;
-}
-#signout {
-  width: 100%;
-  height: 32px;
-  font-size: 13px;
-  font-weight: bold;
-  color: #08b;
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/swagger-ui/css/typography.css
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/swagger-ui/css/typography.css b/brooklyn-ui/src/main/webapp/assets/swagger-ui/css/typography.css
deleted file mode 100644
index acc9c61..0000000
--- a/brooklyn-ui/src/main/webapp/assets/swagger-ui/css/typography.css
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/* droid-sans-regular - latin */
-@font-face {
-  font-family: 'Droid Sans';
-  font-style: normal;
-  font-weight: 400;
-  src: url('../fonts/droid-sans-v6-latin-regular.eot'); /* IE9 Compat Modes */
-  src: local('Droid Sans'), local('DroidSans'),
-       url('../fonts/droid-sans-v6-latin-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
-       url('../fonts/droid-sans-v6-latin-regular.woff2') format('woff2'), /* Super Modern Browsers */
-       url('../fonts/droid-sans-v6-latin-regular.woff') format('woff'), /* Modern Browsers */
-       url('../fonts/droid-sans-v6-latin-regular.ttf') format('truetype'), /* Safari, Android, iOS */
-       url('../fonts/droid-sans-v6-latin-regular.svg#DroidSans') format('svg'); /* Legacy iOS */
-}
-/* droid-sans-700 - latin */
-@font-face {
-  font-family: 'Droid Sans';
-  font-style: normal;
-  font-weight: 700;
-  src: url('../fonts/droid-sans-v6-latin-700.eot'); /* IE9 Compat Modes */
-  src: local('Droid Sans Bold'), local('DroidSans-Bold'),
-       url('../fonts/droid-sans-v6-latin-700.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
-       url('../fonts/droid-sans-v6-latin-700.woff2') format('woff2'), /* Super Modern Browsers */
-       url('../fonts/droid-sans-v6-latin-700.woff') format('woff'), /* Modern Browsers */
-       url('../fonts/droid-sans-v6-latin-700.ttf') format('truetype'), /* Safari, Android, iOS */
-       url('../fonts/droid-sans-v6-latin-700.svg#DroidSans') format('svg'); /* Legacy iOS */
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/swagger-ui/fonts/droid-sans-v6-latin-700.eot
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/swagger-ui/fonts/droid-sans-v6-latin-700.eot b/brooklyn-ui/src/main/webapp/assets/swagger-ui/fonts/droid-sans-v6-latin-700.eot
deleted file mode 100644
index d852498..0000000
Binary files a/brooklyn-ui/src/main/webapp/assets/swagger-ui/fonts/droid-sans-v6-latin-700.eot and /dev/null differ


[38/51] [abbrv] [partial] brooklyn-ui git commit: move subdir from incubator up a level as it is promoted to its own repo (first non-incubator commit!)

Posted by he...@apache.org.
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/js/libs/js-yaml.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/js/libs/js-yaml.js b/brooklyn-ui/src/main/webapp/assets/js/libs/js-yaml.js
deleted file mode 100644
index 890b00e..0000000
--- a/brooklyn-ui/src/main/webapp/assets/js/libs/js-yaml.js
+++ /dev/null
@@ -1,3666 +0,0 @@
-/* js-yaml 3.2.7 https://github.com/nodeca/js-yaml */!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.jsyaml=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
-'use strict';
-
-
-var loader = require('./js-yaml/loader');
-var dumper = require('./js-yaml/dumper');
-
-
-function deprecated(name) {
-  return function () {
-    throw new Error('Function ' + name + ' is deprecated and cannot be used.');
-  };
-}
-
-
-module.exports.Type                = require('./js-yaml/type');
-module.exports.Schema              = require('./js-yaml/schema');
-module.exports.FAILSAFE_SCHEMA     = require('./js-yaml/schema/failsafe');
-module.exports.JSON_SCHEMA         = require('./js-yaml/schema/json');
-module.exports.CORE_SCHEMA         = require('./js-yaml/schema/core');
-module.exports.DEFAULT_SAFE_SCHEMA = require('./js-yaml/schema/default_safe');
-module.exports.DEFAULT_FULL_SCHEMA = require('./js-yaml/schema/default_full');
-module.exports.load                = loader.load;
-module.exports.loadAll             = loader.loadAll;
-module.exports.safeLoad            = loader.safeLoad;
-module.exports.safeLoadAll         = loader.safeLoadAll;
-module.exports.dump                = dumper.dump;
-module.exports.safeDump            = dumper.safeDump;
-module.exports.YAMLException       = require('./js-yaml/exception');
-
-// Deprecared schema names from JS-YAML 2.0.x
-module.exports.MINIMAL_SCHEMA = require('./js-yaml/schema/failsafe');
-module.exports.SAFE_SCHEMA    = require('./js-yaml/schema/default_safe');
-module.exports.DEFAULT_SCHEMA = require('./js-yaml/schema/default_full');
-
-// Deprecated functions from JS-YAML 1.x.x
-module.exports.scan           = deprecated('scan');
-module.exports.parse          = deprecated('parse');
-module.exports.compose        = deprecated('compose');
-module.exports.addConstructor = deprecated('addConstructor');
-
-},{"./js-yaml/dumper":3,"./js-yaml/exception":4,"./js-yaml/loader":5,"./js-yaml/schema":7,"./js-yaml/schema/core":8,"./js-yaml/schema/default_full":9,"./js-yaml/schema/default_safe":10,"./js-yaml/schema/failsafe":11,"./js-yaml/schema/json":12,"./js-yaml/type":13}],2:[function(require,module,exports){
-'use strict';
-
-
-function isNothing(subject) {
-  return (undefined === subject) || (null === subject);
-}
-
-
-function isObject(subject) {
-  return ('object' === typeof subject) && (null !== subject);
-}
-
-
-function toArray(sequence) {
-  if (Array.isArray(sequence)) {
-    return sequence;
-  } else if (isNothing(sequence)) {
-    return [];
-  } else {
-    return [ sequence ];
-  }
-}
-
-
-function extend(target, source) {
-  var index, length, key, sourceKeys;
-
-  if (source) {
-    sourceKeys = Object.keys(source);
-
-    for (index = 0, length = sourceKeys.length; index < length; index += 1) {
-      key = sourceKeys[index];
-      target[key] = source[key];
-    }
-  }
-
-  return target;
-}
-
-
-function repeat(string, count) {
-  var result = '', cycle;
-
-  for (cycle = 0; cycle < count; cycle += 1) {
-    result += string;
-  }
-
-  return result;
-}
-
-
-function isNegativeZero(number) {
-  return (0 === number) && (Number.NEGATIVE_INFINITY === 1 / number);
-}
-
-
-module.exports.isNothing      = isNothing;
-module.exports.isObject       = isObject;
-module.exports.toArray        = toArray;
-module.exports.repeat         = repeat;
-module.exports.isNegativeZero = isNegativeZero;
-module.exports.extend         = extend;
-
-},{}],3:[function(require,module,exports){
-'use strict';
-
-
-var common              = require('./common');
-var YAMLException       = require('./exception');
-var DEFAULT_FULL_SCHEMA = require('./schema/default_full');
-var DEFAULT_SAFE_SCHEMA = require('./schema/default_safe');
-
-
-var _toString       = Object.prototype.toString;
-var _hasOwnProperty = Object.prototype.hasOwnProperty;
-
-
-var CHAR_TAB                  = 0x09; /* Tab */
-var CHAR_LINE_FEED            = 0x0A; /* LF */
-var CHAR_CARRIAGE_RETURN      = 0x0D; /* CR */
-var CHAR_SPACE                = 0x20; /* Space */
-var CHAR_EXCLAMATION          = 0x21; /* ! */
-var CHAR_DOUBLE_QUOTE         = 0x22; /* " */
-var CHAR_SHARP                = 0x23; /* # */
-var CHAR_PERCENT              = 0x25; /* % */
-var CHAR_AMPERSAND            = 0x26; /* & */
-var CHAR_SINGLE_QUOTE         = 0x27; /* ' */
-var CHAR_ASTERISK             = 0x2A; /* * */
-var CHAR_COMMA                = 0x2C; /* , */
-var CHAR_MINUS                = 0x2D; /* - */
-var CHAR_COLON                = 0x3A; /* : */
-var CHAR_GREATER_THAN         = 0x3E; /* > */
-var CHAR_QUESTION             = 0x3F; /* ? */
-var CHAR_COMMERCIAL_AT        = 0x40; /* @ */
-var CHAR_LEFT_SQUARE_BRACKET  = 0x5B; /* [ */
-var CHAR_RIGHT_SQUARE_BRACKET = 0x5D; /* ] */
-var CHAR_GRAVE_ACCENT         = 0x60; /* ` */
-var CHAR_LEFT_CURLY_BRACKET   = 0x7B; /* { */
-var CHAR_VERTICAL_LINE        = 0x7C; /* | */
-var CHAR_RIGHT_CURLY_BRACKET  = 0x7D; /* } */
-
-
-var ESCAPE_SEQUENCES = {};
-
-ESCAPE_SEQUENCES[0x00]   = '\\0';
-ESCAPE_SEQUENCES[0x07]   = '\\a';
-ESCAPE_SEQUENCES[0x08]   = '\\b';
-ESCAPE_SEQUENCES[0x09]   = '\\t';
-ESCAPE_SEQUENCES[0x0A]   = '\\n';
-ESCAPE_SEQUENCES[0x0B]   = '\\v';
-ESCAPE_SEQUENCES[0x0C]   = '\\f';
-ESCAPE_SEQUENCES[0x0D]   = '\\r';
-ESCAPE_SEQUENCES[0x1B]   = '\\e';
-ESCAPE_SEQUENCES[0x22]   = '\\"';
-ESCAPE_SEQUENCES[0x5C]   = '\\\\';
-ESCAPE_SEQUENCES[0x85]   = '\\N';
-ESCAPE_SEQUENCES[0xA0]   = '\\_';
-ESCAPE_SEQUENCES[0x2028] = '\\L';
-ESCAPE_SEQUENCES[0x2029] = '\\P';
-
-
-var DEPRECATED_BOOLEANS_SYNTAX = [
-  'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON',
-  'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF'
-];
-
-
-function compileStyleMap(schema, map) {
-  var result, keys, index, length, tag, style, type;
-
-  if (null === map) {
-    return {};
-  }
-
-  result = {};
-  keys = Object.keys(map);
-
-  for (index = 0, length = keys.length; index < length; index += 1) {
-    tag = keys[index];
-    style = String(map[tag]);
-
-    if ('!!' === tag.slice(0, 2)) {
-      tag = 'tag:yaml.org,2002:' + tag.slice(2);
-    }
-
-    type = schema.compiledTypeMap[tag];
-
-    if (type && _hasOwnProperty.call(type.styleAliases, style)) {
-      style = type.styleAliases[style];
-    }
-
-    result[tag] = style;
-  }
-
-  return result;
-}
-
-
-function encodeHex(character) {
-  var string, handle, length;
-
-  string = character.toString(16).toUpperCase();
-
-  if (character <= 0xFF) {
-    handle = 'x';
-    length = 2;
-  } else if (character <= 0xFFFF) {
-    handle = 'u';
-    length = 4;
-  } else if (character <= 0xFFFFFFFF) {
-    handle = 'U';
-    length = 8;
-  } else {
-    throw new YAMLException('code point within a string may not be greater than 0xFFFFFFFF');
-  }
-
-  return '\\' + handle + common.repeat('0', length - string.length) + string;
-}
-
-
-function State(options) {
-  this.schema      = options['schema'] || DEFAULT_FULL_SCHEMA;
-  this.indent      = Math.max(1, (options['indent'] || 2));
-  this.skipInvalid = options['skipInvalid'] || false;
-  this.flowLevel   = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']);
-  this.styleMap    = compileStyleMap(this.schema, options['styles'] || null);
-
-  this.implicitTypes = this.schema.compiledImplicit;
-  this.explicitTypes = this.schema.compiledExplicit;
-
-  this.tag = null;
-  this.result = '';
-
-  this.duplicates = [];
-  this.usedDuplicates = null;
-}
-
-
-function generateNextLine(state, level) {
-  return '\n' + common.repeat(' ', state.indent * level);
-}
-
-function testImplicitResolving(state, str) {
-  var index, length, type;
-
-  for (index = 0, length = state.implicitTypes.length; index < length; index += 1) {
-    type = state.implicitTypes[index];
-
-    if (type.resolve(str)) {
-      return true;
-    }
-  }
-
-  return false;
-}
-
-function writeScalar(state, object) {
-  var isQuoted, checkpoint, position, length, character, first;
-
-  state.dump = '';
-  isQuoted = false;
-  checkpoint = 0;
-  first = object.charCodeAt(0) || 0;
-
-  if (-1 !== DEPRECATED_BOOLEANS_SYNTAX.indexOf(object)) {
-    // Ensure compatibility with YAML 1.0/1.1 loaders.
-    isQuoted = true;
-  } else if (0 === object.length) {
-    // Quote empty string
-    isQuoted = true;
-  } else if (CHAR_SPACE    === first ||
-             CHAR_SPACE    === object.charCodeAt(object.length - 1)) {
-    isQuoted = true;
-  } else if (CHAR_MINUS    === first ||
-             CHAR_QUESTION === first) {
-    // Don't check second symbol for simplicity
-    isQuoted = true;
-  }
-
-  for (position = 0, length = object.length; position < length; position += 1) {
-    character = object.charCodeAt(position);
-
-    if (!isQuoted) {
-      if (CHAR_TAB                  === character ||
-          CHAR_LINE_FEED            === character ||
-          CHAR_CARRIAGE_RETURN      === character ||
-          CHAR_COMMA                === character ||
-          CHAR_LEFT_SQUARE_BRACKET  === character ||
-          CHAR_RIGHT_SQUARE_BRACKET === character ||
-          CHAR_LEFT_CURLY_BRACKET   === character ||
-          CHAR_RIGHT_CURLY_BRACKET  === character ||
-          CHAR_SHARP                === character ||
-          CHAR_AMPERSAND            === character ||
-          CHAR_ASTERISK             === character ||
-          CHAR_EXCLAMATION          === character ||
-          CHAR_VERTICAL_LINE        === character ||
-          CHAR_GREATER_THAN         === character ||
-          CHAR_SINGLE_QUOTE         === character ||
-          CHAR_DOUBLE_QUOTE         === character ||
-          CHAR_PERCENT              === character ||
-          CHAR_COMMERCIAL_AT        === character ||
-          CHAR_COLON                === character ||
-          CHAR_GRAVE_ACCENT         === character) {
-        isQuoted = true;
-      }
-    }
-
-    if (ESCAPE_SEQUENCES[character] ||
-        !((0x00020 <= character && character <= 0x00007E) ||
-          (0x00085 === character)                         ||
-          (0x000A0 <= character && character <= 0x00D7FF) ||
-          (0x0E000 <= character && character <= 0x00FFFD) ||
-          (0x10000 <= character && character <= 0x10FFFF))) {
-      state.dump += object.slice(checkpoint, position);
-      state.dump += ESCAPE_SEQUENCES[character] || encodeHex(character);
-      checkpoint = position + 1;
-      isQuoted = true;
-    }
-  }
-
-  if (checkpoint < position) {
-    state.dump += object.slice(checkpoint, position);
-  }
-
-  if (!isQuoted && testImplicitResolving(state, state.dump)) {
-    isQuoted = true;
-  }
-
-  if (isQuoted) {
-    state.dump = '"' + state.dump + '"';
-  }
-}
-
-function writeFlowSequence(state, level, object) {
-  var _result = '',
-      _tag    = state.tag,
-      index,
-      length;
-
-  for (index = 0, length = object.length; index < length; index += 1) {
-    // Write only valid elements.
-    if (writeNode(state, level, object[index], false, false)) {
-      if (0 !== index) {
-        _result += ', ';
-      }
-      _result += state.dump;
-    }
-  }
-
-  state.tag = _tag;
-  state.dump = '[' + _result + ']';
-}
-
-function writeBlockSequence(state, level, object, compact) {
-  var _result = '',
-      _tag    = state.tag,
-      index,
-      length;
-
-  for (index = 0, length = object.length; index < length; index += 1) {
-    // Write only valid elements.
-    if (writeNode(state, level + 1, object[index], true, true)) {
-      if (!compact || 0 !== index) {
-        _result += generateNextLine(state, level);
-      }
-      _result += '- ' + state.dump;
-    }
-  }
-
-  state.tag = _tag;
-  state.dump = _result || '[]'; // Empty sequence if no valid values.
-}
-
-function writeFlowMapping(state, level, object) {
-  var _result       = '',
-      _tag          = state.tag,
-      objectKeyList = Object.keys(object),
-      index,
-      length,
-      objectKey,
-      objectValue,
-      pairBuffer;
-
-  for (index = 0, length = objectKeyList.length; index < length; index += 1) {
-    pairBuffer = '';
-
-    if (0 !== index) {
-      pairBuffer += ', ';
-    }
-
-    objectKey = objectKeyList[index];
-    objectValue = object[objectKey];
-
-    if (!writeNode(state, level, objectKey, false, false)) {
-      continue; // Skip this pair because of invalid key;
-    }
-
-    if (state.dump.length > 1024) {
-      pairBuffer += '? ';
-    }
-
-    pairBuffer += state.dump + ': ';
-
-    if (!writeNode(state, level, objectValue, false, false)) {
-      continue; // Skip this pair because of invalid value.
-    }
-
-    pairBuffer += state.dump;
-
-    // Both key and value are valid.
-    _result += pairBuffer;
-  }
-
-  state.tag = _tag;
-  state.dump = '{' + _result + '}';
-}
-
-function writeBlockMapping(state, level, object, compact) {
-  var _result       = '',
-      _tag          = state.tag,
-      objectKeyList = Object.keys(object),
-      index,
-      length,
-      objectKey,
-      objectValue,
-      explicitPair,
-      pairBuffer;
-
-  for (index = 0, length = objectKeyList.length; index < length; index += 1) {
-    pairBuffer = '';
-
-    if (!compact || 0 !== index) {
-      pairBuffer += generateNextLine(state, level);
-    }
-
-    objectKey = objectKeyList[index];
-    objectValue = object[objectKey];
-
-    if (!writeNode(state, level + 1, objectKey, true, true)) {
-      continue; // Skip this pair because of invalid key.
-    }
-
-    explicitPair = (null !== state.tag && '?' !== state.tag) ||
-                   (state.dump && state.dump.length > 1024);
-
-    if (explicitPair) {
-      if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
-        pairBuffer += '?';
-      } else {
-        pairBuffer += '? ';
-      }
-    }
-
-    pairBuffer += state.dump;
-
-    if (explicitPair) {
-      pairBuffer += generateNextLine(state, level);
-    }
-
-    if (!writeNode(state, level + 1, objectValue, true, explicitPair)) {
-      continue; // Skip this pair because of invalid value.
-    }
-
-    if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
-      pairBuffer += ':';
-    } else {
-      pairBuffer += ': ';
-    }
-
-    pairBuffer += state.dump;
-
-    // Both key and value are valid.
-    _result += pairBuffer;
-  }
-
-  state.tag = _tag;
-  state.dump = _result || '{}'; // Empty mapping if no valid pairs.
-}
-
-function detectType(state, object, explicit) {
-  var _result, typeList, index, length, type, style;
-
-  typeList = explicit ? state.explicitTypes : state.implicitTypes;
-
-  for (index = 0, length = typeList.length; index < length; index += 1) {
-    type = typeList[index];
-
-    if ((type.instanceOf  || type.predicate) &&
-        (!type.instanceOf || (('object' === typeof object) && (object instanceof type.instanceOf))) &&
-        (!type.predicate  || type.predicate(object))) {
-
-      state.tag = explicit ? type.tag : '?';
-
-      if (type.represent) {
-        style = state.styleMap[type.tag] || type.defaultStyle;
-
-        if ('[object Function]' === _toString.call(type.represent)) {
-          _result = type.represent(object, style);
-        } else if (_hasOwnProperty.call(type.represent, style)) {
-          _result = type.represent[style](object, style);
-        } else {
-          throw new YAMLException('!<' + type.tag + '> tag resolver accepts not "' + style + '" style');
-        }
-
-        state.dump = _result;
-      }
-
-      return true;
-    }
-  }
-
-  return false;
-}
-
-// Serializes `object` and writes it to global `result`.
-// Returns true on success, or false on invalid object.
-//
-function writeNode(state, level, object, block, compact) {
-  state.tag = null;
-  state.dump = object;
-
-  if (!detectType(state, object, false)) {
-    detectType(state, object, true);
-  }
-
-  var type = _toString.call(state.dump);
-
-  if (block) {
-    block = (0 > state.flowLevel || state.flowLevel > level);
-  }
-
-  if ((null !== state.tag && '?' !== state.tag) || (2 !== state.indent && level > 0)) {
-    compact = false;
-  }
-
-  var objectOrArray = '[object Object]' === type || '[object Array]' === type,
-      duplicateIndex,
-      duplicate;
-
-  if (objectOrArray) {
-    duplicateIndex = state.duplicates.indexOf(object);
-    duplicate = duplicateIndex !== -1;
-  }
-
-  if (duplicate && state.usedDuplicates[duplicateIndex]) {
-    state.dump = '*ref_' + duplicateIndex;
-  } else {
-    if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) {
-      state.usedDuplicates[duplicateIndex] = true;
-    }
-    if ('[object Object]' === type) {
-      if (block && (0 !== Object.keys(state.dump).length)) {
-        writeBlockMapping(state, level, state.dump, compact);
-        if (duplicate) {
-          state.dump = '&ref_' + duplicateIndex + (0 === level ? '\n' : '') + state.dump;
-        }
-      } else {
-        writeFlowMapping(state, level, state.dump);
-        if (duplicate) {
-          state.dump = '&ref_' + duplicateIndex + ' ' + state.dump;
-        }
-      }
-    } else if ('[object Array]' === type) {
-      if (block && (0 !== state.dump.length)) {
-        writeBlockSequence(state, level, state.dump, compact);
-        if (duplicate) {
-          state.dump = '&ref_' + duplicateIndex + (0 === level ? '\n' : '') + state.dump;
-        }
-      } else {
-        writeFlowSequence(state, level, state.dump);
-        if (duplicate) {
-          state.dump = '&ref_' + duplicateIndex + ' ' + state.dump;
-        }
-      }
-    } else if ('[object String]' === type) {
-      if ('?' !== state.tag) {
-        writeScalar(state, state.dump);
-      }
-    } else if (state.skipInvalid) {
-      return false;
-    } else {
-      throw new YAMLException('unacceptable kind of an object to dump ' + type);
-    }
-
-    if (null !== state.tag && '?' !== state.tag) {
-      state.dump = '!<' + state.tag + '> ' + state.dump;
-    }
-  }
-
-  return true;
-}
-
-function getDuplicateReferences(object, state) {
-  var objects = [],
-      duplicatesIndexes = [],
-      index,
-      length;
-
-  inspectNode(object, objects, duplicatesIndexes);
-
-  for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) {
-    state.duplicates.push(objects[duplicatesIndexes[index]]);
-  }
-  state.usedDuplicates = new Array(length);
-}
-
-function inspectNode(object, objects, duplicatesIndexes) {
-  var type = _toString.call(object),
-      objectKeyList,
-      index,
-      length;
-
-  if (null !== object && 'object' === typeof object) {
-    index = objects.indexOf(object);
-    if (-1 !== index) {
-      if (-1 === duplicatesIndexes.indexOf(index)) {
-        duplicatesIndexes.push(index);
-      }
-    } else {
-      objects.push(object);
-    
-      if(Array.isArray(object)) {
-        for (index = 0, length = object.length; index < length; index += 1) {
-          inspectNode(object[index], objects, duplicatesIndexes);
-        }
-      } else {
-        objectKeyList = Object.keys(object);
-
-        for (index = 0, length = objectKeyList.length; index < length; index += 1) {
-          inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes);
-        }
-      }
-    }
-  }
-}
-
-function dump(input, options) {
-  options = options || {};
-
-  var state = new State(options);
-
-  getDuplicateReferences(input, state);
-
-  if (writeNode(state, 0, input, true, true)) {
-    return state.dump + '\n';
-  } else {
-    return '';
-  }
-}
-
-
-function safeDump(input, options) {
-  return dump(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
-}
-
-
-module.exports.dump     = dump;
-module.exports.safeDump = safeDump;
-
-},{"./common":2,"./exception":4,"./schema/default_full":9,"./schema/default_safe":10}],4:[function(require,module,exports){
-'use strict';
-
-
-function YAMLException(reason, mark) {
-  this.name    = 'YAMLException';
-  this.reason  = reason;
-  this.mark    = mark;
-  this.message = this.toString(false);
-}
-
-
-YAMLException.prototype.toString = function toString(compact) {
-  var result;
-
-  result = 'JS-YAML: ' + (this.reason || '(unknown reason)');
-
-  if (!compact && this.mark) {
-    result += ' ' + this.mark.toString();
-  }
-
-  return result;
-};
-
-
-module.exports = YAMLException;
-
-},{}],5:[function(require,module,exports){
-'use strict';
-
-
-var common              = require('./common');
-var YAMLException       = require('./exception');
-var Mark                = require('./mark');
-var DEFAULT_SAFE_SCHEMA = require('./schema/default_safe');
-var DEFAULT_FULL_SCHEMA = require('./schema/default_full');
-
-
-var _hasOwnProperty = Object.prototype.hasOwnProperty;
-
-
-var CONTEXT_FLOW_IN   = 1;
-var CONTEXT_FLOW_OUT  = 2;
-var CONTEXT_BLOCK_IN  = 3;
-var CONTEXT_BLOCK_OUT = 4;
-
-
-var CHOMPING_CLIP  = 1;
-var CHOMPING_STRIP = 2;
-var CHOMPING_KEEP  = 3;
-
-
-var PATTERN_NON_PRINTABLE         = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uD800-\uDFFF\uFFFE\uFFFF]/;
-var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/;
-var PATTERN_FLOW_INDICATORS       = /[,\[\]\{\}]/;
-var PATTERN_TAG_HANDLE            = /^(?:!|!!|![a-z\-]+!)$/i;
-var PATTERN_TAG_URI               = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
-
-
-function is_EOL(c) {
-  return (c === 0x0A/* LF */) || (c === 0x0D/* CR */);
-}
-
-function is_WHITE_SPACE(c) {
-  return (c === 0x09/* Tab */) || (c === 0x20/* Space */);
-}
-
-function is_WS_OR_EOL(c) {
-  return (c === 0x09/* Tab */) ||
-         (c === 0x20/* Space */) ||
-         (c === 0x0A/* LF */) ||
-         (c === 0x0D/* CR */);
-}
-
-function is_FLOW_INDICATOR(c) {
-  return 0x2C/* , */ === c ||
-         0x5B/* [ */ === c ||
-         0x5D/* ] */ === c ||
-         0x7B/* { */ === c ||
-         0x7D/* } */ === c;
-}
-
-function fromHexCode(c) {
-  var lc;
-
-  if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) {
-    return c - 0x30;
-  }
-
-  lc = c | 0x20;
-  if ((0x61/* a */ <= lc) && (lc <= 0x66/* f */)) {
-    return lc - 0x61 + 10;
-  }
-
-  return -1;
-}
-
-function escapedHexLen(c) {
-  if (c === 0x78/* x */) { return 2; }
-  if (c === 0x75/* u */) { return 4; }
-  if (c === 0x55/* U */) { return 8; }
-  return 0;
-}
-
-function fromDecimalCode(c) {
-  if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) {
-    return c - 0x30;
-  }
-
-  return -1;
-}
-
-function simpleEscapeSequence(c) {
- return (c === 0x30/* 0 */) ? '\x00' :
-        (c === 0x61/* a */) ? '\x07' :
-        (c === 0x62/* b */) ? '\x08' :
-        (c === 0x74/* t */) ? '\x09' :
-        (c === 0x09/* Tab */) ? '\x09' :
-        (c === 0x6E/* n */) ? '\x0A' :
-        (c === 0x76/* v */) ? '\x0B' :
-        (c === 0x66/* f */) ? '\x0C' :
-        (c === 0x72/* r */) ? '\x0D' :
-        (c === 0x65/* e */) ? '\x1B' :
-        (c === 0x20/* Space */) ? ' ' :
-        (c === 0x22/* " */) ? '\x22' :
-        (c === 0x2F/* / */) ? '/' :
-        (c === 0x5C/* \ */) ? '\x5C' :
-        (c === 0x4E/* N */) ? '\x85' :
-        (c === 0x5F/* _ */) ? '\xA0' :
-        (c === 0x4C/* L */) ? '\u2028' :
-        (c === 0x50/* P */) ? '\u2029' : '';
-}
-
-function charFromCodepoint(c) {
-  if (c <= 0xFFFF) {
-    return String.fromCharCode(c);
-  } else {
-    // Encode UTF-16 surrogate pair
-    // https://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B010000_to_U.2B10FFFF
-    return String.fromCharCode(((c - 0x010000) >> 10) + 0xD800,
-                               ((c - 0x010000) & 0x03FF) + 0xDC00);
-  }
-}
-
-var simpleEscapeCheck = new Array(256); // integer, for fast access
-var simpleEscapeMap = new Array(256);
-for (var i = 0; i < 256; i++) {
-  simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0;
-  simpleEscapeMap[i] = simpleEscapeSequence(i);
-}
-
-
-function State(input, options) {
-  this.input = input;
-
-  this.filename  = options['filename']  || null;
-  this.schema    = options['schema']    || DEFAULT_FULL_SCHEMA;
-  this.onWarning = options['onWarning'] || null;
-  this.legacy    = options['legacy']    || false;
-
-  this.implicitTypes = this.schema.compiledImplicit;
-  this.typeMap       = this.schema.compiledTypeMap;
-
-  this.length     = input.length;
-  this.position   = 0;
-  this.line       = 0;
-  this.lineStart  = 0;
-  this.lineIndent = 0;
-
-  this.documents = [];
-
-  /*
-  this.version;
-  this.checkLineBreaks;
-  this.tagMap;
-  this.anchorMap;
-  this.tag;
-  this.anchor;
-  this.kind;
-  this.result;*/
-
-}
-
-
-function generateError(state, message) {
-  return new YAMLException(
-    message,
-    new Mark(state.filename, state.input, state.position, state.line, (state.position - state.lineStart)));
-}
-
-function throwError(state, message) {
-  throw generateError(state, message);
-}
-
-function throwWarning(state, message) {
-  var error = generateError(state, message);
-
-  if (state.onWarning) {
-    state.onWarning.call(null, error);
-  } else {
-    throw error;
-  }
-}
-
-
-var directiveHandlers = {
-
-  'YAML': function handleYamlDirective(state, name, args) {
-
-      var match, major, minor;
-
-      if (null !== state.version) {
-        throwError(state, 'duplication of %YAML directive');
-      }
-
-      if (1 !== args.length) {
-        throwError(state, 'YAML directive accepts exactly one argument');
-      }
-
-      match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]);
-
-      if (null === match) {
-        throwError(state, 'ill-formed argument of the YAML directive');
-      }
-
-      major = parseInt(match[1], 10);
-      minor = parseInt(match[2], 10);
-
-      if (1 !== major) {
-        throwError(state, 'unacceptable YAML version of the document');
-      }
-
-      state.version = args[0];
-      state.checkLineBreaks = (minor < 2);
-
-      if (1 !== minor && 2 !== minor) {
-        throwWarning(state, 'unsupported YAML version of the document');
-      }
-    },
-
-  'TAG': function handleTagDirective(state, name, args) {
-
-      var handle, prefix;
-
-      if (2 !== args.length) {
-        throwError(state, 'TAG directive accepts exactly two arguments');
-      }
-
-      handle = args[0];
-      prefix = args[1];
-
-      if (!PATTERN_TAG_HANDLE.test(handle)) {
-        throwError(state, 'ill-formed tag handle (first argument) of the TAG directive');
-      }
-
-      if (_hasOwnProperty.call(state.tagMap, handle)) {
-        throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle');
-      }
-
-      if (!PATTERN_TAG_URI.test(prefix)) {
-        throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive');
-      }
-
-      state.tagMap[handle] = prefix;
-    }
-};
-
-
-function captureSegment(state, start, end, checkJson) {
-  var _position, _length, _character, _result;
-
-  if (start < end) {
-    _result = state.input.slice(start, end);
-
-    if (checkJson) {
-      for (_position = 0, _length = _result.length;
-           _position < _length;
-           _position += 1) {
-        _character = _result.charCodeAt(_position);
-        if (!(0x09 === _character ||
-              0x20 <= _character && _character <= 0x10FFFF)) {
-          throwError(state, 'expected valid JSON character');
-        }
-      }
-    }
-
-    state.result += _result;
-  }
-}
-
-function mergeMappings(state, destination, source) {
-  var sourceKeys, key, index, quantity;
-
-  if (!common.isObject(source)) {
-    throwError(state, 'cannot merge mappings; the provided source object is unacceptable');
-  }
-
-  sourceKeys = Object.keys(source);
-
-  for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {
-    key = sourceKeys[index];
-
-    if (!_hasOwnProperty.call(destination, key)) {
-      destination[key] = source[key];
-    }
-  }
-}
-
-function storeMappingPair(state, _result, keyTag, keyNode, valueNode) {
-  var index, quantity;
-
-  keyNode = String(keyNode);
-
-  if (null === _result) {
-    _result = {};
-  }
-
-  if ('tag:yaml.org,2002:merge' === keyTag) {
-    if (Array.isArray(valueNode)) {
-      for (index = 0, quantity = valueNode.length; index < quantity; index += 1) {
-        mergeMappings(state, _result, valueNode[index]);
-      }
-    } else {
-      mergeMappings(state, _result, valueNode);
-    }
-  } else {
-    _result[keyNode] = valueNode;
-  }
-
-  return _result;
-}
-
-function readLineBreak(state) {
-  var ch;
-
-  ch = state.input.charCodeAt(state.position);
-
-  if (0x0A/* LF */ === ch) {
-    state.position++;
-  } else if (0x0D/* CR */ === ch) {
-    state.position++;
-    if (0x0A/* LF */ === state.input.charCodeAt(state.position)) {
-      state.position++;
-    }
-  } else {
-    throwError(state, 'a line break is expected');
-  }
-
-  state.line += 1;
-  state.lineStart = state.position;
-}
-
-function skipSeparationSpace(state, allowComments, checkIndent) {
-  var lineBreaks = 0,
-      ch = state.input.charCodeAt(state.position);
-
-  while (0 !== ch) {
-    while (is_WHITE_SPACE(ch)) {
-      ch = state.input.charCodeAt(++state.position);
-    }
-
-    if (allowComments && 0x23/* # */ === ch) {
-      do {
-        ch = state.input.charCodeAt(++state.position);
-      } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && 0 !== ch);
-    }
-
-    if (is_EOL(ch)) {
-      readLineBreak(state);
-
-      ch = state.input.charCodeAt(state.position);
-      lineBreaks++;
-      state.lineIndent = 0;
-
-      while (0x20/* Space */ === ch) {
-        state.lineIndent++;
-        ch = state.input.charCodeAt(++state.position);
-      }
-    } else {
-      break;
-    }
-  }
-
-  if (-1 !== checkIndent && 0 !== lineBreaks && state.lineIndent < checkIndent) {
-    throwWarning(state, 'deficient indentation');
-  }
-
-  return lineBreaks;
-}
-
-function testDocumentSeparator(state) {
-  var _position = state.position,
-      ch;
-
-  ch = state.input.charCodeAt(_position);
-
-  // Condition state.position === state.lineStart is tested
-  // in parent on each call, for efficiency. No needs to test here again.
-  if ((0x2D/* - */ === ch || 0x2E/* . */ === ch) &&
-      state.input.charCodeAt(_position + 1) === ch &&
-      state.input.charCodeAt(_position+ 2) === ch) {
-
-    _position += 3;
-
-    ch = state.input.charCodeAt(_position);
-
-    if (ch === 0 || is_WS_OR_EOL(ch)) {
-      return true;
-    }
-  }
-
-  return false;
-}
-
-function writeFoldedLines(state, count) {
-  if (1 === count) {
-    state.result += ' ';
-  } else if (count > 1) {
-    state.result += common.repeat('\n', count - 1);
-  }
-}
-
-
-function readPlainScalar(state, nodeIndent, withinFlowCollection) {
-  var preceding,
-      following,
-      captureStart,
-      captureEnd,
-      hasPendingContent,
-      _line,
-      _lineStart,
-      _lineIndent,
-      _kind = state.kind,
-      _result = state.result,
-      ch;
-
-  ch = state.input.charCodeAt(state.position);
-
-  if (is_WS_OR_EOL(ch)             ||
-      is_FLOW_INDICATOR(ch)        ||
-      0x23/* # */           === ch ||
-      0x26/* & */           === ch ||
-      0x2A/* * */           === ch ||
-      0x21/* ! */           === ch ||
-      0x7C/* | */           === ch ||
-      0x3E/* > */           === ch ||
-      0x27/* ' */           === ch ||
-      0x22/* " */           === ch ||
-      0x25/* % */           === ch ||
-      0x40/* @ */           === ch ||
-      0x60/* ` */           === ch) {
-    return false;
-  }
-
-  if (0x3F/* ? */ === ch || 0x2D/* - */ === ch) {
-    following = state.input.charCodeAt(state.position + 1);
-
-    if (is_WS_OR_EOL(following) ||
-        withinFlowCollection && is_FLOW_INDICATOR(following)) {
-      return false;
-    }
-  }
-
-  state.kind = 'scalar';
-  state.result = '';
-  captureStart = captureEnd = state.position;
-  hasPendingContent = false;
-
-  while (0 !== ch) {
-    if (0x3A/* : */ === ch) {
-      following = state.input.charCodeAt(state.position+1);
-
-      if (is_WS_OR_EOL(following) ||
-          withinFlowCollection && is_FLOW_INDICATOR(following)) {
-        break;
-      }
-
-    } else if (0x23/* # */ === ch) {
-      preceding = state.input.charCodeAt(state.position - 1);
-
-      if (is_WS_OR_EOL(preceding)) {
-        break;
-      }
-
-    } else if ((state.position === state.lineStart && testDocumentSeparator(state)) ||
-               withinFlowCollection && is_FLOW_INDICATOR(ch)) {
-      break;
-
-    } else if (is_EOL(ch)) {
-      _line = state.line;
-      _lineStart = state.lineStart;
-      _lineIndent = state.lineIndent;
-      skipSeparationSpace(state, false, -1);
-
-      if (state.lineIndent >= nodeIndent) {
-        hasPendingContent = true;
-        ch = state.input.charCodeAt(state.position);
-        continue;
-      } else {
-        state.position = captureEnd;
-        state.line = _line;
-        state.lineStart = _lineStart;
-        state.lineIndent = _lineIndent;
-        break;
-      }
-    }
-
-    if (hasPendingContent) {
-      captureSegment(state, captureStart, captureEnd, false);
-      writeFoldedLines(state, state.line - _line);
-      captureStart = captureEnd = state.position;
-      hasPendingContent = false;
-    }
-
-    if (!is_WHITE_SPACE(ch)) {
-      captureEnd = state.position + 1;
-    }
-
-    ch = state.input.charCodeAt(++state.position);
-  }
-
-  captureSegment(state, captureStart, captureEnd, false);
-
-  if (state.result) {
-    return true;
-  } else {
-    state.kind = _kind;
-    state.result = _result;
-    return false;
-  }
-}
-
-function readSingleQuotedScalar(state, nodeIndent) {
-  var ch,
-      captureStart, captureEnd;
-
-  ch = state.input.charCodeAt(state.position);
-
-  if (0x27/* ' */ !== ch) {
-    return false;
-  }
-
-  state.kind = 'scalar';
-  state.result = '';
-  state.position++;
-  captureStart = captureEnd = state.position;
-
-  while (0 !== (ch = state.input.charCodeAt(state.position))) {
-    if (0x27/* ' */ === ch) {
-      captureSegment(state, captureStart, state.position, true);
-      ch = state.input.charCodeAt(++state.position);
-
-      if (0x27/* ' */ === ch) {
-        captureStart = captureEnd = state.position;
-        state.position++;
-      } else {
-        return true;
-      }
-
-    } else if (is_EOL(ch)) {
-      captureSegment(state, captureStart, captureEnd, true);
-      writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
-      captureStart = captureEnd = state.position;
-
-    } else if (state.position === state.lineStart && testDocumentSeparator(state)) {
-      throwError(state, 'unexpected end of the document within a single quoted scalar');
-
-    } else {
-      state.position++;
-      captureEnd = state.position;
-    }
-  }
-
-  throwError(state, 'unexpected end of the stream within a single quoted scalar');
-}
-
-function readDoubleQuotedScalar(state, nodeIndent) {
-  var captureStart,
-      captureEnd,
-      hexLength,
-      hexResult,
-      tmp, tmpEsc,
-      ch;
-
-  ch = state.input.charCodeAt(state.position);
-
-  if (0x22/* " */ !== ch) {
-    return false;
-  }
-
-  state.kind = 'scalar';
-  state.result = '';
-  state.position++;
-  captureStart = captureEnd = state.position;
-
-  while (0 !== (ch = state.input.charCodeAt(state.position))) {
-    if (0x22/* " */ === ch) {
-      captureSegment(state, captureStart, state.position, true);
-      state.position++;
-      return true;
-
-    } else if (0x5C/* \ */ === ch) {
-      captureSegment(state, captureStart, state.position, true);
-      ch = state.input.charCodeAt(++state.position);
-
-      if (is_EOL(ch)) {
-        skipSeparationSpace(state, false, nodeIndent);
-
-        //TODO: rework to inline fn with no type cast?
-      } else if (ch < 256 && simpleEscapeCheck[ch]) {
-        state.result += simpleEscapeMap[ch];
-        state.position++;
-
-      } else if ((tmp = escapedHexLen(ch)) > 0) {
-        hexLength = tmp;
-        hexResult = 0;
-
-        for (; hexLength > 0; hexLength--) {
-          ch = state.input.charCodeAt(++state.position);
-
-          if ((tmp = fromHexCode(ch)) >= 0) {
-            hexResult = (hexResult << 4) + tmp;
-
-          } else {
-            throwError(state, 'expected hexadecimal character');
-          }
-        }
-
-        state.result += charFromCodepoint(hexResult);
-
-        state.position++;
-
-      } else {
-        throwError(state, 'unknown escape sequence');
-      }
-
-      captureStart = captureEnd = state.position;
-
-    } else if (is_EOL(ch)) {
-      captureSegment(state, captureStart, captureEnd, true);
-      writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
-      captureStart = captureEnd = state.position;
-
-    } else if (state.position === state.lineStart && testDocumentSeparator(state)) {
-      throwError(state, 'unexpected end of the document within a double quoted scalar');
-
-    } else {
-      state.position++;
-      captureEnd = state.position;
-    }
-  }
-
-  throwError(state, 'unexpected end of the stream within a double quoted scalar');
-}
-
-function readFlowCollection(state, nodeIndent) {
-  var readNext = true,
-      _line,
-      _tag     = state.tag,
-      _result,
-      _anchor  = state.anchor,
-      following,
-      terminator,
-      isPair,
-      isExplicitPair,
-      isMapping,
-      keyNode,
-      keyTag,
-      valueNode,
-      ch;
-
-  ch = state.input.charCodeAt(state.position);
-
-  if (ch === 0x5B/* [ */) {
-    terminator = 0x5D/* ] */;
-    isMapping = false;
-    _result = [];
-  } else if (ch === 0x7B/* { */) {
-    terminator = 0x7D/* } */;
-    isMapping = true;
-    _result = {};
-  } else {
-    return false;
-  }
-
-  if (null !== state.anchor) {
-    state.anchorMap[state.anchor] = _result;
-  }
-
-  ch = state.input.charCodeAt(++state.position);
-
-  while (0 !== ch) {
-    skipSeparationSpace(state, true, nodeIndent);
-
-    ch = state.input.charCodeAt(state.position);
-
-    if (ch === terminator) {
-      state.position++;
-      state.tag = _tag;
-      state.anchor = _anchor;
-      state.kind = isMapping ? 'mapping' : 'sequence';
-      state.result = _result;
-      return true;
-    } else if (!readNext) {
-      throwError(state, 'missed comma between flow collection entries');
-    }
-
-    keyTag = keyNode = valueNode = null;
-    isPair = isExplicitPair = false;
-
-    if (0x3F/* ? */ === ch) {
-      following = state.input.charCodeAt(state.position + 1);
-
-      if (is_WS_OR_EOL(following)) {
-        isPair = isExplicitPair = true;
-        state.position++;
-        skipSeparationSpace(state, true, nodeIndent);
-      }
-    }
-
-    _line = state.line;
-    composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
-    keyTag = state.tag;
-    keyNode = state.result;
-    skipSeparationSpace(state, true, nodeIndent);
-
-    ch = state.input.charCodeAt(state.position);
-
-    if ((isExplicitPair || state.line === _line) && 0x3A/* : */ === ch) {
-      isPair = true;
-      ch = state.input.charCodeAt(++state.position);
-      skipSeparationSpace(state, true, nodeIndent);
-      composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
-      valueNode = state.result;
-    }
-
-    if (isMapping) {
-      storeMappingPair(state, _result, keyTag, keyNode, valueNode);
-    } else if (isPair) {
-      _result.push(storeMappingPair(state, null, keyTag, keyNode, valueNode));
-    } else {
-      _result.push(keyNode);
-    }
-
-    skipSeparationSpace(state, true, nodeIndent);
-
-    ch = state.input.charCodeAt(state.position);
-
-    if (0x2C/* , */ === ch) {
-      readNext = true;
-      ch = state.input.charCodeAt(++state.position);
-    } else {
-      readNext = false;
-    }
-  }
-
-  throwError(state, 'unexpected end of the stream within a flow collection');
-}
-
-function readBlockScalar(state, nodeIndent) {
-  var captureStart,
-      folding,
-      chomping       = CHOMPING_CLIP,
-      detectedIndent = false,
-      textIndent     = nodeIndent,
-      emptyLines     = 0,
-      atMoreIndented = false,
-      tmp,
-      ch;
-
-  ch = state.input.charCodeAt(state.position);
-
-  if (ch === 0x7C/* | */) {
-    folding = false;
-  } else if (ch === 0x3E/* > */) {
-    folding = true;
-  } else {
-    return false;
-  }
-
-  state.kind = 'scalar';
-  state.result = '';
-
-  while (0 !== ch) {
-    ch = state.input.charCodeAt(++state.position);
-
-    if (0x2B/* + */ === ch || 0x2D/* - */ === ch) {
-      if (CHOMPING_CLIP === chomping) {
-        chomping = (0x2B/* + */ === ch) ? CHOMPING_KEEP : CHOMPING_STRIP;
-      } else {
-        throwError(state, 'repeat of a chomping mode identifier');
-      }
-
-    } else if ((tmp = fromDecimalCode(ch)) >= 0) {
-      if (tmp === 0) {
-        throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one');
-      } else if (!detectedIndent) {
-        textIndent = nodeIndent + tmp - 1;
-        detectedIndent = true;
-      } else {
-        throwError(state, 'repeat of an indentation width identifier');
-      }
-
-    } else {
-      break;
-    }
-  }
-
-  if (is_WHITE_SPACE(ch)) {
-    do { ch = state.input.charCodeAt(++state.position); }
-    while (is_WHITE_SPACE(ch));
-
-    if (0x23/* # */ === ch) {
-      do { ch = state.input.charCodeAt(++state.position); }
-      while (!is_EOL(ch) && (0 !== ch));
-    }
-  }
-
-  while (0 !== ch) {
-    readLineBreak(state);
-    state.lineIndent = 0;
-
-    ch = state.input.charCodeAt(state.position);
-
-    while ((!detectedIndent || state.lineIndent < textIndent) &&
-           (0x20/* Space */ === ch)) {
-      state.lineIndent++;
-      ch = state.input.charCodeAt(++state.position);
-    }
-
-    if (!detectedIndent && state.lineIndent > textIndent) {
-      textIndent = state.lineIndent;
-    }
-
-    if (is_EOL(ch)) {
-      emptyLines++;
-      continue;
-    }
-
-    // End of the scalar.
-    if (state.lineIndent < textIndent) {
-
-      // Perform the chomping.
-      if (chomping === CHOMPING_KEEP) {
-        state.result += common.repeat('\n', emptyLines);
-      } else if (chomping === CHOMPING_CLIP) {
-        if (detectedIndent) { // i.e. only if the scalar is not empty.
-          state.result += '\n';
-        }
-      }
-
-      // Break this `while` cycle and go to the funciton's epilogue.
-      break;
-    }
-
-    // Folded style: use fancy rules to handle line breaks.
-    if (folding) {
-
-      // Lines starting with white space characters (more-indented lines) are not folded.
-      if (is_WHITE_SPACE(ch)) {
-        atMoreIndented = true;
-        state.result += common.repeat('\n', emptyLines + 1);
-
-      // End of more-indented block.
-      } else if (atMoreIndented) {
-        atMoreIndented = false;
-        state.result += common.repeat('\n', emptyLines + 1);
-
-      // Just one line break - perceive as the same line.
-      } else if (0 === emptyLines) {
-        if (detectedIndent) { // i.e. only if we have already read some scalar content.
-          state.result += ' ';
-        }
-
-      // Several line breaks - perceive as different lines.
-      } else {
-        state.result += common.repeat('\n', emptyLines);
-      }
-
-    // Literal style: just add exact number of line breaks between content lines.
-    } else {
-
-      // If current line isn't the first one - count line break from the last content line.
-      if (detectedIndent) {
-        state.result += common.repeat('\n', emptyLines + 1);
-
-      // In case of the first content line - count only empty lines.
-      } else {
-        state.result += common.repeat('\n', emptyLines);
-      }
-    }
-
-    detectedIndent = true;
-    emptyLines = 0;
-    captureStart = state.position;
-
-    while (!is_EOL(ch) && (0 !== ch))
-    { ch = state.input.charCodeAt(++state.position); }
-
-    captureSegment(state, captureStart, state.position, false);
-  }
-
-  return true;
-}
-
-function readBlockSequence(state, nodeIndent) {
-  var _line,
-      _tag      = state.tag,
-      _anchor   = state.anchor,
-      _result   = [],
-      following,
-      detected  = false,
-      ch;
-
-  if (null !== state.anchor) {
-    state.anchorMap[state.anchor] = _result;
-  }
-
-  ch = state.input.charCodeAt(state.position);
-
-  while (0 !== ch) {
-
-    if (0x2D/* - */ !== ch) {
-      break;
-    }
-
-    following = state.input.charCodeAt(state.position + 1);
-
-    if (!is_WS_OR_EOL(following)) {
-      break;
-    }
-
-    detected = true;
-    state.position++;
-
-    if (skipSeparationSpace(state, true, -1)) {
-      if (state.lineIndent <= nodeIndent) {
-        _result.push(null);
-        ch = state.input.charCodeAt(state.position);
-        continue;
-      }
-    }
-
-    _line = state.line;
-    composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true);
-    _result.push(state.result);
-    skipSeparationSpace(state, true, -1);
-
-    ch = state.input.charCodeAt(state.position);
-
-    if ((state.line === _line || state.lineIndent > nodeIndent) && (0 !== ch)) {
-      throwError(state, 'bad indentation of a sequence entry');
-    } else if (state.lineIndent < nodeIndent) {
-      break;
-    }
-  }
-
-  if (detected) {
-    state.tag = _tag;
-    state.anchor = _anchor;
-    state.kind = 'sequence';
-    state.result = _result;
-    return true;
-  } else {
-    return false;
-  }
-}
-
-function readBlockMapping(state, nodeIndent, flowIndent) {
-  var following,
-      allowCompact,
-      _line,
-      _tag          = state.tag,
-      _anchor       = state.anchor,
-      _result       = {},
-      keyTag        = null,
-      keyNode       = null,
-      valueNode     = null,
-      atExplicitKey = false,
-      detected      = false,
-      ch;
-
-  if (null !== state.anchor) {
-    state.anchorMap[state.anchor] = _result;
-  }
-
-  ch = state.input.charCodeAt(state.position);
-
-  while (0 !== ch) {
-    following = state.input.charCodeAt(state.position + 1);
-    _line = state.line; // Save the current line.
-
-    //
-    // Explicit notation case. There are two separate blocks:
-    // first for the key (denoted by "?") and second for the value (denoted by ":")
-    //
-    if ((0x3F/* ? */ === ch || 0x3A/* : */  === ch) && is_WS_OR_EOL(following)) {
-
-      if (0x3F/* ? */ === ch) {
-        if (atExplicitKey) {
-          storeMappingPair(state, _result, keyTag, keyNode, null);
-          keyTag = keyNode = valueNode = null;
-        }
-
-        detected = true;
-        atExplicitKey = true;
-        allowCompact = true;
-
-      } else if (atExplicitKey) {
-        // i.e. 0x3A/* : */ === character after the explicit key.
-        atExplicitKey = false;
-        allowCompact = true;
-
-      } else {
-        throwError(state, 'incomplete explicit mapping pair; a key node is missed');
-      }
-
-      state.position += 1;
-      ch = following;
-
-    //
-    // Implicit notation case. Flow-style node as the key first, then ":", and the value.
-    //
-    } else if (composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) {
-
-      if (state.line === _line) {
-        ch = state.input.charCodeAt(state.position);
-
-        while (is_WHITE_SPACE(ch)) {
-          ch = state.input.charCodeAt(++state.position);
-        }
-
-        if (0x3A/* : */ === ch) {
-          ch = state.input.charCodeAt(++state.position);
-
-          if (!is_WS_OR_EOL(ch)) {
-            throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping');
-          }
-
-          if (atExplicitKey) {
-            storeMappingPair(state, _result, keyTag, keyNode, null);
-            keyTag = keyNode = valueNode = null;
-          }
-
-          detected = true;
-          atExplicitKey = false;
-          allowCompact = false;
-          keyTag = state.tag;
-          keyNode = state.result;
-
-        } else if (detected) {
-          throwError(state, 'can not read an implicit mapping pair; a colon is missed');
-
-        } else {
-          state.tag = _tag;
-          state.anchor = _anchor;
-          return true; // Keep the result of `composeNode`.
-        }
-
-      } else if (detected) {
-        throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key');
-
-      } else {
-        state.tag = _tag;
-        state.anchor = _anchor;
-        return true; // Keep the result of `composeNode`.
-      }
-
-    } else {
-      break; // Reading is done. Go to the epilogue.
-    }
-
-    //
-    // Common reading code for both explicit and implicit notations.
-    //
-    if (state.line === _line || state.lineIndent > nodeIndent) {
-      if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) {
-        if (atExplicitKey) {
-          keyNode = state.result;
-        } else {
-          valueNode = state.result;
-        }
-      }
-
-      if (!atExplicitKey) {
-        storeMappingPair(state, _result, keyTag, keyNode, valueNode);
-        keyTag = keyNode = valueNode = null;
-      }
-
-      skipSeparationSpace(state, true, -1);
-      ch = state.input.charCodeAt(state.position);
-    }
-
-    if (state.lineIndent > nodeIndent && (0 !== ch)) {
-      throwError(state, 'bad indentation of a mapping entry');
-    } else if (state.lineIndent < nodeIndent) {
-      break;
-    }
-  }
-
-  //
-  // Epilogue.
-  //
-
-  // Special case: last mapping's node contains only the key in explicit notation.
-  if (atExplicitKey) {
-    storeMappingPair(state, _result, keyTag, keyNode, null);
-  }
-
-  // Expose the resulting mapping.
-  if (detected) {
-    state.tag = _tag;
-    state.anchor = _anchor;
-    state.kind = 'mapping';
-    state.result = _result;
-  }
-
-  return detected;
-}
-
-function readTagProperty(state) {
-  var _position,
-      isVerbatim = false,
-      isNamed    = false,
-      tagHandle,
-      tagName,
-      ch;
-
-  ch = state.input.charCodeAt(state.position);
-
-  if (0x21/* ! */ !== ch) {
-    return false;
-  }
-
-  if (null !== state.tag) {
-    throwError(state, 'duplication of a tag property');
-  }
-
-  ch = state.input.charCodeAt(++state.position);
-
-  if (0x3C/* < */ === ch) {
-    isVerbatim = true;
-    ch = state.input.charCodeAt(++state.position);
-
-  } else if (0x21/* ! */ === ch) {
-    isNamed = true;
-    tagHandle = '!!';
-    ch = state.input.charCodeAt(++state.position);
-
-  } else {
-    tagHandle = '!';
-  }
-
-  _position = state.position;
-
-  if (isVerbatim) {
-    do { ch = state.input.charCodeAt(++state.position); }
-    while (0 !== ch && 0x3E/* > */ !== ch);
-
-    if (state.position < state.length) {
-      tagName = state.input.slice(_position, state.position);
-      ch = state.input.charCodeAt(++state.position);
-    } else {
-      throwError(state, 'unexpected end of the stream within a verbatim tag');
-    }
-  } else {
-    while (0 !== ch && !is_WS_OR_EOL(ch)) {
-
-      if (0x21/* ! */ === ch) {
-        if (!isNamed) {
-          tagHandle = state.input.slice(_position - 1, state.position + 1);
-
-          if (!PATTERN_TAG_HANDLE.test(tagHandle)) {
-            throwError(state, 'named tag handle cannot contain such characters');
-          }
-
-          isNamed = true;
-          _position = state.position + 1;
-        } else {
-          throwError(state, 'tag suffix cannot contain exclamation marks');
-        }
-      }
-
-      ch = state.input.charCodeAt(++state.position);
-    }
-
-    tagName = state.input.slice(_position, state.position);
-
-    if (PATTERN_FLOW_INDICATORS.test(tagName)) {
-      throwError(state, 'tag suffix cannot contain flow indicator characters');
-    }
-  }
-
-  if (tagName && !PATTERN_TAG_URI.test(tagName)) {
-    throwError(state, 'tag name cannot contain such characters: ' + tagName);
-  }
-
-  if (isVerbatim) {
-    state.tag = tagName;
-
-  } else if (_hasOwnProperty.call(state.tagMap, tagHandle)) {
-    state.tag = state.tagMap[tagHandle] + tagName;
-
-  } else if ('!' === tagHandle) {
-    state.tag = '!' + tagName;
-
-  } else if ('!!' === tagHandle) {
-    state.tag = 'tag:yaml.org,2002:' + tagName;
-
-  } else {
-    throwError(state, 'undeclared tag handle "' + tagHandle + '"');
-  }
-
-  return true;
-}
-
-function readAnchorProperty(state) {
-  var _position,
-      ch;
-
-  ch = state.input.charCodeAt(state.position);
-
-  if (0x26/* & */ !== ch) {
-    return false;
-  }
-
-  if (null !== state.anchor) {
-    throwError(state, 'duplication of an anchor property');
-  }
-
-  ch = state.input.charCodeAt(++state.position);
-  _position = state.position;
-
-  while (0 !== ch && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
-    ch = state.input.charCodeAt(++state.position);
-  }
-
-  if (state.position === _position) {
-    throwError(state, 'name of an anchor node must contain at least one character');
-  }
-
-  state.anchor = state.input.slice(_position, state.position);
-  return true;
-}
-
-function readAlias(state) {
-  var _position, alias,
-      len = state.length,
-      input = state.input,
-      ch;
-
-  ch = state.input.charCodeAt(state.position);
-
-  if (0x2A/* * */ !== ch) {
-    return false;
-  }
-
-  ch = state.input.charCodeAt(++state.position);
-  _position = state.position;
-
-  while (0 !== ch && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
-    ch = state.input.charCodeAt(++state.position);
-  }
-
-  if (state.position === _position) {
-    throwError(state, 'name of an alias node must contain at least one character');
-  }
-
-  alias = state.input.slice(_position, state.position);
-
-  if (!state.anchorMap.hasOwnProperty(alias)) {
-    throwError(state, 'unidentified alias "' + alias + '"');
-  }
-
-  state.result = state.anchorMap[alias];
-  skipSeparationSpace(state, true, -1);
-  return true;
-}
-
-function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) {
-  var allowBlockStyles,
-      allowBlockScalars,
-      allowBlockCollections,
-      indentStatus = 1, // 1: this>parent, 0: this=parent, -1: this<parent
-      atNewLine  = false,
-      hasContent = false,
-      typeIndex,
-      typeQuantity,
-      type,
-      flowIndent,
-      blockIndent,
-      _result;
-
-  state.tag    = null;
-  state.anchor = null;
-  state.kind   = null;
-  state.result = null;
-
-  allowBlockStyles = allowBlockScalars = allowBlockCollections =
-    CONTEXT_BLOCK_OUT === nodeContext ||
-    CONTEXT_BLOCK_IN  === nodeContext;
-
-  if (allowToSeek) {
-    if (skipSeparationSpace(state, true, -1)) {
-      atNewLine = true;
-
-      if (state.lineIndent > parentIndent) {
-        indentStatus = 1;
-      } else if (state.lineIndent === parentIndent) {
-        indentStatus = 0;
-      } else if (state.lineIndent < parentIndent) {
-        indentStatus = -1;
-      }
-    }
-  }
-
-  if (1 === indentStatus) {
-    while (readTagProperty(state) || readAnchorProperty(state)) {
-      if (skipSeparationSpace(state, true, -1)) {
-        atNewLine = true;
-        allowBlockCollections = allowBlockStyles;
-
-        if (state.lineIndent > parentIndent) {
-          indentStatus = 1;
-        } else if (state.lineIndent === parentIndent) {
-          indentStatus = 0;
-        } else if (state.lineIndent < parentIndent) {
-          indentStatus = -1;
-        }
-      } else {
-        allowBlockCollections = false;
-      }
-    }
-  }
-
-  if (allowBlockCollections) {
-    allowBlockCollections = atNewLine || allowCompact;
-  }
-
-  if (1 === indentStatus || CONTEXT_BLOCK_OUT === nodeContext) {
-    if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) {
-      flowIndent = parentIndent;
-    } else {
-      flowIndent = parentIndent + 1;
-    }
-
-    blockIndent = state.position - state.lineStart;
-
-    if (1 === indentStatus) {
-      if (allowBlockCollections &&
-          (readBlockSequence(state, blockIndent) ||
-           readBlockMapping(state, blockIndent, flowIndent)) ||
-          readFlowCollection(state, flowIndent)) {
-        hasContent = true;
-      } else {
-        if ((allowBlockScalars && readBlockScalar(state, flowIndent)) ||
-            readSingleQuotedScalar(state, flowIndent) ||
-            readDoubleQuotedScalar(state, flowIndent)) {
-          hasContent = true;
-
-        } else if (readAlias(state)) {
-          hasContent = true;
-
-          if (null !== state.tag || null !== state.anchor) {
-            throwError(state, 'alias node should not have any properties');
-          }
-
-        } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) {
-          hasContent = true;
-
-          if (null === state.tag) {
-            state.tag = '?';
-          }
-        }
-
-        if (null !== state.anchor) {
-          state.anchorMap[state.anchor] = state.result;
-        }
-      }
-    } else if (0 === indentStatus) {
-      // Special case: block sequences are allowed to have same indentation level as the parent.
-      // http://www.yaml.org/spec/1.2/spec.html#id2799784
-      hasContent = allowBlockCollections && readBlockSequence(state, blockIndent);
-    }
-  }
-
-  if (null !== state.tag && '!' !== state.tag) {
-    if ('?' === state.tag) {
-      for (typeIndex = 0, typeQuantity = state.implicitTypes.length;
-           typeIndex < typeQuantity;
-           typeIndex += 1) {
-        type = state.implicitTypes[typeIndex];
-
-        // Implicit resolving is not allowed for non-scalar types, and '?'
-        // non-specific tag is only assigned to plain scalars. So, it isn't
-        // needed to check for 'kind' conformity.
-
-        if (type.resolve(state.result)) { // `state.result` updated in resolver if matched
-          state.result = type.construct(state.result);
-          state.tag = type.tag;
-          if (null !== state.anchor) {
-            state.anchorMap[state.anchor] = state.result;
-          }
-          break;
-        }
-      }
-    } else if (_hasOwnProperty.call(state.typeMap, state.tag)) {
-      type = state.typeMap[state.tag];
-
-      if (null !== state.result && type.kind !== state.kind) {
-        throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"');
-      }
-
-      if (!type.resolve(state.result)) { // `state.result` updated in resolver if matched
-        throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag');
-      } else {
-        state.result = type.construct(state.result);
-        if (null !== state.anchor) {
-          state.anchorMap[state.anchor] = state.result;
-        }
-      }
-    } else {
-      throwWarning(state, 'unknown tag !<' + state.tag + '>');
-    }
-  }
-
-  return null !== state.tag || null !== state.anchor || hasContent;
-}
-
-function readDocument(state) {
-  var documentStart = state.position,
-      _position,
-      directiveName,
-      directiveArgs,
-      hasDirectives = false,
-      ch;
-
-  state.version = null;
-  state.checkLineBreaks = state.legacy;
-  state.tagMap = {};
-  state.anchorMap = {};
-
-  while (0 !== (ch = state.input.charCodeAt(state.position))) {
-    skipSeparationSpace(state, true, -1);
-
-    ch = state.input.charCodeAt(state.position);
-
-    if (state.lineIndent > 0 || 0x25/* % */ !== ch) {
-      break;
-    }
-
-    hasDirectives = true;
-    ch = state.input.charCodeAt(++state.position);
-    _position = state.position;
-
-    while (0 !== ch && !is_WS_OR_EOL(ch)) {
-      ch = state.input.charCodeAt(++state.position);
-    }
-
-    directiveName = state.input.slice(_position, state.position);
-    directiveArgs = [];
-
-    if (directiveName.length < 1) {
-      throwError(state, 'directive name must not be less than one character in length');
-    }
-
-    while (0 !== ch) {
-      while (is_WHITE_SPACE(ch)) {
-        ch = state.input.charCodeAt(++state.position);
-      }
-
-      if (0x23/* # */ === ch) {
-        do { ch = state.input.charCodeAt(++state.position); }
-        while (0 !== ch && !is_EOL(ch));
-        break;
-      }
-
-      if (is_EOL(ch)) {
-        break;
-      }
-
-      _position = state.position;
-
-      while (0 !== ch && !is_WS_OR_EOL(ch)) {
-        ch = state.input.charCodeAt(++state.position);
-      }
-
-      directiveArgs.push(state.input.slice(_position, state.position));
-    }
-
-    if (0 !== ch) {
-      readLineBreak(state);
-    }
-
-    if (_hasOwnProperty.call(directiveHandlers, directiveName)) {
-      directiveHandlers[directiveName](state, directiveName, directiveArgs);
-    } else {
-      throwWarning(state, 'unknown document directive "' + directiveName + '"');
-    }
-  }
-
-  skipSeparationSpace(state, true, -1);
-
-  if (0 === state.lineIndent &&
-      0x2D/* - */ === state.input.charCodeAt(state.position) &&
-      0x2D/* - */ === state.input.charCodeAt(state.position + 1) &&
-      0x2D/* - */ === state.input.charCodeAt(state.position + 2)) {
-    state.position += 3;
-    skipSeparationSpace(state, true, -1);
-
-  } else if (hasDirectives) {
-    throwError(state, 'directives end mark is expected');
-  }
-
-  composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true);
-  skipSeparationSpace(state, true, -1);
-
-  if (state.checkLineBreaks &&
-      PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) {
-    throwWarning(state, 'non-ASCII line breaks are interpreted as content');
-  }
-
-  state.documents.push(state.result);
-
-  if (state.position === state.lineStart && testDocumentSeparator(state)) {
-
-    if (0x2E/* . */ === state.input.charCodeAt(state.position)) {
-      state.position += 3;
-      skipSeparationSpace(state, true, -1);
-    }
-    return;
-  }
-
-  if (state.position < (state.length - 1)) {
-    throwError(state, 'end of the stream or a document separator is expected');
-  } else {
-    return;
-  }
-}
-
-
-function loadDocuments(input, options) {
-  input = String(input);
-  options = options || {};
-
-  if (0 !== input.length &&
-      0x0A/* LF */ !== input.charCodeAt(input.length - 1) &&
-      0x0D/* CR */ !== input.charCodeAt(input.length - 1)) {
-    input += '\n';
-  }
-
-  var state = new State(input, options);
-
-  if (PATTERN_NON_PRINTABLE.test(state.input)) {
-    throwError(state, 'the stream contains non-printable characters');
-  }
-
-  // Use 0 as string terminator. That significantly simplifies bounds check.
-  state.input += '\0';
-
-  while (0x20/* Space */ === state.input.charCodeAt(state.position)) {
-    state.lineIndent += 1;
-    state.position += 1;
-  }
-
-  while (state.position < (state.length - 1)) {
-    readDocument(state);
-  }
-
-  return state.documents;
-}
-
-
-function loadAll(input, iterator, options) {
-  var documents = loadDocuments(input, options), index, length;
-
-  for (index = 0, length = documents.length; index < length; index += 1) {
-    iterator(documents[index]);
-  }
-}
-
-
-function load(input, options) {
-  var documents = loadDocuments(input, options), index, length;
-
-  if (0 === documents.length) {
-    return undefined;
-  } else if (1 === documents.length) {
-    return documents[0];
-  } else {
-    throw new YAMLException('expected a single document in the stream, but found more');
-  }
-}
-
-
-function safeLoadAll(input, output, options) {
-  loadAll(input, output, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
-}
-
-
-function safeLoad(input, options) {
-  return load(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
-}
-
-
-module.exports.loadAll     = loadAll;
-module.exports.load        = load;
-module.exports.safeLoadAll = safeLoadAll;
-module.exports.safeLoad    = safeLoad;
-
-},{"./common":2,"./exception":4,"./mark":6,"./schema/default_full":9,"./schema/default_safe":10}],6:[function(require,module,exports){
-'use strict';
-
-
-var common = require('./common');
-
-
-function Mark(name, buffer, position, line, column) {
-  this.name     = name;
-  this.buffer   = buffer;
-  this.position = position;
-  this.line     = line;
-  this.column   = column;
-}
-
-
-Mark.prototype.getSnippet = function getSnippet(indent, maxLength) {
-  var head, start, tail, end, snippet;
-
-  if (!this.buffer) {
-    return null;
-  }
-
-  indent = indent || 4;
-  maxLength = maxLength || 75;
-
-  head = '';
-  start = this.position;
-
-  while (start > 0 && -1 === '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(start - 1))) {
-    start -= 1;
-    if (this.position - start > (maxLength / 2 - 1)) {
-      head = ' ... ';
-      start += 5;
-      break;
-    }
-  }
-
-  tail = '';
-  end = this.position;
-
-  while (end < this.buffer.length && -1 === '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(end))) {
-    end += 1;
-    if (end - this.position > (maxLength / 2 - 1)) {
-      tail = ' ... ';
-      end -= 5;
-      break;
-    }
-  }
-
-  snippet = this.buffer.slice(start, end);
-
-  return common.repeat(' ', indent) + head + snippet + tail + '\n' +
-         common.repeat(' ', indent + this.position - start + head.length) + '^';
-};
-
-
-Mark.prototype.toString = function toString(compact) {
-  var snippet, where = '';
-
-  if (this.name) {
-    where += 'in "' + this.name + '" ';
-  }
-
-  where += 'at line ' + (this.line + 1) + ', column ' + (this.column + 1);
-
-  if (!compact) {
-    snippet = this.getSnippet();
-
-    if (snippet) {
-      where += ':\n' + snippet;
-    }
-  }
-
-  return where;
-};
-
-
-module.exports = Mark;
-
-},{"./common":2}],7:[function(require,module,exports){
-'use strict';
-
-
-var common        = require('./common');
-var YAMLException = require('./exception');
-var Type          = require('./type');
-
-
-function compileList(schema, name, result) {
-  var exclude = [];
-
-  schema.include.forEach(function (includedSchema) {
-    result = compileList(includedSchema, name, result);
-  });
-
-  schema[name].forEach(function (currentType) {
-    result.forEach(function (previousType, previousIndex) {
-      if (previousType.tag === currentType.tag) {
-        exclude.push(previousIndex);
-      }
-    });
-
-    result.push(currentType);
-  });
-
-  return result.filter(function (type, index) {
-    return -1 === exclude.indexOf(index);
-  });
-}
-
-
-function compileMap(/* lists... */) {
-  var result = {}, index, length;
-
-  function collectType(type) {
-    result[type.tag] = type;
-  }
-
-  for (index = 0, length = arguments.length; index < length; index += 1) {
-    arguments[index].forEach(collectType);
-  }
-
-  return result;
-}
-
-
-function Schema(definition) {
-  this.include  = definition.include  || [];
-  this.implicit = definition.implicit || [];
-  this.explicit = definition.explicit || [];
-
-  this.implicit.forEach(function (type) {
-    if (type.loadKind && 'scalar' !== type.loadKind) {
-      throw new YAMLException('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.');
-    }
-  });
-
-  this.compiledImplicit = compileList(this, 'implicit', []);
-  this.compiledExplicit = compileList(this, 'explicit', []);
-  this.compiledTypeMap  = compileMap(this.compiledImplicit, this.compiledExplicit);
-}
-
-
-Schema.DEFAULT = null;
-
-
-Schema.create = function createSchema() {
-  var schemas, types;
-
-  switch (arguments.length) {
-  case 1:
-    schemas = Schema.DEFAULT;
-    types = arguments[0];
-    break;
-
-  case 2:
-    schemas = arguments[0];
-    types = arguments[1];
-    break;
-
-  default:
-    throw new YAMLException('Wrong number of arguments for Schema.create function');
-  }
-
-  schemas = common.toArray(schemas);
-  types = common.toArray(types);
-
-  if (!schemas.every(function (schema) { return schema instanceof Schema; })) {
-    throw new YAMLException('Specified list of super schemas (or a single Schema object) contains a non-Schema object.');
-  }
-
-  if (!types.every(function (type) { return type instanceof Type; })) {
-    throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.');
-  }
-
-  return new Schema({
-    include: schemas,
-    explicit: types
-  });
-};
-
-
-module.exports = Schema;
-
-},{"./common":2,"./exception":4,"./type":13}],8:[function(require,module,exports){
-// Standard YAML's Core schema.
-// http://www.yaml.org/spec/1.2/spec.html#id2804923
-//
-// NOTE: JS-YAML does not support schema-specific tag resolution restrictions.
-// So, Core schema has no distinctions from JSON schema is JS-YAML.
-
-
-'use strict';
-
-
-var Schema = require('../schema');
-
-
-module.exports = new Schema({
-  include: [
-    require('./json')
-  ]
-});
-
-},{"../schema":7,"./json":12}],9:[function(require,module,exports){
-// JS-YAML's default schema for `load` function.
-// It is not described in the YAML specification.
-//
-// This schema is based on JS-YAML's default safe schema and includes
-// JavaScript-specific types: !!js/undefined, !!js/regexp and !!js/function.
-//
-// Also this schema is used as default base schema at `Schema.create` function.
-
-
-'use strict';
-
-
-var Schema = require('../schema');
-
-
-module.exports = Schema.DEFAULT = new Schema({
-  include: [
-    require('./default_safe')
-  ],
-  explicit: [
-    require('../type/js/undefined'),
-    require('../type/js/regexp'),
-    require('../type/js/function')
-  ]
-});
-
-},{"../schema":7,"../type/js/function":18,"../type/js/regexp":19,"../type/js/undefined":20,"./default_safe":10}],10:[function(require,module,exports){
-// JS-YAML's default schema for `safeLoad` function.
-// It is not described in the YAML specification.
-//
-// This schema is based on standard YAML's Core schema and includes most of
-// extra types described at YAML tag repository. (http://yaml.org/type/)
-
-
-'use strict';
-
-
-var Schema = require('../schema');
-
-
-module.exports = new Schema({
-  include: [
-    require('./core')
-  ],
-  implicit: [
-    require('../type/timestamp'),
-    require('../type/merge')
-  ],
-  explicit: [
-    require('../type/binary'),
-    require('../type/omap'),
-    require('../type/pairs'),
-    require('../type/set')
-  ]
-});
-
-},{"../schema":7,"../type/binary":14,"../type/merge":22,"../type/omap":24,"../type/pairs":25,"../type/set":27,"../type/timestamp":29,"./core":8}],11:[function(require,module,exports){
-// Standard YAML's Failsafe schema.
-// http://www.yaml.org/spec/1.2/spec.html#id2802346
-
-
-'use strict';
-
-
-var Schema = require('../schema');
-
-
-module.exports = new Schema({
-  explicit: [
-    require('../type/str'),
-    require('../type/seq'),
-    require('../type/map')
-  ]
-});
-
-},{"../schema":7,"../type/map":21,"../type/seq":26,"../type/str":28}],12:[function(require,module,exports){
-// Standard YAML's JSON schema.
-// http://www.yaml.org/spec/1.2/spec.html#id2803231
-//
-// NOTE: JS-YAML does not support schema-specific tag resolution restrictions.
-// So, this schema is not such strict as defined in the YAML specification.
-// It allows numbers in binary notaion, use `Null` and `NULL` as `null`, etc.
-
-
-'use strict';
-
-
-var Schema = require('../schema');
-
-
-module.exports = new Schema({
-  include: [
-    require('./failsafe')
-  ],
-  implicit: [
-    require('../type/null'),
-    require('../type/bool'),
-    require('../type/int'),
-    require('../type/float')
-  ]
-});
-
-},{"../schema":7,"../type/bool":15,"../type/float":16,"../type/int":17,"../type/null":23,"./failsafe":11}],13:[function(require,module,exports){
-'use strict';
-
-var YAMLException = require('./exception');
-
-var TYPE_CONSTRUCTOR_OPTIONS = [
-  'kind',
-  'resolve',
-  'construct',
-  'instanceOf',
-  'predicate',
-  'represent',
-  'defaultStyle',
-  'styleAliases'
-];
-
-var YAML_NODE_KINDS = [
-  'scalar',
-  'sequence',
-  'mapping'
-];
-
-function compileStyleAliases(map) {
-  var result = {};
-
-  if (null !== map) {
-    Object.keys(map).forEach(function (style) {
-      map[style].forEach(function (alias) {
-        result[String(alias)] = style;
-      });
-    });
-  }
-
-  return result;
-}
-
-function Type(tag, options) {
-  options = options || {};
-
-  Object.keys(options).forEach(function (name) {
-    if (-1 === TYPE_CONSTRUCTOR_OPTIONS.indexOf(name)) {
-      throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.');
-    }
-  });
-
-  // TODO: Add tag format check.
-  this.tag          = tag;
-  this.kind         = options['kind']         || null;
-  this.resolve      = options['resolve']      || function () { return true; };
-  this.construct    = options['construct']    || function (data) { return data; };
-  this.instanceOf   = options['instanceOf']   || null;
-  this.predicate    = options['predicate']    || null;
-  this.represent    = options['represent']    || null;
-  this.defaultStyle = options['defaultStyle'] || null;
-  this.styleAliases = compileStyleAliases(options['styleAliases'] || null);
-
-  if (-1 === YAML_NODE_KINDS.indexOf(this.kind)) {
-    throw new YAMLException('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.');
-  }
-}
-
-module.exports = Type;
-
-},{"./exception":4}],14:[function(require,module,exports){
-'use strict';
-
-
-// A trick for browserified version.
-// Since we make browserifier to ignore `buffer` module, NodeBuffer will be undefined
-var NodeBuffer = require('buffer').Buffer;
-var Type       = require('../type');
-
-
-// [ 64, 65, 66 ] -> [ padding, CR, LF ]
-var BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r';
-
-
-function resolveYamlBinary(data) {
-  if (null === data) {
-    return false;
-  }
-
-  var code, idx, bitlen = 0, len = 0, max = data.length, map = BASE64_MAP;
-
-  // Convert one by one.
-  for (idx = 0; idx < max; idx ++) {
-    code = map.indexOf(data.charAt(idx));
-
-    // Skip CR/LF
-    if (code > 64) { continue; }
-
-    // Fail on illegal characters
-    if (code < 0) { return false; }
-
-    bitlen += 6;
-  }
-
-  // If there are any bits left, source was corrupted
-  return (bitlen % 8) === 0;
-}
-
-function constructYamlBinary(data) {
-  var code, idx, tailbits,
-      input = data.replace(/[\r\n=]/g, ''), // remove CR/LF & padding to simplify scan
-      max = input.length,
-      map = BASE64_MAP,
-      bits = 0,
-      result = [];
-
-  // Collect by 6*4 bits (3 bytes)
-
-  for (idx = 0; idx < max; idx++) {
-    if ((idx % 4 === 0) && idx) {
-      result.push((bits >> 16) & 0xFF);
-      result.push((bits >> 8) & 0xFF);
-      result.push(bits & 0xFF);
-    }
-
-    bits = (bits << 6) | map.indexOf(input.charAt(idx));
-  }
-
-  // Dump tail
-
-  tailbits = (max % 4)*6;
-
-  if (tailbits === 0) {
-    result.push((bits >> 16) & 0xFF);
-    result.push((bits >> 8) & 0xFF);
-    result.push(bits & 0xFF);
-  } else if (tailbits === 18) {
-    result.push((bits >> 10) & 0xFF);
-    result.push((bits >> 2) & 0xFF);
-  } else if (tailbits === 12) {
-    result.push((bits >> 4) & 0xFF);
-  }
-
-  // Wrap into Buffer for NodeJS and leave Array for browser
-  if (NodeBuffer) {
-    return new NodeBuffer(result);
-  }
-
-  return result;
-}
-
-function representYamlBinary(object /*, style*/) {
-  var result = '', bits = 0, idx, tail,
-      max = object.length,
-      map = BASE64_MAP;
-
-  // Convert every three bytes to 4 ASCII characters.
-
-  for (idx = 0; idx < max; idx++) {
-    if ((idx % 3 === 0) && idx) {
-      result += map[(bits >> 18) & 0x3F];
-      result += map[(bits >> 12) & 0x3F];
-      result += map[(bits >> 6) & 0x3F];
-      result += map[bits & 0x3F];
-    }
-
-    bits = (bits << 8) + object[idx];
-  }
-
-  // Dump tail
-
-  tail = max % 3;
-
-  if (tail === 0) {
-    result += map[(bits >> 18) & 0x3F];
-    result += map[(bits >> 12) & 0x3F];
-    result += map[(bits >> 6) & 0x3F];
-    result += map[bits & 0x3F];
-  } else if (tail === 2) {
-    result += map[(bits >> 10) & 0x3F];
-    result += map[(bits >> 4) & 0x3F];
-    result += map[(bits << 2) & 0x3F];
-    result += map[64];
-  } else if (tail === 1) {
-    result += map[(bits >> 2) & 0x3F];
-    result += map[(bits << 4) & 0x3F];
-    result += map[64];
-    result += map[64];
-  }
-
-  return result;
-}
-
-function isBinary(object) {
-  return NodeBuffer && NodeBuffer.isBuffer(object);
-}
-
-module.exports = new Type('tag:yaml.org,2002:binary', {
-  kind: 'scalar',
-  resolve: resolveYamlBinary,
-  construct: constructYamlBinary,
-  predicate: isBinary,
-  represent: representYamlBinary
-});
-
-},{"../type":13,"buffer":30}],15:[function(require,module,exports){
-'use strict';
-
-var Type = require('../type');
-
-function resolveYamlBoolean(data) {
-  if (null === data) {
-    return false;
-  }
-
-  var max = data.length;
-
-  return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) ||
-         (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE'));
-}
-
-function constructYamlBoolean(data) {
-  return data === 'true' ||
-         data === 'True' ||
-         data === 'TRUE';
-}
-
-function isBoolean(object) {
-  return '[object Boolean]' === Object.prototype.toString.call(object);
-}
-
-module.exports = new Type('tag:yaml.org,2002:bool', {
-  kind: 'scalar',
-  resolve: resolveYamlBoolean,
-  construct: constructYamlBoolean,
-  predicate: isBoolean,
-  represent: {
-    lowercase: function (object) { return object ? 'true' : 'false'; },
-    uppercase: function (object) { return object ? 'TRUE' : 'FALSE'; },
-    camelcase: function (object) { return object ? 'True' : 'False'; }
-  },
-  defaultStyle: 'lowercase'
-});
-
-},{"../type":13}],16:[function(require,module,exports){
-'use strict';
-
-var common = require('../common');
-var Type   = require('../type');
-
-var YAML_FLOAT_PATTERN = new RegExp(
-  '^(?:[-+]?(?:[0-9][0-9_]*)\\.[0-9_]*(?:[eE][-+][0-9]+)?' +
-  '|\\.[0-9_]+(?:[eE][-+][0-9]+)?' +
-  '|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*' +
-  '|[-+]?\\.(?:inf|Inf|INF)' +
-  '|\\.(?:nan|NaN|NAN))$');
-
-function resolveYamlFloat(data) {
-  if (null === data) {
-    return false;
-  }
-
-  var value, sign, base, digits;
-
-  if (!YAML_FLOAT_PATTERN.test(data)) {
-    return false;
-  }
-  return true;
-}
-
-function constructYamlFloat(data) {
-  var value, sign, base, digits;
-
-  value  = data.replace(/_/g, '').toLowerCase();
-  sign   = '-' === value[0] ? -1 : 1;
-  digits = [];
-
-  if (0 <= '+-'.indexOf(value[0])) {
-    value = value.slice(1);
-  }
-
-  if ('.inf' === value) {
-    return (1 === sign) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;
-
-  } else if ('.nan' === value) {
-    return NaN;
-
-  } else if (0 <= value.indexOf(':')) {
-    value.split(':').forEach(function (v) {
-      digits.unshift(parseFloat(v, 10));
-    });
-
-    value = 0.0;
-    base = 1;
-
-    digits.forEach(function (d) {
-      value += d * base;
-      base *= 60;
-    });
-
-    return sign * value;
-
-  } else {
-    return sign * parseFloat(value, 10);
-  }
-}
-
-function representYamlFloat(object, style) {
-  if (isNaN(object)) {
-    switch (style) {
-    case 'lowercase':
-      return '.nan';
-    case 'uppercase':
-      return '.NAN';
-    case 'camelcase':
-      return '.NaN';
-    }
-  } else if (Number.POSITIVE_INFINITY === object) {
-    switch (style) {
-    case 'lowercase':
-      return '.inf';
-    case 'uppercase':
-      return '.INF';
-    case 'camelcase':
-      return '.Inf';
-    }
-  } else if (Number.NEGATIVE_INFINITY === object) {
-    switch (style) {
-    case 'lowercase':
-      return '-.inf';
-    case 'uppercase':
-      return '-.INF';
-    case 'camelcase':
-      return '-.Inf';
-    }
-  } else if (common.isNegativeZero(object)) {
-    return '-0.0';
-  } else {
-    return object.toString(10);
-  }
-}
-
-function isFloat(object) {
-  return ('[object Number]' === Object.prototype.toString.call(object)) &&
-         (0 !== object % 1 || common.isNegativeZero(object));
-}
-
-module.exports = new Type('tag:yaml.org,2002:float', {
-  kind: 'scalar',
-  resolve: resolveYamlFloat,
-  construct: constructYamlFloat,
-  predicate: isFloat,
-  represent: representYamlFloat,
-  defaultStyle: 'lowercase'
-});
-
-},{"../common":2,"../type":13}],17:[function(require,module,exports){
-'use strict';
-
-var common = require('../common');
-var Type   = require('../type');
-
-function isHexCode(c) {
-  return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) ||
-         ((0x41/* A */ <= c) && (c <= 0x46/* F */)) ||
-         ((0x61/* a */ <= c) && (c <= 0x66/* f */));
-}
-
-function isOctCode(c) {
-  return ((0x30/* 0 */ <= c) && (c <= 0x37/* 7 */));
-}
-
-function isDecCode(c) {
-  return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */));
-}
-
-function resolveYamlInteger(data) {
-  if (null === data) {
-    return false;
-  }
-
-  var max = data.length,
-      index = 0,
-      hasDigits = false,
-      ch;
-
-  if (!max) { return false; }
-
-  ch = data[index];
-
-  // sign
-  if (ch === '-' || ch === '+') {
-    ch = data[++index];
-  }
-
-  if (ch === '0') {
-    // 0
-    if (index+1 === max) { return true; }
-    ch = data[++index];
-
-    // base 2, base 8, base 16
-
-    if (ch === 'b') {
-      // base 2
-      index++;
-
-      for (; index < max; index++) {
-        ch = data[index];
-        if (ch === '_') { continue; }
-        if (ch !== '0' && ch !== '1') {
-          return false;
-        }
-        hasDigits = true;
-      }
-      return hasDigits;
-    }
-
-
-    if (ch === 'x') {
-      // base 16
-      index++;
-
-      for (; index < max; index++) {
-        ch = data[index];
-        if (ch === '_') { continue; }
-        if (!isHexCode(data.charCodeAt(index))) {
-          return false;
-        }
-        hasDigits = true;
-      }
-      return hasDigits;
-    }
-
-    // base 8
-    for (; index < max; index++) {
-      ch = data[index];
-      if (ch === '_') { continue; }
-      if (!isOctCode(data.charCodeAt(index))) {
-        return false;
-      }
-      hasDigits = true;
-    }
-    return hasDigits;
-  }
-
-  // base 10 (except 0) or base 60
-
-  for (; index < max; index++) {
-    ch = data[index];
-    if (ch === '_') { continue; }
-    if (ch === ':') { break; }
-    if (!isDecCode(data.charCodeAt(index))) {
-      return false;
-    }
-    hasDigits = true;
-  }
-
-  if (!hasDigits) { return false; }
-
-  // if !base60 - done;
-  if (ch !== ':') { return true; }
-
-  // base60 almost not used, no needs to optimize
-  return /^(:[0-5]?[0-9])+$/.test(data.slice(index));
-}
-
-function constructYamlInteger(data) {
-  var value = data, sign = 1, ch, base, digits = [];
-
-  if (value.indexOf('_') !== -1) {
-    value = value.replace(/_/g, '');
-  }
-
-  ch = value[0];
-
-  if (ch === '-' || ch === '+') {
-    if (ch === '-') { sign = -1; }
-    value = value.slice(1);
-    ch = value[0];
-  }
-
-  if ('0' === value) {
-    return 0;
-  }
-
-  if (ch === '0') {
-    if (value[1] === 'b') {
-      return sign * parseInt(value.slice(2), 2);
-    }
-    if (value[1] === 'x') {
-      return sign * parseInt(value, 16);
-    }
-    return sign * parseInt(value, 8);
-
-  }
-
-  if (value.indexOf(':') !== -1) {
-    value.split(':').forEach(function (v) {
-      digits.unshift(parseInt(v, 10));
-    });
-
-    value = 0;
-    base = 1;
-
-    digits.forEach(function (d) {
-      value += (d * base);
-      base *= 60;
-    });
-
-    return sign * value;
-
-  }
-
-  return sign * parseInt(value, 10);
-}
-
-function isInteger(object) {
-  return ('[object Number]' === Object.prototype.toString.call(object)) &&
-         (0 === object % 1 && !common.isNegativeZero(object));
-}
-
-module.exports = new Type('tag:yaml.org,2002:int', {
-  kind: 'scalar',
-  resolve: resolveYamlInteger,
-  construct: constructYamlInteger,
-  predicate: isInteger,
-  represent: {
-    binary:      function (object) { return '0b' + object.toString(2); },
-    octal:       function (object) { return '0'  + object.toString(8); },
-    decimal:     function (object) { return        object.toString(10); },
-    hexadecimal: function (object) { return '0x' + object.toString(16).toUpperCase(); }
-  },
-  defaultStyle: 'decimal',
-  styleAliases: {
-    binary:      [ 2,  'bin' ],
-    octal:       [ 8,  'oct' ],
-    decimal:     [ 10, 'dec' ],
-    hexadecimal: [ 16, 'hex' ]
-  }
-});
-
-},{"../common":2,"../type":13}],18:[function(require,module,exports){
-'use strict';
-
-var esprima;
-
-// Browserified version does not have esprima
-//
-// 1. For node.js just require module as deps
-// 2. For browser try to require mudule via external AMD system.
-//    If not found - try to fallback to window.esprima. If not
-//    found too - then fail to parse.
-//
-try {
-  esprima = require('esprima');
-} catch (_) {
-  /*global window */
-  if (typeof window !== 'undefined') { esprima = window.esprima; }
-}
-
-var Type = require('../../type');
-
-function resolveJavascriptFunction(data) {
-  if (null === data) {
-    return false;
-  }
-
-  try {
-    var source = '(' + data + ')',
-        ast    = esprima.parse(source, { range: true }),
-        params = [],
-        body;
-
-    if ('Program'             !== ast.type         ||
-        1                     !== ast.body.length  ||
-        'ExpressionStatement' !== ast.body[0].type ||
-        'FunctionExpression'  !== ast.body[0].expression.type) {
-      return false;
-    }
-
-    return true;
-  } catch (err) {
-    return false;
-  }
-}
-
-function constructJavascriptFunction(data) {
-  /*jslint evil:true*/
-
-  var source = '(' + data + ')',
-      ast    = esprima.parse(source, { range: true }),
-      params = [],
-      body;
-
-  if ('Program'             !== ast.type         ||
-      1                     !== ast.body.length  ||
-      'ExpressionStatement' !== ast.body[0].type ||
-      'FunctionExpression'  !== ast.body[0].expression.type) {
-    throw new Error('Failed to resolve function');
-  }
-
-  ast.body[0].expression.params.forEach(function (param) {
-    params.push(param.name);
-  });
-
-  body = ast.body[0].expression.body.range;
-
-  // Esprima's ranges include the first '{' and the last '}' characters on
-  // function expressions. So cut them out.
-  return new Function(params, source.slice(body[0]+1, body[1]-1));
-}
-
-function representJavascriptFunction(object /*, style*/) {
-  return object.toString();
-}
-
-function isFunction(object) {
-  return '[object Function]' === Object.prototype.toString.call(object);
-}
-
-module.exports = new Type('tag:yaml.org,2002:js/function', {
-  kind: 'scalar',
-  resolve: resolveJavascriptFunction,
-  construct: constructJavascriptFunction,
-  predicate: isFunction,
-  represent: representJavascriptFunction
-});
-
-},{"../../type":13,"esprima":"esprima"}],19:[function(require,module,exports){
-'use strict';
-
-var Type = require('../../type');
-
-function resolveJavascriptRegExp(data) {
-  if (null === data) {
-    return false;
-  }
-
-  if (0 === data.length) {
-    return false;
-  }
-
-  var regexp = data,
-      tail   = /\/([gim]*)$/.exec(data),
-      modifiers = '';
-
-  // if regexp starts with '/' it can have modifiers and must be properly closed
-  // `/foo/gim` - modifiers tail can be maximum 3 chars
-  if ('/' === regexp[0]) {
-    if (tail) {
-      modifiers = tail[1];
-    }
-
-    if (modifiers.length > 3) { return false; }
-    // if expression starts with /, is should be properly terminated
-    if (regexp[regexp.length - modifiers.length - 1] !== '/') { return false; }
-
-    regexp = regexp.slice(1, regexp.length - modifiers.length - 1);
-  }
-
-  try {
-    var dummy = new RegExp(regexp, modifiers);
-    return true;
-  } catch (error) {
-    return false;
-  }
-}
-
-function constructJavascriptRegExp(data) {
-  var regexp = data,
-      tail   = /\/([gim]*)$/.exec(data),
-      modifiers = '';
-
-  // `/foo/gim` - tail can be maximum 4 chars
-  if ('/' === regexp[0]) {
-    if (tail) {
-      modifiers = tail[1];
-    }
-    regexp = regexp.slice(1, regexp.length - modifiers.length - 1);
-  }
-
-  return new RegExp(regexp, modifiers);
-}
-
-function representJavascriptRegExp(object /*, style*/) {
-  var result = '/' + object.source + '/';
-
-  if (object.global) {
-    result += 'g';
-  }
-
-  if (object.multiline) {
-    result += 'm';
-  }
-
-  if (object.ignoreCase) {
-    result += 'i';
-  }
-
-  return result;
-}
-
-function isRegExp(object) {
-  return '[object RegExp]' === Object.prototype.toString.call(object);
-}
-
-module.exports = new Type('tag:yaml.org,2002:js/regexp', {
-  kind: 'scalar',
-  resolve: resolveJavascriptRegExp,
-

<TRUNCATED>

[45/51] [abbrv] [partial] brooklyn-ui git commit: move subdir from incubator up a level as it is promoted to its own repo (first non-incubator commit!)

Posted by he...@apache.org.
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/js/libs/backbone.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/js/libs/backbone.js b/brooklyn-ui/src/main/webapp/assets/js/libs/backbone.js
deleted file mode 100644
index 3512d42..0000000
--- a/brooklyn-ui/src/main/webapp/assets/js/libs/backbone.js
+++ /dev/null
@@ -1,1571 +0,0 @@
-//     Backbone.js 1.0.0
-
-//     (c) 2010-2013 Jeremy Ashkenas, DocumentCloud Inc.
-//     Backbone may be freely distributed under the MIT license.
-//     For all details and documentation:
-//     http://backbonejs.org
-
-(function(){
-
-  // Initial Setup
-  // -------------
-
-  // Save a reference to the global object (`window` in the browser, `exports`
-  // on the server).
-  var root = this;
-
-  // Save the previous value of the `Backbone` variable, so that it can be
-  // restored later on, if `noConflict` is used.
-  var previousBackbone = root.Backbone;
-
-  // Create local references to array methods we'll want to use later.
-  var array = [];
-  var push = array.push;
-  var slice = array.slice;
-  var splice = array.splice;
-
-  // The top-level namespace. All public Backbone classes and modules will
-  // be attached to this. Exported for both the browser and the server.
-  var Backbone;
-  if (typeof exports !== 'undefined') {
-    Backbone = exports;
-  } else {
-    Backbone = root.Backbone = {};
-  }
-
-  // Current version of the library. Keep in sync with `package.json`.
-  Backbone.VERSION = '1.0.0';
-
-  // Require Underscore, if we're on the server, and it's not already present.
-  var _ = root._;
-  if (!_ && (typeof require !== 'undefined')) _ = require('underscore');
-
-  // For Backbone's purposes, jQuery, Zepto, Ender, or My Library (kidding) owns
-  // the `$` variable.
-  Backbone.$ = root.jQuery || root.Zepto || root.ender || root.$;
-
-  // Runs Backbone.js in *noConflict* mode, returning the `Backbone` variable
-  // to its previous owner. Returns a reference to this Backbone object.
-  Backbone.noConflict = function() {
-    root.Backbone = previousBackbone;
-    return this;
-  };
-
-  // Turn on `emulateHTTP` to support legacy HTTP servers. Setting this option
-  // will fake `"PUT"` and `"DELETE"` requests via the `_method` parameter and
-  // set a `X-Http-Method-Override` header.
-  Backbone.emulateHTTP = false;
-
-  // Turn on `emulateJSON` to support legacy servers that can't deal with direct
-  // `application/json` requests ... will encode the body as
-  // `application/x-www-form-urlencoded` instead and will send the model in a
-  // form param named `model`.
-  Backbone.emulateJSON = false;
-
-  // Backbone.Events
-  // ---------------
-
-  // A module that can be mixed in to *any object* in order to provide it with
-  // custom events. You may bind with `on` or remove with `off` callback
-  // functions to an event; `trigger`-ing an event fires all callbacks in
-  // succession.
-  //
-  //     var object = {};
-  //     _.extend(object, Backbone.Events);
-  //     object.on('expand', function(){ alert('expanded'); });
-  //     object.trigger('expand');
-  //
-  var Events = Backbone.Events = {
-
-    // Bind an event to a `callback` function. Passing `"all"` will bind
-    // the callback to all events fired.
-    on: function(name, callback, context) {
-      if (!eventsApi(this, 'on', name, [callback, context]) || !callback) return this;
-      this._events || (this._events = {});
-      var events = this._events[name] || (this._events[name] = []);
-      events.push({callback: callback, context: context, ctx: context || this});
-      return this;
-    },
-
-    // Bind an event to only be triggered a single time. After the first time
-    // the callback is invoked, it will be removed.
-    once: function(name, callback, context) {
-      if (!eventsApi(this, 'once', name, [callback, context]) || !callback) return this;
-      var self = this;
-      var once = _.once(function() {
-        self.off(name, once);
-        callback.apply(this, arguments);
-      });
-      once._callback = callback;
-      return this.on(name, once, context);
-    },
-
-    // Remove one or many callbacks. If `context` is null, removes all
-    // callbacks with that function. If `callback` is null, removes all
-    // callbacks for the event. If `name` is null, removes all bound
-    // callbacks for all events.
-    off: function(name, callback, context) {
-      var retain, ev, events, names, i, l, j, k;
-      if (!this._events || !eventsApi(this, 'off', name, [callback, context])) return this;
-      if (!name && !callback && !context) {
-        this._events = {};
-        return this;
-      }
-
-      names = name ? [name] : _.keys(this._events);
-      for (i = 0, l = names.length; i < l; i++) {
-        name = names[i];
-        if (events = this._events[name]) {
-          this._events[name] = retain = [];
-          if (callback || context) {
-            for (j = 0, k = events.length; j < k; j++) {
-              ev = events[j];
-              if ((callback && callback !== ev.callback && callback !== ev.callback._callback) ||
-                  (context && context !== ev.context)) {
-                retain.push(ev);
-              }
-            }
-          }
-          if (!retain.length) delete this._events[name];
-        }
-      }
-
-      return this;
-    },
-
-    // Trigger one or many events, firing all bound callbacks. Callbacks are
-    // passed the same arguments as `trigger` is, apart from the event name
-    // (unless you're listening on `"all"`, which will cause your callback to
-    // receive the true name of the event as the first argument).
-    trigger: function(name) {
-      if (!this._events) return this;
-      var args = slice.call(arguments, 1);
-      if (!eventsApi(this, 'trigger', name, args)) return this;
-      var events = this._events[name];
-      var allEvents = this._events.all;
-      if (events) triggerEvents(events, args);
-      if (allEvents) triggerEvents(allEvents, arguments);
-      return this;
-    },
-
-    // Tell this object to stop listening to either specific events ... or
-    // to every object it's currently listening to.
-    stopListening: function(obj, name, callback) {
-      var listeners = this._listeners;
-      if (!listeners) return this;
-      var deleteListener = !name && !callback;
-      if (typeof name === 'object') callback = this;
-      if (obj) (listeners = {})[obj._listenerId] = obj;
-      for (var id in listeners) {
-        listeners[id].off(name, callback, this);
-        if (deleteListener) delete this._listeners[id];
-      }
-      return this;
-    }
-
-  };
-
-  // Regular expression used to split event strings.
-  var eventSplitter = /\s+/;
-
-  // Implement fancy features of the Events API such as multiple event
-  // names `"change blur"` and jQuery-style event maps `{change: action}`
-  // in terms of the existing API.
-  var eventsApi = function(obj, action, name, rest) {
-    if (!name) return true;
-
-    // Handle event maps.
-    if (typeof name === 'object') {
-      for (var key in name) {
-        obj[action].apply(obj, [key, name[key]].concat(rest));
-      }
-      return false;
-    }
-
-    // Handle space separated event names.
-    if (eventSplitter.test(name)) {
-      var names = name.split(eventSplitter);
-      for (var i = 0, l = names.length; i < l; i++) {
-        obj[action].apply(obj, [names[i]].concat(rest));
-      }
-      return false;
-    }
-
-    return true;
-  };
-
-  // A difficult-to-believe, but optimized internal dispatch function for
-  // triggering events. Tries to keep the usual cases speedy (most internal
-  // Backbone events have 3 arguments).
-  var triggerEvents = function(events, args) {
-    var ev, i = -1, l = events.length, a1 = args[0], a2 = args[1], a3 = args[2];
-    switch (args.length) {
-      case 0: while (++i < l) (ev = events[i]).callback.call(ev.ctx); return;
-      case 1: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1); return;
-      case 2: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2); return;
-      case 3: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2, a3); return;
-      default: while (++i < l) (ev = events[i]).callback.apply(ev.ctx, args);
-    }
-  };
-
-  var listenMethods = {listenTo: 'on', listenToOnce: 'once'};
-
-  // Inversion-of-control versions of `on` and `once`. Tell *this* object to
-  // listen to an event in another object ... keeping track of what it's
-  // listening to.
-  _.each(listenMethods, function(implementation, method) {
-    Events[method] = function(obj, name, callback) {
-      var listeners = this._listeners || (this._listeners = {});
-      var id = obj._listenerId || (obj._listenerId = _.uniqueId('l'));
-      listeners[id] = obj;
-      if (typeof name === 'object') callback = this;
-      obj[implementation](name, callback, this);
-      return this;
-    };
-  });
-
-  // Aliases for backwards compatibility.
-  Events.bind   = Events.on;
-  Events.unbind = Events.off;
-
-  // Allow the `Backbone` object to serve as a global event bus, for folks who
-  // want global "pubsub" in a convenient place.
-  _.extend(Backbone, Events);
-
-  // Backbone.Model
-  // --------------
-
-  // Backbone **Models** are the basic data object in the framework --
-  // frequently representing a row in a table in a database on your server.
-  // A discrete chunk of data and a bunch of useful, related methods for
-  // performing computations and transformations on that data.
-
-  // Create a new model with the specified attributes. A client id (`cid`)
-  // is automatically generated and assigned for you.
-  var Model = Backbone.Model = function(attributes, options) {
-    var defaults;
-    var attrs = attributes || {};
-    options || (options = {});
-    this.cid = _.uniqueId('c');
-    this.attributes = {};
-    _.extend(this, _.pick(options, modelOptions));
-    if (options.parse) attrs = this.parse(attrs, options) || {};
-    if (defaults = _.result(this, 'defaults')) {
-      attrs = _.defaults({}, attrs, defaults);
-    }
-    this.set(attrs, options);
-    this.changed = {};
-    this.initialize.apply(this, arguments);
-  };
-
-  // A list of options to be attached directly to the model, if provided.
-  var modelOptions = ['url', 'urlRoot', 'collection'];
-
-  // Attach all inheritable methods to the Model prototype.
-  _.extend(Model.prototype, Events, {
-
-    // A hash of attributes whose current and previous value differ.
-    changed: null,
-
-    // The value returned during the last failed validation.
-    validationError: null,
-
-    // The default name for the JSON `id` attribute is `"id"`. MongoDB and
-    // CouchDB users may want to set this to `"_id"`.
-    idAttribute: 'id',
-
-    // Initialize is an empty function by default. Override it with your own
-    // initialization logic.
-    initialize: function(){},
-
-    // Return a copy of the model's `attributes` object.
-    toJSON: function(options) {
-      return _.clone(this.attributes);
-    },
-
-    // Proxy `Backbone.sync` by default -- but override this if you need
-    // custom syncing semantics for *this* particular model.
-    sync: function() {
-      return Backbone.sync.apply(this, arguments);
-    },
-
-    // Get the value of an attribute.
-    get: function(attr) {
-      return this.attributes[attr];
-    },
-
-    // Get the HTML-escaped value of an attribute.
-    escape: function(attr) {
-      return _.escape(this.get(attr));
-    },
-
-    // Returns `true` if the attribute contains a value that is not null
-    // or undefined.
-    has: function(attr) {
-      return this.get(attr) != null;
-    },
-
-    // Set a hash of model attributes on the object, firing `"change"`. This is
-    // the core primitive operation of a model, updating the data and notifying
-    // anyone who needs to know about the change in state. The heart of the beast.
-    set: function(key, val, options) {
-      var attr, attrs, unset, changes, silent, changing, prev, current;
-      if (key == null) return this;
-
-      // Handle both `"key", value` and `{key: value}` -style arguments.
-      if (typeof key === 'object') {
-        attrs = key;
-        options = val;
-      } else {
-        (attrs = {})[key] = val;
-      }
-
-      options || (options = {});
-
-      // Run validation.
-      if (!this._validate(attrs, options)) return false;
-
-      // Extract attributes and options.
-      unset           = options.unset;
-      silent          = options.silent;
-      changes         = [];
-      changing        = this._changing;
-      this._changing  = true;
-
-      if (!changing) {
-        this._previousAttributes = _.clone(this.attributes);
-        this.changed = {};
-      }
-      current = this.attributes, prev = this._previousAttributes;
-
-      // Check for changes of `id`.
-      if (this.idAttribute in attrs) this.id = attrs[this.idAttribute];
-
-      // For each `set` attribute, update or delete the current value.
-      for (attr in attrs) {
-        val = attrs[attr];
-        if (!_.isEqual(current[attr], val)) changes.push(attr);
-        if (!_.isEqual(prev[attr], val)) {
-          this.changed[attr] = val;
-        } else {
-          delete this.changed[attr];
-        }
-        unset ? delete current[attr] : current[attr] = val;
-      }
-
-      // Trigger all relevant attribute changes.
-      if (!silent) {
-        if (changes.length) this._pending = true;
-        for (var i = 0, l = changes.length; i < l; i++) {
-          this.trigger('change:' + changes[i], this, current[changes[i]], options);
-        }
-      }
-
-      // You might be wondering why there's a `while` loop here. Changes can
-      // be recursively nested within `"change"` events.
-      if (changing) return this;
-      if (!silent) {
-        while (this._pending) {
-          this._pending = false;
-          this.trigger('change', this, options);
-        }
-      }
-      this._pending = false;
-      this._changing = false;
-      return this;
-    },
-
-    // Remove an attribute from the model, firing `"change"`. `unset` is a noop
-    // if the attribute doesn't exist.
-    unset: function(attr, options) {
-      return this.set(attr, void 0, _.extend({}, options, {unset: true}));
-    },
-
-    // Clear all attributes on the model, firing `"change"`.
-    clear: function(options) {
-      var attrs = {};
-      for (var key in this.attributes) attrs[key] = void 0;
-      return this.set(attrs, _.extend({}, options, {unset: true}));
-    },
-
-    // Determine if the model has changed since the last `"change"` event.
-    // If you specify an attribute name, determine if that attribute has changed.
-    hasChanged: function(attr) {
-      if (attr == null) return !_.isEmpty(this.changed);
-      return _.has(this.changed, attr);
-    },
-
-    // Return an object containing all the attributes that have changed, or
-    // false if there are no changed attributes. Useful for determining what
-    // parts of a view need to be updated and/or what attributes need to be
-    // persisted to the server. Unset attributes will be set to undefined.
-    // You can also pass an attributes object to diff against the model,
-    // determining if there *would be* a change.
-    changedAttributes: function(diff) {
-      if (!diff) return this.hasChanged() ? _.clone(this.changed) : false;
-      var val, changed = false;
-      var old = this._changing ? this._previousAttributes : this.attributes;
-      for (var attr in diff) {
-        if (_.isEqual(old[attr], (val = diff[attr]))) continue;
-        (changed || (changed = {}))[attr] = val;
-      }
-      return changed;
-    },
-
-    // Get the previous value of an attribute, recorded at the time the last
-    // `"change"` event was fired.
-    previous: function(attr) {
-      if (attr == null || !this._previousAttributes) return null;
-      return this._previousAttributes[attr];
-    },
-
-    // Get all of the attributes of the model at the time of the previous
-    // `"change"` event.
-    previousAttributes: function() {
-      return _.clone(this._previousAttributes);
-    },
-
-    // Fetch the model from the server. If the server's representation of the
-    // model differs from its current attributes, they will be overridden,
-    // triggering a `"change"` event.
-    fetch: function(options) {
-      options = options ? _.clone(options) : {};
-      if (options.parse === void 0) options.parse = true;
-      var model = this;
-      var success = options.success;
-      options.success = function(resp) {
-        if (!model.set(model.parse(resp, options), options)) return false;
-        if (success) success(model, resp, options);
-        model.trigger('sync', model, resp, options);
-      };
-      wrapError(this, options);
-      return this.sync('read', this, options);
-    },
-
-    // Set a hash of model attributes, and sync the model to the server.
-    // If the server returns an attributes hash that differs, the model's
-    // state will be `set` again.
-    save: function(key, val, options) {
-      var attrs, method, xhr, attributes = this.attributes;
-
-      // Handle both `"key", value` and `{key: value}` -style arguments.
-      if (key == null || typeof key === 'object') {
-        attrs = key;
-        options = val;
-      } else {
-        (attrs = {})[key] = val;
-      }
-
-      // If we're not waiting and attributes exist, save acts as `set(attr).save(null, opts)`.
-      if (attrs && (!options || !options.wait) && !this.set(attrs, options)) return false;
-
-      options = _.extend({validate: true}, options);
-
-      // Do not persist invalid models.
-      if (!this._validate(attrs, options)) return false;
-
-      // Set temporary attributes if `{wait: true}`.
-      if (attrs && options.wait) {
-        this.attributes = _.extend({}, attributes, attrs);
-      }
-
-      // After a successful server-side save, the client is (optionally)
-      // updated with the server-side state.
-      if (options.parse === void 0) options.parse = true;
-      var model = this;
-      var success = options.success;
-      options.success = function(resp) {
-        // Ensure attributes are restored during synchronous saves.
-        model.attributes = attributes;
-        var serverAttrs = model.parse(resp, options);
-        if (options.wait) serverAttrs = _.extend(attrs || {}, serverAttrs);
-        if (_.isObject(serverAttrs) && !model.set(serverAttrs, options)) {
-          return false;
-        }
-        if (success) success(model, resp, options);
-        model.trigger('sync', model, resp, options);
-      };
-      wrapError(this, options);
-
-      method = this.isNew() ? 'create' : (options.patch ? 'patch' : 'update');
-      if (method === 'patch') options.attrs = attrs;
-      xhr = this.sync(method, this, options);
-
-      // Restore attributes.
-      if (attrs && options.wait) this.attributes = attributes;
-
-      return xhr;
-    },
-
-    // Destroy this model on the server if it was already persisted.
-    // Optimistically removes the model from its collection, if it has one.
-    // If `wait: true` is passed, waits for the server to respond before removal.
-    destroy: function(options) {
-      options = options ? _.clone(options) : {};
-      var model = this;
-      var success = options.success;
-
-      var destroy = function() {
-        model.trigger('destroy', model, model.collection, options);
-      };
-
-      options.success = function(resp) {
-        if (options.wait || model.isNew()) destroy();
-        if (success) success(model, resp, options);
-        if (!model.isNew()) model.trigger('sync', model, resp, options);
-      };
-
-      if (this.isNew()) {
-        options.success();
-        return false;
-      }
-      wrapError(this, options);
-
-      var xhr = this.sync('delete', this, options);
-      if (!options.wait) destroy();
-      return xhr;
-    },
-
-    // Default URL for the model's representation on the server -- if you're
-    // using Backbone's restful methods, override this to change the endpoint
-    // that will be called.
-    url: function() {
-      var base = _.result(this, 'urlRoot') || _.result(this.collection, 'url') || urlError();
-      if (this.isNew()) return base;
-      return base + (base.charAt(base.length - 1) === '/' ? '' : '/') + encodeURIComponent(this.id);
-    },
-
-    // **parse** converts a response into the hash of attributes to be `set` on
-    // the model. The default implementation is just to pass the response along.
-    parse: function(resp, options) {
-      return resp;
-    },
-
-    // Create a new model with identical attributes to this one.
-    clone: function() {
-      return new this.constructor(this.attributes);
-    },
-
-    // A model is new if it has never been saved to the server, and lacks an id.
-    isNew: function() {
-      return this.id == null;
-    },
-
-    // Check if the model is currently in a valid state.
-    isValid: function(options) {
-      return this._validate({}, _.extend(options || {}, { validate: true }));
-    },
-
-    // Run validation against the next complete set of model attributes,
-    // returning `true` if all is well. Otherwise, fire an `"invalid"` event.
-    _validate: function(attrs, options) {
-      if (!options.validate || !this.validate) return true;
-      attrs = _.extend({}, this.attributes, attrs);
-      var error = this.validationError = this.validate(attrs, options) || null;
-      if (!error) return true;
-      this.trigger('invalid', this, error, _.extend(options || {}, {validationError: error}));
-      return false;
-    }
-
-  });
-
-  // Underscore methods that we want to implement on the Model.
-  var modelMethods = ['keys', 'values', 'pairs', 'invert', 'pick', 'omit'];
-
-  // Mix in each Underscore method as a proxy to `Model#attributes`.
-  _.each(modelMethods, function(method) {
-    Model.prototype[method] = function() {
-      var args = slice.call(arguments);
-      args.unshift(this.attributes);
-      return _[method].apply(_, args);
-    };
-  });
-
-  // Backbone.Collection
-  // -------------------
-
-  // If models tend to represent a single row of data, a Backbone Collection is
-  // more analagous to a table full of data ... or a small slice or page of that
-  // table, or a collection of rows that belong together for a particular reason
-  // -- all of the messages in this particular folder, all of the documents
-  // belonging to this particular author, and so on. Collections maintain
-  // indexes of their models, both in order, and for lookup by `id`.
-
-  // Create a new **Collection**, perhaps to contain a specific type of `model`.
-  // If a `comparator` is specified, the Collection will maintain
-  // its models in sort order, as they're added and removed.
-  var Collection = Backbone.Collection = function(models, options) {
-    options || (options = {});
-    if (options.url) this.url = options.url;
-    if (options.model) this.model = options.model;
-    if (options.comparator !== void 0) this.comparator = options.comparator;
-    this._reset();
-    this.initialize.apply(this, arguments);
-    if (models) this.reset(models, _.extend({silent: true}, options));
-  };
-
-  // Default options for `Collection#set`.
-  var setOptions = {add: true, remove: true, merge: true};
-  var addOptions = {add: true, merge: false, remove: false};
-
-  // Define the Collection's inheritable methods.
-  _.extend(Collection.prototype, Events, {
-
-    // The default model for a collection is just a **Backbone.Model**.
-    // This should be overridden in most cases.
-    model: Model,
-
-    // Initialize is an empty function by default. Override it with your own
-    // initialization logic.
-    initialize: function(){},
-
-    // The JSON representation of a Collection is an array of the
-    // models' attributes.
-    toJSON: function(options) {
-      return this.map(function(model){ return model.toJSON(options); });
-    },
-
-    // Proxy `Backbone.sync` by default.
-    sync: function() {
-      return Backbone.sync.apply(this, arguments);
-    },
-
-    // Add a model, or list of models to the set.
-    add: function(models, options) {
-      return this.set(models, _.defaults(options || {}, addOptions));
-    },
-
-    // Remove a model, or a list of models from the set.
-    remove: function(models, options) {
-      models = _.isArray(models) ? models.slice() : [models];
-      options || (options = {});
-      var i, l, index, model;
-      for (i = 0, l = models.length; i < l; i++) {
-        model = this.get(models[i]);
-        if (!model) continue;
-        delete this._byId[model.id];
-        delete this._byId[model.cid];
-        index = this.indexOf(model);
-        this.models.splice(index, 1);
-        this.length--;
-        if (!options.silent) {
-          options.index = index;
-          model.trigger('remove', model, this, options);
-        }
-        this._removeReference(model);
-      }
-      return this;
-    },
-
-    // Update a collection by `set`-ing a new list of models, adding new ones,
-    // removing models that are no longer present, and merging models that
-    // already exist in the collection, as necessary. Similar to **Model#set**,
-    // the core operation for updating the data contained by the collection.
-    set: function(models, options) {
-      options = _.defaults(options || {}, setOptions);
-      if (options.parse) models = this.parse(models, options);
-      if (!_.isArray(models)) models = models ? [models] : [];
-      var i, l, model, attrs, existing, sort;
-      var at = options.at;
-      var sortable = this.comparator && (at == null) && options.sort !== false;
-      var sortAttr = _.isString(this.comparator) ? this.comparator : null;
-      var toAdd = [], toRemove = [], modelMap = {};
-
-      // Turn bare objects into model references, and prevent invalid models
-      // from being added.
-      for (i = 0, l = models.length; i < l; i++) {
-        if (!(model = this._prepareModel(models[i], options))) continue;
-
-        // If a duplicate is found, prevent it from being added and
-        // optionally merge it into the existing model.
-        if (existing = this.get(model)) {
-          if (options.remove) modelMap[existing.cid] = true;
-          if (options.merge) {
-            existing.set(model.attributes, options);
-            if (sortable && !sort && existing.hasChanged(sortAttr)) sort = true;
-          }
-
-        // This is a new model, push it to the `toAdd` list.
-        } else if (options.add) {
-          toAdd.push(model);
-
-          // Listen to added models' events, and index models for lookup by
-          // `id` and by `cid`.
-          model.on('all', this._onModelEvent, this);
-          this._byId[model.cid] = model;
-          if (model.id != null) this._byId[model.id] = model;
-        }
-      }
-
-      // Remove nonexistent models if appropriate.
-      if (options.remove) {
-        for (i = 0, l = this.length; i < l; ++i) {
-          if (!modelMap[(model = this.models[i]).cid]) toRemove.push(model);
-        }
-        if (toRemove.length) this.remove(toRemove, options);
-      }
-
-      // See if sorting is needed, update `length` and splice in new models.
-      if (toAdd.length) {
-        if (sortable) sort = true;
-        this.length += toAdd.length;
-        if (at != null) {
-          splice.apply(this.models, [at, 0].concat(toAdd));
-        } else {
-          push.apply(this.models, toAdd);
-        }
-      }
-
-      // Silently sort the collection if appropriate.
-      if (sort) this.sort({silent: true});
-
-      if (options.silent) return this;
-
-      // Trigger `add` events.
-      for (i = 0, l = toAdd.length; i < l; i++) {
-        (model = toAdd[i]).trigger('add', model, this, options);
-      }
-
-      // Trigger `sort` if the collection was sorted.
-      if (sort) this.trigger('sort', this, options);
-      return this;
-    },
-
-    // When you have more items than you want to add or remove individually,
-    // you can reset the entire set with a new list of models, without firing
-    // any granular `add` or `remove` events. Fires `reset` when finished.
-    // Useful for bulk operations and optimizations.
-    reset: function(models, options) {
-      options || (options = {});
-      for (var i = 0, l = this.models.length; i < l; i++) {
-        this._removeReference(this.models[i]);
-      }
-      options.previousModels = this.models;
-      this._reset();
-      this.add(models, _.extend({silent: true}, options));
-      if (!options.silent) this.trigger('reset', this, options);
-      return this;
-    },
-
-    // Add a model to the end of the collection.
-    push: function(model, options) {
-      model = this._prepareModel(model, options);
-      this.add(model, _.extend({at: this.length}, options));
-      return model;
-    },
-
-    // Remove a model from the end of the collection.
-    pop: function(options) {
-      var model = this.at(this.length - 1);
-      this.remove(model, options);
-      return model;
-    },
-
-    // Add a model to the beginning of the collection.
-    unshift: function(model, options) {
-      model = this._prepareModel(model, options);
-      this.add(model, _.extend({at: 0}, options));
-      return model;
-    },
-
-    // Remove a model from the beginning of the collection.
-    shift: function(options) {
-      var model = this.at(0);
-      this.remove(model, options);
-      return model;
-    },
-
-    // Slice out a sub-array of models from the collection.
-    slice: function(begin, end) {
-      return this.models.slice(begin, end);
-    },
-
-    // Get a model from the set by id.
-    get: function(obj) {
-      if (obj == null) return void 0;
-      return this._byId[obj.id != null ? obj.id : obj.cid || obj];
-    },
-
-    // Get the model at the given index.
-    at: function(index) {
-      return this.models[index];
-    },
-
-    // Return models with matching attributes. Useful for simple cases of
-    // `filter`.
-    where: function(attrs, first) {
-      if (_.isEmpty(attrs)) return first ? void 0 : [];
-      return this[first ? 'find' : 'filter'](function(model) {
-        for (var key in attrs) {
-          if (attrs[key] !== model.get(key)) return false;
-        }
-        return true;
-      });
-    },
-
-    // Return the first model with matching attributes. Useful for simple cases
-    // of `find`.
-    findWhere: function(attrs) {
-      return this.where(attrs, true);
-    },
-
-    // Force the collection to re-sort itself. You don't need to call this under
-    // normal circumstances, as the set will maintain sort order as each item
-    // is added.
-    sort: function(options) {
-      if (!this.comparator) throw new Error('Cannot sort a set without a comparator');
-      options || (options = {});
-
-      // Run sort based on type of `comparator`.
-      if (_.isString(this.comparator) || this.comparator.length === 1) {
-        this.models = this.sortBy(this.comparator, this);
-      } else {
-        this.models.sort(_.bind(this.comparator, this));
-      }
-
-      if (!options.silent) this.trigger('sort', this, options);
-      return this;
-    },
-
-    // Figure out the smallest index at which a model should be inserted so as
-    // to maintain order.
-    sortedIndex: function(model, value, context) {
-      value || (value = this.comparator);
-      var iterator = _.isFunction(value) ? value : function(model) {
-        return model.get(value);
-      };
-      return _.sortedIndex(this.models, model, iterator, context);
-    },
-
-    // Pluck an attribute from each model in the collection.
-    pluck: function(attr) {
-      return _.invoke(this.models, 'get', attr);
-    },
-
-    // Fetch the default set of models for this collection, resetting the
-    // collection when they arrive. If `reset: true` is passed, the response
-    // data will be passed through the `reset` method instead of `set`.
-    fetch: function(options) {
-      options = options ? _.clone(options) : {};
-      if (options.parse === void 0) options.parse = true;
-      var success = options.success;
-      var collection = this;
-      options.success = function(resp) {
-        var method = options.reset ? 'reset' : 'set';
-        collection[method](resp, options);
-        if (success) success(collection, resp, options);
-        collection.trigger('sync', collection, resp, options);
-      };
-      wrapError(this, options);
-      return this.sync('read', this, options);
-    },
-
-    // Create a new instance of a model in this collection. Add the model to the
-    // collection immediately, unless `wait: true` is passed, in which case we
-    // wait for the server to agree.
-    create: function(model, options) {
-      options = options ? _.clone(options) : {};
-      if (!(model = this._prepareModel(model, options))) return false;
-      if (!options.wait) this.add(model, options);
-      var collection = this;
-      var success = options.success;
-      options.success = function(resp) {
-        if (options.wait) collection.add(model, options);
-        if (success) success(model, resp, options);
-      };
-      model.save(null, options);
-      return model;
-    },
-
-    // **parse** converts a response into a list of models to be added to the
-    // collection. The default implementation is just to pass it through.
-    parse: function(resp, options) {
-      return resp;
-    },
-
-    // Create a new collection with an identical list of models as this one.
-    clone: function() {
-      return new this.constructor(this.models);
-    },
-
-    // Private method to reset all internal state. Called when the collection
-    // is first initialized or reset.
-    _reset: function() {
-      this.length = 0;
-      this.models = [];
-      this._byId  = {};
-    },
-
-    // Prepare a hash of attributes (or other model) to be added to this
-    // collection.
-    _prepareModel: function(attrs, options) {
-      if (attrs instanceof Model) {
-        if (!attrs.collection) attrs.collection = this;
-        return attrs;
-      }
-      options || (options = {});
-      options.collection = this;
-      var model = new this.model(attrs, options);
-      if (!model._validate(attrs, options)) {
-        this.trigger('invalid', this, attrs, options);
-        return false;
-      }
-      return model;
-    },
-
-    // Internal method to sever a model's ties to a collection.
-    _removeReference: function(model) {
-      if (this === model.collection) delete model.collection;
-      model.off('all', this._onModelEvent, this);
-    },
-
-    // Internal method called every time a model in the set fires an event.
-    // Sets need to update their indexes when models change ids. All other
-    // events simply proxy through. "add" and "remove" events that originate
-    // in other collections are ignored.
-    _onModelEvent: function(event, model, collection, options) {
-      if ((event === 'add' || event === 'remove') && collection !== this) return;
-      if (event === 'destroy') this.remove(model, options);
-      if (model && event === 'change:' + model.idAttribute) {
-        delete this._byId[model.previous(model.idAttribute)];
-        if (model.id != null) this._byId[model.id] = model;
-      }
-      this.trigger.apply(this, arguments);
-    }
-
-  });
-
-  // Underscore methods that we want to implement on the Collection.
-  // 90% of the core usefulness of Backbone Collections is actually implemented
-  // right here:
-  var methods = ['forEach', 'each', 'map', 'collect', 'reduce', 'foldl',
-    'inject', 'reduceRight', 'foldr', 'find', 'detect', 'filter', 'select',
-    'reject', 'every', 'all', 'some', 'any', 'include', 'contains', 'invoke',
-    'max', 'min', 'toArray', 'size', 'first', 'head', 'take', 'initial', 'rest',
-    'tail', 'drop', 'last', 'without', 'indexOf', 'shuffle', 'lastIndexOf',
-    'isEmpty', 'chain'];
-
-  // Mix in each Underscore method as a proxy to `Collection#models`.
-  _.each(methods, function(method) {
-    Collection.prototype[method] = function() {
-      var args = slice.call(arguments);
-      args.unshift(this.models);
-      return _[method].apply(_, args);
-    };
-  });
-
-  // Underscore methods that take a property name as an argument.
-  var attributeMethods = ['groupBy', 'countBy', 'sortBy'];
-
-  // Use attributes instead of properties.
-  _.each(attributeMethods, function(method) {
-    Collection.prototype[method] = function(value, context) {
-      var iterator = _.isFunction(value) ? value : function(model) {
-        return model.get(value);
-      };
-      return _[method](this.models, iterator, context);
-    };
-  });
-
-  // Backbone.View
-  // -------------
-
-  // Backbone Views are almost more convention than they are actual code. A View
-  // is simply a JavaScript object that represents a logical chunk of UI in the
-  // DOM. This might be a single item, an entire list, a sidebar or panel, or
-  // even the surrounding frame which wraps your whole app. Defining a chunk of
-  // UI as a **View** allows you to define your DOM events declaratively, without
-  // having to worry about render order ... and makes it easy for the view to
-  // react to specific changes in the state of your models.
-
-  // Creating a Backbone.View creates its initial element outside of the DOM,
-  // if an existing element is not provided...
-  var View = Backbone.View = function(options) {
-    this.cid = _.uniqueId('view');
-    this._configure(options || {});
-    this._ensureElement();
-    this.initialize.apply(this, arguments);
-    this.delegateEvents();
-  };
-
-  // Cached regex to split keys for `delegate`.
-  var delegateEventSplitter = /^(\S+)\s*(.*)$/;
-
-  // List of view options to be merged as properties.
-  var viewOptions = ['model', 'collection', 'el', 'id', 'attributes', 'className', 'tagName', 'events'];
-
-  // Set up all inheritable **Backbone.View** properties and methods.
-  _.extend(View.prototype, Events, {
-
-    // The default `tagName` of a View's element is `"div"`.
-    tagName: 'div',
-
-    // jQuery delegate for element lookup, scoped to DOM elements within the
-    // current view. This should be prefered to global lookups where possible.
-    $: function(selector) {
-      return this.$el.find(selector);
-    },
-
-    // Initialize is an empty function by default. Override it with your own
-    // initialization logic.
-    initialize: function(){},
-
-    // **render** is the core function that your view should override, in order
-    // to populate its element (`this.el`), with the appropriate HTML. The
-    // convention is for **render** to always return `this`.
-    render: function() {
-      return this;
-    },
-
-    // Remove this view by taking the element out of the DOM, and removing any
-    // applicable Backbone.Events listeners.
-    remove: function() {
-      this.$el.remove();
-      this.stopListening();
-      return this;
-    },
-
-    // Change the view's element (`this.el` property), including event
-    // re-delegation.
-    setElement: function(element, delegate) {
-      if (this.$el) this.undelegateEvents();
-      this.$el = element instanceof Backbone.$ ? element : Backbone.$(element);
-      this.el = this.$el[0];
-      if (delegate !== false) this.delegateEvents();
-      return this;
-    },
-
-    // Set callbacks, where `this.events` is a hash of
-    //
-    // *{"event selector": "callback"}*
-    //
-    //     {
-    //       'mousedown .title':  'edit',
-    //       'click .button':     'save'
-    //       'click .open':       function(e) { ... }
-    //     }
-    //
-    // pairs. Callbacks will be bound to the view, with `this` set properly.
-    // Uses event delegation for efficiency.
-    // Omitting the selector binds the event to `this.el`.
-    // This only works for delegate-able events: not `focus`, `blur`, and
-    // not `change`, `submit`, and `reset` in Internet Explorer.
-    delegateEvents: function(events) {
-      if (!(events || (events = _.result(this, 'events')))) return this;
-      this.undelegateEvents();
-      for (var key in events) {
-        var method = events[key];
-        if (!_.isFunction(method)) method = this[events[key]];
-        if (!method) continue;
-
-        var match = key.match(delegateEventSplitter);
-        var eventName = match[1], selector = match[2];
-        method = _.bind(method, this);
-        eventName += '.delegateEvents' + this.cid;
-        if (selector === '') {
-          this.$el.on(eventName, method);
-        } else {
-          this.$el.on(eventName, selector, method);
-        }
-      }
-      return this;
-    },
-
-    // Clears all callbacks previously bound to the view with `delegateEvents`.
-    // You usually don't need to use this, but may wish to if you have multiple
-    // Backbone views attached to the same DOM element.
-    undelegateEvents: function() {
-      this.$el.off('.delegateEvents' + this.cid);
-      return this;
-    },
-
-    // Performs the initial configuration of a View with a set of options.
-    // Keys with special meaning *(e.g. model, collection, id, className)* are
-    // attached directly to the view.  See `viewOptions` for an exhaustive
-    // list.
-    _configure: function(options) {
-      if (this.options) options = _.extend({}, _.result(this, 'options'), options);
-      _.extend(this, _.pick(options, viewOptions));
-      this.options = options;
-    },
-
-    // Ensure that the View has a DOM element to render into.
-    // If `this.el` is a string, pass it through `$()`, take the first
-    // matching element, and re-assign it to `el`. Otherwise, create
-    // an element from the `id`, `className` and `tagName` properties.
-    _ensureElement: function() {
-      if (!this.el) {
-        var attrs = _.extend({}, _.result(this, 'attributes'));
-        if (this.id) attrs.id = _.result(this, 'id');
-        if (this.className) attrs['class'] = _.result(this, 'className');
-        var $el = Backbone.$('<' + _.result(this, 'tagName') + '>').attr(attrs);
-        this.setElement($el, false);
-      } else {
-        this.setElement(_.result(this, 'el'), false);
-      }
-    }
-
-  });
-
-  // Backbone.sync
-  // -------------
-
-  // Override this function to change the manner in which Backbone persists
-  // models to the server. You will be passed the type of request, and the
-  // model in question. By default, makes a RESTful Ajax request
-  // to the model's `url()`. Some possible customizations could be:
-  //
-  // * Use `setTimeout` to batch rapid-fire updates into a single request.
-  // * Send up the models as XML instead of JSON.
-  // * Persist models via WebSockets instead of Ajax.
-  //
-  // Turn on `Backbone.emulateHTTP` in order to send `PUT` and `DELETE` requests
-  // as `POST`, with a `_method` parameter containing the true HTTP method,
-  // as well as all requests with the body as `application/x-www-form-urlencoded`
-  // instead of `application/json` with the model in a param named `model`.
-  // Useful when interfacing with server-side languages like **PHP** that make
-  // it difficult to read the body of `PUT` requests.
-  Backbone.sync = function(method, model, options) {
-    var type = methodMap[method];
-
-    // Default options, unless specified.
-    _.defaults(options || (options = {}), {
-      emulateHTTP: Backbone.emulateHTTP,
-      emulateJSON: Backbone.emulateJSON
-    });
-
-    // Default JSON-request options.
-    var params = {type: type, dataType: 'json'};
-
-    // Ensure that we have a URL.
-    if (!options.url) {
-      params.url = _.result(model, 'url') || urlError();
-    }
-
-    // Ensure that we have the appropriate request data.
-    if (options.data == null && model && (method === 'create' || method === 'update' || method === 'patch')) {
-      params.contentType = 'application/json';
-      params.data = JSON.stringify(options.attrs || model.toJSON(options));
-    }
-
-    // For older servers, emulate JSON by encoding the request into an HTML-form.
-    if (options.emulateJSON) {
-      params.contentType = 'application/x-www-form-urlencoded';
-      params.data = params.data ? {model: params.data} : {};
-    }
-
-    // For older servers, emulate HTTP by mimicking the HTTP method with `_method`
-    // And an `X-HTTP-Method-Override` header.
-    if (options.emulateHTTP && (type === 'PUT' || type === 'DELETE' || type === 'PATCH')) {
-      params.type = 'POST';
-      if (options.emulateJSON) params.data._method = type;
-      var beforeSend = options.beforeSend;
-      options.beforeSend = function(xhr) {
-        xhr.setRequestHeader('X-HTTP-Method-Override', type);
-        if (beforeSend) return beforeSend.apply(this, arguments);
-      };
-    }
-
-    // Don't process data on a non-GET request.
-    if (params.type !== 'GET' && !options.emulateJSON) {
-      params.processData = false;
-    }
-
-    // If we're sending a `PATCH` request, and we're in an old Internet Explorer
-    // that still has ActiveX enabled by default, override jQuery to use that
-    // for XHR instead. Remove this line when jQuery supports `PATCH` on IE8.
-    if (params.type === 'PATCH' && window.ActiveXObject &&
-          !(window.external && window.external.msActiveXFilteringEnabled)) {
-      params.xhr = function() {
-        return new ActiveXObject("Microsoft.XMLHTTP");
-      };
-    }
-
-    // Make the request, allowing the user to override any Ajax options.
-    var xhr = options.xhr = Backbone.ajax(_.extend(params, options));
-    model.trigger('request', model, xhr, options);
-    return xhr;
-  };
-
-  // Map from CRUD to HTTP for our default `Backbone.sync` implementation.
-  var methodMap = {
-    'create': 'POST',
-    'update': 'PUT',
-    'patch':  'PATCH',
-    'delete': 'DELETE',
-    'read':   'GET'
-  };
-
-  // Set the default implementation of `Backbone.ajax` to proxy through to `$`.
-  // Override this if you'd like to use a different library.
-  Backbone.ajax = function() {
-    return Backbone.$.ajax.apply(Backbone.$, arguments);
-  };
-
-  // Backbone.Router
-  // ---------------
-
-  // Routers map faux-URLs to actions, and fire events when routes are
-  // matched. Creating a new one sets its `routes` hash, if not set statically.
-  var Router = Backbone.Router = function(options) {
-    options || (options = {});
-    if (options.routes) this.routes = options.routes;
-    this._bindRoutes();
-    this.initialize.apply(this, arguments);
-  };
-
-  // Cached regular expressions for matching named param parts and splatted
-  // parts of route strings.
-  var optionalParam = /\((.*?)\)/g;
-  var namedParam    = /(\(\?)?:\w+/g;
-  var splatParam    = /\*\w+/g;
-  var escapeRegExp  = /[\-{}\[\]+?.,\\\^$|#\s]/g;
-
-  // Set up all inheritable **Backbone.Router** properties and methods.
-  _.extend(Router.prototype, Events, {
-
-    // Initialize is an empty function by default. Override it with your own
-    // initialization logic.
-    initialize: function(){},
-
-    // Manually bind a single named route to a callback. For example:
-    //
-    //     this.route('search/:query/p:num', 'search', function(query, num) {
-    //       ...
-    //     });
-    //
-    route: function(route, name, callback) {
-      if (!_.isRegExp(route)) route = this._routeToRegExp(route);
-      if (_.isFunction(name)) {
-        callback = name;
-        name = '';
-      }
-      if (!callback) callback = this[name];
-      var router = this;
-      Backbone.history.route(route, function(fragment) {
-        var args = router._extractParameters(route, fragment);
-        callback && callback.apply(router, args);
-        router.trigger.apply(router, ['route:' + name].concat(args));
-        router.trigger('route', name, args);
-        Backbone.history.trigger('route', router, name, args);
-      });
-      return this;
-    },
-
-    // Simple proxy to `Backbone.history` to save a fragment into the history.
-    navigate: function(fragment, options) {
-      Backbone.history.navigate(fragment, options);
-      return this;
-    },
-
-    // Bind all defined routes to `Backbone.history`. We have to reverse the
-    // order of the routes here to support behavior where the most general
-    // routes can be defined at the bottom of the route map.
-    _bindRoutes: function() {
-      if (!this.routes) return;
-      this.routes = _.result(this, 'routes');
-      var route, routes = _.keys(this.routes);
-      while ((route = routes.pop()) != null) {
-        this.route(route, this.routes[route]);
-      }
-    },
-
-    // Convert a route string into a regular expression, suitable for matching
-    // against the current location hash.
-    _routeToRegExp: function(route) {
-      route = route.replace(escapeRegExp, '\\$&')
-                   .replace(optionalParam, '(?:$1)?')
-                   .replace(namedParam, function(match, optional){
-                     return optional ? match : '([^\/]+)';
-                   })
-                   .replace(splatParam, '(.*?)');
-      return new RegExp('^' + route + '$');
-    },
-
-    // Given a route, and a URL fragment that it matches, return the array of
-    // extracted decoded parameters. Empty or unmatched parameters will be
-    // treated as `null` to normalize cross-browser behavior.
-    _extractParameters: function(route, fragment) {
-      var params = route.exec(fragment).slice(1);
-      return _.map(params, function(param) {
-        return param ? decodeURIComponent(param) : null;
-      });
-    }
-
-  });
-
-  // Backbone.History
-  // ----------------
-
-  // Handles cross-browser history management, based on either
-  // [pushState](http://diveintohtml5.info/history.html) and real URLs, or
-  // [onhashchange](https://developer.mozilla.org/en-US/docs/DOM/window.onhashchange)
-  // and URL fragments. If the browser supports neither (old IE, natch),
-  // falls back to polling.
-  var History = Backbone.History = function() {
-    this.handlers = [];
-    _.bindAll(this, 'checkUrl');
-
-    // Ensure that `History` can be used outside of the browser.
-    if (typeof window !== 'undefined') {
-      this.location = window.location;
-      this.history = window.history;
-    }
-  };
-
-  // Cached regex for stripping a leading hash/slash and trailing space.
-  var routeStripper = /^[#\/]|\s+$/g;
-
-  // Cached regex for stripping leading and trailing slashes.
-  var rootStripper = /^\/+|\/+$/g;
-
-  // Cached regex for detecting MSIE.
-  var isExplorer = /msie [\w.]+/;
-
-  // Cached regex for removing a trailing slash.
-  var trailingSlash = /\/$/;
-
-  // Has the history handling already been started?
-  History.started = false;
-
-  // Set up all inheritable **Backbone.History** properties and methods.
-  _.extend(History.prototype, Events, {
-
-    // The default interval to poll for hash changes, if necessary, is
-    // twenty times a second.
-    interval: 50,
-
-    // Gets the true hash value. Cannot use location.hash directly due to bug
-    // in Firefox where location.hash will always be decoded.
-    getHash: function(window) {
-      var match = (window || this).location.href.match(/#(.*)$/);
-      return match ? match[1] : '';
-    },
-
-    // Get the cross-browser normalized URL fragment, either from the URL,
-    // the hash, or the override.
-    getFragment: function(fragment, forcePushState) {
-      if (fragment == null) {
-        if (this._hasPushState || !this._wantsHashChange || forcePushState) {
-          fragment = this.location.pathname;
-          var root = this.root.replace(trailingSlash, '');
-          if (!fragment.indexOf(root)) fragment = fragment.substr(root.length);
-        } else {
-          fragment = this.getHash();
-        }
-      }
-      return fragment.replace(routeStripper, '');
-    },
-
-    // Start the hash change handling, returning `true` if the current URL matches
-    // an existing route, and `false` otherwise.
-    start: function(options) {
-      if (History.started) throw new Error("Backbone.history has already been started");
-      History.started = true;
-
-      // Figure out the initial configuration. Do we need an iframe?
-      // Is pushState desired ... is it available?
-      this.options          = _.extend({}, {root: '/'}, this.options, options);
-      this.root             = this.options.root;
-      this._wantsHashChange = this.options.hashChange !== false;
-      this._wantsPushState  = !!this.options.pushState;
-      this._hasPushState    = !!(this.options.pushState && this.history && this.history.pushState);
-      var fragment          = this.getFragment();
-      var docMode           = document.documentMode;
-      var oldIE             = (isExplorer.exec(navigator.userAgent.toLowerCase()) && (!docMode || docMode <= 7));
-
-      // Normalize root to always include a leading and trailing slash.
-      this.root = ('/' + this.root + '/').replace(rootStripper, '/');
-
-      if (oldIE && this._wantsHashChange) {
-        this.iframe = Backbone.$('<iframe src="javascript:0" tabindex="-1" />').hide().appendTo('body')[0].contentWindow;
-        this.navigate(fragment);
-      }
-
-      // Depending on whether we're using pushState or hashes, and whether
-      // 'onhashchange' is supported, determine how we check the URL state.
-      if (this._hasPushState) {
-        Backbone.$(window).on('popstate', this.checkUrl);
-      } else if (this._wantsHashChange && ('onhashchange' in window) && !oldIE) {
-        Backbone.$(window).on('hashchange', this.checkUrl);
-      } else if (this._wantsHashChange) {
-        this._checkUrlInterval = setInterval(this.checkUrl, this.interval);
-      }
-
-      // Determine if we need to change the base url, for a pushState link
-      // opened by a non-pushState browser.
-      this.fragment = fragment;
-      var loc = this.location;
-      var atRoot = loc.pathname.replace(/[^\/]$/, '$&/') === this.root;
-
-      // If we've started off with a route from a `pushState`-enabled browser,
-      // but we're currently in a browser that doesn't support it...
-      if (this._wantsHashChange && this._wantsPushState && !this._hasPushState && !atRoot) {
-        this.fragment = this.getFragment(null, true);
-        this.location.replace(this.root + this.location.search + '#' + this.fragment);
-        // Return immediately as browser will do redirect to new url
-        return true;
-
-      // Or if we've started out with a hash-based route, but we're currently
-      // in a browser where it could be `pushState`-based instead...
-      } else if (this._wantsPushState && this._hasPushState && atRoot && loc.hash) {
-        this.fragment = this.getHash().replace(routeStripper, '');
-        this.history.replaceState({}, document.title, this.root + this.fragment + loc.search);
-      }
-
-      if (!this.options.silent) return this.loadUrl();
-    },
-
-    // Disable Backbone.history, perhaps temporarily. Not useful in a real app,
-    // but possibly useful for unit testing Routers.
-    stop: function() {
-      Backbone.$(window).off('popstate', this.checkUrl).off('hashchange', this.checkUrl);
-      clearInterval(this._checkUrlInterval);
-      History.started = false;
-    },
-
-    // Add a route to be tested when the fragment changes. Routes added later
-    // may override previous routes.
-    route: function(route, callback) {
-      this.handlers.unshift({route: route, callback: callback});
-    },
-
-    // Checks the current URL to see if it has changed, and if it has,
-    // calls `loadUrl`, normalizing across the hidden iframe.
-    checkUrl: function(e) {
-      var current = this.getFragment();
-      if (current === this.fragment && this.iframe) {
-        current = this.getFragment(this.getHash(this.iframe));
-      }
-      if (current === this.fragment) return false;
-      if (this.iframe) this.navigate(current);
-      this.loadUrl() || this.loadUrl(this.getHash());
-    },
-
-    // Attempt to load the current URL fragment. If a route succeeds with a
-    // match, returns `true`. If no defined routes matches the fragment,
-    // returns `false`.
-    loadUrl: function(fragmentOverride) {
-      var fragment = this.fragment = this.getFragment(fragmentOverride);
-      var matched = _.any(this.handlers, function(handler) {
-        if (handler.route.test(fragment)) {
-          handler.callback(fragment);
-          return true;
-        }
-      });
-      return matched;
-    },
-
-    // Save a fragment into the hash history, or replace the URL state if the
-    // 'replace' option is passed. You are responsible for properly URL-encoding
-    // the fragment in advance.
-    //
-    // The options object can contain `trigger: true` if you wish to have the
-    // route callback be fired (not usually desirable), or `replace: true`, if
-    // you wish to modify the current URL without adding an entry to the history.
-    navigate: function(fragment, options) {
-      if (!History.started) return false;
-      if (!options || options === true) options = {trigger: options};
-      fragment = this.getFragment(fragment || '');
-      if (this.fragment === fragment) return;
-      this.fragment = fragment;
-      var url = this.root + fragment;
-
-      // If pushState is available, we use it to set the fragment as a real URL.
-      if (this._hasPushState) {
-        this.history[options.replace ? 'replaceState' : 'pushState']({}, document.title, url);
-
-      // If hash changes haven't been explicitly disabled, update the hash
-      // fragment to store history.
-      } else if (this._wantsHashChange) {
-        this._updateHash(this.location, fragment, options.replace);
-        if (this.iframe && (fragment !== this.getFragment(this.getHash(this.iframe)))) {
-          // Opening and closing the iframe tricks IE7 and earlier to push a
-          // history entry on hash-tag change.  When replace is true, we don't
-          // want this.
-          if(!options.replace) this.iframe.document.open().close();
-          this._updateHash(this.iframe.location, fragment, options.replace);
-        }
-
-      // If you've told us that you explicitly don't want fallback hashchange-
-      // based history, then `navigate` becomes a page refresh.
-      } else {
-        return this.location.assign(url);
-      }
-      if (options.trigger) this.loadUrl(fragment);
-    },
-
-    // Update the hash location, either replacing the current entry, or adding
-    // a new one to the browser history.
-    _updateHash: function(location, fragment, replace) {
-      if (replace) {
-        var href = location.href.replace(/(javascript:|#).*$/, '');
-        location.replace(href + '#' + fragment);
-      } else {
-        // Some browsers require that `hash` contains a leading #.
-        location.hash = '#' + fragment;
-      }
-    }
-
-  });
-
-  // Create the default Backbone.history.
-  Backbone.history = new History;
-
-  // Helpers
-  // -------
-
-  // Helper function to correctly set up the prototype chain, for subclasses.
-  // Similar to `goog.inherits`, but uses a hash of prototype properties and
-  // class properties to be extended.
-  var extend = function(protoProps, staticProps) {
-    var parent = this;
-    var child;
-
-    // The constructor function for the new subclass is either defined by you
-    // (the "constructor" property in your `extend` definition), or defaulted
-    // by us to simply call the parent's constructor.
-    if (protoProps && _.has(protoProps, 'constructor')) {
-      child = protoProps.constructor;
-    } else {
-      child = function(){ return parent.apply(this, arguments); };
-    }
-
-    // Add static properties to the constructor function, if supplied.
-    _.extend(child, parent, staticProps);
-
-    // Set the prototype chain to inherit from `parent`, without calling
-    // `parent`'s constructor function.
-    var Surrogate = function(){ this.constructor = child; };
-    Surrogate.prototype = parent.prototype;
-    child.prototype = new Surrogate;
-
-    // Add prototype properties (instance properties) to the subclass,
-    // if supplied.
-    if (protoProps) _.extend(child.prototype, protoProps);
-
-    // Set a convenience property in case the parent's prototype is needed
-    // later.
-    child.__super__ = parent.prototype;
-
-    return child;
-  };
-
-  // Set up inheritance for the model, collection, router, view and history.
-  Model.extend = Collection.extend = Router.extend = View.extend = History.extend = extend;
-
-  // Throw an error when a URL is needed, and none is supplied.
-  var urlError = function() {
-    throw new Error('A "url" property or function must be specified');
-  };
-
-  // Wrap an optional error callback with a fallback error event.
-  var wrapError = function (model, options) {
-    var error = options.error;
-    options.error = function(resp) {
-      if (error) error(model, resp, options);
-      model.trigger('error', model, resp, options);
-    };
-  };
-
-}).call(this);


[28/51] [abbrv] [partial] brooklyn-ui git commit: move subdir from incubator up a level as it is promoted to its own repo (first non-incubator commit!)

Posted by he...@apache.org.
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/swagger-ui/fonts/droid-sans-v6-latin-regular.svg
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/swagger-ui/fonts/droid-sans-v6-latin-regular.svg b/brooklyn-ui/src/main/webapp/assets/swagger-ui/fonts/droid-sans-v6-latin-regular.svg
deleted file mode 100644
index d9f2a21..0000000
--- a/brooklyn-ui/src/main/webapp/assets/swagger-ui/fonts/droid-sans-v6-latin-regular.svg
+++ /dev/null
@@ -1,403 +0,0 @@
-<?xml version="1.0" standalone="no"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
-<svg xmlns="http://www.w3.org/2000/svg">
-<defs >
-<font id="DroidSans" horiz-adv-x="1062" ><font-face
-    font-family="Droid Sans"
-    units-per-em="2048"
-    panose-1="2 11 6 6 3 8 4 2 2 4"
-    ascent="1907"
-    descent="-492"
-    alphabetic="0" />
-<glyph unicode=" " glyph-name="space" horiz-adv-x="532" />
-<glyph unicode="!" glyph-name="exclam" horiz-adv-x="551" d="M336 414H215L164 1462H387L336 414ZM147 111Q147 149 157 175T184 218T224 242T274 250Q300 250 323 243T364 219T391 176T401 111Q401 74 391 48T364 4T324 -21T274 -29Q247 -29 224 -21T184 4T157
-47T147 111Z" />
-<glyph unicode="&quot;" glyph-name="quotedbl" horiz-adv-x="823" d="M330 1462L289 934H174L133 1462H330ZM690 1462L649 934H535L494 1462H690Z" />
-<glyph unicode="#" glyph-name="numbersign" horiz-adv-x="1323" d="M983 893L920 565H1200V428H893L811 0H664L748 428H457L375 0H231L309 428H51V565H336L401 893H127V1030H426L508 1462H655L573 1030H866L950 1462H1094L1010 1030H1272V893H983ZM483 565H774L838
-893H547L483 565Z" />
-<glyph unicode="$" glyph-name="dollar" horiz-adv-x="1128" d="M985 446Q985 376 960 319T889 220T776 151T625 111V-119H487V102Q437 102 386 106T287 120T197 142T123 172V344Q156 328 199 312T291 282T389 261T487 252V686Q398 716 333 749T224 824T160 922T139
-1051Q139 1118 163 1173T233 1270T343 1338T487 1374V1554H625V1378Q725 1373 809 1352T961 1300L895 1155Q839 1180 769 1200T625 1227V805Q713 774 780 741T893 667T962 572T985 446ZM809 446Q809 479 799 506T768 556T711 598T625 635V262Q718 276 763 325T809
-446ZM315 1049Q315 1013 323 985T352 933T405 890T487 854V1223Q398 1207 357 1163T315 1049Z" />
-<glyph unicode="%" glyph-name="percent" horiz-adv-x="1690" d="M250 1026Q250 861 285 779T401 696Q557 696 557 1026Q557 1354 401 1354Q321 1354 286 1273T250 1026ZM705 1026Q705 918 687 832T632 687T538 597T401 565Q328 565 272 596T178 687T121 832T102
-1026Q102 1134 119 1219T173 1362T266 1452T401 1483Q476 1483 532 1452T627 1363T685 1219T705 1026ZM1133 440Q1133 275 1168 193T1284 111Q1440 111 1440 440Q1440 768 1284 768Q1204 768 1169 687T1133 440ZM1587 440Q1587 332 1570 247T1515 102T1421 12T1284
--20Q1210 -20 1154 11T1061 102T1004 246T985 440Q985 548 1002 633T1056 776T1149 866T1284 897Q1359 897 1415 866T1510 777T1567 633T1587 440ZM1331 1462L520 0H362L1174 1462H1331Z" />
-<glyph unicode="&amp;" glyph-name="ampersand" horiz-adv-x="1438" d="M422 1165Q422 1131 430 1099T454 1034T497 968T559 897Q618 932 661 963T732 1026T774 1093T788 1169Q788 1205 776 1235T740 1288T683 1322T608 1335Q522 1335 472 1291T422 1165ZM557
-141Q615 141 664 152T755 184T833 231T901 289L514 696Q462 663 422 632T355 564T313 486T299 387Q299 333 316 288T367 210T448 159T557 141ZM109 381Q109 459 129 520T187 631T281 724T408 809Q377 845 347 883T295 965T258 1058T244 1165Q244 1240 269 1299T341
-1400T457 1463T614 1485Q697 1485 762 1464T873 1401T943 1300T967 1165Q967 1101 942 1047T875 946T779 860T664 784L1016 412Q1043 441 1064 471T1103 535T1133 608T1157 694H1341Q1326 628 1306 573T1259 468T1200 377T1128 293L1405 0H1180L1012 172Q963 127
-915 92T813 32T697 -6T557 -20Q452 -20 369 6T228 84T140 210T109 381Z" />
-<glyph unicode="&apos;" glyph-name="quotesingle" horiz-adv-x="463" d="M330 1462L289 934H174L133 1462H330Z" />
-<glyph unicode="(" glyph-name="parenleft" horiz-adv-x="616" d="M82 561Q82 686 100 807T155 1043T248 1263T383 1462H555Q415 1269 343 1038T270 563Q270 444 288 326T342 95T431 -124T553 -324H383Q305 -234 249 -131T155 84T100 317T82 561Z" />
-<glyph unicode=")" glyph-name="parenright" horiz-adv-x="616" d="M535 561Q535 437 517 317T462 85T368 -131T233 -324H63Q132 -230 185 -124T274 95T328 326T346 563Q346 807 274 1038T61 1462H233Q311 1369 367 1264T461 1044T517 808T535 561Z" />
-<glyph unicode="*" glyph-name="asterisk" horiz-adv-x="1128" d="M664 1556L621 1163L1018 1274L1044 1081L666 1053L911 727L733 631L557 989L399 631L215 727L457 1053L82 1081L111 1274L502 1163L459 1556H664Z" />
-<glyph unicode="+" glyph-name="plus" horiz-adv-x="1128" d="M489 647H102V797H489V1186H639V797H1026V647H639V262H489V647Z" />
-<glyph unicode="," glyph-name="comma" horiz-adv-x="512" d="M362 238L377 215Q363 161 344 100T301 -23T252 -146T201 -264H63Q78 -203 92 -137T120 -6T145 122T164 238H362Z" />
-<glyph unicode="-" glyph-name="hyphen" horiz-adv-x="659" d="M82 465V633H578V465H82Z" />
-<glyph unicode="." glyph-name="period" horiz-adv-x="549" d="M147 111Q147 149 157 175T184 218T224 242T274 250Q300 250 323 243T364 219T391 176T401 111Q401 74 391 48T364 4T324 -21T274 -29Q247 -29 224 -21T184 4T157 47T147 111Z" />
-<glyph unicode="/" glyph-name="slash" horiz-adv-x="764" d="M743 1462L199 0H20L565 1462H743Z" />
-<glyph unicode="0" glyph-name="zero" horiz-adv-x="1128" d="M1032 733Q1032 556 1007 416T925 179T779 31T563 -20Q445 -20 358 31T213 179T127 416T98 733Q98 910 123 1050T204 1286T348 1434T563 1485Q682 1485 770 1435T916 1288T1003 1051T1032 733ZM283
-733Q283 583 298 471T346 285T432 173T563 135Q640 135 694 172T782 283T832 469T848 733Q848 883 833 995T783 1181T694 1292T563 1329Q486 1329 433 1292T346 1181T298 995T283 733Z" />
-<glyph unicode="1" glyph-name="one" horiz-adv-x="1128" d="M711 0H535V913Q535 956 535 1005T537 1102T540 1195T543 1274Q526 1256 513 1243T487 1218T458 1193T422 1161L274 1040L178 1163L561 1462H711V0Z" />
-<glyph unicode="2" glyph-name="two" horiz-adv-x="1128" d="M1008 0H96V156L446 537Q521 618 580 685T680 816T744 944T766 1085Q766 1144 749 1189T701 1265T626 1313T530 1329Q435 1329 359 1291T213 1192L111 1311Q151 1347 197 1378T296 1433T408 1469T532
-1483Q628 1483 705 1456T837 1379T920 1256T950 1092Q950 1007 924 930T851 779T740 629T600 473L319 174V166H1008V0Z" />
-<glyph unicode="3" glyph-name="three" horiz-adv-x="1128" d="M961 1120Q961 1047 938 987T874 883T774 811T645 770V764Q822 742 914 652T1006 416Q1006 320 974 240T875 102T708 12T469 -20Q360 -20 264 -3T82 59V229Q169 183 270 158T465 133Q557 133 624
-153T734 210T798 301T819 422Q819 490 793 538T717 618T598 665T438 680H305V831H438Q519 831 582 851T687 908T752 996T774 1108Q774 1160 756 1201T705 1270T626 1314T524 1329Q417 1329 336 1296T180 1208L88 1333Q126 1364 172 1391T274 1438T391 1471T524
-1483Q632 1483 713 1456T850 1381T933 1266T961 1120Z" />
-<glyph unicode="4" glyph-name="four" horiz-adv-x="1128" d="M1087 328H874V0H698V328H23V487L686 1470H874V494H1087V328ZM698 494V850Q698 906 699 967T703 1087T707 1197T711 1282H702Q695 1262 685 1238T662 1189T636 1141T612 1102L201 494H698Z" />
-<glyph unicode="5" glyph-name="five" horiz-adv-x="1128" d="M545 897Q644 897 729 870T878 788T978 654T1014 469Q1014 355 980 264T879 110T714 14T487 -20Q436 -20 387 -15T292 -1T205 24T131 59V231Q164 208 208 190T302 160T400 142T492 135Q571 135 633
-153T738 211T804 309T827 449Q827 592 739 667T483 743Q456 743 425 741T362 734T302 726T252 717L162 774L217 1462H907V1296H375L336 877Q368 883 420 890T545 897Z" />
-<glyph unicode="6" glyph-name="six" horiz-adv-x="1128" d="M113 625Q113 730 123 834T160 1033T233 1211T350 1353T520 1448T752 1483Q771 1483 794 1482T840 1479T885 1473T924 1464V1309Q889 1321 845 1327T758 1333Q668 1333 600 1312T481 1251T398 1158T343
-1039T312 899T299 745H311Q331 781 359 812T426 866T511 902T618 915Q713 915 790 886T921 799T1004 660T1034 471Q1034 357 1003 266T914 112T774 14T590 -20Q490 -20 403 19T251 138T150 339T113 625ZM588 133Q648 133 697 153T783 215T838 320T858 471Q858 541
-842 596T792 691T710 751T594 772Q527 772 472 749T377 688T317 602T295 506Q295 439 313 373T368 253T460 167T588 133Z" />
-<glyph unicode="7" glyph-name="seven" horiz-adv-x="1128" d="M281 0L844 1296H90V1462H1030V1317L475 0H281Z" />
-<glyph unicode="8" glyph-name="eight" horiz-adv-x="1128" d="M565 1485Q649 1485 723 1463T854 1397T944 1287T977 1133Q977 1066 957 1012T902 915T819 837T715 774Q773 743 828 705T927 620T997 513T1024 381Q1024 289 991 215T897 88T752 8T565 -20Q455 -20
-370 7T226 84T137 208T106 373Q106 448 128 508T189 616T279 701T389 766Q340 797 297 833T223 915T173 1014T154 1135Q154 1222 187 1287T278 1397T409 1463T565 1485ZM285 371Q285 318 301 274T351 198T437 149T561 131Q631 131 684 148T774 198T828 277T846
-379Q846 431 827 473T771 551T683 619T569 682L539 696Q413 636 349 559T285 371ZM563 1333Q457 1333 395 1280T332 1126Q332 1069 349 1028T398 955T472 898T567 848Q615 870 657 896T731 955T781 1030T799 1126Q799 1227 736 1280T563 1333Z" />
-<glyph unicode="9" glyph-name="nine" horiz-adv-x="1128" d="M1028 838Q1028 733 1018 629T981 429T908 252T791 109T621 15T389 -20Q370 -20 347 -19T301 -16T256 -10T217 -2V154Q252 141 296 135T383 129Q518 129 605 176T743 303T815 491T842 717H829Q809
-681 781 650T715 596T629 560T522 547Q427 547 350 576T219 663T136 802T106 991Q106 1105 137 1196T226 1351T366 1449T551 1483Q652 1483 739 1444T890 1325T991 1124T1028 838ZM553 1329Q493 1329 444 1309T358 1247T303 1142T283 991Q283 921 299 866T349 771T431
-711T547 690Q615 690 670 713T764 774T824 860T846 956Q846 1023 828 1089T773 1209T681 1296T553 1329Z" />
-<glyph unicode=":" glyph-name="colon" horiz-adv-x="549" d="M147 111Q147 149 157 175T184 218T224 242T274 250Q300 250 323 243T364 219T391 176T401 111Q401 74 391 48T364 4T324 -21T274 -29Q247 -29 224 -21T184 4T157 47T147 111ZM147 987Q147 1026 157
-1052T184 1095T224 1119T274 1126Q300 1126 323 1119T364 1096T391 1053T401 987Q401 950 391 924T364 881T324 856T274 848Q247 848 224 856T184 881T157 924T147 987Z" />
-<glyph unicode=";" glyph-name="semicolon" horiz-adv-x="549" d="M362 238L377 215Q363 161 344 100T301 -23T252 -146T201 -264H63Q78 -203 92 -137T120 -6T145 122T164 238H362ZM147 987Q147 1026 157 1052T184 1095T224 1119T274 1126Q300 1126 323 1119T364
-1096T391 1053T401 987Q401 950 391 924T364 881T324 856T274 848Q247 848 224 856T184 881T157 924T147 987Z" />
-<glyph unicode="&lt;" glyph-name="less" horiz-adv-x="1128" d="M1026 238L102 662V764L1026 1245V1085L291 721L1026 399V238Z" />
-<glyph unicode="=" glyph-name="equal" horiz-adv-x="1128" d="M102 852V1001H1026V852H102ZM102 442V592H1026V442H102Z" />
-<glyph unicode="&gt;" glyph-name="greater" horiz-adv-x="1128" d="M102 399L838 721L102 1085V1245L1026 764V662L102 238V399Z" />
-<glyph unicode="?" glyph-name="question" horiz-adv-x="872" d="M281 414V451Q281 508 288 554T315 640T368 718T451 799Q499 840 533 873T588 941T620 1015T631 1108Q631 1156 616 1195T573 1263T502 1307T403 1323Q320 1323 245 1297T100 1237L37 1382Q118
-1424 212 1453T403 1483Q496 1483 570 1458T697 1384T777 1267T805 1110Q805 1043 792 991T751 893T684 806T590 717Q538 672 505 639T453 574T427 509T420 432V414H281ZM233 111Q233 149 243 175T270 218T310 242T360 250Q386 250 409 243T450 219T477 176T487
-111Q487 74 477 48T450 4T410 -21T360 -29Q333 -29 310 -21T270 4T243 47T233 111Z" />
-<glyph unicode="@" glyph-name="at" horiz-adv-x="1774" d="M1665 731Q1665 669 1656 607T1628 488T1581 383T1514 298T1428 242T1321 221Q1276 221 1240 236T1177 276T1135 333T1112 401H1108Q1090 364 1063 331T1001 274T921 235T823 221Q746 221 687 249T586
-327T524 449T502 606Q502 707 531 791T616 936T751 1031T928 1065Q973 1065 1018 1061T1104 1050T1179 1035T1237 1018L1214 602Q1213 580 1213 567T1212 545T1212 533T1212 526Q1212 473 1222 439T1250 385T1288 358T1333 350Q1379 350 1414 380T1472 463T1508
-585T1520 733Q1520 875 1477 985T1358 1172T1178 1287T950 1327Q781 1327 652 1272T436 1117T303 881T258 582Q258 431 297 314T413 117T603 -4T864 -45Q925 -45 984 -38T1099 -19T1205 8T1298 41V-100Q1212 -138 1104 -160T866 -182Q687 -182 547 -131T309 17T160
-255T109 575Q109 763 168 925T336 1207T601 1394T950 1462Q1106 1462 1237 1412T1463 1267T1612 1037T1665 731ZM662 602Q662 469 712 410T848 350Q903 350 942 372T1006 436T1044 535T1061 662L1075 915Q1047 923 1009 929T928 936Q854 936 804 907T722 831T676
-724T662 602Z" />
-<glyph unicode="A" glyph-name="A" horiz-adv-x="1245" d="M1055 0L895 453H350L188 0H0L537 1468H707L1245 0H1055ZM836 618L688 1042Q682 1060 674 1086T656 1142T638 1204T621 1268Q614 1237 605 1204T587 1141T570 1085T555 1042L410 618H836Z" />
-<glyph unicode="B" glyph-name="B" horiz-adv-x="1272" d="M199 1462H598Q726 1462 823 1443T986 1380T1085 1266T1118 1092Q1118 1030 1099 976T1042 881T951 813T827 776V766Q896 754 956 732T1062 670T1133 570T1159 424Q1159 324 1127 246T1033 113T883 29T684
-0H199V1462ZM385 842H629Q713 842 770 857T862 901T912 975T928 1079Q928 1199 851 1251T608 1303H385V842ZM385 686V158H651Q739 158 798 178T894 234T947 320T963 432Q963 488 947 535T893 615T793 667T639 686H385Z" />
-<glyph unicode="C" glyph-name="C" horiz-adv-x="1235" d="M793 1319Q686 1319 599 1279T451 1162T356 977T322 731Q322 590 351 481T440 296T587 182T793 143Q882 143 962 160T1120 201V39Q1081 24 1042 13T961 -6T870 -16T762 -20Q598 -20 478 34T280 187T163
-425T125 733Q125 899 168 1037T296 1274T506 1428T793 1483Q901 1483 999 1461T1176 1397L1098 1241Q1035 1273 961 1296T793 1319Z" />
-<glyph unicode="D" glyph-name="D" horiz-adv-x="1401" d="M1276 745Q1276 560 1228 421T1089 188T866 47T565 0H199V1462H606Q759 1462 883 1416T1094 1280T1228 1055T1276 745ZM1079 739Q1079 885 1046 991T950 1167T795 1269T586 1303H385V160H547Q811 160
-945 306T1079 739Z" />
-<glyph unicode="E" glyph-name="E" horiz-adv-x="1081" d="M958 0H199V1462H958V1298H385V846H920V684H385V164H958V0Z" />
-<glyph unicode="F" glyph-name="F" horiz-adv-x="1006" d="M385 0H199V1462H958V1298H385V782H920V618H385V0Z" />
-<glyph unicode="G" glyph-name="G" horiz-adv-x="1413" d="M782 772H1266V55Q1211 37 1155 23T1040 0T916 -15T776 -20Q619 -20 498 32T294 182T168 419T125 733Q125 905 172 1044T311 1280T535 1430T840 1483Q951 1483 1053 1461T1243 1397L1171 1235Q1135 1252
-1094 1267T1008 1293T918 1312T825 1319Q703 1319 609 1279T452 1162T355 977T322 731Q322 601 349 493T437 307T592 186T821 143Q865 143 901 145T969 152T1027 161T1081 172V608H782V772Z" />
-<glyph unicode="H" glyph-name="H" horiz-adv-x="1436" d="M1237 0H1051V682H385V0H199V1462H385V846H1051V1462H1237V0Z" />
-<glyph unicode="I" glyph-name="I" horiz-adv-x="694" d="M612 0H82V102L254 143V1319L82 1360V1462H612V1360L440 1319V143L612 102V0Z" />
-<glyph unicode="J" glyph-name="J" horiz-adv-x="555" d="M-29 -389Q-80 -389 -118 -383T-184 -365V-205Q-150 -214 -111 -219T-27 -225Q10 -225 47 -216T115 -181T165 -112T184 0V1462H371V20Q371 -85 342 -162T260 -289T134 -364T-29 -389Z" />
-<glyph unicode="K" glyph-name="K" horiz-adv-x="1186" d="M1186 0H975L524 698L385 584V0H199V1462H385V731L506 899L958 1462H1167L647 825L1186 0Z" />
-<glyph unicode="L" glyph-name="L" horiz-adv-x="1006" d="M199 0V1462H385V166H958V0H199Z" />
-<glyph unicode="M" glyph-name="M" horiz-adv-x="1782" d="M803 0L360 1280H352Q358 1206 362 1133Q366 1070 368 1001T371 874V0H199V1462H475L887 270H893L1307 1462H1583V0H1397V887Q1397 939 1399 1006T1404 1134Q1408 1205 1411 1278H1403L956 0H803Z" />
-<glyph unicode="N" glyph-name="N" horiz-adv-x="1493" d="M1294 0H1079L360 1210H352Q358 1133 362 1057Q366 992 368 921T371 793V0H199V1462H412L1128 258H1135Q1132 334 1128 408Q1127 440 1126 473T1123 540T1121 605T1120 662V1462H1294V0Z" />
-<glyph unicode="O" glyph-name="O" horiz-adv-x="1520" d="M1393 733Q1393 564 1353 425T1232 187T1034 34T760 -20Q597 -20 478 34T280 187T163 425T125 735Q125 905 163 1043T280 1280T479 1431T762 1485Q917 1485 1034 1432T1232 1280T1352 1043T1393 733ZM322
-733Q322 596 348 487T427 301T563 184T760 143Q874 143 956 183T1092 300T1171 486T1196 733Q1196 871 1171 980T1093 1164T958 1280T762 1321Q648 1321 565 1281T428 1165T348 980T322 733Z" />
-<glyph unicode="P" glyph-name="P" horiz-adv-x="1180" d="M1075 1034Q1075 943 1048 859T957 711T791 608T535 569H385V0H199V1462H561Q695 1462 792 1434T952 1351T1045 1216T1075 1034ZM385 727H514Q607 727 676 743T791 794T860 886T883 1024Q883 1166 801
-1234T545 1303H385V727Z" />
-<glyph unicode="Q" glyph-name="Q" horiz-adv-x="1518" d="M1393 733Q1393 602 1369 489T1297 286T1178 129T1014 25Q1057 -69 1125 -140T1284 -272L1163 -414Q1060 -341 974 -242T836 -16Q819 -18 799 -19T760 -20Q597 -20 478 34T280 187T163 425T125 735Q125
-905 163 1043T280 1280T479 1431T762 1485Q917 1485 1034 1432T1232 1280T1352 1043T1393 733ZM322 733Q322 596 348 487T427 301T563 184T760 143Q874 143 956 183T1092 300T1171 486T1196 733Q1196 871 1171 980T1093 1164T958 1280T762 1321Q648 1321 565 1281T428
-1165T348 980T322 733Z" />
-<glyph unicode="R" glyph-name="R" horiz-adv-x="1208" d="M385 604V0H199V1462H555Q821 1462 948 1359T1075 1047Q1075 960 1051 895T986 784T893 706T786 655L1184 0H965L614 604H385ZM385 762H549Q639 762 702 779T805 831T864 917T883 1038Q883 1110 863 1160T801
-1242T696 1288T545 1303H385V762Z" />
-<glyph unicode="S" glyph-name="S" horiz-adv-x="1063" d="M969 391Q969 294 935 218T836 88T680 8T473 -20Q362 -20 266 -3T104 49V227Q138 211 181 196T273 168T372 149T473 141Q633 141 709 201T786 373Q786 427 772 467T721 540T623 605T469 674Q380 709 315
-750T207 844T144 962T123 1112Q123 1200 155 1269T245 1385T383 1458T561 1483Q680 1483 775 1461T944 1403L877 1247Q812 1276 730 1297T559 1319Q437 1319 370 1263T303 1110Q303 1053 318 1012T368 937T460 874T602 811Q693 775 761 737T876 651T945 540T969
-391Z" />
-<glyph unicode="T" glyph-name="T" horiz-adv-x="1063" d="M625 0H438V1298H20V1462H1042V1298H625V0Z" />
-<glyph unicode="U" glyph-name="U" horiz-adv-x="1430" d="M1245 1464V516Q1245 402 1212 304T1113 134T946 21T709 -20Q581 -20 483 18T319 128T218 298T184 520V1462H371V510Q371 335 457 239T719 143Q808 143 872 170T977 246T1038 363T1059 512V1464H1245Z" />
-<glyph unicode="V" glyph-name="V" horiz-adv-x="1163" d="M965 1462H1163L674 0H487L0 1462H197L492 535Q521 444 542 360T580 201Q595 275 618 359T672 541L965 1462Z" />
-<glyph unicode="W" glyph-name="W" horiz-adv-x="1810" d="M809 1462H1006L1235 606Q1250 550 1264 494T1291 386T1313 286T1329 201Q1333 239 1339 284T1353 378T1370 479T1391 580L1591 1462H1790L1423 0H1235L981 938Q967 989 954 1043T930 1144Q918 1199 907
-1251Q896 1200 885 1145Q875 1098 863 1042T836 932L594 0H406L20 1462H217L440 573Q452 527 462 478T480 379T496 285T508 201Q513 238 520 287T538 390T559 499T584 604L809 1462Z" />
-<glyph unicode="X" glyph-name="X" horiz-adv-x="1120" d="M1120 0H909L555 635L188 0H0L453 764L31 1462H229L561 903L895 1462H1085L664 770L1120 0Z" />
-<glyph unicode="Y" glyph-name="Y" horiz-adv-x="1079" d="M539 723L879 1462H1079L633 569V0H446V559L0 1462H203L539 723Z" />
-<glyph unicode="Z" glyph-name="Z" horiz-adv-x="1104" d="M1022 0H82V145L793 1296H102V1462H1001V1317L291 166H1022V0Z" />
-<glyph unicode="[" glyph-name="bracketleft" horiz-adv-x="621" d="M569 -324H164V1462H569V1313H346V-174H569V-324Z" />
-<glyph unicode="\" glyph-name="backslash" horiz-adv-x="764" d="M201 1462L745 0H567L23 1462H201Z" />
-<glyph unicode="]" glyph-name="bracketright" horiz-adv-x="621" d="M51 -174H274V1313H51V1462H457V-324H51V-174Z" />
-<glyph unicode="^" glyph-name="asciicircum" horiz-adv-x="1090" d="M41 549L500 1473H602L1049 549H888L551 1284L202 549H41Z" />
-<glyph unicode="_" glyph-name="underscore" horiz-adv-x="842" d="M846 -324H-4V-184H846V-324Z" />
-<glyph unicode="`" glyph-name="grave" horiz-adv-x="1182" d="M786 1241H666Q631 1269 590 1310T511 1396T441 1480T393 1548V1569H612Q628 1535 649 1495T694 1414T741 1335T786 1268V1241Z" />
-<glyph unicode="a" glyph-name="a" horiz-adv-x="1087" d="M793 0L756 152H748Q715 107 682 75T610 21T523 -10T412 -20Q343 -20 285 -1T185 59T118 161T94 307Q94 471 209 559T561 655L745 662V731Q745 798 731 843T689 915T621 955T528 967Q445 967 374 943T236
-885L172 1022Q246 1062 337 1090T528 1118Q630 1118 704 1098T827 1033T900 919T924 752V0H793ZM459 127Q520 127 572 146T662 203T721 300T743 438V537L600 530Q510 526 449 510T352 466T299 397T283 305Q283 213 331 170T459 127Z" />
-<glyph unicode="b" glyph-name="b" horiz-adv-x="1200" d="M670 1118Q764 1118 841 1082T972 975T1057 797T1087 551Q1087 410 1057 304T973 125T841 17T670 -20Q611 -20 563 -7T477 27T409 78T356 139H344L307 0H174V1556H356V1180Q356 1145 355 1106T352 1032Q350
-992 348 954H356Q379 989 408 1019T475 1071T562 1105T670 1118ZM635 967Q555 967 502 942T416 864T370 734T356 551Q356 450 369 372T415 240T502 159T637 131Q772 131 835 240T899 553Q899 761 836 864T635 967Z" />
-<glyph unicode="c" glyph-name="c" horiz-adv-x="948" d="M594 -20Q493 -20 405 11T252 111T150 286T113 543Q113 700 151 809T255 987T411 1087T602 1118Q680 1118 754 1101T879 1059L825 905Q802 915 774 924T716 941T657 953T602 958Q445 958 373 858T301 545Q301
-334 373 237T594 139Q675 139 740 157T860 201V39Q806 10 745 -5T594 -20Z" />
-<glyph unicode="d" glyph-name="d" horiz-adv-x="1200" d="M852 147H844Q822 113 793 83T725 29T638 -7T530 -20Q437 -20 360 16T228 123T143 301T113 547Q113 688 143 794T228 973T360 1081T530 1118Q589 1118 637 1105T723 1070T792 1019T844 958H856Q853 992
-850 1023Q848 1049 846 1076T844 1120V1556H1026V0H879L852 147ZM565 131Q641 131 693 154T778 224T826 341T844 506V547Q844 648 831 726T785 858T698 939T563 967Q428 967 365 858T301 545Q301 336 364 234T565 131Z" />
-<glyph unicode="e" glyph-name="e" horiz-adv-x="1096" d="M608 -20Q498 -20 407 17T251 125T149 301T113 541Q113 677 146 784T239 965T382 1079T567 1118Q666 1118 745 1083T879 983T963 828T993 627V514H301Q306 321 382 230T610 139Q661 139 704 144T788 158T867
-182T944 215V53Q904 34 866 20T787 -3T703 -16T608 -20ZM563 967Q449 967 383 889T305 662H797Q797 730 784 786T742 883T669 945T563 967Z" />
-<glyph unicode="f" glyph-name="f" horiz-adv-x="674" d="M651 961H406V0H223V961H29V1036L223 1104V1200Q223 1307 245 1377T310 1490T415 1549T555 1567Q614 1567 663 1556T752 1530L705 1389Q674 1400 638 1408T561 1417Q521 1417 492 1408T444 1374T416 1309T406
-1202V1098H651V961Z" />
-<glyph unicode="g" glyph-name="g" horiz-adv-x="1061" d="M1020 1098V985L823 958Q851 923 870 869T889 745Q889 669 866 605T795 493T677 420T514 393Q492 393 470 393T434 397Q417 387 401 375T371 346T349 310T340 266Q340 239 352 223T384 197T433 185T492
-182H668Q761 182 825 159T929 95T988 1T1006 -115Q1006 -203 974 -273T874 -391T705 -466T463 -492Q356 -492 276 -471T143 -410T64 -314T37 -186Q37 -126 56 -81T109 -2T185 52T276 84Q234 103 207 144T180 238Q180 299 212 343T313 430Q270 448 235 479T175 551T137
-640T123 739Q123 828 148 898T222 1017T344 1092T514 1118Q551 1118 590 1113T657 1098H1020ZM209 -180Q209 -217 222 -249T264 -304T342 -340T463 -354Q649 -354 741 -297T834 -131Q834 -85 822 -56T783 -11T710 12T600 18H424Q389 18 351 10T282 -20T230 -80T209
--180ZM301 745Q301 630 355 574T508 518Q608 518 659 573T711 748Q711 871 659 929T506 987Q407 987 354 927T301 745Z" />
-<glyph unicode="h" glyph-name="h" horiz-adv-x="1206" d="M860 0V707Q860 837 808 902T643 967Q562 967 507 941T419 864T371 739T356 569V0H174V1556H356V1094L348 950H358Q383 993 417 1024T493 1077T580 1108T674 1118Q857 1118 949 1023T1042 717V0H860Z" />
-<glyph unicode="i" glyph-name="i" horiz-adv-x="530" d="M356 0H174V1098H356V0ZM160 1395Q160 1455 190 1482T266 1509Q288 1509 307 1503T341 1482T364 1447T373 1395Q373 1337 342 1309T266 1280Q221 1280 191 1308T160 1395Z" />
-<glyph unicode="j" glyph-name="j" horiz-adv-x="530" d="M66 -492Q18 -492 -13 -485T-68 -467V-319Q-42 -329 -15 -334T47 -340Q74 -340 97 -333T137 -306T164 -254T174 -170V1098H356V-158Q356 -235 339 -296T286 -401T196 -468T66 -492ZM160 1395Q160 1455
-190 1482T266 1509Q288 1509 307 1503T341 1482T364 1447T373 1395Q373 1337 342 1309T266 1280Q221 1280 191 1308T160 1395Z" />
-<glyph unicode="k" glyph-name="k" horiz-adv-x="1016" d="M342 567L477 737L770 1098H981L580 623L1008 0H799L463 504L354 422V0H174V1556H354V842L338 567H342Z" />
-<glyph unicode="l" glyph-name="l" horiz-adv-x="530" d="M356 0H174V1556H356V0Z" />
-<glyph unicode="m" glyph-name="m" horiz-adv-x="1835" d="M1489 0V707Q1489 837 1439 902T1284 967Q1211 967 1160 944T1077 875T1029 762T1014 606V0H831V707Q831 837 782 902T627 967Q550 967 498 941T415 864T370 739T356 569V0H174V1098H322L348 950H358Q382
-993 415 1024T487 1077T571 1108T662 1118Q782 1118 861 1074T979 936H987Q1013 983 1049 1017T1129 1073T1221 1107T1319 1118Q1494 1118 1582 1023T1671 717V0H1489Z" />
-<glyph unicode="n" glyph-name="n" horiz-adv-x="1206" d="M860 0V707Q860 837 808 902T643 967Q562 967 507 941T419 864T371 739T356 569V0H174V1098H322L348 950H358Q383 993 417 1024T493 1077T580 1108T674 1118Q857 1118 949 1023T1042 717V0H860Z" />
-<glyph unicode="o" glyph-name="o" horiz-adv-x="1182" d="M1069 551Q1069 414 1036 308T940 129T788 18T588 -20Q485 -20 398 18T248 128T149 307T113 551Q113 687 146 792T242 970T393 1080T594 1118Q697 1118 784 1081T934 971T1033 793T1069 551ZM301 551Q301
-342 369 237T592 131Q746 131 813 236T881 551Q881 760 813 863T590 967Q436 967 369 864T301 551Z" />
-<glyph unicode="p" glyph-name="p" horiz-adv-x="1200" d="M670 -20Q611 -20 563 -7T477 27T409 78T356 139H344Q347 105 350 74Q352 48 354 21T356 -23V-492H174V1098H322L348 950H356Q379 985 408 1015T475 1068T562 1104T670 1118Q764 1118 841 1082T972 975T1057
-797T1087 551Q1087 410 1057 304T973 125T841 17T670 -20ZM635 967Q559 967 507 944T422 874T374 757T356 592V551Q356 450 369 372T415 240T502 159T637 131Q772 131 835 240T899 553Q899 761 836 864T635 967Z" />
-<glyph unicode="q" glyph-name="q" horiz-adv-x="1200" d="M565 131Q641 131 693 154T778 224T826 341T844 506V547Q844 648 831 726T785 858T698 939T563 967Q428 967 365 858T301 545Q301 336 364 234T565 131ZM530 -20Q437 -20 360 16T228 123T143 301T113
-547Q113 688 143 794T228 973T360 1081T530 1118Q589 1118 637 1105T723 1069T791 1016T844 950H852L879 1098H1026V-492H844V-23Q844 -4 846 25T850 81Q853 113 856 147H844Q822 113 793 83T725 29T638 -7T530 -20Z" />
-<glyph unicode="r" glyph-name="r" horiz-adv-x="817" d="M649 1118Q678 1118 714 1116T776 1108L752 940Q724 945 695 948T639 952Q576 952 524 927T435 854T377 740T356 592V0H174V1098H322L344 897H352Q377 940 405 980T469 1050T549 1099T649 1118Z" />
-<glyph unicode="s" glyph-name="s" horiz-adv-x="924" d="M831 301Q831 221 802 161T719 61T587 0T414 -20Q305 -20 227 -3T90 49V215Q121 199 159 184T239 156T325 137T414 129Q479 129 524 140T598 171T640 221T653 287Q653 318 643 343T607 392T534 442T416
-498Q344 529 287 559T189 626T128 711T106 827Q106 897 133 951T211 1043T331 1099T487 1118Q584 1118 664 1097T817 1042L754 895Q689 924 621 945T481 967Q379 967 330 934T281 838Q281 803 292 777T332 728T407 682T524 629Q596 599 652 569T749 502T810 416T831
-301Z" />
-<glyph unicode="t" glyph-name="t" horiz-adv-x="694" d="M506 129Q524 129 546 131T590 136T628 143T655 150V12Q642 6 622 0T578 -10T528 -17T477 -20Q415 -20 362 -4T271 51T210 156T188 324V961H33V1042L188 1120L266 1350H371V1098H647V961H371V324Q371 227
-402 178T506 129Z" />
-<glyph unicode="u" glyph-name="u" horiz-adv-x="1206" d="M885 0L858 147H848Q823 104 789 73T713 21T626 -10T532 -20Q441 -20 372 3T257 75T188 200T164 381V1098H346V391Q346 261 399 196T563 131Q644 131 699 157T787 233T835 358T850 528V1098H1032V0H885Z" />
-<glyph unicode="v" glyph-name="v" horiz-adv-x="981" d="M375 0L0 1098H188L387 487Q398 454 413 402T443 296T470 194T487 121H494Q499 146 511 194T538 296T568 402T594 487L793 1098H981L606 0H375Z" />
-<glyph unicode="w" glyph-name="w" horiz-adv-x="1528" d="M1008 0L840 616Q836 634 830 656T818 704T806 755T793 806Q779 864 764 926H758Q744 863 731 805Q720 755 708 702T684 612L512 0H301L20 1098H211L342 514Q352 469 362 417T381 313T397 216T408 141H414Q419
-167 427 210T446 302T468 398T489 479L668 1098H864L1036 479Q1045 445 1056 399T1079 306T1099 214T1112 141H1118Q1121 167 1127 210T1143 306T1162 412T1184 514L1321 1098H1507L1223 0H1008Z" />
-<glyph unicode="x" glyph-name="x" horiz-adv-x="1024" d="M408 563L55 1098H262L512 688L762 1098H969L614 563L987 0H780L512 436L242 0H35L408 563Z" />
-<glyph unicode="y" glyph-name="y" horiz-adv-x="1001" d="M10 1098H199L414 485Q428 445 442 401T469 313T491 228T504 152H510Q515 177 526 220T550 311T578 407T604 487L803 1098H991L557 -143Q529 -224 497 -288T421 -398T320 -467T182 -492Q130 -492 92 -487T27
--475V-330Q48 -335 80 -338T147 -342Q195 -342 230 -331T291 -297T335 -243T369 -170L426 -10L10 1098Z" />
-<glyph unicode="z" glyph-name="z" horiz-adv-x="903" d="M821 0H82V125L618 961H115V1098H803V952L279 137H821V0Z" />
-<glyph unicode="{" glyph-name="braceleft" horiz-adv-x="725" d="M500 -16Q500 -64 512 -94T546 -142T601 -166T674 -174V-324Q597 -323 532 -307T419 -255T344 -164T317 -31V303Q317 406 252 449T61 492V647Q186 647 251 690T317 836V1169Q317 1247 344 1302T418
-1392T531 1444T674 1462V1313Q634 1312 602 1306T547 1282T512 1234T500 1155V823Q500 718 441 657T266 575V563Q381 543 440 482T500 315V-16Z" />
-<glyph unicode="|" glyph-name="bar" horiz-adv-x="1128" d="M489 1556H639V-492H489V1556Z" />
-<glyph unicode="}" glyph-name="braceright" horiz-adv-x="725" d="M225 315Q225 421 284 482T459 563V575Q344 595 285 656T225 823V1155Q225 1203 213 1233T179 1281T124 1305T51 1313V1462Q128 1461 193 1445T306 1393T381 1302T408 1169V836Q408 784 424 748T473
-690T554 657T664 647V492Q539 492 474 449T408 303V-31Q408 -109 381 -164T307 -254T194 -306T51 -324V-174Q91 -173 123 -167T178 -143T213 -95T225 -16V315Z" />
-<glyph unicode="~" glyph-name="asciitilde" horiz-adv-x="1128" d="M530 651Q493 667 466 678T416 695T373 704T330 707Q302 707 272 698T213 672T155 633T102 586V748Q202 856 350 856Q379 856 404 854T456 845T517 826T598 793Q635 777 662 766T713 749T757
-740T799 737Q827 737 857 746T916 772T974 811T1026 858V696Q927 588 778 588Q749 588 724 590T672 599T611 618T530 651Z" />
-<glyph unicode="&#xa0;" glyph-name="nbspace" horiz-adv-x="532" />
-<glyph unicode="&#xa1;" glyph-name="exclamdown" horiz-adv-x="551" d="M213 676H334L385 -373H162L213 676ZM401 979Q401 941 392 915T365 872T324 848T274 840Q248 840 225 847T185 871T157 914T147 979Q147 1016 157 1042T184 1085T225 1110T274 1118Q301
-1118 324 1110T364 1085T391 1042T401 979Z" />
-<glyph unicode="&#xa2;" glyph-name="cent" horiz-adv-x="1128" d="M886 212T831 197T700 180V-20H563V186Q476 199 407 236T289 340T214 506T188 743Q188 884 214 985T289 1155T407 1260T563 1311V1483H700V1319Q772 1316 840 1300T954 1260L901 1106Q878 1116
-850 1125T792 1142T733 1154T678 1159Q521 1159 449 1058T377 745Q377 535 449 438T670 340Q751 340 816 358T936 401V240Q886 212 831 197Z" />
-<glyph unicode="&#xa3;" glyph-name="sterling" horiz-adv-x="1128" d="M666 1481Q772 1481 859 1459T1012 1401L946 1257Q890 1286 820 1307T674 1329Q626 1329 585 1316T514 1273T468 1196T451 1083V788H827V651H451V440Q451 378 440 334T409 257T364 204T311
-166H1059V0H68V154Q112 165 148 185T211 240T253 322T268 438V651H70V788H268V1112Q268 1199 297 1267T379 1383T505 1456T666 1481Z" />
-<glyph unicode="&#xa4;" glyph-name="currency" horiz-adv-x="1128" d="M186 723Q186 782 203 835T252 936L123 1065L221 1163L348 1034Q395 1066 449 1084T563 1102Q623 1102 676 1084T776 1034L905 1163L1004 1067L874 938Q905 892 923 838T942 723Q942 663
-925 608T874 508L1001 381L905 285L776 412Q730 381 677 364T563 346Q503 346 448 364T348 414L221 287L125 383L252 510Q221 555 204 609T186 723ZM324 723Q324 673 342 630T393 554T469 502T563 483Q614 483 658 502T736 553T788 629T807 723Q807 774 788 818T736
-896T659 948T563 967Q513 967 470 948T394 896T343 819T324 723Z" />
-<glyph unicode="&#xa5;" glyph-name="yen" horiz-adv-x="1128" d="M563 723L909 1462H1100L715 694H954V557H653V399H954V262H653V0H475V262H174V399H475V557H174V694H408L29 1462H221L563 723Z" />
-<glyph unicode="&#xa6;" glyph-name="brokenbar" horiz-adv-x="1128" d="M489 1556H639V776H489V1556ZM489 289H639V-492H489V289Z" />
-<glyph unicode="&#xa7;" glyph-name="section" horiz-adv-x="995" d="M137 809Q137 860 150 901T185 975T237 1029T297 1067Q222 1105 180 1162T137 1303Q137 1364 164 1413T242 1496T362 1548T518 1567Q615 1567 693 1547T844 1495L788 1356Q723 1384 653 1403T512
-1423Q413 1423 362 1394T311 1307Q311 1280 323 1257T363 1212T439 1167T557 1114Q629 1086 685 1054T781 982T841 895T862 784Q862 732 850 690T818 613T771 555T717 514Q786 476 824 422T862 289Q862 218 833 163T749 69T618 10T444 -10Q336 -10 258 6T121 55V213Q152
-198 190 183T270 157T356 138T444 131Q513 131 559 143T633 174T672 219T684 272Q684 301 676 323T642 368T569 415T446 471Q373 502 316 533T218 603T158 692T137 809ZM291 831Q291 794 305 763T350 702T432 646T555 588L590 573Q610 586 630 604T667 645T694
-696T705 758Q705 796 692 828T647 889T560 947T424 1006Q399 998 376 983T333 945T303 893T291 831Z" />
-<glyph unicode="&#xa8;" glyph-name="dieresis" horiz-adv-x="1182" d="M307 1395Q307 1449 335 1473T403 1497Q442 1497 471 1473T500 1395Q500 1342 471 1317T403 1292Q363 1292 335 1317T307 1395ZM682 1395Q682 1449 710 1473T778 1497Q797 1497 814 1491T845
-1473T866 1441T874 1395Q874 1342 845 1317T778 1292Q738 1292 710 1317T682 1395Z" />
-<glyph unicode="&#xa9;" glyph-name="copyright" horiz-adv-x="1704" d="M891 1053Q830 1053 783 1031T704 968T656 866T639 731Q639 653 653 593T698 492T776 430T891 408Q914 408 941 411T996 421T1053 435T1106 453V322Q1082 311 1058 302T1007 286T950 276T885
-272Q783 272 707 305T581 399T505 545T479 733Q479 834 506 917T585 1061T714 1154T891 1188Q954 1188 1020 1172T1145 1126L1083 999Q1031 1025 983 1039T891 1053ZM100 731Q100 835 127 931T202 1110T320 1263T472 1380T652 1456T852 1483Q956 1483 1052 1456T1231
-1381T1384 1263T1501 1111T1577 931T1604 731Q1604 627 1577 531T1502 352T1384 200T1232 82T1052 7T852 -20Q748 -20 652 6T473 82T320 199T203 351T127 531T100 731ZM209 731Q209 598 259 481T397 277T602 139T852 88Q985 88 1102 138T1306 276T1444 481T1495
-731Q1495 864 1445 981T1307 1185T1102 1323T852 1374Q719 1374 602 1324T398 1186T260 981T209 731Z" />
-<glyph unicode="&#xaa;" glyph-name="ordfeminine" horiz-adv-x="678" d="M487 797L459 879Q441 857 422 840T379 810T327 791T264 784Q221 784 185 797T123 835T83 899T68 989Q68 1091 138 1145T352 1204L451 1208V1239Q451 1311 421 1339T334 1368Q286 1368
-241 1354T154 1317L106 1417Q157 1443 215 1461T334 1479Q459 1479 518 1426T578 1251V797H487ZM377 1110Q326 1107 292 1098T238 1074T208 1038T199 987Q199 936 224 914T291 891Q325 891 354 901T404 934T438 988T451 1065V1114L377 1110Z" />
-<glyph unicode="&#xab;" glyph-name="guillemotleft" horiz-adv-x="997" d="M82 553L391 967L508 889L270 541L508 193L391 115L82 526V553ZM489 553L799 967L915 889L678 541L915 193L799 115L489 526V553Z" />
-<glyph unicode="&#xac;" glyph-name="logicalnot" horiz-adv-x="1128" d="M1026 797V262H877V647H102V797H1026Z" />
-<glyph unicode="&#xad;" glyph-name="uni00AD" horiz-adv-x="659" d="M82 465V633H578V465H82Z" />
-<glyph unicode="&#xae;" glyph-name="registered" horiz-adv-x="1704" d="M743 768H815Q906 768 945 804T985 909Q985 983 944 1012T813 1042H743V768ZM1145 913Q1145 865 1132 828T1096 762T1045 713T985 680Q1052 570 1105 483Q1128 446 1149 411T1186 347T1213
-302L1223 285H1044L838 637H743V285H586V1178H819Q987 1178 1066 1113T1145 913ZM100 731Q100 835 127 931T202 1110T320 1263T472 1380T652 1456T852 1483Q956 1483 1052 1456T1231 1381T1384 1263T1501 1111T1577 931T1604 731Q1604 627 1577 531T1502 352T1384
-200T1232 82T1052 7T852 -20Q748 -20 652 6T473 82T320 199T203 351T127 531T100 731ZM209 731Q209 598 259 481T397 277T602 139T852 88Q985 88 1102 138T1306 276T1444 481T1495 731Q1495 864 1445 981T1307 1185T1102 1323T852 1374Q719 1374 602 1324T398 1186T260
-981T209 731Z" />
-<glyph unicode="&#xaf;" glyph-name="overscore" horiz-adv-x="1024" d="M1030 1556H-6V1696H1030V1556Z" />
-<glyph unicode="&#xb0;" glyph-name="degree" horiz-adv-x="877" d="M123 1167Q123 1232 148 1289T215 1390T315 1458T438 1483Q503 1483 560 1458T661 1390T729 1290T754 1167Q754 1102 729 1045T661 946T561 879T438 854Q373 854 316 878T216 945T148 1045T123
-1167ZM246 1167Q246 1128 261 1094T302 1033T363 992T438 977Q478 977 513 992T574 1033T616 1093T631 1167Q631 1207 616 1242T575 1304T513 1346T438 1362Q398 1362 363 1347T302 1305T261 1243T246 1167Z" />
-<glyph unicode="&#xb1;" glyph-name="plusminus" horiz-adv-x="1128" d="M489 647H102V797H489V1186H639V797H1026V647H639V262H489V647ZM102 0V150H1026V0H102Z" />
-<glyph unicode="&#xb2;" glyph-name="twosuperior" horiz-adv-x="678" d="M621 586H49V698L258 926Q315 988 351 1030T407 1106T434 1169T442 1233Q442 1298 409 1330T322 1362Q271 1362 225 1337T133 1274L55 1368Q109 1416 175 1448T324 1481Q384 1481 432 1465T515
-1417T567 1340T586 1237Q586 1187 572 1144T530 1059T464 971T373 870L225 713H621V586Z" />
-<glyph unicode="&#xb3;" glyph-name="threesuperior" horiz-adv-x="678" d="M590 1255Q590 1177 550 1124T440 1047Q528 1024 572 971T616 840Q616 780 596 730T535 645T430 589T281 569Q211 569 150 581T31 625V758Q94 724 160 705T279 686Q377 686 421 727T465
-842Q465 916 412 949T262 983H164V1096H262Q354 1096 396 1135T438 1239Q438 1271 428 1294T401 1333T360 1355T309 1362Q250 1362 202 1342T102 1284L33 1380Q62 1403 92 1421T157 1453T229 1473T311 1481Q380 1481 432 1464T520 1417T572 1346T590 1255Z" />
-<glyph unicode="&#xb4;" glyph-name="acute" horiz-adv-x="1182" d="M393 1268Q415 1297 438 1335T485 1413T530 1494T567 1569H786V1548Q770 1521 739 1481T669 1396T590 1311T514 1241H393V1268Z" />
-<glyph unicode="&#xb5;" glyph-name="mu" horiz-adv-x="1217" d="M356 391Q356 261 409 196T573 131Q655 131 710 157T798 233T846 358T860 528V1098H1042V0H895L868 147H858Q810 64 738 22T563 -20Q491 -20 438 3T350 68Q351 30 353 -10Q355 -45 355 -87T356
--172V-492H174V1098H356V391Z" />
-<glyph unicode="&#xb6;" glyph-name="paragraph" horiz-adv-x="1341" d="M1126 -260H1006V1397H799V-260H678V559Q617 541 532 541Q437 541 360 566T228 651T143 806T113 1042Q113 1189 145 1287T237 1446T380 1531T563 1556H1126V-260Z" />
-<glyph unicode="&#xb7;" glyph-name="middot" horiz-adv-x="549" d="M147 723Q147 761 157 787T184 830T224 854T274 862Q300 862 323 855T364 831T391 788T401 723Q401 686 391 660T364 617T324 592T274 584Q247 584 224 592T184 617T157 660T147 723Z" />
-<glyph unicode="&#xb8;" glyph-name="cedilla" horiz-adv-x="420" d="M408 -287Q408 -384 338 -438T117 -492Q95 -492 73 -489T35 -483V-375Q50 -378 74 -379T115 -381Q186 -381 226 -360T266 -289Q266 -265 253 -248T217 -217T163 -195T94 -176L184 0H305L248
--115Q282 -123 311 -136T361 -169T395 -219T408 -287Z" />
-<glyph unicode="&#xb9;" glyph-name="onesuperior" horiz-adv-x="678" d="M307 1462H442V586H297V1102Q297 1127 297 1157T299 1217T302 1275T305 1325Q291 1308 272 1288T231 1251L137 1178L63 1274L307 1462Z" />
-<glyph unicode="&#xba;" glyph-name="ordmasculine" horiz-adv-x="717" d="M651 1133Q651 1050 631 985T572 876T479 808T356 784Q293 784 240 807T148 875T88 985T66 1133Q66 1216 86 1280T145 1389T237 1456T360 1479Q422 1479 475 1456T568 1389T629 1281T651
-1133ZM197 1133Q197 1014 234 954T358 893Q443 893 480 953T518 1133Q518 1253 481 1310T358 1368Q272 1368 235 1311T197 1133Z" />
-<glyph unicode="&#xbb;" glyph-name="guillemotright" horiz-adv-x="997" d="M918 526L608 115L492 193L729 541L492 889L608 967L918 553V526ZM510 526L201 115L84 193L322 541L84 889L201 967L510 553V526Z" />
-<glyph unicode="&#xbc;" glyph-name="onequarter" horiz-adv-x="1509" d="M307 1462H442V586H297V1102Q297 1127 297 1157T299 1217T302 1275T305 1325Q291 1308 272 1288T231 1251L137 1178L63 1274L307 1462ZM1202 1462L391 0H234L1045 1462H1202ZM1419 193H1294V1H1151V193H776V304L1153
-883H1294V320H1419V193ZM1151 320V515Q1151 557 1152 606T1157 705Q1152 694 1142 676T1121 636T1098 595T1077 560L922 320H1151Z" />
-<glyph unicode="&#xbd;" glyph-name="onehalf" horiz-adv-x="1509" d="M544 1462H679V586H534V1102Q534 1127 534 1157T536 1217T539 1275T542 1325Q528 1308 509 1288T468 1251L374 1178L300 1274L544 1462ZM1181 1462L370 0H213L1024 1462H1181ZM1440 1H868V113L1077
-341Q1134 403 1170 445T1226 521T1253 584T1261 648Q1261 713 1228 745T1141 777Q1090 777 1044 752T952 689L874 783Q928 831 994 863T1143 896Q1203 896 1251 880T1334 832T1386 755T1405 652Q1405 602 1391 559T1349 474T1283 386T1192 285L1044 128H1440V1Z"
-/>
-<glyph unicode="&#xbe;" glyph-name="threequarters" horiz-adv-x="1509" d="M590 1255Q590 1177 550 1124T440 1047Q528 1024 572 971T616 840Q616 780 596 730T535 645T430 589T281 569Q211 569 150 581T31 625V758Q94 724 160 705T279 686Q377 686 421 727T465
-842Q465 916 412 949T262 983H164V1096H262Q354 1096 396 1135T438 1239Q438 1271 428 1294T401 1333T360 1355T309 1362Q250 1362 202 1342T102 1284L33 1380Q62 1403 92 1421T157 1453T229 1473T311 1481Q380 1481 432 1464T520 1417T572 1346T590 1255ZM1296
-1462L485 0H328L1139 1462H1296ZM1486 193H1361V1H1218V193H843V304L1220 883H1361V320H1486V193ZM1218 320V515Q1218 557 1219 606T1224 705Q1219 694 1209 676T1188 636T1165 595T1144 560L989 320H1218Z" />
-<glyph unicode="&#xbf;" glyph-name="questiondown" horiz-adv-x="872" d="M592 676V639Q592 581 584 536T557 450T505 371T422 291Q374 250 340 217T285 149T253 75T242 -18Q242 -66 257 -105T300 -173T371 -217T469 -233Q553 -233 628 -208T772 -147L836 -293Q754
--335 660 -364T469 -393Q376 -393 302 -368T176 -294T96 -177T68 -20Q68 48 81 100T121 197T188 284T283 373Q335 418 368 451T420 516T446 580T453 657V676H592ZM639 979Q639 941 630 915T603 872T562 848T512 840Q486 840 463 847T423 871T395 914T385 979Q385
-1016 395 1042T422 1085T463 1110T512 1118Q539 1118 562 1110T602 1085T629 1042T639 979Z" />
-<glyph unicode="&#xc0;" glyph-name="Agrave" horiz-adv-x="1245" d="M1055 0L895 453H350L188 0H0L537 1468H707L1245 0H1055ZM836 618L688 1042Q682 1060 674 1086T656 1142T638 1204T621 1268Q614 1237 605 1204T587 1141T570 1085T555 1042L410 618H836ZM719
-1579H599Q564 1607 523 1648T444 1734T374 1818T326 1886V1907H545Q561 1873 582 1833T627 1752T674 1673T719 1606V1579Z" />
-<glyph unicode="&#xc1;" glyph-name="Aacute" horiz-adv-x="1245" d="M1055 0L895 453H350L188 0H0L537 1468H707L1245 0H1055ZM836 618L688 1042Q682 1060 674 1086T656 1142T638 1204T621 1268Q614 1237 605 1204T587 1141T570 1085T555 1042L410 618H836ZM534
-1606Q556 1635 579 1673T626 1751T671 1832T708 1907H927V1886Q911 1859 880 1819T810 1734T731 1649T655 1579H534V1606Z" />
-<glyph unicode="&#xc2;" glyph-name="Acircumflex" horiz-adv-x="1245" d="M1055 0L895 453H350L188 0H0L537 1468H707L1245 0H1055ZM836 618L688 1042Q682 1060 674 1086T656 1142T638 1204T621 1268Q614 1237 605 1204T587 1141T570 1085T555 1042L410 618H836ZM953
-1579H832Q781 1613 727 1661T621 1765Q567 1710 514 1662T410 1579H289V1606Q315 1635 349 1673T416 1751T479 1832T525 1907H717Q733 1873 762 1833T825 1752T893 1673T953 1606V1579Z" />
-<glyph unicode="&#xc3;" glyph-name="Atilde" horiz-adv-x="1245" d="M1055 0L895 453H350L188 0H0L537 1468H707L1245 0H1055ZM836 618L688 1042Q682 1060 674 1086T656 1142T638 1204T621 1268Q614 1237 605 1204T587 1141T570 1085T555 1042L410 618H836ZM772
-1581Q732 1581 693 1598T615 1637T542 1676T475 1694Q430 1694 406 1668T368 1579H264Q269 1639 285 1688T328 1771T392 1824T475 1843Q517 1843 557 1826T636 1787T708 1749T772 1731Q817 1731 840 1757T878 1845H983Q978 1785 962 1737T919 1654T855 1600T772
-1581Z" />
-<glyph unicode="&#xc4;" glyph-name="Adieresis" horiz-adv-x="1245" d="M1055 0L895 453H350L188 0H0L537 1468H707L1245 0H1055ZM836 618L688 1042Q682 1060 674 1086T656 1142T638 1204T621 1268Q614 1237 605 1204T587 1141T570 1085T555 1042L410 618H836ZM340
-1733Q340 1787 368 1811T436 1835Q475 1835 504 1811T533 1733Q533 1680 504 1655T436 1630Q396 1630 368 1655T340 1733ZM715 1733Q715 1787 743 1811T811 1835Q830 1835 847 1829T878 1811T899 1779T907 1733Q907 1680 878 1655T811 1630Q771 1630 743 1655T715
-1733Z" />
-<glyph unicode="&#xc5;" glyph-name="Aring" horiz-adv-x="1245" d="M1055 0L895 453H350L188 0H0L537 1468H707L1245 0H1055ZM836 618L688 1042Q682 1060 674 1086T656 1142T638 1204T621 1268Q614 1237 605 1204T587 1141T570 1085T555 1042L410 618H836ZM848
-1583Q848 1532 831 1492T783 1423T710 1381T619 1366Q569 1366 528 1380T458 1423T412 1490T396 1581Q396 1632 412 1671T457 1739T528 1781T619 1796Q667 1796 709 1782T782 1740T830 1673T848 1583ZM731 1581Q731 1634 700 1664T619 1694Q569 1694 538 1664T506
-1581Q506 1528 534 1498T619 1468Q668 1468 699 1498T731 1581Z" />
-<glyph unicode="&#xc6;" glyph-name="AE" horiz-adv-x="1745" d="M1622 0H862V453H387L184 0H-2L653 1462H1622V1298H1049V846H1583V684H1049V164H1622V0ZM459 618H862V1298H754L459 618Z" />
-<glyph unicode="&#xc7;" glyph-name="Ccedilla" horiz-adv-x="1235" d="M793 1319Q686 1319 599 1279T451 1162T356 977T322 731Q322 590 351 481T440 296T587 182T793 143Q882 143 962 160T1120 201V39Q1081 24 1042 13T961 -6T870 -16T762 -20Q598 -20 478 34T280
-187T163 425T125 733Q125 899 168 1037T296 1274T506 1428T793 1483Q901 1483 999 1461T1176 1397L1098 1241Q1035 1273 961 1296T793 1319ZM916 -287Q916 -384 846 -438T625 -492Q603 -492 581 -489T543 -483V-375Q558 -378 582 -379T623 -381Q694 -381 734 -360T774
--289Q774 -265 761 -248T725 -217T671 -195T602 -176L692 0H813L756 -115Q790 -123 819 -136T869 -169T903 -219T916 -287Z" />
-<glyph unicode="&#xc8;" glyph-name="Egrave" horiz-adv-x="1081" d="M958 0H199V1462H958V1298H385V846H920V684H385V164H958V0ZM713 1579H593Q558 1607 517 1648T438 1734T368 1818T320 1886V1907H539Q555 1873 576 1833T621 1752T668 1673T713 1606V1579Z" />
-<glyph unicode="&#xc9;" glyph-name="Eacute" horiz-adv-x="1081" d="M958 0H199V1462H958V1298H385V846H920V684H385V164H958V0ZM456 1606Q478 1635 501 1673T548 1751T593 1832T630 1907H849V1886Q833 1859 802 1819T732 1734T653 1649T577 1579H456V1606Z" />
-<glyph unicode="&#xca;" glyph-name="Ecircumflex" horiz-adv-x="1081" d="M958 0H199V1462H958V1298H385V846H920V684H385V164H958V0ZM907 1579H786Q735 1613 681 1661T575 1765Q521 1710 468 1662T364 1579H243V1606Q269 1635 303 1673T370 1751T433 1832T479
-1907H671Q687 1873 716 1833T779 1752T847 1673T907 1606V1579Z" />
-<glyph unicode="&#xcb;" glyph-name="Edieresis" horiz-adv-x="1081" d="M958 0H199V1462H958V1298H385V846H920V684H385V164H958V0ZM296 1733Q296 1787 324 1811T392 1835Q431 1835 460 1811T489 1733Q489 1680 460 1655T392 1630Q352 1630 324 1655T296 1733ZM671
-1733Q671 1787 699 1811T767 1835Q786 1835 803 1829T834 1811T855 1779T863 1733Q863 1680 834 1655T767 1630Q727 1630 699 1655T671 1733Z" />
-<glyph unicode="&#xcc;" glyph-name="Igrave" horiz-adv-x="694" d="M612 0H82V102L254 143V1319L82 1360V1462H612V1360L440 1319V143L612 102V0ZM455 1579H335Q300 1607 259 1648T180 1734T110 1818T62 1886V1907H281Q297 1873 318 1833T363 1752T410 1673T455
-1606V1579Z" />
-<glyph unicode="&#xcd;" glyph-name="Iacute" horiz-adv-x="694" d="M612 0H82V102L254 143V1319L82 1360V1462H612V1360L440 1319V143L612 102V0ZM257 1606Q279 1635 302 1673T349 1751T394 1832T431 1907H650V1886Q634 1859 603 1819T533 1734T454 1649T378
-1579H257V1606Z" />
-<glyph unicode="&#xce;" glyph-name="Icircumflex" horiz-adv-x="694" d="M612 0H82V102L254 143V1319L82 1360V1462H612V1360L440 1319V143L612 102V0ZM681 1579H560Q509 1613 455 1661T349 1765Q295 1710 242 1662T138 1579H17V1606Q43 1635 77 1673T144 1751T207
-1832T253 1907H445Q461 1873 490 1833T553 1752T621 1673T681 1606V1579Z" />
-<glyph unicode="&#xcf;" glyph-name="Idieresis" horiz-adv-x="694" d="M612 0H82V102L254 143V1319L82 1360V1462H612V1360L440 1319V143L612 102V0ZM64 1733Q64 1787 92 1811T160 1835Q199 1835 228 1811T257 1733Q257 1680 228 1655T160 1630Q120 1630 92 1655T64
-1733ZM439 1733Q439 1787 467 1811T535 1835Q554 1835 571 1829T602 1811T623 1779T631 1733Q631 1680 602 1655T535 1630Q495 1630 467 1655T439 1733Z" />
-<glyph unicode="&#xd0;" glyph-name="Eth" horiz-adv-x="1401" d="M47 805H199V1462H606Q759 1462 883 1416T1094 1280T1228 1055T1276 745Q1276 560 1228 421T1089 188T866 47T565 0H199V643H47V805ZM1079 739Q1079 885 1046 991T950 1167T795 1269T586 1303H385V805H721V643H385V160H547Q811
-160 945 306T1079 739Z" />
-<glyph unicode="&#xd1;" glyph-name="Ntilde" horiz-adv-x="1493" d="M1294 0H1079L360 1210H352Q358 1133 362 1057Q366 992 368 921T371 793V0H199V1462H412L1128 258H1135Q1132 334 1128 408Q1127 440 1126 473T1123 540T1121 605T1120 662V1462H1294V0ZM905
-1581Q865 1581 826 1598T748 1637T675 1676T608 1694Q563 1694 539 1668T501 1579H397Q402 1639 418 1688T461 1771T525 1824T608 1843Q650 1843 690 1826T769 1787T841 1749T905 1731Q950 1731 973 1757T1011 1845H1116Q1111 1785 1095 1737T1052 1654T988 1600T905
-1581Z" />
-<glyph unicode="&#xd2;" glyph-name="Ograve" horiz-adv-x="1520" d="M1393 733Q1393 564 1353 425T1232 187T1034 34T760 -20Q597 -20 478 34T280 187T163 425T125 735Q125 905 163 1043T280 1280T479 1431T762 1485Q917 1485 1034 1432T1232 1280T1352 1043T1393
-733ZM322 733Q322 596 348 487T427 301T563 184T760 143Q874 143 956 183T1092 300T1171 486T1196 733Q1196 871 1171 980T1093 1164T958 1280T762 1321Q648 1321 565 1281T428 1165T348 980T322 733ZM870 1579H750Q715 1607 674 1648T595 1734T525 1818T477 1886V1907H696Q712
-1873 733 1833T778 1752T825 1673T870 1606V1579Z" />
-<glyph unicode="&#xd3;" glyph-name="Oacute" horiz-adv-x="1520" d="M1393 733Q1393 564 1353 425T1232 187T1034 34T760 -20Q597 -20 478 34T280 187T163 425T125 735Q125 905 163 1043T280 1280T479 1431T762 1485Q917 1485 1034 1432T1232 1280T1352 1043T1393
-733ZM322 733Q322 596 348 487T427 301T563 184T760 143Q874 143 956 183T1092 300T1171 486T1196 733Q1196 871 1171 980T1093 1164T958 1280T762 1321Q648 1321 565 1281T428 1165T348 980T322 733ZM651 1606Q673 1635 696 1673T743 1751T788 1832T825 1907H1044V1886Q1028
-1859 997 1819T927 1734T848 1649T772 1579H651V1606Z" />
-<glyph unicode="&#xd4;" glyph-name="Ocircumflex" horiz-adv-x="1520" d="M1393 733Q1393 564 1353 425T1232 187T1034 34T760 -20Q597 -20 478 34T280 187T163 425T125 735Q125 905 163 1043T280 1280T479 1431T762 1485Q917 1485 1034 1432T1232 1280T1352
-1043T1393 733ZM322 733Q322 596 348 487T427 301T563 184T760 143Q874 143 956 183T1092 300T1171 486T1196 733Q1196 871 1171 980T1093 1164T958 1280T762 1321Q648 1321 565 1281T428 1165T348 980T322 733ZM1096 1579H975Q924 1613 870 1661T764 1765Q710
-1710 657 1662T553 1579H432V1606Q458 1635 492 1673T559 1751T622 1832T668 1907H860Q876 1873 905 1833T968 1752T1036 1673T1096 1606V1579Z" />
-<glyph unicode="&#xd5;" glyph-name="Otilde" horiz-adv-x="1520" d="M1393 733Q1393 564 1353 425T1232 187T1034 34T760 -20Q597 -20 478 34T280 187T163 425T125 735Q125 905 163 1043T280 1280T479 1431T762 1485Q917 1485 1034 1432T1232 1280T1352 1043T1393
-733ZM322 733Q322 596 348 487T427 301T563 184T760 143Q874 143 956 183T1092 300T1171 486T1196 733Q1196 871 1171 980T1093 1164T958 1280T762 1321Q648 1321 565 1281T428 1165T348 980T322 733ZM891 1581Q851 1581 812 1598T734 1637T661 1676T594 1694Q549
-1694 525 1668T487 1579H383Q388 1639 404 1688T447 1771T511 1824T594 1843Q636 1843 676 1826T755 1787T827 1749T891 1731Q936 1731 959 1757T997 1845H1102Q1097 1785 1081 1737T1038 1654T974 1600T891 1581Z" />
-<glyph unicode="&#xd6;" glyph-name="Odieresis" horiz-adv-x="1520" d="M1393 733Q1393 564 1353 425T1232 187T1034 34T760 -20Q597 -20 478 34T280 187T163 425T125 735Q125 905 163 1043T280 1280T479 1431T762 1485Q917 1485 1034 1432T1232 1280T1352 1043T1393
-733ZM322 733Q322 596 348 487T427 301T563 184T760 143Q874 143 956 183T1092 300T1171 486T1196 733Q1196 871 1171 980T1093 1164T958 1280T762 1321Q648 1321 565 1281T428 1165T348 980T322 733ZM477 1733Q477 1787 505 1811T573 1835Q612 1835 641 1811T670
-1733Q670 1680 641 1655T573 1630Q533 1630 505 1655T477 1733ZM852 1733Q852 1787 880 1811T948 1835Q967 1835 984 1829T1015 1811T1036 1779T1044 1733Q1044 1680 1015 1655T948 1630Q908 1630 880 1655T852 1733Z" />
-<glyph unicode="&#xd7;" glyph-name="multiply" horiz-adv-x="1128" d="M459 723L141 1042L246 1147L563 829L885 1147L989 1044L668 723L987 403L885 301L563 618L246 303L143 406L459 723Z" />
-<glyph unicode="&#xd8;" glyph-name="Oslash" horiz-adv-x="1520" d="M1300 1454L1208 1305Q1299 1206 1346 1061T1393 733Q1393 564 1353 425T1232 187T1034 34T760 -20Q571 -20 438 51L360 -76L223 2L313 147Q216 247 171 396T125 735Q125 905 163 1043T280
-1280T479 1431T762 1485Q856 1485 936 1464T1083 1405L1163 1532L1300 1454ZM322 733Q322 602 345 498T416 315L995 1260Q947 1289 890 1305T762 1321Q648 1321 565 1281T428 1165T348 980T322 733ZM1196 733Q1196 990 1108 1141L530 201Q577 173 634 158T760 143Q874
-143 956 183T1092 300T1171 486T1196 733Z" />
-<glyph unicode="&#xd9;" glyph-name="Ugrave" horiz-adv-x="1430" d="M1245 1464V516Q1245 402 1212 304T1113 134T946 21T709 -20Q581 -20 483 18T319 128T218 298T184 520V1462H371V510Q371 335 457 239T719 143Q808 143 872 170T977 246T1038 363T1059 512V1464H1245ZM847
-1579H727Q692 1607 651 1648T572 1734T502 1818T454 1886V1907H673Q689 1873 710 1833T755 1752T802 1673T847 1606V1579Z" />
-<glyph unicode="&#xda;" glyph-name="Uacute" horiz-adv-x="1430" d="M1245 1464V516Q1245 402 1212 304T1113 134T946 21T709 -20Q581 -20 483 18T319 128T218 298T184 520V1462H371V510Q371 335 457 239T719 143Q808 143 872 170T977 246T1038 363T1059 512V1464H1245ZM590
-1606Q612 1635 635 1673T682 1751T727 1832T764 1907H983V1886Q967 1859 936 1819T866 1734T787 1649T711 1579H590V1606Z" />
-<glyph unicode="&#xdb;" glyph-name="Ucircumflex" horiz-adv-x="1430" d="M1245 1464V516Q1245 402 1212 304T1113 134T946 21T709 -20Q581 -20 483 18T319 128T218 298T184 520V1462H371V510Q371 335 457 239T719 143Q808 143 872 170T977 246T1038 363T1059
-512V1464H1245ZM1043 1579H922Q871 1613 817 1661T711 1765Q657 1710 604 1662T500 1579H379V1606Q405 1635 439 1673T506 1751T569 1832T615 1907H807Q823 1873 852 1833T915 1752T983 1673T1043 1606V1579Z" />
-<glyph unicode="&#xdc;" glyph-name="Udieresis" horiz-adv-x="1430" d="M1245 1464V516Q1245 402 1212 304T1113 134T946 21T709 -20Q581 -20 483 18T319 128T218 298T184 520V1462H371V510Q371 335 457 239T719 143Q808 143 872 170T977 246T1038 363T1059 512V1464H1245ZM432
-1733Q432 1787 460 1811T528 1835Q567 1835 596 1811T625 1733Q625 1680 596 1655T528 1630Q488 1630 460 1655T432 1733ZM807 1733Q807 1787 835 1811T903 1835Q922 1835 939 1829T970 1811T991 1779T999 1733Q999 1680 970 1655T903 1630Q863 1630 835 1655T807
-1733Z" />
-<glyph unicode="&#xdd;" glyph-name="Yacute" horiz-adv-x="1079" d="M539 723L879 1462H1079L633 569V0H446V559L0 1462H203L539 723ZM442 1606Q464 1635 487 1673T534 1751T579 1832T616 1907H835V1886Q819 1859 788 1819T718 1734T639 1649T563 1579H442V1606Z" />
-<glyph unicode="&#xde;" glyph-name="Thorn" horiz-adv-x="1180" d="M1075 782Q1075 691 1048 607T957 459T791 356T535 317H385V0H199V1462H385V1210H561Q695 1210 792 1182T952 1099T1045 964T1075 782ZM385 475H514Q607 475 676 491T791 542T860 634T883 772Q883
-915 801 983T545 1051H385V475Z" />
-<glyph unicode="&#xdf;" glyph-name="germandbls" horiz-adv-x="1233" d="M1010 1260Q1010 1203 989 1159T936 1078T867 1011T798 954T745 899T723 842Q723 821 730 805T756 769T811 725T903 662Q959 625 1003 589T1077 512T1124 423T1141 313Q1141 226 1113 163T1035
-60T914 0T758 -20Q661 -20 592 -3T469 49V215Q495 199 527 184T596 156T670 137T745 129Q801 129 841 141T908 176T946 231T958 303Q958 339 950 368T920 426T862 483T770 547Q707 587 665 621T596 688T558 757T547 834Q547 888 567 927T619 998T686 1057T753 1113T804
-1175T825 1253Q825 1295 809 1326T762 1377T691 1407T598 1417Q549 1417 505 1408T428 1374T376 1309T356 1202V0H174V1200Q174 1304 205 1374T293 1487T428 1548T598 1567Q690 1567 766 1548T896 1491T980 1395T1010 1260Z" />
-<glyph unicode="&#xe0;" glyph-name="agrave" horiz-adv-x="1087" d="M793 0L756 152H748Q715 107 682 75T610 21T523 -10T412 -20Q343 -20 285 -1T185 59T118 161T94 307Q94 471 209 559T561 655L745 662V731Q745 798 731 843T689 915T621 955T528 967Q445 967
-374 943T236 885L172 1022Q246 1062 337 1090T528 1118Q630 1118 704 1098T827 1033T900 919T924 752V0H793ZM459 127Q520 127 572 146T662 203T721 300T743 438V537L600 530Q510 526 449 510T352 466T299 397T283 305Q283 213 331 170T459 127ZM934 1241H814Q779
-1269 738 1310T659 1396T589 1480T541 1548V1569H760Q776 1535 797 1495T842 1414T889 1335T934 1268V1241Z" />
-<glyph unicode="&#xe1;" glyph-name="aacute" horiz-adv-x="1087" d="M793 0L756 152H748Q715 107 682 75T610 21T523 -10T412 -20Q343 -20 285 -1T185 59T118 161T94 307Q94 471 209 559T561 655L745 662V731Q745 798 731 843T689 915T621 955T528 967Q445 967
-374 943T236 885L172 1022Q246 1062 337 1090T528 1118Q630 1118 704 1098T827 1033T900 919T924 752V0H793ZM459 127Q520 127 572 146T662 203T721 300T743 438V537L600 530Q510 526 449 510T352 466T299 397T283 305Q283 213 331 170T459 127ZM446 1268Q468 1297
-491 1335T538 1413T583 1494T620 1569H839V1548Q823 1521 792 1481T722 1396T643 1311T567 1241H446V1268Z" />
-<glyph unicode="&#xe2;" glyph-name="acircumflex" horiz-adv-x="1087" d="M793 0L756 152H748Q715 107 682 75T610 21T523 -10T412 -20Q343 -20 285 -1T185 59T118 161T94 307Q94 471 209 559T561 655L745 662V731Q745 798 731 843T689 915T621 955T528 967Q445
-967 374 943T236 885L172 1022Q246 1062 337 1090T528 1118Q630 1118 704 1098T827 1033T900 919T924 752V0H793ZM459 127Q520 127 572 146T662 203T721 300T743 438V537L600 530Q510 526 449 510T352 466T299 397T283 305Q283 213 331 170T459 127ZM1148 1241H1027Q976
-1275 922 1323T816 1427Q762 1372 709 1324T605 1241H484V1268Q510 1297 544 1335T611 1413T674 1494T720 1569H912Q928 1535 957 1495T1020 1414T1088 1335T1148 1268V1241Z" />
-<glyph unicode="&#xe3;" glyph-name="atilde" horiz-adv-x="1087" d="M793 0L756 152H748Q715 107 682 75T610 21T523 -10T412 -20Q343 -20 285 -1T185 59T118 161T94 307Q94 471 209 559T561 655L745 662V731Q745 798 731 843T689 915T621 955T528 967Q445 967
-374 943T236 885L172 1022Q246 1062 337 1090T528 1118Q630 1118 704 1098T827 1033T900 919T924 752V0H793ZM459 127Q520 127 572 146T662 203T721 300T743 438V537L600 530Q510 526 449 510T352 466T299 397T283 305Q283 213 331 170T459 127ZM955 1243Q915 1243
-876 1260T798 1299T725 1338T658 1356Q613 1356 589 1330T551 1241H447Q452 1301 468 1350T511 1433T575 1486T658 1505Q700 1505 740 1488T819 1449T891 1411T955 1393Q1000 1393 1023 1419T1061 1507H1166Q1161 1447 1145 1399T1102 1316T1038 1262T955 1243Z"
-/>
-<glyph unicode="&#xe4;" glyph-name="adieresis" horiz-adv-x="1087" d="M793 0L756 152H748Q715 107 682 75T610 21T523 -10T412 -20Q343 -20 285 -1T185 59T118 161T94 307Q94 471 209 559T561 655L745 662V731Q745 798 731 843T689 915T621 955T528 967Q445
-967 374 943T236 885L172 1022Q246 1062 337 1090T528 1118Q630 1118 704 1098T827 1033T900 919T924 752V0H793ZM459 127Q520 127 572 146T662 203T721 300T743 438V537L600 530Q510 526 449 510T352 466T299 397T283 305Q283 213 331 170T459 127ZM529 1395Q529
-1449 557 1473T625 1497Q664 1497 693 1473T722 1395Q722 1342 693 1317T625 1292Q585 1292 557 1317T529 1395ZM904 1395Q904 1449 932 1473T1000 1497Q1019 1497 1036 1491T1067 1473T1088 1441T1096 1395Q1096 1342 1067 1317T1000 1292Q960 1292 932 1317T904
-1395Z" />
-<glyph unicode="&#xe5;" glyph-name="aring" horiz-adv-x="1087" d="M793 0L756 152H748Q715 107 682 75T610 21T523 -10T412 -20Q343 -20 285 -1T185 59T118 161T94 307Q94 471 209 559T561 655L745 662V731Q745 798 731 843T689 915T621 955T528 967Q445 967
-374 943T236 885L172 1022Q246 1062 337 1090T528 1118Q630 1118 704 1098T827 1033T900 919T924 752V0H793ZM459 127Q520 127 572 146T662 203T721 300T743 438V537L600 530Q510 526 449 510T352 466T299 397T283 305Q283 213 331 170T459 127ZM1039 1458Q1039
-1407 1022 1367T974 1298T901 1256T810 1241Q760 1241 719 1255T649 1298T603 1365T587 1456Q587 1507 603 1546T648 1614T719 1656T810 1671Q858 1671 900 1657T973 1615T1021 1548T1039 1458ZM922 1456Q922 1509 891 1539T810 1569Q760 1569 729 1539T697 1456Q697
-1403 725 1373T810 1343Q859 1343 890 1373T922 1456Z" />
-<glyph unicode="&#xe6;" glyph-name="ae" horiz-adv-x="1706" d="M94 307Q94 471 209 559T561 655L745 662V731Q745 798 731 843T689 915T621 955T528 967Q445 967 374 943T236 885L172 1022Q246 1062 337 1090T528 1118Q659 1118 742 1076T868 940Q919 1025 1002
-1071T1188 1118Q1285 1118 1362 1083T1493 983T1575 828T1604 627V514H932Q937 321 1010 230T1231 139Q1280 139 1322 144T1404 158T1480 182T1554 215V53Q1515 34 1478 20T1401 -3T1319 -16T1227 -20Q1089 -20 988 37T825 209Q791 155 753 113T668 41T562 -4T430
--20Q359 -20 298 -1T191 59T120 161T94 307ZM283 305Q283 213 331 170T459 127Q520 127 572 146T662 203T721 300T743 438V537L600 530Q510 526 449 510T352 466T299 397T283 305ZM1184 967Q1074 967 1011 889T936 662H1407Q1407 730 1394 786T1354 883T1284 945T1184
-967Z" />
-<glyph unicode="&#xe7;" glyph-name="ccedilla" horiz-adv-x="948" d="M594 -20Q493 -20 405 11T252 111T150 286T113 543Q113 700 151 809T255 987T411 1087T602 1118Q680 1118 754 1101T879 1059L825 905Q802 915 774 924T716 941T657 953T602 958Q445 958 373
-858T301 545Q301 334 373 237T594 139Q675 139 740 157T860 201V39Q806 10 745 -5T594 -20ZM730 -287Q730 -384 660 -438T439 -492Q417 -492 395 -489T357 -483V-375Q372 -378 396 -379T437 -381Q508 -381 548 -360T588 -289Q588 -265 575 -248T539 -217T485 -195T416
--176L506 0H627L570 -115Q604 -123 633 -136T683 -169T717 -219T730 -287Z" />
-<glyph unicode="&#xe8;" glyph-name="egrave" horiz-adv-x="1096" d="M608 -20Q498 -20 407 17T251 125T149 301T113 541Q113 677 146 784T239 965T382 1079T567 1118Q666 1118 745 1083T879 983T963 828T993 627V514H301Q306 321 382 230T610 139Q661 139 704
-144T788 158T867 182T944 215V53Q904 34 866 20T787 -3T703 -16T608 -20ZM563 967Q449 967 383 889T305 662H797Q797 730 784 786T742 883T669 945T563 967ZM934 1241H814Q779 1269 738 1310T659 1396T589 1480T541 1548V1569H760Q776 1535 797 1495T842 1414T889
-1335T934 1268V1241Z" />
-<glyph unicode="&#xe9;" glyph-name="eacute" horiz-adv-x="1096" d="M608 -20Q498 -20 407 17T251 125T149 301T113 541Q113 677 146 784T239 965T382 1079T567 1118Q666 1118 745 1083T879 983T963 828T993 627V514H301Q306 321 382 230T610 139Q661 139 704
-144T788 158T867 182T944 215V53Q904 34 866 20T787 -3T703 -16T608 -20ZM563 967Q449 967 383 889T305 662H797Q797 730 784 786T742 883T669 945T563 967ZM475 1268Q497 1297 520 1335T567 1413T612 1494T649 1569H868V1548Q852 1521 821 1481T751 1396T672 1311T596
-1241H475V1268Z" />
-<glyph unicode="&#xea;" glyph-name="ecircumflex" horiz-adv-x="1096" d="M608 -20Q498 -20 407 17T251 125T149 301T113 541Q113 677 146 784T239 965T382 1079T567 1118Q666 1118 745 1083T879 983T963 828T993 627V514H301Q306 321 382 230T610 139Q661 139
-704 144T788 158T867 182T944 215V53Q904 34 866 20T787 -3T703 -16T608 -20ZM563 967Q449 967 383 889T305 662H797Q797 730 784 786T742 883T669 945T563 967ZM1144 1241H1023Q972 1275 918 1323T812 1427Q758 1372 705 1324T601 1241H480V1268Q506 1297 540
-1335T607 1413T670 1494T716 1569H908Q924 1535 953 1495T1016 1414T1084 1335T1144 1268V1241Z" />
-<glyph unicode="&#xeb;" glyph-name="edieresis" horiz-adv-x="1096" d="M608 -20Q498 -20 407 17T251 125T149 301T113 541Q113 677 146 784T239 965T382 1079T567 1118Q666 1118 745 1083T879 983T963 828T993 627V514H301Q306 321 382 230T610 139Q661 139
-704 144T788 158T867 182T944 215V53Q904 34 866 20T787 -3T703 -16T608 -20ZM563 967Q449 967 383 889T305 662H797Q797 730 784 786T742 883T669 945T563 967ZM525 1395Q525 1449 553 1473T621 1497Q660 1497 689 1473T718 1395Q718 1342 689 1317T621 1292Q581
-1292 553 1317T525 1395ZM900 1395Q900 1449 928 1473T996 1497Q1015 1497 1032 1491T1063 1473T1084 1441T1092 1395Q1092 1342 1063 1317T996 1292Q956 1292 928 1317T900 1395Z" />
-<glyph unicode="&#xec;" glyph-name="igrave" horiz-adv-x="530" d="M356 0H174V1098H356V0ZM359 1241H239Q204 1269 163 1310T84 1396T14 1480T-34 1548V1569H185Q201 1535 222 1495T267 1414T314 1335T359 1268V1241Z" />
-<glyph unicode="&#xed;" glyph-name="iacute" horiz-adv-x="530" d="M356 0H174V1098H356V0ZM185 1268Q207 1297 230 1335T277 1413T322 1494T359 1569H578V1548Q562 1521 531 1481T461 1396T382 1311T306 1241H185V1268Z" />
-<glyph unicode="&#xee;" glyph-name="icircumflex" horiz-adv-x="530" d="M356 0H174V1098H356V0ZM597 1241H476Q425 1275 371 1323T265 1427Q211 1372 158 1324T54 1241H-67V1268Q-41 1297 -7 1335T60 1413T123 1494T169 1569H361Q377 1535 406 1495T469 1414T537
-1335T597 1268V1241Z" />
-<glyph unicode="&#xef;" glyph-name="idieresis" horiz-adv-x="530" d="M356 0H174V1098H356V0ZM-18 1395Q-18 1449 10 1473T78 1497Q117 1497 146 1473T175 1395Q175 1342 146 1317T78 1292Q38 1292 10 1317T-18 1395ZM357 1395Q357 1449 385 1473T453 1497Q472
-1497 489 1491T520 1473T541 1441T549 1395Q549 1342 520 1317T453 1292Q413 1292 385 1317T357 1395Z" />
-<glyph unicode="&#xf0;" glyph-name="eth" horiz-adv-x="1182" d="M1069 573Q1069 431 1036 321T940 135T788 20T588 -20Q484 -20 397 13T246 109T147 265T111 477Q111 596 142 688T233 843T376 938T565 971Q667 971 744 942T864 852L872 856Q841 974 781 1070T631
-1247L375 1094L301 1208L518 1339Q478 1367 436 1394T346 1448L416 1571Q481 1539 542 1503T662 1423L889 1561L963 1448L768 1331Q835 1266 890 1188T985 1017T1047 813T1069 573ZM881 526Q881 582 864 635T812 730T722 796T592 821Q515 821 461 798T371 731T320
-622T303 471Q303 395 319 333T371 225T461 156T592 131Q746 131 813 230T881 526Z" />
-<glyph unicode="&#xf1;" glyph-name="ntilde" horiz-adv-x="1206" d="M860 0V707Q860 837 808 902T643 967Q562 967 507 941T419 864T371 739T356 569V0H174V1098H322L348 950H358Q383 993 417 1024T493 1077T580 1108T674 1118Q857 1118 949 1023T1042 717V0H860ZM1015
-1243Q975 1243 936 1260T858 1299T785 1338T718 1356Q673 1356 649 1330T611 1241H507Q512 1301 528 1350T571 1433T635 1486T718 1505Q760 1505 800 1488T879 1449T951 1411T1015 1393Q1060 1393 1083 1419T1121 1507H1226Q1221 1447 1205 1399T1162 1316T1098
-1262T1015 1243Z" />
-<glyph unicode="&#xf2;" glyph-name="ograve" horiz-adv-x="1182" d="M1069 551Q1069 414 1036 308T940 129T788 18T588 -20Q485 -20 398 18T248 128T149 307T113 551Q113 687 146 792T242 970T393 1080T594 1118Q697 1118 784 1081T934 971T1033 793T1069 551ZM301
-551Q301 342 369 237T592 131Q746 131 813 236T881 551Q881 760 813 863T590 967Q436 967 369 864T301 551ZM1002 1241H882Q847 1269 806 1310T727 1396T657 1480T609 1548V1569H828Q844 1535 865 1495T910 1414T957 1335T1002 1268V1241Z" />
-<glyph unicode="&#xf3;" glyph-name="oacute" horiz-adv-x="1182" d="M1069 551Q1069 414 1036 308T940 129T788 18T588 -20Q485 -20 398 18T248 128T149 307T113 551Q113 687 146 792T242 970T393 1080T594 1118Q697 1118 784 1081T934 971T1033 793T1069 551ZM301
-551Q301 342 369 237T592 131Q746 131 813 236T881 551Q881 760 813 863T590 967Q436 967 369 864T301 551ZM473 1268Q495 1297 518 1335T565 1413T610 1494T647 1569H866V1548Q850 1521 819 1481T749 1396T670 1311T594 1241H473V1268Z" />
-<glyph unicode="&#xf4;" glyph-name="ocircumflex" horiz-adv-x="1182" d="M1069 551Q1069 414 1036 308T940 129T788 18T588 -20Q485 -20 398 18T248 128T149 307T113 551Q113 687 146 792T242 970T393 1080T594 1118Q697 1118 784 1081T934 971T1033 793T1069
-551ZM301 551Q301 342 369 237T592 131Q746 131 813 236T881 551Q881 760 813 863T590 967Q436 967 369 864T301 551ZM1173 1241H1052Q1001 1275 947 1323T841 1427Q787 1372 734 1324T630 1241H509V1268Q535 1297 569 1335T636 1413T699 1494T745 1569H937Q953
-1535 982 1495T1045 1414T1113 1335T1173 1268V1241Z" />
-<glyph unicode="&#xf5;" glyph-name="otilde" horiz-adv-x="1182" d="M1069 551Q1069 414 1036 308T940 129T788 18T588 -20Q485 -20 398 18T248 128T149 307T113 551Q113 687 146 792T242 970T393 1080T594 1118Q697 1118 784 1081T934 971T1033 793T1069 551ZM301
-551Q301 342 369 237T592 131Q746 131 813 236T881 551Q881 760 813 863T590 967Q436 967 369 864T301 551ZM992 1243Q952 1243 913 1260T835 1299T762 1338T695 1356Q650 1356 626 1330T588 1241H484Q489 1301 505 1350T548 1433T612 1486T695 1505Q737 1505 777
-1488T856 1449T928 1411T992 1393Q1037 1393 1060 1419T1098 1507H1203Q1198 1447 1182 1399T1139 1316T1075 1262T992 1243Z" />
-<glyph unicode="&#xf6;" glyph-name="odieresis" horiz-adv-x="1182" d="M1069 551Q1069 414 1036 308T940 129T788 18T588 -20Q485 -20 398 18T248 128T149 307T113 551Q113 687 146 792T242 970T393 1080T594 1118Q697 1118 784 1081T934 971T1033 793T1069
-551ZM301 551Q301 342 369 237T592 131Q746 131 813 236T881 551Q881 760 813 863T590 967Q436 967 369 864T301 551ZM556 1395Q556 1449 584 1473T652 1497Q691 1497 720 1473T749 1395Q749 1342 720 1317T652 1292Q612 1292 584 1317T556 1395ZM931 1395Q931
-1449 959 1473T1027 1497Q1046 1497 1063 1491T1094 1473T1115 1441T1123 1395Q1123 1342 1094 1317T1027 1292Q987 1292 959 1317T931 1395Z" />
-<glyph unicode="&#xf7;" glyph-name="divide" horiz-adv-x="1128" d="M102 647V797H1026V647H102ZM449 373Q449 408 458 431T482 470T518 491T563 498Q586 498 607 492T644 470T669 432T678 373Q678 340 669 317T644 278T607 255T563 248Q539 248 519 255T483
-277T458 316T449 373ZM449 1071Q449 1106 458 1129T482 1168T518 1189T563 1196Q586 1196 607 1190T644 1168T669 1130T678 1071Q678 1038 669 1015T644 976T607 953T563 946Q539 946 519 953T483 975T458 1014T449 1071Z" />
-<glyph unicode="&#xf8;" glyph-name="oslash" horiz-adv-x="1182" d="M1071 551Q1071 414 1038 308T942 129T790 18T590 -20Q465 -20 367 33L299 -76L168 -2L248 129Q185 201 150 307T115 551Q115 687 148 792T244 970T395 1080T596 1118Q659 1118 715 1104T821
-1061L889 1169L1020 1096L940 967Q1002 894 1036 790T1071 551ZM303 551Q303 467 312 402T344 285L741 932Q712 949 675 958T592 967Q438 967 371 864T303 551ZM883 551Q883 710 844 809L446 164Q477 147 513 139T594 131Q748 131 815 236T883 551Z" />
-<glyph unicode="&#xf9;" glyph-name="ugrave" horiz-adv-x="1206" d="M885 0L858 147H848Q823 104 789 73T713 21T626 -10T532 -20Q441 -20 372 3T257 75T188 200T164 381V1098H346V391Q346 261 399 196T563 131Q644 131 699 157T787 233T835 358T850 528V1098H1032V0H885ZM949
-1241H829Q794 1269 753 1310T674 1396T604 1480T556 1548V1569H775Q791 1535 812 1495T857 1414T904 1335T949 1268V1241Z" />
-<glyph unicode="&#xfa;" glyph-name="uacute" horiz-adv-x="1206" d="M885 0L858 147H848Q823 104 789 73T713 21T626 -10T532 -20Q441 -20 372 3T257 75T188 200T164 381V1098H346V391Q346 261 399 196T563 131Q644 131 699 157T787 233T835 358T850 528V1098H1032V0H885ZM489
-1268Q511 1297 534 1335T581 1413T626 1494T663 1569H882V1548Q866 1521 835 1481T765 1396T686 1311T610 1241H489V1268Z" />
-<glyph unicode="&#xfb;" glyph-name="ucircumflex" horiz-adv-x="1206" d="M885 0L858 147H848Q823 104 789 73T713 21T626 -10T532 -20Q441 -20 372 3T257 75T188 200T164 381V1098H346V391Q346 261 399 196T563 131Q644 131 699 157T787 233T835 358T850 528V1098H1032V0H885ZM930
-1241H809Q758 1275 704 1323T598 1427Q544 1372 491 1324T387 1241H266V1268Q292 1297 326 1335T393 1413T456 1494T502 1569H694Q710 1535 739 1495T802 1414T870 1335T930 1268V1241Z" />
-<glyph unicode="&#xfc;" glyph-name="udieresis" horiz-adv-x="1206" d="M885 0L858 147H848Q823 104 789 73T713 21T626 -10T532 -20Q441 -20 372 3T257 75T188 200T164 381V1098H346V391Q346 261 399 196T563 131Q644 131 699 157T787 233T835 358T850 528V1098H1032V0H885ZM309
-1395Q309 1449 337 1473T405 1497Q444 1497 473 1473T502 1395Q502 1342 473 1317T405 1292Q365 1292 337 1317T309 1395ZM684 1395Q684 1449 712 1473T780 1497Q799 1497 816 1491T847 1473T868 1441T876 1395Q876 1342 847 1317T780 1292Q740 1292 712 1317T684
-1395Z" />
-<glyph unicode="&#xfd;" glyph-name="yacute" horiz-adv-x="1001" d="M10 1098H199L414 485Q428 445 442 401T469 313T491 228T504 152H510Q515 177 526 220T550 311T578 407T604 487L803 1098H991L557 -143Q529 -224 497 -288T421 -398T320 -467T182 -492Q130
--492 92 -487T27 -475V-330Q48 -335 80 -338T147 -342Q195 -342 230 -331T291 -297T335 -243T369 -170L426 -10L10 1098ZM407 1268Q429 1297 452 1335T499 1413T544 1494T581 1569H800V1548Q784 1521 753 1481T683 1396T604 1311T528 1241H407V1268Z" />
-<glyph unicode="&#xfe;" glyph-name="thorn" horiz-adv-x="1200" d="M356 950Q379 985 408 1015T475 1068T562 1104T670 1118Q764 1118 841 1082T972 975T1057 797T1087 551Q1087 410 1057 304T973 125T841 17T670 -20Q611 -20 563 -7T477 27T409 78T356 139H344Q347
-105 350 74Q352 48 354 21T356 -23V-492H174V1556H356V1098L348 950H356ZM635 967Q559 967 507 944T422 874T374 757T356 592V551Q356 450 369 372T415 240T502 159T637 131Q772 131 835 240T899 553Q899 761 836 864T635 967Z" />
-<glyph unicode="&#xff;" glyph-name="ydieresis" horiz-adv-x="1001" d="M10 1098H199L414 485Q428 445 442 401T469 313T491 228T504 152H510Q515 177 526 220T550 311T578 407T604 487L803 1098H991L557 -143Q529 -224 497 -288T421 -398T320 -467T182 -492Q130
--492 92 -487T27 -475V-330Q48 -335 80 -338T147 -342Q195 -342 230 -331T291 -297T335 -243T369 -170L426 -10L10 1098ZM484 1395Q484 1449 512 1473T580 1497Q619 1497 648 1473T677 1395Q677 1342 648 1317T580 1292Q540 1292 512 1317T484 1395ZM859 1395Q859
-1449 887 1473T955 1497Q974 1497 991 1491T1022 1473T1043 1441T1051 1395Q1051 1342 1022 1317T955 1292Q915 1292 887 1317T859 1395Z" />
-<glyph unicode="&#x2013;" glyph-name="endash" horiz-adv-x="1024" d="M82 465V633H942V465H82Z" />
-<glyph unicode="&#x2014;" glyph-name="emdash" horiz-adv-x="2048" d="M82 465V633H1966V465H82Z" />
-<glyph unicode="&#x2018;" glyph-name="quoteleft" horiz-adv-x="358" d="M37 961L23 983Q37 1037 56 1098T99 1221T148 1344T199 1462H336Q321 1401 307 1335T279 1204T255 1076T236 961H37Z" />
-<glyph unicode="&#x2019;" glyph-name="quoteright" horiz-adv-x="358" d="M322 1462L336 1440Q322 1385 303 1325T260 1202T211 1078T160 961H23Q37 1021 51 1087T79 1219T104 1347T123 1462H322Z" />
-<glyph unicode="&#x201a;" glyph-name="quotesinglbase" horiz-adv-x="512" d="M362 238L377 215Q363 161 344 100T301 -23T252 -146T201 -264H63Q78 -203 92 -137T120 -6T145 122T164 238H362Z" />
-<glyph unicode="&#x201c;" glyph-name="quotedblleft" horiz-adv-x="743" d="M422 961L408 983Q422 1037 441 1098T484 1221T533 1344T584 1462H721Q706 1401 692 1335T664 1204T640 1076T621 961H422ZM37 961L23 983Q37 1037 56 1098T99 1221T148 1344T199 1462H336Q321
-1401 307 1335T279 1204T255 1076T236 961H37Z" />
-<glyph unicode="&#x201d;" glyph-name="quotedblright" horiz-adv-x="743" d="M322 1462L336 1440Q322 1385 303 1325T260 1202T211 1078T160 961H23Q37 1021 51 1087T79 1219T104 1347T123 1462H322ZM707 1462L721 1440Q707 1385 688 1325T645 1202T596 1078T545
-961H408Q422 1021 436 1087T464 1219T489 1347T508 1462H707Z" />
-<glyph unicode="&#x201e;" glyph-name="quotedblbase" horiz-adv-x="897" d="M362 238L377 215Q363 161 344 100T301 -23T252 -146T201 -264H63Q78 -203 92 -137T120 -6T145 122T164 238H362ZM748 238L762 215Q748 161 729 100T686 -23T637 -146T586 -264H449Q463
--203 477 -137T505 -6T530 122T549 238H748Z" />
-<glyph unicode="&#x2022;" glyph-name="bullet" horiz-adv-x="770" d="M150 748Q150 819 168 869T217 950T292 996T385 1010Q434 1010 477 996T552 951T602 869T621 748Q621 678 603 628T552 547T477 500T385 485Q335 485 292 500T218 546T168 628T150 748Z" />
-<glyph unicode="&#x2039;" glyph-name="guilsinglleft" horiz-adv-x="590" d="M82 553L391 967L508 889L270 541L508 193L391 115L82 526V553Z" />
-<glyph unicode="&#x203a;" glyph-name="guilsinglright" horiz-adv-x="590" d="M508 526L199 115L82 193L319 541L82 889L199 967L508 553V526Z" />
-</font>
-</defs>
-</svg>

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/swagger-ui/fonts/droid-sans-v6-latin-regular.ttf
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/swagger-ui/fonts/droid-sans-v6-latin-regular.ttf b/brooklyn-ui/src/main/webapp/assets/swagger-ui/fonts/droid-sans-v6-latin-regular.ttf
deleted file mode 100644
index fb8cea6..0000000
Binary files a/brooklyn-ui/src/main/webapp/assets/swagger-ui/fonts/droid-sans-v6-latin-regular.ttf and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/swagger-ui/fonts/droid-sans-v6-latin-regular.woff
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/swagger-ui/fonts/droid-sans-v6-latin-regular.woff b/brooklyn-ui/src/main/webapp/assets/swagger-ui/fonts/droid-sans-v6-latin-regular.woff
deleted file mode 100644
index abf1989..0000000
Binary files a/brooklyn-ui/src/main/webapp/assets/swagger-ui/fonts/droid-sans-v6-latin-regular.woff and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/swagger-ui/fonts/droid-sans-v6-latin-regular.woff2
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/swagger-ui/fonts/droid-sans-v6-latin-regular.woff2 b/brooklyn-ui/src/main/webapp/assets/swagger-ui/fonts/droid-sans-v6-latin-regular.woff2
deleted file mode 100644
index 9f93f74..0000000
Binary files a/brooklyn-ui/src/main/webapp/assets/swagger-ui/fonts/droid-sans-v6-latin-regular.woff2 and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/swagger-ui/images/explorer_icons.png
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/swagger-ui/images/explorer_icons.png b/brooklyn-ui/src/main/webapp/assets/swagger-ui/images/explorer_icons.png
deleted file mode 100644
index ed9d2ff..0000000
Binary files a/brooklyn-ui/src/main/webapp/assets/swagger-ui/images/explorer_icons.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/swagger-ui/images/pet_store_api.png
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/swagger-ui/images/pet_store_api.png b/brooklyn-ui/src/main/webapp/assets/swagger-ui/images/pet_store_api.png
deleted file mode 100644
index f9f9cd4..0000000
Binary files a/brooklyn-ui/src/main/webapp/assets/swagger-ui/images/pet_store_api.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/swagger-ui/images/throbber.gif
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/swagger-ui/images/throbber.gif b/brooklyn-ui/src/main/webapp/assets/swagger-ui/images/throbber.gif
deleted file mode 100644
index 0639388..0000000
Binary files a/brooklyn-ui/src/main/webapp/assets/swagger-ui/images/throbber.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/swagger-ui/images/wordnik_api.png
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/swagger-ui/images/wordnik_api.png b/brooklyn-ui/src/main/webapp/assets/swagger-ui/images/wordnik_api.png
deleted file mode 100644
index dca4f14..0000000
Binary files a/brooklyn-ui/src/main/webapp/assets/swagger-ui/images/wordnik_api.png and /dev/null differ


[26/51] [abbrv] [partial] brooklyn-ui git commit: move subdir from incubator up a level as it is promoted to its own repo (first non-incubator commit!)

Posted by he...@apache.org.
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/swagger-ui/lib/jquery-1.8.0.min.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/swagger-ui/lib/jquery-1.8.0.min.js b/brooklyn-ui/src/main/webapp/assets/swagger-ui/lib/jquery-1.8.0.min.js
deleted file mode 100644
index b724323..0000000
--- a/brooklyn-ui/src/main/webapp/assets/swagger-ui/lib/jquery-1.8.0.min.js
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/*! jQuery v@1.8.0 jquery.com | jquery.org/license */
-(function(a,b){function G(a){var b=F[a]={};return p.each(a.split(s),function(a,c){b[c]=!0}),b}function J(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(I,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:+d+""===d?+d:H.test(d)?p.parseJSON(d):d}catch(f){}p.data(a,c,d)}else d=b}return d}function K(a){var b;for(b in a){if(b==="data"&&p.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function ba(){return!1}function bb(){return!0}function bh(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function bi(a,b){do a=a[b];while(a&&a.nodeType!==1);return a}function bj(a,b,c){b=b||0;if(p.isFunction(b))return p.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return p.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=p.grep(a,function(a){return a.nodeType===1});if(be.test(b))return p.filter(b,d,!c);b=p.filter(b,d)}return p.grep(a,function(a,d){return p.inArray(
 a,b)>=0===c})}function bk(a){var b=bl.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function bC(a,b){return a.getElementsByTagName(b)[0]||a.appendChild(a.ownerDocument.createElement(b))}function bD(a,b){if(b.nodeType!==1||!p.hasData(a))return;var c,d,e,f=p._data(a),g=p._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;d<e;d++)p.event.add(b,c,h[c][d])}g.data&&(g.data=p.extend({},g.data))}function bE(a,b){var c;if(b.nodeType!==1)return;b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase(),c==="object"?(b.parentNode&&(b.outerHTML=a.outerHTML),p.support.html5Clone&&a.innerHTML&&!p.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):c==="input"&&bv.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):c==="option"?b.selected=a.defaultSelected:c==="input"||c==="textarea"?b.defaultValue=a.defaultValue:c==="scri
 pt"&&b.text!==a.text&&(b.text=a.text),b.removeAttribute(p.expando)}function bF(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bG(a){bv.test(a.type)&&(a.defaultChecked=a.checked)}function bX(a,b){if(b in a)return b;var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=bV.length;while(e--){b=bV[e]+c;if(b in a)return b}return d}function bY(a,b){return a=b||a,p.css(a,"display")==="none"||!p.contains(a.ownerDocument,a)}function bZ(a,b){var c,d,e=[],f=0,g=a.length;for(;f<g;f++){c=a[f];if(!c.style)continue;e[f]=p._data(c,"olddisplay"),b?(!e[f]&&c.style.display==="none"&&(c.style.display=""),c.style.display===""&&bY(c)&&(e[f]=p._data(c,"olddisplay",cb(c.nodeName)))):(d=bH(c,"display"),!e[f]&&d!=="none"&&p._data(c,"olddisplay",d))}for(f=0;f<g;f++){c=a[f];if(!c.style)continue;if(!b||c.style.display==="none"||c.style.display==="")c.style.display=b?e[f]||"":"none"}return a}function b$(a,b,c){
 var d=bO.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function b_(a,b,c,d){var e=c===(d?"border":"content")?4:b==="width"?1:0,f=0;for(;e<4;e+=2)c==="margin"&&(f+=p.css(a,c+bU[e],!0)),d?(c==="content"&&(f-=parseFloat(bH(a,"padding"+bU[e]))||0),c!=="margin"&&(f-=parseFloat(bH(a,"border"+bU[e]+"Width"))||0)):(f+=parseFloat(bH(a,"padding"+bU[e]))||0,c!=="padding"&&(f+=parseFloat(bH(a,"border"+bU[e]+"Width"))||0));return f}function ca(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=!0,f=p.support.boxSizing&&p.css(a,"boxSizing")==="border-box";if(d<=0){d=bH(a,b);if(d<0||d==null)d=a.style[b];if(bP.test(d))return d;e=f&&(p.support.boxSizingReliable||d===a.style[b]),d=parseFloat(d)||0}return d+b_(a,b,c||(f?"border":"content"),e)+"px"}function cb(a){if(bR[a])return bR[a];var b=p("<"+a+">").appendTo(e.body),c=b.css("display");b.remove();if(c==="none"||c===""){bI=e.body.appendChild(bI||p.extend(e.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!bJ||!bI.createEle
 ment)bJ=(bI.contentWindow||bI.contentDocument).document,bJ.write("<!doctype html><html><body>"),bJ.close();b=bJ.body.appendChild(bJ.createElement(a)),c=bH(b,"display"),e.body.removeChild(bI)}return bR[a]=c,c}function ch(a,b,c,d){var e;if(p.isArray(b))p.each(b,function(b,e){c||cd.test(a)?d(a,e):ch(a+"["+(typeof e=="object"?b:"")+"]",e,c,d)});else if(!c&&p.type(b)==="object")for(e in b)ch(a+"["+e+"]",b[e],c,d);else d(a,b)}function cy(a){return function(b,c){typeof b!="string"&&(c=b,b="*");var d,e,f,g=b.toLowerCase().split(s),h=0,i=g.length;if(p.isFunction(c))for(;h<i;h++)d=g[h],f=/^\+/.test(d),f&&(d=d.substr(1)||"*"),e=a[d]=a[d]||[],e[f?"unshift":"push"](c)}}function cz(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h,i=a[f],j=0,k=i?i.length:0,l=a===cu;for(;j<k&&(l||!h);j++)h=i[j](c,d,e),typeof h=="string"&&(!l||g[h]?h=b:(c.dataTypes.unshift(h),h=cz(a,c,d,e,h,g)));return(l||!h)&&!g["*"]&&(h=cz(a,c,d,e,"*",g)),h}function cA(a,c){var d,e,f=p.ajaxSettings.flatOptions||{};for(d in c
 )c[d]!==b&&((f[d]?a:e||(e={}))[d]=c[d]);e&&p.extend(!0,a,e)}function cB(a,c,d){var e,f,g,h,i=a.contents,j=a.dataTypes,k=a.responseFields;for(f in k)f in d&&(c[k[f]]=d[f]);while(j[0]==="*")j.shift(),e===b&&(e=a.mimeType||c.getResponseHeader("content-type"));if(e)for(f in i)if(i[f]&&i[f].test(e)){j.unshift(f);break}if(j[0]in d)g=j[0];else{for(f in d){if(!j[0]||a.converters[f+" "+j[0]]){g=f;break}h||(h=f)}g=g||h}if(g)return g!==j[0]&&j.unshift(g),d[g]}function cC(a,b){var c,d,e,f,g=a.dataTypes.slice(),h=g[0],i={},j=0;a.dataFilter&&(b=a.dataFilter(b,a.dataType));if(g[1])for(c in a.converters)i[c.toLowerCase()]=a.converters[c];for(;e=g[++j];)if(e!=="*"){if(h!=="*"&&h!==e){c=i[h+" "+e]||i["* "+e];if(!c)for(d in i){f=d.split(" ");if(f[1]===e){c=i[h+" "+f[0]]||i["* "+f[0]];if(c){c===!0?c=i[d]:i[d]!==!0&&(e=f[0],g.splice(j--,0,e));break}}}if(c!==!0)if(c&&a["throws"])b=c(b);else try{b=c(b)}catch(k){return{state:"parsererror",error:c?k:"No conversion from "+h+" to "+e}}}h=e}return{state:"succe
 ss",data:b}}function cK(){try{return new a.XMLHttpRequest}catch(b){}}function cL(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function cT(){return setTimeout(function(){cM=b},0),cM=p.now()}function cU(a,b){p.each(b,function(b,c){var d=(cS[b]||[]).concat(cS["*"]),e=0,f=d.length;for(;e<f;e++)if(d[e].call(a,b,c))return})}function cV(a,b,c){var d,e=0,f=0,g=cR.length,h=p.Deferred().always(function(){delete i.elem}),i=function(){var b=cM||cT(),c=Math.max(0,j.startTime+j.duration-b),d=1-(c/j.duration||0),e=0,f=j.tweens.length;for(;e<f;e++)j.tweens[e].run(d);return h.notifyWith(a,[j,d,c]),d<1&&f?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:p.extend({},b),opts:p.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:cM||cT(),duration:c.duration,tweens:[],createTween:function(b,c,d){var e=p.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(e),e},stop:function(b){var c=0,d=b?j.tweens.length:0;for(;c<d;c++)j.t
 weens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;cW(k,j.opts.specialEasing);for(;e<g;e++){d=cR[e].call(j,a,k,j.opts);if(d)return d}return cU(j,k),p.isFunction(j.opts.start)&&j.opts.start.call(a,j),p.fx.timer(p.extend(i,{anim:j,queue:j.opts.queue,elem:a})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}function cW(a,b){var c,d,e,f,g;for(c in a){d=p.camelCase(c),e=b[d],f=a[c],p.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=p.cssHooks[d];if(g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}}function cX(a,b,c){var d,e,f,g,h,i,j,k,l=this,m=a.style,n={},o=[],q=a.nodeType&&bY(a);c.queue||(j=p._queueHooks(a,"fx"),j.unqueued==null&&(j.unqueued=0,k=j.empty.fire,j.empty.fire=function(){j.unqueued||k()}),j.unqueued++,l.always(function(){l.always(function(){j.unqueued--,p.queue(a,"fx").length||j.empty.fire()})})),a.nodeType===1&&("height"in b||
 "width"in b)&&(c.overflow=[m.overflow,m.overflowX,m.overflowY],p.css(a,"display")==="inline"&&p.css(a,"float")==="none"&&(!p.support.inlineBlockNeedsLayout||cb(a.nodeName)==="inline"?m.display="inline-block":m.zoom=1)),c.overflow&&(m.overflow="hidden",p.support.shrinkWrapBlocks||l.done(function(){m.overflow=c.overflow[0],m.overflowX=c.overflow[1],m.overflowY=c.overflow[2]}));for(d in b){f=b[d];if(cO.exec(f)){delete b[d];if(f===(q?"hide":"show"))continue;o.push(d)}}g=o.length;if(g){h=p._data(a,"fxshow")||p._data(a,"fxshow",{}),q?p(a).show():l.done(function(){p(a).hide()}),l.done(function(){var b;p.removeData(a,"fxshow",!0);for(b in n)p.style(a,b,n[b])});for(d=0;d<g;d++)e=o[d],i=l.createTween(e,q?h[e]:0),n[e]=h[e]||p.style(a,e),e in h||(h[e]=i.start,q&&(i.end=i.start,i.start=e==="width"||e==="height"?1:0))}}function cY(a,b,c,d,e){return new cY.prototype.init(a,b,c,d,e)}function cZ(a,b){var c,d={height:a},e=0;for(;e<4;e+=2-b)c=bU[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d
 .width=a),d}function c_(a){return p.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}var c,d,e=a.document,f=a.location,g=a.navigator,h=a.jQuery,i=a.$,j=Array.prototype.push,k=Array.prototype.slice,l=Array.prototype.indexOf,m=Object.prototype.toString,n=Object.prototype.hasOwnProperty,o=String.prototype.trim,p=function(a,b){return new p.fn.init(a,b,c)},q=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,r=/\S/,s=/\s+/,t=r.test(" ")?/^[\s\xA0]+|[\s\xA0]+$/g:/^\s+|\s+$/g,u=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,y=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,z=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,A=/^-ms-/,B=/-([\da-z])/gi,C=function(a,b){return(b+"").toUpperCase()},D=function(){e.addEventListener?(e.removeEventListener("DOMContentLoaded",D,!1),p.ready()):e.readyState==="complete"&&(e.detachEvent("onreadystatechange",D),p.ready())},E={};p.fn=p.prototype={constructor:p,init:fu
 nction(a,c,d){var f,g,h,i;if(!a)return this;if(a.nodeType)return this.context=this[0]=a,this.length=1,this;if(typeof a=="string"){a.charAt(0)==="<"&&a.charAt(a.length-1)===">"&&a.length>=3?f=[null,a,null]:f=u.exec(a);if(f&&(f[1]||!c)){if(f[1])return c=c instanceof p?c[0]:c,i=c&&c.nodeType?c.ownerDocument||c:e,a=p.parseHTML(f[1],i,!0),v.test(f[1])&&p.isPlainObject(c)&&this.attr.call(a,c,!0),p.merge(this,a);g=e.getElementById(f[2]);if(g&&g.parentNode){if(g.id!==f[2])return d.find(a);this.length=1,this[0]=g}return this.context=e,this.selector=a,this}return!c||c.jquery?(c||d).find(a):this.constructor(c).find(a)}return p.isFunction(a)?d.ready(a):(a.selector!==b&&(this.selector=a.selector,this.context=a.context),p.makeArray(a,this))},selector:"",jquery:"1.8.0",length:0,size:function(){return this.length},toArray:function(){return k.call(this)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=p.merge(this.constructor(),a);return
  d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")"),d},each:function(a,b){return p.each(this,a,b)},ready:function(a){return p.ready.promise().done(a),this},eq:function(a){return a=+a,a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(k.apply(this,arguments),"slice",k.call(arguments).join(","))},map:function(a){return this.pushStack(p.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:j,sort:[].sort,splice:[].splice},p.fn.init.prototype=p.fn,p.extend=p.fn.extend=function(){var a,c,d,e,f,g,h=arguments[0]||{},i=1,j=arguments.length,k=!1;typeof h=="boolean"&&(k=h,h=arguments[1]||{},i=2),typeof h!="object"&&!p.isFunction(h)&&(h={}),j===i&&(h=this,--i);for(;i<j;i++)if((a=arguments[i])!=null)for(c in a){d=h[c],e=a[c];if(h===e)contin
 ue;k&&e&&(p.isPlainObject(e)||(f=p.isArray(e)))?(f?(f=!1,g=d&&p.isArray(d)?d:[]):g=d&&p.isPlainObject(d)?d:{},h[c]=p.extend(k,g,e)):e!==b&&(h[c]=e)}return h},p.extend({noConflict:function(b){return a.$===p&&(a.$=i),b&&a.jQuery===p&&(a.jQuery=h),p},isReady:!1,readyWait:1,holdReady:function(a){a?p.readyWait++:p.ready(!0)},ready:function(a){if(a===!0?--p.readyWait:p.isReady)return;if(!e.body)return setTimeout(p.ready,1);p.isReady=!0;if(a!==!0&&--p.readyWait>0)return;d.resolveWith(e,[p]),p.fn.trigger&&p(e).trigger("ready").off("ready")},isFunction:function(a){return p.type(a)==="function"},isArray:Array.isArray||function(a){return p.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):E[m.call(a)]||"object"},isPlainObject:function(a){if(!a||p.type(a)!=="object"||a.nodeType||p.isWindow(a))return!1;try{if(a.constructor&&!n.call(a,"constructor")&&!n.call(a.constructor.p
 rototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||n.call(a,d)},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},error:function(a){throw new Error(a)},parseHTML:function(a,b,c){var d;return!a||typeof a!="string"?null:(typeof b=="boolean"&&(c=b,b=0),b=b||e,(d=v.exec(a))?[b.createElement(d[1])]:(d=p.buildFragment([a],b,c?null:[]),p.merge([],(d.cacheable?p.clone(d.fragment):d.fragment).childNodes)))},parseJSON:function(b){if(!b||typeof b!="string")return null;b=p.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(w.test(b.replace(y,"@").replace(z,"]").replace(x,"")))return(new Function("return "+b))();p.error("Invalid JSON: "+b)},parseXML:function(c){var d,e;if(!c||typeof c!="string")return null;try{a.DOMParser?(e=new DOMParser,d=e.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(f){d=b}return(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&p.error("In
 valid XML: "+c),d},noop:function(){},globalEval:function(b){b&&r.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(A,"ms-").replace(B,C)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var e,f=0,g=a.length,h=g===b||p.isFunction(a);if(d){if(h){for(e in a)if(c.apply(a[e],d)===!1)break}else for(;f<g;)if(c.apply(a[f++],d)===!1)break}else if(h){for(e in a)if(c.call(a[e],e,a[e])===!1)break}else for(;f<g;)if(c.call(a[f],f,a[f++])===!1)break;return a},trim:o?function(a){return a==null?"":o.call(a)}:function(a){return a==null?"":a.toString().replace(t,"")},makeArray:function(a,b){var c,d=b||[];return a!=null&&(c=p.type(a),a.length==null||c==="string"||c==="function"||c==="regexp"||p.isWindow(a)?j.call(d,a):p.merge(d,a)),d},inArray:function(a,b,c){var d;if(b){if(l)return l.call(b,a,c);d=b.length,c=c?c<0?Math.max(0,d+c):c:0;for(;c<d;c++)if(c in b&&b[c]===a)return c}return-1},merge:functi
 on(a,c){var d=c.length,e=a.length,f=0;if(typeof d=="number")for(;f<d;f++)a[e++]=c[f];else while(c[f]!==b)a[e++]=c[f++];return a.length=e,a},grep:function(a,b,c){var d,e=[],f=0,g=a.length;c=!!c;for(;f<g;f++)d=!!b(a[f],f),c!==d&&e.push(a[f]);return e},map:function(a,c,d){var e,f,g=[],h=0,i=a.length,j=a instanceof p||i!==b&&typeof i=="number"&&(i>0&&a[0]&&a[i-1]||i===0||p.isArray(a));if(j)for(;h<i;h++)e=c(a[h],h,d),e!=null&&(g[g.length]=e);else for(f in a)e=c(a[f],f,d),e!=null&&(g[g.length]=e);return g.concat.apply([],g)},guid:1,proxy:function(a,c){var d,e,f;return typeof c=="string"&&(d=a[c],c=a,a=d),p.isFunction(a)?(e=k.call(arguments,2),f=function(){return a.apply(c,e.concat(k.call(arguments)))},f.guid=a.guid=a.guid||f.guid||p.guid++,f):b},access:function(a,c,d,e,f,g,h){var i,j=d==null,k=0,l=a.length;if(d&&typeof d=="object"){for(k in d)p.access(a,c,k,d[k],1,g,e);f=1}else if(e!==b){i=h===b&&p.isFunction(e),j&&(i?(i=c,c=function(a,b,c){return i.call(p(a),c)}):(c.call(a,e),c=null));if
 (c)for(;k<l;k++)c(a[k],d,i?e.call(a[k],k,c(a[k],d)):e,h);f=1}return f?a:j?c.call(a):l?c(a[0],d):g},now:function(){return(new Date).getTime()}}),p.ready.promise=function(b){if(!d){d=p.Deferred();if(e.readyState==="complete"||e.readyState!=="loading"&&e.addEventListener)setTimeout(p.ready,1);else if(e.addEventListener)e.addEventListener("DOMContentLoaded",D,!1),a.addEventListener("load",p.ready,!1);else{e.attachEvent("onreadystatechange",D),a.attachEvent("onload",p.ready);var c=!1;try{c=a.frameElement==null&&e.documentElement}catch(f){}c&&c.doScroll&&function g(){if(!p.isReady){try{c.doScroll("left")}catch(a){return setTimeout(g,50)}p.ready()}}()}}return d.promise(b)},p.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){E["[object "+b+"]"]=b.toLowerCase()}),c=p(e);var F={};p.Callbacks=function(a){a=typeof a=="string"?F[a]||G(a):p.extend({},a);var c,d,e,f,g,h,i=[],j=!a.once&&[],k=function(b){c=a.memory&&b,d=!0,h=f||0,f=0,g=i.length,e=!0;for(;i&&h<g;
 h++)if(i[h].apply(b[0],b[1])===!1&&a.stopOnFalse){c=!1;break}e=!1,i&&(j?j.length&&k(j.shift()):c?i=[]:l.disable())},l={add:function(){if(i){var b=i.length;(function d(b){p.each(b,function(b,c){p.isFunction(c)&&(!a.unique||!l.has(c))?i.push(c):c&&c.length&&d(c)})})(arguments),e?g=i.length:c&&(f=b,k(c))}return this},remove:function(){return i&&p.each(arguments,function(a,b){var c;while((c=p.inArray(b,i,c))>-1)i.splice(c,1),e&&(c<=g&&g--,c<=h&&h--)}),this},has:function(a){return p.inArray(a,i)>-1},empty:function(){return i=[],this},disable:function(){return i=j=c=b,this},disabled:function(){return!i},lock:function(){return j=b,c||l.disable(),this},locked:function(){return!j},fireWith:function(a,b){return b=b||[],b=[a,b.slice?b.slice():b],i&&(!d||j)&&(e?j.push(b):k(b)),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!d}};return l},p.extend({Deferred:function(a){var b=[["resolve","done",p.Callbacks("once memory"),"resolved"],["reject","fail",p.Callba
 cks("once memory"),"rejected"],["notify","progress",p.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return p.Deferred(function(c){p.each(b,function(b,d){var f=d[0],g=a[b];e[d[1]](p.isFunction(g)?function(){var a=g.apply(this,arguments);a&&p.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f+"With"](this===e?c:this,[a])}:c[f])}),a=null}).promise()},promise:function(a){return typeof a=="object"?p.extend(a,d):d}},e={};return d.pipe=d.then,p.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[a^1][2].disable,b[2][2].lock),e[f[0]]=g.fire,e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=k.call(arguments),d=c.length,e=d!==1||a&&p.isFunction(a.promise)?d:0,f=e===1?a:p.Deferred(),g=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?k.call(arguments):d,c===h?f.n
 otifyWith(b,c):--e||f.resolveWith(b,c)}},h,i,j;if(d>1){h=new Array(d),i=new Array(d),j=new Array(d);for(;b<d;b++)c[b]&&p.isFunction(c[b].promise)?c[b].promise().done(g(b,j,c)).fail(f.reject).progress(g(b,i,h)):--e}return e||f.resolveWith(j,c),f.promise()}}),p.support=function(){var b,c,d,f,g,h,i,j,k,l,m,n=e.createElement("div");n.setAttribute("className","t"),n.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",c=n.getElementsByTagName("*"),d=n.getElementsByTagName("a")[0],d.style.cssText="top:1px;float:left;opacity:.5";if(!c||!c.length||!d)return{};f=e.createElement("select"),g=f.appendChild(e.createElement("option")),h=n.getElementsByTagName("input")[0],b={leadingWhitespace:n.firstChild.nodeType===3,tbody:!n.getElementsByTagName("tbody").length,htmlSerialize:!!n.getElementsByTagName("link").length,style:/top/.test(d.getAttribute("style")),hrefNormalized:d.getAttribute("href")==="/a",opacity:/^0.5/.test(d.style.opacity),cssFloat:!!d.style.cssFloat,checkO
 n:h.value==="on",optSelected:g.selected,getSetAttribute:n.className!=="t",enctype:!!e.createElement("form").enctype,html5Clone:e.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",boxModel:e.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},h.checked=!0,b.noCloneChecked=h.cloneNode(!0).checked,f.disabled=!0,b.optDisabled=!g.disabled;try{delete n.test}catch(o){b.deleteExpando=!1}!n.addEventListener&&n.attachEvent&&n.fireEvent&&(n.attachEvent("onclick",m=function(){b.noCloneEvent=!1}),n.cloneNode(!0).fireEvent("onclick"),n.detachEvent("onclick",m)),h=e.createElement("input"),h.value="t",h.setAttribute("type","radio"),b.radioValue=h.value==="t",h.setAttribute("checked","checked"),h.setAttribute("name","t"),n.appendChild(h),i=e.createDocumentFragment(),i.appendChild(n.lastChild),b.checkClone=i.cloneNode(!0).c
 loneNode(!0).lastChild.checked,b.appendChecked=h.checked,i.removeChild(h),i.appendChild(n);if(n.attachEvent)for(k in{submit:!0,change:!0,focusin:!0})j="on"+k,l=j in n,l||(n.setAttribute(j,"return;"),l=typeof n[j]=="function"),b[k+"Bubbles"]=l;return p(function(){var c,d,f,g,h="padding:0;margin:0;border:0;display:block;overflow:hidden;",i=e.getElementsByTagName("body")[0];if(!i)return;c=e.createElement("div"),c.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",i.insertBefore(c,i.firstChild),d=e.createElement("div"),c.appendChild(d),d.innerHTML="<table><tr><td></td><td>t</td></tr></table>",f=d.getElementsByTagName("td"),f[0].style.cssText="padding:0;margin:0;border:0;display:none",l=f[0].offsetHeight===0,f[0].style.display="",f[1].style.display="none",b.reliableHiddenOffsets=l&&f[0].offsetHeight===0,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display
 :block;width:4px;margin-top:1%;position:absolute;top:1%;",b.boxSizing=d.offsetWidth===4,b.doesNotIncludeMarginInBodyOffset=i.offsetTop!==1,a.getComputedStyle&&(b.pixelPosition=(a.getComputedStyle(d,null)||{}).top!=="1%",b.boxSizingReliable=(a.getComputedStyle(d,null)||{width:"4px"}).width==="4px",g=e.createElement("div"),g.style.cssText=d.style.cssText=h,g.style.marginRight=g.style.width="0",d.style.width="1px",d.appendChild(g),b.reliableMarginRight=!parseFloat((a.getComputedStyle(g,null)||{}).marginRight)),typeof d.style.zoom!="undefined"&&(d.innerHTML="",d.style.cssText=h+"width:1px;padding:1px;display:inline;zoom:1",b.inlineBlockNeedsLayout=d.offsetWidth===3,d.style.display="block",d.style.overflow="visible",d.innerHTML="<div></div>",d.firstChild.style.width="5px",b.shrinkWrapBlocks=d.offsetWidth!==3,c.style.zoom=1),i.removeChild(c),c=d=f=g=null}),i.removeChild(n),c=d=f=g=h=i=n=null,b}();var H=/^(?:\{.*\}|\[.*\])$/,I=/([A-Z])/g;p.extend({cache:{},deletedIds:[],uuid:0,expando:"jQu
 ery"+(p.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){return a=a.nodeType?p.cache[a[p.expando]]:a[p.expando],!!a&&!K(a)},data:function(a,c,d,e){if(!p.acceptData(a))return;var f,g,h=p.expando,i=typeof c=="string",j=a.nodeType,k=j?p.cache:a,l=j?a[h]:a[h]&&h;if((!l||!k[l]||!e&&!k[l].data)&&i&&d===b)return;l||(j?a[h]=l=p.deletedIds.pop()||++p.uuid:l=h),k[l]||(k[l]={},j||(k[l].toJSON=p.noop));if(typeof c=="object"||typeof c=="function")e?k[l]=p.extend(k[l],c):k[l].data=p.extend(k[l].data,c);return f=k[l],e||(f.data||(f.data={}),f=f.data),d!==b&&(f[p.camelCase(c)]=d),i?(g=f[c],g==null&&(g=f[p.camelCase(c)])):g=f,g},removeData:function(a,b,c){if(!p.acceptData(a))return;var d,e,f,g=a.nodeType,h=g?p.cache:a,i=g?a[p.expando]:p.expando;if(!h[i])return;if(b){d=c?h[i]:h[i].data;if(d){p.isArray(b)||(b in d?b=[b]:(b=p.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,f=b.length;e<f;e++)delete d[b[e]];
 if(!(c?K:p.isEmptyObject)(d))return}}if(!c){delete h[i].data;if(!K(h[i]))return}g?p.cleanData([a],!0):p.support.deleteExpando||h!=h.window?delete h[i]:h[i]=null},_data:function(a,b,c){return p.data(a,b,c,!0)},acceptData:function(a){var b=a.nodeName&&p.noData[a.nodeName.toLowerCase()];return!b||b!==!0&&a.getAttribute("classid")===b}}),p.fn.extend({data:function(a,c){var d,e,f,g,h,i=this[0],j=0,k=null;if(a===b){if(this.length){k=p.data(i);if(i.nodeType===1&&!p._data(i,"parsedAttrs")){f=i.attributes;for(h=f.length;j<h;j++)g=f[j].name,g.indexOf("data-")===0&&(g=p.camelCase(g.substring(5)),J(i,g,k[g]));p._data(i,"parsedAttrs",!0)}}return k}return typeof a=="object"?this.each(function(){p.data(this,a)}):(d=a.split(".",2),d[1]=d[1]?"."+d[1]:"",e=d[1]+"!",p.access(this,function(c){if(c===b)return k=this.triggerHandler("getData"+e,[d[0]]),k===b&&i&&(k=p.data(i,a),k=J(i,a,k)),k===b&&d[1]?this.data(d[0]):k;d[1]=c,this.each(function(){var b=p(this);b.triggerHandler("setData"+e,d),p.data(this,a,
 c),b.triggerHandler("changeData"+e,d)})},null,c,arguments.length>1,null,!1))},removeData:function(a){return this.each(function(){p.removeData(this,a)})}}),p.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=p._data(a,b),c&&(!d||p.isArray(c)?d=p._data(a,b,p.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=p.queue(a,b),d=c.shift(),e=p._queueHooks(a,b),f=function(){p.dequeue(a,b)};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),delete e.stop,d.call(a,f,e)),!c.length&&e&&e.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return p._data(a,c)||p._data(a,c,{empty:p.Callbacks("once memory").add(function(){p.removeData(a,b+"queue",!0),p.removeData(a,c,!0)})})}}),p.fn.extend({queue:function(a,c){var d=2;return typeof a!="string"&&(c=a,a="fx",d--),arguments.length<d?p.queue(this[0],a):c===b?this:this.each(function(){var b=p.queue(this,a,c);p._queueHooks(this,a),a==="fx"&&b[0]!=="inprogress"&&p.dequeue(this,a)})},dequeue
 :function(a){return this.each(function(){p.dequeue(this,a)})},delay:function(a,b){return a=p.fx?p.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){var d,e=1,f=p.Deferred(),g=this,h=this.length,i=function(){--e||f.resolveWith(g,[g])};typeof a!="string"&&(c=a,a=b),a=a||"fx";while(h--)(d=p._data(g[h],a+"queueHooks"))&&d.empty&&(e++,d.empty.add(i));return i(),f.promise(c)}});var L,M,N,O=/[\t\r\n]/g,P=/\r/g,Q=/^(?:button|input)$/i,R=/^(?:button|input|object|select|textarea)$/i,S=/^a(?:rea|)$/i,T=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,U=p.support.getSetAttribute;p.fn.extend({attr:function(a,b){return p.access(this,p.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){p.removeAttr(this,a)})},prop:function(a,b){return p.access(this,p.pro
 p,a,b,arguments.length>1)},removeProp:function(a){return a=p.propFix[a]||a,this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,f,g,h;if(p.isFunction(a))return this.each(function(b){p(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(s);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{f=" "+e.className+" ";for(g=0,h=b.length;g<h;g++)~f.indexOf(" "+b[g]+" ")||(f+=b[g]+" ");e.className=p.trim(f)}}}return this},removeClass:function(a){var c,d,e,f,g,h,i;if(p.isFunction(a))return this.each(function(b){p(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(s);for(h=0,i=this.length;h<i;h++){e=this[h];if(e.nodeType===1&&e.className){d=(" "+e.className+" ").replace(O," ");for(f=0,g=c.length;f<g;f++)while(d.indexOf(" "+c[f]+" ")>-1)d=d.replace(" "+c[f]+" "," ");e.className=a?p.trim(d):""}}}return this},toggleCla
 ss:function(a,b){var c=typeof a,d=typeof b=="boolean";return p.isFunction(a)?this.each(function(c){p(this).toggleClass(a.call(this,c,this.className,b),b)}):this.each(function(){if(c==="string"){var e,f=0,g=p(this),h=b,i=a.split(s);while(e=i[f++])h=d?h:!g.hasClass(e),g[h?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&p._data(this,"__className__",this.className),this.className=this.className||a===!1?"":p._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c<d;c++)if(this[c].nodeType===1&&(" "+this[c].className+" ").replace(O," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e,f=this[0];if(!arguments.length){if(f)return c=p.valHooks[f.type]||p.valHooks[f.nodeName.toLowerCase()],c&&"get"in c&&(d=c.get(f,"value"))!==b?d:(d=f.value,typeof d=="string"?d.replace(P,""):d==null?"":d);return}return e=p.isFunction(a),this.each(function(d){var f,g=p(this);if(this.nodeType!==1)return;e?f=a.call(this,d,g.va
 l()):f=a,f==null?f="":typeof f=="number"?f+="":p.isArray(f)&&(f=p.map(f,function(a){return a==null?"":a+""})),c=p.valHooks[this.type]||p.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,f,"value")===b)this.value=f})}}),p.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,f=a.selectedIndex,g=[],h=a.options,i=a.type==="select-one";if(f<0)return null;c=i?f:0,d=i?f+1:h.length;for(;c<d;c++){e=h[c];if(e.selected&&(p.support.optDisabled?!e.disabled:e.getAttribute("disabled")===null)&&(!e.parentNode.disabled||!p.nodeName(e.parentNode,"optgroup"))){b=p(e).val();if(i)return b;g.push(b)}}return i&&!g.length&&h.length?p(h[f]).val():g},set:function(a,b){var c=p.makeArray(b);return p(a).find("option").each(function(){this.selected=p.inArray(p(this).val(),c)>=0}),c.length||(a.selectedIndex=-1),c}}},attrFn:{},attr:function(a,c,d,e){var f,g,h,i=a.nodeType;if(!a||i===3||i===8||i===2)return;
 if(e&&p.isFunction(p.fn[c]))return p(a)[c](d);if(typeof a.getAttribute=="undefined")return p.prop(a,c,d);h=i!==1||!p.isXMLDoc(a),h&&(c=c.toLowerCase(),g=p.attrHooks[c]||(T.test(c)?M:L));if(d!==b){if(d===null){p.removeAttr(a,c);return}return g&&"set"in g&&h&&(f=g.set(a,d,c))!==b?f:(a.setAttribute(c,""+d),d)}return g&&"get"in g&&h&&(f=g.get(a,c))!==null?f:(f=a.getAttribute(c),f===null?b:f)},removeAttr:function(a,b){var c,d,e,f,g=0;if(b&&a.nodeType===1){d=b.split(s);for(;g<d.length;g++)e=d[g],e&&(c=p.propFix[e]||e,f=T.test(e),f||p.attr(a,e,""),a.removeAttribute(U?e:c),f&&c in a&&(a[c]=!1))}},attrHooks:{type:{set:function(a,b){if(Q.test(a.nodeName)&&a.parentNode)p.error("type property can't be changed");else if(!p.support.radioValue&&b==="radio"&&p.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}},value:{get:function(a,b){return L&&p.nodeName(a,"button")?L.get(a,b):b in a?a.value:null},set:function(a,b,c){if(L&&p.nodeName(a,"button"))return L.set(a,b
 ,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e,f,g,h=a.nodeType;if(!a||h===3||h===8||h===2)return;return g=h!==1||!p.isXMLDoc(a),g&&(c=p.propFix[c]||c,f=p.propHooks[c]),d!==b?f&&"set"in f&&(e=f.set(a,d,c))!==b?e:a[c]=d:f&&"get"in f&&(e=f.get(a,c))!==null?e:a[c]},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):R.test(a.nodeName)||S.test(a.nodeName)&&a.href?0:b}}}}),M={get:function(a,c){var d,e=p.prop(a,c);return e===!0||typeof e!="boolean"&&(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;return b===!1?p.removeAttr(a,c):(d=p.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase())),c}},U||(N={name:!0,id:
 !0,coords:!0},L=p.valHooks.button={get:function(a,c){var d;return d=a.getAttributeNode(c),d&&(N[c]?d.value!=="":d.specified)?d.value:b},set:function(a,b,c){var d=a.getAttributeNode(c);return d||(d=e.createAttribute(c),a.setAttributeNode(d)),d.value=b+""}},p.each(["width","height"],function(a,b){p.attrHooks[b]=p.extend(p.attrHooks[b],{set:function(a,c){if(c==="")return a.setAttribute(b,"auto"),c}})}),p.attrHooks.contenteditable={get:L.get,set:function(a,b,c){b===""&&(b="false"),L.set(a,b,c)}}),p.support.hrefNormalized||p.each(["href","src","width","height"],function(a,c){p.attrHooks[c]=p.extend(p.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),p.support.style||(p.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),p.support.optSelected||(p.propHooks.selected=p.extend(p.propHooks.selected,{get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selec
 tedIndex),null}})),p.support.enctype||(p.propFix.enctype="encoding"),p.support.checkOn||p.each(["radio","checkbox"],function(){p.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),p.each(["radio","checkbox"],function(){p.valHooks[this]=p.extend(p.valHooks[this],{set:function(a,b){if(p.isArray(b))return a.checked=p.inArray(p(a).val(),b)>=0}})});var V=/^(?:textarea|input|select)$/i,W=/^([^\.]*|)(?:\.(.+)|)$/,X=/(?:^|\s)hover(\.\S+|)\b/,Y=/^key/,Z=/^(?:mouse|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=function(a){return p.event.special.hover?a:a.replace(X,"mouseenter$1 mouseleave$1")};p.event={add:function(a,c,d,e,f){var g,h,i,j,k,l,m,n,o,q,r;if(a.nodeType===3||a.nodeType===8||!c||!d||!(g=p._data(a)))return;d.handler&&(o=d,d=o.handler,f=o.selector),d.guid||(d.guid=p.guid++),i=g.events,i||(g.events=i={}),h=g.handle,h||(g.handle=h=function(a){return typeof p!="undefined"&&(!a||p.event.triggered!==a.type)?p.event.dispatch.apply(h.elem,argu
 ments):b},h.elem=a),c=p.trim(_(c)).split(" ");for(j=0;j<c.length;j++){k=W.exec(c[j])||[],l=k[1],m=(k[2]||"").split(".").sort(),r=p.event.special[l]||{},l=(f?r.delegateType:r.bindType)||l,r=p.event.special[l]||{},n=p.extend({type:l,origType:k[1],data:e,handler:d,guid:d.guid,selector:f,namespace:m.join(".")},o),q=i[l];if(!q){q=i[l]=[],q.delegateCount=0;if(!r.setup||r.setup.call(a,e,m,h)===!1)a.addEventListener?a.addEventListener(l,h,!1):a.attachEvent&&a.attachEvent("on"+l,h)}r.add&&(r.add.call(a,n),n.handler.guid||(n.handler.guid=d.guid)),f?q.splice(q.delegateCount++,0,n):q.push(n),p.event.global[l]=!0}a=null},global:{},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,q,r=p.hasData(a)&&p._data(a);if(!r||!(m=r.events))return;b=p.trim(_(b||"")).split(" ");for(f=0;f<b.length;f++){g=W.exec(b[f])||[],h=i=g[1],j=g[2];if(!h){for(h in m)p.event.remove(a,h+b[f],c,d,!0);continue}n=p.event.special[h]||{},h=(d?n.delegateType:n.bindType)||h,o=m[h]||[],k=o.length,j=j?new RegExp("(^|\\.)"+j.split(
 ".").sort().join("\\.(?:.*\\.|)")+"(\\.|$)"):null;for(l=0;l<o.length;l++)q=o[l],(e||i===q.origType)&&(!c||c.guid===q.guid)&&(!j||j.test(q.namespace))&&(!d||d===q.selector||d==="**"&&q.selector)&&(o.splice(l--,1),q.selector&&o.delegateCount--,n.remove&&n.remove.call(a,q));o.length===0&&k!==o.length&&((!n.teardown||n.teardown.call(a,j,r.handle)===!1)&&p.removeEvent(a,h,r.handle),delete m[h])}p.isEmptyObject(m)&&(delete r.handle,p.removeData(a,"events",!0))},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,f,g){if(!f||f.nodeType!==3&&f.nodeType!==8){var h,i,j,k,l,m,n,o,q,r,s=c.type||c,t=[];if($.test(s+p.event.triggered))return;s.indexOf("!")>=0&&(s=s.slice(0,-1),i=!0),s.indexOf(".")>=0&&(t=s.split("."),s=t.shift(),t.sort());if((!f||p.event.customEvent[s])&&!p.event.global[s])return;c=typeof c=="object"?c[p.expando]?c:new p.Event(s,c):new p.Event(s),c.type=s,c.isTrigger=!0,c.exclusive=i,c.namespace=t.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+t.join(
 "\\.(?:.*\\.|)")+"(\\.|$)"):null,m=s.indexOf(":")<0?"on"+s:"";if(!f){h=p.cache;for(j in h)h[j].events&&h[j].events[s]&&p.event.trigger(c,d,h[j].handle.elem,!0);return}c.result=b,c.target||(c.target=f),d=d!=null?p.makeArray(d):[],d.unshift(c),n=p.event.special[s]||{};if(n.trigger&&n.trigger.apply(f,d)===!1)return;q=[[f,n.bindType||s]];if(!g&&!n.noBubble&&!p.isWindow(f)){r=n.delegateType||s,k=$.test(r+s)?f:f.parentNode;for(l=f;k;k=k.parentNode)q.push([k,r]),l=k;l===(f.ownerDocument||e)&&q.push([l.defaultView||l.parentWindow||a,r])}for(j=0;j<q.length&&!c.isPropagationStopped();j++)k=q[j][0],c.type=q[j][1],o=(p._data(k,"events")||{})[c.type]&&p._data(k,"handle"),o&&o.apply(k,d),o=m&&k[m],o&&p.acceptData(k)&&o.apply(k,d)===!1&&c.preventDefault();return c.type=s,!g&&!c.isDefaultPrevented()&&(!n._default||n._default.apply(f.ownerDocument,d)===!1)&&(s!=="click"||!p.nodeName(f,"a"))&&p.acceptData(f)&&m&&f[s]&&(s!=="focus"&&s!=="blur"||c.target.offsetWidth!==0)&&!p.isWindow(f)&&(l=f[m],l&&(f[
 m]=null),p.event.triggered=s,f[s](),p.event.triggered=b,l&&(f[m]=l)),c.result}return},dispatch:function(c){c=p.event.fix(c||a.event);var d,e,f,g,h,i,j,k,l,m,n,o=(p._data(this,"events")||{})[c.type]||[],q=o.delegateCount,r=[].slice.call(arguments),s=!c.exclusive&&!c.namespace,t=p.event.special[c.type]||{},u=[];r[0]=c,c.delegateTarget=this;if(t.preDispatch&&t.preDispatch.call(this,c)===!1)return;if(q&&(!c.button||c.type!=="click")){g=p(this),g.context=this;for(f=c.target;f!=this;f=f.parentNode||this)if(f.disabled!==!0||c.type!=="click"){i={},k=[],g[0]=f;for(d=0;d<q;d++)l=o[d],m=l.selector,i[m]===b&&(i[m]=g.is(m)),i[m]&&k.push(l);k.length&&u.push({elem:f,matches:k})}}o.length>q&&u.push({elem:this,matches:o.slice(q)});for(d=0;d<u.length&&!c.isPropagationStopped();d++){j=u[d],c.currentTarget=j.elem;for(e=0;e<j.matches.length&&!c.isImmediatePropagationStopped();e++){l=j.matches[e];if(s||!c.namespace&&!l.namespace||c.namespace_re&&c.namespace_re.test(l.namespace))c.data=l.data,c.handleObj=
 l,h=((p.event.special[l.origType]||{}).handle||l.handler).apply(j.elem,r),h!==b&&(c.result=h,h===!1&&(c.preventDefault(),c.stopPropagation()))}}return t.postDispatch&&t.postDispatch.call(this,c),c.result},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,c){var d,f,g,h=c.button,i=c.fromElement;return a.pageX==null&&c.clientX!=null&&(d=a.target.ownerDocument||e,f=d.documentElement,g=d.body,a.pageX=c.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=c.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&
 &g.clientTop||0)),!a.relatedTarget&&i&&(a.relatedTarget=i===a.target?c.toElement:i),!a.which&&h!==b&&(a.which=h&1?1:h&2?3:h&4?2:0),a}},fix:function(a){if(a[p.expando])return a;var b,c,d=a,f=p.event.fixHooks[a.type]||{},g=f.props?this.props.concat(f.props):this.props;a=p.Event(d);for(b=g.length;b;)c=g[--b],a[c]=d[c];return a.target||(a.target=d.srcElement||e),a.target.nodeType===3&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,f.filter?f.filter(a,d):a},special:{ready:{setup:p.bindReady},load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(a,b,c){p.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){var e=p.extend(new p.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?p.event.trigger(e,null,b):p.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},p.event.handle=p.event.dispatch,p.removeEvent=e.removeEventList
 ener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){var d="on"+b;a.detachEvent&&(typeof a[d]=="undefined"&&(a[d]=null),a.detachEvent(d,c))},p.Event=function(a,b){if(this instanceof p.Event)a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?bb:ba):this.type=a,b&&p.extend(this,b),this.timeStamp=a&&a.timeStamp||p.now(),this[p.expando]=!0;else return new p.Event(a,b)},p.Event.prototype={preventDefault:function(){this.isDefaultPrevented=bb;var a=this.originalEvent;if(!a)return;a.preventDefault?a.preventDefault():a.returnValue=!1},stopPropagation:function(){this.isPropagationStopped=bb;var a=this.originalEvent;if(!a)return;a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=bb,this.stopPropagation()},isDefaultPrevented:ba,isPropagationStopped:ba,isImmediatePropagationStop
 ped:ba},p.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){p.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj,g=f.selector;if(!e||e!==d&&!p.contains(d,e))a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b;return c}}}),p.support.submitBubbles||(p.event.special.submit={setup:function(){if(p.nodeName(this,"form"))return!1;p.event.add(this,"click._submit keypress._submit",function(a){var c=a.target,d=p.nodeName(c,"input")||p.nodeName(c,"button")?c.form:b;d&&!p._data(d,"_submit_attached")&&(p.event.add(d,"submit._submit",function(a){a._submit_bubble=!0}),p._data(d,"_submit_attached",!0))})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&p.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){if(p.nodeName(this,"form"))return!1;p.event.remove(this,"._submit")}}),p.support.changeBubbles||(p.event.special.change={setup:function(){if(V.test(t
 his.nodeName)){if(this.type==="checkbox"||this.type==="radio")p.event.add(this,"propertychange._change",function(a){a.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),p.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1),p.event.simulate("change",this,a,!0)});return!1}p.event.add(this,"beforeactivate._change",function(a){var b=a.target;V.test(b.nodeName)&&!p._data(b,"_change_attached")&&(p.event.add(b,"change._change",function(a){this.parentNode&&!a.isSimulated&&!a.isTrigger&&p.event.simulate("change",this.parentNode,a,!0)}),p._data(b,"_change_attached",!0))})},handle:function(a){var b=a.target;if(this!==b||a.isSimulated||a.isTrigger||b.type!=="radio"&&b.type!=="checkbox")return a.handleObj.handler.apply(this,arguments)},teardown:function(){return p.event.remove(this,"._change"),V.test(this.nodeName)}}),p.support.focusinBubbles||p.each({focus:"focusin",blur:"focusout"},function(a,b){var c=0,d=function(a){p.event.simul
 ate(b,a.target,p.event.fix(a),!0)};p.event.special[b]={setup:function(){c++===0&&e.addEventListener(a,d,!0)},teardown:function(){--c===0&&e.removeEventListener(a,d,!0)}}}),p.fn.extend({on:function(a,c,d,e,f){var g,h;if(typeof a=="object"){typeof c!="string"&&(d=d||c,c=b);for(h in a)this.on(h,c,d,a[h],f);return this}d==null&&e==null?(e=c,d=c=b):e==null&&(typeof c=="string"?(e=d,d=b):(e=d,d=c,c=b));if(e===!1)e=ba;else if(!e)return this;return f===1&&(g=e,e=function(a){return p().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=p.guid++)),this.each(function(){p.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,c,d){var e,f;if(a&&a.preventDefault&&a.handleObj)return e=a.handleObj,p(a.delegateTarget).off(e.namespace?e.origType+"."+e.namespace:e.origType,e.selector,e.handler),this;if(typeof a=="object"){for(f in a)this.off(f,c,a[f]);return this}if(c===!1||typeof c=="function")d=c,c=b;return d===!1&&(d=ba),this.each(function(){p.event.remove(t
 his,a,d,c)})},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},live:function(a,b,c){return p(this.context).on(a,this.selector,b,c),this},die:function(a,b){return p(this.context).off(a,this.selector||"**",b),this},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return arguments.length==1?this.off(a,"**"):this.off(b,a||"**",c)},trigger:function(a,b){return this.each(function(){p.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return p.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||p.guid++,d=0,e=function(c){var e=(p._data(this,"lastToggle"+a.guid)||0)%d;return p._data(this,"lastToggle"+a.guid,e+1),c.preventDefault(),b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),p.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown m
 ouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){p.fn[b]=function(a,c){return c==null&&(c=a,a=null),arguments.length>0?this.on(b,null,a,c):this.trigger(b)},Y.test(b)&&(p.event.fixHooks[b]=p.event.keyHooks),Z.test(b)&&(p.event.fixHooks[b]=p.event.mouseHooks)}),function(a,b){function bd(a,b,c,d){var e=0,f=b.length;for(;e<f;e++)Z(a,b[e],c,d)}function be(a,b,c,d,e,f){var g,h=$.setFilters[b.toLowerCase()];return h||Z.error(b),(a||!(g=e))&&bd(a||"*",d,g=[],e),g.length>0?h(g,c,f):[]}function bf(a,c,d,e,f){var g,h,i,j,k,l,m,n,p=0,q=f.length,s=L.POS,t=new RegExp("^"+s.source+"(?!"+r+")","i"),u=function(){var a=1,c=arguments.length-2;for(;a<c;a++)arguments[a]===b&&(g[a]=b)};for(;p<q;p++){s.exec(""),a=f[p],j=[],i=0,k=e;while(g=s.exec(a)){n=s.lastIndex=g.index+g[0].length;if(n>i){m=a.slice(i,g.index),i=n,l=[c],B.test(m)&&(k&&(l=k),k=e);if(h=H.test(m))m=m.slice(0,-5).replace(B,"$&*");g.length>1&&g[0]
 .replace(t,u),k=be(m,g[1],g[2],l,k,h)}}k?(j=j.concat(k),(m=a.slice(i))&&m!==")"?B.test(m)?bd(m,j,d,e):Z(m,c,d,e?e.concat(k):k):o.apply(d,j)):Z(a,c,d,e)}return q===1?d:Z.uniqueSort(d)}function bg(a,b,c){var d,e,f,g=[],i=0,j=D.exec(a),k=!j.pop()&&!j.pop(),l=k&&a.match(C)||[""],m=$.preFilter,n=$.filter,o=!c&&b!==h;for(;(e=l[i])!=null&&k;i++){g.push(d=[]),o&&(e=" "+e);while(e){k=!1;if(j=B.exec(e))e=e.slice(j[0].length),k=d.push({part:j.pop().replace(A," "),captures:j});for(f in n)(j=L[f].exec(e))&&(!m[f]||(j=m[f](j,b,c)))&&(e=e.slice(j.shift().length),k=d.push({part:f,captures:j}));if(!k)break}}return k||Z.error(a),g}function bh(a,b,e){var f=b.dir,g=m++;return a||(a=function(a){return a===e}),b.first?function(b,c){while(b=b[f])if(b.nodeType===1)return a(b,c)&&b}:function(b,e){var h,i=g+"."+d,j=i+"."+c;while(b=b[f])if(b.nodeType===1){if((h=b[q])===j)return b.sizset;if(typeof h=="string"&&h.indexOf(i)===0){if(b.sizset)return b}else{b[q]=j;if(a(b,e))return b.sizset=!0,b;b.sizset=!1}}}}func
 tion bi(a,b){return a?function(c,d){var e=b(c,d);return e&&a(e===!0?c:e,d)}:b}function bj(a,b,c){var d,e,f=0;for(;d=a[f];f++)$.relative[d.part]?e=bh(e,$.relative[d.part],b):(d.captures.push(b,c),e=bi(e,$.filter[d.part].apply(null,d.captures)));return e}function bk(a){return function(b,c){var d,e=0;for(;d=a[e];e++)if(d(b,c))return!0;return!1}}var c,d,e,f,g,h=a.document,i=h.documentElement,j="undefined",k=!1,l=!0,m=0,n=[].slice,o=[].push,q=("sizcache"+Math.random()).replace(".",""),r="[\\x20\\t\\r\\n\\f]",s="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",t=s.replace("w","w#"),u="([*^$|!~]?=)",v="\\["+r+"*("+s+")"+r+"*(?:"+u+r+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+t+")|)|)"+r+"*\\]",w=":("+s+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|((?:[^,]|\\\\,|(?:,(?=[^\\[]*\\]))|(?:,(?=[^\\(]*\\))))*))\\)|)",x=":(nth|eq|gt|lt|first|last|even|odd)(?:\\((\\d*)\\)|)(?=[^-]|$)",y=r+"*([\\x20\\t\\r\\n\\f>+~])"+r+"*",z="(?=[^\\x20\\t\\r\\n\\f])(?:\\\\.|"+v+"|"+w.replace(2,7)+"|[^\\\\(),])+",A=new RegExp("^"+r+"+|
 ((?:^|[^\\\\])(?:\\\\.)*)"+r+"+$","g"),B=new RegExp("^"+y),C=new RegExp(z+"?(?="+r+"*,|$)","g"),D=new RegExp("^(?:(?!,)(?:(?:^|,)"+r+"*"+z+")*?|"+r+"*(.*?))(\\)|$)"),E=new RegExp(z.slice(19,-6)+"\\x20\\t\\r\\n\\f>+~])+|"+y,"g"),F=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,G=/[\x20\t\r\n\f]*[+~]/,H=/:not\($/,I=/h\d/i,J=/input|select|textarea|button/i,K=/\\(?!\\)/g,L={ID:new RegExp("^#("+s+")"),CLASS:new RegExp("^\\.("+s+")"),NAME:new RegExp("^\\[name=['\"]?("+s+")['\"]?\\]"),TAG:new RegExp("^("+s.replace("[-","[-\\*")+")"),ATTR:new RegExp("^"+v),PSEUDO:new RegExp("^"+w),CHILD:new RegExp("^:(only|nth|last|first)-child(?:\\("+r+"*(even|odd|(([+-]|)(\\d*)n|)"+r+"*(?:([+-]|)"+r+"*(\\d+)|))"+r+"*\\)|)","i"),POS:new RegExp(x,"ig"),needsContext:new RegExp("^"+r+"*[>+~]|"+x,"i")},M={},N=[],O={},P=[],Q=function(a){return a.sizzleFilter=!0,a},R=function(a){return function(b){return b.nodeName.toLowerCase()==="input"&&b.type===a}},S=function(a){return function(b){var c=b.nodeName.toLowerCase();return
 (c==="input"||c==="button")&&b.type===a}},T=function(a){var b=!1,c=h.createElement("div");try{b=a(c)}catch(d){}return c=null,b},U=T(function(a){a.innerHTML="<select></select>";var b=typeof a.lastChild.getAttribute("multiple");return b!=="boolean"&&b!=="string"}),V=T(function(a){a.id=q+0,a.innerHTML="<a name='"+q+"'></a><div name='"+q+"'></div>",i.insertBefore(a,i.firstChild);var b=h.getElementsByName&&h.getElementsByName(q).length===2+h.getElementsByName(q+0).length;return g=!h.getElementById(q),i.removeChild(a),b}),W=T(function(a){return a.appendChild(h.createComment("")),a.getElementsByTagName("*").length===0}),X=T(function(a){return a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!==j&&a.firstChild.getAttribute("href")==="#"}),Y=T(function(a){return a.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",!a.getElementsByClassName||a.getElementsByClassName("e").length===0?!1:(a.lastChild.className="e",a.getElementsByClassName("e").length!=
 =1)}),Z=function(a,b,c,d){c=c||[],b=b||h;var e,f,g,i,j=b.nodeType;if(j!==1&&j!==9)return[];if(!a||typeof a!="string")return c;g=ba(b);if(!g&&!d)if(e=F.exec(a))if(i=e[1]){if(j===9){f=b.getElementById(i);if(!f||!f.parentNode)return c;if(f.id===i)return c.push(f),c}else if(b.ownerDocument&&(f=b.ownerDocument.getElementById(i))&&bb(b,f)&&f.id===i)return c.push(f),c}else{if(e[2])return o.apply(c,n.call(b.getElementsByTagName(a),0)),c;if((i=e[3])&&Y&&b.getElementsByClassName)return o.apply(c,n.call(b.getElementsByClassName(i),0)),c}return bm(a,b,c,d,g)},$=Z.selectors={cacheLength:50,match:L,order:["ID","TAG"],attrHandle:{},createPseudo:Q,find:{ID:g?function(a,b,c){if(typeof b.getElementById!==j&&!c){var d=b.getElementById(a);return d&&d.parentNode?[d]:[]}}:function(a,c,d){if(typeof c.getElementById!==j&&!d){var e=c.getElementById(a);return e?e.id===a||typeof e.getAttributeNode!==j&&e.getAttributeNode("id").value===a?[e]:b:[]}},TAG:W?function(a,b){if(typeof b.getElementsByTagName!==j)retur
 n b.getElementsByTagName(a)}:function(a,b){var c=b.getElementsByTagName(a);if(a==="*"){var d,e=[],f=0;for(;d=c[f];f++)d.nodeType===1&&e.push(d);return e}return c}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(K,""),a[3]=(a[4]||a[5]||"").replace(K,""),a[2]==="~="&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),a[1]==="nth"?(a[2]||Z.error(a[0]),a[3]=+(a[3]?a[4]+(a[5]||1):2*(a[2]==="even"||a[2]==="odd")),a[4]=+(a[6]+a[7]||a[2]==="odd")):a[2]&&Z.error(a[0]),a},PSEUDO:function(a){var b,c=a[4];return L.CHILD.test(a[0])?null:(c&&(b=D.exec(c))&&b.pop()&&(a[0]=a[0].slice(0,b[0].length-c.length-1),c=b[0].slice(0,-1)),a.splice(2,3,c||a[3]),a)}},filter:{ID:g?function(a){return a=a.replace(K,""),function(b){return b.getAttribute("id")===a}}:function(a){return a=a.replace(K,""),function(b){var c=typeof b.getAttributeNode!==j
 &&b.getAttributeNode("id");return c&&c.value===a}},TAG:function(a){return a==="*"?function(){return!0}:(a=a.replace(K,"").toLowerCase(),function(b){return b.nodeName&&b.nodeName.toLowerCase()===a})},CLASS:function(a){var b=M[a];return b||(b=M[a]=new RegExp("(^|"+r+")"+a+"("+r+"|$)"),N.push(a),N.length>$.cacheLength&&delete M[N.shift()]),function(a){return b.test(a.className||typeof a.getAttribute!==j&&a.getAttribute("class")||"")}},ATTR:function(a,b,c){return b?function(d){var e=Z.attr(d,a),f=e+"";if(e==null)return b==="!=";switch(b){case"=":return f===c;case"!=":return f!==c;case"^=":return c&&f.indexOf(c)===0;case"*=":return c&&f.indexOf(c)>-1;case"$=":return c&&f.substr(f.length-c.length)===c;case"~=":return(" "+f+" ").indexOf(c)>-1;case"|=":return f===c||f.substr(0,c.length+1)===c+"-"}}:function(b){return Z.attr(b,a)!=null}},CHILD:function(a,b,c,d){if(a==="nth"){var e=m++;return function(a){var b,f,g=0,h=a;if(c===1&&d===0)return!0;b=a.parentNode;if(b&&(b[q]!==e||!a.sizset)){for(
 h=b.firstChild;h;h=h.nextSibling)if(h.nodeType===1){h.sizset=++g;if(h===a)break}b[q]=e}return f=a.sizset-d,c===0?f===0:f%c===0&&f/c>=0}}return function(b){var c=b;switch(a){case"only":case"first":while(c=c.previousSibling)if(c.nodeType===1)return!1;if(a==="first")return!0;c=b;case"last":while(c=c.nextSibling)if(c.nodeType===1)return!1;return!0}}},PSEUDO:function(a,b,c,d){var e=$.pseudos[a]||$.pseudos[a.toLowerCase()];return e||Z.error("unsupported pseudo: "+a),e.sizzleFilter?e(b,c,d):e}},pseudos:{not:Q(function(a,b,c){var d=bl(a.replace(A,"$1"),b,c);return function(a){return!d(a)}}),enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&!!a.checked||b==="option"&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},parent:function(a){return!$.pseudos.empty(a)},empty:function(a){var b;a=a.firstChild;while(a){if(a.nodeName>"@"||(b=a.no
 deType)===3||b===4)return!1;a=a.nextSibling}return!0},contains:Q(function(a){return function(b){return(b.textContent||b.innerText||bc(b)).indexOf(a)>-1}}),has:Q(function(a){return function(b){return Z(a,b).length>0}}),header:function(a){return I.test(a.nodeName)},text:function(a){var b,c;return a.nodeName.toLowerCase()==="input"&&(b=a.type)==="text"&&((c=a.getAttribute("type"))==null||c.toLowerCase()===b)},radio:R("radio"),checkbox:R("checkbox"),file:R("file"),password:R("password"),image:R("image"),submit:S("submit"),reset:S("reset"),button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&a.type==="button"||b==="button"},input:function(a){return J.test(a.nodeName)},focus:function(a){var b=a.ownerDocument;return a===b.activeElement&&(!b.hasFocus||b.hasFocus())&&(!!a.type||!!a.href)},active:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b,c){return c?a.slice(1):[a[0]]},last:function(a,b,c){var d=a.pop();return c?a:[d]},even:function(
 a,b,c){var d=[],e=c?1:0,f=a.length;for(;e<f;e=e+2)d.push(a[e]);return d},odd:function(a,b,c){var d=[],e=c?0:1,f=a.length;for(;e<f;e=e+2)d.push(a[e]);return d},lt:function(a,b,c){return c?a.slice(+b):a.slice(0,+b)},gt:function(a,b,c){return c?a.slice(0,+b+1):a.slice(+b+1)},eq:function(a,b,c){var d=a.splice(+b,1);return c?a:d}}};$.setFilters.nth=$.setFilters.eq,$.filters=$.pseudos,X||($.attrHandle={href:function(a){return a.getAttribute("href",2)},type:function(a){return a.getAttribute("type")}}),V&&($.order.push("NAME"),$.find.NAME=function(a,b){if(typeof b.getElementsByName!==j)return b.getElementsByName(a)}),Y&&($.order.splice(1,0,"CLASS"),$.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!==j&&!c)return b.getElementsByClassName(a)});try{n.call(i.childNodes,0)[0].nodeType}catch(_){n=function(a){var b,c=[];for(;b=this[a];a++)c.push(b);return c}}var ba=Z.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?b.nodeName!=="HTML":!1},bb=Z.contains=i.compa
 reDocumentPosition?function(a,b){return!!(a.compareDocumentPosition(b)&16)}:i.contains?function(a,b){var c=a.nodeType===9?a.documentElement:a,d=b.parentNode;return a===d||!!(d&&d.nodeType===1&&c.contains&&c.contains(d))}:function(a,b){while(b=b.parentNode)if(b===a)return!0;return!1},bc=Z.getText=function(a){var b,c="",d=0,e=a.nodeType;if(e){if(e===1||e===9||e===11){if(typeof a.textContent=="string")return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=bc(a)}else if(e===3||e===4)return a.nodeValue}else for(;b=a[d];d++)c+=bc(b);return c};Z.attr=function(a,b){var c,d=ba(a);return d||(b=b.toLowerCase()),$.attrHandle[b]?$.attrHandle[b](a):U||d?a.getAttribute(b):(c=a.getAttributeNode(b),c?typeof a[b]=="boolean"?a[b]?b:null:c.specified?c.value:null:null)},Z.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},[0,0].sort(function(){return l=0}),i.compareDocumentPosition?e=function(a,b){return a===b?(k=!0,0):(!a.compareDocumentPosition||!b.compareDocumentPos
 ition?a.compareDocumentPosition:a.compareDocumentPosition(b)&4)?-1:1}:(e=function(a,b){if(a===b)return k=!0,0;if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],g=[],h=a.parentNode,i=b.parentNode,j=h;if(h===i)return f(a,b);if(!h)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)g.unshift(j),j=j.parentNode;c=e.length,d=g.length;for(var l=0;l<c&&l<d;l++)if(e[l]!==g[l])return f(e[l],g[l]);return l===c?f(a,g[l],-1):f(e[l],b,1)},f=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),Z.uniqueSort=function(a){var b,c=1;if(e){k=l,a.sort(e);if(k)for(;b=a[c];c++)b===a[c-1]&&a.splice(c--,1)}return a};var bl=Z.compile=function(a,b,c){var d,e,f,g=O[a];if(g&&g.context===b)return g;e=bg(a,b,c);for(f=0;d=e[f];f++)e[f]=bj(d,b,c);return g=O[a]=bk(e),g.context=b,g.runs=g.dirruns=0,P.push(a),P.length>$.cacheLength&&delete O[P.shift()],g};Z.matches=function(a,b){return Z(a,null,null,b)},Z.matchesSel
 ector=function(a,b){return Z(b,null,null,[a]).length>0};var bm=function(a,b,e,f,g){a=a.replace(A,"$1");var h,i,j,k,l,m,p,q,r,s=a.match(C),t=a.match(E),u=b.nodeType;if(L.POS.test(a))return bf(a,b,e,f,s);if(f)h=n.call(f,0);else if(s&&s.length===1){if(t.length>1&&u===9&&!g&&(s=L.ID.exec(t[0]))){b=$.find.ID(s[1],b,g)[0];if(!b)return e;a=a.slice(t.shift().length)}q=(s=G.exec(t[0]))&&!s.index&&b.parentNode||b,r=t.pop(),m=r.split(":not")[0];for(j=0,k=$.order.length;j<k;j++){p=$.order[j];if(s=L[p].exec(m)){h=$.find[p]((s[1]||"").replace(K,""),q,g);if(h==null)continue;m===r&&(a=a.slice(0,a.length-r.length)+m.replace(L[p],""),a||o.apply(e,n.call(h,0)));break}}}if(a){i=bl(a,b,g),d=i.dirruns++,h==null&&(h=$.find.TAG("*",G.test(a)&&b.parentNode||b));for(j=0;l=h[j];j++)c=i.runs++,i(l,b)&&e.push(l)}return e};h.querySelectorAll&&function(){var a,b=bm,c=/'|\\/g,d=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,e=[],f=[":active"],g=i.matchesSelector||i.mozMatchesSelector||i.webkitMatchesSelector||i.o
 MatchesSelector||i.msMatchesSelector;T(function(a){a.innerHTML="<select><option selected></option></select>",a.querySelectorAll("[selected]").length||e.push("\\["+r+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),a.querySelectorAll(":checked").length||e.push(":checked")}),T(function(a){a.innerHTML="<p test=''></p>",a.querySelectorAll("[test^='']").length&&e.push("[*^$]="+r+"*(?:\"\"|'')"),a.innerHTML="<input type='hidden'>",a.querySelectorAll(":enabled").length||e.push(":enabled",":disabled")}),e=e.length&&new RegExp(e.join("|")),bm=function(a,d,f,g,h){if(!g&&!h&&(!e||!e.test(a)))if(d.nodeType===9)try{return o.apply(f,n.call(d.querySelectorAll(a),0)),f}catch(i){}else if(d.nodeType===1&&d.nodeName.toLowerCase()!=="object"){var j=d.getAttribute("id"),k=j||q,l=G.test(a)&&d.parentNode||d;j?k=k.replace(c,"\\$&"):d.setAttribute("id",k);try{return o.apply(f,n.call(l.querySelectorAll(a.replace(C,"[id='"+k+"'] $&")),0)),f}catch(i){}finally{j||d.removeAttribute("id")}}return b
 (a,d,f,g,h)},g&&(T(function(b){a=g.call(b,"div");try{g.call(b,"[test!='']:sizzle"),f.push($.match.PSEUDO)}catch(c){}}),f=new RegExp(f.join("|")),Z.matchesSelector=function(b,c){c=c.replace(d,"='$1']");if(!ba(b)&&!f.test(c)&&(!e||!e.test(c)))try{var h=g.call(b,c);if(h||a||b.document&&b.document.nodeType!==11)return h}catch(i){}return Z(c,null,null,[b]).length>0})}(),Z.attr=p.attr,p.find=Z,p.expr=Z.selectors,p.expr[":"]=p.expr.pseudos,p.unique=Z.uniqueSort,p.text=Z.getText,p.isXMLDoc=Z.isXML,p.contains=Z.contains}(a);var bc=/Until$/,bd=/^(?:parents|prev(?:Until|All))/,be=/^.[^:#\[\.,]*$/,bf=p.expr.match.needsContext,bg={children:!0,contents:!0,next:!0,prev:!0};p.fn.extend({find:function(a){var b,c,d,e,f,g,h=this;if(typeof a!="string")return p(a).filter(function(){for(b=0,c=h.length;b<c;b++)if(p.contains(h[b],this))return!0});g=this.pushStack("","find",a);for(b=0,c=this.length;b<c;b++){d=g.length,p.find(a,this[b],g);if(b>0)for(e=d;e<g.length;e++)for(f=0;f<d;f++)if(g[f]===g[e]){g.splice
 (e--,1);break}}return g},has:function(a){var b,c=p(a,this),d=c.length;return this.filter(function(){for(b=0;b<d;b++)if(p.contains(this,c[b]))return!0})},not:function(a){return this.pushStack(bj(this,a,!1),"not",a)},filter:function(a){return this.pushStack(bj(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?bf.test(a)?p(a,this.context).index(this[0])>=0:p.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c,d=0,e=this.length,f=[],g=bf.test(a)||typeof a!="string"?p(a,b||this.context):0;for(;d<e;d++){c=this[d];while(c&&c.ownerDocument&&c!==b&&c.nodeType!==11){if(g?g.index(c)>-1:p.find.matchesSelector(c,a)){f.push(c);break}c=c.parentNode}}return f=f.length>1?p.unique(f):f,this.pushStack(f,"closest",a)},index:function(a){return a?typeof a=="string"?p.inArray(this[0],p(a)):p.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(a,b){var c=typeof a=="string"?p(a,b):p.makeArray(a&&a.nodeType?[a]:a),d=p.
 merge(this.get(),c);return this.pushStack(bh(c[0])||bh(d[0])?d:p.unique(d))},addBack:function(a){return this.add(a==null?this.prevObject:this.prevObject.filter(a))}}),p.fn.andSelf=p.fn.addBack,p.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return p.dir(a,"parentNode")},parentsUntil:function(a,b,c){return p.dir(a,"parentNode",c)},next:function(a){return bi(a,"nextSibling")},prev:function(a){return bi(a,"previousSibling")},nextAll:function(a){return p.dir(a,"nextSibling")},prevAll:function(a){return p.dir(a,"previousSibling")},nextUntil:function(a,b,c){return p.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return p.dir(a,"previousSibling",c)},siblings:function(a){return p.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return p.sibling(a.firstChild)},contents:function(a){return p.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:p.merge([],a.childNodes)}},function(a,b){p.fn[a]=function(c,d){var e=p.
 map(this,b,c);return bc.test(a)||(d=c),d&&typeof d=="string"&&(e=p.filter(d,e)),e=this.length>1&&!bg[a]?p.unique(e):e,this.length>1&&bd.test(a)&&(e=e.reverse()),this.pushStack(e,a,k.call(arguments).join(","))}}),p.extend({filter:function(a,b,c){return c&&(a=":not("+a+")"),b.length===1?p.find.matchesSelector(b[0],a)?[b[0]]:[]:p.find.matches(a,b)},dir:function(a,c,d){var e=[],f=a[c];while(f&&f.nodeType!==9&&(d===b||f.nodeType!==1||!p(f).is(d)))f.nodeType===1&&e.push(f),f=f[c];return e},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var bl="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",bm=/ jQuery\d+="(?:null|\d+)"/g,bn=/^\s+/,bo=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bp=/<([\w:]+)/,bq=/<tbody/i,br=/<|&#?\w+;/,bs=/<(?:script|style|link)/i,bt=/<(?:script|object|embed|option|style)/i,bu=new Reg
 Exp("<(?:"+bl+")[\\s/>]","i"),bv=/^(?:checkbox|radio)$/,bw=/checked\s*(?:[^=]|=\s*.checked.)/i,bx=/\/(java|ecma)script/i,by=/^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g,bz={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},bA=bk(e),bB=bA.appendChild(e.createElement("div"));bz.optgroup=bz.option,bz.tbody=bz.tfoot=bz.colgroup=bz.caption=bz.thead,bz.th=bz.td,p.support.htmlSerialize||(bz._default=[1,"X<div>","</div>"]),p.fn.extend({text:function(a){return p.access(this,function(a){return a===b?p.text(this):this.empty().append((this[0]&&this[0].ownerDocument||e).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(p.isFunction(a))return this.each(function(b){p(this).wrapAll(a.call(this,b))});if(this[
 0]){var b=p(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return p.isFunction(a)?this.each(function(b){p(this).wrapInner(a.call(this,b))}):this.each(function(){var b=p(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=p.isFunction(a);return this.each(function(c){p(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){p.nodeName(this,"body")||p(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(a,this.firstChild)})},before:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(
 a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(a,this),"before",this.selector)}},after:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(this,a),"after",this.selector)}},remove:function(a,b){var c,d=0;for(;(c=this[d])!=null;d++)if(!a||p.filter(a,[c]).length)!b&&c.nodeType===1&&(p.cleanData(c.getElementsByTagName("*")),p.cleanData([c])),c.parentNode&&c.parentNode.removeChild(c);return this},empty:function(){var a,b=0;for(;(a=this[b])!=null;b++){a.nodeType===1&&p.cleanData(a.getElementsByTagName("*"));while(a.firstChild)a.removeChild(a.firstChild)}return this},clone:function(a,b){return a=a==null?!1:a,b=b==null?a:b,this.map(function(){return p.clone(this,a,b)})},html:function(a){return p.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nod
 eType===1?c.innerHTML.replace(bm,""):b;if(typeof a=="string"&&!bs.test(a)&&(p.support.htmlSerialize||!bu.test(a))&&(p.support.leadingWhitespace||!bn.test(a))&&!bz[(bp.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(bo,"<$1></$2>");try{for(;d<e;d++)c=this[d]||{},c.nodeType===1&&(p.cleanData(c.getElementsByTagName("*")),c.innerHTML=a);c=0}catch(f){}}c&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(a){return bh(this[0])?this.length?this.pushStack(p(p.isFunction(a)?a():a),"replaceWith",a):this:p.isFunction(a)?this.each(function(b){var c=p(this),d=c.html();c.replaceWith(a.call(this,b,d))}):(typeof a!="string"&&(a=p(a).detach()),this.each(function(){var b=this.nextSibling,c=this.parentNode;p(this).remove(),b?p(b).before(a):p(c).append(a)}))},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){a=[].concat.apply([],a);var e,f,g,h,i=0,j=a[0],k=[],l=this.length;if(!p.support.checkClone&&l>1&&typeof j=="string"&&bw.test(j))return this.each(function()
 {p(this).domManip(a,c,d)});if(p.isFunction(j))return this.each(function(e){var f=p(this);a[0]=j.call(this,e,c?f.html():b),f.domManip(a,c,d)});if(this[0]){e=p.buildFragment(a,this,k),g=e.fragment,f=g.firstChild,g.childNodes.length===1&&(g=f);if(f){c=c&&p.nodeName(f,"tr");for(h=e.cacheable||l-1;i<l;i++)d.call(c&&p.nodeName(this[i],"table")?bC(this[i],"tbody"):this[i],i===h?g:p.clone(g,!0,!0))}g=f=null,k.length&&p.each(k,function(a,b){b.src?p.ajax?p.ajax({url:b.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):p.error("no ajax"):p.globalEval((b.text||b.textContent||b.innerHTML||"").replace(by,"")),b.parentNode&&b.parentNode.removeChild(b)})}return this}}),p.buildFragment=function(a,c,d){var f,g,h,i=a[0];return c=c||e,c=(c[0]||c).ownerDocument||c[0]||c,typeof c.createDocumentFragment=="undefined"&&(c=e),a.length===1&&typeof i=="string"&&i.length<512&&c===e&&i.charAt(0)==="<"&&!bt.test(i)&&(p.support.checkClone||!bw.test(i))&&(p.support.html5Clone||!bu.test(i))&&(g=!0,f=p
 .fragments[i],h=f!==b),f||(f=c.createDocumentFragment(),p.clean(a,c,f,d),g&&(p.fragments[i]=h&&f)),{fragment:f,cacheable:g}},p.fragments={},p.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){p.fn[a]=function(c){var d,e=0,f=[],g=p(c),h=g.length,i=this.length===1&&this[0].parentNode;if((i==null||i&&i.nodeType===11&&i.childNodes.length===1)&&h===1)return g[b](this[0]),this;for(;e<h;e++)d=(e>0?this.clone(!0):this).get(),p(g[e])[b](d),f=f.concat(d);return this.pushStack(f,a,g.selector)}}),p.extend({clone:function(a,b,c){var d,e,f,g;p.support.html5Clone||p.isXMLDoc(a)||!bu.test("<"+a.nodeName+">")?g=a.cloneNode(!0):(bB.innerHTML=a.outerHTML,bB.removeChild(g=bB.firstChild));if((!p.support.noCloneEvent||!p.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!p.isXMLDoc(a)){bE(a,g),d=bF(a),e=bF(g);for(f=0;d[f];++f)e[f]&&bE(d[f],e[f])}if(b){bD(a,g);if(c){d=bF(a),e=bF(g);for(f=0;d[f];++f)bD(d[f],e[f])}}return 
 d=e=null,g},clean:function(a,b,c,d){var f,g,h,i,j,k,l,m,n,o,q,r,s=0,t=[];if(!b||typeof b.createDocumentFragment=="undefined")b=e;for(g=b===e&&bA;(h=a[s])!=null;s++){typeof h=="number"&&(h+="");if(!h)continue;if(typeof h=="string")if(!br.test(h))h=b.createTextNode(h);else{g=g||bk(b),l=l||g.appendChild(b.createElement("div")),h=h.replace(bo,"<$1></$2>"),i=(bp.exec(h)||["",""])[1].toLowerCase(),j=bz[i]||bz._default,k=j[0],l.innerHTML=j[1]+h+j[2];while(k--)l=l.lastChild;if(!p.support.tbody){m=bq.test(h),n=i==="table"&&!m?l.firstChild&&l.firstChild.childNodes:j[1]==="<table>"&&!m?l.childNodes:[];for(f=n.length-1;f>=0;--f)p.nodeName(n[f],"tbody")&&!n[f].childNodes.length&&n[f].parentNode.removeChild(n[f])}!p.support.leadingWhitespace&&bn.test(h)&&l.insertBefore(b.createTextNode(bn.exec(h)[0]),l.firstChild),h=l.childNodes,l=g.lastChild}h.nodeType?t.push(h):t=p.merge(t,h)}l&&(g.removeChild(l),h=l=g=null);if(!p.support.appendChecked)for(s=0;(h=t[s])!=null;s++)p.nodeName(h,"input")?bG(h):type
 of h.getElementsByTagName!="undefined"&&p.grep(h.getElementsByTagName("input"),bG);if(c){q=function(a){if(!a.type||bx.test(a.type))return d?d.push(a.parentNode?a.parentNode.removeChild(a):a):c.appendChild(a)};for(s=0;(h=t[s])!=null;s++)if(!p.nodeName(h,"script")||!q(h))c.appendChild(h),typeof h.getElementsByTagName!="undefined"&&(r=p.grep(p.merge([],h.getElementsByTagName("script")),q),t.splice.apply(t,[s+1,0].concat(r)),s+=r.length)}return t},cleanData:function(a,b){var c,d,e,f,g=0,h=p.expando,i=p.cache,j=p.support.deleteExpando,k=p.event.special;for(;(e=a[g])!=null;g++)if(b||p.acceptData(e)){d=e[h],c=d&&i[d];if(c){if(c.events)for(f in c.events)k[f]?p.event.remove(e,f):p.removeEvent(e,f,c.handle);i[d]&&(delete i[d],j?delete e[h]:e.removeAttribute?e.removeAttribute(h):e[h]=null,p.deletedIds.push(d))}}}}),function(){var a,b;p.uaMatch=function(a){a=a.toLowerCase();var b=/(chrome)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(ms
 ie) ([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},a=p.uaMatch(g.userAgent),b={},a.browser&&(b[a.browser]=!0,b.version=a.version),b.webkit&&(b.safari=!0),p.browser=b,p.sub=function(){function a(b,c){return new a.fn.init(b,c)}p.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function c(c,d){return d&&d instanceof p&&!(d instanceof a)&&(d=a(d)),p.fn.init.call(this,c,d,b)},a.fn.init.prototype=a.fn;var b=a(e);return a}}();var bH,bI,bJ,bK=/alpha\([^)]*\)/i,bL=/opacity=([^)]*)/,bM=/^(top|right|bottom|left)$/,bN=/^margin/,bO=new RegExp("^("+q+")(.*)$","i"),bP=new RegExp("^("+q+")(?!px)[a-z%]+$","i"),bQ=new RegExp("^([-+])=("+q+")","i"),bR={},bS={position:"absolute",visibility:"hidden",display:"block"},bT={letterSpacing:0,fontWeight:400,lineHeight:1},bU=["Top","Right","Bottom","Left"],bV=["Webkit","O","Moz","ms"],bW=p.fn.toggle;p.fn.extend({css:funct
 ion(a,c){return p.access(this,function(a,c,d){return d!==b?p.style(a,c,d):p.css(a,c)},a,c,arguments.length>1)},show:function(){return bZ(this,!0)},hide:function(){return bZ(this)},toggle:function(a,b){var c=typeof a=="boolean";return p.isFunction(a)&&p.isFunction(b)?bW.apply(this,arguments):this.each(function(){(c?a:bY(this))?p(this).show():p(this).hide()})}}),p.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bH(a,"opacity");return c===""?"1":c}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":p.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!a||a.nodeType===3||a.nodeType===8||!a.style)return;var f,g,h,i=p.camelCase(c),j=a.style;c=p.cssProps[i]||(p.cssProps[i]=bX(j,i)),h=p.cssHooks[c]||p.cssHooks[i];if(d===b)return h&&"get"in h&&(f=h.get(a,!1,e))!==b?f:j[c];g=typeof d,g==="string"&&(f=bQ.exec(d))&&(d=(f[1]+1)*f[2]+parseFloat(p.css(a,c)),g="number");if(d==null||g==="number"&&is
 NaN(d))return;g==="number"&&!p.cssNumber[i]&&(d+="px");if(!h||!("set"in h)||(d=h.set(a,d,e))!==b)try{j[c]=d}catch(k){}},css:function(a,c,d,e){var f,g,h,i=p.camelCase(c);return c=p.cssProps[i]||(p.cssProps[i]=bX(a.style,i)),h=p.cssHooks[c]||p.cssHooks[i],h&&"get"in h&&(f=h.get(a,!0,e)),f===b&&(f=bH(a,c)),f==="normal"&&c in bT&&(f=bT[c]),d||e!==b?(g=parseFloat(f),d||p.isNumeric(g)?g||0:f):f},swap:function(a,b,c){var d,e,f={};for(e in b)f[e]=a.style[e],a.style[e]=b[e];d=c.call(a);for(e in b)a.style[e]=f[e];return d}}),a.getComputedStyle?bH=function(a,b){var c,d,e,f,g=getComputedStyle(a,null),h=a.style;return g&&(c=g[b],c===""&&!p.contains(a.ownerDocument.documentElement,a)&&(c=p.style(a,b)),bP.test(c)&&bN.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=c,c=g.width,h.width=d,h.minWidth=e,h.maxWidth=f)),c}:e.documentElement.currentStyle&&(bH=function(a,b){var c,d,e=a.currentStyle&&a.currentStyle[b],f=a.style;return e==null&&f&&f[b]&&(e=f[b]),bP.test(e)&&!bM.te
 st(b)&&(c=f.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":e,e=f.pixelLeft+"px",f.left=c,d&&(a.runtimeStyle.left=d)),e===""?"auto":e}),p.each(["height","width"],function(a,b){p.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth!==0||bH(a,"display")!=="none"?ca(a,b,d):p.swap(a,bS,function(){return ca(a,b,d)})},set:function(a,c,d){return b$(a,c,d?b_(a,b,d,p.support.boxSizing&&p.css(a,"boxSizing")==="border-box"):0)}}}),p.support.opacity||(p.cssHooks.opacity={get:function(a,b){return bL.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=p.isNumeric(b)?"alpha(opacity="+b*100+")":"",f=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&p.trim(f.replace(bK,""))===""&&c.removeAttribute){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bK.test(f)?f.replace(bK,e):f+" "+e}}),p(function(){p.support.reliableMarg
 inRight||(p.cssHooks.marginRight={get:function(a,b){return p.swap(a,{display:"inline-block"},function(){if(b)return bH(a,"marginRight")})}}),!p.support.pixelPosition&&p.fn.position&&p.each(["top","left"],function(a,b){p.cssHooks[b]={get:function(a,c){if(c){var d=bH(a,b);return bP.test(d)?p(a).position()[b]+"px":d}}}})}),p.expr&&p.expr.filters&&(p.expr.filters.hidden=function(a){return a.offsetWidth===0&&a.offsetHeight===0||!p.support.reliableHiddenOffsets&&(a.style&&a.style.display||bH(a,"display"))==="none"},p.expr.filters.visible=function(a){return!p.expr.filters.hidden(a)}),p.each({margin:"",padding:"",border:"Width"},function(a,b){p.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bU[d]+b]=e[d]||e[d-2]||e[0];return f}},bN.test(a)||(p.cssHooks[a+b].set=b$)});var cc=/%20/g,cd=/\[\]$/,ce=/\r?\n/g,cf=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,cg=/^(?:select|t
 extarea)/i;p.fn.extend({serialize:function(){return p.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?p.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||cg.test(this.nodeName)||cf.test(this.type))}).map(function(a,b){var c=p(this).val();return c==null?null:p.isArray(c)?p.map(c,function(a,c){return{name:b.name,value:a.replace(ce,"\r\n")}}):{name:b.name,value:c.replace(ce,"\r\n")}}).get()}}),p.param=function(a,c){var d,e=[],f=function(a,b){b=p.isFunction(b)?b():b==null?"":b,e[e.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=p.ajaxSettings&&p.ajaxSettings.traditional);if(p.isArray(a)||a.jquery&&!p.isPlainObject(a))p.each(a,function(){f(this.name,this.value)});else for(d in a)ch(d,a[d],c,f);return e.join("&").replace(cc,"+")};var ci,cj,ck=/#.*$/,cl=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,cm=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,cn=/^(?:GET|HEAD)$/
 ,co=/^\/\//,cp=/\?/,cq=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,cr=/([?&])_=[^&]*/,cs=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,ct=p.fn.load,cu={},cv={},cw=["*/"]+["*"];try{ci=f.href}catch(cx){ci=e.createElement("a"),ci.href="",ci=ci.href}cj=cs.exec(ci.toLowerCase())||[],p.fn.load=function(a,c,d){if(typeof a!="string"&&ct)return ct.apply(this,arguments);if(!this.length)return this;var e,f,g,h=this,i=a.indexOf(" ");return i>=0&&(e=a.slice(i,a.length),a=a.slice(0,i)),p.isFunction(c)?(d=c,c=b):typeof c=="object"&&(f="POST"),p.ajax({url:a,type:f,dataType:"html",data:c,complete:function(a,b){d&&h.each(d,g||[a.responseText,b,a])}}).done(function(a){g=arguments,h.html(e?p("<div>").append(a.replace(cq,"")).find(e):a)}),this},p.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){p.fn[b]=function(a){return this.on(b,a)}}),p.each(["get","post"],function(a,c){p[c]=function(a,d,e,f){return p.isFunction(d)&&(f=f||e,e=d,d=b),p.ajax({ty
 pe:c,url:a,data:d,success:e,dataType:f})}}),p.extend({getScript:function(a,c){return p.get(a,b,c,"script")},getJSON:function(a,b,c){return p.get(a,b,c,"json")},ajaxSetup:function(a,b){return b?cA(a,p.ajaxSettings):(b=a,a=p.ajaxSettings),cA(a,b),a},ajaxSettings:{url:ci,isLocal:cm.test(cj[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":cw},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":p.parseJSON,"text xml":p.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:cy(cu),ajaxTransport:cy(cv),ajax:function(a,c){function y(a,c,f,i){var k,s,t,u,w,y=c;if(v===2)return;v=2,h&&clearTimeout(h),g=b,e=i||"",x.readyState=a>0?4:0,f&&(u=cB(l,x,f));if(a>=200&&a<300||a===304)l.ifModified&&(w=x.getResponseHea
 der("Last-Modified"),w&&(p.lastModified[d]=w),w=x.getResponseHeader("Etag"),w&&(p.etag[d]=w)),a===304?(y="notmodified",k=!0):(k=cC(l,u),y=k.state,s=k.data,t=k.error,k=!t);else{t=y;if(!y||a)y="error",a<0&&(a=0)}x.status=a,x.statusText=""+(c||y),k?o.resolveWith(m,[s,y,x]):o.rejectWith(m,[x,y,t]),x.statusCode(r),r=b,j&&n.trigger("ajax"+(k?"Success":"Error"),[x,l,k?s:t]),q.fireWith(m,[x,y]),j&&(n.trigger("ajaxComplete",[x,l]),--p.active||p.event.trigger("ajaxStop"))}typeof a=="object"&&(c=a,a=b),c=c||{};var d,e,f,g,h,i,j,k,l=p.ajaxSetup({},c),m=l.context||l,n=m!==l&&(m.nodeType||m instanceof p)?p(m):p.event,o=p.Deferred(),q=p.Callbacks("once memory"),r=l.statusCode||{},t={},u={},v=0,w="canceled",x={readyState:0,setRequestHeader:function(a,b){if(!v){var c=a.toLowerCase();a=u[c]=u[c]||a,t[a]=b}return this},getAllResponseHeaders:function(){return v===2?e:null},getResponseHeader:function(a){var c;if(v===2){if(!f){f={};while(c=cl.exec(e))f[c[1].toLowerCase()]=c[2]}c=f[a.toLowerCase()]}return
  c===b?null:c},overrideMimeType:function(a){return v||(l.mimeType=a),this},abort:function(a){return a=a||w,g&&g.abort(a),y(0,a),this}};o.promise(x),x.success=x.done,x.error=x.fail,x.complete=q.add,x.statusCode=function(a){if(a){var b;if(v<2)for(b in a)r[b]=[r[b],a[b]];else b=a[x.status],x.always(b)}return this},l.url=((a||l.url)+"").replace(ck,"").replace(co,cj[1]+"//"),l.dataTypes=p.trim(l.dataType||"*").toLowerCase().split(s),l.crossDomain==null&&(i=cs.exec(l.url.toLowerCase()),l.crossDomain=!(!i||i[1]==cj[1]&&i[2]==cj[2]&&(i[3]||(i[1]==="http:"?80:443))==(cj[3]||(cj[1]==="http:"?80:443)))),l.data&&l.processData&&typeof l.data!="string"&&(l.data=p.param(l.data,l.traditional)),cz(cu,l,c,x);if(v===2)return x;j=l.global,l.type=l.type.toUpperCase(),l.hasContent=!cn.test(l.type),j&&p.active++===0&&p.event.trigger("ajaxStart");if(!l.hasContent){l.data&&(l.url+=(cp.test(l.url)?"&":"?")+l.data,delete l.data),d=l.url;if(l.cache===!1){var z=p.now(),A=l.url.replace(cr,"$1_="+z);l.url=A+(A===
 l.url?(cp.test(l.url)?"&":"?")+"_="+z:"")}}(l.data&&l.hasContent&&l.contentType!==!1||c.contentType)&&x.setRequestHeader("Content-Type",l.contentType),l.ifModified&&(d=d||l.url,p.lastModified[d]&&x.setRequestHeader("If-Modified-Since",p.lastModified[d]),p.etag[d]&&x.setRequestHeader("If-None-Match",p.etag[d])),x.setRequestHeader("Accept",l.dataTypes[0]&&l.accepts[l.dataTypes[0]]?l.accepts[l.dataTypes[0]]+(l.dataTypes[0]!=="*"?", "+cw+"; q=0.01":""):l.accepts["*"]);for(k in l.headers)x.setRequestHeader(k,l.headers[k]);if(!l.beforeSend||l.beforeSend.call(m,x,l)!==!1&&v!==2){w="abort";for(k in{success:1,error:1,complete:1})x[k](l[k]);g=cz(cv,l,c,x);if(!g)y(-1,"No Transport");else{x.readyState=1,j&&n.trigger("ajaxSend",[x,l]),l.async&&l.timeout>0&&(h=setTimeout(function(){x.abort("timeout")},l.timeout));try{v=1,g.send(t,y)}catch(B){if(v<2)y(-1,B);else throw B}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var cD=[],cE=/\?/,cF=/(=)\?(?=&|$)|\?\?/,cG=p.now();p.ajaxSetup({j
 sonp:"callback",jsonpCallback:function(){var a=cD.pop()||p.expando+"_"+cG++;return this[a]=!0,a}}),p.ajaxPrefilter("json jsonp",function(c,d,e){var f,g,h,i=c.data,j=c.url,k=c.jsonp!==!1,l=k&&cF.test(j),m=k&&!l&&typeof i=="string"&&!(c.contentType||"").indexOf("application/x-www-form-urlencoded")&&cF.test(i);if(c.dataTypes[0]==="jsonp"||l||m)return f=c.jsonpCallback=p.isFunction(c.jsonpCallback)?c.jsonpCallback():c.jsonpCallback,g=a[f],l?c.url=j.replace(cF,"$1"+f):m?c.data=i.replace(cF,"$1"+f):k&&(c.url+=(cE.test(j)?"&":"?")+c.jsonp+"="+f),c.converters["script json"]=function(){return h||p.error(f+" was not called"),h[0]},c.dataTypes[0]="json",a[f]=function(){h=arguments},e.always(function(){a[f]=g,c[f]&&(c.jsonpCallback=d.jsonpCallback,cD.push(f)),h&&p.isFunction(g)&&g(h[0]),h=g=b}),"script"}),p.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":fu
 nction(a){return p.globalEval(a),a}}}),p.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),p.ajaxTransport("script",function(a){if(a.crossDomain){var c,d=e.head||e.getElementsByTagName("head")[0]||e.documentElement;return{send:function(f,g){c=e.createElement("script"),c.async="async",a.scriptCharset&&(c.charset=a.scriptCharset),c.src=a.url,c.onload=c.onreadystatechange=function(a,e){if(e||!c.readyState||/loaded|complete/.test(c.readyState))c.onload=c.onreadystatechange=null,d&&c.parentNode&&d.removeChild(c),c=b,e||g(200,"success")},d.insertBefore(c,d.firstChild)},abort:function(){c&&c.onload(0,1)}}}});var cH,cI=a.ActiveXObject?function(){for(var a in cH)cH[a](0,1)}:!1,cJ=0;p.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&cK()||cL()}:cK,function(a){p.extend(p.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(p.ajaxSettings.xhr()),p.support.ajax&&p.ajaxTransport(function(c){if(!c.crossDomain||p.support.cors){v
 ar d;return{send:function(e,f){var g,h,i=c.xhr();c.username?i.open(c.type,c.url,c.async,c.username,c.password):i.open(c.type,c.url,c.async);if(c.xhrFields)for(h in c.xhrFields)i[h]=c.xhrFields[h];c.mimeType&&i.overrideMimeType&&i.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(h in e)i.setRequestHeader(h,e[h])}catch(j){}i.send(c.hasContent&&c.data||null),d=function(a,e){var h,j,k,l,m;try{if(d&&(e||i.readyState===4)){d=b,g&&(i.onreadystatechange=p.noop,cI&&delete cH[g]);if(e)i.readyState!==4&&i.abort();else{h=i.status,k=i.getAllResponseHeaders(),l={},m=i.responseXML,m&&m.documentElement&&(l.xml=m);try{l.text=i.responseText}catch(a){}try{j=i.statusText}catch(n){j=""}!h&&c.isLocal&&!c.crossDomain?h=l.text?200:404:h===1223&&(h=204)}}}catch(o){e||f(-1,o)}l&&f(h,j,l,k)},c.async?i.readyState===4?setTimeout(d,0):(g=++cJ,cI&&(cH||(cH={},p(a).unload(cI)),cH[g]=d),i.onreadystatechange=d):d()},abort:function(){d&&d(0,1)}}}});
 var cM,cN,cO=/^(?:toggle|show|hide)$/,cP=new RegExp("^(?:([-+])=|)("+q+")([a-z%]*)$","i"),cQ=/queueHooks$/,cR=[cX],cS={"*":[function(a,b){var c,d,e,f=this.createTween(a,b),g=cP.exec(b),h=f.cur(),i=+h||0,j=1;if(g){c=+g[2],d=g[3]||(p.cssNumber[a]?"":"px");if(d!=="px"&&i){i=p.css(f.elem,a,!0)||c||1;do e=j=j||".5",i=i/j,p.style(f.elem,a,i+d),j=f.cur()/h;while(j!==1&&j!==e)}f.unit=d,f.start=i,f.end=g[1]?i+(g[1]+1)*c:c}return f}]};p.Animation=p.extend(cV,{tweener:function(a,b){p.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");var c,d=0,e=a.length;for(;d<e;d++)c=a[d],cS[c]=cS[c]||[],cS[c].unshift(b)},prefilter:function(a,b){b?cR.unshift(a):cR.push(a)}}),p.Tween=cY,cY.prototype={constructor:cY,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(p.cssNumber[c]?"":"px")},cur:function(){var a=cY.propHooks[this.prop];return a&&a.get?a.get(this):cY.propHooks._default.get(this)},run:function(a){var b,c=cY.prop
 Hooks[this.prop];return this.pos=b=p.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration),this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):cY.propHooks._default.set(this),this}},cY.prototype.init.prototype=cY.prototype,cY.propHooks={_default:{get:function(a){var b;return a.elem[a.prop]==null||!!a.elem.style&&a.elem.style[a.prop]!=null?(b=p.css(a.elem,a.prop,!1,""),!b||b==="auto"?0:b):a.elem[a.prop]},set:function(a){p.fx.step[a.prop]?p.fx.step[a.prop](a):a.elem.style&&(a.elem.style[p.cssProps[a.prop]]!=null||p.cssHooks[a.prop])?p.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},cY.propHooks.scrollTop=cY.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},p.each(["toggle","show","hide"],function(a,b){var c=p.fn[b];p.fn[b]=function(d,e,f){return d==null||typeof d=="boolean"||!a&&p.isFunction(d)&&p.isFunction(e)?c.apply(this,argum
 ents):this.animate(cZ(b,!0),d,e,f)}}),p.fn.extend({fadeTo:function(a,b,c,d){return this.filter(bY).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=p.isEmptyObject(a),f=p.speed(b,c,d),g=function(){var b=cV(this,p.extend({},a),f);e&&b.stop(!0)};return e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:func

<TRUNCATED>

[39/51] [abbrv] [partial] brooklyn-ui git commit: move subdir from incubator up a level as it is promoted to its own repo (first non-incubator commit!)

Posted by he...@apache.org.
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/js/libs/jquery.wiggle.min.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/js/libs/jquery.wiggle.min.js b/brooklyn-ui/src/main/webapp/assets/js/libs/jquery.wiggle.min.js
deleted file mode 100644
index 2adb0d6..0000000
--- a/brooklyn-ui/src/main/webapp/assets/js/libs/jquery.wiggle.min.js
+++ /dev/null
@@ -1,8 +0,0 @@
-/*
-jQuery Wiggle
-Author: WonderGroup, Jordan Thomas
-URL: http://labs.wondergroup.com/demos/mini-ui/index.html
-License: MIT (http://en.wikipedia.org/wiki/MIT_License)
-*/
-jQuery.fn.wiggle=function(o){var d={speed:50,wiggles:3,travel:5,callback:null};var o=jQuery.extend(d,o);return this.each(function(){var cache=this;var wrap=jQuery(this).wrap('<div class="wiggle-wrap"></div>').css("position","relative");var calls=0;for(i=1;i<=o.wiggles;i++){jQuery(this).animate({left:"-="+o.travel},o.speed).animate({left:"+="+o.travel*2},o.speed*2).animate({left:"-="+o.travel},o.speed,function(){calls++;if(jQuery(cache).parent().hasClass('wiggle-wrap')){jQuery(cache).parent().replaceWith(cache);}
-if(calls==o.wiggles&&jQuery.isFunction(o.callback)){o.callback();}});}});};
\ No newline at end of file


[36/51] [abbrv] [partial] brooklyn-ui git commit: move subdir from incubator up a level as it is promoted to its own repo (first non-incubator commit!)

Posted by he...@apache.org.
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/js/libs/underscore.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/js/libs/underscore.js b/brooklyn-ui/src/main/webapp/assets/js/libs/underscore.js
deleted file mode 100644
index 32ca0c1..0000000
--- a/brooklyn-ui/src/main/webapp/assets/js/libs/underscore.js
+++ /dev/null
@@ -1,1227 +0,0 @@
-// Underscore.js 1.4.4
-// ===================
-
-// > http://underscorejs.org
-// > (c) 2009-2013 Jeremy Ashkenas, DocumentCloud Inc.
-// > Underscore may be freely distributed under the MIT license.
-
-// Baseline setup
-// --------------
-(function() {
-
-  // Establish the root object, `window` in the browser, or `global` on the server.
-  var root = this;
-
-  // Save the previous value of the `_` variable.
-  var previousUnderscore = root._;
-
-  // Establish the object that gets returned to break out of a loop iteration.
-  var breaker = {};
-
-  // Save bytes in the minified (but not gzipped) version:
-  var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype;
-
-  // Create quick reference variables for speed access to core prototypes.
-  var push             = ArrayProto.push,
-      slice            = ArrayProto.slice,
-      concat           = ArrayProto.concat,
-      toString         = ObjProto.toString,
-      hasOwnProperty   = ObjProto.hasOwnProperty;
-
-  // All **ECMAScript 5** native function implementations that we hope to use
-  // are declared here.
-  var
-    nativeForEach      = ArrayProto.forEach,
-    nativeMap          = ArrayProto.map,
-    nativeReduce       = ArrayProto.reduce,
-    nativeReduceRight  = ArrayProto.reduceRight,
-    nativeFilter       = ArrayProto.filter,
-    nativeEvery        = ArrayProto.every,
-    nativeSome         = ArrayProto.some,
-    nativeIndexOf      = ArrayProto.indexOf,
-    nativeLastIndexOf  = ArrayProto.lastIndexOf,
-    nativeIsArray      = Array.isArray,
-    nativeKeys         = Object.keys,
-    nativeBind         = FuncProto.bind;
-
-  // Create a safe reference to the Underscore object for use below.
-  var _ = function(obj) {
-    if (obj instanceof _) return obj;
-    if (!(this instanceof _)) return new _(obj);
-    this._wrapped = obj;
-  };
-
-  // Export the Underscore object for **Node.js**, with
-  // backwards-compatibility for the old `require()` API. If we're in
-  // the browser, add `_` as a global object via a string identifier,
-  // for Closure Compiler "advanced" mode.
-  if (typeof exports !== 'undefined') {
-    if (typeof module !== 'undefined' && module.exports) {
-      exports = module.exports = _;
-    }
-    exports._ = _;
-  } else {
-    root._ = _;
-  }
-
-  // Current version.
-  _.VERSION = '1.4.4';
-
-  // Collection Functions
-  // --------------------
-
-  // The cornerstone, an `each` implementation, aka `forEach`.
-  // Handles objects with the built-in `forEach`, arrays, and raw objects.
-  // Delegates to **ECMAScript 5**'s native `forEach` if available.
-  var each = _.each = _.forEach = function(obj, iterator, context) {
-    if (obj == null) return;
-    if (nativeForEach && obj.forEach === nativeForEach) {
-      obj.forEach(iterator, context);
-    } else if (obj.length === +obj.length) {
-      for (var i = 0, l = obj.length; i < l; i++) {
-        if (iterator.call(context, obj[i], i, obj) === breaker) return;
-      }
-    } else {
-      for (var key in obj) {
-        if (_.has(obj, key)) {
-          if (iterator.call(context, obj[key], key, obj) === breaker) return;
-        }
-      }
-    }
-  };
-
-  // Return the results of applying the iterator to each element.
-  // Delegates to **ECMAScript 5**'s native `map` if available.
-  _.map = _.collect = function(obj, iterator, context) {
-    var results = [];
-    if (obj == null) return results;
-    if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context);
-    each(obj, function(value, index, list) {
-      results[results.length] = iterator.call(context, value, index, list);
-    });
-    return results;
-  };
-
-  var reduceError = 'Reduce of empty array with no initial value';
-
-  // **Reduce** builds up a single result from a list of values, aka `inject`,
-  // or `foldl`. Delegates to **ECMAScript 5**'s native `reduce` if available.
-  _.reduce = _.foldl = _.inject = function(obj, iterator, memo, context) {
-    var initial = arguments.length > 2;
-    if (obj == null) obj = [];
-    if (nativeReduce && obj.reduce === nativeReduce) {
-      if (context) iterator = _.bind(iterator, context);
-      return initial ? obj.reduce(iterator, memo) : obj.reduce(iterator);
-    }
-    each(obj, function(value, index, list) {
-      if (!initial) {
-        memo = value;
-        initial = true;
-      } else {
-        memo = iterator.call(context, memo, value, index, list);
-      }
-    });
-    if (!initial) throw new TypeError(reduceError);
-    return memo;
-  };
-
-  // The right-associative version of reduce, also known as `foldr`.
-  // Delegates to **ECMAScript 5**'s native `reduceRight` if available.
-  _.reduceRight = _.foldr = function(obj, iterator, memo, context) {
-    var initial = arguments.length > 2;
-    if (obj == null) obj = [];
-    if (nativeReduceRight && obj.reduceRight === nativeReduceRight) {
-      if (context) iterator = _.bind(iterator, context);
-      return initial ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator);
-    }
-    var length = obj.length;
-    if (length !== +length) {
-      var keys = _.keys(obj);
-      length = keys.length;
-    }
-    each(obj, function(value, index, list) {
-      index = keys ? keys[--length] : --length;
-      if (!initial) {
-        memo = obj[index];
-        initial = true;
-      } else {
-        memo = iterator.call(context, memo, obj[index], index, list);
-      }
-    });
-    if (!initial) throw new TypeError(reduceError);
-    return memo;
-  };
-
-  // Return the first value which passes a truth test. Aliased as `detect`.
-  _.find = _.detect = function(obj, iterator, context) {
-    var result;
-    any(obj, function(value, index, list) {
-      if (iterator.call(context, value, index, list)) {
-        result = value;
-        return true;
-      }
-    });
-    return result;
-  };
-
-  // Return all the elements that pass a truth test.
-  // Delegates to **ECMAScript 5**'s native `filter` if available.
-  // Aliased as `select`.
-  _.filter = _.select = function(obj, iterator, context) {
-    var results = [];
-    if (obj == null) return results;
-    if (nativeFilter && obj.filter === nativeFilter) return obj.filter(iterator, context);
-    each(obj, function(value, index, list) {
-      if (iterator.call(context, value, index, list)) results[results.length] = value;
-    });
-    return results;
-  };
-
-  // Return all the elements for which a truth test fails.
-  _.reject = function(obj, iterator, context) {
-    return _.filter(obj, function(value, index, list) {
-      return !iterator.call(context, value, index, list);
-    }, context);
-  };
-
-  // Determine whether all of the elements match a truth test.
-  // Delegates to **ECMAScript 5**'s native `every` if available.
-  // Aliased as `all`.
-  _.every = _.all = function(obj, iterator, context) {
-    iterator || (iterator = _.identity);
-    var result = true;
-    if (obj == null) return result;
-    if (nativeEvery && obj.every === nativeEvery) return obj.every(iterator, context);
-    each(obj, function(value, index, list) {
-      if (!(result = result && iterator.call(context, value, index, list))) return breaker;
-    });
-    return !!result;
-  };
-
-  // Determine if at least one element in the object matches a truth test.
-  // Delegates to **ECMAScript 5**'s native `some` if available.
-  // Aliased as `any`.
-  var any = _.some = _.any = function(obj, iterator, context) {
-    iterator || (iterator = _.identity);
-    var result = false;
-    if (obj == null) return result;
-    if (nativeSome && obj.some === nativeSome) return obj.some(iterator, context);
-    each(obj, function(value, index, list) {
-      if (result || (result = iterator.call(context, value, index, list))) return breaker;
-    });
-    return !!result;
-  };
-
-  // Determine if the array or object contains a given value (using `===`).
-  // Aliased as `include`.
-  _.contains = _.include = function(obj, target) {
-    if (obj == null) return false;
-    if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1;
-    return any(obj, function(value) {
-      return value === target;
-    });
-  };
-
-  // Invoke a method (with arguments) on every item in a collection.
-  _.invoke = function(obj, method) {
-    var args = slice.call(arguments, 2);
-    var isFunc = _.isFunction(method);
-    return _.map(obj, function(value) {
-      return (isFunc ? method : value[method]).apply(value, args);
-    });
-  };
-
-  // Convenience version of a common use case of `map`: fetching a property.
-  _.pluck = function(obj, key) {
-    return _.map(obj, function(value){ return value[key]; });
-  };
-
-  // Convenience version of a common use case of `filter`: selecting only objects
-  // containing specific `key:value` pairs.
-  _.where = function(obj, attrs, first) {
-    if (_.isEmpty(attrs)) return first ? null : [];
-    return _[first ? 'find' : 'filter'](obj, function(value) {
-      for (var key in attrs) {
-        if (attrs[key] !== value[key]) return false;
-      }
-      return true;
-    });
-  };
-
-  // Convenience version of a common use case of `find`: getting the first object
-  // containing specific `key:value` pairs.
-  _.findWhere = function(obj, attrs) {
-    return _.where(obj, attrs, true);
-  };
-
-  // Return the maximum element or (element-based computation).
-  // Can't optimize arrays of integers longer than 65,535 elements.
-  // See: https://bugs.webkit.org/show_bug.cgi?id=80797
-  _.max = function(obj, iterator, context) {
-    if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) {
-      return Math.max.apply(Math, obj);
-    }
-    if (!iterator && _.isEmpty(obj)) return -Infinity;
-    var result = {computed : -Infinity, value: -Infinity};
-    each(obj, function(value, index, list) {
-      var computed = iterator ? iterator.call(context, value, index, list) : value;
-      computed >= result.computed && (result = {value : value, computed : computed});
-    });
-    return result.value;
-  };
-
-  // Return the minimum element (or element-based computation).
-  _.min = function(obj, iterator, context) {
-    if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) {
-      return Math.min.apply(Math, obj);
-    }
-    if (!iterator && _.isEmpty(obj)) return Infinity;
-    var result = {computed : Infinity, value: Infinity};
-    each(obj, function(value, index, list) {
-      var computed = iterator ? iterator.call(context, value, index, list) : value;
-      computed < result.computed && (result = {value : value, computed : computed});
-    });
-    return result.value;
-  };
-
-  // Shuffle an array.
-  _.shuffle = function(obj) {
-    var rand;
-    var index = 0;
-    var shuffled = [];
-    each(obj, function(value) {
-      rand = _.random(index++);
-      shuffled[index - 1] = shuffled[rand];
-      shuffled[rand] = value;
-    });
-    return shuffled;
-  };
-
-  // An internal function to generate lookup iterators.
-  var lookupIterator = function(value) {
-    return _.isFunction(value) ? value : function(obj){ return obj[value]; };
-  };
-
-  // Sort the object's values by a criterion produced by an iterator.
-  _.sortBy = function(obj, value, context) {
-    var iterator = lookupIterator(value);
-    return _.pluck(_.map(obj, function(value, index, list) {
-      return {
-        value : value,
-        index : index,
-        criteria : iterator.call(context, value, index, list)
-      };
-    }).sort(function(left, right) {
-      var a = left.criteria;
-      var b = right.criteria;
-      if (a !== b) {
-        if (a > b || a === void 0) return 1;
-        if (a < b || b === void 0) return -1;
-      }
-      return left.index < right.index ? -1 : 1;
-    }), 'value');
-  };
-
-  // An internal function used for aggregate "group by" operations.
-  var group = function(obj, value, context, behavior) {
-    var result = {};
-    var iterator = lookupIterator(value || _.identity);
-    each(obj, function(value, index) {
-      var key = iterator.call(context, value, index, obj);
-      behavior(result, key, value);
-    });
-    return result;
-  };
-
-  // Groups the object's values by a criterion. Pass either a string attribute
-  // to group by, or a function that returns the criterion.
-  _.groupBy = function(obj, value, context) {
-    return group(obj, value, context, function(result, key, value) {
-      (_.has(result, key) ? result[key] : (result[key] = [])).push(value);
-    });
-  };
-
-  // Counts instances of an object that group by a certain criterion. Pass
-  // either a string attribute to count by, or a function that returns the
-  // criterion.
-  _.countBy = function(obj, value, context) {
-    return group(obj, value, context, function(result, key) {
-      if (!_.has(result, key)) result[key] = 0;
-      result[key]++;
-    });
-  };
-
-  // Use a comparator function to figure out the smallest index at which
-  // an object should be inserted so as to maintain order. Uses binary search.
-  _.sortedIndex = function(array, obj, iterator, context) {
-    iterator = iterator == null ? _.identity : lookupIterator(iterator);
-    var value = iterator.call(context, obj);
-    var low = 0, high = array.length;
-    while (low < high) {
-      var mid = (low + high) >>> 1;
-      iterator.call(context, array[mid]) < value ? low = mid + 1 : high = mid;
-    }
-    return low;
-  };
-
-  // Safely convert anything iterable into a real, live array.
-  _.toArray = function(obj) {
-    if (!obj) return [];
-    if (_.isArray(obj)) return slice.call(obj);
-    if (obj.length === +obj.length) return _.map(obj, _.identity);
-    return _.values(obj);
-  };
-
-  // Return the number of elements in an object.
-  _.size = function(obj) {
-    if (obj == null) return 0;
-    return (obj.length === +obj.length) ? obj.length : _.keys(obj).length;
-  };
-
-  // Array Functions
-  // ---------------
-
-  // Get the first element of an array. Passing **n** will return the first N
-  // values in the array. Aliased as `head` and `take`. The **guard** check
-  // allows it to work with `_.map`.
-  _.first = _.head = _.take = function(array, n, guard) {
-    if (array == null) return void 0;
-    return (n != null) && !guard ? slice.call(array, 0, n) : array[0];
-  };
-
-  // Returns everything but the last entry of the array. Especially useful on
-  // the arguments object. Passing **n** will return all the values in
-  // the array, excluding the last N. The **guard** check allows it to work with
-  // `_.map`.
-  _.initial = function(array, n, guard) {
-    return slice.call(array, 0, array.length - ((n == null) || guard ? 1 : n));
-  };
-
-  // Get the last element of an array. Passing **n** will return the last N
-  // values in the array. The **guard** check allows it to work with `_.map`.
-  _.last = function(array, n, guard) {
-    if (array == null) return void 0;
-    if ((n != null) && !guard) {
-      return slice.call(array, Math.max(array.length - n, 0));
-    } else {
-      return array[array.length - 1];
-    }
-  };
-
-  // Returns everything but the first entry of the array. Aliased as `tail` and `drop`.
-  // Especially useful on the arguments object. Passing an **n** will return
-  // the rest N values in the array. The **guard**
-  // check allows it to work with `_.map`.
-  _.rest = _.tail = _.drop = function(array, n, guard) {
-    return slice.call(array, (n == null) || guard ? 1 : n);
-  };
-
-  // Trim out all falsy values from an array.
-  _.compact = function(array) {
-    return _.filter(array, _.identity);
-  };
-
-  // Internal implementation of a recursive `flatten` function.
-  var flatten = function(input, shallow, output) {
-    each(input, function(value) {
-      if (_.isArray(value)) {
-        shallow ? push.apply(output, value) : flatten(value, shallow, output);
-      } else {
-        output.push(value);
-      }
-    });
-    return output;
-  };
-
-  // Return a completely flattened version of an array.
-  _.flatten = function(array, shallow) {
-    return flatten(array, shallow, []);
-  };
-
-  // Return a version of the array that does not contain the specified value(s).
-  _.without = function(array) {
-    return _.difference(array, slice.call(arguments, 1));
-  };
-
-  // Produce a duplicate-free version of the array. If the array has already
-  // been sorted, you have the option of using a faster algorithm.
-  // Aliased as `unique`.
-  _.uniq = _.unique = function(array, isSorted, iterator, context) {
-    if (_.isFunction(isSorted)) {
-      context = iterator;
-      iterator = isSorted;
-      isSorted = false;
-    }
-    var initial = iterator ? _.map(array, iterator, context) : array;
-    var results = [];
-    var seen = [];
-    each(initial, function(value, index) {
-      if (isSorted ? (!index || seen[seen.length - 1] !== value) : !_.contains(seen, value)) {
-        seen.push(value);
-        results.push(array[index]);
-      }
-    });
-    return results;
-  };
-
-  // Produce an array that contains the union: each distinct element from all of
-  // the passed-in arrays.
-  _.union = function() {
-    return _.uniq(concat.apply(ArrayProto, arguments));
-  };
-
-  // Produce an array that contains every item shared between all the
-  // passed-in arrays.
-  _.intersection = function(array) {
-    var rest = slice.call(arguments, 1);
-    return _.filter(_.uniq(array), function(item) {
-      return _.every(rest, function(other) {
-        return _.indexOf(other, item) >= 0;
-      });
-    });
-  };
-
-  // Take the difference between one array and a number of other arrays.
-  // Only the elements present in just the first array will remain.
-  _.difference = function(array) {
-    var rest = concat.apply(ArrayProto, slice.call(arguments, 1));
-    return _.filter(array, function(value){ return !_.contains(rest, value); });
-  };
-
-  // Zip together multiple lists into a single array -- elements that share
-  // an index go together.
-  _.zip = function() {
-    var args = slice.call(arguments);
-    var length = _.max(_.pluck(args, 'length'));
-    var results = new Array(length);
-    for (var i = 0; i < length; i++) {
-      results[i] = _.pluck(args, "" + i);
-    }
-    return results;
-  };
-
-  // Converts lists into objects. Pass either a single array of `[key, value]`
-  // pairs, or two parallel arrays of the same length -- one of keys, and one of
-  // the corresponding values.
-  _.object = function(list, values) {
-    if (list == null) return {};
-    var result = {};
-    for (var i = 0, l = list.length; i < l; i++) {
-      if (values) {
-        result[list[i]] = values[i];
-      } else {
-        result[list[i][0]] = list[i][1];
-      }
-    }
-    return result;
-  };
-
-  // If the browser doesn't supply us with indexOf (I'm looking at you, **MSIE**),
-  // we need this function. Return the position of the first occurrence of an
-  // item in an array, or -1 if the item is not included in the array.
-  // Delegates to **ECMAScript 5**'s native `indexOf` if available.
-  // If the array is large and already in sort order, pass `true`
-  // for **isSorted** to use binary search.
-  _.indexOf = function(array, item, isSorted) {
-    if (array == null) return -1;
-    var i = 0, l = array.length;
-    if (isSorted) {
-      if (typeof isSorted == 'number') {
-        i = (isSorted < 0 ? Math.max(0, l + isSorted) : isSorted);
-      } else {
-        i = _.sortedIndex(array, item);
-        return array[i] === item ? i : -1;
-      }
-    }
-    if (nativeIndexOf && array.indexOf === nativeIndexOf) return array.indexOf(item, isSorted);
-    for (; i < l; i++) if (array[i] === item) return i;
-    return -1;
-  };
-
-  // Delegates to **ECMAScript 5**'s native `lastIndexOf` if available.
-  _.lastIndexOf = function(array, item, from) {
-    if (array == null) return -1;
-    var hasIndex = from != null;
-    if (nativeLastIndexOf && array.lastIndexOf === nativeLastIndexOf) {
-      return hasIndex ? array.lastIndexOf(item, from) : array.lastIndexOf(item);
-    }
-    var i = (hasIndex ? from : array.length);
-    while (i--) if (array[i] === item) return i;
-    return -1;
-  };
-
-  // Generate an integer Array containing an arithmetic progression. A port of
-  // the native Python `range()` function. See
-  // [the Python documentation](http://docs.python.org/library/functions.html#range).
-  _.range = function(start, stop, step) {
-    if (arguments.length <= 1) {
-      stop = start || 0;
-      start = 0;
-    }
-    step = arguments[2] || 1;
-
-    var len = Math.max(Math.ceil((stop - start) / step), 0);
-    var idx = 0;
-    var range = new Array(len);
-
-    while(idx < len) {
-      range[idx++] = start;
-      start += step;
-    }
-
-    return range;
-  };
-
-  // Function (ahem) Functions
-  // ------------------
-
-  // Create a function bound to a given object (assigning `this`, and arguments,
-  // optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if
-  // available.
-  _.bind = function(func, context) {
-    if (func.bind === nativeBind && nativeBind) return nativeBind.apply(func, slice.call(arguments, 1));
-    var args = slice.call(arguments, 2);
-    return function() {
-      return func.apply(context, args.concat(slice.call(arguments)));
-    };
-  };
-
-  // Partially apply a function by creating a version that has had some of its
-  // arguments pre-filled, without changing its dynamic `this` context.
-  _.partial = function(func) {
-    var args = slice.call(arguments, 1);
-    return function() {
-      return func.apply(this, args.concat(slice.call(arguments)));
-    };
-  };
-
-  // Bind all of an object's methods to that object. Useful for ensuring that
-  // all callbacks defined on an object belong to it.
-  _.bindAll = function(obj) {
-    var funcs = slice.call(arguments, 1);
-    if (funcs.length === 0) funcs = _.functions(obj);
-    each(funcs, function(f) { obj[f] = _.bind(obj[f], obj); });
-    return obj;
-  };
-
-  // Memoize an expensive function by storing its results.
-  _.memoize = function(func, hasher) {
-    var memo = {};
-    hasher || (hasher = _.identity);
-    return function() {
-      var key = hasher.apply(this, arguments);
-      return _.has(memo, key) ? memo[key] : (memo[key] = func.apply(this, arguments));
-    };
-  };
-
-  // Delays a function for the given number of milliseconds, and then calls
-  // it with the arguments supplied.
-  _.delay = function(func, wait) {
-    var args = slice.call(arguments, 2);
-    return setTimeout(function(){ return func.apply(null, args); }, wait);
-  };
-
-  // Defers a function, scheduling it to run after the current call stack has
-  // cleared.
-  _.defer = function(func) {
-    return _.delay.apply(_, [func, 1].concat(slice.call(arguments, 1)));
-  };
-
-  // Returns a function, that, when invoked, will only be triggered at most once
-  // during a given window of time.
-  _.throttle = function(func, wait) {
-    var context, args, timeout, result;
-    var previous = 0;
-    var later = function() {
-      previous = new Date;
-      timeout = null;
-      result = func.apply(context, args);
-    };
-    return function() {
-      var now = new Date;
-      var remaining = wait - (now - previous);
-      context = this;
-      args = arguments;
-      if (remaining <= 0) {
-        clearTimeout(timeout);
-        timeout = null;
-        previous = now;
-        result = func.apply(context, args);
-      } else if (!timeout) {
-        timeout = setTimeout(later, remaining);
-      }
-      return result;
-    };
-  };
-
-  // Returns a function, that, as long as it continues to be invoked, will not
-  // be triggered. The function will be called after it stops being called for
-  // N milliseconds. If `immediate` is passed, trigger the function on the
-  // leading edge, instead of the trailing.
-  _.debounce = function(func, wait, immediate) {
-    var timeout, result;
-    return function() {
-      var context = this, args = arguments;
-      var later = function() {
-        timeout = null;
-        if (!immediate) result = func.apply(context, args);
-      };
-      var callNow = immediate && !timeout;
-      clearTimeout(timeout);
-      timeout = setTimeout(later, wait);
-      if (callNow) result = func.apply(context, args);
-      return result;
-    };
-  };
-
-  // Returns a function that will be executed at most one time, no matter how
-  // often you call it. Useful for lazy initialization.
-  _.once = function(func) {
-    var ran = false, memo;
-    return function() {
-      if (ran) return memo;
-      ran = true;
-      memo = func.apply(this, arguments);
-      func = null;
-      return memo;
-    };
-  };
-
-  // Returns the first function passed as an argument to the second,
-  // allowing you to adjust arguments, run code before and after, and
-  // conditionally execute the original function.
-  _.wrap = function(func, wrapper) {
-    return function() {
-      var args = [func];
-      push.apply(args, arguments);
-      return wrapper.apply(this, args);
-    };
-  };
-
-  // Returns a function that is the composition of a list of functions, each
-  // consuming the return value of the function that follows.
-  _.compose = function() {
-    var funcs = arguments;
-    return function() {
-      var args = arguments;
-      for (var i = funcs.length - 1; i >= 0; i--) {
-        args = [funcs[i].apply(this, args)];
-      }
-      return args[0];
-    };
-  };
-
-  // Returns a function that will only be executed after being called N times.
-  _.after = function(times, func) {
-    if (times <= 0) return func();
-    return function() {
-      if (--times < 1) {
-        return func.apply(this, arguments);
-      }
-    };
-  };
-
-  // Object Functions
-  // ----------------
-
-  // Retrieve the names of an object's properties.
-  // Delegates to **ECMAScript 5**'s native `Object.keys`
-  _.keys = nativeKeys || function(obj) {
-    if (obj !== Object(obj)) throw new TypeError('Invalid object');
-    var keys = [];
-    for (var key in obj) if (_.has(obj, key)) keys[keys.length] = key;
-    return keys;
-  };
-
-  // Retrieve the values of an object's properties.
-  _.values = function(obj) {
-    var values = [];
-    for (var key in obj) if (_.has(obj, key)) values.push(obj[key]);
-    return values;
-  };
-
-  // Convert an object into a list of `[key, value]` pairs.
-  _.pairs = function(obj) {
-    var pairs = [];
-    for (var key in obj) if (_.has(obj, key)) pairs.push([key, obj[key]]);
-    return pairs;
-  };
-
-  // Invert the keys and values of an object. The values must be serializable.
-  _.invert = function(obj) {
-    var result = {};
-    for (var key in obj) if (_.has(obj, key)) result[obj[key]] = key;
-    return result;
-  };
-
-  // Return a sorted list of the function names available on the object.
-  // Aliased as `methods`
-  _.functions = _.methods = function(obj) {
-    var names = [];
-    for (var key in obj) {
-      if (_.isFunction(obj[key])) names.push(key);
-    }
-    return names.sort();
-  };
-
-  // Extend a given object with all the properties in passed-in object(s).
-  _.extend = function(obj) {
-    each(slice.call(arguments, 1), function(source) {
-      if (source) {
-        for (var prop in source) {
-          obj[prop] = source[prop];
-        }
-      }
-    });
-    return obj;
-  };
-
-  // Return a copy of the object only containing the whitelisted properties.
-  _.pick = function(obj) {
-    var copy = {};
-    var keys = concat.apply(ArrayProto, slice.call(arguments, 1));
-    each(keys, function(key) {
-      if (key in obj) copy[key] = obj[key];
-    });
-    return copy;
-  };
-
-   // Return a copy of the object without the blacklisted properties.
-  _.omit = function(obj) {
-    var copy = {};
-    var keys = concat.apply(ArrayProto, slice.call(arguments, 1));
-    for (var key in obj) {
-      if (!_.contains(keys, key)) copy[key] = obj[key];
-    }
-    return copy;
-  };
-
-  // Fill in a given object with default properties.
-  _.defaults = function(obj) {
-    each(slice.call(arguments, 1), function(source) {
-      if (source) {
-        for (var prop in source) {
-          if (obj[prop] == null) obj[prop] = source[prop];
-        }
-      }
-    });
-    return obj;
-  };
-
-  // Create a (shallow-cloned) duplicate of an object.
-  _.clone = function(obj) {
-    if (!_.isObject(obj)) return obj;
-    return _.isArray(obj) ? obj.slice() : _.extend({}, obj);
-  };
-
-  // Invokes interceptor with the obj, and then returns obj.
-  // The primary purpose of this method is to "tap into" a method chain, in
-  // order to perform operations on intermediate results within the chain.
-  _.tap = function(obj, interceptor) {
-    interceptor(obj);
-    return obj;
-  };
-
-  // Internal recursive comparison function for `isEqual`.
-  var eq = function(a, b, aStack, bStack) {
-    // Identical objects are equal. `0 === -0`, but they aren't identical.
-    // See the Harmony `egal` proposal: http://wiki.ecmascript.org/doku.php?id=harmony:egal.
-    if (a === b) return a !== 0 || 1 / a == 1 / b;
-    // A strict comparison is necessary because `null == undefined`.
-    if (a == null || b == null) return a === b;
-    // Unwrap any wrapped objects.
-    if (a instanceof _) a = a._wrapped;
-    if (b instanceof _) b = b._wrapped;
-    // Compare `[[Class]]` names.
-    var className = toString.call(a);
-    if (className != toString.call(b)) return false;
-    switch (className) {
-      // Strings, numbers, dates, and booleans are compared by value.
-      case '[object String]':
-        // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is
-        // equivalent to `new String("5")`.
-        return a == String(b);
-      case '[object Number]':
-        // `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for
-        // other numeric values.
-        return a != +a ? b != +b : (a == 0 ? 1 / a == 1 / b : a == +b);
-      case '[object Date]':
-      case '[object Boolean]':
-        // Coerce dates and booleans to numeric primitive values. Dates are compared by their
-        // millisecond representations. Note that invalid dates with millisecond representations
-        // of `NaN` are not equivalent.
-        return +a == +b;
-      // RegExps are compared by their source patterns and flags.
-      case '[object RegExp]':
-        return a.source == b.source &&
-               a.global == b.global &&
-               a.multiline == b.multiline &&
-               a.ignoreCase == b.ignoreCase;
-    }
-    if (typeof a != 'object' || typeof b != 'object') return false;
-    // Assume equality for cyclic structures. The algorithm for detecting cyclic
-    // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.
-    var length = aStack.length;
-    while (length--) {
-      // Linear search. Performance is inversely proportional to the number of
-      // unique nested structures.
-      if (aStack[length] == a) return bStack[length] == b;
-    }
-    // Add the first object to the stack of traversed objects.
-    aStack.push(a);
-    bStack.push(b);
-    var size = 0, result = true;
-    // Recursively compare objects and arrays.
-    if (className == '[object Array]') {
-      // Compare array lengths to determine if a deep comparison is necessary.
-      size = a.length;
-      result = size == b.length;
-      if (result) {
-        // Deep compare the contents, ignoring non-numeric properties.
-        while (size--) {
-          if (!(result = eq(a[size], b[size], aStack, bStack))) break;
-        }
-      }
-    } else {
-      // Objects with different constructors are not equivalent, but `Object`s
-      // from different frames are.
-      var aCtor = a.constructor, bCtor = b.constructor;
-      if (aCtor !== bCtor && !(_.isFunction(aCtor) && (aCtor instanceof aCtor) &&
-                               _.isFunction(bCtor) && (bCtor instanceof bCtor))) {
-        return false;
-      }
-      // Deep compare objects.
-      for (var key in a) {
-        if (_.has(a, key)) {
-          // Count the expected number of properties.
-          size++;
-          // Deep compare each member.
-          if (!(result = _.has(b, key) && eq(a[key], b[key], aStack, bStack))) break;
-        }
-      }
-      // Ensure that both objects contain the same number of properties.
-      if (result) {
-        for (key in b) {
-          if (_.has(b, key) && !(size--)) break;
-        }
-        result = !size;
-      }
-    }
-    // Remove the first object from the stack of traversed objects.
-    aStack.pop();
-    bStack.pop();
-    return result;
-  };
-
-  // Perform a deep comparison to check if two objects are equal.
-  _.isEqual = function(a, b) {
-    return eq(a, b, [], []);
-  };
-
-  // Is a given array, string, or object empty?
-  // An "empty" object has no enumerable own-properties.
-  _.isEmpty = function(obj) {
-    if (obj == null) return true;
-    if (_.isArray(obj) || _.isString(obj)) return obj.length === 0;
-    for (var key in obj) if (_.has(obj, key)) return false;
-    return true;
-  };
-
-  // Is a given value a DOM element?
-  _.isElement = function(obj) {
-    return !!(obj && obj.nodeType === 1);
-  };
-
-  // Is a given value an array?
-  // Delegates to ECMA5's native Array.isArray
-  _.isArray = nativeIsArray || function(obj) {
-    return toString.call(obj) == '[object Array]';
-  };
-
-  // Is a given variable an object?
-  _.isObject = function(obj) {
-    return obj === Object(obj);
-  };
-
-  // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp.
-  each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp'], function(name) {
-    _['is' + name] = function(obj) {
-      return toString.call(obj) == '[object ' + name + ']';
-    };
-  });
-
-  // Define a fallback version of the method in browsers (ahem, IE), where
-  // there isn't any inspectable "Arguments" type.
-  if (!_.isArguments(arguments)) {
-    _.isArguments = function(obj) {
-      return !!(obj && _.has(obj, 'callee'));
-    };
-  }
-
-  // Optimize `isFunction` if appropriate.
-  if (typeof (/./) !== 'function') {
-    _.isFunction = function(obj) {
-      return typeof obj === 'function';
-    };
-  }
-
-  // Is a given object a finite number?
-  _.isFinite = function(obj) {
-    return isFinite(obj) && !isNaN(parseFloat(obj));
-  };
-
-  // Is the given value `NaN`? (NaN is the only number which does not equal itself).
-  _.isNaN = function(obj) {
-    return _.isNumber(obj) && obj != +obj;
-  };
-
-  // Is a given value a boolean?
-  _.isBoolean = function(obj) {
-    return obj === true || obj === false || toString.call(obj) == '[object Boolean]';
-  };
-
-  // Is a given value equal to null?
-  _.isNull = function(obj) {
-    return obj === null;
-  };
-
-  // Is a given variable undefined?
-  _.isUndefined = function(obj) {
-    return obj === void 0;
-  };
-
-  // Shortcut function for checking if an object has a given property directly
-  // on itself (in other words, not on a prototype).
-  _.has = function(obj, key) {
-    return hasOwnProperty.call(obj, key);
-  };
-
-  // Utility Functions
-  // -----------------
-
-  // Run Underscore.js in *noConflict* mode, returning the `_` variable to its
-  // previous owner. Returns a reference to the Underscore object.
-  _.noConflict = function() {
-    root._ = previousUnderscore;
-    return this;
-  };
-
-  // Keep the identity function around for default iterators.
-  _.identity = function(value) {
-    return value;
-  };
-
-  // Run a function **n** times.
-  _.times = function(n, iterator, context) {
-    var accum = Array(n);
-    for (var i = 0; i < n; i++) accum[i] = iterator.call(context, i);
-    return accum;
-  };
-
-  // Return a random integer between min and max (inclusive).
-  _.random = function(min, max) {
-    if (max == null) {
-      max = min;
-      min = 0;
-    }
-    return min + Math.floor(Math.random() * (max - min + 1));
-  };
-
-  // List of HTML entities for escaping.
-  var entityMap = {
-    escape: {
-      '&': '&amp;',
-      '<': '&lt;',
-      '>': '&gt;',
-      '"': '&quot;',
-      "'": '&#x27;',
-      '/': '&#x2F;'
-    }
-  };
-  entityMap.unescape = _.invert(entityMap.escape);
-
-  // Regexes containing the keys and values listed immediately above.
-  var entityRegexes = {
-    escape:   new RegExp('[' + _.keys(entityMap.escape).join('') + ']', 'g'),
-    unescape: new RegExp('(' + _.keys(entityMap.unescape).join('|') + ')', 'g')
-  };
-
-  // Functions for escaping and unescaping strings to/from HTML interpolation.
-  _.each(['escape', 'unescape'], function(method) {
-    _[method] = function(string) {
-      if (string == null) return '';
-      return ('' + string).replace(entityRegexes[method], function(match) {
-        return entityMap[method][match];
-      });
-    };
-  });
-
-  // If the value of the named property is a function then invoke it;
-  // otherwise, return it.
-  _.result = function(object, property) {
-    if (object == null) return null;
-    var value = object[property];
-    return _.isFunction(value) ? value.call(object) : value;
-  };
-
-  // Add your own custom functions to the Underscore object.
-  _.mixin = function(obj) {
-    each(_.functions(obj), function(name){
-      var func = _[name] = obj[name];
-      _.prototype[name] = function() {
-        var args = [this._wrapped];
-        push.apply(args, arguments);
-        return result.call(this, func.apply(_, args));
-      };
-    });
-  };
-
-  // Generate a unique integer id (unique within the entire client session).
-  // Useful for temporary DOM ids.
-  var idCounter = 0;
-  _.uniqueId = function(prefix) {
-    var id = ++idCounter + '';
-    return prefix ? prefix + id : id;
-  };
-
-  // By default, Underscore uses ERB-style template delimiters, change the
-  // following template settings to use alternative delimiters.
-  _.templateSettings = {
-    evaluate    : /<%([\s\S]+?)%>/g,
-    interpolate : /<%=([\s\S]+?)%>/g,
-    escape      : /<%-([\s\S]+?)%>/g
-  };
-
-  // When customizing `templateSettings`, if you don't want to define an
-  // interpolation, evaluation or escaping regex, we need one that is
-  // guaranteed not to match.
-  var noMatch = /(.)^/;
-
-  // Certain characters need to be escaped so that they can be put into a
-  // string literal.
-  var escapes = {
-    "'":      "'",
-    '\\':     '\\',
-    '\r':     'r',
-    '\n':     'n',
-    '\t':     't',
-    '\u2028': 'u2028',
-    '\u2029': 'u2029'
-  };
-
-  var escaper = /\\|'|\r|\n|\t|\u2028|\u2029/g;
-
-  // JavaScript micro-templating, similar to John Resig's implementation.
-  // Underscore templating handles arbitrary delimiters, preserves whitespace,
-  // and correctly escapes quotes within interpolated code.
-  _.template = function(text, data, settings) {
-    var render;
-    settings = _.defaults({}, settings, _.templateSettings);
-
-    // Combine delimiters into one regular expression via alternation.
-    var matcher = new RegExp([
-      (settings.escape || noMatch).source,
-      (settings.interpolate || noMatch).source,
-      (settings.evaluate || noMatch).source
-    ].join('|') + '|$', 'g');
-
-    // Compile the template source, escaping string literals appropriately.
-    var index = 0;
-    var source = "__p+='";
-    text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {
-      source += text.slice(index, offset)
-        .replace(escaper, function(match) { return '\\' + escapes[match]; });
-
-      if (escape) {
-        source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'";
-      }
-      if (interpolate) {
-        source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'";
-      }
-      if (evaluate) {
-        source += "';\n" + evaluate + "\n__p+='";
-      }
-      index = offset + match.length;
-      return match;
-    });
-    source += "';\n";
-
-    // If a variable is not specified, place data values in local scope.
-    if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n';
-
-    source = "var __t,__p='',__j=Array.prototype.join," +
-      "print=function(){__p+=__j.call(arguments,'');};\n" +
-      source + "return __p;\n";
-
-    try {
-      render = new Function(settings.variable || 'obj', '_', source);
-    } catch (e) {
-      e.source = source;
-      throw e;
-    }
-
-    if (data) return render(data, _);
-    var template = function(data) {
-      return render.call(this, data, _);
-    };
-
-    // Provide the compiled function source as a convenience for precompilation.
-    template.source = 'function(' + (settings.variable || 'obj') + '){\n' + source + '}';
-
-    return template;
-  };
-
-  // Add a "chain" function, which will delegate to the wrapper.
-  _.chain = function(obj) {
-    return _(obj).chain();
-  };
-
-  // OOP
-  // ---------------
-  // If Underscore is called as a function, it returns a wrapped object that
-  // can be used OO-style. This wrapper holds altered versions of all the
-  // underscore functions. Wrapped objects may be chained.
-
-  // Helper function to continue chaining intermediate results.
-  var result = function(obj) {
-    return this._chain ? _(obj).chain() : obj;
-  };
-
-  // Add all of the Underscore functions to the wrapper object.
-  _.mixin(_);
-
-  // Add all mutator Array functions to the wrapper.
-  each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {
-    var method = ArrayProto[name];
-    _.prototype[name] = function() {
-      var obj = this._wrapped;
-      method.apply(obj, arguments);
-      if ((name == 'shift' || name == 'splice') && obj.length === 0) delete obj[0];
-      return result.call(this, obj);
-    };
-  });
-
-  // Add all accessor Array functions to the wrapper.
-  each(['concat', 'join', 'slice'], function(name) {
-    var method = ArrayProto[name];
-    _.prototype[name] = function() {
-      return result.call(this, method.apply(this._wrapped, arguments));
-    };
-  });
-
-  _.extend(_.prototype, {
-
-    // Start chaining a wrapped Underscore object.
-    chain: function() {
-      this._chain = true;
-      return this;
-    },
-
-    // Extracts the result from a wrapped and chained object.
-    value: function() {
-      return this._wrapped;
-    }
-
-  });
-
-}).call(this);

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/js/model/app-tree.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/js/model/app-tree.js b/brooklyn-ui/src/main/webapp/assets/js/model/app-tree.js
deleted file mode 100644
index 67efd91..0000000
--- a/brooklyn-ui/src/main/webapp/assets/js/model/app-tree.js
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-define([
-    "underscore", "backbone"
-], function (_, Backbone) {
-
-    var AppTree = {};
-
-    AppTree.Model = Backbone.Model.extend({
-        defaults: function() {
-            return {
-                id: "",
-                name: "",
-                type: "",
-                iconUrl: "",
-                serviceUp: "",
-                serviceState: "",
-                applicationId: "",
-                parentId: "",
-                children: [],
-                members: []
-            };
-        },
-        getDisplayName: function() {
-            return this.get("name");
-        },
-        hasChildren: function() {
-            return this.get("children").length > 0;
-        },
-        hasMembers: function() {
-            return this.get("members").length > 0;
-        }
-    })
-
-    AppTree.Collection = Backbone.Collection.extend({
-        model: AppTree.Model,
-        includedEntities: [],
-
-        getApplications: function() {
-            var entities = [];
-            _.each(this.models, function(it) {
-                if (it.get('id') == it.get('applicationId'))
-                    entities.push(it.get('id'));
-            });
-            return entities;
-        },
-
-        getNonApplications: function() {
-            var entities = [];
-            _.each(this.models, function(it) {
-                if (it.get('id') != it.get('applicationId'))
-                    entities.push(it.get('id'));
-            });
-            return entities;
-        },
-
-        includeEntities: function(entities) {
-            // accepts id as string or object with id field
-            var oldLength = this.includedEntities.length;
-            var newList = [].concat(this.includedEntities);
-            for (entityId in entities) {
-                var entity = entities[entityId];
-                if (typeof entity === 'string')
-                    newList.push(entity);
-                else
-                    newList.push(entity.id);
-            }
-            this.includedEntities = _.uniq(newList);
-            return (this.includedEntities.length > oldLength);
-        },
-
-        /**
-         * Depth-first search of entries in this.models for the first entity whose ID matches the
-         * function's argument. Includes each entity's children.
-         */
-        getEntityNameFromId: function (id) {
-            if (!this.models.length) return undefined;
-
-            for (var i = 0, l = this.models.length; i < l; i++) {
-                var model = this.models[i];
-                if (model.get("id") === id) {
-                    return model.getDisplayName();
-                } else {
-                    // slice(0) makes a shallow clone of the array
-                    var queue = model.get("children").slice(0);
-                    while (queue.length) {
-                        var child = queue.pop();
-                        if (child.id === id) {
-                            return child.name;
-                        } else {
-                            if (_.has(child, 'children')) {
-                                queue = queue.concat(child.children);
-                            }
-                        }
-                    }
-                }
-            }
-
-            // Is this surprising? If we returned undefined and the caller concatenates it with
-            // a string they'll get "stringundefined", whereas this way they'll just get "string".
-            return "";
-        },
-
-        url: function() {
-            if (this.includedEntities.length) {
-                var ids = this.includedEntities.join(",");
-                return "/v1/applications/fetch?items="+ids;
-            } else
-                return "/v1/applications/fetch";
-        }
-    });
-
-    return AppTree;
-})
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/js/model/application.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/js/model/application.js b/brooklyn-ui/src/main/webapp/assets/js/model/application.js
deleted file mode 100644
index 589ea40..0000000
--- a/brooklyn-ui/src/main/webapp/assets/js/model/application.js
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-/**
- * Models an application.
- */
-define([
-    "underscore", "backbone"
-], function (_, Backbone) {
-
-    var Application = {}
-
-    Application.Spec = Backbone.Model.extend({
-        defaults:function () {
-            return {
-                id:null,
-                name:"",
-                type:null,
-                entities:null,
-                locations:[]
-            }
-        },
-        hasLocation:function (location) {
-            if (location) return _.include(this.get('locations'), location)
-        },
-        addLocation:function (location) {
-            var locations = this.get('locations')
-            locations.push(location)
-            this.set('locations', locations)
-            this.trigger("change")
-            this.trigger("change:locations")
-        },
-        removeLocation:function (location) {
-            var newLocations = [],
-                currentLocations = this.get("locations")
-            for (var index in currentLocations) {
-                if (currentLocations[index] != location && index != null)
-                    newLocations.push(currentLocations[index])
-            }
-            this.set('locations', newLocations)
-        },
-        removeLocationIndex:function (locationNumber) {
-            var newLocations = [],
-                currentLocations = this.get("locations")
-            for (var index=0; index<currentLocations.length; index++) {
-                if (index != locationNumber)
-                    newLocations.push(currentLocations[index])
-            }
-            this.set('locations', newLocations)
-        },
-        /* Drops falsy locations */
-        pruneLocations: function() {
-            var newLocations = _.compact(this.get('locations'));
-            if (newLocations && _.size(newLocations)) this.set('locations', newLocations);
-            else this.unset("locations");
-        },
-        setLocationAtIndex:function (locationNumber, val) {
-            var newLocations = [],
-                currentLocations = this.get("locations")
-            for (var index=0; index<currentLocations.length; index++) {
-                if (index != locationNumber)
-                    newLocations.push(currentLocations[index])
-                else
-                    newLocations.push(val)
-            }
-            this.set('locations', newLocations)
-        },
-        getEntities: function() {
-            var entities = this.get('entities')
-            if (entities === undefined) return [];
-            return entities;
-        },
-        addEntity:function (entity) {
-            var entities = this.getEntities()
-            if (!entities) {
-                entities = []
-                this.set("entities", entities)
-            }
-            entities.push(entity.toJSON())
-            this.set('entities', entities)
-            this.trigger("change")
-            this.trigger("change:entities")
-        },
-        removeEntityIndex:function (indexToRemove) {
-            var newEntities = [],
-                currentEntities = this.getEntities()
-            for (var index=0; index<currentEntities.length; index++) {
-                if (index != indexToRemove)
-                    newEntities.push(currentEntities[index])
-            }
-            this.set('entities', newEntities)
-        },
-        removeEntityByName:function (name) {
-            var newEntities = [],
-                currentEntities = this.getEntities()
-            for (var index in currentEntities) {
-                if (currentEntities[index].name != name)
-                    newEntities.push(currentEntities[index])
-            }
-            this.set('entities', newEntities)
-        },
-        hasEntityWithName:function (name) {
-            return _.any(this.getEntities(), function (entity) {
-                return entity.name === name
-            })
-        }
-    })
-
-    Application.Model = Backbone.Model.extend({
-        defaults:function () {
-            return{
-                id:null,
-                spec:{},
-                status:"UNKNOWN",
-                links:{}
-            }
-        },
-        initialize:function () {
-            this.id = this.get("id")
-        },
-        getSpec:function () {
-            return new Application.Spec(this.get('spec'))
-        },
-        getLinkByName:function (name) {
-            if (name) return this.get("links")[name]
-        }
-    })
-
-    Application.Collection = Backbone.Collection.extend({
-        model:Application.Model,
-        url:'/v1/applications'
-    })
-
-    return Application
-})
-

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/js/model/catalog-application.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/js/model/catalog-application.js b/brooklyn-ui/src/main/webapp/assets/js/model/catalog-application.js
deleted file mode 100644
index 73b4d03..0000000
--- a/brooklyn-ui/src/main/webapp/assets/js/model/catalog-application.js
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-define(["underscore", "backbone"], function (_, Backbone) {
-    
-    var CatalogApplication = {}
-
-    CatalogApplication.Model = Backbone.Model.extend({
-        defaults: function () {
-            return {
-                id: "",
-                type: "",
-                name: "",
-                version: "",
-                description: "",
-                planYaml: "",
-                iconUrl: ""
-            }
-        }
-    })
-
-    CatalogApplication.Collection = Backbone.Collection.extend({
-        model: CatalogApplication.Model,
-        url: '/v1/catalog/applications',
-        getDistinctApplications: function() {
-            return this.groupBy('type');
-        },
-        getTypes: function(type) {
-            return _.uniq(this.chain().map(function(model) {return model.get('type')}).value());
-        },
-        hasType: function(type) {
-            return this.where({type: type}).length > 0;
-        },
-        getVersions: function(type) {
-            return this.chain().filter(function(model) {return model.get('type') === type}).map(function(model) {return model.get('version')}).value();
-        }
-    })
-
-    return CatalogApplication
-})
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/js/model/catalog-item-summary.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/js/model/catalog-item-summary.js b/brooklyn-ui/src/main/webapp/assets/js/model/catalog-item-summary.js
deleted file mode 100644
index 60d1eda..0000000
--- a/brooklyn-ui/src/main/webapp/assets/js/model/catalog-item-summary.js
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-define(["underscore", "backbone"], function (_, Backbone) {
-
-    // NB: THIS IS NOT USED CURRENTLY
-    // the logic in application-add-wizard.js simply loads and manipulates json;
-    // logic in catalog.js (view) defines its own local model
-    // TODO change those so that they use this backbone model + collection,
-    // allowing a way to specify on creation what we are looking up in the catalog -- apps or entities or policies
-    
-    var CatalogItem = {}
-
-    CatalogItem.Model = Backbone.Model.extend({
-        defaults:function () {
-            return {
-                id:"",
-                name:"",
-                type:"",
-                description:"",
-                planYaml:"",
-                iconUrl:""
-            }
-        }
-    })
-
-    CatalogItem.Collection = Backbone.Collection.extend({
-        model:CatalogItem.Model,
-        url:'/v1/catalog'  // TODO is this application or entities or policies? (but note THIS IS NOT USED)
-    })
-
-    return CatalogItem
-})
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/js/model/config-summary.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/js/model/config-summary.js b/brooklyn-ui/src/main/webapp/assets/js/model/config-summary.js
deleted file mode 100644
index 2f6102b..0000000
--- a/brooklyn-ui/src/main/webapp/assets/js/model/config-summary.js
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-define([
-    "jquery", 'backbone'
-], function ($, Backbone) {
-
-    var ConfigSummary = {}
-
-    ConfigSummary.Model = Backbone.Model.extend({
-        defaults:function () {
-            return {
-                name:'',
-                type:'',
-                description:'',
-                links:{}
-            }
-        },
-        getLinkByName:function (name) {
-            if (name) return this.get("links")[name]
-        }
-    })
-
-    ConfigSummary.Collection = Backbone.Collection.extend({
-        model:ConfigSummary.Model
-    })
-
-    return ConfigSummary
-})
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/js/model/effector-param.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/js/model/effector-param.js b/brooklyn-ui/src/main/webapp/assets/js/model/effector-param.js
deleted file mode 100644
index ea0d510..0000000
--- a/brooklyn-ui/src/main/webapp/assets/js/model/effector-param.js
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-define([
-    "backbone"
-], function (Backbone) {
-
-    var Param = {}
-
-    Param.Model = Backbone.Model.extend({
-        defaults:function () {
-            return {
-                name:"",
-                type:"",
-                description:"",
-                defaultValue:""
-            }
-        }
-    })
-
-    Param.Collection = Backbone.Collection.extend({
-        model:Param.Model
-    })
-
-    return Param
-})
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/js/model/effector-summary.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/js/model/effector-summary.js b/brooklyn-ui/src/main/webapp/assets/js/model/effector-summary.js
deleted file mode 100644
index 0524a23..0000000
--- a/brooklyn-ui/src/main/webapp/assets/js/model/effector-summary.js
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-define([
-    "underscore", "backbone"
-], function (_, Backbone) {
-
-    var EffectorSummary = {}
-
-    EffectorSummary.Model = Backbone.Model.extend({
-        idAttribute: 'name',
-        defaults:function () {
-            return {
-                name:"",
-                description:"",
-                returnType:"",
-                parameters:[],
-                links:{
-                    self:"",
-                    entity:"",
-                    application:""
-                }
-            }
-        },
-        getParameterByName:function (name) {
-            if (name) {
-                return _.find(this.get("parameters"), function (param) {
-                    return param.name == name
-                })
-            }
-        },
-        getLinkByName:function (name) {
-            if (name) return this.get("links")[name]
-        }
-    })
-
-    EffectorSummary.Collection = Backbone.Collection.extend({
-        model:EffectorSummary.Model
-    })
-
-    return EffectorSummary
-})
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/js/model/entity-summary.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/js/model/entity-summary.js b/brooklyn-ui/src/main/webapp/assets/js/model/entity-summary.js
deleted file mode 100644
index d8a3d66..0000000
--- a/brooklyn-ui/src/main/webapp/assets/js/model/entity-summary.js
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-define(["underscore", "backbone"], function (_, Backbone) {
-
-    var EntitySummary = {}
-
-    EntitySummary.Model = Backbone.Model.extend({
-        defaults:function () {
-            return {
-                'id':'',
-                'name':'',
-                'type':'',
-                'catalogItemId':'',
-                'links':{}
-            }
-        },
-        getLinkByName:function (name) {
-            if (name) return this.get("links")[name]
-        },
-        getDisplayName:function () {
-            var name = this.get("name")
-            if (name) return name;
-            var type = this.get("type")
-            var appId = this.getLinkByName('self')
-            if (type && appId) {
-                return type.slice(type.lastIndexOf('.') + 1) + ':' + appId.slice(appId.lastIndexOf('/') + 1)
-            }
-        },
-        getSensorUpdateUrl:function () {
-            return this.getLinkByName("self") + "/sensors/current-state"
-        },
-        getConfigUpdateUrl:function () {
-            return this.getLinkByName("self") + "/config/current-state"
-        }
-    })
-
-    EntitySummary.Collection = Backbone.Collection.extend({
-        model:EntitySummary.Model,
-        url:'entity-summary-collection',
-        findByDisplayName:function (displayName) {
-            if (displayName) return this.filter(function (element) {
-                return element.getDisplayName() === displayName
-            })
-        }
-    })
-
-    return EntitySummary
-})
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/js/model/entity.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/js/model/entity.js b/brooklyn-ui/src/main/webapp/assets/js/model/entity.js
deleted file mode 100644
index fc83743..0000000
--- a/brooklyn-ui/src/main/webapp/assets/js/model/entity.js
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-define(["underscore", "backbone"], function (_, Backbone) {
-
-    var Entity = {}
-
-    Entity.Model = Backbone.Model.extend({
-        defaults:function () {
-            return {
-                name:"",
-                type:"",
-                config:{}
-            }
-        },
-        getVersionedAttr: function(name) {
-            var attr = this.get(name);
-            var version = this.get('version');
-            if (version && version != '0.0.0.SNAPSHOT') {
-                return attr + ':' + version;
-            } else {
-                return attr;
-            }
-        },
-        url: function() {
-            var base = _.result(this, 'urlRoot') || _.result(this.collection, 'url') || urlError();
-            if (this.isNew()) return base;
-            return base + (base.charAt(base.length - 1) === '/' ? '' : '/') + 
-                encodeURIComponent(this.get("symbolicName")) + '/' + encodeURIComponent(this.get("version"));
-        },
-        getConfigByName:function (key) {
-            if (key) return this.get("config")[key]
-        },
-        addConfig:function (key, value) {
-            if (key) {
-                var configs = this.get("config")
-                configs[key] = value
-                this.set('config', configs)
-                this.trigger("change")
-                this.trigger("change:config")
-                return true
-            }
-            return false
-        },
-        removeConfig:function (key) {
-            if (key) {
-                var configs = this.get('config')
-                delete configs[key]
-                this.set('config', configs)
-                this.trigger("change")
-                this.trigger("change:config")
-                return true
-            }
-            return false
-        }
-    })
-
-    Entity.Collection = Backbone.Collection.extend({
-        model:Entity.Model,
-        url:'entity-collection'
-    })
-
-    return Entity
-})
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/js/model/location.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/js/model/location.js b/brooklyn-ui/src/main/webapp/assets/js/model/location.js
deleted file mode 100644
index 4e33860..0000000
--- a/brooklyn-ui/src/main/webapp/assets/js/model/location.js
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-define(["underscore", "backbone"], function (_, Backbone) {
-
-    var Location = {}
-
-    Location.Model = Backbone.Model.extend({
-        urlRoot:'/v1/locations',
-        defaults:function () {
-            return {
-                name:'',
-                spec:'',
-                config:{}
-            }
-        },
-        idFromSelfLink:function () {
-            return this.get('id');
-        },
-        initialize:function () {
-        },
-        addConfig:function (key, value) {
-            if (key) {
-                var configs = this.get("config")
-                configs[key] = value
-                this.set('config', configs)
-                return true
-            }
-            return false
-        },
-        removeConfig:function (key) {
-            if (key) {
-                var configs = this.get('config')
-                delete configs[key]
-                this.set('config', configs)
-                return true
-            }
-            return false
-        },
-        getConfigByName:function (name) {
-            if (name) return this.get("config")[name]
-        },
-        getLinkByName:function (name) {
-            if (name) return this.get("links")[name]
-        },
-        hasSelfUrl:function (url) {
-            return (this.getLinkByName("self") === url)
-        },
-        getPrettyName: function() {
-            var name = null;
-            if (this.get('config') && this.get('config')['displayName'])
-                name = this.get('config')['displayName'];
-            if (name!=null && name.length>0) return name
-            name = this.get('name')
-            if (name!=null && name.length>0) return name
-            return this.get('spec')
-        },
-        getIdentifierName: function() {
-            var name = null;
-            name = this.get('name')
-            if (name!=null && name.length>0) return name
-            return this.get('spec')
-        }
-
-    })
-
-    Location.Collection = Backbone.Collection.extend({
-        model:Location.Model,
-        url:'/v1/locations'
-    })
-
-    Location.UsageLocated = Backbone.Model.extend({
-        url:'/v1/locations/usage/LocatedLocations'
-    })
-
-    return Location
-})
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/js/model/policy-config-summary.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/js/model/policy-config-summary.js b/brooklyn-ui/src/main/webapp/assets/js/model/policy-config-summary.js
deleted file mode 100644
index 4c1da98..0000000
--- a/brooklyn-ui/src/main/webapp/assets/js/model/policy-config-summary.js
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-define([
-    "underscore", "backbone"
-], function (_, Backbone) {
-
-    var PolicyConfigSummary = {}
-
-    PolicyConfigSummary.Model = Backbone.Model.extend({
-        defaults:function () {
-            return {
-                name:"",
-                type:"",
-                description:"",
-                defaultValue:"",
-                value:"",
-                reconfigurable:"",
-                links:{
-                    self:"",
-                    application:"",
-                    entity:"",
-                    policy:"",
-                    edit:""
-                }
-            }
-        },
-        getLinkByName:function (name) {
-            if (name) return this.get("links")[name]
-        }
-    })
-
-    PolicyConfigSummary.Collection = Backbone.Collection.extend({
-        model:PolicyConfigSummary.Model
-    })
-
-    return PolicyConfigSummary
-})
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/js/model/policy-summary.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/js/model/policy-summary.js b/brooklyn-ui/src/main/webapp/assets/js/model/policy-summary.js
deleted file mode 100644
index 9dc6932..0000000
--- a/brooklyn-ui/src/main/webapp/assets/js/model/policy-summary.js
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-define([
-    "underscore", "backbone"
-], function (_, Backbone) {
-
-    var PolicySummary = {}
-
-    PolicySummary.Model = Backbone.Model.extend({
-        defaults:function () {
-            return {
-                id:"",
-                name:"",
-                state:"",
-                links:{
-                    self:"",
-                    config:"",
-                    start:"",
-                    stop:"",
-                    destroy:"",
-                    entity:"",
-                    application:""
-                }
-            }
-        },
-        getLinkByName:function (name) {
-            if (name) return this.get("links")[name]
-        },
-        getPolicyConfigUpdateUrl:function () {
-            return this.getLinkByName("self") + "/config/current-state"
-        }
-    })
-
-    PolicySummary.Collection = Backbone.Collection.extend({
-        model:PolicySummary.Model
-    })
-
-    return PolicySummary
-})
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/js/model/sensor-summary.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/js/model/sensor-summary.js b/brooklyn-ui/src/main/webapp/assets/js/model/sensor-summary.js
deleted file mode 100644
index 5f9bcbe..0000000
--- a/brooklyn-ui/src/main/webapp/assets/js/model/sensor-summary.js
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-define([
-    "jquery", 'backbone'
-], function ($, Backbone) {
-
-    var SensorSummary = {}
-
-    SensorSummary.Model = Backbone.Model.extend({
-        defaults:function () {
-            return {
-                name:'',
-                type:'',
-                description:'',
-                links:{}
-            }
-        },
-        getLinkByName:function (name) {
-            if (name) return this.get("links")[name]
-        }
-    })
-
-    SensorSummary.Collection = Backbone.Collection.extend({
-        model:SensorSummary.Model
-    })
-
-    return SensorSummary
-})
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/js/model/server-extended-status.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/js/model/server-extended-status.js b/brooklyn-ui/src/main/webapp/assets/js/model/server-extended-status.js
deleted file mode 100644
index aa9e5fa..0000000
--- a/brooklyn-ui/src/main/webapp/assets/js/model/server-extended-status.js
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-define(["backbone", "brooklyn", "view/viewutils"], function (Backbone, Brooklyn, ViewUtils) {
-
-    var ServerExtendedStatus = Backbone.Model.extend({
-        callbacks: [],
-        loaded: false,
-        url: "/v1/server/up/extended",
-        onError: function(thiz,xhr,modelish) {
-            log("ServerExtendedStatus: error contacting Brooklyn server");
-            log(xhr);
-            if (xhr.readyState==0) {
-                // server not contactable
-                this.loaded = false;
-            } else {
-                // server error
-                log(xhr.responseText);
-                // simply set unhealthy
-                this.set("healthy", false);
-            }
-            this.applyCallbacks();
-        },
-        whenUp: function(f) {
-            var that = this;
-            if (this.isUp()) {
-                f();
-            } else {
-                this.addCallback(function() { that.whenUp(f); });
-            }
-        },
-        onLoad: function(f) {
-            if (this.loaded) {
-                f();
-            } else {
-                this.addCallback(f);
-            }
-        },
-        addCallback: function(f) {
-            this.callbacks.push(f);
-        },
-        autoUpdate: function() {
-            var that = this;
-            // to debug:
-//            serverExtendedStatus.onLoad(function() { log("loaded server status:"); log(that.attributes); })
-            ViewUtils.fetchModelRepeatedlyWithDelay(this, { doitnow: true, backoffMaxPeriod: 3000 });
-        },
-
-        isUp: function() { return this.get("up") },
-        isShuttingDown: function() { return this.get("shuttingDown") },
-        isHealthy: function() { return this.get("healthy") },
-        isMaster: function() {
-            ha = this.get("ha") || {};
-            ownId = ha.ownId;
-            if (!ownId) return null;
-            return ha.masterId == ownId;
-        },
-        getMasterUri: function() {
-            // Might be undefined if first fetch hasn't completed
-            ha = this.get("ha") || {};
-            nodes = ha.nodes || {};
-            master = nodes[ha.masterId];
-            if (!master || master.status != "MASTER") {
-                return null;
-            } else {
-                return master.nodeUri;
-            }
-        },
-        applyCallbacks: function() {
-            var currentCallbacks = this.callbacks;
-            this.callbacks = [];
-            _.invoke(currentCallbacks, "apply");
-        },
-    });
-
-    var serverExtendedStatus = new ServerExtendedStatus();
-    serverExtendedStatus.on("sync", function() {
-        serverExtendedStatus.loaded = true;
-        serverExtendedStatus.applyCallbacks();
-    });
-    serverExtendedStatus.on("error", serverExtendedStatus.onError);
-
-    // Will returning the instance rather than the object be confusing?
-    // It breaks the pattern used by all the other models.
-    return serverExtendedStatus;
-
-});
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/js/model/task-summary.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/js/model/task-summary.js b/brooklyn-ui/src/main/webapp/assets/js/model/task-summary.js
deleted file mode 100644
index 6a54e4b..0000000
--- a/brooklyn-ui/src/main/webapp/assets/js/model/task-summary.js
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-define([
-    "underscore", "backbone"
-], function (_, Backbone) {
-
-    var TaskSummary = {};
-
-    TaskSummary.Model = Backbone.Model.extend({
-        defaults:function () {
-            return {
-                id:"",
-                links:{},
-                displayName:"",
-                description:"",
-                entityId:"",
-                entityDisplayName:"",
-                tags:{},
-                submitTimeUtc:null,
-                startTimeUtc:null,
-                endTimeUtc:null,
-                currentStatus:"",
-                result:null,
-                isError:null,
-                isCancelled:null,
-                children:[],
-                detailedStatus:"",
-                blockingTask:null,
-                blockingDetails:null,
-                // missing some from TaskSummary (e.g. streams, isError), 
-                // but that's fine, worst case they come back null / undefined
-            };
-        },
-        getTagByName:function (name) {
-            if (name) return this.get("tags")[name];
-        },
-        isError: function() { return this.attributes.isError==true; },
-        isGlobalTopLevel: function() {
-            return this.attributes.submittedByTask == null;
-        },
-        isLocalTopLevel: function() {
-            var submitter = this.attributes.submittedByTask;
-            return (submitter==null ||
-                    (submitter.metadata && submitter.metadata.id != this.id)); 
-        },
-        
-        // added from https://github.com/jashkenas/backbone/issues/1069#issuecomment-17511573
-        // to clear attributes locally if they aren't in the server-side function
-        parse: function(resp) {
-            _.forEach(_.keys(this.attributes), function(key) {
-              if (resp[key] === undefined) {
-                resp[key] = null;
-              }
-            });
-
-            return resp;
-        }
-    });
-
-    TaskSummary.Collection = Backbone.Collection.extend({
-        model:TaskSummary.Model
-    });
-
-    return TaskSummary;
-});


[14/51] [abbrv] [partial] brooklyn-ui git commit: move subdir from incubator up a level as it is promoted to its own repo (first non-incubator commit!)

Posted by he...@apache.org.
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/js/libs/backbone.js
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/js/libs/backbone.js b/src/main/webapp/assets/js/libs/backbone.js
new file mode 100644
index 0000000..3512d42
--- /dev/null
+++ b/src/main/webapp/assets/js/libs/backbone.js
@@ -0,0 +1,1571 @@
+//     Backbone.js 1.0.0
+
+//     (c) 2010-2013 Jeremy Ashkenas, DocumentCloud Inc.
+//     Backbone may be freely distributed under the MIT license.
+//     For all details and documentation:
+//     http://backbonejs.org
+
+(function(){
+
+  // Initial Setup
+  // -------------
+
+  // Save a reference to the global object (`window` in the browser, `exports`
+  // on the server).
+  var root = this;
+
+  // Save the previous value of the `Backbone` variable, so that it can be
+  // restored later on, if `noConflict` is used.
+  var previousBackbone = root.Backbone;
+
+  // Create local references to array methods we'll want to use later.
+  var array = [];
+  var push = array.push;
+  var slice = array.slice;
+  var splice = array.splice;
+
+  // The top-level namespace. All public Backbone classes and modules will
+  // be attached to this. Exported for both the browser and the server.
+  var Backbone;
+  if (typeof exports !== 'undefined') {
+    Backbone = exports;
+  } else {
+    Backbone = root.Backbone = {};
+  }
+
+  // Current version of the library. Keep in sync with `package.json`.
+  Backbone.VERSION = '1.0.0';
+
+  // Require Underscore, if we're on the server, and it's not already present.
+  var _ = root._;
+  if (!_ && (typeof require !== 'undefined')) _ = require('underscore');
+
+  // For Backbone's purposes, jQuery, Zepto, Ender, or My Library (kidding) owns
+  // the `$` variable.
+  Backbone.$ = root.jQuery || root.Zepto || root.ender || root.$;
+
+  // Runs Backbone.js in *noConflict* mode, returning the `Backbone` variable
+  // to its previous owner. Returns a reference to this Backbone object.
+  Backbone.noConflict = function() {
+    root.Backbone = previousBackbone;
+    return this;
+  };
+
+  // Turn on `emulateHTTP` to support legacy HTTP servers. Setting this option
+  // will fake `"PUT"` and `"DELETE"` requests via the `_method` parameter and
+  // set a `X-Http-Method-Override` header.
+  Backbone.emulateHTTP = false;
+
+  // Turn on `emulateJSON` to support legacy servers that can't deal with direct
+  // `application/json` requests ... will encode the body as
+  // `application/x-www-form-urlencoded` instead and will send the model in a
+  // form param named `model`.
+  Backbone.emulateJSON = false;
+
+  // Backbone.Events
+  // ---------------
+
+  // A module that can be mixed in to *any object* in order to provide it with
+  // custom events. You may bind with `on` or remove with `off` callback
+  // functions to an event; `trigger`-ing an event fires all callbacks in
+  // succession.
+  //
+  //     var object = {};
+  //     _.extend(object, Backbone.Events);
+  //     object.on('expand', function(){ alert('expanded'); });
+  //     object.trigger('expand');
+  //
+  var Events = Backbone.Events = {
+
+    // Bind an event to a `callback` function. Passing `"all"` will bind
+    // the callback to all events fired.
+    on: function(name, callback, context) {
+      if (!eventsApi(this, 'on', name, [callback, context]) || !callback) return this;
+      this._events || (this._events = {});
+      var events = this._events[name] || (this._events[name] = []);
+      events.push({callback: callback, context: context, ctx: context || this});
+      return this;
+    },
+
+    // Bind an event to only be triggered a single time. After the first time
+    // the callback is invoked, it will be removed.
+    once: function(name, callback, context) {
+      if (!eventsApi(this, 'once', name, [callback, context]) || !callback) return this;
+      var self = this;
+      var once = _.once(function() {
+        self.off(name, once);
+        callback.apply(this, arguments);
+      });
+      once._callback = callback;
+      return this.on(name, once, context);
+    },
+
+    // Remove one or many callbacks. If `context` is null, removes all
+    // callbacks with that function. If `callback` is null, removes all
+    // callbacks for the event. If `name` is null, removes all bound
+    // callbacks for all events.
+    off: function(name, callback, context) {
+      var retain, ev, events, names, i, l, j, k;
+      if (!this._events || !eventsApi(this, 'off', name, [callback, context])) return this;
+      if (!name && !callback && !context) {
+        this._events = {};
+        return this;
+      }
+
+      names = name ? [name] : _.keys(this._events);
+      for (i = 0, l = names.length; i < l; i++) {
+        name = names[i];
+        if (events = this._events[name]) {
+          this._events[name] = retain = [];
+          if (callback || context) {
+            for (j = 0, k = events.length; j < k; j++) {
+              ev = events[j];
+              if ((callback && callback !== ev.callback && callback !== ev.callback._callback) ||
+                  (context && context !== ev.context)) {
+                retain.push(ev);
+              }
+            }
+          }
+          if (!retain.length) delete this._events[name];
+        }
+      }
+
+      return this;
+    },
+
+    // Trigger one or many events, firing all bound callbacks. Callbacks are
+    // passed the same arguments as `trigger` is, apart from the event name
+    // (unless you're listening on `"all"`, which will cause your callback to
+    // receive the true name of the event as the first argument).
+    trigger: function(name) {
+      if (!this._events) return this;
+      var args = slice.call(arguments, 1);
+      if (!eventsApi(this, 'trigger', name, args)) return this;
+      var events = this._events[name];
+      var allEvents = this._events.all;
+      if (events) triggerEvents(events, args);
+      if (allEvents) triggerEvents(allEvents, arguments);
+      return this;
+    },
+
+    // Tell this object to stop listening to either specific events ... or
+    // to every object it's currently listening to.
+    stopListening: function(obj, name, callback) {
+      var listeners = this._listeners;
+      if (!listeners) return this;
+      var deleteListener = !name && !callback;
+      if (typeof name === 'object') callback = this;
+      if (obj) (listeners = {})[obj._listenerId] = obj;
+      for (var id in listeners) {
+        listeners[id].off(name, callback, this);
+        if (deleteListener) delete this._listeners[id];
+      }
+      return this;
+    }
+
+  };
+
+  // Regular expression used to split event strings.
+  var eventSplitter = /\s+/;
+
+  // Implement fancy features of the Events API such as multiple event
+  // names `"change blur"` and jQuery-style event maps `{change: action}`
+  // in terms of the existing API.
+  var eventsApi = function(obj, action, name, rest) {
+    if (!name) return true;
+
+    // Handle event maps.
+    if (typeof name === 'object') {
+      for (var key in name) {
+        obj[action].apply(obj, [key, name[key]].concat(rest));
+      }
+      return false;
+    }
+
+    // Handle space separated event names.
+    if (eventSplitter.test(name)) {
+      var names = name.split(eventSplitter);
+      for (var i = 0, l = names.length; i < l; i++) {
+        obj[action].apply(obj, [names[i]].concat(rest));
+      }
+      return false;
+    }
+
+    return true;
+  };
+
+  // A difficult-to-believe, but optimized internal dispatch function for
+  // triggering events. Tries to keep the usual cases speedy (most internal
+  // Backbone events have 3 arguments).
+  var triggerEvents = function(events, args) {
+    var ev, i = -1, l = events.length, a1 = args[0], a2 = args[1], a3 = args[2];
+    switch (args.length) {
+      case 0: while (++i < l) (ev = events[i]).callback.call(ev.ctx); return;
+      case 1: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1); return;
+      case 2: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2); return;
+      case 3: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2, a3); return;
+      default: while (++i < l) (ev = events[i]).callback.apply(ev.ctx, args);
+    }
+  };
+
+  var listenMethods = {listenTo: 'on', listenToOnce: 'once'};
+
+  // Inversion-of-control versions of `on` and `once`. Tell *this* object to
+  // listen to an event in another object ... keeping track of what it's
+  // listening to.
+  _.each(listenMethods, function(implementation, method) {
+    Events[method] = function(obj, name, callback) {
+      var listeners = this._listeners || (this._listeners = {});
+      var id = obj._listenerId || (obj._listenerId = _.uniqueId('l'));
+      listeners[id] = obj;
+      if (typeof name === 'object') callback = this;
+      obj[implementation](name, callback, this);
+      return this;
+    };
+  });
+
+  // Aliases for backwards compatibility.
+  Events.bind   = Events.on;
+  Events.unbind = Events.off;
+
+  // Allow the `Backbone` object to serve as a global event bus, for folks who
+  // want global "pubsub" in a convenient place.
+  _.extend(Backbone, Events);
+
+  // Backbone.Model
+  // --------------
+
+  // Backbone **Models** are the basic data object in the framework --
+  // frequently representing a row in a table in a database on your server.
+  // A discrete chunk of data and a bunch of useful, related methods for
+  // performing computations and transformations on that data.
+
+  // Create a new model with the specified attributes. A client id (`cid`)
+  // is automatically generated and assigned for you.
+  var Model = Backbone.Model = function(attributes, options) {
+    var defaults;
+    var attrs = attributes || {};
+    options || (options = {});
+    this.cid = _.uniqueId('c');
+    this.attributes = {};
+    _.extend(this, _.pick(options, modelOptions));
+    if (options.parse) attrs = this.parse(attrs, options) || {};
+    if (defaults = _.result(this, 'defaults')) {
+      attrs = _.defaults({}, attrs, defaults);
+    }
+    this.set(attrs, options);
+    this.changed = {};
+    this.initialize.apply(this, arguments);
+  };
+
+  // A list of options to be attached directly to the model, if provided.
+  var modelOptions = ['url', 'urlRoot', 'collection'];
+
+  // Attach all inheritable methods to the Model prototype.
+  _.extend(Model.prototype, Events, {
+
+    // A hash of attributes whose current and previous value differ.
+    changed: null,
+
+    // The value returned during the last failed validation.
+    validationError: null,
+
+    // The default name for the JSON `id` attribute is `"id"`. MongoDB and
+    // CouchDB users may want to set this to `"_id"`.
+    idAttribute: 'id',
+
+    // Initialize is an empty function by default. Override it with your own
+    // initialization logic.
+    initialize: function(){},
+
+    // Return a copy of the model's `attributes` object.
+    toJSON: function(options) {
+      return _.clone(this.attributes);
+    },
+
+    // Proxy `Backbone.sync` by default -- but override this if you need
+    // custom syncing semantics for *this* particular model.
+    sync: function() {
+      return Backbone.sync.apply(this, arguments);
+    },
+
+    // Get the value of an attribute.
+    get: function(attr) {
+      return this.attributes[attr];
+    },
+
+    // Get the HTML-escaped value of an attribute.
+    escape: function(attr) {
+      return _.escape(this.get(attr));
+    },
+
+    // Returns `true` if the attribute contains a value that is not null
+    // or undefined.
+    has: function(attr) {
+      return this.get(attr) != null;
+    },
+
+    // Set a hash of model attributes on the object, firing `"change"`. This is
+    // the core primitive operation of a model, updating the data and notifying
+    // anyone who needs to know about the change in state. The heart of the beast.
+    set: function(key, val, options) {
+      var attr, attrs, unset, changes, silent, changing, prev, current;
+      if (key == null) return this;
+
+      // Handle both `"key", value` and `{key: value}` -style arguments.
+      if (typeof key === 'object') {
+        attrs = key;
+        options = val;
+      } else {
+        (attrs = {})[key] = val;
+      }
+
+      options || (options = {});
+
+      // Run validation.
+      if (!this._validate(attrs, options)) return false;
+
+      // Extract attributes and options.
+      unset           = options.unset;
+      silent          = options.silent;
+      changes         = [];
+      changing        = this._changing;
+      this._changing  = true;
+
+      if (!changing) {
+        this._previousAttributes = _.clone(this.attributes);
+        this.changed = {};
+      }
+      current = this.attributes, prev = this._previousAttributes;
+
+      // Check for changes of `id`.
+      if (this.idAttribute in attrs) this.id = attrs[this.idAttribute];
+
+      // For each `set` attribute, update or delete the current value.
+      for (attr in attrs) {
+        val = attrs[attr];
+        if (!_.isEqual(current[attr], val)) changes.push(attr);
+        if (!_.isEqual(prev[attr], val)) {
+          this.changed[attr] = val;
+        } else {
+          delete this.changed[attr];
+        }
+        unset ? delete current[attr] : current[attr] = val;
+      }
+
+      // Trigger all relevant attribute changes.
+      if (!silent) {
+        if (changes.length) this._pending = true;
+        for (var i = 0, l = changes.length; i < l; i++) {
+          this.trigger('change:' + changes[i], this, current[changes[i]], options);
+        }
+      }
+
+      // You might be wondering why there's a `while` loop here. Changes can
+      // be recursively nested within `"change"` events.
+      if (changing) return this;
+      if (!silent) {
+        while (this._pending) {
+          this._pending = false;
+          this.trigger('change', this, options);
+        }
+      }
+      this._pending = false;
+      this._changing = false;
+      return this;
+    },
+
+    // Remove an attribute from the model, firing `"change"`. `unset` is a noop
+    // if the attribute doesn't exist.
+    unset: function(attr, options) {
+      return this.set(attr, void 0, _.extend({}, options, {unset: true}));
+    },
+
+    // Clear all attributes on the model, firing `"change"`.
+    clear: function(options) {
+      var attrs = {};
+      for (var key in this.attributes) attrs[key] = void 0;
+      return this.set(attrs, _.extend({}, options, {unset: true}));
+    },
+
+    // Determine if the model has changed since the last `"change"` event.
+    // If you specify an attribute name, determine if that attribute has changed.
+    hasChanged: function(attr) {
+      if (attr == null) return !_.isEmpty(this.changed);
+      return _.has(this.changed, attr);
+    },
+
+    // Return an object containing all the attributes that have changed, or
+    // false if there are no changed attributes. Useful for determining what
+    // parts of a view need to be updated and/or what attributes need to be
+    // persisted to the server. Unset attributes will be set to undefined.
+    // You can also pass an attributes object to diff against the model,
+    // determining if there *would be* a change.
+    changedAttributes: function(diff) {
+      if (!diff) return this.hasChanged() ? _.clone(this.changed) : false;
+      var val, changed = false;
+      var old = this._changing ? this._previousAttributes : this.attributes;
+      for (var attr in diff) {
+        if (_.isEqual(old[attr], (val = diff[attr]))) continue;
+        (changed || (changed = {}))[attr] = val;
+      }
+      return changed;
+    },
+
+    // Get the previous value of an attribute, recorded at the time the last
+    // `"change"` event was fired.
+    previous: function(attr) {
+      if (attr == null || !this._previousAttributes) return null;
+      return this._previousAttributes[attr];
+    },
+
+    // Get all of the attributes of the model at the time of the previous
+    // `"change"` event.
+    previousAttributes: function() {
+      return _.clone(this._previousAttributes);
+    },
+
+    // Fetch the model from the server. If the server's representation of the
+    // model differs from its current attributes, they will be overridden,
+    // triggering a `"change"` event.
+    fetch: function(options) {
+      options = options ? _.clone(options) : {};
+      if (options.parse === void 0) options.parse = true;
+      var model = this;
+      var success = options.success;
+      options.success = function(resp) {
+        if (!model.set(model.parse(resp, options), options)) return false;
+        if (success) success(model, resp, options);
+        model.trigger('sync', model, resp, options);
+      };
+      wrapError(this, options);
+      return this.sync('read', this, options);
+    },
+
+    // Set a hash of model attributes, and sync the model to the server.
+    // If the server returns an attributes hash that differs, the model's
+    // state will be `set` again.
+    save: function(key, val, options) {
+      var attrs, method, xhr, attributes = this.attributes;
+
+      // Handle both `"key", value` and `{key: value}` -style arguments.
+      if (key == null || typeof key === 'object') {
+        attrs = key;
+        options = val;
+      } else {
+        (attrs = {})[key] = val;
+      }
+
+      // If we're not waiting and attributes exist, save acts as `set(attr).save(null, opts)`.
+      if (attrs && (!options || !options.wait) && !this.set(attrs, options)) return false;
+
+      options = _.extend({validate: true}, options);
+
+      // Do not persist invalid models.
+      if (!this._validate(attrs, options)) return false;
+
+      // Set temporary attributes if `{wait: true}`.
+      if (attrs && options.wait) {
+        this.attributes = _.extend({}, attributes, attrs);
+      }
+
+      // After a successful server-side save, the client is (optionally)
+      // updated with the server-side state.
+      if (options.parse === void 0) options.parse = true;
+      var model = this;
+      var success = options.success;
+      options.success = function(resp) {
+        // Ensure attributes are restored during synchronous saves.
+        model.attributes = attributes;
+        var serverAttrs = model.parse(resp, options);
+        if (options.wait) serverAttrs = _.extend(attrs || {}, serverAttrs);
+        if (_.isObject(serverAttrs) && !model.set(serverAttrs, options)) {
+          return false;
+        }
+        if (success) success(model, resp, options);
+        model.trigger('sync', model, resp, options);
+      };
+      wrapError(this, options);
+
+      method = this.isNew() ? 'create' : (options.patch ? 'patch' : 'update');
+      if (method === 'patch') options.attrs = attrs;
+      xhr = this.sync(method, this, options);
+
+      // Restore attributes.
+      if (attrs && options.wait) this.attributes = attributes;
+
+      return xhr;
+    },
+
+    // Destroy this model on the server if it was already persisted.
+    // Optimistically removes the model from its collection, if it has one.
+    // If `wait: true` is passed, waits for the server to respond before removal.
+    destroy: function(options) {
+      options = options ? _.clone(options) : {};
+      var model = this;
+      var success = options.success;
+
+      var destroy = function() {
+        model.trigger('destroy', model, model.collection, options);
+      };
+
+      options.success = function(resp) {
+        if (options.wait || model.isNew()) destroy();
+        if (success) success(model, resp, options);
+        if (!model.isNew()) model.trigger('sync', model, resp, options);
+      };
+
+      if (this.isNew()) {
+        options.success();
+        return false;
+      }
+      wrapError(this, options);
+
+      var xhr = this.sync('delete', this, options);
+      if (!options.wait) destroy();
+      return xhr;
+    },
+
+    // Default URL for the model's representation on the server -- if you're
+    // using Backbone's restful methods, override this to change the endpoint
+    // that will be called.
+    url: function() {
+      var base = _.result(this, 'urlRoot') || _.result(this.collection, 'url') || urlError();
+      if (this.isNew()) return base;
+      return base + (base.charAt(base.length - 1) === '/' ? '' : '/') + encodeURIComponent(this.id);
+    },
+
+    // **parse** converts a response into the hash of attributes to be `set` on
+    // the model. The default implementation is just to pass the response along.
+    parse: function(resp, options) {
+      return resp;
+    },
+
+    // Create a new model with identical attributes to this one.
+    clone: function() {
+      return new this.constructor(this.attributes);
+    },
+
+    // A model is new if it has never been saved to the server, and lacks an id.
+    isNew: function() {
+      return this.id == null;
+    },
+
+    // Check if the model is currently in a valid state.
+    isValid: function(options) {
+      return this._validate({}, _.extend(options || {}, { validate: true }));
+    },
+
+    // Run validation against the next complete set of model attributes,
+    // returning `true` if all is well. Otherwise, fire an `"invalid"` event.
+    _validate: function(attrs, options) {
+      if (!options.validate || !this.validate) return true;
+      attrs = _.extend({}, this.attributes, attrs);
+      var error = this.validationError = this.validate(attrs, options) || null;
+      if (!error) return true;
+      this.trigger('invalid', this, error, _.extend(options || {}, {validationError: error}));
+      return false;
+    }
+
+  });
+
+  // Underscore methods that we want to implement on the Model.
+  var modelMethods = ['keys', 'values', 'pairs', 'invert', 'pick', 'omit'];
+
+  // Mix in each Underscore method as a proxy to `Model#attributes`.
+  _.each(modelMethods, function(method) {
+    Model.prototype[method] = function() {
+      var args = slice.call(arguments);
+      args.unshift(this.attributes);
+      return _[method].apply(_, args);
+    };
+  });
+
+  // Backbone.Collection
+  // -------------------
+
+  // If models tend to represent a single row of data, a Backbone Collection is
+  // more analagous to a table full of data ... or a small slice or page of that
+  // table, or a collection of rows that belong together for a particular reason
+  // -- all of the messages in this particular folder, all of the documents
+  // belonging to this particular author, and so on. Collections maintain
+  // indexes of their models, both in order, and for lookup by `id`.
+
+  // Create a new **Collection**, perhaps to contain a specific type of `model`.
+  // If a `comparator` is specified, the Collection will maintain
+  // its models in sort order, as they're added and removed.
+  var Collection = Backbone.Collection = function(models, options) {
+    options || (options = {});
+    if (options.url) this.url = options.url;
+    if (options.model) this.model = options.model;
+    if (options.comparator !== void 0) this.comparator = options.comparator;
+    this._reset();
+    this.initialize.apply(this, arguments);
+    if (models) this.reset(models, _.extend({silent: true}, options));
+  };
+
+  // Default options for `Collection#set`.
+  var setOptions = {add: true, remove: true, merge: true};
+  var addOptions = {add: true, merge: false, remove: false};
+
+  // Define the Collection's inheritable methods.
+  _.extend(Collection.prototype, Events, {
+
+    // The default model for a collection is just a **Backbone.Model**.
+    // This should be overridden in most cases.
+    model: Model,
+
+    // Initialize is an empty function by default. Override it with your own
+    // initialization logic.
+    initialize: function(){},
+
+    // The JSON representation of a Collection is an array of the
+    // models' attributes.
+    toJSON: function(options) {
+      return this.map(function(model){ return model.toJSON(options); });
+    },
+
+    // Proxy `Backbone.sync` by default.
+    sync: function() {
+      return Backbone.sync.apply(this, arguments);
+    },
+
+    // Add a model, or list of models to the set.
+    add: function(models, options) {
+      return this.set(models, _.defaults(options || {}, addOptions));
+    },
+
+    // Remove a model, or a list of models from the set.
+    remove: function(models, options) {
+      models = _.isArray(models) ? models.slice() : [models];
+      options || (options = {});
+      var i, l, index, model;
+      for (i = 0, l = models.length; i < l; i++) {
+        model = this.get(models[i]);
+        if (!model) continue;
+        delete this._byId[model.id];
+        delete this._byId[model.cid];
+        index = this.indexOf(model);
+        this.models.splice(index, 1);
+        this.length--;
+        if (!options.silent) {
+          options.index = index;
+          model.trigger('remove', model, this, options);
+        }
+        this._removeReference(model);
+      }
+      return this;
+    },
+
+    // Update a collection by `set`-ing a new list of models, adding new ones,
+    // removing models that are no longer present, and merging models that
+    // already exist in the collection, as necessary. Similar to **Model#set**,
+    // the core operation for updating the data contained by the collection.
+    set: function(models, options) {
+      options = _.defaults(options || {}, setOptions);
+      if (options.parse) models = this.parse(models, options);
+      if (!_.isArray(models)) models = models ? [models] : [];
+      var i, l, model, attrs, existing, sort;
+      var at = options.at;
+      var sortable = this.comparator && (at == null) && options.sort !== false;
+      var sortAttr = _.isString(this.comparator) ? this.comparator : null;
+      var toAdd = [], toRemove = [], modelMap = {};
+
+      // Turn bare objects into model references, and prevent invalid models
+      // from being added.
+      for (i = 0, l = models.length; i < l; i++) {
+        if (!(model = this._prepareModel(models[i], options))) continue;
+
+        // If a duplicate is found, prevent it from being added and
+        // optionally merge it into the existing model.
+        if (existing = this.get(model)) {
+          if (options.remove) modelMap[existing.cid] = true;
+          if (options.merge) {
+            existing.set(model.attributes, options);
+            if (sortable && !sort && existing.hasChanged(sortAttr)) sort = true;
+          }
+
+        // This is a new model, push it to the `toAdd` list.
+        } else if (options.add) {
+          toAdd.push(model);
+
+          // Listen to added models' events, and index models for lookup by
+          // `id` and by `cid`.
+          model.on('all', this._onModelEvent, this);
+          this._byId[model.cid] = model;
+          if (model.id != null) this._byId[model.id] = model;
+        }
+      }
+
+      // Remove nonexistent models if appropriate.
+      if (options.remove) {
+        for (i = 0, l = this.length; i < l; ++i) {
+          if (!modelMap[(model = this.models[i]).cid]) toRemove.push(model);
+        }
+        if (toRemove.length) this.remove(toRemove, options);
+      }
+
+      // See if sorting is needed, update `length` and splice in new models.
+      if (toAdd.length) {
+        if (sortable) sort = true;
+        this.length += toAdd.length;
+        if (at != null) {
+          splice.apply(this.models, [at, 0].concat(toAdd));
+        } else {
+          push.apply(this.models, toAdd);
+        }
+      }
+
+      // Silently sort the collection if appropriate.
+      if (sort) this.sort({silent: true});
+
+      if (options.silent) return this;
+
+      // Trigger `add` events.
+      for (i = 0, l = toAdd.length; i < l; i++) {
+        (model = toAdd[i]).trigger('add', model, this, options);
+      }
+
+      // Trigger `sort` if the collection was sorted.
+      if (sort) this.trigger('sort', this, options);
+      return this;
+    },
+
+    // When you have more items than you want to add or remove individually,
+    // you can reset the entire set with a new list of models, without firing
+    // any granular `add` or `remove` events. Fires `reset` when finished.
+    // Useful for bulk operations and optimizations.
+    reset: function(models, options) {
+      options || (options = {});
+      for (var i = 0, l = this.models.length; i < l; i++) {
+        this._removeReference(this.models[i]);
+      }
+      options.previousModels = this.models;
+      this._reset();
+      this.add(models, _.extend({silent: true}, options));
+      if (!options.silent) this.trigger('reset', this, options);
+      return this;
+    },
+
+    // Add a model to the end of the collection.
+    push: function(model, options) {
+      model = this._prepareModel(model, options);
+      this.add(model, _.extend({at: this.length}, options));
+      return model;
+    },
+
+    // Remove a model from the end of the collection.
+    pop: function(options) {
+      var model = this.at(this.length - 1);
+      this.remove(model, options);
+      return model;
+    },
+
+    // Add a model to the beginning of the collection.
+    unshift: function(model, options) {
+      model = this._prepareModel(model, options);
+      this.add(model, _.extend({at: 0}, options));
+      return model;
+    },
+
+    // Remove a model from the beginning of the collection.
+    shift: function(options) {
+      var model = this.at(0);
+      this.remove(model, options);
+      return model;
+    },
+
+    // Slice out a sub-array of models from the collection.
+    slice: function(begin, end) {
+      return this.models.slice(begin, end);
+    },
+
+    // Get a model from the set by id.
+    get: function(obj) {
+      if (obj == null) return void 0;
+      return this._byId[obj.id != null ? obj.id : obj.cid || obj];
+    },
+
+    // Get the model at the given index.
+    at: function(index) {
+      return this.models[index];
+    },
+
+    // Return models with matching attributes. Useful for simple cases of
+    // `filter`.
+    where: function(attrs, first) {
+      if (_.isEmpty(attrs)) return first ? void 0 : [];
+      return this[first ? 'find' : 'filter'](function(model) {
+        for (var key in attrs) {
+          if (attrs[key] !== model.get(key)) return false;
+        }
+        return true;
+      });
+    },
+
+    // Return the first model with matching attributes. Useful for simple cases
+    // of `find`.
+    findWhere: function(attrs) {
+      return this.where(attrs, true);
+    },
+
+    // Force the collection to re-sort itself. You don't need to call this under
+    // normal circumstances, as the set will maintain sort order as each item
+    // is added.
+    sort: function(options) {
+      if (!this.comparator) throw new Error('Cannot sort a set without a comparator');
+      options || (options = {});
+
+      // Run sort based on type of `comparator`.
+      if (_.isString(this.comparator) || this.comparator.length === 1) {
+        this.models = this.sortBy(this.comparator, this);
+      } else {
+        this.models.sort(_.bind(this.comparator, this));
+      }
+
+      if (!options.silent) this.trigger('sort', this, options);
+      return this;
+    },
+
+    // Figure out the smallest index at which a model should be inserted so as
+    // to maintain order.
+    sortedIndex: function(model, value, context) {
+      value || (value = this.comparator);
+      var iterator = _.isFunction(value) ? value : function(model) {
+        return model.get(value);
+      };
+      return _.sortedIndex(this.models, model, iterator, context);
+    },
+
+    // Pluck an attribute from each model in the collection.
+    pluck: function(attr) {
+      return _.invoke(this.models, 'get', attr);
+    },
+
+    // Fetch the default set of models for this collection, resetting the
+    // collection when they arrive. If `reset: true` is passed, the response
+    // data will be passed through the `reset` method instead of `set`.
+    fetch: function(options) {
+      options = options ? _.clone(options) : {};
+      if (options.parse === void 0) options.parse = true;
+      var success = options.success;
+      var collection = this;
+      options.success = function(resp) {
+        var method = options.reset ? 'reset' : 'set';
+        collection[method](resp, options);
+        if (success) success(collection, resp, options);
+        collection.trigger('sync', collection, resp, options);
+      };
+      wrapError(this, options);
+      return this.sync('read', this, options);
+    },
+
+    // Create a new instance of a model in this collection. Add the model to the
+    // collection immediately, unless `wait: true` is passed, in which case we
+    // wait for the server to agree.
+    create: function(model, options) {
+      options = options ? _.clone(options) : {};
+      if (!(model = this._prepareModel(model, options))) return false;
+      if (!options.wait) this.add(model, options);
+      var collection = this;
+      var success = options.success;
+      options.success = function(resp) {
+        if (options.wait) collection.add(model, options);
+        if (success) success(model, resp, options);
+      };
+      model.save(null, options);
+      return model;
+    },
+
+    // **parse** converts a response into a list of models to be added to the
+    // collection. The default implementation is just to pass it through.
+    parse: function(resp, options) {
+      return resp;
+    },
+
+    // Create a new collection with an identical list of models as this one.
+    clone: function() {
+      return new this.constructor(this.models);
+    },
+
+    // Private method to reset all internal state. Called when the collection
+    // is first initialized or reset.
+    _reset: function() {
+      this.length = 0;
+      this.models = [];
+      this._byId  = {};
+    },
+
+    // Prepare a hash of attributes (or other model) to be added to this
+    // collection.
+    _prepareModel: function(attrs, options) {
+      if (attrs instanceof Model) {
+        if (!attrs.collection) attrs.collection = this;
+        return attrs;
+      }
+      options || (options = {});
+      options.collection = this;
+      var model = new this.model(attrs, options);
+      if (!model._validate(attrs, options)) {
+        this.trigger('invalid', this, attrs, options);
+        return false;
+      }
+      return model;
+    },
+
+    // Internal method to sever a model's ties to a collection.
+    _removeReference: function(model) {
+      if (this === model.collection) delete model.collection;
+      model.off('all', this._onModelEvent, this);
+    },
+
+    // Internal method called every time a model in the set fires an event.
+    // Sets need to update their indexes when models change ids. All other
+    // events simply proxy through. "add" and "remove" events that originate
+    // in other collections are ignored.
+    _onModelEvent: function(event, model, collection, options) {
+      if ((event === 'add' || event === 'remove') && collection !== this) return;
+      if (event === 'destroy') this.remove(model, options);
+      if (model && event === 'change:' + model.idAttribute) {
+        delete this._byId[model.previous(model.idAttribute)];
+        if (model.id != null) this._byId[model.id] = model;
+      }
+      this.trigger.apply(this, arguments);
+    }
+
+  });
+
+  // Underscore methods that we want to implement on the Collection.
+  // 90% of the core usefulness of Backbone Collections is actually implemented
+  // right here:
+  var methods = ['forEach', 'each', 'map', 'collect', 'reduce', 'foldl',
+    'inject', 'reduceRight', 'foldr', 'find', 'detect', 'filter', 'select',
+    'reject', 'every', 'all', 'some', 'any', 'include', 'contains', 'invoke',
+    'max', 'min', 'toArray', 'size', 'first', 'head', 'take', 'initial', 'rest',
+    'tail', 'drop', 'last', 'without', 'indexOf', 'shuffle', 'lastIndexOf',
+    'isEmpty', 'chain'];
+
+  // Mix in each Underscore method as a proxy to `Collection#models`.
+  _.each(methods, function(method) {
+    Collection.prototype[method] = function() {
+      var args = slice.call(arguments);
+      args.unshift(this.models);
+      return _[method].apply(_, args);
+    };
+  });
+
+  // Underscore methods that take a property name as an argument.
+  var attributeMethods = ['groupBy', 'countBy', 'sortBy'];
+
+  // Use attributes instead of properties.
+  _.each(attributeMethods, function(method) {
+    Collection.prototype[method] = function(value, context) {
+      var iterator = _.isFunction(value) ? value : function(model) {
+        return model.get(value);
+      };
+      return _[method](this.models, iterator, context);
+    };
+  });
+
+  // Backbone.View
+  // -------------
+
+  // Backbone Views are almost more convention than they are actual code. A View
+  // is simply a JavaScript object that represents a logical chunk of UI in the
+  // DOM. This might be a single item, an entire list, a sidebar or panel, or
+  // even the surrounding frame which wraps your whole app. Defining a chunk of
+  // UI as a **View** allows you to define your DOM events declaratively, without
+  // having to worry about render order ... and makes it easy for the view to
+  // react to specific changes in the state of your models.
+
+  // Creating a Backbone.View creates its initial element outside of the DOM,
+  // if an existing element is not provided...
+  var View = Backbone.View = function(options) {
+    this.cid = _.uniqueId('view');
+    this._configure(options || {});
+    this._ensureElement();
+    this.initialize.apply(this, arguments);
+    this.delegateEvents();
+  };
+
+  // Cached regex to split keys for `delegate`.
+  var delegateEventSplitter = /^(\S+)\s*(.*)$/;
+
+  // List of view options to be merged as properties.
+  var viewOptions = ['model', 'collection', 'el', 'id', 'attributes', 'className', 'tagName', 'events'];
+
+  // Set up all inheritable **Backbone.View** properties and methods.
+  _.extend(View.prototype, Events, {
+
+    // The default `tagName` of a View's element is `"div"`.
+    tagName: 'div',
+
+    // jQuery delegate for element lookup, scoped to DOM elements within the
+    // current view. This should be prefered to global lookups where possible.
+    $: function(selector) {
+      return this.$el.find(selector);
+    },
+
+    // Initialize is an empty function by default. Override it with your own
+    // initialization logic.
+    initialize: function(){},
+
+    // **render** is the core function that your view should override, in order
+    // to populate its element (`this.el`), with the appropriate HTML. The
+    // convention is for **render** to always return `this`.
+    render: function() {
+      return this;
+    },
+
+    // Remove this view by taking the element out of the DOM, and removing any
+    // applicable Backbone.Events listeners.
+    remove: function() {
+      this.$el.remove();
+      this.stopListening();
+      return this;
+    },
+
+    // Change the view's element (`this.el` property), including event
+    // re-delegation.
+    setElement: function(element, delegate) {
+      if (this.$el) this.undelegateEvents();
+      this.$el = element instanceof Backbone.$ ? element : Backbone.$(element);
+      this.el = this.$el[0];
+      if (delegate !== false) this.delegateEvents();
+      return this;
+    },
+
+    // Set callbacks, where `this.events` is a hash of
+    //
+    // *{"event selector": "callback"}*
+    //
+    //     {
+    //       'mousedown .title':  'edit',
+    //       'click .button':     'save'
+    //       'click .open':       function(e) { ... }
+    //     }
+    //
+    // pairs. Callbacks will be bound to the view, with `this` set properly.
+    // Uses event delegation for efficiency.
+    // Omitting the selector binds the event to `this.el`.
+    // This only works for delegate-able events: not `focus`, `blur`, and
+    // not `change`, `submit`, and `reset` in Internet Explorer.
+    delegateEvents: function(events) {
+      if (!(events || (events = _.result(this, 'events')))) return this;
+      this.undelegateEvents();
+      for (var key in events) {
+        var method = events[key];
+        if (!_.isFunction(method)) method = this[events[key]];
+        if (!method) continue;
+
+        var match = key.match(delegateEventSplitter);
+        var eventName = match[1], selector = match[2];
+        method = _.bind(method, this);
+        eventName += '.delegateEvents' + this.cid;
+        if (selector === '') {
+          this.$el.on(eventName, method);
+        } else {
+          this.$el.on(eventName, selector, method);
+        }
+      }
+      return this;
+    },
+
+    // Clears all callbacks previously bound to the view with `delegateEvents`.
+    // You usually don't need to use this, but may wish to if you have multiple
+    // Backbone views attached to the same DOM element.
+    undelegateEvents: function() {
+      this.$el.off('.delegateEvents' + this.cid);
+      return this;
+    },
+
+    // Performs the initial configuration of a View with a set of options.
+    // Keys with special meaning *(e.g. model, collection, id, className)* are
+    // attached directly to the view.  See `viewOptions` for an exhaustive
+    // list.
+    _configure: function(options) {
+      if (this.options) options = _.extend({}, _.result(this, 'options'), options);
+      _.extend(this, _.pick(options, viewOptions));
+      this.options = options;
+    },
+
+    // Ensure that the View has a DOM element to render into.
+    // If `this.el` is a string, pass it through `$()`, take the first
+    // matching element, and re-assign it to `el`. Otherwise, create
+    // an element from the `id`, `className` and `tagName` properties.
+    _ensureElement: function() {
+      if (!this.el) {
+        var attrs = _.extend({}, _.result(this, 'attributes'));
+        if (this.id) attrs.id = _.result(this, 'id');
+        if (this.className) attrs['class'] = _.result(this, 'className');
+        var $el = Backbone.$('<' + _.result(this, 'tagName') + '>').attr(attrs);
+        this.setElement($el, false);
+      } else {
+        this.setElement(_.result(this, 'el'), false);
+      }
+    }
+
+  });
+
+  // Backbone.sync
+  // -------------
+
+  // Override this function to change the manner in which Backbone persists
+  // models to the server. You will be passed the type of request, and the
+  // model in question. By default, makes a RESTful Ajax request
+  // to the model's `url()`. Some possible customizations could be:
+  //
+  // * Use `setTimeout` to batch rapid-fire updates into a single request.
+  // * Send up the models as XML instead of JSON.
+  // * Persist models via WebSockets instead of Ajax.
+  //
+  // Turn on `Backbone.emulateHTTP` in order to send `PUT` and `DELETE` requests
+  // as `POST`, with a `_method` parameter containing the true HTTP method,
+  // as well as all requests with the body as `application/x-www-form-urlencoded`
+  // instead of `application/json` with the model in a param named `model`.
+  // Useful when interfacing with server-side languages like **PHP** that make
+  // it difficult to read the body of `PUT` requests.
+  Backbone.sync = function(method, model, options) {
+    var type = methodMap[method];
+
+    // Default options, unless specified.
+    _.defaults(options || (options = {}), {
+      emulateHTTP: Backbone.emulateHTTP,
+      emulateJSON: Backbone.emulateJSON
+    });
+
+    // Default JSON-request options.
+    var params = {type: type, dataType: 'json'};
+
+    // Ensure that we have a URL.
+    if (!options.url) {
+      params.url = _.result(model, 'url') || urlError();
+    }
+
+    // Ensure that we have the appropriate request data.
+    if (options.data == null && model && (method === 'create' || method === 'update' || method === 'patch')) {
+      params.contentType = 'application/json';
+      params.data = JSON.stringify(options.attrs || model.toJSON(options));
+    }
+
+    // For older servers, emulate JSON by encoding the request into an HTML-form.
+    if (options.emulateJSON) {
+      params.contentType = 'application/x-www-form-urlencoded';
+      params.data = params.data ? {model: params.data} : {};
+    }
+
+    // For older servers, emulate HTTP by mimicking the HTTP method with `_method`
+    // And an `X-HTTP-Method-Override` header.
+    if (options.emulateHTTP && (type === 'PUT' || type === 'DELETE' || type === 'PATCH')) {
+      params.type = 'POST';
+      if (options.emulateJSON) params.data._method = type;
+      var beforeSend = options.beforeSend;
+      options.beforeSend = function(xhr) {
+        xhr.setRequestHeader('X-HTTP-Method-Override', type);
+        if (beforeSend) return beforeSend.apply(this, arguments);
+      };
+    }
+
+    // Don't process data on a non-GET request.
+    if (params.type !== 'GET' && !options.emulateJSON) {
+      params.processData = false;
+    }
+
+    // If we're sending a `PATCH` request, and we're in an old Internet Explorer
+    // that still has ActiveX enabled by default, override jQuery to use that
+    // for XHR instead. Remove this line when jQuery supports `PATCH` on IE8.
+    if (params.type === 'PATCH' && window.ActiveXObject &&
+          !(window.external && window.external.msActiveXFilteringEnabled)) {
+      params.xhr = function() {
+        return new ActiveXObject("Microsoft.XMLHTTP");
+      };
+    }
+
+    // Make the request, allowing the user to override any Ajax options.
+    var xhr = options.xhr = Backbone.ajax(_.extend(params, options));
+    model.trigger('request', model, xhr, options);
+    return xhr;
+  };
+
+  // Map from CRUD to HTTP for our default `Backbone.sync` implementation.
+  var methodMap = {
+    'create': 'POST',
+    'update': 'PUT',
+    'patch':  'PATCH',
+    'delete': 'DELETE',
+    'read':   'GET'
+  };
+
+  // Set the default implementation of `Backbone.ajax` to proxy through to `$`.
+  // Override this if you'd like to use a different library.
+  Backbone.ajax = function() {
+    return Backbone.$.ajax.apply(Backbone.$, arguments);
+  };
+
+  // Backbone.Router
+  // ---------------
+
+  // Routers map faux-URLs to actions, and fire events when routes are
+  // matched. Creating a new one sets its `routes` hash, if not set statically.
+  var Router = Backbone.Router = function(options) {
+    options || (options = {});
+    if (options.routes) this.routes = options.routes;
+    this._bindRoutes();
+    this.initialize.apply(this, arguments);
+  };
+
+  // Cached regular expressions for matching named param parts and splatted
+  // parts of route strings.
+  var optionalParam = /\((.*?)\)/g;
+  var namedParam    = /(\(\?)?:\w+/g;
+  var splatParam    = /\*\w+/g;
+  var escapeRegExp  = /[\-{}\[\]+?.,\\\^$|#\s]/g;
+
+  // Set up all inheritable **Backbone.Router** properties and methods.
+  _.extend(Router.prototype, Events, {
+
+    // Initialize is an empty function by default. Override it with your own
+    // initialization logic.
+    initialize: function(){},
+
+    // Manually bind a single named route to a callback. For example:
+    //
+    //     this.route('search/:query/p:num', 'search', function(query, num) {
+    //       ...
+    //     });
+    //
+    route: function(route, name, callback) {
+      if (!_.isRegExp(route)) route = this._routeToRegExp(route);
+      if (_.isFunction(name)) {
+        callback = name;
+        name = '';
+      }
+      if (!callback) callback = this[name];
+      var router = this;
+      Backbone.history.route(route, function(fragment) {
+        var args = router._extractParameters(route, fragment);
+        callback && callback.apply(router, args);
+        router.trigger.apply(router, ['route:' + name].concat(args));
+        router.trigger('route', name, args);
+        Backbone.history.trigger('route', router, name, args);
+      });
+      return this;
+    },
+
+    // Simple proxy to `Backbone.history` to save a fragment into the history.
+    navigate: function(fragment, options) {
+      Backbone.history.navigate(fragment, options);
+      return this;
+    },
+
+    // Bind all defined routes to `Backbone.history`. We have to reverse the
+    // order of the routes here to support behavior where the most general
+    // routes can be defined at the bottom of the route map.
+    _bindRoutes: function() {
+      if (!this.routes) return;
+      this.routes = _.result(this, 'routes');
+      var route, routes = _.keys(this.routes);
+      while ((route = routes.pop()) != null) {
+        this.route(route, this.routes[route]);
+      }
+    },
+
+    // Convert a route string into a regular expression, suitable for matching
+    // against the current location hash.
+    _routeToRegExp: function(route) {
+      route = route.replace(escapeRegExp, '\\$&')
+                   .replace(optionalParam, '(?:$1)?')
+                   .replace(namedParam, function(match, optional){
+                     return optional ? match : '([^\/]+)';
+                   })
+                   .replace(splatParam, '(.*?)');
+      return new RegExp('^' + route + '$');
+    },
+
+    // Given a route, and a URL fragment that it matches, return the array of
+    // extracted decoded parameters. Empty or unmatched parameters will be
+    // treated as `null` to normalize cross-browser behavior.
+    _extractParameters: function(route, fragment) {
+      var params = route.exec(fragment).slice(1);
+      return _.map(params, function(param) {
+        return param ? decodeURIComponent(param) : null;
+      });
+    }
+
+  });
+
+  // Backbone.History
+  // ----------------
+
+  // Handles cross-browser history management, based on either
+  // [pushState](http://diveintohtml5.info/history.html) and real URLs, or
+  // [onhashchange](https://developer.mozilla.org/en-US/docs/DOM/window.onhashchange)
+  // and URL fragments. If the browser supports neither (old IE, natch),
+  // falls back to polling.
+  var History = Backbone.History = function() {
+    this.handlers = [];
+    _.bindAll(this, 'checkUrl');
+
+    // Ensure that `History` can be used outside of the browser.
+    if (typeof window !== 'undefined') {
+      this.location = window.location;
+      this.history = window.history;
+    }
+  };
+
+  // Cached regex for stripping a leading hash/slash and trailing space.
+  var routeStripper = /^[#\/]|\s+$/g;
+
+  // Cached regex for stripping leading and trailing slashes.
+  var rootStripper = /^\/+|\/+$/g;
+
+  // Cached regex for detecting MSIE.
+  var isExplorer = /msie [\w.]+/;
+
+  // Cached regex for removing a trailing slash.
+  var trailingSlash = /\/$/;
+
+  // Has the history handling already been started?
+  History.started = false;
+
+  // Set up all inheritable **Backbone.History** properties and methods.
+  _.extend(History.prototype, Events, {
+
+    // The default interval to poll for hash changes, if necessary, is
+    // twenty times a second.
+    interval: 50,
+
+    // Gets the true hash value. Cannot use location.hash directly due to bug
+    // in Firefox where location.hash will always be decoded.
+    getHash: function(window) {
+      var match = (window || this).location.href.match(/#(.*)$/);
+      return match ? match[1] : '';
+    },
+
+    // Get the cross-browser normalized URL fragment, either from the URL,
+    // the hash, or the override.
+    getFragment: function(fragment, forcePushState) {
+      if (fragment == null) {
+        if (this._hasPushState || !this._wantsHashChange || forcePushState) {
+          fragment = this.location.pathname;
+          var root = this.root.replace(trailingSlash, '');
+          if (!fragment.indexOf(root)) fragment = fragment.substr(root.length);
+        } else {
+          fragment = this.getHash();
+        }
+      }
+      return fragment.replace(routeStripper, '');
+    },
+
+    // Start the hash change handling, returning `true` if the current URL matches
+    // an existing route, and `false` otherwise.
+    start: function(options) {
+      if (History.started) throw new Error("Backbone.history has already been started");
+      History.started = true;
+
+      // Figure out the initial configuration. Do we need an iframe?
+      // Is pushState desired ... is it available?
+      this.options          = _.extend({}, {root: '/'}, this.options, options);
+      this.root             = this.options.root;
+      this._wantsHashChange = this.options.hashChange !== false;
+      this._wantsPushState  = !!this.options.pushState;
+      this._hasPushState    = !!(this.options.pushState && this.history && this.history.pushState);
+      var fragment          = this.getFragment();
+      var docMode           = document.documentMode;
+      var oldIE             = (isExplorer.exec(navigator.userAgent.toLowerCase()) && (!docMode || docMode <= 7));
+
+      // Normalize root to always include a leading and trailing slash.
+      this.root = ('/' + this.root + '/').replace(rootStripper, '/');
+
+      if (oldIE && this._wantsHashChange) {
+        this.iframe = Backbone.$('<iframe src="javascript:0" tabindex="-1" />').hide().appendTo('body')[0].contentWindow;
+        this.navigate(fragment);
+      }
+
+      // Depending on whether we're using pushState or hashes, and whether
+      // 'onhashchange' is supported, determine how we check the URL state.
+      if (this._hasPushState) {
+        Backbone.$(window).on('popstate', this.checkUrl);
+      } else if (this._wantsHashChange && ('onhashchange' in window) && !oldIE) {
+        Backbone.$(window).on('hashchange', this.checkUrl);
+      } else if (this._wantsHashChange) {
+        this._checkUrlInterval = setInterval(this.checkUrl, this.interval);
+      }
+
+      // Determine if we need to change the base url, for a pushState link
+      // opened by a non-pushState browser.
+      this.fragment = fragment;
+      var loc = this.location;
+      var atRoot = loc.pathname.replace(/[^\/]$/, '$&/') === this.root;
+
+      // If we've started off with a route from a `pushState`-enabled browser,
+      // but we're currently in a browser that doesn't support it...
+      if (this._wantsHashChange && this._wantsPushState && !this._hasPushState && !atRoot) {
+        this.fragment = this.getFragment(null, true);
+        this.location.replace(this.root + this.location.search + '#' + this.fragment);
+        // Return immediately as browser will do redirect to new url
+        return true;
+
+      // Or if we've started out with a hash-based route, but we're currently
+      // in a browser where it could be `pushState`-based instead...
+      } else if (this._wantsPushState && this._hasPushState && atRoot && loc.hash) {
+        this.fragment = this.getHash().replace(routeStripper, '');
+        this.history.replaceState({}, document.title, this.root + this.fragment + loc.search);
+      }
+
+      if (!this.options.silent) return this.loadUrl();
+    },
+
+    // Disable Backbone.history, perhaps temporarily. Not useful in a real app,
+    // but possibly useful for unit testing Routers.
+    stop: function() {
+      Backbone.$(window).off('popstate', this.checkUrl).off('hashchange', this.checkUrl);
+      clearInterval(this._checkUrlInterval);
+      History.started = false;
+    },
+
+    // Add a route to be tested when the fragment changes. Routes added later
+    // may override previous routes.
+    route: function(route, callback) {
+      this.handlers.unshift({route: route, callback: callback});
+    },
+
+    // Checks the current URL to see if it has changed, and if it has,
+    // calls `loadUrl`, normalizing across the hidden iframe.
+    checkUrl: function(e) {
+      var current = this.getFragment();
+      if (current === this.fragment && this.iframe) {
+        current = this.getFragment(this.getHash(this.iframe));
+      }
+      if (current === this.fragment) return false;
+      if (this.iframe) this.navigate(current);
+      this.loadUrl() || this.loadUrl(this.getHash());
+    },
+
+    // Attempt to load the current URL fragment. If a route succeeds with a
+    // match, returns `true`. If no defined routes matches the fragment,
+    // returns `false`.
+    loadUrl: function(fragmentOverride) {
+      var fragment = this.fragment = this.getFragment(fragmentOverride);
+      var matched = _.any(this.handlers, function(handler) {
+        if (handler.route.test(fragment)) {
+          handler.callback(fragment);
+          return true;
+        }
+      });
+      return matched;
+    },
+
+    // Save a fragment into the hash history, or replace the URL state if the
+    // 'replace' option is passed. You are responsible for properly URL-encoding
+    // the fragment in advance.
+    //
+    // The options object can contain `trigger: true` if you wish to have the
+    // route callback be fired (not usually desirable), or `replace: true`, if
+    // you wish to modify the current URL without adding an entry to the history.
+    navigate: function(fragment, options) {
+      if (!History.started) return false;
+      if (!options || options === true) options = {trigger: options};
+      fragment = this.getFragment(fragment || '');
+      if (this.fragment === fragment) return;
+      this.fragment = fragment;
+      var url = this.root + fragment;
+
+      // If pushState is available, we use it to set the fragment as a real URL.
+      if (this._hasPushState) {
+        this.history[options.replace ? 'replaceState' : 'pushState']({}, document.title, url);
+
+      // If hash changes haven't been explicitly disabled, update the hash
+      // fragment to store history.
+      } else if (this._wantsHashChange) {
+        this._updateHash(this.location, fragment, options.replace);
+        if (this.iframe && (fragment !== this.getFragment(this.getHash(this.iframe)))) {
+          // Opening and closing the iframe tricks IE7 and earlier to push a
+          // history entry on hash-tag change.  When replace is true, we don't
+          // want this.
+          if(!options.replace) this.iframe.document.open().close();
+          this._updateHash(this.iframe.location, fragment, options.replace);
+        }
+
+      // If you've told us that you explicitly don't want fallback hashchange-
+      // based history, then `navigate` becomes a page refresh.
+      } else {
+        return this.location.assign(url);
+      }
+      if (options.trigger) this.loadUrl(fragment);
+    },
+
+    // Update the hash location, either replacing the current entry, or adding
+    // a new one to the browser history.
+    _updateHash: function(location, fragment, replace) {
+      if (replace) {
+        var href = location.href.replace(/(javascript:|#).*$/, '');
+        location.replace(href + '#' + fragment);
+      } else {
+        // Some browsers require that `hash` contains a leading #.
+        location.hash = '#' + fragment;
+      }
+    }
+
+  });
+
+  // Create the default Backbone.history.
+  Backbone.history = new History;
+
+  // Helpers
+  // -------
+
+  // Helper function to correctly set up the prototype chain, for subclasses.
+  // Similar to `goog.inherits`, but uses a hash of prototype properties and
+  // class properties to be extended.
+  var extend = function(protoProps, staticProps) {
+    var parent = this;
+    var child;
+
+    // The constructor function for the new subclass is either defined by you
+    // (the "constructor" property in your `extend` definition), or defaulted
+    // by us to simply call the parent's constructor.
+    if (protoProps && _.has(protoProps, 'constructor')) {
+      child = protoProps.constructor;
+    } else {
+      child = function(){ return parent.apply(this, arguments); };
+    }
+
+    // Add static properties to the constructor function, if supplied.
+    _.extend(child, parent, staticProps);
+
+    // Set the prototype chain to inherit from `parent`, without calling
+    // `parent`'s constructor function.
+    var Surrogate = function(){ this.constructor = child; };
+    Surrogate.prototype = parent.prototype;
+    child.prototype = new Surrogate;
+
+    // Add prototype properties (instance properties) to the subclass,
+    // if supplied.
+    if (protoProps) _.extend(child.prototype, protoProps);
+
+    // Set a convenience property in case the parent's prototype is needed
+    // later.
+    child.__super__ = parent.prototype;
+
+    return child;
+  };
+
+  // Set up inheritance for the model, collection, router, view and history.
+  Model.extend = Collection.extend = Router.extend = View.extend = History.extend = extend;
+
+  // Throw an error when a URL is needed, and none is supplied.
+  var urlError = function() {
+    throw new Error('A "url" property or function must be specified');
+  };
+
+  // Wrap an optional error callback with a fallback error event.
+  var wrapError = function (model, options) {
+    var error = options.error;
+    options.error = function(resp) {
+      if (error) error(model, resp, options);
+      model.trigger('error', model, resp, options);
+    };
+  };
+
+}).call(this);


[11/51] [abbrv] [partial] brooklyn-ui git commit: move subdir from incubator up a level as it is promoted to its own repo (first non-incubator commit!)

Posted by he...@apache.org.
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/js/libs/jquery.dataTables.js
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/js/libs/jquery.dataTables.js b/src/main/webapp/assets/js/libs/jquery.dataTables.js
new file mode 100644
index 0000000..6b4d452
--- /dev/null
+++ b/src/main/webapp/assets/js/libs/jquery.dataTables.js
@@ -0,0 +1,12098 @@
+/**
+ * @summary     DataTables
+ * @description Paginate, search and sort HTML tables
+ * @version     1.9.4
+ * @file        jquery.dataTables.js
+ * @author      Allan Jardine (www.sprymedia.co.uk)
+ * @contact     www.sprymedia.co.uk/contact
+ *
+ * @copyright Copyright 2008-2012 Allan Jardine, all rights reserved.
+ *
+ * This source file is free software, under either the GPL v2 license or a
+ * BSD style license, available at:
+ *   http://datatables.net/license_gpl2
+ *   http://datatables.net/license_bsd
+ * 
+ * This source file is distributed in the hope that it will be useful, but 
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.
+ * 
+ * For details please refer to: http://www.datatables.net
+ */
+
+/*jslint evil: true, undef: true, browser: true */
+/*globals $, jQuery,define,_fnExternApiFunc,_fnInitialise,_fnInitComplete,_fnLanguageCompat,_fnAddColumn,_fnColumnOptions,_fnAddData,_fnCreateTr,_fnGatherData,_fnBuildHead,_fnDrawHead,_fnDraw,_fnReDraw,_fnAjaxUpdate,_fnAjaxParameters,_fnAjaxUpdateDraw,_fnServerParams,_fnAddOptionsHtml,_fnFeatureHtmlTable,_fnScrollDraw,_fnAdjustColumnSizing,_fnFeatureHtmlFilter,_fnFilterComplete,_fnFilterCustom,_fnFilterColumn,_fnFilter,_fnBuildSearchArray,_fnBuildSearchRow,_fnFilterCreateSearch,_fnDataToSearch,_fnSort,_fnSortAttachListener,_fnSortingClasses,_fnFeatureHtmlPaginate,_fnPageChange,_fnFeatureHtmlInfo,_fnUpdateInfo,_fnFeatureHtmlLength,_fnFeatureHtmlProcessing,_fnProcessingDisplay,_fnVisibleToColumnIndex,_fnColumnIndexToVisible,_fnNodeToDataIndex,_fnVisbleColumns,_fnCalculateEnd,_fnConvertToWidth,_fnCalculateColumnWidths,_fnScrollingWidthAdjust,_fnGetWidestNode,_fnGetMaxLenString,_fnStringToCss,_fnDetectType,_fnSettingsFromNode,_fnGetDataMaster,_fnGetTrNodes,_fnGetTdNodes,_fnEscapeRegex,_
 fnDeleteIndex,_fnReOrderIndex,_fnColumnOrdering,_fnLog,_fnClearTable,_fnSaveState,_fnLoadState,_fnCreateCookie,_fnReadCookie,_fnDetectHeader,_fnGetUniqueThs,_fnScrollBarWidth,_fnApplyToChildren,_fnMap,_fnGetRowData,_fnGetCellData,_fnSetCellData,_fnGetObjectDataFn,_fnSetObjectDataFn,_fnApplyColumnDefs,_fnBindAction,_fnCallbackReg,_fnCallbackFire,_fnJsonString,_fnRender,_fnNodeToColumnIndex,_fnInfoMacros,_fnBrowserDetect,_fnGetColumns*/
+
+(/** @lends <global> */function( window, document, undefined ) {
+
+(function( factory ) {
+    "use strict";
+
+    // Define as an AMD module if possible
+    if ( typeof define === 'function' && define.amd )
+    {
+        define( ['jquery'], factory );
+    }
+    /* Define using browser globals otherwise
+     * Prevent multiple instantiations if the script is loaded twice
+     */
+    else if ( jQuery && !jQuery.fn.dataTable )
+    {
+        factory( jQuery );
+    }
+}
+(/** @lends <global> */function( $ ) {
+    "use strict";
+    /** 
+     * DataTables is a plug-in for the jQuery Javascript library. It is a 
+     * highly flexible tool, based upon the foundations of progressive 
+     * enhancement, which will add advanced interaction controls to any 
+     * HTML table. For a full list of features please refer to
+     * <a href="http://datatables.net">DataTables.net</a>.
+     *
+     * Note that the <i>DataTable</i> object is not a global variable but is
+     * aliased to <i>jQuery.fn.DataTable</i> and <i>jQuery.fn.dataTable</i> through which 
+     * it may be  accessed.
+     *
+     *  @class
+     *  @param {object} [oInit={}] Configuration object for DataTables. Options
+     *    are defined by {@link DataTable.defaults}
+     *  @requires jQuery 1.3+
+     * 
+     *  @example
+     *    // Basic initialisation
+     *    $(document).ready( function {
+     *      $('#example').dataTable();
+     *    } );
+     *  
+     *  @example
+     *    // Initialisation with configuration options - in this case, disable
+     *    // pagination and sorting.
+     *    $(document).ready( function {
+     *      $('#example').dataTable( {
+     *        "bPaginate": false,
+     *        "bSort": false 
+     *      } );
+     *    } );
+     */
+    var DataTable = function( oInit )
+    {
+        
+        
+        /**
+         * Add a column to the list used for the table with default values
+         *  @param {object} oSettings dataTables settings object
+         *  @param {node} nTh The th element for this column
+         *  @memberof DataTable#oApi
+         */
+        function _fnAddColumn( oSettings, nTh )
+        {
+            var oDefaults = DataTable.defaults.columns;
+            var iCol = oSettings.aoColumns.length;
+            var oCol = $.extend( {}, DataTable.models.oColumn, oDefaults, {
+                "sSortingClass": oSettings.oClasses.sSortable,
+                "sSortingClassJUI": oSettings.oClasses.sSortJUI,
+                "nTh": nTh ? nTh : document.createElement('th'),
+                "sTitle":    oDefaults.sTitle    ? oDefaults.sTitle    : nTh ? nTh.innerHTML : '',
+                "aDataSort": oDefaults.aDataSort ? oDefaults.aDataSort : [iCol],
+                "mData": oDefaults.mData ? oDefaults.oDefaults : iCol
+            } );
+            oSettings.aoColumns.push( oCol );
+            
+            /* Add a column specific filter */
+            if ( oSettings.aoPreSearchCols[ iCol ] === undefined || oSettings.aoPreSearchCols[ iCol ] === null )
+            {
+                oSettings.aoPreSearchCols[ iCol ] = $.extend( {}, DataTable.models.oSearch );
+            }
+            else
+            {
+                var oPre = oSettings.aoPreSearchCols[ iCol ];
+                
+                /* Don't require that the user must specify bRegex, bSmart or bCaseInsensitive */
+                if ( oPre.bRegex === undefined )
+                {
+                    oPre.bRegex = true;
+                }
+                
+                if ( oPre.bSmart === undefined )
+                {
+                    oPre.bSmart = true;
+                }
+                
+                if ( oPre.bCaseInsensitive === undefined )
+                {
+                    oPre.bCaseInsensitive = true;
+                }
+            }
+            
+            /* Use the column options function to initialise classes etc */
+            _fnColumnOptions( oSettings, iCol, null );
+        }
+        
+        
+        /**
+         * Apply options for a column
+         *  @param {object} oSettings dataTables settings object
+         *  @param {int} iCol column index to consider
+         *  @param {object} oOptions object with sType, bVisible and bSearchable etc
+         *  @memberof DataTable#oApi
+         */
+        function _fnColumnOptions( oSettings, iCol, oOptions )
+        {
+            var oCol = oSettings.aoColumns[ iCol ];
+            
+            /* User specified column options */
+            if ( oOptions !== undefined && oOptions !== null )
+            {
+                /* Backwards compatibility for mDataProp */
+                if ( oOptions.mDataProp && !oOptions.mData )
+                {
+                    oOptions.mData = oOptions.mDataProp;
+                }
+        
+                if ( oOptions.sType !== undefined )
+                {
+                    oCol.sType = oOptions.sType;
+                    oCol._bAutoType = false;
+                }
+                
+                $.extend( oCol, oOptions );
+                _fnMap( oCol, oOptions, "sWidth", "sWidthOrig" );
+        
+                /* iDataSort to be applied (backwards compatibility), but aDataSort will take
+                 * priority if defined
+                 */
+                if ( oOptions.iDataSort !== undefined )
+                {
+                    oCol.aDataSort = [ oOptions.iDataSort ];
+                }
+                _fnMap( oCol, oOptions, "aDataSort" );
+            }
+        
+            /* Cache the data get and set functions for speed */
+            var mRender = oCol.mRender ? _fnGetObjectDataFn( oCol.mRender ) : null;
+            var mData = _fnGetObjectDataFn( oCol.mData );
+        
+            oCol.fnGetData = function (oData, sSpecific) {
+                var innerData = mData( oData, sSpecific );
+        
+                if ( oCol.mRender && (sSpecific && sSpecific !== '') )
+                {
+                    return mRender( innerData, sSpecific, oData );
+                }
+                return innerData;
+            };
+            oCol.fnSetData = _fnSetObjectDataFn( oCol.mData );
+            
+            /* Feature sorting overrides column specific when off */
+            if ( !oSettings.oFeatures.bSort )
+            {
+                oCol.bSortable = false;
+            }
+            
+            /* Check that the class assignment is correct for sorting */
+            if ( !oCol.bSortable ||
+                 ($.inArray('asc', oCol.asSorting) == -1 && $.inArray('desc', oCol.asSorting) == -1) )
+            {
+                oCol.sSortingClass = oSettings.oClasses.sSortableNone;
+                oCol.sSortingClassJUI = "";
+            }
+            else if ( $.inArray('asc', oCol.asSorting) == -1 && $.inArray('desc', oCol.asSorting) == -1 )
+            {
+                oCol.sSortingClass = oSettings.oClasses.sSortable;
+                oCol.sSortingClassJUI = oSettings.oClasses.sSortJUI;
+            }
+            else if ( $.inArray('asc', oCol.asSorting) != -1 && $.inArray('desc', oCol.asSorting) == -1 )
+            {
+                oCol.sSortingClass = oSettings.oClasses.sSortableAsc;
+                oCol.sSortingClassJUI = oSettings.oClasses.sSortJUIAscAllowed;
+            }
+            else if ( $.inArray('asc', oCol.asSorting) == -1 && $.inArray('desc', oCol.asSorting) != -1 )
+            {
+                oCol.sSortingClass = oSettings.oClasses.sSortableDesc;
+                oCol.sSortingClassJUI = oSettings.oClasses.sSortJUIDescAllowed;
+            }
+        }
+        
+        
+        /**
+         * Adjust the table column widths for new data. Note: you would probably want to 
+         * do a redraw after calling this function!
+         *  @param {object} oSettings dataTables settings object
+         *  @memberof DataTable#oApi
+         */
+        function _fnAdjustColumnSizing ( oSettings )
+        {
+            /* Not interested in doing column width calculation if auto-width is disabled */
+            if ( oSettings.oFeatures.bAutoWidth === false )
+            {
+                return false;
+            }
+            
+            _fnCalculateColumnWidths( oSettings );
+            for ( var i=0 , iLen=oSettings.aoColumns.length ; i<iLen ; i++ )
+            {
+                oSettings.aoColumns[i].nTh.style.width = oSettings.aoColumns[i].sWidth;
+            }
+        }
+        
+        
+        /**
+         * Covert the index of a visible column to the index in the data array (take account
+         * of hidden columns)
+         *  @param {object} oSettings dataTables settings object
+         *  @param {int} iMatch Visible column index to lookup
+         *  @returns {int} i the data index
+         *  @memberof DataTable#oApi
+         */
+        function _fnVisibleToColumnIndex( oSettings, iMatch )
+        {
+            var aiVis = _fnGetColumns( oSettings, 'bVisible' );
+        
+            return typeof aiVis[iMatch] === 'number' ?
+                aiVis[iMatch] :
+                null;
+        }
+        
+        
+        /**
+         * Covert the index of an index in the data array and convert it to the visible
+         *   column index (take account of hidden columns)
+         *  @param {int} iMatch Column index to lookup
+         *  @param {object} oSettings dataTables settings object
+         *  @returns {int} i the data index
+         *  @memberof DataTable#oApi
+         */
+        function _fnColumnIndexToVisible( oSettings, iMatch )
+        {
+            var aiVis = _fnGetColumns( oSettings, 'bVisible' );
+            var iPos = $.inArray( iMatch, aiVis );
+        
+            return iPos !== -1 ? iPos : null;
+        }
+        
+        
+        /**
+         * Get the number of visible columns
+         *  @param {object} oSettings dataTables settings object
+         *  @returns {int} i the number of visible columns
+         *  @memberof DataTable#oApi
+         */
+        function _fnVisbleColumns( oSettings )
+        {
+            return _fnGetColumns( oSettings, 'bVisible' ).length;
+        }
+        
+        
+        /**
+         * Get an array of column indexes that match a given property
+         *  @param {object} oSettings dataTables settings object
+         *  @param {string} sParam Parameter in aoColumns to look for - typically 
+         *    bVisible or bSearchable
+         *  @returns {array} Array of indexes with matched properties
+         *  @memberof DataTable#oApi
+         */
+        function _fnGetColumns( oSettings, sParam )
+        {
+            var a = [];
+        
+            $.map( oSettings.aoColumns, function(val, i) {
+                if ( val[sParam] ) {
+                    a.push( i );
+                }
+            } );
+        
+            return a;
+        }
+        
+        
+        /**
+         * Get the sort type based on an input string
+         *  @param {string} sData data we wish to know the type of
+         *  @returns {string} type (defaults to 'string' if no type can be detected)
+         *  @memberof DataTable#oApi
+         */
+        function _fnDetectType( sData )
+        {
+            var aTypes = DataTable.ext.aTypes;
+            var iLen = aTypes.length;
+            
+            for ( var i=0 ; i<iLen ; i++ )
+            {
+                var sType = aTypes[i]( sData );
+                if ( sType !== null )
+                {
+                    return sType;
+                }
+            }
+            
+            return 'string';
+        }
+        
+        
+        /**
+         * Figure out how to reorder a display list
+         *  @param {object} oSettings dataTables settings object
+         *  @returns array {int} aiReturn index list for reordering
+         *  @memberof DataTable#oApi
+         */
+        function _fnReOrderIndex ( oSettings, sColumns )
+        {
+            var aColumns = sColumns.split(',');
+            var aiReturn = [];
+            
+            for ( var i=0, iLen=oSettings.aoColumns.length ; i<iLen ; i++ )
+            {
+                for ( var j=0 ; j<iLen ; j++ )
+                {
+                    if ( oSettings.aoColumns[i].sName == aColumns[j] )
+                    {
+                        aiReturn.push( j );
+                        break;
+                    }
+                }
+            }
+            
+            return aiReturn;
+        }
+        
+        
+        /**
+         * Get the column ordering that DataTables expects
+         *  @param {object} oSettings dataTables settings object
+         *  @returns {string} comma separated list of names
+         *  @memberof DataTable#oApi
+         */
+        function _fnColumnOrdering ( oSettings )
+        {
+            var sNames = '';
+            for ( var i=0, iLen=oSettings.aoColumns.length ; i<iLen ; i++ )
+            {
+                sNames += oSettings.aoColumns[i].sName+',';
+            }
+            if ( sNames.length == iLen )
+            {
+                return "";
+            }
+            return sNames.slice(0, -1);
+        }
+        
+        
+        /**
+         * Take the column definitions and static columns arrays and calculate how
+         * they relate to column indexes. The callback function will then apply the
+         * definition found for a column to a suitable configuration object.
+         *  @param {object} oSettings dataTables settings object
+         *  @param {array} aoColDefs The aoColumnDefs array that is to be applied
+         *  @param {array} aoCols The aoColumns array that defines columns individually
+         *  @param {function} fn Callback function - takes two parameters, the calculated
+         *    column index and the definition for that column.
+         *  @memberof DataTable#oApi
+         */
+        function _fnApplyColumnDefs( oSettings, aoColDefs, aoCols, fn )
+        {
+            var i, iLen, j, jLen, k, kLen;
+        
+            // Column definitions with aTargets
+            if ( aoColDefs )
+            {
+                /* Loop over the definitions array - loop in reverse so first instance has priority */
+                for ( i=aoColDefs.length-1 ; i>=0 ; i-- )
+                {
+                    /* Each definition can target multiple columns, as it is an array */
+                    var aTargets = aoColDefs[i].aTargets;
+                    if ( !$.isArray( aTargets ) )
+                    {
+                        _fnLog( oSettings, 1, 'aTargets must be an array of targets, not a '+(typeof aTargets) );
+                    }
+        
+                    for ( j=0, jLen=aTargets.length ; j<jLen ; j++ )
+                    {
+                        if ( typeof aTargets[j] === 'number' && aTargets[j] >= 0 )
+                        {
+                            /* Add columns that we don't yet know about */
+                            while( oSettings.aoColumns.length <= aTargets[j] )
+                            {
+                                _fnAddColumn( oSettings );
+                            }
+        
+                            /* Integer, basic index */
+                            fn( aTargets[j], aoColDefs[i] );
+                        }
+                        else if ( typeof aTargets[j] === 'number' && aTargets[j] < 0 )
+                        {
+                            /* Negative integer, right to left column counting */
+                            fn( oSettings.aoColumns.length+aTargets[j], aoColDefs[i] );
+                        }
+                        else if ( typeof aTargets[j] === 'string' )
+                        {
+                            /* Class name matching on TH element */
+                            for ( k=0, kLen=oSettings.aoColumns.length ; k<kLen ; k++ )
+                            {
+                                if ( aTargets[j] == "_all" ||
+                                     $(oSettings.aoColumns[k].nTh).hasClass( aTargets[j] ) )
+                                {
+                                    fn( k, aoColDefs[i] );
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        
+            // Statically defined columns array
+            if ( aoCols )
+            {
+                for ( i=0, iLen=aoCols.length ; i<iLen ; i++ )
+                {
+                    fn( i, aoCols[i] );
+                }
+            }
+        }
+        
+        /**
+         * Add a data array to the table, creating DOM node etc. This is the parallel to 
+         * _fnGatherData, but for adding rows from a Javascript source, rather than a
+         * DOM source.
+         *  @param {object} oSettings dataTables settings object
+         *  @param {array} aData data array to be added
+         *  @returns {int} >=0 if successful (index of new aoData entry), -1 if failed
+         *  @memberof DataTable#oApi
+         */
+        function _fnAddData ( oSettings, aDataSupplied )
+        {
+            var oCol;
+            
+            /* Take an independent copy of the data source so we can bash it about as we wish */
+            var aDataIn = ($.isArray(aDataSupplied)) ?
+                aDataSupplied.slice() :
+                $.extend( true, {}, aDataSupplied );
+            
+            /* Create the object for storing information about this new row */
+            var iRow = oSettings.aoData.length;
+            var oData = $.extend( true, {}, DataTable.models.oRow );
+            oData._aData = aDataIn;
+            oSettings.aoData.push( oData );
+        
+            /* Create the cells */
+            var nTd, sThisType;
+            for ( var i=0, iLen=oSettings.aoColumns.length ; i<iLen ; i++ )
+            {
+                oCol = oSettings.aoColumns[i];
+        
+                /* Use rendered data for filtering / sorting */
+                if ( typeof oCol.fnRender === 'function' && oCol.bUseRendered && oCol.mData !== null )
+                {
+                    _fnSetCellData( oSettings, iRow, i, _fnRender(oSettings, iRow, i) );
+                }
+                else
+                {
+                    _fnSetCellData( oSettings, iRow, i, _fnGetCellData( oSettings, iRow, i ) );
+                }
+                
+                /* See if we should auto-detect the column type */
+                if ( oCol._bAutoType && oCol.sType != 'string' )
+                {
+                    /* Attempt to auto detect the type - same as _fnGatherData() */
+                    var sVarType = _fnGetCellData( oSettings, iRow, i, 'type' );
+                    if ( sVarType !== null && sVarType !== '' )
+                    {
+                        sThisType = _fnDetectType( sVarType );
+                        if ( oCol.sType === null )
+                        {
+                            oCol.sType = sThisType;
+                        }
+                        else if ( oCol.sType != sThisType && oCol.sType != "html" )
+                        {
+                            /* String is always the 'fallback' option */
+                            oCol.sType = 'string';
+                        }
+                    }
+                }
+            }
+            
+            /* Add to the display array */
+            oSettings.aiDisplayMaster.push( iRow );
+        
+            /* Create the DOM information */
+            if ( !oSettings.oFeatures.bDeferRender )
+            {
+                _fnCreateTr( oSettings, iRow );
+            }
+        
+            return iRow;
+        }
+        
+        
+        /**
+         * Read in the data from the target table from the DOM
+         *  @param {object} oSettings dataTables settings object
+         *  @memberof DataTable#oApi
+         */
+        function _fnGatherData( oSettings )
+        {
+            var iLoop, i, iLen, j, jLen, jInner,
+                nTds, nTrs, nTd, nTr, aLocalData, iThisIndex,
+                iRow, iRows, iColumn, iColumns, sNodeName,
+                oCol, oData;
+            
+            /*
+             * Process by row first
+             * Add the data object for the whole table - storing the tr node. Note - no point in getting
+             * DOM based data if we are going to go and replace it with Ajax source data.
+             */
+            if ( oSettings.bDeferLoading || oSettings.sAjaxSource === null )
+            {
+                nTr = oSettings.nTBody.firstChild;
+                while ( nTr )
+                {
+                    if ( nTr.nodeName.toUpperCase() == "TR" )
+                    {
+                        iThisIndex = oSettings.aoData.length;
+                        nTr._DT_RowIndex = iThisIndex;
+                        oSettings.aoData.push( $.extend( true, {}, DataTable.models.oRow, {
+                            "nTr": nTr
+                        } ) );
+        
+                        oSettings.aiDisplayMaster.push( iThisIndex );
+                        nTd = nTr.firstChild;
+                        jInner = 0;
+                        while ( nTd )
+                        {
+                            sNodeName = nTd.nodeName.toUpperCase();
+                            if ( sNodeName == "TD" || sNodeName == "TH" )
+                            {
+                                _fnSetCellData( oSettings, iThisIndex, jInner, $.trim(nTd.innerHTML) );
+                                jInner++;
+                            }
+                            nTd = nTd.nextSibling;
+                        }
+                    }
+                    nTr = nTr.nextSibling;
+                }
+            }
+            
+            /* Gather in the TD elements of the Table - note that this is basically the same as
+             * fnGetTdNodes, but that function takes account of hidden columns, which we haven't yet
+             * setup!
+             */
+            nTrs = _fnGetTrNodes( oSettings );
+            nTds = [];
+            for ( i=0, iLen=nTrs.length ; i<iLen ; i++ )
+            {
+                nTd = nTrs[i].firstChild;
+                while ( nTd )
+                {
+                    sNodeName = nTd.nodeName.toUpperCase();
+                    if ( sNodeName == "TD" || sNodeName == "TH" )
+                    {
+                        nTds.push( nTd );
+                    }
+                    nTd = nTd.nextSibling;
+                }
+            }
+            
+            /* Now process by column */
+            for ( iColumn=0, iColumns=oSettings.aoColumns.length ; iColumn<iColumns ; iColumn++ )
+            {
+                oCol = oSettings.aoColumns[iColumn];
+        
+                /* Get the title of the column - unless there is a user set one */
+                if ( oCol.sTitle === null )
+                {
+                    oCol.sTitle = oCol.nTh.innerHTML;
+                }
+                
+                var
+                    bAutoType = oCol._bAutoType,
+                    bRender = typeof oCol.fnRender === 'function',
+                    bClass = oCol.sClass !== null,
+                    bVisible = oCol.bVisible,
+                    nCell, sThisType, sRendered, sValType;
+                
+                /* A single loop to rule them all (and be more efficient) */
+                if ( bAutoType || bRender || bClass || !bVisible )
+                {
+                    for ( iRow=0, iRows=oSettings.aoData.length ; iRow<iRows ; iRow++ )
+                    {
+                        oData = oSettings.aoData[iRow];
+                        nCell = nTds[ (iRow*iColumns) + iColumn ];
+                        
+                        /* Type detection */
+                        if ( bAutoType && oCol.sType != 'string' )
+                        {
+                            sValType = _fnGetCellData( oSettings, iRow, iColumn, 'type' );
+                            if ( sValType !== '' )
+                            {
+                                sThisType = _fnDetectType( sValType );
+                                if ( oCol.sType === null )
+                                {
+                                    oCol.sType = sThisType;
+                                }
+                                else if ( oCol.sType != sThisType && 
+                                          oCol.sType != "html" )
+                                {
+                                    /* String is always the 'fallback' option */
+                                    oCol.sType = 'string';
+                                }
+                            }
+                        }
+        
+                        if ( oCol.mRender )
+                        {
+                            // mRender has been defined, so we need to get the value and set it
+                            nCell.innerHTML = _fnGetCellData( oSettings, iRow, iColumn, 'display' );
+                        }
+                        else if ( oCol.mData !== iColumn )
+                        {
+                            // If mData is not the same as the column number, then we need to
+                            // get the dev set value. If it is the column, no point in wasting
+                            // time setting the value that is already there!
+                            nCell.innerHTML = _fnGetCellData( oSettings, iRow, iColumn, 'display' );
+                        }
+                        
+                        /* Rendering */
+                        if ( bRender )
+                        {
+                            sRendered = _fnRender( oSettings, iRow, iColumn );
+                            nCell.innerHTML = sRendered;
+                            if ( oCol.bUseRendered )
+                            {
+                                /* Use the rendered data for filtering / sorting */
+                                _fnSetCellData( oSettings, iRow, iColumn, sRendered );
+                            }
+                        }
+                        
+                        /* Classes */
+                        if ( bClass )
+                        {
+                            nCell.className += ' '+oCol.sClass;
+                        }
+                        
+                        /* Column visibility */
+                        if ( !bVisible )
+                        {
+                            oData._anHidden[iColumn] = nCell;
+                            nCell.parentNode.removeChild( nCell );
+                        }
+                        else
+                        {
+                            oData._anHidden[iColumn] = null;
+                        }
+        
+                        if ( oCol.fnCreatedCell )
+                        {
+                            oCol.fnCreatedCell.call( oSettings.oInstance,
+                                nCell, _fnGetCellData( oSettings, iRow, iColumn, 'display' ), oData._aData, iRow, iColumn
+                            );
+                        }
+                    }
+                }
+            }
+        
+            /* Row created callbacks */
+            if ( oSettings.aoRowCreatedCallback.length !== 0 )
+            {
+                for ( i=0, iLen=oSettings.aoData.length ; i<iLen ; i++ )
+                {
+                    oData = oSettings.aoData[i];
+                    _fnCallbackFire( oSettings, 'aoRowCreatedCallback', null, [oData.nTr, oData._aData, i] );
+                }
+            }
+        }
+        
+        
+        /**
+         * Take a TR element and convert it to an index in aoData
+         *  @param {object} oSettings dataTables settings object
+         *  @param {node} n the TR element to find
+         *  @returns {int} index if the node is found, null if not
+         *  @memberof DataTable#oApi
+         */
+        function _fnNodeToDataIndex( oSettings, n )
+        {
+            return (n._DT_RowIndex!==undefined) ? n._DT_RowIndex : null;
+        }
+        
+        
+        /**
+         * Take a TD element and convert it into a column data index (not the visible index)
+         *  @param {object} oSettings dataTables settings object
+         *  @param {int} iRow The row number the TD/TH can be found in
+         *  @param {node} n The TD/TH element to find
+         *  @returns {int} index if the node is found, -1 if not
+         *  @memberof DataTable#oApi
+         */
+        function _fnNodeToColumnIndex( oSettings, iRow, n )
+        {
+            var anCells = _fnGetTdNodes( oSettings, iRow );
+        
+            for ( var i=0, iLen=oSettings.aoColumns.length ; i<iLen ; i++ )
+            {
+                if ( anCells[i] === n )
+                {
+                    return i;
+                }
+            }
+            return -1;
+        }
+        
+        
+        /**
+         * Get an array of data for a given row from the internal data cache
+         *  @param {object} oSettings dataTables settings object
+         *  @param {int} iRow aoData row id
+         *  @param {string} sSpecific data get type ('type' 'filter' 'sort')
+         *  @param {array} aiColumns Array of column indexes to get data from
+         *  @returns {array} Data array
+         *  @memberof DataTable#oApi
+         */
+        function _fnGetRowData( oSettings, iRow, sSpecific, aiColumns )
+        {
+            var out = [];
+            for ( var i=0, iLen=aiColumns.length ; i<iLen ; i++ )
+            {
+                out.push( _fnGetCellData( oSettings, iRow, aiColumns[i], sSpecific ) );
+            }
+            return out;
+        }
+        
+        
+        /**
+         * Get the data for a given cell from the internal cache, taking into account data mapping
+         *  @param {object} oSettings dataTables settings object
+         *  @param {int} iRow aoData row id
+         *  @param {int} iCol Column index
+         *  @param {string} sSpecific data get type ('display', 'type' 'filter' 'sort')
+         *  @returns {*} Cell data
+         *  @memberof DataTable#oApi
+         */
+        function _fnGetCellData( oSettings, iRow, iCol, sSpecific )
+        {
+            var sData;
+            var oCol = oSettings.aoColumns[iCol];
+            var oData = oSettings.aoData[iRow]._aData;
+        
+            if ( (sData=oCol.fnGetData( oData, sSpecific )) === undefined )
+            {
+                if ( oSettings.iDrawError != oSettings.iDraw && oCol.sDefaultContent === null )
+                {
+                    _fnLog( oSettings, 0, "Requested unknown parameter "+
+                        (typeof oCol.mData=='function' ? '{mData function}' : "'"+oCol.mData+"'")+
+                        " from the data source for row "+iRow );
+                    oSettings.iDrawError = oSettings.iDraw;
+                }
+                return oCol.sDefaultContent;
+            }
+        
+            /* When the data source is null, we can use default column data */
+            if ( sData === null && oCol.sDefaultContent !== null )
+            {
+                sData = oCol.sDefaultContent;
+            }
+            else if ( typeof sData === 'function' )
+            {
+                /* If the data source is a function, then we run it and use the return */
+                return sData();
+            }
+        
+            if ( sSpecific == 'display' && sData === null )
+            {
+                return '';
+            }
+            return sData;
+        }
+        
+        
+        /**
+         * Set the value for a specific cell, into the internal data cache
+         *  @param {object} oSettings dataTables settings object
+         *  @param {int} iRow aoData row id
+         *  @param {int} iCol Column index
+         *  @param {*} val Value to set
+         *  @memberof DataTable#oApi
+         */
+        function _fnSetCellData( oSettings, iRow, iCol, val )
+        {
+            var oCol = oSettings.aoColumns[iCol];
+            var oData = oSettings.aoData[iRow]._aData;
+        
+            oCol.fnSetData( oData, val );
+        }
+        
+        
+        // Private variable that is used to match array syntax in the data property object
+        var __reArray = /\[.*?\]$/;
+        
+        /**
+         * Return a function that can be used to get data from a source object, taking
+         * into account the ability to use nested objects as a source
+         *  @param {string|int|function} mSource The data source for the object
+         *  @returns {function} Data get function
+         *  @memberof DataTable#oApi
+         */
+        function _fnGetObjectDataFn( mSource )
+        {
+            if ( mSource === null )
+            {
+                /* Give an empty string for rendering / sorting etc */
+                return function (data, type) {
+                    return null;
+                };
+            }
+            else if ( typeof mSource === 'function' )
+            {
+                return function (data, type, extra) {
+                    return mSource( data, type, extra );
+                };
+            }
+            else if ( typeof mSource === 'string' && (mSource.indexOf('.') !== -1 || mSource.indexOf('[') !== -1) )
+            {
+                /* If there is a . in the source string then the data source is in a 
+                 * nested object so we loop over the data for each level to get the next
+                 * level down. On each loop we test for undefined, and if found immediately
+                 * return. This allows entire objects to be missing and sDefaultContent to
+                 * be used if defined, rather than throwing an error
+                 */
+                var fetchData = function (data, type, src) {
+                    var a = src.split('.');
+                    var arrayNotation, out, innerSrc;
+        
+                    if ( src !== "" )
+                    {
+                        for ( var i=0, iLen=a.length ; i<iLen ; i++ )
+                        {
+                            // Check if we are dealing with an array notation request
+                            arrayNotation = a[i].match(__reArray);
+        
+                            if ( arrayNotation ) {
+                                a[i] = a[i].replace(__reArray, '');
+        
+                                // Condition allows simply [] to be passed in
+                                if ( a[i] !== "" ) {
+                                    data = data[ a[i] ];
+                                }
+                                out = [];
+                                
+                                // Get the remainder of the nested object to get
+                                a.splice( 0, i+1 );
+                                innerSrc = a.join('.');
+        
+                                // Traverse each entry in the array getting the properties requested
+                                for ( var j=0, jLen=data.length ; j<jLen ; j++ ) {
+                                    out.push( fetchData( data[j], type, innerSrc ) );
+                                }
+        
+                                // If a string is given in between the array notation indicators, that
+                                // is used to join the strings together, otherwise an array is returned
+                                var join = arrayNotation[0].substring(1, arrayNotation[0].length-1);
+                                data = (join==="") ? out : out.join(join);
+        
+                                // The inner call to fetchData has already traversed through the remainder
+                                // of the source requested, so we exit from the loop
+                                break;
+                            }
+        
+                            if ( data === null || data[ a[i] ] === undefined )
+                            {
+                                return undefined;
+                            }
+                            data = data[ a[i] ];
+                        }
+                    }
+        
+                    return data;
+                };
+        
+                return function (data, type) {
+                    return fetchData( data, type, mSource );
+                };
+            }
+            else
+            {
+                /* Array or flat object mapping */
+                return function (data, type) {
+                    return data[mSource];   
+                };
+            }
+        }
+        
+        
+        /**
+         * Return a function that can be used to set data from a source object, taking
+         * into account the ability to use nested objects as a source
+         *  @param {string|int|function} mSource The data source for the object
+         *  @returns {function} Data set function
+         *  @memberof DataTable#oApi
+         */
+        function _fnSetObjectDataFn( mSource )
+        {
+            if ( mSource === null )
+            {
+                /* Nothing to do when the data source is null */
+                return function (data, val) {};
+            }
+            else if ( typeof mSource === 'function' )
+            {
+                return function (data, val) {
+                    mSource( data, 'set', val );
+                };
+            }
+            else if ( typeof mSource === 'string' && (mSource.indexOf('.') !== -1 || mSource.indexOf('[') !== -1) )
+            {
+                /* Like the get, we need to get data from a nested object */
+                var setData = function (data, val, src) {
+                    var a = src.split('.'), b;
+                    var arrayNotation, o, innerSrc;
+        
+                    for ( var i=0, iLen=a.length-1 ; i<iLen ; i++ )
+                    {
+                        // Check if we are dealing with an array notation request
+                        arrayNotation = a[i].match(__reArray);
+        
+                        if ( arrayNotation )
+                        {
+                            a[i] = a[i].replace(__reArray, '');
+                            data[ a[i] ] = [];
+                            
+                            // Get the remainder of the nested object to set so we can recurse
+                            b = a.slice();
+                            b.splice( 0, i+1 );
+                            innerSrc = b.join('.');
+        
+                            // Traverse each entry in the array setting the properties requested
+                            for ( var j=0, jLen=val.length ; j<jLen ; j++ )
+                            {
+                                o = {};
+                                setData( o, val[j], innerSrc );
+                                data[ a[i] ].push( o );
+                            }
+        
+                            // The inner call to setData has already traversed through the remainder
+                            // of the source and has set the data, thus we can exit here
+                            return;
+                        }
+        
+                        // If the nested object doesn't currently exist - since we are
+                        // trying to set the value - create it
+                        if ( data[ a[i] ] === null || data[ a[i] ] === undefined )
+                        {
+                            data[ a[i] ] = {};
+                        }
+                        data = data[ a[i] ];
+                    }
+        
+                    // If array notation is used, we just want to strip it and use the property name
+                    // and assign the value. If it isn't used, then we get the result we want anyway
+                    data[ a[a.length-1].replace(__reArray, '') ] = val;
+                };
+        
+                return function (data, val) {
+                    return setData( data, val, mSource );
+                };
+            }
+            else
+            {
+                /* Array or flat object mapping */
+                return function (data, val) {
+                    data[mSource] = val;    
+                };
+            }
+        }
+        
+        
+        /**
+         * Return an array with the full table data
+         *  @param {object} oSettings dataTables settings object
+         *  @returns array {array} aData Master data array
+         *  @memberof DataTable#oApi
+         */
+        function _fnGetDataMaster ( oSettings )
+        {
+            var aData = [];
+            var iLen = oSettings.aoData.length;
+            for ( var i=0 ; i<iLen; i++ )
+            {
+                aData.push( oSettings.aoData[i]._aData );
+            }
+            return aData;
+        }
+        
+        
+        /**
+         * Nuke the table
+         *  @param {object} oSettings dataTables settings object
+         *  @memberof DataTable#oApi
+         */
+        function _fnClearTable( oSettings )
+        {
+            oSettings.aoData.splice( 0, oSettings.aoData.length );
+            oSettings.aiDisplayMaster.splice( 0, oSettings.aiDisplayMaster.length );
+            oSettings.aiDisplay.splice( 0, oSettings.aiDisplay.length );
+            _fnCalculateEnd( oSettings );
+        }
+        
+        
+         /**
+         * Take an array of integers (index array) and remove a target integer (value - not 
+         * the key!)
+         *  @param {array} a Index array to target
+         *  @param {int} iTarget value to find
+         *  @memberof DataTable#oApi
+         */
+        function _fnDeleteIndex( a, iTarget )
+        {
+            var iTargetIndex = -1;
+            
+            for ( var i=0, iLen=a.length ; i<iLen ; i++ )
+            {
+                if ( a[i] == iTarget )
+                {
+                    iTargetIndex = i;
+                }
+                else if ( a[i] > iTarget )
+                {
+                    a[i]--;
+                }
+            }
+            
+            if ( iTargetIndex != -1 )
+            {
+                a.splice( iTargetIndex, 1 );
+            }
+        }
+        
+        
+         /**
+         * Call the developer defined fnRender function for a given cell (row/column) with
+         * the required parameters and return the result.
+         *  @param {object} oSettings dataTables settings object
+         *  @param {int} iRow aoData index for the row
+         *  @param {int} iCol aoColumns index for the column
+         *  @returns {*} Return of the developer's fnRender function
+         *  @memberof DataTable#oApi
+         */
+        function _fnRender( oSettings, iRow, iCol )
+        {
+            var oCol = oSettings.aoColumns[iCol];
+        
+            return oCol.fnRender( {
+                "iDataRow":    iRow,
+                "iDataColumn": iCol,
+                "oSettings":   oSettings,
+                "aData":       oSettings.aoData[iRow]._aData,
+                "mDataProp":   oCol.mData
+            }, _fnGetCellData(oSettings, iRow, iCol, 'display') );
+        }
+        /**
+         * Create a new TR element (and it's TD children) for a row
+         *  @param {object} oSettings dataTables settings object
+         *  @param {int} iRow Row to consider
+         *  @memberof DataTable#oApi
+         */
+        function _fnCreateTr ( oSettings, iRow )
+        {
+            var oData = oSettings.aoData[iRow];
+            var nTd;
+        
+            if ( oData.nTr === null )
+            {
+                oData.nTr = document.createElement('tr');
+        
+                /* Use a private property on the node to allow reserve mapping from the node
+                 * to the aoData array for fast look up
+                 */
+                oData.nTr._DT_RowIndex = iRow;
+        
+                /* Special parameters can be given by the data source to be used on the row */
+                if ( oData._aData.DT_RowId )
+                {
+                    oData.nTr.id = oData._aData.DT_RowId;
+                }
+        
+                if ( oData._aData.DT_RowClass )
+                {
+                    oData.nTr.className = oData._aData.DT_RowClass;
+                }
+        
+                /* Process each column */
+                for ( var i=0, iLen=oSettings.aoColumns.length ; i<iLen ; i++ )
+                {
+                    var oCol = oSettings.aoColumns[i];
+                    nTd = document.createElement( oCol.sCellType );
+        
+                    /* Render if needed - if bUseRendered is true then we already have the rendered
+                     * value in the data source - so can just use that
+                     */
+                    nTd.innerHTML = (typeof oCol.fnRender === 'function' && (!oCol.bUseRendered || oCol.mData === null)) ?
+                        _fnRender( oSettings, iRow, i ) :
+                        _fnGetCellData( oSettings, iRow, i, 'display' );
+                
+                    /* Add user defined class */
+                    if ( oCol.sClass !== null )
+                    {
+                        nTd.className = oCol.sClass;
+                    }
+                    
+                    if ( oCol.bVisible )
+                    {
+                        oData.nTr.appendChild( nTd );
+                        oData._anHidden[i] = null;
+                    }
+                    else
+                    {
+                        oData._anHidden[i] = nTd;
+                    }
+        
+                    if ( oCol.fnCreatedCell )
+                    {
+                        oCol.fnCreatedCell.call( oSettings.oInstance,
+                            nTd, _fnGetCellData( oSettings, iRow, i, 'display' ), oData._aData, iRow, i
+                        );
+                    }
+                }
+        
+                _fnCallbackFire( oSettings, 'aoRowCreatedCallback', null, [oData.nTr, oData._aData, iRow] );
+            }
+        }
+        
+        
+        /**
+         * Create the HTML header for the table
+         *  @param {object} oSettings dataTables settings object
+         *  @memberof DataTable#oApi
+         */
+        function _fnBuildHead( oSettings )
+        {
+            var i, nTh, iLen, j, jLen;
+            var iThs = $('th, td', oSettings.nTHead).length;
+            var iCorrector = 0;
+            var jqChildren;
+            
+            /* If there is a header in place - then use it - otherwise it's going to get nuked... */
+            if ( iThs !== 0 )
+            {
+                /* We've got a thead from the DOM, so remove hidden columns and apply width to vis cols */
+                for ( i=0, iLen=oSettings.aoColumns.length ; i<iLen ; i++ )
+                {
+                    nTh = oSettings.aoColumns[i].nTh;
+                    nTh.setAttribute('role', 'columnheader');
+                    if ( oSettings.aoColumns[i].bSortable )
+                    {
+                        nTh.setAttribute('tabindex', oSettings.iTabIndex);
+                        nTh.setAttribute('aria-controls', oSettings.sTableId);
+                    }
+        
+                    if ( oSettings.aoColumns[i].sClass !== null )
+                    {
+                        $(nTh).addClass( oSettings.aoColumns[i].sClass );
+                    }
+                    
+                    /* Set the title of the column if it is user defined (not what was auto detected) */
+                    if ( oSettings.aoColumns[i].sTitle != nTh.innerHTML )
+                    {
+                        nTh.innerHTML = oSettings.aoColumns[i].sTitle;
+                    }
+                }
+            }
+            else
+            {
+                /* We don't have a header in the DOM - so we are going to have to create one */
+                var nTr = document.createElement( "tr" );
+                
+                for ( i=0, iLen=oSettings.aoColumns.length ; i<iLen ; i++ )
+                {
+                    nTh = oSettings.aoColumns[i].nTh;
+                    nTh.innerHTML = oSettings.aoColumns[i].sTitle;
+                    nTh.setAttribute('tabindex', '0');
+                    
+                    if ( oSettings.aoColumns[i].sClass !== null )
+                    {
+                        $(nTh).addClass( oSettings.aoColumns[i].sClass );
+                    }
+                    
+                    nTr.appendChild( nTh );
+                }
+                $(oSettings.nTHead).html( '' )[0].appendChild( nTr );
+                _fnDetectHeader( oSettings.aoHeader, oSettings.nTHead );
+            }
+            
+            /* ARIA role for the rows */    
+            $(oSettings.nTHead).children('tr').attr('role', 'row');
+            
+            /* Add the extra markup needed by jQuery UI's themes */
+            if ( oSettings.bJUI )
+            {
+                for ( i=0, iLen=oSettings.aoColumns.length ; i<iLen ; i++ )
+                {
+                    nTh = oSettings.aoColumns[i].nTh;
+                    
+                    var nDiv = document.createElement('div');
+                    nDiv.className = oSettings.oClasses.sSortJUIWrapper;
+                    $(nTh).contents().appendTo(nDiv);
+                    
+                    var nSpan = document.createElement('span');
+                    nSpan.className = oSettings.oClasses.sSortIcon;
+                    nDiv.appendChild( nSpan );
+                    nTh.appendChild( nDiv );
+                }
+            }
+            
+            if ( oSettings.oFeatures.bSort )
+            {
+                for ( i=0 ; i<oSettings.aoColumns.length ; i++ )
+                {
+                    if ( oSettings.aoColumns[i].bSortable !== false )
+                    {
+                        _fnSortAttachListener( oSettings, oSettings.aoColumns[i].nTh, i );
+                    }
+                    else
+                    {
+                        $(oSettings.aoColumns[i].nTh).addClass( oSettings.oClasses.sSortableNone );
+                    }
+                }
+            }
+            
+            /* Deal with the footer - add classes if required */
+            if ( oSettings.oClasses.sFooterTH !== "" )
+            {
+                $(oSettings.nTFoot).children('tr').children('th').addClass( oSettings.oClasses.sFooterTH );
+            }
+            
+            /* Cache the footer elements */
+            if ( oSettings.nTFoot !== null )
+            {
+                var anCells = _fnGetUniqueThs( oSettings, null, oSettings.aoFooter );
+                for ( i=0, iLen=oSettings.aoColumns.length ; i<iLen ; i++ )
+                {
+                    if ( anCells[i] )
+                    {
+                        oSettings.aoColumns[i].nTf = anCells[i];
+                        if ( oSettings.aoColumns[i].sClass )
+                        {
+                            $(anCells[i]).addClass( oSettings.aoColumns[i].sClass );
+                        }
+                    }
+                }
+            }
+        }
+        
+        
+        /**
+         * Draw the header (or footer) element based on the column visibility states. The
+         * methodology here is to use the layout array from _fnDetectHeader, modified for
+         * the instantaneous column visibility, to construct the new layout. The grid is
+         * traversed over cell at a time in a rows x columns grid fashion, although each 
+         * cell insert can cover multiple elements in the grid - which is tracks using the
+         * aApplied array. Cell inserts in the grid will only occur where there isn't
+         * already a cell in that position.
+         *  @param {object} oSettings dataTables settings object
+         *  @param array {objects} aoSource Layout array from _fnDetectHeader
+         *  @param {boolean} [bIncludeHidden=false] If true then include the hidden columns in the calc, 
+         *  @memberof DataTable#oApi
+         */
+        function _fnDrawHead( oSettings, aoSource, bIncludeHidden )
+        {
+            var i, iLen, j, jLen, k, kLen, n, nLocalTr;
+            var aoLocal = [];
+            var aApplied = [];
+            var iColumns = oSettings.aoColumns.length;
+            var iRowspan, iColspan;
+        
+            if (  bIncludeHidden === undefined )
+            {
+                bIncludeHidden = false;
+            }
+        
+            /* Make a copy of the master layout array, but without the visible columns in it */
+            for ( i=0, iLen=aoSource.length ; i<iLen ; i++ )
+            {
+                aoLocal[i] = aoSource[i].slice();
+                aoLocal[i].nTr = aoSource[i].nTr;
+        
+                /* Remove any columns which are currently hidden */
+                for ( j=iColumns-1 ; j>=0 ; j-- )
+                {
+                    if ( !oSettings.aoColumns[j].bVisible && !bIncludeHidden )
+                    {
+                        aoLocal[i].splice( j, 1 );
+                    }
+                }
+        
+                /* Prep the applied array - it needs an element for each row */
+                aApplied.push( [] );
+            }
+        
+            for ( i=0, iLen=aoLocal.length ; i<iLen ; i++ )
+            {
+                nLocalTr = aoLocal[i].nTr;
+                
+                /* All cells are going to be replaced, so empty out the row */
+                if ( nLocalTr )
+                {
+                    while( (n = nLocalTr.firstChild) )
+                    {
+                        nLocalTr.removeChild( n );
+                    }
+                }
+        
+                for ( j=0, jLen=aoLocal[i].length ; j<jLen ; j++ )
+                {
+                    iRowspan = 1;
+                    iColspan = 1;
+        
+                    /* Check to see if there is already a cell (row/colspan) covering our target
+                     * insert point. If there is, then there is nothing to do.
+                     */
+                    if ( aApplied[i][j] === undefined )
+                    {
+                        nLocalTr.appendChild( aoLocal[i][j].cell );
+                        aApplied[i][j] = 1;
+        
+                        /* Expand the cell to cover as many rows as needed */
+                        while ( aoLocal[i+iRowspan] !== undefined &&
+                                aoLocal[i][j].cell == aoLocal[i+iRowspan][j].cell )
+                        {
+                            aApplied[i+iRowspan][j] = 1;
+                            iRowspan++;
+                        }
+        
+                        /* Expand the cell to cover as many columns as needed */
+                        while ( aoLocal[i][j+iColspan] !== undefined &&
+                                aoLocal[i][j].cell == aoLocal[i][j+iColspan].cell )
+                        {
+                            /* Must update the applied array over the rows for the columns */
+                            for ( k=0 ; k<iRowspan ; k++ )
+                            {
+                                aApplied[i+k][j+iColspan] = 1;
+                            }
+                            iColspan++;
+                        }
+        
+                        /* Do the actual expansion in the DOM */
+                        aoLocal[i][j].cell.rowSpan = iRowspan;
+                        aoLocal[i][j].cell.colSpan = iColspan;
+                    }
+                }
+            }
+        }
+        
+        
+        /**
+         * Insert the required TR nodes into the table for display
+         *  @param {object} oSettings dataTables settings object
+         *  @memberof DataTable#oApi
+         */
+        function _fnDraw( oSettings )
+        {
+            /* Provide a pre-callback function which can be used to cancel the draw is false is returned */
+            var aPreDraw = _fnCallbackFire( oSettings, 'aoPreDrawCallback', 'preDraw', [oSettings] );
+            if ( $.inArray( false, aPreDraw ) !== -1 )
+            {
+                _fnProcessingDisplay( oSettings, false );
+                return;
+            }
+            
+            var i, iLen, n;
+            var anRows = [];
+            var iRowCount = 0;
+            var iStripes = oSettings.asStripeClasses.length;
+            var iOpenRows = oSettings.aoOpenRows.length;
+            
+            oSettings.bDrawing = true;
+            
+            /* Check and see if we have an initial draw position from state saving */
+            if ( oSettings.iInitDisplayStart !== undefined && oSettings.iInitDisplayStart != -1 )
+            {
+                if ( oSettings.oFeatures.bServerSide )
+                {
+                    oSettings._iDisplayStart = oSettings.iInitDisplayStart;
+                }
+                else
+                {
+                    oSettings._iDisplayStart = (oSettings.iInitDisplayStart >= oSettings.fnRecordsDisplay()) ?
+                        0 : oSettings.iInitDisplayStart;
+                }
+                oSettings.iInitDisplayStart = -1;
+                _fnCalculateEnd( oSettings );
+            }
+            
+            /* Server-side processing draw intercept */
+            if ( oSettings.bDeferLoading )
+            {
+                oSettings.bDeferLoading = false;
+                oSettings.iDraw++;
+            }
+            else if ( !oSettings.oFeatures.bServerSide )
+            {
+                oSettings.iDraw++;
+            }
+            else if ( !oSettings.bDestroying && !_fnAjaxUpdate( oSettings ) )
+            {
+                return;
+            }
+            
+            if ( oSettings.aiDisplay.length !== 0 )
+            {
+                var iStart = oSettings._iDisplayStart;
+                var iEnd = oSettings._iDisplayEnd;
+                
+                if ( oSettings.oFeatures.bServerSide )
+                {
+                    iStart = 0;
+                    iEnd = oSettings.aoData.length;
+                }
+                
+                for ( var j=iStart ; j<iEnd ; j++ )
+                {
+                    var aoData = oSettings.aoData[ oSettings.aiDisplay[j] ];
+                    if ( aoData.nTr === null )
+                    {
+                        _fnCreateTr( oSettings, oSettings.aiDisplay[j] );
+                    }
+        
+                    var nRow = aoData.nTr;
+                    
+                    /* Remove the old striping classes and then add the new one */
+                    if ( iStripes !== 0 )
+                    {
+                        var sStripe = oSettings.asStripeClasses[ iRowCount % iStripes ];
+                        if ( aoData._sRowStripe != sStripe )
+                        {
+                            $(nRow).removeClass( aoData._sRowStripe ).addClass( sStripe );
+                            aoData._sRowStripe = sStripe;
+                        }
+                    }
+                    
+                    /* Row callback functions - might want to manipulate the row */
+                    _fnCallbackFire( oSettings, 'aoRowCallback', null, 
+                        [nRow, oSettings.aoData[ oSettings.aiDisplay[j] ]._aData, iRowCount, j] );
+                    
+                    anRows.push( nRow );
+                    iRowCount++;
+                    
+                    /* If there is an open row - and it is attached to this parent - attach it on redraw */
+                    if ( iOpenRows !== 0 )
+                    {
+                        for ( var k=0 ; k<iOpenRows ; k++ )
+                        {
+                            if ( nRow == oSettings.aoOpenRows[k].nParent )
+                            {
+                                anRows.push( oSettings.aoOpenRows[k].nTr );
+                                break;
+                            }
+                        }
+                    }
+                }
+            }
+            else
+            {
+                /* Table is empty - create a row with an empty message in it */
+                anRows[ 0 ] = document.createElement( 'tr' );
+                
+                if ( oSettings.asStripeClasses[0] )
+                {
+                    anRows[ 0 ].className = oSettings.asStripeClasses[0];
+                }
+        
+                var oLang = oSettings.oLanguage;
+                var sZero = oLang.sZeroRecords;
+                if ( oSettings.iDraw == 1 && oSettings.sAjaxSource !== null && !oSettings.oFeatures.bServerSide )
+                {
+                    sZero = oLang.sLoadingRecords;
+                }
+                else if ( oLang.sEmptyTable && oSettings.fnRecordsTotal() === 0 )
+                {
+                    sZero = oLang.sEmptyTable;
+                }
+        
+                var nTd = document.createElement( 'td' );
+                nTd.setAttribute( 'valign', "top" );
+                nTd.colSpan = _fnVisbleColumns( oSettings );
+                nTd.className = oSettings.oClasses.sRowEmpty;
+                nTd.innerHTML = _fnInfoMacros( oSettings, sZero );
+                
+                anRows[ iRowCount ].appendChild( nTd );
+            }
+            
+            /* Header and footer callbacks */
+            _fnCallbackFire( oSettings, 'aoHeaderCallback', 'header', [ $(oSettings.nTHead).children('tr')[0], 
+                _fnGetDataMaster( oSettings ), oSettings._iDisplayStart, oSettings.fnDisplayEnd(), oSettings.aiDisplay ] );
+            
+            _fnCallbackFire( oSettings, 'aoFooterCallback', 'footer', [ $(oSettings.nTFoot).children('tr')[0], 
+                _fnGetDataMaster( oSettings ), oSettings._iDisplayStart, oSettings.fnDisplayEnd(), oSettings.aiDisplay ] );
+            
+            /* 
+             * Need to remove any old row from the display - note we can't just empty the tbody using
+             * $().html('') since this will unbind the jQuery event handlers (even although the node 
+             * still exists!) - equally we can't use innerHTML, since IE throws an exception.
+             */
+            var
+                nAddFrag = document.createDocumentFragment(),
+                nRemoveFrag = document.createDocumentFragment(),
+                nBodyPar, nTrs;
+            
+            if ( oSettings.nTBody )
+            {
+                nBodyPar = oSettings.nTBody.parentNode;
+                nRemoveFrag.appendChild( oSettings.nTBody );
+                
+                /* When doing infinite scrolling, only remove child rows when sorting, filtering or start
+                 * up. When not infinite scroll, always do it.
+                 */
+                if ( !oSettings.oScroll.bInfinite || !oSettings._bInitComplete ||
+                    oSettings.bSorted || oSettings.bFiltered )
+                {
+                    while( (n = oSettings.nTBody.firstChild) )
+                    {
+                        oSettings.nTBody.removeChild( n );
+                    }
+                }
+                
+                /* Put the draw table into the dom */
+                for ( i=0, iLen=anRows.length ; i<iLen ; i++ )
+                {
+                    nAddFrag.appendChild( anRows[i] );
+                }
+                
+                oSettings.nTBody.appendChild( nAddFrag );
+                if ( nBodyPar !== null )
+                {
+                    nBodyPar.appendChild( oSettings.nTBody );
+                }
+            }
+            
+            /* Call all required callback functions for the end of a draw */
+            _fnCallbackFire( oSettings, 'aoDrawCallback', 'draw', [oSettings] );
+            
+            /* Draw is complete, sorting and filtering must be as well */
+            oSettings.bSorted = false;
+            oSettings.bFiltered = false;
+            oSettings.bDrawing = false;
+            
+            if ( oSettings.oFeatures.bServerSide )
+            {
+                _fnProcessingDisplay( oSettings, false );
+                if ( !oSettings._bInitComplete )
+                {
+                    _fnInitComplete( oSettings );
+                }
+            }
+        }
+        
+        
+        /**
+         * Redraw the table - taking account of the various features which are enabled
+         *  @param {object} oSettings dataTables settings object
+         *  @memberof DataTable#oApi
+         */
+        function _fnReDraw( oSettings )
+        {
+            if ( oSettings.oFeatures.bSort )
+            {
+                /* Sorting will refilter and draw for us */
+                _fnSort( oSettings, oSettings.oPreviousSearch );
+            }
+            else if ( oSettings.oFeatures.bFilter )
+            {
+                /* Filtering will redraw for us */
+                _fnFilterComplete( oSettings, oSettings.oPreviousSearch );
+            }
+            else
+            {
+                _fnCalculateEnd( oSettings );
+                _fnDraw( oSettings );
+            }
+        }
+        
+        
+        /**
+         * Add the options to the page HTML for the table
+         *  @param {object} oSettings dataTables settings object
+         *  @memberof DataTable#oApi
+         */
+        function _fnAddOptionsHtml ( oSettings )
+        {
+            /*
+             * Create a temporary, empty, div which we can later on replace with what we have generated
+             * we do it this way to rendering the 'options' html offline - speed :-)
+             */
+            var nHolding = $('<div></div>')[0];
+            oSettings.nTable.parentNode.insertBefore( nHolding, oSettings.nTable );
+            
+            /* 
+             * All DataTables are wrapped in a div
+             */
+            oSettings.nTableWrapper = $('<div id="'+oSettings.sTableId+'_wrapper" class="'+oSettings.oClasses.sWrapper+'" role="grid"></div>')[0];
+            oSettings.nTableReinsertBefore = oSettings.nTable.nextSibling;
+        
+            /* Track where we want to insert the option */
+            var nInsertNode = oSettings.nTableWrapper;
+            
+            /* Loop over the user set positioning and place the elements as needed */
+            var aDom = oSettings.sDom.split('');
+            var nTmp, iPushFeature, cOption, nNewNode, cNext, sAttr, j;
+            for ( var i=0 ; i<aDom.length ; i++ )
+            {
+                iPushFeature = 0;
+                cOption = aDom[i];
+                
+                if ( cOption == '<' )
+                {
+                    /* New container div */
+                    nNewNode = $('<div></div>')[0];
+                    
+                    /* Check to see if we should append an id and/or a class name to the container */
+                    cNext = aDom[i+1];
+                    if ( cNext == "'" || cNext == '"' )
+                    {
+                        sAttr = "";
+                        j = 2;
+                        while ( aDom[i+j] != cNext )
+                        {
+                            sAttr += aDom[i+j];
+                            j++;
+                        }
+                        
+                        /* Replace jQuery UI constants */
+                        if ( sAttr == "H" )
+                        {
+                            sAttr = oSettings.oClasses.sJUIHeader;
+                        }
+                        else if ( sAttr == "F" )
+                        {
+                            sAttr = oSettings.oClasses.sJUIFooter;
+                        }
+                        
+                        /* The attribute can be in the format of "#id.class", "#id" or "class" This logic
+                         * breaks the string into parts and applies them as needed
+                         */
+                        if ( sAttr.indexOf('.') != -1 )
+                        {
+                            var aSplit = sAttr.split('.');
+                            nNewNode.id = aSplit[0].substr(1, aSplit[0].length-1);
+                            nNewNode.className = aSplit[1];
+                        }
+                        else if ( sAttr.charAt(0) == "#" )
+                        {
+                            nNewNode.id = sAttr.substr(1, sAttr.length-1);
+                        }
+                        else
+                        {
+                            nNewNode.className = sAttr;
+                        }
+                        
+                        i += j; /* Move along the position array */
+                    }
+                    
+                    nInsertNode.appendChild( nNewNode );
+                    nInsertNode = nNewNode;
+                }
+                else if ( cOption == '>' )
+                {
+                    /* End container div */
+                    nInsertNode = nInsertNode.parentNode;
+                }
+                else if ( cOption == 'l' && oSettings.oFeatures.bPaginate && oSettings.oFeatures.bLengthChange )
+                {
+                    /* Length */
+                    nTmp = _fnFeatureHtmlLength( oSettings );
+                    iPushFeature = 1;
+                }
+                else if ( cOption == 'f' && oSettings.oFeatures.bFilter )
+                {
+                    /* Filter */
+                    nTmp = _fnFeatureHtmlFilter( oSettings );
+                    iPushFeature = 1;
+                }
+                else if ( cOption == 'r' && oSettings.oFeatures.bProcessing )
+                {
+                    /* pRocessing */
+                    nTmp = _fnFeatureHtmlProcessing( oSettings );
+                    iPushFeature = 1;
+                }
+                else if ( cOption == 't' )
+                {
+                    /* Table */
+                    nTmp = _fnFeatureHtmlTable( oSettings );
+                    iPushFeature = 1;
+                }
+                else if ( cOption ==  'i' && oSettings.oFeatures.bInfo )
+                {
+                    /* Info */
+                    nTmp = _fnFeatureHtmlInfo( oSettings );
+                    iPushFeature = 1;
+                }
+                else if ( cOption == 'p' && oSettings.oFeatures.bPaginate )
+                {
+                    /* Pagination */
+                    nTmp = _fnFeatureHtmlPaginate( oSettings );
+                    iPushFeature = 1;
+                }
+                else if ( DataTable.ext.aoFeatures.length !== 0 )
+                {
+                    /* Plug-in features */
+                    var aoFeatures = DataTable.ext.aoFeatures;
+                    for ( var k=0, kLen=aoFeatures.length ; k<kLen ; k++ )
+                    {
+                        if ( cOption == aoFeatures[k].cFeature )
+                        {
+                            nTmp = aoFeatures[k].fnInit( oSettings );
+                            if ( nTmp )
+                            {
+                                iPushFeature = 1;
+                            }
+                            break;
+                        }
+                    }
+                }
+                
+                /* Add to the 2D features array */
+                if ( iPushFeature == 1 && nTmp !== null )
+                {
+                    if ( typeof oSettings.aanFeatures[cOption] !== 'object' )
+                    {
+                        oSettings.aanFeatures[cOption] = [];
+                    }
+                    oSettings.aanFeatures[cOption].push( nTmp );
+                    nInsertNode.appendChild( nTmp );
+                }
+            }
+            
+            /* Built our DOM structure - replace the holding div with what we want */
+            nHolding.parentNode.replaceChild( oSettings.nTableWrapper, nHolding );
+        }
+        
+        
+        /**
+         * Use the DOM source to create up an array of header cells. The idea here is to
+         * create a layout grid (array) of rows x columns, which contains a reference
+         * to the cell that that point in the grid (regardless of col/rowspan), such that
+         * any column / row could be removed and the new grid constructed
+         *  @param array {object} aLayout Array to store the calculated layout in
+         *  @param {node} nThead The header/footer element for the table
+         *  @memberof DataTable#oApi
+         */
+        function _fnDetectHeader ( aLayout, nThead )
+        {
+            var nTrs = $(nThead).children('tr');
+            var nTr, nCell;
+            var i, k, l, iLen, jLen, iColShifted, iColumn, iColspan, iRowspan;
+            var bUnique;
+            var fnShiftCol = function ( a, i, j ) {
+                var k = a[i];
+                        while ( k[j] ) {
+                    j++;
+                }
+                return j;
+            };
+        
+            aLayout.splice( 0, aLayout.length );
+            
+            /* We know how many rows there are in the layout - so prep it */
+            for ( i=0, iLen=nTrs.length ; i<iLen ; i++ )
+            {
+                aLayout.push( [] );
+            }
+            
+            /* Calculate a layout array */
+            for ( i=0, iLen=nTrs.length ; i<iLen ; i++ )
+            {
+                nTr = nTrs[i];
+                iColumn = 0;
+                
+                /* For every cell in the row... */
+                nCell = nTr.firstChild;
+                while ( nCell ) {
+                    if ( nCell.nodeName.toUpperCase() == "TD" ||
+                         nCell.nodeName.toUpperCase() == "TH" )
+                    {
+                        /* Get the col and rowspan attributes from the DOM and sanitise them */
+                        iColspan = nCell.getAttribute('colspan') * 1;
+                        iRowspan = nCell.getAttribute('rowspan') * 1;
+                        iColspan = (!iColspan || iColspan===0 || iColspan===1) ? 1 : iColspan;
+                        iRowspan = (!iRowspan || iRowspan===0 || iRowspan===1) ? 1 : iRowspan;
+        
+                        /* There might be colspan cells already in this row, so shift our target 
+                         * accordingly
+                         */
+                        iColShifted = fnShiftCol( aLayout, i, iColumn );
+                        
+                        /* Cache calculation for unique columns */
+                        bUnique = iColspan === 1 ? true : false;
+                        
+                        /* If there is col / rowspan, copy the information into the layout grid */
+                        for ( l=0 ; l<iColspan ; l++ )
+                        {
+                            for ( k=0 ; k<iRowspan ; k++ )
+                            {
+                                aLayout[i+k][iColShifted+l] = {
+                                    "cell": nCell,
+                                    "unique": bUnique
+                                };
+                                aLayout[i+k].nTr = nTr;
+                            }
+                        }
+                    }
+                    nCell = nCell.nextSibling;
+                }
+            }
+        }
+        
+        
+        /**
+         * Get an array of unique th elements, one for each column
+         *  @param {object} oSettings dataTables settings object
+         *  @param {node} nHeader automatically detect the layout from this node - optional
+         *  @param {array} aLayout thead/tfoot layout from _fnDetectHeader - optional
+         *  @returns array {node} aReturn list of unique th's
+         *  @memberof DataTable#oApi
+         */
+        function _fnGetUniqueThs ( oSettings, nHeader, aLayout )
+        {
+            var aReturn = [];
+            if ( !aLayout )
+            {
+                aLayout = oSettings.aoHeader;
+                if ( nHeader )
+                {
+                    aLayout = [];
+                    _fnDetectHeader( aLayout, nHeader );
+                }
+            }
+        
+            for ( var i=0, iLen=aLayout.length ; i<iLen ; i++ )
+            {
+                for ( var j=0, jLen=aLayout[i].length ; j<jLen ; j++ )
+                {
+                    if ( aLayout[i][j].unique && 
+                         (!aReturn[j] || !oSettings.bSortCellsTop) )
+                    {
+                        aReturn[j] = aLayout[i][j].cell;
+                    }
+                }
+            }
+            
+            return aReturn;
+        }
+        
+        
+        
+        /**
+         * Update the table using an Ajax call
+         *  @param {object} oSettings dataTables settings object
+         *  @returns {boolean} Block the table drawing or not
+         *  @memberof DataTable#oApi
+         */
+        function _fnAjaxUpdate( oSettings )
+        {
+            if ( oSettings.bAjaxDataGet )
+            {
+                oSettings.iDraw++;
+                _fnProcessingDisplay( oSettings, true );
+                var iColumns = oSettings.aoColumns.length;
+                var aoData = _fnAjaxParameters( oSettings );
+                _fnServerParams( oSettings, aoData );
+                
+                oSettings.fnServerData.call( oSettings.oInstance, oSettings.sAjaxSource, aoData,
+                    function(json) {
+                        _fnAjaxUpdateDraw( oSettings, json );
+                    }, oSettings );
+                return false;
+            }
+            else
+            {
+                return true;
+            }
+        }
+        
+        
+        /**
+         * Build up the parameters in an object needed for a server-side processing request
+         *  @param {object} oSettings dataTables settings object
+         *  @returns {bool} block the table drawing or not
+         *  @memberof DataTable#oApi
+         */
+        function _fnAjaxParameters( oSettings )
+        {
+            var iColumns = oSettings.aoColumns.length;
+            var aoData = [], mDataProp, aaSort, aDataSort;
+            var i, j;
+            
+            aoData.push( { "name": "sEcho",          "value": oSettings.iDraw } );
+            aoData.push( { "name": "iColumns",       "value": iColumns } );
+            aoData.push( { "name": "sColumns",       "value": _fnColumnOrdering(oSettings) } );
+            aoData.push( { "name": "iDisplayStart",  "value": oSettings._iDisplayStart } );
+            aoData.push( { "name": "iDisplayLength", "value": oSettings.oFeatures.bPaginate !== false ?
+                oSettings._iDisplayLength : -1 } );
+                
+            for ( i=0 ; i<iColumns ; i++ )
+            {
+              mDataProp = oSettings.aoColumns[i].mData;
+                aoData.push( { "name": "mDataProp_"+i, "value": typeof(mDataProp)==="function" ? 'function' : mDataProp } );
+            }
+            
+            /* Filtering */
+            if ( oSettings.oFeatures.bFilter !== false )
+            {
+                aoData.push( { "name": "sSearch", "value": oSettings.oPreviousSearch.sSearch } );
+                aoData.push( { "name": "bRegex",  "value": oSettings.oPreviousSearch.bRegex } );
+                for ( i=0 ; i<iColumns ; i++ )
+                {
+                    aoData.push( { "name": "sSearch_"+i,     "value": oSettings.aoPreSearchCols[i].sSearch } );
+                    aoData.push( { "name": "bRegex_"+i,      "value": oSettings.aoPreSearchCols[i].bRegex } );
+                    aoData.push( { "name": "bSearchable_"+i, "value": oSettings.aoColumns[i].bSearchable } );
+                }
+            }
+            
+            /* Sorting */
+            if ( oSettings.oFeatures.bSort !== false )
+            {
+                var iCounter = 0;
+        
+                aaSort = ( oSettings.aaSortingFixed !== null ) ?
+                    oSettings.aaSortingFixed.concat( oSettings.aaSorting ) :
+                    oSettings.aaSorting.slice();
+                
+                for ( i=0 ; i<aaSort.length ; i++ )
+                {
+                    aDataSort = oSettings.aoColumns[ aaSort[i][0] ].aDataSort;
+                    
+                    for ( j=0 ; j<aDataSort.length ; j++ )
+                    {
+                        aoData.push( { "name": "iSortCol_"+iCounter,  "value": aDataSort[j] } );
+                        aoData.push( { "name": "sSortDir_"+iCounter,  "value": aaSort[i][1] } );
+                        iCounter++;
+                    }
+                }
+                aoData.push( { "name": "iSortingCols",   "value": iCounter } );
+                
+                for ( i=0 ; i<iColumns ; i++ )
+                {
+                    aoData.push( { "name": "bSortable_"+i,  "value": oSettings.aoColumns[i].bSortable } );
+                }
+            }
+            
+            return aoData;
+        }
+        
+        
+        /**
+         * Add Ajax parameters from plug-ins
+         *  @param {object} oSettings dataTables settings object
+         *  @param array {objects} aoData name/value pairs to send to the server
+         *  @memberof DataTable#oApi
+         */
+        function _fnServerParams( oSettings, aoData )
+        {
+            _fnCallbackFire( oSettings, 'aoServerParams', 'serverParams', [aoData] );
+        }
+        
+        
+        /**
+         * Data the data from the server (nuking the old) and redraw the table
+         *  @param {object} oSettings dataTables settings object
+         *  @param {object} json json data return from the server.
+         *  @param {string} json.sEcho Tracking flag for DataTables to match requests
+         *  @param {int} json.iTotalRecords Number of records in the data set, not accounting for filtering
+         *  @param {int} json.iTotalDisplayRecords Number of records in the data set, accounting for filtering
+         *  @param {array} json.aaData The data to display on this page
+         *  @param {string} [json.sColumns] Column ordering (sName, comma separated)
+         *  @memberof DataTable#oApi
+         */
+        function _fnAjaxUpdateDraw ( oSettings, json )
+        {
+            if ( json.sEcho !== undefined )
+            {
+                /* Protect against old returns over-writing a new one. Possible when you get
+                 * very fast interaction, and later queries are completed much faster
+                 */
+                if ( json.sEcho*1 < oSettings.iDraw )
+                {
+                    return;
+                }
+                else
+                {
+                    oSettings.iDraw = json.sEcho * 1;
+                }
+            }
+            
+            if ( !oSettings.oScroll.bInfinite ||
+                   (oSettings.oScroll.bInfinite && (oSettings.bSorted || oSettings.bFiltered)) )
+            {
+                _fnClearTable( oSettings );
+            }
+            oSettings._iRecordsTotal = parseInt(json.iTotalRecords, 10);
+            oSettings._iRecordsDisplay = parseInt(json.iTotalDisplayRecords, 10);
+            
+            /* Determine if reordering is required */
+            var sOrdering = _fnColumnOrdering(oSettings);
+            var bReOrder = (json.sColumns !== undefined && sOrdering !== "" && json.sColumns != sOrdering );
+            var aiIndex;
+            if ( bReOrder )
+            {
+                aiIndex = _fnReOrderIndex( oSettings, json.sColumns );
+            }
+            
+            var aData = _fnGetObjectDataFn( oSettings.sAjaxDataProp )( json );
+            for ( var i=0, iLen=aData.length ; i<iLen ; i++ )
+            {
+                if ( bReOrder )
+                {
+                    /* If we need to re-order, then create a new array with the correct order and add it */
+                    var aDataSorted = [];
+                    for ( var j=0, jLen=oSettings.aoColumns.length ; j<jLen ; j++ )
+                    {
+                        aDataSorted.push( aData[i][ aiIndex[j] ] );
+                    }
+                    _fnAddData( oSettings, aDataSorted );
+                }
+                else
+                {
+                    /* No re-order required, sever got it "right" - just straight add */
+                    _fnAddData( oSettings, aData[i] );
+                }
+            }
+            oSettings.aiDisplay = oSettings.aiDisplayMaster.slice();
+            
+            oSettings.bAjaxDataGet = false;
+            _fnDraw( oSettings );
+            oSettings.bAjaxDataGet = true;
+            _fnProcessingDisplay( oSettings, false );
+        }
+        
+        
+        
+        /**
+         * Generate the node required for filtering text
+         *  @returns {node} Filter control element
+         *  @param {object} oSettings dataTables settings object
+         *  @memberof DataTable#oApi
+         */
+        function _fnFeatureHtmlFilter ( oSettings )
+        {
+            var oPreviousSearch = oSettings.oPreviousSearch;
+            
+            var sSearchStr = oSettings.oLanguage.sSearch;
+            sSearchStr = (sSearchStr.indexOf('_INPUT_') !== -1) ?
+              sSearchStr.replace('_INPUT_', '<input type="text" />') :
+              sSearchStr==="" ? '<input type="text" />' : sSearchStr+' <input type="text" />';
+            
+            var nFilter = document.createElement( 'div' );
+            nFilter.className = oSettings.oClasses.sFilter;
+            nFilter.innerHTML = '<label>'+sSearchStr+'</label>';
+            if ( !oSettings.aanFeatures.f )
+            {
+                nFilter.id = oSettings.sTableId+'_filter';
+            }
+            
+            var jqFilter = $('input[type="text"]', nFilter);
+        
+            // Store a reference to the input element, so other input elements could be
+            // added to the filter wrapper if needed (submit button for example)
+            nFilter._DT_Input = jqFilter[0];
+        
+            jqFilter.val( oPreviousSearch.sSearch.replace('"','&quot;') );
+            jqFilter.bind( 'keyup.DT', function(e) {
+                /* Update all other filter input elements for the new display */
+                var n = oSettings.aanFeatures.f;
+                var val = this.

<TRUNCATED>

[51/51] [abbrv] [partial] brooklyn-ui git commit: move subdir from incubator up a level as it is promoted to its own repo (first non-incubator commit!)

Posted by he...@apache.org.
move subdir from incubator up a level as it is promoted to its own repo (first non-incubator commit!)


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/commit/18b073a9
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/tree/18b073a9
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/diff/18b073a9

Branch: refs/heads/master
Commit: 18b073a95526c1842e6869916ac7a4d9960368c1
Parents: f173a0e
Author: Alex Heneveld <al...@cloudsoftcorp.com>
Authored: Sat Jan 30 13:28:02 2016 +0000
Committer: Alex Heneveld <al...@cloudsoftcorp.com>
Committed: Sat Jan 30 13:28:02 2016 +0000

----------------------------------------------------------------------
 .gitignore                                      |     1 +
 LICENSE                                         |    15 -
 README.md                                       |    10 +
 brooklyn-ui/.gitattributes                      |     6 -
 brooklyn-ui/.gitignore                          |    33 -
 brooklyn-ui/LICENSE                             |   440 -
 brooklyn-ui/NOTICE                              |     5 -
 brooklyn-ui/README.md                           |    10 -
 brooklyn-ui/pom.xml                             |   440 -
 brooklyn-ui/src/build/.gitattributes            |     2 -
 brooklyn-ui/src/build/nodejs                    |    41 -
 brooklyn-ui/src/build/optimize-css.json         |    12 -
 brooklyn-ui/src/build/optimize-js.json          |    18 -
 .../src/build/requirejs-maven-plugin/r.js       | 25256 -----------------
 brooklyn-ui/src/main/license/README.md          |     7 -
 brooklyn-ui/src/main/license/files/DISCLAIMER   |     8 -
 brooklyn-ui/src/main/license/files/LICENSE      |   440 -
 brooklyn-ui/src/main/license/files/NOTICE       |     5 -
 .../src/main/license/source-inclusions.yaml     |    42 -
 brooklyn-ui/src/main/webapp/WEB-INF/web.xml     |    24 -
 brooklyn-ui/src/main/webapp/assets/css/base.css |  1488 -
 .../src/main/webapp/assets/css/bootstrap.css    |  5001 ----
 .../src/main/webapp/assets/css/brooklyn.css     |   271 -
 .../webapp/assets/css/jquery.dataTables.css     |   238 -
 .../src/main/webapp/assets/css/styles.css       |    21 -
 .../src/main/webapp/assets/css/swagger.css      |  1567 -
 .../src/main/webapp/assets/html/swagger-ui.html |    78 -
 .../main/webapp/assets/images/Sorting icons.psd |   Bin 27490 -> 0 bytes
 .../assets/images/addApplication-plus-hover.png |   Bin 1620 -> 0 bytes
 .../assets/images/addApplication-plus.png       |   Bin 1680 -> 0 bytes
 .../images/application-icon-add-hover.png       |   Bin 1402 -> 0 bytes
 .../assets/images/application-icon-add.png      |   Bin 1291 -> 0 bytes
 .../images/application-icon-refresh-hover.png   |   Bin 1263 -> 0 bytes
 .../assets/images/application-icon-refresh.png  |   Bin 1225 -> 0 bytes
 .../main/webapp/assets/images/back_disabled.png |   Bin 1361 -> 0 bytes
 .../main/webapp/assets/images/back_enabled.png  |   Bin 1379 -> 0 bytes
 .../webapp/assets/images/back_enabled_hover.png |   Bin 1375 -> 0 bytes
 .../images/brooklyn-header-background.png       |   Bin 2162 -> 0 bytes
 .../main/webapp/assets/images/brooklyn-logo.png |   Bin 7055 -> 0 bytes
 .../src/main/webapp/assets/images/favicon.ico   |   Bin 894 -> 0 bytes
 .../webapp/assets/images/forward_disabled.png   |   Bin 1363 -> 0 bytes
 .../webapp/assets/images/forward_enabled.png    |   Bin 1380 -> 0 bytes
 .../assets/images/forward_enabled_hover.png     |   Bin 1379 -> 0 bytes
 .../assets/images/main-menu-tab-active.png      |   Bin 1051 -> 0 bytes
 .../assets/images/main-menu-tab-hover.png       |   Bin 985 -> 0 bytes
 .../main/webapp/assets/images/main-menu-tab.png |   Bin 985 -> 0 bytes
 .../assets/images/nav-tabs-background.png       |   Bin 985 -> 0 bytes
 .../assets/images/roundedSummary-background.png |   Bin 998 -> 0 bytes
 .../src/main/webapp/assets/images/sort_asc.png  |   Bin 1118 -> 0 bytes
 .../webapp/assets/images/sort_asc_disabled.png  |   Bin 1050 -> 0 bytes
 .../src/main/webapp/assets/images/sort_both.png |   Bin 1136 -> 0 bytes
 .../src/main/webapp/assets/images/sort_desc.png |   Bin 1127 -> 0 bytes
 .../webapp/assets/images/sort_desc_disabled.png |   Bin 1045 -> 0 bytes
 .../src/main/webapp/assets/images/throbber.gif  |   Bin 9257 -> 0 bytes
 .../src/main/webapp/assets/img/bridge.png       |   Bin 154600 -> 0 bytes
 .../src/main/webapp/assets/img/brooklyn.png     |   Bin 14733 -> 0 bytes
 .../src/main/webapp/assets/img/document.png     |   Bin 485 -> 0 bytes
 brooklyn-ui/src/main/webapp/assets/img/fire.png |   Bin 37127 -> 0 bytes
 .../webapp/assets/img/folder-horizontal.png     |   Bin 401 -> 0 bytes
 .../img/glyphicons-halflings-bright-green.png   |   Bin 26800 -> 0 bytes
 .../img/glyphicons-halflings-dark-green.png     |   Bin 27158 -> 0 bytes
 .../assets/img/glyphicons-halflings-green.png   |   Bin 27143 -> 0 bytes
 .../assets/img/glyphicons-halflings-white.png   |   Bin 8777 -> 0 bytes
 .../webapp/assets/img/glyphicons-halflings.png  |   Bin 13826 -> 0 bytes
 .../webapp/assets/img/icon-status-onfire.png    |   Bin 37127 -> 0 bytes
 .../assets/img/icon-status-running-onfire.png   |   Bin 56029 -> 0 bytes
 .../webapp/assets/img/icon-status-running.png   |   Bin 31290 -> 0 bytes
 .../webapp/assets/img/icon-status-starting.gif  |   Bin 23820 -> 0 bytes
 .../assets/img/icon-status-stopped-onfire.png   |   Bin 53515 -> 0 bytes
 .../webapp/assets/img/icon-status-stopped.png   |   Bin 31858 -> 0 bytes
 .../webapp/assets/img/icon-status-stopping.gif  |   Bin 23820 -> 0 bytes
 .../assets/img/magnifying-glass-right-icon.png  |   Bin 958 -> 0 bytes
 .../assets/img/magnifying-glass-right.png       |   Bin 29371 -> 0 bytes
 .../main/webapp/assets/img/magnifying-glass.gif |   Bin 565 -> 0 bytes
 .../webapp/assets/img/toggle-small-expand.png   |   Bin 418 -> 0 bytes
 .../src/main/webapp/assets/img/toggle-small.png |   Bin 394 -> 0 bytes
 brooklyn-ui/src/main/webapp/assets/js/config.js |    84 -
 .../src/main/webapp/assets/js/libs/URI.js       |   133 -
 .../main/webapp/assets/js/libs/ZeroClipboard.js |  1015 -
 .../src/main/webapp/assets/js/libs/async.js     |    46 -
 .../src/main/webapp/assets/js/libs/backbone.js  |  1571 -
 .../src/main/webapp/assets/js/libs/bootstrap.js |  1821 --
 .../assets/js/libs/handlebars-1.0.rc.1.js       |  1928 --
 .../webapp/assets/js/libs/jquery.ba-bbq.min.js  |    18 -
 .../webapp/assets/js/libs/jquery.dataTables.js  | 12098 --------
 .../main/webapp/assets/js/libs/jquery.form.js   |  1076 -
 .../src/main/webapp/assets/js/libs/jquery.js    |  9404 ------
 .../webapp/assets/js/libs/jquery.wiggle.min.js  |     8 -
 .../src/main/webapp/assets/js/libs/js-yaml.js   |  3666 ---
 .../src/main/webapp/assets/js/libs/moment.js    |  1662 --
 .../src/main/webapp/assets/js/libs/require.js   |    35 -
 .../src/main/webapp/assets/js/libs/text.js      |   367 -
 .../main/webapp/assets/js/libs/underscore.js    |  1227 -
 .../src/main/webapp/assets/js/model/app-tree.js |   130 -
 .../main/webapp/assets/js/model/application.js  |   151 -
 .../assets/js/model/catalog-application.js      |    55 -
 .../assets/js/model/catalog-item-summary.js     |    48 -
 .../webapp/assets/js/model/config-summary.js    |    44 -
 .../webapp/assets/js/model/effector-param.js    |    41 -
 .../webapp/assets/js/model/effector-summary.js  |    57 -
 .../webapp/assets/js/model/entity-summary.js    |    64 -
 .../src/main/webapp/assets/js/model/entity.js   |    79 -
 .../src/main/webapp/assets/js/model/location.js |    92 -
 .../assets/js/model/policy-config-summary.js    |    53 -
 .../webapp/assets/js/model/policy-summary.js    |    55 -
 .../webapp/assets/js/model/sensor-summary.js    |    44 -
 .../assets/js/model/server-extended-status.js   |   102 -
 .../main/webapp/assets/js/model/task-summary.js |    81 -
 brooklyn-ui/src/main/webapp/assets/js/router.js |   240 -
 .../webapp/assets/js/util/brooklyn-utils.js     |   226 -
 .../main/webapp/assets/js/util/brooklyn-view.js |   352 -
 .../src/main/webapp/assets/js/util/brooklyn.js  |    86 -
 .../assets/js/util/dataTables.extensions.js     |    56 -
 .../webapp/assets/js/util/jquery.slideto.js     |    61 -
 .../webapp/assets/js/view/activity-details.js   |   426 -
 .../webapp/assets/js/view/add-child-invoke.js   |    61 -
 .../assets/js/view/application-add-wizard.js    |   838 -
 .../assets/js/view/application-explorer.js      |   205 -
 .../webapp/assets/js/view/application-tree.js   |   367 -
 .../src/main/webapp/assets/js/view/catalog.js   |   613 -
 .../webapp/assets/js/view/change-name-invoke.js |    57 -
 .../webapp/assets/js/view/effector-invoke.js    |   171 -
 .../webapp/assets/js/view/entity-activities.js  |   249 -
 .../webapp/assets/js/view/entity-advanced.js    |   177 -
 .../main/webapp/assets/js/view/entity-config.js |   516 -
 .../webapp/assets/js/view/entity-details.js     |   180 -
 .../webapp/assets/js/view/entity-effectors.js   |    92 -
 .../webapp/assets/js/view/entity-policies.js    |   244 -
 .../webapp/assets/js/view/entity-sensors.js     |   539 -
 .../webapp/assets/js/view/entity-summary.js     |   229 -
 .../main/webapp/assets/js/view/googlemaps.js    |   178 -
 .../main/webapp/assets/js/view/ha-summary.js    |   132 -
 .../src/main/webapp/assets/js/view/home.js      |   245 -
 .../assets/js/view/policy-config-invoke.js      |    77 -
 .../main/webapp/assets/js/view/policy-new.js    |    82 -
 .../main/webapp/assets/js/view/script-groovy.js |   105 -
 .../src/main/webapp/assets/js/view/viewutils.js |   560 -
 .../main/webapp/assets/swagger-ui/css/print.css |  1195 -
 .../main/webapp/assets/swagger-ui/css/reset.css |   144 -
 .../webapp/assets/swagger-ui/css/screen.css     |  1301 -
 .../main/webapp/assets/swagger-ui/css/style.css |   269 -
 .../webapp/assets/swagger-ui/css/typography.css |    45 -
 .../fonts/droid-sans-v6-latin-700.eot           |   Bin 22922 -> 0 bytes
 .../fonts/droid-sans-v6-latin-700.svg           |   411 -
 .../fonts/droid-sans-v6-latin-700.ttf           |   Bin 40513 -> 0 bytes
 .../fonts/droid-sans-v6-latin-700.woff          |   Bin 25992 -> 0 bytes
 .../fonts/droid-sans-v6-latin-700.woff2         |   Bin 11480 -> 0 bytes
 .../fonts/droid-sans-v6-latin-regular.eot       |   Bin 22008 -> 0 bytes
 .../fonts/droid-sans-v6-latin-regular.svg       |   403 -
 .../fonts/droid-sans-v6-latin-regular.ttf       |   Bin 39069 -> 0 bytes
 .../fonts/droid-sans-v6-latin-regular.woff      |   Bin 24868 -> 0 bytes
 .../fonts/droid-sans-v6-latin-regular.woff2     |   Bin 11304 -> 0 bytes
 .../assets/swagger-ui/images/explorer_icons.png |   Bin 5763 -> 0 bytes
 .../assets/swagger-ui/images/pet_store_api.png  |   Bin 824 -> 0 bytes
 .../assets/swagger-ui/images/throbber.gif       |   Bin 9257 -> 0 bytes
 .../assets/swagger-ui/images/wordnik_api.png    |   Bin 980 -> 0 bytes
 .../assets/swagger-ui/lib/backbone-min.js       |    34 -
 .../assets/swagger-ui/lib/handlebars-2.0.0.js   |    20 -
 .../assets/swagger-ui/lib/jquery-1.8.0.min.js   |    21 -
 .../assets/swagger-ui/lib/jquery.ba-bbq.min.js  |    29 -
 .../assets/swagger-ui/lib/jquery.wiggle.min.js  |    27 -
 .../main/webapp/assets/swagger-ui/lib/marked.js |  1285 -
 .../assets/swagger-ui/lib/swagger-ui.min.js     |    37 -
 .../assets/swagger-ui/lib/underscore-min.js     |    25 -
 .../assets/swagger-ui/lib/underscore-min.map    |     1 -
 .../tpl/app-add-wizard/create-entity-entry.html |    64 -
 .../create-step-template-entry.html             |    33 -
 .../assets/tpl/app-add-wizard/create.html       |   101 -
 .../app-add-wizard/deploy-location-option.html  |    23 -
 .../tpl/app-add-wizard/deploy-location-row.html |    26 -
 .../app-add-wizard/deploy-version-option.html   |    23 -
 .../assets/tpl/app-add-wizard/deploy.html       |    64 -
 .../tpl/app-add-wizard/edit-config-entry.html   |    28 -
 .../assets/tpl/app-add-wizard/modal-wizard.html |    35 -
 .../app-add-wizard/required-config-entry.html   |    47 -
 .../main/webapp/assets/tpl/apps/activities.html |    30 -
 .../assets/tpl/apps/activity-details.html       |   141 -
 .../assets/tpl/apps/activity-full-details.html  |    25 -
 .../tpl/apps/activity-row-details-main.html     |    28 -
 .../assets/tpl/apps/activity-row-details.html   |    39 -
 .../webapp/assets/tpl/apps/activity-table.html  |    31 -
 .../webapp/assets/tpl/apps/add-child-modal.html |    35 -
 .../main/webapp/assets/tpl/apps/advanced.html   |    75 -
 .../assets/tpl/apps/change-name-modal.html      |    29 -
 .../webapp/assets/tpl/apps/config-name.html     |    34 -
 .../src/main/webapp/assets/tpl/apps/config.html |    33 -
 .../main/webapp/assets/tpl/apps/details.html    |    38 -
 .../webapp/assets/tpl/apps/effector-modal.html  |    37 -
 .../webapp/assets/tpl/apps/effector-row.html    |    27 -
 .../main/webapp/assets/tpl/apps/effector.html   |    34 -
 .../assets/tpl/apps/entity-not-found.html       |    24 -
 .../src/main/webapp/assets/tpl/apps/page.html   |    38 -
 .../main/webapp/assets/tpl/apps/param-list.html |    30 -
 .../src/main/webapp/assets/tpl/apps/param.html  |    42 -
 .../assets/tpl/apps/policy-config-row.html      |    31 -
 .../main/webapp/assets/tpl/apps/policy-new.html |    37 -
 .../tpl/apps/policy-parameter-config.html       |    30 -
 .../main/webapp/assets/tpl/apps/policy-row.html |    32 -
 .../src/main/webapp/assets/tpl/apps/policy.html |    57 -
 .../webapp/assets/tpl/apps/sensor-name.html     |    34 -
 .../main/webapp/assets/tpl/apps/sensors.html    |    33 -
 .../main/webapp/assets/tpl/apps/summary.html    |   107 -
 .../main/webapp/assets/tpl/apps/tree-empty.html |    27 -
 .../main/webapp/assets/tpl/apps/tree-item.html  |    83 -
 .../assets/tpl/catalog/add-catalog-entry.html   |    34 -
 .../webapp/assets/tpl/catalog/add-location.html |    36 -
 .../webapp/assets/tpl/catalog/add-yaml.html     |    29 -
 .../assets/tpl/catalog/details-entity.html      |   178 -
 .../assets/tpl/catalog/details-generic.html     |    45 -
 .../assets/tpl/catalog/details-location.html    |    59 -
 .../webapp/assets/tpl/catalog/nav-entry.html    |    19 -
 .../main/webapp/assets/tpl/catalog/page.html    |    37 -
 .../src/main/webapp/assets/tpl/help/page.html   |    77 -
 .../main/webapp/assets/tpl/home/app-entry.html  |    23 -
 .../webapp/assets/tpl/home/applications.html    |    84 -
 .../main/webapp/assets/tpl/home/ha-summary.html |    32 -
 .../webapp/assets/tpl/home/server-caution.html  |   106 -
 .../main/webapp/assets/tpl/home/summaries.html  |    38 -
 .../src/main/webapp/assets/tpl/labs/page.html   |   195 -
 .../main/webapp/assets/tpl/lib/basic-modal.html |    29 -
 .../lib/config-key-type-value-input-pair.html   |    23 -
 .../main/webapp/assets/tpl/script/groovy.html   |    93 -
 .../main/webapp/assets/tpl/script/swagger.html  |    30 -
 brooklyn-ui/src/main/webapp/favicon.ico         |   Bin 1150 -> 0 bytes
 brooklyn-ui/src/main/webapp/index.html          |    77 -
 brooklyn-ui/src/test/javascript/config.txt      |    72 -
 .../src/test/javascript/specs/home-spec.js      |   106 -
 .../src/test/javascript/specs/library-spec.js   |    50 -
 .../javascript/specs/model/app-tree-spec.js     |    68 -
 .../javascript/specs/model/application-spec.js  |   128 -
 .../specs/model/catalog-application-spec.js     |   130 -
 .../javascript/specs/model/effector-spec.js     |    60 -
 .../test/javascript/specs/model/entity-spec.js  |    38 -
 .../specs/model/entity-summary-spec.js          |    48 -
 .../javascript/specs/model/location-spec.js     |    58 -
 .../specs/model/sensor-summary-spec.js          |    41 -
 .../javascript/specs/model/task-summary-spec.js |    35 -
 .../src/test/javascript/specs/router-spec.js    |    92 -
 .../test/javascript/specs/util/brooklyn-spec.js |   128 -
 .../specs/util/brooklyn-utils-spec.js           |   151 -
 .../specs/view/application-add-wizard-spec.js   |   215 -
 .../specs/view/application-explorer-spec.js     |    80 -
 .../specs/view/application-tree-spec.js         |    75 -
 .../specs/view/effector-invoke-spec.js          |    82 -
 .../specs/view/entity-activities-spec.js        |    34 -
 .../specs/view/entity-details-spec.js           |   120 -
 .../specs/view/entity-effector-view-spec.js     |    49 -
 .../specs/view/entity-sensors-spec.js           |    43 -
 brooklyn-ui/src/test/license/DISCLAIMER         |     8 -
 brooklyn-ui/src/test/license/LICENSE            |   175 -
 brooklyn-ui/src/test/license/NOTICE             |     5 -
 pom.xml                                         |   440 +
 src/build/.gitattributes                        |     2 +
 src/build/nodejs                                |    41 +
 src/build/optimize-css.json                     |    12 +
 src/build/optimize-js.json                      |    18 +
 src/build/requirejs-maven-plugin/r.js           | 25256 +++++++++++++++++
 src/main/license/README.md                      |     7 +
 src/main/license/files/DISCLAIMER               |     8 +
 src/main/license/files/LICENSE                  |   440 +
 src/main/license/files/NOTICE                   |     5 +
 src/main/license/source-inclusions.yaml         |    42 +
 src/main/webapp/WEB-INF/web.xml                 |    24 +
 src/main/webapp/assets/css/base.css             |  1488 +
 src/main/webapp/assets/css/bootstrap.css        |  5001 ++++
 src/main/webapp/assets/css/brooklyn.css         |   271 +
 .../webapp/assets/css/jquery.dataTables.css     |   238 +
 src/main/webapp/assets/css/styles.css           |    21 +
 src/main/webapp/assets/css/swagger.css          |  1567 +
 src/main/webapp/assets/html/swagger-ui.html     |    78 +
 src/main/webapp/assets/images/Sorting icons.psd |   Bin 0 -> 27490 bytes
 .../assets/images/addApplication-plus-hover.png |   Bin 0 -> 1620 bytes
 .../assets/images/addApplication-plus.png       |   Bin 0 -> 1680 bytes
 .../images/application-icon-add-hover.png       |   Bin 0 -> 1402 bytes
 .../assets/images/application-icon-add.png      |   Bin 0 -> 1291 bytes
 .../images/application-icon-refresh-hover.png   |   Bin 0 -> 1263 bytes
 .../assets/images/application-icon-refresh.png  |   Bin 0 -> 1225 bytes
 src/main/webapp/assets/images/back_disabled.png |   Bin 0 -> 1361 bytes
 src/main/webapp/assets/images/back_enabled.png  |   Bin 0 -> 1379 bytes
 .../webapp/assets/images/back_enabled_hover.png |   Bin 0 -> 1375 bytes
 .../images/brooklyn-header-background.png       |   Bin 0 -> 2162 bytes
 src/main/webapp/assets/images/brooklyn-logo.png |   Bin 0 -> 7055 bytes
 src/main/webapp/assets/images/favicon.ico       |   Bin 0 -> 894 bytes
 .../webapp/assets/images/forward_disabled.png   |   Bin 0 -> 1363 bytes
 .../webapp/assets/images/forward_enabled.png    |   Bin 0 -> 1380 bytes
 .../assets/images/forward_enabled_hover.png     |   Bin 0 -> 1379 bytes
 .../assets/images/main-menu-tab-active.png      |   Bin 0 -> 1051 bytes
 .../assets/images/main-menu-tab-hover.png       |   Bin 0 -> 985 bytes
 src/main/webapp/assets/images/main-menu-tab.png |   Bin 0 -> 985 bytes
 .../assets/images/nav-tabs-background.png       |   Bin 0 -> 985 bytes
 .../assets/images/roundedSummary-background.png |   Bin 0 -> 998 bytes
 src/main/webapp/assets/images/sort_asc.png      |   Bin 0 -> 1118 bytes
 .../webapp/assets/images/sort_asc_disabled.png  |   Bin 0 -> 1050 bytes
 src/main/webapp/assets/images/sort_both.png     |   Bin 0 -> 1136 bytes
 src/main/webapp/assets/images/sort_desc.png     |   Bin 0 -> 1127 bytes
 .../webapp/assets/images/sort_desc_disabled.png |   Bin 0 -> 1045 bytes
 src/main/webapp/assets/images/throbber.gif      |   Bin 0 -> 9257 bytes
 src/main/webapp/assets/img/bridge.png           |   Bin 0 -> 154600 bytes
 src/main/webapp/assets/img/brooklyn.png         |   Bin 0 -> 14733 bytes
 src/main/webapp/assets/img/document.png         |   Bin 0 -> 485 bytes
 src/main/webapp/assets/img/fire.png             |   Bin 0 -> 37127 bytes
 .../webapp/assets/img/folder-horizontal.png     |   Bin 0 -> 401 bytes
 .../img/glyphicons-halflings-bright-green.png   |   Bin 0 -> 26800 bytes
 .../img/glyphicons-halflings-dark-green.png     |   Bin 0 -> 27158 bytes
 .../assets/img/glyphicons-halflings-green.png   |   Bin 0 -> 27143 bytes
 .../assets/img/glyphicons-halflings-white.png   |   Bin 0 -> 8777 bytes
 .../webapp/assets/img/glyphicons-halflings.png  |   Bin 0 -> 13826 bytes
 .../webapp/assets/img/icon-status-onfire.png    |   Bin 0 -> 37127 bytes
 .../assets/img/icon-status-running-onfire.png   |   Bin 0 -> 56029 bytes
 .../webapp/assets/img/icon-status-running.png   |   Bin 0 -> 31290 bytes
 .../webapp/assets/img/icon-status-starting.gif  |   Bin 0 -> 23820 bytes
 .../assets/img/icon-status-stopped-onfire.png   |   Bin 0 -> 53515 bytes
 .../webapp/assets/img/icon-status-stopped.png   |   Bin 0 -> 31858 bytes
 .../webapp/assets/img/icon-status-stopping.gif  |   Bin 0 -> 23820 bytes
 .../assets/img/magnifying-glass-right-icon.png  |   Bin 0 -> 958 bytes
 .../assets/img/magnifying-glass-right.png       |   Bin 0 -> 29371 bytes
 src/main/webapp/assets/img/magnifying-glass.gif |   Bin 0 -> 565 bytes
 .../webapp/assets/img/toggle-small-expand.png   |   Bin 0 -> 418 bytes
 src/main/webapp/assets/img/toggle-small.png     |   Bin 0 -> 394 bytes
 src/main/webapp/assets/js/config.js             |    84 +
 src/main/webapp/assets/js/libs/URI.js           |   133 +
 src/main/webapp/assets/js/libs/ZeroClipboard.js |  1015 +
 src/main/webapp/assets/js/libs/async.js         |    46 +
 src/main/webapp/assets/js/libs/backbone.js      |  1571 +
 src/main/webapp/assets/js/libs/bootstrap.js     |  1821 ++
 .../assets/js/libs/handlebars-1.0.rc.1.js       |  1928 ++
 .../webapp/assets/js/libs/jquery.ba-bbq.min.js  |    18 +
 .../webapp/assets/js/libs/jquery.dataTables.js  | 12098 ++++++++
 src/main/webapp/assets/js/libs/jquery.form.js   |  1076 +
 src/main/webapp/assets/js/libs/jquery.js        |  9404 ++++++
 .../webapp/assets/js/libs/jquery.wiggle.min.js  |     8 +
 src/main/webapp/assets/js/libs/js-yaml.js       |  3666 +++
 src/main/webapp/assets/js/libs/moment.js        |  1662 ++
 src/main/webapp/assets/js/libs/require.js       |    35 +
 src/main/webapp/assets/js/libs/text.js          |   367 +
 src/main/webapp/assets/js/libs/underscore.js    |  1227 +
 src/main/webapp/assets/js/model/app-tree.js     |   130 +
 src/main/webapp/assets/js/model/application.js  |   151 +
 .../assets/js/model/catalog-application.js      |    55 +
 .../assets/js/model/catalog-item-summary.js     |    48 +
 .../webapp/assets/js/model/config-summary.js    |    44 +
 .../webapp/assets/js/model/effector-param.js    |    41 +
 .../webapp/assets/js/model/effector-summary.js  |    57 +
 .../webapp/assets/js/model/entity-summary.js    |    64 +
 src/main/webapp/assets/js/model/entity.js       |    79 +
 src/main/webapp/assets/js/model/location.js     |    92 +
 .../assets/js/model/policy-config-summary.js    |    53 +
 .../webapp/assets/js/model/policy-summary.js    |    55 +
 .../webapp/assets/js/model/sensor-summary.js    |    44 +
 .../assets/js/model/server-extended-status.js   |   102 +
 src/main/webapp/assets/js/model/task-summary.js |    81 +
 src/main/webapp/assets/js/router.js             |   240 +
 .../webapp/assets/js/util/brooklyn-utils.js     |   226 +
 src/main/webapp/assets/js/util/brooklyn-view.js |   352 +
 src/main/webapp/assets/js/util/brooklyn.js      |    86 +
 .../assets/js/util/dataTables.extensions.js     |    56 +
 .../webapp/assets/js/util/jquery.slideto.js     |    61 +
 .../webapp/assets/js/view/activity-details.js   |   426 +
 .../webapp/assets/js/view/add-child-invoke.js   |    61 +
 .../assets/js/view/application-add-wizard.js    |   838 +
 .../assets/js/view/application-explorer.js      |   205 +
 .../webapp/assets/js/view/application-tree.js   |   367 +
 src/main/webapp/assets/js/view/catalog.js       |   613 +
 .../webapp/assets/js/view/change-name-invoke.js |    57 +
 .../webapp/assets/js/view/effector-invoke.js    |   171 +
 .../webapp/assets/js/view/entity-activities.js  |   249 +
 .../webapp/assets/js/view/entity-advanced.js    |   177 +
 src/main/webapp/assets/js/view/entity-config.js |   516 +
 .../webapp/assets/js/view/entity-details.js     |   180 +
 .../webapp/assets/js/view/entity-effectors.js   |    92 +
 .../webapp/assets/js/view/entity-policies.js    |   244 +
 .../webapp/assets/js/view/entity-sensors.js     |   539 +
 .../webapp/assets/js/view/entity-summary.js     |   229 +
 src/main/webapp/assets/js/view/googlemaps.js    |   178 +
 src/main/webapp/assets/js/view/ha-summary.js    |   132 +
 src/main/webapp/assets/js/view/home.js          |   245 +
 .../assets/js/view/policy-config-invoke.js      |    77 +
 src/main/webapp/assets/js/view/policy-new.js    |    82 +
 src/main/webapp/assets/js/view/script-groovy.js |   105 +
 src/main/webapp/assets/js/view/viewutils.js     |   560 +
 src/main/webapp/assets/swagger-ui/css/print.css |  1195 +
 src/main/webapp/assets/swagger-ui/css/reset.css |   144 +
 .../webapp/assets/swagger-ui/css/screen.css     |  1301 +
 src/main/webapp/assets/swagger-ui/css/style.css |   269 +
 .../webapp/assets/swagger-ui/css/typography.css |    45 +
 .../fonts/droid-sans-v6-latin-700.eot           |   Bin 0 -> 22922 bytes
 .../fonts/droid-sans-v6-latin-700.svg           |   411 +
 .../fonts/droid-sans-v6-latin-700.ttf           |   Bin 0 -> 40513 bytes
 .../fonts/droid-sans-v6-latin-700.woff          |   Bin 0 -> 25992 bytes
 .../fonts/droid-sans-v6-latin-700.woff2         |   Bin 0 -> 11480 bytes
 .../fonts/droid-sans-v6-latin-regular.eot       |   Bin 0 -> 22008 bytes
 .../fonts/droid-sans-v6-latin-regular.svg       |   403 +
 .../fonts/droid-sans-v6-latin-regular.ttf       |   Bin 0 -> 39069 bytes
 .../fonts/droid-sans-v6-latin-regular.woff      |   Bin 0 -> 24868 bytes
 .../fonts/droid-sans-v6-latin-regular.woff2     |   Bin 0 -> 11304 bytes
 .../assets/swagger-ui/images/explorer_icons.png |   Bin 0 -> 5763 bytes
 .../assets/swagger-ui/images/pet_store_api.png  |   Bin 0 -> 824 bytes
 .../assets/swagger-ui/images/throbber.gif       |   Bin 0 -> 9257 bytes
 .../assets/swagger-ui/images/wordnik_api.png    |   Bin 0 -> 980 bytes
 .../assets/swagger-ui/lib/backbone-min.js       |    34 +
 .../assets/swagger-ui/lib/handlebars-2.0.0.js   |    20 +
 .../assets/swagger-ui/lib/jquery-1.8.0.min.js   |    21 +
 .../assets/swagger-ui/lib/jquery.ba-bbq.min.js  |    29 +
 .../assets/swagger-ui/lib/jquery.wiggle.min.js  |    27 +
 src/main/webapp/assets/swagger-ui/lib/marked.js |  1285 +
 .../assets/swagger-ui/lib/swagger-ui.min.js     |    37 +
 .../assets/swagger-ui/lib/underscore-min.js     |    25 +
 .../assets/swagger-ui/lib/underscore-min.map    |     1 +
 .../tpl/app-add-wizard/create-entity-entry.html |    64 +
 .../create-step-template-entry.html             |    33 +
 .../assets/tpl/app-add-wizard/create.html       |   101 +
 .../app-add-wizard/deploy-location-option.html  |    23 +
 .../tpl/app-add-wizard/deploy-location-row.html |    26 +
 .../app-add-wizard/deploy-version-option.html   |    23 +
 .../assets/tpl/app-add-wizard/deploy.html       |    64 +
 .../tpl/app-add-wizard/edit-config-entry.html   |    28 +
 .../assets/tpl/app-add-wizard/modal-wizard.html |    35 +
 .../app-add-wizard/required-config-entry.html   |    47 +
 src/main/webapp/assets/tpl/apps/activities.html |    30 +
 .../assets/tpl/apps/activity-details.html       |   141 +
 .../assets/tpl/apps/activity-full-details.html  |    25 +
 .../tpl/apps/activity-row-details-main.html     |    28 +
 .../assets/tpl/apps/activity-row-details.html   |    39 +
 .../webapp/assets/tpl/apps/activity-table.html  |    31 +
 .../webapp/assets/tpl/apps/add-child-modal.html |    35 +
 src/main/webapp/assets/tpl/apps/advanced.html   |    75 +
 .../assets/tpl/apps/change-name-modal.html      |    29 +
 .../webapp/assets/tpl/apps/config-name.html     |    34 +
 src/main/webapp/assets/tpl/apps/config.html     |    33 +
 src/main/webapp/assets/tpl/apps/details.html    |    38 +
 .../webapp/assets/tpl/apps/effector-modal.html  |    37 +
 .../webapp/assets/tpl/apps/effector-row.html    |    27 +
 src/main/webapp/assets/tpl/apps/effector.html   |    34 +
 .../assets/tpl/apps/entity-not-found.html       |    24 +
 src/main/webapp/assets/tpl/apps/page.html       |    38 +
 src/main/webapp/assets/tpl/apps/param-list.html |    30 +
 src/main/webapp/assets/tpl/apps/param.html      |    42 +
 .../assets/tpl/apps/policy-config-row.html      |    31 +
 src/main/webapp/assets/tpl/apps/policy-new.html |    37 +
 .../tpl/apps/policy-parameter-config.html       |    30 +
 src/main/webapp/assets/tpl/apps/policy-row.html |    32 +
 src/main/webapp/assets/tpl/apps/policy.html     |    57 +
 .../webapp/assets/tpl/apps/sensor-name.html     |    34 +
 src/main/webapp/assets/tpl/apps/sensors.html    |    33 +
 src/main/webapp/assets/tpl/apps/summary.html    |   107 +
 src/main/webapp/assets/tpl/apps/tree-empty.html |    27 +
 src/main/webapp/assets/tpl/apps/tree-item.html  |    83 +
 .../assets/tpl/catalog/add-catalog-entry.html   |    34 +
 .../webapp/assets/tpl/catalog/add-location.html |    36 +
 .../webapp/assets/tpl/catalog/add-yaml.html     |    29 +
 .../assets/tpl/catalog/details-entity.html      |   178 +
 .../assets/tpl/catalog/details-generic.html     |    45 +
 .../assets/tpl/catalog/details-location.html    |    59 +
 .../webapp/assets/tpl/catalog/nav-entry.html    |    19 +
 src/main/webapp/assets/tpl/catalog/page.html    |    37 +
 src/main/webapp/assets/tpl/help/page.html       |    77 +
 src/main/webapp/assets/tpl/home/app-entry.html  |    23 +
 .../webapp/assets/tpl/home/applications.html    |    84 +
 src/main/webapp/assets/tpl/home/ha-summary.html |    32 +
 .../webapp/assets/tpl/home/server-caution.html  |   106 +
 src/main/webapp/assets/tpl/home/summaries.html  |    38 +
 src/main/webapp/assets/tpl/labs/page.html       |   195 +
 src/main/webapp/assets/tpl/lib/basic-modal.html |    29 +
 .../lib/config-key-type-value-input-pair.html   |    23 +
 src/main/webapp/assets/tpl/script/groovy.html   |    93 +
 src/main/webapp/assets/tpl/script/swagger.html  |    30 +
 src/main/webapp/favicon.ico                     |   Bin 0 -> 1150 bytes
 src/main/webapp/index.html                      |    77 +
 src/test/javascript/config.txt                  |    72 +
 src/test/javascript/specs/home-spec.js          |   106 +
 src/test/javascript/specs/library-spec.js       |    50 +
 .../javascript/specs/model/app-tree-spec.js     |    68 +
 .../javascript/specs/model/application-spec.js  |   128 +
 .../specs/model/catalog-application-spec.js     |   130 +
 .../javascript/specs/model/effector-spec.js     |    60 +
 src/test/javascript/specs/model/entity-spec.js  |    38 +
 .../specs/model/entity-summary-spec.js          |    48 +
 .../javascript/specs/model/location-spec.js     |    58 +
 .../specs/model/sensor-summary-spec.js          |    41 +
 .../javascript/specs/model/task-summary-spec.js |    35 +
 src/test/javascript/specs/router-spec.js        |    92 +
 src/test/javascript/specs/util/brooklyn-spec.js |   128 +
 .../specs/util/brooklyn-utils-spec.js           |   151 +
 .../specs/view/application-add-wizard-spec.js   |   215 +
 .../specs/view/application-explorer-spec.js     |    80 +
 .../specs/view/application-tree-spec.js         |    75 +
 .../specs/view/effector-invoke-spec.js          |    82 +
 .../specs/view/entity-activities-spec.js        |    34 +
 .../specs/view/entity-details-spec.js           |   120 +
 .../specs/view/entity-effector-view-spec.js     |    49 +
 .../specs/view/entity-sensors-spec.js           |    43 +
 src/test/license/DISCLAIMER                     |     8 +
 src/test/license/LICENSE                        |   175 +
 src/test/license/NOTICE                         |     5 +
 494 files changed, 89856 insertions(+), 90354 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index ed439f2..8fb7ef7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -30,3 +30,4 @@ brooklyn*.log.*
 *brooklyn-persisted-state/
 
 ignored
+/build/

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/LICENSE
----------------------------------------------------------------------
diff --git a/LICENSE b/LICENSE
index 3d8f4e7..58c78f1 100644
--- a/LICENSE
+++ b/LICENSE
@@ -337,13 +337,6 @@ This project includes the software: Swagger UI
   Used under the following license: Apache License, version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
   Copyright (c) SmartBear Software (2011-2015)
 
-This project includes the software: typeahead.js
-  Available at: https://github.com/twitter/typeahead.js
-  Developed by: Twitter, Inc (http://twitter.com)
-  Version used: 0.10.5
-  Used under the following license: The MIT License (http://opensource.org/licenses/MIT)
-  Copyright (c) Twitter, Inc. and other contributors (2013-2014)
-
 This project includes the software: underscore.js
   Available at: http://underscorejs.org
   Developed by: DocumentCloud Inc. (http://www.documentcloud.org/)
@@ -352,14 +345,6 @@ This project includes the software: underscore.js
   Used under the following license: The MIT License (http://opensource.org/licenses/MIT)
   Copyright (c) Jeremy Ashkenas, DocumentCloud Inc. (2009-2013)
 
-This project includes the software: underscore.js:1.7.0
-  Available at: http://underscorejs.org
-  Developed by: DocumentCloud Inc. (http://www.documentcloud.org/)
-  Inclusive of: underscore*.{js,map}
-  Version used: 1.7.0
-  Used under the following license: The MIT License (http://opensource.org/licenses/MIT)
-  Copyright (c) Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors (2009-2014)
-
 This project includes the software: ZeroClipboard
   Available at: http://zeroclipboard.org/
   Developed by: ZeroClipboard contributors (https://github.com/zeroclipboard)

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..057c206
--- /dev/null
+++ b/README.md
@@ -0,0 +1,10 @@
+
+# [![**Brooklyn**](https://brooklyn.apache.org/style/img/apache-brooklyn-logo-244px-wide.png)](http://brooklyn.apache.org/)
+
+### Apache Brooklyn UI Sub-Project
+
+This repo contains the JS GUI for Apache Brooklyn.
+
+It is pure Javascript, but for legacy reasons it expects the REST endpoint at the same endpoint,
+so currently the easiest way to run it is using the BrooklynJavascriptGuiLauncher java launcher 
+in `brooklyn-server`.

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/.gitattributes
----------------------------------------------------------------------
diff --git a/brooklyn-ui/.gitattributes b/brooklyn-ui/.gitattributes
deleted file mode 100644
index 7920d0e..0000000
--- a/brooklyn-ui/.gitattributes
+++ /dev/null
@@ -1,6 +0,0 @@
-#Don't auto-convert line endings for shell scripts on Windows (breaks the scripts)
-* text=auto
-*.sh text eol=lf
-*.bat text eol=crlf
-*.ps1 text eol=crlf
-*.ini text eol=crlf

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/.gitignore
----------------------------------------------------------------------
diff --git a/brooklyn-ui/.gitignore b/brooklyn-ui/.gitignore
deleted file mode 100644
index 8fb7ef7..0000000
--- a/brooklyn-ui/.gitignore
+++ /dev/null
@@ -1,33 +0,0 @@
-\#*\#
-*~
-*.bak
-*.swp
-*.swo
-.DS_Store
-
-atlassian-ide-plugin.xml
-*.class
-
-target/
-test-output/
-
-.project
-.classpath
-.settings/
-.metadata/
-
-.idea/
-*.iml
-
-nbactions.xml
-nb-configuration.xml
-
-prodDb.*
-
-*.log
-brooklyn*.log.*
-
-*brooklyn-persisted-state/
-
-ignored
-/build/

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/LICENSE
----------------------------------------------------------------------
diff --git a/brooklyn-ui/LICENSE b/brooklyn-ui/LICENSE
deleted file mode 100644
index 58c78f1..0000000
--- a/brooklyn-ui/LICENSE
+++ /dev/null
@@ -1,440 +0,0 @@
-
-This software is distributed under the Apache License, version 2.0. See (1) below.
-This software is copyright (c) The Apache Software Foundation and contributors.
-
-Contents:
-
-  (1) This software license: Apache License, version 2.0
-  (2) Notices for bundled software
-  (3) Licenses for bundled software
-
-
----------------------------------------------------
-
-(1) This software license: Apache License, version 2.0
-
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-
----------------------------------------------------
-
-(2) Notices for bundled software
-
-This project includes the software: async.js
-  Available at: https://github.com/p15martin/google-maps-hello-world/blob/master/js/libs/async.js
-  Developed by: Miller Medeiros (https://github.com/millermedeiros/)
-  Version used: 0.1.1
-  Used under the following license: The MIT License (http://opensource.org/licenses/MIT)
-  Copyright (c) Miller Medeiros (2011)
-
-This project includes the software: backbone.js
-  Available at: http://backbonejs.org
-  Developed by: DocumentCloud Inc. (http://www.documentcloud.org/)
-  Version used: 1.0.0
-  Used under the following license: The MIT License (http://opensource.org/licenses/MIT)
-  Copyright (c) Jeremy Ashkenas, DocumentCloud Inc. (2010-2013)
-
-This project includes the software: bootstrap.js
-  Available at: http://twitter.github.com/bootstrap/javascript.html#transitions
-  Version used: 2.0.4
-  Used under the following license: Apache License, version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
-  Copyright (c) Twitter, Inc. (2012)
-
-This project includes the software: handlebars.js
-  Available at: https://github.com/wycats/handlebars.js
-  Developed by: Yehuda Katz (https://github.com/wycats/)
-  Inclusive of: handlebars*.js
-  Version used: 1.0-rc1
-  Used under the following license: The MIT License (http://opensource.org/licenses/MIT)
-  Copyright (c) Yehuda Katz (2012)
-
-This project includes the software: jQuery JavaScript Library
-  Available at: http://jquery.com/
-  Developed by: The jQuery Foundation (http://jquery.org/)
-  Inclusive of: jquery.js
-  Version used: 1.7.2
-  Used under the following license: The MIT License (http://opensource.org/licenses/MIT)
-  Copyright (c) John Resig (2005-2011)
-  Includes code fragments from sizzle.js:
-    Copyright (c) The Dojo Foundation
-    Available at http://sizzlejs.com
-    Used under the MIT license
-
-This project includes the software: jQuery BBQ: Back Button & Query Library
-  Available at: http://benalman.com/projects/jquery-bbq-plugin/
-  Developed by: "Cowboy" Ben Alman (http://benalman.com/)
-  Inclusive of: jquery.ba-bbq*.js
-  Version used: 1.2.1
-  Used under the following license: The MIT License (http://opensource.org/licenses/MIT)
-  Copyright (c) "Cowboy" Ben Alman (2010)"
-
-This project includes the software: DataTables Table plug-in for jQuery
-  Available at: http://www.datatables.net/
-  Developed by: SpryMedia Ltd (http://sprymedia.co.uk/)
-  Inclusive of: jquery.dataTables.{js,css}
-  Version used: 1.9.4
-  Used under the following license: The BSD 3-Clause (New BSD) License (http://opensource.org/licenses/BSD-3-Clause)
-  Copyright (c) Allan Jardine (2008-2012)
-
-This project includes the software: jQuery Form Plugin
-  Available at: https://github.com/malsup/form
-  Developed by: Mike Alsup (http://malsup.com/)
-  Inclusive of: jquery.form.js
-  Version used: 3.09
-  Used under the following license: The MIT License (http://opensource.org/licenses/MIT)
-  Copyright (c) M. Alsup (2006-2013)
-
-This project includes the software: jQuery Wiggle
-  Available at: https://github.com/jordanthomas/jquery-wiggle
-  Inclusive of: jquery.wiggle.min.js
-  Version used: swagger-ui:1.0.1
-  Used under the following license: The MIT License (http://opensource.org/licenses/MIT)
-  Copyright (c) WonderGroup and Jordan Thomas (2010)
-  Previously online at http://labs.wondergroup.com/demos/mini-ui/index.html.
-  The version included here is from the Swagger UI distribution.
-
-This project includes the software: js-uri
-  Available at: http://code.google.com/p/js-uri/
-  Developed by: js-uri contributors (https://code.google.com/js-uri)
-  Inclusive of: URI.js
-  Version used: 0.1
-  Used under the following license: The BSD 3-Clause (New BSD) License (http://opensource.org/licenses/BSD-3-Clause)
-  Copyright (c) js-uri contributors (2013)
-
-This project includes the software: js-yaml.js
-  Available at: https://github.com/nodeca/
-  Developed by: Vitaly Puzrin (https://github.com/nodeca/)
-  Version used: 3.2.7
-  Used under the following license: The MIT License (http://opensource.org/licenses/MIT)
-  Copyright (c) Vitaly Puzrin (2011-2015)
-
-This project includes the software: marked.js
-  Available at: https://github.com/chjj/marked
-  Developed by: Christopher Jeffrey (https://github.com/chjj)
-  Version used: 0.3.1
-  Used under the following license: The MIT License (http://opensource.org/licenses/MIT)
-  Copyright (c) Christopher Jeffrey (2011-2014)
-
-This project includes the software: moment.js
-  Available at: http://momentjs.com
-  Developed by: Tim Wood (http://momentjs.com)
-  Version used: 2.1.0
-  Used under the following license: The MIT License (http://opensource.org/licenses/MIT)
-  Copyright (c) Tim Wood, Iskren Chernev, Moment.js contributors (2011-2014)
-
-This project includes the software: RequireJS
-  Available at: http://requirejs.org/
-  Developed by: The Dojo Foundation (http://dojofoundation.org/)
-  Inclusive of: require.js, text.js
-  Version used: 2.0.6
-  Used under the following license: The MIT License (http://opensource.org/licenses/MIT)
-  Copyright (c) The Dojo Foundation (2010-2012)
-
-This project includes the software: RequireJS (r.js maven plugin)
-  Available at: http://github.com/jrburke/requirejs
-  Developed by: The Dojo Foundation (http://dojofoundation.org/)
-  Inclusive of: r.js
-  Version used: 2.1.6
-  Used under the following license: The MIT License (http://opensource.org/licenses/MIT)
-  Copyright (c) The Dojo Foundation (2009-2013)
-  Includes code fragments for source-map and other functionality:
-    Copyright (c) The Mozilla Foundation and contributors (2011)
-    Used under the BSD 2-Clause license.
-  Includes code fragments for parse-js and other functionality:
-    Copyright (c) Mihai Bazon (2010, 2012)
-    Used under the BSD 2-Clause license.
-  Includes code fragments for uglifyjs/consolidator:
-    Copyright (c) Robert Gust-Bardon (2012)
-    Used under the BSD 2-Clause license.
-  Includes code fragments for the esprima parser:
-    Copyright (c):
-      Ariya Hidayat (2011, 2012)
-      Mathias Bynens (2012)
-      Joost-Wim Boekesteijn (2012)
-      Kris Kowal (2012)
-      Yusuke Suzuki (2012)
-      Arpad Borsos (2012)
-    Used under the BSD 2-Clause license.
-
-This project includes the software: Swagger UI
-  Available at: https://github.com/swagger-api/swagger-ui
-  Inclusive of: swagger*.{js,css,html}
-  Version used: 2.1.4
-  Used under the following license: Apache License, version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
-  Copyright (c) SmartBear Software (2011-2015)
-
-This project includes the software: underscore.js
-  Available at: http://underscorejs.org
-  Developed by: DocumentCloud Inc. (http://www.documentcloud.org/)
-  Inclusive of: underscore*.{js,map}
-  Version used: 1.4.4
-  Used under the following license: The MIT License (http://opensource.org/licenses/MIT)
-  Copyright (c) Jeremy Ashkenas, DocumentCloud Inc. (2009-2013)
-
-This project includes the software: ZeroClipboard
-  Available at: http://zeroclipboard.org/
-  Developed by: ZeroClipboard contributors (https://github.com/zeroclipboard)
-  Inclusive of: ZeroClipboard.*
-  Version used: 1.3.1
-  Used under the following license: The MIT License (http://opensource.org/licenses/MIT)
-  Copyright (c) Jon Rohan, James M. Greene (2014)
-
-
----------------------------------------------------
-
-(3) Licenses for bundled software
-
-Contents:
-
-  The BSD 2-Clause License
-  The BSD 3-Clause License ("New BSD")
-  The MIT License ("MIT")
-
-
-The BSD 2-Clause License
-
-  Redistribution and use in source and binary forms, with or without
-  modification, are permitted provided that the following conditions are met:
-  
-  1. Redistributions of source code must retain the above copyright notice, this
-  list of conditions and the following disclaimer.
-  
-  2. Redistributions in binary form must reproduce the above copyright notice,
-  this list of conditions and the following disclaimer in the documentation
-  and/or other materials provided with the distribution.
-  
-  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
-  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-  
-
-The BSD 3-Clause License ("New BSD")
-
-  Redistribution and use in source and binary forms, with or without modification,
-  are permitted provided that the following conditions are met:
-  
-  1. Redistributions of source code must retain the above copyright notice, 
-  this list of conditions and the following disclaimer.
-  
-  2. Redistributions in binary form must reproduce the above copyright notice, 
-  this list of conditions and the following disclaimer in the documentation 
-  and/or other materials provided with the distribution.
-  
-  3. Neither the name of the copyright holder nor the names of its contributors 
-  may be used to endorse or promote products derived from this software without 
-  specific prior written permission.
-  
-  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
-  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
-  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
-  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
-  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
-  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
-  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
-  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
-  POSSIBILITY OF SUCH DAMAGE.
-  
-
-The MIT License ("MIT")
-
-  Permission is hereby granted, free of charge, to any person obtaining a copy
-  of this software and associated documentation files (the "Software"), to deal
-  in the Software without restriction, including without limitation the rights
-  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-  copies of the Software, and to permit persons to whom the Software is
-  furnished to do so, subject to the following conditions:
-  
-  The above copyright notice and this permission notice shall be included in
-  all copies or substantial portions of the Software.
-  
-  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-  THE SOFTWARE.
-  
-

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/NOTICE
----------------------------------------------------------------------
diff --git a/brooklyn-ui/NOTICE b/brooklyn-ui/NOTICE
deleted file mode 100644
index f790f13..0000000
--- a/brooklyn-ui/NOTICE
+++ /dev/null
@@ -1,5 +0,0 @@
-Apache Brooklyn
-Copyright 2014-2015 The Apache Software Foundation
-
-This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/README.md
----------------------------------------------------------------------
diff --git a/brooklyn-ui/README.md b/brooklyn-ui/README.md
deleted file mode 100644
index 057c206..0000000
--- a/brooklyn-ui/README.md
+++ /dev/null
@@ -1,10 +0,0 @@
-
-# [![**Brooklyn**](https://brooklyn.apache.org/style/img/apache-brooklyn-logo-244px-wide.png)](http://brooklyn.apache.org/)
-
-### Apache Brooklyn UI Sub-Project
-
-This repo contains the JS GUI for Apache Brooklyn.
-
-It is pure Javascript, but for legacy reasons it expects the REST endpoint at the same endpoint,
-so currently the easiest way to run it is using the BrooklynJavascriptGuiLauncher java launcher 
-in `brooklyn-server`.

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/pom.xml
----------------------------------------------------------------------
diff --git a/brooklyn-ui/pom.xml b/brooklyn-ui/pom.xml
deleted file mode 100644
index 3c5acf0..0000000
--- a/brooklyn-ui/pom.xml
+++ /dev/null
@@ -1,440 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-    Licensed to the Apache Software Foundation (ASF) under one
-    or more contributor license agreements.  See the NOTICE file
-    distributed with this work for additional information
-    regarding copyright ownership.  The ASF licenses this file
-    to you under the Apache License, Version 2.0 (the
-    "License"); you may not use this file except in compliance
-    with the License.  You may obtain a copy of the License at
-
-     http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing,
-    software distributed under the License is distributed on an
-    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    KIND, either express or implied.  See the License for the
-    specific language governing permissions and limitations
-    under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-
-    <parent>
-        <groupId>org.apache</groupId>
-        <artifactId>apache</artifactId>
-        <version>17</version>
-        <relativePath></relativePath> <!-- prevent loading of ../pom.xml as the "parent" -->
-    </parent>
-
-    <groupId>org.apache.brooklyn</groupId>
-    <artifactId>brooklyn-jsgui</artifactId>
-    <version>0.9.0-SNAPSHOT</version>  <!-- BROOKLYN_VERSION -->
-    <packaging>war</packaging>
-
-    <name>Brooklyn REST JavaScript Web GUI</name>
-
-    <description>
-        JavaScript+HTML GUI for interacting with Brooklyn, using the REST API
-    </description>
-
-    <properties>
-        <project.build.webapp>
-            ${project.build.directory}/${project.build.finalName}
-        </project.build.webapp>
-        <nodejs.path>${project.basedir}/target/nodejs/node</nodejs.path>
-        <jasmine-maven-plugin.version>1.3.1.5</jasmine-maven-plugin.version>
-        <maven-dependency-plugin.version>2.8</maven-dependency-plugin.version>
-        <nodejs-maven-plugin.version>1.0.3</nodejs-maven-plugin.version>
-        <maven-war-plugin.version>2.4</maven-war-plugin.version>
-        <nodejs-maven-binaries.version>0.10.25</nodejs-maven-binaries.version>
-        <requirejs-maven-plugin.version>2.0.0</requirejs-maven-plugin.version>
-        <maven-replacer-plugin.version>1.5.2</maven-replacer-plugin.version>
-        <maven-resources-plugin.version>2.7</maven-resources-plugin.version>
-    </properties>
-
-    <build>
-        <resources>
-            <resource>
-                <directory>${project.basedir}/src/test/resources/fixtures</directory>
-                <targetPath>${project.build.directory}/jasmine/fixtures</targetPath>
-            </resource>
-        </resources>
-        <!-- Insert special LICENSE/NOTICE into the <test-jar>/META-INF folder -->
-        <testResources>
-            <testResource>
-                <directory>${project.basedir}/src/test/resources</directory>
-            </testResource>
-            <testResource>
-                <targetPath>META-INF</targetPath>
-                <directory>${basedir}/src/test/license/files</directory>
-            </testResource>
-        </testResources>
-        <plugins>
-            <!--
-                 run js tests with: $ mvn clean process-test-resources jasmine:test
-                 run tests in the browser with: $ mvn jasmine:bdd
-            -->
-            <plugin>
-                <artifactId>maven-resources-plugin</artifactId>
-                <version>${maven-resources-plugin.version}</version>
-                <executions>
-                    <execution>
-                        <id>copy-fixtures</id>
-                        <phase>process-test-resources</phase>
-                        <goals>
-                            <goal>copy-resources</goal>
-                        </goals>
-                        <configuration>
-                            <outputDirectory>${project.build.directory}/jasmine/fixtures</outputDirectory>
-                            <resources>
-                                <resource>
-                                    <!-- copy rest-api fixtures from brooklyn-server submodule repo -->
-                                    <directory>${project.basedir}/../brooklyn-server/rest/rest-api/src/test/resources/fixtures</directory>
-                                </resource>
-                            </resources>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-            <plugin>
-                <groupId>com.github.searls</groupId>
-                <artifactId>jasmine-maven-plugin</artifactId>
-                <version>${jasmine-maven-plugin.version}</version>
-                <executions>
-                    <execution>
-                        <goals>
-                            <goal>test</goal>
-                        </goals>
-                    </execution>
-                </executions>
-                <configuration>
-                    <!--Uses the require.js test spec-->
-                    <specRunnerTemplate>REQUIRE_JS</specRunnerTemplate>
-                    <preloadSources>
-                        <source>js/libs/require.js</source>
-                    </preloadSources>
-
-                    <!--Sources-->
-                    <jsSrcDir>${project.basedir}/src/main/webapp/assets</jsSrcDir>
-                    <jsTestSrcDir>${project.basedir}/src/test/javascript/specs</jsTestSrcDir>
-                    <customRunnerConfiguration>
-                        ${project.basedir}/src/test/javascript/config.txt
-                    </customRunnerConfiguration>
-                    <!-- Makes output terser -->
-                    <format>progress</format>
-                    <additionalContexts>
-                        <!-- If context roots start with a / the resource will be available on the server at //root. -->
-                        <!-- It is an error for context roots to end with a /. -->
-                        <context>
-                            <contextRoot>fixtures</contextRoot>
-                            <directory>${project.build.directory}/jasmine/fixtures</directory>
-                        </context>
-                    </additionalContexts>
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-war-plugin</artifactId>
-                <version>${maven-war-plugin.version}</version>
-                <configuration>
-                    <useCache>true</useCache> <!-- to prevent replaced files being overwritten -->
-                    <!-- Insert special LICENSE/NOTICE into the <war>/META-INF folder -->
-                    <webResources>
-                        <webResource>
-                            <targetPath>META-INF</targetPath>
-                            <directory>${basedir}/src/main/license/files</directory>
-                        </webResource>
-                    </webResources>
-                    <archive>
-                        <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
-                    </archive>
-                </configuration>
-            </plugin>
-            <!-- Disable the automatic LICENSE/NOTICE placement from the upstream pom, because we need to include
-                 bundled dependencies. See "webResources" section above for where we include the new LICENSE/NOTICE -->
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-remote-resources-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <goals>
-                            <goal>process</goal>
-                        </goals>
-                        <configuration>
-                            <skip>true</skip>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-bundle-plugin</artifactId>
-                <version>2.5.4</version>
-                <executions>
-                    <execution>
-                        <id>bundle-manifest</id>
-                        <phase>process-classes</phase>
-                        <goals>
-                            <goal>manifest</goal>
-                        </goals>
-                    </execution>
-                </executions>
-                <configuration>
-                    <supportedProjectTypes>
-                        <supportedProjectType>war</supportedProjectType>
-                    </supportedProjectTypes>
-                    <instructions>
-                        <Web-ContextPath>/</Web-ContextPath>
-                    </instructions>
-                </configuration>
-            </plugin>
-        </plugins>
-
-        <pluginManagement>
-            <plugins>
-                <plugin>
-                    <groupId>org.apache.rat</groupId>
-                    <artifactId>apache-rat-plugin</artifactId>
-                    <configuration>
-                        <excludes combine.children="append">
-                            <!--
-                                JavaScript code that is not copyright of Apache Foundation. It is included in NOTICE.
-                            -->
-                            <exclude>**/src/main/webapp/assets/js/libs/*</exclude>
-                            <exclude>**/src/build/requirejs-maven-plugin/r.js</exclude>
-
-                            <!--
-                                Copy of swagger-ui from https://github.com/swagger-api/swagger-ui tag::v2.1.3
-                            -->
-                            <exclude>**/src/main/webapp/assets/swagger-ui/**</exclude>
-
-                            <!--
-                                Trivial Json controlling the build,  "without any degree of creativity".
-                                Json does not support comments, therefore far easier to just omit the license header!
-                            -->
-                            <exclude>**//src/build/optimize-css.json</exclude>
-                            <exclude>**//src/build/optimize-js.json</exclude>
-                        </excludes>
-                    </configuration>
-                </plugin>
-                <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
-                <plugin>
-                	<groupId>org.eclipse.m2e</groupId>
-                	<artifactId>lifecycle-mapping</artifactId>
-                	<version>1.0.0</version>
-                	<configuration>
-                		<lifecycleMappingMetadata>
-                			<pluginExecutions>
-                				<pluginExecution>
-                					<pluginExecutionFilter>
-                						<groupId>
-                							com.github.skwakman.nodejs-maven-plugin
-                						</groupId>
-                						<artifactId>
-                							nodejs-maven-plugin
-                						</artifactId>
-                						<versionRange>
-                							[1.0.3,)
-                						</versionRange>
-                						<goals>
-                							<goal>extract</goal>
-                						</goals>
-                					</pluginExecutionFilter>
-                					<action>
-                						<ignore></ignore>
-                					</action>
-                				</pluginExecution>
-                			</pluginExecutions>
-                		</lifecycleMappingMetadata>
-                	</configuration>
-                </plugin>
-            </plugins>
-        </pluginManagement>
-    </build>
-
-    <profiles>
-        <profile>
-            <id>nodejs-path-override</id>
-            <activation>
-                <os><family>linux</family></os>
-            </activation>
-            <properties>
-                <nodejs.path>${project.basedir}/src/build/nodejs</nodejs.path>
-            </properties>
-            <dependencies>
-                <dependency>
-                    <groupId>com.github.skwakman.nodejs-maven-binaries</groupId>
-                    <artifactId>nodejs-maven-binaries</artifactId>
-                    <version>${nodejs-maven-binaries.version}</version>
-                    <classifier>linux-x64</classifier>
-                    <type>zip</type>
-                </dependency>
-            </dependencies>
-            <build>
-                <plugins>
-                    <plugin>
-                        <groupId>org.apache.maven.plugins</groupId>
-                        <artifactId>maven-dependency-plugin</artifactId>
-                        <version>${maven-dependency-plugin.version}</version>
-                        <executions>
-                          <execution>
-                            <id>unpack-nodejs64</id>
-                            <phase>prepare-package</phase>
-                            <goals>
-                              <goal>unpack-dependencies</goal>
-                            </goals>
-                            <configuration>
-                              <includeGroupIds>com.github.skwakman.nodejs-maven-binaries</includeGroupIds>
-                              <includeArtifactIds>nodejs-maven-binaries</includeArtifactIds>
-                              <outputDirectory>
-                                 ${project.basedir}/target/nodejs64/
-                              </outputDirectory>
-                            </configuration>
-                          </execution>
-                        </executions>
-                    </plugin>
-                </plugins>
-            </build>
-        </profile>
-
-        <profile>
-            <id>Optimize resources</id>
-            <activation>
-                <property>
-                    <name>!skipOptimization</name>
-                </property>
-            </activation>
-            <build>
-                <plugins>
-                    <!-- Installs node.js in target/. Means we get the benefits of node's speed
-                         (compared to Rhino) without having to install it manually. -->
-                    <plugin>
-                        <groupId>com.github.skwakman.nodejs-maven-plugin</groupId>
-                        <artifactId>nodejs-maven-plugin</artifactId>
-                        <version>${nodejs-maven-plugin.version}</version>
-                        <executions>
-                            <execution>
-                                <goals>
-                                    <goal>extract</goal>
-                                </goals>
-                            </execution>
-                        </executions>
-                        <configuration>
-                            <!-- target directory for node binaries -->
-                            <targetDirectory>${project.basedir}/target/nodejs/</targetDirectory>
-                        </configuration>
-                    </plugin>
-
-                    <!-- Including the exploded goal means sources are in place ready for the replacer plugin. -->
-                    <plugin>
-                        <groupId>org.apache.maven.plugins</groupId>
-                        <artifactId>maven-war-plugin</artifactId>
-                        <version>${maven-war-plugin.version}</version>
-                        <executions>
-                            <execution>
-                                <id>prepare-war</id>
-                                <phase>prepare-package</phase>
-                                <goals>
-                                    <goal>exploded</goal>
-                                </goals>
-                            </execution>
-                        </executions>
-                    </plugin>
-
-                    <!-- Runs the require.js optimizer with node to produce a single artifact. -->
-                    <plugin>
-                        <groupId>com.github.mcheely</groupId>
-                        <artifactId>requirejs-maven-plugin</artifactId>
-                        <version>${requirejs-maven-plugin.version}</version>
-                        <executions>
-                            <execution>
-                                <id>optimize-js</id>
-                                <phase>prepare-package</phase>
-                                <goals>
-                                    <goal>optimize</goal>
-                                </goals>
-                                <configuration>
-                                    <configFile>${project.basedir}/src/build/optimize-js.json</configFile>
-                                </configuration>
-                            </execution>
-                            <execution>
-                                <id>optimize-css</id>
-                                <phase>prepare-package</phase>
-                                <goals>
-                                    <goal>optimize</goal>
-                                </goals>
-                                <configuration>
-                                    <configFile>${project.basedir}/src/build/optimize-css.json</configFile>
-                                </configuration>
-                            </execution>
-                        </executions>
-                        <configuration>
-                            <nodeExecutable>${nodejs.path}</nodeExecutable>
-                            <optimizerFile>${project.basedir}/src/build/requirejs-maven-plugin/r.js</optimizerFile>
-                            <!-- Replaces Maven tokens in the build file with their values -->
-                            <filterConfig>true</filterConfig>
-                        </configuration>
-                    </plugin>
-
-                    <!-- Modify index.html to point to the optimized resources generated above. -->
-                    <plugin>
-                        <groupId>com.google.code.maven-replacer-plugin</groupId>
-                        <artifactId>replacer</artifactId>
-                        <version>${maven-replacer-plugin.version}</version>
-                        <executions>
-                            <execution>
-                                <id>modify-for-optimized</id>
-                                <phase>prepare-package</phase>
-                                <goals>
-                                    <goal>replace</goal>
-                                </goals>
-                            </execution>
-                        </executions>
-                        <configuration>
-                            <file>${project.build.webapp}/index.html</file>
-                            <replacements>
-                                <replacement>
-                                    <token>assets/js/config.js</token>
-                                    <value>assets/js/gui.all.min.js</value>
-                                </replacement>
-                                <replacement>
-                                    <token>assets/css/styles.css</token>
-                                    <value>assets/css/styles.min.css</value>
-                                </replacement>
-                                <replacement>
-                                    <token>GIT_SHA_1</token>
-                                    <value>${buildNumber}</value>
-                                </replacement>
-                            </replacements>
-                        </configuration>
-                    </plugin>
-
-                    <!-- Compress the minified files. Jetty will serve the gzipped content instead. -->
-                    <plugin>
-                        <artifactId>maven-antrun-plugin</artifactId>
-                        <executions>
-                            <execution>
-                                <id>Compress resources</id>
-                                <phase>prepare-package</phase>
-                                <goals>
-                                    <goal>run</goal>
-                                </goals>
-                                <configuration>
-                                    <target>
-                                        <gzip src="${project.build.webapp}/assets/css/styles.min.css" destfile="${project.build.webapp}/assets/css/styles.min.css.gz" />
-                                        <gzip src="${project.build.webapp}/assets/css/brooklyn.css" destfile="${project.build.webapp}/assets/css/brooklyn.css.gz" />
-                                        <gzip src="${project.build.webapp}/assets/js/gui.all.min.js" destfile="${project.build.webapp}/assets/js/gui.all.min.js.gz" />
-                                        <gzip src="${project.build.webapp}/assets/js/libs/require.js" destfile="${project.build.webapp}/assets/js/libs/require.js.gz" />
-                                    </target>
-                                </configuration>
-                            </execution>
-                        </executions>
-                    </plugin>
-                </plugins>
-            </build>
-        </profile>
-    </profiles>
-
-</project>
-

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/build/.gitattributes
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/build/.gitattributes b/brooklyn-ui/src/build/.gitattributes
deleted file mode 100644
index 83a693d..0000000
--- a/brooklyn-ui/src/build/.gitattributes
+++ /dev/null
@@ -1,2 +0,0 @@
-#Don't auto-convert line endings for shell scripts on Windows (breaks the scripts)
-nodejs text eol=lf

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/build/nodejs
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/build/nodejs b/brooklyn-ui/src/build/nodejs
deleted file mode 100755
index 2b00792..0000000
--- a/brooklyn-ui/src/build/nodejs
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/bin/sh
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#  http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-# nodejs-maven-plugin incorrectly detects the architecture on 
-# Linux x64 running 32 bit Java leading to the installation of
-# invalid nodejs binary - 32 bit on 64 bit OS. This is a
-# wrapper which makes a check for the architecture again and
-# forces the usage of the 64 bit binary. The 64 bit nodejs
-# is installed in advance in case we need it.
-#
-# target/nodejs64/node - the forcibly installed 64 bit binary
-# target/nodejs/node - the binary installed by nodejs-maven-plugin
-#                      could be 32 bit or 64 bit.
-#
-
-MACHINE_TYPE=`uname -m`
-if [ $MACHINE_TYPE = 'x86_64' ]; then
-  NODE_PATH=$( dirname "$0" )/../../target/nodejs64/node
-  chmod +x $NODE_PATH
-  echo Forcing 64 bit nodejs at $NODE_PATH
-else
-  NODE_PATH=$( dirname "$0" )/../../target/nodejs/node
-fi
-
-$NODE_PATH "$@"

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/build/optimize-css.json
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/build/optimize-css.json b/brooklyn-ui/src/build/optimize-css.json
deleted file mode 100644
index d27d7ac..0000000
--- a/brooklyn-ui/src/build/optimize-css.json
+++ /dev/null
@@ -1,12 +0,0 @@
-({
-    cssIn: "${project.build.webapp}/assets/css/styles.css",
-    out: "${project.build.webapp}/assets/css/styles.min.css",
-
-    // CSS optimization options are:
-    //  - "standard": @import inlining, comment removal and line returns.
-    //  - "standard.keepLines": like "standard" but keeps line returns.
-    //  - "standard.keepComments": keeps the file comments, but removes line returns.
-    //  - "standard.keepComments.keepLines": keeps the file comments and line returns.
-    //  - "none": skip CSS optimizations.
-    optimizeCss: "standard"
-})

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/build/optimize-js.json
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/build/optimize-js.json b/brooklyn-ui/src/build/optimize-js.json
deleted file mode 100644
index 60855d9..0000000
--- a/brooklyn-ui/src/build/optimize-js.json
+++ /dev/null
@@ -1,18 +0,0 @@
-({
-    // The entry point to the application. Brooklyn's is in config.js.
-    name: "config",
-    baseUrl: "${project.build.webapp}/assets/js",
-    mainConfigFile: "${project.build.webapp}/assets/js/config.js",
-    paths: {
-        // Include paths to external resources (e.g. on a CDN) here.
-
-        // Optimiser looks for js/requireLib.js by default.
-        "requireLib": "libs/require"
-    },
-
-    // Place the optimised file in target/<war>/assets.
-    out: "${project.build.webapp}/assets/js/gui.all.min.js",
-
-    // Set to "none" to skip minification
-    optimize: "uglify"
-})


[29/51] [abbrv] [partial] brooklyn-ui git commit: move subdir from incubator up a level as it is promoted to its own repo (first non-incubator commit!)

Posted by he...@apache.org.
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/swagger-ui/fonts/droid-sans-v6-latin-700.svg
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/swagger-ui/fonts/droid-sans-v6-latin-700.svg b/brooklyn-ui/src/main/webapp/assets/swagger-ui/fonts/droid-sans-v6-latin-700.svg
deleted file mode 100644
index a54bbbb..0000000
--- a/brooklyn-ui/src/main/webapp/assets/swagger-ui/fonts/droid-sans-v6-latin-700.svg
+++ /dev/null
@@ -1,411 +0,0 @@
-<?xml version="1.0" standalone="no"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
-<svg xmlns="http://www.w3.org/2000/svg">
-<defs >
-<font id="DroidSans" horiz-adv-x="1123" ><font-face
-    font-family="Droid Sans"
-    units-per-em="2048"
-    panose-1="2 11 8 6 3 8 4 2 2 4"
-    ascent="1907"
-    descent="-492"
-    alphabetic="0" />
-<glyph unicode=" " glyph-name="space" horiz-adv-x="532" />
-<glyph unicode="!" glyph-name="exclam" horiz-adv-x="586" d="M416 485H172L121 1462H467L416 485ZM117 143Q117 190 130 222T168 275T224 304T293 313Q328 313 359 304T415 275T453 223T467 143Q467 98 453 66T415 13T360 -17T293 -27Q256 -27 224 -18T168 13T131
-66T117 143Z" />
-<glyph unicode="&quot;" glyph-name="quotedbl" horiz-adv-x="967" d="M412 1462L371 934H174L133 1462H412ZM834 1462L793 934H596L555 1462H834Z" />
-<glyph unicode="#" glyph-name="numbersign" horiz-adv-x="1323" d="M999 844L952 612H1210V406H913L836 0H616L694 406H500L424 0H209L283 406H45V612H322L369 844H117V1053H406L483 1460H702L625 1053H823L901 1460H1116L1038 1053H1278V844H999ZM539 612H735L782
-844H586L539 612Z" />
-<glyph unicode="$" glyph-name="dollar" horiz-adv-x="1128" d="M1061 457Q1061 382 1035 318T956 206T825 127T645 86V-119H508V82Q442 84 386 90T281 107T188 133T100 168V432Q142 411 191 392T294 358T401 331T508 317V635Q500 638 491 642Q483 645 475 648T461
-653Q370 688 302 726T189 811T121 915T98 1044Q98 1119 126 1180T208 1287T337 1361T508 1399V1556H645V1405Q732 1400 823 1380T1014 1317L913 1083Q848 1109 778 1129T645 1155V862L684 848Q779 813 850 776T968 693T1038 590T1061 457ZM760 451Q760 475 754
-493T733 526T698 553T645 580V328Q704 337 732 367T760 451ZM399 1051Q399 1004 425 973T508 920V1153Q454 1147 427 1123T399 1051Z" />
-<glyph unicode="%" glyph-name="percent" horiz-adv-x="1804" d="M315 1024Q315 897 337 835T410 772Q459 772 482 834T506 1024Q506 1274 410 1274Q360 1274 338 1213T315 1024ZM758 1026Q758 918 738 832T674 687T565 597T408 565Q323 565 259 596T151 687T85
-832T63 1026Q63 1134 83 1219T145 1362T253 1452T408 1483Q494 1483 559 1452T669 1363T735 1219T758 1026ZM1425 1462L614 0H375L1186 1462H1425ZM1298 440Q1298 313 1320 251T1393 188Q1442 188 1465 250T1489 440Q1489 690 1393 690Q1343 690 1321 629T1298
-440ZM1741 442Q1741 334 1721 249T1657 104T1548 14T1391 -18Q1306 -18 1242 13T1135 104T1069 248T1047 442Q1047 550 1067 635T1129 778T1236 868T1391 899Q1477 899 1542 868T1652 779T1718 635T1741 442Z" />
-<glyph unicode="&amp;" glyph-name="ampersand" horiz-adv-x="1479" d="M1475 0H1098L1001 100Q921 45 825 13T612 -20Q492 -20 395 10T228 94T120 225T82 395Q82 472 100 532T153 642T235 731T344 807Q306 853 280 895T237 979T214 1062T207 1149Q207 1227 237
-1288T322 1393T452 1460T618 1483Q704 1483 776 1462T901 1401T984 1301T1014 1165Q1014 1096 992 1039T931 932T842 842T731 766L991 498Q1026 564 1052 637T1098 784H1415Q1400 727 1380 664T1332 538T1270 411T1192 291L1475 0ZM403 424Q403 380 419 345T463
-286T530 249T614 236Q674 236 725 251T819 295L510 625Q459 583 431 535T403 424ZM731 1124Q731 1155 721 1176T695 1212T658 1232T616 1239Q594 1239 572 1233T531 1214T501 1178T489 1122Q489 1070 512 1024T575 932Q652 976 691 1020T731 1124Z" />
-<glyph unicode="&apos;" glyph-name="quotesingle" horiz-adv-x="545" d="M412 1462L371 934H174L133 1462H412Z" />
-<glyph unicode="(" glyph-name="parenleft" horiz-adv-x="694" d="M82 561Q82 686 100 807T155 1043T248 1263T383 1462H633Q492 1269 420 1038T348 563Q348 444 366 326T420 95T509 -124T631 -324H383Q305 -234 249 -131T155 84T100 317T82 561Z" />
-<glyph unicode=")" glyph-name="parenright" horiz-adv-x="694" d="M612 561Q612 437 594 317T539 85T446 -131T311 -324H63Q132 -230 185 -124T274 95T328 326T346 563Q346 807 274 1038T61 1462H311Q389 1369 445 1264T539 1044T594 808T612 561Z" />
-<glyph unicode="*" glyph-name="asterisk" horiz-adv-x="1116" d="M688 1556L647 1188L1020 1292L1053 1040L713 1016L936 719L709 598L553 911L416 600L180 719L401 1016L63 1042L102 1292L467 1188L426 1556H688Z" />
-<glyph unicode="+" glyph-name="plus" horiz-adv-x="1128" d="M455 612H88V831H455V1200H674V831H1040V612H674V248H455V612Z" />
-<glyph unicode="," glyph-name="comma" horiz-adv-x="594" d="M459 215Q445 161 426 100T383 -23T334 -146T283 -264H63Q78 -203 92 -137T120 -6T145 122T164 238H444L459 215Z" />
-<glyph unicode="-" glyph-name="hyphen" horiz-adv-x="659" d="M61 424V674H598V424H61Z" />
-<glyph unicode="." glyph-name="period" horiz-adv-x="584" d="M117 143Q117 190 130 222T168 275T224 304T293 313Q328 313 359 304T415 275T453 223T467 143Q467 98 453 66T415 13T360 -17T293 -27Q256 -27 224 -18T168 13T131 66T117 143Z" />
-<glyph unicode="/" glyph-name="slash" horiz-adv-x="846" d="M836 1462L291 0H14L559 1462H836Z" />
-<glyph unicode="0" glyph-name="zero" horiz-adv-x="1128" d="M1065 731Q1065 554 1038 415T950 179T794 31T563 -20Q436 -20 342 31T186 179T94 415T63 731Q63 908 90 1048T178 1285T333 1433T563 1485Q689 1485 783 1434T940 1286T1034 1049T1065 731ZM371 731Q371
-481 414 355T563 229Q667 229 712 354T758 731Q758 982 713 1108T563 1235Q510 1235 474 1203T414 1108T381 951T371 731Z" />
-<glyph unicode="1" glyph-name="one" horiz-adv-x="1128" d="M817 0H508V846Q508 872 508 908T510 984T513 1064T516 1137Q511 1131 499 1119T472 1093T441 1063T410 1036L242 901L92 1087L563 1462H817V0Z" />
-<glyph unicode="2" glyph-name="two" horiz-adv-x="1128" d="M1063 0H82V215L426 586Q491 656 544 715T635 830T694 944T715 1069Q715 1143 671 1184T551 1225Q472 1225 399 1186T246 1075L78 1274Q123 1315 172 1352T280 1419T410 1465T569 1483Q674 1483 757
-1454T900 1372T990 1242T1022 1071Q1022 985 992 907T910 753T790 603T643 451L467 274V260H1063V0Z" />
-<glyph unicode="3" glyph-name="three" horiz-adv-x="1128" d="M1006 1135Q1006 1059 982 999T915 893T815 817T690 770V764Q867 742 958 657T1049 426Q1049 330 1015 249T909 107T729 14T473 -20Q355 -20 251 -1T57 59V322Q102 298 152 280T252 250T350 231T442
-225Q528 225 585 241T676 286T724 355T739 444Q739 489 721 525T661 587T552 627T387 641H283V858H385Q477 858 538 874T635 919T687 986T702 1067Q702 1145 654 1189T500 1233Q452 1233 411 1224T334 1200T269 1168T215 1133L59 1339Q101 1370 150 1396T258 1441T383
-1472T526 1483Q634 1483 722 1460T874 1392T971 1283T1006 1135Z" />
-<glyph unicode="4" glyph-name="four" horiz-adv-x="1128" d="M1085 303H909V0H608V303H4V518L625 1462H909V543H1085V303ZM608 543V791Q608 804 608 828T610 884T612 948T615 1011T618 1063T621 1096H612Q594 1054 572 1007T520 913L276 543H608Z" />
-<glyph unicode="5" glyph-name="five" horiz-adv-x="1128" d="M598 934Q692 934 773 905T914 820T1008 681T1042 489Q1042 370 1005 276T896 116T718 15T473 -20Q418 -20 364 -15T261 -1T167 24T86 59V326Q121 306 167 289T262 259T362 239T457 231Q591 231 661
-286T731 463Q731 571 663 627T451 684Q425 684 396 681T338 673T283 663T238 651L115 717L170 1462H942V1200H438L414 913Q446 920 488 927T598 934Z" />
-<glyph unicode="6" glyph-name="six" horiz-adv-x="1128" d="M76 621Q76 726 87 830T128 1029T208 1207T336 1349T522 1444T776 1479Q797 1479 822 1478T872 1476T922 1471T965 1464V1217Q927 1226 885 1231T799 1237Q664 1237 577 1204T439 1110T367 966T340
-780H352Q372 816 400 847T467 901T552 937T659 950Q754 950 830 919T958 829T1039 684T1067 487Q1067 368 1034 274T938 115T788 15T590 -20Q482 -20 388 18T225 136T116 335T76 621ZM584 227Q625 227 658 242T716 289T754 369T768 483Q768 590 724 651T588 713Q542
-713 504 695T439 648T398 583T383 510Q383 459 395 409T433 318T496 252T584 227Z" />
-<glyph unicode="7" glyph-name="seven" horiz-adv-x="1128" d="M207 0L727 1200H55V1460H1063V1266L530 0H207Z" />
-<glyph unicode="8" glyph-name="eight" horiz-adv-x="1128" d="M565 1481Q656 1481 737 1459T879 1393T976 1283T1012 1128Q1012 1062 992 1009T937 912T854 834T750 772Q808 741 863 703T962 618T1031 511T1057 379Q1057 288 1021 214T920 88T765 8T565 -20Q447
--20 355 7T200 84T105 207T72 371Q72 446 94 506T154 614T243 699T352 764Q303 795 260 831T186 912T136 1011T117 1130Q117 1217 153 1282T252 1392T395 1459T565 1481ZM358 389Q358 349 371 316T409 258T473 221T561 207Q666 207 718 256T770 387Q770 429 753
-462T708 524T645 577T575 623L553 637Q509 615 473 590T412 534T372 467T358 389ZM563 1255Q530 1255 502 1245T453 1216T420 1169T408 1106Q408 1064 420 1034T454 980T504 938T565 901Q596 917 624 936T673 979T708 1035T721 1106Q721 1141 709 1169T676 1216T626
-1245T563 1255Z" />
-<glyph unicode="9" glyph-name="nine" horiz-adv-x="1128" d="M1055 838Q1055 733 1044 629T1003 429T923 252T795 109T609 15T354 -20Q333 -20 308 -19T258 -17T208 -13T166 -6V242Q203 232 245 227T332 221Q467 221 554 254T692 348T764 493T791 678H778Q758
-642 730 611T664 557T578 521T471 508Q376 508 300 539T172 629T91 774T63 971Q63 1090 96 1184T192 1343T342 1444T541 1479Q649 1479 743 1441T906 1323T1015 1123T1055 838ZM547 1231Q506 1231 472 1216T414 1170T376 1090T362 975Q362 869 407 807T543 745Q589
-745 627 763T692 810T733 875T748 948Q748 999 736 1049T698 1140T635 1206T547 1231Z" />
-<glyph unicode=":" glyph-name="colon" horiz-adv-x="584" d="M117 143Q117 190 130 222T168 275T224 304T293 313Q328 313 359 304T415 275T453 223T467 143Q467 98 453 66T415 13T360 -17T293 -27Q256 -27 224 -18T168 13T131 66T117 143ZM117 969Q117 1016
-130 1048T168 1101T224 1130T293 1139Q328 1139 359 1130T415 1101T453 1049T467 969Q467 924 453 892T415 839T360 809T293 799Q256 799 224 808T168 838T131 891T117 969Z" />
-<glyph unicode=";" glyph-name="semicolon" horiz-adv-x="594" d="M444 238L459 215Q445 161 426 100T383 -23T334 -146T283 -264H63Q78 -203 92 -137T120 -6T145 122T164 238H444ZM117 969Q117 1016 130 1048T168 1101T224 1130T293 1139Q328 1139 359 1130T415
-1101T453 1049T467 969Q467 924 453 892T415 839T360 809T293 799Q256 799 224 808T168 838T131 891T117 969Z" />
-<glyph unicode="&lt;" glyph-name="less" horiz-adv-x="1128" d="M1040 203L88 641V784L1040 1280V1040L397 723L1040 442V203Z" />
-<glyph unicode="=" glyph-name="equal" horiz-adv-x="1128" d="M88 807V1024H1040V807H88ZM88 418V637H1040V418H88Z" />
-<glyph unicode="&gt;" glyph-name="greater" horiz-adv-x="1128" d="M88 442L731 723L88 1040V1280L1040 784V641L88 203V442Z" />
-<glyph unicode="?" glyph-name="question" horiz-adv-x="940" d="M264 485V559Q264 610 274 651T306 730T362 803T444 877Q486 910 515 936T562 987T588 1041T596 1106Q596 1163 558 1200T440 1237Q371 1237 292 1208T127 1137L25 1358Q68 1383 118 1405T223 1445T334
-1473T444 1483Q546 1483 628 1459T767 1387T854 1273T885 1120Q885 1057 871 1008T830 916T761 834T664 750Q622 717 596 693T554 646T534 601T528 545V485H264ZM231 143Q231 190 244 222T282 275T338 304T408 313Q443 313 474 304T530 275T568 223T582 143Q582
-98 568 66T530 13T475 -17T408 -27Q371 -27 339 -18T282 13T245 66T231 143Z" />
-<glyph unicode="@" glyph-name="at" horiz-adv-x="1774" d="M1673 752Q1673 657 1651 564T1582 398T1467 279T1303 233Q1265 233 1232 242T1170 269T1122 310T1090 362H1075Q1056 337 1031 314T975 272T907 244T825 233Q742 233 678 261T569 342T502 468T479 631Q479
-734 510 820T599 968T740 1065T926 1100Q971 1100 1019 1095T1111 1082T1195 1064T1262 1044L1241 625Q1239 603 1239 582T1239 555Q1239 513 1245 486T1262 444T1286 422T1315 416Q1350 416 1376 443T1419 516T1445 623T1454 754Q1454 882 1416 982T1311 1151T1150
-1256T948 1292Q795 1292 679 1241T484 1099T365 882T324 608Q324 470 359 364T463 185T633 75T866 37Q922 37 981 44T1098 63T1213 92T1321 129V-63Q1227 -105 1113 -129T868 -154Q687 -154 545 -103T304 46T154 283T102 602Q102 726 129 839T207 1050T331 1227T499
-1363T706 1450T948 1481Q1106 1481 1239 1431T1468 1286T1619 1056T1673 752ZM711 627Q711 515 749 466T850 416Q892 416 922 435T972 490T1002 575T1016 686L1028 907Q1008 912 981 915T926 918Q867 918 826 893T760 827T723 734T711 627Z" />
-<glyph unicode="A" glyph-name="A" horiz-adv-x="1331" d="M1018 0L918 348H414L313 0H0L475 1468H854L1331 0H1018ZM846 608L752 928Q746 946 734 987T709 1077T683 1177T666 1262Q662 1240 656 1210T641 1147T623 1079T606 1015T592 962T582 928L489 608H846Z" />
-<glyph unicode="B" glyph-name="B" horiz-adv-x="1315" d="M184 1462H612Q750 1462 854 1443T1028 1380T1133 1266T1169 1092Q1169 1030 1154 976T1110 881T1040 813T944 776V766Q999 754 1046 732T1129 670T1185 570T1206 424Q1206 324 1171 246T1071 113T912
-29T700 0H184V1462ZM494 883H655Q713 883 752 893T815 925T849 977T860 1051Q860 1135 808 1171T641 1208H494V883ZM494 637V256H676Q737 256 778 270T845 310T882 373T893 455Q893 496 882 529T845 587T775 624T668 637H494Z" />
-<glyph unicode="C" glyph-name="C" horiz-adv-x="1305" d="M805 1225Q716 1225 648 1191T533 1092T462 935T438 727Q438 610 459 519T525 366T639 271T805 238Q894 238 983 258T1178 315V55Q1130 35 1083 21T987 -2T887 -15T776 -20Q607 -20 483 34T278 186T158
-422T119 729Q119 895 164 1033T296 1272T511 1427T805 1483Q914 1483 1023 1456T1233 1380L1133 1128Q1051 1167 968 1196T805 1225Z" />
-<glyph unicode="D" glyph-name="D" horiz-adv-x="1434" d="M1315 745Q1315 560 1265 421T1119 188T885 47T569 0H184V1462H612Q773 1462 902 1416T1124 1280T1265 1055T1315 745ZM1001 737Q1001 859 977 947T906 1094T792 1180T637 1208H494V256H608Q804 256 902
-376T1001 737Z" />
-<glyph unicode="E" glyph-name="E" horiz-adv-x="1147" d="M1026 0H184V1462H1026V1208H494V887H989V633H494V256H1026V0Z" />
-<glyph unicode="F" glyph-name="F" horiz-adv-x="1124" d="M489 0H184V1462H1022V1208H489V831H985V578H489V0Z" />
-<glyph unicode="G" glyph-name="G" horiz-adv-x="1483" d="M739 821H1319V63Q1261 44 1202 29T1080 3T947 -14T799 -20Q635 -20 509 28T296 172T164 408T119 733Q119 905 169 1044T316 1280T556 1430T883 1483Q1000 1483 1112 1458T1317 1393L1214 1145Q1146 1179
-1061 1202T881 1225Q779 1225 698 1190T558 1089T469 932T438 727Q438 619 459 530T527 375T645 274T819 238Q885 238 930 244T1016 258V563H739V821Z" />
-<glyph unicode="H" glyph-name="H" horiz-adv-x="1485" d="M1300 0H991V631H494V0H184V1462H494V889H991V1462H1300V0Z" />
-<glyph unicode="I" glyph-name="I" horiz-adv-x="797" d="M731 0H66V176L244 258V1204L66 1286V1462H731V1286L553 1204V258L731 176V0Z" />
-<glyph unicode="J" glyph-name="J" horiz-adv-x="678" d="M-2 -430Q-67 -430 -116 -424T-199 -408V-150Q-162 -158 -122 -164T-33 -170Q13 -170 52 -160T121 -126T167 -60T184 43V1462H494V53Q494 -73 458 -164T356 -314T199 -402T-2 -430Z" />
-<glyph unicode="K" glyph-name="K" horiz-adv-x="1298" d="M1298 0H946L610 608L494 522V0H184V1462H494V758L616 965L950 1462H1294L827 803L1298 0Z" />
-<glyph unicode="L" glyph-name="L" horiz-adv-x="1096" d="M184 0V1462H494V256H1026V0H184Z" />
-<glyph unicode="M" glyph-name="M" horiz-adv-x="1870" d="M772 0L451 1147H442Q448 1055 452 969Q454 932 455 893T458 816T460 743T461 680V0H184V1462H606L922 344H928L1264 1462H1686V0H1397V692Q1397 718 1397 751T1399 821T1401 896T1404 970Q1408 1054
-1411 1145H1403L1057 0H772Z" />
-<glyph unicode="N" glyph-name="N" horiz-adv-x="1604" d="M1419 0H1026L451 1106H442Q448 1029 452 953Q456 888 458 817T461 688V0H184V1462H575L1149 367H1155Q1152 443 1148 517Q1147 549 1146 582T1143 649T1142 714T1141 770V1462H1419V0Z" />
-<glyph unicode="O" glyph-name="O" horiz-adv-x="1548" d="M1430 733Q1430 564 1391 425T1270 187T1066 34T774 -20Q606 -20 483 34T279 187T159 425T119 735Q119 905 158 1043T279 1280T483 1431T776 1485Q944 1485 1067 1432T1270 1280T1390 1043T1430 733ZM438
-733Q438 618 458 527T519 372T624 274T774 240Q863 240 926 274T1030 371T1090 526T1110 733Q1110 848 1091 939T1031 1095T927 1193T776 1227Q689 1227 625 1193T520 1095T458 940T438 733Z" />
-<glyph unicode="P" glyph-name="P" horiz-adv-x="1225" d="M494 774H555Q686 774 752 826T819 995Q819 1104 760 1156T573 1208H494V774ZM1133 1006Q1133 910 1104 822T1009 667T834 560T565 520H494V0H184V1462H590Q731 1462 833 1431T1002 1341T1101 1198T1133 1006Z" />
-<glyph unicode="Q" glyph-name="Q" horiz-adv-x="1548" d="M1430 733Q1430 614 1411 510T1352 319T1253 166T1112 55L1473 -348H1075L807 -18Q800 -18 794 -19Q789 -20 784 -20T774 -20Q606 -20 483 34T279 187T159 425T119 735Q119 905 158 1043T279 1280T483
-1431T776 1485Q944 1485 1067 1432T1270 1280T1390 1043T1430 733ZM438 733Q438 618 458 527T519 372T624 274T774 240Q863 240 926 274T1030 371T1090 526T1110 733Q1110 848 1091 939T1031 1095T927 1193T776 1227Q689 1227 625 1193T520 1095T458 940T438 733Z"
-/>
-<glyph unicode="R" glyph-name="R" horiz-adv-x="1290" d="M494 813H578Q707 813 763 864T819 1016Q819 1120 759 1164T573 1208H494V813ZM494 561V0H184V1462H584Q865 1462 999 1354T1133 1024Q1133 949 1113 888T1060 780T983 697T891 637Q1002 459 1090 319Q1128
-259 1163 202T1227 100T1273 28L1290 0H946L629 561H494Z" />
-<glyph unicode="S" glyph-name="S" horiz-adv-x="1073" d="M985 406Q985 308 952 230T854 96T696 10T481 -20Q375 -20 277 2T94 68V356Q142 333 191 312T290 273T391 246T492 236Q543 236 579 247T638 279T671 328T682 391Q682 432 665 463T616 522T540 576T440
-631Q394 655 337 689T230 773T145 895T111 1067Q111 1165 143 1242T236 1373T381 1455T573 1483Q626 1483 676 1476T776 1456T876 1424T979 1380L879 1139Q834 1160 795 1176T719 1203T647 1219T575 1225Q497 1225 456 1184T414 1073Q414 1036 426 1008T466 954T537
-903T643 844Q718 804 781 763T889 671T960 556T985 406Z" />
-<glyph unicode="T" glyph-name="T" horiz-adv-x="1124" d="M717 0H408V1204H41V1462H1083V1204H717V0Z" />
-<glyph unicode="U" glyph-name="U" horiz-adv-x="1466" d="M1292 1462V516Q1292 402 1258 304T1153 134T976 21T727 -20Q592 -20 489 18T316 128T210 298T174 520V1462H483V543Q483 462 499 405T546 311T625 257T735 240Q866 240 924 316T983 545V1462H1292Z" />
-<glyph unicode="V" glyph-name="V" horiz-adv-x="1249" d="M936 1462H1249L793 0H455L0 1462H313L561 582Q566 565 574 525T592 437T611 341T625 260Q630 293 639 341T658 436T677 524T692 582L936 1462Z" />
-<glyph unicode="W" glyph-name="W" horiz-adv-x="1898" d="M1546 0H1194L1014 721Q1010 736 1005 763T992 824T978 895T965 967T955 1031T948 1079Q946 1061 942 1032T931 968T919 896T906 825T893 763T883 719L705 0H352L0 1462H305L471 664Q474 648 479 618T492
-549T506 469T521 387T534 313T543 256Q546 278 551 312T563 384T576 464T590 540T601 603T610 643L813 1462H1085L1288 643Q1291 631 1296 604T1308 541T1322 464T1335 385T1347 312T1356 256Q1359 278 1364 312T1377 387T1391 469T1406 549T1418 617T1427 664L1593
-1462H1898L1546 0Z" />
-<glyph unicode="X" glyph-name="X" horiz-adv-x="1284" d="M1284 0H930L631 553L332 0H0L444 754L31 1462H373L647 936L915 1462H1249L831 737L1284 0Z" />
-<glyph unicode="Y" glyph-name="Y" horiz-adv-x="1196" d="M598 860L862 1462H1196L752 569V0H444V559L0 1462H336L598 860Z" />
-<glyph unicode="Z" glyph-name="Z" horiz-adv-x="1104" d="M1055 0H49V201L668 1206H68V1462H1036V1262L418 256H1055V0Z" />
-<glyph unicode="[" glyph-name="bracketleft" horiz-adv-x="678" d="M627 -324H143V1462H627V1251H403V-113H627V-324Z" />
-<glyph unicode="\" glyph-name="backslash" horiz-adv-x="846" d="M289 1462L834 0H557L12 1462H289Z" />
-<glyph unicode="]" glyph-name="bracketright" horiz-adv-x="678" d="M51 -113H274V1251H51V1462H535V-324H51V-113Z" />
-<glyph unicode="^" glyph-name="asciicircum" horiz-adv-x="1090" d="M8 520L446 1470H590L1085 520H846L524 1163Q455 1002 384 839T244 520H8Z" />
-<glyph unicode="_" glyph-name="underscore" horiz-adv-x="842" d="M846 -324H-4V-184H846V-324Z" />
-<glyph unicode="`" glyph-name="grave" horiz-adv-x="1182" d="M645 1241Q611 1269 564 1310T470 1396T386 1480T332 1548V1569H674Q690 1535 711 1495T756 1414T803 1335T848 1268V1241H645Z" />
-<glyph unicode="a" glyph-name="a" horiz-adv-x="1176" d="M809 0L750 152H741Q708 107 675 75T603 21T516 -10T403 -20Q335 -20 277 1T177 66T110 176T86 334Q86 512 200 596T541 690L719 696V780Q719 849 679 882T567 915Q495 915 427 894T289 838L190 1040Q274
-1087 376 1114T590 1141Q799 1141 910 1043T1022 745V0H809ZM719 518L618 514Q557 512 515 498T448 461T411 405T399 332Q399 262 433 233T522 203Q564 203 600 217T662 260T704 330T719 426V518Z" />
-<glyph unicode="b" glyph-name="b" horiz-adv-x="1245" d="M756 1139Q842 1139 913 1102T1035 992T1114 811T1143 561Q1143 417 1115 309T1034 127T909 17T748 -20Q692 -20 649 -8T571 24T512 69T465 123H444L393 0H160V1556H465V1194Q465 1161 463 1123T459 1051Q456
-1012 453 973H465Q486 1008 513 1038T575 1090T656 1126T756 1139ZM653 895Q602 895 567 877T509 821T477 728T465 596V563Q465 482 474 419T506 314T564 249T655 227Q746 227 788 313T831 565Q831 730 789 812T653 895Z" />
-<glyph unicode="c" glyph-name="c" horiz-adv-x="1022" d="M625 -20Q505 -20 409 13T244 115T139 293T102 553Q102 720 139 832T245 1013T410 1110T625 1139Q711 1139 796 1118T956 1059L868 827Q802 856 741 874T625 893Q514 893 464 809T414 555Q414 387 464
-307T621 227Q708 227 779 249T924 307V53Q887 35 852 21T782 -2T708 -15T625 -20Z" />
-<glyph unicode="d" glyph-name="d" horiz-adv-x="1245" d="M489 -20Q403 -20 332 17T210 126T131 307T102 557Q102 701 130 809T211 991T337 1102T498 1139Q552 1139 597 1127T678 1092T742 1040T793 975H803Q797 1014 792 1054Q787 1088 784 1126T780 1198V1556H1085V0H852L793
-145H780Q759 111 732 81T670 28T590 -7T489 -20ZM600 223Q654 223 692 241T753 297T788 391T801 522V555Q801 636 791 699T758 804T696 869T598 891Q502 891 457 805T412 553Q412 388 457 306T600 223Z" />
-<glyph unicode="e" glyph-name="e" horiz-adv-x="1190" d="M612 922Q531 922 478 865T416 686H805Q804 737 792 780T756 854T696 904T612 922ZM651 -20Q531 -20 430 15T256 120T143 298T102 551Q102 698 139 808T242 991T402 1102T610 1139Q721 1139 810 1106T962
-1007T1058 848T1092 631V483H410Q412 419 430 368T482 281T563 226T672 207Q723 207 768 212T857 229T942 256T1028 295V59Q988 38 948 24T862 -1T765 -15T651 -20Z" />
-<glyph unicode="f" glyph-name="f" horiz-adv-x="793" d="M741 889H514V0H209V889H41V1036L209 1118V1200Q209 1307 235 1377T309 1490T425 1549T578 1567Q670 1567 733 1553T840 1520L768 1296Q737 1307 703 1316T623 1325Q563 1325 539 1287T514 1188V1118H741V889Z" />
-<glyph unicode="g" glyph-name="g" horiz-adv-x="1130" d="M1085 1116V950L922 899Q942 865 950 829T958 750Q958 665 931 595T851 474T718 397T532 369Q509 369 482 371T442 377Q422 360 411 342T399 297Q399 276 412 264T446 244T495 234T553 231H727Q808 231
-872 213T980 156T1049 60T1073 -80Q1073 -175 1035 -251T922 -381T734 -463T475 -492Q361 -492 276 -471T134 -409T49 -311T20 -182Q20 -121 41 -76T97 1T176 53T268 84Q247 93 227 109T190 146T163 192T152 246Q152 278 161 304T189 352T234 395T295 436Q207 474
-156 558T104 756Q104 846 132 917T214 1037T348 1113T532 1139Q552 1139 577 1137T626 1131T672 1123T705 1116H1085ZM285 -158Q285 -183 295 -206T330 -248T393 -276T489 -287Q645 -287 724 -243T803 -125Q803 -62 754 -41T602 -20H461Q434 -20 403 -26T346 -49T303
--91T285 -158ZM395 752Q395 661 429 611T532 561Q604 561 636 611T668 752Q668 842 637 895T532 948Q395 948 395 752Z" />
-<glyph unicode="h" glyph-name="h" horiz-adv-x="1284" d="M1130 0H825V653Q825 774 788 834T672 895Q613 895 573 871T509 800T475 684T465 526V0H160V1556H465V1239Q465 1197 463 1151T458 1065Q454 1019 451 975H467Q516 1062 592 1100T764 1139Q847 1139 914
-1116T1030 1042T1104 915T1130 729V0Z" />
-<glyph unicode="i" glyph-name="i" horiz-adv-x="625" d="M147 1407Q147 1450 160 1478T195 1524T248 1549T313 1556Q347 1556 377 1549T429 1525T465 1479T479 1407Q479 1365 466 1336T430 1290T377 1265T313 1257Q279 1257 249 1264T196 1289T160 1336T147 1407ZM465
-0H160V1118H465V0Z" />
-<glyph unicode="j" glyph-name="j" horiz-adv-x="625" d="M102 -492Q54 -492 3 -485T-82 -467V-227Q-51 -237 -24 -241T37 -246Q62 -246 84 -239T123 -212T150 -160T160 -76V1118H465V-121Q465 -198 446 -265T383 -383T270 -463T102 -492ZM147 1407Q147 1450 160
-1478T195 1524T248 1549T313 1556Q347 1556 377 1549T429 1525T465 1479T479 1407Q479 1365 466 1336T430 1290T377 1265T313 1257Q279 1257 249 1264T196 1289T160 1336T147 1407Z" />
-<glyph unicode="k" glyph-name="k" horiz-adv-x="1208" d="M453 608L565 778L838 1118H1182L778 633L1208 0H856L584 430L465 348V0H160V1556H465V862L449 608H453Z" />
-<glyph unicode="l" glyph-name="l" horiz-adv-x="625" d="M465 0H160V1556H465V0Z" />
-<glyph unicode="m" glyph-name="m" horiz-adv-x="1929" d="M1120 0H815V653Q815 774 779 834T666 895Q608 895 570 871T508 800T475 684T465 526V0H160V1118H393L434 975H451Q475 1018 508 1049T582 1100T667 1129T758 1139Q873 1139 953 1100T1077 975H1102Q1126
-1018 1160 1049T1235 1100T1321 1129T1413 1139Q1593 1139 1684 1042T1776 729V0H1470V653Q1470 774 1434 834T1321 895Q1212 895 1166 809T1120 561V0Z" />
-<glyph unicode="n" glyph-name="n" horiz-adv-x="1284" d="M1130 0H825V653Q825 774 789 834T672 895Q612 895 572 871T509 800T475 684T465 526V0H160V1118H393L434 975H451Q475 1018 509 1049T585 1100T672 1129T766 1139Q848 1139 915 1116T1030 1042T1104
-915T1130 729V0Z" />
-<glyph unicode="o" glyph-name="o" horiz-adv-x="1227" d="M414 561Q414 394 461 310T614 225Q719 225 766 310T813 561Q813 728 766 810T612 893Q507 893 461 811T414 561ZM1124 561Q1124 421 1089 313T987 131T825 19T610 -20Q499 -20 406 18T246 131T140 313T102
-561Q102 700 137 808T239 989T401 1101T616 1139Q727 1139 820 1101T980 990T1086 808T1124 561Z" />
-<glyph unicode="p" glyph-name="p" horiz-adv-x="1245" d="M748 -20Q693 -20 650 -8T572 24T512 69T465 123H449Q453 88 457 57Q460 31 462 4T465 -39V-492H160V1118H408L451 973H465Q486 1007 513 1037T575 1089T656 1125T756 1139Q843 1139 914 1102T1036 992T1115
-811T1143 561Q1143 418 1114 310T1033 128T908 17T748 -20ZM653 895Q602 895 567 877T509 821T477 728T465 596V563Q465 482 474 419T506 314T564 249T655 227Q746 227 788 313T831 565Q831 730 789 812T653 895Z" />
-<glyph unicode="q" glyph-name="q" horiz-adv-x="1245" d="M602 219Q657 219 694 237T755 293T789 386T801 518V555Q801 636 792 699T759 804T697 869T600 891Q504 891 459 805T414 553Q414 385 459 302T602 219ZM489 -20Q402 -20 331 17T209 126T130 307T102
-557Q102 700 130 808T211 990T337 1101T498 1139Q554 1139 599 1127T680 1092T745 1040T795 975H803L827 1118H1085V-492H780V-23Q780 -4 782 24T787 80Q790 112 793 145H780Q760 111 733 81T671 28T590 -7T489 -20Z" />
-<glyph unicode="r" glyph-name="r" horiz-adv-x="889" d="M743 1139Q755 1139 769 1139T797 1137T822 1134T840 1130V844Q832 846 818 848T789 851T758 853T733 854Q674 854 625 839T540 791T485 703T465 569V0H160V1118H391L436 950H451Q475 993 503 1028T565
-1087T643 1125T743 1139Z" />
-<glyph unicode="s" glyph-name="s" horiz-adv-x="985" d="M905 332Q905 244 873 178T782 68T639 2T451 -20Q396 -20 349 -17T260 -5T179 15T100 45V297Q142 276 188 259T281 230T370 210T451 203Q492 203 521 210T568 231T595 263T604 303Q604 324 598 340T568
-375T501 417T381 475Q308 508 255 540T167 613T115 704T98 827Q98 905 128 963T213 1061T345 1119T518 1139Q618 1139 708 1116T893 1047L801 831Q725 867 656 890T518 913Q456 913 429 891T401 831Q401 811 408 796T436 764T495 728T594 680Q665 649 722 619T820
-549T883 458T905 332Z" />
-<glyph unicode="t" glyph-name="t" horiz-adv-x="848" d="M614 223Q659 223 699 233T782 258V31Q739 9 676 -5T537 -20Q464 -20 401 -3T292 56T220 170T193 350V889H47V1018L215 1120L303 1356H498V1118H770V889H498V350Q498 285 530 254T614 223Z" />
-<glyph unicode="u" glyph-name="u" horiz-adv-x="1284" d="M891 0L850 143H834Q809 100 775 70T699 19T612 -10T518 -20Q436 -20 369 3T254 77T180 204T154 389V1118H459V465Q459 344 495 284T612 223Q672 223 712 247T775 318T809 434T819 592V1118H1124V0H891Z" />
-<glyph unicode="v" glyph-name="v" horiz-adv-x="1104" d="M395 0L0 1118H319L504 481Q521 424 533 363T549 252H555Q558 305 570 364T600 481L784 1118H1104L709 0H395Z" />
-<glyph unicode="w" glyph-name="w" horiz-adv-x="1651" d="M1014 0L928 391Q924 408 918 439T903 510T887 594T869 683Q849 786 825 905H819Q796 786 777 682Q769 638 761 593T744 509T730 437T719 387L629 0H301L0 1118H303L416 623Q425 584 434 530T452 420T468
-315T479 236H485Q486 255 489 285T498 351T508 422T519 491T529 547T537 582L659 1118H995L1112 582Q1117 560 1125 514T1141 416T1156 314T1163 236H1169Q1172 261 1179 310T1196 415T1215 528T1235 623L1352 1118H1651L1346 0H1014Z" />
-<glyph unicode="x" glyph-name="x" horiz-adv-x="1122" d="M389 571L29 1118H375L561 782L750 1118H1096L731 571L1112 0H766L561 362L356 0H10L389 571Z" />
-<glyph unicode="y" glyph-name="y" horiz-adv-x="1104" d="M0 1118H334L514 489Q530 437 537 378T547 272H553Q555 295 558 323T567 380T578 437T592 489L768 1118H1104L662 -143Q600 -320 493 -406T225 -492Q173 -492 135 -487T70 -475V-233Q91 -238 123 -242T190
--246Q238 -246 272 -233T330 -197T372 -140T403 -66L422 -10L0 1118Z" />
-<glyph unicode="z" glyph-name="z" horiz-adv-x="936" d="M877 0H55V180L512 885H86V1118H858V920L416 233H877V0Z" />
-<glyph unicode="{" glyph-name="braceleft" horiz-adv-x="745" d="M287 367T222 408T31 449V688Q93 688 141 697T223 728T272 784T287 866V1184Q287 1258 306 1310T374 1396T509 1446T725 1462V1237Q685 1236 653 1230T598 1209T563 1166T551 1096V797Q545 610
-317 575V563Q432 546 493 491T551 342V43Q551 0 563 -27T597 -69T652 -91T725 -98V-324Q594 -324 509 -308T375 -259T306 -172T287 -45V270Q287 367 222 408Z" />
-<glyph unicode="|" glyph-name="bar" horiz-adv-x="1128" d="M455 1550H674V-465H455V1550Z" />
-<glyph unicode="}" glyph-name="braceright" horiz-adv-x="745" d="M469 -45Q469 -119 450 -172T382 -258T247 -308T31 -324V-98Q71 -97 103 -91T157 -70T192 -27T205 43V342Q202 436 263 491T438 563V575Q211 610 205 797V1096Q205 1139 193 1166T158 1208T103
-1230T31 1237V1462Q162 1462 247 1446T381 1397T450 1311T469 1184V866Q468 818 484 784T533 729T614 698T725 688V449Q600 449 535 408T469 270V-45Z" />
-<glyph unicode="~" glyph-name="asciitilde" horiz-adv-x="1128" d="M528 616Q491 632 463 643T411 660T366 669T322 672Q293 672 262 663T201 637T143 598T88 551V782Q139 836 202 863T344 891Q374 891 399 889T453 879T517 860T600 827Q638 811 666 801T719
-784T764 775T807 772Q836 772 867 781T928 807T986 845T1040 893V662Q939 553 784 553Q754 553 729 555T675 564T611 583T528 616Z" />
-<glyph unicode="&#xa0;" glyph-name="nbspace" horiz-adv-x="532" />
-<glyph unicode="&#xa1;" glyph-name="exclamdown" horiz-adv-x="586" d="M168 606H412L463 -369H117L168 606ZM467 948Q467 901 454 869T416 816T360 787T291 778Q256 778 225 787T169 816T131 868T117 948Q117 993 131 1025T169 1078T224 1108T291 1118Q328 1118
-360 1109T416 1079T453 1026T467 948Z" />
-<glyph unicode="&#xa2;" glyph-name="cent" horiz-adv-x="1128" d="M543 -20V186Q451 199 377 236T251 340T171 506T143 743Q143 884 171 985T251 1155T378 1260T543 1311V1483H721V1319Q759 1318 797 1313T870 1299T937 1281T993 1260L907 1034Q886 1044 860
-1053T805 1070T750 1082T698 1087Q632 1087 586 1067T511 1006T468 901T455 750Q455 579 512 500T698 420Q774 420 844 438T965 481V242Q914 213 852 198T721 180V-20H543Z" />
-<glyph unicode="&#xa3;" glyph-name="sterling" horiz-adv-x="1128" d="M680 1483Q790 1483 879 1459T1049 1401L956 1171Q885 1200 827 1217T705 1235Q638 1235 601 1197T563 1063V870H897V651H563V508Q563 453 550 413T514 343T466 294T412 260H1090V0H82V248Q124
-266 157 287T214 337T250 407T262 506V651H84V870H262V1065Q262 1178 293 1257T380 1387T512 1460T680 1483Z" />
-<glyph unicode="&#xa4;" glyph-name="currency" horiz-adv-x="1128" d="M168 723Q168 777 182 826T221 920L92 1047L240 1194L367 1067Q410 1092 461 1106T563 1120Q617 1120 665 1107T760 1065L887 1194L1036 1051L907 922Q932 880 946 829T961 723Q961 667 947
-618T907 524L1032 399L887 254L760 379Q716 356 667 342T563 328Q507 328 458 340T365 379L240 256L94 401L221 526Q168 617 168 723ZM375 723Q375 684 390 650T430 590T490 550T563 535Q603 535 638 549T699 589T741 649T756 723Q756 763 741 797T700 857T638
-898T563 913Q524 913 490 898T431 858T390 798T375 723Z" />
-<glyph unicode="&#xa5;" glyph-name="yen" horiz-adv-x="1128" d="M565 860L809 1462H1122L760 715H954V537H709V399H954V221H709V0H422V221H174V399H422V537H174V715H365L8 1462H324L565 860Z" />
-<glyph unicode="&#xa6;" glyph-name="brokenbar" horiz-adv-x="1128" d="M455 1550H674V735H455V1550ZM455 350H674V-465H455V350Z" />
-<glyph unicode="&#xa7;" glyph-name="section" horiz-adv-x="995" d="M121 805Q121 849 131 886T160 955T203 1012T254 1055Q191 1095 156 1154T121 1288Q121 1353 150 1406T232 1498T360 1556T526 1577Q628 1577 716 1554T889 1493L807 1303Q739 1335 669 1360T520
-1386Q439 1386 402 1363T365 1292Q365 1267 377 1246T415 1206T481 1167T578 1124Q649 1096 707 1062T807 987T872 895T895 782Q895 682 861 621T770 522Q832 482 863 430T895 303Q895 229 864 170T776 68T638 3T455 -20Q345 -20 261 0T106 59V266Q145 246 190
-229T281 198T371 176T455 168Q511 168 548 177T607 202T639 239T649 285Q649 310 642 329T612 368T549 408T442 457Q366 489 306 521T205 593T143 685T121 805ZM344 827Q344 764 400 716T575 616L590 610Q605 621 619 635T644 668T661 708T668 756Q668 788 658
-815T621 867T550 917T434 967Q416 960 400 947T372 915T352 875T344 827Z" />
-<glyph unicode="&#xa8;" glyph-name="dieresis" horiz-adv-x="1182" d="M248 1405Q248 1440 259 1465T288 1507T332 1532T387 1540Q416 1540 441 1532T486 1508T516 1466T528 1405Q528 1371 517 1346T486 1305T442 1280T387 1272Q358 1272 333 1280T289 1304T259
-1346T248 1405ZM651 1405Q651 1440 662 1465T692 1507T737 1532T793 1540Q821 1540 846 1532T891 1508T922 1466T934 1405Q934 1371 923 1346T892 1305T847 1280T793 1272Q733 1272 692 1305T651 1405Z" />
-<glyph unicode="&#xa9;" glyph-name="copyright" horiz-adv-x="1704" d="M895 1010Q798 1010 745 936T692 731Q692 596 740 524T895 451Q952 451 1018 466T1141 510V319Q1084 292 1025 277T889 262Q782 262 702 296T569 392T488 540T461 733Q461 836 487 921T565
-1068T697 1164T881 1198Q964 1198 1041 1176T1186 1120L1112 952Q999 1010 895 1010ZM100 731Q100 835 127 931T202 1110T320 1263T472 1380T652 1456T852 1483Q956 1483 1052 1456T1231 1381T1384 1263T1501 1111T1577 931T1604 731Q1604 627 1577 531T1502 352T1384
-200T1232 82T1052 7T852 -20Q748 -20 652 6T473 82T320 199T203 351T127 531T100 731ZM242 731Q242 604 290 493T420 300T614 169T852 121Q979 121 1090 169T1283 299T1414 493T1462 731Q1462 858 1414 969T1284 1162T1090 1293T852 1341Q725 1341 614 1293T421
-1163T290 969T242 731Z" />
-<glyph unicode="&#xaa;" glyph-name="ordfeminine" horiz-adv-x="743" d="M520 764L489 874Q449 816 393 784T268 752Q218 752 178 765T108 806T63 876T47 975Q47 1035 68 1076T130 1144T230 1184T365 1202L455 1206Q455 1269 426 1296T342 1323Q302 1323 253
-1306T152 1262L86 1397Q148 1429 222 1454T387 1479Q455 1479 505 1460T589 1405T638 1319T655 1206V764H520ZM373 1081Q335 1078 312 1068T275 1044T257 1012T252 977Q252 939 271 921T317 903Q349 903 374 914T418 944T445 991T455 1051V1087L373 1081Z" />
-<glyph unicode="&#xab;" glyph-name="guillemotleft" horiz-adv-x="1198" d="M82 573L391 1028L610 909L393 561L610 213L391 94L82 547V573ZM588 573L897 1028L1116 909L899 561L1116 213L897 94L588 547V573Z" />
-<glyph unicode="&#xac;" glyph-name="logicalnot" horiz-adv-x="1128" d="M1040 248H821V612H88V831H1040V248Z" />
-<glyph unicode="&#xad;" glyph-name="uni00AD" horiz-adv-x="659" d="M61 424V674H598V424H61Z" />
-<glyph unicode="&#xae;" glyph-name="registered" horiz-adv-x="1704" d="M1157 905Q1157 811 1119 756T1014 672L1251 272H997L819 610H772V272H543V1188H807Q989 1188 1073 1118T1157 905ZM772 778H803Q869 778 897 806T926 901Q926 936 919 959T896 995T857
-1014T801 1020H772V778ZM100 731Q100 835 127 931T202 1110T320 1263T472 1380T652 1456T852 1483Q956 1483 1052 1456T1231 1381T1384 1263T1501 1111T1577 931T1604 731Q1604 627 1577 531T1502 352T1384 200T1232 82T1052 7T852 -20Q748 -20 652 6T473 82T320
-199T203 351T127 531T100 731ZM242 731Q242 604 290 493T420 300T614 169T852 121Q979 121 1090 169T1283 299T1414 493T1462 731Q1462 858 1414 969T1284 1162T1090 1293T852 1341Q725 1341 614 1293T421 1163T290 969T242 731Z" />
-<glyph unicode="&#xaf;" glyph-name="overscore" horiz-adv-x="1024" d="M1030 1556H-6V1757H1030V1556Z" />
-<glyph unicode="&#xb0;" glyph-name="degree" horiz-adv-x="877" d="M92 1137Q92 1208 119 1271T193 1381T303 1455T438 1483Q510 1483 573 1456T683 1381T757 1271T784 1137Q784 1065 757 1002T684 893T574 820T438 793Q366 793 303 819T193 892T119 1002T92
-1137ZM283 1137Q283 1106 295 1078T328 1029T377 996T438 983Q470 983 498 995T548 1029T581 1078T594 1137Q594 1169 582 1197T548 1247T499 1281T438 1294Q406 1294 378 1282T328 1248T295 1198T283 1137Z" />
-<glyph unicode="&#xb1;" glyph-name="plusminus" horiz-adv-x="1128" d="M455 674H88V893H455V1262H674V893H1040V674H674V309H455V674ZM88 0V219H1040V0H88Z" />
-<glyph unicode="&#xb2;" glyph-name="twosuperior" horiz-adv-x="776" d="M702 586H55V754L279 973Q325 1018 355 1051T404 1111T430 1161T438 1212Q438 1250 414 1270T350 1290Q310 1290 267 1270T170 1202L47 1354Q112 1411 193 1447T383 1483Q449 1483 503
-1467T596 1419T656 1341T678 1233Q678 1187 666 1147T626 1065T557 980T455 881L350 786H702V586Z" />
-<glyph unicode="&#xb3;" glyph-name="threesuperior" horiz-adv-x="776" d="M666 1249Q666 1180 626 1130T496 1051V1038Q547 1028 584 1007T645 959T682 898T694 829Q694 708 606 639T332 569Q256 569 190 586T59 639V829Q125 789 191 764T330 739Q404 739 438
-766T473 846Q473 867 465 886T438 919T387 943T307 952H195V1112H287Q339 1112 371 1121T421 1145T445 1180T451 1221Q451 1259 426 1284T350 1309Q303 1309 261 1290T162 1231L61 1372Q123 1419 198 1450T377 1481Q439 1481 492 1465T583 1418T644 1345T666 1249Z"
-/>
-<glyph unicode="&#xb4;" glyph-name="acute" horiz-adv-x="1182" d="M332 1241V1268Q353 1297 377 1335T424 1413T469 1494T506 1569H848V1548Q837 1530 816 1506T768 1453T710 1396T648 1338T587 1285T535 1241H332Z" />
-<glyph unicode="&#xb5;" glyph-name="mu" horiz-adv-x="1290" d="M465 465Q465 344 502 284T621 223Q679 223 718 247T781 318T815 434T825 592V1118H1130V0H897L854 150H842Q807 65 755 23T627 -20Q573 -20 528 3T455 70Q457 28 460 -15Q462 -52 463 -94T465
--172V-492H160V1118H465V465Z" />
-<glyph unicode="&#xb6;" glyph-name="paragraph" horiz-adv-x="1341" d="M1167 -260H1006V1356H840V-260H678V559Q617 541 532 541Q437 541 360 566T228 651T143 806T113 1042Q113 1189 145 1287T237 1446T380 1531T563 1556H1167V-260Z" />
-<glyph unicode="&#xb7;" glyph-name="middot" horiz-adv-x="584" d="M117 723Q117 770 130 802T168 855T224 884T293 893Q328 893 359 884T415 855T453 803T467 723Q467 678 453 646T415 593T360 563T293 553Q256 553 224 562T168 592T131 645T117 723Z" />
-<glyph unicode="&#xb8;" glyph-name="cedilla" horiz-adv-x="420" d="M418 -250Q418 -307 403 -352T351 -428T256 -475T109 -492Q64 -492 28 -486T-37 -471V-303Q-22 -307 -4 -310T34 -317T72 -322T106 -324Q135 -324 156 -311T178 -262Q178 -225 141 -197T12
--154L90 0H283L256 -61Q287 -71 316 -88T367 -128T404 -182T418 -250Z" />
-<glyph unicode="&#xb9;" glyph-name="onesuperior" horiz-adv-x="776" d="M584 586H346V1032Q346 1052 346 1082T348 1144T351 1201T354 1239Q348 1231 339 1221T319 1199T298 1178T279 1161L201 1100L92 1227L393 1462H584V586Z" />
-<glyph unicode="&#xba;" glyph-name="ordmasculine" horiz-adv-x="754" d="M696 1116Q696 1029 674 962T609 848T508 777T375 752Q306 752 248 776T147 847T81 961T57 1116Q57 1203 79 1270T143 1384T244 1455T379 1479Q447 1479 504 1455T605 1385T672 1271T696
-1116ZM260 1116Q260 1016 287 966T377 915Q437 915 464 965T492 1116Q492 1216 465 1265T377 1315Q315 1315 288 1266T260 1116Z" />
-<glyph unicode="&#xbb;" glyph-name="guillemotright" horiz-adv-x="1198" d="M1118 547L809 94L590 213L807 561L590 909L809 1028L1118 573V547ZM612 547L303 94L84 213L301 561L84 909L303 1028L612 573V547Z" />
-<glyph unicode="&#xbc;" glyph-name="onequarter" horiz-adv-x="1804" d="M1370 1462L559 0H320L1131 1462H1370ZM794 586H556V1032Q556 1052 556 1082T558 1144T561 1201T564 1239Q558 1231 549 1221T529 1199T508 1178T489 1161L411 1100L302 1227L603 1462H794V586ZM1682
-152H1557V1H1319V152H936V306L1321 883H1557V320H1682V152ZM1319 320V484Q1319 526 1320 572T1325 668Q1320 655 1311 634T1290 590T1268 546T1248 511L1121 320H1319Z" />
-<glyph unicode="&#xbd;" glyph-name="onehalf" horiz-adv-x="1804" d="M1370 1462L559 0H320L1131 1462H1370ZM794 586H556V1032Q556 1052 556 1082T558 1144T561 1201T564 1239Q558 1231 549 1221T529 1199T508 1178T489 1161L411 1100L302 1227L603 1462H794V586ZM1716
-1H1069V169L1293 388Q1339 433 1369 466T1418 526T1444 576T1452 627Q1452 665 1428 685T1364 705Q1324 705 1281 685T1184 617L1061 769Q1126 826 1207 862T1397 898Q1463 898 1517 882T1610 834T1670 756T1692 648Q1692 602 1680 562T1640 480T1571 395T1469
-296L1364 201H1716V1Z" />
-<glyph unicode="&#xbe;" glyph-name="threequarters" horiz-adv-x="1804" d="M1441 1462L630 0H391L1202 1462H1441ZM1712 152H1587V1H1349V152H966V306L1351 883H1587V320H1712V152ZM1349 320V484Q1349 526 1350 572T1355 668Q1350 655 1341 634T1320 590T1298
-546T1278 511L1151 320H1349ZM697 1249Q697 1180 657 1130T527 1051V1038Q578 1028 615 1007T676 959T713 898T725 829Q725 708 637 639T363 569Q287 569 221 586T90 639V829Q156 789 222 764T361 739Q435 739 469 766T504 846Q504 867 496 886T469 919T418 943T338
-952H226V1112H318Q370 1112 402 1121T452 1145T476 1180T482 1221Q482 1259 457 1284T381 1309Q334 1309 292 1290T193 1231L92 1372Q154 1419 229 1450T408 1481Q470 1481 523 1465T614 1418T675 1345T697 1249Z" />
-<glyph unicode="&#xbf;" glyph-name="questiondown" horiz-adv-x="940" d="M686 606V532Q686 481 676 440T644 361T588 288T506 215Q464 182 435 156T388 105T362 51T354 -14Q354 -71 393 -108T510 -145Q579 -145 659 -116T823 -45L926 -266Q883 -292 832 -314T727
--354T616 -381T506 -391Q404 -391 323 -367T184 -296T97 -182T66 -29Q66 34 79 83T121 175T190 258T287 342Q328 375 354 399T396 446T416 492T422 547V606H686ZM719 948Q719 901 706 869T668 816T612 787T543 778Q508 778 477 787T421 816T383 868T369 948Q369
-993 383 1025T421 1078T476 1108T543 1118Q580 1118 612 1109T668 1079T705 1026T719 948Z" />
-<glyph unicode="&#xc0;" glyph-name="Agrave" horiz-adv-x="1331" d="M1018 0L918 348H414L313 0H0L475 1468H854L1331 0H1018ZM846 608L752 928Q746 946 734 987T709 1077T683 1177T666 1262Q662 1240 656 1210T641 1147T623 1079T606 1015T592 962T582 928L489
-608H846ZM632 1579Q598 1607 551 1648T457 1734T373 1818T319 1886V1907H661Q677 1873 698 1833T743 1752T790 1673T835 1606V1579H632Z" />
-<glyph unicode="&#xc1;" glyph-name="Aacute" horiz-adv-x="1331" d="M1018 0L918 348H414L313 0H0L475 1468H854L1331 0H1018ZM846 608L752 928Q746 946 734 987T709 1077T683 1177T666 1262Q662 1240 656 1210T641 1147T623 1079T606 1015T592 962T582 928L489
-608H846ZM494 1579V1606Q515 1635 539 1673T586 1751T631 1832T668 1907H1010V1886Q999 1868 978 1844T930 1791T872 1734T810 1676T749 1623T697 1579H494Z" />
-<glyph unicode="&#xc2;" glyph-name="Acircumflex" horiz-adv-x="1331" d="M1018 0L918 348H414L313 0H0L475 1468H854L1331 0H1018ZM846 608L752 928Q746 946 734 987T709 1077T683 1177T666 1262Q662 1240 656 1210T641 1147T623 1079T606 1015T592 962T582
-928L489 608H846ZM879 1579Q828 1613 773 1656T666 1755Q612 1699 560 1656T457 1579H254V1606Q280 1635 311 1673T375 1751T438 1832T490 1907H846Q867 1873 897 1833T959 1752T1024 1673T1082 1606V1579H879Z" />
-<glyph unicode="&#xc3;" glyph-name="Atilde" horiz-adv-x="1331" d="M1018 0L918 348H414L313 0H0L475 1468H854L1331 0H1018ZM846 608L752 928Q746 946 734 987T709 1077T683 1177T666 1262Q662 1240 656 1210T641 1147T623 1079T606 1015T592 962T582 928L489
-608H846ZM504 1684Q473 1684 455 1658T424 1577H275Q281 1657 301 1715T353 1811T430 1867T527 1886Q568 1886 607 1870T684 1835T760 1799T834 1782Q865 1782 883 1808T914 1888H1063Q1057 1809 1037 1751T983 1655T907 1598T811 1579Q771 1579 731 1595T653 1631T578
-1667T504 1684Z" />
-<glyph unicode="&#xc4;" glyph-name="Adieresis" horiz-adv-x="1331" d="M1018 0L918 348H414L313 0H0L475 1468H854L1331 0H1018ZM846 608L752 928Q746 946 734 987T709 1077T683 1177T666 1262Q662 1240 656 1210T641 1147T623 1079T606 1015T592 962T582 928L489
-608H846ZM324 1743Q324 1778 335 1803T364 1845T408 1870T463 1878Q492 1878 517 1870T562 1846T592 1804T604 1743Q604 1709 593 1684T562 1643T518 1618T463 1610Q434 1610 409 1618T365 1642T335 1684T324 1743ZM727 1743Q727 1778 738 1803T768 1845T813 1870T869
-1878Q897 1878 922 1870T967 1846T998 1804T1010 1743Q1010 1709 999 1684T968 1643T923 1618T869 1610Q809 1610 768 1643T727 1743Z" />
-<glyph unicode="&#xc5;" glyph-name="Aring" horiz-adv-x="1331" d="M1018 0L918 348H414L313 0H0L475 1468H854L1331 0H1018ZM846 608L752 928Q746 946 734 987T709 1077T683 1177T666 1262Q662 1240 656 1210T641 1147T623 1079T606 1015T592 962T582 928L489
-608H846ZM918 1567Q918 1511 899 1467T845 1391T764 1344T664 1327Q609 1327 563 1343T485 1390T434 1465T416 1565Q416 1620 434 1664T484 1738T563 1785T664 1802Q717 1802 763 1786T843 1739T898 1665T918 1567ZM760 1565Q760 1610 733 1635T664 1661Q622 1661
-595 1636T568 1565Q568 1520 592 1494T664 1468Q706 1468 733 1494T760 1565Z" />
-<glyph unicode="&#xc6;" glyph-name="AE" horiz-adv-x="1888" d="M1767 0H926V348H465L315 0H0L655 1462H1767V1208H1235V887H1731V633H1235V256H1767V0ZM578 608H926V1198H829L578 608Z" />
-<glyph unicode="&#xc7;" glyph-name="Ccedilla" horiz-adv-x="1305" d="M805 1225Q716 1225 648 1191T533 1092T462 935T438 727Q438 610 459 519T525 366T639 271T805 238Q894 238 983 258T1178 315V55Q1130 35 1083 21T987 -2T887 -15T776 -20Q607 -20 483 34T278
-186T158 422T119 729Q119 895 164 1033T296 1272T511 1427T805 1483Q914 1483 1023 1456T1233 1380L1133 1128Q1051 1167 968 1196T805 1225ZM926 -250Q926 -307 911 -352T859 -428T764 -475T617 -492Q572 -492 536 -486T471 -471V-303Q486 -307 504 -310T542 -317T580
--322T614 -324Q643 -324 664 -311T686 -262Q686 -225 649 -197T520 -154L598 0H791L764 -61Q795 -71 824 -88T875 -128T912 -182T926 -250Z" />
-<glyph unicode="&#xc8;" glyph-name="Egrave" horiz-adv-x="1147" d="M1026 0H184V1462H1026V1208H494V887H989V633H494V256H1026V0ZM572 1579Q538 1607 491 1648T397 1734T313 1818T259 1886V1907H601Q617 1873 638 1833T683 1752T730 1673T775 1606V1579H572Z" />
-<glyph unicode="&#xc9;" glyph-name="Eacute" horiz-adv-x="1147" d="M1026 0H184V1462H1026V1208H494V887H989V633H494V256H1026V0ZM424 1579V1606Q445 1635 469 1673T516 1751T561 1832T598 1907H940V1886Q929 1868 908 1844T860 1791T802 1734T740 1676T679
-1623T627 1579H424Z" />
-<glyph unicode="&#xca;" glyph-name="Ecircumflex" horiz-adv-x="1147" d="M1026 0H184V1462H1026V1208H494V887H989V633H494V256H1026V0ZM832 1579Q781 1613 726 1656T619 1755Q565 1699 513 1656T410 1579H207V1606Q233 1635 264 1673T328 1751T391 1832T443
-1907H799Q820 1873 850 1833T912 1752T977 1673T1035 1606V1579H832Z" />
-<glyph unicode="&#xcb;" glyph-name="Edieresis" horiz-adv-x="1147" d="M1026 0H184V1462H1026V1208H494V887H989V633H494V256H1026V0ZM273 1743Q273 1778 284 1803T313 1845T357 1870T412 1878Q441 1878 466 1870T511 1846T541 1804T553 1743Q553 1709 542 1684T511
-1643T467 1618T412 1610Q383 1610 358 1618T314 1642T284 1684T273 1743ZM676 1743Q676 1778 687 1803T717 1845T762 1870T818 1878Q846 1878 871 1870T916 1846T947 1804T959 1743Q959 1709 948 1684T917 1643T872 1618T818 1610Q758 1610 717 1643T676 1743Z"
-/>
-<glyph unicode="&#xcc;" glyph-name="Igrave" horiz-adv-x="797" d="M731 0H66V176L244 258V1204L66 1286V1462H731V1286L553 1204V258L731 176V0ZM355 1579Q321 1607 274 1648T180 1734T96 1818T42 1886V1907H384Q400 1873 421 1833T466 1752T513 1673T558 1606V1579H355Z"
-/>
-<glyph unicode="&#xcd;" glyph-name="Iacute" horiz-adv-x="797" d="M731 0H66V176L244 258V1204L66 1286V1462H731V1286L553 1204V258L731 176V0ZM237 1579V1606Q258 1635 282 1673T329 1751T374 1832T411 1907H753V1886Q742 1868 721 1844T673 1791T615 1734T553
-1676T492 1623T440 1579H237Z" />
-<glyph unicode="&#xce;" glyph-name="Icircumflex" horiz-adv-x="797" d="M731 0H66V176L244 258V1204L66 1286V1462H731V1286L553 1204V258L731 176V0ZM609 1579Q558 1613 503 1656T396 1755Q342 1699 290 1656T187 1579H-16V1606Q10 1635 41 1673T105 1751T168
-1832T220 1907H576Q597 1873 627 1833T689 1752T754 1673T812 1606V1579H609Z" />
-<glyph unicode="&#xcf;" glyph-name="Idieresis" horiz-adv-x="797" d="M731 0H66V176L244 258V1204L66 1286V1462H731V1286L553 1204V258L731 176V0ZM54 1743Q54 1778 65 1803T94 1845T138 1870T193 1878Q222 1878 247 1870T292 1846T322 1804T334 1743Q334 1709
-323 1684T292 1643T248 1618T193 1610Q164 1610 139 1618T95 1642T65 1684T54 1743ZM457 1743Q457 1778 468 1803T498 1845T543 1870T599 1878Q627 1878 652 1870T697 1846T728 1804T740 1743Q740 1709 729 1684T698 1643T653 1618T599 1610Q539 1610 498 1643T457
-1743Z" />
-<glyph unicode="&#xd0;" glyph-name="Eth" horiz-adv-x="1434" d="M47 850H184V1462H612Q773 1462 902 1416T1124 1280T1265 1055T1315 745Q1315 560 1265 421T1119 188T885 47T569 0H184V596H47V850ZM1001 737Q1001 859 977 947T906 1094T792 1180T637 1208H494V850H731V596H494V256H608Q804
-256 902 376T1001 737Z" />
-<glyph unicode="&#xd1;" glyph-name="Ntilde" horiz-adv-x="1604" d="M1419 0H1026L451 1106H442Q448 1029 452 953Q456 888 458 817T461 688V0H184V1462H575L1149 367H1155Q1152 443 1148 517Q1147 549 1146 582T1143 649T1142 714T1141 770V1462H1419V0ZM623
-1684Q592 1684 574 1658T543 1577H394Q400 1657 420 1715T472 1811T549 1867T646 1886Q687 1886 726 1870T803 1835T879 1799T953 1782Q984 1782 1002 1808T1033 1888H1182Q1176 1809 1156 1751T1102 1655T1026 1598T930 1579Q890 1579 850 1595T772 1631T697 1667T623
-1684Z" />
-<glyph unicode="&#xd2;" glyph-name="Ograve" horiz-adv-x="1548" d="M1430 733Q1430 564 1391 425T1270 187T1066 34T774 -20Q606 -20 483 34T279 187T159 425T119 735Q119 905 158 1043T279 1280T483 1431T776 1485Q944 1485 1067 1432T1270 1280T1390 1043T1430
-733ZM438 733Q438 618 458 527T519 372T624 274T774 240Q863 240 926 274T1030 371T1090 526T1110 733Q1110 848 1091 939T1031 1095T927 1193T776 1227Q689 1227 625 1193T520 1095T458 940T438 733ZM729 1579Q695 1607 648 1648T554 1734T470 1818T416 1886V1907H758Q774
-1873 795 1833T840 1752T887 1673T932 1606V1579H729Z" />
-<glyph unicode="&#xd3;" glyph-name="Oacute" horiz-adv-x="1548" d="M1430 733Q1430 564 1391 425T1270 187T1066 34T774 -20Q606 -20 483 34T279 187T159 425T119 735Q119 905 158 1043T279 1280T483 1431T776 1485Q944 1485 1067 1432T1270 1280T1390 1043T1430
-733ZM438 733Q438 618 458 527T519 372T624 274T774 240Q863 240 926 274T1030 371T1090 526T1110 733Q1110 848 1091 939T1031 1095T927 1193T776 1227Q689 1227 625 1193T520 1095T458 940T438 733ZM590 1579V1606Q611 1635 635 1673T682 1751T727 1832T764 1907H1106V1886Q1095
-1868 1074 1844T1026 1791T968 1734T906 1676T845 1623T793 1579H590Z" />
-<glyph unicode="&#xd4;" glyph-name="Ocircumflex" horiz-adv-x="1548" d="M1430 733Q1430 564 1391 425T1270 187T1066 34T774 -20Q606 -20 483 34T279 187T159 425T119 735Q119 905 158 1043T279 1280T483 1431T776 1485Q944 1485 1067 1432T1270 1280T1390
-1043T1430 733ZM438 733Q438 618 458 527T519 372T624 274T774 240Q863 240 926 274T1030 371T1090 526T1110 733Q1110 848 1091 939T1031 1095T927 1193T776 1227Q689 1227 625 1193T520 1095T458 940T438 733ZM975 1579Q924 1613 869 1656T762 1755Q708 1699
-656 1656T553 1579H350V1606Q376 1635 407 1673T471 1751T534 1832T586 1907H942Q963 1873 993 1833T1055 1752T1120 1673T1178 1606V1579H975Z" />
-<glyph unicode="&#xd5;" glyph-name="Otilde" horiz-adv-x="1548" d="M1430 733Q1430 564 1391 425T1270 187T1066 34T774 -20Q606 -20 483 34T279 187T159 425T119 735Q119 905 158 1043T279 1280T483 1431T776 1485Q944 1485 1067 1432T1270 1280T1390 1043T1430
-733ZM438 733Q438 618 458 527T519 372T624 274T774 240Q863 240 926 274T1030 371T1090 526T1110 733Q1110 848 1091 939T1031 1095T927 1193T776 1227Q689 1227 625 1193T520 1095T458 940T438 733ZM612 1684Q581 1684 563 1658T532 1577H383Q389 1657 409 1715T461
-1811T538 1867T635 1886Q676 1886 715 1870T792 1835T868 1799T942 1782Q973 1782 991 1808T1022 1888H1171Q1165 1809 1145 1751T1091 1655T1015 1598T919 1579Q879 1579 839 1595T761 1631T686 1667T612 1684Z" />
-<glyph unicode="&#xd6;" glyph-name="Odieresis" horiz-adv-x="1548" d="M1430 733Q1430 564 1391 425T1270 187T1066 34T774 -20Q606 -20 483 34T279 187T159 425T119 735Q119 905 158 1043T279 1280T483 1431T776 1485Q944 1485 1067 1432T1270 1280T1390 1043T1430
-733ZM438 733Q438 618 458 527T519 372T624 274T774 240Q863 240 926 274T1030 371T1090 526T1110 733Q1110 848 1091 939T1031 1095T927 1193T776 1227Q689 1227 625 1193T520 1095T458 940T438 733ZM428 1743Q428 1778 439 1803T468 1845T512 1870T567 1878Q596
-1878 621 1870T666 1846T696 1804T708 1743Q708 1709 697 1684T666 1643T622 1618T567 1610Q538 1610 513 1618T469 1642T439 1684T428 1743ZM831 1743Q831 1778 842 1803T872 1845T917 1870T973 1878Q1001 1878 1026 1870T1071 1846T1102 1804T1114 1743Q1114
-1709 1103 1684T1072 1643T1027 1618T973 1610Q913 1610 872 1643T831 1743Z" />
-<glyph unicode="&#xd7;" glyph-name="multiply" horiz-adv-x="1128" d="M408 723L109 1024L260 1178L561 879L866 1178L1020 1028L715 723L1016 420L866 268L561 569L260 270L111 422L408 723Z" />
-<glyph unicode="&#xd8;" glyph-name="Oslash" horiz-adv-x="1548" d="M1430 733Q1430 564 1391 425T1270 187T1066 34T774 -20Q595 -20 467 41L395 -76L227 18L309 152Q212 252 166 400T119 735Q119 905 158 1043T279 1280T483 1431T776 1485Q867 1485 944 1469T1087
-1421L1157 1532L1323 1436L1243 1307Q1337 1208 1383 1063T1430 733ZM438 733Q438 553 485 438L942 1184Q873 1227 776 1227Q689 1227 625 1193T520 1095T458 940T438 733ZM1110 733Q1110 904 1067 1020L612 279Q646 260 686 250T774 240Q863 240 926 274T1030
-371T1090 526T1110 733Z" />
-<glyph unicode="&#xd9;" glyph-name="Ugrave" horiz-adv-x="1466" d="M1292 1462V516Q1292 402 1258 304T1153 134T976 21T727 -20Q592 -20 489 18T316 128T210 298T174 520V1462H483V543Q483 462 499 405T546 311T625 257T735 240Q866 240 924 316T983 545V1462H1292ZM706
-1579Q672 1607 625 1648T531 1734T447 1818T393 1886V1907H735Q751 1873 772 1833T817 1752T864 1673T909 1606V1579H706Z" />
-<glyph unicode="&#xda;" glyph-name="Uacute" horiz-adv-x="1466" d="M1292 1462V516Q1292 402 1258 304T1153 134T976 21T727 -20Q592 -20 489 18T316 128T210 298T174 520V1462H483V543Q483 462 499 405T546 311T625 257T735 240Q866 240 924 316T983 545V1462H1292ZM570
-1579V1606Q591 1635 615 1673T662 1751T707 1832T744 1907H1086V1886Q1075 1868 1054 1844T1006 1791T948 1734T886 1676T825 1623T773 1579H570Z" />
-<glyph unicode="&#xdb;" glyph-name="Ucircumflex" horiz-adv-x="1466" d="M1292 1462V516Q1292 402 1258 304T1153 134T976 21T727 -20Q592 -20 489 18T316 128T210 298T174 520V1462H483V543Q483 462 499 405T546 311T625 257T735 240Q866 240 924 316T983 545V1462H1292ZM942
-1579Q891 1613 836 1656T729 1755Q675 1699 623 1656T520 1579H317V1606Q343 1635 374 1673T438 1751T501 1832T553 1907H909Q930 1873 960 1833T1022 1752T1087 1673T1145 1606V1579H942Z" />
-<glyph unicode="&#xdc;" glyph-name="Udieresis" horiz-adv-x="1466" d="M1292 1462V516Q1292 402 1258 304T1153 134T976 21T727 -20Q592 -20 489 18T316 128T210 298T174 520V1462H483V543Q483 462 499 405T546 311T625 257T735 240Q866 240 924 316T983 545V1462H1292ZM393
-1743Q393 1778 404 1803T433 1845T477 1870T532 1878Q561 1878 586 1870T631 1846T661 1804T673 1743Q673 1709 662 1684T631 1643T587 1618T532 1610Q503 1610 478 1618T434 1642T404 1684T393 1743ZM796 1743Q796 1778 807 1803T837 1845T882 1870T938 1878Q966
-1878 991 1870T1036 1846T1067 1804T1079 1743Q1079 1709 1068 1684T1037 1643T992 1618T938 1610Q878 1610 837 1643T796 1743Z" />
-<glyph unicode="&#xdd;" glyph-name="Yacute" horiz-adv-x="1196" d="M598 860L862 1462H1196L752 569V0H444V559L0 1462H336L598 860ZM422 1579V1606Q443 1635 467 1673T514 1751T559 1832T596 1907H938V1886Q927 1868 906 1844T858 1791T800 1734T738 1676T677
-1623T625 1579H422Z" />
-<glyph unicode="&#xde;" glyph-name="Thorn" horiz-adv-x="1225" d="M1133 770Q1133 676 1108 590T1024 438T870 333T633 293H494V0H184V1462H494V1233H655Q779 1233 869 1200T1017 1107T1104 961T1133 770ZM494 543H578Q699 543 759 595T819 770Q819 878 766
-929T598 981H494V543Z" />
-<glyph unicode="&#xdf;" glyph-name="germandbls" horiz-adv-x="1395" d="M1188 1241Q1188 1177 1167 1129T1114 1042T1045 975T976 922T923 877T901 834Q901 814 913 797T952 760T1020 715T1118 651Q1167 620 1205 588T1269 517T1309 432T1323 326Q1323 154 1206
-67T862 -20Q764 -20 692 -6T559 43V285Q583 269 617 254T690 226T768 207T842 199Q922 199 966 229T1010 322Q1010 349 1003 370T976 412T918 457T821 516Q758 552 716 584T647 647T609 713T598 788Q598 841 618 880T670 950T737 1007T805 1059T856 1117T877 1188Q877
-1251 827 1290T680 1329Q572 1329 519 1281T465 1128V0H160V1139Q160 1248 197 1328T302 1462T467 1541T680 1567Q795 1567 889 1546T1049 1483T1152 1380T1188 1241Z" />
-<glyph unicode="&#xe0;" glyph-name="agrave" horiz-adv-x="1176" d="M809 0L750 152H741Q708 107 675 75T603 21T516 -10T403 -20Q335 -20 277 1T177 66T110 176T86 334Q86 512 200 596T541 690L719 696V780Q719 849 679 882T567 915Q495 915 427 894T289 838L190
-1040Q274 1087 376 1114T590 1141Q799 1141 910 1043T1022 745V0H809ZM719 518L618 514Q557 512 515 498T448 461T411 405T399 332Q399 262 433 233T522 203Q564 203 600 217T662 260T704 330T719 426V518ZM808 1241Q774 1269 727 1310T633 1396T549 1480T495 1548V1569H837Q853
-1535 874 1495T919 1414T966 1335T1011 1268V1241H808Z" />
-<glyph unicode="&#xe1;" glyph-name="aacute" horiz-adv-x="1176" d="M809 0L750 152H741Q708 107 675 75T603 21T516 -10T403 -20Q335 -20 277 1T177 66T110 176T86 334Q86 512 200 596T541 690L719 696V780Q719 849 679 882T567 915Q495 915 427 894T289 838L190
-1040Q274 1087 376 1114T590 1141Q799 1141 910 1043T1022 745V0H809ZM719 518L618 514Q557 512 515 498T448 461T411 405T399 332Q399 262 433 233T522 203Q564 203 600 217T662 260T704 330T719 426V518ZM441 1241V1268Q462 1297 486 1335T533 1413T578 1494T615
-1569H957V1548Q946 1530 925 1506T877 1453T819 1396T757 1338T696 1285T644 1241H441Z" />
-<glyph unicode="&#xe2;" glyph-name="acircumflex" horiz-adv-x="1176" d="M809 0L750 152H741Q708 107 675 75T603 21T516 -10T403 -20Q335 -20 277 1T177 66T110 176T86 334Q86 512 200 596T541 690L719 696V780Q719 849 679 882T567 915Q495 915 427 894T289
-838L190 1040Q274 1087 376 1114T590 1141Q799 1141 910 1043T1022 745V0H809ZM719 518L618 514Q557 512 515 498T448 461T411 405T399 332Q399 262 433 233T522 203Q564 203 600 217T662 260T704 330T719 426V518ZM801 1496Q750 1530 695 1573T588 1672Q534 1616
-482 1573T379 1496H176V1523Q202 1552 233 1590T297 1668T360 1749T412 1824H768Q789 1790 819 1750T881 1669T946 1590T1004 1523V1496H801Z" />
-<glyph unicode="&#xe3;" glyph-name="atilde" horiz-adv-x="1176" d="M809 0L750 152H741Q708 107 675 75T603 21T516 -10T403 -20Q335 -20 277 1T177 66T110 176T86 334Q86 512 200 596T541 690L719 696V780Q719 849 679 882T567 915Q495 915 427 894T289 838L190
-1040Q274 1087 376 1114T590 1141Q799 1141 910 1043T1022 745V0H809ZM719 518L618 514Q557 512 515 498T448 461T411 405T399 332Q399 262 433 233T522 203Q564 203 600 217T662 260T704 330T719 426V518ZM681 1346Q650 1346 632 1320T601 1239H452Q458 1319 478
-1377T530 1473T607 1529T704 1548Q745 1548 784 1532T861 1497T937 1461T1011 1444Q1042 1444 1060 1470T1091 1550H1240Q1234 1471 1214 1413T1160 1317T1084 1260T988 1241Q948 1241 908 1257T830 1293T755 1329T681 1346Z" />
-<glyph unicode="&#xe4;" glyph-name="adieresis" horiz-adv-x="1176" d="M809 0L750 152H741Q708 107 675 75T603 21T516 -10T403 -20Q335 -20 277 1T177 66T110 176T86 334Q86 512 200 596T541 690L719 696V780Q719 849 679 882T567 915Q495 915 427 894T289
-838L190 1040Q274 1087 376 1114T590 1141Q799 1141 910 1043T1022 745V0H809ZM719 518L618 514Q557 512 515 498T448 461T411 405T399 332Q399 262 433 233T522 203Q564 203 600 217T662 260T704 330T719 426V518ZM254 1405Q254 1440 265 1465T294 1507T338 1532T393
-1540Q422 1540 447 1532T492 1508T522 1466T534 1405Q534 1371 523 1346T492 1305T448 1280T393 1272Q364 1272 339 1280T295 1304T265 1346T254 1405ZM657 1405Q657 1440 668 1465T698 1507T743 1532T799 1540Q827 1540 852 1532T897 1508T928 1466T940 1405Q940
-1371 929 1346T898 1305T853 1280T799 1272Q739 1272 698 1305T657 1405Z" />
-<glyph unicode="&#xe5;" glyph-name="aring" horiz-adv-x="1176" d="M809 0L750 152H741Q708 107 675 75T603 21T516 -10T403 -20Q335 -20 277 1T177 66T110 176T86 334Q86 512 200 596T541 690L719 696V780Q719 849 679 882T567 915Q495 915 427 894T289 838L190
-1040Q274 1087 376 1114T590 1141Q799 1141 910 1043T1022 745V0H809ZM719 518L618 514Q557 512 515 498T448 461T411 405T399 332Q399 262 433 233T522 203Q564 203 600 217T662 260T704 330T719 426V518ZM842 1479Q842 1423 823 1379T769 1303T688 1256T588 1239Q533
-1239 487 1255T409 1302T358 1377T340 1477Q340 1532 358 1576T408 1650T487 1697T588 1714Q641 1714 687 1698T767 1651T822 1577T842 1479ZM684 1477Q684 1522 657 1547T588 1573Q546 1573 519 1548T492 1477Q492 1432 516 1406T588 1380Q630 1380 657 1406T684
-1477Z" />
-<glyph unicode="&#xe6;" glyph-name="ae" horiz-adv-x="1806" d="M1268 -20Q1137 -20 1030 30T854 186Q811 132 769 94T678 30T568 -8T424 -20Q356 -20 295 1T187 66T113 176T86 334Q86 512 200 596T541 690L719 696V780Q719 849 679 882T567 915Q495 915 427
-894T289 838L190 1040Q274 1087 376 1114T590 1141Q804 1141 913 1010Q1039 1139 1227 1139Q1338 1139 1427 1106T1579 1007T1674 848T1708 631V483H1026Q1028 419 1046 368T1098 281T1179 226T1288 207Q1382 207 1469 228T1645 295V59Q1605 38 1565 24T1479 -1T1382
--15T1268 -20ZM719 518L618 514Q557 512 515 498T448 461T411 405T399 332Q399 262 433 233T522 203Q564 203 600 217T662 260T704 330T719 426V518ZM1229 922Q1147 922 1094 865T1032 686H1421Q1420 737 1408 780T1373 854T1313 904T1229 922Z" />
-<glyph unicode="&#xe7;" glyph-name="ccedilla" horiz-adv-x="1022" d="M625 -20Q505 -20 409 13T244 115T139 293T102 553Q102 720 139 832T245 1013T410 1110T625 1139Q711 1139 796 1118T956 1059L868 827Q802 856 741 874T625 893Q514 893 464 809T414 555Q414
-387 464 307T621 227Q708 227 779 249T924 307V53Q887 35 852 21T782 -2T708 -15T625 -20ZM778 -250Q778 -307 763 -352T711 -428T616 -475T469 -492Q424 -492 388 -486T323 -471V-303Q338 -307 356 -310T394 -317T432 -322T466 -324Q495 -324 516 -311T538 -262Q538
--225 501 -197T372 -154L450 0H643L616 -61Q647 -71 676 -88T727 -128T764 -182T778 -250Z" />
-<glyph unicode="&#xe8;" glyph-name="egrave" horiz-adv-x="1190" d="M612 922Q531 922 478 865T416 686H805Q804 737 792 780T756 854T696 904T612 922ZM651 -20Q531 -20 430 15T256 120T143 298T102 551Q102 698 139 808T242 991T402 1102T610 1139Q721 1139
-810 1106T962 1007T1058 848T1092 631V483H410Q412 419 430 368T482 281T563 226T672 207Q723 207 768 212T857 229T942 256T1028 295V59Q988 38 948 24T862 -1T765 -15T651 -20ZM834 1241Q800 1269 753 1310T659 1396T575 1480T521 1548V1569H863Q879 1535 900
-1495T945 1414T992 1335T1037 1268V1241H834Z" />
-<glyph unicode="&#xe9;" glyph-name="eacute" horiz-adv-x="1190" d="M612 922Q531 922 478 865T416 686H805Q804 737 792 780T756 854T696 904T612 922ZM651 -20Q531 -20 430 15T256 120T143 298T102 551Q102 698 139 808T242 991T402 1102T610 1139Q721 1139
-810 1106T962 1007T1058 848T1092 631V483H410Q412 419 430 368T482 281T563 226T672 207Q723 207 768 212T857 229T942 256T1028 295V59Q988 38 948 24T862 -1T765 -15T651 -20ZM447 1241V1268Q468 1297 492 1335T539 1413T584 1494T621 1569H963V1548Q952 1530
-931 1506T883 1453T825 1396T763 1338T702 1285T650 1241H447Z" />
-<glyph unicode="&#xea;" glyph-name="ecircumflex" horiz-adv-x="1190" d="M612 922Q531 922 478 865T416 686H805Q804 737 792 780T756 854T696 904T612 922ZM651 -20Q531 -20 430 15T256 120T143 298T102 551Q102 698 139 808T242 991T402 1102T610 1139Q721
-1139 810 1106T962 1007T1058 848T1092 631V483H410Q412 419 430 368T482 281T563 226T672 207Q723 207 768 212T857 229T942 256T1028 295V59Q988 38 948 24T862 -1T765 -15T651 -20ZM819 1241Q768 1275 713 1318T606 1417Q552 1361 500 1318T397 1241H194V1268Q220
-1297 251 1335T315 1413T378 1494T430 1569H786Q807 1535 837 1495T899 1414T964 1335T1022 1268V1241H819Z" />
-<glyph unicode="&#xeb;" glyph-name="edieresis" horiz-adv-x="1190" d="M612 922Q531 922 478 865T416 686H805Q804 737 792 780T756 854T696 904T612 922ZM651 -20Q531 -20 430 15T256 120T143 298T102 551Q102 698 139 808T242 991T402 1102T610 1139Q721 1139
-810 1106T962 1007T1058 848T1092 631V483H410Q412 419 430 368T482 281T563 226T672 207Q723 207 768 212T857 229T942 256T1028 295V59Q988 38 948 24T862 -1T765 -15T651 -20ZM266 1405Q266 1440 277 1465T306 1507T350 1532T405 1540Q434 1540 459 1532T504
-1508T534 1466T546 1405Q546 1371 535 1346T504 1305T460 1280T405 1272Q376 1272 351 1280T307 1304T277 1346T266 1405ZM669 1405Q669 1440 680 1465T710 1507T755 1532T811 1540Q839 1540 864 1532T909 1508T940 1466T952 1405Q952 1371 941 1346T910 1305T865
-1280T811 1272Q751 1272 710 1305T669 1405Z" />
-<glyph unicode="&#xec;" glyph-name="igrave" horiz-adv-x="625" d="M465 0H160V1118H465V0ZM269 1241Q235 1269 188 1310T94 1396T10 1480T-44 1548V1569H298Q314 1535 335 1495T380 1414T427 1335T472 1268V1241H269Z" />
-<glyph unicode="&#xed;" glyph-name="iacute" horiz-adv-x="625" d="M465 0H160V1118H465V0ZM145 1241V1268Q166 1297 190 1335T237 1413T282 1494T319 1569H661V1548Q650 1530 629 1506T581 1453T523 1396T461 1338T400 1285T348 1241H145Z" />
-<glyph unicode="&#xee;" glyph-name="icircumflex" horiz-adv-x="625" d="M465 0H160V1118H465V0ZM521 1241Q470 1275 415 1318T308 1417Q254 1361 202 1318T99 1241H-104V1268Q-78 1297 -47 1335T17 1413T80 1494T132 1569H488Q509 1535 539 1495T601 1414T666
-1335T724 1268V1241H521Z" />
-<glyph unicode="&#xef;" glyph-name="idieresis" horiz-adv-x="625" d="M465 0H160V1118H465V0ZM-32 1405Q-32 1440 -21 1465T8 1507T52 1532T107 1540Q136 1540 161 1532T206 1508T236 1466T248 1405Q248 1371 237 1346T206 1305T162 1280T107 1272Q78 1272 53
-1280T9 1304T-21 1346T-32 1405ZM371 1405Q371 1440 382 1465T412 1507T457 1532T513 1540Q541 1540 566 1532T611 1508T642 1466T654 1405Q654 1371 643 1346T612 1305T567 1280T513 1272Q453 1272 412 1305T371 1405Z" />
-<glyph unicode="&#xf0;" glyph-name="eth" horiz-adv-x="1182" d="M457 1309Q423 1330 384 1354T303 1401L399 1571Q472 1537 536 1503T657 1430L883 1569L983 1415L809 1309Q881 1240 935 1162T1024 993T1078 798T1096 573Q1096 431 1060 321T957 135T795 20T582
--20Q471 -20 378 14T218 113T112 272T74 489Q74 611 106 705T197 863T337 961T516 995Q612 995 680 964T780 883L801 885Q773 973 723 1050T606 1184L375 1040L274 1196L457 1309ZM784 532Q784 579 773 622T737 698T675 750T586 770Q478 770 432 700T385 487Q385
-424 396 372T432 283T495 226T586 205Q692 205 738 286T784 532Z" />
-<glyph unicode="&#xf1;" glyph-name="ntilde" horiz-adv-x="1284" d="M1130 0H825V653Q825 774 789 834T672 895Q612 895 572 871T509 800T475 684T465 526V0H160V1118H393L434 975H451Q475 1018 509 1049T585 1100T672 1129T766 1139Q848 1139 915 1116T1030
-1042T1104 915T1130 729V0ZM477 1346Q446 1346 428 1320T397 1239H248Q254 1319 274 1377T326 1473T403 1529T500 1548Q541 1548 580 1532T657 1497T733 1461T807 1444Q838 1444 856 1470T887 1550H1036Q1030 1471 1010 1413T956 1317T880 1260T784 1241Q744 1241
-704 1257T626 1293T551 1329T477 1346Z" />
-<glyph unicode="&#xf2;" glyph-name="ograve" horiz-adv-x="1227" d="M414 561Q414 394 461 310T614 225Q719 225 766 310T813 561Q813 728 766 810T612 893Q507 893 461 811T414 561ZM1124 561Q1124 421 1089 313T987 131T825 19T610 -20Q499 -20 406 18T246
-131T140 313T102 561Q102 700 137 808T239 989T401 1101T616 1139Q727 1139 820 1101T980 990T1086 808T1124 561ZM841 1241Q807 1269 760 1310T666 1396T582 1480T528 1548V1569H870Q886 1535 907 1495T952 1414T999 1335T1044 1268V1241H841Z" />
-<glyph unicode="&#xf3;" glyph-name="oacute" horiz-adv-x="1227" d="M414 561Q414 394 461 310T614 225Q719 225 766 310T813 561Q813 728 766 810T612 893Q507 893 461 811T414 561ZM1124 561Q1124 421 1089 313T987 131T825 19T610 -20Q499 -20 406 18T246
-131T140 313T102 561Q102 700 137 808T239 989T401 1101T616 1139Q727 1139 820 1101T980 990T1086 808T1124 561ZM434 1241V1268Q455 1297 479 1335T526 1413T571 1494T608 1569H950V1548Q939 1530 918 1506T870 1453T812 1396T750 1338T689 1285T637 1241H434Z"
-/>
-<glyph unicode="&#xf4;" glyph-name="ocircumflex" horiz-adv-x="1227" d="M414 561Q414 394 461 310T614 225Q719 225 766 310T813 561Q813 728 766 810T612 893Q507 893 461 811T414 561ZM1124 561Q1124 421 1089 313T987 131T825 19T610 -20Q499 -20 406 18T246
-131T140 313T102 561Q102 700 137 808T239 989T401 1101T616 1139Q727 1139 820 1101T980 990T1086 808T1124 561ZM821 1241Q770 1275 715 1318T608 1417Q554 1361 502 1318T399 1241H196V1268Q222 1297 253 1335T317 1413T380 1494T432 1569H788Q809 1535 839
-1495T901 1414T966 1335T1024 1268V1241H821Z" />
-<glyph unicode="&#xf5;" glyph-name="otilde" horiz-adv-x="1227" d="M414 561Q414 394 461 310T614 225Q719 225 766 310T813 561Q813 728 766 810T612 893Q507 893 461 811T414 561ZM1124 561Q1124 421 1089 313T987 131T825 19T610 -20Q499 -20 406 18T246
-131T140 313T102 561Q102 700 137 808T239 989T401 1101T616 1139Q727 1139 820 1101T980 990T1086 808T1124 561ZM444 1346Q413 1346 395 1320T364 1239H215Q221 1319 241 1377T293 1473T370 1529T467 1548Q508 1548 547 1532T624 1497T700 1461T774 1444Q805
-1444 823 1470T854 1550H1003Q997 1471 977 1413T923 1317T847 1260T751 1241Q711 1241 671 1257T593 1293T518 1329T444 1346Z" />
-<glyph unicode="&#xf6;" glyph-name="odieresis" horiz-adv-x="1227" d="M414 561Q414 394 461 310T614 225Q719 225 766 310T813 561Q813 728 766 810T612 893Q507 893 461 811T414 561ZM1124 561Q1124 421 1089 313T987 131T825 19T610 -20Q499 -20 406 18T246
-131T140 313T102 561Q102 700 137 808T239 989T401 1101T616 1139Q727 1139 820 1101T980 990T1086 808T1124 561ZM266 1405Q266 1440 277 1465T306 1507T350 1532T405 1540Q434 1540 459 1532T504 1508T534 1466T546 1405Q546 1371 535 1346T504 1305T460 1280T405
-1272Q376 1272 351 1280T307 1304T277 1346T266 1405ZM669 1405Q669 1440 680 1465T710 1507T755 1532T811 1540Q839 1540 864 1532T909 1508T940 1466T952 1405Q952 1371 941 1346T910 1305T865 1280T811 1272Q751 1272 710 1305T669 1405Z" />
-<glyph unicode="&#xf7;" glyph-name="divide" horiz-adv-x="1128" d="M88 612V831H1040V612H88ZM424 373Q424 415 435 444T465 490T509 516T563 524Q591 524 616 516T660 491T690 444T702 373Q702 333 691 304T660 257T616 230T563 221Q535 221 510 229T465 256T435
-304T424 373ZM424 1071Q424 1113 435 1142T465 1189T509 1215T563 1223Q591 1223 616 1215T660 1189T690 1142T702 1071Q702 1031 691 1003T660 956T616 929T563 920Q535 920 510 928T465 955T435 1002T424 1071Z" />
-<glyph unicode="&#xf8;" glyph-name="oslash" horiz-adv-x="1227" d="M1124 561Q1124 421 1089 313T987 131T825 19T610 -20Q553 -20 501 -10T401 18L344 -76L182 14L250 125Q181 199 142 308T102 561Q102 700 137 808T239 989T401 1101T616 1139Q678 1139 735
-1126T844 1090L893 1169L1053 1073L991 975Q1054 903 1089 799T1124 561ZM414 561Q414 475 426 410L709 868Q669 893 612 893Q507 893 461 811T414 561ZM813 561Q813 625 807 674L539 240Q556 232 574 229T614 225Q719 225 766 310T813 561Z" />
-<glyph unicode="&#xf9;" glyph-name="ugrave" horiz-adv-x="1284" d="M891 0L850 143H834Q809 100 775 70T699 19T612 -10T518 -20Q436 -20 369 3T254 77T180 204T154 389V1118H459V465Q459 344 495 284T612 223Q672 223 712 247T775 318T809 434T819 592V1118H1124V0H891ZM839
-1241Q805 1269 758 1310T664 1396T580 1480T526 1548V1569H868Q884 1535 905 1495T950 1414T997 1335T1042 1268V1241H839Z" />
-<glyph unicode="&#xfa;" glyph-name="uacute" horiz-adv-x="1284" d="M891 0L850 143H834Q809 100 775 70T699 19T612 -10T518 -20Q436 -20 369 3T254 77T180 204T154 389V1118H459V465Q459 344 495 284T612 223Q672 223 712 247T775 318T809 434T819 592V1118H1124V0H891ZM461
-1241V1268Q482 1297 506 1335T553 1413T598 1494T635 1569H977V1548Q966 1530 945 1506T897 1453T839 1396T777 1338T716 1285T664 1241H461Z" />
-<glyph unicode="&#xfb;" glyph-name="ucircumflex" horiz-adv-x="1284" d="M891 0L850 143H834Q809 100 775 70T699 19T612 -10T518 -20Q436 -20 369 3T254 77T180 204T154 389V1118H459V465Q459 344 495 284T612 223Q672 223 712 247T775 318T809 434T819 592V1118H1124V0H891ZM842
-1241Q791 1275 736 1318T629 1417Q575 1361 523 1318T420 1241H217V1268Q243 1297 274 1335T338 1413T401 1494T453 1569H809Q830 1535 860 1495T922 1414T987 1335T1045 1268V1241H842Z" />
-<glyph unicode="&#xfc;" glyph-name="udieresis" horiz-adv-x="1284" d="M891 0L850 143H834Q809 100 775 70T699 19T612 -10T518 -20Q436 -20 369 3T254 77T180 204T154 389V1118H459V465Q459 344 495 284T612 223Q672 223 712 247T775 318T809 434T819 592V1118H1124V0H891ZM295
-1405Q295 1440 306 1465T335 1507T379 1532T434 1540Q463 1540 488 1532T533 1508T563 1466T575 1405Q575 1371 564 1346T533 1305T489 1280T434 1272Q405 1272 380 1280T336 1304T306 1346T295 1405ZM698 1405Q698 1440 709 1465T739 1507T784 1532T840 1540Q868
-1540 893 1532T938 1508T969 1466T981 1405Q981 1371 970 1346T939 1305T894 1280T840 1272Q780 1272 739 1305T698 1405Z" />
-<glyph unicode="&#xfd;" glyph-name="yacute" horiz-adv-x="1104" d="M0 1118H334L514 489Q530 437 537 378T547 272H553Q555 295 558 323T567 380T578 437T592 489L768 1118H1104L662 -143Q600 -320 493 -406T225 -492Q173 -492 135 -487T70 -475V-233Q91 -238
-123 -242T190 -246Q238 -246 272 -233T330 -197T372 -140T403 -66L422 -10L0 1118ZM393 1241V1268Q414 1297 438 1335T485 1413T530 1494T567 1569H909V1548Q898 1530 877 1506T829 1453T771 1396T709 1338T648 1285T596 1241H393Z" />
-<glyph unicode="&#xfe;" glyph-name="thorn" horiz-adv-x="1245" d="M465 973Q485 1008 512 1038T576 1090T656 1126T756 1139Q842 1139 913 1102T1035 992T1114 811T1143 561Q1143 418 1115 310T1036 128T914 17T756 -20Q701 -20 656 -10T576 20T513 64T465 117H451Q454
-85 458 55Q461 29 463 3T465 -39V-492H160V1556H465V1165Q465 1141 463 1108T458 1045Q454 1010 451 973H465ZM653 895Q602 895 567 877T509 821T477 728T465 596V563Q465 482 474 419T506 314T564 249T655 227Q746 227 788 313T831 565Q831 730 789 812T653 895Z"
-/>
-<glyph unicode="&#xff;" glyph-name="ydieresis" horiz-adv-x="1104" d="M0 1118H334L514 489Q530 437 537 378T547 272H553Q555 295 558 323T567 380T578 437T592 489L768 1118H1104L662 -143Q600 -320 493 -406T225 -492Q173 -492 135 -487T70 -475V-233Q91
--238 123 -242T190 -246Q238 -246 272 -233T330 -197T372 -140T403 -66L422 -10L0 1118ZM466 1405Q466 1440 477 1465T506 1507T550 1532T605 1540Q634 1540 659 1532T704 1508T734 1466T746 1405Q746 1371 735 1346T704 1305T660 1280T605 1272Q576 1272 551 1280T507
-1304T477 1346T466 1405ZM869 1405Q869 1440 880 1465T910 1507T955 1532T1011 1540Q1039 1540 1064 1532T1109 1508T1140 1466T1152 1405Q1152 1371 1141 1346T1110 1305T1065 1280T1011 1272Q951 1272 910 1305T869 1405Z" />
-<glyph unicode="&#x2013;" glyph-name="endash" horiz-adv-x="1024" d="M82 436V666H942V436H82Z" />
-<glyph unicode="&#x2014;" glyph-name="emdash" horiz-adv-x="2048" d="M82 436V666H1966V436H82Z" />
-<glyph unicode="&#x2018;" glyph-name="quoteleft" horiz-adv-x="440" d="M37 961L23 983Q37 1037 56 1098T99 1221T148 1344T199 1462H418Q403 1401 389 1335T361 1204T336 1076T317 961H37Z" />
-<glyph unicode="&#x2019;" glyph-name="quoteright" horiz-adv-x="440" d="M403 1462L418 1440Q404 1385 385 1325T342 1202T293 1078T242 961H23Q37 1021 51 1087T79 1219T104 1347T123 1462H403Z" />
-<glyph unicode="&#x201a;" glyph-name="quotesinglbase" horiz-adv-x="594" d="M459 215Q445 161 426 100T383 -23T334 -146T283 -264H63Q78 -203 92 -137T120 -6T145 122T164 238H444L459 215Z" />
-<glyph unicode="&#x201c;" glyph-name="quotedblleft" horiz-adv-x="907" d="M489 983Q503 1037 523 1098T566 1221T615 1344T666 1462H885Q870 1401 856 1335T828 1204T803 1076T784 961H504L489 983ZM23 983Q37 1037 56 1098T99 1221T148 1344T199 1462H418Q403
-1401 389 1335T361 1204T336 1076T317 961H37L23 983Z" />
-<glyph unicode="&#x201d;" glyph-name="quotedblright" horiz-adv-x="907" d="M418 1440Q404 1385 385 1325T342 1202T293 1078T242 961H23Q37 1021 51 1087T79 1219T104 1347T123 1462H403L418 1440ZM885 1440Q871 1385 852 1325T809 1202T760 1078T709 961H489Q504
-1021 518 1087T546 1219T571 1347T590 1462H870L885 1440Z" />
-<glyph unicode="&#x201e;" glyph-name="quotedblbase" horiz-adv-x="1061" d="M459 215Q445 161 426 100T383 -23T334 -146T283 -264H63Q78 -203 92 -137T120 -6T145 122T164 238H444L459 215ZM926 215Q912 161 893 100T850 -23T801 -146T750 -264H530Q545 -203
-559 -137T587 -6T612 122T631 238H911L926 215Z" />
-<glyph unicode="&#x2022;" glyph-name="bullet" horiz-adv-x="770" d="M98 748Q98 834 120 894T180 992T271 1047T385 1065Q444 1065 496 1048T588 992T649 894T672 748Q672 663 650 603T588 505T497 448T385 430Q324 430 272 448T181 504T120 603T98 748Z" />
-<glyph unicode="&#x2039;" glyph-name="guilsinglleft" horiz-adv-x="692" d="M82 573L391 1028L610 909L393 561L610 213L391 94L82 547V573Z" />
-<glyph unicode="&#x203a;" glyph-name="guilsinglright" horiz-adv-x="692" d="M610 547L301 94L82 213L299 561L82 909L301 1028L610 573V547Z" />
-</font>
-</defs>
-</svg>

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/swagger-ui/fonts/droid-sans-v6-latin-700.ttf
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/swagger-ui/fonts/droid-sans-v6-latin-700.ttf b/brooklyn-ui/src/main/webapp/assets/swagger-ui/fonts/droid-sans-v6-latin-700.ttf
deleted file mode 100644
index 15896c4..0000000
Binary files a/brooklyn-ui/src/main/webapp/assets/swagger-ui/fonts/droid-sans-v6-latin-700.ttf and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/swagger-ui/fonts/droid-sans-v6-latin-700.woff
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/swagger-ui/fonts/droid-sans-v6-latin-700.woff b/brooklyn-ui/src/main/webapp/assets/swagger-ui/fonts/droid-sans-v6-latin-700.woff
deleted file mode 100644
index 67e3e25..0000000
Binary files a/brooklyn-ui/src/main/webapp/assets/swagger-ui/fonts/droid-sans-v6-latin-700.woff and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/swagger-ui/fonts/droid-sans-v6-latin-700.woff2
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/swagger-ui/fonts/droid-sans-v6-latin-700.woff2 b/brooklyn-ui/src/main/webapp/assets/swagger-ui/fonts/droid-sans-v6-latin-700.woff2
deleted file mode 100644
index 1e726a7..0000000
Binary files a/brooklyn-ui/src/main/webapp/assets/swagger-ui/fonts/droid-sans-v6-latin-700.woff2 and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/swagger-ui/fonts/droid-sans-v6-latin-regular.eot
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/swagger-ui/fonts/droid-sans-v6-latin-regular.eot b/brooklyn-ui/src/main/webapp/assets/swagger-ui/fonts/droid-sans-v6-latin-regular.eot
deleted file mode 100644
index ac2698e..0000000
Binary files a/brooklyn-ui/src/main/webapp/assets/swagger-ui/fonts/droid-sans-v6-latin-regular.eot and /dev/null differ


[22/51] [abbrv] [partial] brooklyn-ui git commit: move subdir from incubator up a level as it is promoted to its own repo (first non-incubator commit!)

Posted by he...@apache.org.
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/tpl/apps/change-name-modal.html
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/tpl/apps/change-name-modal.html b/brooklyn-ui/src/main/webapp/assets/tpl/apps/change-name-modal.html
deleted file mode 100644
index 49cec81..0000000
--- a/brooklyn-ui/src/main/webapp/assets/tpl/apps/change-name-modal.html
+++ /dev/null
@@ -1,29 +0,0 @@
-
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-    <h4 style="margin-bottom: 9px;">New Name</h4>
-    <p>Change the display name of an entity</p>
-
-    <input type="text" id="new-name" style="width: 100%;" value="<%= name %>"></input>
-
-    <div class="hide alert alert-error change-name-error-container" style="margin-top: 9px;">
-        <strong>Error</strong>
-        <span class="change-name-error-message"></span>
-    </div>

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/tpl/apps/config-name.html
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/tpl/apps/config-name.html b/brooklyn-ui/src/main/webapp/assets/tpl/apps/config-name.html
deleted file mode 100644
index 2c44974..0000000
--- a/brooklyn-ui/src/main/webapp/assets/tpl/apps/config-name.html
+++ /dev/null
@@ -1,34 +0,0 @@
-
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<% if (description || type) { %>
-<span class="config-name" rel="tooltip" data-placement="left"
-    title="<% 
-         if (description) { %><b><%- description %></b><br/><% } 
-         if (type) { %>(<% 
-           if (type.startsWith("java.lang.") || type.startsWith("java.util.")) type = type.substring(10);
-         %><%- type %>)<% } %>">
-    <%- name %>
-</span>
-<% } else { %>
-<span class="config-name">
-    <%- name %>
-</span>
-<% } %>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/tpl/apps/config.html
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/tpl/apps/config.html b/brooklyn-ui/src/main/webapp/assets/tpl/apps/config.html
deleted file mode 100644
index 82ca6c6..0000000
--- a/brooklyn-ui/src/main/webapp/assets/tpl/apps/config.html
+++ /dev/null
@@ -1,33 +0,0 @@
-
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<div class="table-scroll-wrapper" style="overflow: visible;">
-<table id="config-table" width="100%">
-    <thead>
-    <tr>
-        <th>ID</th>
-        <th>Name</th>
-        <th>Value</th>
-    </tr>
-    </thead>
-    <tbody></tbody>
-</table>
-<div style="height: 30px;"></div>
-</div>

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/tpl/apps/details.html
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/tpl/apps/details.html b/brooklyn-ui/src/main/webapp/assets/tpl/apps/details.html
deleted file mode 100644
index 549f7e8..0000000
--- a/brooklyn-ui/src/main/webapp/assets/tpl/apps/details.html
+++ /dev/null
@@ -1,38 +0,0 @@
-
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<div class="tabbable">
-    <ul class="nav nav-tabs entity-tabs">
-        <li><a data-target="#summary" data-toggle="tab">Summary</a></li>
-        <li><a data-target="#sensors" data-toggle="tab">Sensors</a></li>
-        <li><a data-target="#effectors" data-toggle="tab">Effectors</a></li>
-        <li><a data-target="#policies" data-toggle="tab">Policies</a></li>
-        <li><a data-target="#activities" data-toggle="tab">Activity</a></li>
-        <li><a data-target="#advanced" data-toggle="tab">Advanced</a></li>
-    </ul>
-    <div class="tab-content">
-        <div class="tab-pane" id="summary"><i>Nothing selected</i></div>
-        <div class="tab-pane" id="sensors"><i>Nothing selected</i></div>
-        <div class="tab-pane" id="effectors"><i>Nothing selected</i></div>
-        <div class="tab-pane" id="policies"><i>Nothing selected</i></div>
-        <div class="tab-pane" id="activities"><i>Nothing selected</i></div>
-        <div class="tab-pane" id="advanced"><i>Nothing selected</i></div>
-    </div>
-</div>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/tpl/apps/effector-modal.html
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/tpl/apps/effector-modal.html b/brooklyn-ui/src/main/webapp/assets/tpl/apps/effector-modal.html
deleted file mode 100644
index 97aafc7..0000000
--- a/brooklyn-ui/src/main/webapp/assets/tpl/apps/effector-modal.html
+++ /dev/null
@@ -1,37 +0,0 @@
-
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<!-- modal to render effector-->
-
-<div class="modal-header">
-    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
-    <h3><%= entityName %> <%= name %></h3>
-
-    <p><%= description %></p>
-</div>
-
-<div class="modal-body">
-    <p><i>No arguments required</i></p>
-</div>
-
-<div class="modal-footer">
-    <button type="button" class="btn btn-info btn-mini" data-dismiss="modal">Cancel</button>
-    <button type="button" class="btn btn-danger btn-mini invoke-effector">Invoke</button>
-</div>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/tpl/apps/effector-row.html
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/tpl/apps/effector-row.html b/brooklyn-ui/src/main/webapp/assets/tpl/apps/effector-row.html
deleted file mode 100644
index c6b1a7c..0000000
--- a/brooklyn-ui/src/main/webapp/assets/tpl/apps/effector-row.html
+++ /dev/null
@@ -1,27 +0,0 @@
-
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<tr>
-    <td class="effector-name"><%= name %></td>
-    <td><%= description %></td>
-    <td class="effector-action">
-        <button class="btn btn-info btn-mini show-effector-modal" id="<%=cid%>">Invoke</button>
-    </td>
-</tr>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/tpl/apps/effector.html
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/tpl/apps/effector.html b/brooklyn-ui/src/main/webapp/assets/tpl/apps/effector.html
deleted file mode 100644
index d1a0aee..0000000
--- a/brooklyn-ui/src/main/webapp/assets/tpl/apps/effector.html
+++ /dev/null
@@ -1,34 +0,0 @@
-
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<table id="effectors-table" class="table table-striped table-condensed nonDatatables" style="width: 100%;">
-    <thead>
-    <tr>
-        <th>Name</th>
-        <th>Description</th>
-        <th>Action</th>
-    </tr>
-    </thead>
-    <tbody></tbody>
-</table>
-<div class="has-no-effectors for-empty-table hide">
-    <i>No effectors available on this entity</i>
-</div>
-<div id="effector-modal" class="modal hide fade"></div>

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/tpl/apps/entity-not-found.html
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/tpl/apps/entity-not-found.html b/brooklyn-ui/src/main/webapp/assets/tpl/apps/entity-not-found.html
deleted file mode 100644
index 9c705ed..0000000
--- a/brooklyn-ui/src/main/webapp/assets/tpl/apps/entity-not-found.html
+++ /dev/null
@@ -1,24 +0,0 @@
-
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<div class="padded-div">
-    <p>Failed to load entity <strong><%= id %></strong>. Does it exist?</p>
-    <p>Try <a class="handy application-tree-refresh">reloading the applications list</a> or refreshing the page.</p>
-</div>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/tpl/apps/page.html
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/tpl/apps/page.html b/brooklyn-ui/src/main/webapp/assets/tpl/apps/page.html
deleted file mode 100644
index dbe89ec..0000000
--- a/brooklyn-ui/src/main/webapp/assets/tpl/apps/page.html
+++ /dev/null
@@ -1,38 +0,0 @@
-
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<div class="row row-fluid">
-    <div class="span4" id="tree">
-        <div class="navbar_top">
-            <h3>Applications</h3>
-            <div class="apps-tree-toolbar">
-                <i id="add-new-application" class="icon-br-plus-sign handy" />
-                &nbsp;
-                <i class="icon-br-refresh application-tree-refresh handy" />
-            </div>
-        </div>
-        <div id="app-tree"></div>
-    </div>
-
-    <div class="span8" id="details"></div>
-</div>
-<div class="add-app">
-    <div id="modal-container"></div>
-</div>

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/tpl/apps/param-list.html
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/tpl/apps/param-list.html b/brooklyn-ui/src/main/webapp/assets/tpl/apps/param-list.html
deleted file mode 100644
index 177e1c3..0000000
--- a/brooklyn-ui/src/main/webapp/assets/tpl/apps/param-list.html
+++ /dev/null
@@ -1,30 +0,0 @@
-
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<!-- effector param list template -->
-<table id="params" class="table table-striped table-condensed">
-    <thead>
-    <tr>
-        <th>Name</th>
-        <th>Value</th>
-    </tr>
-    </thead>
-    <tbody></tbody>
-</table>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/tpl/apps/param.html
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/tpl/apps/param.html b/brooklyn-ui/src/main/webapp/assets/tpl/apps/param.html
deleted file mode 100644
index b292012..0000000
--- a/brooklyn-ui/src/main/webapp/assets/tpl/apps/param.html
+++ /dev/null
@@ -1,42 +0,0 @@
-
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<!--effector param template -->
-<tr class="effector-param" rel="tooltip" title="<%= description %></b><br><br><%= type %>" data-placement="left">
-    <td class="param-name"><%= name %></td>
-    <!-- TODO: for now this just looks at the name of the parameter which is poor (and @Beta !). 
-    Better will be to use a strongly-typed LocationCollection or (significantly better) supply a generic 
-    server-side mechanism for populating options in some situations. -->
-    <% if (name == 'locations' || name == 'location') { %>
-    <td><div id="selector-container" class="input-medium param-value"></div></td>
-    <% } else if (type == 'java.lang.Boolean') { %>
-    <td>
-        <% if (defaultValue) { %>
-        <input type="checkbox" class="param-value" checked>
-        <% } else { %>
-        <input type="checkbox" class="param-value">
-        <% } %>
-    </td>
-    <% } else { %>
-    <td><!--  use 1 line textarea so it can be resized -->
-      <textarea class="input-medium param-value"><%- defaultValue %></textarea>
-    </td>
-    <% } %>    
-</tr>

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/tpl/apps/policy-config-row.html
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/tpl/apps/policy-config-row.html b/brooklyn-ui/src/main/webapp/assets/tpl/apps/policy-config-row.html
deleted file mode 100644
index cb2cdce..0000000
--- a/brooklyn-ui/src/main/webapp/assets/tpl/apps/policy-config-row.html
+++ /dev/null
@@ -1,31 +0,0 @@
-
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<tr class="policy-config-row">
-    <td class="policy-config-name"><span
-        rel="tooltip" title="<b><%= description %></b><br/>(<%= type %>)" data-placement="left"
-        ><%= name %></span></td>
-    <td class="policy-config-value"><%= value %></td>
-    <td class="policy-config-action">
-        <% if (reconfigurable) { %>
-        <button class="btn btn-info btn-mini show-policy-config-modal" id="<%= cid %>">Edit</button>
-        <% } %> 
-    </td>
-</tr>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/tpl/apps/policy-new.html
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/tpl/apps/policy-new.html b/brooklyn-ui/src/main/webapp/assets/tpl/apps/policy-new.html
deleted file mode 100644
index 49116d2..0000000
--- a/brooklyn-ui/src/main/webapp/assets/tpl/apps/policy-new.html
+++ /dev/null
@@ -1,37 +0,0 @@
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-<form style="margin-bottom: 0;">
-    <h4 style="margin-bottom: 9px;">Policy Type</h4>
-    <input id="policy-add-type" class="input-xlarge" type="text" name="policy-type" placeholder="Type"/>
-    <p>Enter the full type of the policy</p>
-
-    <h4 style="margin-bottom: 9px; margin-top: 5px">Config Keys</h4>
-    <div class="policy-add-config-keys"></div>
-    <p>
-        Enter the full name of the config key and its value. Values will be coerced to the
-        appropriate type automatically. Blank keys and values will cause the property
-        to be ignored. Last key wins if any key is duplicated.
-    </p>
-
-    <div class="hide alert alert-error policy-add-error-container" style="margin-top: 9px;">
-        <strong>Error</strong>
-        <span class="policy-add-error-message"></span>
-    </div>
-
-</form>

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/tpl/apps/policy-parameter-config.html
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/tpl/apps/policy-parameter-config.html b/brooklyn-ui/src/main/webapp/assets/tpl/apps/policy-parameter-config.html
deleted file mode 100644
index fa52331..0000000
--- a/brooklyn-ui/src/main/webapp/assets/tpl/apps/policy-parameter-config.html
+++ /dev/null
@@ -1,30 +0,0 @@
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-<p>
-    <strong>Update the value for <%= name %></strong>
-</p>
-<p>
-    <%= description %>
-</p>
-<input id="policy-config-value" type="text" class="input-xlarge" name="value" value="<%= value %>" autofocus />
-
-<div class="hide alert alert-error policy-add-error-container" style="margin-top: 9px; margin-bottom: 0;">
-    <strong>Error</strong>
-    <span class="policy-add-error-message"></span>
-</div>

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/tpl/apps/policy-row.html
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/tpl/apps/policy-row.html b/brooklyn-ui/src/main/webapp/assets/tpl/apps/policy-row.html
deleted file mode 100644
index 0799ac0..0000000
--- a/brooklyn-ui/src/main/webapp/assets/tpl/apps/policy-row.html
+++ /dev/null
@@ -1,32 +0,0 @@
-
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<tr class="policy-row" id="<%= cid %>">
-    <td class="policy-name"><%= name %></td>
-    <td><%= state %></td>
-    <td class="policy-action">
-        <% if (state == "RUNNING") { %>
-        <button class="btn btn-info btn-mini policy-stop" link="<%= summary.getLinkByName('stop') %>">Suspend</button>
-        <% } else if (state == "STOPPED") { %>
-        <button class="btn btn-info btn-mini policy-start" link="<%= summary.getLinkByName('start') %>">Resume</button>
-        <button class="btn btn-info btn-mini policy-destroy" link="<%= summary.getLinkByName('destroy') %>">Destroy</button>
-        <% } %> 
-    </td>
-</tr>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/tpl/apps/policy.html
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/tpl/apps/policy.html b/brooklyn-ui/src/main/webapp/assets/tpl/apps/policy.html
deleted file mode 100644
index 33748b5..0000000
--- a/brooklyn-ui/src/main/webapp/assets/tpl/apps/policy.html
+++ /dev/null
@@ -1,57 +0,0 @@
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<table id="policies-table" class="table table-striped table-condensed nonDatatables">
-    <thead>
-    <tr>
-        <th width="50%">Name</th>
-        <th width="25%">State</th>
-        <th width="25%">Action</th>
-    </tr>
-    </thead>
-    <tbody></tbody>
-</table>
-
-<div class="has-no-policies for-empty-table hide">
-    <i>No policies are attached to this entity</i>
-</div>
-
-<div id="policy-config" class="hide">
-  <div class="table-scroll-wrapper">
-    <table id="policy-config-table" style="width: 554px;">
-        <thead>
-        <tr>
-            <th width="35%">Name</th>
-            <th width="55%">Value</th>
-            <th width="10%">Edit</th>
-        </tr>
-        </thead>
-        <tbody></tbody>
-    </table>
-    <div class="has-no-policy-config for-empty-table hide">
-        <i>No configuration is available on this policy</i>
-    </div>
-  </div>
-</div>
-
-<div id="policy-config-none-selected">
-    <i>Select a policy above to view or edit configuration.</i>
-</div>
-
-<button class="btn add-new-policy pull-right">Attach New Policy</button>

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/tpl/apps/sensor-name.html
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/tpl/apps/sensor-name.html b/brooklyn-ui/src/main/webapp/assets/tpl/apps/sensor-name.html
deleted file mode 100644
index 619aa32..0000000
--- a/brooklyn-ui/src/main/webapp/assets/tpl/apps/sensor-name.html
+++ /dev/null
@@ -1,34 +0,0 @@
-
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<% if (description || type) { %>
-<span class="sensor-name" rel="tooltip" data-placement="left"
-    title="<% 
-         if (description) { %><b><%- description %></b><br/><% } 
-         if (type) { %>(<% 
-           if (type.startsWith("java.lang.") || type.startsWith("java.util.")) type = type.substring(10);
-         %><%- type %>)<% } %>">
-    <%- name %>
-</span>
-<% } else { %>
-<span class="sensor-name">
-    <%- name %>
-</span>
-<% } %>

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/tpl/apps/sensors.html
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/tpl/apps/sensors.html b/brooklyn-ui/src/main/webapp/assets/tpl/apps/sensors.html
deleted file mode 100644
index cf992c4..0000000
--- a/brooklyn-ui/src/main/webapp/assets/tpl/apps/sensors.html
+++ /dev/null
@@ -1,33 +0,0 @@
-
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<div class="table-scroll-wrapper" style="overflow: visible;">
-<table id="sensors-table" width="100%">
-    <thead>
-    <tr>
-        <th>ID</th>
-        <th>Name</th>
-        <th>Value</th>
-    </tr>
-    </thead>
-    <tbody></tbody>
-</table>
-<div style="height: 30px;"></div>
-</div>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/tpl/apps/summary.html
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/tpl/apps/summary.html b/brooklyn-ui/src/main/webapp/assets/tpl/apps/summary.html
deleted file mode 100644
index ed90c75..0000000
--- a/brooklyn-ui/src/main/webapp/assets/tpl/apps/summary.html
+++ /dev/null
@@ -1,107 +0,0 @@
-
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<div class="app-summary">
-
- <div id="title-and-info-row" style="white-space: nowrap;">
-  <% if (entity.getLinkByName('iconUrl')) { %>
-  <div style="display: inline-block; vertical-align: bottom; padding-top: 12px; padding-bottom: 18px;">
-    <img src="<%= entity.getLinkByName('iconUrl') %>"
-        style="max-width: 128px; max-height: 128px;"/>
-  </div>
-  <% } %>
-
-  <div style="display: inline-block; vertical-align: bottom;">
-  
-   <div class="name" style="margin-bottom: 12px; padding-right: 12px;">
-     <h2><%= entity.get('name') %></h2>
-   </div>
-
-  </div>
- </div>
-
- <div class="toggler-region">
-  <div class="toggler-header">
-    <div class="toggler-icon icon-chevron-down"></div>
-    <div><b>Status</b></div>
-  </div>
-  <div class="inforow" style="position: relative;">
-     
-    <div style="display: inline-block; padding-left: 8px; padding-right: 24px; padding-top: 6px;">
-        <div class="info-name-value status hide">
-            <div class="name">Status</div>
-            <div class="value"><i>Loading...</i></div>
-        </div>
-        <div class="info-name-value serviceUp hide">
-            <div class="name">Service Up</div>
-            <div class="value"><i>Loading...</i></div>
-        </div>
-        <div class="info-name-value url hide" style="margin-top: 12px;">
-            <div class="name">URL</div>
-            <div class="value"><i>Loading...</i></div>
-        </div>
-        
-        <div class="info-name-value type" style="margin-top: 12px;">
-            <div class="name">Type</div>
-            <div class="value"><%= entity.get('type') %></div>
-        </div>
-        <div class="info-name-value id">
-            <div class="name">ID</div>
-            <div class="value"><%= entity.get('id') %></div>
-        </div>
-        <div class="info-name-value catalogItemId hide">
-            <div class="name">Catalog Item</div>
-            <div class="value"><a href="#v1/catalog/<%= (isApp ? "applications" : "entities") %>/<%= entity.get('catalogItemId') %>"><%= entity.get('catalogItemId') %></a></div>
-        </div>
-
-        <div class="additional-info-on-problem hide" style="margin-top: 12px;">
-        </div>
-
-        <div id="status-icon" style="display: inline-block; padding-top: 12px; padding-bottom: 18px; padding-right: 8px; position: absolute; right: 0; top: 0;"></div>
-
-   </div>
-  </div>
- </div>
- 
- <div id="entity-spec-yaml-toggler" class="toggler-region region-config hide" style="margin-top: 18px;">
-    <div class="toggler-header user-hidden">
-      <div class="toggler-icon icon-chevron-left"></div>
-      <div><b>Blueprint</b></div>
-    </div>
-    <div id="entity-spec-yaml" class="for-textarea hide">
-      <textarea readonly="readonly" class="code-textarea"/>
-    </div>
- </div>
-
-  <div class="toggler-region region-config" style="margin-top: 18px;">
-    <div class="toggler-header user-hidden">
-      <div class="toggler-icon icon-chevron-left"></div>
-      <div><b>Config</b></div>
-    </div>
-    <div id="advanced-config" class="hide"/>
-  </div>
-
-  <!-- TODO would like to show more info here, nicely; e.g.
-         children, members (above? new section here ?)
-         active tasks (new section here)
-         locations / map (new section here ?)
-  -->
-
-</div>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/tpl/apps/tree-empty.html
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/tpl/apps/tree-empty.html b/brooklyn-ui/src/main/webapp/assets/tpl/apps/tree-empty.html
deleted file mode 100644
index 300ec8f..0000000
--- a/brooklyn-ui/src/main/webapp/assets/tpl/apps/tree-empty.html
+++ /dev/null
@@ -1,27 +0,0 @@
-
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<div class="navbar_main_wrapper">
-    <div class="navbar_main">
-        <div style="padding-left: 12px; padding-top: 12px; padding-bottom: 300px;">
-            <i>No applications</i>
-        </div>
-    </div>
-</div>

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/tpl/apps/tree-item.html
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/tpl/apps/tree-item.html b/brooklyn-ui/src/main/webapp/assets/tpl/apps/tree-item.html
deleted file mode 100644
index f13107a..0000000
--- a/brooklyn-ui/src/main/webapp/assets/tpl/apps/tree-item.html
+++ /dev/null
@@ -1,83 +0,0 @@
-
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<%
-    var isLoaded = (model ? true : false);
-    var isApp = (parentId ? false : true);
-
-    // Only emphasise applications at the top level, not as indirect references.
-    isApp &= !indirect;
-
-    if (!isLoaded) {
-%>
-        <i>Loading... (<%= id %>)</i>
-<%  } else {
-        var hasChildren = model.hasChildren() || model.hasMembers();
-        var iconUrl = model.get('iconUrl');
-
-        var entityIconSize = isApp ? 40 : 30;
-        var statusIconSize = isApp ? 24 : 16;
-
-        var chevronLeft = (isApp ? 5.5 : 1.5);
-        var minHeight = hasChildren && statusIconUrl ? entityIconSize : 24;
-        var statusColumnWidth = hasChildren || statusIconUrl || (!isApp && !iconUrl /* for children, insert space so things line up */) ? statusIconSize : 0;
-%>
-
-  <span class="entity_tree_node name entity" id="span-<%= id %>" 
-        data-entity-id="<%= id %>" data-entity-type="<%= model.get('type') %>" data-parent-id="<%= parentId %>" data-app-id="<%= model.get('applicationId') %>">
-    <a href="#v1/applications/<%= model.get('applicationId') %>/entities/<%= id %>">
-
-      <div style="min-width: <%= statusColumnWidth + (iconUrl ? entityIconSize : 6)%>px; min-height: <%= minHeight %>px; max-height: 40px; display: inline-block; margin-right: 4px; vertical-align: middle;">
-        <% if (statusIconUrl) { %>
-        <div style="position: absolute; left: 0px; margin: auto; top: <%= isApp && hasChildren ? 3 : 2 %>px;<% if (!hasChildren) { %> bottom: 0px;<% } %>">
-            <img src="<%= statusIconUrl %>" style="max-width: <%= statusIconSize %>px; max-height: <%= statusIconSize %>px; margin: auto; position: absolute; top: -1px;<% if (!hasChildren) { %> bottom: 0px;<% } %>">
-        </div>
-        <% } %>
-
-        <% if (hasChildren) { %>
-        <div style="position: absolute; left: <%= chevronLeft %>px; margin: auto; <%= statusIconUrl ? "bottom: -1px;" : isApp ? "top: 6px;" : "top: 6px;" %>">
-            <div class="toggler-icon icon-chevron-right tree-node-state tree-change">
-                <div class="light-popup">
-                    <div class="light-popup-body">
-                        <div class="light-popup-menu-item tree-change tr-toggle tr-default">Toggle Children</div>
-                        <div class="light-popup-menu-item tree-change tr-expand">Expand</div>
-                        <div class="light-popup-menu-item tree-change tr-expand-all">Expand All</div>
-                        <div class="light-popup-menu-item tree-change tr-collapse">Collapse</div>
-                        <div class="light-popup-menu-item tree-change tr-collapse-all">Collapse All</div>
-                    </div>
-                </div>
-            </div>
-        </div>
-        <% } %>
-
-        <% if (iconUrl) { %>
-            <img src="<%= iconUrl %>" style="max-width: <%= entityIconSize %>px; max-height: <%= entityIconSize %>px; position: absolute; padding-left: 5px; left: <%= statusColumnWidth %>px; top: 0; bottom: 0; margin: auto;">
-        <% } %>
-      </div>
-
-      <% if (indirect) { %>
-        <i class="indirection-icon icon-share-alt"></i>
-      <% } %>
-      <span style="max-height: 18px; padding-right: 6px; position: relative; margin: auto; top: 2px; bottom: 0;"><%= model.get('name') %></span>
-
-    </a>
-  </span>
-
-<% } %>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/tpl/catalog/add-catalog-entry.html
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/tpl/catalog/add-catalog-entry.html b/brooklyn-ui/src/main/webapp/assets/tpl/catalog/add-catalog-entry.html
deleted file mode 100644
index 238dd77..0000000
--- a/brooklyn-ui/src/main/webapp/assets/tpl/catalog/add-catalog-entry.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-<div class="catalog-details">
-
-    <h2>Add to Catalog</h2>
-    <br/>
-
-    <div data-toggle="buttons-radio">
-        <button class="btn btn-large show-context" data-context="yaml">YAML</button>
-        <button class="btn btn-large show-context" data-context="location">Location</button>
-    </div>
-
-    <hr/>
-
-    <div id="catalog-add-form">
-        <div class="context">Select the type you wish to add</div>
-    </div>
-</div>

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/tpl/catalog/add-location.html
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/tpl/catalog/add-location.html b/brooklyn-ui/src/main/webapp/assets/tpl/catalog/add-location.html
deleted file mode 100644
index 4748617..0000000
--- a/brooklyn-ui/src/main/webapp/assets/tpl/catalog/add-location.html
+++ /dev/null
@@ -1,36 +0,0 @@
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-<form>
-    <label for="name" class="control-label">Name</label>
-    <input id="name" name="name" type="text" placeholder="e.g. My Cloud Region #3" class="input-xlarge">
-
-    <label for="spec" class="control-label">Spec</label>
-    <input id="spec" name="spec" type="text" placeholder="e.g. jclouds:cloud:region" class="input-xlarge">
-
-    <h4>Configuration</h4>
-    <div id="new-location-config"></div>
-
-    <button class='catalog-submit-button btn' data-loading-text='Saving...'>Submit</button>
-
-    <p class="catalog-save-error hide">
-        <span class="alert-error">
-            <span class="catalog-error-message"><strong>Error</strong></span>
-        </span>
-    </p>
-</form>

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/tpl/catalog/add-yaml.html
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/tpl/catalog/add-yaml.html b/brooklyn-ui/src/main/webapp/assets/tpl/catalog/add-yaml.html
deleted file mode 100644
index bcd2d17..0000000
--- a/brooklyn-ui/src/main/webapp/assets/tpl/catalog/add-yaml.html
+++ /dev/null
@@ -1,29 +0,0 @@
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-<form>
-    <label for="new-blueprint">Enter blueprint:</label>
-    <textarea id='new-blueprint' name='yaml' rows='5' cols='15'></textarea>
-
-    <button class='catalog-submit-button btn' data-loading-text='Saving...'>Submit</button>
-    <p class="catalog-save-error hide">
-        <span class="alert-error">
-            <span class="catalog-error-message"><strong>Error</strong></span>
-        </span>
-    </p>
-</form>

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/tpl/catalog/details-entity.html
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/tpl/catalog/details-entity.html b/brooklyn-ui/src/main/webapp/assets/tpl/catalog/details-entity.html
deleted file mode 100644
index 2e43fe5..0000000
--- a/brooklyn-ui/src/main/webapp/assets/tpl/catalog/details-entity.html
+++ /dev/null
@@ -1,178 +0,0 @@
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<div class="catalog-details">
-
-    <div class="float-right">
-        <button data-name="<%= model.id %>" class="btn btn-danger delete">Delete</button>
-    </div>
-
-    <% if (model.get("name") != model.get("symbolicName")) { %>
-        <h2><%- model.get("name") %></h2>
-        <p><%- model.getVersionedAttr("symbolicName") %></p>
-    <% } else { %>
-        <h2><%- model.getVersionedAttr("symbolicName") %></h2>
-    <% } %>
-    <% if (model.get("description")) { %>
-        <p><%- model.get("description") %></p>
-    <% } %>
-
-    <div id="catalog-details-accordion" class="accordion">
-      <% if (model.get("planYaml")) { %>
-        <div class="accordion-group">
-            <div class="accordion-heading">
-                <a class="accordion-toggle" data-toggle="collapse" data-parent="#catalog-details-accordion" href="#collapseYaml">
-                    Plan
-                </a>
-            </div>
-            <div id="collapseYaml" class="accordion-body collapse">
-                <div class="accordion-inner">
-                    <textarea rows="15" readonly><%- model.get("planYaml") %></textarea>
-                </div>
-            </div>
-        </div>
-      <% } %>
-        <% if (viewName != "policies") { %>
-        <div class="accordion-group">
-            <div class="accordion-heading">
-                <a class="accordion-toggle" data-toggle="collapse" data-parent="#catalog-details-accordion" href="#collapseConfiguration">
-                    Configuration
-                </a>
-            </div>
-            <div id="collapseConfiguration" class="accordion-body collapse">
-                <div class="accordion-inner">
-                    <% if (model.error) { %>
-                    <p><i class="icon-exclamation-sign"></i> Could not load configuration</p>
-                    <% } else if (!model.get("config")) { %>
-                        <p>Loading...</p>
-                    <% } else if (_.isEmpty(model.get("config"))) { %>
-                        <p>No configuration</p>
-                    <% } else { %>
-                        <% var skip = [
-                            'name',
-                            'description',
-                            'label',
-                            'priority',
-                            'reconfigurable'
-                        ]; %>
-                        <% _.each(model.get("config"), function(object, index) { %>
-                        <div style="padding-bottom: 12px;">
-                        <p><strong><%- object.name %></strong>: <%- object.description %></p>
-                        <div style="margin-left: 24px;">
-                        <table class="table table-striped table-condensed nonDatatables">
-                            <tbody>
-                            <% _.each(object, function(value, key) { %>
-                            <% if (!_.contains(skip, key)) { %>
-                            <tr>
-                                <td><%- key %></td>
-                                <td><%- typeof value === "string" ? value : JSON.stringify(value) %></td>
-                            </tr>
-                            <% } %>
-                            <% }); %>
-                            </tbody>
-                        </table></div>
-                        </div>
-                        <% }); %>
-                    <% } %>
-                </div>
-            </div>
-        </div>
-        <div class="accordion-group">
-            <div class="accordion-heading">
-                <a class="accordion-toggle" data-toggle="collapse" data-parent="#catalog-details-accordion" href="#collapseSensors">
-                    Sensors
-                </a>
-            </div>
-            <div id="collapseSensors" class="accordion-body collapse">
-                <div class="accordion-inner">
-                    <% if (model.error) { %>
-                    <p><i class="icon-exclamation-sign"></i> Could not load sensors</p>
-                    <% } else if (!model.get("sensors")) { %>
-                        <p>Loading...</p>
-                    <% } else if (_.isEmpty(model.get("sensors"))) { %>
-                        <p>No sensors</p>
-                    <% } else { %>
-                        <table class="table table-striped table-condensed nonDatatables">
-                            <thead>
-                                <tr>
-                                    <th>Name</th>
-                                    <th>Type</th>
-                                    <th>Description</th>
-                                </tr>
-                            </thead>
-                            <tbody>
-                            <% _.each(model.get("sensors"), function(object, index) { %>
-                                <tr>
-                                    <td><%- object.name %></td>
-                                    <td><%- object.type %></td>
-                                    <td><%- object.description %></td>
-                                </tr>
-                            <% }); %>
-                            </tbody>
-                        </table>
-                    <% } %>
-                </div>
-            </div>
-        </div>
-        <div class="accordion-group">
-            <div class="accordion-heading">
-                <a class="accordion-toggle" data-toggle="collapse" data-parent="#catalog-details-accordion" href="#collapseEffectors">
-                    Effectors
-                </a>
-            </div>
-            <div id="collapseEffectors" class="accordion-body collapse">
-                <div class="accordion-inner">
-                <% if (model.error) { %>
-                    <p><i class="icon-exclamation-sign"></i> Could not load effectors</p>
-                <% } else if (!model.get("effectors")) { %>
-                    <p>Loading...</p>
-                <% } else if (_.isEmpty(model.get("effectors"))) { %>
-                    <p>No effectors</p>
-                <% } else { %>
-                    <% _.each(model.get("effectors"), function(object, index) { %>
-                        <div style="padding-bottom: 12px;">
-                        <p><strong><%- object.name %></strong>: <%- object.description %></p>
-                        <% if (!object.parameters || _.isEmpty(object.parameters)) { %>
-                            <p>No parameters</p>
-                        <% } else { %>
-                            <div style="margin-left: 24px;">
-                            <table class="table table-striped table-condensed nonDatatables">
-                                <tbody>
-                                    <% _.each(object.parameters, function(parameter, index) { %>
-                                        <% _.each(parameter, function(value, key) { %>
-                                        <tr>
-                                            <td><%- key %></td>
-                                            <td><%- value %></td>
-                                        </tr>
-                                        <% }); %>
-                                    <% }); %>
-                                </tbody>
-                            </table>
-                            </div>
-                        <% } %>
-                        </div>
-                    <% }); %>
-                <% } %>
-                </div>
-            </div>
-        </div>
-        <% } %>
-    </div>
-
-</div>

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/tpl/catalog/details-generic.html
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/tpl/catalog/details-generic.html b/brooklyn-ui/src/main/webapp/assets/tpl/catalog/details-generic.html
deleted file mode 100644
index 49a29a0..0000000
--- a/brooklyn-ui/src/main/webapp/assets/tpl/catalog/details-generic.html
+++ /dev/null
@@ -1,45 +0,0 @@
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<div class="catalog-details">
-
-    <div class="float-right">
-        <button data-name="<%= model.id %>" class="btn btn-danger delete">Delete</button>
-    </div>
-
-    <% if (model.get("name") !== undefined) { %>
-        <h2><%= model.get("name") %></h2>
-    <% } else if (model.get("type") !== undefined) { %>
-        <h2><%= model.get("type") %></h2>
-    <% } %>
-
-    <dl>
-        <% _.each(model.attributes, function(value, key) { %>
-            <% if (value) { %>
-                <dt><%= key %></dt>
-                <% if (_.isObject(value)) { %>
-                    <dd>Not shown: is a complex object</dd>
-                <% } else { %>
-                    <dd><%= value %></dd>
-                <% } %>
-            <% } %>
-        <% }) %>
-    </dl>
-
-</div>

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/tpl/catalog/details-location.html
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/tpl/catalog/details-location.html b/brooklyn-ui/src/main/webapp/assets/tpl/catalog/details-location.html
deleted file mode 100644
index 03dd596..0000000
--- a/brooklyn-ui/src/main/webapp/assets/tpl/catalog/details-location.html
+++ /dev/null
@@ -1,59 +0,0 @@
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<div class="catalog-details">
-
-    <h3><%- model.getIdentifierName() %></h3>
-
-    <div class="float-right">
-        <button data-name="<%= model.getIdentifierName() %>" class="btn btn-danger delete">Delete</button>
-    </div>
-
-    <br/>
-    <table>
-        <tr><td><strong>Display Name:</strong>&nbsp;&nbsp;</td><td><%- model.getPrettyName() || "" %></td></tr>
-        <tr><td><strong>Reference Name:</strong>&nbsp;&nbsp;</td><td><%- model.get("name") || "" %></td></tr>
-        <tr><td><strong>Internal ID:</strong>&nbsp;&nbsp;</td><td><%- model.get("id") || "" %></td></tr>
-        <tr><td><strong>Implementation Spec:</strong>&nbsp;&nbsp;</td><td><%- model.get("spec") || "" %></td></tr>
-    </table>
-    
-    <br/>
-    
-<% if (!model.get("config") || _.isEmpty(model.get("config"))) { %>
-    <!-- either no config or it comes from a yaml plan and config not yet available;
-         TODO need to use the /v1/catalog/location API not the /v1/locations/ API -->
-<% } else { %>
-
-    <table class="table table-striped table-condensed nonDatatables">
-        <thead><tr>
-            <th>Configuration Key</th>
-            <th>Value</th>
-        </tr></thead>
-        <tbody>
-        <% _.each(model.get("config"), function(value, key) { %>
-        <tr>
-            <td style="border-left:none; width:50%;"><%- key%></td>
-            <td><%- value%></td>
-        </tr>
-        <% }); %>
-        </tbody>
-    </table>
-<% } %>
-
-</div>

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/tpl/catalog/nav-entry.html
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/tpl/catalog/nav-entry.html b/brooklyn-ui/src/main/webapp/assets/tpl/catalog/nav-entry.html
deleted file mode 100644
index e739704..0000000
--- a/brooklyn-ui/src/main/webapp/assets/tpl/catalog/nav-entry.html
+++ /dev/null
@@ -1,19 +0,0 @@
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-<div data-cid="<%= cid %>" class="accordion-nav-row <%= extraClasses %> <%= isChild ? 'accordion-nav-child' : '' %>"><%- type %></div>

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/tpl/catalog/page.html
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/tpl/catalog/page.html b/brooklyn-ui/src/main/webapp/assets/tpl/catalog/page.html
deleted file mode 100644
index dc1b102..0000000
--- a/brooklyn-ui/src/main/webapp/assets/tpl/catalog/page.html
+++ /dev/null
@@ -1,37 +0,0 @@
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-<div id="catalog-resource">
-    <div class="row row-fluid">
-        <div class="span4" id="accord">
-            <div class="navbar_top">
-                <h3>Catalog</h3>
-                <div class="apps-tree-toolbar">
-                    <i id="add-new-thing" class="icon-br-plus-sign handy"></i>
-                    &nbsp;
-                    <i class="icon-br-refresh refresh handy"></i>
-                </div>
-            </div>
-            <div class="navbar_main_wrapper">
-                <div class="catalog-accordion-parent catalog-accordion-wrapper"></div>
-            </div>
-        </div>
-
-        <div class="span8" id="details"></div>
-    </div>
-</div>

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/tpl/help/page.html
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/tpl/help/page.html b/brooklyn-ui/src/main/webapp/assets/tpl/help/page.html
deleted file mode 100644
index c8e5c8a..0000000
--- a/brooklyn-ui/src/main/webapp/assets/tpl/help/page.html
+++ /dev/null
@@ -1,77 +0,0 @@
-
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<!-- Help page -->
-<div class="container container-fluid single-main-container brooklyn-help-page">
-<div id="help-page">
-    <div class="help-logo-right"><img width="450" src="/assets/img/bridge.png"/></div>
-    <h3>Brooklyn Help</h3>
-    
-    <p>This is the Brooklyn JavaScript web client for the REST API.<br/>
-    Brooklyn is an Apache-licensed open-source project for deployment and management.
-    </p>
-    
-    <p>You are currently using Brooklyn Version 0.9.0-SNAPSHOT.</p> <!-- BROOKLYN_VERSION -->
-    
-    <hr/>
-    Some useful references include:
-    <ul>
-        <li><a href="http://brooklyn.io">Brooklyn Project web page</a></li>
-        <li><a href="http://github.com/brooklyncentral/brooklyn">Code at Github</a></li>
-    </ul>
-    <p>
-    Note you can observe the REST requests made by the Javascript GUI 
-    through the developers console in many browsers.
-    <hr/>
-    Some miscellaneous Brooklyn control options are:
-    <ul>
-        <li><a href="/logout">Log out</a></li>
-        <li>Shutdown Brooklyn Server: <a href="javascript:postShutdown(true)">stop all apps</a> or <a href="javascript:postShutdown(false)">leave apps running</a></li>
-        <script type="text/javascript">
-        function postShutdown(stopAppsFirst) {
-          if (window.confirm("Really shutdown the Brooklyn server?")) {
-            $.ajax({
-                type:"POST",
-                url:"/v1/server/shutdown",
-                data: { stopAppsFirst: stopAppsFirst, shutdownTimeout: 0, requestTimeout: 0 },
-                success:function (data) {
-                    // unfaded if server restarted, in router.js ServerCautionOverlay
-                    $('#application-content').fadeTo(500,0.1);
-                },
-                error: function(data) {
-                    $('#application-content')
-                        .fadeTo(200,0.2)
-                        .delay(200).fadeTo(200,1)
-                        .delay(200).fadeTo(100,0.2)
-                        .delay(200).fadeTo(200,1)
-//                      .delay(200).fadeTo(100,0.2)
-//                      .delay(200).fadeTo(200,1)
-                    // TODO render the error better than poor-man's flashing
-                    
-                    console.error("ERROR shutting down")
-                    console.debug(data)
-                }})
-          }
-        }
-        </script>
-    </ul> 
-    (These are living here until a more appropriate home for them is built.)
-</div>
-</div>

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/tpl/home/app-entry.html
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/tpl/home/app-entry.html b/brooklyn-ui/src/main/webapp/assets/tpl/home/app-entry.html
deleted file mode 100644
index 13e7ab3..0000000
--- a/brooklyn-ui/src/main/webapp/assets/tpl/home/app-entry.html
+++ /dev/null
@@ -1,23 +0,0 @@
-
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<!-- Application entry template inside the main application page -->
-<td><a href="#<%= link && link[0]=='/' ? link.substring(1) : link %>"><%= name %></a></td>
-<td><%= status %></td>

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/tpl/home/applications.html
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/tpl/home/applications.html b/brooklyn-ui/src/main/webapp/assets/tpl/home/applications.html
deleted file mode 100644
index 3c38989..0000000
--- a/brooklyn-ui/src/main/webapp/assets/tpl/home/applications.html
+++ /dev/null
@@ -1,84 +0,0 @@
-
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<!-- Applications page template -->
-<div class="home-first-row container container-fluid">
-
-    <div class="row home-summaries-row"><!--  inserted by JS (templated by summaries.html)  --></div>
-
-</div>
-
-<div class="home-second-row"><div class="container container-fluid">
-
-    <div class="row home-widgets-row">
-            
-  <div class="map-container">
-    <div id="circles-map" class="circles-map">
-      <div id="circles-map-message" class="circles-map-message">(map loading)</div>
-    </div>
-  </div>
-
-  <div class="apps-summary-container">
-
-    <div id="applications">
-        <table class="table table-striped table-bordered table-condensed">
-            <thead>
-            <th>Application</th>
-            <th>Status</th>
-            </thead>
-            <tbody id="applications-table-body">
-            </tbody>
-        </table>
-    </div>
-
-    <div id="ha-summary"></div>
-
-    <dl class="dl-horizontal"></dl>
-    <div id="new-application-resource">
-        <button id="add-new-application" type="button" class="btn btn-info">
-            Add Application</button>
-    </div>
-    
-    <dl class="dl-horizontal"></dl>
-    <div id="reload-brooklyn-properties-resource">
-        <button id="reload-brooklyn-properties" type="button" class="btn btn-info">
-            Reload Properties</button>
-    </div>
-    <div id="reload-brooklyn-properties-indicator" class="throbber hide" style="float: right;">
-        <img src="/assets/images/throbber.gif"/>
-    </div>
-    
-    <dl class="dl-horizontal"></dl>
-    <div id="clear-ha-node-records-resource">
-        <button id="clear-ha-node-records" type="button" class="btn btn-info">
-            Clear HA Node Records</button>
-    </div>
-    <div id="clear-ha-node-records-indicator" class="throbber hide" style="float: right;">
-        <img src="/assets/images/throbber.gif"/>
-    </div>
-    
-  </div>
-  
-    </div>
-</div></div>
-
-<div class="add-app">
-    <div id="modal-container"></div>
-</div>

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/tpl/home/ha-summary.html
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/tpl/home/ha-summary.html b/brooklyn-ui/src/main/webapp/assets/tpl/home/ha-summary.html
deleted file mode 100644
index b109303..0000000
--- a/brooklyn-ui/src/main/webapp/assets/tpl/home/ha-summary.html
+++ /dev/null
@@ -1,32 +0,0 @@
-
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<table class="table table-striped table-bordered table-condensed">
-    <thead>
-    <tr>
-        <th>Server</th>
-        <th>Status</th>
-        <th>Last seen</th>
-    </tr>
-    </thead>
-    <tbody class="ha-summary-table-body">
-        <tr><td colspan="3"><i>Loading...</i></td></tr>
-    </tbody>
-</table>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/tpl/home/server-caution.html
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/tpl/home/server-caution.html b/brooklyn-ui/src/main/webapp/assets/tpl/home/server-caution.html
deleted file mode 100644
index 94bd622..0000000
--- a/brooklyn-ui/src/main/webapp/assets/tpl/home/server-caution.html
+++ /dev/null
@@ -1,106 +0,0 @@
-
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<div class="server-caution-overlay overlay-with-opacity"></div>
-<div class="server-caution-overlay">
-    <div class="overlay-content">
-        <h1 class="lead">Warning!</h1>
-
-<% if (!loaded) { %>
-        <p><strong>
-            Connecting to server...</strong></p>
-
-        <p>
-            No response from server (yet). 
-            Please check your network connection and the URL, or if you are on a slow connection simply be patient!
-            This dialog will disappear if and when the server responds.</p>
-        
-        <p><i>
-            If you understand the risks, that information may be unavailable and operations may fail, 
-            and wish to proceed regardless, click <a id="dismiss-standby-warning">here</a>.</i></p>
-
-<% } else if (shuttingDown) { %>
-        <p><strong>
-            Server shutting down...</strong></p>
-                    
-        <p>
-            The Brooklyn server is shutting down.
-            This dialog will disappear if and when the server is restarted at this address.
-            If in doubt, contact your system administrator.</p>
-        
-        <p><i>
-            If you understand the risks, that information may be unavailable and operations may fail, 
-            and wish to proceed regardless, click <a id="dismiss-standby-warning">here</a>.</i></p>
-
-<% } else if (!up) { %>
-            <div style="float: right; position: relative; top: -45px; height: 0; overflow: visible;">
-                <img src="/assets/img/icon-status-starting.gif" width="60"/></div>
-            
-        <p><strong>
-            Starting up...</strong></p>
-                    
-        <p>
-            The Brooklyn server is starting.
-            It is recommended to wait before proceeding.
-            This dialog will disappear when the server is ready.</p>
-        
-        <p><i>
-            If you understand the risks, that information may be incomplete and operations may fail, 
-            and wish to proceed regardless, click <a id="dismiss-standby-warning">here</a>.</i></p>
-
-<% } else if (healthy && !master) { %>
-        <p><strong>
-            This Brooklyn server is not the high availability master.</strong></p>
-        
-        <p>
-            It is recommended not to use this server directly.</p>
-            
-    <% if (masterUri) { %>
-        <p>Redirecting to the master server at <a href="<%= masterUri %>"><%= masterUri %></a> shortly.</p>
-    <% } else { %>
-        <p>The address of the master Brooklyn server is not currently known.</p>
-    <% } %>
-
-        <p><i>
-            If you understand the risks, that write operations will likely fail, 
-            and wish to proceed regardless, click <a id="dismiss-standby-warning">here</a>.</i></p>
-          
-<% } else { %>
-        <p><strong>
-            This Brooklyn server has errors.</strong></p>
-        
-        <p>
-            Please check with your system administrator.</p>
-
-    <% if (healthy) { /* this page should not be displayed in this case */ %>
-        <p>
-            The misconfiguration may be in Javascript as the server is reporting it is healthy.</p><% } %>
-        
-        <p><i>
-          If you would like to debug the server, click <a id="dismiss-standby-warning">here</a>
-          to dismiss this warning until you reload this page. 
-          (You should reload the page once you believe the errors are fixed
-          to confirm that this dialog does not return.)
-          </i></p>
-
-<% } %>
-
-    </div>
-</div>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/tpl/home/summaries.html
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/tpl/home/summaries.html b/brooklyn-ui/src/main/webapp/assets/tpl/home/summaries.html
deleted file mode 100644
index 8562513..0000000
--- a/brooklyn-ui/src/main/webapp/assets/tpl/home/summaries.html
+++ /dev/null
@@ -1,38 +0,0 @@
-
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-  <div class="roundedSummary"><div class="roundedSummaryText">
-    <span class="big" id="numApps"><%- apps.size() %></span> 
-        app<%- apps.size()==1 ? "" : "s" %> running<br/>
-    <!-- in <span class="big">3</span> locations<br/>
-        with <span class="big">8</span> machines  -->
-  </div></div>
-  <!-- 
-  <div class="roundedSummary"><div class="roundedSummaryText">
-    <span class="big">6</span> app and <span class="big">44</span> entity<br/>
-    templates available
-  </div></div>
-   -->
-  <div class="roundedSummary"><div class="roundedSummaryText">
-    <span class="big"><%- locations.size() %></span> location<%- locations.size()==1 ? "" : "s" %> configured<br/>
-    <!-- with <span class="big">14</span> active machines  -->
-  </div></div>
-
-  <button class="roundedSummary addApplication" type="button">add application</button>

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/tpl/labs/page.html
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/tpl/labs/page.html b/brooklyn-ui/src/main/webapp/assets/tpl/labs/page.html
deleted file mode 100644
index a0097b6..0000000
--- a/brooklyn-ui/src/main/webapp/assets/tpl/labs/page.html
+++ /dev/null
@@ -1,195 +0,0 @@
-
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<!-- labs page : this is not included in the menu, but by entering the url
-     http://localhost:8081/#/labs
-     this page will load, showing colours and doing other experiments -->
-<div class="container container-fluid single-main-container brooklyn-labs-page">
-<div id="labs-page">
-
-<!--  -->
-<!-- demo the colour themese we use -->
-
-<h1>Colours</h1><br/>
-
-<style media="screen" type="text/css">
-.swatch {
-    padding: 10px 10px 10px 5px;
-    margin: 10px 5px;
-    display: inline-block;
-    border: 2px solid #A0A0A0;
-}
-</style>
-
-<script>
-var swatch = function(bg, fg, bo) {
-    var bgR = bg ? bg : '#808080';
-    var fgR = fg ? fg : '#202020';
-    var boR = bo ? bo : '#A0A0A0';
-     $('#swatches').append('<div class="swatch" style="background-color: '+bgR+'; color: '+fgR+'; border: 2px solid '+boR+';">'
-    +'<div>'+(bg ? 'bg:'+bg : '&nbsp;')+'</div>'
-    +'<div>'+(fg ? 'fg:'+fg : '&nbsp;')+'</div>'
-    +'<div>'+(bo ? 'bo:'+bo : '&nbsp;')+'</div>'
-    +'</div>');
-}
-
-$(document).ready(function() {
-    // display standard color themese we use for easy reference
-    var colors = [
-           // border colors
-           //'#EEE', '#CCC', '#793',
-           // text colors
-           //'#F0F4E8'
-           // background colors
-           //'#A8B8B0', '#e0f0e0', '#e0e8e0', 
-           ];
-    
-    swatch('#492')
-    swatch('#58AA33')
-    swatch('#77AA3E')
-    swatch('#98B890')  // selected alt
-    swatch('#A8B8B0')  // paging numbers
-    swatch('#A8B8B0', null, '#CCC')
-    swatch('#A8B8B0', null, '#EEE')
-    swatch('#B8C8B0')  // selected
-    swatch('#d0d8d0') // app content
-    swatch('#D8E0D4') // opened row
-    swatch('#d8e4d0') // table body
-    swatch('#E0E4E0')  // table row hover, table header
-    swatch('#e8e8e8') // app content
-    swatch('#f0f4f0') // app content
-    swatch('#F9F9F9')  // table odd
-    swatch('#FFFFFF')  // table even
-    swatch('#261', '#F0F4E8', null)
-    swatch(null, '#182018') // tree node
-    swatch(null, '#382')    // links
-    swatch(null, '#65AA34') // hover for above
-    swatch(null, '#273')
-    swatch('#f9f9f9', null, '#d4d4d4')  // tabs
-    swatch('#f9f9f9', '#505050', '#a1cb8c')  // add app
-    swatch('#f9f9f9', '#58a82e', '#58a82e')  // add app hover
-
-
-
-    for (c in colors) {
-//        $('#swatches').append('<div class="swatch" style="background-color: '+colors[c]+';">'+colors[c]+'</div>');
-    }
-})
-</script>
-
-<div id="swatches">
-</div>
-
-
-<br/><br/>
-<h1>Icons</h1><br/>
-
-<div><b>Glyphs</b></div><br/>
-<img src="/assets/img/glyphicons-halflings.png"/>
-
-
-<br/><br/>
-<h1>Experimental Config</h1><br/>
-
-<br/><br/>
-<div><b>Refresh pages (globally in JS)</b></div><br/>
-
-<script>
-var updateGlobalRefreshDisplay = function() {
-    require(["brooklyn"], function(b) {
-        $('#globalRefresh').html(''+b.refresh)
-    })    
-}
-
-var toggleGlobalRefresh = function() {
-  require(["brooklyn"], function(b) {
-      b.toggleRefresh();
-      updateGlobalRefreshDisplay();
-  })    
-}
-
-$(document).ready(function() {
-    updateGlobalRefreshDisplay()
-})
-</script>
-
-Brooklyn Global Auto Refresh is: <b><span id="globalRefresh">?</span>
-<span onclick="javascript:toggleGlobalRefresh()"><i>[change]</i></span></b>
-<br/><span><i>(this setting controls whether things do auto refresh;
-disabling globally can be helpful when testing)</i></span>
-
-
-
-
-<br/><br/>
-<h1>Debug</h1><br/>
-
-
-<br/><br/>
-<div><b>Fade Practice</b></div><br/>
-
-<script>
-var fadeHello = function() {
-    require(["view/viewutils"], function(v) {
-        log('fading')
-        v.fadeToIndicateInitialLoad($('#hello'))
-    })    
-}
-var showHello = function() {
-    require(["view/viewutils"], function(v) {
-        log('unfading')
-        v.cancelFadeOnceLoaded($('#hello'))
-    })    
-}
-</script>
-<div id="hello">I'm a region which fades.</div>
-<div><span onclick="javascript:fadeHello()">fade</span>  <span onclick="javascript:showHello()">show</span></div>
-
-
-
-<br/><br/>
-<div><b>Ajax Practice</b></div><br/>
-
-        <script type="text/javascript">
-        function fetchSummat() {
-            log("fetching")
-            $.ajax({
-                type:"GET",
-                url:"/v1/applications/dI6fIDvw/entities/dI6fIDvw/sensors/service.state",
-                success:function (data) {
-                    log("fetch success - "+data)
-                    var a = data;
-                    log(typeof a)
-                    log(a)
-                },
-                error: function(data) {
-                    log("fetch fail")
-                }})
-        }
-        </script>
-
-<div>
-    <span onclick="javascript:fetchSummat()">fetch</span>
-</div>
-
-
-
-</div>
-</div>


[12/51] [abbrv] [partial] brooklyn-ui git commit: move subdir from incubator up a level as it is promoted to its own repo (first non-incubator commit!)

Posted by he...@apache.org.
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/js/libs/handlebars-1.0.rc.1.js
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/js/libs/handlebars-1.0.rc.1.js b/src/main/webapp/assets/js/libs/handlebars-1.0.rc.1.js
new file mode 100644
index 0000000..6f54cd7
--- /dev/null
+++ b/src/main/webapp/assets/js/libs/handlebars-1.0.rc.1.js
@@ -0,0 +1,1928 @@
+// NOTE FROM sjcorbett: There have been several new releases of handlebars.js, but 
+// Brooklyn's current version of swagger.js (md5sum 117c05807c33c73132a93edd715086d7)
+// will not work with anything greater than 1.0.rc.2.
+
+// Released under MIT license.  See https://github.com/wycats/handlebars.js .
+
+// ---- code below this line is unchanged by Brooklyn -----
+
+// lib/handlebars/base.js
+
+/*jshint eqnull:true*/
+this.Handlebars = {};
+
+(function(Handlebars) {
+
+Handlebars.VERSION = "1.0.rc.1";
+
+Handlebars.helpers  = {};
+Handlebars.partials = {};
+
+Handlebars.registerHelper = function(name, fn, inverse) {
+  if(inverse) { fn.not = inverse; }
+  this.helpers[name] = fn;
+};
+
+Handlebars.registerPartial = function(name, str) {
+  this.partials[name] = str;
+};
+
+Handlebars.registerHelper('helperMissing', function(arg) {
+  if(arguments.length === 2) {
+    return undefined;
+  } else {
+    throw new Error("Could not find property '" + arg + "'");
+  }
+});
+
+var toString = Object.prototype.toString, functionType = "[object Function]";
+
+Handlebars.registerHelper('blockHelperMissing', function(context, options) {
+  var inverse = options.inverse || function() {}, fn = options.fn;
+
+
+  var ret = "";
+  var type = toString.call(context);
+
+  if(type === functionType) { context = context.call(this); }
+
+  if(context === true) {
+    return fn(this);
+  } else if(context === false || context == null) {
+    return inverse(this);
+  } else if(type === "[object Array]") {
+    if(context.length > 0) {
+      return Handlebars.helpers.each(context, options);
+    } else {
+      return inverse(this);
+    }
+  } else {
+    return fn(context);
+  }
+});
+
+Handlebars.K = function() {};
+
+Handlebars.createFrame = Object.create || function(object) {
+  Handlebars.K.prototype = object;
+  var obj = new Handlebars.K();
+  Handlebars.K.prototype = null;
+  return obj;
+};
+
+Handlebars.registerHelper('each', function(context, options) {
+  var fn = options.fn, inverse = options.inverse;
+  var ret = "", data;
+
+  if (options.data) {
+    data = Handlebars.createFrame(options.data);
+  }
+
+  if(context && context.length > 0) {
+    for(var i=0, j=context.length; i<j; i++) {
+      if (data) { data.index = i; }
+      ret = ret + fn(context[i], { data: data });
+    }
+  } else {
+    ret = inverse(this);
+  }
+  return ret;
+});
+
+Handlebars.registerHelper('if', function(context, options) {
+  var type = toString.call(context);
+  if(type === functionType) { context = context.call(this); }
+
+  if(!context || Handlebars.Utils.isEmpty(context)) {
+    return options.inverse(this);
+  } else {
+    return options.fn(this);
+  }
+});
+
+Handlebars.registerHelper('unless', function(context, options) {
+  var fn = options.fn, inverse = options.inverse;
+  options.fn = inverse;
+  options.inverse = fn;
+
+  return Handlebars.helpers['if'].call(this, context, options);
+});
+
+Handlebars.registerHelper('with', function(context, options) {
+  return options.fn(context);
+});
+
+Handlebars.registerHelper('log', function(context) {
+  Handlebars.log(context);
+});
+
+}(this.Handlebars));
+;
+// lib/handlebars/compiler/parser.js
+/* Jison generated parser */
+var handlebars = (function(){
+var parser = {trace: function trace() { },
+yy: {},
+symbols_: {"error":2,"root":3,"program":4,"EOF":5,"statements":6,"simpleInverse":7,"statement":8,"openInverse":9,"closeBlock":10,"openBlock":11,"mustache":12,"partial":13,"CONTENT":14,"COMMENT":15,"OPEN_BLOCK":16,"inMustache":17,"CLOSE":18,"OPEN_INVERSE":19,"OPEN_ENDBLOCK":20,"path":21,"OPEN":22,"OPEN_UNESCAPED":23,"OPEN_PARTIAL":24,"params":25,"hash":26,"DATA":27,"param":28,"STRING":29,"INTEGER":30,"BOOLEAN":31,"hashSegments":32,"hashSegment":33,"ID":34,"EQUALS":35,"pathSegments":36,"SEP":37,"$accept":0,"$end":1},
+terminals_: {2:"error",5:"EOF",14:"CONTENT",15:"COMMENT",16:"OPEN_BLOCK",18:"CLOSE",19:"OPEN_INVERSE",20:"OPEN_ENDBLOCK",22:"OPEN",23:"OPEN_UNESCAPED",24:"OPEN_PARTIAL",27:"DATA",29:"STRING",30:"INTEGER",31:"BOOLEAN",34:"ID",35:"EQUALS",37:"SEP"},
+productions_: [0,[3,2],[4,3],[4,1],[4,0],[6,1],[6,2],[8,3],[8,3],[8,1],[8,1],[8,1],[8,1],[11,3],[9,3],[10,3],[12,3],[12,3],[13,3],[13,4],[7,2],[17,3],[17,2],[17,2],[17,1],[17,1],[25,2],[25,1],[28,1],[28,1],[28,1],[28,1],[28,1],[26,1],[32,2],[32,1],[33,3],[33,3],[33,3],[33,3],[33,3],[21,1],[36,3],[36,1]],
+performAction: function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$) {
+
+var $0 = $$.length - 1;
+switch (yystate) {
+case 1: return $$[$0-1]; 
+break;
+case 2: this.$ = new yy.ProgramNode($$[$0-2], $$[$0]); 
+break;
+case 3: this.$ = new yy.ProgramNode($$[$0]); 
+break;
+case 4: this.$ = new yy.ProgramNode([]); 
+break;
+case 5: this.$ = [$$[$0]]; 
+break;
+case 6: $$[$0-1].push($$[$0]); this.$ = $$[$0-1]; 
+break;
+case 7: this.$ = new yy.BlockNode($$[$0-2], $$[$0-1].inverse, $$[$0-1], $$[$0]); 
+break;
+case 8: this.$ = new yy.BlockNode($$[$0-2], $$[$0-1], $$[$0-1].inverse, $$[$0]); 
+break;
+case 9: this.$ = $$[$0]; 
+break;
+case 10: this.$ = $$[$0]; 
+break;
+case 11: this.$ = new yy.ContentNode($$[$0]); 
+break;
+case 12: this.$ = new yy.CommentNode($$[$0]); 
+break;
+case 13: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1]); 
+break;
+case 14: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1]); 
+break;
+case 15: this.$ = $$[$0-1]; 
+break;
+case 16: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1]); 
+break;
+case 17: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1], true); 
+break;
+case 18: this.$ = new yy.PartialNode($$[$0-1]); 
+break;
+case 19: this.$ = new yy.PartialNode($$[$0-2], $$[$0-1]); 
+break;
+case 20: 
+break;
+case 21: this.$ = [[$$[$0-2]].concat($$[$0-1]), $$[$0]]; 
+break;
+case 22: this.$ = [[$$[$0-1]].concat($$[$0]), null]; 
+break;
+case 23: this.$ = [[$$[$0-1]], $$[$0]]; 
+break;
+case 24: this.$ = [[$$[$0]], null]; 
+break;
+case 25: this.$ = [[new yy.DataNode($$[$0])], null]; 
+break;
+case 26: $$[$0-1].push($$[$0]); this.$ = $$[$0-1]; 
+break;
+case 27: this.$ = [$$[$0]]; 
+break;
+case 28: this.$ = $$[$0]; 
+break;
+case 29: this.$ = new yy.StringNode($$[$0]); 
+break;
+case 30: this.$ = new yy.IntegerNode($$[$0]); 
+break;
+case 31: this.$ = new yy.BooleanNode($$[$0]); 
+break;
+case 32: this.$ = new yy.DataNode($$[$0]); 
+break;
+case 33: this.$ = new yy.HashNode($$[$0]); 
+break;
+case 34: $$[$0-1].push($$[$0]); this.$ = $$[$0-1]; 
+break;
+case 35: this.$ = [$$[$0]]; 
+break;
+case 36: this.$ = [$$[$0-2], $$[$0]]; 
+break;
+case 37: this.$ = [$$[$0-2], new yy.StringNode($$[$0])]; 
+break;
+case 38: this.$ = [$$[$0-2], new yy.IntegerNode($$[$0])]; 
+break;
+case 39: this.$ = [$$[$0-2], new yy.BooleanNode($$[$0])]; 
+break;
+case 40: this.$ = [$$[$0-2], new yy.DataNode($$[$0])]; 
+break;
+case 41: this.$ = new yy.IdNode($$[$0]); 
+break;
+case 42: $$[$0-2].push($$[$0]); this.$ = $$[$0-2]; 
+break;
+case 43: this.$ = [$$[$0]]; 
+break;
+}
+},
+table: [{3:1,4:2,5:[2,4],6:3,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],22:[1,13],23:[1,14],24:[1,15]},{1:[3]},{5:[1,16]},{5:[2,3],7:17,8:18,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,19],20:[2,3],22:[1,13],23:[1,14],24:[1,15]},{5:[2,5],14:[2,5],15:[2,5],16:[2,5],19:[2,5],20:[2,5],22:[2,5],23:[2,5],24:[2,5]},{4:20,6:3,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,4],22:[1,13],23:[1,14],24:[1,15]},{4:21,6:3,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,4],22:[1,13],23:[1,14],24:[1,15]},{5:[2,9],14:[2,9],15:[2,9],16:[2,9],19:[2,9],20:[2,9],22:[2,9],23:[2,9],24:[2,9]},{5:[2,10],14:[2,10],15:[2,10],16:[2,10],19:[2,10],20:[2,10],22:[2,10],23:[2,10],24:[2,10]},{5:[2,11],14:[2,11],15:[2,11],16:[2,11],19:[2,11],20:[2,11],22:[2,11],23:[2,11],24:[2,11]},{5:[2,12],14:[2,12],15:[2,12],16:[2,12],19:[2,12],20:[2,12],22:[2,12],23:[2,12],24:[2,12]},{17:22,21:23,27:[1,24],34:[1,26],36:25},{17:27,21:23,27:[1,24],34:[1,26],36:25
 },{17:28,21:23,27:[1,24],34:[1,26],36:25},{17:29,21:23,27:[1,24],34:[1,26],36:25},{21:30,34:[1,26],36:25},{1:[2,1]},{6:31,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],22:[1,13],23:[1,14],24:[1,15]},{5:[2,6],14:[2,6],15:[2,6],16:[2,6],19:[2,6],20:[2,6],22:[2,6],23:[2,6],24:[2,6]},{17:22,18:[1,32],21:23,27:[1,24],34:[1,26],36:25},{10:33,20:[1,34]},{10:35,20:[1,34]},{18:[1,36]},{18:[2,24],21:41,25:37,26:38,27:[1,45],28:39,29:[1,42],30:[1,43],31:[1,44],32:40,33:46,34:[1,47],36:25},{18:[2,25]},{18:[2,41],27:[2,41],29:[2,41],30:[2,41],31:[2,41],34:[2,41],37:[1,48]},{18:[2,43],27:[2,43],29:[2,43],30:[2,43],31:[2,43],34:[2,43],37:[2,43]},{18:[1,49]},{18:[1,50]},{18:[1,51]},{18:[1,52],21:53,34:[1,26],36:25},{5:[2,2],8:18,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,2],22:[1,13],23:[1,14],24:[1,15]},{14:[2,20],15:[2,20],16:[2,20],19:[2,20],22:[2,20],23:[2,20],24:[2,20]},{5:[2,7],14:[2,7],15:[2,7],16:[2,7],19:[2,7],20:[2,7],22:[2,7],23:[2,7],24:[2,7]},{21:54
 ,34:[1,26],36:25},{5:[2,8],14:[2,8],15:[2,8],16:[2,8],19:[2,8],20:[2,8],22:[2,8],23:[2,8],24:[2,8]},{14:[2,14],15:[2,14],16:[2,14],19:[2,14],20:[2,14],22:[2,14],23:[2,14],24:[2,14]},{18:[2,22],21:41,26:55,27:[1,45],28:56,29:[1,42],30:[1,43],31:[1,44],32:40,33:46,34:[1,47],36:25},{18:[2,23]},{18:[2,27],27:[2,27],29:[2,27],30:[2,27],31:[2,27],34:[2,27]},{18:[2,33],33:57,34:[1,58]},{18:[2,28],27:[2,28],29:[2,28],30:[2,28],31:[2,28],34:[2,28]},{18:[2,29],27:[2,29],29:[2,29],30:[2,29],31:[2,29],34:[2,29]},{18:[2,30],27:[2,30],29:[2,30],30:[2,30],31:[2,30],34:[2,30]},{18:[2,31],27:[2,31],29:[2,31],30:[2,31],31:[2,31],34:[2,31]},{18:[2,32],27:[2,32],29:[2,32],30:[2,32],31:[2,32],34:[2,32]},{18:[2,35],34:[2,35]},{18:[2,43],27:[2,43],29:[2,43],30:[2,43],31:[2,43],34:[2,43],35:[1,59],37:[2,43]},{34:[1,60]},{14:[2,13],15:[2,13],16:[2,13],19:[2,13],20:[2,13],22:[2,13],23:[2,13],24:[2,13]},{5:[2,16],14:[2,16],15:[2,16],16:[2,16],19:[2,16],20:[2,16],22:[2,16],23:[2,16],24:[2,16]},{5:[2,17],14:[2,
 17],15:[2,17],16:[2,17],19:[2,17],20:[2,17],22:[2,17],23:[2,17],24:[2,17]},{5:[2,18],14:[2,18],15:[2,18],16:[2,18],19:[2,18],20:[2,18],22:[2,18],23:[2,18],24:[2,18]},{18:[1,61]},{18:[1,62]},{18:[2,21]},{18:[2,26],27:[2,26],29:[2,26],30:[2,26],31:[2,26],34:[2,26]},{18:[2,34],34:[2,34]},{35:[1,59]},{21:63,27:[1,67],29:[1,64],30:[1,65],31:[1,66],34:[1,26],36:25},{18:[2,42],27:[2,42],29:[2,42],30:[2,42],31:[2,42],34:[2,42],37:[2,42]},{5:[2,19],14:[2,19],15:[2,19],16:[2,19],19:[2,19],20:[2,19],22:[2,19],23:[2,19],24:[2,19]},{5:[2,15],14:[2,15],15:[2,15],16:[2,15],19:[2,15],20:[2,15],22:[2,15],23:[2,15],24:[2,15]},{18:[2,36],34:[2,36]},{18:[2,37],34:[2,37]},{18:[2,38],34:[2,38]},{18:[2,39],34:[2,39]},{18:[2,40],34:[2,40]}],
+defaultActions: {16:[2,1],24:[2,25],38:[2,23],55:[2,21]},
+parseError: function parseError(str, hash) {
+    throw new Error(str);
+},
+parse: function parse(input) {
+    var self = this, stack = [0], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
+    this.lexer.setInput(input);
+    this.lexer.yy = this.yy;
+    this.yy.lexer = this.lexer;
+    this.yy.parser = this;
+    if (typeof this.lexer.yylloc == "undefined")
+        this.lexer.yylloc = {};
+    var yyloc = this.lexer.yylloc;
+    lstack.push(yyloc);
+    var ranges = this.lexer.options && this.lexer.options.ranges;
+    if (typeof this.yy.parseError === "function")
+        this.parseError = this.yy.parseError;
+    function popStack(n) {
+        stack.length = stack.length - 2 * n;
+        vstack.length = vstack.length - n;
+        lstack.length = lstack.length - n;
+    }
+    function lex() {
+        var token;
+        token = self.lexer.lex() || 1;
+        if (typeof token !== "number") {
+            token = self.symbols_[token] || token;
+        }
+        return token;
+    }
+    var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;
+    while (true) {
+        state = stack[stack.length - 1];
+        if (this.defaultActions[state]) {
+            action = this.defaultActions[state];
+        } else {
+            if (symbol === null || typeof symbol == "undefined") {
+                symbol = lex();
+            }
+            action = table[state] && table[state][symbol];
+        }
+        if (typeof action === "undefined" || !action.length || !action[0]) {
+            var errStr = "";
+            if (!recovering) {
+                expected = [];
+                for (p in table[state])
+                    if (this.terminals_[p] && p > 2) {
+                        expected.push("'" + this.terminals_[p] + "'");
+                    }
+                if (this.lexer.showPosition) {
+                    errStr = "Parse error on line " + (yylineno + 1) + ":\n" + this.lexer.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
+                } else {
+                    errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == 1?"end of input":"'" + (this.terminals_[symbol] || symbol) + "'");
+                }
+                this.parseError(errStr, {text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected});
+            }
+        }
+        if (action[0] instanceof Array && action.length > 1) {
+            throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
+        }
+        switch (action[0]) {
+        case 1:
+            stack.push(symbol);
+            vstack.push(this.lexer.yytext);
+            lstack.push(this.lexer.yylloc);
+            stack.push(action[1]);
+            symbol = null;
+            if (!preErrorSymbol) {
+                yyleng = this.lexer.yyleng;
+                yytext = this.lexer.yytext;
+                yylineno = this.lexer.yylineno;
+                yyloc = this.lexer.yylloc;
+                if (recovering > 0)
+                    recovering--;
+            } else {
+                symbol = preErrorSymbol;
+                preErrorSymbol = null;
+            }
+            break;
+        case 2:
+            len = this.productions_[action[1]][1];
+            yyval.$ = vstack[vstack.length - len];
+            yyval._$ = {first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column};
+            if (ranges) {
+                yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]];
+            }
+            r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack);
+            if (typeof r !== "undefined") {
+                return r;
+            }
+            if (len) {
+                stack = stack.slice(0, -1 * len * 2);
+                vstack = vstack.slice(0, -1 * len);
+                lstack = lstack.slice(0, -1 * len);
+            }
+            stack.push(this.productions_[action[1]][0]);
+            vstack.push(yyval.$);
+            lstack.push(yyval._$);
+            newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
+            stack.push(newState);
+            break;
+        case 3:
+            return true;
+        }
+    }
+    return true;
+}
+};
+/* Jison generated lexer */
+var lexer = (function(){
+var lexer = ({EOF:1,
+parseError:function parseError(str, hash) {
+        if (this.yy.parser) {
+            this.yy.parser.parseError(str, hash);
+        } else {
+            throw new Error(str);
+        }
+    },
+setInput:function (input) {
+        this._input = input;
+        this._more = this._less = this.done = false;
+        this.yylineno = this.yyleng = 0;
+        this.yytext = this.matched = this.match = '';
+        this.conditionStack = ['INITIAL'];
+        this.yylloc = {first_line:1,first_column:0,last_line:1,last_column:0};
+        if (this.options.ranges) this.yylloc.range = [0,0];
+        this.offset = 0;
+        return this;
+    },
+input:function () {
+        var ch = this._input[0];
+        this.yytext += ch;
+        this.yyleng++;
+        this.offset++;
+        this.match += ch;
+        this.matched += ch;
+        var lines = ch.match(/(?:\r\n?|\n).*/g);
+        if (lines) {
+            this.yylineno++;
+            this.yylloc.last_line++;
+        } else {
+            this.yylloc.last_column++;
+        }
+        if (this.options.ranges) this.yylloc.range[1]++;
+
+        this._input = this._input.slice(1);
+        return ch;
+    },
+unput:function (ch) {
+        var len = ch.length;
+        var lines = ch.split(/(?:\r\n?|\n)/g);
+
+        this._input = ch + this._input;
+        this.yytext = this.yytext.substr(0, this.yytext.length-len-1);
+        //this.yyleng -= len;
+        this.offset -= len;
+        var oldLines = this.match.split(/(?:\r\n?|\n)/g);
+        this.match = this.match.substr(0, this.match.length-1);
+        this.matched = this.matched.substr(0, this.matched.length-1);
+
+        if (lines.length-1) this.yylineno -= lines.length-1;
+        var r = this.yylloc.range;
+
+        this.yylloc = {first_line: this.yylloc.first_line,
+          last_line: this.yylineno+1,
+          first_column: this.yylloc.first_column,
+          last_column: lines ?
+              (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length:
+              this.yylloc.first_column - len
+          };
+
+        if (this.options.ranges) {
+            this.yylloc.range = [r[0], r[0] + this.yyleng - len];
+        }
+        return this;
+    },
+more:function () {
+        this._more = true;
+        return this;
+    },
+less:function (n) {
+        this.unput(this.match.slice(n));
+    },
+pastInput:function () {
+        var past = this.matched.substr(0, this.matched.length - this.match.length);
+        return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, "");
+    },
+upcomingInput:function () {
+        var next = this.match;
+        if (next.length < 20) {
+            next += this._input.substr(0, 20-next.length);
+        }
+        return (next.substr(0,20)+(next.length > 20 ? '...':'')).replace(/\n/g, "");
+    },
+showPosition:function () {
+        var pre = this.pastInput();
+        var c = new Array(pre.length + 1).join("-");
+        return pre + this.upcomingInput() + "\n" + c+"^";
+    },
+next:function () {
+        if (this.done) {
+            return this.EOF;
+        }
+        if (!this._input) this.done = true;
+
+        var token,
+            match,
+            tempMatch,
+            index,
+            col,
+            lines;
+        if (!this._more) {
+            this.yytext = '';
+            this.match = '';
+        }
+        var rules = this._currentRules();
+        for (var i=0;i < rules.length; i++) {
+            tempMatch = this._input.match(this.rules[rules[i]]);
+            if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
+                match = tempMatch;
+                index = i;
+                if (!this.options.flex) break;
+            }
+        }
+        if (match) {
+            lines = match[0].match(/(?:\r\n?|\n).*/g);
+            if (lines) this.yylineno += lines.length;
+            this.yylloc = {first_line: this.yylloc.last_line,
+                           last_line: this.yylineno+1,
+                           first_column: this.yylloc.last_column,
+                           last_column: lines ? lines[lines.length-1].length-lines[lines.length-1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length};
+            this.yytext += match[0];
+            this.match += match[0];
+            this.matches = match;
+            this.yyleng = this.yytext.length;
+            if (this.options.ranges) {
+                this.yylloc.range = [this.offset, this.offset += this.yyleng];
+            }
+            this._more = false;
+            this._input = this._input.slice(match[0].length);
+            this.matched += match[0];
+            token = this.performAction.call(this, this.yy, this, rules[index],this.conditionStack[this.conditionStack.length-1]);
+            if (this.done && this._input) this.done = false;
+            if (token) return token;
+            else return;
+        }
+        if (this._input === "") {
+            return this.EOF;
+        } else {
+            return this.parseError('Lexical error on line '+(this.yylineno+1)+'. Unrecognized text.\n'+this.showPosition(),
+                    {text: "", token: null, line: this.yylineno});
+        }
+    },
+lex:function lex() {
+        var r = this.next();
+        if (typeof r !== 'undefined') {
+            return r;
+        } else {
+            return this.lex();
+        }
+    },
+begin:function begin(condition) {
+        this.conditionStack.push(condition);
+    },
+popState:function popState() {
+        return this.conditionStack.pop();
+    },
+_currentRules:function _currentRules() {
+        return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;
+    },
+topState:function () {
+        return this.conditionStack[this.conditionStack.length-2];
+    },
+pushState:function begin(condition) {
+        this.begin(condition);
+    }});
+lexer.options = {};
+lexer.performAction = function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {
+
+var YYSTATE=YY_START
+switch($avoiding_name_collisions) {
+case 0:
+                                   if(yy_.yytext.slice(-1) !== "\\") this.begin("mu");
+                                   if(yy_.yytext.slice(-1) === "\\") yy_.yytext = yy_.yytext.substr(0,yy_.yyleng-1), this.begin("emu");
+                                   if(yy_.yytext) return 14;
+                                 
+break;
+case 1: return 14; 
+break;
+case 2:
+                                   if(yy_.yytext.slice(-1) !== "\\") this.popState();
+                                   if(yy_.yytext.slice(-1) === "\\") yy_.yytext = yy_.yytext.substr(0,yy_.yyleng-1);
+                                   return 14;
+                                 
+break;
+case 3: return 24; 
+break;
+case 4: return 16; 
+break;
+case 5: return 20; 
+break;
+case 6: return 19; 
+break;
+case 7: return 19; 
+break;
+case 8: return 23; 
+break;
+case 9: return 23; 
+break;
+case 10: yy_.yytext = yy_.yytext.substr(3,yy_.yyleng-5); this.popState(); return 15; 
+break;
+case 11: return 22; 
+break;
+case 12: return 35; 
+break;
+case 13: return 34; 
+break;
+case 14: return 34; 
+break;
+case 15: return 37; 
+break;
+case 16: /*ignore whitespace*/ 
+break;
+case 17: this.popState(); return 18; 
+break;
+case 18: this.popState(); return 18; 
+break;
+case 19: yy_.yytext = yy_.yytext.substr(1,yy_.yyleng-2).replace(/\\"/g,'"'); return 29; 
+break;
+case 20: yy_.yytext = yy_.yytext.substr(1,yy_.yyleng-2).replace(/\\"/g,'"'); return 29; 
+break;
+case 21: yy_.yytext = yy_.yytext.substr(1); return 27; 
+break;
+case 22: return 31; 
+break;
+case 23: return 31; 
+break;
+case 24: return 30; 
+break;
+case 25: return 34; 
+break;
+case 26: yy_.yytext = yy_.yytext.substr(1, yy_.yyleng-2); return 34; 
+break;
+case 27: return 'INVALID'; 
+break;
+case 28: return 5; 
+break;
+}
+};
+lexer.rules = [/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|$)))/,/^(?:\{\{>)/,/^(?:\{\{#)/,/^(?:\{\{\/)/,/^(?:\{\{\^)/,/^(?:\{\{\s*else\b)/,/^(?:\{\{\{)/,/^(?:\{\{&)/,/^(?:\{\{![\s\S]*?\}\})/,/^(?:\{\{)/,/^(?:=)/,/^(?:\.(?=[} ]))/,/^(?:\.\.)/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}\}\})/,/^(?:\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@[a-zA-Z]+)/,/^(?:true(?=[}\s]))/,/^(?:false(?=[}\s]))/,/^(?:[0-9]+(?=[}\s]))/,/^(?:[a-zA-Z0-9_$-]+(?=[=}\s\/.]))/,/^(?:\[[^\]]*\])/,/^(?:.)/,/^(?:$)/];
+lexer.conditions = {"mu":{"rules":[3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28],"inclusive":false},"emu":{"rules":[2],"inclusive":false},"INITIAL":{"rules":[0,1,28],"inclusive":true}};
+return lexer;})()
+parser.lexer = lexer;
+function Parser () { this.yy = {}; }Parser.prototype = parser;parser.Parser = Parser;
+return new Parser;
+})();
+if (typeof require !== 'undefined' && typeof exports !== 'undefined') {
+exports.parser = handlebars;
+exports.Parser = handlebars.Parser;
+exports.parse = function () { return handlebars.parse.apply(handlebars, arguments); }
+exports.main = function commonjsMain(args) {
+    if (!args[1])
+        throw new Error('Usage: '+args[0]+' FILE');
+    var source, cwd;
+    if (typeof process !== 'undefined') {
+        source = require('fs').readFileSync(require('path').resolve(args[1]), "utf8");
+    } else {
+        source = require("file").path(require("file").cwd()).join(args[1]).read({charset: "utf-8"});
+    }
+    return exports.parser.parse(source);
+}
+if (typeof module !== 'undefined' && require.main === module) {
+  exports.main(typeof process !== 'undefined' ? process.argv.slice(1) : require("system").args);
+}
+};
+;
+// lib/handlebars/compiler/base.js
+Handlebars.Parser = handlebars;
+
+Handlebars.parse = function(string) {
+  Handlebars.Parser.yy = Handlebars.AST;
+  return Handlebars.Parser.parse(string);
+};
+
+Handlebars.print = function(ast) {
+  return new Handlebars.PrintVisitor().accept(ast);
+};
+
+Handlebars.logger = {
+  DEBUG: 0, INFO: 1, WARN: 2, ERROR: 3, level: 3,
+
+  // override in the host environment
+  log: function(level, str) {}
+};
+
+Handlebars.log = function(level, str) { Handlebars.logger.log(level, str); };
+;
+// lib/handlebars/compiler/ast.js
+(function() {
+
+  Handlebars.AST = {};
+
+  Handlebars.AST.ProgramNode = function(statements, inverse) {
+    this.type = "program";
+    this.statements = statements;
+    if(inverse) { this.inverse = new Handlebars.AST.ProgramNode(inverse); }
+  };
+
+  Handlebars.AST.MustacheNode = function(rawParams, hash, unescaped) {
+    this.type = "mustache";
+    this.escaped = !unescaped;
+    this.hash = hash;
+
+    var id = this.id = rawParams[0];
+    var params = this.params = rawParams.slice(1);
+
+    // a mustache is an eligible helper if:
+    // * its id is simple (a single part, not `this` or `..`)
+    var eligibleHelper = this.eligibleHelper = id.isSimple;
+
+    // a mustache is definitely a helper if:
+    // * it is an eligible helper, and
+    // * it has at least one parameter or hash segment
+    this.isHelper = eligibleHelper && (params.length || hash);
+
+    // if a mustache is an eligible helper but not a definite
+    // helper, it is ambiguous, and will be resolved in a later
+    // pass or at runtime.
+  };
+
+  Handlebars.AST.PartialNode = function(id, context) {
+    this.type    = "partial";
+
+    // TODO: disallow complex IDs
+
+    this.id      = id;
+    this.context = context;
+  };
+
+  var verifyMatch = function(open, close) {
+    if(open.original !== close.original) {
+      throw new Handlebars.Exception(open.original + " doesn't match " + close.original);
+    }
+  };
+
+  Handlebars.AST.BlockNode = function(mustache, program, inverse, close) {
+    verifyMatch(mustache.id, close);
+    this.type = "block";
+    this.mustache = mustache;
+    this.program  = program;
+    this.inverse  = inverse;
+
+    if (this.inverse && !this.program) {
+      this.isInverse = true;
+    }
+  };
+
+  Handlebars.AST.ContentNode = function(string) {
+    this.type = "content";
+    this.string = string;
+  };
+
+  Handlebars.AST.HashNode = function(pairs) {
+    this.type = "hash";
+    this.pairs = pairs;
+  };
+
+  Handlebars.AST.IdNode = function(parts) {
+    this.type = "ID";
+    this.original = parts.join(".");
+
+    var dig = [], depth = 0;
+
+    for(var i=0,l=parts.length; i<l; i++) {
+      var part = parts[i];
+
+      if(part === "..") { depth++; }
+      else if(part === "." || part === "this") { this.isScoped = true; }
+      else { dig.push(part); }
+    }
+
+    this.parts    = dig;
+    this.string   = dig.join('.');
+    this.depth    = depth;
+
+    // an ID is simple if it only has one part, and that part is not
+    // `..` or `this`.
+    this.isSimple = parts.length === 1 && !this.isScoped && depth === 0;
+  };
+
+  Handlebars.AST.DataNode = function(id) {
+    this.type = "DATA";
+    this.id = id;
+  };
+
+  Handlebars.AST.StringNode = function(string) {
+    this.type = "STRING";
+    this.string = string;
+  };
+
+  Handlebars.AST.IntegerNode = function(integer) {
+    this.type = "INTEGER";
+    this.integer = integer;
+  };
+
+  Handlebars.AST.BooleanNode = function(bool) {
+    this.type = "BOOLEAN";
+    this.bool = bool;
+  };
+
+  Handlebars.AST.CommentNode = function(comment) {
+    this.type = "comment";
+    this.comment = comment;
+  };
+
+})();;
+// lib/handlebars/utils.js
+Handlebars.Exception = function(message) {
+  var tmp = Error.prototype.constructor.apply(this, arguments);
+
+  for (var p in tmp) {
+    if (tmp.hasOwnProperty(p)) { this[p] = tmp[p]; }
+  }
+
+  this.message = tmp.message;
+};
+Handlebars.Exception.prototype = new Error();
+
+// Build out our basic SafeString type
+Handlebars.SafeString = function(string) {
+  this.string = string;
+};
+Handlebars.SafeString.prototype.toString = function() {
+  return this.string.toString();
+};
+
+(function() {
+  var escape = {
+    "&": "&amp;",
+    "<": "&lt;",
+    ">": "&gt;",
+    '"': "&quot;",
+    "'": "&#x27;",
+    "`": "&#x60;"
+  };
+
+  var badChars = /[&<>"'`]/g;
+  var possible = /[&<>"'`]/;
+
+  var escapeChar = function(chr) {
+    return escape[chr] || "&amp;";
+  };
+
+  Handlebars.Utils = {
+    escapeExpression: function(string) {
+      // don't escape SafeStrings, since they're already safe
+      if (string instanceof Handlebars.SafeString) {
+        return string.toString();
+      } else if (string == null || string === false) {
+        return "";
+      }
+
+      if(!possible.test(string)) { return string; }
+      return string.replace(badChars, escapeChar);
+    },
+
+    isEmpty: function(value) {
+      if (typeof value === "undefined") {
+        return true;
+      } else if (value === null) {
+        return true;
+      } else if (value === false) {
+        return true;
+      } else if(Object.prototype.toString.call(value) === "[object Array]" && value.length === 0) {
+        return true;
+      } else {
+        return false;
+      }
+    }
+  };
+})();;
+// lib/handlebars/compiler/compiler.js
+
+/*jshint eqnull:true*/
+Handlebars.Compiler = function() {};
+Handlebars.JavaScriptCompiler = function() {};
+
+(function(Compiler, JavaScriptCompiler) {
+  // the foundHelper register will disambiguate helper lookup from finding a
+  // function in a context. This is necessary for mustache compatibility, which
+  // requires that context functions in blocks are evaluated by blockHelperMissing,
+  // and then proceed as if the resulting value was provided to blockHelperMissing.
+
+  Compiler.prototype = {
+    compiler: Compiler,
+
+    disassemble: function() {
+      var opcodes = this.opcodes, opcode, out = [], params, param;
+
+      for (var i=0, l=opcodes.length; i<l; i++) {
+        opcode = opcodes[i];
+
+        if (opcode.opcode === 'DECLARE') {
+          out.push("DECLARE " + opcode.name + "=" + opcode.value);
+        } else {
+          params = [];
+          for (var j=0; j<opcode.args.length; j++) {
+            param = opcode.args[j];
+            if (typeof param === "string") {
+              param = "\"" + param.replace("\n", "\\n") + "\"";
+            }
+            params.push(param);
+          }
+          out.push(opcode.opcode + " " + params.join(" "));
+        }
+      }
+
+      return out.join("\n");
+    },
+
+    guid: 0,
+
+    compile: function(program, options) {
+      this.children = [];
+      this.depths = {list: []};
+      this.options = options;
+
+      // These changes will propagate to the other compiler components
+      var knownHelpers = this.options.knownHelpers;
+      this.options.knownHelpers = {
+        'helperMissing': true,
+        'blockHelperMissing': true,
+        'each': true,
+        'if': true,
+        'unless': true,
+        'with': true,
+        'log': true
+      };
+      if (knownHelpers) {
+        for (var name in knownHelpers) {
+          this.options.knownHelpers[name] = knownHelpers[name];
+        }
+      }
+
+      return this.program(program);
+    },
+
+    accept: function(node) {
+      return this[node.type](node);
+    },
+
+    program: function(program) {
+      var statements = program.statements, statement;
+      this.opcodes = [];
+
+      for(var i=0, l=statements.length; i<l; i++) {
+        statement = statements[i];
+        this[statement.type](statement);
+      }
+      this.isSimple = l === 1;
+
+      this.depths.list = this.depths.list.sort(function(a, b) {
+        return a - b;
+      });
+
+      return this;
+    },
+
+    compileProgram: function(program) {
+      var result = new this.compiler().compile(program, this.options);
+      var guid = this.guid++, depth;
+
+      this.usePartial = this.usePartial || result.usePartial;
+
+      this.children[guid] = result;
+
+      for(var i=0, l=result.depths.list.length; i<l; i++) {
+        depth = result.depths.list[i];
+
+        if(depth < 2) { continue; }
+        else { this.addDepth(depth - 1); }
+      }
+
+      return guid;
+    },
+
+    block: function(block) {
+      var mustache = block.mustache,
+          program = block.program,
+          inverse = block.inverse;
+
+      if (program) {
+        program = this.compileProgram(program);
+      }
+
+      if (inverse) {
+        inverse = this.compileProgram(inverse);
+      }
+
+      var type = this.classifyMustache(mustache);
+
+      if (type === "helper") {
+        this.helperMustache(mustache, program, inverse);
+      } else if (type === "simple") {
+        this.simpleMustache(mustache);
+
+        // now that the simple mustache is resolved, we need to
+        // evaluate it by executing `blockHelperMissing`
+        this.opcode('pushProgram', program);
+        this.opcode('pushProgram', inverse);
+        this.opcode('pushLiteral', '{}');
+        this.opcode('blockValue');
+      } else {
+        this.ambiguousMustache(mustache, program, inverse);
+
+        // now that the simple mustache is resolved, we need to
+        // evaluate it by executing `blockHelperMissing`
+        this.opcode('pushProgram', program);
+        this.opcode('pushProgram', inverse);
+        this.opcode('pushLiteral', '{}');
+        this.opcode('ambiguousBlockValue');
+      }
+
+      this.opcode('append');
+    },
+
+    hash: function(hash) {
+      var pairs = hash.pairs, pair, val;
+
+      this.opcode('push', '{}');
+
+      for(var i=0, l=pairs.length; i<l; i++) {
+        pair = pairs[i];
+        val  = pair[1];
+
+        this.accept(val);
+        this.opcode('assignToHash', pair[0]);
+      }
+    },
+
+    partial: function(partial) {
+      var id = partial.id;
+      this.usePartial = true;
+
+      if(partial.context) {
+        this.ID(partial.context);
+      } else {
+        this.opcode('push', 'depth0');
+      }
+
+      this.opcode('invokePartial', id.original);
+      this.opcode('append');
+    },
+
+    content: function(content) {
+      this.opcode('appendContent', content.string);
+    },
+
+    mustache: function(mustache) {
+      var options = this.options;
+      var type = this.classifyMustache(mustache);
+
+      if (type === "simple") {
+        this.simpleMustache(mustache);
+      } else if (type === "helper") {
+        this.helperMustache(mustache);
+      } else {
+        this.ambiguousMustache(mustache);
+      }
+
+      if(mustache.escaped && !options.noEscape) {
+        this.opcode('appendEscaped');
+      } else {
+        this.opcode('append');
+      }
+    },
+
+    ambiguousMustache: function(mustache, program, inverse) {
+      var id = mustache.id, name = id.parts[0];
+
+      this.opcode('getContext', id.depth);
+
+      this.opcode('pushProgram', program);
+      this.opcode('pushProgram', inverse);
+
+      this.opcode('invokeAmbiguous', name);
+    },
+
+    simpleMustache: function(mustache, program, inverse) {
+      var id = mustache.id;
+
+      if (id.type === 'DATA') {
+        this.DATA(id);
+      } else if (id.parts.length) {
+        this.ID(id);
+      } else {
+        // Simplified ID for `this`
+        this.addDepth(id.depth);
+        this.opcode('getContext', id.depth);
+        this.opcode('pushContext');
+      }
+
+      this.opcode('resolvePossibleLambda');
+    },
+
+    helperMustache: function(mustache, program, inverse) {
+      var params = this.setupFullMustacheParams(mustache, program, inverse),
+          name = mustache.id.parts[0];
+
+      if (this.options.knownHelpers[name]) {
+        this.opcode('invokeKnownHelper', params.length, name);
+      } else if (this.knownHelpersOnly) {
+        throw new Error("You specified knownHelpersOnly, but used the unknown helper " + name);
+      } else {
+        this.opcode('invokeHelper', params.length, name);
+      }
+    },
+
+    ID: function(id) {
+      this.addDepth(id.depth);
+      this.opcode('getContext', id.depth);
+
+      var name = id.parts[0];
+      if (!name) {
+        this.opcode('pushContext');
+      } else {
+        this.opcode('lookupOnContext', id.parts[0]);
+      }
+
+      for(var i=1, l=id.parts.length; i<l; i++) {
+        this.opcode('lookup', id.parts[i]);
+      }
+    },
+
+    DATA: function(data) {
+      this.options.data = true;
+      this.opcode('lookupData', data.id);
+    },
+
+    STRING: function(string) {
+      this.opcode('pushString', string.string);
+    },
+
+    INTEGER: function(integer) {
+      this.opcode('pushLiteral', integer.integer);
+    },
+
+    BOOLEAN: function(bool) {
+      this.opcode('pushLiteral', bool.bool);
+    },
+
+    comment: function() {},
+
+    // HELPERS
+    opcode: function(name) {
+      this.opcodes.push({ opcode: name, args: [].slice.call(arguments, 1) });
+    },
+
+    declare: function(name, value) {
+      this.opcodes.push({ opcode: 'DECLARE', name: name, value: value });
+    },
+
+    addDepth: function(depth) {
+      if(isNaN(depth)) { throw new Error("EWOT"); }
+      if(depth === 0) { return; }
+
+      if(!this.depths[depth]) {
+        this.depths[depth] = true;
+        this.depths.list.push(depth);
+      }
+    },
+
+    classifyMustache: function(mustache) {
+      var isHelper   = mustache.isHelper;
+      var isEligible = mustache.eligibleHelper;
+      var options    = this.options;
+
+      // if ambiguous, we can possibly resolve the ambiguity now
+      if (isEligible && !isHelper) {
+        var name = mustache.id.parts[0];
+
+        if (options.knownHelpers[name]) {
+          isHelper = true;
+        } else if (options.knownHelpersOnly) {
+          isEligible = false;
+        }
+      }
+
+      if (isHelper) { return "helper"; }
+      else if (isEligible) { return "ambiguous"; }
+      else { return "simple"; }
+    },
+
+    pushParams: function(params) {
+      var i = params.length, param;
+
+      while(i--) {
+        param = params[i];
+
+        if(this.options.stringParams) {
+          if(param.depth) {
+            this.addDepth(param.depth);
+          }
+
+          this.opcode('getContext', param.depth || 0);
+          this.opcode('pushStringParam', param.string);
+        } else {
+          this[param.type](param);
+        }
+      }
+    },
+
+    setupMustacheParams: function(mustache) {
+      var params = mustache.params;
+      this.pushParams(params);
+
+      if(mustache.hash) {
+        this.hash(mustache.hash);
+      } else {
+        this.opcode('pushLiteral', '{}');
+      }
+
+      return params;
+    },
+
+    // this will replace setupMustacheParams when we're done
+    setupFullMustacheParams: function(mustache, program, inverse) {
+      var params = mustache.params;
+      this.pushParams(params);
+
+      this.opcode('pushProgram', program);
+      this.opcode('pushProgram', inverse);
+
+      if(mustache.hash) {
+        this.hash(mustache.hash);
+      } else {
+        this.opcode('pushLiteral', '{}');
+      }
+
+      return params;
+    }
+  };
+
+  var Literal = function(value) {
+    this.value = value;
+  };
+
+  JavaScriptCompiler.prototype = {
+    // PUBLIC API: You can override these methods in a subclass to provide
+    // alternative compiled forms for name lookup and buffering semantics
+    nameLookup: function(parent, name, type) {
+      if (/^[0-9]+$/.test(name)) {
+        return parent + "[" + name + "]";
+      } else if (JavaScriptCompiler.isValidJavaScriptVariableName(name)) {
+        return parent + "." + name;
+      }
+      else {
+        return parent + "['" + name + "']";
+      }
+    },
+
+    appendToBuffer: function(string) {
+      if (this.environment.isSimple) {
+        return "return " + string + ";";
+      } else {
+        return "buffer += " + string + ";";
+      }
+    },
+
+    initializeBuffer: function() {
+      return this.quotedString("");
+    },
+
+    namespace: "Handlebars",
+    // END PUBLIC API
+
+    compile: function(environment, options, context, asObject) {
+      this.environment = environment;
+      this.options = options || {};
+
+      Handlebars.log(Handlebars.logger.DEBUG, this.environment.disassemble() + "\n\n");
+
+      this.name = this.environment.name;
+      this.isChild = !!context;
+      this.context = context || {
+        programs: [],
+        aliases: { }
+      };
+
+      this.preamble();
+
+      this.stackSlot = 0;
+      this.stackVars = [];
+      this.registers = { list: [] };
+      this.compileStack = [];
+
+      this.compileChildren(environment, options);
+
+      var opcodes = environment.opcodes, opcode;
+
+      this.i = 0;
+
+      for(l=opcodes.length; this.i<l; this.i++) {
+        opcode = opcodes[this.i];
+
+        if(opcode.opcode === 'DECLARE') {
+          this[opcode.name] = opcode.value;
+        } else {
+          this[opcode.opcode].apply(this, opcode.args);
+        }
+      }
+
+      return this.createFunctionContext(asObject);
+    },
+
+    nextOpcode: function() {
+      var opcodes = this.environment.opcodes, opcode = opcodes[this.i + 1];
+      return opcodes[this.i + 1];
+    },
+
+    eat: function(opcode) {
+      this.i = this.i + 1;
+    },
+
+    preamble: function() {
+      var out = [];
+
+      if (!this.isChild) {
+        var namespace = this.namespace;
+        var copies = "helpers = helpers || " + namespace + ".helpers;";
+        if (this.environment.usePartial) { copies = copies + " partials = partials || " + namespace + ".partials;"; }
+        if (this.options.data) { copies = copies + " data = data || {};"; }
+        out.push(copies);
+      } else {
+        out.push('');
+      }
+
+      if (!this.environment.isSimple) {
+        out.push(", buffer = " + this.initializeBuffer());
+      } else {
+        out.push("");
+      }
+
+      // track the last context pushed into place to allow skipping the
+      // getContext opcode when it would be a noop
+      this.lastContext = 0;
+      this.source = out;
+    },
+
+    createFunctionContext: function(asObject) {
+      var locals = this.stackVars.concat(this.registers.list);
+
+      if(locals.length > 0) {
+        this.source[1] = this.source[1] + ", " + locals.join(", ");
+      }
+
+      // Generate minimizer alias mappings
+      if (!this.isChild) {
+        var aliases = [];
+        for (var alias in this.context.aliases) {
+          this.source[1] = this.source[1] + ', ' + alias + '=' + this.context.aliases[alias];
+        }
+      }
+
+      if (this.source[1]) {
+        this.source[1] = "var " + this.source[1].substring(2) + ";";
+      }
+
+      // Merge children
+      if (!this.isChild) {
+        this.source[1] += '\n' + this.context.programs.join('\n') + '\n';
+      }
+
+      if (!this.environment.isSimple) {
+        this.source.push("return buffer;");
+      }
+
+      var params = this.isChild ? ["depth0", "data"] : ["Handlebars", "depth0", "helpers", "partials", "data"];
+
+      for(var i=0, l=this.environment.depths.list.length; i<l; i++) {
+        params.push("depth" + this.environment.depths.list[i]);
+      }
+
+      if (asObject) {
+        params.push(this.source.join("\n  "));
+
+        return Function.apply(this, params);
+      } else {
+        var functionSource = 'function ' + (this.name || '') + '(' + params.join(',') + ') {\n  ' + this.source.join("\n  ") + '}';
+        Handlebars.log(Handlebars.logger.DEBUG, functionSource + "\n\n");
+        return functionSource;
+      }
+    },
+
+    // [blockValue]
+    //
+    // On stack, before: hash, inverse, program, value
+    // On stack, after: return value of blockHelperMissing
+    //
+    // The purpose of this opcode is to take a block of the form
+    // `{{#foo}}...{{/foo}}`, resolve the value of `foo`, and
+    // replace it on the stack with the result of properly
+    // invoking blockHelperMissing.
+    blockValue: function() {
+      this.context.aliases.blockHelperMissing = 'helpers.blockHelperMissing';
+
+      var params = ["depth0"];
+      this.setupParams(0, params);
+
+      this.replaceStack(function(current) {
+        params.splice(1, 0, current);
+        return current + " = blockHelperMissing.call(" + params.join(", ") + ")";
+      });
+    },
+
+    // [ambiguousBlockValue]
+    //
+    // On stack, before: hash, inverse, program, value
+    // Compiler value, before: lastHelper=value of last found helper, if any
+    // On stack, after, if no lastHelper: same as [blockValue]
+    // On stack, after, if lastHelper: value
+    ambiguousBlockValue: function() {
+      this.context.aliases.blockHelperMissing = 'helpers.blockHelperMissing';
+
+      var params = ["depth0"];
+      this.setupParams(0, params);
+
+      var current = this.topStack();
+      params.splice(1, 0, current);
+
+      this.source.push("if (!" + this.lastHelper + ") { " + current + " = blockHelperMissing.call(" + params.join(", ") + "); }");
+    },
+
+    // [appendContent]
+    //
+    // On stack, before: ...
+    // On stack, after: ...
+    //
+    // Appends the string value of `content` to the current buffer
+    appendContent: function(content) {
+      this.source.push(this.appendToBuffer(this.quotedString(content)));
+    },
+
+    // [append]
+    //
+    // On stack, before: value, ...
+    // On stack, after: ...
+    //
+    // Coerces `value` to a String and appends it to the current buffer.
+    //
+    // If `value` is truthy, or 0, it is coerced into a string and appended
+    // Otherwise, the empty string is appended
+    append: function() {
+      var local = this.popStack();
+      this.source.push("if(" + local + " || " + local + " === 0) { " + this.appendToBuffer(local) + " }");
+      if (this.environment.isSimple) {
+        this.source.push("else { " + this.appendToBuffer("''") + " }");
+      }
+    },
+
+    // [appendEscaped]
+    //
+    // On stack, before: value, ...
+    // On stack, after: ...
+    //
+    // Escape `value` and append it to the buffer
+    appendEscaped: function() {
+      var opcode = this.nextOpcode(), extra = "";
+      this.context.aliases.escapeExpression = 'this.escapeExpression';
+
+      if(opcode && opcode.opcode === 'appendContent') {
+        extra = " + " + this.quotedString(opcode.args[0]);
+        this.eat(opcode);
+      }
+
+      this.source.push(this.appendToBuffer("escapeExpression(" + this.popStack() + ")" + extra));
+    },
+
+    // [getContext]
+    //
+    // On stack, before: ...
+    // On stack, after: ...
+    // Compiler value, after: lastContext=depth
+    //
+    // Set the value of the `lastContext` compiler value to the depth
+    getContext: function(depth) {
+      if(this.lastContext !== depth) {
+        this.lastContext = depth;
+      }
+    },
+
+    // [lookupOnContext]
+    //
+    // On stack, before: ...
+    // On stack, after: currentContext[name], ...
+    //
+    // Looks up the value of `name` on the current context and pushes
+    // it onto the stack.
+    lookupOnContext: function(name) {
+      this.pushStack(this.nameLookup('depth' + this.lastContext, name, 'context'));
+    },
+
+    // [pushContext]
+    //
+    // On stack, before: ...
+    // On stack, after: currentContext, ...
+    //
+    // Pushes the value of the current context onto the stack.
+    pushContext: function() {
+      this.pushStackLiteral('depth' + this.lastContext);
+    },
+
+    // [resolvePossibleLambda]
+    //
+    // On stack, before: value, ...
+    // On stack, after: resolved value, ...
+    //
+    // If the `value` is a lambda, replace it on the stack by
+    // the return value of the lambda
+    resolvePossibleLambda: function() {
+      this.context.aliases.functionType = '"function"';
+
+      this.replaceStack(function(current) {
+        return "typeof " + current + " === functionType ? " + current + "() : " + current;
+      });
+    },
+
+    // [lookup]
+    //
+    // On stack, before: value, ...
+    // On stack, after: value[name], ...
+    //
+    // Replace the value on the stack with the result of looking
+    // up `name` on `value`
+    lookup: function(name) {
+      this.replaceStack(function(current) {
+        return current + " == null || " + current + " === false ? " + current + " : " + this.nameLookup(current, name, 'context');
+      });
+    },
+
+    // [lookupData]
+    //
+    // On stack, before: ...
+    // On stack, after: data[id], ...
+    //
+    // Push the result of looking up `id` on the current data
+    lookupData: function(id) {
+      this.pushStack(this.nameLookup('data', id, 'data'));
+    },
+
+    // [pushStringParam]
+    //
+    // On stack, before: ...
+    // On stack, after: string, currentContext, ...
+    //
+    // This opcode is designed for use in string mode, which
+    // provides the string value of a parameter along with its
+    // depth rather than resolving it immediately.
+    pushStringParam: function(string) {
+      this.pushStackLiteral('depth' + this.lastContext);
+      this.pushString(string);
+    },
+
+    // [pushString]
+    //
+    // On stack, before: ...
+    // On stack, after: quotedString(string), ...
+    //
+    // Push a quoted version of `string` onto the stack
+    pushString: function(string) {
+      this.pushStackLiteral(this.quotedString(string));
+    },
+
+    // [push]
+    //
+    // On stack, before: ...
+    // On stack, after: expr, ...
+    //
+    // Push an expression onto the stack
+    push: function(expr) {
+      this.pushStack(expr);
+    },
+
+    // [pushLiteral]
+    //
+    // On stack, before: ...
+    // On stack, after: value, ...
+    //
+    // Pushes a value onto the stack. This operation prevents
+    // the compiler from creating a temporary variable to hold
+    // it.
+    pushLiteral: function(value) {
+      this.pushStackLiteral(value);
+    },
+
+    // [pushProgram]
+    //
+    // On stack, before: ...
+    // On stack, after: program(guid), ...
+    //
+    // Push a program expression onto the stack. This takes
+    // a compile-time guid and converts it into a runtime-accessible
+    // expression.
+    pushProgram: function(guid) {
+      if (guid != null) {
+        this.pushStackLiteral(this.programExpression(guid));
+      } else {
+        this.pushStackLiteral(null);
+      }
+    },
+
+    // [invokeHelper]
+    //
+    // On stack, before: hash, inverse, program, params..., ...
+    // On stack, after: result of helper invocation
+    //
+    // Pops off the helper's parameters, invokes the helper,
+    // and pushes the helper's return value onto the stack.
+    //
+    // If the helper is not found, `helperMissing` is called.
+    invokeHelper: function(paramSize, name) {
+      this.context.aliases.helperMissing = 'helpers.helperMissing';
+
+      var helper = this.lastHelper = this.setupHelper(paramSize, name);
+      this.register('foundHelper', helper.name);
+
+      this.pushStack("foundHelper ? foundHelper.call(" +
+        helper.callParams + ") " + ": helperMissing.call(" +
+        helper.helperMissingParams + ")");
+    },
+
+    // [invokeKnownHelper]
+    //
+    // On stack, before: hash, inverse, program, params..., ...
+    // On stack, after: result of helper invocation
+    //
+    // This operation is used when the helper is known to exist,
+    // so a `helperMissing` fallback is not required.
+    invokeKnownHelper: function(paramSize, name) {
+      var helper = this.setupHelper(paramSize, name);
+      this.pushStack(helper.name + ".call(" + helper.callParams + ")");
+    },
+
+    // [invokeAmbiguous]
+    //
+    // On stack, before: hash, inverse, program, params..., ...
+    // On stack, after: result of disambiguation
+    //
+    // This operation is used when an expression like `{{foo}}`
+    // is provided, but we don't know at compile-time whether it
+    // is a helper or a path.
+    //
+    // This operation emits more code than the other options,
+    // and can be avoided by passing the `knownHelpers` and
+    // `knownHelpersOnly` flags at compile-time.
+    invokeAmbiguous: function(name) {
+      this.context.aliases.functionType = '"function"';
+
+      this.pushStackLiteral('{}');
+      var helper = this.setupHelper(0, name);
+
+      var helperName = this.lastHelper = this.nameLookup('helpers', name, 'helper');
+      this.register('foundHelper', helperName);
+
+      var nonHelper = this.nameLookup('depth' + this.lastContext, name, 'context');
+      var nextStack = this.nextStack();
+
+      this.source.push('if (foundHelper) { ' + nextStack + ' = foundHelper.call(' + helper.callParams + '); }');
+      this.source.push('else { ' + nextStack + ' = ' + nonHelper + '; ' + nextStack + ' = typeof ' + nextStack + ' === functionType ? ' + nextStack + '() : ' + nextStack + '; }');
+    },
+
+    // [invokePartial]
+    //
+    // On stack, before: context, ...
+    // On stack after: result of partial invocation
+    //
+    // This operation pops off a context, invokes a partial with that context,
+    // and pushes the result of the invocation back.
+    invokePartial: function(name) {
+      var params = [this.nameLookup('partials', name, 'partial'), "'" + name + "'", this.popStack(), "helpers", "partials"];
+
+      if (this.options.data) {
+        params.push("data");
+      }
+
+      this.context.aliases.self = "this";
+      this.pushStack("self.invokePartial(" + params.join(", ") + ");");
+    },
+
+    // [assignToHash]
+    //
+    // On stack, before: value, hash, ...
+    // On stack, after: hash, ...
+    //
+    // Pops a value and hash off the stack, assigns `hash[key] = value`
+    // and pushes the hash back onto the stack.
+    assignToHash: function(key) {
+      var value = this.popStack();
+      var hash = this.topStack();
+
+      this.source.push(hash + "['" + key + "'] = " + value + ";");
+    },
+
+    // HELPERS
+
+    compiler: JavaScriptCompiler,
+
+    compileChildren: function(environment, options) {
+      var children = environment.children, child, compiler;
+
+      for(var i=0, l=children.length; i<l; i++) {
+        child = children[i];
+        compiler = new this.compiler();
+
+        this.context.programs.push('');     // Placeholder to prevent name conflicts for nested children
+        var index = this.context.programs.length;
+        child.index = index;
+        child.name = 'program' + index;
+        this.context.programs[index] = compiler.compile(child, options, this.context);
+      }
+    },
+
+    programExpression: function(guid) {
+      this.context.aliases.self = "this";
+
+      if(guid == null) {
+        return "self.noop";
+      }
+
+      var child = this.environment.children[guid],
+          depths = child.depths.list, depth;
+
+      var programParams = [child.index, child.name, "data"];
+
+      for(var i=0, l = depths.length; i<l; i++) {
+        depth = depths[i];
+
+        if(depth === 1) { programParams.push("depth0"); }
+        else { programParams.push("depth" + (depth - 1)); }
+      }
+
+      if(depths.length === 0) {
+        return "self.program(" + programParams.join(", ") + ")";
+      } else {
+        programParams.shift();
+        return "self.programWithDepth(" + programParams.join(", ") + ")";
+      }
+    },
+
+    register: function(name, val) {
+      this.useRegister(name);
+      this.source.push(name + " = " + val + ";");
+    },
+
+    useRegister: function(name) {
+      if(!this.registers[name]) {
+        this.registers[name] = true;
+        this.registers.list.push(name);
+      }
+    },
+
+    pushStackLiteral: function(item) {
+      this.compileStack.push(new Literal(item));
+      return item;
+    },
+
+    pushStack: function(item) {
+      this.source.push(this.incrStack() + " = " + item + ";");
+      this.compileStack.push("stack" + this.stackSlot);
+      return "stack" + this.stackSlot;
+    },
+
+    replaceStack: function(callback) {
+      var item = callback.call(this, this.topStack());
+
+      this.source.push(this.topStack() + " = " + item + ";");
+      return "stack" + this.stackSlot;
+    },
+
+    nextStack: function(skipCompileStack) {
+      var name = this.incrStack();
+      this.compileStack.push("stack" + this.stackSlot);
+      return name;
+    },
+
+    incrStack: function() {
+      this.stackSlot++;
+      if(this.stackSlot > this.stackVars.length) { this.stackVars.push("stack" + this.stackSlot); }
+      return "stack" + this.stackSlot;
+    },
+
+    popStack: function() {
+      var item = this.compileStack.pop();
+
+      if (item instanceof Literal) {
+        return item.value;
+      } else {
+        this.stackSlot--;
+        return item;
+      }
+    },
+
+    topStack: function() {
+      var item = this.compileStack[this.compileStack.length - 1];
+
+      if (item instanceof Literal) {
+        return item.value;
+      } else {
+        return item;
+      }
+    },
+
+    quotedString: function(str) {
+      return '"' + str
+        .replace(/\\/g, '\\\\')
+        .replace(/"/g, '\\"')
+        .replace(/\n/g, '\\n')
+        .replace(/\r/g, '\\r') + '"';
+    },
+
+    setupHelper: function(paramSize, name) {
+      var params = [];
+      this.setupParams(paramSize, params);
+      var foundHelper = this.nameLookup('helpers', name, 'helper');
+
+      return {
+        params: params,
+        name: foundHelper,
+        callParams: ["depth0"].concat(params).join(", "),
+        helperMissingParams: ["depth0", this.quotedString(name)].concat(params).join(", ")
+      };
+    },
+
+    // the params and contexts arguments are passed in arrays
+    // to fill in
+    setupParams: function(paramSize, params) {
+      var options = [], contexts = [], param, inverse, program;
+
+      options.push("hash:" + this.popStack());
+
+      inverse = this.popStack();
+      program = this.popStack();
+
+      // Avoid setting fn and inverse if neither are set. This allows
+      // helpers to do a check for `if (options.fn)`
+      if (program || inverse) {
+        if (!program) {
+          this.context.aliases.self = "this";
+          program = "self.noop";
+        }
+
+        if (!inverse) {
+         this.context.aliases.self = "this";
+          inverse = "self.noop";
+        }
+
+        options.push("inverse:" + inverse);
+        options.push("fn:" + program);
+      }
+
+      for(var i=0; i<paramSize; i++) {
+        param = this.popStack();
+        params.push(param);
+
+        if(this.options.stringParams) {
+          contexts.push(this.popStack());
+        }
+      }
+
+      if (this.options.stringParams) {
+        options.push("contexts:[" + contexts.join(",") + "]");
+      }
+
+      if(this.options.data) {
+        options.push("data:data");
+      }
+
+      params.push("{" + options.join(",") + "}");
+      return params.join(", ");
+    }
+  };
+
+  var reservedWords = (
+    "break else new var" +
+    " case finally return void" +
+    " catch for switch while" +
+    " continue function this with" +
+    " default if throw" +
+    " delete in try" +
+    " do instanceof typeof" +
+    " abstract enum int short" +
+    " boolean export interface static" +
+    " byte extends long super" +
+    " char final native synchronized" +
+    " class float package throws" +
+    " const goto private transient" +
+    " debugger implements protected volatile" +
+    " double import public let yield"
+  ).split(" ");
+
+  var compilerWords = JavaScriptCompiler.RESERVED_WORDS = {};
+
+  for(var i=0, l=reservedWords.length; i<l; i++) {
+    compilerWords[reservedWords[i]] = true;
+  }
+
+  JavaScriptCompiler.isValidJavaScriptVariableName = function(name) {
+    if(!JavaScriptCompiler.RESERVED_WORDS[name] && /^[a-zA-Z_$][0-9a-zA-Z_$]+$/.test(name)) {
+      return true;
+    }
+    return false;
+  };
+
+})(Handlebars.Compiler, Handlebars.JavaScriptCompiler);
+
+Handlebars.precompile = function(string, options) {
+  options = options || {};
+
+  var ast = Handlebars.parse(string);
+  var environment = new Handlebars.Compiler().compile(ast, options);
+  return new Handlebars.JavaScriptCompiler().compile(environment, options);
+};
+
+Handlebars.compile = function(string, options) {
+  options = options || {};
+
+  var compiled;
+  function compile() {
+    var ast = Handlebars.parse(string);
+    var environment = new Handlebars.Compiler().compile(ast, options);
+    var templateSpec = new Handlebars.JavaScriptCompiler().compile(environment, options, undefined, true);
+    return Handlebars.template(templateSpec);
+  }
+
+  // Template is only compiled on first use and cached after that point.
+  return function(context, options) {
+    if (!compiled) {
+      compiled = compile();
+    }
+    return compiled.call(this, context, options);
+  };
+};
+;
+// lib/handlebars/runtime.js
+Handlebars.VM = {
+  template: function(templateSpec) {
+    // Just add water
+    var container = {
+      escapeExpression: Handlebars.Utils.escapeExpression,
+      invokePartial: Handlebars.VM.invokePartial,
+      programs: [],
+      program: function(i, fn, data) {
+        var programWrapper = this.programs[i];
+        if(data) {
+          return Handlebars.VM.program(fn, data);
+        } else if(programWrapper) {
+          return programWrapper;
+        } else {
+          programWrapper = this.programs[i] = Handlebars.VM.program(fn);
+          return programWrapper;
+        }
+      },
+      programWithDepth: Handlebars.VM.programWithDepth,
+      noop: Handlebars.VM.noop
+    };
+
+    return function(context, options) {
+      options = options || {};
+      return templateSpec.call(container, Handlebars, context, options.helpers, options.partials, options.data);
+    };
+  },
+
+  programWithDepth: function(fn, data, $depth) {
+    var args = Array.prototype.slice.call(arguments, 2);
+
+    return function(context, options) {
+      options = options || {};
+
+      return fn.apply(this, [context, options.data || data].concat(args));
+    };
+  },
+  program: function(fn, data) {
+    return function(context, options) {
+      options = options || {};
+
+      return fn(context, options.data || data);
+    };
+  },
+  noop: function() { return ""; },
+  invokePartial: function(partial, name, context, helpers, partials, data) {
+    var options = { helpers: helpers, partials: partials, data: data };
+
+    if(partial === undefined) {
+      throw new Handlebars.Exception("The partial " + name + " could not be found");
+    } else if(partial instanceof Function) {
+      return partial(context, options);
+    } else if (!Handlebars.compile) {
+      throw new Handlebars.Exception("The partial " + name + " could not be compiled when running in runtime-only mode");
+    } else {
+      partials[name] = Handlebars.compile(partial, {data: data !== undefined});
+      return partials[name](context, options);
+    }
+  }
+};
+
+Handlebars.template = Handlebars.VM.template;
+;

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/js/libs/jquery.ba-bbq.min.js
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/js/libs/jquery.ba-bbq.min.js b/src/main/webapp/assets/js/libs/jquery.ba-bbq.min.js
new file mode 100644
index 0000000..bcbf248
--- /dev/null
+++ b/src/main/webapp/assets/js/libs/jquery.ba-bbq.min.js
@@ -0,0 +1,18 @@
+/*
+ * jQuery BBQ: Back Button & Query Library - v1.2.1 - 2/17/2010
+ * http://benalman.com/projects/jquery-bbq-plugin/
+ * 
+ * Copyright (c) 2010 "Cowboy" Ben Alman
+ * Dual licensed under the MIT and GPL licenses.
+ * http://benalman.com/about/license/
+ */
+(function($,p){var i,m=Array.prototype.slice,r=decodeURIComponent,a=$.param,c,l,v,b=$.bbq=$.bbq||{},q,u,j,e=$.event.special,d="hashchange",A="querystring",D="fragment",y="elemUrlAttr",g="location",k="href",t="src",x=/^.*\?|#.*$/g,w=/^.*\#/,h,C={};function E(F){return typeof F==="string"}function B(G){var F=m.call(arguments,1);return function(){return G.apply(this,F.concat(m.call(arguments)))}}function n(F){return F.replace(/^[^#]*#?(.*)$/,"$1")}function o(F){return F.replace(/(?:^[^?#]*\?([^#]*).*$)?.*/,"$1")}function f(H,M,F,I,G){var O,L,K,N,J;if(I!==i){K=F.match(H?/^([^#]*)\#?(.*)$/:/^([^#?]*)\??([^#]*)(#?.*)/);J=K[3]||"";if(G===2&&E(I)){L=I.replace(H?w:x,"")}else{N=l(K[2]);I=E(I)?l[H?D:A](I):I;L=G===2?I:G===1?$.extend({},I,N):$.extend({},N,I);L=a(L);if(H){L=L.replace(h,r)}}O=K[1]+(H?"#":L||!K[1]?"?":"")+L+J}else{O=M(F!==i?F:p[g][k])}return O}a[A]=B(f,0,o);a[D]=c=B(f,1,n);c.noEscape=function(G){G=G||"";var F=$.map(G.split(""),encodeURIComponent);h=new RegExp(F.join("|"),"g")};c.no
 Escape(",/");$.deparam=l=function(I,F){var H={},G={"true":!0,"false":!1,"null":null};$.each(I.replace(/\+/g," ").split("&"),function(L,Q){var K=Q.split("="),P=r(K[0]),J,O=H,M=0,R=P.split("]["),N=R.length-1;if(/\[/.test(R[0])&&/\]$/.test(R[N])){R[N]=R[N].replace(/\]$/,"");R=R.shift().split("[").concat(R);N=R.length-1}else{N=0}if(K.length===2){J=r(K[1]);if(F){J=J&&!isNaN(J)?+J:J==="undefined"?i:G[J]!==i?G[J]:J}if(N){for(;M<=N;M++){P=R[M]===""?O.length:R[M];O=O[P]=M<N?O[P]||(R[M+1]&&isNaN(R[M+1])?{}:[]):J}}else{if($.isArray(H[P])){H[P].push(J)}else{if(H[P]!==i){H[P]=[H[P],J]}else{H[P]=J}}}}else{if(P){H[P]=F?i:""}}});return H};function z(H,F,G){if(F===i||typeof F==="boolean"){G=F;F=a[H?D:A]()}else{F=E(F)?F.replace(H?w:x,""):F}return l(F,G)}l[A]=B(z,0);l[D]=v=B(z,1);$[y]||($[y]=function(F){return $.extend(C,F)})({a:k,base:k,iframe:t,img:t,input:t,form:"action",link:k,script:t});j=$[y];function s(I,G,H,F){if(!E(H)&&typeof H!=="object"){F=H;H=G;G=i}return this.each(function(){var L=$(this)
 ,J=G||j()[(this.nodeName||"").toLowerCase()]||"",K=J&&L.attr(J)||"";L.attr(J,a[I](K,H,F))})}$.fn[A]=B(s,A);$.fn[D]=B(s,D);b.pushState=q=function(I,F){if(E(I)&&/^#/.test(I)&&F===i){F=2}var H=I!==i,G=c(p[g][k],H?I:{},H?F:2);p[g][k]=G+(/#/.test(G)?"":"#")};b.getState=u=function(F,G){return F===i||typeof F==="boolean"?v(F):v(G)[F]};b.removeState=function(F){var G={};if(F!==i){G=u();$.each($.isArray(F)?F:arguments,function(I,H){delete G[H]})}q(G,2)};e[d]=$.extend(e[d],{add:function(F){var H;function G(J){var I=J[D]=c();J.getState=function(K,L){return K===i||typeof K==="boolean"?l(I,K):l(I,L)[K]};H.apply(this,arguments)}if($.isFunction(F)){H=F;return G}else{H=F.handler;F.handler=G}}})})(jQuery,this);
+/*
+ * jQuery hashchange event - v1.2 - 2/11/2010
+ * http://benalman.com/projects/jquery-hashchange-plugin/
+ * 
+ * Copyright (c) 2010 "Cowboy" Ben Alman
+ * Dual licensed under the MIT and GPL licenses.
+ * http://benalman.com/about/license/
+ */
+(function($,i,b){var j,k=$.event.special,c="location",d="hashchange",l="href",f=$.browser,g=document.documentMode,h=f.msie&&(g===b||g<8),e="on"+d in i&&!h;function a(m){m=m||i[c][l];return m.replace(/^[^#]*#?(.*)$/,"$1")}$[d+"Delay"]=100;k[d]=$.extend(k[d],{setup:function(){if(e){return false}$(j.start)},teardown:function(){if(e){return false}$(j.stop)}});j=(function(){var m={},r,n,o,q;function p(){o=q=function(s){return s};if(h){n=$('<iframe src="javascript:0"/>').hide().insertAfter("body")[0].contentWindow;q=function(){return a(n.document[c][l])};o=function(u,s){if(u!==s){var t=n.document;t.open().close();t[c].hash="#"+u}};o(a())}}m.start=function(){if(r){return}var t=a();o||p();(function s(){var v=a(),u=q(t);if(v!==t){o(t=v,u);$(i).trigger(d)}else{if(u!==t){i[c][l]=i[c][l].replace(/#.*/,"")+"#"+u}}r=setTimeout(s,$[d+"Delay"])})()};m.stop=function(){if(!n){r&&clearTimeout(r);r=0}};return m})()})(jQuery,this);
\ No newline at end of file


[09/51] [abbrv] [partial] brooklyn-ui git commit: move subdir from incubator up a level as it is promoted to its own repo (first non-incubator commit!)

Posted by he...@apache.org.
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/js/libs/jquery.js
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/js/libs/jquery.js b/src/main/webapp/assets/js/libs/jquery.js
new file mode 100644
index 0000000..3774ff9
--- /dev/null
+++ b/src/main/webapp/assets/js/libs/jquery.js
@@ -0,0 +1,9404 @@
+/*!
+ * jQuery JavaScript Library v1.7.2
+ * http://jquery.com/
+ *
+ * Copyright 2011, John Resig
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * Includes Sizzle.js
+ * http://sizzlejs.com/
+ * Copyright 2011, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ *
+ * Date: Wed Mar 21 12:46:34 2012 -0700
+ */
+(function( window, undefined ) {
+
+// Use the correct document accordingly with window argument (sandbox)
+var document = window.document,
+	navigator = window.navigator,
+	location = window.location;
+var jQuery = (function() {
+
+// Define a local copy of jQuery
+var jQuery = function( selector, context ) {
+		// The jQuery object is actually just the init constructor 'enhanced'
+		return new jQuery.fn.init( selector, context, rootjQuery );
+	},
+
+	// Map over jQuery in case of overwrite
+	_jQuery = window.jQuery,
+
+	// Map over the $ in case of overwrite
+	_$ = window.$,
+
+	// A central reference to the root jQuery(document)
+	rootjQuery,
+
+	// A simple way to check for HTML strings or ID strings
+	// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
+	quickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,
+
+	// Check if a string has a non-whitespace character in it
+	rnotwhite = /\S/,
+
+	// Used for trimming whitespace
+	trimLeft = /^\s+/,
+	trimRight = /\s+$/,
+
+	// Match a standalone tag
+	rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
+
+	// JSON RegExp
+	rvalidchars = /^[\],:{}\s]*$/,
+	rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
+	rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
+	rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
+
+	// Useragent RegExp
+	rwebkit = /(webkit)[ \/]([\w.]+)/,
+	ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/,
+	rmsie = /(msie) ([\w.]+)/,
+	rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/,
+
+	// Matches dashed string for camelizing
+	rdashAlpha = /-([a-z]|[0-9])/ig,
+	rmsPrefix = /^-ms-/,
+
+	// Used by jQuery.camelCase as callback to replace()
+	fcamelCase = function( all, letter ) {
+		return ( letter + "" ).toUpperCase();
+	},
+
+	// Keep a UserAgent string for use with jQuery.browser
+	userAgent = navigator.userAgent,
+
+	// For matching the engine and version of the browser
+	browserMatch,
+
+	// The deferred used on DOM ready
+	readyList,
+
+	// The ready event handler
+	DOMContentLoaded,
+
+	// Save a reference to some core methods
+	toString = Object.prototype.toString,
+	hasOwn = Object.prototype.hasOwnProperty,
+	push = Array.prototype.push,
+	slice = Array.prototype.slice,
+	trim = String.prototype.trim,
+	indexOf = Array.prototype.indexOf,
+
+	// [[Class]] -> type pairs
+	class2type = {};
+
+jQuery.fn = jQuery.prototype = {
+	constructor: jQuery,
+	init: function( selector, context, rootjQuery ) {
+		var match, elem, ret, doc;
+
+		// Handle $(""), $(null), or $(undefined)
+		if ( !selector ) {
+			return this;
+		}
+
+		// Handle $(DOMElement)
+		if ( selector.nodeType ) {
+			this.context = this[0] = selector;
+			this.length = 1;
+			return this;
+		}
+
+		// The body element only exists once, optimize finding it
+		if ( selector === "body" && !context && document.body ) {
+			this.context = document;
+			this[0] = document.body;
+			this.selector = selector;
+			this.length = 1;
+			return this;
+		}
+
+		// Handle HTML strings
+		if ( typeof selector === "string" ) {
+			// Are we dealing with HTML string or an ID?
+			if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
+				// Assume that strings that start and end with <> are HTML and skip the regex check
+				match = [ null, selector, null ];
+
+			} else {
+				match = quickExpr.exec( selector );
+			}
+
+			// Verify a match, and that no context was specified for #id
+			if ( match && (match[1] || !context) ) {
+
+				// HANDLE: $(html) -> $(array)
+				if ( match[1] ) {
+					context = context instanceof jQuery ? context[0] : context;
+					doc = ( context ? context.ownerDocument || context : document );
+
+					// If a single string is passed in and it's a single tag
+					// just do a createElement and skip the rest
+					ret = rsingleTag.exec( selector );
+
+					if ( ret ) {
+						if ( jQuery.isPlainObject( context ) ) {
+							selector = [ document.createElement( ret[1] ) ];
+							jQuery.fn.attr.call( selector, context, true );
+
+						} else {
+							selector = [ doc.createElement( ret[1] ) ];
+						}
+
+					} else {
+						ret = jQuery.buildFragment( [ match[1] ], [ doc ] );
+						selector = ( ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment ).childNodes;
+					}
+
+					return jQuery.merge( this, selector );
+
+				// HANDLE: $("#id")
+				} else {
+					elem = document.getElementById( match[2] );
+
+					// Check parentNode to catch when Blackberry 4.6 returns
+					// nodes that are no longer in the document #6963
+					if ( elem && elem.parentNode ) {
+						// Handle the case where IE and Opera return items
+						// by name instead of ID
+						if ( elem.id !== match[2] ) {
+							return rootjQuery.find( selector );
+						}
+
+						// Otherwise, we inject the element directly into the jQuery object
+						this.length = 1;
+						this[0] = elem;
+					}
+
+					this.context = document;
+					this.selector = selector;
+					return this;
+				}
+
+			// HANDLE: $(expr, $(...))
+			} else if ( !context || context.jquery ) {
+				return ( context || rootjQuery ).find( selector );
+
+			// HANDLE: $(expr, context)
+			// (which is just equivalent to: $(context).find(expr)
+			} else {
+				return this.constructor( context ).find( selector );
+			}
+
+		// HANDLE: $(function)
+		// Shortcut for document ready
+		} else if ( jQuery.isFunction( selector ) ) {
+			return rootjQuery.ready( selector );
+		}
+
+		if ( selector.selector !== undefined ) {
+			this.selector = selector.selector;
+			this.context = selector.context;
+		}
+
+		return jQuery.makeArray( selector, this );
+	},
+
+	// Start with an empty selector
+	selector: "",
+
+	// The current version of jQuery being used
+	jquery: "1.7.2",
+
+	// The default length of a jQuery object is 0
+	length: 0,
+
+	// The number of elements contained in the matched element set
+	size: function() {
+		return this.length;
+	},
+
+	toArray: function() {
+		return slice.call( this, 0 );
+	},
+
+	// Get the Nth element in the matched element set OR
+	// Get the whole matched element set as a clean array
+	get: function( num ) {
+		return num == null ?
+
+			// Return a 'clean' array
+			this.toArray() :
+
+			// Return just the object
+			( num < 0 ? this[ this.length + num ] : this[ num ] );
+	},
+
+	// Take an array of elements and push it onto the stack
+	// (returning the new matched element set)
+	pushStack: function( elems, name, selector ) {
+		// Build a new jQuery matched element set
+		var ret = this.constructor();
+
+		if ( jQuery.isArray( elems ) ) {
+			push.apply( ret, elems );
+
+		} else {
+			jQuery.merge( ret, elems );
+		}
+
+		// Add the old object onto the stack (as a reference)
+		ret.prevObject = this;
+
+		ret.context = this.context;
+
+		if ( name === "find" ) {
+			ret.selector = this.selector + ( this.selector ? " " : "" ) + selector;
+		} else if ( name ) {
+			ret.selector = this.selector + "." + name + "(" + selector + ")";
+		}
+
+		// Return the newly-formed element set
+		return ret;
+	},
+
+	// Execute a callback for every element in the matched set.
+	// (You can seed the arguments with an array of args, but this is
+	// only used internally.)
+	each: function( callback, args ) {
+		return jQuery.each( this, callback, args );
+	},
+
+	ready: function( fn ) {
+		// Attach the listeners
+		jQuery.bindReady();
+
+		// Add the callback
+		readyList.add( fn );
+
+		return this;
+	},
+
+	eq: function( i ) {
+		i = +i;
+		return i === -1 ?
+			this.slice( i ) :
+			this.slice( i, i + 1 );
+	},
+
+	first: function() {
+		return this.eq( 0 );
+	},
+
+	last: function() {
+		return this.eq( -1 );
+	},
+
+	slice: function() {
+		return this.pushStack( slice.apply( this, arguments ),
+			"slice", slice.call(arguments).join(",") );
+	},
+
+	map: function( callback ) {
+		return this.pushStack( jQuery.map(this, function( elem, i ) {
+			return callback.call( elem, i, elem );
+		}));
+	},
+
+	end: function() {
+		return this.prevObject || this.constructor(null);
+	},
+
+	// For internal use only.
+	// Behaves like an Array's method, not like a jQuery method.
+	push: push,
+	sort: [].sort,
+	splice: [].splice
+};
+
+// Give the init function the jQuery prototype for later instantiation
+jQuery.fn.init.prototype = jQuery.fn;
+
+jQuery.extend = jQuery.fn.extend = function() {
+	var options, name, src, copy, copyIsArray, clone,
+		target = arguments[0] || {},
+		i = 1,
+		length = arguments.length,
+		deep = false;
+
+	// Handle a deep copy situation
+	if ( typeof target === "boolean" ) {
+		deep = target;
+		target = arguments[1] || {};
+		// skip the boolean and the target
+		i = 2;
+	}
+
+	// Handle case when target is a string or something (possible in deep copy)
+	if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
+		target = {};
+	}
+
+	// extend jQuery itself if only one argument is passed
+	if ( length === i ) {
+		target = this;
+		--i;
+	}
+
+	for ( ; i < length; i++ ) {
+		// Only deal with non-null/undefined values
+		if ( (options = arguments[ i ]) != null ) {
+			// Extend the base object
+			for ( name in options ) {
+				src = target[ name ];
+				copy = options[ name ];
+
+				// Prevent never-ending loop
+				if ( target === copy ) {
+					continue;
+				}
+
+				// Recurse if we're merging plain objects or arrays
+				if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
+					if ( copyIsArray ) {
+						copyIsArray = false;
+						clone = src && jQuery.isArray(src) ? src : [];
+
+					} else {
+						clone = src && jQuery.isPlainObject(src) ? src : {};
+					}
+
+					// Never move original objects, clone them
+					target[ name ] = jQuery.extend( deep, clone, copy );
+
+				// Don't bring in undefined values
+				} else if ( copy !== undefined ) {
+					target[ name ] = copy;
+				}
+			}
+		}
+	}
+
+	// Return the modified object
+	return target;
+};
+
+jQuery.extend({
+	noConflict: function( deep ) {
+		if ( window.$ === jQuery ) {
+			window.$ = _$;
+		}
+
+		if ( deep && window.jQuery === jQuery ) {
+			window.jQuery = _jQuery;
+		}
+
+		return jQuery;
+	},
+
+	// Is the DOM ready to be used? Set to true once it occurs.
+	isReady: false,
+
+	// A counter to track how many items to wait for before
+	// the ready event fires. See #6781
+	readyWait: 1,
+
+	// Hold (or release) the ready event
+	holdReady: function( hold ) {
+		if ( hold ) {
+			jQuery.readyWait++;
+		} else {
+			jQuery.ready( true );
+		}
+	},
+
+	// Handle when the DOM is ready
+	ready: function( wait ) {
+		// Either a released hold or an DOMready/load event and not yet ready
+		if ( (wait === true && !--jQuery.readyWait) || (wait !== true && !jQuery.isReady) ) {
+			// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
+			if ( !document.body ) {
+				return setTimeout( jQuery.ready, 1 );
+			}
+
+			// Remember that the DOM is ready
+			jQuery.isReady = true;
+
+			// If a normal DOM Ready event fired, decrement, and wait if need be
+			if ( wait !== true && --jQuery.readyWait > 0 ) {
+				return;
+			}
+
+			// If there are functions bound, to execute
+			readyList.fireWith( document, [ jQuery ] );
+
+			// Trigger any bound ready events
+			if ( jQuery.fn.trigger ) {
+				jQuery( document ).trigger( "ready" ).off( "ready" );
+			}
+		}
+	},
+
+	bindReady: function() {
+		if ( readyList ) {
+			return;
+		}
+
+		readyList = jQuery.Callbacks( "once memory" );
+
+		// Catch cases where $(document).ready() is called after the
+		// browser event has already occurred.
+		if ( document.readyState === "complete" ) {
+			// Handle it asynchronously to allow scripts the opportunity to delay ready
+			return setTimeout( jQuery.ready, 1 );
+		}
+
+		// Mozilla, Opera and webkit nightlies currently support this event
+		if ( document.addEventListener ) {
+			// Use the handy event callback
+			document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
+
+			// A fallback to window.onload, that will always work
+			window.addEventListener( "load", jQuery.ready, false );
+
+		// If IE event model is used
+		} else if ( document.attachEvent ) {
+			// ensure firing before onload,
+			// maybe late but safe also for iframes
+			document.attachEvent( "onreadystatechange", DOMContentLoaded );
+
+			// A fallback to window.onload, that will always work
+			window.attachEvent( "onload", jQuery.ready );
+
+			// If IE and not a frame
+			// continually check to see if the document is ready
+			var toplevel = false;
+
+			try {
+				toplevel = window.frameElement == null;
+			} catch(e) {}
+
+			if ( document.documentElement.doScroll && toplevel ) {
+				doScrollCheck();
+			}
+		}
+	},
+
+	// See test/unit/core.js for details concerning isFunction.
+	// Since version 1.3, DOM methods and functions like alert
+	// aren't supported. They return false on IE (#2968).
+	isFunction: function( obj ) {
+		return jQuery.type(obj) === "function";
+	},
+
+	isArray: Array.isArray || function( obj ) {
+		return jQuery.type(obj) === "array";
+	},
+
+	isWindow: function( obj ) {
+		return obj != null && obj == obj.window;
+	},
+
+	isNumeric: function( obj ) {
+		return !isNaN( parseFloat(obj) ) && isFinite( obj );
+	},
+
+	type: function( obj ) {
+		return obj == null ?
+			String( obj ) :
+			class2type[ toString.call(obj) ] || "object";
+	},
+
+	isPlainObject: function( obj ) {
+		// Must be an Object.
+		// Because of IE, we also have to check the presence of the constructor property.
+		// Make sure that DOM nodes and window objects don't pass through, as well
+		if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
+			return false;
+		}
+
+		try {
+			// Not own constructor property must be Object
+			if ( obj.constructor &&
+				!hasOwn.call(obj, "constructor") &&
+				!hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
+				return false;
+			}
+		} catch ( e ) {
+			// IE8,9 Will throw exceptions on certain host objects #9897
+			return false;
+		}
+
+		// Own properties are enumerated firstly, so to speed up,
+		// if last one is own, then all properties are own.
+
+		var key;
+		for ( key in obj ) {}
+
+		return key === undefined || hasOwn.call( obj, key );
+	},
+
+	isEmptyObject: function( obj ) {
+		for ( var name in obj ) {
+			return false;
+		}
+		return true;
+	},
+
+	error: function( msg ) {
+		throw new Error( msg );
+	},
+
+	parseJSON: function( data ) {
+		if ( typeof data !== "string" || !data ) {
+			return null;
+		}
+
+		// Make sure leading/trailing whitespace is removed (IE can't handle it)
+		data = jQuery.trim( data );
+
+		// Attempt to parse using the native JSON parser first
+		if ( window.JSON && window.JSON.parse ) {
+			return window.JSON.parse( data );
+		}
+
+		// Make sure the incoming data is actual JSON
+		// Logic borrowed from http://json.org/json2.js
+		if ( rvalidchars.test( data.replace( rvalidescape, "@" )
+			.replace( rvalidtokens, "]" )
+			.replace( rvalidbraces, "")) ) {
+
+			return ( new Function( "return " + data ) )();
+
+		}
+		jQuery.error( "Invalid JSON: " + data );
+	},
+
+	// Cross-browser xml parsing
+	parseXML: function( data ) {
+		if ( typeof data !== "string" || !data ) {
+			return null;
+		}
+		var xml, tmp;
+		try {
+			if ( window.DOMParser ) { // Standard
+				tmp = new DOMParser();
+				xml = tmp.parseFromString( data , "text/xml" );
+			} else { // IE
+				xml = new ActiveXObject( "Microsoft.XMLDOM" );
+				xml.async = "false";
+				xml.loadXML( data );
+			}
+		} catch( e ) {
+			xml = undefined;
+		}
+		if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
+			jQuery.error( "Invalid XML: " + data );
+		}
+		return xml;
+	},
+
+	noop: function() {},
+
+	// Evaluates a script in a global context
+	// Workarounds based on findings by Jim Driscoll
+	// http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
+	globalEval: function( data ) {
+		if ( data && rnotwhite.test( data ) ) {
+			// We use execScript on Internet Explorer
+			// We use an anonymous function so that context is window
+			// rather than jQuery in Firefox
+			( window.execScript || function( data ) {
+				window[ "eval" ].call( window, data );
+			} )( data );
+		}
+	},
+
+	// Convert dashed to camelCase; used by the css and data modules
+	// Microsoft forgot to hump their vendor prefix (#9572)
+	camelCase: function( string ) {
+		return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
+	},
+
+	nodeName: function( elem, name ) {
+		return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
+	},
+
+	// args is for internal usage only
+	each: function( object, callback, args ) {
+		var name, i = 0,
+			length = object.length,
+			isObj = length === undefined || jQuery.isFunction( object );
+
+		if ( args ) {
+			if ( isObj ) {
+				for ( name in object ) {
+					if ( callback.apply( object[ name ], args ) === false ) {
+						break;
+					}
+				}
+			} else {
+				for ( ; i < length; ) {
+					if ( callback.apply( object[ i++ ], args ) === false ) {
+						break;
+					}
+				}
+			}
+
+		// A special, fast, case for the most common use of each
+		} else {
+			if ( isObj ) {
+				for ( name in object ) {
+					if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
+						break;
+					}
+				}
+			} else {
+				for ( ; i < length; ) {
+					if ( callback.call( object[ i ], i, object[ i++ ] ) === false ) {
+						break;
+					}
+				}
+			}
+		}
+
+		return object;
+	},
+
+	// Use native String.trim function wherever possible
+	trim: trim ?
+		function( text ) {
+			return text == null ?
+				"" :
+				trim.call( text );
+		} :
+
+		// Otherwise use our own trimming functionality
+		function( text ) {
+			return text == null ?
+				"" :
+				text.toString().replace( trimLeft, "" ).replace( trimRight, "" );
+		},
+
+	// results is for internal usage only
+	makeArray: function( array, results ) {
+		var ret = results || [];
+
+		if ( array != null ) {
+			// The window, strings (and functions) also have 'length'
+			// Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930
+			var type = jQuery.type( array );
+
+			if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) {
+				push.call( ret, array );
+			} else {
+				jQuery.merge( ret, array );
+			}
+		}
+
+		return ret;
+	},
+
+	inArray: function( elem, array, i ) {
+		var len;
+
+		if ( array ) {
+			if ( indexOf ) {
+				return indexOf.call( array, elem, i );
+			}
+
+			len = array.length;
+			i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
+
+			for ( ; i < len; i++ ) {
+				// Skip accessing in sparse arrays
+				if ( i in array && array[ i ] === elem ) {
+					return i;
+				}
+			}
+		}
+
+		return -1;
+	},
+
+	merge: function( first, second ) {
+		var i = first.length,
+			j = 0;
+
+		if ( typeof second.length === "number" ) {
+			for ( var l = second.length; j < l; j++ ) {
+				first[ i++ ] = second[ j ];
+			}
+
+		} else {
+			while ( second[j] !== undefined ) {
+				first[ i++ ] = second[ j++ ];
+			}
+		}
+
+		first.length = i;
+
+		return first;
+	},
+
+	grep: function( elems, callback, inv ) {
+		var ret = [], retVal;
+		inv = !!inv;
+
+		// Go through the array, only saving the items
+		// that pass the validator function
+		for ( var i = 0, length = elems.length; i < length; i++ ) {
+			retVal = !!callback( elems[ i ], i );
+			if ( inv !== retVal ) {
+				ret.push( elems[ i ] );
+			}
+		}
+
+		return ret;
+	},
+
+	// arg is for internal usage only
+	map: function( elems, callback, arg ) {
+		var value, key, ret = [],
+			i = 0,
+			length = elems.length,
+			// jquery objects are treated as arrays
+			isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ;
+
+		// Go through the array, translating each of the items to their
+		if ( isArray ) {
+			for ( ; i < length; i++ ) {
+				value = callback( elems[ i ], i, arg );
+
+				if ( value != null ) {
+					ret[ ret.length ] = value;
+				}
+			}
+
+		// Go through every key on the object,
+		} else {
+			for ( key in elems ) {
+				value = callback( elems[ key ], key, arg );
+
+				if ( value != null ) {
+					ret[ ret.length ] = value;
+				}
+			}
+		}
+
+		// Flatten any nested arrays
+		return ret.concat.apply( [], ret );
+	},
+
+	// A global GUID counter for objects
+	guid: 1,
+
+	// Bind a function to a context, optionally partially applying any
+	// arguments.
+	proxy: function( fn, context ) {
+		if ( typeof context === "string" ) {
+			var tmp = fn[ context ];
+			context = fn;
+			fn = tmp;
+		}
+
+		// Quick check to determine if target is callable, in the spec
+		// this throws a TypeError, but we will just return undefined.
+		if ( !jQuery.isFunction( fn ) ) {
+			return undefined;
+		}
+
+		// Simulated bind
+		var args = slice.call( arguments, 2 ),
+			proxy = function() {
+				return fn.apply( context, args.concat( slice.call( arguments ) ) );
+			};
+
+		// Set the guid of unique handler to the same of original handler, so it can be removed
+		proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
+
+		return proxy;
+	},
+
+	// Mutifunctional method to get and set values to a collection
+	// The value/s can optionally be executed if it's a function
+	access: function( elems, fn, key, value, chainable, emptyGet, pass ) {
+		var exec,
+			bulk = key == null,
+			i = 0,
+			length = elems.length;
+
+		// Sets many values
+		if ( key && typeof key === "object" ) {
+			for ( i in key ) {
+				jQuery.access( elems, fn, i, key[i], 1, emptyGet, value );
+			}
+			chainable = 1;
+
+		// Sets one value
+		} else if ( value !== undefined ) {
+			// Optionally, function values get executed if exec is true
+			exec = pass === undefined && jQuery.isFunction( value );
+
+			if ( bulk ) {
+				// Bulk operations only iterate when executing function values
+				if ( exec ) {
+					exec = fn;
+					fn = function( elem, key, value ) {
+						return exec.call( jQuery( elem ), value );
+					};
+
+				// Otherwise they run against the entire set
+				} else {
+					fn.call( elems, value );
+					fn = null;
+				}
+			}
+
+			if ( fn ) {
+				for (; i < length; i++ ) {
+					fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
+				}
+			}
+
+			chainable = 1;
+		}
+
+		return chainable ?
+			elems :
+
+			// Gets
+			bulk ?
+				fn.call( elems ) :
+				length ? fn( elems[0], key ) : emptyGet;
+	},
+
+	now: function() {
+		return ( new Date() ).getTime();
+	},
+
+	// Use of jQuery.browser is frowned upon.
+	// More details: http://docs.jquery.com/Utilities/jQuery.browser
+	uaMatch: function( ua ) {
+		ua = ua.toLowerCase();
+
+		var match = rwebkit.exec( ua ) ||
+			ropera.exec( ua ) ||
+			rmsie.exec( ua ) ||
+			ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) ||
+			[];
+
+		return { browser: match[1] || "", version: match[2] || "0" };
+	},
+
+	sub: function() {
+		function jQuerySub( selector, context ) {
+			return new jQuerySub.fn.init( selector, context );
+		}
+		jQuery.extend( true, jQuerySub, this );
+		jQuerySub.superclass = this;
+		jQuerySub.fn = jQuerySub.prototype = this();
+		jQuerySub.fn.constructor = jQuerySub;
+		jQuerySub.sub = this.sub;
+		jQuerySub.fn.init = function init( selector, context ) {
+			if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) {
+				context = jQuerySub( context );
+			}
+
+			return jQuery.fn.init.call( this, selector, context, rootjQuerySub );
+		};
+		jQuerySub.fn.init.prototype = jQuerySub.fn;
+		var rootjQuerySub = jQuerySub(document);
+		return jQuerySub;
+	},
+
+	browser: {}
+});
+
+// Populate the class2type map
+jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) {
+	class2type[ "[object " + name + "]" ] = name.toLowerCase();
+});
+
+browserMatch = jQuery.uaMatch( userAgent );
+if ( browserMatch.browser ) {
+	jQuery.browser[ browserMatch.browser ] = true;
+	jQuery.browser.version = browserMatch.version;
+}
+
+// Deprecated, use jQuery.browser.webkit instead
+if ( jQuery.browser.webkit ) {
+	jQuery.browser.safari = true;
+}
+
+// IE doesn't match non-breaking spaces with \s
+if ( rnotwhite.test( "\xA0" ) ) {
+	trimLeft = /^[\s\xA0]+/;
+	trimRight = /[\s\xA0]+$/;
+}
+
+// All jQuery objects should point back to these
+rootjQuery = jQuery(document);
+
+// Cleanup functions for the document ready method
+if ( document.addEventListener ) {
+	DOMContentLoaded = function() {
+		document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
+		jQuery.ready();
+	};
+
+} else if ( document.attachEvent ) {
+	DOMContentLoaded = function() {
+		// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
+		if ( document.readyState === "complete" ) {
+			document.detachEvent( "onreadystatechange", DOMContentLoaded );
+			jQuery.ready();
+		}
+	};
+}
+
+// The DOM ready check for Internet Explorer
+function doScrollCheck() {
+	if ( jQuery.isReady ) {
+		return;
+	}
+
+	try {
+		// If IE is used, use the trick by Diego Perini
+		// http://javascript.nwbox.com/IEContentLoaded/
+		document.documentElement.doScroll("left");
+	} catch(e) {
+		setTimeout( doScrollCheck, 1 );
+		return;
+	}
+
+	// and execute any waiting functions
+	jQuery.ready();
+}
+
+return jQuery;
+
+})();
+
+
+// String to Object flags format cache
+var flagsCache = {};
+
+// Convert String-formatted flags into Object-formatted ones and store in cache
+function createFlags( flags ) {
+	var object = flagsCache[ flags ] = {},
+		i, length;
+	flags = flags.split( /\s+/ );
+	for ( i = 0, length = flags.length; i < length; i++ ) {
+		object[ flags[i] ] = true;
+	}
+	return object;
+}
+
+/*
+ * Create a callback list using the following parameters:
+ *
+ *	flags:	an optional list of space-separated flags that will change how
+ *			the callback list behaves
+ *
+ * By default a callback list will act like an event callback list and can be
+ * "fired" multiple times.
+ *
+ * Possible flags:
+ *
+ *	once:			will ensure the callback list can only be fired once (like a Deferred)
+ *
+ *	memory:			will keep track of previous values and will call any callback added
+ *					after the list has been fired right away with the latest "memorized"
+ *					values (like a Deferred)
+ *
+ *	unique:			will ensure a callback can only be added once (no duplicate in the list)
+ *
+ *	stopOnFalse:	interrupt callings when a callback returns false
+ *
+ */
+jQuery.Callbacks = function( flags ) {
+
+	// Convert flags from String-formatted to Object-formatted
+	// (we check in cache first)
+	flags = flags ? ( flagsCache[ flags ] || createFlags( flags ) ) : {};
+
+	var // Actual callback list
+		list = [],
+		// Stack of fire calls for repeatable lists
+		stack = [],
+		// Last fire value (for non-forgettable lists)
+		memory,
+		// Flag to know if list was already fired
+		fired,
+		// Flag to know if list is currently firing
+		firing,
+		// First callback to fire (used internally by add and fireWith)
+		firingStart,
+		// End of the loop when firing
+		firingLength,
+		// Index of currently firing callback (modified by remove if needed)
+		firingIndex,
+		// Add one or several callbacks to the list
+		add = function( args ) {
+			var i,
+				length,
+				elem,
+				type,
+				actual;
+			for ( i = 0, length = args.length; i < length; i++ ) {
+				elem = args[ i ];
+				type = jQuery.type( elem );
+				if ( type === "array" ) {
+					// Inspect recursively
+					add( elem );
+				} else if ( type === "function" ) {
+					// Add if not in unique mode and callback is not in
+					if ( !flags.unique || !self.has( elem ) ) {
+						list.push( elem );
+					}
+				}
+			}
+		},
+		// Fire callbacks
+		fire = function( context, args ) {
+			args = args || [];
+			memory = !flags.memory || [ context, args ];
+			fired = true;
+			firing = true;
+			firingIndex = firingStart || 0;
+			firingStart = 0;
+			firingLength = list.length;
+			for ( ; list && firingIndex < firingLength; firingIndex++ ) {
+				if ( list[ firingIndex ].apply( context, args ) === false && flags.stopOnFalse ) {
+					memory = true; // Mark as halted
+					break;
+				}
+			}
+			firing = false;
+			if ( list ) {
+				if ( !flags.once ) {
+					if ( stack && stack.length ) {
+						memory = stack.shift();
+						self.fireWith( memory[ 0 ], memory[ 1 ] );
+					}
+				} else if ( memory === true ) {
+					self.disable();
+				} else {
+					list = [];
+				}
+			}
+		},
+		// Actual Callbacks object
+		self = {
+			// Add a callback or a collection of callbacks to the list
+			add: function() {
+				if ( list ) {
+					var length = list.length;
+					add( arguments );
+					// Do we need to add the callbacks to the
+					// current firing batch?
+					if ( firing ) {
+						firingLength = list.length;
+					// With memory, if we're not firing then
+					// we should call right away, unless previous
+					// firing was halted (stopOnFalse)
+					} else if ( memory && memory !== true ) {
+						firingStart = length;
+						fire( memory[ 0 ], memory[ 1 ] );
+					}
+				}
+				return this;
+			},
+			// Remove a callback from the list
+			remove: function() {
+				if ( list ) {
+					var args = arguments,
+						argIndex = 0,
+						argLength = args.length;
+					for ( ; argIndex < argLength ; argIndex++ ) {
+						for ( var i = 0; i < list.length; i++ ) {
+							if ( args[ argIndex ] === list[ i ] ) {
+								// Handle firingIndex and firingLength
+								if ( firing ) {
+									if ( i <= firingLength ) {
+										firingLength--;
+										if ( i <= firingIndex ) {
+											firingIndex--;
+										}
+									}
+								}
+								// Remove the element
+								list.splice( i--, 1 );
+								// If we have some unicity property then
+								// we only need to do this once
+								if ( flags.unique ) {
+									break;
+								}
+							}
+						}
+					}
+				}
+				return this;
+			},
+			// Control if a given callback is in the list
+			has: function( fn ) {
+				if ( list ) {
+					var i = 0,
+						length = list.length;
+					for ( ; i < length; i++ ) {
+						if ( fn === list[ i ] ) {
+							return true;
+						}
+					}
+				}
+				return false;
+			},
+			// Remove all callbacks from the list
+			empty: function() {
+				list = [];
+				return this;
+			},
+			// Have the list do nothing anymore
+			disable: function() {
+				list = stack = memory = undefined;
+				return this;
+			},
+			// Is it disabled?
+			disabled: function() {
+				return !list;
+			},
+			// Lock the list in its current state
+			lock: function() {
+				stack = undefined;
+				if ( !memory || memory === true ) {
+					self.disable();
+				}
+				return this;
+			},
+			// Is it locked?
+			locked: function() {
+				return !stack;
+			},
+			// Call all callbacks with the given context and arguments
+			fireWith: function( context, args ) {
+				if ( stack ) {
+					if ( firing ) {
+						if ( !flags.once ) {
+							stack.push( [ context, args ] );
+						}
+					} else if ( !( flags.once && memory ) ) {
+						fire( context, args );
+					}
+				}
+				return this;
+			},
+			// Call all the callbacks with the given arguments
+			fire: function() {
+				self.fireWith( this, arguments );
+				return this;
+			},
+			// To know if the callbacks have already been called at least once
+			fired: function() {
+				return !!fired;
+			}
+		};
+
+	return self;
+};
+
+
+
+
+var // Static reference to slice
+	sliceDeferred = [].slice;
+
+jQuery.extend({
+
+	Deferred: function( func ) {
+		var doneList = jQuery.Callbacks( "once memory" ),
+			failList = jQuery.Callbacks( "once memory" ),
+			progressList = jQuery.Callbacks( "memory" ),
+			state = "pending",
+			lists = {
+				resolve: doneList,
+				reject: failList,
+				notify: progressList
+			},
+			promise = {
+				done: doneList.add,
+				fail: failList.add,
+				progress: progressList.add,
+
+				state: function() {
+					return state;
+				},
+
+				// Deprecated
+				isResolved: doneList.fired,
+				isRejected: failList.fired,
+
+				then: function( doneCallbacks, failCallbacks, progressCallbacks ) {
+					deferred.done( doneCallbacks ).fail( failCallbacks ).progress( progressCallbacks );
+					return this;
+				},
+				always: function() {
+					deferred.done.apply( deferred, arguments ).fail.apply( deferred, arguments );
+					return this;
+				},
+				pipe: function( fnDone, fnFail, fnProgress ) {
+					return jQuery.Deferred(function( newDefer ) {
+						jQuery.each( {
+							done: [ fnDone, "resolve" ],
+							fail: [ fnFail, "reject" ],
+							progress: [ fnProgress, "notify" ]
+						}, function( handler, data ) {
+							var fn = data[ 0 ],
+								action = data[ 1 ],
+								returned;
+							if ( jQuery.isFunction( fn ) ) {
+								deferred[ handler ](function() {
+									returned = fn.apply( this, arguments );
+									if ( returned && jQuery.isFunction( returned.promise ) ) {
+										returned.promise().then( newDefer.resolve, newDefer.reject, newDefer.notify );
+									} else {
+										newDefer[ action + "With" ]( this === deferred ? newDefer : this, [ returned ] );
+									}
+								});
+							} else {
+								deferred[ handler ]( newDefer[ action ] );
+							}
+						});
+					}).promise();
+				},
+				// Get a promise for this deferred
+				// If obj is provided, the promise aspect is added to the object
+				promise: function( obj ) {
+					if ( obj == null ) {
+						obj = promise;
+					} else {
+						for ( var key in promise ) {
+							obj[ key ] = promise[ key ];
+						}
+					}
+					return obj;
+				}
+			},
+			deferred = promise.promise({}),
+			key;
+
+		for ( key in lists ) {
+			deferred[ key ] = lists[ key ].fire;
+			deferred[ key + "With" ] = lists[ key ].fireWith;
+		}
+
+		// Handle state
+		deferred.done( function() {
+			state = "resolved";
+		}, failList.disable, progressList.lock ).fail( function() {
+			state = "rejected";
+		}, doneList.disable, progressList.lock );
+
+		// Call given func if any
+		if ( func ) {
+			func.call( deferred, deferred );
+		}
+
+		// All done!
+		return deferred;
+	},
+
+	// Deferred helper
+	when: function( firstParam ) {
+		var args = sliceDeferred.call( arguments, 0 ),
+			i = 0,
+			length = args.length,
+			pValues = new Array( length ),
+			count = length,
+			pCount = length,
+			deferred = length <= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ?
+				firstParam :
+				jQuery.Deferred(),
+			promise = deferred.promise();
+		function resolveFunc( i ) {
+			return function( value ) {
+				args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;
+				if ( !( --count ) ) {
+					deferred.resolveWith( deferred, args );
+				}
+			};
+		}
+		function progressFunc( i ) {
+			return function( value ) {
+				pValues[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;
+				deferred.notifyWith( promise, pValues );
+			};
+		}
+		if ( length > 1 ) {
+			for ( ; i < length; i++ ) {
+				if ( args[ i ] && args[ i ].promise && jQuery.isFunction( args[ i ].promise ) ) {
+					args[ i ].promise().then( resolveFunc(i), deferred.reject, progressFunc(i) );
+				} else {
+					--count;
+				}
+			}
+			if ( !count ) {
+				deferred.resolveWith( deferred, args );
+			}
+		} else if ( deferred !== firstParam ) {
+			deferred.resolveWith( deferred, length ? [ firstParam ] : [] );
+		}
+		return promise;
+	}
+});
+
+
+
+
+jQuery.support = (function() {
+
+	var support,
+		all,
+		a,
+		select,
+		opt,
+		input,
+		fragment,
+		tds,
+		events,
+		eventName,
+		i,
+		isSupported,
+		div = document.createElement( "div" ),
+		documentElement = document.documentElement;
+
+	// Preliminary tests
+	div.setAttribute("className", "t");
+	div.innerHTML = "   <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
+
+	all = div.getElementsByTagName( "*" );
+	a = div.getElementsByTagName( "a" )[ 0 ];
+
+	// Can't get basic test support
+	if ( !all || !all.length || !a ) {
+		return {};
+	}
+
+	// First batch of supports tests
+	select = document.createElement( "select" );
+	opt = select.appendChild( document.createElement("option") );
+	input = div.getElementsByTagName( "input" )[ 0 ];
+
+	support = {
+		// IE strips leading whitespace when .innerHTML is used
+		leadingWhitespace: ( div.firstChild.nodeType === 3 ),
+
+		// Make sure that tbody elements aren't automatically inserted
+		// IE will insert them into empty tables
+		tbody: !div.getElementsByTagName("tbody").length,
+
+		// Make sure that link elements get serialized correctly by innerHTML
+		// This requires a wrapper element in IE
+		htmlSerialize: !!div.getElementsByTagName("link").length,
+
+		// Get the style information from getAttribute
+		// (IE uses .cssText instead)
+		style: /top/.test( a.getAttribute("style") ),
+
+		// Make sure that URLs aren't manipulated
+		// (IE normalizes it by default)
+		hrefNormalized: ( a.getAttribute("href") === "/a" ),
+
+		// Make sure that element opacity exists
+		// (IE uses filter instead)
+		// Use a regex to work around a WebKit issue. See #5145
+		opacity: /^0.55/.test( a.style.opacity ),
+
+		// Verify style float existence
+		// (IE uses styleFloat instead of cssFloat)
+		cssFloat: !!a.style.cssFloat,
+
+		// Make sure that if no value is specified for a checkbox
+		// that it defaults to "on".
+		// (WebKit defaults to "" instead)
+		checkOn: ( input.value === "on" ),
+
+		// Make sure that a selected-by-default option has a working selected property.
+		// (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
+		optSelected: opt.selected,
+
+		// Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
+		getSetAttribute: div.className !== "t",
+
+		// Tests for enctype support on a form(#6743)
+		enctype: !!document.createElement("form").enctype,
+
+		// Makes sure cloning an html5 element does not cause problems
+		// Where outerHTML is undefined, this still works
+		html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>",
+
+		// Will be defined later
+		submitBubbles: true,
+		changeBubbles: true,
+		focusinBubbles: false,
+		deleteExpando: true,
+		noCloneEvent: true,
+		inlineBlockNeedsLayout: false,
+		shrinkWrapBlocks: false,
+		reliableMarginRight: true,
+		pixelMargin: true
+	};
+
+	// jQuery.boxModel DEPRECATED in 1.3, use jQuery.support.boxModel instead
+	jQuery.boxModel = support.boxModel = (document.compatMode === "CSS1Compat");
+
+	// Make sure checked status is properly cloned
+	input.checked = true;
+	support.noCloneChecked = input.cloneNode( true ).checked;
+
+	// Make sure that the options inside disabled selects aren't marked as disabled
+	// (WebKit marks them as disabled)
+	select.disabled = true;
+	support.optDisabled = !opt.disabled;
+
+	// Test to see if it's possible to delete an expando from an element
+	// Fails in Internet Explorer
+	try {
+		delete div.test;
+	} catch( e ) {
+		support.deleteExpando = false;
+	}
+
+	if ( !div.addEventListener && div.attachEvent && div.fireEvent ) {
+		div.attachEvent( "onclick", function() {
+			// Cloning a node shouldn't copy over any
+			// bound event handlers (IE does this)
+			support.noCloneEvent = false;
+		});
+		div.cloneNode( true ).fireEvent( "onclick" );
+	}
+
+	// Check if a radio maintains its value
+	// after being appended to the DOM
+	input = document.createElement("input");
+	input.value = "t";
+	input.setAttribute("type", "radio");
+	support.radioValue = input.value === "t";
+
+	input.setAttribute("checked", "checked");
+
+	// #11217 - WebKit loses check when the name is after the checked attribute
+	input.setAttribute( "name", "t" );
+
+	div.appendChild( input );
+	fragment = document.createDocumentFragment();
+	fragment.appendChild( div.lastChild );
+
+	// WebKit doesn't clone checked state correctly in fragments
+	support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
+
+	// Check if a disconnected checkbox will retain its checked
+	// value of true after appended to the DOM (IE6/7)
+	support.appendChecked = input.checked;
+
+	fragment.removeChild( input );
+	fragment.appendChild( div );
+
+	// Technique from Juriy Zaytsev
+	// http://perfectionkills.com/detecting-event-support-without-browser-sniffing/
+	// We only care about the case where non-standard event systems
+	// are used, namely in IE. Short-circuiting here helps us to
+	// avoid an eval call (in setAttribute) which can cause CSP
+	// to go haywire. See: https://developer.mozilla.org/en/Security/CSP
+	if ( div.attachEvent ) {
+		for ( i in {
+			submit: 1,
+			change: 1,
+			focusin: 1
+		}) {
+			eventName = "on" + i;
+			isSupported = ( eventName in div );
+			if ( !isSupported ) {
+				div.setAttribute( eventName, "return;" );
+				isSupported = ( typeof div[ eventName ] === "function" );
+			}
+			support[ i + "Bubbles" ] = isSupported;
+		}
+	}
+
+	fragment.removeChild( div );
+
+	// Null elements to avoid leaks in IE
+	fragment = select = opt = div = input = null;
+
+	// Run tests that need a body at doc ready
+	jQuery(function() {
+		var container, outer, inner, table, td, offsetSupport,
+			marginDiv, conMarginTop, style, html, positionTopLeftWidthHeight,
+			paddingMarginBorderVisibility, paddingMarginBorder,
+			body = document.getElementsByTagName("body")[0];
+
+		if ( !body ) {
+			// Return for frameset docs that don't have a body
+			return;
+		}
+
+		conMarginTop = 1;
+		paddingMarginBorder = "padding:0;margin:0;border:";
+		positionTopLeftWidthHeight = "position:absolute;top:0;left:0;width:1px;height:1px;";
+		paddingMarginBorderVisibility = paddingMarginBorder + "0;visibility:hidden;";
+		style = "style='" + positionTopLeftWidthHeight + paddingMarginBorder + "5px solid #000;";
+		html = "<div " + style + "display:block;'><div style='" + paddingMarginBorder + "0;display:block;overflow:hidden;'></div></div>" +
+			"<table " + style + "' cellpadding='0' cellspacing='0'>" +
+			"<tr><td></td></tr></table>";
+
+		container = document.createElement("div");
+		container.style.cssText = paddingMarginBorderVisibility + "width:0;height:0;position:static;top:0;margin-top:" + conMarginTop + "px";
+		body.insertBefore( container, body.firstChild );
+
+		// Construct the test element
+		div = document.createElement("div");
+		container.appendChild( div );
+
+		// Check if table cells still have offsetWidth/Height when they are set
+		// to display:none and there are still other visible table cells in a
+		// table row; if so, offsetWidth/Height are not reliable for use when
+		// determining if an element has been hidden directly using
+		// display:none (it is still safe to use offsets if a parent element is
+		// hidden; don safety goggles and see bug #4512 for more information).
+		// (only IE 8 fails this test)
+		div.innerHTML = "<table><tr><td style='" + paddingMarginBorder + "0;display:none'></td><td>t</td></tr></table>";
+		tds = div.getElementsByTagName( "td" );
+		isSupported = ( tds[ 0 ].offsetHeight === 0 );
+
+		tds[ 0 ].style.display = "";
+		tds[ 1 ].style.display = "none";
+
+		// Check if empty table cells still have offsetWidth/Height
+		// (IE <= 8 fail this test)
+		support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
+
+		// Check if div with explicit width and no margin-right incorrectly
+		// gets computed margin-right based on width of container. For more
+		// info see bug #3333
+		// Fails in WebKit before Feb 2011 nightlies
+		// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
+		if ( window.getComputedStyle ) {
+			div.innerHTML = "";
+			marginDiv = document.createElement( "div" );
+			marginDiv.style.width = "0";
+			marginDiv.style.marginRight = "0";
+			div.style.width = "2px";
+			div.appendChild( marginDiv );
+			support.reliableMarginRight =
+				( parseInt( ( window.getComputedStyle( marginDiv, null ) || { marginRight: 0 } ).marginRight, 10 ) || 0 ) === 0;
+		}
+
+		if ( typeof div.style.zoom !== "undefined" ) {
+			// Check if natively block-level elements act like inline-block
+			// elements when setting their display to 'inline' and giving
+			// them layout
+			// (IE < 8 does this)
+			div.innerHTML = "";
+			div.style.width = div.style.padding = "1px";
+			div.style.border = 0;
+			div.style.overflow = "hidden";
+			div.style.display = "inline";
+			div.style.zoom = 1;
+			support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 );
+
+			// Check if elements with layout shrink-wrap their children
+			// (IE 6 does this)
+			div.style.display = "block";
+			div.style.overflow = "visible";
+			div.innerHTML = "<div style='width:5px;'></div>";
+			support.shrinkWrapBlocks = ( div.offsetWidth !== 3 );
+		}
+
+		div.style.cssText = positionTopLeftWidthHeight + paddingMarginBorderVisibility;
+		div.innerHTML = html;
+
+		outer = div.firstChild;
+		inner = outer.firstChild;
+		td = outer.nextSibling.firstChild.firstChild;
+
+		offsetSupport = {
+			doesNotAddBorder: ( inner.offsetTop !== 5 ),
+			doesAddBorderForTableAndCells: ( td.offsetTop === 5 )
+		};
+
+		inner.style.position = "fixed";
+		inner.style.top = "20px";
+
+		// safari subtracts parent border width here which is 5px
+		offsetSupport.fixedPosition = ( inner.offsetTop === 20 || inner.offsetTop === 15 );
+		inner.style.position = inner.style.top = "";
+
+		outer.style.overflow = "hidden";
+		outer.style.position = "relative";
+
+		offsetSupport.subtractsBorderForOverflowNotVisible = ( inner.offsetTop === -5 );
+		offsetSupport.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== conMarginTop );
+
+		if ( window.getComputedStyle ) {
+			div.style.marginTop = "1%";
+			support.pixelMargin = ( window.getComputedStyle( div, null ) || { marginTop: 0 } ).marginTop !== "1%";
+		}
+
+		if ( typeof container.style.zoom !== "undefined" ) {
+			container.style.zoom = 1;
+		}
+
+		body.removeChild( container );
+		marginDiv = div = container = null;
+
+		jQuery.extend( support, offsetSupport );
+	});
+
+	return support;
+})();
+
+
+
+
+var rbrace = /^(?:\{.*\}|\[.*\])$/,
+	rmultiDash = /([A-Z])/g;
+
+jQuery.extend({
+	cache: {},
+
+	// Please use with caution
+	uuid: 0,
+
+	// Unique for each copy of jQuery on the page
+	// Non-digits removed to match rinlinejQuery
+	expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ),
+
+	// The following elements throw uncatchable exceptions if you
+	// attempt to add expando properties to them.
+	noData: {
+		"embed": true,
+		// Ban all objects except for Flash (which handle expandos)
+		"object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
+		"applet": true
+	},
+
+	hasData: function( elem ) {
+		elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
+		return !!elem && !isEmptyDataObject( elem );
+	},
+
+	data: function( elem, name, data, pvt /* Internal Use Only */ ) {
+		if ( !jQuery.acceptData( elem ) ) {
+			return;
+		}
+
+		var privateCache, thisCache, ret,
+			internalKey = jQuery.expando,
+			getByName = typeof name === "string",
+
+			// We have to handle DOM nodes and JS objects differently because IE6-7
+			// can't GC object references properly across the DOM-JS boundary
+			isNode = elem.nodeType,
+
+			// Only DOM nodes need the global jQuery cache; JS object data is
+			// attached directly to the object so GC can occur automatically
+			cache = isNode ? jQuery.cache : elem,
+
+			// Only defining an ID for JS objects if its cache already exists allows
+			// the code to shortcut on the same path as a DOM node with no cache
+			id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey,
+			isEvents = name === "events";
+
+		// Avoid doing any more work than we need to when trying to get data on an
+		// object that has no data at all
+		if ( (!id || !cache[id] || (!isEvents && !pvt && !cache[id].data)) && getByName && data === undefined ) {
+			return;
+		}
+
+		if ( !id ) {
+			// Only DOM nodes need a new unique ID for each element since their data
+			// ends up in the global cache
+			if ( isNode ) {
+				elem[ internalKey ] = id = ++jQuery.uuid;
+			} else {
+				id = internalKey;
+			}
+		}
+
+		if ( !cache[ id ] ) {
+			cache[ id ] = {};
+
+			// Avoids exposing jQuery metadata on plain JS objects when the object
+			// is serialized using JSON.stringify
+			if ( !isNode ) {
+				cache[ id ].toJSON = jQuery.noop;
+			}
+		}
+
+		// An object can be passed to jQuery.data instead of a key/value pair; this gets
+		// shallow copied over onto the existing cache
+		if ( typeof name === "object" || typeof name === "function" ) {
+			if ( pvt ) {
+				cache[ id ] = jQuery.extend( cache[ id ], name );
+			} else {
+				cache[ id ].data = jQuery.extend( cache[ id ].data, name );
+			}
+		}
+
+		privateCache = thisCache = cache[ id ];
+
+		// jQuery data() is stored in a separate object inside the object's internal data
+		// cache in order to avoid key collisions between internal data and user-defined
+		// data.
+		if ( !pvt ) {
+			if ( !thisCache.data ) {
+				thisCache.data = {};
+			}
+
+			thisCache = thisCache.data;
+		}
+
+		if ( data !== undefined ) {
+			thisCache[ jQuery.camelCase( name ) ] = data;
+		}
+
+		// Users should not attempt to inspect the internal events object using jQuery.data,
+		// it is undocumented and subject to change. But does anyone listen? No.
+		if ( isEvents && !thisCache[ name ] ) {
+			return privateCache.events;
+		}
+
+		// Check for both converted-to-camel and non-converted data property names
+		// If a data property was specified
+		if ( getByName ) {
+
+			// First Try to find as-is property data
+			ret = thisCache[ name ];
+
+			// Test for null|undefined property data
+			if ( ret == null ) {
+
+				// Try to find the camelCased property
+				ret = thisCache[ jQuery.camelCase( name ) ];
+			}
+		} else {
+			ret = thisCache;
+		}
+
+		return ret;
+	},
+
+	removeData: function( elem, name, pvt /* Internal Use Only */ ) {
+		if ( !jQuery.acceptData( elem ) ) {
+			return;
+		}
+
+		var thisCache, i, l,
+
+			// Reference to internal data cache key
+			internalKey = jQuery.expando,
+
+			isNode = elem.nodeType,
+
+			// See jQuery.data for more information
+			cache = isNode ? jQuery.cache : elem,
+
+			// See jQuery.data for more information
+			id = isNode ? elem[ internalKey ] : internalKey;
+
+		// If there is already no cache entry for this object, there is no
+		// purpose in continuing
+		if ( !cache[ id ] ) {
+			return;
+		}
+
+		if ( name ) {
+
+			thisCache = pvt ? cache[ id ] : cache[ id ].data;
+
+			if ( thisCache ) {
+
+				// Support array or space separated string names for data keys
+				if ( !jQuery.isArray( name ) ) {
+
+					// try the string as a key before any manipulation
+					if ( name in thisCache ) {
+						name = [ name ];
+					} else {
+
+						// split the camel cased version by spaces unless a key with the spaces exists
+						name = jQuery.camelCase( name );
+						if ( name in thisCache ) {
+							name = [ name ];
+						} else {
+							name = name.split( " " );
+						}
+					}
+				}
+
+				for ( i = 0, l = name.length; i < l; i++ ) {
+					delete thisCache[ name[i] ];
+				}
+
+				// If there is no data left in the cache, we want to continue
+				// and let the cache object itself get destroyed
+				if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) {
+					return;
+				}
+			}
+		}
+
+		// See jQuery.data for more information
+		if ( !pvt ) {
+			delete cache[ id ].data;
+
+			// Don't destroy the parent cache unless the internal data object
+			// had been the only thing left in it
+			if ( !isEmptyDataObject(cache[ id ]) ) {
+				return;
+			}
+		}
+
+		// Browsers that fail expando deletion also refuse to delete expandos on
+		// the window, but it will allow it on all other JS objects; other browsers
+		// don't care
+		// Ensure that `cache` is not a window object #10080
+		if ( jQuery.support.deleteExpando || !cache.setInterval ) {
+			delete cache[ id ];
+		} else {
+			cache[ id ] = null;
+		}
+
+		// We destroyed the cache and need to eliminate the expando on the node to avoid
+		// false lookups in the cache for entries that no longer exist
+		if ( isNode ) {
+			// IE does not allow us to delete expando properties from nodes,
+			// nor does it have a removeAttribute function on Document nodes;
+			// we must handle all of these cases
+			if ( jQuery.support.deleteExpando ) {
+				delete elem[ internalKey ];
+			} else if ( elem.removeAttribute ) {
+				elem.removeAttribute( internalKey );
+			} else {
+				elem[ internalKey ] = null;
+			}
+		}
+	},
+
+	// For internal use only.
+	_data: function( elem, name, data ) {
+		return jQuery.data( elem, name, data, true );
+	},
+
+	// A method for determining if a DOM node can handle the data expando
+	acceptData: function( elem ) {
+		if ( elem.nodeName ) {
+			var match = jQuery.noData[ elem.nodeName.toLowerCase() ];
+
+			if ( match ) {
+				return !(match === true || elem.getAttribute("classid") !== match);
+			}
+		}
+
+		return true;
+	}
+});
+
+jQuery.fn.extend({
+	data: function( key, value ) {
+		var parts, part, attr, name, l,
+			elem = this[0],
+			i = 0,
+			data = null;
+
+		// Gets all values
+		if ( key === undefined ) {
+			if ( this.length ) {
+				data = jQuery.data( elem );
+
+				if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {
+					attr = elem.attributes;
+					for ( l = attr.length; i < l; i++ ) {
+						name = attr[i].name;
+
+						if ( name.indexOf( "data-" ) === 0 ) {
+							name = jQuery.camelCase( name.substring(5) );
+
+							dataAttr( elem, name, data[ name ] );
+						}
+					}
+					jQuery._data( elem, "parsedAttrs", true );
+				}
+			}
+
+			return data;
+		}
+
+		// Sets multiple values
+		if ( typeof key === "object" ) {
+			return this.each(function() {
+				jQuery.data( this, key );
+			});
+		}
+
+		parts = key.split( ".", 2 );
+		parts[1] = parts[1] ? "." + parts[1] : "";
+		part = parts[1] + "!";
+
+		return jQuery.access( this, function( value ) {
+
+			if ( value === undefined ) {
+				data = this.triggerHandler( "getData" + part, [ parts[0] ] );
+
+				// Try to fetch any internally stored data first
+				if ( data === undefined && elem ) {
+					data = jQuery.data( elem, key );
+					data = dataAttr( elem, key, data );
+				}
+
+				return data === undefined && parts[1] ?
+					this.data( parts[0] ) :
+					data;
+			}
+
+			parts[1] = value;
+			this.each(function() {
+				var self = jQuery( this );
+
+				self.triggerHandler( "setData" + part, parts );
+				jQuery.data( this, key, value );
+				self.triggerHandler( "changeData" + part, parts );
+			});
+		}, null, value, arguments.length > 1, null, false );
+	},
+
+	removeData: function( key ) {
+		return this.each(function() {
+			jQuery.removeData( this, key );
+		});
+	}
+});
+
+function dataAttr( elem, key, data ) {
+	// If nothing was found internally, try to fetch any
+	// data from the HTML5 data-* attribute
+	if ( data === undefined && elem.nodeType === 1 ) {
+
+		var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
+
+		data = elem.getAttribute( name );
+
+		if ( typeof data === "string" ) {
+			try {
+				data = data === "true" ? true :
+				data === "false" ? false :
+				data === "null" ? null :
+				jQuery.isNumeric( data ) ? +data :
+					rbrace.test( data ) ? jQuery.parseJSON( data ) :
+					data;
+			} catch( e ) {}
+
+			// Make sure we set the data so it isn't changed later
+			jQuery.data( elem, key, data );
+
+		} else {
+			data = undefined;
+		}
+	}
+
+	return data;
+}
+
+// checks a cache object for emptiness
+function isEmptyDataObject( obj ) {
+	for ( var name in obj ) {
+
+		// if the public data object is empty, the private is still empty
+		if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {
+			continue;
+		}
+		if ( name !== "toJSON" ) {
+			return false;
+		}
+	}
+
+	return true;
+}
+
+
+
+
+function handleQueueMarkDefer( elem, type, src ) {
+	var deferDataKey = type + "defer",
+		queueDataKey = type + "queue",
+		markDataKey = type + "mark",
+		defer = jQuery._data( elem, deferDataKey );
+	if ( defer &&
+		( src === "queue" || !jQuery._data(elem, queueDataKey) ) &&
+		( src === "mark" || !jQuery._data(elem, markDataKey) ) ) {
+		// Give room for hard-coded callbacks to fire first
+		// and eventually mark/queue something else on the element
+		setTimeout( function() {
+			if ( !jQuery._data( elem, queueDataKey ) &&
+				!jQuery._data( elem, markDataKey ) ) {
+				jQuery.removeData( elem, deferDataKey, true );
+				defer.fire();
+			}
+		}, 0 );
+	}
+}
+
+jQuery.extend({
+
+	_mark: function( elem, type ) {
+		if ( elem ) {
+			type = ( type || "fx" ) + "mark";
+			jQuery._data( elem, type, (jQuery._data( elem, type ) || 0) + 1 );
+		}
+	},
+
+	_unmark: function( force, elem, type ) {
+		if ( force !== true ) {
+			type = elem;
+			elem = force;
+			force = false;
+		}
+		if ( elem ) {
+			type = type || "fx";
+			var key = type + "mark",
+				count = force ? 0 : ( (jQuery._data( elem, key ) || 1) - 1 );
+			if ( count ) {
+				jQuery._data( elem, key, count );
+			} else {
+				jQuery.removeData( elem, key, true );
+				handleQueueMarkDefer( elem, type, "mark" );
+			}
+		}
+	},
+
+	queue: function( elem, type, data ) {
+		var q;
+		if ( elem ) {
+			type = ( type || "fx" ) + "queue";
+			q = jQuery._data( elem, type );
+
+			// Speed up dequeue by getting out quickly if this is just a lookup
+			if ( data ) {
+				if ( !q || jQuery.isArray(data) ) {
+					q = jQuery._data( elem, type, jQuery.makeArray(data) );
+				} else {
+					q.push( data );
+				}
+			}
+			return q || [];
+		}
+	},
+
+	dequeue: function( elem, type ) {
+		type = type || "fx";
+
+		var queue = jQuery.queue( elem, type ),
+			fn = queue.shift(),
+			hooks = {};
+
+		// If the fx queue is dequeued, always remove the progress sentinel
+		if ( fn === "inprogress" ) {
+			fn = queue.shift();
+		}
+
+		if ( fn ) {
+			// Add a progress sentinel to prevent the fx queue from being
+			// automatically dequeued
+			if ( type === "fx" ) {
+				queue.unshift( "inprogress" );
+			}
+
+			jQuery._data( elem, type + ".run", hooks );
+			fn.call( elem, function() {
+				jQuery.dequeue( elem, type );
+			}, hooks );
+		}
+
+		if ( !queue.length ) {
+			jQuery.removeData( elem, type + "queue " + type + ".run", true );
+			handleQueueMarkDefer( elem, type, "queue" );
+		}
+	}
+});
+
+jQuery.fn.extend({
+	queue: function( type, data ) {
+		var setter = 2;
+
+		if ( typeof type !== "string" ) {
+			data = type;
+			type = "fx";
+			setter--;
+		}
+
+		if ( arguments.length < setter ) {
+			return jQuery.queue( this[0], type );
+		}
+
+		return data === undefined ?
+			this :
+			this.each(function() {
+				var queue = jQuery.queue( this, type, data );
+
+				if ( type === "fx" && queue[0] !== "inprogress" ) {
+					jQuery.dequeue( this, type );
+				}
+			});
+	},
+	dequeue: function( type ) {
+		return this.each(function() {
+			jQuery.dequeue( this, type );
+		});
+	},
+	// Based off of the plugin by Clint Helfers, with permission.
+	// http://blindsignals.com/index.php/2009/07/jquery-delay/
+	delay: function( time, type ) {
+		time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
+		type = type || "fx";
+
+		return this.queue( type, function( next, hooks ) {
+			var timeout = setTimeout( next, time );
+			hooks.stop = function() {
+				clearTimeout( timeout );
+			};
+		});
+	},
+	clearQueue: function( type ) {
+		return this.queue( type || "fx", [] );
+	},
+	// Get a promise resolved when queues of a certain type
+	// are emptied (fx is the type by default)
+	promise: function( type, object ) {
+		if ( typeof type !== "string" ) {
+			object = type;
+			type = undefined;
+		}
+		type = type || "fx";
+		var defer = jQuery.Deferred(),
+			elements = this,
+			i = elements.length,
+			count = 1,
+			deferDataKey = type + "defer",
+			queueDataKey = type + "queue",
+			markDataKey = type + "mark",
+			tmp;
+		function resolve() {
+			if ( !( --count ) ) {
+				defer.resolveWith( elements, [ elements ] );
+			}
+		}
+		while( i-- ) {
+			if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) ||
+					( jQuery.data( elements[ i ], queueDataKey, undefined, true ) ||
+						jQuery.data( elements[ i ], markDataKey, undefined, true ) ) &&
+					jQuery.data( elements[ i ], deferDataKey, jQuery.Callbacks( "once memory" ), true ) )) {
+				count++;
+				tmp.add( resolve );
+			}
+		}
+		resolve();
+		return defer.promise( object );
+	}
+});
+
+
+
+
+var rclass = /[\n\t\r]/g,
+	rspace = /\s+/,
+	rreturn = /\r/g,
+	rtype = /^(?:button|input)$/i,
+	rfocusable = /^(?:button|input|object|select|textarea)$/i,
+	rclickable = /^a(?:rea)?$/i,
+	rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
+	getSetAttribute = jQuery.support.getSetAttribute,
+	nodeHook, boolHook, fixSpecified;
+
+jQuery.fn.extend({
+	attr: function( name, value ) {
+		return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 );
+	},
+
+	removeAttr: function( name ) {
+		return this.each(function() {
+			jQuery.removeAttr( this, name );
+		});
+	},
+
+	prop: function( name, value ) {
+		return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 );
+	},
+
+	removeProp: function( name ) {
+		name = jQuery.propFix[ name ] || name;
+		return this.each(function() {
+			// try/catch handles cases where IE balks (such as removing a property on window)
+			try {
+				this[ name ] = undefined;
+				delete this[ name ];
+			} catch( e ) {}
+		});
+	},
+
+	addClass: function( value ) {
+		var classNames, i, l, elem,
+			setClass, c, cl;
+
+		if ( jQuery.isFunction( value ) ) {
+			return this.each(function( j ) {
+				jQuery( this ).addClass( value.call(this, j, this.className) );
+			});
+		}
+
+		if ( value && typeof value === "string" ) {
+			classNames = value.split( rspace );
+
+			for ( i = 0, l = this.length; i < l; i++ ) {
+				elem = this[ i ];
+
+				if ( elem.nodeType === 1 ) {
+					if ( !elem.className && classNames.length === 1 ) {
+						elem.className = value;
+
+					} else {
+						setClass = " " + elem.className + " ";
+
+						for ( c = 0, cl = classNames.length; c < cl; c++ ) {
+							if ( !~setClass.indexOf( " " + classNames[ c ] + " " ) ) {
+								setClass += classNames[ c ] + " ";
+							}
+						}
+						elem.className = jQuery.trim( setClass );
+					}
+				}
+			}
+		}
+
+		return this;
+	},
+
+	removeClass: function( value ) {
+		var classNames, i, l, elem, className, c, cl;
+
+		if ( jQuery.isFunction( value ) ) {
+			return this.each(function( j ) {
+				jQuery( this ).removeClass( value.call(this, j, this.className) );
+			});
+		}
+
+		if ( (value && typeof value === "string") || value === undefined ) {
+			classNames = ( value || "" ).split( rspace );
+
+			for ( i = 0, l = this.length; i < l; i++ ) {
+				elem = this[ i ];
+
+				if ( elem.nodeType === 1 && elem.className ) {
+					if ( value ) {
+						className = (" " + elem.className + " ").replace( rclass, " " );
+						for ( c = 0, cl = classNames.length; c < cl; c++ ) {
+							className = className.replace(" " + classNames[ c ] + " ", " ");
+						}
+						elem.className = jQuery.trim( className );
+
+					} else {
+						elem.className = "";
+					}
+				}
+			}
+		}
+
+		return this;
+	},
+
+	toggleClass: function( value, stateVal ) {
+		var type = typeof value,
+			isBool = typeof stateVal === "boolean";
+
+		if ( jQuery.isFunction( value ) ) {
+			return this.each(function( i ) {
+				jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
+			});
+		}
+
+		return this.each(function() {
+			if ( type === "string" ) {
+				// toggle individual class names
+				var className,
+					i = 0,
+					self = jQuery( this ),
+					state = stateVal,
+					classNames = value.split( rspace );
+
+				while ( (className = classNames[ i++ ]) ) {
+					// check each className given, space seperated list
+					state = isBool ? state : !self.hasClass( className );
+					self[ state ? "addClass" : "removeClass" ]( className );
+				}
+
+			} else if ( type === "undefined" || type === "boolean" ) {
+				if ( this.className ) {
+					// store className if set
+					jQuery._data( this, "__className__", this.className );
+				}
+
+				// toggle whole className
+				this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
+			}
+		});
+	},
+
+	hasClass: function( selector ) {
+		var className = " " + selector + " ",
+			i = 0,
+			l = this.length;
+		for ( ; i < l; i++ ) {
+			if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
+				return true;
+			}
+		}
+
+		return false;
+	},
+
+	val: function( value ) {
+		var hooks, ret, isFunction,
+			elem = this[0];
+
+		if ( !arguments.length ) {
+			if ( elem ) {
+				hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
+
+				if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
+					return ret;
+				}
+
+				ret = elem.value;
+
+				return typeof ret === "string" ?
+					// handle most common string cases
+					ret.replace(rreturn, "") :
+					// handle cases where value is null/undef or number
+					ret == null ? "" : ret;
+			}
+
+			return;
+		}
+
+		isFunction = jQuery.isFunction( value );
+
+		return this.each(function( i ) {
+			var self = jQuery(this), val;
+
+			if ( this.nodeType !== 1 ) {
+				return;
+			}
+
+			if ( isFunction ) {
+				val = value.call( this, i, self.val() );
+			} else {
+				val = value;
+			}
+
+			// Treat null/undefined as ""; convert numbers to string
+			if ( val == null ) {
+				val = "";
+			} else if ( typeof val === "number" ) {
+				val += "";
+			} else if ( jQuery.isArray( val ) ) {
+				val = jQuery.map(val, function ( value ) {
+					return value == null ? "" : value + "";
+				});
+			}
+
+			hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
+
+			// If set returns undefined, fall back to normal setting
+			if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
+				this.value = val;
+			}
+		});
+	}
+});
+
+jQuery.extend({
+	valHooks: {
+		option: {
+			get: function( elem ) {
+				// attributes.value is undefined in Blackberry 4.7 but
+				// uses .value. See #6932
+				var val = elem.attributes.value;
+				return !val || val.specified ? elem.value : elem.text;
+			}
+		},
+		select: {
+			get: function( elem ) {
+				var value, i, max, option,
+					index = elem.selectedIndex,
+					values = [],
+					options = elem.options,
+					one = elem.type === "select-one";
+
+				// Nothing was selected
+				if ( index < 0 ) {
+					return null;
+				}
+
+				// Loop through all the selected options
+				i = one ? index : 0;
+				max = one ? index + 1 : options.length;
+				for ( ; i < max; i++ ) {
+					option = options[ i ];
+
+					// Don't return options that are disabled or in a disabled optgroup
+					if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) &&
+							(!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) {
+
+						// Get the specific value for the option
+						value = jQuery( option ).val();
+
+						// We don't need an array for one selects
+						if ( one ) {
+							return value;
+						}
+
+						// Multi-Selects return an array
+						values.push( value );
+					}
+				}
+
+				// Fixes Bug #2551 -- select.val() broken in IE after form.reset()
+				if ( one && !values.length && options.length ) {
+					return jQuery( options[ index ] ).val();
+				}
+
+				return values;
+			},
+
+			set: function( elem, value ) {
+				var values = jQuery.makeArray( value );
+
+				jQuery(elem).find("option").each(function() {
+					this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
+				});
+
+				if ( !values.length ) {
+					elem.selectedIndex = -1;
+				}
+				return values;
+			}
+		}
+	},
+
+	attrFn: {
+		val: true,
+		css: true,
+		html: true,
+		text: true,
+		data: true,
+		width: true,
+		height: true,
+		offset: true
+	},
+
+	attr: function( elem, name, value, pass ) {
+		var ret, hooks, notxml,
+			nType = elem.nodeType;
+
+		// don't get/set attributes on text, comment and attribute nodes
+		if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
+			return;
+		}
+
+		if ( pass && name in jQuery.attrFn ) {
+			return jQuery( elem )[ name ]( value );
+		}
+
+		// Fallback to prop when attributes are not supported
+		if ( typeof elem.getAttribute === "undefined" ) {
+			return jQuery.prop( elem, name, value );
+		}
+
+		notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
+
+		// All attributes are lowercase
+		// Grab necessary hook if one is defined
+		if ( notxml ) {
+			name = name.toLowerCase();
+			hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook );
+		}
+
+		if ( value !== undefined ) {
+
+			if ( value === null ) {
+				jQuery.removeAttr( elem, name );
+				return;
+
+			} else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) {
+				return ret;
+
+			} else {
+				elem.setAttribute( name, "" + value );
+				return value;
+			}
+
+		} else if ( hooks && "get" in hooks && notxml && (ret = hooks.get( elem, name )) !== null ) {
+			return ret;
+
+		} else {
+
+			ret = elem.getAttribute( name );
+
+			// Non-existent attributes return null, we normalize to undefined
+			return ret === null ?
+				undefined :
+				ret;
+		}
+	},
+
+	removeAttr: function( elem, value ) {
+		var propName, attrNames, name, l, isBool,
+			i = 0;
+
+		if ( value && elem.nodeType === 1 ) {
+			attrNames = value.toLowerCase().split( rspace );
+			l = attrNames.length;
+
+			for ( ; i < l; i++ ) {
+				name = attrNames[ i ];
+
+				if ( name ) {
+					propName = jQuery.propFix[ name ] || name;
+					isBool = rboolean.test( name );
+
+					// See #9699 for explanation of this approach (setting first, then removal)
+					// Do not do this for boolean attributes (see #10870)
+					if ( !isBool ) {
+						jQuery.attr( elem, name, "" );
+					}
+					elem.removeAttribute( getSetAttribute ? name : propName );
+
+					// Set corresponding property to false for boolean attributes
+					if ( isBool && propName in elem ) {
+						elem[ propName ] = false;
+					}
+				}
+			}
+		}
+	},
+
+	attrHooks: {
+		type: {
+			set: function( elem, value ) {
+				// We can't allow the type property to be changed (since it causes problems in IE)
+				if ( rtype.test( elem.nodeName ) && elem.parentNode ) {
+					jQuery.error( "type property can't be changed" );
+				} else if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
+					// Setting the type on a radio button after the value resets the value in IE6-9
+					// Reset value to it's default in case type is set after value
+					// This is for element creation
+					var val = elem.value;
+					elem.setAttribute( "type", value );
+					if ( val ) {
+						elem.value = val;
+					}
+					return value;
+				}
+			}
+		},
+		// Use the value property for back compat
+		// Use the nodeHook for button elements in IE6/7 (#1954)
+		value: {
+			get: function( elem, name ) {
+				if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
+					return nodeHook.get( elem, name );
+				}
+				return name in elem ?
+					elem.value :
+					null;
+			},
+			set: function( elem, value, name ) {
+				if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
+					return nodeHook.set( elem, value, name );
+				}
+				// Does not return so that setAttribute is also used
+				elem.value = value;
+			}
+		}
+	},
+
+	propFix: {
+		tabindex: "tabIndex",
+		readonly: "readOnly",
+		"for": "htmlFor",
+		"class": "className",
+		maxlength: "maxLength",
+		cellspacing: "cellSpacing",
+		cellpadding: "cellPadding",
+		rowspan: "rowSpan",
+		colspan: "colSpan",
+		usemap: "useMap",
+		frameborder: "frameBorder",
+		contenteditable: "contentEditable"
+	},
+
+	prop: function( elem, name, value ) {
+		var ret, hooks, notxml,
+			nType = elem.nodeType;
+
+		// don't get/set properties on text, comment and attribute nodes
+		if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
+			return;
+		}
+
+		notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
+
+		if ( notxml ) {
+			// Fix name and attach hooks
+			name = jQuery.propFix[ name ] || name;
+			hooks = jQuery.propHooks[ name ];
+		}
+
+		if ( value !== undefined ) {
+			if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
+				return ret;
+
+			} else {
+				return ( elem[ name ] = value );
+			}
+
+		} else {
+			if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
+				return ret;
+
+			} else {
+				return elem[ name ];
+			}
+		}
+	},
+
+	propHooks: {
+		tabIndex: {
+			get: function( elem ) {
+				// elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
+				// http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
+				var attributeNode = elem.getAttributeNode("tabindex");
+
+				return attributeNode && attributeNode.specified ?
+					parseInt( attributeNode.value, 10 ) :
+					rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
+						0 :
+						undefined;
+			}
+		}
+	}
+});
+
+// Add the tabIndex propHook to attrHooks for back-compat (different case is intentional)
+jQuery.attrHooks.tabindex = jQuery.propHooks.tabIndex;
+
+// Hook for boolean attributes
+boolHook = {
+	get: function( elem, name ) {
+		// Align boolean attributes with corresponding properties
+		// Fall back to attribute presence where some booleans are not supported
+		var attrNode,
+			property = jQuery.prop( elem, name );
+		return property === true || typeof property !== "boolean" && ( attrNode = elem.getAttributeNode(name) ) && attrNode.nodeValue !== false ?
+			name.toLowerCase() :
+			undefined;
+	},
+	set: function( elem, value, name ) {
+		var propName;
+		if ( value === false ) {
+			// Remove boolean attributes when set to false
+			jQuery.removeAttr( elem, name );
+		} else {
+			// value is true since we know at this point it's type boolean and not false
+			// Set boolean attributes to the same name and set the DOM property
+			propName = jQuery.propFix[ name ] || name;
+			if ( propName in elem ) {
+				// Only set the IDL specifically if it already exists on the element
+				elem[ propName ] = true;
+			}
+
+			elem.setAttribute( name, name.toLowerCase() );
+		}
+		return name;
+	}
+};
+
+// IE6/7 do not support getting/setting some attributes with get/setAttribute
+if ( !getSetAttribute ) {
+
+	fixSpecified = {
+		name: true,
+		id: true,
+		coords: true
+	};
+
+	// Use this for any attribute in IE6/7
+	// This fixes almost every IE6/7 issue
+	nodeHook = jQuery.valHooks.button = {
+		get: function( elem, name ) {
+			var ret;
+			ret = elem.getAttributeNode( name );
+			return ret && ( fixSpecified[ name ] ? ret.nodeValue !== "" : ret.specified ) ?
+				ret.nodeValue :
+				undefined;
+		},
+		set: function( elem, value, name ) {
+			// Set the existing or create a new attribute node
+			var ret = elem.getAttributeNode( name );
+			if ( !ret ) {
+				ret = document.createAttribute( name );
+				elem.setAttributeNode( ret );
+			}
+			return ( ret.nodeValue = value + "" );
+		}
+	};
+
+	// Apply the nodeHook to tabindex
+	jQuery.attrHooks.tabindex.set = nodeHook.set;
+
+	// Set width and height to auto instead of 0 on empty string( Bug #8150 )
+	// This is for removals
+	jQuery.each([ "width", "height" ], function( i, name ) {
+		jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
+			set: function( elem, value ) {
+				if ( value === "" ) {
+					elem.setAttribute( name, "auto" );
+					return value;
+				}
+			}
+		});
+	});
+
+	// Set contenteditable to false on removals(#10429)
+	// Setting to empty string throws an error as an invalid value
+	jQuery.attrHooks.contenteditable = {
+		get: nodeHook.get,
+		set: function( elem, value, name ) {
+			if ( value === "" ) {
+				value = "false";
+			}
+			nodeHook.set( elem, value, name );
+		}
+	};
+}
+
+
+// Some attributes require a special call on IE
+if ( !jQuery.support.hrefNormalized ) {
+	jQuery.each([ "href", "src", "width", "height" ], function( i, name ) {
+		jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
+			get: function( elem ) {
+				var ret = elem.getAttribute( name, 2 );
+				return ret === null ? undefined : ret;
+			}
+		});
+	});
+}
+
+if ( !jQuery.support.style ) {
+	jQuery.attrHooks.style = {
+		get: function( elem ) {
+			// Return undefined in the case of empty string
+			// Normalize to lowercase since IE uppercases css property names
+			return elem.style.cssText.toLowerCase() || undefined;
+		},
+		set: function( elem, value ) {
+			return ( elem.style.cssText = "" + value );
+		}
+	};
+}
+
+// Safari mis-reports the default selected property of an option
+// Accessing the parent's selectedIndex property fixes it
+if ( !jQuery.support.optSelected ) {
+	jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, {
+		get: function( elem ) {
+			var parent = elem.parentNode;
+
+			if ( parent ) {
+				parent.selectedIndex;
+
+				// Make sure that it also works with optgroups, see #5701
+				if ( parent.parentNode ) {
+					parent.parentNode.selectedIndex;
+				}
+			}
+			return null;
+		}
+	});
+}
+
+// IE6/7 call enctype encoding
+if ( !jQuery.support.enctype ) {
+	jQuery.propFix.enctype = "encoding";
+}
+
+// Radios and checkboxes getter/setter
+if ( !jQuery.support.checkOn ) {
+	jQuery.each([ "radio", "checkbox" ], function() {
+		jQuery.valHooks[ this ] = {
+			get: function( elem ) {
+				// Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
+				return elem.getAttribute("value") === null ? "on" : elem.value;
+			}
+		};
+	});
+}
+jQuery.each([ "radio", "checkbox" ], function() {
+	jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], {
+		set: function( elem, value ) {
+			if ( jQuery.isArray( value ) ) {
+				return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
+			}
+		}
+	});
+});
+
+
+
+
+var rformElems = /^(?:textarea|input|select)$/i,
+	rtypenamespace = /^([^\.]*)?(?:\.(.+))?$/,
+	rhoverHack = /(?:^|\s)hover(\.\S+)?\b/,
+	rkeyEvent = /^key/,
+	rmouseEvent = /^(?:mouse|contextmenu)|click/,
+	rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
+	rquickIs = /^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,
+	quickParse = function( selector ) {
+		var quick = rquickIs.exec( selector );
+		if ( quick ) {
+			//   0  1    2   3
+			// [ _, tag, id, class ]
+			quick[1] = ( quick[1] || "" ).toLowerCase();
+			quick[3] = quick[3] && new RegExp( "(?:^|\\s)" + quick[3] + "(?:\\s|$)" );
+		}
+		return quick;
+	},
+	quickIs = function( elem, m ) {
+		var attrs = elem.attributes || {};
+		return (
+			(!m[1] || elem.nodeName.toLowerCase() === m[1]) &&
+			(!m[2] || (attrs.id || {}).value === m[2]) &&
+			(!m[3] || m[3].test( (attrs[ "class" ] || {}).value ))
+		);
+	},
+	hoverHack = function( events ) {
+		return jQuery.event.special.hover ? events : events.replace( rhoverHack, "mouseenter$1 mouseleave$1" );
+	};
+
+/*
+ * Helper functions for managing events -- not part of the public interface.
+ * Props to Dean Edwards' addEvent library for many of the ideas.
+ */
+jQuery.event = {
+
+	add: function( elem, types, handler, data, selector ) {
+
+		var elemData, eventHandle, events,
+			t, tns, type, namespaces, handleObj,
+			handleObjIn, quick, handlers, special;
+
+		// Don't attach events to noData or text/comment nodes (allow plain objects tho)
+		if ( elem.nodeType === 3 || elem.nodeType === 8 || !types || !handler || !(elemData = jQuery._data( elem )) ) {
+			return;
+		}
+
+		// Caller can pass in an object of custom data in lieu of the handler
+		if ( handler.handler ) {
+			handleObjIn = handler;
+			handler = handleObjIn.handler;
+			selector = handleObjIn.selector;
+		}
+
+		// Make sure that the handler has a unique ID, used to find/remove it later
+		if ( !handler.guid ) {
+			handler.guid = jQuery.guid++;
+		}
+
+		// Init the element's event structure and main handler, if this is the first
+		events = elemData.events;
+		if ( !events ) {
+			elemData.events = events = {};
+		}
+		eventHandle = elemData.handle;
+		if ( !eventHandle ) {
+			elemData.handle = eventHandle = function( e ) {
+				// Discard the second event of a jQuery.event.trigger() and
+				// when an event is called after a page has unloaded
+				return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ?
+					jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
+					undefined;
+			};
+			// Add elem as a property of the handle fn to prevent a memory leak with IE non-native events
+			eventHandle.elem = elem;
+		}
+
+		// Handle multiple events separated by a space
+		// jQuery(...).bind("mouseover mouseout", fn);
+		types = jQuery.trim( hoverHack(types) ).split( " " );
+		for ( t = 0; t < types.length; t++ ) {
+
+			tns = rtypenamespace.exec( types[t] ) || [];
+			type = tns[1];
+			namespaces = ( tns[2] || "" ).split( "." ).sort();
+
+			// If event changes its type, use the special event handlers for the changed type
+			special = jQuery.event.special[ type ] || {};
+
+			// If selector defined, determine special event api type, otherwise given type
+			type = ( selector ? special.delegateType : special.bindType ) || type;
+
+			// Update special based on newly reset type
+			special = jQuery.event.special[ type ] || {};
+
+			// handleObj is passed to all event handlers
+			handleObj = jQuery.extend({
+				type: type,
+				origType: tns[1],
+				data: data,
+				handler: handler,
+				guid: handler.guid,
+				selector: selector,
+				quick: selector && quickParse( selector ),
+				namespace: namespaces.join(".")
+			}, handleObjIn );
+
+			// Init the event handler queue if we're the first
+			handlers = events[ type ];
+			if ( !handlers ) {
+				handlers = events[ type ] = [];
+				handlers.delegateCount = 0;
+
+				// Only use addEventListener/attachEvent if the special events handler returns false
+				if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
+					// Bind the global event handler to the element
+					if ( elem.addEventListener ) {
+						elem.addEventListener( type, eventHandle, false );
+
+					} else if ( elem.attachEvent ) {
+						elem.attachEvent( "on" + type, eventHandle );
+					}
+				}
+			}
+
+			if ( special.add ) {
+				special.add.call( elem, handleObj );
+
+				if ( !handleObj.handler.guid ) {
+					handleObj.handler.guid = handler.guid;
+				}
+			}
+
+			// Add to the element's handler list, delegates in front
+			if ( selector ) {
+				handlers.splice( handlers.delegateCount++, 0, handleObj );
+			} else {
+				handlers.push( handleObj );
+			}
+
+			// Keep track of which events have ever been used, for event optimization
+			jQuery.event.global[ type ] = true;
+		}
+
+		// Nullify elem to prevent memory leaks in IE
+		elem = null;
+	},
+
+	global: {},
+
+	// Detach an event or set of events from an element
+	remove: function( elem, types, handler, selector, mappedTypes ) {
+
+		var elemData = jQuery.hasData( elem ) && jQuery._data( elem ),
+			t, tns, type, origType, namespaces, origCount,
+			j, events, special, handle, eventType, handleObj;
+
+		if ( !elemData || !(events = elemData.events) ) {
+			return;
+		}
+
+		// Once for each type.namespace in types; type may be omitted
+		types = jQuery.trim( hoverHack( types || "" ) ).split(" ");
+		for ( t = 0; t < types.length; t++ ) {
+			tns = rtypenamespace.exec( types[t] ) || [];
+			type = origType = tns[1];
+			namespaces = tns[2];
+
+			// Unbind all events (on this namespace, if provided) for the element
+			if ( !type ) {
+				for ( type in events ) {
+					jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
+				}
+				continue;
+			}
+
+			special = jQuery.event.special[ type ] || {};
+			type = ( selector? special.delegateType : special.bindType ) || type;
+			eventType = events[ type ] || [];
+			origCount = eventType.length;
+			namespaces = namespaces ? new RegExp("(^|\\.)" + namespaces.split(".").sort().join("\\.(?:.*\\.)?") + "(\\.|$)") : null;
+
+			// Remove matching events
+			for ( j = 0; j < eventType.length; j++ ) {
+				handleObj = eventType[ j ];
+
+				if ( ( mappedTypes || origType === handleObj.origType ) &&
+					 ( !handler || handler.guid === handleObj.guid ) &&
+					 ( !namespaces || namespaces.test( handleObj.namespace ) ) &&
+					 ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
+					eventType.splice( j--, 1 );
+
+					if ( handleObj.selector ) {
+						eventType.delegateCount--;
+					}
+					if ( special.remove ) {
+						special.remove.call( elem, handleObj );
+					}
+				}
+			}
+
+			// Remove generic event handler if we removed something and no more handlers exist
+			// (avoids potential for endless recursion during removal of special event handlers)
+			if ( eventType.length === 0 && origCount !== eventType.length ) {
+				if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
+					jQuery.removeEvent( elem, type, elemData.handle );
+				}
+
+				delete events[ type ];
+			}
+		}
+
+		// Remove the expando if it's no longer used
+		if ( jQuery.isEmptyObject( events ) ) {
+			handle = elemData.handle;
+			if ( handle ) {
+				handle.elem = null;
+			}
+
+			// removeData also checks for emptiness and clears the expando if empty
+			// so use it instead of delete
+			jQuery.removeData( elem, [ "events", "handle" ], true );
+		}
+	},
+
+	// Events that are safe to short-circuit if no handlers are attached.
+	// Native DOM events should not be added, they may have inline handlers.
+	customEvent: {
+		"getData": true,
+		"setData": true,
+		"changeData": true
+	},
+
+	trigger: function( event, data, elem, onlyHandlers ) {
+		// Don't do events on text and comment nodes
+		if ( elem && (elem.nodeType === 3 || elem.nodeType === 8) ) {
+			return;
+		}
+
+		// Event object or event type
+		var type = event.type || event,
+			namespaces = [],
+			cache, exclusive, i, cur, old, ontype, special, handle, eventPath, bubbleType;
+
+		// focus/blur morphs to focusin/out; ensure we're not firing them right now
+		if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
+			return;
+		}
+
+		if ( type.indexOf( "!" ) >= 0 ) {
+			// Exclusive events trigger only for the exact event (no namespaces)
+			type = type.slice(0, -1);
+			exclusive = true;
+		}
+
+		if ( type.indexOf( "." ) >= 0 ) {
+			// Namespaced trigger; create a regexp to match event type in handle()
+			namespaces = type.split(".");
+			type = namespaces.shift();
+			namespaces.sort();
+		}
+
+		if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) {
+			// No jQuery handlers for this event type, and it can't have inline handlers
+			return;
+		}
+
+		// Caller can pass in an Event, Object, or just an event type string
+		event = typeof event === "object" ?
+			// jQuery.Event object
+			event[ jQuery.expando ] ? event :
+			// Object literal
+			new jQuery.Event( type, event ) :
+			// Just the event type (string)
+			new jQuery.Event( type );
+
+		event.type = type;
+		event.isTrigger = true;
+		event.exclusive = exclusive;
+		event.namespace = namespaces.join( "." );
+		event.namespace_re = event.namespace? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)") : null;
+		ontype = type.indexOf( ":" ) < 0 ? "on" + type : "";
+
+		// Handle a global trigger
+		if ( !elem ) {
+
+			// TODO: Stop taunting the data cache; remove global events and always attach to document
+			cache = jQuery.cache;
+			for ( i in cache ) {
+				if ( cache[ i ].events && cache[ i ].events[ type ] ) {
+					jQuery.event.trigger( event, data, cache[ i ].handle.elem, true );
+				}
+			}
+			return;
+		}
+
+		// Clean up the event in case it is being reused
+

<TRUNCATED>

[34/51] [abbrv] [partial] brooklyn-ui git commit: move subdir from incubator up a level as it is promoted to its own repo (first non-incubator commit!)

Posted by he...@apache.org.
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/js/view/application-add-wizard.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/js/view/application-add-wizard.js b/brooklyn-ui/src/main/webapp/assets/js/view/application-add-wizard.js
deleted file mode 100644
index 2c4f012..0000000
--- a/brooklyn-ui/src/main/webapp/assets/js/view/application-add-wizard.js
+++ /dev/null
@@ -1,838 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-/**
- * Builds a Twitter Bootstrap modal as the framework for a Wizard.
- * Also creates an empty Application model.
- */
-define([
-    "underscore", "jquery", "backbone", "brooklyn-utils", "js-yaml",
-    "model/entity", "model/application", "model/location", "model/catalog-application",
-    "text!tpl/app-add-wizard/modal-wizard.html",
-    "text!tpl/app-add-wizard/create.html",
-    "text!tpl/app-add-wizard/create-step-template-entry.html", 
-    "text!tpl/app-add-wizard/create-entity-entry.html", 
-    "text!tpl/app-add-wizard/required-config-entry.html",
-    "text!tpl/app-add-wizard/edit-config-entry.html",
-    "text!tpl/app-add-wizard/deploy.html",
-    "text!tpl/app-add-wizard/deploy-version-option.html",
-    "text!tpl/app-add-wizard/deploy-location-row.html",
-    "text!tpl/app-add-wizard/deploy-location-option.html",
-    "bootstrap"
-    
-], function (_, $, Backbone, Util, JsYaml, Entity, Application, Location, CatalogApplication,
-             ModalHtml, CreateHtml, CreateStepTemplateEntryHtml, CreateEntityEntryHtml,
-             RequiredConfigEntryHtml, EditConfigEntryHtml, DeployHtml,
-             DeployVersionOptionHtml, DeployLocationRowHtml, DeployLocationOptionHtml
-) {
-
-    /** Special ID to indicate that no locations will be provided when starting the server. */
-    var NO_LOCATION_INDICATOR = "__NONE__";
-
-    function setVisibility(obj, isVisible) {
-        if (isVisible) obj.show();
-        else obj.hide();
-    }
-
-    function setEnablement(obj, isEnabled) {
-        obj.attr("disabled", !isEnabled)
-    }
-    
-    /** converts old-style spec with "entities" to camp-style spec with services */
-    function oldSpecToCamp(spec) {
-        var services;
-        if (spec.type) {
-            services = [entityToCamp({type: spec.type, version: spec.version, config: spec.config})];
-        } else if (spec.entities) {
-            services = [];
-            var entities = spec.entities;
-            for (var i = 0; i < entities.length; i++) {
-                services.push(entityToCamp(entities[i]));
-            }
-        }
-        var result = {};
-        if (spec.name) result.name = spec.name;
-        if (spec.locations) {
-          if (spec.locations.length>1)
-            result.locations = spec.locations;
-          else
-            result.location = spec.locations[0];
-        }
-        if (services) result.services = services;
-        // NB: currently nothing else is supported in this spec
-        return result;
-    }
-    function entityToCamp(entity) {
-        var result = {};
-        if (entity.name && (!options || !options.exclude_name)) result.name = entity.name;
-        if (entity.type) result.type = entity.type;
-        if (entity.type && entity.version) result.type += ":" + entity.version;
-        if (entity.config && _.size(entity.config)) result["brooklyn.config"] = entity.config;
-        return result;
-    }
-    function getConvertedConfigValue(value) {
-        try {
-            return $.parseJSON(value);
-        } catch (e) {
-            return value;
-        }
-    }
-    
-    var ModalWizard = Backbone.View.extend({
-        tagName:'div',
-        className:'modal hide fade',
-        events:{
-            'click #prev_step':'prevStep',
-            'click #next_step':'nextStep',
-            'click #preview_step':'previewStep',
-            'click #finish_step':'finishStep'
-        },
-        template:_.template(ModalHtml),
-        initialize:function () {
-            this.catalog = {}
-            this.catalog.applications = {}
-            this.model = {}
-            this.model.spec = new Application.Spec;
-            this.model.yaml = "";
-            this.model.mode = "template";  // or "yaml" or "other"
-            this.currentStep = 0;
-            this.steps = [
-                          {
-                              step_id:'what-app',
-                              title:'Create Application',
-                              instructions:'Choose or build the application to deploy',
-                              view:new ModalWizard.StepCreate({ model:this.model, wizard: this, catalog: this.catalog })
-                          },
-                          {
-                              // TODO rather than make this another step -- since we now on preview revert to the yaml tab
-                              // this should probably be shown in the catalog tab, replacing the other contents.
-                              step_id:'name-and-locations',
-                              title:'<%= appName %>',
-                              instructions:'Specify the locations to deploy to and any additional configuration',
-                              view:new ModalWizard.StepDeploy({ model:this.model, catalog: this.catalog })
-                          }
-                          ]
-        },
-        beforeClose:function () {
-            // ensure we close the sub-views
-            _.each(this.steps, function (step) {
-                step.view.close()
-            }, this)
-        },
-        render:function () {
-            this.$el.html(this.template({}))
-            this.renderCurrentStep()
-            return this
-        },
-
-        renderCurrentStep:function (callback) {
-            var name = this.model.name || "";
-            this.title = this.$("h3#step_title")
-            this.instructions = this.$("p#step_instructions")
-
-            var currentStepObj = this.steps[this.currentStep]
-            this.title.html(_.template(currentStepObj.title)({appName: name}));
-            this.instructions.html(currentStepObj.instructions)
-            this.currentView = currentStepObj.view
-            
-            // delegate to sub-views !!
-            this.currentView.render()
-            this.currentView.updateForState()
-            this.$(".modal-body").replaceWith(this.currentView.el)
-            if (callback) callback(this.currentView);
-
-            this.updateButtonVisibility();
-        },
-        updateButtonVisibility:function () {
-            var currentStepObj = this.steps[this.currentStep]
-            
-            setVisibility(this.$("#prev_step"), (this.currentStep > 0))
-
-            // next shown for first step, but not for yaml
-            var nextVisible = (this.currentStep < 1) && (this.model.mode != "yaml")
-            setVisibility(this.$("#next_step"), nextVisible)
-            
-            // previous shown for step 2 (but again, not yaml)
-            var previewVisible = (this.currentStep == 1) && (this.model.mode != "yaml")
-            setVisibility(this.$("#preview_step"), previewVisible)
-            
-            // now set next/preview enablement
-            if (nextVisible || previewVisible) {
-                var nextEnabled = true;
-                if (this.currentStep==0 && this.model.mode=="template" && currentStepObj && currentStepObj.view) {
-                    // disable if this is template selction (lozenge) view, and nothing is selected
-                    if (! currentStepObj.view.selectedTemplate)
-                        nextEnabled = false;
-                }
-                
-                if (nextVisible)
-                    setEnablement(this.$("#next_step"), nextEnabled)
-                if (previewVisible)
-                    setEnablement(this.$("#preview_step"), nextEnabled)
-            }
-            
-            // finish from config step, preview step, and from first step if yaml tab selected (and valid)
-            var finishVisible = (this.currentStep >= 1)
-            var finishEnabled = finishVisible
-            if (!finishEnabled && this.currentStep==0) {
-                if (this.model.mode == "yaml") {
-                    // should do better validation than non-empty
-                    finishVisible = true;
-                    var yaml_code = this.$("#yaml_code").val()
-                    if (yaml_code) {
-                        finishEnabled = true;
-                    }
-                }
-            }
-            setVisibility(this.$("#finish_step"), finishVisible)
-            setEnablement(this.$("#finish_step"), finishEnabled)
-        },
-        
-        submitApplication:function (event) {
-            var that = this
-            var $modal = $('.add-app #modal-container .modal')
-            $modal.fadeTo(500,0.5);
-            
-            var yaml;
-            if (this.model.mode == "yaml") {
-                yaml = this.model.yaml;
-            } else {
-                // Drop any "None" locations.
-                this.model.spec.pruneLocations();
-                yaml = JsYaml.safeDump(oldSpecToCamp(this.model.spec.toJSON()));
-            }
-
-            $.ajax({
-                url:'/v1/applications',
-                type:'post',
-                contentType:'application/yaml',
-                processData:false,
-                data:yaml,
-                success:function (data) {
-                    that.onSubmissionComplete(true, data, $modal)
-                },
-                error:function (data) {
-                    that.onSubmissionComplete(false, data, $modal)
-                }
-            });
-
-            return false
-        },
-        onSubmissionComplete: function(succeeded, data, $modal) {
-            var that = this;
-            if (succeeded) {
-                $modal.modal('hide')
-                $modal.fadeTo(500,1);
-                if (that.options.callback) that.options.callback();             
-            } else {
-                log("ERROR submitting application: "+data.responseText);
-                var response, summary="Server responded with an error";
-                try {
-                    if (data.responseText) {
-                        response = JSON.parse(data.responseText)
-                        if (response) {
-                            summary = response.message;
-                        } 
-                    }
-                } catch (e) {
-                    summary = data.responseText;
-                }
-                that.$el.fadeTo(100,1).delay(200).fadeTo(200,0.2).delay(200).fadeTo(200,1);
-                that.steps[that.currentStep].view.showFailure(summary)
-            }
-        },
-
-        prevStep:function () {
-            this.currentStep -= 1;
-            this.renderCurrentStep();
-        },
-        nextStep:function () {
-            if (this.currentStep == 0) {
-                if (this.currentView.validate()) {
-                    var yaml = (this.currentView && this.currentView.selectedTemplate && this.currentView.selectedTemplate.yaml);
-                    if (yaml) {
-                        try {
-                            yaml = JsYaml.safeLoad(yaml);
-                            hasLocation = yaml.location || yaml.locations;
-                            if (!hasLocation) {
-                              // look for locations defined in locations
-                              svcs = yaml.services;
-                              if (svcs) {
-                                for (svcI in svcs) {
-                                  if (svcs[svcI].location || svcs[svcI].locations) {
-                                    hasLocation = true;
-                                    break;
-                                  }
-                                }
-                              }
-                            }
-                            yaml = (hasLocation ? true : false);
-                        } catch (e) {
-                            log("Warning: could not parse yaml template")
-                            log(yaml);
-                            yaml = false;
-                        }
-                    }
-                    if (yaml) {
-                        // it's a yaml catalog template which includes a location, show the yaml tab
-           	            $("ul#app-add-wizard-create-tab").find("a[href='#yamlTab']").tab('show');
-                        $("#yaml_code").setCaretToStart();
-                    } else {
-                        // it's a java catalog template or yaml template without a location, go to wizard
-                        this.currentStep += 1;
-                        this.renderCurrentStep();
-                    }
-                } else {
-                    // the call to validate will have done the showFailure
-                }
-            } else {
-                throw "Unexpected step: "+this.currentStep;
-            }
-        },
-        previewStep:function () {
-            if (this.currentView.validate()) {
-                this.currentStep = 0;
-                var that = this;
-                this.renderCurrentStep(function callback(view) {
-                    // Drop any "None" locations.
-                    that.model.spec.pruneLocations();
-                    $("textarea#yaml_code").val(JsYaml.safeDump(oldSpecToCamp(that.model.spec.toJSON())));
-                    $("ul#app-add-wizard-create-tab").find("a[href='#yamlTab']").tab('show');
-                    $("#yaml_code").setCaretToStart();
-                });
-            } else {
-                // call to validate should showFailure
-            }
-        },
-        finishStep:function () {
-            if (this.currentView.validate()) {
-                this.submitApplication()
-            } else {
-                // call to validate should showFailure
-            }
-        }
-    })
-    
-    // Note: this does not restore values on a back click; setting type and entity type+name is easy,
-    // but relevant config lines is a little bit more tedious
-    ModalWizard.StepCreate = Backbone.View.extend({
-        className:'modal-body',
-        events:{
-            'click #add-app-entity':'addEntityBox',
-            'click .editable-entity-heading':'expandEntity',
-            'click .remove-entity-button':'removeEntityClick',
-            'click .editable-entity-button':'saveEntityClick',
-            'click #remove-config':'removeConfigRow',
-            'click #add-config':'addConfigRow',
-            'click .template-lozenge':'templateClick',
-            'keyup .text-filter input':'applyFilter',
-            'change .text-filter input':'applyFilter',
-            'paste .text-filter input':'applyFilter',
-            'keyup #yaml_code':'onYamlCodeChange',
-            'change #yaml_code':'onYamlCodeChange',
-            'paste #yaml_code':'onYamlCodeChange',
-            'shown a[data-toggle="tab"]':'onTabChange',
-            'click #templateTab #catalog-add':'switchToCatalogAdd',
-            'click #templateTab #catalog-yaml':'showYamlTab'
-        },
-        template:_.template(CreateHtml),
-        wizard: null,
-        initialize:function () {
-            var self = this
-            self.catalogEntityIds = []
-
-            this.$el.html(this.template({}))
-
-            // for building from entities
-            this.addEntityBox()
-
-            // TODO: Make into models, allow options to override, then pass in in test
-            // with overrridden url. Can then think about fixing tests in application-add-wizard-spec.js.
-            $.get('/v1/catalog/entities', {}, function (result) {
-                self.catalogEntityItems = result
-                self.catalogEntityIds = _.map(result, function(item) { return item.id })
-                self.$(".entity-type-input").typeahead().data('typeahead').source = self.catalogEntityIds
-            })
-            this.options.catalog.applications = new CatalogApplication.Collection();
-            this.options.catalog.applications.fetch({
-                data: $.param({
-                    allVersions: true
-                }),
-                success: function (collection, response, options) {
-                    self.$("#appClassTab .application-type-input").typeahead().data('typeahead').source = collection.getTypes();
-                    $('#catalog-applications-throbber').hide();
-                    $('#catalog-applications-empty').hide();
-                    if (collection.size() > 0) {
-                        self.addTemplateLozenges()
-                    } else {
-                        $('#catalog-applications-empty').show();
-                        self.showYamlTab();
-                    }
-                }
-            });
-        },
-        renderConfiguredEntities:function () {
-            var $configuredEntities = this.$('#entitiesAccordionish').empty()
-            var that = this
-            if (this.model.spec.get("entities") && this.model.spec.get("entities").length > 0) {
-                _.each(this.model.spec.get("entities"), function (entity) {
-                    that.addEntityHtml($configuredEntities, entity)
-                })
-            }
-        },
-        updateForState: function () {},
-        render:function () {
-            this.renderConfiguredEntities()
-            this.delegateEvents()
-            return this
-        },
-        onTabChange: function(e) {
-            var tabText = $(e.target).text();
-            if (tabText=="Catalog") {
-                $("li.text-filter").show()
-            } else {
-                $("li.text-filter").hide()
-            }
-
-            if (tabText=="YAML") {
-                this.model.mode = "yaml";
-            } else if (tabText=="Template") {
-                this.model.mode = "template";
-            } else {
-                this.model.mode = "other";
-            }
-
-            if (this.options.wizard)
-                this.options.wizard.updateButtonVisibility();
-        },
-        onYamlCodeChange: function() {
-            if (this.options.wizard)
-                this.options.wizard.updateButtonVisibility();
-        },
-        switchToCatalogAdd: function() {
-            var $modal = $('.add-app #modal-container .modal')
-            $modal.modal('hide');
-            window.location.href="#v1/catalog/new";
-        },
-        showYamlTab: function() {
-            $("ul#app-add-wizard-create-tab").find("a[href='#yamlTab']").tab('show')
-            $("#yaml_code").focus();
-        },
-        applyFilter: function(e) {
-            var filter = $(e.currentTarget).val().toLowerCase()
-            if (!filter) {
-                $(".template-lozenge").show()
-            } else {
-                _.each($(".template-lozenge"), function(it) {
-                    var viz = $(it).text().toLowerCase().indexOf(filter)>=0
-                    if (viz)
-                        $(it).show()
-                    else
-                        $(it).hide()
-                })
-            }
-        },
-        addTemplateLozenges: function(event) {
-            var that = this
-            _.each(this.options.catalog.applications.getDistinctApplications(), function(item) {
-                that.addTemplateLozenge(that, item[0])
-            })
-        },
-        addTemplateLozenge: function(that, item) {
-            var $tempel = _.template(CreateStepTemplateEntryHtml, {
-                id: item.get('id'),
-                type: item.get('type'),
-                name: item.get('name') || item.get('id'),
-                description: item.get('description'),
-                planYaml:  item.get('planYaml'),
-                iconUrl: item.get('iconUrl')
-            })
-            $("#create-step-template-entries", that.$el).append($tempel)
-        },
-        templateClick: function(event) {
-            var $tl = $(event.target).closest(".template-lozenge");
-            var wasSelected = $tl.hasClass("selected")
-            $(".template-lozenge").removeClass("selected")
-            if (!wasSelected) {
-                $tl.addClass("selected")
-                this.selectedTemplate = {
-                    id: $tl.attr('id'),
-                    type: $tl.data('type'),
-                    name: $tl.data("name"),
-                    yaml: $tl.data("yaml"),
-                };
-                if (this.selectedTemplate.yaml) {
-                    $("textarea#yaml_code").val(this.selectedTemplate.yaml);
-                } else {
-                    $("textarea#yaml_code").val("services:\n- type: "+this.selectedTemplate.type);
-                }
-            } else {
-                this.selectedTemplate = null;
-            }
-
-            if (this.options.wizard)
-                this.options.wizard.updateButtonVisibility();
-        },
-        expandEntity:function (event) {
-            $(event.currentTarget).next().show('fast').delay(1000).prev().hide('slow')
-        },
-        saveEntityClick:function (event) {
-            this.saveEntity($(event.currentTarget).closest(".editable-entity-group"));
-        },
-        saveEntity:function ($entityGroup) {
-            var that = this
-            var name = $('#entity-name',$entityGroup).val()
-            var type = $('#entity-type',$entityGroup).val()
-            if (type=="" || !_.contains(that.catalogEntityIds, type)) {
-                that.showFailure("Missing or invalid type");
-                return false
-            }
-            var saveTarget = this.model.spec.get("entities")[$entityGroup.index()];
-            this.model.spec.set("type", null)
-            saveTarget.name = name
-            saveTarget.type = type
-            saveTarget.config = this.getConfigMap($entityGroup)
-
-            if (name=="") name=type;
-            if (name=="") name="<i>(new entity)</i>";
-            $('#entity-name-header',$entityGroup).html( name )
-            $('.editable-entity-body',$entityGroup).prev().show('fast').next().hide('fast')
-            return true;
-        },
-        getConfigMap:function (root) {
-            var map = {}
-            $('.app-add-wizard-config-entry',root).each( function (index,elt) {
-                var value = getConvertedConfigValue($('#value',elt).val());
-                if (value !== null) {
-                    map[$('#key',elt).val()] = value;
-                }
-            })
-            return map;
-        },
-        saveTemplate:function () {
-            if (!this.selectedTemplate) return false
-            var type = this.selectedTemplate.type;
-            if (!this.options.catalog.applications.hasType(type)) {
-                $('.entity-info-message').show('slow').delay(2000).hide('slow')
-                return false
-            }
-
-            this.model.spec.set("type", type);
-            this.model.name = this.selectedTemplate.name;
-            this.model.catalogEntityData = "LOAD"
-            return true;
-        },
-        saveAppClass:function () {
-            var that = this
-            var tab = $.find('#appClassTab')
-            var type = $(tab).find('#app-java-type').val()
-            if (!this.options.catalog.applications.hasType(type)) {
-                $('.entity-info-message').show('slow').delay(2000).hide('slow')
-                return false
-            }
-            this.model.spec.set("type", type);
-            return true;
-        },
-        addEntityBox:function () {
-            var entity = new Entity.Model
-            this.model.spec.addEntity( entity )
-            this.addEntityHtml($('#entitiesAccordionish', this.$el), entity)
-        },
-        addEntityHtml:function (parent, entity) {
-            var $entity = _.template(CreateEntityEntryHtml, {})
-            var that = this
-            parent.append($entity)
-            parent.children().last().find('.entity-type-input').typeahead({ source: that.catalogEntityIds })
-        },
-        removeEntityClick:function (event) {
-            var $entityGroup = $(event.currentTarget).parent().parent().parent();
-            this.model.spec.removeEntityIndex($entityGroup.index())
-            $entityGroup.remove()
-        },
-
-        addConfigRow:function (event) {
-            var $row = _.template(EditConfigEntryHtml, {})
-            $(event.currentTarget).parent().prev().append($row)
-        },
-        removeConfigRow:function (event) {
-            $(event.currentTarget).parent().remove()
-        },
-
-        validate:function () {
-            var that = this
-            var tabName = $('#app-add-wizard-create-tab li[class="active"] a').attr('href')
-            if (tabName=='#entitiesTab') {
-                delete this.model.spec.attributes["id"]
-                var allokay = true
-                $($.find('.editable-entity-group')).each(
-                    function (i,$entityGroup) {
-                        allokay = that.saveEntity($($entityGroup)) & allokay
-                    })
-                if (!allokay) return false;
-                if (this.model.spec.get("entities") && this.model.spec.get("entities").length > 0) {
-                    this.model.spec.set("type", null);
-                    return true;
-                }
-            } else if (tabName=='#templateTab') {
-                delete this.model.spec.attributes["id"]
-                if (this.saveTemplate()) {
-                    this.model.spec.set("entities", []);
-                    return true
-                }
-            } else if (tabName=='#appClassTab') {
-                delete this.model.spec.attributes["id"]
-                if (this.saveAppClass()) {
-                    this.model.spec.set("entities", []);
-                    return true
-                }
-            } else if (tabName=='#yamlTab') {
-                this.model.yaml = this.$("#yaml_code").val();
-                if (this.model.yaml) {
-                    return true;
-                }
-            } else {
-                console.info("NOT IMPLEMENTED YET")
-                // TODO - other tabs not implemented yet 
-                // do nothing, show error return false below
-            }
-            this.showFailure("Invalid application type/spec");
-            return false
-        },
-
-        showFailure: function(text) {
-            if (!text) text = "Failure performing the specified action";
-            this.$('div.error-message .error-message-text').html(_.escape(text));
-            this.$('div.error-message').slideDown(250).delay(10000).slideUp(500);
-        }
-
-    })
-
-    ModalWizard.StepDeploy = Backbone.View.extend({
-        className:'modal-body',
-
-        events:{
-            'click #add-selector-container':'addLocation',
-            'click #remove-app-location':'removeLocation',
-            'change .select-version': 'selectionVersion',
-            'change .select-location': 'selectionLocation',
-            'blur #application-name':'updateName',
-            'click #remove-config':'removeConfigRow',
-            'click #add-config':'addConfigRow'
-        },
-
-        template:_.template(DeployHtml),
-        versionOptionTemplate:_.template(DeployVersionOptionHtml),
-        locationRowTemplate:_.template(DeployLocationRowHtml),
-        locationOptionTemplate:_.template(DeployLocationOptionHtml),
-
-        initialize:function () {
-            this.model.spec.on("change", this.render, this)
-            this.$el.html(this.template())
-            this.locations = new Location.Collection()
-        },
-        beforeClose:function () {
-            this.model.spec.off("change", this.render)
-        },
-        renderName:function () {
-            this.$('#application-name').val(this.model.spec.get("name"))
-        },
-        renderVersions: function() {
-            var optionTemplate = this.versionOptionTemplate
-                select = this.$('.select-version')
-                container = this.$('#app-versions')
-                defaultVersion = '0.0.0.SNAPSHOT';
-
-            select.empty();
-
-            var versions = this.options.catalog.applications.getVersions(this.model.spec.get('type'));
-            for (var vi = 0; vi < versions.length; vi++) {
-                var version = versions[vi];
-                select.append(optionTemplate({
-                    version: version
-                }));
-            }
-
-            if (versions.length === 1 && versions[0] === defaultVersion) {
-                this.model.spec.set('version', '');
-                container.hide();
-            } else {
-                this.model.spec.set('version', versions[0]);
-                container.show();
-            }
-        },
-        renderAddedLocations:function () {
-            // renders the locations added to the model
-            var rowTemplate = this.locationRowTemplate,
-                optionTemplate = this.locationOptionTemplate,
-                container = this.$("#selector-container-location");
-            container.empty();
-            for (var li = 0; li < this.model.spec.get("locations").length; li++) {
-                var chosenLocation = this.model.spec.get("locations")[li];
-                container.append(rowTemplate({
-                    initialValue: chosenLocation,
-                    rowId: li
-                }));
-            }
-            var $locationOptions = container.find('.select-location');
-            var templated = this.locations.map(function(aLocation) {
-                return optionTemplate({
-                    id: aLocation.id || "",
-                    name: aLocation.getPrettyName()
-                });
-            });
-
-            // insert "none" location
-            $locationOptions.append(templated.join(""));
-            $locationOptions.each(function(i) {
-                var option = $($locationOptions[i]);
-                option.val(option.parent().attr('initialValue'));
-                // Only append dashes if there are any locations
-                if (option.find("option").length > 0) {
-                    option.append("<option disabled>------</option>");
-                }
-                option.append(optionTemplate({
-                    id: NO_LOCATION_INDICATOR,
-                    name: "None"
-                }));
-            });
-        },
-        render:function () {
-            this.delegateEvents()
-            return this
-        },
-        updateForState: function () {
-            var that = this
-            // clear any error message (we are being displayed fresh; if there are errors in the update, we'll show them in code below)
-            this.$('div.error-message').hide();
-            this.renderName()
-            this.renderVersions()
-            this.locations.fetch({
-                success:function () {
-                    if (that.model.spec.get("locations").length==0)
-                        that.addLocation()
-                    else
-                        that.renderAddedLocations()
-                }})
-                
-            if (this.model.catalogEntityData==null) {
-                this.renderStaticConfig(null)
-            } else if (this.model.catalogEntityData=="LOAD") {
-                this.renderStaticConfig("LOADING")
-                $.get('/v1/catalog/entities/'+this.model.spec.get("type"), {}, function (result) {
-                    that.model.catalogEntityData = result
-                    that.renderStaticConfig(that.model.catalogEntityData)
-                })
-            } else {
-                this.renderStaticConfig(this.model.catalogEntityData)
-            }            
-        },
-        addLocation:function () {
-            if (this.locations.models.length>0) {
-                this.model.spec.addLocation(this.locations.models[0].get("id"))
-            } else {
-                // i.e. No location
-                this.model.spec.addLocation(undefined);
-            }
-            this.renderAddedLocations()
-        },
-        removeLocation:function (event) {
-            var toBeRemoved = $(event.currentTarget).parent().attr('rowId')
-            this.model.spec.removeLocationIndex(toBeRemoved)
-            this.renderAddedLocations()
-        },
-        addConfigRow:function (event) {
-            var $row = _.template(EditConfigEntryHtml, {})
-            $(event.currentTarget).parent().prev().append($row)
-        },
-        removeConfigRow:function (event) {
-            $(event.currentTarget).parent().parent().remove()
-        },
-        renderStaticConfig:function (catalogEntryItem) {
-            this.$('.config-table').html('')
-            if (catalogEntryItem=="LOADING") {
-                this.$('.required-config-loading').show()
-            } else {
-                var configs = []
-                this.$('.required-config-loading').hide()
-                if (catalogEntryItem!=null && catalogEntryItem.config!=null) {
-                    var that = this
-                    _.each(catalogEntryItem.config, function (cfg) {
-                        if (cfg.priority !== undefined) {
-                            var html = _.template(RequiredConfigEntryHtml, {data:cfg});
-                            that.$('.config-table').append(html)
-                        }
-                    })
-                }
-            }
-        },
-        getConfigMap:function() {
-            var map = {};
-            $('.app-add-wizard-config-entry').each( function (index,elt) {
-                var value = $('#checkboxValue',elt).length ? $('#checkboxValue',elt).is(':checked') :
-                    getConvertedConfigValue($('#value',elt).val());
-                if (value !== null) {
-                    map[$('#key',elt).val()] = value;
-                }
-            })
-            return map;
-        },
-        selectionVersion:function (event) {
-            this.model.spec.set("version", $(event.currentTarget).val())
-        },
-        selectionLocation:function (event) {
-            var loc_id = $(event.currentTarget).val(),
-                isNoneLocation = loc_id === NO_LOCATION_INDICATOR;
-            var locationValid = isNoneLocation || this.locations.find(function (candidate) {
-                return candidate.get("id")==loc_id;
-            });
-            if (!locationValid) {
-                log("invalid location "+loc_id);
-                this.showFailure("Invalid location "+loc_id);
-                this.model.spec.set("locations",[]);
-            } else {
-                var index = $(event.currentTarget).parent().attr('rowId');
-                this.model.spec.setLocationAtIndex(index, isNoneLocation ? undefined : loc_id);
-            }
-        },
-        updateName:function () {
-            var name = this.$('#application-name').val();
-            if (name)
-                this.model.spec.set("name", name);
-            else
-                this.model.spec.set("name", "");
-        },
-        validate:function () {
-            this.model.spec.set("config", this.getConfigMap())
-            if (this.model.spec.get("locations").length !== 0) {
-                return true
-            } else {
-                this.showFailure("A location is required");
-                return false;
-            }
-        },
-        showFailure: function(text) {
-            if (!text) text = "Failure performing the specified action";
-            log("showing error: "+text);
-            this.$('div.error-message .error-message-text').html(_.escape(text));
-            // flash the error, but make sure it goes away (we do not currently have any other logic for hiding this error message)
-            this.$('div.error-message').slideDown(250).delay(10000).slideUp(500);
-        }
-    })
-    
-    return ModalWizard
-})

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/js/view/application-explorer.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/js/view/application-explorer.js b/brooklyn-ui/src/main/webapp/assets/js/view/application-explorer.js
deleted file mode 100644
index e9c23bc..0000000
--- a/brooklyn-ui/src/main/webapp/assets/js/view/application-explorer.js
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-/**
- * This should render the main content in the Application Explorer page.
- * Components on this page should be rendered as sub-views.
- * @type {*}
- */
-define([
-    "underscore", "jquery", "backbone", "view/viewutils", 
-    "./application-add-wizard", "model/application", "model/entity-summary", "model/app-tree", "./application-tree",  "./entity-details",
-    "text!tpl/apps/details.html", "text!tpl/apps/entity-not-found.html", "text!tpl/apps/page.html"
-], function (_, $, Backbone, ViewUtils,
-        AppAddWizard, Application, EntitySummary, AppTree, ApplicationTreeView, EntityDetailsView,
-        EntityDetailsEmptyHtml, EntityNotFoundHtml, PageHtml) {
-
-    var ApplicationExplorerView = Backbone.View.extend({
-        tagName:"div",
-        className:"container container-fluid",
-        id:'application-explorer',
-        template:_.template(PageHtml),
-        notFoundTemplate: _.template(EntityNotFoundHtml),
-        events:{
-            'click .application-tree-refresh': 'refreshApplicationsInPlace',
-            'click #add-new-application':'createApplication',
-            'click .delete':'deleteApplication'
-        },
-        initialize: function () {
-            this.$el.html(this.template({}))
-            $(".nav1").removeClass("active");
-            $(".nav1_apps").addClass("active");
-
-            this.treeView = new ApplicationTreeView({
-                collection:this.collection,
-                appRouter:this.options.appRouter
-            })
-            this.treeView.on('entitySelected', function(e) {
-               this.displayEntityId(e.id, e.get('applicationId'), false);
-            }, this);
-            this.$('div#app-tree').html(this.treeView.renderFull().el)
-            this.$('div#details').html(EntityDetailsEmptyHtml);
-
-            ViewUtils.fetchRepeatedlyWithDelay(this, this.collection)
-        },
-        refreshApplicationsInPlace: function() {
-            // fetch without reset sets of change events, which now get handled correctly
-            // (not a full visual recompute, which reset does - both in application-tree.js)
-            this.collection.fetch();
-        },
-        beforeClose: function () {
-            this.collection.off("reset", this.render);
-            this.treeView.close();
-            if (this.detailsView)
-                this.detailsView.close();
-        },
-        show: function(entityId) {
-            var tab = "";
-            var tabDetails = "";
-            if (entityId) {
-                if (entityId[0]=='/') entityId = entityId.substring(1);
-                var slash = entityId.indexOf('/');
-                if (slash>0) {
-                    tab = entityId.substring(slash+1)
-                    entityId = entityId.substring(0, slash);
-                }
-            }
-            if (tab) {
-                var slash = tab.indexOf('/');
-                if (slash>0) {
-                    tabDetails = tab.substring(slash+1)
-                    tab = tab.substring(0, slash);
-                }
-                this.preselectTab(tab, tabDetails);
-            }
-            this.treeView.selectEntity(entityId)
-        },
-        createApplication:function () {
-            var that = this;
-            if (this._modal) {
-                this._modal.close()
-            }
-            var wizard = new AppAddWizard({
-                appRouter:that.options.appRouter,
-                callback:function() { that.refreshApplicationsInPlace() }
-            })
-            this._modal = wizard
-            this.$(".add-app #modal-container").html(wizard.render().el)
-            this.$(".add-app #modal-container .modal")
-                .on("hidden",function () {
-                    wizard.close()
-                }).modal('show')
-        },
-        deleteApplication:function (event) {
-            // call Backbone destroy() which does HTTP DELETE on the model
-            this.collection.get(event.currentTarget['id']).destroy({wait:true})
-        },
-        /**
-         * Causes the tab with the given name to be selected automatically when
-         * the view is next rendered.
-         */
-        preselectTab: function(tab, tabDetails) {
-            this.currentTab = tab;
-            this.currentTabDetails = tabDetails;
-        },
-        showDetails: function(app, entitySummary) {
-            var that = this;
-            ViewUtils.cancelFadeOnceLoaded($("div#details"));
-
-            var whichTab = this.currentTab;
-            if (!whichTab) {
-                whichTab = "summary";
-                if (this.detailsView) {
-                    whichTab = this.detailsView.$el.find(".tab-pane.active").attr("id");
-                    this.detailsView.close();
-                }
-            }
-            if (this.detailsView) {
-                this.detailsView.close();
-            }
-            this.detailsView = new EntityDetailsView({
-                model: entitySummary,
-                application: app,
-                appRouter: this.options.appRouter,
-                preselectTab: whichTab,
-                preselectTabDetails: this.currentTabDetails,
-            });
-
-            this.detailsView.on("entity.expunged", function() {
-                that.preselectTab("summary");
-                var id = that.selectedEntityId;
-                var model = that.collection.get(id);
-                if (model && model.get("parentId")) {
-                    that.displayEntityId(model.get("parentId"));
-                } else if (that.collection) {
-                    that.displayEntityId(that.collection.first().id);
-                } else if (id) {
-                    that.displayEntityNotFound(id);
-                } else {
-                    that.displayEntityNotFound("?");
-                }
-                that.collection.fetch();
-            });
-            this.detailsView.render( $("div#details") );
-        },
-        displayEntityId: function (id, appName, afterLoad) {
-            var that = this;
-            var entityLoadFailed = function() {
-                return that.displayEntityNotFound(id);
-            };
-            if (appName === undefined) {
-                if (!afterLoad) {
-                    // try a reload if given an ID we don't recognise
-                    this.collection.includeEntities([id]);
-                    this.collection.fetch({
-                        success: function() { _.defer(function() { that.displayEntityId(id, appName, true); }); },
-                        error: function() { _.defer(function() { that.displayEntityId(id, appName, true); }); }
-                    });
-                    ViewUtils.fadeToIndicateInitialLoad($("div#details"))
-                    return;
-                } else {
-                    // no such app
-                    entityLoadFailed();
-                    return; 
-                }
-            }
-
-            var app = new Application.Model();
-            var entitySummary = new EntitySummary.Model;
-
-            app.url = "/v1/applications/" + appName;
-            entitySummary.url = "/v1/applications/" + appName + "/entities/" + id;
-
-            // in case the server response time is low, fade out while it refreshes
-            // (since we can't show updated details until we've retrieved app + entity details)
-            ViewUtils.fadeToIndicateInitialLoad($("div#details"));
-
-            $.when(app.fetch(), entitySummary.fetch())
-                .done(function() {
-                    that.showDetails(app, entitySummary);
-                })
-                .fail(entityLoadFailed);
-        },
-        displayEntityNotFound: function(id) {
-            $("div#details").html(this.notFoundTemplate({"id": id}));
-            ViewUtils.cancelFadeOnceLoaded($("div#details"))
-        },
-    })
-
-    return ApplicationExplorerView
-})

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/js/view/application-tree.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/js/view/application-tree.js b/brooklyn-ui/src/main/webapp/assets/js/view/application-tree.js
deleted file mode 100644
index 2f7a3d0..0000000
--- a/brooklyn-ui/src/main/webapp/assets/js/view/application-tree.js
+++ /dev/null
@@ -1,367 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-/**
- * Sub-View to render the Application tree.
- * @type {*}
- */
-define([
-    "underscore", "jquery", "backbone", "view/viewutils",
-    "model/app-tree", "text!tpl/apps/tree-item.html", "text!tpl/apps/tree-empty.html"
-], function (_, $, Backbone, ViewUtils,
-             AppTree, TreeItemHtml, EmptyTreeHtml) {
-
-    var emptyTreeTemplate = _.template(EmptyTreeHtml);
-    var treeItemTemplate = _.template(TreeItemHtml);
-
-    var findAllTreeboxes = function(id, $scope) {
-        return $('.tree-box[data-entity-id="' + id + '"]', $scope);
-    };
-
-    var findRootTreebox = function(id) {
-        return $('.lozenge-app-tree-wrapper').children('.tree-box[data-entity-id="' + id + '"]', this.$el);
-    };
-
-    var findChildTreebox = function(id, $parentTreebox) {
-        return $parentTreebox.children('.node-children').children('.tree-box[data-entity-id="' + id + '"]');
-    };
-
-    var findMasterTreebox = function(id, $scope) {
-        return $('.tree-box[data-entity-id="' + id + '"]:not(.indirect)', $scope);
-    };
-
-    var createEntityTreebox = function(id, name, $domParent, depth, indirect) {
-        // Tildes in sort key force entities with no name to bottom of list (z < ~).
-        var sortKey = (name ? name.toLowerCase() : "~~~") + "     " + id.toLowerCase();
-
-        // Create the wrapper.
-        var $treebox = $(
-                '<div data-entity-id="'+id+'" data-sort-key="'+sortKey+'" data-depth="'+depth+'" ' +
-                'class="tree-box toggler-group' +
-                    (indirect ? " indirect" : "") +
-                    (depth == 0 ? " outer" : " inner " + (depth % 2 ? " depth-odd" : " depth-even")+
-                    (depth == 1 ? " depth-first" : "")) + '">'+
-                '<div class="entity_tree_node_wrapper"></div>'+
-                '<div class="node-children toggler-target hide"></div>'+
-                '</div>');
-
-        // Insert into the passed DOM parent, maintaining sort order relative to siblings: name then id.
-        var placed = false;
-        var contender = $(".toggler-group", $domParent).first();
-        while (contender.length && !placed) {
-            var contenderKey = contender.data("sort-key");
-            if (sortKey < contenderKey) {
-                contender.before($treebox);
-                placed = true;
-            } else {
-                contender = contender.next(".toggler-group", $domParent);
-            }
-        }
-        if (!placed) {
-            $domParent.append($treebox);
-        }
-        return $treebox;
-    };
-
-    var getOrCreateApplicationTreebox = function(id, name, treeView) {
-        var $treebox = findRootTreebox(id);
-        if (!$treebox.length) {
-            var $insertionPoint = $('.lozenge-app-tree-wrapper', treeView.$el);
-            if (!$insertionPoint.length) {
-                // entire view must be created
-                treeView.$el.html(
-                        '<div class="navbar_main_wrapper treeloz">'+
-                        '<div id="tree-list" class="navbar_main treeloz">'+
-                        '<div class="lozenge-app-tree-wrapper">'+
-                        '</div></div></div>');
-                $insertionPoint = $('.lozenge-app-tree-wrapper', treeView.$el);
-            }
-            $treebox = createEntityTreebox(id, name, $insertionPoint, 0, false);
-        }
-        return $treebox;
-    };
-
-    var getOrCreateChildTreebox = function(id, name, isIndirect, $parentTreebox) {
-        var $treebox = findChildTreebox(id, $parentTreebox);
-        if (!$treebox.length) {
-            $treebox = createEntityTreebox(id, name, $parentTreebox.children('.node-children'), $parentTreebox.data("depth") + 1, isIndirect);
-        }
-        return $treebox;
-    };
-
-    var updateTreeboxContent = function(entity, $treebox, treeView) {
-        var $newContent = $(treeView.template({
-            id: entity.get('id'),
-            parentId:  entity.get('parentId'),
-            model: entity,
-            statusIconUrl: ViewUtils.computeStatusIconInfo(entity.get("serviceUp"), entity.get("serviceState")).url,
-            indirect: $treebox.hasClass('indirect'),
-        }));
-
-        var $wrapper = $treebox.children('.entity_tree_node_wrapper');
-
-        // Preserve old display status (just chevron direction at present).
-        if ($wrapper.find('.tree-node-state').hasClass('icon-chevron-down')) {
-            $newContent.find('.tree-node-state').removeClass('icon-chevron-right').addClass('icon-chevron-down');
-        }
-
-        $wrapper.html($newContent);
-        addEventsToNode($treebox, treeView);
-    };
-
-    var addEventsToNode = function($node, treeView) {
-        // show the "light-popup" (expand / expand all / etc) menu
-        // if user hovers for 500ms. surprising there is no option for this (hover delay).
-        // also, annoyingly, clicks around the time the animation starts don't seem to get handled
-        // if the click is in an overlapping reason; this is why we position relative top: 12px in css
-        $('.light-popup', $node).parent().parent().hover(
-                function(parent) {
-                    treeView.cancelHoverTimer();
-                    treeView.hoverTimer = setTimeout(function() {
-                        var menu = $(parent.currentTarget).find('.light-popup');
-                        menu.show();
-                    }, 500);
-                },
-                function(parent) {
-                    treeView.cancelHoverTimer();
-                    $('.light-popup').hide();
-                }
-        );
-    };
-
-    var selectTreebox = function(id, $treebox, treeView) {
-        $('.entity_tree_node_wrapper').removeClass('active');
-        $treebox.children('.entity_tree_node_wrapper').addClass('active');
-
-        var entity = treeView.collection.get(id);
-        if (entity) {
-            treeView.selectedEntityId = id;
-            treeView.trigger('entitySelected', entity);
-        }
-    };
-
-
-    return Backbone.View.extend({
-        template: treeItemTemplate,
-        hoverTimer: null,
-
-        events: {
-            'click span.entity_tree_node .tree-change': 'treeChange',
-            'click span.entity_tree_node': 'nodeClicked'
-        },
-
-        initialize: function() {
-            this.collection.on('add', this.entityAdded, this);
-            this.collection.on('change', this.entityChanged, this);
-            this.collection.on('remove', this.entityRemoved, this);
-            this.collection.on('reset', this.renderFull, this);
-            _.bindAll(this);
-        },
-
-        beforeClose: function() {
-            this.collection.off("reset", this.renderFull);
-        },
-
-        entityAdded: function(entity) {
-            // Called when the full entity model is fetched into our collection, at which time we can replace
-            // the empty contents of any placeholder tree nodes (.tree-box) that were created earlier.
-            // The entity may have multiple 'treebox' views (in the case of group members).
-
-            // If the new entity is an application, we must create its placeholder in the DOM.
-            if (!entity.get('parentId')) {
-                var $treebox = getOrCreateApplicationTreebox(entity.id, entity.get('name'), this);
-
-                // Select the new app if there's no current selection.
-                if (!this.selectedEntityId)
-                    selectTreebox(entity.id, $treebox, this);
-            }
-
-            this.entityChanged(entity);
-        },
-
-        entityChanged: function(entity) {
-            // The entity may have multiple 'treebox' views (in the case of group members).
-            var that = this;
-            findAllTreeboxes(entity.id).each(function() {
-                var $treebox = $(this);
-                updateTreeboxContent(entity, $treebox, that);
-            });
-        },
-
-        entityRemoved: function(entity) {
-            // The entity may have multiple 'treebox' views (in the case of group members).
-            findAllTreeboxes(entity.id, this.$el).remove();
-            // Collection seems sometimes to retain children of the removed node;
-            // not sure why, but that's okay for now.
-            if (this.collection.getApplications().length == 0)
-                this.renderFull();
-        },
-
-        nodeClicked: function(event) {
-            var $treebox = $(event.currentTarget).closest('.tree-box');
-            var id = $treebox.data('entityId');
-            selectTreebox(id, $treebox, this);
-            return false;
-        },
-
-        selectEntity: function(id) {
-            var $treebox = findMasterTreebox(id, this.$el);
-            selectTreebox(id, $treebox, this);
-        },
-
-        renderFull: function() {
-            var that = this;
-            this.$el.empty();
-
-            // Display tree and highlight the selected entity.
-            if (this.collection.getApplications().length == 0) {
-                this.$el.append(emptyTreeTemplate());
-
-            } else {
-                _.each(this.collection.getApplications(), function(appId) {
-                    var entity = that.collection.get(appId);
-                    var $treebox = getOrCreateApplicationTreebox(entity.id, entity.name, that);
-                    updateTreeboxContent(entity, $treebox, that);
-                });
-            }
-
-            // Select the first app if there's no current selection.
-            if (!this.selectedEntityId) {
-                var firstApp = _.first(this.collection.getApplications());
-                if (firstApp)
-                    this.selectEntity(firstApp);
-            }
-            return this;
-        },
-
-        cancelHoverTimer: function() {
-            if (this.hoverTimer != null) {
-                clearTimeout(this.hoverTimer);
-                this.hoverTimer = null;
-            }
-        },
-
-        treeChange: function(event) {
-            var $target = $(event.currentTarget);
-            var $treeBox = $target.closest('.tree-box');
-            if ($target.hasClass('tr-expand')) {
-                this.showChildrenOf($treeBox, false);
-            } else if ($target.hasClass('tr-expand-all')) {
-                this.showChildrenOf($treeBox, true);
-            } else if ($target.hasClass('tr-collapse')) {
-                this.hideChildrenOf($treeBox, false);
-            } else if ($target.hasClass('tr-collapse-all')) {
-                this.hideChildrenOf($treeBox, true);
-            } else {
-                // default - toggle
-                if ($treeBox.children('.node-children').is(':visible')) {
-                    this.hideChildrenOf($treeBox, false);
-                } else {
-                    this.showChildrenOf($treeBox, false);
-                }
-            }
-            // hide the popup menu
-            this.cancelHoverTimer();
-            $('.light-popup').hide();
-            // don't let other events interfere
-            return false;
-        },
-
-        showChildrenOf: function($treeBox, recurse, excludedEntityIds) {
-            excludedEntityIds = excludedEntityIds || [];
-            var idToExpand = $treeBox.data('entityId');
-            var $wrapper = $treeBox.children('.entity_tree_node_wrapper');
-            var $childContainer = $treeBox.children('.node-children');
-            var model = this.collection.get(idToExpand);
-            if (model == null) {
-                // not yet loaded; parallel thread should load
-                return;
-            }
-
-            var that = this;
-            var children = model.get('children'); // entity summaries: {id: ..., name: ...}
-            var renderChildrenAsIndirect = $treeBox.hasClass("indirect");
-            _.each(children, function(child) {
-                var $treebox = getOrCreateChildTreebox(child.id, child.name, renderChildrenAsIndirect, $treeBox);
-                var model = that.collection.get(child.id);
-                if (model) {
-                    updateTreeboxContent(model, $treebox, that);
-                }
-            });
-            var members = model.get('members'); // entity summaries: {id: ..., name: ...}
-            _.each(members, function(member) {
-                var $treebox = getOrCreateChildTreebox(member.id, member.name, true, $treeBox);
-                var model = that.collection.get(member.id);
-                if (model) {
-                    updateTreeboxContent(model, $treebox, that);
-                }
-            });
-
-            // Avoid infinite recursive expansion using a "taboo list" of indirect entities already expanded in this
-            // operation. Example: a group that contains itself or one of its own ancestors. Such cycles can only
-            // originate via "indirect" subordinates.
-            var expandIfNotExcluded = function($treebox, excludedEntityIds, defer) {
-                if ($treebox.hasClass('indirect')) {
-                    var id = $treebox.data('entityId');
-                    if (_.contains(excludedEntityIds, id))
-                        return;
-                    excludedEntityIds.push(id);
-                }
-                var doExpand = function() { that.showChildrenOf($treebox, recurse, excludedEntityIds); };
-                if (defer) _.defer(doExpand);
-                else doExpand();
-            };
-
-            if (this.collection.includeEntities(_.union(children, members))) {
-                // we have to load entities before we can proceed
-                this.collection.fetch({
-                    success: function() {
-                        if (recurse) {
-                            $childContainer.children('.tree-box').each(function () {
-                                expandIfNotExcluded($(this), excludedEntityIds, true);
-                            });
-                        }
-                    }
-                });
-            }
-
-            $childContainer.slideDown(300);
-            $wrapper.find('.tree-node-state').removeClass('icon-chevron-right').addClass('icon-chevron-down');
-            if (recurse) {
-                $childContainer.children('.tree-box').each(function () {
-                    expandIfNotExcluded($(this), excludedEntityIds, false);
-                });
-            }
-        },
-
-        hideChildrenOf: function($treeBox, recurse) {
-            var $wrapper = $treeBox.children('.entity_tree_node_wrapper');
-            var $childContainer = $treeBox.children('.node-children');
-            if (recurse) {
-                var that = this;
-                $childContainer.children('.tree-box').each(function () {
-                    that.hideChildrenOf($(this), recurse);
-                });
-            }
-            $childContainer.slideUp(300);
-            $wrapper.find('.tree-node-state').removeClass('icon-chevron-down').addClass('icon-chevron-right');
-        },
-
-    });
-
-});

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/js/view/catalog.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/js/view/catalog.js b/brooklyn-ui/src/main/webapp/assets/js/view/catalog.js
deleted file mode 100644
index 7d4ab2a..0000000
--- a/brooklyn-ui/src/main/webapp/assets/js/view/catalog.js
+++ /dev/null
@@ -1,613 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-define([
-    "underscore", "jquery", "backbone", "brooklyn",
-    "model/location", "model/entity",
-    "text!tpl/catalog/page.html",
-    "text!tpl/catalog/details-entity.html",
-    "text!tpl/catalog/details-generic.html",
-    "text!tpl/catalog/details-location.html",
-    "text!tpl/catalog/add-catalog-entry.html",
-    "text!tpl/catalog/add-yaml.html",
-    "text!tpl/catalog/add-location.html",
-    "text!tpl/catalog/nav-entry.html",
-
-    "bootstrap", "jquery-form"
-], function(_, $, Backbone, Brooklyn,
-        Location, Entity,
-        CatalogPageHtml, DetailsEntityHtml, DetailsGenericHtml, LocationDetailsHtml,
-        AddCatalogEntryHtml, AddYamlHtml, AddLocationHtml, EntryHtml) {
-
-    // Holds the currently active details type, e.g. applications, policies. Bit of a workaround
-    // to share the active view with all instances of AccordionItemView, so clicking the 'reload
-    // catalog' button (handled by the parent of the AIVs) does not apply the 'active' class to
-    // more than one element.
-    var activeDetailsView;
-
-    var CatalogItemDetailsView = Backbone.View.extend({
-
-        events: {
-            "click .delete": "deleteItem"
-        },
-
-        initialize: function() {
-            _.bindAll(this);
-            this.options.template = _.template(this.options.template || DetailsGenericHtml);
-        },
-
-        render: function() {
-            if (!this.options.model) {
-                return this.renderEmpty();
-            } else {
-                return this.renderDetails();
-            }
-        },
-
-        renderEmpty: function(extraMessage) {
-            this.$el.html("<div class='catalog-details'>" +
-                "<h3>Select an entry on the left</h3>" +
-                (extraMessage ? extraMessage : "") +
-                "</div>");
-            return this;
-        },
-
-        renderDetails: function() {
-            var that = this,
-                model = this.options.model,
-                template = this.options.template;
-            var show = function() {
-                // Keep the previously open section open between items. Duplication between
-                // here and setDetailsView, below. This case handles view refreshes from this
-                // view directly (e.g. when indicating an error), below handles keeping the
-                // right thing open when navigating from view to view.
-                var open = this.$(".in").attr("id");
-                var newHtml = $(template({model: model, viewName: that.options.name}));
-                $(newHtml).find("#"+open).addClass("in");
-                that.$el.html(newHtml);
-                // rewire events. previous callbacks are removed automatically.
-                that.delegateEvents()
-            };
-
-            this.activeModel = model;
-            // Load the view with currently available data and refresh once the load is complete.
-            // Only refreshes the view if the model changes and the user hasn't selected another
-            // item while the load was executing.
-            show();
-            model.on("change", function() {
-                if (that.activeModel.cid === model.cid) {
-                    show();
-                }
-            });
-            model.fetch()
-                .fail(function(xhr, textStatus, errorThrown) {
-                    console.log("error loading", model.id, ":", errorThrown);
-                    if (that.activeModel.cid === model.cid) {
-                        model.error = true;
-                        show();
-                    }
-                })
-                // Runs after the change event fires, or after the xhr completes
-                .always(function () {
-                    model.off("change");
-                });
-            return this;
-        },
-
-        deleteItem: function(event) {
-            // Could use wait flag to block removal of model from collection
-            // until server confirms deletion and success handler to perform
-            // removal. Useful if delete fails for e.g. lack of entitlement.
-            var that = this;
-            var displayName = $(event.currentTarget).data("name") || "item";
-            this.activeModel.destroy({
-                success: function() {
-                    that.renderEmpty("Deleted " + displayName);
-                },
-                error: function(info) {
-                    that.renderEmpty("Unable to permanently delete " + displayName+". Deletion is temporary, client-side only.");
-                }
-            });
-        }
-    });
-
-    var AddCatalogEntryView = Backbone.View.extend({
-        template: _.template(AddCatalogEntryHtml),
-        events: {
-            "click .show-context": "showContext"
-        },
-        initialize: function() {
-            _.bindAll(this);
-        },
-        render: function (initialView) {
-            this.$el.html(this.template());
-            if (initialView) {
-                if (initialView == "entity") initialView = "yaml";
-                
-                this.$("[data-context='"+initialView+"']").addClass("active");
-                this.showFormForType(initialView)
-            }
-            return this;
-        },
-        clearWithHtml: function(template) {
-            if (this.contextView) this.contextView.close();
-            this.context = undefined;
-            this.$(".btn").removeClass("active");
-            this.$("#catalog-add-form").html(template);
-        },
-        beforeClose: function () {
-            if (this.contextView) this.contextView.close();
-        },
-        showContext: function(event) {
-            var $event = $(event.currentTarget);
-            var context = $event.data("context");
-            if (this.context !== context) {
-                if (this.contextView) {
-                    this.contextView.close();
-                }
-                this.showFormForType(context)
-            }
-        },
-        showFormForType: function (type) {
-            this.context = type;
-            if (type == "yaml" || type == "entity") {
-                this.contextView = newYamlForm(this, this.options.parent);
-            } else if (type == "location") {
-                this.contextView = newLocationForm(this, this.options.parent);
-            } else if (type !== undefined) {
-                console.log("unknown catalog type " + type);
-                this.showFormForType("yaml");
-                return;
-            }
-            Backbone.history.navigate("/v1/catalog/new/" + type);
-            this.$("#catalog-add-form").html(this.contextView.$el);
-        }
-    });
-
-    function newYamlForm(addView, addViewParent) {
-        return new Brooklyn.view.Form({
-            template: _.template(AddYamlHtml),
-            onSubmit: function (model) {
-                var submitButton = this.$(".catalog-submit-button");
-                // "loading" is an indicator to Bootstrap, not a string to display
-                submitButton.button("loading");
-                var self = this;
-                var options = {
-                    url: "/v1/catalog/",
-                    data: model.get("yaml"),
-                    processData: false,
-                    type: "post"
-                };
-                $.ajax(options)
-                    .done(function (data, status, xhr) {
-                        // Can extract location of new item with:
-                        //model.url = Brooklyn.util.pathOf(xhr.getResponseHeader("Location"));
-                        if (_.size(data)==0) {
-                          addView.clearWithHtml( "No items supplied." );
-                        } else {
-                          addView.clearWithHtml( "Added: "+_.escape(_.keys(data).join(", ")) 
-                            + (_.size(data)==1 ? ". Loading..." : "") );
-                          addViewParent.loadAnyAccordionItem(_.size(data)==1 ? _.keys(data)[0] : undefined);
-                        }
-                    })
-                    .fail(function (xhr, status, error) {
-                        submitButton.button("reset");
-                        self.$(".catalog-save-error")
-                            .removeClass("hide")
-                            .find(".catalog-error-message")
-                            .html(_.escape(Brooklyn.util.extractError(xhr, "Could not add catalog item:\n'n" + error)));
-                    });
-            }
-        });
-    }
-
-    // Could adapt to edit existing locations too.
-    function newLocationForm(addView, addViewParent) {
-        // Renders with config key list
-        var body = new (Backbone.View.extend({
-            beforeClose: function() {
-                if (this.configKeyList) {
-                    this.configKeyList.close();
-                }
-            },
-            render: function() {
-                this.configKeyList = new Brooklyn.view.ConfigKeyInputPairList().render();
-                var template = _.template(AddLocationHtml);
-                this.$el.html(template);
-                this.$("#new-location-config").html(this.configKeyList.$el);
-            },
-            showError: function (message) {
-                self.$(".catalog-save-error")
-                    .removeClass("hide")
-                    .find(".catalog-error-message")
-                    .html(message);
-            }
-        }));
-        var form = new Brooklyn.view.Form({
-            body: body,
-            model: Location.Model,
-            onSubmit: function (location) {
-                var configKeys = body.configKeyList.getConfigKeys();
-                if (!configKeys.displayName) {
-                    configKeys.displayName = location.get("name");
-                }
-                var submitButton = this.$(".catalog-submit-button");
-                // "loading" is an indicator to Bootstrap, not a string to display
-                submitButton.button("loading");
-                location.set("config", configKeys);
-                location.save()
-                    .done(function (data) {
-                        addView.clearWithHtml( "Added: "+data.id+". Loading..." ); 
-                        addViewParent.loadAccordionItem("locations", data.id);
-                    })
-                    .fail(function (response) {
-                        submitButton.button("reset");
-                        body.showError(Brooklyn.util.extractError(response));
-                    });
-            }
-        });
-
-        return form;
-    }
-
-    var Catalog = Backbone.Collection.extend({
-        modelX: Backbone.Model.extend({
-          url: function() {
-            return "/v1/catalog/" + this.name + "/" + this.id + "?allVersions=true";
-          }
-        }),
-        initialize: function(models, options) {
-            this.name = options["name"];
-            if (!this.name) {
-                throw new Error("Catalog collection must know its name");
-            }
-            //this.model is a constructor so it shouldn't be _.bind'ed to this
-            //It actually works when a browser provided .bind is used, but the
-            //fallback implementation doesn't support it.
-            var that = this; 
-            var model = this.model.extend({
-              url: function() {
-                return "/v1/catalog/" + that.name + "/" + this.id.split(":").join("/");
-              }
-            });
-            _.bindAll(this);
-            this.model = model;
-        },
-        url: function() {
-            return "/v1/catalog/" + this.name+"?allVersions=true";
-        }
-    });
-
-    /** Use to fill single accordion view list. */
-    var AccordionItemView = Backbone.View.extend({
-        tag: "div",
-        className: "accordion-item",
-        events: {
-            'click .accordion-head': 'toggle',
-            'click .accordion-nav-row': 'showDetails'
-        },
-        bodyTemplate: _.template(
-            "<div class='accordion-head capitalized'><%= name %></div>" +
-            "<div class='accordion-body' style='display: <%= display %>'></div>"),
-
-        initialize: function() {
-            _.bindAll(this);
-            this.name = this.options.name;
-            if (!this.name) {
-                throw new Error("Name should have been given for accordion entry");
-            } else if (!this.options.onItemSelected) {
-                throw new Error("onItemSelected(model, element) callback should have been given for accordion entry");
-            }
-
-            // Generic templates
-            this.template = _.template(this.options.template || EntryHtml);
-
-            // Returns template applied to function arguments. Alter if collection altered.
-            // Will be run in the context of the AccordionItemView.
-            this.entryTemplateArgs = this.options.entryTemplateArgs || function(model, index) {
-                return {type: model.getVersionedAttr("type"), id: model.get("id")};
-            };
-
-            // undefined argument is used for existing model items
-            var collectionModel = this.options.model || Backbone.Model;
-            this.collection = this.options.collection || new Catalog(undefined, {
-                name: this.name,
-                model: collectionModel
-            });
-            // Refreshes entries list when the collection is synced with the server or
-            // any of its members are destroyed.
-            this.collection
-                .on("sync", this.renderEntries)
-                .on("destroy", this.renderEntries);
-            this.refresh();
-        },
-
-        beforeClose: function() {
-            this.collection.off();
-        },
-
-        render: function() {
-            this.$el.html(this.bodyTemplate({
-                name: this.name,
-                display: this.options.autoOpen ? "block" : "none"
-            }));
-            this.renderEntries();
-            return this;
-        },
-
-        singleItemTemplater: function(isChild, model, index) {
-            var args = _.extend({
-                    cid: model.cid,
-                    isChild: isChild,
-                    extraClasses: (activeDetailsView == this.name && model.cid == this.activeCid) ? "active" : ""
-                }, this.entryTemplateArgs(model));
-            return this.template(args);
-        },
-
-        renderEntries: function() {
-            var elements = this.collection.map(_.partial(this.singleItemTemplater, false), this);
-            this.updateContent(elements.join(''));
-        },
-
-        updateContent: function(markup) {
-            this.$(".accordion-body")
-                .empty()
-                .append(markup);
-        },
-
-        refresh: function() {
-            this.collection.fetch();
-        },
-
-        showDetails: function(event) {
-            var $event = $(event.currentTarget);
-            var cid = $event.data("cid");
-            if (activeDetailsView !== this.name || this.activeCid !== cid) {
-                activeDetailsView = this.name;
-                this.activeCid = cid;
-                var model = this.collection.get(cid);
-                Backbone.history.navigate("v1/catalog/" + this.name + "/" + model.id);
-                this.options.onItemSelected(activeDetailsView, model, $event);
-            }
-        },
-
-        toggle: function() {
-            var body = this.$(".accordion-body");
-            var hidden = this.hidden = body.css("display") == "none";
-            if (hidden) {
-                body.removeClass("hide").slideDown('fast');
-            } else {
-                body.slideUp('fast')
-            }
-        },
-
-        show: function() {
-            var body = this.$(".accordion-body");
-            var hidden = this.hidden = body.css("display") == "none";
-            if (hidden) {
-                body.removeClass("hide").slideDown('fast');
-            }
-        }
-    });
-    
-    var AccordionEntityView = AccordionItemView.extend({
-        renderEntries: function() {
-            var symbolicNameFn = function(model) {return model.get("symbolicName")};
-            var groups = this.collection.groupBy(symbolicNameFn);
-            var orderedIds = _.uniq(this.collection.map(symbolicNameFn));
-
-            function getLatestStableVersion(items) {
-                //the server sorts items by descending version, snapshots at the back
-                return items[0];
-            }
-
-            var catalogTree = _.map(orderedIds, function(symbolicName) {
-                var group = groups[symbolicName];
-                var root = getLatestStableVersion(group);
-                var children = _.reject(group, function(model) {return root.id == model.id;});
-                return {root: root, children: children};
-            });
-
-            var templater = function(memo, item, index) {
-                memo.push(this.singleItemTemplater(false, item.root));
-                return memo.concat(_.map(item.children, _.partial(this.singleItemTemplater, true), this));
-            };
-
-            var elements = _.reduce(catalogTree, templater, [], this);
-            this.updateContent(elements.join(''));
-        }
-    });
-
-    // Controls whole page. Parent of accordion items and details view.
-    var CatalogResourceView = Backbone.View.extend({
-        tagName:"div",
-        className:"container container-fluid",
-        entryTemplate:_.template(EntryHtml),
-
-        events: {
-            'click .refresh':'refresh',
-            'click #add-new-thing': 'createNewThing'
-        },
-
-        initialize: function() {
-            $(".nav1").removeClass("active");
-            $(".nav1_catalog").addClass("active");
-            // Important that bind happens before accordion object is created. If it happens after
-            // `this' will not be set correctly for the onItemSelected callbacks.
-            _.bindAll(this);
-            this.accordion = this.options.accordion || {
-                "applications": new AccordionEntityView({
-                    name: "applications",
-                    singular: "application",
-                    onItemSelected: _.partial(this.showCatalogItem, DetailsEntityHtml),
-                    model: Entity.Model,
-                    autoOpen: !this.options.kind || this.options.kind == "applications"
-                }),
-                "entities": new AccordionEntityView({
-                    name: "entities",
-                    singular: "entity",
-                    onItemSelected: _.partial(this.showCatalogItem, DetailsEntityHtml),
-                    model: Entity.Model,
-                    autoOpen: this.options.kind == "entities"
-                }),
-                "policies": new AccordionEntityView({
-                    // TODO needs parsing, and probably its own model
-                    // but cribbing "entity" works for now 
-                    // (and not setting a model can cause errors intermittently)
-                    onItemSelected: _.partial(this.showCatalogItem, DetailsEntityHtml),
-                    name: "policies",
-                    singular: "policy",
-                    model: Entity.Model,
-                    autoOpen: this.options.kind == "policies"
-                }),
-                "locations": new AccordionItemView({
-                    name: "locations",
-                    singular: "location",
-                    onItemSelected: _.partial(this.showCatalogItem, LocationDetailsHtml),
-                    collection: this.options.locations,
-                    autoOpen: this.options.kind == "locations",
-                    entryTemplateArgs: function (location, index) {
-                        return {
-                            type: location.getIdentifierName(),
-                            id: location.getLinkByName("self")
-                        };
-                    }
-                })
-            };
-        },
-
-        beforeClose: function() {
-            _.invoke(this.accordion, 'close');
-        },
-
-        render: function() {
-            this.$el.html(_.template(CatalogPageHtml, {}));
-            var parent = this.$(".catalog-accordion-parent");
-            _.each(this.accordion, function(child) {
-                parent.append(child.render().$el);
-            });
-            if (this.options.kind === "new") {
-                this.createNewThing(this.options.id);
-            } else if (this.options.kind && this.options.id) {
-                this.loadAccordionItem(this.options.kind, this.options.id)
-            } else {
-                // Show empty details view to start
-                this.setDetailsView(new CatalogItemDetailsView().render());
-            }
-            return this
-        },
-
-        /** Refreshes the contents of each accordion pane */
-        refresh: function() {
-            _.invoke(this.accordion, 'refresh');
-        },
-
-        createNewThing: function (type) {
-            // Discard if it's the jquery event object.
-            if (!_.isString(type)) {
-                type = undefined;
-            }
-            var viewName = "createNewThing";
-            if (!type) {
-                Backbone.history.navigate("/v1/catalog/new");
-            }
-            activeDetailsView = viewName;
-            this.$(".accordion-nav-row").removeClass("active");
-            var newView = new AddCatalogEntryView({
-                parent: this
-            }).render(type);
-            this.setDetailsView(newView);
-        },
-
-        loadAnyAccordionItem: function (id) {
-            this.loadAccordionItem("entities", id);
-            this.loadAccordionItem("applications", id);
-            this.loadAccordionItem("policies", id);
-            this.loadAccordionItem("locations", id);
-        },
-
-        loadAccordionItem: function (kind, id) {
-            if (!this.accordion[kind]) {
-                console.error("No accordion for: " + kind);
-            } else {
-                var accordion = this.accordion[kind];
-                var self = this;
-                // reset is needed because we rely on server's ordering;
-                // without it, server additions are placed at end of list
-                accordion.collection.fetch({reset: true})
-                    .then(function() {
-                        var model = accordion.collection.get(id);
-                        if (!model) {
-                            // if a version is supplied, try it without a version - needed for locations, navigating after deletion
-                            if (id && id.split(":").length>1) {
-                                model = accordion.collection.get( id.split(":")[0] );
-                            }
-                        }
-                        if (!model) {
-                            // if an ID is supplied without a version, look for first matching version (should be newest)
-                            if (id && id.split(":").length==1 && accordion.collection.models) {
-                                model = _.find(accordion.collection.models, function(m) { 
-                                    return m && m.id && m.id.startsWith(id+":");
-                                });
-                            }
-                        }
-                        // TODO could look in collection for any starting with ID
-                        if (model) {
-                            Backbone.history.navigate("/v1/catalog/"+kind+"/"+id);
-                            activeDetailsView = kind;
-                            accordion.activeCid = model.cid;
-                            accordion.options.onItemSelected(kind, model);
-                            accordion.show();
-                        } else {
-                            // catalog item not found, or not found yet (it might be reloaded and another callback will try again)
-                        }
-                    });
-            }
-        },
-
-        showCatalogItem: function(template, viewName, model, $target) {
-            this.$(".accordion-nav-row").removeClass("active");
-            if ($target) {
-                $target.addClass("active");
-            } else {
-                this.$("[data-cid=" + model.cid + "]").addClass("active");
-            }
-            var newView = new CatalogItemDetailsView({
-                model: model,
-                template: template,
-                name: viewName
-            }).render();
-            this.setDetailsView(newView)
-        },
-
-        setDetailsView: function(view) {
-            this.$("#details").html(view.el);
-            if (this.detailsView) {
-                // Try to re-open sections that were previously visible.
-                var openedItem = this.detailsView.$(".in").attr("id");
-                if (openedItem) {
-                    view.$("#" + openedItem).addClass("in");
-                }
-                this.detailsView.close();
-            }
-            this.detailsView = view;
-        }
-    });
-    
-    return CatalogResourceView
-});


[16/51] [abbrv] [partial] brooklyn-ui git commit: move subdir from incubator up a level as it is promoted to its own repo (first non-incubator commit!)

Posted by he...@apache.org.
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/css/brooklyn.css
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/css/brooklyn.css b/src/main/webapp/assets/css/brooklyn.css
new file mode 100644
index 0000000..fde2a3c
--- /dev/null
+++ b/src/main/webapp/assets/css/brooklyn.css
@@ -0,0 +1,271 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+*/
+/* KROME STYLES */
+BODY {
+    background-color: #e8e8e8 !important;
+    color: #505050 !important;
+}
+
+textarea {
+    white-space: pre;
+    word-wrap: normal;
+    overflow-x: scroll;
+}
+
+/* HEADER  */
+.logo {
+    height: 44px !important;
+    width: 195px !important;
+    background: url(../images/brooklyn-logo.png) no-repeat;
+    margin-top: 50px;
+    margin-left: 40px;
+}
+
+.navbar-inner {
+    min-height: 105px !important;
+    border-bottom: 2px solid #a9a9a9;
+    background: #383737 url(../images/brooklyn-header-background.png)
+        repeat-x top;
+}
+
+.menubar-top {
+    padding-right: 0px !important
+}
+
+.userName-top {
+    display: inline-block;
+    vertical-align: bottom;
+    float: right;
+    text-align: bottom;
+    font-weight:bold;
+    font-size:15px;
+    padding: 75px 10px 0 0;
+}
+
+.navbar .nav {
+    margin-right: 0px !important;
+}
+
+.navbar .nav>li {
+    margin: 35px 0px 0px 3px !important;
+}
+
+.navbar .nav>li>a {
+    border: 1px solid #151515;
+    padding: 8px 11px !important;
+    font-size: 15px !important;
+    background: url(../images/main-menu-tab.png) top !important;
+}
+
+.navbar .nav>li>a.active {
+    background: url(../images/main-menu-tab-active.png) top !important;
+    margin-top: 3px !important
+}
+
+.navbar .nav>li>a:hover {
+    color: #FFF !important;
+    background: url(../images/main-menu-tab-hover.png) top !important;
+}
+
+.table-bordered thead:first-child tr:first-child th:first-child,.table-bordered tbody:first-child tr:first-child td:first-child
+    {
+    -webkit-border-top-left-radius: 13px !important;
+    -moz-border-top-left-radius: 13px !important;
+    border-top-left-radius: 13px !important;
+    background-color: #f7f7f7 !important;
+}
+
+.table-bordered thead:first-child tr:first-child th:last-child,.table-bordered tbody:first-child tr:first-child td:last-child
+    {
+    -webkit-border-top-right-radius: 13px !important;
+    -moz-border-top-right-radius: 13px !important;
+    border-top-right-radius: 13px !important;
+    background-color: #f7f7f7 !important;
+}
+
+.table-condensed th {
+    background-color: #f7f7f7;
+    padding: 8px;
+}
+
+.table-bordered tr td {
+    background-color: #f7f7f7;
+    padding: 8px;
+}
+
+.table-bordered thead:last-child tr:last-child th:first-child,.table-bordered tbody:last-child tr:last-child td:first-child
+    {
+    -webkit-border-top-right-radius: 0 0 0 13px !important;
+    -moz-border-top-right-radius: 0 0 0 13px !important;
+    border-bottom-left-radius: 13px;
+}
+
+.table-bordered thead:last-child tr:last-child th:last-child,.table-bordered tbody:last-child tr:last-child td:last-child
+    {
+    -webkit-border-top-right-radius: 0 0 13px 0 !important;
+    -moz-border-top-right-radius: 0 0 13px 0 !important;
+    border-bottom-right-radius: 13px;
+}
+/*HOME BODY */
+
+/*APP PAGE*/
+.row-fluid .span4 {
+    width: 300px !important;
+    margin-left: 34px !important;
+    margin-top: 10px !important
+}
+
+.row-fluid .span8 {
+    width: 618px !important;
+    margin-right: -26px !important;
+    margin-top: 10px !important
+}
+
+.navbar_top {
+    background-color: #f0f0f0 !important;
+    -webkit-border-radius: 13px 13px 0 0 !important;
+    -moz-border-radius: 13px 13px 0 0 !important;
+    border-radius: 13px 13px 0 0 !important;
+    border: 1px solid #d3d3d3;
+    border-bottom: none;
+}
+
+.navbar_top  h3 {
+    line-height: 24px !important;
+}
+
+.navbar_main_wrapper {
+    background-color: #ffffff !important;
+    -webkit-border-radius: 0 0 13px 13px !important;
+    -moz-border-radius: 0 0 13px 13px !important;
+    border-radius: 0 0 13px 13px !important;
+    border: 1px solid #d3d3d3;
+    border-top: 4px solid #e2e2e2;
+}
+
+.apps-tree-toolbar {
+    float: right;
+    margin: 0px !important;
+    margin-top: -18px !important;
+}
+
+.icon-br-plus-sign {
+    background: url(../images/application-icon-add.png) top left !important;
+    width: 15px !important;
+    height: 15px !important;
+}
+
+.icon-br-plus-sign:hover {
+    background: url(../images/application-icon-add-hover.png) top left
+        !important;
+}
+
+.icon-br-refresh {
+    background: url(../images/application-icon-refresh.png) top left
+        !important;
+    width: 15px !important;
+    height: 15px !important;
+}
+.icon-br-refresh:hover {
+    background: url(../images/application-icon-refresh-hover.png) top left
+        !important;
+}
+
+.table-toolbar-icon:hover {
+    opacity: .7;
+}
+
+#details {
+    background-color: #f0f0f0 !important;
+    -webkit-border-radius: 13px 13px 13px 13px !important;
+    -moz-border-radius: 13px 13px 13px 13px !important;
+    border-radius: 13px 13px 13px 13px !important;
+    border: 1px solid #d3d3d3;
+    padding-top: 9px;
+}
+
+.tab-content {
+    background-color: #ffffff !important;
+    border: none !important;
+    -webkit-border-radius: 0 0 13px 13px !important;
+    -moz-border-radius: 0 0 13px 13px !important;
+    border-radius: 0 0 13px 13px !important;
+}
+
+.nav-tabs {
+    border-bottom: 4px solid #e2e2e2 !important;
+}
+
+.nav-tabs>.active>a,.nav-tabs>.active {
+    color: #549e2b;
+}
+
+.nav-tabs>.active>a,.nav-tabs>.active a {
+    background: #ffffff !important;
+}
+
+.nav-tabs .dropdown-menu li > a:hover,
+.nav-tabs .dropdown-menu .active > a,
+.nav-tabs .dropdown-menu .active > a:hover {
+    color: white;
+    background-color: #549e2b !important;
+}
+
+.nav-tabs>li>a {
+    color: #444444 !important;
+    border: 1px solid #dddddd !important;
+    background: #ffffff url(../images/nav-tabs-background.png) top
+        !important;
+    padding-bottom: 7px !important;
+    padding-top: 9px !important;
+}
+
+.nav-tabs>li>a:hover {
+    color: #549e2b !important;
+    background: #ffffff none !important;
+}
+.nav-tabs .dropdown-toggle .caret, .nav-pills .dropdown-toggle .caret {
+    opacity: 0.5;
+    margin-top: 6px;
+    border-top-color: #000;
+    border-bottom-color: #000;
+}
+.nav-tabs .dropdown-toggle:hover .caret, .nav-pills .dropdown-toggle:hover .caret {
+    opacity: 0.8;
+    border-top-color: #549e2b;
+    border-bottom-color: #549e2b;
+}
+
+#advanced-summary button.btn {
+    margin-left: 6px;
+}
+/*APP PAGE*/
+
+/* END KROME STYLES */
+
+.view_not_available {
+    /*
+    // nothing yet; idea is to put CSS here which will show a 'Not Available' message.
+    // but it is hard to position it without assuming or introducing position-absolute on the parent.
+    // probably need to mess with the hierarchy, or make such an assumption.
+    // also there is the issue the (currently) the parent view has had opacity set to 0.2.
+    // used in viewutils.js fade/cancelFade methods (and should be only those!)
+    content: 'Not Available';
+    */
+}

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/css/jquery.dataTables.css
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/css/jquery.dataTables.css b/src/main/webapp/assets/css/jquery.dataTables.css
new file mode 100644
index 0000000..3197c7c
--- /dev/null
+++ b/src/main/webapp/assets/css/jquery.dataTables.css
@@ -0,0 +1,238 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+*/
+
+/*
+ * Table
+ */
+table.dataTable {
+    margin: 0 auto;
+    clear: both;
+    width: 100%;
+}
+
+table.dataTable thead th {
+    padding: 3px 18px 3px 10px;
+    border-bottom: 1px solid black;
+    font-weight: bold;
+    cursor: pointer;
+    *cursor: hand;
+}
+
+table.dataTable tfoot th {
+    padding: 3px 18px 3px 10px;
+    border-top: 1px solid black;
+    font-weight: bold;
+}
+
+table.dataTable td {
+    padding: 3px 10px;
+}
+
+table.dataTable td.center,
+table.dataTable td.dataTables_empty {
+    text-align: center;
+}
+
+table.dataTable tr.odd { background-color: #E2E4FF; }
+table.dataTable tr.even { background-color: white; }
+
+table.dataTable tr.odd td.sorting_1 { background-color: #D3D6FF; }
+table.dataTable tr.odd td.sorting_2 { background-color: #DADCFF; }
+table.dataTable tr.odd td.sorting_3 { background-color: #E0E2FF; }
+table.dataTable tr.even td.sorting_1 { background-color: #EAEBFF; }
+table.dataTable tr.even td.sorting_2 { background-color: #F2F3FF; }
+table.dataTable tr.even td.sorting_3 { background-color: #F9F9FF; }
+
+
+/*
+ * Table wrapper
+ */
+.dataTables_wrapper {
+    position: relative;
+    clear: both;
+    *zoom: 1;
+}
+
+
+/*
+ * Page length menu
+ */
+.dataTables_length {
+    float: left;
+}
+
+
+/*
+ * Filter
+ */
+.dataTables_filter {
+    float: right;
+    text-align: right;
+}
+
+
+/*
+ * Table information
+ */
+.dataTables_info {
+    clear: both;
+    float: left;
+}
+
+
+/*
+ * Pagination
+ */
+.dataTables_paginate {
+    float: right;
+    text-align: right;
+}
+
+/* Two button pagination - previous / next */
+.paginate_disabled_previous,
+.paginate_enabled_previous,
+.paginate_disabled_next,
+.paginate_enabled_next {
+    height: 19px;
+    float: left;
+    cursor: pointer;
+    *cursor: hand;
+    color: #111 !important;
+}
+.paginate_disabled_previous:hover,
+.paginate_enabled_previous:hover,
+.paginate_disabled_next:hover,
+.paginate_enabled_next:hover {
+    text-decoration: none !important;
+}
+.paginate_disabled_previous:active,
+.paginate_enabled_previous:active,
+.paginate_disabled_next:active,
+.paginate_enabled_next:active {
+    outline: none;
+}
+
+.paginate_disabled_previous,
+.paginate_disabled_next {
+    color: #666 !important;
+}
+.paginate_disabled_previous,
+.paginate_enabled_previous {
+    padding-left: 23px;
+}
+.paginate_disabled_next,
+.paginate_enabled_next {
+    padding-right: 23px;
+    margin-left: 10px;
+}
+
+.paginate_enabled_previous { background: url('../images/back_enabled.png') no-repeat top left; }
+.paginate_enabled_previous:hover { background: url('../images/back_enabled_hover.png') no-repeat top left; }
+.paginate_disabled_previous { background: url('../images/back_disabled.png') no-repeat top left; }
+
+.paginate_enabled_next { background: url('../images/forward_enabled.png') no-repeat top right; }
+.paginate_enabled_next:hover { background: url('../images/forward_enabled_hover.png') no-repeat top right; }
+.paginate_disabled_next { background: url('../images/forward_disabled.png') no-repeat top right; }
+
+/* Full number pagination */
+.paging_full_numbers {
+    height: 22px;
+    line-height: 22px;
+}
+.paging_full_numbers a:active {
+    outline: none
+}
+.paging_full_numbers a:hover {
+    text-decoration: none;
+}
+
+.paging_full_numbers a.paginate_button,
+.paging_full_numbers a.paginate_active {
+    border: 1px solid #aaa;
+    -webkit-border-radius: 5px;
+    -moz-border-radius: 5px;
+    border-radius: 5px;
+    padding: 2px 5px;
+    margin: 0 3px;
+    cursor: pointer;
+    *cursor: hand;
+    color: #333 !important;
+}
+
+.paging_full_numbers a.paginate_button {
+    background-color: #ddd;
+}
+
+.paging_full_numbers a.paginate_button:hover {
+    background-color: #ccc;
+    text-decoration: none !important;
+}
+
+.paging_full_numbers a.paginate_active {
+    background-color: #99B3FF;
+}
+
+
+/*
+ * Processing indicator
+ */
+.dataTables_processing {
+    position: absolute;
+    top: 50%;
+    left: 50%;
+    width: 250px;
+    height: 30px;
+    margin-left: -125px;
+    margin-top: -15px;
+    padding: 14px 0 2px 0;
+    border: 1px solid #ddd;
+    text-align: center;
+    color: #999;
+    font-size: 14px;
+    background-color: white;
+}
+
+
+/*
+ * Sorting
+ */
+.sorting { background: url('../images/sort_both.png') no-repeat center right; }
+.sorting_asc { background: url('../images/sort_asc.png') no-repeat center right; }
+.sorting_desc { background: url('../images/sort_desc.png') no-repeat center right; }
+
+.sorting_asc_disabled { background: url('../images/sort_asc_disabled.png') no-repeat center right; }
+.sorting_desc_disabled { background: url('../images/sort_desc_disabled.png') no-repeat center right; }
+ 
+table.dataTable th:active {
+    outline: none;
+}
+
+
+/*
+ * Scrolling
+ */
+.dataTables_scroll {
+    clear: both;
+}
+
+.dataTables_scrollBody {
+    *margin-top: -1px;
+    -webkit-overflow-scrolling: touch;
+}
+

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/css/styles.css
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/css/styles.css b/src/main/webapp/assets/css/styles.css
new file mode 100644
index 0000000..bfb5b40
--- /dev/null
+++ b/src/main/webapp/assets/css/styles.css
@@ -0,0 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+*/
+@import url('bootstrap.css');
+@import url('jquery.dataTables.css');
+@import url('base.css');
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/css/swagger.css
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/css/swagger.css b/src/main/webapp/assets/css/swagger.css
new file mode 100644
index 0000000..b344d70
--- /dev/null
+++ b/src/main/webapp/assets/css/swagger.css
@@ -0,0 +1,1567 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+*/
+/* BROOKLYN removed
+
+html, body, div, span, applet, object, iframe,
+h1, h2, h3, h4, h5, h6, p, blockquote, pre,
+a, abbr, acronym, address, big, cite, code,
+del, dfn, em, img, ins, kbd, q, s, samp,
+small, strike, strong, sub, sup, tt, var,
+b, u, i, center,
+dl, dt, dd, ol, ul, li,
+fieldset, form, label, legend,
+table, caption, tbody, tfoot, thead, tr, th, td,
+article, aside, canvas, details, embed,
+figure, figcaption, footer, header, hgroup,
+menu, nav, output, ruby, section, summary,
+time, mark, audio, video {
+    margin: 0;
+    padding: 0;
+    border: 0;
+    font-size: 100%;
+    vertical-align: baseline;
+}
+
+body {
+    line-height: 1;
+}
+
+ */
+ 
+ol, ul {
+    list-style: none;
+}
+
+table {
+    border-collapse: collapse;
+    border-spacing: 0;
+}
+
+caption, th, td {
+    text-align: left;
+    font-weight: normal;
+    vertical-align: middle;
+}
+
+q, blockquote {
+    quotes: none;
+}
+
+q:before, q:after, blockquote:before, blockquote:after {
+    content: "";
+    content: none;
+}
+
+a img {
+    border: none;
+}
+
+article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section, summary {
+    display: block;
+}
+
+h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
+    text-decoration: none;
+}
+
+h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover, h5 a:hover, h6 a:hover {
+    text-decoration: underline;
+}
+
+h1 span.divider, h2 span.divider, h3 span.divider, h4 span.divider, h5 span.divider, h6 span.divider {
+    color: #aaaaaa;
+}
+
+h1 {
+    color: #547f00;
+    color: black;
+    font-size: 1.5em;
+    line-height: 1.3em;
+    padding: 10px 0 10px 0;
+/*    font-family: "Droid Sans", sans-serif; */
+    font-weight: bold;
+}
+
+h2 {
+    color: #89bf04;
+    color: black;
+    font-size: 1.3em;
+/*    padding: 10px 0 10px 0; */
+}
+
+h2 a {
+    color: black;
+}
+
+h2 span.sub {
+    font-size: 0.7em;
+    color: #999999;
+    font-style: italic;
+}
+
+h2 span.sub a {
+    color: #777777;
+}
+
+h3 {
+    color: black;
+    font-size: 1.1em;
+    padding: 10px 0 10px 0;
+}
+
+div.heading_with_menu {
+    float: none;
+    clear: both;
+    overflow: hidden;
+    display: block;
+}
+
+div.heading_with_menu h1, div.heading_with_menu h2, div.heading_with_menu h3, div.heading_with_menu h4, div.heading_with_menu h5, div.heading_with_menu h6 {
+    display: block;
+    clear: none;
+    float: left;
+    -moz-box-sizing: border-box;
+    -webkit-box-sizing: border-box;
+    -ms-box-sizing: border-box;
+    box-sizing: border-box;
+    width: 60%;
+}
+
+div.heading_with_menu ul {
+    display: block;
+    clear: none;
+    float: right;
+    -moz-box-sizing: border-box;
+    -webkit-box-sizing: border-box;
+    -ms-box-sizing: border-box;
+    box-sizing: border-box;
+    margin-top: 10px;
+}
+
+.body-textarea {
+    width: 300px;
+    height: 100px;
+}
+
+p {
+    line-height: 1.4em;
+    padding: 0 0 10px 0;
+    color: #333333;
+}
+
+ol {
+    margin: 0px 0 10px 0;
+    padding: 0 0 0 18px;
+    list-style-type: decimal;
+}
+
+ol li {
+    padding: 5px 0px;
+    font-size: 0.9em;
+    color: #333333;
+}
+
+.markdown h3 {
+    color: #547f00;
+}
+
+.markdown h4 {
+    color: #666666;
+}
+
+.markdown pre {
+    font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
+    background-color: #fcf6db;
+    border: 1px solid black;
+    border-color: #e5e0c6;
+    padding: 10px;
+    margin: 0 0 10px 0;
+}
+
+.markdown pre code {
+    line-height: 1.6em;
+}
+
+.markdown p code, .markdown li code {
+    font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
+    background-color: #f0f0f0;
+    color: black;
+    padding: 1px 3px;
+}
+
+.markdown ol, .markdown ul {
+/*    font-family: "Droid Sans", sans-serif; */
+    margin: 5px 0 10px 0;
+    padding: 0 0 0 18px;
+    list-style-type: disc;
+}
+
+.markdown ol li, .markdown ul li {
+    padding: 3px 0px;
+    line-height: 1.4em;
+    color: #333333;
+}
+
+div.gist {
+    margin: 20px 0 25px 0 !important;
+}
+
+p.big, div.big p {
+    font-size: 1em;
+    margin-bottom: 10px;
+}
+
+span.weak {
+    color: #666666;
+}
+
+span.blank, span.empty {
+    color: #888888;
+    font-style: italic;
+}
+
+a {
+    color: #547f00;
+}
+
+strong {
+/*    font-family: "Droid Sans", sans-serif; */
+    font-weight: bold;
+}
+
+.code {
+    font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
+}
+
+pre {
+    font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
+    background-color: #fcf6db;
+    border: 1px solid black;
+    border-color: #e5e0c6;
+    padding: 10px;
+    /* white-space: pre-line */
+}
+
+pre code {
+    line-height: 1.6em;
+}
+
+.required {
+    font-weight: bold;
+}
+
+table.fullwidth {
+    width: 100%;
+}
+
+table thead tr th {
+    padding: 5px;
+    font-size: 0.9em;
+    color: #666666;
+    border-bottom: 1px solid #999999;
+}
+
+table tbody tr.offset {
+    background-color: #f5f5f5;
+}
+
+table tbody tr td {
+    padding: 6px;
+    font-size: 0.9em;
+    border-bottom: 1px solid #cccccc;
+    vertical-align: top;
+    line-height: 1.3em;
+}
+
+table tbody tr:last-child td {
+    border-bottom: none;
+}
+
+table tbody tr.offset {
+    background-color: #f0f0f0;
+}
+
+form.form_box {
+    background-color: #ebf3f9;
+    border: 1px solid black;
+    border-color: #c3d9ec;
+    padding: 10px;
+}
+
+form.form_box label {
+    color: #0f6ab4 !important;
+}
+
+form.form_box input[type=submit] {
+    display: block;
+    padding: 10px;
+}
+
+form.form_box p {
+    font-size: 0.9em;
+    padding: 0 0 15px 0;
+    color: #7e7b6d;
+}
+
+form.form_box p a {
+    color: #646257;
+}
+
+form.form_box p strong {
+    color: black;
+}
+
+form.form_box p.weak {
+    font-size: 0.8em;
+}
+
+form.formtastic fieldset.inputs ol li p.inline-hints {
+    margin-left: 0;
+    font-style: italic;
+    font-size: 0.9em;
+    margin: 0;
+}
+
+form.formtastic fieldset.inputs ol li label {
+    display: block;
+    clear: both;
+    width: auto;
+    padding: 0 0 3px 0;
+    color: #666666;
+}
+
+form.formtastic fieldset.inputs ol li label abbr {
+    padding-left: 3px;
+    color: #888888;
+}
+
+form.formtastic fieldset.inputs ol li.required label {
+    color: black;
+}
+
+form.formtastic fieldset.inputs ol li.string input, form.formtastic fieldset.inputs ol li.url input, form.formtastic fieldset.inputs ol li.numeric input {
+    display: block;
+    padding: 4px;
+    width: auto;
+    clear: both;
+}
+
+form.formtastic fieldset.inputs ol li.string input.title, form.formtastic fieldset.inputs ol li.url input.title, form.formtastic fieldset.inputs ol li.numeric input.title {
+    font-size: 1.3em;
+}
+
+form.formtastic fieldset.inputs ol li.text textarea {
+/*    font-family: "Droid Sans", sans-serif; */
+    height: 250px;
+    padding: 4px;
+    display: block;
+    clear: both;
+}
+
+form.formtastic fieldset.inputs ol li.select select {
+    display: block;
+    clear: both;
+}
+
+form.formtastic fieldset.inputs ol li.boolean {
+    float: none;
+    clear: both;
+    overflow: hidden;
+    display: block;
+}
+
+form.formtastic fieldset.inputs ol li.boolean input {
+    display: block;
+    float: left;
+    clear: none;
+    margin: 0 5px 0 0;
+}
+
+form.formtastic fieldset.inputs ol li.boolean label {
+    display: block;
+    float: left;
+    clear: none;
+    margin: 0;
+    padding: 0;
+}
+
+form.formtastic fieldset.buttons {
+    margin: 0;
+    padding: 0;
+}
+
+form.fullwidth ol li.string input, form.fullwidth ol li.url input, form.fullwidth ol li.text textarea, form.fullwidth ol li.numeric input {
+    width: 500px !important;
+}
+
+body {
+/*    font-family: "Droid Sans", sans-serif; */
+}
+
+body #content_message {
+    margin: 10px 15px;
+    font-style: italic;
+    color: #999999;
+}
+
+body #header {
+    background-color: #89bf04;
+    padding: 14px;
+}
+
+body #header a#logo {
+    font-size: 1.5em;
+    font-weight: bold;
+    text-decoration: none;
+    background: transparent url(../images/logo_small.png) no-repeat left center;
+    padding: 20px 0 20px 40px;
+    color: white;
+}
+
+body #header form#api_selector {
+    display: block;
+    clear: none;
+    float: right;
+}
+
+body #header form#api_selector .input {
+    display: block;
+    clear: none;
+    float: left;
+    margin: 0 10px 0 0;
+}
+
+body #header form#api_selector .input input {
+    font-size: 0.9em;
+    padding: 3px;
+    margin: 0;
+}
+
+body #header form#api_selector .input input#input_baseUrl {
+    width: 400px;
+}
+
+body #header form#api_selector .input input#input_apiKey {
+    width: 200px;
+}
+
+body #header form#api_selector .input a#explore {
+    display: block;
+    text-decoration: none;
+    font-weight: bold;
+    padding: 6px 8px;
+    font-size: 0.9em;
+    color: white;
+    background-color: #547f00;
+    -moz-border-radius: 4px;
+    -webkit-border-radius: 4px;
+    -o-border-radius: 4px;
+    -ms-border-radius: 4px;
+    -khtml-border-radius: 4px;
+    border-radius: 4px;
+}
+
+body #header form#api_selector .input a#explore:hover {
+    background-color: #547f00;
+}
+
+body p#colophon {
+    margin: 0 15px 40px 15px;
+    padding: 10px 0;
+    font-size: 0.8em;
+    border-top: 1px solid #dddddd;
+/*    font-family: "Droid Sans", sans-serif; */
+    color: #999999;
+    font-style: italic;
+}
+
+body p#colophon a {
+    text-decoration: none;
+    color: #547f00;
+}
+
+body ul#resources {
+/*    font-family: "Droid Sans", sans-serif; */
+    font-size: 0.9em;
+}
+
+body ul#resources li.resource {
+    border-bottom: 1px solid #dddddd;
+}
+
+body ul#resources li.resource:last-child {
+    border-bottom: none;
+}
+
+body ul#resources li.resource div.heading {
+    border: 1px solid transparent;
+    float: none;
+    clear: both;
+    overflow: hidden;
+    display: block;
+}
+
+body ul#resources li.resource div.heading h2 {
+    color: #999999;
+    padding-left: 0px;
+    display: block;
+    clear: none;
+    float: left;
+/*    font-family: "Droid Sans", sans-serif; */
+    font-weight: bold;
+}
+
+body ul#resources li.resource div.heading h2 a {
+    color: #999999;
+}
+
+body ul#resources li.resource div.heading h2 a:hover {
+    color: black;
+}
+
+body ul#resources li.resource div.heading ul.options {
+    float: none;
+    clear: both;
+    overflow: hidden;
+    margin: 0;
+    padding: 0;
+    display: block;
+    clear: none;
+    float: right;
+    margin: 14px 10px 0 0;
+}
+
+body ul#resources li.resource div.heading ul.options li {
+    float: left;
+    clear: none;
+    margin: 0;
+    padding: 2px 10px;
+    border-right: 1px solid #dddddd;
+}
+
+body ul#resources li.resource div.heading ul.options li:first-child, body ul#resources li.resource div.heading ul.options li.first {
+    padding-left: 0;
+}
+
+body ul#resources li.resource div.heading ul.options li:last-child, body ul#resources li.resource div.heading ul.options li.last {
+    padding-right: 0;
+    border-right: none;
+}
+
+body ul#resources li.resource div.heading ul.options li {
+    color: #666666;
+    font-size: 0.9em;
+}
+
+body ul#resources li.resource div.heading ul.options li a {
+    color: #aaaaaa;
+    text-decoration: none;
+}
+
+body ul#resources li.resource div.heading ul.options li a:hover {
+    text-decoration: underline;
+    color: black;
+}
+
+body ul#resources li.resource:hover div.heading h2 a, body ul#resources li.resource.active div.heading h2 a {
+    color: black;
+}
+
+body ul#resources li.resource:hover div.heading ul.options li a, body ul#resources li.resource.active div.heading ul.options li a {
+    color: #555555;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get {
+    float: none;
+    clear: both;
+    overflow: hidden;
+    display: block;
+    margin: 0 0 10px 0;
+    padding: 0 0 0 0px;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading {
+    float: none;
+    clear: both;
+    overflow: hidden;
+    display: block;
+    margin: 0 0 0 0;
+    padding: 0;
+    background-color: #e7f0f7;
+    border: 1px solid black;
+    border-color: #c3d9ec;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading h3 {
+    display: block;
+    clear: none;
+    float: left;
+    width: auto;
+    margin: 0;
+    padding: 0;
+    line-height: 1.1em;
+    color: black;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading h3 span {
+    margin: 0;
+    padding: 0;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading h3 span.http_method a {
+    text-transform: uppercase;
+    background-color: #0f6ab4;
+    text-decoration: none;
+    color: white;
+    display: inline-block;
+    width: 50px;
+    font-size: 0.7em;
+    text-align: center;
+    padding: 7px 0 4px 0;
+    -moz-border-radius: 2px;
+    -webkit-border-radius: 2px;
+    -o-border-radius: 2px;
+    -ms-border-radius: 2px;
+    -khtml-border-radius: 2px;
+    border-radius: 2px;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading h3 span.path {
+    padding-left: 10px;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading h3 span.path a {
+    color: black;
+    text-decoration: none;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading h3 span.path a:hover {
+    text-decoration: underline;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options {
+    float: none;
+    clear: both;
+    overflow: hidden;
+    margin: 0;
+    padding: 0;
+    display: block;
+    clear: none;
+    float: right;
+    margin: 6px 10px 0 0;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li {
+    float: left;
+    clear: none;
+    margin: 0;
+    padding: 2px 10px;
+    border-right: 1px solid #dddddd;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li:first-child, body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li.first {
+    padding-left: 0;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li:last-child, body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li.last {
+    padding-right: 0;
+    border-right: none;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li {
+    border-right-color: #c3d9ec;
+    color: #0f6ab4;
+    font-size: 0.9em;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li a {
+    color: #0f6ab4;
+    text-decoration: none;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li a:hover, body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li a:active, body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li a.active {
+    text-decoration: underline;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content {
+    background-color: #ebf3f9;
+    border: 1px solid black;
+    border-color: #c3d9ec;
+    border-top: none;
+    padding: 10px;
+    -moz-border-radius-bottomleft: 6px;
+    -webkit-border-bottom-left-radius: 6px;
+    -o-border-bottom-left-radius: 6px;
+    -ms-border-bottom-left-radius: 6px;
+    -khtml-border-bottom-left-radius: 6px;
+    border-bottom-left-radius: 6px;
+    -moz-border-radius-bottomright: 6px;
+    -webkit-border-bottom-right-radius: 6px;
+    -o-border-bottom-right-radius: 6px;
+    -ms-border-bottom-right-radius: 6px;
+    -khtml-border-bottom-right-radius: 6px;
+    border-bottom-right-radius: 6px;
+    margin: 0 0 20px 0;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content h4 {
+    color: #0f6ab4;
+    font-size: 1.1em;
+    margin: 0;
+    padding: 15px 0 5px 0px;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content form input[type='text'].error {
+    outline: 2px solid black;
+    outline-color: #cc0000;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content div.sandbox_header {
+    float: none;
+    clear: both;
+    overflow: hidden;
+    display: block;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content div.sandbox_header input.submit {
+    display: block;
+    clear: none;
+    float: left;
+    padding: 6px 8px;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content div.sandbox_header img {
+    display: block;
+    display: block;
+    clear: none;
+    float: right;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content div.sandbox_header a {
+    padding: 4px 0 0 10px;
+    color: #6fa5d2;
+    display: inline-block;
+    font-size: 0.9em;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content div.response div.block {
+    background-color: #fcf6db;
+    border: 1px solid black;
+    border-color: #e5e0c6;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content div.response div.block pre {
+    font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
+    padding: 10px;
+    font-size: 0.9em;
+    max-height: 400px;
+    overflow-y: auto;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post {
+    float: none;
+    clear: both;
+    overflow: hidden;
+    display: block;
+    margin: 0 0 10px 0;
+    padding: 0 0 0 0px;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading {
+    float: none;
+    clear: both;
+    overflow: hidden;
+    display: block;
+    margin: 0 0 0 0;
+    padding: 0;
+    background-color: #e7f6ec;
+    border: 1px solid black;
+    border-color: #c3e8d1;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading h3 {
+    display: block;
+    clear: none;
+    float: left;
+    width: auto;
+    margin: 0;
+    padding: 0;
+    line-height: 1.1em;
+    color: black;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading h3 span {
+    margin: 0;
+    padding: 0;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading h3 span.http_method a {
+    text-transform: uppercase;
+    background-color: #10a54a;
+    text-decoration: none;
+    color: white;
+    display: inline-block;
+    width: 50px;
+    font-size: 0.7em;
+    text-align: center;
+    padding: 7px 0 4px 0;
+    -moz-border-radius: 2px;
+    -webkit-border-radius: 2px;
+    -o-border-radius: 2px;
+    -ms-border-radius: 2px;
+    -khtml-border-radius: 2px;
+    border-radius: 2px;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading h3 span.path {
+    padding-left: 10px;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading h3 span.path a {
+    color: black;
+    text-decoration: none;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading h3 span.path a:hover {
+    text-decoration: underline;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options {
+    float: none;
+    clear: both;
+    overflow: hidden;
+    margin: 0;
+    padding: 0;
+    display: block;
+    clear: none;
+    float: right;
+    margin: 6px 10px 0 0;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li {
+    float: left;
+    clear: none;
+    margin: 0;
+    padding: 2px 10px;
+    border-right: 1px solid #dddddd;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li:first-child, body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li.first {
+    padding-left: 0;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li:last-child, body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li.last {
+    padding-right: 0;
+    border-right: none;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li {
+    border-right-color: #c3e8d1;
+    color: #10a54a;
+    font-size: 0.9em;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li a {
+    color: #10a54a;
+    text-decoration: none;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li a:hover, body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li a:active, body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li a.active {
+    text-decoration: underline;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content {
+    background-color: #ebf7f0;
+    border: 1px solid black;
+    border-color: #c3e8d1;
+    border-top: none;
+    padding: 10px;
+    -moz-border-radius-bottomleft: 6px;
+    -webkit-border-bottom-left-radius: 6px;
+    -o-border-bottom-left-radius: 6px;
+    -ms-border-bottom-left-radius: 6px;
+    -khtml-border-bottom-left-radius: 6px;
+    border-bottom-left-radius: 6px;
+    -moz-border-radius-bottomright: 6px;
+    -webkit-border-bottom-right-radius: 6px;
+    -o-border-bottom-right-radius: 6px;
+    -ms-border-bottom-right-radius: 6px;
+    -khtml-border-bottom-right-radius: 6px;
+    border-bottom-right-radius: 6px;
+    margin: 0 0 20px 0;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content h4 {
+    color: #10a54a;
+    font-size: 1.1em;
+    margin: 0;
+    padding: 15px 0 5px 0px;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content form input[type='text'].error {
+    outline: 2px solid black;
+    outline-color: #cc0000;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content div.sandbox_header {
+    float: none;
+    clear: both;
+    overflow: hidden;
+    display: block;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content div.sandbox_header input.submit {
+    display: block;
+    clear: none;
+    float: left;
+    padding: 6px 8px;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content div.sandbox_header img {
+    display: block;
+    display: block;
+    clear: none;
+    float: right;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content div.sandbox_header a {
+    padding: 4px 0 0 10px;
+    color: #6fc992;
+    display: inline-block;
+    font-size: 0.9em;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content div.response div.block {
+    background-color: #fcf6db;
+    border: 1px solid black;
+    border-color: #e5e0c6;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content div.response div.block pre {
+    font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
+    padding: 10px;
+    font-size: 0.9em;
+    max-height: 400px;
+    overflow-y: auto;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put {
+    float: none;
+    clear: both;
+    overflow: hidden;
+    display: block;
+    margin: 0 0 10px 0;
+    padding: 0 0 0 0px;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading {
+    float: none;
+    clear: both;
+    overflow: hidden;
+    display: block;
+    margin: 0 0 0 0;
+    padding: 0;
+    background-color: #f9f2e9;
+    border: 1px solid black;
+    border-color: #f0e0ca;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading h3 {
+    display: block;
+    clear: none;
+    float: left;
+    width: auto;
+    margin: 0;
+    padding: 0;
+    line-height: 1.1em;
+    color: black;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading h3 span {
+    margin: 0;
+    padding: 0;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading h3 span.http_method a {
+    text-transform: uppercase;
+    background-color: #c5862b;
+    text-decoration: none;
+    color: white;
+    display: inline-block;
+    width: 50px;
+    font-size: 0.7em;
+    text-align: center;
+    padding: 7px 0 4px 0;
+    -moz-border-radius: 2px;
+    -webkit-border-radius: 2px;
+    -o-border-radius: 2px;
+    -ms-border-radius: 2px;
+    -khtml-border-radius: 2px;
+    border-radius: 2px;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading h3 span.path {
+    padding-left: 10px;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading h3 span.path a {
+    color: black;
+    text-decoration: none;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading h3 span.path a:hover {
+    text-decoration: underline;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options {
+    float: none;
+    clear: both;
+    overflow: hidden;
+    margin: 0;
+    padding: 0;
+    display: block;
+    clear: none;
+    float: right;
+    margin: 6px 10px 0 0;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li {
+    float: left;
+    clear: none;
+    margin: 0;
+    padding: 2px 10px;
+    border-right: 1px solid #dddddd;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li:first-child, body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li.first {
+    padding-left: 0;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li:last-child, body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li.last {
+    padding-right: 0;
+    border-right: none;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li {
+    border-right-color: #f0e0ca;
+    color: #c5862b;
+    font-size: 0.9em;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li a {
+    color: #c5862b;
+    text-decoration: none;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li a:hover, body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li a:active, body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li a.active {
+    text-decoration: underline;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content {
+    background-color: #faf5ee;
+    border: 1px solid black;
+    border-color: #f0e0ca;
+    border-top: none;
+    padding: 10px;
+    -moz-border-radius-bottomleft: 6px;
+    -webkit-border-bottom-left-radius: 6px;
+    -o-border-bottom-left-radius: 6px;
+    -ms-border-bottom-left-radius: 6px;
+    -khtml-border-bottom-left-radius: 6px;
+    border-bottom-left-radius: 6px;
+    -moz-border-radius-bottomright: 6px;
+    -webkit-border-bottom-right-radius: 6px;
+    -o-border-bottom-right-radius: 6px;
+    -ms-border-bottom-right-radius: 6px;
+    -khtml-border-bottom-right-radius: 6px;
+    border-bottom-right-radius: 6px;
+    margin: 0 0 20px 0;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content h4 {
+    color: #c5862b;
+    font-size: 1.1em;
+    margin: 0;
+    padding: 15px 0 5px 0px;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content form input[type='text'].error {
+    outline: 2px solid black;
+    outline-color: #cc0000;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content div.sandbox_header {
+    float: none;
+    clear: both;
+    overflow: hidden;
+    display: block;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content div.sandbox_header input.submit {
+    display: block;
+    clear: none;
+    float: left;
+    padding: 6px 8px;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content div.sandbox_header img {
+    display: block;
+    display: block;
+    clear: none;
+    float: right;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content div.sandbox_header a {
+    padding: 4px 0 0 10px;
+    color: #dcb67f;
+    display: inline-block;
+    font-size: 0.9em;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content div.response div.block {
+    background-color: #fcf6db;
+    border: 1px solid black;
+    border-color: #e5e0c6;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content div.response div.block pre {
+    font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
+    padding: 10px;
+    font-size: 0.9em;
+    max-height: 400px;
+    overflow-y: auto;
+}
+
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch {
+    float: none;
+    clear: both;
+    overflow: hidden;
+    display: block;
+    margin: 0 0 10px 0;
+    padding: 0 0 0 0px;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading {
+    float: none;
+    clear: both;
+    overflow: hidden;
+    display: block;
+    margin: 0 0 0 0;
+    padding: 0;
+    background-color: #faebf2;
+    border: 1px solid black;
+    border-color: #f0cecb;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading h3 {
+    display: block;
+    clear: none;
+    float: left;
+    width: auto;
+    margin: 0;
+    padding: 0;
+    line-height: 1.1em;
+    color: black;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading h3 span {
+    margin: 0;
+    padding: 0;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading h3 span.http_method a {
+    text-transform: uppercase;
+    background-color: #993300;
+    text-decoration: none;
+    color: white;
+    display: inline-block;
+    width: 50px;
+    font-size: 0.7em;
+    text-align: center;
+    padding: 7px 0 4px 0;
+    -moz-border-radius: 2px;
+    -webkit-border-radius: 2px;
+    -o-border-radius: 2px;
+    -ms-border-radius: 2px;
+    -khtml-border-radius: 2px;
+    border-radius: 2px;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading h3 span.path {
+    padding-left: 10px;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading h3 span.path a {
+    color: black;
+    text-decoration: none;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading h3 span.path a:hover {
+    text-decoration: underline;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options {
+    float: none;
+    clear: both;
+    overflow: hidden;
+    margin: 0;
+    padding: 0;
+    display: block;
+    clear: none;
+    float: right;
+    margin: 6px 10px 0 0;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li {
+    float: left;
+    clear: none;
+    margin: 0;
+    padding: 2px 10px;
+    border-right: 1px solid #dddddd;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li:first-child, body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li.first {
+    padding-left: 0;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li:last-child, body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li.last {
+    padding-right: 0;
+    border-right: none;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li {
+    border-right-color: #f0cecb;
+    color: #993300;
+    font-size: 0.9em;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li a {
+    color: #993300;
+    text-decoration: none;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li a:hover, body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li a:active, body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li a.active {
+    text-decoration: underline;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content {
+    background-color: #faf0ef;
+    border: 1px solid black;
+    border-color: #f0cecb;
+    border-top: none;
+    padding: 10px;
+    -moz-border-radius-bottomleft: 6px;
+    -webkit-border-bottom-left-radius: 6px;
+    -o-border-bottom-left-radius: 6px;
+    -ms-border-bottom-left-radius: 6px;
+    -khtml-border-bottom-left-radius: 6px;
+    border-bottom-left-radius: 6px;
+    -moz-border-radius-bottomright: 6px;
+    -webkit-border-bottom-right-radius: 6px;
+    -o-border-bottom-right-radius: 6px;
+    -ms-border-bottom-right-radius: 6px;
+    -khtml-border-bottom-right-radius: 6px;
+    border-bottom-right-radius: 6px;
+    margin: 0 0 20px 0;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content h4 {
+    color: #993300;
+    font-size: 1.1em;
+    margin: 0;
+    padding: 15px 0 5px 0px;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content form input[type='text'].error {
+    outline: 2px solid black;
+    outline-color: #cc0000;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content div.sandbox_header {
+    float: none;
+    clear: both;
+    overflow: hidden;
+    display: block;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content div.sandbox_header input.submit {
+    display: block;
+    clear: none;
+    float: left;
+    padding: 6px 8px;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content div.sandbox_header img {
+    display: block;
+    display: block;
+    clear: none;
+    float: right;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content div.sandbox_header a {
+    padding: 4px 0 0 10px;
+    color: #dcb67f;
+    display: inline-block;
+    font-size: 0.9em;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content div.response div.block {
+    background-color: #fcf6db;
+    border: 1px solid black;
+    border-color: #e5e0c6;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content div.response div.block pre {
+    font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
+    padding: 10px;
+    font-size: 0.9em;
+    max-height: 400px;
+    overflow-y: auto;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete {
+    float: none;
+    clear: both;
+    overflow: hidden;
+    display: block;
+    margin: 0 0 10px 0;
+    padding: 0 0 0 0px;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading {
+    float: none;
+    clear: both;
+    overflow: hidden;
+    display: block;
+    margin: 0 0 0 0;
+    padding: 0;
+    background-color: #f5e8e8;
+    border: 1px solid black;
+    border-color: #e8c6c7;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading h3 {
+    display: block;
+    clear: none;
+    float: left;
+    width: auto;
+    margin: 0;
+    padding: 0;
+    line-height: 1.1em;
+    color: black;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading h3 span {
+    margin: 0;
+    padding: 0;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading h3 span.http_method a {
+    text-transform: uppercase;
+    background-color: #a41e22;
+    text-decoration: none;
+    color: white;
+    display: inline-block;
+    width: 50px;
+    font-size: 0.7em;
+    text-align: center;
+    padding: 7px 0 4px 0;
+    -moz-border-radius: 2px;
+    -webkit-border-radius: 2px;
+    -o-border-radius: 2px;
+    -ms-border-radius: 2px;
+    -khtml-border-radius: 2px;
+    border-radius: 2px;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading h3 span.path {
+    padding-left: 10px;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading h3 span.path a {
+    color: black;
+    text-decoration: none;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading h3 span.path a:hover {
+    text-decoration: underline;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options {
+    float: none;
+    clear: both;
+    overflow: hidden;
+    margin: 0;
+    padding: 0;
+    display: block;
+    clear: none;
+    float: right;
+    margin: 6px 10px 0 0;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li {
+    float: left;
+    clear: none;
+    margin: 0;
+    padding: 2px 10px;
+    border-right: 1px solid #dddddd;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li:first-child, body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li.first {
+    padding-left: 0;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li:last-child, body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li.last {
+    padding-right: 0;
+    border-right: none;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li {
+    border-right-color: #e8c6c7;
+    color: #a41e22;
+    font-size: 0.9em;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li a {
+    color: #a41e22;
+    text-decoration: none;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li a:hover, body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li a:active, body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li a.active {
+    text-decoration: underline;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content {
+    background-color: #f7eded;
+    border: 1px solid black;
+    border-color: #e8c6c7;
+    border-top: none;
+    padding: 10px;
+    -moz-border-radius-bottomleft: 6px;
+    -webkit-border-bottom-left-radius: 6px;
+    -o-border-bottom-left-radius: 6px;
+    -ms-border-bottom-left-radius: 6px;
+    -khtml-border-bottom-left-radius: 6px;
+    border-bottom-left-radius: 6px;
+    -moz-border-radius-bottomright: 6px;
+    -webkit-border-bottom-right-radius: 6px;
+    -o-border-bottom-right-radius: 6px;
+    -ms-border-bottom-right-radius: 6px;
+    -khtml-border-bottom-right-radius: 6px;
+    border-bottom-right-radius: 6px;
+    margin: 0 0 20px 0;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content h4 {
+    color: #a41e22;
+    font-size: 1.1em;
+    margin: 0;
+    padding: 15px 0 5px 0px;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content form input[type='text'].error {
+    outline: 2px solid black;
+    outline-color: #cc0000;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content div.sandbox_header {
+    float: none;
+    clear: both;
+    overflow: hidden;
+    display: block;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content div.sandbox_header input.submit {
+    display: block;
+    clear: none;
+    float: left;
+    padding: 6px 8px;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content div.sandbox_header img {
+    display: block;
+    display: block;
+    clear: none;
+    float: right;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content div.sandbox_header a {
+    padding: 4px 0 0 10px;
+    color: #c8787a;
+    display: inline-block;
+    font-size: 0.9em;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content div.response div.block {
+    background-color: #fcf6db;
+    border: 1px solid black;
+    border-color: #e5e0c6;
+}
+
+body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content div.response div.block pre {
+    font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
+    padding: 10px;
+    font-size: 0.9em;
+    max-height: 400px;
+    overflow-y: auto;
+}
+
+
+.model-signature {
+/*    font-family: "Droid Sans", sans-serif; */
+    font-size: 1em;
+    line-height: 1.5em;
+}
+.model-signature span {
+    font-size: 0.9em;
+    line-height: 1.5em;
+}
+.model-signature span:nth-child(odd)    { color:#333; }
+.model-signature span:nth-child(even)    { color:#C5862B; }
+
+/* BROOKLYN removed 
+#message-bar {
+    margin-top: 45px;
+}
+ */
+ 
+a {
+    cursor: hand; cursor: pointer;
+}
+
+
+/** BROOKLYN added
+*/
+div#message-bar {
+    text-align: left;
+    margin-top: 12px;
+    margin-bottom: 12px;
+}
+div.apidoc-title {
+    font-weight: bold;
+    padding-left: 24px;
+    font-size: 1.8em;
+    color: #668866;
+    padding-top: 24px;
+    padding-bottom: 24px;
+}
+form.sandbox > table {
+    margin-bottom: 30px;
+}

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/html/swagger-ui.html
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/html/swagger-ui.html b/src/main/webapp/assets/html/swagger-ui.html
new file mode 100644
index 0000000..499c855
--- /dev/null
+++ b/src/main/webapp/assets/html/swagger-ui.html
@@ -0,0 +1,78 @@
+<!DOCTYPE html>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+  -->
+<!-- Brooklyn SHA-1: GIT_SHA_1 -->
+<html>
+<head>
+    <meta charset="UTF-8">
+    <title>Brooklyn API Docs</title>
+    <link rel="icon" type="image/x-icon" href="/favicon.ico" sizes="16x16"/>
+    <link href='../swagger-ui/css/typography.css' media='screen' rel='stylesheet' type='text/css'/>
+    <link href='../swagger-ui/css/reset.css' media='screen' rel='stylesheet' type='text/css'/>
+    <link href='../swagger-ui/css/screen.css' media='screen' rel='stylesheet' type='text/css'/>
+    <link href='../swagger-ui/css/reset.css' media='print' rel='stylesheet' type='text/css'/>
+    <link href='../swagger-ui/css/print.css' media='print' rel='stylesheet' type='text/css'/>
+    <link href='../swagger-ui/css/style.css' media='print' rel='stylesheet' type='text/css'/>
+    <script src='../swagger-ui/lib/jquery-1.8.0.min.js' type='text/javascript'></script>
+    <script src='../swagger-ui/lib/jquery.wiggle.min.js' type='text/javascript'></script>
+    <script src='../swagger-ui/lib/jquery.ba-bbq.min.js' type='text/javascript'></script>
+    <script src='../swagger-ui/lib/handlebars-2.0.0.js' type='text/javascript'></script>
+    <script src='../swagger-ui/lib/underscore-min.js' type='text/javascript'></script>
+    <script src='../swagger-ui/lib/backbone-min.js' type='text/javascript'></script>
+    <script src='../swagger-ui/lib/swagger-ui.min.js' type='text/javascript'></script>
+    <script src='../swagger-ui/lib/marked.js' type='text/javascript'></script>
+
+    <script type="text/javascript">
+        $(function () {
+            window.swaggerUi = new SwaggerUi({
+                url: "/v1/apidoc/swagger.json",
+                dom_id: "swagger-ui-container",
+                supportHeaderParams: false,
+                supportedSubmitMethods: ['get', 'post', 'put', 'delete'],
+                onComplete: function (swaggerApi, swaggerUi) {
+                    log("Brooklyn swagger api doc loaded");
+                },
+                onFailure: function (data) {
+                    log("Unable to Load SwaggerUI");
+                },
+                docExpansion: "none",
+                apisSorter: "alpha",
+                showRequestHeaders: false
+            });
+            window.swaggerUi.load();
+
+            function log() {
+                if ('console' in window) {
+                    console.log.apply(console, arguments);
+                }
+            }
+        });
+    </script>
+    <style>
+        #validator {
+            display: none;
+        }
+    </style>
+</head>
+
+<body class="swagger-section">
+<div id="message-bar" class="swagger-ui-wrap" data-sw-translate>&nbsp;</div>
+<div id="swagger-ui-container" class="swagger-ui-wrap"></div>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/images/Sorting icons.psd
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/images/Sorting icons.psd b/src/main/webapp/assets/images/Sorting icons.psd
new file mode 100644
index 0000000..53b2e06
Binary files /dev/null and b/src/main/webapp/assets/images/Sorting icons.psd differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/images/addApplication-plus-hover.png
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/images/addApplication-plus-hover.png b/src/main/webapp/assets/images/addApplication-plus-hover.png
new file mode 100755
index 0000000..7137d51
Binary files /dev/null and b/src/main/webapp/assets/images/addApplication-plus-hover.png differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/images/addApplication-plus.png
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/images/addApplication-plus.png b/src/main/webapp/assets/images/addApplication-plus.png
new file mode 100755
index 0000000..c4ff5e6
Binary files /dev/null and b/src/main/webapp/assets/images/addApplication-plus.png differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/images/application-icon-add-hover.png
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/images/application-icon-add-hover.png b/src/main/webapp/assets/images/application-icon-add-hover.png
new file mode 100755
index 0000000..95c9bc8
Binary files /dev/null and b/src/main/webapp/assets/images/application-icon-add-hover.png differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/images/application-icon-add.png
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/images/application-icon-add.png b/src/main/webapp/assets/images/application-icon-add.png
new file mode 100755
index 0000000..b795bc5
Binary files /dev/null and b/src/main/webapp/assets/images/application-icon-add.png differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/images/application-icon-refresh-hover.png
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/images/application-icon-refresh-hover.png b/src/main/webapp/assets/images/application-icon-refresh-hover.png
new file mode 100755
index 0000000..6d23b8f
Binary files /dev/null and b/src/main/webapp/assets/images/application-icon-refresh-hover.png differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/images/application-icon-refresh.png
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/images/application-icon-refresh.png b/src/main/webapp/assets/images/application-icon-refresh.png
new file mode 100755
index 0000000..4f13df4
Binary files /dev/null and b/src/main/webapp/assets/images/application-icon-refresh.png differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/images/back_disabled.png
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/images/back_disabled.png b/src/main/webapp/assets/images/back_disabled.png
new file mode 100644
index 0000000..881de79
Binary files /dev/null and b/src/main/webapp/assets/images/back_disabled.png differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/images/back_enabled.png
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/images/back_enabled.png b/src/main/webapp/assets/images/back_enabled.png
new file mode 100644
index 0000000..c608682
Binary files /dev/null and b/src/main/webapp/assets/images/back_enabled.png differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/images/back_enabled_hover.png
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/images/back_enabled_hover.png b/src/main/webapp/assets/images/back_enabled_hover.png
new file mode 100644
index 0000000..d300f10
Binary files /dev/null and b/src/main/webapp/assets/images/back_enabled_hover.png differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/images/brooklyn-header-background.png
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/images/brooklyn-header-background.png b/src/main/webapp/assets/images/brooklyn-header-background.png
new file mode 100755
index 0000000..3399da7
Binary files /dev/null and b/src/main/webapp/assets/images/brooklyn-header-background.png differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/images/brooklyn-logo.png
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/images/brooklyn-logo.png b/src/main/webapp/assets/images/brooklyn-logo.png
new file mode 100755
index 0000000..27b2e5a
Binary files /dev/null and b/src/main/webapp/assets/images/brooklyn-logo.png differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/images/favicon.ico
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/images/favicon.ico b/src/main/webapp/assets/images/favicon.ico
new file mode 100644
index 0000000..6eeaa2a
Binary files /dev/null and b/src/main/webapp/assets/images/favicon.ico differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/images/forward_disabled.png
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/images/forward_disabled.png b/src/main/webapp/assets/images/forward_disabled.png
new file mode 100644
index 0000000..6a6ded7
Binary files /dev/null and b/src/main/webapp/assets/images/forward_disabled.png differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/images/forward_enabled.png
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/images/forward_enabled.png b/src/main/webapp/assets/images/forward_enabled.png
new file mode 100644
index 0000000..a4e6b53
Binary files /dev/null and b/src/main/webapp/assets/images/forward_enabled.png differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/images/forward_enabled_hover.png
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/images/forward_enabled_hover.png b/src/main/webapp/assets/images/forward_enabled_hover.png
new file mode 100644
index 0000000..fc46c5e
Binary files /dev/null and b/src/main/webapp/assets/images/forward_enabled_hover.png differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/images/main-menu-tab-active.png
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/images/main-menu-tab-active.png b/src/main/webapp/assets/images/main-menu-tab-active.png
new file mode 100755
index 0000000..539f19a
Binary files /dev/null and b/src/main/webapp/assets/images/main-menu-tab-active.png differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/images/main-menu-tab-hover.png
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/images/main-menu-tab-hover.png b/src/main/webapp/assets/images/main-menu-tab-hover.png
new file mode 100755
index 0000000..cb8a106
Binary files /dev/null and b/src/main/webapp/assets/images/main-menu-tab-hover.png differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/images/main-menu-tab.png
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/images/main-menu-tab.png b/src/main/webapp/assets/images/main-menu-tab.png
new file mode 100755
index 0000000..ae62fd5
Binary files /dev/null and b/src/main/webapp/assets/images/main-menu-tab.png differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/images/nav-tabs-background.png
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/images/nav-tabs-background.png b/src/main/webapp/assets/images/nav-tabs-background.png
new file mode 100755
index 0000000..043df7c
Binary files /dev/null and b/src/main/webapp/assets/images/nav-tabs-background.png differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/images/roundedSummary-background.png
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/images/roundedSummary-background.png b/src/main/webapp/assets/images/roundedSummary-background.png
new file mode 100755
index 0000000..4e6f579
Binary files /dev/null and b/src/main/webapp/assets/images/roundedSummary-background.png differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/images/sort_asc.png
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/images/sort_asc.png b/src/main/webapp/assets/images/sort_asc.png
new file mode 100644
index 0000000..a88d797
Binary files /dev/null and b/src/main/webapp/assets/images/sort_asc.png differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/images/sort_asc_disabled.png
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/images/sort_asc_disabled.png b/src/main/webapp/assets/images/sort_asc_disabled.png
new file mode 100644
index 0000000..4e144cf
Binary files /dev/null and b/src/main/webapp/assets/images/sort_asc_disabled.png differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/images/sort_both.png
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/images/sort_both.png b/src/main/webapp/assets/images/sort_both.png
new file mode 100644
index 0000000..1867040
Binary files /dev/null and b/src/main/webapp/assets/images/sort_both.png differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/images/sort_desc.png
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/images/sort_desc.png b/src/main/webapp/assets/images/sort_desc.png
new file mode 100644
index 0000000..def071e
Binary files /dev/null and b/src/main/webapp/assets/images/sort_desc.png differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/images/sort_desc_disabled.png
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/images/sort_desc_disabled.png b/src/main/webapp/assets/images/sort_desc_disabled.png
new file mode 100644
index 0000000..7824973
Binary files /dev/null and b/src/main/webapp/assets/images/sort_desc_disabled.png differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/images/throbber.gif
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/images/throbber.gif b/src/main/webapp/assets/images/throbber.gif
new file mode 100644
index 0000000..0639388
Binary files /dev/null and b/src/main/webapp/assets/images/throbber.gif differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/img/bridge.png
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/img/bridge.png b/src/main/webapp/assets/img/bridge.png
new file mode 100644
index 0000000..811c79d
Binary files /dev/null and b/src/main/webapp/assets/img/bridge.png differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/img/brooklyn.png
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/img/brooklyn.png b/src/main/webapp/assets/img/brooklyn.png
new file mode 100644
index 0000000..6efaed5
Binary files /dev/null and b/src/main/webapp/assets/img/brooklyn.png differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/img/document.png
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/img/document.png b/src/main/webapp/assets/img/document.png
new file mode 100644
index 0000000..75f92b0
Binary files /dev/null and b/src/main/webapp/assets/img/document.png differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/img/fire.png
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/img/fire.png b/src/main/webapp/assets/img/fire.png
new file mode 100644
index 0000000..a238ba9
Binary files /dev/null and b/src/main/webapp/assets/img/fire.png differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/img/folder-horizontal.png
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/img/folder-horizontal.png b/src/main/webapp/assets/img/folder-horizontal.png
new file mode 100644
index 0000000..260b415
Binary files /dev/null and b/src/main/webapp/assets/img/folder-horizontal.png differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/img/glyphicons-halflings-bright-green.png
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/img/glyphicons-halflings-bright-green.png b/src/main/webapp/assets/img/glyphicons-halflings-bright-green.png
new file mode 100644
index 0000000..39473e0
Binary files /dev/null and b/src/main/webapp/assets/img/glyphicons-halflings-bright-green.png differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/img/glyphicons-halflings-dark-green.png
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/img/glyphicons-halflings-dark-green.png b/src/main/webapp/assets/img/glyphicons-halflings-dark-green.png
new file mode 100644
index 0000000..6671579
Binary files /dev/null and b/src/main/webapp/assets/img/glyphicons-halflings-dark-green.png differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/img/glyphicons-halflings-green.png
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/img/glyphicons-halflings-green.png b/src/main/webapp/assets/img/glyphicons-halflings-green.png
new file mode 100644
index 0000000..0616efb
Binary files /dev/null and b/src/main/webapp/assets/img/glyphicons-halflings-green.png differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/img/glyphicons-halflings-white.png
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/img/glyphicons-halflings-white.png b/src/main/webapp/assets/img/glyphicons-halflings-white.png
new file mode 100644
index 0000000..3bf6484
Binary files /dev/null and b/src/main/webapp/assets/img/glyphicons-halflings-white.png differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/img/glyphicons-halflings.png
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/img/glyphicons-halflings.png b/src/main/webapp/assets/img/glyphicons-halflings.png
new file mode 100644
index 0000000..79bc568
Binary files /dev/null and b/src/main/webapp/assets/img/glyphicons-halflings.png differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/img/icon-status-onfire.png
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/img/icon-status-onfire.png b/src/main/webapp/assets/img/icon-status-onfire.png
new file mode 100644
index 0000000..a238ba9
Binary files /dev/null and b/src/main/webapp/assets/img/icon-status-onfire.png differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/img/icon-status-running-onfire.png
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/img/icon-status-running-onfire.png b/src/main/webapp/assets/img/icon-status-running-onfire.png
new file mode 100644
index 0000000..d0af3d7
Binary files /dev/null and b/src/main/webapp/assets/img/icon-status-running-onfire.png differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/img/icon-status-running.png
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/img/icon-status-running.png b/src/main/webapp/assets/img/icon-status-running.png
new file mode 100644
index 0000000..8bb39f8
Binary files /dev/null and b/src/main/webapp/assets/img/icon-status-running.png differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/img/icon-status-starting.gif
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/img/icon-status-starting.gif b/src/main/webapp/assets/img/icon-status-starting.gif
new file mode 100644
index 0000000..0b0de23
Binary files /dev/null and b/src/main/webapp/assets/img/icon-status-starting.gif differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/img/icon-status-stopped-onfire.png
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/img/icon-status-stopped-onfire.png b/src/main/webapp/assets/img/icon-status-stopped-onfire.png
new file mode 100644
index 0000000..03eceb5
Binary files /dev/null and b/src/main/webapp/assets/img/icon-status-stopped-onfire.png differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/img/icon-status-stopped.png
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/img/icon-status-stopped.png b/src/main/webapp/assets/img/icon-status-stopped.png
new file mode 100644
index 0000000..effb768
Binary files /dev/null and b/src/main/webapp/assets/img/icon-status-stopped.png differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/img/icon-status-stopping.gif
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/img/icon-status-stopping.gif b/src/main/webapp/assets/img/icon-status-stopping.gif
new file mode 100644
index 0000000..a966b12
Binary files /dev/null and b/src/main/webapp/assets/img/icon-status-stopping.gif differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/img/magnifying-glass-right-icon.png
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/img/magnifying-glass-right-icon.png b/src/main/webapp/assets/img/magnifying-glass-right-icon.png
new file mode 100644
index 0000000..16d4819
Binary files /dev/null and b/src/main/webapp/assets/img/magnifying-glass-right-icon.png differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/img/magnifying-glass-right.png
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/img/magnifying-glass-right.png b/src/main/webapp/assets/img/magnifying-glass-right.png
new file mode 100644
index 0000000..90e5c9f
Binary files /dev/null and b/src/main/webapp/assets/img/magnifying-glass-right.png differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/img/magnifying-glass.gif
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/img/magnifying-glass.gif b/src/main/webapp/assets/img/magnifying-glass.gif
new file mode 100644
index 0000000..18e046b
Binary files /dev/null and b/src/main/webapp/assets/img/magnifying-glass.gif differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/img/toggle-small-expand.png
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/img/toggle-small-expand.png b/src/main/webapp/assets/img/toggle-small-expand.png
new file mode 100644
index 0000000..79c5ff7
Binary files /dev/null and b/src/main/webapp/assets/img/toggle-small-expand.png differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/img/toggle-small.png
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/img/toggle-small.png b/src/main/webapp/assets/img/toggle-small.png
new file mode 100644
index 0000000..f783a6f
Binary files /dev/null and b/src/main/webapp/assets/img/toggle-small.png differ


[50/51] [abbrv] [partial] brooklyn-ui git commit: move subdir from incubator up a level as it is promoted to its own repo (first non-incubator commit!)

Posted by he...@apache.org.
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/build/requirejs-maven-plugin/r.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/build/requirejs-maven-plugin/r.js b/brooklyn-ui/src/build/requirejs-maven-plugin/r.js
deleted file mode 100644
index f76b1e2..0000000
--- a/brooklyn-ui/src/build/requirejs-maven-plugin/r.js
+++ /dev/null
@@ -1,25256 +0,0 @@
-/**
- * @license r.js 2.1.6 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
- * Available via the MIT or new BSD license.
- * see: http://github.com/jrburke/requirejs for details
- */
-
-/*
- * This is a bootstrap script to allow running RequireJS in the command line
- * in either a Java/Rhino or Node environment. It is modified by the top-level
- * dist.js file to inject other files to completely enable this file. It is
- * the shell of the r.js file.
- */
-
-/*jslint evil: true, nomen: true, sloppy: true */
-/*global readFile: true, process: false, Packages: false, print: false,
-console: false, java: false, module: false, requirejsVars, navigator,
-document, importScripts, self, location, Components, FileUtils */
-
-var requirejs, require, define, xpcUtil;
-(function (console, args, readFileFunc) {
-    var fileName, env, fs, vm, path, exec, rhinoContext, dir, nodeRequire,
-        nodeDefine, exists, reqMain, loadedOptimizedLib, existsForNode, Cc, Ci,
-        version = '2.1.6',
-        jsSuffixRegExp = /\.js$/,
-        commandOption = '',
-        useLibLoaded = {},
-        //Used by jslib/rhino/args.js
-        rhinoArgs = args,
-        //Used by jslib/xpconnect/args.js
-        xpconnectArgs = args,
-        readFile = typeof readFileFunc !== 'undefined' ? readFileFunc : null;
-
-    function showHelp() {
-        console.log('See https://github.com/jrburke/r.js for usage.');
-    }
-
-    if ((typeof navigator !== 'undefined' && typeof document !== 'undefined') ||
-            (typeof importScripts !== 'undefined' && typeof self !== 'undefined')) {
-        env = 'browser';
-
-        readFile = function (path) {
-            return fs.readFileSync(path, 'utf8');
-        };
-
-        exec = function (string) {
-            return eval(string);
-        };
-
-        exists = function () {
-            console.log('x.js exists not applicable in browser env');
-            return false;
-        };
-
-    } else if (typeof Packages !== 'undefined') {
-        env = 'rhino';
-
-        fileName = args[0];
-
-        if (fileName && fileName.indexOf('-') === 0) {
-            commandOption = fileName.substring(1);
-            fileName = args[1];
-        }
-
-        //Set up execution context.
-        rhinoContext = Packages.org.mozilla.javascript.ContextFactory.getGlobal().enterContext();
-
-        exec = function (string, name) {
-            return rhinoContext.evaluateString(this, string, name, 0, null);
-        };
-
-        exists = function (fileName) {
-            return (new java.io.File(fileName)).exists();
-        };
-
-        //Define a console.log for easier logging. Don't
-        //get fancy though.
-        if (typeof console === 'undefined') {
-            console = {
-                log: function () {
-                    print.apply(undefined, arguments);
-                }
-            };
-        }
-    } else if (typeof process !== 'undefined' && process.versions && !!process.versions.node) {
-        env = 'node';
-
-        //Get the fs module via Node's require before it
-        //gets replaced. Used in require/node.js
-        fs = require('fs');
-        vm = require('vm');
-        path = require('path');
-        //In Node 0.7+ existsSync is on fs.
-        existsForNode = fs.existsSync || path.existsSync;
-
-        nodeRequire = require;
-        nodeDefine = define;
-        reqMain = require.main;
-
-        //Temporarily hide require and define to allow require.js to define
-        //them.
-        require = undefined;
-        define = undefined;
-
-        readFile = function (path) {
-            return fs.readFileSync(path, 'utf8');
-        };
-
-        exec = function (string, name) {
-            return vm.runInThisContext(this.requirejsVars.require.makeNodeWrapper(string),
-                                       name ? fs.realpathSync(name) : '');
-        };
-
-        exists = function (fileName) {
-            return existsForNode(fileName);
-        };
-
-
-        fileName = process.argv[2];
-
-        if (fileName && fileName.indexOf('-') === 0) {
-            commandOption = fileName.substring(1);
-            fileName = process.argv[3];
-        }
-    } else if (typeof Components !== 'undefined' && Components.classes && Components.interfaces) {
-        env = 'xpconnect';
-
-        Components.utils['import']('resource://gre/modules/FileUtils.jsm');
-        Cc = Components.classes;
-        Ci = Components.interfaces;
-
-        fileName = args[0];
-
-        if (fileName && fileName.indexOf('-') === 0) {
-            commandOption = fileName.substring(1);
-            fileName = args[1];
-        }
-
-        xpcUtil = {
-            cwd: function () {
-                return FileUtils.getFile("CurWorkD", []).path;
-            },
-
-            //Remove . and .. from paths, normalize on front slashes
-            normalize: function (path) {
-                //There has to be an easier way to do this.
-                var i, part, ary,
-                    firstChar = path.charAt(0);
-
-                if (firstChar !== '/' &&
-                        firstChar !== '\\' &&
-                        path.indexOf(':') === -1) {
-                    //A relative path. Use the current working directory.
-                    path = xpcUtil.cwd() + '/' + path;
-                }
-
-                ary = path.replace(/\\/g, '/').split('/');
-
-                for (i = 0; i < ary.length; i += 1) {
-                    part = ary[i];
-                    if (part === '.') {
-                        ary.splice(i, 1);
-                        i -= 1;
-                    } else if (part === '..') {
-                        ary.splice(i - 1, 2);
-                        i -= 2;
-                    }
-                }
-                return ary.join('/');
-            },
-
-            xpfile: function (path) {
-                try {
-                    return new FileUtils.File(xpcUtil.normalize(path));
-                } catch (e) {
-                    throw new Error(path + ' failed: ' + e);
-                }
-            },
-
-            readFile: function (/*String*/path, /*String?*/encoding) {
-                //A file read function that can deal with BOMs
-                encoding = encoding || "utf-8";
-
-                var inStream, convertStream,
-                    readData = {},
-                    fileObj = xpcUtil.xpfile(path);
-
-                //XPCOM, you so crazy
-                try {
-                    inStream = Cc['@mozilla.org/network/file-input-stream;1']
-                               .createInstance(Ci.nsIFileInputStream);
-                    inStream.init(fileObj, 1, 0, false);
-
-                    convertStream = Cc['@mozilla.org/intl/converter-input-stream;1']
-                                    .createInstance(Ci.nsIConverterInputStream);
-                    convertStream.init(inStream, encoding, inStream.available(),
-                    Ci.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER);
-
-                    convertStream.readString(inStream.available(), readData);
-                    return readData.value;
-                } catch (e) {
-                    throw new Error((fileObj && fileObj.path || '') + ': ' + e);
-                } finally {
-                    if (convertStream) {
-                        convertStream.close();
-                    }
-                    if (inStream) {
-                        inStream.close();
-                    }
-                }
-            }
-        };
-
-        readFile = xpcUtil.readFile;
-
-        exec = function (string) {
-            return eval(string);
-        };
-
-        exists = function (fileName) {
-            return xpcUtil.xpfile(fileName).exists();
-        };
-
-        //Define a console.log for easier logging. Don't
-        //get fancy though.
-        if (typeof console === 'undefined') {
-            console = {
-                log: function () {
-                    print.apply(undefined, arguments);
-                }
-            };
-        }
-    }
-
-    /** vim: et:ts=4:sw=4:sts=4
- * @license RequireJS 2.1.6 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
- * Available via the MIT or new BSD license.
- * see: http://github.com/jrburke/requirejs for details
- */
-//Not using strict: uneven strict support in browsers, #392, and causes
-//problems with requirejs.exec()/transpiler plugins that may not be strict.
-/*jslint regexp: true, nomen: true, sloppy: true */
-/*global window, navigator, document, importScripts, setTimeout, opera */
-
-
-(function (global) {
-    var req, s, head, baseElement, dataMain, src,
-        interactiveScript, currentlyAddingScript, mainScript, subPath,
-        version = '2.1.6',
-        commentRegExp = /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,
-        cjsRequireRegExp = /[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,
-        jsSuffixRegExp = /\.js$/,
-        currDirRegExp = /^\.\//,
-        op = Object.prototype,
-        ostring = op.toString,
-        hasOwn = op.hasOwnProperty,
-        ap = Array.prototype,
-        apsp = ap.splice,
-        isBrowser = !!(typeof window !== 'undefined' && navigator && window.document),
-        isWebWorker = !isBrowser && typeof importScripts !== 'undefined',
-        //PS3 indicates loaded and complete, but need to wait for complete
-        //specifically. Sequence is 'loading', 'loaded', execution,
-        // then 'complete'. The UA check is unfortunate, but not sure how
-        //to feature test w/o causing perf issues.
-        readyRegExp = isBrowser && navigator.platform === 'PLAYSTATION 3' ?
-                      /^complete$/ : /^(complete|loaded)$/,
-        defContextName = '_',
-        //Oh the tragedy, detecting opera. See the usage of isOpera for reason.
-        isOpera = typeof opera !== 'undefined' && opera.toString() === '[object Opera]',
-        contexts = {},
-        cfg = {},
-        globalDefQueue = [],
-        useInteractive = false;
-
-    function isFunction(it) {
-        return ostring.call(it) === '[object Function]';
-    }
-
-    function isArray(it) {
-        return ostring.call(it) === '[object Array]';
-    }
-
-    /**
-     * Helper function for iterating over an array. If the func returns
-     * a true value, it will break out of the loop.
-     */
-    function each(ary, func) {
-        if (ary) {
-            var i;
-            for (i = 0; i < ary.length; i += 1) {
-                if (ary[i] && func(ary[i], i, ary)) {
-                    break;
-                }
-            }
-        }
-    }
-
-    /**
-     * Helper function for iterating over an array backwards. If the func
-     * returns a true value, it will break out of the loop.
-     */
-    function eachReverse(ary, func) {
-        if (ary) {
-            var i;
-            for (i = ary.length - 1; i > -1; i -= 1) {
-                if (ary[i] && func(ary[i], i, ary)) {
-                    break;
-                }
-            }
-        }
-    }
-
-    function hasProp(obj, prop) {
-        return hasOwn.call(obj, prop);
-    }
-
-    function getOwn(obj, prop) {
-        return hasProp(obj, prop) && obj[prop];
-    }
-
-    /**
-     * Cycles over properties in an object and calls a function for each
-     * property value. If the function returns a truthy value, then the
-     * iteration is stopped.
-     */
-    function eachProp(obj, func) {
-        var prop;
-        for (prop in obj) {
-            if (hasProp(obj, prop)) {
-                if (func(obj[prop], prop)) {
-                    break;
-                }
-            }
-        }
-    }
-
-    /**
-     * Simple function to mix in properties from source into target,
-     * but only if target does not already have a property of the same name.
-     */
-    function mixin(target, source, force, deepStringMixin) {
-        if (source) {
-            eachProp(source, function (value, prop) {
-                if (force || !hasProp(target, prop)) {
-                    if (deepStringMixin && typeof value !== 'string') {
-                        if (!target[prop]) {
-                            target[prop] = {};
-                        }
-                        mixin(target[prop], value, force, deepStringMixin);
-                    } else {
-                        target[prop] = value;
-                    }
-                }
-            });
-        }
-        return target;
-    }
-
-    //Similar to Function.prototype.bind, but the 'this' object is specified
-    //first, since it is easier to read/figure out what 'this' will be.
-    function bind(obj, fn) {
-        return function () {
-            return fn.apply(obj, arguments);
-        };
-    }
-
-    function scripts() {
-        return document.getElementsByTagName('script');
-    }
-
-    function defaultOnError(err) {
-        throw err;
-    }
-
-    //Allow getting a global that expressed in
-    //dot notation, like 'a.b.c'.
-    function getGlobal(value) {
-        if (!value) {
-            return value;
-        }
-        var g = global;
-        each(value.split('.'), function (part) {
-            g = g[part];
-        });
-        return g;
-    }
-
-    /**
-     * Constructs an error with a pointer to an URL with more information.
-     * @param {String} id the error ID that maps to an ID on a web page.
-     * @param {String} message human readable error.
-     * @param {Error} [err] the original error, if there is one.
-     *
-     * @returns {Error}
-     */
-    function makeError(id, msg, err, requireModules) {
-        var e = new Error(msg + '\nhttp://requirejs.org/docs/errors.html#' + id);
-        e.requireType = id;
-        e.requireModules = requireModules;
-        if (err) {
-            e.originalError = err;
-        }
-        return e;
-    }
-
-    if (typeof define !== 'undefined') {
-        //If a define is already in play via another AMD loader,
-        //do not overwrite.
-        return;
-    }
-
-    if (typeof requirejs !== 'undefined') {
-        if (isFunction(requirejs)) {
-            //Do not overwrite and existing requirejs instance.
-            return;
-        }
-        cfg = requirejs;
-        requirejs = undefined;
-    }
-
-    //Allow for a require config object
-    if (typeof require !== 'undefined' && !isFunction(require)) {
-        //assume it is a config object.
-        cfg = require;
-        require = undefined;
-    }
-
-    function newContext(contextName) {
-        var inCheckLoaded, Module, context, handlers,
-            checkLoadedTimeoutId,
-            config = {
-                //Defaults. Do not set a default for map
-                //config to speed up normalize(), which
-                //will run faster if there is no default.
-                waitSeconds: 7,
-                baseUrl: './',
-                paths: {},
-                pkgs: {},
-                shim: {},
-                config: {}
-            },
-            registry = {},
-            //registry of just enabled modules, to speed
-            //cycle breaking code when lots of modules
-            //are registered, but not activated.
-            enabledRegistry = {},
-            undefEvents = {},
-            defQueue = [],
-            defined = {},
-            urlFetched = {},
-            requireCounter = 1,
-            unnormalizedCounter = 1;
-
-        /**
-         * Trims the . and .. from an array of path segments.
-         * It will keep a leading path segment if a .. will become
-         * the first path segment, to help with module name lookups,
-         * which act like paths, but can be remapped. But the end result,
-         * all paths that use this function should look normalized.
-         * NOTE: this method MODIFIES the input array.
-         * @param {Array} ary the array of path segments.
-         */
-        function trimDots(ary) {
-            var i, part;
-            for (i = 0; ary[i]; i += 1) {
-                part = ary[i];
-                if (part === '.') {
-                    ary.splice(i, 1);
-                    i -= 1;
-                } else if (part === '..') {
-                    if (i === 1 && (ary[2] === '..' || ary[0] === '..')) {
-                        //End of the line. Keep at least one non-dot
-                        //path segment at the front so it can be mapped
-                        //correctly to disk. Otherwise, there is likely
-                        //no path mapping for a path starting with '..'.
-                        //This can still fail, but catches the most reasonable
-                        //uses of ..
-                        break;
-                    } else if (i > 0) {
-                        ary.splice(i - 1, 2);
-                        i -= 2;
-                    }
-                }
-            }
-        }
-
-        /**
-         * Given a relative module name, like ./something, normalize it to
-         * a real name that can be mapped to a path.
-         * @param {String} name the relative name
-         * @param {String} baseName a real name that the name arg is relative
-         * to.
-         * @param {Boolean} applyMap apply the map config to the value. Should
-         * only be done if this normalization is for a dependency ID.
-         * @returns {String} normalized name
-         */
-        function normalize(name, baseName, applyMap) {
-            var pkgName, pkgConfig, mapValue, nameParts, i, j, nameSegment,
-                foundMap, foundI, foundStarMap, starI,
-                baseParts = baseName && baseName.split('/'),
-                normalizedBaseParts = baseParts,
-                map = config.map,
-                starMap = map && map['*'];
-
-            //Adjust any relative paths.
-            if (name && name.charAt(0) === '.') {
-                //If have a base name, try to normalize against it,
-                //otherwise, assume it is a top-level require that will
-                //be relative to baseUrl in the end.
-                if (baseName) {
-                    if (getOwn(config.pkgs, baseName)) {
-                        //If the baseName is a package name, then just treat it as one
-                        //name to concat the name with.
-                        normalizedBaseParts = baseParts = [baseName];
-                    } else {
-                        //Convert baseName to array, and lop off the last part,
-                        //so that . matches that 'directory' and not name of the baseName's
-                        //module. For instance, baseName of 'one/two/three', maps to
-                        //'one/two/three.js', but we want the directory, 'one/two' for
-                        //this normalization.
-                        normalizedBaseParts = baseParts.slice(0, baseParts.length - 1);
-                    }
-
-                    name = normalizedBaseParts.concat(name.split('/'));
-                    trimDots(name);
-
-                    //Some use of packages may use a . path to reference the
-                    //'main' module name, so normalize for that.
-                    pkgConfig = getOwn(config.pkgs, (pkgName = name[0]));
-                    name = name.join('/');
-                    if (pkgConfig && name === pkgName + '/' + pkgConfig.main) {
-                        name = pkgName;
-                    }
-                } else if (name.indexOf('./') === 0) {
-                    // No baseName, so this is ID is resolved relative
-                    // to baseUrl, pull off the leading dot.
-                    name = name.substring(2);
-                }
-            }
-
-            //Apply map config if available.
-            if (applyMap && map && (baseParts || starMap)) {
-                nameParts = name.split('/');
-
-                for (i = nameParts.length; i > 0; i -= 1) {
-                    nameSegment = nameParts.slice(0, i).join('/');
-
-                    if (baseParts) {
-                        //Find the longest baseName segment match in the config.
-                        //So, do joins on the biggest to smallest lengths of baseParts.
-                        for (j = baseParts.length; j > 0; j -= 1) {
-                            mapValue = getOwn(map, baseParts.slice(0, j).join('/'));
-
-                            //baseName segment has config, find if it has one for
-                            //this name.
-                            if (mapValue) {
-                                mapValue = getOwn(mapValue, nameSegment);
-                                if (mapValue) {
-                                    //Match, update name to the new value.
-                                    foundMap = mapValue;
-                                    foundI = i;
-                                    break;
-                                }
-                            }
-                        }
-                    }
-
-                    if (foundMap) {
-                        break;
-                    }
-
-                    //Check for a star map match, but just hold on to it,
-                    //if there is a shorter segment match later in a matching
-                    //config, then favor over this star map.
-                    if (!foundStarMap && starMap && getOwn(starMap, nameSegment)) {
-                        foundStarMap = getOwn(starMap, nameSegment);
-                        starI = i;
-                    }
-                }
-
-                if (!foundMap && foundStarMap) {
-                    foundMap = foundStarMap;
-                    foundI = starI;
-                }
-
-                if (foundMap) {
-                    nameParts.splice(0, foundI, foundMap);
-                    name = nameParts.join('/');
-                }
-            }
-
-            return name;
-        }
-
-        function removeScript(name) {
-            if (isBrowser) {
-                each(scripts(), function (scriptNode) {
-                    if (scriptNode.getAttribute('data-requiremodule') === name &&
-                            scriptNode.getAttribute('data-requirecontext') === context.contextName) {
-                        scriptNode.parentNode.removeChild(scriptNode);
-                        return true;
-                    }
-                });
-            }
-        }
-
-        function hasPathFallback(id) {
-            var pathConfig = getOwn(config.paths, id);
-            if (pathConfig && isArray(pathConfig) && pathConfig.length > 1) {
-                removeScript(id);
-                //Pop off the first array value, since it failed, and
-                //retry
-                pathConfig.shift();
-                context.require.undef(id);
-                context.require([id]);
-                return true;
-            }
-        }
-
-        //Turns a plugin!resource to [plugin, resource]
-        //with the plugin being undefined if the name
-        //did not have a plugin prefix.
-        function splitPrefix(name) {
-            var prefix,
-                index = name ? name.indexOf('!') : -1;
-            if (index > -1) {
-                prefix = name.substring(0, index);
-                name = name.substring(index + 1, name.length);
-            }
-            return [prefix, name];
-        }
-
-        /**
-         * Creates a module mapping that includes plugin prefix, module
-         * name, and path. If parentModuleMap is provided it will
-         * also normalize the name via require.normalize()
-         *
-         * @param {String} name the module name
-         * @param {String} [parentModuleMap] parent module map
-         * for the module name, used to resolve relative names.
-         * @param {Boolean} isNormalized: is the ID already normalized.
-         * This is true if this call is done for a define() module ID.
-         * @param {Boolean} applyMap: apply the map config to the ID.
-         * Should only be true if this map is for a dependency.
-         *
-         * @returns {Object}
-         */
-        function makeModuleMap(name, parentModuleMap, isNormalized, applyMap) {
-            var url, pluginModule, suffix, nameParts,
-                prefix = null,
-                parentName = parentModuleMap ? parentModuleMap.name : null,
-                originalName = name,
-                isDefine = true,
-                normalizedName = '';
-
-            //If no name, then it means it is a require call, generate an
-            //internal name.
-            if (!name) {
-                isDefine = false;
-                name = '_@r' + (requireCounter += 1);
-            }
-
-            nameParts = splitPrefix(name);
-            prefix = nameParts[0];
-            name = nameParts[1];
-
-            if (prefix) {
-                prefix = normalize(prefix, parentName, applyMap);
-                pluginModule = getOwn(defined, prefix);
-            }
-
-            //Account for relative paths if there is a base name.
-            if (name) {
-                if (prefix) {
-                    if (pluginModule && pluginModule.normalize) {
-                        //Plugin is loaded, use its normalize method.
-                        normalizedName = pluginModule.normalize(name, function (name) {
-                            return normalize(name, parentName, applyMap);
-                        });
-                    } else {
-                        normalizedName = normalize(name, parentName, applyMap);
-                    }
-                } else {
-                    //A regular module.
-                    normalizedName = normalize(name, parentName, applyMap);
-
-                    //Normalized name may be a plugin ID due to map config
-                    //application in normalize. The map config values must
-                    //already be normalized, so do not need to redo that part.
-                    nameParts = splitPrefix(normalizedName);
-                    prefix = nameParts[0];
-                    normalizedName = nameParts[1];
-                    isNormalized = true;
-
-                    url = context.nameToUrl(normalizedName);
-                }
-            }
-
-            //If the id is a plugin id that cannot be determined if it needs
-            //normalization, stamp it with a unique ID so two matching relative
-            //ids that may conflict can be separate.
-            suffix = prefix && !pluginModule && !isNormalized ?
-                     '_unnormalized' + (unnormalizedCounter += 1) :
-                     '';
-
-            return {
-                prefix: prefix,
-                name: normalizedName,
-                parentMap: parentModuleMap,
-                unnormalized: !!suffix,
-                url: url,
-                originalName: originalName,
-                isDefine: isDefine,
-                id: (prefix ?
-                        prefix + '!' + normalizedName :
-                        normalizedName) + suffix
-            };
-        }
-
-        function getModule(depMap) {
-            var id = depMap.id,
-                mod = getOwn(registry, id);
-
-            if (!mod) {
-                mod = registry[id] = new context.Module(depMap);
-            }
-
-            return mod;
-        }
-
-        function on(depMap, name, fn) {
-            var id = depMap.id,
-                mod = getOwn(registry, id);
-
-            if (hasProp(defined, id) &&
-                    (!mod || mod.defineEmitComplete)) {
-                if (name === 'defined') {
-                    fn(defined[id]);
-                }
-            } else {
-                mod = getModule(depMap);
-                if (mod.error && name === 'error') {
-                    fn(mod.error);
-                } else {
-                    mod.on(name, fn);
-                }
-            }
-        }
-
-        function onError(err, errback) {
-            var ids = err.requireModules,
-                notified = false;
-
-            if (errback) {
-                errback(err);
-            } else {
-                each(ids, function (id) {
-                    var mod = getOwn(registry, id);
-                    if (mod) {
-                        //Set error on module, so it skips timeout checks.
-                        mod.error = err;
-                        if (mod.events.error) {
-                            notified = true;
-                            mod.emit('error', err);
-                        }
-                    }
-                });
-
-                if (!notified) {
-                    req.onError(err);
-                }
-            }
-        }
-
-        /**
-         * Internal method to transfer globalQueue items to this context's
-         * defQueue.
-         */
-        function takeGlobalQueue() {
-            //Push all the globalDefQueue items into the context's defQueue
-            if (globalDefQueue.length) {
-                //Array splice in the values since the context code has a
-                //local var ref to defQueue, so cannot just reassign the one
-                //on context.
-                apsp.apply(defQueue,
-                           [defQueue.length - 1, 0].concat(globalDefQueue));
-                globalDefQueue = [];
-            }
-        }
-
-        handlers = {
-            'require': function (mod) {
-                if (mod.require) {
-                    return mod.require;
-                } else {
-                    return (mod.require = context.makeRequire(mod.map));
-                }
-            },
-            'exports': function (mod) {
-                mod.usingExports = true;
-                if (mod.map.isDefine) {
-                    if (mod.exports) {
-                        return mod.exports;
-                    } else {
-                        return (mod.exports = defined[mod.map.id] = {});
-                    }
-                }
-            },
-            'module': function (mod) {
-                if (mod.module) {
-                    return mod.module;
-                } else {
-                    return (mod.module = {
-                        id: mod.map.id,
-                        uri: mod.map.url,
-                        config: function () {
-                            var c,
-                                pkg = getOwn(config.pkgs, mod.map.id);
-                            // For packages, only support config targeted
-                            // at the main module.
-                            c = pkg ? getOwn(config.config, mod.map.id + '/' + pkg.main) :
-                                      getOwn(config.config, mod.map.id);
-                            return  c || {};
-                        },
-                        exports: defined[mod.map.id]
-                    });
-                }
-            }
-        };
-
-        function cleanRegistry(id) {
-            //Clean up machinery used for waiting modules.
-            delete registry[id];
-            delete enabledRegistry[id];
-        }
-
-        function breakCycle(mod, traced, processed) {
-            var id = mod.map.id;
-
-            if (mod.error) {
-                mod.emit('error', mod.error);
-            } else {
-                traced[id] = true;
-                each(mod.depMaps, function (depMap, i) {
-                    var depId = depMap.id,
-                        dep = getOwn(registry, depId);
-
-                    //Only force things that have not completed
-                    //being defined, so still in the registry,
-                    //and only if it has not been matched up
-                    //in the module already.
-                    if (dep && !mod.depMatched[i] && !processed[depId]) {
-                        if (getOwn(traced, depId)) {
-                            mod.defineDep(i, defined[depId]);
-                            mod.check(); //pass false?
-                        } else {
-                            breakCycle(dep, traced, processed);
-                        }
-                    }
-                });
-                processed[id] = true;
-            }
-        }
-
-        function checkLoaded() {
-            var map, modId, err, usingPathFallback,
-                waitInterval = config.waitSeconds * 1000,
-                //It is possible to disable the wait interval by using waitSeconds of 0.
-                expired = waitInterval && (context.startTime + waitInterval) < new Date().getTime(),
-                noLoads = [],
-                reqCalls = [],
-                stillLoading = false,
-                needCycleCheck = true;
-
-            //Do not bother if this call was a result of a cycle break.
-            if (inCheckLoaded) {
-                return;
-            }
-
-            inCheckLoaded = true;
-
-            //Figure out the state of all the modules.
-            eachProp(enabledRegistry, function (mod) {
-                map = mod.map;
-                modId = map.id;
-
-                //Skip things that are not enabled or in error state.
-                if (!mod.enabled) {
-                    return;
-                }
-
-                if (!map.isDefine) {
-                    reqCalls.push(mod);
-                }
-
-                if (!mod.error) {
-                    //If the module should be executed, and it has not
-                    //been inited and time is up, remember it.
-                    if (!mod.inited && expired) {
-                        if (hasPathFallback(modId)) {
-                            usingPathFallback = true;
-                            stillLoading = true;
-                        } else {
-                            noLoads.push(modId);
-                            removeScript(modId);
-                        }
-                    } else if (!mod.inited && mod.fetched && map.isDefine) {
-                        stillLoading = true;
-                        if (!map.prefix) {
-                            //No reason to keep looking for unfinished
-                            //loading. If the only stillLoading is a
-                            //plugin resource though, keep going,
-                            //because it may be that a plugin resource
-                            //is waiting on a non-plugin cycle.
-                            return (needCycleCheck = false);
-                        }
-                    }
-                }
-            });
-
-            if (expired && noLoads.length) {
-                //If wait time expired, throw error of unloaded modules.
-                err = makeError('timeout', 'Load timeout for modules: ' + noLoads, null, noLoads);
-                err.contextName = context.contextName;
-                return onError(err);
-            }
-
-            //Not expired, check for a cycle.
-            if (needCycleCheck) {
-                each(reqCalls, function (mod) {
-                    breakCycle(mod, {}, {});
-                });
-            }
-
-            //If still waiting on loads, and the waiting load is something
-            //other than a plugin resource, or there are still outstanding
-            //scripts, then just try back later.
-            if ((!expired || usingPathFallback) && stillLoading) {
-                //Something is still waiting to load. Wait for it, but only
-                //if a timeout is not already in effect.
-                if ((isBrowser || isWebWorker) && !checkLoadedTimeoutId) {
-                    checkLoadedTimeoutId = setTimeout(function () {
-                        checkLoadedTimeoutId = 0;
-                        checkLoaded();
-                    }, 50);
-                }
-            }
-
-            inCheckLoaded = false;
-        }
-
-        Module = function (map) {
-            this.events = getOwn(undefEvents, map.id) || {};
-            this.map = map;
-            this.shim = getOwn(config.shim, map.id);
-            this.depExports = [];
-            this.depMaps = [];
-            this.depMatched = [];
-            this.pluginMaps = {};
-            this.depCount = 0;
-
-            /* this.exports this.factory
-               this.depMaps = [],
-               this.enabled, this.fetched
-            */
-        };
-
-        Module.prototype = {
-            init: function (depMaps, factory, errback, options) {
-                options = options || {};
-
-                //Do not do more inits if already done. Can happen if there
-                //are multiple define calls for the same module. That is not
-                //a normal, common case, but it is also not unexpected.
-                if (this.inited) {
-                    return;
-                }
-
-                this.factory = factory;
-
-                if (errback) {
-                    //Register for errors on this module.
-                    this.on('error', errback);
-                } else if (this.events.error) {
-                    //If no errback already, but there are error listeners
-                    //on this module, set up an errback to pass to the deps.
-                    errback = bind(this, function (err) {
-                        this.emit('error', err);
-                    });
-                }
-
-                //Do a copy of the dependency array, so that
-                //source inputs are not modified. For example
-                //"shim" deps are passed in here directly, and
-                //doing a direct modification of the depMaps array
-                //would affect that config.
-                this.depMaps = depMaps && depMaps.slice(0);
-
-                this.errback = errback;
-
-                //Indicate this module has be initialized
-                this.inited = true;
-
-                this.ignore = options.ignore;
-
-                //Could have option to init this module in enabled mode,
-                //or could have been previously marked as enabled. However,
-                //the dependencies are not known until init is called. So
-                //if enabled previously, now trigger dependencies as enabled.
-                if (options.enabled || this.enabled) {
-                    //Enable this module and dependencies.
-                    //Will call this.check()
-                    this.enable();
-                } else {
-                    this.check();
-                }
-            },
-
-            defineDep: function (i, depExports) {
-                //Because of cycles, defined callback for a given
-                //export can be called more than once.
-                if (!this.depMatched[i]) {
-                    this.depMatched[i] = true;
-                    this.depCount -= 1;
-                    this.depExports[i] = depExports;
-                }
-            },
-
-            fetch: function () {
-                if (this.fetched) {
-                    return;
-                }
-                this.fetched = true;
-
-                context.startTime = (new Date()).getTime();
-
-                var map = this.map;
-
-                //If the manager is for a plugin managed resource,
-                //ask the plugin to load it now.
-                if (this.shim) {
-                    context.makeRequire(this.map, {
-                        enableBuildCallback: true
-                    })(this.shim.deps || [], bind(this, function () {
-                        return map.prefix ? this.callPlugin() : this.load();
-                    }));
-                } else {
-                    //Regular dependency.
-                    return map.prefix ? this.callPlugin() : this.load();
-                }
-            },
-
-            load: function () {
-                var url = this.map.url;
-
-                //Regular dependency.
-                if (!urlFetched[url]) {
-                    urlFetched[url] = true;
-                    context.load(this.map.id, url);
-                }
-            },
-
-            /**
-             * Checks if the module is ready to define itself, and if so,
-             * define it.
-             */
-            check: function () {
-                if (!this.enabled || this.enabling) {
-                    return;
-                }
-
-                var err, cjsModule,
-                    id = this.map.id,
-                    depExports = this.depExports,
-                    exports = this.exports,
-                    factory = this.factory;
-
-                if (!this.inited) {
-                    this.fetch();
-                } else if (this.error) {
-                    this.emit('error', this.error);
-                } else if (!this.defining) {
-                    //The factory could trigger another require call
-                    //that would result in checking this module to
-                    //define itself again. If already in the process
-                    //of doing that, skip this work.
-                    this.defining = true;
-
-                    if (this.depCount < 1 && !this.defined) {
-                        if (isFunction(factory)) {
-                            //If there is an error listener, favor passing
-                            //to that instead of throwing an error. However,
-                            //only do it for define()'d  modules. require
-                            //errbacks should not be called for failures in
-                            //their callbacks (#699). However if a global
-                            //onError is set, use that.
-                            if ((this.events.error && this.map.isDefine) ||
-                                req.onError !== defaultOnError) {
-                                try {
-                                    exports = context.execCb(id, factory, depExports, exports);
-                                } catch (e) {
-                                    err = e;
-                                }
-                            } else {
-                                exports = context.execCb(id, factory, depExports, exports);
-                            }
-
-                            if (this.map.isDefine) {
-                                //If setting exports via 'module' is in play,
-                                //favor that over return value and exports. After that,
-                                //favor a non-undefined return value over exports use.
-                                cjsModule = this.module;
-                                if (cjsModule &&
-                                        cjsModule.exports !== undefined &&
-                                        //Make sure it is not already the exports value
-                                        cjsModule.exports !== this.exports) {
-                                    exports = cjsModule.exports;
-                                } else if (exports === undefined && this.usingExports) {
-                                    //exports already set the defined value.
-                                    exports = this.exports;
-                                }
-                            }
-
-                            if (err) {
-                                err.requireMap = this.map;
-                                err.requireModules = this.map.isDefine ? [this.map.id] : null;
-                                err.requireType = this.map.isDefine ? 'define' : 'require';
-                                return onError((this.error = err));
-                            }
-
-                        } else {
-                            //Just a literal value
-                            exports = factory;
-                        }
-
-                        this.exports = exports;
-
-                        if (this.map.isDefine && !this.ignore) {
-                            defined[id] = exports;
-
-                            if (req.onResourceLoad) {
-                                req.onResourceLoad(context, this.map, this.depMaps);
-                            }
-                        }
-
-                        //Clean up
-                        cleanRegistry(id);
-
-                        this.defined = true;
-                    }
-
-                    //Finished the define stage. Allow calling check again
-                    //to allow define notifications below in the case of a
-                    //cycle.
-                    this.defining = false;
-
-                    if (this.defined && !this.defineEmitted) {
-                        this.defineEmitted = true;
-                        this.emit('defined', this.exports);
-                        this.defineEmitComplete = true;
-                    }
-
-                }
-            },
-
-            callPlugin: function () {
-                var map = this.map,
-                    id = map.id,
-                    //Map already normalized the prefix.
-                    pluginMap = makeModuleMap(map.prefix);
-
-                //Mark this as a dependency for this plugin, so it
-                //can be traced for cycles.
-                this.depMaps.push(pluginMap);
-
-                on(pluginMap, 'defined', bind(this, function (plugin) {
-                    var load, normalizedMap, normalizedMod,
-                        name = this.map.name,
-                        parentName = this.map.parentMap ? this.map.parentMap.name : null,
-                        localRequire = context.makeRequire(map.parentMap, {
-                            enableBuildCallback: true
-                        });
-
-                    //If current map is not normalized, wait for that
-                    //normalized name to load instead of continuing.
-                    if (this.map.unnormalized) {
-                        //Normalize the ID if the plugin allows it.
-                        if (plugin.normalize) {
-                            name = plugin.normalize(name, function (name) {
-                                return normalize(name, parentName, true);
-                            }) || '';
-                        }
-
-                        //prefix and name should already be normalized, no need
-                        //for applying map config again either.
-                        normalizedMap = makeModuleMap(map.prefix + '!' + name,
-                                                      this.map.parentMap);
-                        on(normalizedMap,
-                            'defined', bind(this, function (value) {
-                                this.init([], function () { return value; }, null, {
-                                    enabled: true,
-                                    ignore: true
-                                });
-                            }));
-
-                        normalizedMod = getOwn(registry, normalizedMap.id);
-                        if (normalizedMod) {
-                            //Mark this as a dependency for this plugin, so it
-                            //can be traced for cycles.
-                            this.depMaps.push(normalizedMap);
-
-                            if (this.events.error) {
-                                normalizedMod.on('error', bind(this, function (err) {
-                                    this.emit('error', err);
-                                }));
-                            }
-                            normalizedMod.enable();
-                        }
-
-                        return;
-                    }
-
-                    load = bind(this, function (value) {
-                        this.init([], function () { return value; }, null, {
-                            enabled: true
-                        });
-                    });
-
-                    load.error = bind(this, function (err) {
-                        this.inited = true;
-                        this.error = err;
-                        err.requireModules = [id];
-
-                        //Remove temp unnormalized modules for this module,
-                        //since they will never be resolved otherwise now.
-                        eachProp(registry, function (mod) {
-                            if (mod.map.id.indexOf(id + '_unnormalized') === 0) {
-                                cleanRegistry(mod.map.id);
-                            }
-                        });
-
-                        onError(err);
-                    });
-
-                    //Allow plugins to load other code without having to know the
-                    //context or how to 'complete' the load.
-                    load.fromText = bind(this, function (text, textAlt) {
-                        /*jslint evil: true */
-                        var moduleName = map.name,
-                            moduleMap = makeModuleMap(moduleName),
-                            hasInteractive = useInteractive;
-
-                        //As of 2.1.0, support just passing the text, to reinforce
-                        //fromText only being called once per resource. Still
-                        //support old style of passing moduleName but discard
-                        //that moduleName in favor of the internal ref.
-                        if (textAlt) {
-                            text = textAlt;
-                        }
-
-                        //Turn off interactive script matching for IE for any define
-                        //calls in the text, then turn it back on at the end.
-                        if (hasInteractive) {
-                            useInteractive = false;
-                        }
-
-                        //Prime the system by creating a module instance for
-                        //it.
-                        getModule(moduleMap);
-
-                        //Transfer any config to this other module.
-                        if (hasProp(config.config, id)) {
-                            config.config[moduleName] = config.config[id];
-                        }
-
-                        try {
-                            req.exec(text);
-                        } catch (e) {
-                            return onError(makeError('fromtexteval',
-                                             'fromText eval for ' + id +
-                                            ' failed: ' + e,
-                                             e,
-                                             [id]));
-                        }
-
-                        if (hasInteractive) {
-                            useInteractive = true;
-                        }
-
-                        //Mark this as a dependency for the plugin
-                        //resource
-                        this.depMaps.push(moduleMap);
-
-                        //Support anonymous modules.
-                        context.completeLoad(moduleName);
-
-                        //Bind the value of that module to the value for this
-                        //resource ID.
-                        localRequire([moduleName], load);
-                    });
-
-                    //Use parentName here since the plugin's name is not reliable,
-                    //could be some weird string with no path that actually wants to
-                    //reference the parentName's path.
-                    plugin.load(map.name, localRequire, load, config);
-                }));
-
-                context.enable(pluginMap, this);
-                this.pluginMaps[pluginMap.id] = pluginMap;
-            },
-
-            enable: function () {
-                enabledRegistry[this.map.id] = this;
-                this.enabled = true;
-
-                //Set flag mentioning that the module is enabling,
-                //so that immediate calls to the defined callbacks
-                //for dependencies do not trigger inadvertent load
-                //with the depCount still being zero.
-                this.enabling = true;
-
-                //Enable each dependency
-                each(this.depMaps, bind(this, function (depMap, i) {
-                    var id, mod, handler;
-
-                    if (typeof depMap === 'string') {
-                        //Dependency needs to be converted to a depMap
-                        //and wired up to this module.
-                        depMap = makeModuleMap(depMap,
-                                               (this.map.isDefine ? this.map : this.map.parentMap),
-                                               false,
-                                               !this.skipMap);
-                        this.depMaps[i] = depMap;
-
-                        handler = getOwn(handlers, depMap.id);
-
-                        if (handler) {
-                            this.depExports[i] = handler(this);
-                            return;
-                        }
-
-                        this.depCount += 1;
-
-                        on(depMap, 'defined', bind(this, function (depExports) {
-                            this.defineDep(i, depExports);
-                            this.check();
-                        }));
-
-                        if (this.errback) {
-                            on(depMap, 'error', bind(this, this.errback));
-                        }
-                    }
-
-                    id = depMap.id;
-                    mod = registry[id];
-
-                    //Skip special modules like 'require', 'exports', 'module'
-                    //Also, don't call enable if it is already enabled,
-                    //important in circular dependency cases.
-                    if (!hasProp(handlers, id) && mod && !mod.enabled) {
-                        context.enable(depMap, this);
-                    }
-                }));
-
-                //Enable each plugin that is used in
-                //a dependency
-                eachProp(this.pluginMaps, bind(this, function (pluginMap) {
-                    var mod = getOwn(registry, pluginMap.id);
-                    if (mod && !mod.enabled) {
-                        context.enable(pluginMap, this);
-                    }
-                }));
-
-                this.enabling = false;
-
-                this.check();
-            },
-
-            on: function (name, cb) {
-                var cbs = this.events[name];
-                if (!cbs) {
-                    cbs = this.events[name] = [];
-                }
-                cbs.push(cb);
-            },
-
-            emit: function (name, evt) {
-                each(this.events[name], function (cb) {
-                    cb(evt);
-                });
-                if (name === 'error') {
-                    //Now that the error handler was triggered, remove
-                    //the listeners, since this broken Module instance
-                    //can stay around for a while in the registry.
-                    delete this.events[name];
-                }
-            }
-        };
-
-        function callGetModule(args) {
-            //Skip modules already defined.
-            if (!hasProp(defined, args[0])) {
-                getModule(makeModuleMap(args[0], null, true)).init(args[1], args[2]);
-            }
-        }
-
-        function removeListener(node, func, name, ieName) {
-            //Favor detachEvent because of IE9
-            //issue, see attachEvent/addEventListener comment elsewhere
-            //in this file.
-            if (node.detachEvent && !isOpera) {
-                //Probably IE. If not it will throw an error, which will be
-                //useful to know.
-                if (ieName) {
-                    node.detachEvent(ieName, func);
-                }
-            } else {
-                node.removeEventListener(name, func, false);
-            }
-        }
-
-        /**
-         * Given an event from a script node, get the requirejs info from it,
-         * and then removes the event listeners on the node.
-         * @param {Event} evt
-         * @returns {Object}
-         */
-        function getScriptData(evt) {
-            //Using currentTarget instead of target for Firefox 2.0's sake. Not
-            //all old browsers will be supported, but this one was easy enough
-            //to support and still makes sense.
-            var node = evt.currentTarget || evt.srcElement;
-
-            //Remove the listeners once here.
-            removeListener(node, context.onScriptLoad, 'load', 'onreadystatechange');
-            removeListener(node, context.onScriptError, 'error');
-
-            return {
-                node: node,
-                id: node && node.getAttribute('data-requiremodule')
-            };
-        }
-
-        function intakeDefines() {
-            var args;
-
-            //Any defined modules in the global queue, intake them now.
-            takeGlobalQueue();
-
-            //Make sure any remaining defQueue items get properly processed.
-            while (defQueue.length) {
-                args = defQueue.shift();
-                if (args[0] === null) {
-                    return onError(makeError('mismatch', 'Mismatched anonymous define() module: ' + args[args.length - 1]));
-                } else {
-                    //args are id, deps, factory. Should be normalized by the
-                    //define() function.
-                    callGetModule(args);
-                }
-            }
-        }
-
-        context = {
-            config: config,
-            contextName: contextName,
-            registry: registry,
-            defined: defined,
-            urlFetched: urlFetched,
-            defQueue: defQueue,
-            Module: Module,
-            makeModuleMap: makeModuleMap,
-            nextTick: req.nextTick,
-            onError: onError,
-
-            /**
-             * Set a configuration for the context.
-             * @param {Object} cfg config object to integrate.
-             */
-            configure: function (cfg) {
-                //Make sure the baseUrl ends in a slash.
-                if (cfg.baseUrl) {
-                    if (cfg.baseUrl.charAt(cfg.baseUrl.length - 1) !== '/') {
-                        cfg.baseUrl += '/';
-                    }
-                }
-
-                //Save off the paths and packages since they require special processing,
-                //they are additive.
-                var pkgs = config.pkgs,
-                    shim = config.shim,
-                    objs = {
-                        paths: true,
-                        config: true,
-                        map: true
-                    };
-
-                eachProp(cfg, function (value, prop) {
-                    if (objs[prop]) {
-                        if (prop === 'map') {
-                            if (!config.map) {
-                                config.map = {};
-                            }
-                            mixin(config[prop], value, true, true);
-                        } else {
-                            mixin(config[prop], value, true);
-                        }
-                    } else {
-                        config[prop] = value;
-                    }
-                });
-
-                //Merge shim
-                if (cfg.shim) {
-                    eachProp(cfg.shim, function (value, id) {
-                        //Normalize the structure
-                        if (isArray(value)) {
-                            value = {
-                                deps: value
-                            };
-                        }
-                        if ((value.exports || value.init) && !value.exportsFn) {
-                            value.exportsFn = context.makeShimExports(value);
-                        }
-                        shim[id] = value;
-                    });
-                    config.shim = shim;
-                }
-
-                //Adjust packages if necessary.
-                if (cfg.packages) {
-                    each(cfg.packages, function (pkgObj) {
-                        var location;
-
-                        pkgObj = typeof pkgObj === 'string' ? { name: pkgObj } : pkgObj;
-                        location = pkgObj.location;
-
-                        //Create a brand new object on pkgs, since currentPackages can
-                        //be passed in again, and config.pkgs is the internal transformed
-                        //state for all package configs.
-                        pkgs[pkgObj.name] = {
-                            name: pkgObj.name,
-                            location: location || pkgObj.name,
-                            //Remove leading dot in main, so main paths are normalized,
-                            //and remove any trailing .js, since different package
-                            //envs have different conventions: some use a module name,
-                            //some use a file name.
-                            main: (pkgObj.main || 'main')
-                                  .replace(currDirRegExp, '')
-                                  .replace(jsSuffixRegExp, '')
-                        };
-                    });
-
-                    //Done with modifications, assing packages back to context config
-                    config.pkgs = pkgs;
-                }
-
-                //If there are any "waiting to execute" modules in the registry,
-                //update the maps for them, since their info, like URLs to load,
-                //may have changed.
-                eachProp(registry, function (mod, id) {
-                    //If module already has init called, since it is too
-                    //late to modify them, and ignore unnormalized ones
-                    //since they are transient.
-                    if (!mod.inited && !mod.map.unnormalized) {
-                        mod.map = makeModuleMap(id);
-                    }
-                });
-
-                //If a deps array or a config callback is specified, then call
-                //require with those args. This is useful when require is defined as a
-                //config object before require.js is loaded.
-                if (cfg.deps || cfg.callback) {
-                    context.require(cfg.deps || [], cfg.callback);
-                }
-            },
-
-            makeShimExports: function (value) {
-                function fn() {
-                    var ret;
-                    if (value.init) {
-                        ret = value.init.apply(global, arguments);
-                    }
-                    return ret || (value.exports && getGlobal(value.exports));
-                }
-                return fn;
-            },
-
-            makeRequire: function (relMap, options) {
-                options = options || {};
-
-                function localRequire(deps, callback, errback) {
-                    var id, map, requireMod;
-
-                    if (options.enableBuildCallback && callback && isFunction(callback)) {
-                        callback.__requireJsBuild = true;
-                    }
-
-                    if (typeof deps === 'string') {
-                        if (isFunction(callback)) {
-                            //Invalid call
-                            return onError(makeError('requireargs', 'Invalid require call'), errback);
-                        }
-
-                        //If require|exports|module are requested, get the
-                        //value for them from the special handlers. Caveat:
-                        //this only works while module is being defined.
-                        if (relMap && hasProp(handlers, deps)) {
-                            return handlers[deps](registry[relMap.id]);
-                        }
-
-                        //Synchronous access to one module. If require.get is
-                        //available (as in the Node adapter), prefer that.
-                        if (req.get) {
-                            return req.get(context, deps, relMap, localRequire);
-                        }
-
-                        //Normalize module name, if it contains . or ..
-                        map = makeModuleMap(deps, relMap, false, true);
-                        id = map.id;
-
-                        if (!hasProp(defined, id)) {
-                            return onError(makeError('notloaded', 'Module name "' +
-                                        id +
-                                        '" has not been loaded yet for context: ' +
-                                        contextName +
-                                        (relMap ? '' : '. Use require([])')));
-                        }
-                        return defined[id];
-                    }
-
-                    //Grab defines waiting in the global queue.
-                    intakeDefines();
-
-                    //Mark all the dependencies as needing to be loaded.
-                    context.nextTick(function () {
-                        //Some defines could have been added since the
-                        //require call, collect them.
-                        intakeDefines();
-
-                        requireMod = getModule(makeModuleMap(null, relMap));
-
-                        //Store if map config should be applied to this require
-                        //call for dependencies.
-                        requireMod.skipMap = options.skipMap;
-
-                        requireMod.init(deps, callback, errback, {
-                            enabled: true
-                        });
-
-                        checkLoaded();
-                    });
-
-                    return localRequire;
-                }
-
-                mixin(localRequire, {
-                    isBrowser: isBrowser,
-
-                    /**
-                     * Converts a module name + .extension into an URL path.
-                     * *Requires* the use of a module name. It does not support using
-                     * plain URLs like nameToUrl.
-                     */
-                    toUrl: function (moduleNamePlusExt) {
-                        var ext,
-                            index = moduleNamePlusExt.lastIndexOf('.'),
-                            segment = moduleNamePlusExt.split('/')[0],
-                            isRelative = segment === '.' || segment === '..';
-
-                        //Have a file extension alias, and it is not the
-                        //dots from a relative path.
-                        if (index !== -1 && (!isRelative || index > 1)) {
-                            ext = moduleNamePlusExt.substring(index, moduleNamePlusExt.length);
-                            moduleNamePlusExt = moduleNamePlusExt.substring(0, index);
-                        }
-
-                        return context.nameToUrl(normalize(moduleNamePlusExt,
-                                                relMap && relMap.id, true), ext,  true);
-                    },
-
-                    defined: function (id) {
-                        return hasProp(defined, makeModuleMap(id, relMap, false, true).id);
-                    },
-
-                    specified: function (id) {
-                        id = makeModuleMap(id, relMap, false, true).id;
-                        return hasProp(defined, id) || hasProp(registry, id);
-                    }
-                });
-
-                //Only allow undef on top level require calls
-                if (!relMap) {
-                    localRequire.undef = function (id) {
-                        //Bind any waiting define() calls to this context,
-                        //fix for #408
-                        takeGlobalQueue();
-
-                        var map = makeModuleMap(id, relMap, true),
-                            mod = getOwn(registry, id);
-
-                        delete defined[id];
-                        delete urlFetched[map.url];
-                        delete undefEvents[id];
-
-                        if (mod) {
-                            //Hold on to listeners in case the
-                            //module will be attempted to be reloaded
-                            //using a different config.
-                            if (mod.events.defined) {
-                                undefEvents[id] = mod.events;
-                            }
-
-                            cleanRegistry(id);
-                        }
-                    };
-                }
-
-                return localRequire;
-            },
-
-            /**
-             * Called to enable a module if it is still in the registry
-             * awaiting enablement. A second arg, parent, the parent module,
-             * is passed in for context, when this method is overriden by
-             * the optimizer. Not shown here to keep code compact.
-             */
-            enable: function (depMap) {
-                var mod = getOwn(registry, depMap.id);
-                if (mod) {
-                    getModule(depMap).enable();
-                }
-            },
-
-            /**
-             * Internal method used by environment adapters to complete a load event.
-             * A load event could be a script load or just a load pass from a synchronous
-             * load call.
-             * @param {String} moduleName the name of the module to potentially complete.
-             */
-            completeLoad: function (moduleName) {
-                var found, args, mod,
-                    shim = getOwn(config.shim, moduleName) || {},
-                    shExports = shim.exports;
-
-                takeGlobalQueue();
-
-                while (defQueue.length) {
-                    args = defQueue.shift();
-                    if (args[0] === null) {
-                        args[0] = moduleName;
-                        //If already found an anonymous module and bound it
-                        //to this name, then this is some other anon module
-                        //waiting for its completeLoad to fire.
-                        if (found) {
-                            break;
-                        }
-                        found = true;
-                    } else if (args[0] === moduleName) {
-                        //Found matching define call for this script!
-                        found = true;
-                    }
-
-                    callGetModule(args);
-                }
-
-                //Do this after the cycle of callGetModule in case the result
-                //of those calls/init calls changes the registry.
-                mod = getOwn(registry, moduleName);
-
-                if (!found && !hasProp(defined, moduleName) && mod && !mod.inited) {
-                    if (config.enforceDefine && (!shExports || !getGlobal(shExports))) {
-                        if (hasPathFallback(moduleName)) {
-                            return;
-                        } else {
-                            return onError(makeError('nodefine',
-                                             'No define call for ' + moduleName,
-                                             null,
-                                             [moduleName]));
-                        }
-                    } else {
-                        //A script that does not call define(), so just simulate
-                        //the call for it.
-                        callGetModule([moduleName, (shim.deps || []), shim.exportsFn]);
-                    }
-                }
-
-                checkLoaded();
-            },
-
-            /**
-             * Converts a module name to a file path. Supports cases where
-             * moduleName may actually be just an URL.
-             * Note that it **does not** call normalize on the moduleName,
-             * it is assumed to have already been normalized. This is an
-             * internal API, not a public one. Use toUrl for the public API.
-             */
-            nameToUrl: function (moduleName, ext, skipExt) {
-                var paths, pkgs, pkg, pkgPath, syms, i, parentModule, url,
-                    parentPath;
-
-                //If a colon is in the URL, it indicates a protocol is used and it is just
-                //an URL to a file, or if it starts with a slash, contains a query arg (i.e. ?)
-                //or ends with .js, then assume the user meant to use an url and not a module id.
-                //The slash is important for protocol-less URLs as well as full paths.
-                if (req.jsExtRegExp.test(moduleName)) {
-                    //Just a plain path, not module name lookup, so just return it.
-                    //Add extension if it is included. This is a bit wonky, only non-.js things pass
-                    //an extension, this method probably needs to be reworked.
-                    url = moduleName + (ext || '');
-                } else {
-                    //A module that needs to be converted to a path.
-                    paths = config.paths;
-                    pkgs = config.pkgs;
-
-                    syms = moduleName.split('/');
-                    //For each module name segment, see if there is a path
-                    //registered for it. Start with most specific name
-                    //and work up from it.
-                    for (i = syms.length; i > 0; i -= 1) {
-                        parentModule = syms.slice(0, i).join('/');
-                        pkg = getOwn(pkgs, parentModule);
-                        parentPath = getOwn(paths, parentModule);
-                        if (parentPath) {
-                            //If an array, it means there are a few choices,
-                            //Choose the one that is desired
-                            if (isArray(parentPath)) {
-                                parentPath = parentPath[0];
-                            }
-                            syms.splice(0, i, parentPath);
-                            break;
-                        } else if (pkg) {
-                            //If module name is just the package name, then looking
-                            //for the main module.
-                            if (moduleName === pkg.name) {
-                                pkgPath = pkg.location + '/' + pkg.main;
-                            } else {
-                                pkgPath = pkg.location;
-                            }
-                            syms.splice(0, i, pkgPath);
-                            break;
-                        }
-                    }
-
-                    //Join the path parts together, then figure out if baseUrl is needed.
-                    url = syms.join('/');
-                    url += (ext || (/\?/.test(url) || skipExt ? '' : '.js'));
-                    url = (url.charAt(0) === '/' || url.match(/^[\w\+\.\-]+:/) ? '' : config.baseUrl) + url;
-                }
-
-                return config.urlArgs ? url +
-                                        ((url.indexOf('?') === -1 ? '?' : '&') +
-                                         config.urlArgs) : url;
-            },
-
-            //Delegates to req.load. Broken out as a separate function to
-            //allow overriding in the optimizer.
-            load: function (id, url) {
-                req.load(context, id, url);
-            },
-
-            /**
-             * Executes a module callback function. Broken out as a separate function
-             * solely to allow the build system to sequence the files in the built
-             * layer in the right sequence.
-             *
-             * @private
-             */
-            execCb: function (name, callback, args, exports) {
-                return callback.apply(exports, args);
-            },
-
-            /**
-             * callback for script loads, used to check status of loading.
-             *
-             * @param {Event} evt the event from the browser for the script
-             * that was loaded.
-             */
-            onScriptLoad: function (evt) {
-                //Using currentTarget instead of target for Firefox 2.0's sake. Not
-                //all old browsers will be supported, but this one was easy enough
-                //to support and still makes sense.
-                if (evt.type === 'load' ||
-                        (readyRegExp.test((evt.currentTarget || evt.srcElement).readyState))) {
-                    //Reset interactive script so a script node is not held onto for
-                    //to long.
-                    interactiveScript = null;
-
-                    //Pull out the name of the module and the context.
-                    var data = getScriptData(evt);
-                    context.completeLoad(data.id);
-                }
-            },
-
-            /**
-             * Callback for script errors.
-             */
-            onScriptError: function (evt) {
-                var data = getScriptData(evt);
-                if (!hasPathFallback(data.id)) {
-                    return onError(makeError('scripterror', 'Script error for: ' + data.id, evt, [data.id]));
-                }
-            }
-        };
-
-        context.require = context.makeRequire();
-        return context;
-    }
-
-    /**
-     * Main entry point.
-     *
-     * If the only argument to require is a string, then the module that
-     * is represented by that string is fetched for the appropriate context.
-     *
-     * If the first argument is an array, then it will be treated as an array
-     * of dependency string names to fetch. An optional function callback can
-     * be specified to execute when all of those dependencies are available.
-     *
-     * Make a local req variable to help Caja compliance (it assumes things
-     * on a require that are not standardized), and to give a short
-     * name for minification/local scope use.
-     */
-    req = requirejs = function (deps, callback, errback, optional) {
-
-        //Find the right context, use default
-        var context, config,
-            contextName = defContextName;
-
-        // Determine if have config object in the call.
-        if (!isArray(deps) && typeof deps !== 'string') {
-            // deps is a config object
-            config = deps;
-            if (isArray(callback)) {
-                // Adjust args if there are dependencies
-                deps = callback;
-                callback = errback;
-                errback = optional;
-            } else {
-                deps = [];
-            }
-        }
-
-        if (config && config.context) {
-            contextName = config.context;
-        }
-
-        context = getOwn(contexts, contextName);
-        if (!context) {
-            context = contexts[contextName] = req.s.newContext(contextName);
-        }
-
-        if (config) {
-            context.configure(config);
-        }
-
-        return context.require(deps, callback, errback);
-    };
-
-    /**
-     * Support require.config() to make it easier to cooperate with other
-     * AMD loaders on globally agreed names.
-     */
-    req.config = function (config) {
-        return req(config);
-    };
-
-    /**
-     * Execute something after the current tick
-     * of the event loop. Override for other envs
-     * that have a better solution than setTimeout.
-     * @param  {Function} fn function to execute later.
-     */
-    req.nextTick = typeof setTimeout !== 'undefined' ? function (fn) {
-        setTimeout(fn, 4);
-    } : function (fn) { fn(); };
-
-    /**
-     * Export require as a global, but only if it does not already exist.
-     */
-    if (!require) {
-        require = req;
-    }
-
-    req.version = version;
-
-    //Used to filter out dependencies that are already paths.
-    req.jsExtRegExp = /^\/|:|\?|\.js$/;
-    req.isBrowser = isBrowser;
-    s = req.s = {
-        contexts: contexts,
-        newContext: newContext
-    };
-
-    //Create default context.
-    req({});
-
-    //Exports some context-sensitive methods on global require.
-    each([
-        'toUrl',
-        'undef',
-        'defined',
-        'specified'
-    ], function (prop) {
-        //Reference from contexts instead of early binding to default context,
-        //so that during builds, the latest instance of the default context
-        //with its config gets used.
-        req[prop] = function () {
-            var ctx = contexts[defContextName];
-            return ctx.require[prop].apply(ctx, arguments);
-        };
-    });
-
-    if (isBrowser) {
-        head = s.head = document.getElementsByTagName('head')[0];
-        //If BASE tag is in play, using appendChild is a problem for IE6.
-        //When that browser dies, this can be removed. Details in this jQuery bug:
-        //http://dev.jquery.com/ticket/2709
-        baseElement = document.getElementsByTagName('base')[0];
-        if (baseElement) {
-            head = s.head = baseElement.parentNode;
-        }
-    }
-
-    /**
-     * Any errors that require explicitly generates will be passed to this
-     * function. Intercept/override it if you want custom error handling.
-     * @param {Error} err the error object.
-     */
-    req.onError = defaultOnError;
-
-    /**
-     * Does the request to load a module for the browser case.
-     * Make this a separate function to allow other environments
-     * to override it.
-     *
-     * @param {Object} context the require context to find state.
-     * @param {String} moduleName the name of the module.
-     * @param {Object} url the URL to the module.
-     */
-    req.load = function (context, moduleName, url) {
-        var config = (context && context.config) || {},
-            node;
-        if (isBrowser) {
-            //In the browser so use a script tag
-            node = config.xhtml ?
-                    document.createElementNS('http://www.w3.org/1999/xhtml', 'html:script') :
-                    document.createElement('script');
-            node.type = config.scriptType || 'text/javascript';
-            node.charset = 'utf-8';
-            node.async = true;
-
-            node.setAttribute('data-requirecontext', context.contextName);
-            node.setAttribute('data-requiremodule', moduleName);
-
-            //Set up load listener. Test attachEvent first because IE9 has
-            //a subtle issue in its addEventListener and script onload firings
-            //that do not match the behavior of all other browsers with
-            //addEventListener support, which fire the onload event for a
-            //script right after the script execution. See:
-            //https://connect.microsoft.com/IE/feedback/details/648057/script-onload-event-is-not-fired-immediately-after-script-execution
-            //UNFORTUNATELY Opera implements attachEvent but does not follow the script
-            //script execution mode.
-            if (node.attachEvent &&
-                    //Check if node.attachEvent is artificially added by custom script or
-                    //natively supported by browser
-                    //read https://github.com/jrburke/requirejs/issues/187
-                    //if we can NOT find [native code] then it must NOT natively supported.
-                    //in IE8, node.attachEvent does not have toString()
-                    //Note the test for "[native code" with no closing brace, see:
-                    //https://github.com/jrburke/requirejs/issues/273
-                    !(node.attachEvent.toString && node.attachEvent.toString().indexOf('[native code') < 0) &&
-                    !isOpera) {
-                //Probably IE. IE (at least 6-8) do not fire
-                //script onload right after executing the script, so
-                //we cannot tie the anonymous define call to a name.
-                //However, IE reports the script as being in 'interactive'
-                //readyState at the time of the define call.
-                useInteractive = true;
-
-                node.attachEvent('onreadystatechange', context.onScriptLoad);
-                //It would be great to add an error handler here to catch
-                //404s in IE9+. However, onreadystatechange will fire before
-                //the error handler, so that does not help. If addEventListener
-                //is used, then IE will fire error before load, but we cannot
-                //use that pathway given the connect.microsoft.com issue
-                //mentioned above about not doing the 'script execute,
-                //then fire the script load event listener before execute
-                //next script' that other browsers do.
-                //Best hope: IE10 fixes the issues,
-                //and then destroys all installs of IE 6-9.
-                //node.attachEvent('onerror', context.onScriptError);
-            } else {
-                node.addEventListener('load', context.onScriptLoad, false);
-                node.addEventListener('error', context.onScriptError, false);
-            }
-            node.src = url;
-
-            //For some cache cases in IE 6-8, the script executes before the end
-            //of the appendChild execution, so to tie an anonymous define
-            //call to the module name (which is stored on the node), hold on
-            //to a reference to this node, but clear after the DOM insertion.
-            currentlyAddingScript = node;
-            if (baseElement) {
-                head.insertBefore(node, baseElement);
-            } else {
-                head.appendChild(node);
-            }
-            currentlyAddingScript = null;
-
-            return node;
-        } else if (isWebWorker) {
-            try {
-                //In a web worker, use importScripts. This is not a very
-                //efficient use of importScripts, importScripts will block until
-                //its script is downloaded and evaluated. However, if web workers
-                //are in play, the expectation that a build has been done so that
-                //only one script needs to be loaded anyway. This may need to be
-                //reevaluated if other use cases become common.
-                importScripts(url);
-
-                //Account for anonymous modules
-                context.completeLoad(moduleName);
-            } catch (e) {
-                context.onError(makeError('importscripts',
-                                'importScripts failed for ' +
-                                    moduleName + ' at ' + url,
-                                e,
-                                [moduleName]));
-            }
-        }
-    };
-
-    function getInteractiveScript() {
-        if (interactiveScript && interactiveScript.readyState === 'interactive') {
-            return interactiveScript;
-        }
-
-        eachReverse(scripts(), function (script) {
-            if (script.readyState === 'interactive') {
-                return (interactiveScript = script);
-            }
-        });
-        return interactiveScript;
-    }
-
-    //Look for a data-main script attribute, which could also adjust the baseUrl.
-    if (isBrowser) {
-        //Figure out baseUrl. Get it from the script tag with require.js in it.
-        eachReverse(scripts(), function (script) {
-            //Set the 'head' where we can append children by
-            //using the script's parent.
-            if (!head) {
-                head = script.parentNode;
-            }
-
-            //Look for a data-main attribute to set main script for the page
-            //to load. If it is there, the path to data main becomes the
-            //baseUrl, if it is not already set.
-            dataMain = script.getAttribute('data-main');
-            if (dataMain) {
-                //Preserve dataMain in case it is a path (i.e. contains '?')
-                mainScript = dataMain;
-
-                //Set final baseUrl if there is not already an explicit one.
-                if (!cfg.baseUrl) {
-                    //Pull off the directory of data-main for use as the
-                    //baseUrl.
-                    src = mainScript.split('/');
-                    mainScript = src.pop();
-                    subPath = src.length ? src.join('/')  + '/' : './';
-
-                    cfg.baseUrl = subPath;
-                }
-
-                //Strip off any trailing .js since mainScript is now
-                //like a module name.
-                mainScript = mainScript.replace(jsSuffixRegExp, '');
-
-                 //If mainScript is still a path, fall back to dataMain
-                if (req.jsExtRegExp.test(mainScript)) {
-                    mainScript = dataMain;
-                }
-
-                //Put the data-main script in the files to load.
-                cfg.deps 

<TRUNCATED>

[03/51] [abbrv] [partial] brooklyn-ui git commit: move subdir from incubator up a level as it is promoted to its own repo (first non-incubator commit!)

Posted by he...@apache.org.
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/js/view/application-add-wizard.js
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/js/view/application-add-wizard.js b/src/main/webapp/assets/js/view/application-add-wizard.js
new file mode 100644
index 0000000..2c4f012
--- /dev/null
+++ b/src/main/webapp/assets/js/view/application-add-wizard.js
@@ -0,0 +1,838 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+*/
+/**
+ * Builds a Twitter Bootstrap modal as the framework for a Wizard.
+ * Also creates an empty Application model.
+ */
+define([
+    "underscore", "jquery", "backbone", "brooklyn-utils", "js-yaml",
+    "model/entity", "model/application", "model/location", "model/catalog-application",
+    "text!tpl/app-add-wizard/modal-wizard.html",
+    "text!tpl/app-add-wizard/create.html",
+    "text!tpl/app-add-wizard/create-step-template-entry.html", 
+    "text!tpl/app-add-wizard/create-entity-entry.html", 
+    "text!tpl/app-add-wizard/required-config-entry.html",
+    "text!tpl/app-add-wizard/edit-config-entry.html",
+    "text!tpl/app-add-wizard/deploy.html",
+    "text!tpl/app-add-wizard/deploy-version-option.html",
+    "text!tpl/app-add-wizard/deploy-location-row.html",
+    "text!tpl/app-add-wizard/deploy-location-option.html",
+    "bootstrap"
+    
+], function (_, $, Backbone, Util, JsYaml, Entity, Application, Location, CatalogApplication,
+             ModalHtml, CreateHtml, CreateStepTemplateEntryHtml, CreateEntityEntryHtml,
+             RequiredConfigEntryHtml, EditConfigEntryHtml, DeployHtml,
+             DeployVersionOptionHtml, DeployLocationRowHtml, DeployLocationOptionHtml
+) {
+
+    /** Special ID to indicate that no locations will be provided when starting the server. */
+    var NO_LOCATION_INDICATOR = "__NONE__";
+
+    function setVisibility(obj, isVisible) {
+        if (isVisible) obj.show();
+        else obj.hide();
+    }
+
+    function setEnablement(obj, isEnabled) {
+        obj.attr("disabled", !isEnabled)
+    }
+    
+    /** converts old-style spec with "entities" to camp-style spec with services */
+    function oldSpecToCamp(spec) {
+        var services;
+        if (spec.type) {
+            services = [entityToCamp({type: spec.type, version: spec.version, config: spec.config})];
+        } else if (spec.entities) {
+            services = [];
+            var entities = spec.entities;
+            for (var i = 0; i < entities.length; i++) {
+                services.push(entityToCamp(entities[i]));
+            }
+        }
+        var result = {};
+        if (spec.name) result.name = spec.name;
+        if (spec.locations) {
+          if (spec.locations.length>1)
+            result.locations = spec.locations;
+          else
+            result.location = spec.locations[0];
+        }
+        if (services) result.services = services;
+        // NB: currently nothing else is supported in this spec
+        return result;
+    }
+    function entityToCamp(entity) {
+        var result = {};
+        if (entity.name && (!options || !options.exclude_name)) result.name = entity.name;
+        if (entity.type) result.type = entity.type;
+        if (entity.type && entity.version) result.type += ":" + entity.version;
+        if (entity.config && _.size(entity.config)) result["brooklyn.config"] = entity.config;
+        return result;
+    }
+    function getConvertedConfigValue(value) {
+        try {
+            return $.parseJSON(value);
+        } catch (e) {
+            return value;
+        }
+    }
+    
+    var ModalWizard = Backbone.View.extend({
+        tagName:'div',
+        className:'modal hide fade',
+        events:{
+            'click #prev_step':'prevStep',
+            'click #next_step':'nextStep',
+            'click #preview_step':'previewStep',
+            'click #finish_step':'finishStep'
+        },
+        template:_.template(ModalHtml),
+        initialize:function () {
+            this.catalog = {}
+            this.catalog.applications = {}
+            this.model = {}
+            this.model.spec = new Application.Spec;
+            this.model.yaml = "";
+            this.model.mode = "template";  // or "yaml" or "other"
+            this.currentStep = 0;
+            this.steps = [
+                          {
+                              step_id:'what-app',
+                              title:'Create Application',
+                              instructions:'Choose or build the application to deploy',
+                              view:new ModalWizard.StepCreate({ model:this.model, wizard: this, catalog: this.catalog })
+                          },
+                          {
+                              // TODO rather than make this another step -- since we now on preview revert to the yaml tab
+                              // this should probably be shown in the catalog tab, replacing the other contents.
+                              step_id:'name-and-locations',
+                              title:'<%= appName %>',
+                              instructions:'Specify the locations to deploy to and any additional configuration',
+                              view:new ModalWizard.StepDeploy({ model:this.model, catalog: this.catalog })
+                          }
+                          ]
+        },
+        beforeClose:function () {
+            // ensure we close the sub-views
+            _.each(this.steps, function (step) {
+                step.view.close()
+            }, this)
+        },
+        render:function () {
+            this.$el.html(this.template({}))
+            this.renderCurrentStep()
+            return this
+        },
+
+        renderCurrentStep:function (callback) {
+            var name = this.model.name || "";
+            this.title = this.$("h3#step_title")
+            this.instructions = this.$("p#step_instructions")
+
+            var currentStepObj = this.steps[this.currentStep]
+            this.title.html(_.template(currentStepObj.title)({appName: name}));
+            this.instructions.html(currentStepObj.instructions)
+            this.currentView = currentStepObj.view
+            
+            // delegate to sub-views !!
+            this.currentView.render()
+            this.currentView.updateForState()
+            this.$(".modal-body").replaceWith(this.currentView.el)
+            if (callback) callback(this.currentView);
+
+            this.updateButtonVisibility();
+        },
+        updateButtonVisibility:function () {
+            var currentStepObj = this.steps[this.currentStep]
+            
+            setVisibility(this.$("#prev_step"), (this.currentStep > 0))
+
+            // next shown for first step, but not for yaml
+            var nextVisible = (this.currentStep < 1) && (this.model.mode != "yaml")
+            setVisibility(this.$("#next_step"), nextVisible)
+            
+            // previous shown for step 2 (but again, not yaml)
+            var previewVisible = (this.currentStep == 1) && (this.model.mode != "yaml")
+            setVisibility(this.$("#preview_step"), previewVisible)
+            
+            // now set next/preview enablement
+            if (nextVisible || previewVisible) {
+                var nextEnabled = true;
+                if (this.currentStep==0 && this.model.mode=="template" && currentStepObj && currentStepObj.view) {
+                    // disable if this is template selction (lozenge) view, and nothing is selected
+                    if (! currentStepObj.view.selectedTemplate)
+                        nextEnabled = false;
+                }
+                
+                if (nextVisible)
+                    setEnablement(this.$("#next_step"), nextEnabled)
+                if (previewVisible)
+                    setEnablement(this.$("#preview_step"), nextEnabled)
+            }
+            
+            // finish from config step, preview step, and from first step if yaml tab selected (and valid)
+            var finishVisible = (this.currentStep >= 1)
+            var finishEnabled = finishVisible
+            if (!finishEnabled && this.currentStep==0) {
+                if (this.model.mode == "yaml") {
+                    // should do better validation than non-empty
+                    finishVisible = true;
+                    var yaml_code = this.$("#yaml_code").val()
+                    if (yaml_code) {
+                        finishEnabled = true;
+                    }
+                }
+            }
+            setVisibility(this.$("#finish_step"), finishVisible)
+            setEnablement(this.$("#finish_step"), finishEnabled)
+        },
+        
+        submitApplication:function (event) {
+            var that = this
+            var $modal = $('.add-app #modal-container .modal')
+            $modal.fadeTo(500,0.5);
+            
+            var yaml;
+            if (this.model.mode == "yaml") {
+                yaml = this.model.yaml;
+            } else {
+                // Drop any "None" locations.
+                this.model.spec.pruneLocations();
+                yaml = JsYaml.safeDump(oldSpecToCamp(this.model.spec.toJSON()));
+            }
+
+            $.ajax({
+                url:'/v1/applications',
+                type:'post',
+                contentType:'application/yaml',
+                processData:false,
+                data:yaml,
+                success:function (data) {
+                    that.onSubmissionComplete(true, data, $modal)
+                },
+                error:function (data) {
+                    that.onSubmissionComplete(false, data, $modal)
+                }
+            });
+
+            return false
+        },
+        onSubmissionComplete: function(succeeded, data, $modal) {
+            var that = this;
+            if (succeeded) {
+                $modal.modal('hide')
+                $modal.fadeTo(500,1);
+                if (that.options.callback) that.options.callback();             
+            } else {
+                log("ERROR submitting application: "+data.responseText);
+                var response, summary="Server responded with an error";
+                try {
+                    if (data.responseText) {
+                        response = JSON.parse(data.responseText)
+                        if (response) {
+                            summary = response.message;
+                        } 
+                    }
+                } catch (e) {
+                    summary = data.responseText;
+                }
+                that.$el.fadeTo(100,1).delay(200).fadeTo(200,0.2).delay(200).fadeTo(200,1);
+                that.steps[that.currentStep].view.showFailure(summary)
+            }
+        },
+
+        prevStep:function () {
+            this.currentStep -= 1;
+            this.renderCurrentStep();
+        },
+        nextStep:function () {
+            if (this.currentStep == 0) {
+                if (this.currentView.validate()) {
+                    var yaml = (this.currentView && this.currentView.selectedTemplate && this.currentView.selectedTemplate.yaml);
+                    if (yaml) {
+                        try {
+                            yaml = JsYaml.safeLoad(yaml);
+                            hasLocation = yaml.location || yaml.locations;
+                            if (!hasLocation) {
+                              // look for locations defined in locations
+                              svcs = yaml.services;
+                              if (svcs) {
+                                for (svcI in svcs) {
+                                  if (svcs[svcI].location || svcs[svcI].locations) {
+                                    hasLocation = true;
+                                    break;
+                                  }
+                                }
+                              }
+                            }
+                            yaml = (hasLocation ? true : false);
+                        } catch (e) {
+                            log("Warning: could not parse yaml template")
+                            log(yaml);
+                            yaml = false;
+                        }
+                    }
+                    if (yaml) {
+                        // it's a yaml catalog template which includes a location, show the yaml tab
+           	            $("ul#app-add-wizard-create-tab").find("a[href='#yamlTab']").tab('show');
+                        $("#yaml_code").setCaretToStart();
+                    } else {
+                        // it's a java catalog template or yaml template without a location, go to wizard
+                        this.currentStep += 1;
+                        this.renderCurrentStep();
+                    }
+                } else {
+                    // the call to validate will have done the showFailure
+                }
+            } else {
+                throw "Unexpected step: "+this.currentStep;
+            }
+        },
+        previewStep:function () {
+            if (this.currentView.validate()) {
+                this.currentStep = 0;
+                var that = this;
+                this.renderCurrentStep(function callback(view) {
+                    // Drop any "None" locations.
+                    that.model.spec.pruneLocations();
+                    $("textarea#yaml_code").val(JsYaml.safeDump(oldSpecToCamp(that.model.spec.toJSON())));
+                    $("ul#app-add-wizard-create-tab").find("a[href='#yamlTab']").tab('show');
+                    $("#yaml_code").setCaretToStart();
+                });
+            } else {
+                // call to validate should showFailure
+            }
+        },
+        finishStep:function () {
+            if (this.currentView.validate()) {
+                this.submitApplication()
+            } else {
+                // call to validate should showFailure
+            }
+        }
+    })
+    
+    // Note: this does not restore values on a back click; setting type and entity type+name is easy,
+    // but relevant config lines is a little bit more tedious
+    ModalWizard.StepCreate = Backbone.View.extend({
+        className:'modal-body',
+        events:{
+            'click #add-app-entity':'addEntityBox',
+            'click .editable-entity-heading':'expandEntity',
+            'click .remove-entity-button':'removeEntityClick',
+            'click .editable-entity-button':'saveEntityClick',
+            'click #remove-config':'removeConfigRow',
+            'click #add-config':'addConfigRow',
+            'click .template-lozenge':'templateClick',
+            'keyup .text-filter input':'applyFilter',
+            'change .text-filter input':'applyFilter',
+            'paste .text-filter input':'applyFilter',
+            'keyup #yaml_code':'onYamlCodeChange',
+            'change #yaml_code':'onYamlCodeChange',
+            'paste #yaml_code':'onYamlCodeChange',
+            'shown a[data-toggle="tab"]':'onTabChange',
+            'click #templateTab #catalog-add':'switchToCatalogAdd',
+            'click #templateTab #catalog-yaml':'showYamlTab'
+        },
+        template:_.template(CreateHtml),
+        wizard: null,
+        initialize:function () {
+            var self = this
+            self.catalogEntityIds = []
+
+            this.$el.html(this.template({}))
+
+            // for building from entities
+            this.addEntityBox()
+
+            // TODO: Make into models, allow options to override, then pass in in test
+            // with overrridden url. Can then think about fixing tests in application-add-wizard-spec.js.
+            $.get('/v1/catalog/entities', {}, function (result) {
+                self.catalogEntityItems = result
+                self.catalogEntityIds = _.map(result, function(item) { return item.id })
+                self.$(".entity-type-input").typeahead().data('typeahead').source = self.catalogEntityIds
+            })
+            this.options.catalog.applications = new CatalogApplication.Collection();
+            this.options.catalog.applications.fetch({
+                data: $.param({
+                    allVersions: true
+                }),
+                success: function (collection, response, options) {
+                    self.$("#appClassTab .application-type-input").typeahead().data('typeahead').source = collection.getTypes();
+                    $('#catalog-applications-throbber').hide();
+                    $('#catalog-applications-empty').hide();
+                    if (collection.size() > 0) {
+                        self.addTemplateLozenges()
+                    } else {
+                        $('#catalog-applications-empty').show();
+                        self.showYamlTab();
+                    }
+                }
+            });
+        },
+        renderConfiguredEntities:function () {
+            var $configuredEntities = this.$('#entitiesAccordionish').empty()
+            var that = this
+            if (this.model.spec.get("entities") && this.model.spec.get("entities").length > 0) {
+                _.each(this.model.spec.get("entities"), function (entity) {
+                    that.addEntityHtml($configuredEntities, entity)
+                })
+            }
+        },
+        updateForState: function () {},
+        render:function () {
+            this.renderConfiguredEntities()
+            this.delegateEvents()
+            return this
+        },
+        onTabChange: function(e) {
+            var tabText = $(e.target).text();
+            if (tabText=="Catalog") {
+                $("li.text-filter").show()
+            } else {
+                $("li.text-filter").hide()
+            }
+
+            if (tabText=="YAML") {
+                this.model.mode = "yaml";
+            } else if (tabText=="Template") {
+                this.model.mode = "template";
+            } else {
+                this.model.mode = "other";
+            }
+
+            if (this.options.wizard)
+                this.options.wizard.updateButtonVisibility();
+        },
+        onYamlCodeChange: function() {
+            if (this.options.wizard)
+                this.options.wizard.updateButtonVisibility();
+        },
+        switchToCatalogAdd: function() {
+            var $modal = $('.add-app #modal-container .modal')
+            $modal.modal('hide');
+            window.location.href="#v1/catalog/new";
+        },
+        showYamlTab: function() {
+            $("ul#app-add-wizard-create-tab").find("a[href='#yamlTab']").tab('show')
+            $("#yaml_code").focus();
+        },
+        applyFilter: function(e) {
+            var filter = $(e.currentTarget).val().toLowerCase()
+            if (!filter) {
+                $(".template-lozenge").show()
+            } else {
+                _.each($(".template-lozenge"), function(it) {
+                    var viz = $(it).text().toLowerCase().indexOf(filter)>=0
+                    if (viz)
+                        $(it).show()
+                    else
+                        $(it).hide()
+                })
+            }
+        },
+        addTemplateLozenges: function(event) {
+            var that = this
+            _.each(this.options.catalog.applications.getDistinctApplications(), function(item) {
+                that.addTemplateLozenge(that, item[0])
+            })
+        },
+        addTemplateLozenge: function(that, item) {
+            var $tempel = _.template(CreateStepTemplateEntryHtml, {
+                id: item.get('id'),
+                type: item.get('type'),
+                name: item.get('name') || item.get('id'),
+                description: item.get('description'),
+                planYaml:  item.get('planYaml'),
+                iconUrl: item.get('iconUrl')
+            })
+            $("#create-step-template-entries", that.$el).append($tempel)
+        },
+        templateClick: function(event) {
+            var $tl = $(event.target).closest(".template-lozenge");
+            var wasSelected = $tl.hasClass("selected")
+            $(".template-lozenge").removeClass("selected")
+            if (!wasSelected) {
+                $tl.addClass("selected")
+                this.selectedTemplate = {
+                    id: $tl.attr('id'),
+                    type: $tl.data('type'),
+                    name: $tl.data("name"),
+                    yaml: $tl.data("yaml"),
+                };
+                if (this.selectedTemplate.yaml) {
+                    $("textarea#yaml_code").val(this.selectedTemplate.yaml);
+                } else {
+                    $("textarea#yaml_code").val("services:\n- type: "+this.selectedTemplate.type);
+                }
+            } else {
+                this.selectedTemplate = null;
+            }
+
+            if (this.options.wizard)
+                this.options.wizard.updateButtonVisibility();
+        },
+        expandEntity:function (event) {
+            $(event.currentTarget).next().show('fast').delay(1000).prev().hide('slow')
+        },
+        saveEntityClick:function (event) {
+            this.saveEntity($(event.currentTarget).closest(".editable-entity-group"));
+        },
+        saveEntity:function ($entityGroup) {
+            var that = this
+            var name = $('#entity-name',$entityGroup).val()
+            var type = $('#entity-type',$entityGroup).val()
+            if (type=="" || !_.contains(that.catalogEntityIds, type)) {
+                that.showFailure("Missing or invalid type");
+                return false
+            }
+            var saveTarget = this.model.spec.get("entities")[$entityGroup.index()];
+            this.model.spec.set("type", null)
+            saveTarget.name = name
+            saveTarget.type = type
+            saveTarget.config = this.getConfigMap($entityGroup)
+
+            if (name=="") name=type;
+            if (name=="") name="<i>(new entity)</i>";
+            $('#entity-name-header',$entityGroup).html( name )
+            $('.editable-entity-body',$entityGroup).prev().show('fast').next().hide('fast')
+            return true;
+        },
+        getConfigMap:function (root) {
+            var map = {}
+            $('.app-add-wizard-config-entry',root).each( function (index,elt) {
+                var value = getConvertedConfigValue($('#value',elt).val());
+                if (value !== null) {
+                    map[$('#key',elt).val()] = value;
+                }
+            })
+            return map;
+        },
+        saveTemplate:function () {
+            if (!this.selectedTemplate) return false
+            var type = this.selectedTemplate.type;
+            if (!this.options.catalog.applications.hasType(type)) {
+                $('.entity-info-message').show('slow').delay(2000).hide('slow')
+                return false
+            }
+
+            this.model.spec.set("type", type);
+            this.model.name = this.selectedTemplate.name;
+            this.model.catalogEntityData = "LOAD"
+            return true;
+        },
+        saveAppClass:function () {
+            var that = this
+            var tab = $.find('#appClassTab')
+            var type = $(tab).find('#app-java-type').val()
+            if (!this.options.catalog.applications.hasType(type)) {
+                $('.entity-info-message').show('slow').delay(2000).hide('slow')
+                return false
+            }
+            this.model.spec.set("type", type);
+            return true;
+        },
+        addEntityBox:function () {
+            var entity = new Entity.Model
+            this.model.spec.addEntity( entity )
+            this.addEntityHtml($('#entitiesAccordionish', this.$el), entity)
+        },
+        addEntityHtml:function (parent, entity) {
+            var $entity = _.template(CreateEntityEntryHtml, {})
+            var that = this
+            parent.append($entity)
+            parent.children().last().find('.entity-type-input').typeahead({ source: that.catalogEntityIds })
+        },
+        removeEntityClick:function (event) {
+            var $entityGroup = $(event.currentTarget).parent().parent().parent();
+            this.model.spec.removeEntityIndex($entityGroup.index())
+            $entityGroup.remove()
+        },
+
+        addConfigRow:function (event) {
+            var $row = _.template(EditConfigEntryHtml, {})
+            $(event.currentTarget).parent().prev().append($row)
+        },
+        removeConfigRow:function (event) {
+            $(event.currentTarget).parent().remove()
+        },
+
+        validate:function () {
+            var that = this
+            var tabName = $('#app-add-wizard-create-tab li[class="active"] a').attr('href')
+            if (tabName=='#entitiesTab') {
+                delete this.model.spec.attributes["id"]
+                var allokay = true
+                $($.find('.editable-entity-group')).each(
+                    function (i,$entityGroup) {
+                        allokay = that.saveEntity($($entityGroup)) & allokay
+                    })
+                if (!allokay) return false;
+                if (this.model.spec.get("entities") && this.model.spec.get("entities").length > 0) {
+                    this.model.spec.set("type", null);
+                    return true;
+                }
+            } else if (tabName=='#templateTab') {
+                delete this.model.spec.attributes["id"]
+                if (this.saveTemplate()) {
+                    this.model.spec.set("entities", []);
+                    return true
+                }
+            } else if (tabName=='#appClassTab') {
+                delete this.model.spec.attributes["id"]
+                if (this.saveAppClass()) {
+                    this.model.spec.set("entities", []);
+                    return true
+                }
+            } else if (tabName=='#yamlTab') {
+                this.model.yaml = this.$("#yaml_code").val();
+                if (this.model.yaml) {
+                    return true;
+                }
+            } else {
+                console.info("NOT IMPLEMENTED YET")
+                // TODO - other tabs not implemented yet 
+                // do nothing, show error return false below
+            }
+            this.showFailure("Invalid application type/spec");
+            return false
+        },
+
+        showFailure: function(text) {
+            if (!text) text = "Failure performing the specified action";
+            this.$('div.error-message .error-message-text').html(_.escape(text));
+            this.$('div.error-message').slideDown(250).delay(10000).slideUp(500);
+        }
+
+    })
+
+    ModalWizard.StepDeploy = Backbone.View.extend({
+        className:'modal-body',
+
+        events:{
+            'click #add-selector-container':'addLocation',
+            'click #remove-app-location':'removeLocation',
+            'change .select-version': 'selectionVersion',
+            'change .select-location': 'selectionLocation',
+            'blur #application-name':'updateName',
+            'click #remove-config':'removeConfigRow',
+            'click #add-config':'addConfigRow'
+        },
+
+        template:_.template(DeployHtml),
+        versionOptionTemplate:_.template(DeployVersionOptionHtml),
+        locationRowTemplate:_.template(DeployLocationRowHtml),
+        locationOptionTemplate:_.template(DeployLocationOptionHtml),
+
+        initialize:function () {
+            this.model.spec.on("change", this.render, this)
+            this.$el.html(this.template())
+            this.locations = new Location.Collection()
+        },
+        beforeClose:function () {
+            this.model.spec.off("change", this.render)
+        },
+        renderName:function () {
+            this.$('#application-name').val(this.model.spec.get("name"))
+        },
+        renderVersions: function() {
+            var optionTemplate = this.versionOptionTemplate
+                select = this.$('.select-version')
+                container = this.$('#app-versions')
+                defaultVersion = '0.0.0.SNAPSHOT';
+
+            select.empty();
+
+            var versions = this.options.catalog.applications.getVersions(this.model.spec.get('type'));
+            for (var vi = 0; vi < versions.length; vi++) {
+                var version = versions[vi];
+                select.append(optionTemplate({
+                    version: version
+                }));
+            }
+
+            if (versions.length === 1 && versions[0] === defaultVersion) {
+                this.model.spec.set('version', '');
+                container.hide();
+            } else {
+                this.model.spec.set('version', versions[0]);
+                container.show();
+            }
+        },
+        renderAddedLocations:function () {
+            // renders the locations added to the model
+            var rowTemplate = this.locationRowTemplate,
+                optionTemplate = this.locationOptionTemplate,
+                container = this.$("#selector-container-location");
+            container.empty();
+            for (var li = 0; li < this.model.spec.get("locations").length; li++) {
+                var chosenLocation = this.model.spec.get("locations")[li];
+                container.append(rowTemplate({
+                    initialValue: chosenLocation,
+                    rowId: li
+                }));
+            }
+            var $locationOptions = container.find('.select-location');
+            var templated = this.locations.map(function(aLocation) {
+                return optionTemplate({
+                    id: aLocation.id || "",
+                    name: aLocation.getPrettyName()
+                });
+            });
+
+            // insert "none" location
+            $locationOptions.append(templated.join(""));
+            $locationOptions.each(function(i) {
+                var option = $($locationOptions[i]);
+                option.val(option.parent().attr('initialValue'));
+                // Only append dashes if there are any locations
+                if (option.find("option").length > 0) {
+                    option.append("<option disabled>------</option>");
+                }
+                option.append(optionTemplate({
+                    id: NO_LOCATION_INDICATOR,
+                    name: "None"
+                }));
+            });
+        },
+        render:function () {
+            this.delegateEvents()
+            return this
+        },
+        updateForState: function () {
+            var that = this
+            // clear any error message (we are being displayed fresh; if there are errors in the update, we'll show them in code below)
+            this.$('div.error-message').hide();
+            this.renderName()
+            this.renderVersions()
+            this.locations.fetch({
+                success:function () {
+                    if (that.model.spec.get("locations").length==0)
+                        that.addLocation()
+                    else
+                        that.renderAddedLocations()
+                }})
+                
+            if (this.model.catalogEntityData==null) {
+                this.renderStaticConfig(null)
+            } else if (this.model.catalogEntityData=="LOAD") {
+                this.renderStaticConfig("LOADING")
+                $.get('/v1/catalog/entities/'+this.model.spec.get("type"), {}, function (result) {
+                    that.model.catalogEntityData = result
+                    that.renderStaticConfig(that.model.catalogEntityData)
+                })
+            } else {
+                this.renderStaticConfig(this.model.catalogEntityData)
+            }            
+        },
+        addLocation:function () {
+            if (this.locations.models.length>0) {
+                this.model.spec.addLocation(this.locations.models[0].get("id"))
+            } else {
+                // i.e. No location
+                this.model.spec.addLocation(undefined);
+            }
+            this.renderAddedLocations()
+        },
+        removeLocation:function (event) {
+            var toBeRemoved = $(event.currentTarget).parent().attr('rowId')
+            this.model.spec.removeLocationIndex(toBeRemoved)
+            this.renderAddedLocations()
+        },
+        addConfigRow:function (event) {
+            var $row = _.template(EditConfigEntryHtml, {})
+            $(event.currentTarget).parent().prev().append($row)
+        },
+        removeConfigRow:function (event) {
+            $(event.currentTarget).parent().parent().remove()
+        },
+        renderStaticConfig:function (catalogEntryItem) {
+            this.$('.config-table').html('')
+            if (catalogEntryItem=="LOADING") {
+                this.$('.required-config-loading').show()
+            } else {
+                var configs = []
+                this.$('.required-config-loading').hide()
+                if (catalogEntryItem!=null && catalogEntryItem.config!=null) {
+                    var that = this
+                    _.each(catalogEntryItem.config, function (cfg) {
+                        if (cfg.priority !== undefined) {
+                            var html = _.template(RequiredConfigEntryHtml, {data:cfg});
+                            that.$('.config-table').append(html)
+                        }
+                    })
+                }
+            }
+        },
+        getConfigMap:function() {
+            var map = {};
+            $('.app-add-wizard-config-entry').each( function (index,elt) {
+                var value = $('#checkboxValue',elt).length ? $('#checkboxValue',elt).is(':checked') :
+                    getConvertedConfigValue($('#value',elt).val());
+                if (value !== null) {
+                    map[$('#key',elt).val()] = value;
+                }
+            })
+            return map;
+        },
+        selectionVersion:function (event) {
+            this.model.spec.set("version", $(event.currentTarget).val())
+        },
+        selectionLocation:function (event) {
+            var loc_id = $(event.currentTarget).val(),
+                isNoneLocation = loc_id === NO_LOCATION_INDICATOR;
+            var locationValid = isNoneLocation || this.locations.find(function (candidate) {
+                return candidate.get("id")==loc_id;
+            });
+            if (!locationValid) {
+                log("invalid location "+loc_id);
+                this.showFailure("Invalid location "+loc_id);
+                this.model.spec.set("locations",[]);
+            } else {
+                var index = $(event.currentTarget).parent().attr('rowId');
+                this.model.spec.setLocationAtIndex(index, isNoneLocation ? undefined : loc_id);
+            }
+        },
+        updateName:function () {
+            var name = this.$('#application-name').val();
+            if (name)
+                this.model.spec.set("name", name);
+            else
+                this.model.spec.set("name", "");
+        },
+        validate:function () {
+            this.model.spec.set("config", this.getConfigMap())
+            if (this.model.spec.get("locations").length !== 0) {
+                return true
+            } else {
+                this.showFailure("A location is required");
+                return false;
+            }
+        },
+        showFailure: function(text) {
+            if (!text) text = "Failure performing the specified action";
+            log("showing error: "+text);
+            this.$('div.error-message .error-message-text').html(_.escape(text));
+            // flash the error, but make sure it goes away (we do not currently have any other logic for hiding this error message)
+            this.$('div.error-message').slideDown(250).delay(10000).slideUp(500);
+        }
+    })
+    
+    return ModalWizard
+})

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/js/view/application-explorer.js
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/js/view/application-explorer.js b/src/main/webapp/assets/js/view/application-explorer.js
new file mode 100644
index 0000000..e9c23bc
--- /dev/null
+++ b/src/main/webapp/assets/js/view/application-explorer.js
@@ -0,0 +1,205 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+*/
+/**
+ * This should render the main content in the Application Explorer page.
+ * Components on this page should be rendered as sub-views.
+ * @type {*}
+ */
+define([
+    "underscore", "jquery", "backbone", "view/viewutils", 
+    "./application-add-wizard", "model/application", "model/entity-summary", "model/app-tree", "./application-tree",  "./entity-details",
+    "text!tpl/apps/details.html", "text!tpl/apps/entity-not-found.html", "text!tpl/apps/page.html"
+], function (_, $, Backbone, ViewUtils,
+        AppAddWizard, Application, EntitySummary, AppTree, ApplicationTreeView, EntityDetailsView,
+        EntityDetailsEmptyHtml, EntityNotFoundHtml, PageHtml) {
+
+    var ApplicationExplorerView = Backbone.View.extend({
+        tagName:"div",
+        className:"container container-fluid",
+        id:'application-explorer',
+        template:_.template(PageHtml),
+        notFoundTemplate: _.template(EntityNotFoundHtml),
+        events:{
+            'click .application-tree-refresh': 'refreshApplicationsInPlace',
+            'click #add-new-application':'createApplication',
+            'click .delete':'deleteApplication'
+        },
+        initialize: function () {
+            this.$el.html(this.template({}))
+            $(".nav1").removeClass("active");
+            $(".nav1_apps").addClass("active");
+
+            this.treeView = new ApplicationTreeView({
+                collection:this.collection,
+                appRouter:this.options.appRouter
+            })
+            this.treeView.on('entitySelected', function(e) {
+               this.displayEntityId(e.id, e.get('applicationId'), false);
+            }, this);
+            this.$('div#app-tree').html(this.treeView.renderFull().el)
+            this.$('div#details').html(EntityDetailsEmptyHtml);
+
+            ViewUtils.fetchRepeatedlyWithDelay(this, this.collection)
+        },
+        refreshApplicationsInPlace: function() {
+            // fetch without reset sets of change events, which now get handled correctly
+            // (not a full visual recompute, which reset does - both in application-tree.js)
+            this.collection.fetch();
+        },
+        beforeClose: function () {
+            this.collection.off("reset", this.render);
+            this.treeView.close();
+            if (this.detailsView)
+                this.detailsView.close();
+        },
+        show: function(entityId) {
+            var tab = "";
+            var tabDetails = "";
+            if (entityId) {
+                if (entityId[0]=='/') entityId = entityId.substring(1);
+                var slash = entityId.indexOf('/');
+                if (slash>0) {
+                    tab = entityId.substring(slash+1)
+                    entityId = entityId.substring(0, slash);
+                }
+            }
+            if (tab) {
+                var slash = tab.indexOf('/');
+                if (slash>0) {
+                    tabDetails = tab.substring(slash+1)
+                    tab = tab.substring(0, slash);
+                }
+                this.preselectTab(tab, tabDetails);
+            }
+            this.treeView.selectEntity(entityId)
+        },
+        createApplication:function () {
+            var that = this;
+            if (this._modal) {
+                this._modal.close()
+            }
+            var wizard = new AppAddWizard({
+                appRouter:that.options.appRouter,
+                callback:function() { that.refreshApplicationsInPlace() }
+            })
+            this._modal = wizard
+            this.$(".add-app #modal-container").html(wizard.render().el)
+            this.$(".add-app #modal-container .modal")
+                .on("hidden",function () {
+                    wizard.close()
+                }).modal('show')
+        },
+        deleteApplication:function (event) {
+            // call Backbone destroy() which does HTTP DELETE on the model
+            this.collection.get(event.currentTarget['id']).destroy({wait:true})
+        },
+        /**
+         * Causes the tab with the given name to be selected automatically when
+         * the view is next rendered.
+         */
+        preselectTab: function(tab, tabDetails) {
+            this.currentTab = tab;
+            this.currentTabDetails = tabDetails;
+        },
+        showDetails: function(app, entitySummary) {
+            var that = this;
+            ViewUtils.cancelFadeOnceLoaded($("div#details"));
+
+            var whichTab = this.currentTab;
+            if (!whichTab) {
+                whichTab = "summary";
+                if (this.detailsView) {
+                    whichTab = this.detailsView.$el.find(".tab-pane.active").attr("id");
+                    this.detailsView.close();
+                }
+            }
+            if (this.detailsView) {
+                this.detailsView.close();
+            }
+            this.detailsView = new EntityDetailsView({
+                model: entitySummary,
+                application: app,
+                appRouter: this.options.appRouter,
+                preselectTab: whichTab,
+                preselectTabDetails: this.currentTabDetails,
+            });
+
+            this.detailsView.on("entity.expunged", function() {
+                that.preselectTab("summary");
+                var id = that.selectedEntityId;
+                var model = that.collection.get(id);
+                if (model && model.get("parentId")) {
+                    that.displayEntityId(model.get("parentId"));
+                } else if (that.collection) {
+                    that.displayEntityId(that.collection.first().id);
+                } else if (id) {
+                    that.displayEntityNotFound(id);
+                } else {
+                    that.displayEntityNotFound("?");
+                }
+                that.collection.fetch();
+            });
+            this.detailsView.render( $("div#details") );
+        },
+        displayEntityId: function (id, appName, afterLoad) {
+            var that = this;
+            var entityLoadFailed = function() {
+                return that.displayEntityNotFound(id);
+            };
+            if (appName === undefined) {
+                if (!afterLoad) {
+                    // try a reload if given an ID we don't recognise
+                    this.collection.includeEntities([id]);
+                    this.collection.fetch({
+                        success: function() { _.defer(function() { that.displayEntityId(id, appName, true); }); },
+                        error: function() { _.defer(function() { that.displayEntityId(id, appName, true); }); }
+                    });
+                    ViewUtils.fadeToIndicateInitialLoad($("div#details"))
+                    return;
+                } else {
+                    // no such app
+                    entityLoadFailed();
+                    return; 
+                }
+            }
+
+            var app = new Application.Model();
+            var entitySummary = new EntitySummary.Model;
+
+            app.url = "/v1/applications/" + appName;
+            entitySummary.url = "/v1/applications/" + appName + "/entities/" + id;
+
+            // in case the server response time is low, fade out while it refreshes
+            // (since we can't show updated details until we've retrieved app + entity details)
+            ViewUtils.fadeToIndicateInitialLoad($("div#details"));
+
+            $.when(app.fetch(), entitySummary.fetch())
+                .done(function() {
+                    that.showDetails(app, entitySummary);
+                })
+                .fail(entityLoadFailed);
+        },
+        displayEntityNotFound: function(id) {
+            $("div#details").html(this.notFoundTemplate({"id": id}));
+            ViewUtils.cancelFadeOnceLoaded($("div#details"))
+        },
+    })
+
+    return ApplicationExplorerView
+})

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/js/view/application-tree.js
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/js/view/application-tree.js b/src/main/webapp/assets/js/view/application-tree.js
new file mode 100644
index 0000000..2f7a3d0
--- /dev/null
+++ b/src/main/webapp/assets/js/view/application-tree.js
@@ -0,0 +1,367 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+*/
+/**
+ * Sub-View to render the Application tree.
+ * @type {*}
+ */
+define([
+    "underscore", "jquery", "backbone", "view/viewutils",
+    "model/app-tree", "text!tpl/apps/tree-item.html", "text!tpl/apps/tree-empty.html"
+], function (_, $, Backbone, ViewUtils,
+             AppTree, TreeItemHtml, EmptyTreeHtml) {
+
+    var emptyTreeTemplate = _.template(EmptyTreeHtml);
+    var treeItemTemplate = _.template(TreeItemHtml);
+
+    var findAllTreeboxes = function(id, $scope) {
+        return $('.tree-box[data-entity-id="' + id + '"]', $scope);
+    };
+
+    var findRootTreebox = function(id) {
+        return $('.lozenge-app-tree-wrapper').children('.tree-box[data-entity-id="' + id + '"]', this.$el);
+    };
+
+    var findChildTreebox = function(id, $parentTreebox) {
+        return $parentTreebox.children('.node-children').children('.tree-box[data-entity-id="' + id + '"]');
+    };
+
+    var findMasterTreebox = function(id, $scope) {
+        return $('.tree-box[data-entity-id="' + id + '"]:not(.indirect)', $scope);
+    };
+
+    var createEntityTreebox = function(id, name, $domParent, depth, indirect) {
+        // Tildes in sort key force entities with no name to bottom of list (z < ~).
+        var sortKey = (name ? name.toLowerCase() : "~~~") + "     " + id.toLowerCase();
+
+        // Create the wrapper.
+        var $treebox = $(
+                '<div data-entity-id="'+id+'" data-sort-key="'+sortKey+'" data-depth="'+depth+'" ' +
+                'class="tree-box toggler-group' +
+                    (indirect ? " indirect" : "") +
+                    (depth == 0 ? " outer" : " inner " + (depth % 2 ? " depth-odd" : " depth-even")+
+                    (depth == 1 ? " depth-first" : "")) + '">'+
+                '<div class="entity_tree_node_wrapper"></div>'+
+                '<div class="node-children toggler-target hide"></div>'+
+                '</div>');
+
+        // Insert into the passed DOM parent, maintaining sort order relative to siblings: name then id.
+        var placed = false;
+        var contender = $(".toggler-group", $domParent).first();
+        while (contender.length && !placed) {
+            var contenderKey = contender.data("sort-key");
+            if (sortKey < contenderKey) {
+                contender.before($treebox);
+                placed = true;
+            } else {
+                contender = contender.next(".toggler-group", $domParent);
+            }
+        }
+        if (!placed) {
+            $domParent.append($treebox);
+        }
+        return $treebox;
+    };
+
+    var getOrCreateApplicationTreebox = function(id, name, treeView) {
+        var $treebox = findRootTreebox(id);
+        if (!$treebox.length) {
+            var $insertionPoint = $('.lozenge-app-tree-wrapper', treeView.$el);
+            if (!$insertionPoint.length) {
+                // entire view must be created
+                treeView.$el.html(
+                        '<div class="navbar_main_wrapper treeloz">'+
+                        '<div id="tree-list" class="navbar_main treeloz">'+
+                        '<div class="lozenge-app-tree-wrapper">'+
+                        '</div></div></div>');
+                $insertionPoint = $('.lozenge-app-tree-wrapper', treeView.$el);
+            }
+            $treebox = createEntityTreebox(id, name, $insertionPoint, 0, false);
+        }
+        return $treebox;
+    };
+
+    var getOrCreateChildTreebox = function(id, name, isIndirect, $parentTreebox) {
+        var $treebox = findChildTreebox(id, $parentTreebox);
+        if (!$treebox.length) {
+            $treebox = createEntityTreebox(id, name, $parentTreebox.children('.node-children'), $parentTreebox.data("depth") + 1, isIndirect);
+        }
+        return $treebox;
+    };
+
+    var updateTreeboxContent = function(entity, $treebox, treeView) {
+        var $newContent = $(treeView.template({
+            id: entity.get('id'),
+            parentId:  entity.get('parentId'),
+            model: entity,
+            statusIconUrl: ViewUtils.computeStatusIconInfo(entity.get("serviceUp"), entity.get("serviceState")).url,
+            indirect: $treebox.hasClass('indirect'),
+        }));
+
+        var $wrapper = $treebox.children('.entity_tree_node_wrapper');
+
+        // Preserve old display status (just chevron direction at present).
+        if ($wrapper.find('.tree-node-state').hasClass('icon-chevron-down')) {
+            $newContent.find('.tree-node-state').removeClass('icon-chevron-right').addClass('icon-chevron-down');
+        }
+
+        $wrapper.html($newContent);
+        addEventsToNode($treebox, treeView);
+    };
+
+    var addEventsToNode = function($node, treeView) {
+        // show the "light-popup" (expand / expand all / etc) menu
+        // if user hovers for 500ms. surprising there is no option for this (hover delay).
+        // also, annoyingly, clicks around the time the animation starts don't seem to get handled
+        // if the click is in an overlapping reason; this is why we position relative top: 12px in css
+        $('.light-popup', $node).parent().parent().hover(
+                function(parent) {
+                    treeView.cancelHoverTimer();
+                    treeView.hoverTimer = setTimeout(function() {
+                        var menu = $(parent.currentTarget).find('.light-popup');
+                        menu.show();
+                    }, 500);
+                },
+                function(parent) {
+                    treeView.cancelHoverTimer();
+                    $('.light-popup').hide();
+                }
+        );
+    };
+
+    var selectTreebox = function(id, $treebox, treeView) {
+        $('.entity_tree_node_wrapper').removeClass('active');
+        $treebox.children('.entity_tree_node_wrapper').addClass('active');
+
+        var entity = treeView.collection.get(id);
+        if (entity) {
+            treeView.selectedEntityId = id;
+            treeView.trigger('entitySelected', entity);
+        }
+    };
+
+
+    return Backbone.View.extend({
+        template: treeItemTemplate,
+        hoverTimer: null,
+
+        events: {
+            'click span.entity_tree_node .tree-change': 'treeChange',
+            'click span.entity_tree_node': 'nodeClicked'
+        },
+
+        initialize: function() {
+            this.collection.on('add', this.entityAdded, this);
+            this.collection.on('change', this.entityChanged, this);
+            this.collection.on('remove', this.entityRemoved, this);
+            this.collection.on('reset', this.renderFull, this);
+            _.bindAll(this);
+        },
+
+        beforeClose: function() {
+            this.collection.off("reset", this.renderFull);
+        },
+
+        entityAdded: function(entity) {
+            // Called when the full entity model is fetched into our collection, at which time we can replace
+            // the empty contents of any placeholder tree nodes (.tree-box) that were created earlier.
+            // The entity may have multiple 'treebox' views (in the case of group members).
+
+            // If the new entity is an application, we must create its placeholder in the DOM.
+            if (!entity.get('parentId')) {
+                var $treebox = getOrCreateApplicationTreebox(entity.id, entity.get('name'), this);
+
+                // Select the new app if there's no current selection.
+                if (!this.selectedEntityId)
+                    selectTreebox(entity.id, $treebox, this);
+            }
+
+            this.entityChanged(entity);
+        },
+
+        entityChanged: function(entity) {
+            // The entity may have multiple 'treebox' views (in the case of group members).
+            var that = this;
+            findAllTreeboxes(entity.id).each(function() {
+                var $treebox = $(this);
+                updateTreeboxContent(entity, $treebox, that);
+            });
+        },
+
+        entityRemoved: function(entity) {
+            // The entity may have multiple 'treebox' views (in the case of group members).
+            findAllTreeboxes(entity.id, this.$el).remove();
+            // Collection seems sometimes to retain children of the removed node;
+            // not sure why, but that's okay for now.
+            if (this.collection.getApplications().length == 0)
+                this.renderFull();
+        },
+
+        nodeClicked: function(event) {
+            var $treebox = $(event.currentTarget).closest('.tree-box');
+            var id = $treebox.data('entityId');
+            selectTreebox(id, $treebox, this);
+            return false;
+        },
+
+        selectEntity: function(id) {
+            var $treebox = findMasterTreebox(id, this.$el);
+            selectTreebox(id, $treebox, this);
+        },
+
+        renderFull: function() {
+            var that = this;
+            this.$el.empty();
+
+            // Display tree and highlight the selected entity.
+            if (this.collection.getApplications().length == 0) {
+                this.$el.append(emptyTreeTemplate());
+
+            } else {
+                _.each(this.collection.getApplications(), function(appId) {
+                    var entity = that.collection.get(appId);
+                    var $treebox = getOrCreateApplicationTreebox(entity.id, entity.name, that);
+                    updateTreeboxContent(entity, $treebox, that);
+                });
+            }
+
+            // Select the first app if there's no current selection.
+            if (!this.selectedEntityId) {
+                var firstApp = _.first(this.collection.getApplications());
+                if (firstApp)
+                    this.selectEntity(firstApp);
+            }
+            return this;
+        },
+
+        cancelHoverTimer: function() {
+            if (this.hoverTimer != null) {
+                clearTimeout(this.hoverTimer);
+                this.hoverTimer = null;
+            }
+        },
+
+        treeChange: function(event) {
+            var $target = $(event.currentTarget);
+            var $treeBox = $target.closest('.tree-box');
+            if ($target.hasClass('tr-expand')) {
+                this.showChildrenOf($treeBox, false);
+            } else if ($target.hasClass('tr-expand-all')) {
+                this.showChildrenOf($treeBox, true);
+            } else if ($target.hasClass('tr-collapse')) {
+                this.hideChildrenOf($treeBox, false);
+            } else if ($target.hasClass('tr-collapse-all')) {
+                this.hideChildrenOf($treeBox, true);
+            } else {
+                // default - toggle
+                if ($treeBox.children('.node-children').is(':visible')) {
+                    this.hideChildrenOf($treeBox, false);
+                } else {
+                    this.showChildrenOf($treeBox, false);
+                }
+            }
+            // hide the popup menu
+            this.cancelHoverTimer();
+            $('.light-popup').hide();
+            // don't let other events interfere
+            return false;
+        },
+
+        showChildrenOf: function($treeBox, recurse, excludedEntityIds) {
+            excludedEntityIds = excludedEntityIds || [];
+            var idToExpand = $treeBox.data('entityId');
+            var $wrapper = $treeBox.children('.entity_tree_node_wrapper');
+            var $childContainer = $treeBox.children('.node-children');
+            var model = this.collection.get(idToExpand);
+            if (model == null) {
+                // not yet loaded; parallel thread should load
+                return;
+            }
+
+            var that = this;
+            var children = model.get('children'); // entity summaries: {id: ..., name: ...}
+            var renderChildrenAsIndirect = $treeBox.hasClass("indirect");
+            _.each(children, function(child) {
+                var $treebox = getOrCreateChildTreebox(child.id, child.name, renderChildrenAsIndirect, $treeBox);
+                var model = that.collection.get(child.id);
+                if (model) {
+                    updateTreeboxContent(model, $treebox, that);
+                }
+            });
+            var members = model.get('members'); // entity summaries: {id: ..., name: ...}
+            _.each(members, function(member) {
+                var $treebox = getOrCreateChildTreebox(member.id, member.name, true, $treeBox);
+                var model = that.collection.get(member.id);
+                if (model) {
+                    updateTreeboxContent(model, $treebox, that);
+                }
+            });
+
+            // Avoid infinite recursive expansion using a "taboo list" of indirect entities already expanded in this
+            // operation. Example: a group that contains itself or one of its own ancestors. Such cycles can only
+            // originate via "indirect" subordinates.
+            var expandIfNotExcluded = function($treebox, excludedEntityIds, defer) {
+                if ($treebox.hasClass('indirect')) {
+                    var id = $treebox.data('entityId');
+                    if (_.contains(excludedEntityIds, id))
+                        return;
+                    excludedEntityIds.push(id);
+                }
+                var doExpand = function() { that.showChildrenOf($treebox, recurse, excludedEntityIds); };
+                if (defer) _.defer(doExpand);
+                else doExpand();
+            };
+
+            if (this.collection.includeEntities(_.union(children, members))) {
+                // we have to load entities before we can proceed
+                this.collection.fetch({
+                    success: function() {
+                        if (recurse) {
+                            $childContainer.children('.tree-box').each(function () {
+                                expandIfNotExcluded($(this), excludedEntityIds, true);
+                            });
+                        }
+                    }
+                });
+            }
+
+            $childContainer.slideDown(300);
+            $wrapper.find('.tree-node-state').removeClass('icon-chevron-right').addClass('icon-chevron-down');
+            if (recurse) {
+                $childContainer.children('.tree-box').each(function () {
+                    expandIfNotExcluded($(this), excludedEntityIds, false);
+                });
+            }
+        },
+
+        hideChildrenOf: function($treeBox, recurse) {
+            var $wrapper = $treeBox.children('.entity_tree_node_wrapper');
+            var $childContainer = $treeBox.children('.node-children');
+            if (recurse) {
+                var that = this;
+                $childContainer.children('.tree-box').each(function () {
+                    that.hideChildrenOf($(this), recurse);
+                });
+            }
+            $childContainer.slideUp(300);
+            $wrapper.find('.tree-node-state').removeClass('icon-chevron-down').addClass('icon-chevron-right');
+        },
+
+    });
+
+});

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/js/view/catalog.js
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/js/view/catalog.js b/src/main/webapp/assets/js/view/catalog.js
new file mode 100644
index 0000000..7d4ab2a
--- /dev/null
+++ b/src/main/webapp/assets/js/view/catalog.js
@@ -0,0 +1,613 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+*/
+define([
+    "underscore", "jquery", "backbone", "brooklyn",
+    "model/location", "model/entity",
+    "text!tpl/catalog/page.html",
+    "text!tpl/catalog/details-entity.html",
+    "text!tpl/catalog/details-generic.html",
+    "text!tpl/catalog/details-location.html",
+    "text!tpl/catalog/add-catalog-entry.html",
+    "text!tpl/catalog/add-yaml.html",
+    "text!tpl/catalog/add-location.html",
+    "text!tpl/catalog/nav-entry.html",
+
+    "bootstrap", "jquery-form"
+], function(_, $, Backbone, Brooklyn,
+        Location, Entity,
+        CatalogPageHtml, DetailsEntityHtml, DetailsGenericHtml, LocationDetailsHtml,
+        AddCatalogEntryHtml, AddYamlHtml, AddLocationHtml, EntryHtml) {
+
+    // Holds the currently active details type, e.g. applications, policies. Bit of a workaround
+    // to share the active view with all instances of AccordionItemView, so clicking the 'reload
+    // catalog' button (handled by the parent of the AIVs) does not apply the 'active' class to
+    // more than one element.
+    var activeDetailsView;
+
+    var CatalogItemDetailsView = Backbone.View.extend({
+
+        events: {
+            "click .delete": "deleteItem"
+        },
+
+        initialize: function() {
+            _.bindAll(this);
+            this.options.template = _.template(this.options.template || DetailsGenericHtml);
+        },
+
+        render: function() {
+            if (!this.options.model) {
+                return this.renderEmpty();
+            } else {
+                return this.renderDetails();
+            }
+        },
+
+        renderEmpty: function(extraMessage) {
+            this.$el.html("<div class='catalog-details'>" +
+                "<h3>Select an entry on the left</h3>" +
+                (extraMessage ? extraMessage : "") +
+                "</div>");
+            return this;
+        },
+
+        renderDetails: function() {
+            var that = this,
+                model = this.options.model,
+                template = this.options.template;
+            var show = function() {
+                // Keep the previously open section open between items. Duplication between
+                // here and setDetailsView, below. This case handles view refreshes from this
+                // view directly (e.g. when indicating an error), below handles keeping the
+                // right thing open when navigating from view to view.
+                var open = this.$(".in").attr("id");
+                var newHtml = $(template({model: model, viewName: that.options.name}));
+                $(newHtml).find("#"+open).addClass("in");
+                that.$el.html(newHtml);
+                // rewire events. previous callbacks are removed automatically.
+                that.delegateEvents()
+            };
+
+            this.activeModel = model;
+            // Load the view with currently available data and refresh once the load is complete.
+            // Only refreshes the view if the model changes and the user hasn't selected another
+            // item while the load was executing.
+            show();
+            model.on("change", function() {
+                if (that.activeModel.cid === model.cid) {
+                    show();
+                }
+            });
+            model.fetch()
+                .fail(function(xhr, textStatus, errorThrown) {
+                    console.log("error loading", model.id, ":", errorThrown);
+                    if (that.activeModel.cid === model.cid) {
+                        model.error = true;
+                        show();
+                    }
+                })
+                // Runs after the change event fires, or after the xhr completes
+                .always(function () {
+                    model.off("change");
+                });
+            return this;
+        },
+
+        deleteItem: function(event) {
+            // Could use wait flag to block removal of model from collection
+            // until server confirms deletion and success handler to perform
+            // removal. Useful if delete fails for e.g. lack of entitlement.
+            var that = this;
+            var displayName = $(event.currentTarget).data("name") || "item";
+            this.activeModel.destroy({
+                success: function() {
+                    that.renderEmpty("Deleted " + displayName);
+                },
+                error: function(info) {
+                    that.renderEmpty("Unable to permanently delete " + displayName+". Deletion is temporary, client-side only.");
+                }
+            });
+        }
+    });
+
+    var AddCatalogEntryView = Backbone.View.extend({
+        template: _.template(AddCatalogEntryHtml),
+        events: {
+            "click .show-context": "showContext"
+        },
+        initialize: function() {
+            _.bindAll(this);
+        },
+        render: function (initialView) {
+            this.$el.html(this.template());
+            if (initialView) {
+                if (initialView == "entity") initialView = "yaml";
+                
+                this.$("[data-context='"+initialView+"']").addClass("active");
+                this.showFormForType(initialView)
+            }
+            return this;
+        },
+        clearWithHtml: function(template) {
+            if (this.contextView) this.contextView.close();
+            this.context = undefined;
+            this.$(".btn").removeClass("active");
+            this.$("#catalog-add-form").html(template);
+        },
+        beforeClose: function () {
+            if (this.contextView) this.contextView.close();
+        },
+        showContext: function(event) {
+            var $event = $(event.currentTarget);
+            var context = $event.data("context");
+            if (this.context !== context) {
+                if (this.contextView) {
+                    this.contextView.close();
+                }
+                this.showFormForType(context)
+            }
+        },
+        showFormForType: function (type) {
+            this.context = type;
+            if (type == "yaml" || type == "entity") {
+                this.contextView = newYamlForm(this, this.options.parent);
+            } else if (type == "location") {
+                this.contextView = newLocationForm(this, this.options.parent);
+            } else if (type !== undefined) {
+                console.log("unknown catalog type " + type);
+                this.showFormForType("yaml");
+                return;
+            }
+            Backbone.history.navigate("/v1/catalog/new/" + type);
+            this.$("#catalog-add-form").html(this.contextView.$el);
+        }
+    });
+
+    function newYamlForm(addView, addViewParent) {
+        return new Brooklyn.view.Form({
+            template: _.template(AddYamlHtml),
+            onSubmit: function (model) {
+                var submitButton = this.$(".catalog-submit-button");
+                // "loading" is an indicator to Bootstrap, not a string to display
+                submitButton.button("loading");
+                var self = this;
+                var options = {
+                    url: "/v1/catalog/",
+                    data: model.get("yaml"),
+                    processData: false,
+                    type: "post"
+                };
+                $.ajax(options)
+                    .done(function (data, status, xhr) {
+                        // Can extract location of new item with:
+                        //model.url = Brooklyn.util.pathOf(xhr.getResponseHeader("Location"));
+                        if (_.size(data)==0) {
+                          addView.clearWithHtml( "No items supplied." );
+                        } else {
+                          addView.clearWithHtml( "Added: "+_.escape(_.keys(data).join(", ")) 
+                            + (_.size(data)==1 ? ". Loading..." : "") );
+                          addViewParent.loadAnyAccordionItem(_.size(data)==1 ? _.keys(data)[0] : undefined);
+                        }
+                    })
+                    .fail(function (xhr, status, error) {
+                        submitButton.button("reset");
+                        self.$(".catalog-save-error")
+                            .removeClass("hide")
+                            .find(".catalog-error-message")
+                            .html(_.escape(Brooklyn.util.extractError(xhr, "Could not add catalog item:\n'n" + error)));
+                    });
+            }
+        });
+    }
+
+    // Could adapt to edit existing locations too.
+    function newLocationForm(addView, addViewParent) {
+        // Renders with config key list
+        var body = new (Backbone.View.extend({
+            beforeClose: function() {
+                if (this.configKeyList) {
+                    this.configKeyList.close();
+                }
+            },
+            render: function() {
+                this.configKeyList = new Brooklyn.view.ConfigKeyInputPairList().render();
+                var template = _.template(AddLocationHtml);
+                this.$el.html(template);
+                this.$("#new-location-config").html(this.configKeyList.$el);
+            },
+            showError: function (message) {
+                self.$(".catalog-save-error")
+                    .removeClass("hide")
+                    .find(".catalog-error-message")
+                    .html(message);
+            }
+        }));
+        var form = new Brooklyn.view.Form({
+            body: body,
+            model: Location.Model,
+            onSubmit: function (location) {
+                var configKeys = body.configKeyList.getConfigKeys();
+                if (!configKeys.displayName) {
+                    configKeys.displayName = location.get("name");
+                }
+                var submitButton = this.$(".catalog-submit-button");
+                // "loading" is an indicator to Bootstrap, not a string to display
+                submitButton.button("loading");
+                location.set("config", configKeys);
+                location.save()
+                    .done(function (data) {
+                        addView.clearWithHtml( "Added: "+data.id+". Loading..." ); 
+                        addViewParent.loadAccordionItem("locations", data.id);
+                    })
+                    .fail(function (response) {
+                        submitButton.button("reset");
+                        body.showError(Brooklyn.util.extractError(response));
+                    });
+            }
+        });
+
+        return form;
+    }
+
+    var Catalog = Backbone.Collection.extend({
+        modelX: Backbone.Model.extend({
+          url: function() {
+            return "/v1/catalog/" + this.name + "/" + this.id + "?allVersions=true";
+          }
+        }),
+        initialize: function(models, options) {
+            this.name = options["name"];
+            if (!this.name) {
+                throw new Error("Catalog collection must know its name");
+            }
+            //this.model is a constructor so it shouldn't be _.bind'ed to this
+            //It actually works when a browser provided .bind is used, but the
+            //fallback implementation doesn't support it.
+            var that = this; 
+            var model = this.model.extend({
+              url: function() {
+                return "/v1/catalog/" + that.name + "/" + this.id.split(":").join("/");
+              }
+            });
+            _.bindAll(this);
+            this.model = model;
+        },
+        url: function() {
+            return "/v1/catalog/" + this.name+"?allVersions=true";
+        }
+    });
+
+    /** Use to fill single accordion view list. */
+    var AccordionItemView = Backbone.View.extend({
+        tag: "div",
+        className: "accordion-item",
+        events: {
+            'click .accordion-head': 'toggle',
+            'click .accordion-nav-row': 'showDetails'
+        },
+        bodyTemplate: _.template(
+            "<div class='accordion-head capitalized'><%= name %></div>" +
+            "<div class='accordion-body' style='display: <%= display %>'></div>"),
+
+        initialize: function() {
+            _.bindAll(this);
+            this.name = this.options.name;
+            if (!this.name) {
+                throw new Error("Name should have been given for accordion entry");
+            } else if (!this.options.onItemSelected) {
+                throw new Error("onItemSelected(model, element) callback should have been given for accordion entry");
+            }
+
+            // Generic templates
+            this.template = _.template(this.options.template || EntryHtml);
+
+            // Returns template applied to function arguments. Alter if collection altered.
+            // Will be run in the context of the AccordionItemView.
+            this.entryTemplateArgs = this.options.entryTemplateArgs || function(model, index) {
+                return {type: model.getVersionedAttr("type"), id: model.get("id")};
+            };
+
+            // undefined argument is used for existing model items
+            var collectionModel = this.options.model || Backbone.Model;
+            this.collection = this.options.collection || new Catalog(undefined, {
+                name: this.name,
+                model: collectionModel
+            });
+            // Refreshes entries list when the collection is synced with the server or
+            // any of its members are destroyed.
+            this.collection
+                .on("sync", this.renderEntries)
+                .on("destroy", this.renderEntries);
+            this.refresh();
+        },
+
+        beforeClose: function() {
+            this.collection.off();
+        },
+
+        render: function() {
+            this.$el.html(this.bodyTemplate({
+                name: this.name,
+                display: this.options.autoOpen ? "block" : "none"
+            }));
+            this.renderEntries();
+            return this;
+        },
+
+        singleItemTemplater: function(isChild, model, index) {
+            var args = _.extend({
+                    cid: model.cid,
+                    isChild: isChild,
+                    extraClasses: (activeDetailsView == this.name && model.cid == this.activeCid) ? "active" : ""
+                }, this.entryTemplateArgs(model));
+            return this.template(args);
+        },
+
+        renderEntries: function() {
+            var elements = this.collection.map(_.partial(this.singleItemTemplater, false), this);
+            this.updateContent(elements.join(''));
+        },
+
+        updateContent: function(markup) {
+            this.$(".accordion-body")
+                .empty()
+                .append(markup);
+        },
+
+        refresh: function() {
+            this.collection.fetch();
+        },
+
+        showDetails: function(event) {
+            var $event = $(event.currentTarget);
+            var cid = $event.data("cid");
+            if (activeDetailsView !== this.name || this.activeCid !== cid) {
+                activeDetailsView = this.name;
+                this.activeCid = cid;
+                var model = this.collection.get(cid);
+                Backbone.history.navigate("v1/catalog/" + this.name + "/" + model.id);
+                this.options.onItemSelected(activeDetailsView, model, $event);
+            }
+        },
+
+        toggle: function() {
+            var body = this.$(".accordion-body");
+            var hidden = this.hidden = body.css("display") == "none";
+            if (hidden) {
+                body.removeClass("hide").slideDown('fast');
+            } else {
+                body.slideUp('fast')
+            }
+        },
+
+        show: function() {
+            var body = this.$(".accordion-body");
+            var hidden = this.hidden = body.css("display") == "none";
+            if (hidden) {
+                body.removeClass("hide").slideDown('fast');
+            }
+        }
+    });
+    
+    var AccordionEntityView = AccordionItemView.extend({
+        renderEntries: function() {
+            var symbolicNameFn = function(model) {return model.get("symbolicName")};
+            var groups = this.collection.groupBy(symbolicNameFn);
+            var orderedIds = _.uniq(this.collection.map(symbolicNameFn));
+
+            function getLatestStableVersion(items) {
+                //the server sorts items by descending version, snapshots at the back
+                return items[0];
+            }
+
+            var catalogTree = _.map(orderedIds, function(symbolicName) {
+                var group = groups[symbolicName];
+                var root = getLatestStableVersion(group);
+                var children = _.reject(group, function(model) {return root.id == model.id;});
+                return {root: root, children: children};
+            });
+
+            var templater = function(memo, item, index) {
+                memo.push(this.singleItemTemplater(false, item.root));
+                return memo.concat(_.map(item.children, _.partial(this.singleItemTemplater, true), this));
+            };
+
+            var elements = _.reduce(catalogTree, templater, [], this);
+            this.updateContent(elements.join(''));
+        }
+    });
+
+    // Controls whole page. Parent of accordion items and details view.
+    var CatalogResourceView = Backbone.View.extend({
+        tagName:"div",
+        className:"container container-fluid",
+        entryTemplate:_.template(EntryHtml),
+
+        events: {
+            'click .refresh':'refresh',
+            'click #add-new-thing': 'createNewThing'
+        },
+
+        initialize: function() {
+            $(".nav1").removeClass("active");
+            $(".nav1_catalog").addClass("active");
+            // Important that bind happens before accordion object is created. If it happens after
+            // `this' will not be set correctly for the onItemSelected callbacks.
+            _.bindAll(this);
+            this.accordion = this.options.accordion || {
+                "applications": new AccordionEntityView({
+                    name: "applications",
+                    singular: "application",
+                    onItemSelected: _.partial(this.showCatalogItem, DetailsEntityHtml),
+                    model: Entity.Model,
+                    autoOpen: !this.options.kind || this.options.kind == "applications"
+                }),
+                "entities": new AccordionEntityView({
+                    name: "entities",
+                    singular: "entity",
+                    onItemSelected: _.partial(this.showCatalogItem, DetailsEntityHtml),
+                    model: Entity.Model,
+                    autoOpen: this.options.kind == "entities"
+                }),
+                "policies": new AccordionEntityView({
+                    // TODO needs parsing, and probably its own model
+                    // but cribbing "entity" works for now 
+                    // (and not setting a model can cause errors intermittently)
+                    onItemSelected: _.partial(this.showCatalogItem, DetailsEntityHtml),
+                    name: "policies",
+                    singular: "policy",
+                    model: Entity.Model,
+                    autoOpen: this.options.kind == "policies"
+                }),
+                "locations": new AccordionItemView({
+                    name: "locations",
+                    singular: "location",
+                    onItemSelected: _.partial(this.showCatalogItem, LocationDetailsHtml),
+                    collection: this.options.locations,
+                    autoOpen: this.options.kind == "locations",
+                    entryTemplateArgs: function (location, index) {
+                        return {
+                            type: location.getIdentifierName(),
+                            id: location.getLinkByName("self")
+                        };
+                    }
+                })
+            };
+        },
+
+        beforeClose: function() {
+            _.invoke(this.accordion, 'close');
+        },
+
+        render: function() {
+            this.$el.html(_.template(CatalogPageHtml, {}));
+            var parent = this.$(".catalog-accordion-parent");
+            _.each(this.accordion, function(child) {
+                parent.append(child.render().$el);
+            });
+            if (this.options.kind === "new") {
+                this.createNewThing(this.options.id);
+            } else if (this.options.kind && this.options.id) {
+                this.loadAccordionItem(this.options.kind, this.options.id)
+            } else {
+                // Show empty details view to start
+                this.setDetailsView(new CatalogItemDetailsView().render());
+            }
+            return this
+        },
+
+        /** Refreshes the contents of each accordion pane */
+        refresh: function() {
+            _.invoke(this.accordion, 'refresh');
+        },
+
+        createNewThing: function (type) {
+            // Discard if it's the jquery event object.
+            if (!_.isString(type)) {
+                type = undefined;
+            }
+            var viewName = "createNewThing";
+            if (!type) {
+                Backbone.history.navigate("/v1/catalog/new");
+            }
+            activeDetailsView = viewName;
+            this.$(".accordion-nav-row").removeClass("active");
+            var newView = new AddCatalogEntryView({
+                parent: this
+            }).render(type);
+            this.setDetailsView(newView);
+        },
+
+        loadAnyAccordionItem: function (id) {
+            this.loadAccordionItem("entities", id);
+            this.loadAccordionItem("applications", id);
+            this.loadAccordionItem("policies", id);
+            this.loadAccordionItem("locations", id);
+        },
+
+        loadAccordionItem: function (kind, id) {
+            if (!this.accordion[kind]) {
+                console.error("No accordion for: " + kind);
+            } else {
+                var accordion = this.accordion[kind];
+                var self = this;
+                // reset is needed because we rely on server's ordering;
+                // without it, server additions are placed at end of list
+                accordion.collection.fetch({reset: true})
+                    .then(function() {
+                        var model = accordion.collection.get(id);
+                        if (!model) {
+                            // if a version is supplied, try it without a version - needed for locations, navigating after deletion
+                            if (id && id.split(":").length>1) {
+                                model = accordion.collection.get( id.split(":")[0] );
+                            }
+                        }
+                        if (!model) {
+                            // if an ID is supplied without a version, look for first matching version (should be newest)
+                            if (id && id.split(":").length==1 && accordion.collection.models) {
+                                model = _.find(accordion.collection.models, function(m) { 
+                                    return m && m.id && m.id.startsWith(id+":");
+                                });
+                            }
+                        }
+                        // TODO could look in collection for any starting with ID
+                        if (model) {
+                            Backbone.history.navigate("/v1/catalog/"+kind+"/"+id);
+                            activeDetailsView = kind;
+                            accordion.activeCid = model.cid;
+                            accordion.options.onItemSelected(kind, model);
+                            accordion.show();
+                        } else {
+                            // catalog item not found, or not found yet (it might be reloaded and another callback will try again)
+                        }
+                    });
+            }
+        },
+
+        showCatalogItem: function(template, viewName, model, $target) {
+            this.$(".accordion-nav-row").removeClass("active");
+            if ($target) {
+                $target.addClass("active");
+            } else {
+                this.$("[data-cid=" + model.cid + "]").addClass("active");
+            }
+            var newView = new CatalogItemDetailsView({
+                model: model,
+                template: template,
+                name: viewName
+            }).render();
+            this.setDetailsView(newView)
+        },
+
+        setDetailsView: function(view) {
+            this.$("#details").html(view.el);
+            if (this.detailsView) {
+                // Try to re-open sections that were previously visible.
+                var openedItem = this.detailsView.$(".in").attr("id");
+                if (openedItem) {
+                    view.$("#" + openedItem).addClass("in");
+                }
+                this.detailsView.close();
+            }
+            this.detailsView = view;
+        }
+    });
+    
+    return CatalogResourceView
+});


[32/51] [abbrv] [partial] brooklyn-ui git commit: move subdir from incubator up a level as it is promoted to its own repo (first non-incubator commit!)

Posted by he...@apache.org.
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/js/view/entity-sensors.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/js/view/entity-sensors.js b/brooklyn-ui/src/main/webapp/assets/js/view/entity-sensors.js
deleted file mode 100644
index 282c622..0000000
--- a/brooklyn-ui/src/main/webapp/assets/js/view/entity-sensors.js
+++ /dev/null
@@ -1,539 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-/**
- * Render entity sensors tab.
- *
- * @type {*}
- */
-define([
-    "underscore", "jquery", "backbone", "brooklyn-utils", "zeroclipboard", "view/viewutils", 
-    "model/sensor-summary", "text!tpl/apps/sensors.html", "text!tpl/apps/sensor-name.html",
-    "jquery-datatables", "datatables-extensions", "underscore", "jquery", "backbone", "uri",
-], function (_, $, Backbone, Util, ZeroClipboard, ViewUtils, SensorSummary, SensorsHtml, SensorNameHtml) {
-
-    // TODO consider extracting all such usages to a shared ZeroClipboard wrapper?
-    ZeroClipboard.config({ moviePath: '//cdnjs.cloudflare.com/ajax/libs/zeroclipboard/1.3.1/ZeroClipboard.swf' });
-    
-    var sensorHtml = _.template(SensorsHtml),
-        sensorNameHtml = _.template(SensorNameHtml);
-
-    var EntitySensorsView = Backbone.View.extend({
-        template: sensorHtml,
-        sensorMetadata:{},
-        refreshActive:true,
-        zeroClipboard: null,
-
-        events:{
-            /* mouseup might technically be preferred, as moving out then releasing wouldn't
-             * normally be expected to trigger the action; however this introduces complexity
-             * as mouseup seems possibly to fire even if a widget has mouseoutted;
-             * also i note many other places (including backbone examples) seem to use click
-             * perhaps for this very reason.  worth exploring, but as a low priority. */
-            'click .refresh': 'updateSensorsNow',
-            'click .filterEmpty':'toggleFilterEmpty',
-            'click .toggleAutoRefresh':'toggleAutoRefresh',
-            'click #sensors-table div.secret-info':'toggleSecrecyVisibility',
-            
-            'mouseup .valueOpen':'valueOpen',
-            'mouseover #sensors-table tbody tr':'noteFloatMenuActive',
-            'mouseout #sensors-table tbody tr':'noteFloatMenuSeemsInactive',
-            'mouseover .floatGroup':'noteFloatMenuActive',
-            'mouseout .floatGroup':'noteFloatMenuSeemsInactive',
-            'mouseover .clipboard-item':'noteFloatMenuActiveCI',
-            'mouseout .clipboard-item':'noteFloatMenuSeemsInactiveCI',
-            'mouseover .hasFloatLeft':'showFloatLeft',
-            'mouseover .hasFloatDown':'enterFloatDown',
-            'mouseout .hasFloatDown':'exitFloatDown',
-            'mouseup .light-popup-menu-item':'closeFloatMenuNow'
-
-            // these have no effect: you must register on the zeroclipboard object, below
-            // (presumably the same for the .clipboard-item event listeners above, but unconfirmed)
-//            'mouseup .clipboard-item':'closeFloatMenuNow',
-//            'mouseup .global-zeroclipboard-container object':'closeFloatMenuNow',
-        },
-
-        initialize:function () {
-            _.bindAll(this);
-            this.$el.html(this.template());
-
-            var $table = this.$('#sensors-table'),
-                that = this;
-            this.table = ViewUtils.myDataTable($table, {
-                "fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
-                    $(nRow).attr('id', aData[0]);
-                    $('td',nRow).each(function(i,v){
-                        if (i==1) $(v).attr('class','sensor-value');
-                    });
-                    return nRow;
-                },
-                "aoColumnDefs": [
-                                 { // name (with tooltip)
-                                     "mRender": function ( data, type, row ) {
-                                         // name (column 1) should have tooltip title
-                                         var actions = that.getSensorActions(data.name);
-                                         // if data.description or .type is absent we get an error in html rendering (js)
-                                         // unless we set it explicitly (there is probably a nicer way to do this however?)
-                                         var context = _.extend(data, { 
-                                             description: data['description'], type: data['type']});
-                                         return sensorNameHtml(context);
-                                     },
-                                     "aTargets": [ 1 ]
-                                 },
-                                 { // value
-                                     "mRender": function ( data, type, row ) {
-                                         var escapedValue = Util.toDisplayString(data);
-                                         if (type!='display')
-                                             return escapedValue;
-                                         
-                                         var hasEscapedValue = (escapedValue!=null && (""+escapedValue).length > 0);
-                                             sensorName = row[0],
-                                             actions = that.getSensorActions(sensorName);
-                                         
-                                         // NB: the row might not yet exist
-                                         var $row = $('tr[id="'+sensorName+'"]');
-                                         
-                                         // datatables doesn't seem to expose any way to modify the html in place for a cell,
-                                         // so we rebuild
-                                         
-                                         var result = "<span class='value'>"+(hasEscapedValue ? escapedValue : '')+"</span>";
-
-                                         var isSecret = Util.isSecret(sensorName);
-                                         if (isSecret) {
-                                            result += "<span class='secret-indicator'>(hidden)</span>";
-                                         }
-                                         
-                                         if (actions.open)
-                                             result = "<a href='"+actions.open+"'>" + result + "</a>";
-                                         if (escapedValue==null || escapedValue.length < 3)
-                                             // include whitespace so we can click on it, if it's really small
-                                             result += "&nbsp;&nbsp;&nbsp;&nbsp;";
-
-                                         var existing = $row.find('.dynamic-contents');
-                                         // for the json url, use the full url (relative to window.location.href)
-                                         var jsonUrl = actions.json ? new URI(actions.json).resolve(new URI(window.location.href)).toString() : null;
-                                         // prefer to update in place, so menus don't disappear, also more efficient
-                                         // (but if menu is changed, we do recreate it)
-                                         if (existing.length>0) {
-                                             if (that.checkFloatMenuUpToDate($row, actions.open, '.actions-open', 'open-target') &&
-                                                 that.checkFloatMenuUpToDate($row, escapedValue, '.actions-copy') &&
-                                                 that.checkFloatMenuUpToDate($row, actions.json, '.actions-json-open', 'open-target') &&
-                                                 that.checkFloatMenuUpToDate($row, jsonUrl, '.actions-json-copy', 'copy-value')) {
-//                                                 log("updating in place "+sensorName)
-                                                 existing.html(result);
-                                                 return $row.find('td.sensor-value').html();
-                                             }
-                                         }
-                                         
-                                         // build the menu - either because it is the first time, or the actions are stale
-//                                         log("creating "+sensorName);
-                                         
-                                         var downMenu = "";
-                                         if (actions.open)
-                                             downMenu += "<div class='light-popup-menu-item valueOpen actions-open' open-target='"+actions.open+"'>" +
-                                             		"Open</div>";
-                                         if (hasEscapedValue) downMenu +=
-                                             "<div class='light-popup-menu-item handy valueCopy actions-copy clipboard-item'>Copy Value</div>";
-                                         if (actions.json) downMenu +=
-                                             "<div class='light-popup-menu-item handy valueOpen actions-json-open' open-target='"+actions.json+"'>" +
-                                                 "Open REST Link</div>";
-                                         if (actions.json && hasEscapedValue) downMenu +=
-                                             "<div class='light-popup-menu-item handy valueCopy actions-json-copy clipboard-item' copy-value='"+
-                                                 jsonUrl+"'>Copy REST Link</div>";
-                                         if (downMenu=="") {
-//                                             log("no actions for "+sensorName);
-                                             downMenu += 
-                                                 "<div class='light-popup-menu-item'>(no actions)</div>";
-                                         }
-                                         downMenu = "<div class='floatDown'><div class='light-popup'><div class='light-popup-body'>"
-                                             + downMenu +
-                                             "</div></div></div>";
-                                         result = "<span class='hasFloatLeft dynamic-contents'>" + result +
-                                         		"</span>" +
-                                         		"<div class='floatLeft'><span class='icon-chevron-down hasFloatDown'></span>" +
-                                         		downMenu +
-                                         		"</div>";
-                                         result = "<div class='floatGroup"+
-                                            (isSecret ? " secret-info" : "")+
-                                            "'>" + result + "</div>";
-                                         // also see updateFloatMenus which wires up the JS for these classes
-                                         
-                                         return result;
-                                     },
-                                     "aTargets": [ 2 ]
-                                 },
-                                 // ID in column 0 is standard (assumed in ViewUtils)
-                                 { "bVisible": false,  "aTargets": [ 0 ] }
-                             ]            
-            });
-            
-            this.zeroClipboard = new ZeroClipboard();
-            this.zeroClipboard.on( "dataRequested" , function(client) {
-                try {
-                    // the zeroClipboard instance is a singleton so check our scope first
-                    if (!$(this).closest("#sensors-table").length) return;
-                    var text = $(this).attr('copy-value');
-                    if (!text) text = $(this).closest('.floatGroup').find('.value').text();
-
-//                    log("Copying sensors text '"+text+"' to clipboard");
-                    client.setText(text);
-                    
-                    // show the word "copied" for feedback;
-                    // NB this occurs on mousedown, due to how flash plugin works
-                    // (same style of feedback and interaction as github)
-                    // the other "clicks" are now triggered by *mouseup*
-                    var $widget = $(this);
-                    var oldHtml = $widget.html();
-                    $widget.html('<b>Copied!</b>');
-                    // use a timeout to restore because mouseouts can leave corner cases (see history)
-                    setTimeout(function() { $widget.html(oldHtml); }, 600);
-                } catch (e) {
-                    log("Zeroclipboard failure; falling back to prompt mechanism");
-                    log(e);
-                    Util.promptCopyToClipboard(text);
-                }
-            });
-            // these seem to arrive delayed sometimes, so we also work with the clipboard-item class events
-            this.zeroClipboard.on( "mouseover", function() { that.noteFloatMenuZeroClipboardItem(true, this); } );
-            this.zeroClipboard.on( "mouseout", function() { that.noteFloatMenuZeroClipboardItem(false, this); } );
-            this.zeroClipboard.on( "mouseup", function() { that.closeFloatMenuNow(); } );
-            
-            ViewUtils.addFilterEmptyButton(this.table);
-            ViewUtils.addAutoRefreshButton(this.table);
-            ViewUtils.addRefreshButton(this.table);
-            this.loadSensorMetadata();
-            this.updateSensorsPeriodically();
-            this.toggleFilterEmpty();
-            return this;
-        },
-
-        beforeClose: function () {
-            if (this.zeroClipboard) {
-                this.zeroClipboard.destroy();
-            }
-        },
-
-        /* getting the float menu to pop-up and go away with all the right highlighting
-         * is ridiculous. this is pretty good, but still not perfect. it seems some events
-         * just don't fire, others occur out of order, and the root cause is that when
-         * the SWF object (which has to accept the click, for copy to work) gets focus,
-         * its ancestors *lose* focus - we have to suppress the event which makes the
-         * float group disappear.  i have left logging in, commented out, for more debugging.
-         * there are notes that ZeroClipboard 2.0 will support hover properly.
-         * 
-         * see git commit history and review comments in https://github.com/brooklyncentral/brooklyn/pull/1171
-         * for more information.
-         */
-        floatMenuActive: false,
-        lastFloatMenuRowId: null,
-        lastFloatFocusInTextForEventUnmangling: null,
-        updateFloatMenus: function() {
-            $('#sensors-table *[rel="tooltip"]').tooltip();
-            this.zeroClipboard.clip( $('.valueCopy') );
-        },
-        showFloatLeft: function(event) {
-            this.noteFloatMenuFocusChange(true, event, "show-left");
-            this.showFloatLeftOf($(event.currentTarget));
-        },
-        showFloatLeftOf: function($hasFloatLeft) {
-            $hasFloatLeft.next('.floatLeft').show(); 
-        },
-        enterFloatDown: function(event) {
-            this.noteFloatMenuFocusChange(true, event, "show-down");
-//            log("entering float down");
-            var fdTarget = $(event.currentTarget);
-//            log( fdTarget );
-            this.floatDownFocus = fdTarget;
-            var that = this;
-            setTimeout(function() {
-                that.showFloatDownOf( fdTarget );
-            }, 200);
-        },
-        exitFloatDown: function(event) {
-//            log("exiting float down");
-            this.floatDownFocus = null;
-        },
-        showFloatDownOf: function($hasFloatDown) {
-            if ($hasFloatDown != this.floatDownFocus) {
-//                log("float down did not hover long enough");
-                return;
-            }
-            var down = $hasFloatDown.next('.floatDown');
-            down.show();
-            $('.light-popup', down).show(2000); 
-        },
-        noteFloatMenuActive: function(focus) { 
-            this.noteFloatMenuFocusChange(true, focus, "menu");
-            
-            // remove dangling zc events (these don't always get removed, apparent bug in zc event framework)
-            // this causes it to flash sometimes but that's better than leaving the old item highlighted
-            if (focus.toElement && $(focus.toElement).hasClass('clipboard-item')) {
-                // don't remove it
-            } else {
-                var zc = $(focus.target).closest('.floatGroup').find('div.zeroclipboard-is-hover');
-                zc.removeClass('zeroclipboard-is-hover');
-            }
-        },
-        noteFloatMenuSeemsInactive: function(focus) { this.noteFloatMenuFocusChange(false, focus, "menu"); },
-        noteFloatMenuActiveCI: function(focus) { this.noteFloatMenuFocusChange(true, focus, "menu-clip-item"); },
-        noteFloatMenuSeemsInactiveCI: function(focus) { this.noteFloatMenuFocusChange(false, focus, "menu-clip-item"); },
-        noteFloatMenuZeroClipboardItem: function(seemsActive,focus) { 
-            this.noteFloatMenuFocusChange(seemsActive, focus, "clipboard");
-            if (seemsActive) {
-                // make the table row highlighted (as the default hover event is lost)
-                // we remove it when the float group goes away
-                $(focus).closest('tr').addClass('zeroclipboard-is-hover');
-            } else {
-                // sometimes does not get removed by framework - though this doesn't seem to help
-                // as you can see by logging this before and after:
-//                log(""+$(focus).attr('class'))
-                // the problem is that the framework seems sometime to trigger this event before adding the class
-                // see in noteFloatMenuActive where we do a different check
-                $(focus).removeClass('zeroclipboard-is-hover');
-            }
-        },
-        noteFloatMenuFocusChange: function(seemsActive, focus, caller) {
-//            log(""+new Date().getTime()+" note active "+caller+" "+seemsActive);
-            var delayCheckFloat = true;
-            var focusRowId = null;
-            var focusElement = null;
-            if (focus) {
-                focusElement = focus.target ? focus.target : focus;
-                if (seemsActive) {
-                    this.lastFloatFocusInTextForEventUnmangling = $(focusElement).text();
-                    focusRowId = focus.target ? $(focus.target).closest('tr').attr('id') : $(focus).closest('tr').attr('id');
-                    if (this.floatMenuActive && focusRowId==this.lastFloatMenuRowId) {
-                        // lastFloatMenuRowId has not changed, when moving within a floatgroup
-                        // (but we still get mouseout events when the submenu changes)
-//                        log("redundant mousein from "+ focusRowId );
-                        return;
-                    }
-                } else {
-                    // on mouseout, skip events which are bogus
-                    // first, if the toElement is in the same floatGroup
-                    focusRowId = focus.toElement ? $(focus.toElement).closest('tr').attr('id') : null;
-                    if (focusRowId==this.lastFloatMenuRowId) {
-                        // lastFloatMenuRowId has not changed, when moving within a floatgroup
-                        // (but we still get mouseout events when the submenu changes)
-//                        log("skipping, internal mouseout from "+ focusRowId );
-                        return;
-                    }
-                    // check (a) it is the 'out' event corresponding to the most recent 'in'
-                    // (because there is a race where it can say  in1, in2, out1 rather than in1, out2, in2
-                    if ($(focusElement).text() != this.lastFloatFocusInTextForEventUnmangling) {
-//                        log("skipping, not most recent mouseout from "+ focusRowId );
-                        return;
-                    }
-                    if (focus.toElement) {
-                        if ($(focus.toElement).hasClass('global-zeroclipboard-container')) {
-//                            log("skipping out, as we are moving to clipboard container");
-                            return;
-                        }
-                        if (focus.toElement.name && focus.toElement.name=="global-zeroclipboard-flash-bridge") {
-//                            log("skipping out, as we are moving to clipboard movie");
-                            return;                            
-                        }
-                    }
-                } 
-            }           
-//            log( "moving to "+focusRowId );
-            if (seemsActive && focusRowId) {
-//                log("setting lastFloat when "+this.floatMenuActive + ", from "+this.lastFloatMenuRowId );
-                if (this.lastFloatMenuRowId != focusRowId) {
-                    if (this.lastFloatMenuRowId) {
-                        // the floating menu has changed, hide the old
-//                        log("hiding old menu on float-focus change");
-                        this.closeFloatMenuNow();
-                    }
-                }
-                // now show the new, if possible (might happen multiple times, but no matter
-                if (focusElement) {
-//                    log("ensuring row "+focusRowId+" is showing on change");
-                    this.showFloatLeftOf($(focusElement).closest('tr').find('.hasFloatLeft'));
-                    this.lastFloatMenuRowId = focusRowId;
-                } else {
-                    this.lastFloatMenuRowId = null;
-                }
-            }
-            this.floatMenuActive = seemsActive;
-            if (!seemsActive) {
-                this.scheduleCheckFloatMenuNeedsHiding(delayCheckFloat);
-            }
-        },
-        scheduleCheckFloatMenuNeedsHiding: function(delayCheckFloat) {
-            if (delayCheckFloat) {
-                this.checkTime = new Date().getTime()+299;
-                setTimeout(this.checkFloatMenuNeedsHiding, 300);
-            } else {
-                this.checkTime = new Date().getTime()-1;
-                this.checkFloatMenuNeedsHiding();
-            }
-        },
-        closeFloatMenuNow: function() {
-//            log("closing float menu due do direct call (eg click)");
-            this.checkTime = new Date().getTime()-1;
-            this.floatMenuActive = false;
-            this.checkFloatMenuNeedsHiding();
-        },
-        checkFloatMenuNeedsHiding: function() {
-//            log(""+new Date().getTime()+" checking float menu - "+this.floatMenuActive);
-            if (new Date().getTime() <= this.checkTime) {
-//                log("aborting check as another one scheduled");
-                return;
-            }
-            
-            // we use a flag to determine whether to hide the float menu
-            // because the embedded zero-clipboard flash objects cause floatGroup 
-            // to get a mouseout event when the "Copy" menu item is hovered
-            if (!this.floatMenuActive) {
-//                log("HIDING FLOAT MENU")
-                $('.floatLeft').hide(); 
-                $('.floatDown').hide();
-                $('.zeroclipboard-is-hover').removeClass('zeroclipboard-is-hover');
-                lastFloatMenuRowId = null;
-            } else {
-//                log("we're still in")
-            }
-        },
-        valueOpen: function(event) {
-            window.open($(event.target).attr('open-target'),'_blank');
-        },
-
-        render: function() {
-            return this;
-        },
-        checkFloatMenuUpToDate: function($row, actionValue, actionSelector, actionAttribute) {
-            if (typeof actionValue === 'undefined' || actionValue==null || actionValue=="") {
-                if ($row.find(actionSelector).length==0) return true;
-            } else {
-                if (actionAttribute) {
-                    if ($row.find(actionSelector).attr(actionAttribute)==actionValue) return true;
-                } else {
-                    if ($row.find(actionSelector).length>0) return true;
-                }
-            }
-            return false;
-        },
-
-        /**
-         * Returns the actions loaded to view.sensorMetadata[name].actions
-         * for the given name, or an empty object.
-         */
-        getSensorActions: function(sensorName) {
-            var allMetadata = this.sensorMetadata || {};
-            var metadata = allMetadata[sensorName] || {};
-            return metadata.actions || {};
-        },
-
-        toggleFilterEmpty: function() {
-            ViewUtils.toggleFilterEmpty(this.$('#sensors-table'), 2);
-            return this;
-        },
-
-        toggleAutoRefresh: function() {
-            ViewUtils.toggleAutoRefresh(this);
-            return this;
-        },
-
-        enableAutoRefresh: function(isEnabled) {
-            this.refreshActive = isEnabled;
-            return this;
-        },
-        
-        toggleSecrecyVisibility: function(event) {
-            $(event.target).closest('.secret-info').toggleClass('secret-revealed');
-        },
-        
-        /**
-         * Loads current values for all sensors on an entity and updates sensors table.
-         */
-        isRefreshActive: function() { return this.refreshActive; },
-        updateSensorsNow:function () {
-            var that = this;
-            ViewUtils.get(that, that.model.getSensorUpdateUrl(), that.updateWithData,
-                    { enablement: that.isRefreshActive });
-        },
-        updateSensorsPeriodically:function () {
-            var that = this;
-            ViewUtils.getRepeatedlyWithDelay(that, that.model.getSensorUpdateUrl(), function(data) { that.updateWithData(data); },
-                    { enablement: that.isRefreshActive });
-        },
-        updateWithData: function (data) {
-            var that = this;
-            $table = that.$('#sensors-table');
-            var options = {};
-            if (that.fullRedraw) {
-                options.refreshAllRows = true;
-                that.fullRedraw = false;
-            }
-            ViewUtils.updateMyDataTable($table, data, function(value, name) {
-                var metadata = that.sensorMetadata[name];
-                if (metadata==null) {                        
-                    // kick off reload metadata when this happens (new sensor for which no metadata known)
-                    // but only if we haven't loaded metadata for a while
-                    metadata = { 'name':name };
-                    that.sensorMetadata[name] = metadata; 
-                    that.loadSensorMetadataIfStale(name, 10000);
-                };
-                return [name, metadata, value];
-            }, options);
-            
-            that.updateFloatMenus();
-        },
-
-        /**
-         * Loads all information about an entity's sensors. Populates view.sensorMetadata object
-         * with a map of sensor names to description, actions and type (e.g. java.lang.Long).
-         */
-        loadSensorMetadata: function() {
-            var url = this.model.getLinkByName('sensors'),
-                that = this;
-            that.lastSensorMetadataLoadTime = new Date().getTime();
-            $.get(url, function (data) {
-                _.each(data, function(sensor) {
-                    var actions = {};
-                    _.each(sensor.links, function(v, k) {
-                        if (k.slice(0, 7) == "action:") {
-                            actions[k.slice(7)] = v;
-                        }
-                    });
-                    that.sensorMetadata[sensor.name] = {
-                        name: sensor.name,
-                        description: sensor.description,
-                        actions: actions,
-                        type: sensor.type
-                    };
-                });
-                that.fullRedraw = true;
-                that.updateSensorsNow();
-                that.table.find('*[rel="tooltip"]').tooltip();
-            });
-            return this;
-        },
-        
-        loadSensorMetadataIfStale: function(sensorName, recency) {
-            var that = this;
-            if (!that.lastSensorMetadataLoadTime || that.lastSensorMetadataLoadTime + recency < new Date().getTime()) {
-//                log("reloading metadata because new sensor "+sensorName+" identified")
-                that.loadSensorMetadata();
-            }
-        }
-    });
-
-    return EntitySensorsView;
-});

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/js/view/entity-summary.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/js/view/entity-summary.js b/brooklyn-ui/src/main/webapp/assets/js/view/entity-summary.js
deleted file mode 100644
index 51a7c33..0000000
--- a/brooklyn-ui/src/main/webapp/assets/js/view/entity-summary.js
+++ /dev/null
@@ -1,229 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-/**
- * Render the application/entity summary tab.
- * @type {*}
- */
-define([
-    "underscore", "jquery", "backbone", "brooklyn", "brooklyn-utils", "view/viewutils",
-    "text!tpl/apps/summary.html", "view/entity-config", 
-], function (_, $, Backbone, Brooklyn, Util, ViewUtils, 
-        SummaryHtml, EntityConfigView) {
-
-    var EntitySummaryView = Backbone.View.extend({
-        events:{
-            'click a.open-tab':'tabSelected'
-        },
-        template:_.template(SummaryHtml),
-        initialize: function() {
-            _.bindAll(this);
-            var that = this;
-            this.$el.html(this.template({
-                entity:this.model,
-                application:this.options.application,
-                isApp: this.isApp()
-            }));
-            if (this.model.get('catalogItemId'))
-                this.$("div.catalogItemId").show();
-            else
-                this.$("div.catalogItemId").hide();
-
-            this.options.tabView.configView = new EntityConfigView({
-                model:this.options.model,
-                tabView:this.options.tabView,
-            });
-            this.$("div#advanced-config").html(this.options.tabView.configView.render().el);
-
-            ViewUtils.attachToggler(this.$el);
-
-            // TODO we should have a backbone object exported from the sensors view which we can listen to here
-            // (currently we just take the URL from that view) - and do the same for active tasks;
-            ViewUtils.getRepeatedlyWithDelay(this, this.model.getSensorUpdateUrl(),
-                function(data) { that.updateWithData(data); });
-            // however if we only use external objects we must either subscribe to their errors also
-            // or do our own polling against the server, so we know when to disable ourselves
-//            ViewUtils.fetchRepeatedlyWithDelay(this, this.model, { period: 10*1000 })
-
-            this.loadSpec();
-        },
-        isApp: function() {
-            var id = this.model.get('id');
-            var selfLink = this.model.get('links').self;
-            return selfLink.indexOf("/applications/" + id) != -1;
-        },
-        render:function () {
-            return this;
-        },
-        revealIfHasValue: function(sensor, $div, renderer, values) {
-            var that = this;
-            if (!renderer) renderer = function(data) { return _.escape(data); }
-            
-            if (values) {
-                var data = values[sensor]
-                if (data || data===false) {
-                    $(".value", $div).html(renderer(data))
-                    $div.show()
-                } else {
-                    $div.hide();
-                }
-            } else {
-              // direct ajax call not used anymore - but left just in case
-              $.ajax({
-                url: that.model.getLinkByName("sensors")+"/"+sensor,
-                contentType:"application/json",
-                success:function (data) {
-                    if (data || data===false) {
-                        $(".value", $div).html(renderer(data))
-                        $div.show()
-                    } else {
-                        $div.hide();
-                    }
-                    that.updateStatusIcon();
-                }})
-            }
-        },
-        updateWithData: function (data) {
-            this.revealIfHasValue("service.state", this.$(".status"), null, data)
-            this.revealIfHasValue("service.isUp", this.$(".serviceUp"), null, data)
-            
-            var renderAsLink = function(data) { return "<a href='"+_.escape(data)+"'>"+_.escape(data)+"</a>" };
-            this.revealIfHasValue("main.uri", this.$(".url"), renderAsLink, data)
-
-            var status = this.updateStatusIcon();
-            
-            this.updateCachedProblemIndicator(data);
-            
-            if (status.problem) {
-                this.updateAddlInfoForProblem();
-            } else {
-                this.$(".additional-info-on-problem").html("").hide()
-            }
-        },
-        updateStatusIcon: function() {
-            var statusIconInfo = ViewUtils.computeStatusIconInfo(this.$(".serviceUp .value").html(), this.$(".status .value").html());
-            if (statusIconInfo.url) {
-                this.$('#status-icon').html('<img src="'+statusIconInfo.url+'" '+
-                        'style="max-width: 64px; max-height: 64px;"/>');
-            } else {
-                this.$('#status-icon').html('');
-            }
-            return statusIconInfo;
-        },
-        updateCachedProblemIndicator: function(data) {
-            if (!data) return;
-            this.problemIndicators = data['service.problems'];
-            if (!this.problemIndicators || !_.size(this.problemIndicators))
-                this.problemIndicators = data['service.notUp.indicators'];
-            if (!this.problemIndicators || !_.size(this.problemIndicators))
-                this.problemIndicators = null;
-        },
-        updateAddlInfoForProblem: function(tasksReloaded) {
-            if (!this.options.tasks)
-                // if tasks not supplied, then don't attempt to show status info!
-                return;
-            
-            var problemDetails = "";
-            var lastFailedTask = null, that = this;
-            // ideally get the time the status changed, and return the last failure on or around that time
-            // (or take it from some causal log)
-            // but for now, we just return the most recent failed task
-            this.options.tasks.each(function(it) {
-                if (it.isError() && it.isLocalTopLevel()) {
-                    if (!lastFailedTask || it.attributes.endTimeUtc < lastFailedTask.attributes.endTimeUtc)
-                        lastFailedTask = it;
-                }
-            } );
-
-            if (this.problemIndicators) {
-                var indicatorText = _.values(this.problemIndicators);
-                for (var error in indicatorText) {
-                    if (problemDetails) {
-                        problemDetails = problemDetails + "<br style='line-height: 24px;'>";
-                    }
-                    problemDetails = problemDetails + _.escape(indicatorText[error]);
-                }
-            }
-            if (lastFailedTask) {
-                var path = "activities/subtask/"+lastFailedTask.id;
-                var base = this.model.getLinkByName("self");
-                if (problemDetails)
-                    problemDetails = problemDetails + "<br style='line-height: 24px;'>";
-                problemDetails = problemDetails + "<b>"+_.escape("Failure running task ")
-                    +"<a class='open-tab' tab-target='"+path+"'" +
-                    		"href='#"+base+"/"+path+"'>" +
-            				"<i>"+_.escape(lastFailedTask.attributes.displayName)+"</i> "
-                    +"("+lastFailedTask.id+")</a>: </b>"+
-                    _.escape(lastFailedTask.attributes.result);
-            }
-            if (!that.problemTasksLoaded && this.options.tasks) {
-                // trigger callback to get tasks
-                if (!problemDetails)
-                    problemDetails = "<i>Loading problem details...</i>";
-                
-                ViewUtils.get(this, this.options.tasks.url, function() {
-                    that.problemTasksLoaded = true;
-                    that.updateAddlInfoForProblem();
-                });
-            }
-            
-            if (problemDetails) {
-                this.$(".additional-info-on-problem").html(problemDetails).show();
-            } else {
-                var base = this.model.getLinkByName("self");
-                this.$(".additional-info-on-problem").html(
-                        "The entity appears to have failed externally. " +
-                        "<br style='line-height: 24px;'>" +
-                        "No Brooklyn-managed task failures reported. " +
-                        "For more information, investigate " +
-                            "<a class='open-tab' tab-target='sensors' href='#"+base+"/sensors'>sensors</a> and " +
-                            "streams on recent " +
-                            "<a class='open-tab' tab-target='activities' href='#"+base+"/activities'>activity</a>, " +
-                            "as well as external systems and logs where necessary.").show();
-            }
-        },
-        tabSelected: function(event) {
-            if (event.metaKey || event.shiftKey)
-                // trying to open in a new tab, do not act on it here!
-                return;
-            var tab = $(event.currentTarget).attr('tab-target');
-            this.options.tabView.openTab(tab);
-            // and prevent the a from firing
-            event.preventDefault();
-            return false;
-        },
-        loadSpec: function(flushCache) {
-            if (!flushCache && this.spec) {
-                this.renderSpec(this.spec);
-                return;
-            }
-            ViewUtils.get(this, this.model.get('links').spec, this.renderSpec);
-        },
-        renderSpec: function(data) {
-            if (!data) data=this.spec;
-            if (!data) {
-                this.$('#entity-spec-yaml-toggler').hide();
-            } else {
-                ViewUtils.updateTextareaWithData($("#entity-spec-yaml", this.$el), data, true, false, 150, 400);
-                this.$('#entity-spec-yaml-toggler').show();
-            }
-        }
-    });
-
-    return EntitySummaryView;
-});

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/js/view/googlemaps.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/js/view/googlemaps.js b/brooklyn-ui/src/main/webapp/assets/js/view/googlemaps.js
deleted file mode 100644
index fac3774..0000000
--- a/brooklyn-ui/src/main/webapp/assets/js/view/googlemaps.js
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-//shim to access google maps with require.js -- courtesy https://github.com/p15martin/google-maps-hello-world/
-define(
-        [ "async!https://maps.googleapis.com/maps/api/js?sensor=false" ],
-        function() {
-            var locationMarkers = {};
-            // meters squared per entity
-            var area_per_entity = 300000000000;
-            var local = {
-                addMapToCanvas: function( mapCanvas, lat, longitude, zoom ) {
-                    var myOptions = {
-                            center: new google.maps.LatLng( lat, longitude ),
-                            zoom: zoom,
-                            mapTypeId: google.maps.MapTypeId.SATELLITE
-                    };
-
-                    return new google.maps.Map(mapCanvas, myOptions);
-                },
-
-                // TODO info window; massive code tidy
-                drawCircles: function(map, data) {
-                    var newLocs = {};
-                    var lm;
-                    _.each(data, function(it) {
-                        var id = it.id;
-                        if (it.latitude == null || it.longitude == null || (it.latitude == 0 && it.longitude == 0)) {
-                            // Suppress circle if not set or at (0,0); slightly clumsy, but workable
-                        } else if (lm = locationMarkers[id]) {
-                            // Update
-                            var latlng = new google.maps.LatLng(it.latitude, it.longitude);
-
-                            lm.circle.setRadius(local.radius(local.computeLocationArea(it.leafEntityCount)));
-                            lm.circle.setCenter(latlng);
-                            lm.marker.setPosition(latlng);
-                            lm.marker.setTitle(it.name);
-//                            lm.infoWindow.setPairs(l);
-
-                            newLocs[id] = lm;
-                        } else {
-                            // Add
-                            var circle = local.drawCircle(map, it.latitude, it.longitude, local.radius(local.computeLocationArea(it.leafEntityCount)));
-
-                            var marker = new google.maps.Marker({
-                                map: map,
-                                position: new google.maps.LatLng(it.latitude, it.longitude),
-                                title: it.name
-                            });
-
-                            // TODO from old grails app
-//                            var infoWindow = new Brooklyn.gmaps.ListInfoWindow(l, map, marker);
-
-                            circle.bindTo('center', marker, 'position');
-                            newLocs[id] = {circle: circle,
-                                    marker: marker
-//                                    ,
-//                                    infoWindow: infoWindow
-                                    };
-                        }
-                    })
-
-                    // TODO yuck, we assume location markers (static field) are tied to map (supplied)
-                    for (var marker in locationMarkers) {
-                        if (! newLocs[marker]) {
-                            // location has been removed
-                            lm = locationMarkers[marker];
-                            lm.circle.setMap(null);
-                            lm.marker.setMap(null);
-                            lm.infoWindow.getInfoWindow().setMap(null);
-                        }
-                    }
-                    locationMarkers = newLocs;
-                },
-                resetCircles: function() {
-                    locationMarkers = {};
-                },
-
-                drawCircle: function(map, lat, lng, radius) {
-                    var circle_latlong = new google.maps.LatLng(lat, lng);
-                    var circle_options = {
-                        map: map,
-                        center: circle_latlong,
-                        clickableboolean: false,
-                        fillColor: "#FF0000",
-                        fillOpacity: 0.4,
-                        radius: radius, // meters
-                        strokeColor: "#FF0000",
-                        strokeOpacity: 1,
-                        strokeWeight: 1,
-                        zIndex: 1
-                    };
-
-                    return new google.maps.Circle(circle_options);
-                },
-
-                /* Returns the area in square meters that a circle should be to represent
-                 * count entities at a location. */
-                computeLocationArea: function(count) {
-                    return area_per_entity * count;
-                },
-
-                /* Returns the radius of a circle of the given area. */
-                radius: function(area) {
-                    return Math.sqrt(area / Math.PI);
-                }
-
-//                function drawCirclesFromJSON(json) {
-//                    var newLocs = {};
-//                    var id;
-//                    var lm;
-//
-//                    for (id in json) {
-//                        var l = json[id];
-//                        if (l.lat == null || l.lng == null || (l.lat == 0 && l.lng == 0)) {
-//                            // Suppress circle if not set or at (0,0); slightly clumsy, but workable
-//                        } else if (lm = locationMarkers[id]) {
-//                            // Update
-//                            var latlng = new google.maps.LatLng(l.lat, l.lng);
-//
-//                            lm.circle.setRadius(radius(location_area(l.entity_count)));
-//                            lm.circle.setCenter(latlng);
-//                            lm.marker.setPosition(latlng);
-//                            lm.infoWindow.setPairs(l);
-//
-//                            newLocs[id] = lm;
-//                        } else {
-//                            // Add
-//                            var circle = drawCircle(l.lat, l.lng, radius(location_area(l.entity_count)));
-//
-//                            var marker = new google.maps.Marker({
-//                                map: map,
-//                                position: new google.maps.LatLng(l.lat, l.lng)
-//                            });
-//
-//                            var infoWindow = new Brooklyn.gmaps.ListInfoWindow(l, map, marker);
-//
-//                            circle.bindTo('center', marker, 'position');
-//
-//                            newLocs[id] = {circle: circle,
-//                                           marker: marker,
-//                                           infoWindow: infoWindow};
-//                        }
-//                    }
-//
-//                    for (id in locationMarkers) {
-//                        if (! newLocs[id]) {
-//                            // location has been removed
-//                            lm = locationMarkers[id];
-//                            lm.circle.setMap(null);
-//                            lm.marker.setMap(null);
-//                            lm.infoWindow.getInfoWindow().setMap(null);
-//                        }
-//                    }
-//                    locationMarkers = newLocs;
-//                }
-
-            }
-            
-            return local;
-        }
-        
-);

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/js/view/ha-summary.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/js/view/ha-summary.js b/brooklyn-ui/src/main/webapp/assets/js/view/ha-summary.js
deleted file mode 100644
index 250977e..0000000
--- a/brooklyn-ui/src/main/webapp/assets/js/view/ha-summary.js
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-define([
-    "jquery", "underscore", "backbone", "moment", "view/viewutils",
-    "model/server-extended-status",
-    "text!tpl/home/ha-summary.html"
-], function ($, _, Backbone, moment, ViewUtils, serverStatus, HASummaryHtml) {
-
-    var template = _.template(HASummaryHtml);
-    var nodeRowTemplate = _.template(
-        "<tr>" +
-            "<td>" +
-                "<% if (nodeUri && !isTerminated) { %><a href='<%= nodeUri %>'><%= nodeId %></a><% } else { %><%= nodeId %><%    } %>" +
-                "<% if (isSelf) { %><span class='pull-right badge badge-success'>this</span><% } %>" +
-            "</td>" +
-            "<td><% if (isPretendMaster) {%>EX-MASTER<%} else {%><%= status %><%} if (isStale) { %> (stale)<% } %></td>" +
-            "<td><%= timestampDisplayPrefix %><span class='timestamp' data-timestamp='<%= timestamp %>'><%= timestampDisplay %><span><%= timestampDisplaySuffix %></td>" +
-        "</tr>");
-    var noServers = "<tr><td colspan='3'><i>Failed to load data of servers</i></td></tr>";
-    var waitingServers = "<tr><td colspan='3'><i>Waiting on detail for servers...</i></td></tr>";
-
-    var HASummaryView = Backbone.View.extend({
-        initialize: function() {
-            _.bindAll(this);
-            this.updateTimestampCallback = setInterval(this.updateTimestamps, 1000);
-            this.listenTo(serverStatus, "change", this.renderNodeStatus);
-        },
-        beforeClose: function() {
-            clearInterval(this.updateTimestampCallback);
-            this.stopListening();
-        },
-        updateNow: function() {
-            serverStatus.fetch();
-        },
-        render: function() {
-            this.$el.html(template());
-            this.renderNodeStatus();
-            return this;
-        },
-        renderNodeStatus: function() {
-            var $target = this.$(".ha-summary-table-body");
-            if (!serverStatus.loaded) {
-                $target.html(waitingServers);
-                return;
-            }
-            
-            var serverHa = serverStatus.get("ha") || {};
-            var master = serverHa.masterId,
-                self = serverHa.ownId,
-                nodes = serverHa.nodes;
-                
-            // undefined check just in case server returns something odd
-            if (nodes == undefined || _.isEmpty(nodes)) {
-                $target.html(noServers);
-                return;
-            }
-            
-            $target.empty();
-            var masterTimestamp;
-            _.each(nodes, function (n) {
-                    if (n.nodeId == master && n.remoteTimestamp) {
-                        masterTimestamp = n.remoteTimestamp;
-                    }
-                });
-            
-            _.each(nodes, function (n) {
-                var node = _.clone(n);
-                node.timestampDisplayPrefix = "";
-                node.timestampDisplaySuffix = "";
-                if (node['remoteTimestamp']) {
-                    node.timestamp = node.remoteTimestamp;
-                } else {
-                    node.timestamp = node.localTimestamp;
-                    node.timestampDisplaySuffix = " (local)";
-                }
-                if (node.timestamp >= moment().utc() + 10*1000) {
-                    // if server reports time significantly in future, report this, with no timestampe
-                    node.timestampDisplayPrefix = "server clock in future by "+
-                        moment.duration(moment(node.timestamp).diff(moment())).humanize();
-                    node.timestamp = "";
-                    node.timestampDisplay = "";
-                } else {
-                    // else use timestamp
-                    if (node.timestamp >= moment().utc()) {
-                        // but if just a little bit in future, backdate to show "a few seconds ago"
-                        node.timestamp = moment().utc()-1;
-                    }
-                    node.timestampDisplay = moment(node.timestamp).fromNow();
-                }
-                
-                node.isSelf = node.nodeId == self;
-                node.isMaster = self == master;
-                if (node.status == "TERMINATED") {
-                    node.isTerminated = true;
-                    node.isPretendMaster = false;
-                    node.isStale = false;
-                } else {
-                    node.isTerminated = false;
-                    node.isPretendMaster = (!node.isMaster && node.status == "MASTER" && master != node.nodeId);
-                    node.isStale = (masterTimestamp && node.timestamp + 30*1000 < masterTimestamp);
-                }
-                 
-                $target.append(nodeRowTemplate(node));
-            });
-        },
-        updateTimestamps: function() {
-            this.$(".timestamp").each(function(index, t) {
-                t = $(t);
-                var timestamp = t.data("timestamp");
-                t.html(moment(timestamp).fromNow());
-            });
-        }
-    });
-
-    return HASummaryView;
-});
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/js/view/home.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/js/view/home.js b/brooklyn-ui/src/main/webapp/assets/js/view/home.js
deleted file mode 100644
index ae2ba3a..0000000
--- a/brooklyn-ui/src/main/webapp/assets/js/view/home.js
+++ /dev/null
@@ -1,245 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-/**
- * Renders the Applications page. From it we create all other application related views.
- */
-
-define([
-    "jquery", "underscore", "backbone",
-    "view/viewutils", 
-    "view/application-add-wizard",
-    "view/ha-summary",
-    "model/location",
-    "text!tpl/home/applications.html",
-    "text!tpl/home/summaries.html",
-    "text!tpl/home/app-entry.html",
-    "bootstrap", "brooklyn-utils"
-], function ($, _, Backbone, ViewUtils,
-        AppAddWizard, HASummary, Location,
-        ApplicationsHtml, HomeSummariesHtml, AppEntryHtml) {
-
-    var HomeView = Backbone.View.extend({
-        tagName:"div",
-        events:{
-            'click #add-new-application':'createApplication',
-            'click #reload-brooklyn-properties': 'reloadBrooklynProperties',
-            'click #clear-ha-node-records': 'clearHaNodeRecords',
-            'click .addApplication':'createApplication'
-        },
-        
-        initialize:function () {
-            var that = this
-            this.$el.html(_.template(ApplicationsHtml, {} ))
-            $(".nav1").removeClass("active");
-            $(".nav1_home").addClass("active");
-            this._appViews = {}
-            this.summariesView = new HomeView.HomeSummariesView({
-                applications:this.collection,
-                locations:this.options.locations
-            })
-            this.collection.on('reset', this.render, this)
-            this.options.locations.on('reset', this.renderSummaries, this)
-
-            ViewUtils.fetchRepeatedlyWithDelay(this, this.collection, 
-                    { fetchOptions: { reset: true }, doitnow: true, 
-                    /* max is short here so the console becomes usable quickly */
-                    backoffMaxPeriod: 10*1000 });
-            ViewUtils.fetchRepeatedlyWithDelay(this, this.options.locations, { fetchOptions: { reset: true }, doitnow: true });
-
-            var id = $(this.$el).find("#circles-map");
-            if (this.options.offline) {
-                id.find("#circles-map-message").html("(map off in offline mode)");
-            } else {
-                requirejs(["googlemaps"], function (GoogleMaps) {
-                    _.defer( function() {
-                        log("loading google maps")
-                        var map = GoogleMaps.addMapToCanvas(id[0], 0, 0, 1);
-                        var locatedLocations = new Location.UsageLocated()
-                        // googlemaps.js isn't re-loaded during tab-to-tab navigation so we need to reset it each time
-                        // the maps is re-drawn to reset the cached set of location markers
-                        GoogleMaps.resetCircles()
-                        that.updateCircles(that, locatedLocations, GoogleMaps, map)
-                        that.callPeriodically("circles", function() {
-                            that.updateCircles(that, locatedLocations, GoogleMaps, map)
-                        }, 10000)
-                    })
-                }, function (error) {
-                        id.find("#circles-map-message").html("(map not available)"); 
-                });
-            }            
-        },
-        
-        updateCircles: function(that, locatedLocations, GoogleMaps, map) {
-            locatedLocations.fetch({success:function() {
-                GoogleMaps.drawCircles(map, locatedLocations.attributes)
-            }})
-        },
-        
-        // cleaning code goes here
-        beforeClose:function () {
-            this.haSummaryView.close();
-            this.collection.off("reset", this.render)
-            this.options.locations.off("reset", this.renderSummaries)
-            _.invoke(this._appViews, "close");
-            this._appViews = null
-        },
-
-        render:function () {
-            this.renderSummaries();
-            this.renderCollection();
-            this.renderHighAvailabilitySummary();
-            return this;
-        },
-
-        renderSummaries:function () {
-            this.$('.home-summaries-row').html(this.summariesView.render().el )
-        },
-
-        renderHighAvailabilitySummary: function() {
-            // The HA view handles updates itself.
-            if (!this.haSummaryView)
-                this.haSummaryView = new HASummary({ el: this.$("#ha-summary") }).render();
-        },
-        
-        renderCollection:function () {
-            var $tableBody = this.$('#applications-table-body').empty()
-            if (this.collection==null)
-                $tableBody.append("<tr><td colspan='3'><i>No data available</i></td></tr>");
-            else if (this.collection.isEmpty())
-                $tableBody.append("<tr><td colspan='3'><i>No applications deployed</i></td></tr>");
-            else this.collection.each(function (app) {
-                var appView = new HomeView.AppEntryView({model:app})
-                if (this._appViews[app.cid]) {
-                    // if the application has a view destroy it
-                    this._appViews[app.cid].close()
-                }
-                this._appViews[app.cid] = appView
-                $tableBody.append(appView.render().el)
-            }, this)
-        },
-
-        createApplication:function () {
-            if (this._modal) {
-                this._modal.close()
-            }
-            var that = this;
-            if (this.options.offline || (this.options.cautionOverlay && this.options.cautionOverlay.warningActive)) {
-                // don't show wizard
-            } else {
-                var wizard = new AppAddWizard({appRouter:this.options.appRouter})
-                this._modal = wizard
-                this.$(".add-app #modal-container").html(wizard.render().el)
-                this.$(".add-app #modal-container .modal")
-                    .on("hidden",function () {
-                        wizard.close()
-                        that.collection.fetch({reset:true});
-                    }).modal('show')
-            }
-        },
-
-        reloadBrooklynProperties: function() {
-            var self = this;
-            // indicate submitted
-            self.$('#reload-brooklyn-properties-indicator').show();
-            $.ajax({
-                type: "POST",
-                url: "/v1/server/properties/reload",
-                contentType: "application/json",
-                success: function() {
-                    console.log("reloaded brooklyn properties");
-                    self.options.locations.fetch();
-                    // clear submitted indicator
-                    setTimeout(function() { self.$('#reload-brooklyn-properties-indicator').hide(); }, 250);
-                },
-                error: function(data) {
-                    // TODO render the error better than poor-man's flashing
-                    // (would just be connection error -- with timeout=0 we get a task even for invalid input)
-                    self.$el.fadeTo(100,1).delay(200).fadeTo(200,0.2).delay(200).fadeTo(200,1);
-                    self.$('#reload-brooklyn-properties-indicator').hide();
-                    console.error("ERROR reloading brooklyn properties");
-                    console.debug(data);
-                }
-            });
-        },
-        
-        clearHaNodeRecords: function() {
-            var self = this;
-            // indicate submitted
-            self.$('#clear-ha-node-records-indicator').show();
-            $.ajax({
-                type: "POST",
-                url: "/v1/server/ha/states/clear",
-                contentType: "application/json",
-                success: function() {
-                    console.log("cleared HA node records");
-                    self.haSummaryView.updateNow();
-                    // clear submitted indicator
-                    setTimeout(function() { self.$('#clear-ha-node-records-indicator').hide(); }, 250);
-                },
-                error: function(data) {
-                    // TODO render the error better than poor-man's flashing
-                    // (would just be connection error -- with timeout=0 we get a task even for invalid input)
-                    self.$el.fadeTo(100,1).delay(200).fadeTo(200,0.2).delay(200).fadeTo(200,1);
-                    self.$('#clear-ha-node-records-indicator').hide();
-                    console.error("ERROR clearing HA nodes");
-                    console.debug(data);
-                }
-            });
-        }
-    })
-
-    HomeView.HomeSummariesView = Backbone.View.extend({
-        tagName:'div',
-        template:_.template(HomeSummariesHtml),
-        // no listening needed here; it's done by outer class
-        render:function () {
-            this.$el.html(this.template({
-                apps:this.options.applications,
-                locations:this.options.locations
-            }))
-            return this
-        },
-    })
-    
-    HomeView.AppEntryView = Backbone.View.extend({
-        tagName:'tr',
-
-        template:_.template(AppEntryHtml),
-
-        initialize:function () {
-            this.model.on('change', this.render, this)
-            this.model.on('destroy', this.close, this)
-        },
-        render:function () {
-            this.$el.html(this.template({
-                cid:this.model.cid,
-                link:this.model.getLinkByName("self"),
-                name:this.model.getSpec().get("name"),
-                status:this.model.get("status")
-            }))
-            return this
-        },
-        beforeClose:function () {
-            this.off("change", this.render)
-            this.off("destroy", this.close)
-        }
-    })
-
-    return HomeView
-})

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/js/view/policy-config-invoke.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/js/view/policy-config-invoke.js b/brooklyn-ui/src/main/webapp/assets/js/view/policy-config-invoke.js
deleted file mode 100644
index 36b5d9f..0000000
--- a/brooklyn-ui/src/main/webapp/assets/js/view/policy-config-invoke.js
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-/**
- * Render a policy configuration key as a modal for reconfiguring.
- */
-define([
-    "underscore", "jquery", "backbone",
-    "text!tpl/apps/policy-parameter-config.html",
-    "bootstrap"
-], function (_, $, Backbone, PolicyParameterConfigHtml) {
-
-    var PolicyConfigInvokeView = Backbone.View.extend({
-        template: _.template(PolicyParameterConfigHtml),
-
-        initialize: function () {
-            _.bindAll(this);
-        },
-
-        render: function () {
-            this.$el.html(this.template({
-                name: this.model.get("name"),
-                description: this.model.get("description"),
-                type: this.model.get("type"),
-                value: this.options.currentValue || "",
-                policyName: this.options.policy.get("name")
-            }));
-            return this;
-        },
-
-        onSubmit: function () {
-            var that = this,
-                url = that.model.getLinkByName("self"),
-                val = that.$("#policy-config-value").val();
-            try {
-                JSON.parse(val);
-            } catch (e) {
-                // ignore error, it's just unparseable, so put it in a string
-                val = JSON.stringify(val);
-            }
-            return $.ajax({
-                type: "POST",
-                url: url,
-                contentType:"application/json",
-                data: val
-            }).fail(function(response) {
-                var message = JSON.parse(response.responseText).message;
-                that.showError(message);
-            });
-        },
-
-        showError: function (message) {
-            this.$(".policy-add-error-container").removeClass("hide");
-            this.$(".policy-add-error-message").html(message);
-        },
-
-        title: function () {
-            return "Reconfigure " + this.options.policy.get("name");
-        }
-    });
-    return PolicyConfigInvokeView;
-});

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/js/view/policy-new.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/js/view/policy-new.js b/brooklyn-ui/src/main/webapp/assets/js/view/policy-new.js
deleted file mode 100644
index c190f78..0000000
--- a/brooklyn-ui/src/main/webapp/assets/js/view/policy-new.js
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-/**
- * Render a policy configuration key as a modal for reconfiguring.
- */
-define([
-    "jquery", "underscore", "backbone", "brooklyn",
-    "text!tpl/apps/policy-new.html"
-], function ($, _, Backbone, Brooklyn, NewPolicyHtml) {
-
-    return Backbone.View.extend({
-        template: _.template(NewPolicyHtml),
-
-        initialize: function () {
-            if (!this.options.entity) {
-                throw new Error("NewPolicy view requires entity to know where to post result");
-            }
-            this.title = "Attach New Policy to "+this.options.entity.get('name');
-        },
-
-        render: function() {
-            this.$el.html(this.template);
-            this.configKeyView = new Brooklyn.view.ConfigKeyInputPairList();
-            this.$(".policy-add-config-keys").html(this.configKeyView.render().$el);
-            return this;
-        },
-
-        beforeClose: function() {
-            if (this.configKeyView) {
-                this.configKeyView.close();
-            }
-        },
-
-        onSubmit: function (event) {
-            var type = this.$("#policy-add-type").val();
-            var config = this.configKeyView.getConfigKeys();
-            console.log("type", type, "config", config);
-            // Required because request isn't handled correctly if the map is empty.
-            // See comments on PolicyApi.addPolicy for details.
-            if (_.isEmpty(config)) {
-                config["___d_dummy"] = "dummyval";
-            }
-            var url = this.options.entity.get("links").policies + "/?type=" + type;
-            var self = this;
-            var ajax = $.ajax({
-                url: url,
-                type: "post",
-                data: JSON.stringify(config),
-                contentType: "application/json"
-            }).fail(function (response) {
-                var message = JSON.parse(response.responseText).message;
-                self.showError(message);
-            });
-            if (_.isFunction(this.options.onSave)) {
-                ajax.done(this.options.onSave);
-            }
-            return ajax;
-        },
-
-        showError: function (message) {
-            this.$(".policy-add-error-container").removeClass("hide");
-            this.$(".policy-add-error-message").html(message);
-        }
-    });
-
-});
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/js/view/script-groovy.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/js/view/script-groovy.js b/brooklyn-ui/src/main/webapp/assets/js/view/script-groovy.js
deleted file mode 100644
index 045e4f1..0000000
--- a/brooklyn-ui/src/main/webapp/assets/js/view/script-groovy.js
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-define([
-    "underscore", "jquery", "backbone",
-    "view/viewutils",
-    "text!tpl/script/groovy.html", 
-    
-    "jquery-slideto",
-    "jquery-wiggle",
-    "jquery-ba-bbq",
-    "handlebars",
-    "bootstrap"
-], function (_, $, Backbone, ViewUtils, GroovyHtml) {
-
-    var ScriptGroovyView = Backbone.View.extend({
-        tagName:"div",
-        events:{
-            "click #groovy-ui-container #submit":"submitScript",
-            "click #load-example":"loadExample"
-        },
-        className:"container container-fluid",
-        groovyTemplate:_.template(GroovyHtml),
-
-        initialize:function () {
-            this.reset();
-        },
-        reset: function() {
-            this.$el.html(_.template(GroovyHtml, {}))
-            $(".output", this.$el).hide()
-            $(".output .toggler-region", this.$el).hide()
-            ViewUtils.attachToggler(this.$el)
-        },
-        render:function (eventName) {
-            return this
-        },
-        loadExample: function() {
-            $(".input textarea").val(
-                    'import static org.apache.brooklyn.entity.software.base.Entities.*\n'+
-                    '\n'+
-                    'println "Last result: "+last\n'+
-                    'data.exampleRunCount = (data.exampleRunCount ?: 0) + 1\n'+
-                    'println "Example run count: ${data.exampleRunCount}"\n'+
-                    '\n'+
-                    'println "Application count: ${mgmt.applications.size()}\\n"\n'+
-                    '\n'+
-                    'mgmt.applications.each { dumpInfo(it) }\n'+
-                    '\n'+
-                    'return mgmt.applications\n')
-        },
-        updateTextareaWithData: function($div, data, alwaysShow) {
-            ViewUtils.updateTextareaWithData($div, data, alwaysShow, 50, 350) 
-        },
-        submitScript: function() {
-            var that = this;
-            var script = $("#groovy-ui-container #script").val()
-            $(".output .toggler-region", this.$el).hide()
-            $(".output .throbber", this.$el).show()
-            $(".output", this.$el).show()
-            that.updateTextareaWithData($(".output .result"), undefined, false, false);
-            that.updateTextareaWithData($(".output .error"), undefined, false, false);
-            that.updateTextareaWithData($(".output .stdout"), undefined, false, false);
-            that.updateTextareaWithData($(".output .stderr"), undefined, false, false);
-            $.ajax({
-                type:"POST",
-                url:"/v1/script/groovy",
-                data:script,
-                contentType:"application/text",
-                headers: { "Brooklyn-Allow-Non-Master-Access": true },
-                success:function (data) {
-                    $(".output .throbber", that.$el).hide()
-                    that.updateTextareaWithData($(".output .result"), data.result, true, true);
-                    that.updateTextareaWithData($(".output .error"), data.problem, false, true);
-                    that.updateTextareaWithData($(".output .stdout"), data.stdout, false, true);
-                    that.updateTextareaWithData($(".output .stderr"), data.stderr, false, true);
-                },
-                error: function(data) {
-                    $(".output .throbber", that.$el).hide()
-                    $("#groovy-ui-container div.error").val("ERROR: "+data)
-                    $(".output .error").show()
-                    
-                    console.error("ERROR submitting groovy script")
-                    console.debug(data)
-                }})
-        }
-        
-    })
-    
-    return ScriptGroovyView
-})


[10/51] [abbrv] [partial] brooklyn-ui git commit: move subdir from incubator up a level as it is promoted to its own repo (first non-incubator commit!)

Posted by he...@apache.org.
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/js/libs/jquery.form.js
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/js/libs/jquery.form.js b/src/main/webapp/assets/js/libs/jquery.form.js
new file mode 100644
index 0000000..796db12
--- /dev/null
+++ b/src/main/webapp/assets/js/libs/jquery.form.js
@@ -0,0 +1,1076 @@
+/*!
+ * jQuery Form Plugin
+ * version: 3.09 (16-APR-2012)
+ * @requires jQuery v1.3.2 or later
+ *
+ * Examples and documentation at: http://malsup.com/jquery/form/
+ * Project repository: https://github.com/malsup/form
+ * Dual licensed under the MIT and GPL licenses:
+ *    http://malsup.github.com/mit-license.txt
+ *    http://malsup.github.com/gpl-license-v2.txt
+ */
+/*global ActiveXObject alert */
+;(function($) {
+"use strict";
+
+/*
+    Usage Note:
+    -----------
+    Do not use both ajaxSubmit and ajaxForm on the same form.  These
+    functions are mutually exclusive.  Use ajaxSubmit if you want
+    to bind your own submit handler to the form.  For example,
+
+    $(document).ready(function() {
+        $('#myForm').on('submit', function(e) {
+            e.preventDefault(); // <-- important
+            $(this).ajaxSubmit({
+                target: '#output'
+            });
+        });
+    });
+
+    Use ajaxForm when you want the plugin to manage all the event binding
+    for you.  For example,
+
+    $(document).ready(function() {
+        $('#myForm').ajaxForm({
+            target: '#output'
+        });
+    });
+    
+    You can also use ajaxForm with delegation (requires jQuery v1.7+), so the
+    form does not have to exist when you invoke ajaxForm:
+
+    $('#myForm').ajaxForm({
+        delegation: true,
+        target: '#output'
+    });
+    
+    When using ajaxForm, the ajaxSubmit function will be invoked for you
+    at the appropriate time.
+*/
+
+/**
+ * Feature detection
+ */
+var feature = {};
+feature.fileapi = $("<input type='file'/>").get(0).files !== undefined;
+feature.formdata = window.FormData !== undefined;
+
+/**
+ * ajaxSubmit() provides a mechanism for immediately submitting
+ * an HTML form using AJAX.
+ */
+$.fn.ajaxSubmit = function(options) {
+    /*jshint scripturl:true */
+
+    // fast fail if nothing selected (http://dev.jquery.com/ticket/2752)
+    if (!this.length) {
+        log('ajaxSubmit: skipping submit process - no element selected');
+        return this;
+    }
+    
+    var method, action, url, $form = this;
+
+    if (typeof options == 'function') {
+        options = { success: options };
+    }
+
+    method = this.attr('method');
+    action = this.attr('action');
+    url = (typeof action === 'string') ? $.trim(action) : '';
+    url = url || window.location.href || '';
+    if (url) {
+        // clean url (don't include hash vaue)
+        url = (url.match(/^([^#]+)/)||[])[1];
+    }
+
+    options = $.extend(true, {
+        url:  url,
+        success: $.ajaxSettings.success,
+        type: method || 'GET',
+        iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank'
+    }, options);
+
+    // hook for manipulating the form data before it is extracted;
+    // convenient for use with rich editors like tinyMCE or FCKEditor
+    var veto = {};
+    this.trigger('form-pre-serialize', [this, options, veto]);
+    if (veto.veto) {
+        log('ajaxSubmit: submit vetoed via form-pre-serialize trigger');
+        return this;
+    }
+
+    // provide opportunity to alter form data before it is serialized
+    if (options.beforeSerialize && options.beforeSerialize(this, options) === false) {
+        log('ajaxSubmit: submit aborted via beforeSerialize callback');
+        return this;
+    }
+
+    var traditional = options.traditional;
+    if ( traditional === undefined ) {
+        traditional = $.ajaxSettings.traditional;
+    }
+    
+    var elements = [];
+    var qx, a = this.formToArray(options.semantic, elements);
+    if (options.data) {
+        options.extraData = options.data;
+        qx = $.param(options.data, traditional);
+    }
+
+    // give pre-submit callback an opportunity to abort the submit
+    if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) {
+        log('ajaxSubmit: submit aborted via beforeSubmit callback');
+        return this;
+    }
+
+    // fire vetoable 'validate' event
+    this.trigger('form-submit-validate', [a, this, options, veto]);
+    if (veto.veto) {
+        log('ajaxSubmit: submit vetoed via form-submit-validate trigger');
+        return this;
+    }
+
+    var q = $.param(a, traditional);
+    if (qx) {
+        q = ( q ? (q + '&' + qx) : qx );
+    }    
+    if (options.type.toUpperCase() == 'GET') {
+        options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q;
+        options.data = null;  // data is null for 'get'
+    }
+    else {
+        options.data = q; // data is the query string for 'post'
+    }
+
+    var callbacks = [];
+    if (options.resetForm) {
+        callbacks.push(function() { $form.resetForm(); });
+    }
+    if (options.clearForm) {
+        callbacks.push(function() { $form.clearForm(options.includeHidden); });
+    }
+
+    // perform a load on the target only if dataType is not provided
+    if (!options.dataType && options.target) {
+        var oldSuccess = options.success || function(){};
+        callbacks.push(function(data) {
+            var fn = options.replaceTarget ? 'replaceWith' : 'html';
+            $(options.target)[fn](data).each(oldSuccess, arguments);
+        });
+    }
+    else if (options.success) {
+        callbacks.push(options.success);
+    }
+
+    options.success = function(data, status, xhr) { // jQuery 1.4+ passes xhr as 3rd arg
+        var context = options.context || options;    // jQuery 1.4+ supports scope context 
+        for (var i=0, max=callbacks.length; i < max; i++) {
+            callbacks[i].apply(context, [data, status, xhr || $form, $form]);
+        }
+    };
+
+    // are there files to upload?
+    var fileInputs = $('input:file:enabled[value]', this); // [value] (issue #113)
+    var hasFileInputs = fileInputs.length > 0;
+    var mp = 'multipart/form-data';
+    var multipart = ($form.attr('enctype') == mp || $form.attr('encoding') == mp);
+
+    var fileAPI = feature.fileapi && feature.formdata;
+    log("fileAPI :" + fileAPI);
+    var shouldUseFrame = (hasFileInputs || multipart) && !fileAPI;
+
+    // options.iframe allows user to force iframe mode
+    // 06-NOV-09: now defaulting to iframe mode if file input is detected
+    if (options.iframe !== false && (options.iframe || shouldUseFrame)) {
+        // hack to fix Safari hang (thanks to Tim Molendijk for this)
+        // see:  http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d
+        if (options.closeKeepAlive) {
+            $.get(options.closeKeepAlive, function() {
+                fileUploadIframe(a);
+            });
+        }
+          else {
+            fileUploadIframe(a);
+          }
+    }
+    else if ((hasFileInputs || multipart) && fileAPI) {
+        fileUploadXhr(a);
+    }
+    else {
+        $.ajax(options);
+    }
+
+    // clear element array
+    for (var k=0; k < elements.length; k++)
+        elements[k] = null;
+
+    // fire 'notify' event
+    this.trigger('form-submit-notify', [this, options]);
+    return this;
+
+     // XMLHttpRequest Level 2 file uploads (big hat tip to francois2metz)
+    function fileUploadXhr(a) {
+        var formdata = new FormData();
+
+        for (var i=0; i < a.length; i++) {
+            formdata.append(a[i].name, a[i].value);
+        }
+
+        if (options.extraData) {
+            for (var p in options.extraData)
+                if (options.extraData.hasOwnProperty(p))
+                    formdata.append(p, options.extraData[p]);
+        }
+
+        options.data = null;
+
+        var s = $.extend(true, {}, $.ajaxSettings, options, {
+            contentType: false,
+            processData: false,
+            cache: false,
+            type: 'POST'
+        });
+        
+        if (options.uploadProgress) {
+            // workaround because jqXHR does not expose upload property
+            s.xhr = function() {
+                var xhr = jQuery.ajaxSettings.xhr();
+                if (xhr.upload) {
+                    xhr.upload.onprogress = function(event) {
+                        var percent = 0;
+                        var position = event.loaded || event.position; /*event.position is deprecated*/
+                        var total = event.total;
+                        if (event.lengthComputable) {
+                            percent = Math.ceil(position / total * 100);
+                        }
+                        options.uploadProgress(event, position, total, percent);
+                    };
+                }
+                return xhr;
+            };
+        }
+
+        s.data = null;
+          var beforeSend = s.beforeSend;
+          s.beforeSend = function(xhr, o) {
+              o.data = formdata;
+            if(beforeSend)
+                beforeSend.call(o, xhr, options);
+        };
+        $.ajax(s);
+    }
+
+    // private function for handling file uploads (hat tip to YAHOO!)
+    function fileUploadIframe(a) {
+        var form = $form[0], el, i, s, g, id, $io, io, xhr, sub, n, timedOut, timeoutHandle;
+        var useProp = !!$.fn.prop;
+
+        if ($(':input[name=submit],:input[id=submit]', form).length) {
+            // if there is an input with a name or id of 'submit' then we won't be
+            // able to invoke the submit fn on the form (at least not x-browser)
+            alert('Error: Form elements must not have name or id of "submit".');
+            return;
+        }
+        
+        if (a) {
+            // ensure that every serialized input is still enabled
+            for (i=0; i < elements.length; i++) {
+                el = $(elements[i]);
+                if ( useProp )
+                    el.prop('disabled', false);
+                else
+                    el.removeAttr('disabled');
+            }
+        }
+
+        s = $.extend(true, {}, $.ajaxSettings, options);
+        s.context = s.context || s;
+        id = 'jqFormIO' + (new Date().getTime());
+        if (s.iframeTarget) {
+            $io = $(s.iframeTarget);
+            n = $io.attr('name');
+            if (!n)
+                 $io.attr('name', id);
+            else
+                id = n;
+        }
+        else {
+            $io = $('<iframe name="' + id + '" src="'+ s.iframeSrc +'" />');
+            $io.css({ position: 'absolute', top: '-1000px', left: '-1000px' });
+        }
+        io = $io[0];
+
+
+        xhr = { // mock object
+            aborted: 0,
+            responseText: null,
+            responseXML: null,
+            status: 0,
+            statusText: 'n/a',
+            getAllResponseHeaders: function() {},
+            getResponseHeader: function() {},
+            setRequestHeader: function() {},
+            abort: function(status) {
+                var e = (status === 'timeout' ? 'timeout' : 'aborted');
+                log('aborting upload... ' + e);
+                this.aborted = 1;
+                $io.attr('src', s.iframeSrc); // abort op in progress
+                xhr.error = e;
+                if (s.error)
+                    s.error.call(s.context, xhr, e, status);
+                if (g)
+                    $.event.trigger("ajaxError", [xhr, s, e]);
+                if (s.complete)
+                    s.complete.call(s.context, xhr, e);
+            }
+        };
+
+        g = s.global;
+        // trigger ajax global events so that activity/block indicators work like normal
+        if (g && 0 === $.active++) {
+            $.event.trigger("ajaxStart");
+        }
+        if (g) {
+            $.event.trigger("ajaxSend", [xhr, s]);
+        }
+
+        if (s.beforeSend && s.beforeSend.call(s.context, xhr, s) === false) {
+            if (s.global) {
+                $.active--;
+            }
+            return;
+        }
+        if (xhr.aborted) {
+            return;
+        }
+
+        // add submitting element to data if we know it
+        sub = form.clk;
+        if (sub) {
+            n = sub.name;
+            if (n && !sub.disabled) {
+                s.extraData = s.extraData || {};
+                s.extraData[n] = sub.value;
+                if (sub.type == "image") {
+                    s.extraData[n+'.x'] = form.clk_x;
+                    s.extraData[n+'.y'] = form.clk_y;
+                }
+            }
+        }
+        
+        var CLIENT_TIMEOUT_ABORT = 1;
+        var SERVER_ABORT = 2;
+
+        function getDoc(frame) {
+            var doc = frame.contentWindow ? frame.contentWindow.document : frame.contentDocument ? frame.contentDocument : frame.document;
+            return doc;
+        }
+        
+        // Rails CSRF hack (thanks to Yvan Barthelemy)
+        var csrf_token = $('meta[name=csrf-token]').attr('content');
+        var csrf_param = $('meta[name=csrf-param]').attr('content');
+        if (csrf_param && csrf_token) {
+            s.extraData = s.extraData || {};
+            s.extraData[csrf_param] = csrf_token;
+        }
+
+        // take a breath so that pending repaints get some cpu time before the upload starts
+        function doSubmit() {
+            // make sure form attrs are set
+            var t = $form.attr('target'), a = $form.attr('action');
+
+            // update form attrs in IE friendly way
+            form.setAttribute('target',id);
+            if (!method) {
+                form.setAttribute('method', 'POST');
+            }
+            if (a != s.url) {
+                form.setAttribute('action', s.url);
+            }
+
+            // ie borks in some cases when setting encoding
+            if (! s.skipEncodingOverride && (!method || /post/i.test(method))) {
+                $form.attr({
+                    encoding: 'multipart/form-data',
+                    enctype:  'multipart/form-data'
+                });
+            }
+
+            // support timout
+            if (s.timeout) {
+                timeoutHandle = setTimeout(function() { timedOut = true; cb(CLIENT_TIMEOUT_ABORT); }, s.timeout);
+            }
+            
+            // look for server aborts
+            function checkState() {
+                try {
+                    var state = getDoc(io).readyState;
+                    log('state = ' + state);
+                    if (state && state.toLowerCase() == 'uninitialized')
+                        setTimeout(checkState,50);
+                }
+                catch(e) {
+                    log('Server abort: ' , e, ' (', e.name, ')');
+                    cb(SERVER_ABORT);
+                    if (timeoutHandle)
+                        clearTimeout(timeoutHandle);
+                    timeoutHandle = undefined;
+                }
+            }
+
+            // add "extra" data to form if provided in options
+            var extraInputs = [];
+            try {
+                if (s.extraData) {
+                    for (var n in s.extraData) {
+                        if (s.extraData.hasOwnProperty(n)) {
+                            extraInputs.push(
+                                $('<input type="hidden" name="'+n+'">').attr('value',s.extraData[n])
+                                    .appendTo(form)[0]);
+                        }
+                    }
+                }
+
+                if (!s.iframeTarget) {
+                    // add iframe to doc and submit the form
+                    $io.appendTo('body');
+                    if (io.attachEvent)
+                        io.attachEvent('onload', cb);
+                    else
+                        io.addEventListener('load', cb, false);
+                }
+                setTimeout(checkState,15);
+                form.submit();
+            }
+            finally {
+                // reset attrs and remove "extra" input elements
+                form.setAttribute('action',a);
+                if(t) {
+                    form.setAttribute('target', t);
+                } else {
+                    $form.removeAttr('target');
+                }
+                $(extraInputs).remove();
+            }
+        }
+
+        if (s.forceSync) {
+            doSubmit();
+        }
+        else {
+            setTimeout(doSubmit, 10); // this lets dom updates render
+        }
+
+        var data, doc, domCheckCount = 50, callbackProcessed;
+
+        function cb(e) {
+            if (xhr.aborted || callbackProcessed) {
+                return;
+            }
+            try {
+                doc = getDoc(io);
+            }
+            catch(ex) {
+                log('cannot access response document: ', ex);
+                e = SERVER_ABORT;
+            }
+            if (e === CLIENT_TIMEOUT_ABORT && xhr) {
+                xhr.abort('timeout');
+                return;
+            }
+            else if (e == SERVER_ABORT && xhr) {
+                xhr.abort('server abort');
+                return;
+            }
+
+            if (!doc || doc.location.href == s.iframeSrc) {
+                // response not received yet
+                if (!timedOut)
+                    return;
+            }
+            if (io.detachEvent)
+                io.detachEvent('onload', cb);
+            else    
+                io.removeEventListener('load', cb, false);
+
+            var status = 'success', errMsg;
+            try {
+                if (timedOut) {
+                    throw 'timeout';
+                }
+
+                var isXml = s.dataType == 'xml' || doc.XMLDocument || $.isXMLDoc(doc);
+                log('isXml='+isXml);
+                if (!isXml && window.opera && (doc.body === null || !doc.body.innerHTML)) {
+                    if (--domCheckCount) {
+                        // in some browsers (Opera) the iframe DOM is not always traversable when
+                        // the onload callback fires, so we loop a bit to accommodate
+                        log('requeing onLoad callback, DOM not available');
+                        setTimeout(cb, 250);
+                        return;
+                    }
+                    // let this fall through because server response could be an empty document
+                    //log('Could not access iframe DOM after mutiple tries.');
+                    //throw 'DOMException: not available';
+                }
+
+                //log('response detected');
+                var docRoot = doc.body ? doc.body : doc.documentElement;
+                xhr.responseText = docRoot ? docRoot.innerHTML : null;
+                xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc;
+                if (isXml)
+                    s.dataType = 'xml';
+                xhr.getResponseHeader = function(header){
+                    var headers = {'content-type': s.dataType};
+                    return headers[header];
+                };
+                // support for XHR 'status' & 'statusText' emulation :
+                if (docRoot) {
+                    xhr.status = Number( docRoot.getAttribute('status') ) || xhr.status;
+                    xhr.statusText = docRoot.getAttribute('statusText') || xhr.statusText;
+                }
+
+                var dt = (s.dataType || '').toLowerCase();
+                var scr = /(json|script|text)/.test(dt);
+                if (scr || s.textarea) {
+                    // see if user embedded response in textarea
+                    var ta = doc.getElementsByTagName('textarea')[0];
+                    if (ta) {
+                        xhr.responseText = ta.value;
+                        // support for XHR 'status' & 'statusText' emulation :
+                        xhr.status = Number( ta.getAttribute('status') ) || xhr.status;
+                        xhr.statusText = ta.getAttribute('statusText') || xhr.statusText;
+                    }
+                    else if (scr) {
+                        // account for browsers injecting pre around json response
+                        var pre = doc.getElementsByTagName('pre')[0];
+                        var b = doc.getElementsByTagName('body')[0];
+                        if (pre) {
+                            xhr.responseText = pre.textContent ? pre.textContent : pre.innerText;
+                        }
+                        else if (b) {
+                            xhr.responseText = b.textContent ? b.textContent : b.innerText;
+                        }
+                    }
+                }
+                else if (dt == 'xml' && !xhr.responseXML && xhr.responseText) {
+                    xhr.responseXML = toXml(xhr.responseText);
+                }
+
+                try {
+                    data = httpData(xhr, dt, s);
+                }
+                catch (e) {
+                    status = 'parsererror';
+                    xhr.error = errMsg = (e || status);
+                }
+            }
+            catch (e) {
+                log('error caught: ',e);
+                status = 'error';
+                xhr.error = errMsg = (e || status);
+            }
+
+            if (xhr.aborted) {
+                log('upload aborted');
+                status = null;
+            }
+
+            if (xhr.status) { // we've set xhr.status
+                status = (xhr.status >= 200 && xhr.status < 300 || xhr.status === 304) ? 'success' : 'error';
+            }
+
+            // ordering of these callbacks/triggers is odd, but that's how $.ajax does it
+            if (status === 'success') {
+                if (s.success)
+                    s.success.call(s.context, data, 'success', xhr);
+                if (g)
+                    $.event.trigger("ajaxSuccess", [xhr, s]);
+            }
+            else if (status) {
+                if (errMsg === undefined)
+                    errMsg = xhr.statusText;
+                if (s.error)
+                    s.error.call(s.context, xhr, status, errMsg);
+                if (g)
+                    $.event.trigger("ajaxError", [xhr, s, errMsg]);
+            }
+
+            if (g)
+                $.event.trigger("ajaxComplete", [xhr, s]);
+
+            if (g && ! --$.active) {
+                $.event.trigger("ajaxStop");
+            }
+
+            if (s.complete)
+                s.complete.call(s.context, xhr, status);
+
+            callbackProcessed = true;
+            if (s.timeout)
+                clearTimeout(timeoutHandle);
+
+            // clean up
+            setTimeout(function() {
+                if (!s.iframeTarget)
+                    $io.remove();
+                xhr.responseXML = null;
+            }, 100);
+        }
+
+        var toXml = $.parseXML || function(s, doc) { // use parseXML if available (jQuery 1.5+)
+            if (window.ActiveXObject) {
+                doc = new ActiveXObject('Microsoft.XMLDOM');
+                doc.async = 'false';
+                doc.loadXML(s);
+            }
+            else {
+                doc = (new DOMParser()).parseFromString(s, 'text/xml');
+            }
+            return (doc && doc.documentElement && doc.documentElement.nodeName != 'parsererror') ? doc : null;
+        };
+        var parseJSON = $.parseJSON || function(s) {
+            /*jslint evil:true */
+            return window['eval']('(' + s + ')');
+        };
+
+        var httpData = function( xhr, type, s ) { // mostly lifted from jq1.4.4
+
+            var ct = xhr.getResponseHeader('content-type') || '',
+                xml = type === 'xml' || !type && ct.indexOf('xml') >= 0,
+                data = xml ? xhr.responseXML : xhr.responseText;
+
+            if (xml && data.documentElement.nodeName === 'parsererror') {
+                if ($.error)
+                    $.error('parsererror');
+            }
+            if (s && s.dataFilter) {
+                data = s.dataFilter(data, type);
+            }
+            if (typeof data === 'string') {
+                if (type === 'json' || !type && ct.indexOf('json') >= 0) {
+                    data = parseJSON(data);
+                } else if (type === "script" || !type && ct.indexOf("javascript") >= 0) {
+                    $.globalEval(data);
+                }
+            }
+            return data;
+        };
+    }
+};
+
+/**
+ * ajaxForm() provides a mechanism for fully automating form submission.
+ *
+ * The advantages of using this method instead of ajaxSubmit() are:
+ *
+ * 1: This method will include coordinates for <input type="image" /> elements (if the element
+ *    is used to submit the form).
+ * 2. This method will include the submit element's name/value data (for the element that was
+ *    used to submit the form).
+ * 3. This method binds the submit() method to the form for you.
+ *
+ * The options argument for ajaxForm works exactly as it does for ajaxSubmit.  ajaxForm merely
+ * passes the options argument along after properly binding events for submit elements and
+ * the form itself.
+ */
+$.fn.ajaxForm = function(options) {
+    options = options || {};
+    options.delegation = options.delegation && $.isFunction($.fn.on);
+    
+    // in jQuery 1.3+ we can fix mistakes with the ready state
+    if (!options.delegation && this.length === 0) {
+        var o = { s: this.selector, c: this.context };
+        if (!$.isReady && o.s) {
+            log('DOM not ready, queuing ajaxForm');
+            $(function() {
+                $(o.s,o.c).ajaxForm(options);
+            });
+            return this;
+        }
+        // is your DOM ready?  http://docs.jquery.com/Tutorials:Introducing_$(document).ready()
+        log('terminating; zero elements found by selector' + ($.isReady ? '' : ' (DOM not ready)'));
+        return this;
+    }
+
+    if ( options.delegation ) {
+        $(document)
+            .off('submit.form-plugin', this.selector, doAjaxSubmit)
+            .off('click.form-plugin', this.selector, captureSubmittingElement)
+            .on('submit.form-plugin', this.selector, options, doAjaxSubmit)
+            .on('click.form-plugin', this.selector, options, captureSubmittingElement);
+        return this;
+    }
+
+    return this.ajaxFormUnbind()
+        .bind('submit.form-plugin', options, doAjaxSubmit)
+        .bind('click.form-plugin', options, captureSubmittingElement);
+};
+
+// private event handlers    
+function doAjaxSubmit(e) {
+    /*jshint validthis:true */
+    var options = e.data;
+    if (!e.isDefaultPrevented()) { // if event has been canceled, don't proceed
+        e.preventDefault();
+        $(this).ajaxSubmit(options);
+    }
+}
+    
+function captureSubmittingElement(e) {
+    /*jshint validthis:true */
+    var target = e.target;
+    var $el = $(target);
+    if (!($el.is(":submit,input:image"))) {
+        // is this a child element of the submit el?  (ex: a span within a button)
+        var t = $el.closest(':submit');
+        if (t.length === 0) {
+            return;
+        }
+        target = t[0];
+    }
+    var form = this;
+    form.clk = target;
+    if (target.type == 'image') {
+        if (e.offsetX !== undefined) {
+            form.clk_x = e.offsetX;
+            form.clk_y = e.offsetY;
+        } else if (typeof $.fn.offset == 'function') {
+            var offset = $el.offset();
+            form.clk_x = e.pageX - offset.left;
+            form.clk_y = e.pageY - offset.top;
+        } else {
+            form.clk_x = e.pageX - target.offsetLeft;
+            form.clk_y = e.pageY - target.offsetTop;
+        }
+    }
+    // clear form vars
+    setTimeout(function() { form.clk = form.clk_x = form.clk_y = null; }, 100);
+}
+
+
+// ajaxFormUnbind unbinds the event handlers that were bound by ajaxForm
+$.fn.ajaxFormUnbind = function() {
+    return this.unbind('submit.form-plugin click.form-plugin');
+};
+
+/**
+ * formToArray() gathers form element data into an array of objects that can
+ * be passed to any of the following ajax functions: $.get, $.post, or load.
+ * Each object in the array has both a 'name' and 'value' property.  An example of
+ * an array for a simple login form might be:
+ *
+ * [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ]
+ *
+ * It is this array that is passed to pre-submit callback functions provided to the
+ * ajaxSubmit() and ajaxForm() methods.
+ */
+$.fn.formToArray = function(semantic, elements) {
+    var a = [];
+    if (this.length === 0) {
+        return a;
+    }
+
+    var form = this[0];
+    var els = semantic ? form.getElementsByTagName('*') : form.elements;
+    if (!els) {
+        return a;
+    }
+
+    var i,j,n,v,el,max,jmax;
+    for(i=0, max=els.length; i < max; i++) {
+        el = els[i];
+        n = el.name;
+        if (!n) {
+            continue;
+        }
+
+        if (semantic && form.clk && el.type == "image") {
+            // handle image inputs on the fly when semantic == true
+            if(!el.disabled && form.clk == el) {
+                a.push({name: n, value: $(el).val(), type: el.type });
+                a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
+            }
+            continue;
+        }
+
+        v = $.fieldValue(el, true);
+        if (v && v.constructor == Array) {
+            if (elements) 
+                elements.push(el);
+            for(j=0, jmax=v.length; j < jmax; j++) {
+                a.push({name: n, value: v[j]});
+            }
+        }
+        else if (feature.fileapi && el.type == 'file' && !el.disabled) {
+            if (elements) 
+                elements.push(el);
+            var files = el.files;
+            if (files.length) {
+                for (j=0; j < files.length; j++) {
+                    a.push({name: n, value: files[j], type: el.type});
+                }
+            }
+            else {
+                // #180
+                a.push({ name: n, value: '', type: el.type });
+            }
+        }
+        else if (v !== null && typeof v != 'undefined') {
+            if (elements) 
+                elements.push(el);
+            a.push({name: n, value: v, type: el.type, required: el.required});
+        }
+    }
+
+    if (!semantic && form.clk) {
+        // input type=='image' are not found in elements array! handle it here
+        var $input = $(form.clk), input = $input[0];
+        n = input.name;
+        if (n && !input.disabled && input.type == 'image') {
+            a.push({name: n, value: $input.val()});
+            a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
+        }
+    }
+    return a;
+};
+
+/**
+ * Serializes form data into a 'submittable' string. This method will return a string
+ * in the format: name1=value1&amp;name2=value2
+ */
+$.fn.formSerialize = function(semantic) {
+    //hand off to jQuery.param for proper encoding
+    return $.param(this.formToArray(semantic));
+};
+
+/**
+ * Serializes all field elements in the jQuery object into a query string.
+ * This method will return a string in the format: name1=value1&amp;name2=value2
+ */
+$.fn.fieldSerialize = function(successful) {
+    var a = [];
+    this.each(function() {
+        var n = this.name;
+        if (!n) {
+            return;
+        }
+        var v = $.fieldValue(this, successful);
+        if (v && v.constructor == Array) {
+            for (var i=0,max=v.length; i < max; i++) {
+                a.push({name: n, value: v[i]});
+            }
+        }
+        else if (v !== null && typeof v != 'undefined') {
+            a.push({name: this.name, value: v});
+        }
+    });
+    //hand off to jQuery.param for proper encoding
+    return $.param(a);
+};
+
+/**
+ * Returns the value(s) of the element in the matched set.  For example, consider the following form:
+ *
+ *  <form><fieldset>
+ *      <input name="A" type="text" />
+ *      <input name="A" type="text" />
+ *      <input name="B" type="checkbox" value="B1" />
+ *      <input name="B" type="checkbox" value="B2"/>
+ *      <input name="C" type="radio" value="C1" />
+ *      <input name="C" type="radio" value="C2" />
+ *  </fieldset></form>
+ *
+ *  var v = $(':text').fieldValue();
+ *  // if no values are entered into the text inputs
+ *  v == ['','']
+ *  // if values entered into the text inputs are 'foo' and 'bar'
+ *  v == ['foo','bar']
+ *
+ *  var v = $(':checkbox').fieldValue();
+ *  // if neither checkbox is checked
+ *  v === undefined
+ *  // if both checkboxes are checked
+ *  v == ['B1', 'B2']
+ *
+ *  var v = $(':radio').fieldValue();
+ *  // if neither radio is checked
+ *  v === undefined
+ *  // if first radio is checked
+ *  v == ['C1']
+ *
+ * The successful argument controls whether or not the field element must be 'successful'
+ * (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
+ * The default value of the successful argument is true.  If this value is false the value(s)
+ * for each element is returned.
+ *
+ * Note: This method *always* returns an array.  If no valid value can be determined the
+ *    array will be empty, otherwise it will contain one or more values.
+ */
+$.fn.fieldValue = function(successful) {
+    for (var val=[], i=0, max=this.length; i < max; i++) {
+        var el = this[i];
+        var v = $.fieldValue(el, successful);
+        if (v === null || typeof v == 'undefined' || (v.constructor == Array && !v.length)) {
+            continue;
+        }
+        if (v.constructor == Array)
+            $.merge(val, v);
+        else
+            val.push(v);
+    }
+    return val;
+};
+
+/**
+ * Returns the value of the field element.
+ */
+$.fieldValue = function(el, successful) {
+    var n = el.name, t = el.type, tag = el.tagName.toLowerCase();
+    if (successful === undefined) {
+        successful = true;
+    }
+
+    if (successful && (!n || el.disabled || t == 'reset' || t == 'button' ||
+        (t == 'checkbox' || t == 'radio') && !el.checked ||
+        (t == 'submit' || t == 'image') && el.form && el.form.clk != el ||
+        tag == 'select' && el.selectedIndex == -1)) {
+            return null;
+    }
+
+    if (tag == 'select') {
+        var index = el.selectedIndex;
+        if (index < 0) {
+            return null;
+        }
+        var a = [], ops = el.options;
+        var one = (t == 'select-one');
+        var max = (one ? index+1 : ops.length);
+        for(var i=(one ? index : 0); i < max; i++) {
+            var op = ops[i];
+            if (op.selected) {
+                var v = op.value;
+                if (!v) { // extra pain for IE...
+                    v = (op.attributes && op.attributes['value'] && !(op.attributes['value'].specified)) ? op.text : op.value;
+                }
+                if (one) {
+                    return v;
+                }
+                a.push(v);
+            }
+        }
+        return a;
+    }
+    return $(el).val();
+};
+
+/**
+ * Clears the form data.  Takes the following actions on the form's input fields:
+ *  - input text fields will have their 'value' property set to the empty string
+ *  - select elements will have their 'selectedIndex' property set to -1
+ *  - checkbox and radio inputs will have their 'checked' property set to false
+ *  - inputs of type submit, button, reset, and hidden will *not* be effected
+ *  - button elements will *not* be effected
+ */
+$.fn.clearForm = function(includeHidden) {
+    return this.each(function() {
+        $('input,select,textarea', this).clearFields(includeHidden);
+    });
+};
+
+/**
+ * Clears the selected form elements.
+ */
+$.fn.clearFields = $.fn.clearInputs = function(includeHidden) {
+    var re = /^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i; // 'hidden' is not in this list
+    return this.each(function() {
+        var t = this.type, tag = this.tagName.toLowerCase();
+        if (re.test(t) || tag == 'textarea') {
+            this.value = '';
+        }
+        else if (t == 'checkbox' || t == 'radio') {
+            this.checked = false;
+        }
+        else if (tag == 'select') {
+            this.selectedIndex = -1;
+        }
+        else if (includeHidden) {
+            // includeHidden can be the valud true, or it can be a selector string
+            // indicating a special test; for example:
+            //  $('#myForm').clearForm('.special:hidden')
+            // the above would clean hidden inputs that have the class of 'special'
+            if ( (includeHidden === true && /hidden/.test(t)) ||
+                 (typeof includeHidden == 'string' && $(this).is(includeHidden)) )
+                this.value = '';
+        }
+    });
+};
+
+/**
+ * Resets the form data.  Causes all form elements to be reset to their original value.
+ */
+$.fn.resetForm = function() {
+    return this.each(function() {
+        // guard against an input with the name of 'reset'
+        // note that IE reports the reset function as an 'object'
+        if (typeof this.reset == 'function' || (typeof this.reset == 'object' && !this.reset.nodeType)) {
+            this.reset();
+        }
+    });
+};
+
+/**
+ * Enables or disables any matching elements.
+ */
+$.fn.enable = function(b) {
+    if (b === undefined) {
+        b = true;
+    }
+    return this.each(function() {
+        this.disabled = !b;
+    });
+};
+
+/**
+ * Checks/unchecks any matching checkboxes or radio buttons and
+ * selects/deselects and matching option elements.
+ */
+$.fn.selected = function(select) {
+    if (select === undefined) {
+        select = true;
+    }
+    return this.each(function() {
+        var t = this.type;
+        if (t == 'checkbox' || t == 'radio') {
+            this.checked = select;
+        }
+        else if (this.tagName.toLowerCase() == 'option') {
+            var $sel = $(this).parent('select');
+            if (select && $sel[0] && $sel[0].type == 'select-one') {
+                // deselect all other options
+                $sel.find('option').selected(false);
+            }
+            this.selected = select;
+        }
+    });
+};
+
+// expose debug var
+$.fn.ajaxSubmit.debug = false;
+
+// helper fn for console logging
+function log() {
+    if (!$.fn.ajaxSubmit.debug) 
+        return;
+    var msg = '[jquery.form] ' + Array.prototype.join.call(arguments,'');
+    if (window.console && window.console.log) {
+        window.console.log(msg);
+    }
+    else if (window.opera && window.opera.postError) {
+        window.opera.postError(msg);
+    }
+}
+
+})(jQuery);


[19/51] [abbrv] [partial] brooklyn-ui git commit: move subdir from incubator up a level as it is promoted to its own repo (first non-incubator commit!)

Posted by he...@apache.org.
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/build/requirejs-maven-plugin/r.js
----------------------------------------------------------------------
diff --git a/src/build/requirejs-maven-plugin/r.js b/src/build/requirejs-maven-plugin/r.js
new file mode 100644
index 0000000..f76b1e2
--- /dev/null
+++ b/src/build/requirejs-maven-plugin/r.js
@@ -0,0 +1,25256 @@
+/**
+ * @license r.js 2.1.6 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/jrburke/requirejs for details
+ */
+
+/*
+ * This is a bootstrap script to allow running RequireJS in the command line
+ * in either a Java/Rhino or Node environment. It is modified by the top-level
+ * dist.js file to inject other files to completely enable this file. It is
+ * the shell of the r.js file.
+ */
+
+/*jslint evil: true, nomen: true, sloppy: true */
+/*global readFile: true, process: false, Packages: false, print: false,
+console: false, java: false, module: false, requirejsVars, navigator,
+document, importScripts, self, location, Components, FileUtils */
+
+var requirejs, require, define, xpcUtil;
+(function (console, args, readFileFunc) {
+    var fileName, env, fs, vm, path, exec, rhinoContext, dir, nodeRequire,
+        nodeDefine, exists, reqMain, loadedOptimizedLib, existsForNode, Cc, Ci,
+        version = '2.1.6',
+        jsSuffixRegExp = /\.js$/,
+        commandOption = '',
+        useLibLoaded = {},
+        //Used by jslib/rhino/args.js
+        rhinoArgs = args,
+        //Used by jslib/xpconnect/args.js
+        xpconnectArgs = args,
+        readFile = typeof readFileFunc !== 'undefined' ? readFileFunc : null;
+
+    function showHelp() {
+        console.log('See https://github.com/jrburke/r.js for usage.');
+    }
+
+    if ((typeof navigator !== 'undefined' && typeof document !== 'undefined') ||
+            (typeof importScripts !== 'undefined' && typeof self !== 'undefined')) {
+        env = 'browser';
+
+        readFile = function (path) {
+            return fs.readFileSync(path, 'utf8');
+        };
+
+        exec = function (string) {
+            return eval(string);
+        };
+
+        exists = function () {
+            console.log('x.js exists not applicable in browser env');
+            return false;
+        };
+
+    } else if (typeof Packages !== 'undefined') {
+        env = 'rhino';
+
+        fileName = args[0];
+
+        if (fileName && fileName.indexOf('-') === 0) {
+            commandOption = fileName.substring(1);
+            fileName = args[1];
+        }
+
+        //Set up execution context.
+        rhinoContext = Packages.org.mozilla.javascript.ContextFactory.getGlobal().enterContext();
+
+        exec = function (string, name) {
+            return rhinoContext.evaluateString(this, string, name, 0, null);
+        };
+
+        exists = function (fileName) {
+            return (new java.io.File(fileName)).exists();
+        };
+
+        //Define a console.log for easier logging. Don't
+        //get fancy though.
+        if (typeof console === 'undefined') {
+            console = {
+                log: function () {
+                    print.apply(undefined, arguments);
+                }
+            };
+        }
+    } else if (typeof process !== 'undefined' && process.versions && !!process.versions.node) {
+        env = 'node';
+
+        //Get the fs module via Node's require before it
+        //gets replaced. Used in require/node.js
+        fs = require('fs');
+        vm = require('vm');
+        path = require('path');
+        //In Node 0.7+ existsSync is on fs.
+        existsForNode = fs.existsSync || path.existsSync;
+
+        nodeRequire = require;
+        nodeDefine = define;
+        reqMain = require.main;
+
+        //Temporarily hide require and define to allow require.js to define
+        //them.
+        require = undefined;
+        define = undefined;
+
+        readFile = function (path) {
+            return fs.readFileSync(path, 'utf8');
+        };
+
+        exec = function (string, name) {
+            return vm.runInThisContext(this.requirejsVars.require.makeNodeWrapper(string),
+                                       name ? fs.realpathSync(name) : '');
+        };
+
+        exists = function (fileName) {
+            return existsForNode(fileName);
+        };
+
+
+        fileName = process.argv[2];
+
+        if (fileName && fileName.indexOf('-') === 0) {
+            commandOption = fileName.substring(1);
+            fileName = process.argv[3];
+        }
+    } else if (typeof Components !== 'undefined' && Components.classes && Components.interfaces) {
+        env = 'xpconnect';
+
+        Components.utils['import']('resource://gre/modules/FileUtils.jsm');
+        Cc = Components.classes;
+        Ci = Components.interfaces;
+
+        fileName = args[0];
+
+        if (fileName && fileName.indexOf('-') === 0) {
+            commandOption = fileName.substring(1);
+            fileName = args[1];
+        }
+
+        xpcUtil = {
+            cwd: function () {
+                return FileUtils.getFile("CurWorkD", []).path;
+            },
+
+            //Remove . and .. from paths, normalize on front slashes
+            normalize: function (path) {
+                //There has to be an easier way to do this.
+                var i, part, ary,
+                    firstChar = path.charAt(0);
+
+                if (firstChar !== '/' &&
+                        firstChar !== '\\' &&
+                        path.indexOf(':') === -1) {
+                    //A relative path. Use the current working directory.
+                    path = xpcUtil.cwd() + '/' + path;
+                }
+
+                ary = path.replace(/\\/g, '/').split('/');
+
+                for (i = 0; i < ary.length; i += 1) {
+                    part = ary[i];
+                    if (part === '.') {
+                        ary.splice(i, 1);
+                        i -= 1;
+                    } else if (part === '..') {
+                        ary.splice(i - 1, 2);
+                        i -= 2;
+                    }
+                }
+                return ary.join('/');
+            },
+
+            xpfile: function (path) {
+                try {
+                    return new FileUtils.File(xpcUtil.normalize(path));
+                } catch (e) {
+                    throw new Error(path + ' failed: ' + e);
+                }
+            },
+
+            readFile: function (/*String*/path, /*String?*/encoding) {
+                //A file read function that can deal with BOMs
+                encoding = encoding || "utf-8";
+
+                var inStream, convertStream,
+                    readData = {},
+                    fileObj = xpcUtil.xpfile(path);
+
+                //XPCOM, you so crazy
+                try {
+                    inStream = Cc['@mozilla.org/network/file-input-stream;1']
+                               .createInstance(Ci.nsIFileInputStream);
+                    inStream.init(fileObj, 1, 0, false);
+
+                    convertStream = Cc['@mozilla.org/intl/converter-input-stream;1']
+                                    .createInstance(Ci.nsIConverterInputStream);
+                    convertStream.init(inStream, encoding, inStream.available(),
+                    Ci.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER);
+
+                    convertStream.readString(inStream.available(), readData);
+                    return readData.value;
+                } catch (e) {
+                    throw new Error((fileObj && fileObj.path || '') + ': ' + e);
+                } finally {
+                    if (convertStream) {
+                        convertStream.close();
+                    }
+                    if (inStream) {
+                        inStream.close();
+                    }
+                }
+            }
+        };
+
+        readFile = xpcUtil.readFile;
+
+        exec = function (string) {
+            return eval(string);
+        };
+
+        exists = function (fileName) {
+            return xpcUtil.xpfile(fileName).exists();
+        };
+
+        //Define a console.log for easier logging. Don't
+        //get fancy though.
+        if (typeof console === 'undefined') {
+            console = {
+                log: function () {
+                    print.apply(undefined, arguments);
+                }
+            };
+        }
+    }
+
+    /** vim: et:ts=4:sw=4:sts=4
+ * @license RequireJS 2.1.6 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/jrburke/requirejs for details
+ */
+//Not using strict: uneven strict support in browsers, #392, and causes
+//problems with requirejs.exec()/transpiler plugins that may not be strict.
+/*jslint regexp: true, nomen: true, sloppy: true */
+/*global window, navigator, document, importScripts, setTimeout, opera */
+
+
+(function (global) {
+    var req, s, head, baseElement, dataMain, src,
+        interactiveScript, currentlyAddingScript, mainScript, subPath,
+        version = '2.1.6',
+        commentRegExp = /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,
+        cjsRequireRegExp = /[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,
+        jsSuffixRegExp = /\.js$/,
+        currDirRegExp = /^\.\//,
+        op = Object.prototype,
+        ostring = op.toString,
+        hasOwn = op.hasOwnProperty,
+        ap = Array.prototype,
+        apsp = ap.splice,
+        isBrowser = !!(typeof window !== 'undefined' && navigator && window.document),
+        isWebWorker = !isBrowser && typeof importScripts !== 'undefined',
+        //PS3 indicates loaded and complete, but need to wait for complete
+        //specifically. Sequence is 'loading', 'loaded', execution,
+        // then 'complete'. The UA check is unfortunate, but not sure how
+        //to feature test w/o causing perf issues.
+        readyRegExp = isBrowser && navigator.platform === 'PLAYSTATION 3' ?
+                      /^complete$/ : /^(complete|loaded)$/,
+        defContextName = '_',
+        //Oh the tragedy, detecting opera. See the usage of isOpera for reason.
+        isOpera = typeof opera !== 'undefined' && opera.toString() === '[object Opera]',
+        contexts = {},
+        cfg = {},
+        globalDefQueue = [],
+        useInteractive = false;
+
+    function isFunction(it) {
+        return ostring.call(it) === '[object Function]';
+    }
+
+    function isArray(it) {
+        return ostring.call(it) === '[object Array]';
+    }
+
+    /**
+     * Helper function for iterating over an array. If the func returns
+     * a true value, it will break out of the loop.
+     */
+    function each(ary, func) {
+        if (ary) {
+            var i;
+            for (i = 0; i < ary.length; i += 1) {
+                if (ary[i] && func(ary[i], i, ary)) {
+                    break;
+                }
+            }
+        }
+    }
+
+    /**
+     * Helper function for iterating over an array backwards. If the func
+     * returns a true value, it will break out of the loop.
+     */
+    function eachReverse(ary, func) {
+        if (ary) {
+            var i;
+            for (i = ary.length - 1; i > -1; i -= 1) {
+                if (ary[i] && func(ary[i], i, ary)) {
+                    break;
+                }
+            }
+        }
+    }
+
+    function hasProp(obj, prop) {
+        return hasOwn.call(obj, prop);
+    }
+
+    function getOwn(obj, prop) {
+        return hasProp(obj, prop) && obj[prop];
+    }
+
+    /**
+     * Cycles over properties in an object and calls a function for each
+     * property value. If the function returns a truthy value, then the
+     * iteration is stopped.
+     */
+    function eachProp(obj, func) {
+        var prop;
+        for (prop in obj) {
+            if (hasProp(obj, prop)) {
+                if (func(obj[prop], prop)) {
+                    break;
+                }
+            }
+        }
+    }
+
+    /**
+     * Simple function to mix in properties from source into target,
+     * but only if target does not already have a property of the same name.
+     */
+    function mixin(target, source, force, deepStringMixin) {
+        if (source) {
+            eachProp(source, function (value, prop) {
+                if (force || !hasProp(target, prop)) {
+                    if (deepStringMixin && typeof value !== 'string') {
+                        if (!target[prop]) {
+                            target[prop] = {};
+                        }
+                        mixin(target[prop], value, force, deepStringMixin);
+                    } else {
+                        target[prop] = value;
+                    }
+                }
+            });
+        }
+        return target;
+    }
+
+    //Similar to Function.prototype.bind, but the 'this' object is specified
+    //first, since it is easier to read/figure out what 'this' will be.
+    function bind(obj, fn) {
+        return function () {
+            return fn.apply(obj, arguments);
+        };
+    }
+
+    function scripts() {
+        return document.getElementsByTagName('script');
+    }
+
+    function defaultOnError(err) {
+        throw err;
+    }
+
+    //Allow getting a global that expressed in
+    //dot notation, like 'a.b.c'.
+    function getGlobal(value) {
+        if (!value) {
+            return value;
+        }
+        var g = global;
+        each(value.split('.'), function (part) {
+            g = g[part];
+        });
+        return g;
+    }
+
+    /**
+     * Constructs an error with a pointer to an URL with more information.
+     * @param {String} id the error ID that maps to an ID on a web page.
+     * @param {String} message human readable error.
+     * @param {Error} [err] the original error, if there is one.
+     *
+     * @returns {Error}
+     */
+    function makeError(id, msg, err, requireModules) {
+        var e = new Error(msg + '\nhttp://requirejs.org/docs/errors.html#' + id);
+        e.requireType = id;
+        e.requireModules = requireModules;
+        if (err) {
+            e.originalError = err;
+        }
+        return e;
+    }
+
+    if (typeof define !== 'undefined') {
+        //If a define is already in play via another AMD loader,
+        //do not overwrite.
+        return;
+    }
+
+    if (typeof requirejs !== 'undefined') {
+        if (isFunction(requirejs)) {
+            //Do not overwrite and existing requirejs instance.
+            return;
+        }
+        cfg = requirejs;
+        requirejs = undefined;
+    }
+
+    //Allow for a require config object
+    if (typeof require !== 'undefined' && !isFunction(require)) {
+        //assume it is a config object.
+        cfg = require;
+        require = undefined;
+    }
+
+    function newContext(contextName) {
+        var inCheckLoaded, Module, context, handlers,
+            checkLoadedTimeoutId,
+            config = {
+                //Defaults. Do not set a default for map
+                //config to speed up normalize(), which
+                //will run faster if there is no default.
+                waitSeconds: 7,
+                baseUrl: './',
+                paths: {},
+                pkgs: {},
+                shim: {},
+                config: {}
+            },
+            registry = {},
+            //registry of just enabled modules, to speed
+            //cycle breaking code when lots of modules
+            //are registered, but not activated.
+            enabledRegistry = {},
+            undefEvents = {},
+            defQueue = [],
+            defined = {},
+            urlFetched = {},
+            requireCounter = 1,
+            unnormalizedCounter = 1;
+
+        /**
+         * Trims the . and .. from an array of path segments.
+         * It will keep a leading path segment if a .. will become
+         * the first path segment, to help with module name lookups,
+         * which act like paths, but can be remapped. But the end result,
+         * all paths that use this function should look normalized.
+         * NOTE: this method MODIFIES the input array.
+         * @param {Array} ary the array of path segments.
+         */
+        function trimDots(ary) {
+            var i, part;
+            for (i = 0; ary[i]; i += 1) {
+                part = ary[i];
+                if (part === '.') {
+                    ary.splice(i, 1);
+                    i -= 1;
+                } else if (part === '..') {
+                    if (i === 1 && (ary[2] === '..' || ary[0] === '..')) {
+                        //End of the line. Keep at least one non-dot
+                        //path segment at the front so it can be mapped
+                        //correctly to disk. Otherwise, there is likely
+                        //no path mapping for a path starting with '..'.
+                        //This can still fail, but catches the most reasonable
+                        //uses of ..
+                        break;
+                    } else if (i > 0) {
+                        ary.splice(i - 1, 2);
+                        i -= 2;
+                    }
+                }
+            }
+        }
+
+        /**
+         * Given a relative module name, like ./something, normalize it to
+         * a real name that can be mapped to a path.
+         * @param {String} name the relative name
+         * @param {String} baseName a real name that the name arg is relative
+         * to.
+         * @param {Boolean} applyMap apply the map config to the value. Should
+         * only be done if this normalization is for a dependency ID.
+         * @returns {String} normalized name
+         */
+        function normalize(name, baseName, applyMap) {
+            var pkgName, pkgConfig, mapValue, nameParts, i, j, nameSegment,
+                foundMap, foundI, foundStarMap, starI,
+                baseParts = baseName && baseName.split('/'),
+                normalizedBaseParts = baseParts,
+                map = config.map,
+                starMap = map && map['*'];
+
+            //Adjust any relative paths.
+            if (name && name.charAt(0) === '.') {
+                //If have a base name, try to normalize against it,
+                //otherwise, assume it is a top-level require that will
+                //be relative to baseUrl in the end.
+                if (baseName) {
+                    if (getOwn(config.pkgs, baseName)) {
+                        //If the baseName is a package name, then just treat it as one
+                        //name to concat the name with.
+                        normalizedBaseParts = baseParts = [baseName];
+                    } else {
+                        //Convert baseName to array, and lop off the last part,
+                        //so that . matches that 'directory' and not name of the baseName's
+                        //module. For instance, baseName of 'one/two/three', maps to
+                        //'one/two/three.js', but we want the directory, 'one/two' for
+                        //this normalization.
+                        normalizedBaseParts = baseParts.slice(0, baseParts.length - 1);
+                    }
+
+                    name = normalizedBaseParts.concat(name.split('/'));
+                    trimDots(name);
+
+                    //Some use of packages may use a . path to reference the
+                    //'main' module name, so normalize for that.
+                    pkgConfig = getOwn(config.pkgs, (pkgName = name[0]));
+                    name = name.join('/');
+                    if (pkgConfig && name === pkgName + '/' + pkgConfig.main) {
+                        name = pkgName;
+                    }
+                } else if (name.indexOf('./') === 0) {
+                    // No baseName, so this is ID is resolved relative
+                    // to baseUrl, pull off the leading dot.
+                    name = name.substring(2);
+                }
+            }
+
+            //Apply map config if available.
+            if (applyMap && map && (baseParts || starMap)) {
+                nameParts = name.split('/');
+
+                for (i = nameParts.length; i > 0; i -= 1) {
+                    nameSegment = nameParts.slice(0, i).join('/');
+
+                    if (baseParts) {
+                        //Find the longest baseName segment match in the config.
+                        //So, do joins on the biggest to smallest lengths of baseParts.
+                        for (j = baseParts.length; j > 0; j -= 1) {
+                            mapValue = getOwn(map, baseParts.slice(0, j).join('/'));
+
+                            //baseName segment has config, find if it has one for
+                            //this name.
+                            if (mapValue) {
+                                mapValue = getOwn(mapValue, nameSegment);
+                                if (mapValue) {
+                                    //Match, update name to the new value.
+                                    foundMap = mapValue;
+                                    foundI = i;
+                                    break;
+                                }
+                            }
+                        }
+                    }
+
+                    if (foundMap) {
+                        break;
+                    }
+
+                    //Check for a star map match, but just hold on to it,
+                    //if there is a shorter segment match later in a matching
+                    //config, then favor over this star map.
+                    if (!foundStarMap && starMap && getOwn(starMap, nameSegment)) {
+                        foundStarMap = getOwn(starMap, nameSegment);
+                        starI = i;
+                    }
+                }
+
+                if (!foundMap && foundStarMap) {
+                    foundMap = foundStarMap;
+                    foundI = starI;
+                }
+
+                if (foundMap) {
+                    nameParts.splice(0, foundI, foundMap);
+                    name = nameParts.join('/');
+                }
+            }
+
+            return name;
+        }
+
+        function removeScript(name) {
+            if (isBrowser) {
+                each(scripts(), function (scriptNode) {
+                    if (scriptNode.getAttribute('data-requiremodule') === name &&
+                            scriptNode.getAttribute('data-requirecontext') === context.contextName) {
+                        scriptNode.parentNode.removeChild(scriptNode);
+                        return true;
+                    }
+                });
+            }
+        }
+
+        function hasPathFallback(id) {
+            var pathConfig = getOwn(config.paths, id);
+            if (pathConfig && isArray(pathConfig) && pathConfig.length > 1) {
+                removeScript(id);
+                //Pop off the first array value, since it failed, and
+                //retry
+                pathConfig.shift();
+                context.require.undef(id);
+                context.require([id]);
+                return true;
+            }
+        }
+
+        //Turns a plugin!resource to [plugin, resource]
+        //with the plugin being undefined if the name
+        //did not have a plugin prefix.
+        function splitPrefix(name) {
+            var prefix,
+                index = name ? name.indexOf('!') : -1;
+            if (index > -1) {
+                prefix = name.substring(0, index);
+                name = name.substring(index + 1, name.length);
+            }
+            return [prefix, name];
+        }
+
+        /**
+         * Creates a module mapping that includes plugin prefix, module
+         * name, and path. If parentModuleMap is provided it will
+         * also normalize the name via require.normalize()
+         *
+         * @param {String} name the module name
+         * @param {String} [parentModuleMap] parent module map
+         * for the module name, used to resolve relative names.
+         * @param {Boolean} isNormalized: is the ID already normalized.
+         * This is true if this call is done for a define() module ID.
+         * @param {Boolean} applyMap: apply the map config to the ID.
+         * Should only be true if this map is for a dependency.
+         *
+         * @returns {Object}
+         */
+        function makeModuleMap(name, parentModuleMap, isNormalized, applyMap) {
+            var url, pluginModule, suffix, nameParts,
+                prefix = null,
+                parentName = parentModuleMap ? parentModuleMap.name : null,
+                originalName = name,
+                isDefine = true,
+                normalizedName = '';
+
+            //If no name, then it means it is a require call, generate an
+            //internal name.
+            if (!name) {
+                isDefine = false;
+                name = '_@r' + (requireCounter += 1);
+            }
+
+            nameParts = splitPrefix(name);
+            prefix = nameParts[0];
+            name = nameParts[1];
+
+            if (prefix) {
+                prefix = normalize(prefix, parentName, applyMap);
+                pluginModule = getOwn(defined, prefix);
+            }
+
+            //Account for relative paths if there is a base name.
+            if (name) {
+                if (prefix) {
+                    if (pluginModule && pluginModule.normalize) {
+                        //Plugin is loaded, use its normalize method.
+                        normalizedName = pluginModule.normalize(name, function (name) {
+                            return normalize(name, parentName, applyMap);
+                        });
+                    } else {
+                        normalizedName = normalize(name, parentName, applyMap);
+                    }
+                } else {
+                    //A regular module.
+                    normalizedName = normalize(name, parentName, applyMap);
+
+                    //Normalized name may be a plugin ID due to map config
+                    //application in normalize. The map config values must
+                    //already be normalized, so do not need to redo that part.
+                    nameParts = splitPrefix(normalizedName);
+                    prefix = nameParts[0];
+                    normalizedName = nameParts[1];
+                    isNormalized = true;
+
+                    url = context.nameToUrl(normalizedName);
+                }
+            }
+
+            //If the id is a plugin id that cannot be determined if it needs
+            //normalization, stamp it with a unique ID so two matching relative
+            //ids that may conflict can be separate.
+            suffix = prefix && !pluginModule && !isNormalized ?
+                     '_unnormalized' + (unnormalizedCounter += 1) :
+                     '';
+
+            return {
+                prefix: prefix,
+                name: normalizedName,
+                parentMap: parentModuleMap,
+                unnormalized: !!suffix,
+                url: url,
+                originalName: originalName,
+                isDefine: isDefine,
+                id: (prefix ?
+                        prefix + '!' + normalizedName :
+                        normalizedName) + suffix
+            };
+        }
+
+        function getModule(depMap) {
+            var id = depMap.id,
+                mod = getOwn(registry, id);
+
+            if (!mod) {
+                mod = registry[id] = new context.Module(depMap);
+            }
+
+            return mod;
+        }
+
+        function on(depMap, name, fn) {
+            var id = depMap.id,
+                mod = getOwn(registry, id);
+
+            if (hasProp(defined, id) &&
+                    (!mod || mod.defineEmitComplete)) {
+                if (name === 'defined') {
+                    fn(defined[id]);
+                }
+            } else {
+                mod = getModule(depMap);
+                if (mod.error && name === 'error') {
+                    fn(mod.error);
+                } else {
+                    mod.on(name, fn);
+                }
+            }
+        }
+
+        function onError(err, errback) {
+            var ids = err.requireModules,
+                notified = false;
+
+            if (errback) {
+                errback(err);
+            } else {
+                each(ids, function (id) {
+                    var mod = getOwn(registry, id);
+                    if (mod) {
+                        //Set error on module, so it skips timeout checks.
+                        mod.error = err;
+                        if (mod.events.error) {
+                            notified = true;
+                            mod.emit('error', err);
+                        }
+                    }
+                });
+
+                if (!notified) {
+                    req.onError(err);
+                }
+            }
+        }
+
+        /**
+         * Internal method to transfer globalQueue items to this context's
+         * defQueue.
+         */
+        function takeGlobalQueue() {
+            //Push all the globalDefQueue items into the context's defQueue
+            if (globalDefQueue.length) {
+                //Array splice in the values since the context code has a
+                //local var ref to defQueue, so cannot just reassign the one
+                //on context.
+                apsp.apply(defQueue,
+                           [defQueue.length - 1, 0].concat(globalDefQueue));
+                globalDefQueue = [];
+            }
+        }
+
+        handlers = {
+            'require': function (mod) {
+                if (mod.require) {
+                    return mod.require;
+                } else {
+                    return (mod.require = context.makeRequire(mod.map));
+                }
+            },
+            'exports': function (mod) {
+                mod.usingExports = true;
+                if (mod.map.isDefine) {
+                    if (mod.exports) {
+                        return mod.exports;
+                    } else {
+                        return (mod.exports = defined[mod.map.id] = {});
+                    }
+                }
+            },
+            'module': function (mod) {
+                if (mod.module) {
+                    return mod.module;
+                } else {
+                    return (mod.module = {
+                        id: mod.map.id,
+                        uri: mod.map.url,
+                        config: function () {
+                            var c,
+                                pkg = getOwn(config.pkgs, mod.map.id);
+                            // For packages, only support config targeted
+                            // at the main module.
+                            c = pkg ? getOwn(config.config, mod.map.id + '/' + pkg.main) :
+                                      getOwn(config.config, mod.map.id);
+                            return  c || {};
+                        },
+                        exports: defined[mod.map.id]
+                    });
+                }
+            }
+        };
+
+        function cleanRegistry(id) {
+            //Clean up machinery used for waiting modules.
+            delete registry[id];
+            delete enabledRegistry[id];
+        }
+
+        function breakCycle(mod, traced, processed) {
+            var id = mod.map.id;
+
+            if (mod.error) {
+                mod.emit('error', mod.error);
+            } else {
+                traced[id] = true;
+                each(mod.depMaps, function (depMap, i) {
+                    var depId = depMap.id,
+                        dep = getOwn(registry, depId);
+
+                    //Only force things that have not completed
+                    //being defined, so still in the registry,
+                    //and only if it has not been matched up
+                    //in the module already.
+                    if (dep && !mod.depMatched[i] && !processed[depId]) {
+                        if (getOwn(traced, depId)) {
+                            mod.defineDep(i, defined[depId]);
+                            mod.check(); //pass false?
+                        } else {
+                            breakCycle(dep, traced, processed);
+                        }
+                    }
+                });
+                processed[id] = true;
+            }
+        }
+
+        function checkLoaded() {
+            var map, modId, err, usingPathFallback,
+                waitInterval = config.waitSeconds * 1000,
+                //It is possible to disable the wait interval by using waitSeconds of 0.
+                expired = waitInterval && (context.startTime + waitInterval) < new Date().getTime(),
+                noLoads = [],
+                reqCalls = [],
+                stillLoading = false,
+                needCycleCheck = true;
+
+            //Do not bother if this call was a result of a cycle break.
+            if (inCheckLoaded) {
+                return;
+            }
+
+            inCheckLoaded = true;
+
+            //Figure out the state of all the modules.
+            eachProp(enabledRegistry, function (mod) {
+                map = mod.map;
+                modId = map.id;
+
+                //Skip things that are not enabled or in error state.
+                if (!mod.enabled) {
+                    return;
+                }
+
+                if (!map.isDefine) {
+                    reqCalls.push(mod);
+                }
+
+                if (!mod.error) {
+                    //If the module should be executed, and it has not
+                    //been inited and time is up, remember it.
+                    if (!mod.inited && expired) {
+                        if (hasPathFallback(modId)) {
+                            usingPathFallback = true;
+                            stillLoading = true;
+                        } else {
+                            noLoads.push(modId);
+                            removeScript(modId);
+                        }
+                    } else if (!mod.inited && mod.fetched && map.isDefine) {
+                        stillLoading = true;
+                        if (!map.prefix) {
+                            //No reason to keep looking for unfinished
+                            //loading. If the only stillLoading is a
+                            //plugin resource though, keep going,
+                            //because it may be that a plugin resource
+                            //is waiting on a non-plugin cycle.
+                            return (needCycleCheck = false);
+                        }
+                    }
+                }
+            });
+
+            if (expired && noLoads.length) {
+                //If wait time expired, throw error of unloaded modules.
+                err = makeError('timeout', 'Load timeout for modules: ' + noLoads, null, noLoads);
+                err.contextName = context.contextName;
+                return onError(err);
+            }
+
+            //Not expired, check for a cycle.
+            if (needCycleCheck) {
+                each(reqCalls, function (mod) {
+                    breakCycle(mod, {}, {});
+                });
+            }
+
+            //If still waiting on loads, and the waiting load is something
+            //other than a plugin resource, or there are still outstanding
+            //scripts, then just try back later.
+            if ((!expired || usingPathFallback) && stillLoading) {
+                //Something is still waiting to load. Wait for it, but only
+                //if a timeout is not already in effect.
+                if ((isBrowser || isWebWorker) && !checkLoadedTimeoutId) {
+                    checkLoadedTimeoutId = setTimeout(function () {
+                        checkLoadedTimeoutId = 0;
+                        checkLoaded();
+                    }, 50);
+                }
+            }
+
+            inCheckLoaded = false;
+        }
+
+        Module = function (map) {
+            this.events = getOwn(undefEvents, map.id) || {};
+            this.map = map;
+            this.shim = getOwn(config.shim, map.id);
+            this.depExports = [];
+            this.depMaps = [];
+            this.depMatched = [];
+            this.pluginMaps = {};
+            this.depCount = 0;
+
+            /* this.exports this.factory
+               this.depMaps = [],
+               this.enabled, this.fetched
+            */
+        };
+
+        Module.prototype = {
+            init: function (depMaps, factory, errback, options) {
+                options = options || {};
+
+                //Do not do more inits if already done. Can happen if there
+                //are multiple define calls for the same module. That is not
+                //a normal, common case, but it is also not unexpected.
+                if (this.inited) {
+                    return;
+                }
+
+                this.factory = factory;
+
+                if (errback) {
+                    //Register for errors on this module.
+                    this.on('error', errback);
+                } else if (this.events.error) {
+                    //If no errback already, but there are error listeners
+                    //on this module, set up an errback to pass to the deps.
+                    errback = bind(this, function (err) {
+                        this.emit('error', err);
+                    });
+                }
+
+                //Do a copy of the dependency array, so that
+                //source inputs are not modified. For example
+                //"shim" deps are passed in here directly, and
+                //doing a direct modification of the depMaps array
+                //would affect that config.
+                this.depMaps = depMaps && depMaps.slice(0);
+
+                this.errback = errback;
+
+                //Indicate this module has be initialized
+                this.inited = true;
+
+                this.ignore = options.ignore;
+
+                //Could have option to init this module in enabled mode,
+                //or could have been previously marked as enabled. However,
+                //the dependencies are not known until init is called. So
+                //if enabled previously, now trigger dependencies as enabled.
+                if (options.enabled || this.enabled) {
+                    //Enable this module and dependencies.
+                    //Will call this.check()
+                    this.enable();
+                } else {
+                    this.check();
+                }
+            },
+
+            defineDep: function (i, depExports) {
+                //Because of cycles, defined callback for a given
+                //export can be called more than once.
+                if (!this.depMatched[i]) {
+                    this.depMatched[i] = true;
+                    this.depCount -= 1;
+                    this.depExports[i] = depExports;
+                }
+            },
+
+            fetch: function () {
+                if (this.fetched) {
+                    return;
+                }
+                this.fetched = true;
+
+                context.startTime = (new Date()).getTime();
+
+                var map = this.map;
+
+                //If the manager is for a plugin managed resource,
+                //ask the plugin to load it now.
+                if (this.shim) {
+                    context.makeRequire(this.map, {
+                        enableBuildCallback: true
+                    })(this.shim.deps || [], bind(this, function () {
+                        return map.prefix ? this.callPlugin() : this.load();
+                    }));
+                } else {
+                    //Regular dependency.
+                    return map.prefix ? this.callPlugin() : this.load();
+                }
+            },
+
+            load: function () {
+                var url = this.map.url;
+
+                //Regular dependency.
+                if (!urlFetched[url]) {
+                    urlFetched[url] = true;
+                    context.load(this.map.id, url);
+                }
+            },
+
+            /**
+             * Checks if the module is ready to define itself, and if so,
+             * define it.
+             */
+            check: function () {
+                if (!this.enabled || this.enabling) {
+                    return;
+                }
+
+                var err, cjsModule,
+                    id = this.map.id,
+                    depExports = this.depExports,
+                    exports = this.exports,
+                    factory = this.factory;
+
+                if (!this.inited) {
+                    this.fetch();
+                } else if (this.error) {
+                    this.emit('error', this.error);
+                } else if (!this.defining) {
+                    //The factory could trigger another require call
+                    //that would result in checking this module to
+                    //define itself again. If already in the process
+                    //of doing that, skip this work.
+                    this.defining = true;
+
+                    if (this.depCount < 1 && !this.defined) {
+                        if (isFunction(factory)) {
+                            //If there is an error listener, favor passing
+                            //to that instead of throwing an error. However,
+                            //only do it for define()'d  modules. require
+                            //errbacks should not be called for failures in
+                            //their callbacks (#699). However if a global
+                            //onError is set, use that.
+                            if ((this.events.error && this.map.isDefine) ||
+                                req.onError !== defaultOnError) {
+                                try {
+                                    exports = context.execCb(id, factory, depExports, exports);
+                                } catch (e) {
+                                    err = e;
+                                }
+                            } else {
+                                exports = context.execCb(id, factory, depExports, exports);
+                            }
+
+                            if (this.map.isDefine) {
+                                //If setting exports via 'module' is in play,
+                                //favor that over return value and exports. After that,
+                                //favor a non-undefined return value over exports use.
+                                cjsModule = this.module;
+                                if (cjsModule &&
+                                        cjsModule.exports !== undefined &&
+                                        //Make sure it is not already the exports value
+                                        cjsModule.exports !== this.exports) {
+                                    exports = cjsModule.exports;
+                                } else if (exports === undefined && this.usingExports) {
+                                    //exports already set the defined value.
+                                    exports = this.exports;
+                                }
+                            }
+
+                            if (err) {
+                                err.requireMap = this.map;
+                                err.requireModules = this.map.isDefine ? [this.map.id] : null;
+                                err.requireType = this.map.isDefine ? 'define' : 'require';
+                                return onError((this.error = err));
+                            }
+
+                        } else {
+                            //Just a literal value
+                            exports = factory;
+                        }
+
+                        this.exports = exports;
+
+                        if (this.map.isDefine && !this.ignore) {
+                            defined[id] = exports;
+
+                            if (req.onResourceLoad) {
+                                req.onResourceLoad(context, this.map, this.depMaps);
+                            }
+                        }
+
+                        //Clean up
+                        cleanRegistry(id);
+
+                        this.defined = true;
+                    }
+
+                    //Finished the define stage. Allow calling check again
+                    //to allow define notifications below in the case of a
+                    //cycle.
+                    this.defining = false;
+
+                    if (this.defined && !this.defineEmitted) {
+                        this.defineEmitted = true;
+                        this.emit('defined', this.exports);
+                        this.defineEmitComplete = true;
+                    }
+
+                }
+            },
+
+            callPlugin: function () {
+                var map = this.map,
+                    id = map.id,
+                    //Map already normalized the prefix.
+                    pluginMap = makeModuleMap(map.prefix);
+
+                //Mark this as a dependency for this plugin, so it
+                //can be traced for cycles.
+                this.depMaps.push(pluginMap);
+
+                on(pluginMap, 'defined', bind(this, function (plugin) {
+                    var load, normalizedMap, normalizedMod,
+                        name = this.map.name,
+                        parentName = this.map.parentMap ? this.map.parentMap.name : null,
+                        localRequire = context.makeRequire(map.parentMap, {
+                            enableBuildCallback: true
+                        });
+
+                    //If current map is not normalized, wait for that
+                    //normalized name to load instead of continuing.
+                    if (this.map.unnormalized) {
+                        //Normalize the ID if the plugin allows it.
+                        if (plugin.normalize) {
+                            name = plugin.normalize(name, function (name) {
+                                return normalize(name, parentName, true);
+                            }) || '';
+                        }
+
+                        //prefix and name should already be normalized, no need
+                        //for applying map config again either.
+                        normalizedMap = makeModuleMap(map.prefix + '!' + name,
+                                                      this.map.parentMap);
+                        on(normalizedMap,
+                            'defined', bind(this, function (value) {
+                                this.init([], function () { return value; }, null, {
+                                    enabled: true,
+                                    ignore: true
+                                });
+                            }));
+
+                        normalizedMod = getOwn(registry, normalizedMap.id);
+                        if (normalizedMod) {
+                            //Mark this as a dependency for this plugin, so it
+                            //can be traced for cycles.
+                            this.depMaps.push(normalizedMap);
+
+                            if (this.events.error) {
+                                normalizedMod.on('error', bind(this, function (err) {
+                                    this.emit('error', err);
+                                }));
+                            }
+                            normalizedMod.enable();
+                        }
+
+                        return;
+                    }
+
+                    load = bind(this, function (value) {
+                        this.init([], function () { return value; }, null, {
+                            enabled: true
+                        });
+                    });
+
+                    load.error = bind(this, function (err) {
+                        this.inited = true;
+                        this.error = err;
+                        err.requireModules = [id];
+
+                        //Remove temp unnormalized modules for this module,
+                        //since they will never be resolved otherwise now.
+                        eachProp(registry, function (mod) {
+                            if (mod.map.id.indexOf(id + '_unnormalized') === 0) {
+                                cleanRegistry(mod.map.id);
+                            }
+                        });
+
+                        onError(err);
+                    });
+
+                    //Allow plugins to load other code without having to know the
+                    //context or how to 'complete' the load.
+                    load.fromText = bind(this, function (text, textAlt) {
+                        /*jslint evil: true */
+                        var moduleName = map.name,
+                            moduleMap = makeModuleMap(moduleName),
+                            hasInteractive = useInteractive;
+
+                        //As of 2.1.0, support just passing the text, to reinforce
+                        //fromText only being called once per resource. Still
+                        //support old style of passing moduleName but discard
+                        //that moduleName in favor of the internal ref.
+                        if (textAlt) {
+                            text = textAlt;
+                        }
+
+                        //Turn off interactive script matching for IE for any define
+                        //calls in the text, then turn it back on at the end.
+                        if (hasInteractive) {
+                            useInteractive = false;
+                        }
+
+                        //Prime the system by creating a module instance for
+                        //it.
+                        getModule(moduleMap);
+
+                        //Transfer any config to this other module.
+                        if (hasProp(config.config, id)) {
+                            config.config[moduleName] = config.config[id];
+                        }
+
+                        try {
+                            req.exec(text);
+                        } catch (e) {
+                            return onError(makeError('fromtexteval',
+                                             'fromText eval for ' + id +
+                                            ' failed: ' + e,
+                                             e,
+                                             [id]));
+                        }
+
+                        if (hasInteractive) {
+                            useInteractive = true;
+                        }
+
+                        //Mark this as a dependency for the plugin
+                        //resource
+                        this.depMaps.push(moduleMap);
+
+                        //Support anonymous modules.
+                        context.completeLoad(moduleName);
+
+                        //Bind the value of that module to the value for this
+                        //resource ID.
+                        localRequire([moduleName], load);
+                    });
+
+                    //Use parentName here since the plugin's name is not reliable,
+                    //could be some weird string with no path that actually wants to
+                    //reference the parentName's path.
+                    plugin.load(map.name, localRequire, load, config);
+                }));
+
+                context.enable(pluginMap, this);
+                this.pluginMaps[pluginMap.id] = pluginMap;
+            },
+
+            enable: function () {
+                enabledRegistry[this.map.id] = this;
+                this.enabled = true;
+
+                //Set flag mentioning that the module is enabling,
+                //so that immediate calls to the defined callbacks
+                //for dependencies do not trigger inadvertent load
+                //with the depCount still being zero.
+                this.enabling = true;
+
+                //Enable each dependency
+                each(this.depMaps, bind(this, function (depMap, i) {
+                    var id, mod, handler;
+
+                    if (typeof depMap === 'string') {
+                        //Dependency needs to be converted to a depMap
+                        //and wired up to this module.
+                        depMap = makeModuleMap(depMap,
+                                               (this.map.isDefine ? this.map : this.map.parentMap),
+                                               false,
+                                               !this.skipMap);
+                        this.depMaps[i] = depMap;
+
+                        handler = getOwn(handlers, depMap.id);
+
+                        if (handler) {
+                            this.depExports[i] = handler(this);
+                            return;
+                        }
+
+                        this.depCount += 1;
+
+                        on(depMap, 'defined', bind(this, function (depExports) {
+                            this.defineDep(i, depExports);
+                            this.check();
+                        }));
+
+                        if (this.errback) {
+                            on(depMap, 'error', bind(this, this.errback));
+                        }
+                    }
+
+                    id = depMap.id;
+                    mod = registry[id];
+
+                    //Skip special modules like 'require', 'exports', 'module'
+                    //Also, don't call enable if it is already enabled,
+                    //important in circular dependency cases.
+                    if (!hasProp(handlers, id) && mod && !mod.enabled) {
+                        context.enable(depMap, this);
+                    }
+                }));
+
+                //Enable each plugin that is used in
+                //a dependency
+                eachProp(this.pluginMaps, bind(this, function (pluginMap) {
+                    var mod = getOwn(registry, pluginMap.id);
+                    if (mod && !mod.enabled) {
+                        context.enable(pluginMap, this);
+                    }
+                }));
+
+                this.enabling = false;
+
+                this.check();
+            },
+
+            on: function (name, cb) {
+                var cbs = this.events[name];
+                if (!cbs) {
+                    cbs = this.events[name] = [];
+                }
+                cbs.push(cb);
+            },
+
+            emit: function (name, evt) {
+                each(this.events[name], function (cb) {
+                    cb(evt);
+                });
+                if (name === 'error') {
+                    //Now that the error handler was triggered, remove
+                    //the listeners, since this broken Module instance
+                    //can stay around for a while in the registry.
+                    delete this.events[name];
+                }
+            }
+        };
+
+        function callGetModule(args) {
+            //Skip modules already defined.
+            if (!hasProp(defined, args[0])) {
+                getModule(makeModuleMap(args[0], null, true)).init(args[1], args[2]);
+            }
+        }
+
+        function removeListener(node, func, name, ieName) {
+            //Favor detachEvent because of IE9
+            //issue, see attachEvent/addEventListener comment elsewhere
+            //in this file.
+            if (node.detachEvent && !isOpera) {
+                //Probably IE. If not it will throw an error, which will be
+                //useful to know.
+                if (ieName) {
+                    node.detachEvent(ieName, func);
+                }
+            } else {
+                node.removeEventListener(name, func, false);
+            }
+        }
+
+        /**
+         * Given an event from a script node, get the requirejs info from it,
+         * and then removes the event listeners on the node.
+         * @param {Event} evt
+         * @returns {Object}
+         */
+        function getScriptData(evt) {
+            //Using currentTarget instead of target for Firefox 2.0's sake. Not
+            //all old browsers will be supported, but this one was easy enough
+            //to support and still makes sense.
+            var node = evt.currentTarget || evt.srcElement;
+
+            //Remove the listeners once here.
+            removeListener(node, context.onScriptLoad, 'load', 'onreadystatechange');
+            removeListener(node, context.onScriptError, 'error');
+
+            return {
+                node: node,
+                id: node && node.getAttribute('data-requiremodule')
+            };
+        }
+
+        function intakeDefines() {
+            var args;
+
+            //Any defined modules in the global queue, intake them now.
+            takeGlobalQueue();
+
+            //Make sure any remaining defQueue items get properly processed.
+            while (defQueue.length) {
+                args = defQueue.shift();
+                if (args[0] === null) {
+                    return onError(makeError('mismatch', 'Mismatched anonymous define() module: ' + args[args.length - 1]));
+                } else {
+                    //args are id, deps, factory. Should be normalized by the
+                    //define() function.
+                    callGetModule(args);
+                }
+            }
+        }
+
+        context = {
+            config: config,
+            contextName: contextName,
+            registry: registry,
+            defined: defined,
+            urlFetched: urlFetched,
+            defQueue: defQueue,
+            Module: Module,
+            makeModuleMap: makeModuleMap,
+            nextTick: req.nextTick,
+            onError: onError,
+
+            /**
+             * Set a configuration for the context.
+             * @param {Object} cfg config object to integrate.
+             */
+            configure: function (cfg) {
+                //Make sure the baseUrl ends in a slash.
+                if (cfg.baseUrl) {
+                    if (cfg.baseUrl.charAt(cfg.baseUrl.length - 1) !== '/') {
+                        cfg.baseUrl += '/';
+                    }
+                }
+
+                //Save off the paths and packages since they require special processing,
+                //they are additive.
+                var pkgs = config.pkgs,
+                    shim = config.shim,
+                    objs = {
+                        paths: true,
+                        config: true,
+                        map: true
+                    };
+
+                eachProp(cfg, function (value, prop) {
+                    if (objs[prop]) {
+                        if (prop === 'map') {
+                            if (!config.map) {
+                                config.map = {};
+                            }
+                            mixin(config[prop], value, true, true);
+                        } else {
+                            mixin(config[prop], value, true);
+                        }
+                    } else {
+                        config[prop] = value;
+                    }
+                });
+
+                //Merge shim
+                if (cfg.shim) {
+                    eachProp(cfg.shim, function (value, id) {
+                        //Normalize the structure
+                        if (isArray(value)) {
+                            value = {
+                                deps: value
+                            };
+                        }
+                        if ((value.exports || value.init) && !value.exportsFn) {
+                            value.exportsFn = context.makeShimExports(value);
+                        }
+                        shim[id] = value;
+                    });
+                    config.shim = shim;
+                }
+
+                //Adjust packages if necessary.
+                if (cfg.packages) {
+                    each(cfg.packages, function (pkgObj) {
+                        var location;
+
+                        pkgObj = typeof pkgObj === 'string' ? { name: pkgObj } : pkgObj;
+                        location = pkgObj.location;
+
+                        //Create a brand new object on pkgs, since currentPackages can
+                        //be passed in again, and config.pkgs is the internal transformed
+                        //state for all package configs.
+                        pkgs[pkgObj.name] = {
+                            name: pkgObj.name,
+                            location: location || pkgObj.name,
+                            //Remove leading dot in main, so main paths are normalized,
+                            //and remove any trailing .js, since different package
+                            //envs have different conventions: some use a module name,
+                            //some use a file name.
+                            main: (pkgObj.main || 'main')
+                                  .replace(currDirRegExp, '')
+                                  .replace(jsSuffixRegExp, '')
+                        };
+                    });
+
+                    //Done with modifications, assing packages back to context config
+                    config.pkgs = pkgs;
+                }
+
+                //If there are any "waiting to execute" modules in the registry,
+                //update the maps for them, since their info, like URLs to load,
+                //may have changed.
+                eachProp(registry, function (mod, id) {
+                    //If module already has init called, since it is too
+                    //late to modify them, and ignore unnormalized ones
+                    //since they are transient.
+                    if (!mod.inited && !mod.map.unnormalized) {
+                        mod.map = makeModuleMap(id);
+                    }
+                });
+
+                //If a deps array or a config callback is specified, then call
+                //require with those args. This is useful when require is defined as a
+                //config object before require.js is loaded.
+                if (cfg.deps || cfg.callback) {
+                    context.require(cfg.deps || [], cfg.callback);
+                }
+            },
+
+            makeShimExports: function (value) {
+                function fn() {
+                    var ret;
+                    if (value.init) {
+                        ret = value.init.apply(global, arguments);
+                    }
+                    return ret || (value.exports && getGlobal(value.exports));
+                }
+                return fn;
+            },
+
+            makeRequire: function (relMap, options) {
+                options = options || {};
+
+                function localRequire(deps, callback, errback) {
+                    var id, map, requireMod;
+
+                    if (options.enableBuildCallback && callback && isFunction(callback)) {
+                        callback.__requireJsBuild = true;
+                    }
+
+                    if (typeof deps === 'string') {
+                        if (isFunction(callback)) {
+                            //Invalid call
+                            return onError(makeError('requireargs', 'Invalid require call'), errback);
+                        }
+
+                        //If require|exports|module are requested, get the
+                        //value for them from the special handlers. Caveat:
+                        //this only works while module is being defined.
+                        if (relMap && hasProp(handlers, deps)) {
+                            return handlers[deps](registry[relMap.id]);
+                        }
+
+                        //Synchronous access to one module. If require.get is
+                        //available (as in the Node adapter), prefer that.
+                        if (req.get) {
+                            return req.get(context, deps, relMap, localRequire);
+                        }
+
+                        //Normalize module name, if it contains . or ..
+                        map = makeModuleMap(deps, relMap, false, true);
+                        id = map.id;
+
+                        if (!hasProp(defined, id)) {
+                            return onError(makeError('notloaded', 'Module name "' +
+                                        id +
+                                        '" has not been loaded yet for context: ' +
+                                        contextName +
+                                        (relMap ? '' : '. Use require([])')));
+                        }
+                        return defined[id];
+                    }
+
+                    //Grab defines waiting in the global queue.
+                    intakeDefines();
+
+                    //Mark all the dependencies as needing to be loaded.
+                    context.nextTick(function () {
+                        //Some defines could have been added since the
+                        //require call, collect them.
+                        intakeDefines();
+
+                        requireMod = getModule(makeModuleMap(null, relMap));
+
+                        //Store if map config should be applied to this require
+                        //call for dependencies.
+                        requireMod.skipMap = options.skipMap;
+
+                        requireMod.init(deps, callback, errback, {
+                            enabled: true
+                        });
+
+                        checkLoaded();
+                    });
+
+                    return localRequire;
+                }
+
+                mixin(localRequire, {
+                    isBrowser: isBrowser,
+
+                    /**
+                     * Converts a module name + .extension into an URL path.
+                     * *Requires* the use of a module name. It does not support using
+                     * plain URLs like nameToUrl.
+                     */
+                    toUrl: function (moduleNamePlusExt) {
+                        var ext,
+                            index = moduleNamePlusExt.lastIndexOf('.'),
+                            segment = moduleNamePlusExt.split('/')[0],
+                            isRelative = segment === '.' || segment === '..';
+
+                        //Have a file extension alias, and it is not the
+                        //dots from a relative path.
+                        if (index !== -1 && (!isRelative || index > 1)) {
+                            ext = moduleNamePlusExt.substring(index, moduleNamePlusExt.length);
+                            moduleNamePlusExt = moduleNamePlusExt.substring(0, index);
+                        }
+
+                        return context.nameToUrl(normalize(moduleNamePlusExt,
+                                                relMap && relMap.id, true), ext,  true);
+                    },
+
+                    defined: function (id) {
+                        return hasProp(defined, makeModuleMap(id, relMap, false, true).id);
+                    },
+
+                    specified: function (id) {
+                        id = makeModuleMap(id, relMap, false, true).id;
+                        return hasProp(defined, id) || hasProp(registry, id);
+                    }
+                });
+
+                //Only allow undef on top level require calls
+                if (!relMap) {
+                    localRequire.undef = function (id) {
+                        //Bind any waiting define() calls to this context,
+                        //fix for #408
+                        takeGlobalQueue();
+
+                        var map = makeModuleMap(id, relMap, true),
+                            mod = getOwn(registry, id);
+
+                        delete defined[id];
+                        delete urlFetched[map.url];
+                        delete undefEvents[id];
+
+                        if (mod) {
+                            //Hold on to listeners in case the
+                            //module will be attempted to be reloaded
+                            //using a different config.
+                            if (mod.events.defined) {
+                                undefEvents[id] = mod.events;
+                            }
+
+                            cleanRegistry(id);
+                        }
+                    };
+                }
+
+                return localRequire;
+            },
+
+            /**
+             * Called to enable a module if it is still in the registry
+             * awaiting enablement. A second arg, parent, the parent module,
+             * is passed in for context, when this method is overriden by
+             * the optimizer. Not shown here to keep code compact.
+             */
+            enable: function (depMap) {
+                var mod = getOwn(registry, depMap.id);
+                if (mod) {
+                    getModule(depMap).enable();
+                }
+            },
+
+            /**
+             * Internal method used by environment adapters to complete a load event.
+             * A load event could be a script load or just a load pass from a synchronous
+             * load call.
+             * @param {String} moduleName the name of the module to potentially complete.
+             */
+            completeLoad: function (moduleName) {
+                var found, args, mod,
+                    shim = getOwn(config.shim, moduleName) || {},
+                    shExports = shim.exports;
+
+                takeGlobalQueue();
+
+                while (defQueue.length) {
+                    args = defQueue.shift();
+                    if (args[0] === null) {
+                        args[0] = moduleName;
+                        //If already found an anonymous module and bound it
+                        //to this name, then this is some other anon module
+                        //waiting for its completeLoad to fire.
+                        if (found) {
+                            break;
+                        }
+                        found = true;
+                    } else if (args[0] === moduleName) {
+                        //Found matching define call for this script!
+                        found = true;
+                    }
+
+                    callGetModule(args);
+                }
+
+                //Do this after the cycle of callGetModule in case the result
+                //of those calls/init calls changes the registry.
+                mod = getOwn(registry, moduleName);
+
+                if (!found && !hasProp(defined, moduleName) && mod && !mod.inited) {
+                    if (config.enforceDefine && (!shExports || !getGlobal(shExports))) {
+                        if (hasPathFallback(moduleName)) {
+                            return;
+                        } else {
+                            return onError(makeError('nodefine',
+                                             'No define call for ' + moduleName,
+                                             null,
+                                             [moduleName]));
+                        }
+                    } else {
+                        //A script that does not call define(), so just simulate
+                        //the call for it.
+                        callGetModule([moduleName, (shim.deps || []), shim.exportsFn]);
+                    }
+                }
+
+                checkLoaded();
+            },
+
+            /**
+             * Converts a module name to a file path. Supports cases where
+             * moduleName may actually be just an URL.
+             * Note that it **does not** call normalize on the moduleName,
+             * it is assumed to have already been normalized. This is an
+             * internal API, not a public one. Use toUrl for the public API.
+             */
+            nameToUrl: function (moduleName, ext, skipExt) {
+                var paths, pkgs, pkg, pkgPath, syms, i, parentModule, url,
+                    parentPath;
+
+                //If a colon is in the URL, it indicates a protocol is used and it is just
+                //an URL to a file, or if it starts with a slash, contains a query arg (i.e. ?)
+                //or ends with .js, then assume the user meant to use an url and not a module id.
+                //The slash is important for protocol-less URLs as well as full paths.
+                if (req.jsExtRegExp.test(moduleName)) {
+                    //Just a plain path, not module name lookup, so just return it.
+                    //Add extension if it is included. This is a bit wonky, only non-.js things pass
+                    //an extension, this method probably needs to be reworked.
+                    url = moduleName + (ext || '');
+                } else {
+                    //A module that needs to be converted to a path.
+                    paths = config.paths;
+                    pkgs = config.pkgs;
+
+                    syms = moduleName.split('/');
+                    //For each module name segment, see if there is a path
+                    //registered for it. Start with most specific name
+                    //and work up from it.
+                    for (i = syms.length; i > 0; i -= 1) {
+                        parentModule = syms.slice(0, i).join('/');
+                        pkg = getOwn(pkgs, parentModule);
+                        parentPath = getOwn(paths, parentModule);
+                        if (parentPath) {
+                            //If an array, it means there are a few choices,
+                            //Choose the one that is desired
+                            if (isArray(parentPath)) {
+                                parentPath = parentPath[0];
+                            }
+                            syms.splice(0, i, parentPath);
+                            break;
+                        } else if (pkg) {
+                            //If module name is just the package name, then looking
+                            //for the main module.
+                            if (moduleName === pkg.name) {
+                                pkgPath = pkg.location + '/' + pkg.main;
+                            } else {
+                                pkgPath = pkg.location;
+                            }
+                            syms.splice(0, i, pkgPath);
+                            break;
+                        }
+                    }
+
+                    //Join the path parts together, then figure out if baseUrl is needed.
+                    url = syms.join('/');
+                    url += (ext || (/\?/.test(url) || skipExt ? '' : '.js'));
+                    url = (url.charAt(0) === '/' || url.match(/^[\w\+\.\-]+:/) ? '' : config.baseUrl) + url;
+                }
+
+                return config.urlArgs ? url +
+                                        ((url.indexOf('?') === -1 ? '?' : '&') +
+                                         config.urlArgs) : url;
+            },
+
+            //Delegates to req.load. Broken out as a separate function to
+            //allow overriding in the optimizer.
+            load: function (id, url) {
+                req.load(context, id, url);
+            },
+
+            /**
+             * Executes a module callback function. Broken out as a separate function
+             * solely to allow the build system to sequence the files in the built
+             * layer in the right sequence.
+             *
+             * @private
+             */
+            execCb: function (name, callback, args, exports) {
+                return callback.apply(exports, args);
+            },
+
+            /**
+             * callback for script loads, used to check status of loading.
+             *
+             * @param {Event} evt the event from the browser for the script
+             * that was loaded.
+             */
+            onScriptLoad: function (evt) {
+                //Using currentTarget instead of target for Firefox 2.0's sake. Not
+                //all old browsers will be supported, but this one was easy enough
+                //to support and still makes sense.
+                if (evt.type === 'load' ||
+                        (readyRegExp.test((evt.currentTarget || evt.srcElement).readyState))) {
+                    //Reset interactive script so a script node is not held onto for
+                    //to long.
+                    interactiveScript = null;
+
+                    //Pull out the name of the module and the context.
+                    var data = getScriptData(evt);
+                    context.completeLoad(data.id);
+                }
+            },
+
+            /**
+             * Callback for script errors.
+             */
+            onScriptError: function (evt) {
+                var data = getScriptData(evt);
+                if (!hasPathFallback(data.id)) {
+                    return onError(makeError('scripterror', 'Script error for: ' + data.id, evt, [data.id]));
+                }
+            }
+        };
+
+        context.require = context.makeRequire();
+        return context;
+    }
+
+    /**
+     * Main entry point.
+     *
+     * If the only argument to require is a string, then the module that
+     * is represented by that string is fetched for the appropriate context.
+     *
+     * If the first argument is an array, then it will be treated as an array
+     * of dependency string names to fetch. An optional function callback can
+     * be specified to execute when all of those dependencies are available.
+     *
+     * Make a local req variable to help Caja compliance (it assumes things
+     * on a require that are not standardized), and to give a short
+     * name for minification/local scope use.
+     */
+    req = requirejs = function (deps, callback, errback, optional) {
+
+        //Find the right context, use default
+        var context, config,
+            contextName = defContextName;
+
+        // Determine if have config object in the call.
+        if (!isArray(deps) && typeof deps !== 'string') {
+            // deps is a config object
+            config = deps;
+            if (isArray(callback)) {
+                // Adjust args if there are dependencies
+                deps = callback;
+                callback = errback;
+                errback = optional;
+            } else {
+                deps = [];
+            }
+        }
+
+        if (config && config.context) {
+            contextName = config.context;
+        }
+
+        context = getOwn(contexts, contextName);
+        if (!context) {
+            context = contexts[contextName] = req.s.newContext(contextName);
+        }
+
+        if (config) {
+            context.configure(config);
+        }
+
+        return context.require(deps, callback, errback);
+    };
+
+    /**
+     * Support require.config() to make it easier to cooperate with other
+     * AMD loaders on globally agreed names.
+     */
+    req.config = function (config) {
+        return req(config);
+    };
+
+    /**
+     * Execute something after the current tick
+     * of the event loop. Override for other envs
+     * that have a better solution than setTimeout.
+     * @param  {Function} fn function to execute later.
+     */
+    req.nextTick = typeof setTimeout !== 'undefined' ? function (fn) {
+        setTimeout(fn, 4);
+    } : function (fn) { fn(); };
+
+    /**
+     * Export require as a global, but only if it does not already exist.
+     */
+    if (!require) {
+        require = req;
+    }
+
+    req.version = version;
+
+    //Used to filter out dependencies that are already paths.
+    req.jsExtRegExp = /^\/|:|\?|\.js$/;
+    req.isBrowser = isBrowser;
+    s = req.s = {
+        contexts: contexts,
+        newContext: newContext
+    };
+
+    //Create default context.
+    req({});
+
+    //Exports some context-sensitive methods on global require.
+    each([
+        'toUrl',
+        'undef',
+        'defined',
+        'specified'
+    ], function (prop) {
+        //Reference from contexts instead of early binding to default context,
+        //so that during builds, the latest instance of the default context
+        //with its config gets used.
+        req[prop] = function () {
+            var ctx = contexts[defContextName];
+            return ctx.require[prop].apply(ctx, arguments);
+        };
+    });
+
+    if (isBrowser) {
+        head = s.head = document.getElementsByTagName('head')[0];
+        //If BASE tag is in play, using appendChild is a problem for IE6.
+        //When that browser dies, this can be removed. Details in this jQuery bug:
+        //http://dev.jquery.com/ticket/2709
+        baseElement = document.getElementsByTagName('base')[0];
+        if (baseElement) {
+            head = s.head = baseElement.parentNode;
+        }
+    }
+
+    /**
+     * Any errors that require explicitly generates will be passed to this
+     * function. Intercept/override it if you want custom error handling.
+     * @param {Error} err the error object.
+     */
+    req.onError = defaultOnError;
+
+    /**
+     * Does the request to load a module for the browser case.
+     * Make this a separate function to allow other environments
+     * to override it.
+     *
+     * @param {Object} context the require context to find state.
+     * @param {String} moduleName the name of the module.
+     * @param {Object} url the URL to the module.
+     */
+    req.load = function (context, moduleName, url) {
+        var config = (context && context.config) || {},
+            node;
+        if (isBrowser) {
+            //In the browser so use a script tag
+            node = config.xhtml ?
+                    document.createElementNS('http://www.w3.org/1999/xhtml', 'html:script') :
+                    document.createElement('script');
+            node.type = config.scriptType || 'text/javascript';
+            node.charset = 'utf-8';
+            node.async = true;
+
+            node.setAttribute('data-requirecontext', context.contextName);
+            node.setAttribute('data-requiremodule', moduleName);
+
+            //Set up load listener. Test attachEvent first because IE9 has
+            //a subtle issue in its addEventListener and script onload firings
+            //that do not match the behavior of all other browsers with
+            //addEventListener support, which fire the onload event for a
+            //script right after the script execution. See:
+            //https://connect.microsoft.com/IE/feedback/details/648057/script-onload-event-is-not-fired-immediately-after-script-execution
+            //UNFORTUNATELY Opera implements attachEvent but does not follow the script
+            //script execution mode.
+            if (node.attachEvent &&
+                    //Check if node.attachEvent is artificially added by custom script or
+                    //natively supported by browser
+                    //read https://github.com/jrburke/requirejs/issues/187
+                    //if we can NOT find [native code] then it must NOT natively supported.
+                    //in IE8, node.attachEvent does not have toString()
+                    //Note the test for "[native code" with no closing brace, see:
+                    //https://github.com/jrburke/requirejs/issues/273
+                    !(node.attachEvent.toString && node.attachEvent.toString().indexOf('[native code') < 0) &&
+                    !isOpera) {
+                //Probably IE. IE (at least 6-8) do not fire
+                //script onload right after executing the script, so
+                //we cannot tie the anonymous define call to a name.
+                //However, IE reports the script as being in 'interactive'
+                //readyState at the time of the define call.
+                useInteractive = true;
+
+                node.attachEvent('onreadystatechange', context.onScriptLoad);
+                //It would be great to add an error handler here to catch
+                //404s in IE9+. However, onreadystatechange will fire before
+                //the error handler, so that does not help. If addEventListener
+                //is used, then IE will fire error before load, but we cannot
+                //use that pathway given the connect.microsoft.com issue
+                //mentioned above about not doing the 'script execute,
+                //then fire the script load event listener before execute
+                //next script' that other browsers do.
+                //Best hope: IE10 fixes the issues,
+                //and then destroys all installs of IE 6-9.
+                //node.attachEvent('onerror', context.onScriptError);
+            } else {
+                node.addEventListener('load', context.onScriptLoad, false);
+                node.addEventListener('error', context.onScriptError, false);
+            }
+            node.src = url;
+
+            //For some cache cases in IE 6-8, the script executes before the end
+            //of the appendChild execution, so to tie an anonymous define
+            //call to the module name (which is stored on the node), hold on
+            //to a reference to this node, but clear after the DOM insertion.
+            currentlyAddingScript = node;
+            if (baseElement) {
+                head.insertBefore(node, baseElement);
+            } else {
+                head.appendChild(node);
+            }
+            currentlyAddingScript = null;
+
+            return node;
+        } else if (isWebWorker) {
+            try {
+                //In a web worker, use importScripts. This is not a very
+                //efficient use of importScripts, importScripts will block until
+                //its script is downloaded and evaluated. However, if web workers
+                //are in play, the expectation that a build has been done so that
+                //only one script needs to be loaded anyway. This may need to be
+                //reevaluated if other use cases become common.
+                importScripts(url);
+
+                //Account for anonymous modules
+                context.completeLoad(moduleName);
+            } catch (e) {
+                context.onError(makeError('importscripts',
+                                'importScripts failed for ' +
+                                    moduleName + ' at ' + url,
+                                e,
+                                [moduleName]));
+            }
+        }
+    };
+
+    function getInteractiveScript() {
+        if (interactiveScript && interactiveScript.readyState === 'interactive') {
+            return interactiveScript;
+        }
+
+        eachReverse(scripts(), function (script) {
+            if (script.readyState === 'interactive') {
+                return (interactiveScript = script);
+            }
+        });
+        return interactiveScript;
+    }
+
+    //Look for a data-main script attribute, which could also adjust the baseUrl.
+    if (isBrowser) {
+        //Figure out baseUrl. Get it from the script tag with require.js in it.
+        eachReverse(scripts(), function (script) {
+            //Set the 'head' where we can append children by
+            //using the script's parent.
+            if (!head) {
+                head = script.parentNode;
+            }
+
+            //Look for a data-main attribute to set main script for the page
+            //to load. If it is there, the path to data main becomes the
+            //baseUrl, if it is not already set.
+            dataMain = script.getAttribute('data-main');
+            if (dataMain) {
+                //Preserve dataMain in case it is a path (i.e. contains '?')
+                mainScript = dataMain;
+
+                //Set final baseUrl if there is not already an explicit one.
+                if (!cfg.baseUrl) {
+                    //Pull off the directory of data-main for use as the
+                    //baseUrl.
+                    src = mainScript.split('/');
+                    mainScript = src.pop();
+                    subPath = src.length ? src.join('/')  + '/' : './';
+
+                    cfg.baseUrl = subPath;
+                }
+
+                //Strip off any trailing .js since mainScript is now
+                //like a module name.
+                mainScript = mainScript.replace(jsSuffixRegExp, '');
+
+                 //If mainScript is still a path, fall back to dataMain
+                if (req.jsExtRegExp.test(mainScript)) {
+                    mainScript = dataMain;
+                }
+
+                //Put the data-main script in the files to load.
+                cfg.deps = cfg.deps ? cfg.deps.concat(mainScript) : [mainScri

<TRUNCATED>

[33/51] [abbrv] [partial] brooklyn-ui git commit: move subdir from incubator up a level as it is promoted to its own repo (first non-incubator commit!)

Posted by he...@apache.org.
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/js/view/change-name-invoke.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/js/view/change-name-invoke.js b/brooklyn-ui/src/main/webapp/assets/js/view/change-name-invoke.js
deleted file mode 100644
index 30c2277..0000000
--- a/brooklyn-ui/src/main/webapp/assets/js/view/change-name-invoke.js
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-/**
- * Render entity expungement as a modal
- */
-define([
-    "underscore", "jquery", "backbone", "brooklyn-utils",
-    "text!tpl/apps/change-name-modal.html"
-], function(_, $, Backbone, Util, ChangeNameModalHtml) {
-    return Backbone.View.extend({
-        template: _.template(ChangeNameModalHtml),
-        initialize: function() {
-            this.title = "Change Name of "+this.options.entity.get('name');
-        },
-        render: function() {
-            this.$el.html(this.template({ name: this.options.entity.get('name') }));
-            return this;
-        },
-        onSubmit: function() {
-            var self = this;
-            var newName = this.$("#new-name").val();
-            var url = this.options.entity.get('links').rename + "?name=" + encodeURIComponent(newName);
-            var ajax = $.ajax({
-                type: "POST",
-                url: url,
-                contentType: "application/json",
-                success: function() {
-                    self.options.target.reload();
-                },
-                error: function(response) {
-                    self.showError(Util.extractError(response, "Error contacting server", url));
-                }
-            });
-            return ajax;
-        },
-        showError: function (message) {
-            this.$(".change-name-error-container").removeClass("hide");
-            this.$(".change-name-error-message").html(message);
-        }
-    });
-});

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/js/view/effector-invoke.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/js/view/effector-invoke.js b/brooklyn-ui/src/main/webapp/assets/js/view/effector-invoke.js
deleted file mode 100644
index 7c9e0bd..0000000
--- a/brooklyn-ui/src/main/webapp/assets/js/view/effector-invoke.js
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-/**
- * Render an entity effector as a modal.
- */
-define([
-    "underscore", "jquery", "backbone",
-    "model/location",
-    "text!tpl/apps/effector-modal.html",
-    "text!tpl/app-add-wizard/deploy-location-row.html", 
-    "text!tpl/app-add-wizard/deploy-location-option.html",
-    "text!tpl/apps/param.html",
-    "text!tpl/apps/param-list.html",
-    "bootstrap"
-], function (_, $, Backbone, Location, EffectorModalHtml, 
-        DeployLocationRowHtml, DeployLocationOptionHtml, ParamHtml, ParamListHtml) {
-
-    var EffectorInvokeView = Backbone.View.extend({
-        template:_.template(EffectorModalHtml),
-        locationRowTemplate:_.template(DeployLocationRowHtml),
-        locationOptionTemplate:_.template(DeployLocationOptionHtml),
-        effectorParam:_.template(ParamHtml),
-        effectorParamList:_.template(ParamListHtml),
-
-        events:{
-            "click .invoke-effector":"invokeEffector",
-            "shown": "onShow",
-            "hide": "onHide"
-        },
-
-        initialize:function () {
-            this.locations = this.options.locations /* for testing */
-              || new Location.Collection();
-        },
-
-        onShow: function() {
-            this.delegateEvents();
-            this.$el.fadeTo(500,1);
-        },
-
-        onHide: function() {
-            this.undelegateEvents();
-        },
-
-        render:function () {
-            var that = this, params = this.model.get("parameters")
-            this.$el.html(this.template({
-                name:this.model.get("name"),
-                entityName:this.options.entity.get("name"),
-                description:this.model.get("description")?this.model.get("description"):""
-            }))
-            // do we have parameters to render?
-            if (params.length !== 0) {
-                this.$(".modal-body").html(this.effectorParamList({}))
-                // select the body of the table we just rendered and append params
-                var $tbody = this.$("tbody")
-                _(params).each(function (param) {
-                    // TODO: this should be another view whose implementation is specific to
-                    // the type of the parameter (i.e. text, dates, checkboxes etc. can all
-                    // be handled separately).
-                    $tbody.append(that.effectorParam({
-                        name:param.name,
-                        type:param.type,
-                        description:param.description?param.description:"",
-                        defaultValue:param.defaultValue
-                    }))
-                })
-                var container = this.$("#selector-container")
-                if (container.length) {                    
-                    this.locations.fetch({async:false})
-                    container.empty()
-                    var chosenLocation = this.locations[0];
-                    container.append(that.locationRowTemplate({
-                        initialValue : chosenLocation,
-                        rowId : 0
-                    }))
-                    var $selectLocations = container.find('.select-location')
-                        .append(this.locationOptionTemplate({
-                                id: "",
-                                name: "None"
-                            }))
-                        .append("<option disabled>------</option>");
-                    this.locations.each(function(aLocation) {
-                        var $option = that.locationOptionTemplate({
-                            id:aLocation.id,
-                            url:aLocation.getLinkByName("self"),
-                            name:aLocation.getPrettyName()
-                        })
-                        $selectLocations.append($option)
-                    })
-                    $selectLocations.each(function(i) {
-                        var url = $($selectLocations[i]).parent().attr('initialValue');
-                        $($selectLocations[i]).val(url)
-                    })
-                }
-            }
-            this.$(".modal-body").find('*[rel="tooltip"]').tooltip()
-            return this
-        },
-
-        extractParamsFromTable:function () {
-            var parameters = {};
-
-            // iterate over the rows
-            // TODO: this should be generic alongside the rendering of parameters.
-            this.$(".effector-param").each(function (index) {
-                var key = $(this).find(".param-name").text();
-                var valElement = $(this).find(".param-value");
-                var value;
-                if (valElement.attr('id') == 'selector-container') {
-                    value = $(this).find(".param-value option:selected").attr("value")
-                } else if (valElement.is(":checkbox")) {
-                    value = ("checked" == valElement.attr("checked")) ? "true" : "false";
-                } else {
-                    value = valElement.val();
-                }
-                //treat empty field as null value
-                if (value !== '') {
-                    parameters[key] = value;
-                }
-            });
-            return parameters
-        },
-
-        invokeEffector:function () {
-            var that = this
-            var url = this.model.getLinkByName("self")
-            var parameters = this.extractParamsFromTable()
-            this.$el.fadeTo(500,0.5);
-            $.ajax({
-                type:"POST",
-                url:url+"?timeout=0",
-                data:JSON.stringify(parameters),
-                contentType:"application/json",
-                success:function (data) {
-                    that.$el.modal("hide")
-                    that.$el.fadeTo(500,1);
-                    if (that.options.openTask)
-                        that.options.tabView.openTab('activities/subtask/'+data.id);
-                },
-                error: function(data) {
-                    that.$el.fadeTo(100,1).delay(200).fadeTo(200,0.2).delay(200).fadeTo(200,1);
-                    // TODO render the error better than poor-man's flashing
-                    // (would just be connection error -- with timeout=0 we get a task even for invalid input)
-                    
-                    console.error("ERROR invoking effector")
-                    console.debug(data)
-                }})
-            // un-delegate events
-            this.undelegateEvents()
-        }
-
-    })
-    return EffectorInvokeView
-})

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/js/view/entity-activities.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/js/view/entity-activities.js b/brooklyn-ui/src/main/webapp/assets/js/view/entity-activities.js
deleted file mode 100644
index 07dc948..0000000
--- a/brooklyn-ui/src/main/webapp/assets/js/view/entity-activities.js
+++ /dev/null
@@ -1,249 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-/**
- * Displays the list of activities/tasks the entity performed.
- */
-define([
-    "underscore", "jquery", "backbone", "brooklyn-utils", "view/viewutils",
-    "view/activity-details",
-    "text!tpl/apps/activities.html", "text!tpl/apps/activity-table.html", 
-    "text!tpl/apps/activity-row-details.html", "text!tpl/apps/activity-row-details-main.html",
-    "text!tpl/apps/activity-full-details.html", 
-    "bootstrap", "jquery-datatables", "datatables-extensions", "moment"
-], function (_, $, Backbone, Util, ViewUtils, ActivityDetailsView, 
-    ActivitiesHtml, ActivityTableHtml, ActivityRowDetailsHtml, ActivityRowDetailsMainHtml, ActivityFullDetailsHtml) {
-
-    var ActivitiesView = Backbone.View.extend({
-        template:_.template(ActivitiesHtml),
-        table:null,
-        refreshActive:true,
-        selectedId:null,
-        selectedRow:null,
-        events:{
-            "click #activities-root .activity-table tr":"rowClick",
-            'click #activities-root .refresh':'refreshNow',
-            'click #activities-root .toggleAutoRefresh':'toggleAutoRefresh',
-            'click #activities-root .showDrillDown':'showDrillDown',
-            'click #activities-root .toggleFullDetail':'toggleFullDetail'
-        },
-        initialize:function () {
-            _.bindAll(this)
-            this.$el.html(this.template({ }));
-            this.$('#activities-root').html(_.template(ActivityTableHtml))
-            var that = this,
-                $table = that.$('#activities-root .activity-table');
-            that.collection.url = that.model.getLinkByName("activities");
-            that.table = ViewUtils.myDataTable($table, {
-                "fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
-                    $(nRow).attr('id', aData[0])
-                    $(nRow).addClass('activity-row')
-                },
-                "aaSorting": [[ 2, "desc" ]],
-                "aoColumnDefs": [
-                                 {
-                                     "mRender": function ( data, type, row ) {
-                                         return Util.escape(data)
-                                     },
-                                     "aTargets": [ 1, 3 ]
-                                 },
-                                 {
-                                     "mRender": function ( data, type, row ) {
-                                         if ( type === 'display' ) {
-                                             data = moment(data).calendar();
-                                         }
-                                         return Util.escape(data)
-                                     },
-                                     "aTargets": [ 2 ]
-                                 },
-                                 { "bVisible": false,  "aTargets": [ 0 ] }
-                             ]            
-            });
-            
-            // TODO domain-specific filters
-            ViewUtils.addAutoRefreshButton(that.table);
-            ViewUtils.addRefreshButton(that.table);
-            
-            ViewUtils.fadeToIndicateInitialLoad($table);
-            that.collection.on("reset", that.renderOnLoad, that);
-            ViewUtils.fetchRepeatedlyWithDelay(this, this.collection, 
-                    { fetchOptions: { reset: true }, doitnow: true, 
-                    enablement: function() { return that.refreshActive }  });
-        },
-        refreshNow: function() {
-            this.collection.fetch({reset: true});
-        },
-        render:function () {
-            this.updateActivitiesNow();
-            var details = this.options.tabView ? this.options.tabView.options.preselectTabDetails : null;
-            if (details && details!=this.lastPreselectTabDetails) {
-                this.lastPreselectTabDetails = details;
-                // should be a path
-                this.queuedTasksToOpen = details.split("/");
-            }
-            this.tryOpenQueuedTasks();
-            return this;
-        },
-        tryOpenQueuedTasks: function() {
-            if (!this.queuedTasksToOpen || this.tryingOpenQueuedTasks) return;
-            this.openingQueuedTasks = true;
-            var $lastActivityPanel = null;
-            while (true) {
-                var task = this.queuedTasksToOpen.shift();
-                if (task == undefined) {
-                    this.openingQueuedTasks = false;                    
-                    return;
-                }
-                if (task == 'subtask') {
-                    var subtask = this.queuedTasksToOpen.shift();
-                    $lastActivityPanel = this.showDrillDownTask(subtask, $lastActivityPanel);
-                } else {
-                    log("unknown queued task for activities panel: "+task)
-                    // skip it, just continue
-                }
-            }
-        },
-        beforeClose:function () {
-            this.collection.off("reset", this.renderOnLoad);
-        },
-        renderOnLoad: function() {
-            this.loaded = true;
-            this.render();
-            ViewUtils.cancelFadeOnceLoaded(this.table);
-        },
-        toggleAutoRefresh:function () {
-            ViewUtils.toggleAutoRefresh(this);
-        },
-        enableAutoRefresh: function(isEnabled) {
-            this.refreshActive = isEnabled
-        },
-        refreshNow: function() {
-            this.collection.fetch();
-            this.table.fnAdjustColumnSizing();
-        },
-        updateActivitiesNow: function() {
-            var that = this;
-            if (this.table == null || this.collection.length==0 || this.viewIsClosed) {
-                // nothing to do
-            } else {
-                var topLevelTasks = []
-                for (taskI in this.collection.models) {
-                    var task = this.collection.models[taskI]
-                    var submitter = task.get("submittedByTask")
-                    if ((submitter==null) ||
-                        (submitter!=null && this.collection.get(submitter.metadata.id)==null)
-                    ) {                        
-                        topLevelTasks.push(task)
-                    }
-                }
-                ViewUtils.updateMyDataTable(that.table, topLevelTasks, function(task, index) {
-                    return [ task.get("id"),
-                             task.get("displayName"),
-                             task.get("submitTimeUtc"),
-                             task.get("currentStatus")
-                    ]; 
-                });
-                this.showDetailRow(true);
-            }
-            return this;
-        },
-        rowClick:function(evt) {
-            var row = $(evt.currentTarget).closest("tr");
-            var id = row.attr("id");
-            if (id==null)
-                // is the details row, ignore click here
-                return;
-            this.showDrillDownTask(id);
-            return;
-        },
-        showDrillDown: function(event) {
-            this.showDrillDownTask($(event.currentTarget).closest("td.row-expansion").attr("id"));
-        },
-        showDrillDownTask: function(taskId, optionalParent) {  
-//            log("showing initial drill down "+taskId)
-            var that = this;
-            
-            var activityDetailsPanel = new ActivityDetailsView({
-                taskId: taskId,
-                tabView: that,
-                collection: this.collection,
-                breadcrumbs: ''
-            })
-            activityDetailsPanel.addToView(optionalParent || this.$(".activity-table"));
-            return activityDetailsPanel.$el;
-        },
-        
-        showDetailRow: function(updateOnly) {
-            var id = this.selectedId,
-                that = this;
-            if (id==null) return;
-            var task = this.collection.get(id);
-            if (task==null) return;
-            if (!updateOnly) {
-                var html = _.template(ActivityRowDetailsHtml, { 
-                    task: task==null ? null : task.attributes,
-                    link: that.model.getLinkByName("activities")+"/"+id,
-                    updateOnly: updateOnly
-                })
-                $('tr#'+id).next().find('td.row-expansion').html(html)
-                $('tr#'+id).next().find('td.row-expansion').attr('id', id)
-            } else {
-                // just update
-                $('tr#'+id).next().find('.task-description').html(Util.escape(task.attributes.description))
-            }
-            
-            var html = _.template(ActivityRowDetailsMainHtml, { 
-                task: task==null ? null : task.attributes,
-                link: that.model.getLinkByName("activities")+"/"+id,
-                updateOnly: updateOnly 
-            })
-            $('tr#'+id).next().find('.expansion-main').html(html)
-            
-            
-            if (!updateOnly) {
-                $('tr#'+id).next().find('.row-expansion .opened-row-details').hide()
-                $('tr#'+id).next().find('.row-expansion .opened-row-details').slideDown(300)
-            }
-        },
-        toggleFullDetail: function(evt) {
-            var i = $('.toggleFullDetail');
-            var id = i.closest("td.row-expansion").attr('id')
-            i.toggleClass('active')
-            if (i.hasClass('active'))
-                this.showFullActivity(id)
-            else
-                this.hideFullActivity(id)
-        },
-        showFullActivity: function(id) {
-            id = this.selectedId
-            var $details = $("td.row-expansion#"+id+" .expansion-footer");
-            var task = this.collection.get(id);
-            var html = _.template(ActivityFullDetailsHtml, { task: task });
-            $details.html(html);
-            $details.slideDown(100);
-            _.defer(function() { ViewUtils.setHeightAutomatically($('textarea',$details), 30, 200) })
-        },
-        hideFullActivity: function(id) {
-            id = this.selectedId
-            var $details = $("td.row-expansion#"+id+" .expansion-footer");
-            $details.slideUp(100);
-        }
-    });
-
-    return ActivitiesView;
-});

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/js/view/entity-advanced.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/js/view/entity-advanced.js b/brooklyn-ui/src/main/webapp/assets/js/view/entity-advanced.js
deleted file mode 100644
index fe18430..0000000
--- a/brooklyn-ui/src/main/webapp/assets/js/view/entity-advanced.js
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-/**
- * Render entity advanced tab.
- *
- * @type {*}
- */
-define(["underscore", "jquery", "backbone", "brooklyn", "brooklyn-utils", "view/viewutils",
-    "text!tpl/apps/advanced.html", "view/change-name-invoke", "view/add-child-invoke", "view/policy-new"
-], function(_, $, Backbone, Brooklyn, Util, ViewUtils,
-        AdvancedHtml, ChangeNameInvokeView, AddChildInvokeView, NewPolicyView) {
-    var EntityAdvancedView = Backbone.View.extend({
-        events: {
-            "click button#change-name": "showChangeNameModal",
-            "click button#add-child": "showAddChildModal",
-            "click button#add-new-policy": "showNewPolicyModal",
-            "click button#reset-problems": "confirmResetProblems",
-            "click button#expunge": "confirmExpunge",
-            "click button#unmanage": "confirmUnmanage",
-            "click #advanced-tab-error-closer": "closeAdvancedTabError"
-        },
-        template: _.template(AdvancedHtml),
-        initialize:function() {
-            _.bindAll(this);
-            this.$el.html(this.template());
-
-            this.model.on('change', this.modelChange, this);
-            this.modelChange();
-            
-            ViewUtils.getRepeatedlyWithDelay(this, this.model.get('links').locations, this.renderLocationData);
-            ViewUtils.get(this, this.model.get('links').tags, this.renderTags);
-            
-            ViewUtils.attachToggler(this.$el);
-        },
-        modelChange: function() {
-            this.$('#entity-name').html(Util.toDisplayString(this.model.get("name")));
-            ViewUtils.updateTextareaWithData($("#advanced-entity-json", this.$el), Util.toTextAreaString(this.model), true, false, 250, 600);
-        },
-        renderLocationData: function(data) {
-            ViewUtils.updateTextareaWithData($("#advanced-locations", this.$el), Util.toTextAreaString(data), true, false, 250, 600);
-        },
-        renderTags: function(data) {
-            var list = "";
-            for (tag in data)
-                list += "<div class='activity-tag-giftlabel'>"+Util.toDisplayString(data[tag])+"</div>";
-            if (!list) list = "No tags";
-            this.$('#advanced-entity-tags').html(list);
-        },
-        reload: function() {
-            this.model.fetch();
-        },
-        
-        showModal: function(modal) {
-            if (this.activeModal)
-                this.activeModal.close();
-            this.activeModal = modal;
-            Brooklyn.view.showModalWith(modal);
-        },
-        showChangeNameModal: function() {
-            this.showModal(new ChangeNameInvokeView({
-                entity: this.model,
-                target:this
-            }));
-        },
-        showAddChildModal: function() {
-            this.showModal(new AddChildInvokeView({
-                entity: this.model,
-                target:this
-            }));
-        },
-        showNewPolicyModal: function () {
-            this.showModal(new NewPolicyView({
-                entity: this.model,
-            }));
-        },
-        
-        confirmResetProblems: function () {
-            var entity = this.model.get("name");
-            var title = "Confirm the reset of problem indicators in " + entity;
-            var q = "<p>Are you sure you want to reset the problem indicators for this entity?</p>" +
-                "<p>If a problem has been fixed externally, but the fix is not being detected, this will clear problems. " +
-                "If the problem is not actually fixed, many feeds and enrichers will re-detect it, but note that some may not, " +
-                "and the entity may show as healthy when it is not." +
-                "</p>";
-            Brooklyn.view.requestConfirmation(q, title).done(this.doResetProblems);
-        },
-        doResetProblems: function() {
-            this.post(this.model.get('links').sensors+"/"+"service.notUp.indicators", {});
-            this.post(this.model.get('links').sensors+"/"+"service.problems", {});
-        },
-        post: function(url, data) {
-            var self = this;
-            
-            $.ajax({
-                type: "POST",
-                url: url,
-                data: JSON.stringify(data),
-                contentType: "application/json",
-                success: function() {
-                    self.reload();
-                },
-                error: function(response) {
-                    self.showAdvancedTabError(Util.extractError(response, "Error contacting server", url));
-                }
-            });
-        },
-        
-        confirmExpunge: function () {
-            var entity = this.model.get("name");
-            var title = "Confirm the expunging of " + entity;
-            var q = "<p>Are you certain you want to expunge this entity?</p>" +
-                "<p>When possible, Brooklyn will delete all of its resources.</p>" +
-                "<p><span class='label label-important'>Important</span> " +
-                "<b>This action is irreversible</b></p>";
-            this.unmanageAndOrExpunge(q, title, true);
-        },
-        confirmUnmanage: function () {
-            var entity = this.model.get("name");
-            var title = "Confirm the unmanagement of " + entity;
-            var q = "<p>Are you certain you want to unmanage this entity?</p>" +
-            "<p>Its resources will be left running.</p>" +
-            "<p><span class='label label-important'>Important</span> " +
-            "<b>This action is irreversible</b></p>";
-            this.unmanageAndOrExpunge(q, title, false);
-        },
-        unmanageAndOrExpunge: function (question, title, releaseResources) {
-            var self = this;
-            Brooklyn.view.requestConfirmation(question, title).done(function() {
-                return $.ajax({
-                    type: "POST",
-                    url: self.model.get("links").expunge + "?release=" + releaseResources + "&timeout=0",
-                    contentType: "application/json"
-                }).done(function() {
-                    self.trigger("entity.expunged");
-                }).fail(function() {
-                    // (would just be connection error -- with timeout=0 we get a task even for invalid input)
-                    self.showAdvancedTabError("Error connecting to Brooklyn server");
-                    
-                    log("ERROR unmanaging/expunging");
-                    log(data);
-                });
-            });
-        },
-
-        showAdvancedTabError: function(errorMessage) {
-            self.$("#advanced-tab-error-message").html(_.escape(errorMessage));
-            self.$("#advanced-tab-error-section").removeClass("hide");
-        },
-        closeAdvancedTabError: function() {
-            self.$("#advanced-tab-error-section").addClass("hide");
-        },
-        
-        beforeClose:function() {
-            if (this.activeModal)
-                this.activeModal.close();
-            this.options.tabView.configView.close();
-            this.model.off();
-        }
-    });
-    return EntityAdvancedView;
-});
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/js/view/entity-config.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/js/view/entity-config.js b/brooklyn-ui/src/main/webapp/assets/js/view/entity-config.js
deleted file mode 100644
index f517bcb..0000000
--- a/brooklyn-ui/src/main/webapp/assets/js/view/entity-config.js
+++ /dev/null
@@ -1,516 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-/**
- * Render entity config tab.
- *
- * @type {*}
- */
-define([
-    "underscore", "jquery", "backbone", "brooklyn-utils", "zeroclipboard", "view/viewutils", 
-    "model/config-summary", "text!tpl/apps/config.html", "text!tpl/apps/config-name.html",
-    "jquery-datatables", "datatables-extensions"
-], function (_, $, Backbone, Util, ZeroClipboard, ViewUtils, ConfigSummary, ConfigHtml, ConfigNameHtml) {
-
-    // TODO consider extracting all such usages to a shared ZeroClipboard wrapper?
-    ZeroClipboard.config({ moviePath: '//cdnjs.cloudflare.com/ajax/libs/zeroclipboard/1.3.1/ZeroClipboard.swf' });
-
-    var configHtml = _.template(ConfigHtml),
-        configNameHtml = _.template(ConfigNameHtml);
-
-    // TODO refactor to share code w entity-sensors.js
-    // in meantime, see notes there!
-    var EntityConfigView = Backbone.View.extend({
-        template: configHtml,
-        configMetadata:{},
-        refreshActive:true,
-        zeroClipboard: null,
-        
-        events:{
-            'click .refresh':'updateConfigNow',
-            'click .filterEmpty':'toggleFilterEmpty',
-            'click .toggleAutoRefresh':'toggleAutoRefresh',
-            'click #config-table div.secret-info':'toggleSecrecyVisibility',
-
-            'mouseup .valueOpen':'valueOpen',
-            'mouseover #config-table tbody tr':'noteFloatMenuActive',
-            'mouseout #config-table tbody tr':'noteFloatMenuSeemsInactive',
-            'mouseover .floatGroup':'noteFloatMenuActive',
-            'mouseout .floatGroup':'noteFloatMenuSeemsInactive',
-            'mouseover .clipboard-item':'noteFloatMenuActiveCI',
-            'mouseout .clipboard-item':'noteFloatMenuSeemsInactiveCI',
-            'mouseover .hasFloatLeft':'showFloatLeft',
-            'mouseover .hasFloatDown':'enterFloatDown',
-            'mouseout .hasFloatDown':'exitFloatDown',
-            'mouseup .light-popup-menu-item':'closeFloatMenuNow',
-        },
-        
-        initialize:function () {
-            _.bindAll(this);
-            this.$el.html(this.template());
-            
-            var that = this,
-                $table = this.$('#config-table');
-            that.table = ViewUtils.myDataTable($table, {
-                "fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
-                    $(nRow).attr('id', aData[0]);
-                    $('td',nRow).each(function(i,v){
-                        if (i==1) $(v).attr('class','config-value');
-                    });
-                    return nRow;
-                },
-                "aoColumnDefs": [
-                                 { // name (with tooltip)
-                                     "mRender": function ( data, type, row ) {
-                                         // name (column 1) should have tooltip title
-                                         var actions = that.getConfigActions(data.name);
-                                         // if data.description or .type is absent we get an error in html rendering (js)
-                                         // unless we set it explicitly (there is probably a nicer way to do this however?)
-                                         var context = _.extend(data, { 
-                                             description: data['description'], type: data['type']});
-                                         return configNameHtml(context);
-                                     },
-                                     "aTargets": [ 1 ]
-                                 },
-                                 { // value
-                                     "mRender": function ( data, type, row ) {
-                                         var escapedValue = Util.toDisplayString(data);
-                                         if (type!='display')
-                                             return escapedValue;
-                                         
-                                         var hasEscapedValue = (escapedValue!=null && (""+escapedValue).length > 0);
-                                             configName = row[0],
-                                             actions = that.getConfigActions(configName);
-                                         
-                                         // NB: the row might not yet exist
-                                         var $row = $('tr[id="'+configName+'"]');
-                                         
-                                         // datatables doesn't seem to expose any way to modify the html in place for a cell,
-                                         // so we rebuild
-                                         
-                                         var result = "<span class='value'>"+(hasEscapedValue ? escapedValue : '')+"</span>";
-                                         
-                                         var isSecret = Util.isSecret(configName);
-                                         if (isSecret) {
-                                            result += "<span class='secret-indicator'>(hidden)</span>";
-                                         }
-                                         
-                                         if (actions.open)
-                                             result = "<a href='"+actions.open+"'>" + result + "</a>";
-                                         if (escapedValue==null || escapedValue.length < 3)
-                                             // include whitespace so we can click on it, if it's really small
-                                             result += "&nbsp;&nbsp;&nbsp;&nbsp;";
-
-                                         var existing = $row.find('.dynamic-contents');
-                                         // for the json url, use the full url (relative to window.location.href)
-                                         var jsonUrl = actions.json ? new URI(actions.json).resolve(new URI(window.location.href)).toString() : null;
-                                         // prefer to update in place, so menus don't disappear, also more efficient
-                                         // (but if menu is changed, we do recreate it)
-                                         if (existing.length>0) {
-                                             if (that.checkFloatMenuUpToDate($row, actions.open, '.actions-open', 'open-target') &&
-                                                 that.checkFloatMenuUpToDate($row, escapedValue, '.actions-copy') &&
-                                                 that.checkFloatMenuUpToDate($row, actions.json, '.actions-json-open', 'open-target') &&
-                                                 that.checkFloatMenuUpToDate($row, jsonUrl, '.actions-json-copy', 'copy-value')) {
-//                                                 log("updating in place "+configName)
-                                                 existing.html(result);
-                                                 return $row.find('td.config-value').html();
-                                             }
-                                         }
-                                         
-                                         // build the menu - either because it is the first time, or the actions are stale
-//                                         log("creating "+configName);
-                                         
-                                         var downMenu = "";
-                                         if (actions.open)
-                                             downMenu += "<div class='light-popup-menu-item valueOpen actions-open' open-target='"+actions.open+"'>" +
-                                                    "Open</div>";
-                                         if (hasEscapedValue) downMenu +=
-                                             "<div class='light-popup-menu-item handy valueCopy actions-copy clipboard-item'>Copy Value</div>";
-                                         if (actions.json) downMenu +=
-                                             "<div class='light-popup-menu-item handy valueOpen actions-json-open' open-target='"+actions.json+"'>" +
-                                                 "Open REST Link</div>";
-                                         if (actions.json && hasEscapedValue) downMenu +=
-                                             "<div class='light-popup-menu-item handy valueCopy actions-json-copy clipboard-item' copy-value='"+
-                                                 jsonUrl+"'>Copy REST Link</div>";
-                                         if (downMenu=="") {
-//                                             log("no actions for "+configName);
-                                             downMenu += 
-                                                 "<div class='light-popup-menu-item'>(no actions)</div>";
-                                         }
-                                         downMenu = "<div class='floatDown'><div class='light-popup'><div class='light-popup-body'>"
-                                             + downMenu +
-                                             "</div></div></div>";
-                                         result = "<span class='hasFloatLeft dynamic-contents'>" + result +
-                                                "</span>" +
-                                                "<div class='floatLeft'><span class='icon-chevron-down hasFloatDown'></span>" +
-                                                downMenu +
-                                                "</div>";
-                                         result = "<div class='floatGroup"+
-                                            (isSecret ? " secret-info" : "")+
-                                            "'>" + result + "</div>";
-                                         // also see updateFloatMenus which wires up the JS for these classes
-                                         
-                                         return result;
-                                     },
-                                     "aTargets": [ 2 ]
-                                 },
-                                 // ID in column 0 is standard (assumed in ViewUtils)
-                                 { "bVisible": false,  "aTargets": [ 0 ] }
-                             ]            
-            });
-            
-            this.zeroClipboard = new ZeroClipboard();
-            this.zeroClipboard.on( "dataRequested" , function(client) {
-                try {
-                    // the zeroClipboard instance is a singleton so check our scope first
-                    if (!$(this).closest("#config-table").length) return;
-                    var text = $(this).attr('copy-value');
-                    if (!text) text = $(this).closest('.floatGroup').find('.value').text();
-                    
-//                    log("Copying config text '"+text+"' to clipboard");
-                    client.setText(text);
-
-                    // show the word "copied" for feedback;
-                    // NB this occurs on mousedown, due to how flash plugin works
-                    // (same style of feedback and interaction as github)
-                    // the other "clicks" are now triggered by *mouseup*
-                    var $widget = $(this);
-                    var oldHtml = $widget.html();
-                    $widget.html('<b>Copied!</b>');
-                    // use a timeout to restore because mouseouts can leave corner cases (see history)
-                    setTimeout(function() { $widget.html(oldHtml); }, 600);
-                } catch (e) {
-                    log("Zeroclipboard failure; falling back to prompt mechanism");
-                    log(e);
-                    Util.promptCopyToClipboard(text);
-                }
-            });
-            // these seem to arrive delayed sometimes, so we also work with the clipboard-item class events
-            this.zeroClipboard.on( "mouseover", function() { that.noteFloatMenuZeroClipboardItem(true, this); } );
-            this.zeroClipboard.on( "mouseout", function() { that.noteFloatMenuZeroClipboardItem(false, this); } );
-            this.zeroClipboard.on( "mouseup", function() { that.closeFloatMenuNow(); } );
-
-            ViewUtils.addFilterEmptyButton(this.table);
-            ViewUtils.addAutoRefreshButton(this.table);
-            ViewUtils.addRefreshButton(this.table);
-            this.loadConfigMetadata();
-            this.updateConfigPeriodically();
-            this.toggleFilterEmpty();
-            return this;
-        },
-
-        beforeClose: function () {
-            if (this.zeroClipboard) {
-                this.zeroClipboard.destroy();
-            }
-        },
-
-        floatMenuActive: false,
-        lastFloatMenuRowId: null,
-        lastFloatFocusInTextForEventUnmangling: null,
-        updateFloatMenus: function() {
-            $('#config-table *[rel="tooltip"]').tooltip();
-            this.zeroClipboard.clip( $('.valueCopy') );
-        },
-        showFloatLeft: function(event) {
-            this.noteFloatMenuFocusChange(true, event, "show-left");
-            this.showFloatLeftOf($(event.currentTarget));
-        },
-        showFloatLeftOf: function($hasFloatLeft) {
-            $hasFloatLeft.next('.floatLeft').show(); 
-        },
-        enterFloatDown: function(event) {
-            this.noteFloatMenuFocusChange(true, event, "show-down");
-//            log("entering float down");
-            var fdTarget = $(event.currentTarget);
-//            log( fdTarget );
-            this.floatDownFocus = fdTarget;
-            var that = this;
-            setTimeout(function() {
-                that.showFloatDownOf( fdTarget );
-            }, 200);
-        },
-        exitFloatDown: function(event) {
-//            log("exiting float down");
-            this.floatDownFocus = null;
-        },
-        showFloatDownOf: function($hasFloatDown) {
-            if ($hasFloatDown != this.floatDownFocus) {
-//                log("float down did not hover long enough");
-                return;
-            }
-            var down = $hasFloatDown.next('.floatDown');
-            down.show();
-            $('.light-popup', down).show(2000); 
-        },
-        noteFloatMenuActive: function(focus) { 
-            this.noteFloatMenuFocusChange(true, focus, "menu");
-            
-            // remove dangling zc events (these don't always get removed, apparent bug in zc event framework)
-            // this causes it to flash sometimes but that's better than leaving the old item highlighted
-            if (focus.toElement && $(focus.toElement).hasClass('clipboard-item')) {
-                // don't remove it
-            } else {
-                var zc = $(focus.target).closest('.floatGroup').find('div.zeroclipboard-is-hover');
-                zc.removeClass('zeroclipboard-is-hover');
-            }
-        },
-        noteFloatMenuSeemsInactive: function(focus) { this.noteFloatMenuFocusChange(false, focus, "menu"); },
-        noteFloatMenuActiveCI: function(focus) { this.noteFloatMenuFocusChange(true, focus, "menu-clip-item"); },
-        noteFloatMenuSeemsInactiveCI: function(focus) { this.noteFloatMenuFocusChange(false, focus, "menu-clip-item"); },
-        noteFloatMenuZeroClipboardItem: function(seemsActive,focus) { 
-            this.noteFloatMenuFocusChange(seemsActive, focus, "clipboard");
-            if (seemsActive) {
-                // make the table row highlighted (as the default hover event is lost)
-                // we remove it when the float group goes away
-                $(focus).closest('tr').addClass('zeroclipboard-is-hover');
-            } else {
-                // sometimes does not get removed by framework - though this doesn't seem to help
-                // as you can see by logging this before and after:
-//                log(""+$(focus).attr('class'))
-                // the problem is that the framework seems sometime to trigger this event before adding the class
-                // see in noteFloatMenuActive where we do a different check
-                $(focus).removeClass('zeroclipboard-is-hover');
-            }
-        },
-        noteFloatMenuFocusChange: function(seemsActive, focus, caller) {
-//            log(""+new Date().getTime()+" note active "+caller+" "+seemsActive);
-            var delayCheckFloat = true;
-            var focusRowId = null;
-            var focusElement = null;
-            if (focus) {
-                focusElement = focus.target ? focus.target : focus;
-                if (seemsActive) {
-                    this.lastFloatFocusInTextForEventUnmangling = $(focusElement).text();
-                    focusRowId = focus.target ? $(focus.target).closest('tr').attr('id') : $(focus).closest('tr').attr('id');
-                    if (this.floatMenuActive && focusRowId==this.lastFloatMenuRowId) {
-                        // lastFloatMenuRowId has not changed, when moving within a floatgroup
-                        // (but we still get mouseout events when the submenu changes)
-//                        log("redundant mousein from "+ focusRowId );
-                        return;
-                    }
-                } else {
-                    // on mouseout, skip events which are bogus
-                    // first, if the toElement is in the same floatGroup
-                    focusRowId = focus.toElement ? $(focus.toElement).closest('tr').attr('id') : null;
-                    if (focusRowId==this.lastFloatMenuRowId) {
-                        // lastFloatMenuRowId has not changed, when moving within a floatgroup
-                        // (but we still get mouseout events when the submenu changes)
-//                        log("skipping, internal mouseout from "+ focusRowId );
-                        return;
-                    }
-                    // check (a) it is the 'out' event corresponding to the most recent 'in'
-                    // (because there is a race where it can say  in1, in2, out1 rather than in1, out2, in2
-                    if ($(focusElement).text() != this.lastFloatFocusInTextForEventUnmangling) {
-//                        log("skipping, not most recent mouseout from "+ focusRowId );
-                        return;
-                    }
-                    if (focus.toElement) {
-                        if ($(focus.toElement).hasClass('global-zeroclipboard-container')) {
-//                            log("skipping out, as we are moving to clipboard container");
-                            return;
-                        }
-                        if (focus.toElement.name && focus.toElement.name=="global-zeroclipboard-flash-bridge") {
-//                            log("skipping out, as we are moving to clipboard movie");
-                            return;                            
-                        }
-                    }
-                } 
-            }           
-//            log( "moving to "+focusRowId );
-            if (seemsActive && focusRowId) {
-//                log("setting lastFloat when "+this.floatMenuActive + ", from "+this.lastFloatMenuRowId );
-                if (this.lastFloatMenuRowId != focusRowId) {
-                    if (this.lastFloatMenuRowId) {
-                        // the floating menu has changed, hide the old
-//                        log("hiding old menu on float-focus change");
-                        this.closeFloatMenuNow();
-                    }
-                }
-                // now show the new, if possible (might happen multiple times, but no matter
-                if (focusElement) {
-//                    log("ensuring row "+focusRowId+" is showing on change");
-                    this.showFloatLeftOf($(focusElement).closest('tr').find('.hasFloatLeft'));
-                    this.lastFloatMenuRowId = focusRowId;
-                } else {
-                    this.lastFloatMenuRowId = null;
-                }
-            }
-            this.floatMenuActive = seemsActive;
-            if (!seemsActive) {
-                this.scheduleCheckFloatMenuNeedsHiding(delayCheckFloat);
-            }
-        },
-        scheduleCheckFloatMenuNeedsHiding: function(delayCheckFloat) {
-            if (delayCheckFloat) {
-                this.checkTime = new Date().getTime()+299;
-                setTimeout(this.checkFloatMenuNeedsHiding, 300);
-            } else {
-                this.checkTime = new Date().getTime()-1;
-                this.checkFloatMenuNeedsHiding();
-            }
-        },
-        closeFloatMenuNow: function() {
-//            log("closing float menu due do direct call (eg click)");
-            this.checkTime = new Date().getTime()-1;
-            this.floatMenuActive = false;
-            this.checkFloatMenuNeedsHiding();
-        },
-        checkFloatMenuNeedsHiding: function() {
-//            log(""+new Date().getTime()+" checking float menu - "+this.floatMenuActive);
-            if (new Date().getTime() <= this.checkTime) {
-//                log("aborting check as another one scheduled");
-                return;
-            }
-            
-            // we use a flag to determine whether to hide the float menu
-            // because the embedded zero-clipboard flash objects cause floatGroup 
-            // to get a mouseout event when the "Copy" menu item is hovered
-            if (!this.floatMenuActive) {
-//                log("HIDING FLOAT MENU")
-                $('.floatLeft').hide(); 
-                $('.floatDown').hide();
-                $('.zeroclipboard-is-hover').removeClass('zeroclipboard-is-hover');
-                lastFloatMenuRowId = null;
-            } else {
-//                log("we're still in")
-            }
-        },
-        valueOpen: function(event) {
-            window.open($(event.target).attr('open-target'),'_blank');
-        },
-
-        render: function() {
-            return this;
-        },
-        checkFloatMenuUpToDate: function($row, actionValue, actionSelector, actionAttribute) {
-            if (typeof actionValue === 'undefined' || actionValue==null || actionValue=="") {
-                if ($row.find(actionSelector).length==0) return true;
-            } else {
-                if (actionAttribute) {
-                    if ($row.find(actionSelector).attr(actionAttribute)==actionValue) return true;
-                } else {
-                    if ($row.find(actionSelector).length>0) return true;
-                }
-            }
-            return false;
-        },
-        
-        /**
-         * Returns the actions loaded to view.configMetadata[name].actions
-         * for the given name, or an empty object.
-         */
-        getConfigActions: function(configName) {
-            var allMetadata = this.configMetadata || {};
-            var metadata = allMetadata[configName] || {};
-            return metadata.actions || {};
-        },
-
-        toggleFilterEmpty: function() {
-            ViewUtils.toggleFilterEmpty(this.$('#config-table'), 2);
-            return this;
-        },
-
-        toggleAutoRefresh: function() {
-            ViewUtils.toggleAutoRefresh(this);
-            return this;
-        },
-
-        enableAutoRefresh: function(isEnabled) {
-            this.refreshActive = isEnabled;
-            return this;
-        },
-        
-        toggleSecrecyVisibility: function(event) {
-            $(event.target).closest('.secret-info').toggleClass('secret-revealed');
-        },
-        
-        /**
-         * Loads current values for all config on an entity and updates config table.
-         */
-        isRefreshActive: function() { return this.refreshActive; },
-        updateConfigNow:function () {
-            var that = this;
-            ViewUtils.get(that, that.model.getConfigUpdateUrl(), that.updateWithData,
-                    { enablement: that.isRefreshActive });
-        },
-        updateConfigPeriodically:function () {
-            var that = this;
-            ViewUtils.getRepeatedlyWithDelay(that, that.model.getConfigUpdateUrl(), function(data) { that.updateWithData(data); },
-                    { enablement: that.isRefreshActive });
-        },
-        updateWithData: function (data) {
-            var that = this;
-            $table = that.$('#config-table');
-            var options = {};
-            
-            if (that.fullRedraw) {
-                options.refreshAllRows = true;
-                that.fullRedraw = false;
-            }
-            ViewUtils.updateMyDataTable($table, data, function(value, name) {
-                var metadata = that.configMetadata[name];
-                if (metadata==null) {                        
-                    // kick off reload metadata when this happens (new config for which no metadata known)
-                    // but only if we haven't loaded metadata for a while
-                    metadata = { 'name':name };
-                    that.configMetadata[name] = metadata; 
-                    that.loadConfigMetadataIfStale(name, 10000);
-                } 
-                return [name, metadata, value];
-            }, options);
-            
-            that.updateFloatMenus();
-        },
-
-        loadConfigMetadata: function() {
-            var url = this.model.getLinkByName('config'),
-                that = this;
-            that.lastConfigMetadataLoadTime = new Date().getTime();
-            $.get(url, function (data) {
-                _.each(data, function(config) {
-                    var actions = {};
-                    _.each(config.links, function(v, k) {
-                        if (k.slice(0, 7) == "action:") {
-                            actions[k.slice(7)] = v;
-                        }
-                    });
-                    that.configMetadata[config.name] = {
-                        name: config.name,
-                        description: config.description,
-                        actions: actions,
-                        type: config.type
-                    };
-                });
-                that.fullRedraw = true;
-                that.updateConfigNow();
-                that.table.find('*[rel="tooltip"]').tooltip();
-            });
-            return this;
-        },
-        
-        loadConfigMetadataIfStale: function(configName, recency) {
-            var that = this;
-            if (!that.lastConfigMetadataLoadTime || that.lastConfigMetadataLoadTime + recency < new Date().getTime()) {
-//                log("reloading metadata because new config "+configName+" identified")
-                that.loadConfigMetadata();
-            }
-        }
-    });
-    return EntityConfigView;
-});

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/js/view/entity-details.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/js/view/entity-details.js b/brooklyn-ui/src/main/webapp/assets/js/view/entity-details.js
deleted file mode 100644
index f54c572..0000000
--- a/brooklyn-ui/src/main/webapp/assets/js/view/entity-details.js
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-/**
- * Renders details information about an application (sensors, summary, effectors, etc.).
- * 
- * Options preselectTab (e.g. 'activities') and preselectTabDetails ('subtasks/1234') can be set
- * before a render to cause the given tab / details to be opened.
- * 
- * @type {*}
- */
-define([
-    "underscore", "jquery", "backbone", "./entity-summary", 
-    "./entity-sensors", "./entity-effectors", "./entity-policies",
-    "./entity-activities", "./entity-advanced", "model/task-summary", "text!tpl/apps/details.html"
-], function (_, $, Backbone, SummaryView, SensorsView, EffectorsView, PoliciesView, ActivitiesView, AdvancedView, TaskSummary, DetailsHtml) {
-
-    var EntityDetailsView = Backbone.View.extend({
-        template:_.template(DetailsHtml),
-        events:{
-            'click .entity-tabs a':'tabSelected'
-        },
-        initialize:function () {
-            var self = this;
-            var tasks = new TaskSummary.Collection;
-            
-            this.$el.html(this.template({}))
-            this.sensorsView = new SensorsView({
-                model:this.model,
-                tabView:this,
-            })
-            this.effectorsView = new EffectorsView({
-                model:this.model,
-                tabView:this,
-            })
-            this.policiesView = new PoliciesView({
-                model:this.model,
-                tabView:this,
-            })
-            this.activitiesView = new ActivitiesView({
-                model:this.model,
-                tabView:this,
-                collection:tasks
-            })
-            // summary comes after others because it uses the tasks
-            this.summaryView = new SummaryView({
-                model:this.model,
-                tabView:this,
-                application:this.options.application,
-                tasks:tasks,
-            })
-            this.advancedView = new AdvancedView({
-                model: this.model,
-                tabView:this,
-                application:this.options.application
-            });
-            // propagate to app tree view 
-            this.advancedView.on("entity.expunged", function() { self.trigger("entity.expunged"); })
-            
-            this.$("#summary").html(this.summaryView.render().el);
-            this.$("#sensors").html(this.sensorsView.render().el);
-            this.$("#effectors").html(this.effectorsView.render().el);
-            this.$("#policies").html(this.policiesView.render().el);
-            this.$("#activities").html(this.activitiesView.render().el);
-            this.$("#advanced").html(this.advancedView.render().el);
-        },
-        beforeClose:function () {
-            this.summaryView.close();
-            this.sensorsView.close();
-            this.effectorsView.close();
-            this.policiesView.close();
-            this.activitiesView.close();
-            this.advancedView.close();
-        },
-        getEntityHref: function() {
-            return $("#app-tree .entity_tree_node_wrapper.active a").attr("href");
-        },
-        render: function(optionalParent) {
-            this.summaryView.render()
-            this.sensorsView.render()
-            this.effectorsView.render()
-            this.policiesView.render()
-            this.activitiesView.render()
-            this.advancedView.render()
-            
-            if (optionalParent) {
-                optionalParent.html(this.el)
-            }
-            var entityHref = this.getEntityHref();
-            if (entityHref) {
-                $("a[data-toggle='tab']").each(function(i,a) {
-                    $(a).attr('href',entityHref+"/"+$(a).attr("data-target").slice(1));
-                });
-            } else {
-                log("could not find entity href for tab");
-            }
-            if (this.options.preselectTab) {
-                var tabLink = this.$('a[data-target="#'+this.options.preselectTab+'"]');
-                var showFn = function() { tabLink.tab('show'); };
-                if (optionalParent) showFn();
-                else _.defer(showFn);
-            }
-            return this;
-        },
-        tabSelected: function(event) {
-            // TODO: the bootstrap JS code still prevents shift-click from working
-            // have to add the following logic to bootstrap tab click handler also
-//            if (event.metaKey || event.shiftKey)
-//                // trying to open in a new tab, do not act on it here!
-//                return;
-            event.preventDefault();
-            
-            var tabName = $(event.currentTarget).attr("data-target").slice(1);
-            var route = this.getTab(tabName);
-            if (route) {
-                if (route[0]=='#') route = route.substring(1);
-                Backbone.history.navigate(route);
-            }
-            // caller will ensure tab is shown
-        },
-        getTab: function(tabName, entityId, entityHref) {
-            if (!entityHref) {
-                if (entityId) {
-                    entityHref = this.getEntityHref();
-                    if (!entityHref.endsWith(entityId)) {
-                        lastSlash = entityHref.lastIndexOf('/');
-                        if (lastSlash>=0) {
-                            entityHref = entityHref.substring(0, lastSlash+1) + '/' + entityId;
-                        } else {
-                            log("malformed entityHref when opening tab: "+entityHref)
-                            entityHref = this.getEntityHref();
-                        }
-                    }
-                } else {
-                    entityHref = this.getEntityHref();
-                }
-            }
-            if (entityHref && tabName)                
-                return entityHref+"/"+tabName;
-            return null;
-        },
-        /** for tabs to redirect to other tabs; entityId and entityHref are optional (can supply either, or null to use current entity); 
-         * tabPath is e.g. 'sensors' or 'activities/subtask/1234' */ 
-        openTab: function(tabPath, entityId, entityHref) {
-            var route = this.getTab(tabPath, entityId, entityHref);
-            if (!route) return;
-            if (route[0]=='#') route = route.substring(1);
-            Backbone.history.navigate(route);
-                
-            tabPaths = tabPath.split('/');
-            if (!tabPaths) return;
-            var tabName = tabPaths.shift();
-            if (!tabName)
-                // ignore leading /
-                tabName = tabPaths.shift();
-            if (!tabName) return;
-
-            this.options.preselectTab = tabName;
-            if (tabPaths)
-                this.options.preselectTabDetails = tabPaths.join('/');
-            this.render();
-        }
-    });
-    return EntityDetailsView;
-});
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/js/view/entity-effectors.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/js/view/entity-effectors.js b/brooklyn-ui/src/main/webapp/assets/js/view/entity-effectors.js
deleted file mode 100644
index 974fbec..0000000
--- a/brooklyn-ui/src/main/webapp/assets/js/view/entity-effectors.js
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-/**
- * Render the effectors tab.You must supply the model and optionally the element
- * on which the view binds itself.
- *
- * @type {*}
- */
-define([
-    "underscore", "jquery", "backbone", "view/viewutils", "model/effector-summary",
-    "view/effector-invoke", "text!tpl/apps/effector.html", "text!tpl/apps/effector-row.html", "bootstrap"
-], function (_, $, Backbone, ViewUtils, EffectorSummary, EffectorInvokeView, EffectorHtml, EffectorRowHtml) {
-
-    var EntityEffectorsView = Backbone.View.extend({
-        template:_.template(EffectorHtml),
-        effectorRow:_.template(EffectorRowHtml),
-        events:{
-            "click .show-effector-modal":"showEffectorModal"
-        },
-        initialize:function () {
-            this.$el.html(this.template({}))
-            var that = this
-            this._effectors = new EffectorSummary.Collection()
-            // fetch the list of effectors and create a view for each one
-            this._effectors.url = this.model.getLinkByName("effectors")
-            that.loadedData = false;
-            ViewUtils.fadeToIndicateInitialLoad(this.$('#effectors-table'));
-            this.$(".has-no-effectors").hide();
-            
-            this._effectors.fetch({success:function () {
-                that.loadedData = true;
-                that.render()
-                ViewUtils.cancelFadeOnceLoaded(that.$('#effectors-table'));
-            }})
-            // attach a fetch simply to fade this tab when not available
-            // (the table is statically rendered)
-            ViewUtils.fetchRepeatedlyWithDelay(this, this._effectors, { period: 10*1000 })
-        },
-        render:function () {
-            if (this.viewIsClosed)
-                return;
-            var that = this
-            var $tableBody = this.$('#effectors-table tbody').empty()
-            if (this._effectors.length==0) {
-                if (that.loadedData)
-                    this.$(".has-no-effectors").show();
-            } else {                
-                this.$(".has-no-effectors").hide();
-                this._effectors.each(function (effector) {
-                    $tableBody.append(that.effectorRow({
-                        name:effector.get("name"),
-                        description:effector.get("description"),
-                        // cid is mapped to id (here) which is mapped to name (in Effector.Summary), 
-                        // so it is consistent across resets
-                        cid:effector.id
-                    }))
-                })
-            }
-            return this
-        },
-        showEffectorModal:function (eventName) {
-            // get the model that we need to show, create its view and show it
-            var cid = $(eventName.currentTarget).attr("id")
-            var effectorModel = this._effectors.get(cid);
-            var modal = new EffectorInvokeView({
-                el:"#effector-modal",
-                model:effectorModel,
-                entity:this.model,
-                tabView:this.options.tabView,
-                openTask:true
-            })
-            modal.render().$el.modal('show')
-        }
-    })
-    return EntityEffectorsView
-})
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/js/view/entity-policies.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/js/view/entity-policies.js b/brooklyn-ui/src/main/webapp/assets/js/view/entity-policies.js
deleted file mode 100644
index 74ba885..0000000
--- a/brooklyn-ui/src/main/webapp/assets/js/view/entity-policies.js
+++ /dev/null
@@ -1,244 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-/**
- * Render the policies tab. You must supply the model and optionally the element
- * on which the view binds itself.
- */
-define([
-    "underscore", "jquery", "backbone", "brooklyn",
-    "model/policy-summary", "model/policy-config-summary",
-    "view/viewutils", "view/policy-config-invoke", "view/policy-new",
-    "text!tpl/apps/policy.html", "text!tpl/apps/policy-row.html", "text!tpl/apps/policy-config-row.html",
-    "jquery-datatables", "datatables-extensions"
-], function (_, $, Backbone, Brooklyn,
-        PolicySummary, PolicyConfigSummary,
-        ViewUtils, PolicyConfigInvokeView, NewPolicyView,
-        PolicyHtml, PolicyRowHtml, PolicyConfigRowHtml) {
-
-    var EntityPoliciesView = Backbone.View.extend({
-
-        template: _.template(PolicyHtml),
-        policyRow: _.template(PolicyRowHtml),
-
-        events:{
-            'click .refresh':'refreshPolicyConfigNow',
-            'click .filterEmpty':'toggleFilterEmpty',
-            "click #policies-table tr":"rowClick",
-            "click .policy-start":"callStart",
-            "click .policy-stop":"callStop",
-            "click .policy-destroy":"callDestroy",
-            "click .show-policy-config-modal":"showPolicyConfigModal",
-            "click .add-new-policy": "showNewPolicyModal"
-        },
-
-        initialize:function () {
-            _.bindAll(this)
-            this.$el.html(this.template({ }));
-            var that = this;
-            // fetch the list of policies and create a row for each one
-            that._policies = new PolicySummary.Collection();
-            that._policies.url = that.model.getLinkByName("policies");
-            
-            this.loadedData = false;
-            ViewUtils.fadeToIndicateInitialLoad(this.$('#policies-table'));
-            that.render();
-            this._policies.on("all", this.render, this)
-            ViewUtils.fetchRepeatedlyWithDelay(this, this._policies, {
-                doitnow: true,
-                success: function () {
-                    that.loadedData = true;
-                    ViewUtils.cancelFadeOnceLoaded(that.$('#policies-table'));
-                }});
-        },
-
-        render:function () {
-            if (this.viewIsClosed)
-                return;
-            var that = this,
-                $tbody = this.$('#policies-table tbody').empty();
-            if (that._policies.length==0) {
-                if (this.loadedData)
-                    this.$(".has-no-policies").show();
-                this.$("#policy-config").hide();
-                this.$("#policy-config-none-selected").hide();
-            } else {
-                this.$(".has-no-policies").hide();
-                that._policies.each(function (policy) {
-                    // TODO better to use datatables, and a json array, as we do elsewhere
-                    $tbody.append(that.policyRow({
-                        cid:policy.get("id"),
-                        name:policy.get("name"),
-                        state:policy.get("state"),
-                        summary:policy
-                    }));
-                    if (that.activePolicy) {
-                        that.$("#policies-table tr[id='"+that.activePolicy+"']").addClass("selected");
-                        that.showPolicyConfig(that.activePolicy);
-                        that.refreshPolicyConfig();
-                    } else {
-                        that.$("#policy-config").hide();
-                        that.$("#policy-config-none-selected").show();
-                    }
-                });
-            }
-            return that;
-        },
-
-        toggleFilterEmpty:function() {
-            ViewUtils.toggleFilterEmpty($('#policy-config-table'), 2);
-        },
-
-        refreshPolicyConfigNow:function () {
-            this.refreshPolicyConfig();  
-        },
-
-        rowClick:function(evt) {
-            evt.stopPropagation();
-            var row = $(evt.currentTarget).closest("tr"),
-                id = row.attr("id"),
-                policy = this._policies.get(id);
-            $("#policies-table tr").removeClass("selected");
-            if (this.activePolicy == id) {
-                // deselected
-                this.activePolicy = null;
-                this._config = null;
-                $("#policy-config-table").dataTable().fnDestroy();
-                $("#policy-config").slideUp(100);
-                $("#policy-config-none-selected").slideDown(100);
-            } else {
-                row.addClass("selected");
-                // fetch the list of policy config entries
-                this._config = new PolicyConfigSummary.Collection();
-                this._config.url = policy.getLinkByName("config");
-                ViewUtils.fadeToIndicateInitialLoad($('#policy-config-table'));
-                this.showPolicyConfig(id);
-                var that = this;
-                this._config.fetch().done(function () {
-                    that.showPolicyConfig(id);
-                    ViewUtils.cancelFadeOnceLoaded($('#policy-config-table'))
-                });
-            }
-        },
-
-        showPolicyConfig:function (activePolicyId) {
-            var that = this;
-            if (activePolicyId != null && that.activePolicy != activePolicyId) {
-                // TODO better to use a json array, as we do elsewhere
-                var $table = $('#policy-config-table'),
-                    $tbody = $table.find('tbody');
-                $table.dataTable().fnClearTable();
-                $("#policy-config-none-selected").slideUp(100);
-                if (that._config.length==0) {
-                    $(".has-no-policy-config").show();
-                } else {
-                    $(".has-no-policy-config").hide();
-                    that.activePolicy = activePolicyId;
-                    var policyConfigRow = _.template(PolicyConfigRowHtml);
-                    that._config.each(function (config) {
-                        $tbody.append(policyConfigRow({
-                            cid:config.cid,
-                            name:config.get("name"),
-                            description:config.get("description"),
-                            type:config.get("type"),
-                            reconfigurable:config.get("reconfigurable"),
-                            link:config.getLinkByName('self'),
-                            value: config.get("defaultValue")
-                        }));
-                        $tbody.find('*[rel="tooltip"]').tooltip();
-                    });
-                    that.currentStateUrl = that._policies.get(that.activePolicy).getLinkByName("config") + "/current-state";
-                    $("#policy-config").slideDown(100);
-                    $table.slideDown(100);
-                    ViewUtils.myDataTable($table, {
-                        "bAutoWidth": false,
-                        "aoColumns" : [
-                            { sWidth: '220px' },
-                            { sWidth: '240px' },
-                            { sWidth: '25px' }
-                        ]
-                    });
-                    $table.dataTable().fnAdjustColumnSizing();
-                }
-            }
-            that.refreshPolicyConfig();
-        },
-
-        refreshPolicyConfig:function() {
-            var that = this;
-            if (that.viewIsClosed || !that.currentStateUrl) return;
-            var $table = that.$('#policy-config-table').dataTable(),
-                $rows = that.$("tr.policy-config-row");
-            $.get(that.currentStateUrl, function (data) {
-                if (that.viewIsClosed) return;
-                // iterate over the sensors table and update each sensor
-                $rows.each(function (index, row) {
-                    var key = $(this).find(".policy-config-name").text();
-                    var v = data[key];
-                    if (v !== undefined) {
-                        $table.fnUpdate(_.escape(v), row, 1, false);
-                    }
-                });
-            });
-            $table.dataTable().fnStandingRedraw();
-        },
-
-        showPolicyConfigModal: function (evt) {
-            var cid = $(evt.currentTarget).attr("id");
-            var currentValue = $(evt.currentTarget)
-                .parent().parent()
-                .find(".policy-config-value")
-                .text();
-            Brooklyn.view.showModalWith(new PolicyConfigInvokeView({
-                model: this._config.get(cid),
-                policy: this.model,
-                currentValue: currentValue
-            }));
-        },
-
-        showNewPolicyModal: function () {
-            var self = this;
-            Brooklyn.view.showModalWith(new NewPolicyView({
-                entity: this.model,
-                onSave: function (policy) {
-                    console.log("New policy", policy);
-                    self._policies.add(policy);
-                }
-            }));
-        },
-
-        callStart:function(event) { this.doPost(event, "start"); },
-        callStop:function(event) { this.doPost(event, "stop"); },
-        callDestroy:function(event) { this.doPost(event, "destroy"); },
-        doPost:function(event, linkname) {
-            event.stopPropagation();
-            var that = this,
-                url = $(event.currentTarget).attr("link");
-            $.ajax({
-                type:"POST",
-                url:url,
-                success:function() {
-                    that._policies.fetch();
-                }
-            });
-        }
-
-    });
-
-    return EntityPoliciesView;
-});


[37/51] [abbrv] [partial] brooklyn-ui git commit: move subdir from incubator up a level as it is promoted to its own repo (first non-incubator commit!)

Posted by he...@apache.org.
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/js/libs/moment.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/js/libs/moment.js b/brooklyn-ui/src/main/webapp/assets/js/libs/moment.js
deleted file mode 100644
index c8a870e..0000000
--- a/brooklyn-ui/src/main/webapp/assets/js/libs/moment.js
+++ /dev/null
@@ -1,1662 +0,0 @@
-// moment.js
-// version : 2.1.0
-// author : Tim Wood
-// license : MIT
-// momentjs.com
-
-(function (undefined) {
-
-    /************************************
-        Constants
-    ************************************/
-
-    var moment,
-        VERSION = "2.1.0",
-        round = Math.round, i,
-        // internal storage for language config files
-        languages = {},
-
-        // check for nodeJS
-        hasModule = (typeof module !== 'undefined' && module.exports),
-
-        // ASP.NET json date format regex
-        aspNetJsonRegex = /^\/?Date\((\-?\d+)/i,
-        aspNetTimeSpanJsonRegex = /(\-)?(\d*)?\.?(\d+)\:(\d+)\:(\d+)\.?(\d{3})?/,
-
-        // format tokens
-        formattingTokens = /(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|SS?S?|X|zz?|ZZ?|.)/g,
-        localFormattingTokens = /(\[[^\[]*\])|(\\)?(LT|LL?L?L?|l{1,4})/g,
-
-        // parsing token regexes
-        parseTokenOneOrTwoDigits = /\d\d?/, // 0 - 99
-        parseTokenOneToThreeDigits = /\d{1,3}/, // 0 - 999
-        parseTokenThreeDigits = /\d{3}/, // 000 - 999
-        parseTokenFourDigits = /\d{1,4}/, // 0 - 9999
-        parseTokenSixDigits = /[+\-]?\d{1,6}/, // -999,999 - 999,999
-        parseTokenWord = /[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i, // any word (or two) characters or numbers including two/three word month in arabic.
-        parseTokenTimezone = /Z|[\+\-]\d\d:?\d\d/i, // +00:00 -00:00 +0000 -0000 or Z
-        parseTokenT = /T/i, // T (ISO seperator)
-        parseTokenTimestampMs = /[\+\-]?\d+(\.\d{1,3})?/, // 123456789 123456789.123
-
-        // preliminary iso regex
-        // 0000-00-00 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000
-        isoRegex = /^\s*\d{4}-\d\d-\d\d((T| )(\d\d(:\d\d(:\d\d(\.\d\d?\d?)?)?)?)?([\+\-]\d\d:?\d\d)?)?/,
-        isoFormat = 'YYYY-MM-DDTHH:mm:ssZ',
-
-        // iso time formats and regexes
-        isoTimes = [
-            ['HH:mm:ss.S', /(T| )\d\d:\d\d:\d\d\.\d{1,3}/],
-            ['HH:mm:ss', /(T| )\d\d:\d\d:\d\d/],
-            ['HH:mm', /(T| )\d\d:\d\d/],
-            ['HH', /(T| )\d\d/]
-        ],
-
-        // timezone chunker "+10:00" > ["10", "00"] or "-1530" > ["-15", "30"]
-        parseTimezoneChunker = /([\+\-]|\d\d)/gi,
-
-        // getter and setter names
-        proxyGettersAndSetters = 'Date|Hours|Minutes|Seconds|Milliseconds'.split('|'),
-        unitMillisecondFactors = {
-            'Milliseconds' : 1,
-            'Seconds' : 1e3,
-            'Minutes' : 6e4,
-            'Hours' : 36e5,
-            'Days' : 864e5,
-            'Months' : 2592e6,
-            'Years' : 31536e6
-        },
-
-        unitAliases = {
-            ms : 'millisecond',
-            s : 'second',
-            m : 'minute',
-            h : 'hour',
-            d : 'day',
-            w : 'week',
-            M : 'month',
-            y : 'year'
-        },
-
-        // format function strings
-        formatFunctions = {},
-
-        // tokens to ordinalize and pad
-        ordinalizeTokens = 'DDD w W M D d'.split(' '),
-        paddedTokens = 'M D H h m s w W'.split(' '),
-
-        formatTokenFunctions = {
-            M    : function () {
-                return this.month() + 1;
-            },
-            MMM  : function (format) {
-                return this.lang().monthsShort(this, format);
-            },
-            MMMM : function (format) {
-                return this.lang().months(this, format);
-            },
-            D    : function () {
-                return this.date();
-            },
-            DDD  : function () {
-                return this.dayOfYear();
-            },
-            d    : function () {
-                return this.day();
-            },
-            dd   : function (format) {
-                return this.lang().weekdaysMin(this, format);
-            },
-            ddd  : function (format) {
-                return this.lang().weekdaysShort(this, format);
-            },
-            dddd : function (format) {
-                return this.lang().weekdays(this, format);
-            },
-            w    : function () {
-                return this.week();
-            },
-            W    : function () {
-                return this.isoWeek();
-            },
-            YY   : function () {
-                return leftZeroFill(this.year() % 100, 2);
-            },
-            YYYY : function () {
-                return leftZeroFill(this.year(), 4);
-            },
-            YYYYY : function () {
-                return leftZeroFill(this.year(), 5);
-            },
-            gg   : function () {
-                return leftZeroFill(this.weekYear() % 100, 2);
-            },
-            gggg : function () {
-                return this.weekYear();
-            },
-            ggggg : function () {
-                return leftZeroFill(this.weekYear(), 5);
-            },
-            GG   : function () {
-                return leftZeroFill(this.isoWeekYear() % 100, 2);
-            },
-            GGGG : function () {
-                return this.isoWeekYear();
-            },
-            GGGGG : function () {
-                return leftZeroFill(this.isoWeekYear(), 5);
-            },
-            e : function () {
-                return this.weekday();
-            },
-            E : function () {
-                return this.isoWeekday();
-            },
-            a    : function () {
-                return this.lang().meridiem(this.hours(), this.minutes(), true);
-            },
-            A    : function () {
-                return this.lang().meridiem(this.hours(), this.minutes(), false);
-            },
-            H    : function () {
-                return this.hours();
-            },
-            h    : function () {
-                return this.hours() % 12 || 12;
-            },
-            m    : function () {
-                return this.minutes();
-            },
-            s    : function () {
-                return this.seconds();
-            },
-            S    : function () {
-                return ~~(this.milliseconds() / 100);
-            },
-            SS   : function () {
-                return leftZeroFill(~~(this.milliseconds() / 10), 2);
-            },
-            SSS  : function () {
-                return leftZeroFill(this.milliseconds(), 3);
-            },
-            Z    : function () {
-                var a = -this.zone(),
-                    b = "+";
-                if (a < 0) {
-                    a = -a;
-                    b = "-";
-                }
-                return b + leftZeroFill(~~(a / 60), 2) + ":" + leftZeroFill(~~a % 60, 2);
-            },
-            ZZ   : function () {
-                var a = -this.zone(),
-                    b = "+";
-                if (a < 0) {
-                    a = -a;
-                    b = "-";
-                }
-                return b + leftZeroFill(~~(10 * a / 6), 4);
-            },
-            z : function () {
-                return this.zoneAbbr();
-            },
-            zz : function () {
-                return this.zoneName();
-            },
-            X    : function () {
-                return this.unix();
-            }
-        };
-
-    function padToken(func, count) {
-        return function (a) {
-            return leftZeroFill(func.call(this, a), count);
-        };
-    }
-    function ordinalizeToken(func, period) {
-        return function (a) {
-            return this.lang().ordinal(func.call(this, a), period);
-        };
-    }
-
-    while (ordinalizeTokens.length) {
-        i = ordinalizeTokens.pop();
-        formatTokenFunctions[i + 'o'] = ordinalizeToken(formatTokenFunctions[i], i);
-    }
-    while (paddedTokens.length) {
-        i = paddedTokens.pop();
-        formatTokenFunctions[i + i] = padToken(formatTokenFunctions[i], 2);
-    }
-    formatTokenFunctions.DDDD = padToken(formatTokenFunctions.DDD, 3);
-
-
-    /************************************
-        Constructors
-    ************************************/
-
-    function Language() {
-
-    }
-
-    // Moment prototype object
-    function Moment(config) {
-        extend(this, config);
-    }
-
-    // Duration Constructor
-    function Duration(duration) {
-        var years = duration.years || duration.year || duration.y || 0,
-            months = duration.months || duration.month || duration.M || 0,
-            weeks = duration.weeks || duration.week || duration.w || 0,
-            days = duration.days || duration.day || duration.d || 0,
-            hours = duration.hours || duration.hour || duration.h || 0,
-            minutes = duration.minutes || duration.minute || duration.m || 0,
-            seconds = duration.seconds || duration.second || duration.s || 0,
-            milliseconds = duration.milliseconds || duration.millisecond || duration.ms || 0;
-
-        // store reference to input for deterministic cloning
-        this._input = duration;
-
-        // representation for dateAddRemove
-        this._milliseconds = milliseconds +
-            seconds * 1e3 + // 1000
-            minutes * 6e4 + // 1000 * 60
-            hours * 36e5; // 1000 * 60 * 60
-        // Because of dateAddRemove treats 24 hours as different from a
-        // day when working around DST, we need to store them separately
-        this._days = days +
-            weeks * 7;
-        // It is impossible translate months into days without knowing
-        // which months you are are talking about, so we have to store
-        // it separately.
-        this._months = months +
-            years * 12;
-
-        this._data = {};
-
-        this._bubble();
-    }
-
-
-    /************************************
-        Helpers
-    ************************************/
-
-
-    function extend(a, b) {
-        for (var i in b) {
-            if (b.hasOwnProperty(i)) {
-                a[i] = b[i];
-            }
-        }
-        return a;
-    }
-
-    function absRound(number) {
-        if (number < 0) {
-            return Math.ceil(number);
-        } else {
-            return Math.floor(number);
-        }
-    }
-
-    // left zero fill a number
-    // see http://jsperf.com/left-zero-filling for performance comparison
-    function leftZeroFill(number, targetLength) {
-        var output = number + '';
-        while (output.length < targetLength) {
-            output = '0' + output;
-        }
-        return output;
-    }
-
-    // helper function for _.addTime and _.subtractTime
-    function addOrSubtractDurationFromMoment(mom, duration, isAdding, ignoreUpdateOffset) {
-        var milliseconds = duration._milliseconds,
-            days = duration._days,
-            months = duration._months,
-            minutes,
-            hours,
-            currentDate;
-
-        if (milliseconds) {
-            mom._d.setTime(+mom._d + milliseconds * isAdding);
-        }
-        // store the minutes and hours so we can restore them
-        if (days || months) {
-            minutes = mom.minute();
-            hours = mom.hour();
-        }
-        if (days) {
-            mom.date(mom.date() + days * isAdding);
-        }
-        if (months) {
-            mom.month(mom.month() + months * isAdding);
-        }
-        if (milliseconds && !ignoreUpdateOffset) {
-            moment.updateOffset(mom);
-        }
-        // restore the minutes and hours after possibly changing dst
-        if (days || months) {
-            mom.minute(minutes);
-            mom.hour(hours);
-        }
-    }
-
-    // check if is an array
-    function isArray(input) {
-        return Object.prototype.toString.call(input) === '[object Array]';
-    }
-
-    // compare two arrays, return the number of differences
-    function compareArrays(array1, array2) {
-        var len = Math.min(array1.length, array2.length),
-            lengthDiff = Math.abs(array1.length - array2.length),
-            diffs = 0,
-            i;
-        for (i = 0; i < len; i++) {
-            if (~~array1[i] !== ~~array2[i]) {
-                diffs++;
-            }
-        }
-        return diffs + lengthDiff;
-    }
-
-    function normalizeUnits(units) {
-        return units ? unitAliases[units] || units.toLowerCase().replace(/(.)s$/, '$1') : units;
-    }
-
-
-    /************************************
-        Languages
-    ************************************/
-
-
-    Language.prototype = {
-        set : function (config) {
-            var prop, i;
-            for (i in config) {
-                prop = config[i];
-                if (typeof prop === 'function') {
-                    this[i] = prop;
-                } else {
-                    this['_' + i] = prop;
-                }
-            }
-        },
-
-        _months : "January_February_March_April_May_June_July_August_September_October_November_December".split("_"),
-        months : function (m) {
-            return this._months[m.month()];
-        },
-
-        _monthsShort : "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),
-        monthsShort : function (m) {
-            return this._monthsShort[m.month()];
-        },
-
-        monthsParse : function (monthName) {
-            var i, mom, regex;
-
-            if (!this._monthsParse) {
-                this._monthsParse = [];
-            }
-
-            for (i = 0; i < 12; i++) {
-                // make the regex if we don't have it already
-                if (!this._monthsParse[i]) {
-                    mom = moment([2000, i]);
-                    regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');
-                    this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');
-                }
-                // test the regex
-                if (this._monthsParse[i].test(monthName)) {
-                    return i;
-                }
-            }
-        },
-
-        _weekdays : "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),
-        weekdays : function (m) {
-            return this._weekdays[m.day()];
-        },
-
-        _weekdaysShort : "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),
-        weekdaysShort : function (m) {
-            return this._weekdaysShort[m.day()];
-        },
-
-        _weekdaysMin : "Su_Mo_Tu_We_Th_Fr_Sa".split("_"),
-        weekdaysMin : function (m) {
-            return this._weekdaysMin[m.day()];
-        },
-
-        weekdaysParse : function (weekdayName) {
-            var i, mom, regex;
-
-            if (!this._weekdaysParse) {
-                this._weekdaysParse = [];
-            }
-
-            for (i = 0; i < 7; i++) {
-                // make the regex if we don't have it already
-                if (!this._weekdaysParse[i]) {
-                    mom = moment([2000, 1]).day(i);
-                    regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, '');
-                    this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');
-                }
-                // test the regex
-                if (this._weekdaysParse[i].test(weekdayName)) {
-                    return i;
-                }
-            }
-        },
-
-        _longDateFormat : {
-            LT : "h:mm A",
-            L : "MM/DD/YYYY",
-            LL : "MMMM D YYYY",
-            LLL : "MMMM D YYYY LT",
-            LLLL : "dddd, MMMM D YYYY LT"
-        },
-        longDateFormat : function (key) {
-            var output = this._longDateFormat[key];
-            if (!output && this._longDateFormat[key.toUpperCase()]) {
-                output = this._longDateFormat[key.toUpperCase()].replace(/MMMM|MM|DD|dddd/g, function (val) {
-                    return val.slice(1);
-                });
-                this._longDateFormat[key] = output;
-            }
-            return output;
-        },
-
-        isPM : function (input) {
-            return ((input + '').toLowerCase()[0] === 'p');
-        },
-
-        _meridiemParse : /[ap]\.?m?\.?/i,
-        meridiem : function (hours, minutes, isLower) {
-            if (hours > 11) {
-                return isLower ? 'pm' : 'PM';
-            } else {
-                return isLower ? 'am' : 'AM';
-            }
-        },
-
-        _calendar : {
-            sameDay : '[Today at] LT',
-            nextDay : '[Tomorrow at] LT',
-            nextWeek : 'dddd [at] LT',
-            lastDay : '[Yesterday at] LT',
-            lastWeek : '[Last] dddd [at] LT',
-            sameElse : 'L'
-        },
-        calendar : function (key, mom) {
-            var output = this._calendar[key];
-            return typeof output === 'function' ? output.apply(mom) : output;
-        },
-
-        _relativeTime : {
-            future : "in %s",
-            past : "%s ago",
-            s : "a few seconds",
-            m : "a minute",
-            mm : "%d minutes",
-            h : "an hour",
-            hh : "%d hours",
-            d : "a day",
-            dd : "%d days",
-            M : "a month",
-            MM : "%d months",
-            y : "a year",
-            yy : "%d years"
-        },
-        relativeTime : function (number, withoutSuffix, string, isFuture) {
-            var output = this._relativeTime[string];
-            return (typeof output === 'function') ?
-                output(number, withoutSuffix, string, isFuture) :
-                output.replace(/%d/i, number);
-        },
-        pastFuture : function (diff, output) {
-            var format = this._relativeTime[diff > 0 ? 'future' : 'past'];
-            return typeof format === 'function' ? format(output) : format.replace(/%s/i, output);
-        },
-
-        ordinal : function (number) {
-            return this._ordinal.replace("%d", number);
-        },
-        _ordinal : "%d",
-
-        preparse : function (string) {
-            return string;
-        },
-
-        postformat : function (string) {
-            return string;
-        },
-
-        week : function (mom) {
-            return weekOfYear(mom, this._week.dow, this._week.doy).week;
-        },
-        _week : {
-            dow : 0, // Sunday is the first day of the week.
-            doy : 6  // The week that contains Jan 1st is the first week of the year.
-        }
-    };
-
-    // Loads a language definition into the `languages` cache.  The function
-    // takes a key and optionally values.  If not in the browser and no values
-    // are provided, it will load the language file module.  As a convenience,
-    // this function also returns the language values.
-    function loadLang(key, values) {
-        values.abbr = key;
-        if (!languages[key]) {
-            languages[key] = new Language();
-        }
-        languages[key].set(values);
-        return languages[key];
-    }
-
-    // Determines which language definition to use and returns it.
-    //
-    // With no parameters, it will return the global language.  If you
-    // pass in a language key, such as 'en', it will return the
-    // definition for 'en', so long as 'en' has already been loaded using
-    // moment.lang.
-    function getLangDefinition(key) {
-        if (!key) {
-            return moment.fn._lang;
-        }
-        if (!languages[key] && hasModule) {
-            try {
-                require('./lang/' + key);
-            } catch (e) {
-                // call with no params to set to default
-                return moment.fn._lang;
-            }
-        }
-        return languages[key];
-    }
-
-
-    /************************************
-        Formatting
-    ************************************/
-
-
-    function removeFormattingTokens(input) {
-        if (input.match(/\[.*\]/)) {
-            return input.replace(/^\[|\]$/g, "");
-        }
-        return input.replace(/\\/g, "");
-    }
-
-    function makeFormatFunction(format) {
-        var array = format.match(formattingTokens), i, length;
-
-        for (i = 0, length = array.length; i < length; i++) {
-            if (formatTokenFunctions[array[i]]) {
-                array[i] = formatTokenFunctions[array[i]];
-            } else {
-                array[i] = removeFormattingTokens(array[i]);
-            }
-        }
-
-        return function (mom) {
-            var output = "";
-            for (i = 0; i < length; i++) {
-                output += array[i] instanceof Function ? array[i].call(mom, format) : array[i];
-            }
-            return output;
-        };
-    }
-
-    // format date using native date object
-    function formatMoment(m, format) {
-        var i = 5;
-
-        function replaceLongDateFormatTokens(input) {
-            return m.lang().longDateFormat(input) || input;
-        }
-
-        while (i-- && localFormattingTokens.test(format)) {
-            format = format.replace(localFormattingTokens, replaceLongDateFormatTokens);
-        }
-
-        if (!formatFunctions[format]) {
-            formatFunctions[format] = makeFormatFunction(format);
-        }
-
-        return formatFunctions[format](m);
-    }
-
-
-    /************************************
-        Parsing
-    ************************************/
-
-
-    // get the regex to find the next token
-    function getParseRegexForToken(token, config) {
-        switch (token) {
-        case 'DDDD':
-            return parseTokenThreeDigits;
-        case 'YYYY':
-            return parseTokenFourDigits;
-        case 'YYYYY':
-            return parseTokenSixDigits;
-        case 'S':
-        case 'SS':
-        case 'SSS':
-        case 'DDD':
-            return parseTokenOneToThreeDigits;
-        case 'MMM':
-        case 'MMMM':
-        case 'dd':
-        case 'ddd':
-        case 'dddd':
-            return parseTokenWord;
-        case 'a':
-        case 'A':
-            return getLangDefinition(config._l)._meridiemParse;
-        case 'X':
-            return parseTokenTimestampMs;
-        case 'Z':
-        case 'ZZ':
-            return parseTokenTimezone;
-        case 'T':
-            return parseTokenT;
-        case 'MM':
-        case 'DD':
-        case 'YY':
-        case 'HH':
-        case 'hh':
-        case 'mm':
-        case 'ss':
-        case 'M':
-        case 'D':
-        case 'd':
-        case 'H':
-        case 'h':
-        case 'm':
-        case 's':
-            return parseTokenOneOrTwoDigits;
-        default :
-            return new RegExp(token.replace('\\', ''));
-        }
-    }
-
-    function timezoneMinutesFromString(string) {
-        var tzchunk = (parseTokenTimezone.exec(string) || [])[0],
-            parts = (tzchunk + '').match(parseTimezoneChunker) || ['-', 0, 0],
-            minutes = +(parts[1] * 60) + ~~parts[2];
-
-        return parts[0] === '+' ? -minutes : minutes;
-    }
-
-    // function to convert string input to date
-    function addTimeToArrayFromToken(token, input, config) {
-        var a, datePartArray = config._a;
-
-        switch (token) {
-        // MONTH
-        case 'M' : // fall through to MM
-        case 'MM' :
-            datePartArray[1] = (input == null) ? 0 : ~~input - 1;
-            break;
-        case 'MMM' : // fall through to MMMM
-        case 'MMMM' :
-            a = getLangDefinition(config._l).monthsParse(input);
-            // if we didn't find a month name, mark the date as invalid.
-            if (a != null) {
-                datePartArray[1] = a;
-            } else {
-                config._isValid = false;
-            }
-            break;
-        // DAY OF MONTH
-        case 'D' : // fall through to DDDD
-        case 'DD' : // fall through to DDDD
-        case 'DDD' : // fall through to DDDD
-        case 'DDDD' :
-            if (input != null) {
-                datePartArray[2] = ~~input;
-            }
-            break;
-        // YEAR
-        case 'YY' :
-            datePartArray[0] = ~~input + (~~input > 68 ? 1900 : 2000);
-            break;
-        case 'YYYY' :
-        case 'YYYYY' :
-            datePartArray[0] = ~~input;
-            break;
-        // AM / PM
-        case 'a' : // fall through to A
-        case 'A' :
-            config._isPm = getLangDefinition(config._l).isPM(input);
-            break;
-        // 24 HOUR
-        case 'H' : // fall through to hh
-        case 'HH' : // fall through to hh
-        case 'h' : // fall through to hh
-        case 'hh' :
-            datePartArray[3] = ~~input;
-            break;
-        // MINUTE
-        case 'm' : // fall through to mm
-        case 'mm' :
-            datePartArray[4] = ~~input;
-            break;
-        // SECOND
-        case 's' : // fall through to ss
-        case 'ss' :
-            datePartArray[5] = ~~input;
-            break;
-        // MILLISECOND
-        case 'S' :
-        case 'SS' :
-        case 'SSS' :
-            datePartArray[6] = ~~ (('0.' + input) * 1000);
-            break;
-        // UNIX TIMESTAMP WITH MS
-        case 'X':
-            config._d = new Date(parseFloat(input) * 1000);
-            break;
-        // TIMEZONE
-        case 'Z' : // fall through to ZZ
-        case 'ZZ' :
-            config._useUTC = true;
-            config._tzm = timezoneMinutesFromString(input);
-            break;
-        }
-
-        // if the input is null, the date is not valid
-        if (input == null) {
-            config._isValid = false;
-        }
-    }
-
-    // convert an array to a date.
-    // the array should mirror the parameters below
-    // note: all values past the year are optional and will default to the lowest possible value.
-    // [year, month, day , hour, minute, second, millisecond]
-    function dateFromArray(config) {
-        var i, date, input = [];
-
-        if (config._d) {
-            return;
-        }
-
-        for (i = 0; i < 7; i++) {
-            config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];
-        }
-
-        // add the offsets to the time to be parsed so that we can have a clean array for checking isValid
-        input[3] += ~~((config._tzm || 0) / 60);
-        input[4] += ~~((config._tzm || 0) % 60);
-
-        date = new Date(0);
-
-        if (config._useUTC) {
-            date.setUTCFullYear(input[0], input[1], input[2]);
-            date.setUTCHours(input[3], input[4], input[5], input[6]);
-        } else {
-            date.setFullYear(input[0], input[1], input[2]);
-            date.setHours(input[3], input[4], input[5], input[6]);
-        }
-
-        config._d = date;
-    }
-
-    // date from string and format string
-    function makeDateFromStringAndFormat(config) {
-        // This array is used to make a Date, either with `new Date` or `Date.UTC`
-        var tokens = config._f.match(formattingTokens),
-            string = config._i,
-            i, parsedInput;
-
-        config._a = [];
-
-        for (i = 0; i < tokens.length; i++) {
-            parsedInput = (getParseRegexForToken(tokens[i], config).exec(string) || [])[0];
-            if (parsedInput) {
-                string = string.slice(string.indexOf(parsedInput) + parsedInput.length);
-            }
-            // don't parse if its not a known token
-            if (formatTokenFunctions[tokens[i]]) {
-                addTimeToArrayFromToken(tokens[i], parsedInput, config);
-            }
-        }
-
-        // add remaining unparsed input to the string
-        if (string) {
-            config._il = string;
-        }
-
-        // handle am pm
-        if (config._isPm && config._a[3] < 12) {
-            config._a[3] += 12;
-        }
-        // if is 12 am, change hours to 0
-        if (config._isPm === false && config._a[3] === 12) {
-            config._a[3] = 0;
-        }
-        // return
-        dateFromArray(config);
-    }
-
-    // date from string and array of format strings
-    function makeDateFromStringAndArray(config) {
-        var tempConfig,
-            tempMoment,
-            bestMoment,
-
-            scoreToBeat = 99,
-            i,
-            currentScore;
-
-        for (i = 0; i < config._f.length; i++) {
-            tempConfig = extend({}, config);
-            tempConfig._f = config._f[i];
-            makeDateFromStringAndFormat(tempConfig);
-            tempMoment = new Moment(tempConfig);
-
-            currentScore = compareArrays(tempConfig._a, tempMoment.toArray());
-
-            // if there is any input that was not parsed
-            // add a penalty for that format
-            if (tempMoment._il) {
-                currentScore += tempMoment._il.length;
-            }
-
-            if (currentScore < scoreToBeat) {
-                scoreToBeat = currentScore;
-                bestMoment = tempMoment;
-            }
-        }
-
-        extend(config, bestMoment);
-    }
-
-    // date from iso format
-    function makeDateFromString(config) {
-        var i,
-            string = config._i,
-            match = isoRegex.exec(string);
-
-        if (match) {
-            // match[2] should be "T" or undefined
-            config._f = 'YYYY-MM-DD' + (match[2] || " ");
-            for (i = 0; i < 4; i++) {
-                if (isoTimes[i][1].exec(string)) {
-                    config._f += isoTimes[i][0];
-                    break;
-                }
-            }
-            if (parseTokenTimezone.exec(string)) {
-                config._f += " Z";
-            }
-            makeDateFromStringAndFormat(config);
-        } else {
-            config._d = new Date(string);
-        }
-    }
-
-    function makeDateFromInput(config) {
-        var input = config._i,
-            matched = aspNetJsonRegex.exec(input);
-
-        if (input === undefined) {
-            config._d = new Date();
-        } else if (matched) {
-            config._d = new Date(+matched[1]);
-        } else if (typeof input === 'string') {
-            makeDateFromString(config);
-        } else if (isArray(input)) {
-            config._a = input.slice(0);
-            dateFromArray(config);
-        } else {
-            config._d = input instanceof Date ? new Date(+input) : new Date(input);
-        }
-    }
-
-
-    /************************************
-        Relative Time
-    ************************************/
-
-
-    // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize
-    function substituteTimeAgo(string, number, withoutSuffix, isFuture, lang) {
-        return lang.relativeTime(number || 1, !!withoutSuffix, string, isFuture);
-    }
-
-    function relativeTime(milliseconds, withoutSuffix, lang) {
-        var seconds = round(Math.abs(milliseconds) / 1000),
-            minutes = round(seconds / 60),
-            hours = round(minutes / 60),
-            days = round(hours / 24),
-            years = round(days / 365),
-            args = seconds < 45 && ['s', seconds] ||
-                minutes === 1 && ['m'] ||
-                minutes < 45 && ['mm', minutes] ||
-                hours === 1 && ['h'] ||
-                hours < 22 && ['hh', hours] ||
-                days === 1 && ['d'] ||
-                days <= 25 && ['dd', days] ||
-                days <= 45 && ['M'] ||
-                days < 345 && ['MM', round(days / 30)] ||
-                years === 1 && ['y'] || ['yy', years];
-        args[2] = withoutSuffix;
-        args[3] = milliseconds > 0;
-        args[4] = lang;
-        return substituteTimeAgo.apply({}, args);
-    }
-
-
-    /************************************
-        Week of Year
-    ************************************/
-
-
-    // firstDayOfWeek       0 = sun, 6 = sat
-    //                      the day of the week that starts the week
-    //                      (usually sunday or monday)
-    // firstDayOfWeekOfYear 0 = sun, 6 = sat
-    //                      the first week is the week that contains the first
-    //                      of this day of the week
-    //                      (eg. ISO weeks use thursday (4))
-    function weekOfYear(mom, firstDayOfWeek, firstDayOfWeekOfYear) {
-        var end = firstDayOfWeekOfYear - firstDayOfWeek,
-            daysToDayOfWeek = firstDayOfWeekOfYear - mom.day(),
-            adjustedMoment;
-
-
-        if (daysToDayOfWeek > end) {
-            daysToDayOfWeek -= 7;
-        }
-
-        if (daysToDayOfWeek < end - 7) {
-            daysToDayOfWeek += 7;
-        }
-
-        adjustedMoment = moment(mom).add('d', daysToDayOfWeek);
-        return {
-            week: Math.ceil(adjustedMoment.dayOfYear() / 7),
-            year: adjustedMoment.year()
-        };
-    }
-
-
-    /************************************
-        Top Level Functions
-    ************************************/
-
-    function makeMoment(config) {
-        var input = config._i,
-            format = config._f;
-
-        if (input === null || input === '') {
-            return null;
-        }
-
-        if (typeof input === 'string') {
-            config._i = input = getLangDefinition().preparse(input);
-        }
-
-        if (moment.isMoment(input)) {
-            config = extend({}, input);
-            config._d = new Date(+input._d);
-        } else if (format) {
-            if (isArray(format)) {
-                makeDateFromStringAndArray(config);
-            } else {
-                makeDateFromStringAndFormat(config);
-            }
-        } else {
-            makeDateFromInput(config);
-        }
-
-        return new Moment(config);
-    }
-
-    moment = function (input, format, lang) {
-        return makeMoment({
-            _i : input,
-            _f : format,
-            _l : lang,
-            _isUTC : false
-        });
-    };
-
-    // creating with utc
-    moment.utc = function (input, format, lang) {
-        return makeMoment({
-            _useUTC : true,
-            _isUTC : true,
-            _l : lang,
-            _i : input,
-            _f : format
-        });
-    };
-
-    // creating with unix timestamp (in seconds)
-    moment.unix = function (input) {
-        return moment(input * 1000);
-    };
-
-    // duration
-    moment.duration = function (input, key) {
-        var isDuration = moment.isDuration(input),
-            isNumber = (typeof input === 'number'),
-            duration = (isDuration ? input._input : (isNumber ? {} : input)),
-            matched = aspNetTimeSpanJsonRegex.exec(input),
-            sign,
-            ret;
-
-        if (isNumber) {
-            if (key) {
-                duration[key] = input;
-            } else {
-                duration.milliseconds = input;
-            }
-        } else if (matched) {
-            sign = (matched[1] === "-") ? -1 : 1;
-            duration = {
-                y: 0,
-                d: ~~matched[2] * sign,
-                h: ~~matched[3] * sign,
-                m: ~~matched[4] * sign,
-                s: ~~matched[5] * sign,
-                ms: ~~matched[6] * sign
-            };
-        }
-
-        ret = new Duration(duration);
-
-        if (isDuration && input.hasOwnProperty('_lang')) {
-            ret._lang = input._lang;
-        }
-
-        return ret;
-    };
-
-    // version number
-    moment.version = VERSION;
-
-    // default format
-    moment.defaultFormat = isoFormat;
-
-    // This function will be called whenever a moment is mutated.
-    // It is intended to keep the offset in sync with the timezone.
-    moment.updateOffset = function () {};
-
-    // This function will load languages and then set the global language.  If
-    // no arguments are passed in, it will simply return the current global
-    // language key.
-    moment.lang = function (key, values) {
-        if (!key) {
-            return moment.fn._lang._abbr;
-        }
-        if (values) {
-            loadLang(key, values);
-        } else if (!languages[key]) {
-            getLangDefinition(key);
-        }
-        moment.duration.fn._lang = moment.fn._lang = getLangDefinition(key);
-    };
-
-    // returns language data
-    moment.langData = function (key) {
-        if (key && key._lang && key._lang._abbr) {
-            key = key._lang._abbr;
-        }
-        return getLangDefinition(key);
-    };
-
-    // compare moment object
-    moment.isMoment = function (obj) {
-        return obj instanceof Moment;
-    };
-
-    // for typechecking Duration objects
-    moment.isDuration = function (obj) {
-        return obj instanceof Duration;
-    };
-
-
-    /************************************
-        Moment Prototype
-    ************************************/
-
-
-    moment.fn = Moment.prototype = {
-
-        clone : function () {
-            return moment(this);
-        },
-
-        valueOf : function () {
-            return +this._d + ((this._offset || 0) * 60000);
-        },
-
-        unix : function () {
-            return Math.floor(+this / 1000);
-        },
-
-        toString : function () {
-            return this.format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ");
-        },
-
-        toDate : function () {
-            return this._offset ? new Date(+this) : this._d;
-        },
-
-        toISOString : function () {
-            return formatMoment(moment(this).utc(), 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]');
-        },
-
-        toArray : function () {
-            var m = this;
-            return [
-                m.year(),
-                m.month(),
-                m.date(),
-                m.hours(),
-                m.minutes(),
-                m.seconds(),
-                m.milliseconds()
-            ];
-        },
-
-        isValid : function () {
-            if (this._isValid == null) {
-                if (this._a) {
-                    this._isValid = !compareArrays(this._a, (this._isUTC ? moment.utc(this._a) : moment(this._a)).toArray());
-                } else {
-                    this._isValid = !isNaN(this._d.getTime());
-                }
-            }
-            return !!this._isValid;
-        },
-
-        utc : function () {
-            return this.zone(0);
-        },
-
-        local : function () {
-            this.zone(0);
-            this._isUTC = false;
-            return this;
-        },
-
-        format : function (inputString) {
-            var output = formatMoment(this, inputString || moment.defaultFormat);
-            return this.lang().postformat(output);
-        },
-
-        add : function (input, val) {
-            var dur;
-            // switch args to support add('s', 1) and add(1, 's')
-            if (typeof input === 'string') {
-                dur = moment.duration(+val, input);
-            } else {
-                dur = moment.duration(input, val);
-            }
-            addOrSubtractDurationFromMoment(this, dur, 1);
-            return this;
-        },
-
-        subtract : function (input, val) {
-            var dur;
-            // switch args to support subtract('s', 1) and subtract(1, 's')
-            if (typeof input === 'string') {
-                dur = moment.duration(+val, input);
-            } else {
-                dur = moment.duration(input, val);
-            }
-            addOrSubtractDurationFromMoment(this, dur, -1);
-            return this;
-        },
-
-        diff : function (input, units, asFloat) {
-            var that = this._isUTC ? moment(input).zone(this._offset || 0) : moment(input).local(),
-                zoneDiff = (this.zone() - that.zone()) * 6e4,
-                diff, output;
-
-            units = normalizeUnits(units);
-
-            if (units === 'year' || units === 'month') {
-                // average number of days in the months in the given dates
-                diff = (this.daysInMonth() + that.daysInMonth()) * 432e5; // 24 * 60 * 60 * 1000 / 2
-                // difference in months
-                output = ((this.year() - that.year()) * 12) + (this.month() - that.month());
-                // adjust by taking difference in days, average number of days
-                // and dst in the given months.
-                output += ((this - moment(this).startOf('month')) -
-                        (that - moment(that).startOf('month'))) / diff;
-                // same as above but with zones, to negate all dst
-                output -= ((this.zone() - moment(this).startOf('month').zone()) -
-                        (that.zone() - moment(that).startOf('month').zone())) * 6e4 / diff;
-                if (units === 'year') {
-                    output = output / 12;
-                }
-            } else {
-                diff = (this - that);
-                output = units === 'second' ? diff / 1e3 : // 1000
-                    units === 'minute' ? diff / 6e4 : // 1000 * 60
-                    units === 'hour' ? diff / 36e5 : // 1000 * 60 * 60
-                    units === 'day' ? (diff - zoneDiff) / 864e5 : // 1000 * 60 * 60 * 24, negate dst
-                    units === 'week' ? (diff - zoneDiff) / 6048e5 : // 1000 * 60 * 60 * 24 * 7, negate dst
-                    diff;
-            }
-            return asFloat ? output : absRound(output);
-        },
-
-        from : function (time, withoutSuffix) {
-            return moment.duration(this.diff(time)).lang(this.lang()._abbr).humanize(!withoutSuffix);
-        },
-
-        fromNow : function (withoutSuffix) {
-            return this.from(moment(), withoutSuffix);
-        },
-
-        calendar : function () {
-            var diff = this.diff(moment().startOf('day'), 'days', true),
-                format = diff < -6 ? 'sameElse' :
-                diff < -1 ? 'lastWeek' :
-                diff < 0 ? 'lastDay' :
-                diff < 1 ? 'sameDay' :
-                diff < 2 ? 'nextDay' :
-                diff < 7 ? 'nextWeek' : 'sameElse';
-            return this.format(this.lang().calendar(format, this));
-        },
-
-        isLeapYear : function () {
-            var year = this.year();
-            return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
-        },
-
-        isDST : function () {
-            return (this.zone() < this.clone().month(0).zone() ||
-                this.zone() < this.clone().month(5).zone());
-        },
-
-        day : function (input) {
-            var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();
-            if (input != null) {
-                if (typeof input === 'string') {
-                    input = this.lang().weekdaysParse(input);
-                    if (typeof input !== 'number') {
-                        return this;
-                    }
-                }
-                return this.add({ d : input - day });
-            } else {
-                return day;
-            }
-        },
-
-        month : function (input) {
-            var utc = this._isUTC ? 'UTC' : '',
-                dayOfMonth,
-                daysInMonth;
-
-            if (input != null) {
-                if (typeof input === 'string') {
-                    input = this.lang().monthsParse(input);
-                    if (typeof input !== 'number') {
-                        return this;
-                    }
-                }
-
-                dayOfMonth = this.date();
-                this.date(1);
-                this._d['set' + utc + 'Month'](input);
-                this.date(Math.min(dayOfMonth, this.daysInMonth()));
-
-                moment.updateOffset(this);
-                return this;
-            } else {
-                return this._d['get' + utc + 'Month']();
-            }
-        },
-
-        startOf: function (units) {
-            units = normalizeUnits(units);
-            // the following switch intentionally omits break keywords
-            // to utilize falling through the cases.
-            switch (units) {
-            case 'year':
-                this.month(0);
-                /* falls through */
-            case 'month':
-                this.date(1);
-                /* falls through */
-            case 'week':
-            case 'day':
-                this.hours(0);
-                /* falls through */
-            case 'hour':
-                this.minutes(0);
-                /* falls through */
-            case 'minute':
-                this.seconds(0);
-                /* falls through */
-            case 'second':
-                this.milliseconds(0);
-                /* falls through */
-            }
-
-            // weeks are a special case
-            if (units === 'week') {
-                this.weekday(0);
-            }
-
-            return this;
-        },
-
-        endOf: function (units) {
-            return this.startOf(units).add(units, 1).subtract('ms', 1);
-        },
-
-        isAfter: function (input, units) {
-            units = typeof units !== 'undefined' ? units : 'millisecond';
-            return +this.clone().startOf(units) > +moment(input).startOf(units);
-        },
-
-        isBefore: function (input, units) {
-            units = typeof units !== 'undefined' ? units : 'millisecond';
-            return +this.clone().startOf(units) < +moment(input).startOf(units);
-        },
-
-        isSame: function (input, units) {
-            units = typeof units !== 'undefined' ? units : 'millisecond';
-            return +this.clone().startOf(units) === +moment(input).startOf(units);
-        },
-
-        min: function (other) {
-            other = moment.apply(null, arguments);
-            return other < this ? this : other;
-        },
-
-        max: function (other) {
-            other = moment.apply(null, arguments);
-            return other > this ? this : other;
-        },
-
-        zone : function (input) {
-            var offset = this._offset || 0;
-            if (input != null) {
-                if (typeof input === "string") {
-                    input = timezoneMinutesFromString(input);
-                }
-                if (Math.abs(input) < 16) {
-                    input = input * 60;
-                }
-                this._offset = input;
-                this._isUTC = true;
-                if (offset !== input) {
-                    addOrSubtractDurationFromMoment(this, moment.duration(offset - input, 'm'), 1, true);
-                }
-            } else {
-                return this._isUTC ? offset : this._d.getTimezoneOffset();
-            }
-            return this;
-        },
-
-        zoneAbbr : function () {
-            return this._isUTC ? "UTC" : "";
-        },
-
-        zoneName : function () {
-            return this._isUTC ? "Coordinated Universal Time" : "";
-        },
-
-        daysInMonth : function () {
-            return moment.utc([this.year(), this.month() + 1, 0]).date();
-        },
-
-        dayOfYear : function (input) {
-            var dayOfYear = round((moment(this).startOf('day') - moment(this).startOf('year')) / 864e5) + 1;
-            return input == null ? dayOfYear : this.add("d", (input - dayOfYear));
-        },
-
-        weekYear : function (input) {
-            var year = weekOfYear(this, this.lang()._week.dow, this.lang()._week.doy).year;
-            return input == null ? year : this.add("y", (input - year));
-        },
-
-        isoWeekYear : function (input) {
-            var year = weekOfYear(this, 1, 4).year;
-            return input == null ? year : this.add("y", (input - year));
-        },
-
-        week : function (input) {
-            var week = this.lang().week(this);
-            return input == null ? week : this.add("d", (input - week) * 7);
-        },
-
-        isoWeek : function (input) {
-            var week = weekOfYear(this, 1, 4).week;
-            return input == null ? week : this.add("d", (input - week) * 7);
-        },
-
-        weekday : function (input) {
-            var weekday = (this._d.getDay() + 7 - this.lang()._week.dow) % 7;
-            return input == null ? weekday : this.add("d", input - weekday);
-        },
-
-        isoWeekday : function (input) {
-            // behaves the same as moment#day except
-            // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)
-            // as a setter, sunday should belong to the previous week.
-            return input == null ? this.day() || 7 : this.day(this.day() % 7 ? input : input - 7);
-        },
-
-        // If passed a language key, it will set the language for this
-        // instance.  Otherwise, it will return the language configuration
-        // variables for this instance.
-        lang : function (key) {
-            if (key === undefined) {
-                return this._lang;
-            } else {
-                this._lang = getLangDefinition(key);
-                return this;
-            }
-        }
-    };
-
-    // helper for adding shortcuts
-    function makeGetterAndSetter(name, key) {
-        moment.fn[name] = moment.fn[name + 's'] = function (input) {
-            var utc = this._isUTC ? 'UTC' : '';
-            if (input != null) {
-                this._d['set' + utc + key](input);
-                moment.updateOffset(this);
-                return this;
-            } else {
-                return this._d['get' + utc + key]();
-            }
-        };
-    }
-
-    // loop through and add shortcuts (Month, Date, Hours, Minutes, Seconds, Milliseconds)
-    for (i = 0; i < proxyGettersAndSetters.length; i ++) {
-        makeGetterAndSetter(proxyGettersAndSetters[i].toLowerCase().replace(/s$/, ''), proxyGettersAndSetters[i]);
-    }
-
-    // add shortcut for year (uses different syntax than the getter/setter 'year' == 'FullYear')
-    makeGetterAndSetter('year', 'FullYear');
-
-    // add plural methods
-    moment.fn.days = moment.fn.day;
-    moment.fn.months = moment.fn.month;
-    moment.fn.weeks = moment.fn.week;
-    moment.fn.isoWeeks = moment.fn.isoWeek;
-
-    // add aliased format methods
-    moment.fn.toJSON = moment.fn.toISOString;
-
-    /************************************
-        Duration Prototype
-    ************************************/
-
-
-    moment.duration.fn = Duration.prototype = {
-        _bubble : function () {
-            var milliseconds = this._milliseconds,
-                days = this._days,
-                months = this._months,
-                data = this._data,
-                seconds, minutes, hours, years;
-
-            // The following code bubbles up values, see the tests for
-            // examples of what that means.
-            data.milliseconds = milliseconds % 1000;
-
-            seconds = absRound(milliseconds / 1000);
-            data.seconds = seconds % 60;
-
-            minutes = absRound(seconds / 60);
-            data.minutes = minutes % 60;
-
-            hours = absRound(minutes / 60);
-            data.hours = hours % 24;
-
-            days += absRound(hours / 24);
-            data.days = days % 30;
-
-            months += absRound(days / 30);
-            data.months = months % 12;
-
-            years = absRound(months / 12);
-            data.years = years;
-        },
-
-        weeks : function () {
-            return absRound(this.days() / 7);
-        },
-
-        valueOf : function () {
-            return this._milliseconds +
-              this._days * 864e5 +
-              (this._months % 12) * 2592e6 +
-              ~~(this._months / 12) * 31536e6;
-        },
-
-        humanize : function (withSuffix) {
-            var difference = +this,
-                output = relativeTime(difference, !withSuffix, this.lang());
-
-            if (withSuffix) {
-                output = this.lang().pastFuture(difference, output);
-            }
-
-            return this.lang().postformat(output);
-        },
-
-        add : function (input, val) {
-            // supports only 2.0-style add(1, 's') or add(moment)
-            var dur = moment.duration(input, val);
-
-            this._milliseconds += dur._milliseconds;
-            this._days += dur._days;
-            this._months += dur._months;
-
-            this._bubble();
-
-            return this;
-        },
-
-        subtract : function (input, val) {
-            var dur = moment.duration(input, val);
-
-            this._milliseconds -= dur._milliseconds;
-            this._days -= dur._days;
-            this._months -= dur._months;
-
-            this._bubble();
-
-            return this;
-        },
-
-        get : function (units) {
-            units = normalizeUnits(units);
-            return this[units.toLowerCase() + 's']();
-        },
-
-        as : function (units) {
-            units = normalizeUnits(units);
-            return this['as' + units.charAt(0).toUpperCase() + units.slice(1) + 's']();
-        },
-
-        lang : moment.fn.lang
-    };
-
-    function makeDurationGetter(name) {
-        moment.duration.fn[name] = function () {
-            return this._data[name];
-        };
-    }
-
-    function makeDurationAsGetter(name, factor) {
-        moment.duration.fn['as' + name] = function () {
-            return +this / factor;
-        };
-    }
-
-    for (i in unitMillisecondFactors) {
-        if (unitMillisecondFactors.hasOwnProperty(i)) {
-            makeDurationAsGetter(i, unitMillisecondFactors[i]);
-            makeDurationGetter(i.toLowerCase());
-        }
-    }
-
-    makeDurationAsGetter('Weeks', 6048e5);
-    moment.duration.fn.asMonths = function () {
-        return (+this - this.years() * 31536e6) / 2592e6 + this.years() * 12;
-    };
-
-
-    /************************************
-        Default Lang
-    ************************************/
-
-
-    // Set default language, other languages will inherit from English.
-    moment.lang('en', {
-        ordinal : function (number) {
-            var b = number % 10,
-                output = (~~ (number % 100 / 10) === 1) ? 'th' :
-                (b === 1) ? 'st' :
-                (b === 2) ? 'nd' :
-                (b === 3) ? 'rd' : 'th';
-            return number + output;
-        }
-    });
-
-
-    /************************************
-        Exposing Moment
-    ************************************/
-
-
-    // CommonJS module is defined
-    if (hasModule) {
-        module.exports = moment;
-    }
-    /*global ender:false */
-    if (typeof ender === 'undefined') {
-        // here, `this` means `window` in the browser, or `global` on the server
-        // add `moment` as a global object via a string identifier,
-        // for Closure Compiler "advanced" mode
-        this['moment'] = moment;
-    }
-    /*global define:false */
-    if (typeof define === "function" && define.amd) {
-        define("moment", [], function () {
-            return moment;
-        });
-    }
-}).call(this);

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/js/libs/require.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/js/libs/require.js b/brooklyn-ui/src/main/webapp/assets/js/libs/require.js
deleted file mode 100644
index 7df0d60..0000000
--- a/brooklyn-ui/src/main/webapp/assets/js/libs/require.js
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- RequireJS 2.0.6 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
- Available via the MIT or new BSD license.
- see: http://github.com/jrburke/requirejs for details
-*/
-var requirejs,require,define;
-(function(Z){function x(b){return J.call(b)==="[object Function]"}function E(b){return J.call(b)==="[object Array]"}function o(b,e){if(b){var f;for(f=0;f<b.length;f+=1)if(b[f]&&e(b[f],f,b))break}}function M(b,e){if(b){var f;for(f=b.length-1;f>-1;f-=1)if(b[f]&&e(b[f],f,b))break}}function y(b,e){for(var f in b)if(b.hasOwnProperty(f)&&e(b[f],f))break}function N(b,e,f,h){e&&y(e,function(e,j){if(f||!F.call(b,j))h&&typeof e!=="string"?(b[j]||(b[j]={}),N(b[j],e,f,h)):b[j]=e});return b}function t(b,e){return function(){return e.apply(b,
-arguments)}}function $(b){if(!b)return b;var e=Z;o(b.split("."),function(b){e=e[b]});return e}function aa(b,e,f){return function(){var h=ga.call(arguments,0),c;if(f&&x(c=h[h.length-1]))c.__requireJsBuild=!0;h.push(e);return b.apply(null,h)}}function ba(b,e,f){o([["toUrl"],["undef"],["defined","requireDefined"],["specified","requireSpecified"]],function(h){var c=h[1]||h[0];b[h[0]]=e?aa(e[c],f):function(){var b=z[O];return b[c].apply(b,arguments)}})}function G(b,e,f,h){e=Error(e+"\nhttp://requirejs.org/docs/errors.html#"+
-b);e.requireType=b;e.requireModules=h;if(f)e.originalError=f;return e}function ha(){if(H&&H.readyState==="interactive")return H;M(document.getElementsByTagName("script"),function(b){if(b.readyState==="interactive")return H=b});return H}var j,p,u,B,s,C,H,I,ca,da,ia=/(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,ja=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,ea=/\.js$/,ka=/^\.\//;p=Object.prototype;var J=p.toString,F=p.hasOwnProperty;p=Array.prototype;var ga=p.slice,la=p.splice,w=!!(typeof window!==
-"undefined"&&navigator&&document),fa=!w&&typeof importScripts!=="undefined",ma=w&&navigator.platform==="PLAYSTATION 3"?/^complete$/:/^(complete|loaded)$/,O="_",S=typeof opera!=="undefined"&&opera.toString()==="[object Opera]",z={},r={},P=[],K=!1;if(typeof define==="undefined"){if(typeof requirejs!=="undefined"){if(x(requirejs))return;r=requirejs;requirejs=void 0}typeof require!=="undefined"&&!x(require)&&(r=require,require=void 0);j=requirejs=function(b,e,f,h){var c,o=O;!E(b)&&typeof b!=="string"&&
-(c=b,E(e)?(b=e,e=f,f=h):b=[]);if(c&&c.context)o=c.context;(h=z[o])||(h=z[o]=j.s.newContext(o));c&&h.configure(c);return h.require(b,e,f)};j.config=function(b){return j(b)};require||(require=j);j.version="2.0.6";j.jsExtRegExp=/^\/|:|\?|\.js$/;j.isBrowser=w;p=j.s={contexts:z,newContext:function(b){function e(a,d,k){var l,b,i,v,e,c,f,g=d&&d.split("/");l=g;var h=m.map,j=h&&h["*"];if(a&&a.charAt(0)===".")if(d){l=m.pkgs[d]?g=[d]:g.slice(0,g.length-1);d=a=l.concat(a.split("/"));for(l=0;d[l];l+=1)if(b=d[l],
-b===".")d.splice(l,1),l-=1;else if(b==="..")if(l===1&&(d[2]===".."||d[0]===".."))break;else l>0&&(d.splice(l-1,2),l-=2);l=m.pkgs[d=a[0]];a=a.join("/");l&&a===d+"/"+l.main&&(a=d)}else a.indexOf("./")===0&&(a=a.substring(2));if(k&&(g||j)&&h){d=a.split("/");for(l=d.length;l>0;l-=1){i=d.slice(0,l).join("/");if(g)for(b=g.length;b>0;b-=1)if(k=h[g.slice(0,b).join("/")])if(k=k[i]){v=k;e=l;break}if(v)break;!c&&j&&j[i]&&(c=j[i],f=l)}!v&&c&&(v=c,e=f);v&&(d.splice(0,e,v),a=d.join("/"))}return a}function f(a){w&&
-o(document.getElementsByTagName("script"),function(d){if(d.getAttribute("data-requiremodule")===a&&d.getAttribute("data-requirecontext")===g.contextName)return d.parentNode.removeChild(d),!0})}function h(a){var d=m.paths[a];if(d&&E(d)&&d.length>1)return f(a),d.shift(),g.undef(a),g.require([a]),!0}function c(a,d,k,l){var b,i,v=a?a.indexOf("!"):-1,c=null,f=d?d.name:null,h=a,j=!0,m="";a||(j=!1,a="_@r"+(M+=1));v!==-1&&(c=a.substring(0,v),a=a.substring(v+1,a.length));c&&(c=e(c,f,l),i=q[c]);a&&(c?m=i&&
-i.normalize?i.normalize(a,function(a){return e(a,f,l)}):e(a,f,l):(m=e(a,f,l),b=g.nameToUrl(m)));a=c&&!i&&!k?"_unnormalized"+(O+=1):"";return{prefix:c,name:m,parentMap:d,unnormalized:!!a,url:b,originalName:h,isDefine:j,id:(c?c+"!"+m:m)+a}}function p(a){var d=a.id,k=n[d];k||(k=n[d]=new g.Module(a));return k}function r(a,d,k){var b=a.id,c=n[b];if(F.call(q,b)&&(!c||c.defineEmitComplete))d==="defined"&&k(q[b]);else p(a).on(d,k)}function A(a,d){var k=a.requireModules,b=!1;if(d)d(a);else if(o(k,function(d){if(d=
-n[d])d.error=a,d.events.error&&(b=!0,d.emit("error",a))}),!b)j.onError(a)}function s(){P.length&&(la.apply(D,[D.length-1,0].concat(P)),P=[])}function u(a,d,k){a=a&&a.map;d=aa(k||g.require,a,d);ba(d,g,a);d.isBrowser=w;return d}function z(a){delete n[a];o(L,function(d,k){if(d.map.id===a)return L.splice(k,1),d.defined||(g.waitCount-=1),!0})}function B(a,d,k){var b=a.map.id,c=a.depMaps,i;if(a.inited){if(d[b])return a;d[b]=!0;o(c,function(a){var a=a.id,b=n[a];return!b||k[a]||!b.inited||!b.enabled?void 0:
-i=B(b,d,k)});k[b]=!0;return i}}function C(a,d,b){var l=a.map.id,c=a.depMaps;if(a.inited&&a.map.isDefine){if(d[l])return q[l];d[l]=a;o(c,function(i){var i=i.id,c=n[i];!Q[i]&&c&&(!c.inited||!c.enabled?b[l]=!0:(c=C(c,d,b),b[i]||a.defineDepById(i,c)))});a.check(!0);return q[l]}}function I(a){a.check()}function T(){var a,d,b,l,c=(b=m.waitSeconds*1E3)&&g.startTime+b<(new Date).getTime(),i=[],e=!1,j=!0;if(!U){U=!0;y(n,function(b){a=b.map;d=a.id;if(b.enabled&&!b.error)if(!b.inited&&c)h(d)?e=l=!0:(i.push(d),
-f(d));else if(!b.inited&&b.fetched&&a.isDefine&&(e=!0,!a.prefix))return j=!1});if(c&&i.length)return b=G("timeout","Load timeout for modules: "+i,null,i),b.contextName=g.contextName,A(b);j&&(o(L,function(a){if(!a.defined){var a=B(a,{},{}),d={};a&&(C(a,d,{}),y(d,I))}}),y(n,I));if((!c||l)&&e)if((w||fa)&&!V)V=setTimeout(function(){V=0;T()},50);U=!1}}function W(a){p(c(a[0],null,!0)).init(a[1],a[2])}function J(a){var a=a.currentTarget||a.srcElement,d=g.onScriptLoad;a.detachEvent&&!S?a.detachEvent("onreadystatechange",
-d):a.removeEventListener("load",d,!1);d=g.onScriptError;a.detachEvent&&!S||a.removeEventListener("error",d,!1);return{node:a,id:a&&a.getAttribute("data-requiremodule")}}var U,X,g,Q,V,m={waitSeconds:7,baseUrl:"./",paths:{},pkgs:{},shim:{}},n={},Y={},D=[],q={},R={},M=1,O=1,L=[];Q={require:function(a){return u(a)},exports:function(a){a.usingExports=!0;if(a.map.isDefine)return a.exports=q[a.map.id]={}},module:function(a){return a.module={id:a.map.id,uri:a.map.url,config:function(){return m.config&&m.config[a.map.id]||
-{}},exports:q[a.map.id]}}};X=function(a){this.events=Y[a.id]||{};this.map=a;this.shim=m.shim[a.id];this.depExports=[];this.depMaps=[];this.depMatched=[];this.pluginMaps={};this.depCount=0};X.prototype={init:function(a,d,b,c){c=c||{};if(!this.inited){this.factory=d;if(b)this.on("error",b);else this.events.error&&(b=t(this,function(a){this.emit("error",a)}));this.depMaps=a&&a.slice(0);this.depMaps.rjsSkipMap=a.rjsSkipMap;this.errback=b;this.inited=!0;this.ignore=c.ignore;c.enabled||this.enabled?this.enable():
-this.check()}},defineDepById:function(a,d){var b;o(this.depMaps,function(d,c){if(d.id===a)return b=c,!0});return this.defineDep(b,d)},defineDep:function(a,d){this.depMatched[a]||(this.depMatched[a]=!0,this.depCount-=1,this.depExports[a]=d)},fetch:function(){if(!this.fetched){this.fetched=!0;g.startTime=(new Date).getTime();var a=this.map;if(this.shim)u(this,!0)(this.shim.deps||[],t(this,function(){return a.prefix?this.callPlugin():this.load()}));else return a.prefix?this.callPlugin():this.load()}},
-load:function(){var a=this.map.url;R[a]||(R[a]=!0,g.load(this.map.id,a))},check:function(a){if(this.enabled&&!this.enabling){var d,b,c=this.map.id;b=this.depExports;var e=this.exports,i=this.factory;if(this.inited)if(this.error)this.emit("error",this.error);else{if(!this.defining){this.defining=!0;if(this.depCount<1&&!this.defined){if(x(i)){if(this.events.error)try{e=g.execCb(c,i,b,e)}catch(f){d=f}else e=g.execCb(c,i,b,e);if(this.map.isDefine)if((b=this.module)&&b.exports!==void 0&&b.exports!==this.exports)e=
-b.exports;else if(e===void 0&&this.usingExports)e=this.exports;if(d)return d.requireMap=this.map,d.requireModules=[this.map.id],d.requireType="define",A(this.error=d)}else e=i;this.exports=e;if(this.map.isDefine&&!this.ignore&&(q[c]=e,j.onResourceLoad))j.onResourceLoad(g,this.map,this.depMaps);delete n[c];this.defined=!0;g.waitCount-=1;g.waitCount===0&&(L=[])}this.defining=!1;if(!a&&this.defined&&!this.defineEmitted)this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0}}else this.fetch()}},
-callPlugin:function(){var a=this.map,d=a.id,b=c(a.prefix,null,!1,!0);r(b,"defined",t(this,function(b){var k;k=this.map.name;var i=this.map.parentMap?this.map.parentMap.name:null;if(this.map.unnormalized){if(b.normalize&&(k=b.normalize(k,function(a){return e(a,i,!0)})||""),b=c(a.prefix+"!"+k,this.map.parentMap,!1,!0),r(b,"defined",t(this,function(a){this.init([],function(){return a},null,{enabled:!0,ignore:!0})})),b=n[b.id]){if(this.events.error)b.on("error",t(this,function(a){this.emit("error",a)}));
-b.enable()}}else k=t(this,function(a){this.init([],function(){return a},null,{enabled:!0})}),k.error=t(this,function(a){this.inited=!0;this.error=a;a.requireModules=[d];y(n,function(a){a.map.id.indexOf(d+"_unnormalized")===0&&z(a.map.id)});A(a)}),k.fromText=function(a,b){var d=K;d&&(K=!1);p(c(a));j.exec(b);d&&(K=!0);g.completeLoad(a)},b.load(a.name,u(a.parentMap,!0,function(a,b,d){a.rjsSkipMap=!0;return g.require(a,b,d)}),k,m)}));g.enable(b,this);this.pluginMaps[b.id]=b},enable:function(){this.enabled=
-!0;if(!this.waitPushed)L.push(this),g.waitCount+=1,this.waitPushed=!0;this.enabling=!0;o(this.depMaps,t(this,function(a,b){var k,e;if(typeof a==="string"){a=c(a,this.map.isDefine?this.map:this.map.parentMap,!1,!this.depMaps.rjsSkipMap);this.depMaps[b]=a;if(k=Q[a.id]){this.depExports[b]=k(this);return}this.depCount+=1;r(a,"defined",t(this,function(a){this.defineDep(b,a);this.check()}));this.errback&&r(a,"error",this.errback)}k=a.id;e=n[k];!Q[k]&&e&&!e.enabled&&g.enable(a,this)}));y(this.pluginMaps,
-t(this,function(a){var b=n[a.id];b&&!b.enabled&&g.enable(a,this)}));this.enabling=!1;this.check()},on:function(a,b){var c=this.events[a];c||(c=this.events[a]=[]);c.push(b)},emit:function(a,b){o(this.events[a],function(a){a(b)});a==="error"&&delete this.events[a]}};return g={config:m,contextName:b,registry:n,defined:q,urlFetched:R,waitCount:0,defQueue:D,Module:X,makeModuleMap:c,configure:function(a){a.baseUrl&&a.baseUrl.charAt(a.baseUrl.length-1)!=="/"&&(a.baseUrl+="/");var b=m.pkgs,e=m.shim,f=m.paths,
-j=m.map;N(m,a,!0);m.paths=N(f,a.paths,!0);if(a.map)m.map=N(j||{},a.map,!0,!0);if(a.shim)y(a.shim,function(a,b){E(a)&&(a={deps:a});if(a.exports&&!a.exports.__buildReady)a.exports=g.makeShimExports(a.exports);e[b]=a}),m.shim=e;if(a.packages)o(a.packages,function(a){a=typeof a==="string"?{name:a}:a;b[a.name]={name:a.name,location:a.location||a.name,main:(a.main||"main").replace(ka,"").replace(ea,"")}}),m.pkgs=b;y(n,function(a,b){if(!a.inited&&!a.map.unnormalized)a.map=c(b)});if(a.deps||a.callback)g.require(a.deps||
-[],a.callback)},makeShimExports:function(a){var b;return typeof a==="string"?(b=function(){return $(a)},b.exports=a,b):function(){return a.apply(Z,arguments)}},requireDefined:function(a,b){var e=c(a,b,!1,!0).id;return F.call(q,e)},requireSpecified:function(a,b){a=c(a,b,!1,!0).id;return F.call(q,a)||F.call(n,a)},require:function(a,d,e,f){var h;if(typeof a==="string"){if(x(d))return A(G("requireargs","Invalid require call"),e);if(j.get)return j.get(g,a,d);a=c(a,d,!1,!0);a=a.id;return!F.call(q,a)?A(G("notloaded",
-'Module name "'+a+'" has not been loaded yet for context: '+b)):q[a]}e&&!x(e)&&(f=e,e=void 0);d&&!x(d)&&(f=d,d=void 0);for(s();D.length;)if(h=D.shift(),h[0]===null)return A(G("mismatch","Mismatched anonymous define() module: "+h[h.length-1]));else W(h);p(c(null,f)).init(a,d,e,{enabled:!0});T();return g.require},undef:function(a){s();var b=c(a,null,!0),e=n[a];delete q[a];delete R[b.url];delete Y[a];if(e){if(e.events.defined)Y[a]=e.events;z(a)}},enable:function(a){n[a.id]&&p(a).enable()},completeLoad:function(a){var b,
-c,e=m.shim[a]||{},f=e.exports&&e.exports.exports;for(s();D.length;){c=D.shift();if(c[0]===null){c[0]=a;if(b)break;b=!0}else c[0]===a&&(b=!0);W(c)}c=n[a];if(!b&&!q[a]&&c&&!c.inited)if(m.enforceDefine&&(!f||!$(f)))if(h(a))return;else return A(G("nodefine","No define call for "+a,null,[a]));else W([a,e.deps||[],e.exports]);T()},toUrl:function(a,b){var c=a.lastIndexOf("."),f=null;c!==-1&&(f=a.substring(c,a.length),a=a.substring(0,c));return g.nameToUrl(e(a,b&&b.id,!0),f)},nameToUrl:function(a,b){var c,
-e,f,i,h,g;if(j.jsExtRegExp.test(a))i=a+(b||"");else{c=m.paths;e=m.pkgs;i=a.split("/");for(h=i.length;h>0;h-=1)if(g=i.slice(0,h).join("/"),f=e[g],g=c[g]){E(g)&&(g=g[0]);i.splice(0,h,g);break}else if(f){c=a===f.name?f.location+"/"+f.main:f.location;i.splice(0,h,c);break}i=i.join("/");i+=b||(/\?/.test(i)?"":".js");i=(i.charAt(0)==="/"||i.match(/^[\w\+\.\-]+:/)?"":m.baseUrl)+i}return m.urlArgs?i+((i.indexOf("?")===-1?"?":"&")+m.urlArgs):i},load:function(a,b){j.load(g,a,b)},execCb:function(a,b,c,e){return b.apply(e,
-c)},onScriptLoad:function(a){if(a.type==="load"||ma.test((a.currentTarget||a.srcElement).readyState))H=null,a=J(a),g.completeLoad(a.id)},onScriptError:function(a){var b=J(a);if(!h(b.id))return A(G("scripterror","Script error",a,[b.id]))}}}};j({});ba(j);if(w&&(u=p.head=document.getElementsByTagName("head")[0],B=document.getElementsByTagName("base")[0]))u=p.head=B.parentNode;j.onError=function(b){throw b;};j.load=function(b,e,f){var h=b&&b.config||{},c;if(w)return c=h.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml",
-"html:script"):document.createElement("script"),c.type=h.scriptType||"text/javascript",c.charset="utf-8",c.async=!0,c.setAttribute("data-requirecontext",b.contextName),c.setAttribute("data-requiremodule",e),c.attachEvent&&!(c.attachEvent.toString&&c.attachEvent.toString().indexOf("[native code")<0)&&!S?(K=!0,c.attachEvent("onreadystatechange",b.onScriptLoad)):(c.addEventListener("load",b.onScriptLoad,!1),c.addEventListener("error",b.onScriptError,!1)),c.src=f,I=c,B?u.insertBefore(c,B):u.appendChild(c),
-I=null,c;else fa&&(importScripts(f),b.completeLoad(e))};w&&M(document.getElementsByTagName("script"),function(b){if(!u)u=b.parentNode;if(s=b.getAttribute("data-main")){if(!r.baseUrl)C=s.split("/"),ca=C.pop(),da=C.length?C.join("/")+"/":"./",r.baseUrl=da,s=ca;s=s.replace(ea,"");r.deps=r.deps?r.deps.concat(s):[s];return!0}});define=function(b,e,f){var h,c;typeof b!=="string"&&(f=e,e=b,b=null);E(e)||(f=e,e=[]);!e.length&&x(f)&&f.length&&(f.toString().replace(ia,"").replace(ja,function(b,c){e.push(c)}),
-e=(f.length===1?["require"]:["require","exports","module"]).concat(e));if(K&&(h=I||ha()))b||(b=h.getAttribute("data-requiremodule")),c=z[h.getAttribute("data-requirecontext")];(c?c.defQueue:P).push([b,e,f])};define.amd={jQuery:!0};j.exec=function(b){return eval(b)};j(r)}})(this);

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/js/libs/text.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/js/libs/text.js b/brooklyn-ui/src/main/webapp/assets/js/libs/text.js
deleted file mode 100644
index b4623c5..0000000
--- a/brooklyn-ui/src/main/webapp/assets/js/libs/text.js
+++ /dev/null
@@ -1,367 +0,0 @@
-/**
- * @license RequireJS text 2.0.6 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
- * Available via the MIT or new BSD license.
- * see: http://github.com/requirejs/text for details
- */
-/*jslint regexp: true */
-/*global require, XMLHttpRequest, ActiveXObject,
-  define, window, process, Packages,
-  java, location, Components, FileUtils */
-
-define(['module'], function (module) {
-    'use strict';
-
-    var text, fs, Cc, Ci,
-        progIds = ['Msxml2.XMLHTTP', 'Microsoft.XMLHTTP', 'Msxml2.XMLHTTP.4.0'],
-        xmlRegExp = /^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,
-        bodyRegExp = /<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,
-        hasLocation = typeof location !== 'undefined' && location.href,
-        defaultProtocol = hasLocation && location.protocol && location.protocol.replace(/\:/, ''),
-        defaultHostName = hasLocation && location.hostname,
-        defaultPort = hasLocation && (location.port || undefined),
-        buildMap = [],
-        masterConfig = (module.config && module.config()) || {};
-
-    text = {
-        version: '2.0.6',
-
-        strip: function (content) {
-            //Strips <?xml ...?> declarations so that external SVG and XML
-            //documents can be added to a document without worry. Also, if the string
-            //is an HTML document, only the part inside the body tag is returned.
-            if (content) {
-                content = content.replace(xmlRegExp, "");
-                var matches = content.match(bodyRegExp);
-                if (matches) {
-                    content = matches[1];
-                }
-            } else {
-                content = "";
-            }
-            return content;
-        },
-
-        jsEscape: function (content) {
-            return content.replace(/(['\\])/g, '\\$1')
-                .replace(/[\f]/g, "\\f")
-                .replace(/[\b]/g, "\\b")
-                .replace(/[\n]/g, "\\n")
-                .replace(/[\t]/g, "\\t")
-                .replace(/[\r]/g, "\\r")
-                .replace(/[\u2028]/g, "\\u2028")
-                .replace(/[\u2029]/g, "\\u2029");
-        },
-
-        createXhr: masterConfig.createXhr || function () {
-            //Would love to dump the ActiveX crap in here. Need IE 6 to die first.
-            var xhr, i, progId;
-            if (typeof XMLHttpRequest !== "undefined") {
-                return new XMLHttpRequest();
-            } else if (typeof ActiveXObject !== "undefined") {
-                for (i = 0; i < 3; i += 1) {
-                    progId = progIds[i];
-                    try {
-                        xhr = new ActiveXObject(progId);
-                    } catch (e) {}
-
-                    if (xhr) {
-                        progIds = [progId];  // so faster next time
-                        break;
-                    }
-                }
-            }
-
-            return xhr;
-        },
-
-        /**
-         * Parses a resource name into its component parts. Resource names
-         * look like: module/name.ext!strip, where the !strip part is
-         * optional.
-         * @param {String} name the resource name
-         * @returns {Object} with properties "moduleName", "ext" and "strip"
-         * where strip is a boolean.
-         */
-        parseName: function (name) {
-            var modName, ext, temp,
-                strip = false,
-                index = name.indexOf("."),
-                isRelative = name.indexOf('./') === 0 ||
-                             name.indexOf('../') === 0;
-
-            if (index !== -1 && (!isRelative || index > 1)) {
-                modName = name.substring(0, index);
-                ext = name.substring(index + 1, name.length);
-            } else {
-                modName = name;
-            }
-
-            temp = ext || modName;
-            index = temp.indexOf("!");
-            if (index !== -1) {
-                //Pull off the strip arg.
-                strip = temp.substring(index + 1) === "strip";
-                temp = temp.substring(0, index);
-                if (ext) {
-                    ext = temp;
-                } else {
-                    modName = temp;
-                }
-            }
-
-            return {
-                moduleName: modName,
-                ext: ext,
-                strip: strip
-            };
-        },
-
-        xdRegExp: /^((\w+)\:)?\/\/([^\/\\]+)/,
-
-        /**
-         * Is an URL on another domain. Only works for browser use, returns
-         * false in non-browser environments. Only used to know if an
-         * optimized .js version of a text resource should be loaded
-         * instead.
-         * @param {String} url
-         * @returns Boolean
-         */
-        useXhr: function (url, protocol, hostname, port) {
-            var uProtocol, uHostName, uPort,
-                match = text.xdRegExp.exec(url);
-            if (!match) {
-                return true;
-            }
-            uProtocol = match[2];
-            uHostName = match[3];
-
-            uHostName = uHostName.split(':');
-            uPort = uHostName[1];
-            uHostName = uHostName[0];
-
-            return (!uProtocol || uProtocol === protocol) &&
-                   (!uHostName || uHostName.toLowerCase() === hostname.toLowerCase()) &&
-                   ((!uPort && !uHostName) || uPort === port);
-        },
-
-        finishLoad: function (name, strip, content, onLoad) {
-            content = strip ? text.strip(content) : content;
-            if (masterConfig.isBuild) {
-                buildMap[name] = content;
-            }
-            onLoad(content);
-        },
-
-        load: function (name, req, onLoad, config) {
-            //Name has format: some.module.filext!strip
-            //The strip part is optional.
-            //if strip is present, then that means only get the string contents
-            //inside a body tag in an HTML string. For XML/SVG content it means
-            //removing the <?xml ...?> declarations so the content can be inserted
-            //into the current doc without problems.
-
-            // Do not bother with the work if a build and text will
-            // not be inlined.
-            if (config.isBuild && !config.inlineText) {
-                onLoad();
-                return;
-            }
-
-            masterConfig.isBuild = config.isBuild;
-
-            var parsed = text.parseName(name),
-                nonStripName = parsed.moduleName +
-                    (parsed.ext ? '.' + parsed.ext : ''),
-                url = req.toUrl(nonStripName),
-                useXhr = (masterConfig.useXhr) ||
-                         text.useXhr;
-
-            //Load the text. Use XHR if possible and in a browser.
-            if (!hasLocation || useXhr(url, defaultProtocol, defaultHostName, defaultPort)) {
-                text.get(url, function (content) {
-                    text.finishLoad(name, parsed.strip, content, onLoad);
-                }, function (err) {
-                    if (onLoad.error) {
-                        onLoad.error(err);
-                    }
-                });
-            } else {
-                //Need to fetch the resource across domains. Assume
-                //the resource has been optimized into a JS module. Fetch
-                //by the module name + extension, but do not include the
-                //!strip part to avoid file system issues.
-                req([nonStripName], function (content) {
-                    text.finishLoad(parsed.moduleName + '.' + parsed.ext,
-                                    parsed.strip, content, onLoad);
-                });
-            }
-        },
-
-        write: function (pluginName, moduleName, write, config) {
-            if (buildMap.hasOwnProperty(moduleName)) {
-                var content = text.jsEscape(buildMap[moduleName]);
-                write.asModule(pluginName + "!" + moduleName,
-                               "define(function () { return '" +
-                                   content +
-                               "';});\n");
-            }
-        },
-
-        writeFile: function (pluginName, moduleName, req, write, config) {
-            var parsed = text.parseName(moduleName),
-                extPart = parsed.ext ? '.' + parsed.ext : '',
-                nonStripName = parsed.moduleName + extPart,
-                //Use a '.js' file name so that it indicates it is a
-                //script that can be loaded across domains.
-                fileName = req.toUrl(parsed.moduleName + extPart) + '.js';
-
-            //Leverage own load() method to load plugin value, but only
-            //write out values that do not have the strip argument,
-            //to avoid any potential issues with ! in file names.
-            text.load(nonStripName, req, function (value) {
-                //Use own write() method to construct full module value.
-                //But need to create shell that translates writeFile's
-                //write() to the right interface.
-                var textWrite = function (contents) {
-                    return write(fileName, contents);
-                };
-                textWrite.asModule = function (moduleName, contents) {
-                    return write.asModule(moduleName, fileName, contents);
-                };
-
-                text.write(pluginName, nonStripName, textWrite, config);
-            }, config);
-        }
-    };
-
-    if (masterConfig.env === 'node' || (!masterConfig.env &&
-            typeof process !== "undefined" &&
-            process.versions &&
-            !!process.versions.node)) {
-        //Using special require.nodeRequire, something added by r.js.
-        fs = require.nodeRequire('fs');
-
-        text.get = function (url, callback) {
-            var file = fs.readFileSync(url, 'utf8');
-            //Remove BOM (Byte Mark Order) from utf8 files if it is there.
-            if (file.indexOf('\uFEFF') === 0) {
-                file = file.substring(1);
-            }
-            callback(file);
-        };
-    } else if (masterConfig.env === 'xhr' || (!masterConfig.env &&
-            text.createXhr())) {
-        text.get = function (url, callback, errback, headers) {
-            var xhr = text.createXhr(), header;
-            xhr.open('GET', url, true);
-
-            //Allow plugins direct access to xhr headers
-            if (headers) {
-                for (header in headers) {
-                    if (headers.hasOwnProperty(header)) {
-                        xhr.setRequestHeader(header.toLowerCase(), headers[header]);
-                    }
-                }
-            }
-
-            //Allow overrides specified in config
-            if (masterConfig.onXhr) {
-                masterConfig.onXhr(xhr, url);
-            }
-
-            xhr.onreadystatechange = function (evt) {
-                var status, err;
-                //Do not explicitly handle errors, those should be
-                //visible via console output in the browser.
-                if (xhr.readyState === 4) {
-                    status = xhr.status;
-                    if (status > 399 && status < 600) {
-                        //An http 4xx or 5xx error. Signal an error.
-                        err = new Error(url + ' HTTP status: ' + status);
-                        err.xhr = xhr;
-                        errback(err);
-                    } else {
-                        callback(xhr.responseText);
-                    }
-
-                    if (masterConfig.onXhrComplete) {
-                        masterConfig.onXhrComplete(xhr, url);
-                    }
-                }
-            };
-            xhr.send(null);
-        };
-    } else if (masterConfig.env === 'rhino' || (!masterConfig.env &&
-            typeof Packages !== 'undefined' && typeof java !== 'undefined')) {
-        //Why Java, why is this so awkward?
-        text.get = function (url, callback) {
-            var stringBuffer, line,
-                encoding = "utf-8",
-                file = new java.io.File(url),
-                lineSeparator = java.lang.System.getProperty("line.separator"),
-                input = new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(file), encoding)),
-                content = '';
-            try {
-                stringBuffer = new java.lang.StringBuffer();
-                line = input.readLine();
-
-                // Byte Order Mark (BOM) - The Unicode Standard, version 3.0, page 324
-                // http://www.unicode.org/faq/utf_bom.html
-
-                // Note that when we use utf-8, the BOM should appear as "EF BB BF", but it doesn't due to this bug in the JDK:
-                // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4508058
-                if (line && line.length() && line.charAt(0) === 0xfeff) {
-                    // Eat the BOM, since we've already found the encoding on this file,
-                    // and we plan to concatenating this buffer with others; the BOM should
-                    // only appear at the top of a file.
-                    line = line.substring(1);
-                }
-
-                stringBuffer.append(line);
-
-                while ((line = input.readLine()) !== null) {
-                    stringBuffer.append(lineSeparator);
-                    stringBuffer.append(line);
-                }
-                //Make sure we return a JavaScript string and not a Java string.
-                content = String(stringBuffer.toString()); //String
-            } finally {
-                input.close();
-            }
-            callback(content);
-        };
-    } else if (masterConfig.env === 'xpconnect' || (!masterConfig.env &&
-            typeof Components !== 'undefined' && Components.classes &&
-            Components.interfaces)) {
-        //Avert your gaze!
-        Cc = Components.classes,
-        Ci = Components.interfaces;
-        Components.utils['import']('resource://gre/modules/FileUtils.jsm');
-
-        text.get = function (url, callback) {
-            var inStream, convertStream,
-                readData = {},
-                fileObj = new FileUtils.File(url);
-
-            //XPCOM, you so crazy
-            try {
-                inStream = Cc['@mozilla.org/network/file-input-stream;1']
-                           .createInstance(Ci.nsIFileInputStream);
-                inStream.init(fileObj, 1, 0, false);
-
-                convertStream = Cc['@mozilla.org/intl/converter-input-stream;1']
-                                .createInstance(Ci.nsIConverterInputStream);
-                convertStream.init(inStream, "utf-8", inStream.available(),
-                Ci.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER);
-
-                convertStream.readString(inStream.available(), readData);
-                convertStream.close();
-                inStream.close();
-                callback(readData.value);
-            } catch (e) {
-                throw new Error((fileObj && fileObj.path || '') + ': ' + e);
-            }
-        };
-    }
-    return text;
-});


[17/51] [abbrv] [partial] brooklyn-ui git commit: move subdir from incubator up a level as it is promoted to its own repo (first non-incubator commit!)

Posted by he...@apache.org.
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/css/bootstrap.css
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/css/bootstrap.css b/src/main/webapp/assets/css/bootstrap.css
new file mode 100644
index 0000000..107edf8
--- /dev/null
+++ b/src/main/webapp/assets/css/bootstrap.css
@@ -0,0 +1,5001 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+*/
+/*!
+ * Bootstrap v2.0.4
+ *
+ * Copyright 2012 Twitter, Inc
+ * Licensed under the Apache License v2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Designed and built with all the love in the world @twitter by @mdo and @fat.
+ */
+
+article,
+aside,
+details,
+figcaption,
+figure,
+footer,
+header,
+hgroup,
+nav,
+section {
+  display: block;
+}
+
+audio,
+canvas,
+video {
+  display: inline-block;
+  *display: inline;
+  *zoom: 1;
+}
+
+audio:not([controls]) {
+  display: none;
+}
+
+html {
+  font-size: 100%;
+  -webkit-text-size-adjust: 100%;
+      -ms-text-size-adjust: 100%;
+}
+
+a:focus {
+  outline: thin dotted #333;
+  outline: 5px auto -webkit-focus-ring-color;
+  outline-offset: -2px;
+}
+
+a:hover,
+a:active {
+  outline: 0;
+}
+
+sub,
+sup {
+  position: relative;
+  font-size: 75%;
+  line-height: 0;
+  vertical-align: baseline;
+}
+
+sup {
+  top: -0.5em;
+}
+
+sub {
+  bottom: -0.25em;
+}
+
+img {
+  max-width: 100%;
+  vertical-align: middle;
+  border: 0;
+  -ms-interpolation-mode: bicubic;
+}
+
+#map_canvas img {
+  max-width: none;
+}
+
+button,
+input,
+select,
+textarea {
+  margin: 0;
+  font-size: 100%;
+  vertical-align: middle;
+}
+
+button,
+input {
+  *overflow: visible;
+  line-height: normal;
+}
+
+button::-moz-focus-inner,
+input::-moz-focus-inner {
+  padding: 0;
+  border: 0;
+}
+
+button,
+input[type="button"],
+input[type="reset"],
+input[type="submit"] {
+  cursor: pointer;
+  -webkit-appearance: button;
+}
+
+input[type="search"] {
+  -webkit-box-sizing: content-box;
+     -moz-box-sizing: content-box;
+          box-sizing: content-box;
+  -webkit-appearance: textfield;
+}
+
+input[type="search"]::-webkit-search-decoration,
+input[type="search"]::-webkit-search-cancel-button {
+  -webkit-appearance: none;
+}
+
+textarea {
+  overflow: auto;
+  vertical-align: top;
+}
+
+.clearfix {
+  *zoom: 1;
+}
+
+.clearfix:before,
+.clearfix:after {
+  display: table;
+  content: "";
+}
+
+.clearfix:after {
+  clear: both;
+}
+
+.hide-text {
+  font: 0/0 a;
+  color: transparent;
+  text-shadow: none;
+  background-color: transparent;
+  border: 0;
+}
+
+.input-block-level {
+  display: block;
+  width: 100%;
+  min-height: 28px;
+  -webkit-box-sizing: border-box;
+     -moz-box-sizing: border-box;
+      -ms-box-sizing: border-box;
+          box-sizing: border-box;
+}
+
+body {
+  margin: 0;
+  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
+  font-size: 13px;
+  line-height: 18px;
+  color: #333333;
+  background-color: #ffffff;
+}
+
+a {
+  color: #0088cc;
+  text-decoration: none;
+}
+
+a:hover {
+  color: #005580;
+  text-decoration: underline;
+}
+
+.row {
+  margin-left: -20px;
+  *zoom: 1;
+}
+
+.row:before,
+.row:after {
+  display: table;
+  content: "";
+}
+
+.row:after {
+  clear: both;
+}
+
+[class*="span"] {
+  float: left;
+  margin-left: 20px;
+}
+
+.container,
+.navbar-fixed-top .container,
+.navbar-fixed-bottom .container {
+  width: 940px;
+}
+
+.span12 {
+  width: 940px;
+}
+
+.span11 {
+  width: 860px;
+}
+
+.span10 {
+  width: 780px;
+}
+
+.span9 {
+  width: 700px;
+}
+
+.span8 {
+  width: 620px;
+}
+
+.span7 {
+  width: 540px;
+}
+
+.span6 {
+  width: 460px;
+}
+
+.span5 {
+  width: 380px;
+}
+
+.span4 {
+  width: 300px;
+}
+
+.span3 {
+  width: 220px;
+}
+
+.span2 {
+  width: 140px;
+}
+
+.span1 {
+  width: 60px;
+}
+
+.offset12 {
+  margin-left: 980px;
+}
+
+.offset11 {
+  margin-left: 900px;
+}
+
+.offset10 {
+  margin-left: 820px;
+}
+
+.offset9 {
+  margin-left: 740px;
+}
+
+.offset8 {
+  margin-left: 660px;
+}
+
+.offset7 {
+  margin-left: 580px;
+}
+
+.offset6 {
+  margin-left: 500px;
+}
+
+.offset5 {
+  margin-left: 420px;
+}
+
+.offset4 {
+  margin-left: 340px;
+}
+
+.offset3 {
+  margin-left: 260px;
+}
+
+.offset2 {
+  margin-left: 180px;
+}
+
+.offset1 {
+  margin-left: 100px;
+}
+
+.row-fluid {
+  width: 100%;
+  *zoom: 1;
+}
+
+.row-fluid:before,
+.row-fluid:after {
+  display: table;
+  content: "";
+}
+
+.row-fluid:after {
+  clear: both;
+}
+
+.row-fluid [class*="span"] {
+  display: block;
+  float: left;
+  width: 100%;
+  min-height: 28px;
+  margin-left: 2.127659574%;
+  *margin-left: 2.0744680846382977%;
+  -webkit-box-sizing: border-box;
+     -moz-box-sizing: border-box;
+      -ms-box-sizing: border-box;
+          box-sizing: border-box;
+}
+
+.row-fluid [class*="span"]:first-child {
+  margin-left: 0;
+}
+
+.row-fluid .span12 {
+  width: 99.99999998999999%;
+  *width: 99.94680850063828%;
+}
+
+.row-fluid .span11 {
+  width: 91.489361693%;
+  *width: 91.4361702036383%;
+}
+
+.row-fluid .span10 {
+  width: 82.97872339599999%;
+  *width: 82.92553190663828%;
+}
+
+.row-fluid .span9 {
+  width: 74.468085099%;
+  *width: 74.4148936096383%;
+}
+
+.row-fluid .span8 {
+  width: 65.95744680199999%;
+  *width: 65.90425531263828%;
+}
+
+.row-fluid .span7 {
+  width: 57.446808505%;
+  *width: 57.3936170156383%;
+}
+
+.row-fluid .span6 {
+  width: 48.93617020799999%;
+  *width: 48.88297871863829%;
+}
+
+.row-fluid .span5 {
+  width: 40.425531911%;
+  *width: 40.3723404216383%;
+}
+
+.row-fluid .span4 {
+  width: 31.914893614%;
+  *width: 31.8617021246383%;
+}
+
+.row-fluid .span3 {
+  width: 23.404255317%;
+  *width: 23.3510638276383%;
+}
+
+.row-fluid .span2 {
+  width: 14.89361702%;
+  *width: 14.8404255306383%;
+}
+
+.row-fluid .span1 {
+  width: 6.382978723%;
+  *width: 6.329787233638298%;
+}
+
+.container {
+  margin-right: auto;
+  margin-left: auto;
+  *zoom: 1;
+}
+
+.container:before,
+.container:after {
+  display: table;
+  content: "";
+}
+
+.container:after {
+  clear: both;
+}
+
+.container-fluid {
+  padding-right: 20px;
+  padding-left: 20px;
+  *zoom: 1;
+}
+
+.container-fluid:before,
+.container-fluid:after {
+  display: table;
+  content: "";
+}
+
+.container-fluid:after {
+  clear: both;
+}
+
+p {
+  margin: 0 0 9px;
+}
+
+p small {
+  font-size: 11px;
+  color: #999999;
+}
+
+.lead {
+  margin-bottom: 18px;
+  font-size: 20px;
+  font-weight: 200;
+  line-height: 27px;
+}
+
+h1,
+h2,
+h3,
+h4,
+h5,
+h6 {
+  margin: 0;
+  font-family: inherit;
+  font-weight: bold;
+  color: inherit;
+  text-rendering: optimizelegibility;
+}
+
+h1 small,
+h2 small,
+h3 small,
+h4 small,
+h5 small,
+h6 small {
+  font-weight: normal;
+  color: #999999;
+}
+
+h1 {
+  font-size: 30px;
+  line-height: 36px;
+}
+
+h1 small {
+  font-size: 18px;
+}
+
+h2 {
+  font-size: 24px;
+  line-height: 36px;
+}
+
+h2 small {
+  font-size: 18px;
+}
+
+h3 {
+  font-size: 18px;
+  line-height: 27px;
+}
+
+h3 small {
+  font-size: 14px;
+}
+
+h4,
+h5,
+h6 {
+  line-height: 18px;
+}
+
+h4 {
+  font-size: 14px;
+}
+
+h4 small {
+  font-size: 12px;
+}
+
+h5 {
+  font-size: 12px;
+}
+
+h6 {
+  font-size: 11px;
+  color: #999999;
+  text-transform: uppercase;
+}
+
+.page-header {
+  padding-bottom: 17px;
+  margin: 18px 0;
+  border-bottom: 1px solid #eeeeee;
+}
+
+.page-header h1 {
+  line-height: 1;
+}
+
+ul,
+ol {
+  padding: 0;
+  margin: 0 0 9px 25px;
+}
+
+ul ul,
+ul ol,
+ol ol,
+ol ul {
+  margin-bottom: 0;
+}
+
+ul {
+  list-style: disc;
+}
+
+ol {
+  list-style: decimal;
+}
+
+li {
+  line-height: 18px;
+}
+
+ul.unstyled,
+ol.unstyled {
+  margin-left: 0;
+  list-style: none;
+}
+
+dl {
+  margin-bottom: 18px;
+}
+
+dt,
+dd {
+  line-height: 18px;
+}
+
+dt {
+  font-weight: bold;
+  line-height: 17px;
+}
+
+dd {
+  margin-left: 9px;
+}
+
+.dl-horizontal dt {
+  float: left;
+  width: 120px;
+  overflow: hidden;
+  clear: left;
+  text-align: right;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+}
+
+.dl-horizontal dd {
+  margin-left: 130px;
+}
+
+hr {
+  margin: 18px 0;
+  border: 0;
+  border-top: 1px solid #eeeeee;
+  border-bottom: 1px solid #ffffff;
+}
+
+strong {
+  font-weight: bold;
+}
+
+em {
+  font-style: italic;
+}
+
+.muted {
+  color: #999999;
+}
+
+abbr[title] {
+  cursor: help;
+  border-bottom: 1px dotted #999999;
+}
+
+abbr.initialism {
+  font-size: 90%;
+  text-transform: uppercase;
+}
+
+blockquote {
+  padding: 0 0 0 15px;
+  margin: 0 0 18px;
+  border-left: 5px solid #eeeeee;
+}
+
+blockquote p {
+  margin-bottom: 0;
+  font-size: 16px;
+  font-weight: 300;
+  line-height: 22.5px;
+}
+
+blockquote small {
+  display: block;
+  line-height: 18px;
+  color: #999999;
+}
+
+blockquote small:before {
+  content: '\2014 \00A0';
+}
+
+blockquote.pull-right {
+  float: right;
+  padding-right: 15px;
+  padding-left: 0;
+  border-right: 5px solid #eeeeee;
+  border-left: 0;
+}
+
+blockquote.pull-right p,
+blockquote.pull-right small {
+  text-align: right;
+}
+
+q:before,
+q:after,
+blockquote:before,
+blockquote:after {
+  content: "";
+}
+
+address {
+  display: block;
+  margin-bottom: 18px;
+  font-style: normal;
+  line-height: 18px;
+}
+
+small {
+  font-size: 100%;
+}
+
+cite {
+  font-style: normal;
+}
+
+code,
+pre {
+  padding: 0 3px 2px;
+  font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
+  font-size: 12px;
+  color: #333333;
+  -webkit-border-radius: 3px;
+     -moz-border-radius: 3px;
+          border-radius: 3px;
+}
+
+code {
+  padding: 2px 4px;
+  color: #d14;
+  background-color: #f7f7f9;
+  border: 1px solid #e1e1e8;
+}
+
+pre {
+  display: block;
+  padding: 8.5px;
+  margin: 0 0 9px;
+  font-size: 12.025px;
+  line-height: 18px;
+  word-break: break-all;
+  word-wrap: break-word;
+  white-space: pre;
+  white-space: pre-wrap;
+  background-color: #f5f5f5;
+  border: 1px solid #ccc;
+  border: 1px solid rgba(0, 0, 0, 0.15);
+  -webkit-border-radius: 4px;
+     -moz-border-radius: 4px;
+          border-radius: 4px;
+}
+
+pre.prettyprint {
+  margin-bottom: 18px;
+}
+
+pre code {
+  padding: 0;
+  color: inherit;
+  background-color: transparent;
+  border: 0;
+}
+
+.pre-scrollable {
+  max-height: 340px;
+  overflow-y: scroll;
+}
+
+form {
+  margin: 0 0 18px;
+}
+
+fieldset {
+  padding: 0;
+  margin: 0;
+  border: 0;
+}
+
+legend {
+  display: block;
+  width: 100%;
+  padding: 0;
+  margin-bottom: 27px;
+  font-size: 19.5px;
+  line-height: 36px;
+  color: #333333;
+  border: 0;
+  border-bottom: 1px solid #e5e5e5;
+}
+
+legend small {
+  font-size: 13.5px;
+  color: #999999;
+}
+
+label,
+input,
+button,
+select,
+textarea {
+  font-size: 13px;
+  font-weight: normal;
+  line-height: 18px;
+}
+
+input,
+button,
+select,
+textarea {
+  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
+}
+
+label {
+  display: block;
+  margin-bottom: 5px;
+}
+
+select,
+textarea,
+input[type="text"],
+input[type="password"],
+input[type="datetime"],
+input[type="datetime-local"],
+input[type="date"],
+input[type="month"],
+input[type="time"],
+input[type="week"],
+input[type="number"],
+input[type="email"],
+input[type="url"],
+input[type="search"],
+input[type="tel"],
+input[type="color"],
+.uneditable-input {
+  display: inline-block;
+  height: 18px;
+  padding: 4px;
+  margin-bottom: 9px;
+  font-size: 13px;
+  line-height: 18px;
+  color: #555555;
+}
+
+input,
+textarea {
+  width: 210px;
+}
+
+textarea {
+  height: auto;
+}
+
+textarea,
+input[type="text"],
+input[type="password"],
+input[type="datetime"],
+input[type="datetime-local"],
+input[type="date"],
+input[type="month"],
+input[type="time"],
+input[type="week"],
+input[type="number"],
+input[type="email"],
+input[type="url"],
+input[type="search"],
+input[type="tel"],
+input[type="color"],
+.uneditable-input {
+  background-color: #ffffff;
+  border: 1px solid #cccccc;
+  -webkit-border-radius: 3px;
+     -moz-border-radius: 3px;
+          border-radius: 3px;
+  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
+     -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
+          box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
+  -webkit-transition: border linear 0.2s, box-shadow linear 0.2s;
+     -moz-transition: border linear 0.2s, box-shadow linear 0.2s;
+      -ms-transition: border linear 0.2s, box-shadow linear 0.2s;
+       -o-transition: border linear 0.2s, box-shadow linear 0.2s;
+          transition: border linear 0.2s, box-shadow linear 0.2s;
+}
+
+textarea:focus,
+input[type="text"]:focus,
+input[type="password"]:focus,
+input[type="datetime"]:focus,
+input[type="datetime-local"]:focus,
+input[type="date"]:focus,
+input[type="month"]:focus,
+input[type="time"]:focus,
+input[type="week"]:focus,
+input[type="number"]:focus,
+input[type="email"]:focus,
+input[type="url"]:focus,
+input[type="search"]:focus,
+input[type="tel"]:focus,
+input[type="color"]:focus,
+.uneditable-input:focus {
+  border-color: rgba(82, 168, 236, 0.8);
+  outline: 0;
+  outline: thin dotted \9;
+  /* IE6-9 */
+
+  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
+     -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
+          box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
+}
+
+input[type="radio"],
+input[type="checkbox"] {
+  margin: 3px 0;
+  *margin-top: 0;
+  /* IE7 */
+
+  line-height: normal;
+  cursor: pointer;
+}
+
+input[type="submit"],
+input[type="reset"],
+input[type="button"],
+input[type="radio"],
+input[type="checkbox"] {
+  width: auto;
+}
+
+.uneditable-textarea {
+  width: auto;
+  height: auto;
+}
+
+select,
+input[type="file"] {
+  height: 28px;
+  /* In IE7, the height of the select element cannot be changed by height, only font-size */
+
+  *margin-top: 4px;
+  /* For IE7, add top margin to align select with labels */
+
+  line-height: 28px;
+}
+
+select {
+  width: 220px;
+  border: 1px solid #bbb;
+}
+
+select[multiple],
+select[size] {
+  height: auto;
+}
+
+select:focus,
+input[type="file"]:focus,
+input[type="radio"]:focus,
+input[type="checkbox"]:focus {
+  outline: thin dotted #333;
+  outline: 5px auto -webkit-focus-ring-color;
+  outline-offset: -2px;
+}
+
+.radio,
+.checkbox {
+  min-height: 18px;
+  padding-left: 18px;
+}
+
+.radio input[type="radio"],
+.checkbox input[type="checkbox"] {
+  float: left;
+  margin-left: -18px;
+}
+
+.controls > .radio:first-child,
+.controls > .checkbox:first-child {
+  padding-top: 5px;
+}
+
+.radio.inline,
+.checkbox.inline {
+  display: inline-block;
+  padding-top: 5px;
+  margin-bottom: 0;
+  vertical-align: middle;
+}
+
+.radio.inline + .radio.inline,
+.checkbox.inline + .checkbox.inline {
+  margin-left: 10px;
+}
+
+.input-mini {
+  width: 60px;
+}
+
+.input-small {
+  width: 90px;
+}
+
+.input-medium {
+  width: 150px;
+}
+
+.input-large {
+  width: 210px;
+}
+
+.input-xlarge {
+  width: 270px;
+}
+
+.input-xxlarge {
+  width: 530px;
+}
+
+input[class*="span"],
+select[class*="span"],
+textarea[class*="span"],
+.uneditable-input[class*="span"],
+.row-fluid input[class*="span"],
+.row-fluid select[class*="span"],
+.row-fluid textarea[class*="span"],
+.row-fluid .uneditable-input[class*="span"] {
+  float: none;
+  margin-left: 0;
+}
+
+.input-append input[class*="span"],
+.input-append .uneditable-input[class*="span"],
+.input-prepend input[class*="span"],
+.input-prepend .uneditable-input[class*="span"],
+.row-fluid .input-prepend [class*="span"],
+.row-fluid .input-append [class*="span"] {
+  display: inline-block;
+}
+
+input,
+textarea,
+.uneditable-input {
+  margin-left: 0;
+}
+
+input.span12,
+textarea.span12,
+.uneditable-input.span12 {
+  width: 930px;
+}
+
+input.span11,
+textarea.span11,
+.uneditable-input.span11 {
+  width: 850px;
+}
+
+input.span10,
+textarea.span10,
+.uneditable-input.span10 {
+  width: 770px;
+}
+
+input.span9,
+textarea.span9,
+.uneditable-input.span9 {
+  width: 690px;
+}
+
+input.span8,
+textarea.span8,
+.uneditable-input.span8 {
+  width: 610px;
+}
+
+input.span7,
+textarea.span7,
+.uneditable-input.span7 {
+  width: 530px;
+}
+
+input.span6,
+textarea.span6,
+.uneditable-input.span6 {
+  width: 450px;
+}
+
+input.span5,
+textarea.span5,
+.uneditable-input.span5 {
+  width: 370px;
+}
+
+input.span4,
+textarea.span4,
+.uneditable-input.span4 {
+  width: 290px;
+}
+
+input.span3,
+textarea.span3,
+.uneditable-input.span3 {
+  width: 210px;
+}
+
+input.span2,
+textarea.span2,
+.uneditable-input.span2 {
+  width: 130px;
+}
+
+input.span1,
+textarea.span1,
+.uneditable-input.span1 {
+  width: 50px;
+}
+
+input[disabled],
+select[disabled],
+textarea[disabled],
+input[readonly],
+select[readonly],
+textarea[readonly] {
+  cursor: not-allowed;
+  background-color: #eeeeee;
+  border-color: #ddd;
+}
+
+input[type="radio"][disabled],
+input[type="checkbox"][disabled],
+input[type="radio"][readonly],
+input[type="checkbox"][readonly] {
+  background-color: transparent;
+}
+
+.control-group.warning > label,
+.control-group.warning .help-block,
+.control-group.warning .help-inline {
+  color: #c09853;
+}
+
+.control-group.warning .checkbox,
+.control-group.warning .radio,
+.control-group.warning input,
+.control-group.warning select,
+.control-group.warning textarea {
+  color: #c09853;
+  border-color: #c09853;
+}
+
+.control-group.warning .checkbox:focus,
+.control-group.warning .radio:focus,
+.control-group.warning input:focus,
+.control-group.warning select:focus,
+.control-group.warning textarea:focus {
+  border-color: #a47e3c;
+  -webkit-box-shadow: 0 0 6px #dbc59e;
+     -moz-box-shadow: 0 0 6px #dbc59e;
+          box-shadow: 0 0 6px #dbc59e;
+}
+
+.control-group.warning .input-prepend .add-on,
+.control-group.warning .input-append .add-on {
+  color: #c09853;
+  background-color: #fcf8e3;
+  border-color: #c09853;
+}
+
+.control-group.error > label,
+.control-group.error .help-block,
+.control-group.error .help-inline {
+  color: #b94a48;
+}
+
+.control-group.error .checkbox,
+.control-group.error .radio,
+.control-group.error input,
+.control-group.error select,
+.control-group.error textarea {
+  color: #b94a48;
+  border-color: #b94a48;
+}
+
+.control-group.error .checkbox:focus,
+.control-group.error .radio:focus,
+.control-group.error input:focus,
+.control-group.error select:focus,
+.control-group.error textarea:focus {
+  border-color: #953b39;
+  -webkit-box-shadow: 0 0 6px #d59392;
+     -moz-box-shadow: 0 0 6px #d59392;
+          box-shadow: 0 0 6px #d59392;
+}
+
+.control-group.error .input-prepend .add-on,
+.control-group.error .input-append .add-on {
+  color: #b94a48;
+  background-color: #f2dede;
+  border-color: #b94a48;
+}
+
+.control-group.success > label,
+.control-group.success .help-block,
+.control-group.success .help-inline {
+  color: #468847;
+}
+
+.control-group.success .checkbox,
+.control-group.success .radio,
+.control-group.success input,
+.control-group.success select,
+.control-group.success textarea {
+  color: #468847;
+  border-color: #468847;
+}
+
+.control-group.success .checkbox:focus,
+.control-group.success .radio:focus,
+.control-group.success input:focus,
+.control-group.success select:focus,
+.control-group.success textarea:focus {
+  border-color: #356635;
+  -webkit-box-shadow: 0 0 6px #7aba7b;
+     -moz-box-shadow: 0 0 6px #7aba7b;
+          box-shadow: 0 0 6px #7aba7b;
+}
+
+.control-group.success .input-prepend .add-on,
+.control-group.success .input-append .add-on {
+  color: #468847;
+  background-color: #dff0d8;
+  border-color: #468847;
+}
+
+input:focus:required:invalid,
+textarea:focus:required:invalid,
+select:focus:required:invalid {
+  color: #b94a48;
+  border-color: #ee5f5b;
+}
+
+input:focus:required:invalid:focus,
+textarea:focus:required:invalid:focus,
+select:focus:required:invalid:focus {
+  border-color: #e9322d;
+  -webkit-box-shadow: 0 0 6px #f8b9b7;
+     -moz-box-shadow: 0 0 6px #f8b9b7;
+          box-shadow: 0 0 6px #f8b9b7;
+}
+
+.form-actions {
+  padding: 17px 20px 18px;
+  margin-top: 18px;
+  margin-bottom: 18px;
+  background-color: #f5f5f5;
+  border-top: 1px solid #e5e5e5;
+  *zoom: 1;
+}
+
+.form-actions:before,
+.form-actions:after {
+  display: table;
+  content: "";
+}
+
+.form-actions:after {
+  clear: both;
+}
+
+.uneditable-input {
+  overflow: hidden;
+  white-space: nowrap;
+  cursor: not-allowed;
+  background-color: #ffffff;
+  border-color: #eee;
+  -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025);
+     -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025);
+          box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025);
+}
+
+:-moz-placeholder {
+  color: #999999;
+}
+
+:-ms-input-placeholder {
+  color: #999999;
+}
+
+::-webkit-input-placeholder {
+  color: #999999;
+}
+
+.help-block,
+.help-inline {
+  color: #555555;
+}
+
+.help-block {
+  display: block;
+  margin-bottom: 9px;
+}
+
+.help-inline {
+  display: inline-block;
+  *display: inline;
+  padding-left: 5px;
+  vertical-align: middle;
+  *zoom: 1;
+}
+
+.input-prepend,
+.input-append {
+  margin-bottom: 5px;
+}
+
+.input-prepend input,
+.input-append input,
+.input-prepend select,
+.input-append select,
+.input-prepend .uneditable-input,
+.input-append .uneditable-input {
+  position: relative;
+  margin-bottom: 0;
+  *margin-left: 0;
+  vertical-align: middle;
+  -webkit-border-radius: 0 3px 3px 0;
+     -moz-border-radius: 0 3px 3px 0;
+          border-radius: 0 3px 3px 0;
+}
+
+.input-prepend input:focus,
+.input-append input:focus,
+.input-prepend select:focus,
+.input-append select:focus,
+.input-prepend .uneditable-input:focus,
+.input-append .uneditable-input:focus {
+  z-index: 2;
+}
+
+.input-prepend .uneditable-input,
+.input-append .uneditable-input {
+  border-left-color: #ccc;
+}
+
+.input-prepend .add-on,
+.input-append .add-on {
+  display: inline-block;
+  width: auto;
+  height: 18px;
+  min-width: 16px;
+  padding: 4px 5px;
+  font-weight: normal;
+  line-height: 18px;
+  text-align: center;
+  text-shadow: 0 1px 0 #ffffff;
+  vertical-align: middle;
+  background-color: #eeeeee;
+  border: 1px solid #ccc;
+}
+
+.input-prepend .add-on,
+.input-append .add-on,
+.input-prepend .btn,
+.input-append .btn {
+  margin-left: -1px;
+  -webkit-border-radius: 0;
+     -moz-border-radius: 0;
+          border-radius: 0;
+}
+
+.input-prepend .active,
+.input-append .active {
+  background-color: #a9dba9;
+  border-color: #46a546;
+}
+
+.input-prepend .add-on,
+.input-prepend .btn {
+  margin-right: -1px;
+}
+
+.input-prepend .add-on:first-child,
+.input-prepend .btn:first-child {
+  -webkit-border-radius: 3px 0 0 3px;
+     -moz-border-radius: 3px 0 0 3px;
+          border-radius: 3px 0 0 3px;
+}
+
+.input-append input,
+.input-append select,
+.input-append .uneditable-input {
+  -webkit-border-radius: 3px 0 0 3px;
+     -moz-border-radius: 3px 0 0 3px;
+          border-radius: 3px 0 0 3px;
+}
+
+.input-append .uneditable-input {
+  border-right-color: #ccc;
+  border-left-color: #eee;
+}
+
+.input-append .add-on:last-child,
+.input-append .btn:last-child {
+  -webkit-border-radius: 0 3px 3px 0;
+     -moz-border-radius: 0 3px 3px 0;
+          border-radius: 0 3px 3px 0;
+}
+
+.input-prepend.input-append input,
+.input-prepend.input-append select,
+.input-prepend.input-append .uneditable-input {
+  -webkit-border-radius: 0;
+     -moz-border-radius: 0;
+          border-radius: 0;
+}
+
+.input-prepend.input-append .add-on:first-child,
+.input-prepend.input-append .btn:first-child {
+  margin-right: -1px;
+  -webkit-border-radius: 3px 0 0 3px;
+     -moz-border-radius: 3px 0 0 3px;
+          border-radius: 3px 0 0 3px;
+}
+
+.input-prepend.input-append .add-on:last-child,
+.input-prepend.input-append .btn:last-child {
+  margin-left: -1px;
+  -webkit-border-radius: 0 3px 3px 0;
+     -moz-border-radius: 0 3px 3px 0;
+          border-radius: 0 3px 3px 0;
+}
+
+.search-query {
+  padding-right: 14px;
+  padding-right: 4px \9;
+  padding-left: 14px;
+  padding-left: 4px \9;
+  /* IE7-8 doesn't have border-radius, so don't indent the padding */
+
+  margin-bottom: 0;
+  -webkit-border-radius: 14px;
+     -moz-border-radius: 14px;
+          border-radius: 14px;
+}
+
+.form-search input,
+.form-inline input,
+.form-horizontal input,
+.form-search textarea,
+.form-inline textarea,
+.form-horizontal textarea,
+.form-search select,
+.form-inline select,
+.form-horizontal select,
+.form-search .help-inline,
+.form-inline .help-inline,
+.form-horizontal .help-inline,
+.form-search .uneditable-input,
+.form-inline .uneditable-input,
+.form-horizontal .uneditable-input,
+.form-search .input-prepend,
+.form-inline .input-prepend,
+.form-horizontal .input-prepend,
+.form-search .input-append,
+.form-inline .input-append,
+.form-horizontal .input-append {
+  display: inline-block;
+  *display: inline;
+  margin-bottom: 0;
+  *zoom: 1;
+}
+
+.form-search .hide,
+.form-inline .hide,
+.form-horizontal .hide {
+  display: none;
+}
+
+.form-search label,
+.form-inline label {
+  display: inline-block;
+}
+
+.form-search .input-append,
+.form-inline .input-append,
+.form-search .input-prepend,
+.form-inline .input-prepend {
+  margin-bottom: 0;
+}
+
+.form-search .radio,
+.form-search .checkbox,
+.form-inline .radio,
+.form-inline .checkbox {
+  padding-left: 0;
+  margin-bottom: 0;
+  vertical-align: middle;
+}
+
+.form-search .radio input[type="radio"],
+.form-search .checkbox input[type="checkbox"],
+.form-inline .radio input[type="radio"],
+.form-inline .checkbox input[type="checkbox"] {
+  float: left;
+  margin-right: 3px;
+  margin-left: 0;
+}
+
+.control-group {
+  margin-bottom: 9px;
+}
+
+legend + .control-group {
+  margin-top: 18px;
+  -webkit-margin-top-collapse: separate;
+}
+
+.form-horizontal .control-group {
+  margin-bottom: 18px;
+  *zoom: 1;
+}
+
+.form-horizontal .control-group:before,
+.form-horizontal .control-group:after {
+  display: table;
+  content: "";
+}
+
+.form-horizontal .control-group:after {
+  clear: both;
+}
+
+.form-horizontal .control-label {
+  float: left;
+  width: 140px;
+  padding-top: 5px;
+  text-align: right;
+}
+
+.form-horizontal .controls {
+  *display: inline-block;
+  *padding-left: 20px;
+  margin-left: 160px;
+  *margin-left: 0;
+}
+
+.form-horizontal .controls:first-child {
+  *padding-left: 160px;
+}
+
+.form-horizontal .help-block {
+  margin-top: 9px;
+  margin-bottom: 0;
+}
+
+.form-horizontal .form-actions {
+  padding-left: 160px;
+}
+
+table {
+  max-width: 100%;
+  background-color: transparent;
+  border-collapse: collapse;
+  border-spacing: 0;
+}
+
+.table {
+  width: 100%;
+  margin-bottom: 18px;
+}
+
+.table th,
+.table td {
+  padding: 8px;
+  line-height: 18px;
+  text-align: left;
+  vertical-align: top;
+  border-top: 1px solid #dddddd;
+}
+
+.table th {
+  font-weight: bold;
+}
+
+.table thead th {
+  vertical-align: bottom;
+}
+
+.table caption + thead tr:first-child th,
+.table caption + thead tr:first-child td,
+.table colgroup + thead tr:first-child th,
+.table colgroup + thead tr:first-child td,
+.table thead:first-child tr:first-child th,
+.table thead:first-child tr:first-child td {
+  border-top: 0;
+}
+
+.table tbody + tbody {
+  border-top: 2px solid #dddddd;
+}
+
+.table-condensed th,
+.table-condensed td {
+  padding: 4px 5px;
+}
+
+.table-bordered {
+  border: 1px solid #dddddd;
+  border-collapse: separate;
+  *border-collapse: collapsed;
+  border-left: 0;
+  -webkit-border-radius: 4px;
+     -moz-border-radius: 4px;
+          border-radius: 4px;
+}
+
+.table-bordered th,
+.table-bordered td {
+  border-left: 1px solid #dddddd;
+}
+
+.table-bordered caption + thead tr:first-child th,
+.table-bordered caption + tbody tr:first-child th,
+.table-bordered caption + tbody tr:first-child td,
+.table-bordered colgroup + thead tr:first-child th,
+.table-bordered colgroup + tbody tr:first-child th,
+.table-bordered colgroup + tbody tr:first-child td,
+.table-bordered thead:first-child tr:first-child th,
+.table-bordered tbody:first-child tr:first-child th,
+.table-bordered tbody:first-child tr:first-child td {
+  border-top: 0;
+}
+
+.table-bordered thead:first-child tr:first-child th:first-child,
+.table-bordered tbody:first-child tr:first-child td:first-child {
+  -webkit-border-top-left-radius: 4px;
+          border-top-left-radius: 4px;
+  -moz-border-radius-topleft: 4px;
+}
+
+.table-bordered thead:first-child tr:first-child th:last-child,
+.table-bordered tbody:first-child tr:first-child td:last-child {
+  -webkit-border-top-right-radius: 4px;
+          border-top-right-radius: 4px;
+  -moz-border-radius-topright: 4px;
+}
+
+.table-bordered thead:last-child tr:last-child th:first-child,
+.table-bordered tbody:last-child tr:last-child td:first-child {
+  -webkit-border-radius: 0 0 0 4px;
+     -moz-border-radius: 0 0 0 4px;
+          border-radius: 0 0 0 4px;
+  -webkit-border-bottom-left-radius: 4px;
+          border-bottom-left-radius: 4px;
+  -moz-border-radius-bottomleft: 4px;
+}
+
+.table-bordered thead:last-child tr:last-child th:last-child,
+.table-bordered tbody:last-child tr:last-child td:last-child {
+  -webkit-border-bottom-right-radius: 4px;
+          border-bottom-right-radius: 4px;
+  -moz-border-radius-bottomright: 4px;
+}
+
+.table-striped tbody tr:nth-child(odd) td,
+.table-striped tbody tr:nth-child(odd) th {
+  background-color: #f9f9f9;
+}
+
+.table tbody tr:hover td,
+.table tbody tr:hover th {
+  background-color: #f5f5f5;
+}
+
+table .span1 {
+  float: none;
+  width: 44px;
+  margin-left: 0;
+}
+
+table .span2 {
+  float: none;
+  width: 124px;
+  margin-left: 0;
+}
+
+table .span3 {
+  float: none;
+  width: 204px;
+  margin-left: 0;
+}
+
+table .span4 {
+  float: none;
+  width: 284px;
+  margin-left: 0;
+}
+
+table .span5 {
+  float: none;
+  width: 364px;
+  margin-left: 0;
+}
+
+table .span6 {
+  float: none;
+  width: 444px;
+  margin-left: 0;
+}
+
+table .span7 {
+  float: none;
+  width: 524px;
+  margin-left: 0;
+}
+
+table .span8 {
+  float: none;
+  width: 604px;
+  margin-left: 0;
+}
+
+table .span9 {
+  float: none;
+  width: 684px;
+  margin-left: 0;
+}
+
+table .span10 {
+  float: none;
+  width: 764px;
+  margin-left: 0;
+}
+
+table .span11 {
+  float: none;
+  width: 844px;
+  margin-left: 0;
+}
+
+table .span12 {
+  float: none;
+  width: 924px;
+  margin-left: 0;
+}
+
+table .span13 {
+  float: none;
+  width: 1004px;
+  margin-left: 0;
+}
+
+table .span14 {
+  float: none;
+  width: 1084px;
+  margin-left: 0;
+}
+
+table .span15 {
+  float: none;
+  width: 1164px;
+  margin-left: 0;
+}
+
+table .span16 {
+  float: none;
+  width: 1244px;
+  margin-left: 0;
+}
+
+table .span17 {
+  float: none;
+  width: 1324px;
+  margin-left: 0;
+}
+
+table .span18 {
+  float: none;
+  width: 1404px;
+  margin-left: 0;
+}
+
+table .span19 {
+  float: none;
+  width: 1484px;
+  margin-left: 0;
+}
+
+table .span20 {
+  float: none;
+  width: 1564px;
+  margin-left: 0;
+}
+
+table .span21 {
+  float: none;
+  width: 1644px;
+  margin-left: 0;
+}
+
+table .span22 {
+  float: none;
+  width: 1724px;
+  margin-left: 0;
+}
+
+table .span23 {
+  float: none;
+  width: 1804px;
+  margin-left: 0;
+}
+
+table .span24 {
+  float: none;
+  width: 1884px;
+  margin-left: 0;
+}
+
+[class^="icon-"],
+[class*=" icon-"] {
+  display: inline-block;
+  width: 14px;
+  height: 14px;
+  *margin-right: .3em;
+  line-height: 14px;
+  vertical-align: text-top;
+  background-image: url("../img/glyphicons-halflings.png");
+  background-position: 14px 14px;
+  background-repeat: no-repeat;
+}
+
+[class^="icon-"]:last-child,
+[class*=" icon-"]:last-child {
+  *margin-left: 0;
+}
+
+.icon-white {
+  background-image: url("../img/glyphicons-halflings-white.png");
+}
+
+.icon-glass {
+  background-position: 0      0;
+}
+
+.icon-music {
+  background-position: -24px 0;
+}
+
+.icon-search {
+  background-position: -48px 0;
+}
+
+.icon-envelope {
+  background-position: -72px 0;
+}
+
+.icon-heart {
+  background-position: -96px 0;
+}
+
+.icon-star {
+  background-position: -120px 0;
+}
+
+.icon-star-empty {
+  background-position: -144px 0;
+}
+
+.icon-user {
+  background-position: -168px 0;
+}
+
+.icon-film {
+  background-position: -192px 0;
+}
+
+.icon-th-large {
+  background-position: -216px 0;
+}
+
+.icon-th {
+  background-position: -240px 0;
+}
+
+.icon-th-list {
+  background-position: -264px 0;
+}
+
+.icon-ok {
+  background-position: -288px 0;
+}
+
+.icon-remove {
+  background-position: -312px 0;
+}
+
+.icon-zoom-in {
+  background-position: -336px 0;
+}
+
+.icon-zoom-out {
+  background-position: -360px 0;
+}
+
+.icon-off {
+  background-position: -384px 0;
+}
+
+.icon-signal {
+  background-position: -408px 0;
+}
+
+.icon-cog {
+  background-position: -432px 0;
+}
+
+.icon-trash {
+  background-position: -456px 0;
+}
+
+.icon-home {
+  background-position: 0 -24px;
+}
+
+.icon-file {
+  background-position: -24px -24px;
+}
+
+.icon-time {
+  background-position: -48px -24px;
+}
+
+.icon-road {
+  background-position: -72px -24px;
+}
+
+.icon-download-alt {
+  background-position: -96px -24px;
+}
+
+.icon-download {
+  background-position: -120px -24px;
+}
+
+.icon-upload {
+  background-position: -144px -24px;
+}
+
+.icon-inbox {
+  background-position: -168px -24px;
+}
+
+.icon-play-circle {
+  background-position: -192px -24px;
+}
+
+.icon-repeat {
+  background-position: -216px -24px;
+}
+
+.icon-refresh {
+  background-position: -240px -24px;
+}
+
+.icon-list-alt {
+  background-position: -264px -24px;
+}
+
+.icon-lock {
+  background-position: -287px -24px;
+}
+
+.icon-flag {
+  background-position: -312px -24px;
+}
+
+.icon-headphones {
+  background-position: -336px -24px;
+}
+
+.icon-volume-off {
+  background-position: -360px -24px;
+}
+
+.icon-volume-down {
+  background-position: -384px -24px;
+}
+
+.icon-volume-up {
+  background-position: -408px -24px;
+}
+
+.icon-qrcode {
+  background-position: -432px -24px;
+}
+
+.icon-barcode {
+  background-position: -456px -24px;
+}
+
+.icon-tag {
+  background-position: 0 -48px;
+}
+
+.icon-tags {
+  background-position: -25px -48px;
+}
+
+.icon-book {
+  background-position: -48px -48px;
+}
+
+.icon-bookmark {
+  background-position: -72px -48px;
+}
+
+.icon-print {
+  background-position: -96px -48px;
+}
+
+.icon-camera {
+  background-position: -120px -48px;
+}
+
+.icon-font {
+  background-position: -144px -48px;
+}
+
+.icon-bold {
+  background-position: -167px -48px;
+}
+
+.icon-italic {
+  background-position: -192px -48px;
+}
+
+.icon-text-height {
+  background-position: -216px -48px;
+}
+
+.icon-text-width {
+  background-position: -240px -48px;
+}
+
+.icon-align-left {
+  background-position: -264px -48px;
+}
+
+.icon-align-center {
+  background-position: -288px -48px;
+}
+
+.icon-align-right {
+  background-position: -312px -48px;
+}
+
+.icon-align-justify {
+  background-position: -336px -48px;
+}
+
+.icon-list {
+  background-position: -360px -48px;
+}
+
+.icon-indent-left {
+  background-position: -384px -48px;
+}
+
+.icon-indent-right {
+  background-position: -408px -48px;
+}
+
+.icon-facetime-video {
+  background-position: -432px -48px;
+}
+
+.icon-picture {
+  background-position: -456px -48px;
+}
+
+.icon-pencil {
+  background-position: 0 -72px;
+}
+
+.icon-map-marker {
+  background-position: -24px -72px;
+}
+
+.icon-adjust {
+  background-position: -48px -72px;
+}
+
+.icon-tint {
+  background-position: -72px -72px;
+}
+
+.icon-edit {
+  background-position: -96px -72px;
+}
+
+.icon-share {
+  background-position: -120px -72px;
+}
+
+.icon-check {
+  background-position: -144px -72px;
+}
+
+.icon-move {
+  background-position: -168px -72px;
+}
+
+.icon-step-backward {
+  background-position: -192px -72px;
+}
+
+.icon-fast-backward {
+  background-position: -216px -72px;
+}
+
+.icon-backward {
+  background-position: -240px -72px;
+}
+
+.icon-play {
+  background-position: -264px -72px;
+}
+
+.icon-pause {
+  background-position: -288px -72px;
+}
+
+.icon-stop {
+  background-position: -312px -72px;
+}
+
+.icon-forward {
+  background-position: -336px -72px;
+}
+
+.icon-fast-forward {
+  background-position: -360px -72px;
+}
+
+.icon-step-forward {
+  background-position: -384px -72px;
+}
+
+.icon-eject {
+  background-position: -408px -72px;
+}
+
+.icon-chevron-left {
+  background-position: -432px -72px;
+}
+
+.icon-chevron-right {
+  background-position: -456px -72px;
+}
+
+.icon-plus-sign {
+  background-position: 0 -96px;
+}
+
+.icon-minus-sign {
+  background-position: -24px -96px;
+}
+
+.icon-remove-sign {
+  background-position: -48px -96px;
+}
+
+.icon-ok-sign {
+  background-position: -72px -96px;
+}
+
+.icon-question-sign {
+  background-position: -96px -96px;
+}
+
+.icon-info-sign {
+  background-position: -120px -96px;
+}
+
+.icon-screenshot {
+  background-position: -144px -96px;
+}
+
+.icon-remove-circle {
+  background-position: -168px -96px;
+}
+
+.icon-ok-circle {
+  background-position: -192px -96px;
+}
+
+.icon-ban-circle {
+  background-position: -216px -96px;
+}
+
+.icon-arrow-left {
+  background-position: -240px -96px;
+}
+
+.icon-arrow-right {
+  background-position: -264px -96px;
+}
+
+.icon-arrow-up {
+  background-position: -289px -96px;
+}
+
+.icon-arrow-down {
+  background-position: -312px -96px;
+}
+
+.icon-share-alt {
+  background-position: -336px -96px;
+}
+
+.icon-resize-full {
+  background-position: -360px -96px;
+}
+
+.icon-resize-small {
+  background-position: -384px -96px;
+}
+
+.icon-plus {
+  background-position: -408px -96px;
+}
+
+.icon-minus {
+  background-position: -433px -96px;
+}
+
+.icon-asterisk {
+  background-position: -456px -96px;
+}
+
+.icon-exclamation-sign {
+  background-position: 0 -120px;
+}
+
+.icon-gift {
+  background-position: -24px -120px;
+}
+
+.icon-leaf {
+  background-position: -48px -120px;
+}
+
+.icon-fire {
+  background-position: -72px -120px;
+}
+
+.icon-eye-open {
+  background-position: -96px -120px;
+}
+
+.icon-eye-close {
+  background-position: -120px -120px;
+}
+
+.icon-warning-sign {
+  background-position: -144px -120px;
+}
+
+.icon-plane {
+  background-position: -168px -120px;
+}
+
+.icon-calendar {
+  background-position: -192px -120px;
+}
+
+.icon-random {
+  background-position: -216px -120px;
+}
+
+.icon-comment {
+  background-position: -240px -120px;
+}
+
+.icon-magnet {
+  background-position: -264px -120px;
+}
+
+.icon-chevron-up {
+  background-position: -288px -120px;
+}
+
+.icon-chevron-down {
+  background-position: -313px -119px;
+}
+
+.icon-retweet {
+  background-position: -336px -120px;
+}
+
+.icon-shopping-cart {
+  background-position: -360px -120px;
+}
+
+.icon-folder-close {
+  background-position: -384px -120px;
+}
+
+.icon-folder-open {
+  background-position: -408px -120px;
+}
+
+.icon-resize-vertical {
+  background-position: -432px -119px;
+}
+
+.icon-resize-horizontal {
+  background-position: -456px -118px;
+}
+
+.icon-hdd {
+  background-position: 0 -144px;
+}
+
+.icon-bullhorn {
+  background-position: -24px -144px;
+}
+
+.icon-bell {
+  background-position: -48px -144px;
+}
+
+.icon-certificate {
+  background-position: -72px -144px;
+}
+
+.icon-thumbs-up {
+  background-position: -96px -144px;
+}
+
+.icon-thumbs-down {
+  background-position: -120px -144px;
+}
+
+.icon-hand-right {
+  background-position: -144px -144px;
+}
+
+.icon-hand-left {
+  background-position: -168px -144px;
+}
+
+.icon-hand-up {
+  background-position: -192px -144px;
+}
+
+.icon-hand-down {
+  background-position: -216px -144px;
+}
+
+.icon-circle-arrow-right {
+  background-position: -240px -144px;
+}
+
+.icon-circle-arrow-left {
+  background-position: -264px -144px;
+}
+
+.icon-circle-arrow-up {
+  background-position: -288px -144px;
+}
+
+.icon-circle-arrow-down {
+  background-position: -312px -144px;
+}
+
+.icon-globe {
+  background-position: -336px -144px;
+}
+
+.icon-wrench {
+  background-position: -360px -144px;
+}
+
+.icon-tasks {
+  background-position: -384px -144px;
+}
+
+.icon-filter {
+  background-position: -408px -144px;
+}
+
+.icon-briefcase {
+  background-position: -432px -144px;
+}
+
+.icon-fullscreen {
+  background-position: -456px -144px;
+}
+
+.dropup,
+.dropdown {
+  position: relative;
+}
+
+.dropdown-toggle {
+  *margin-bottom: -3px;
+}
+
+.dropdown-toggle:active,
+.open .dropdown-toggle {
+  outline: 0;
+}
+
+.caret {
+  display: inline-block;
+  width: 0;
+  height: 0;
+  vertical-align: top;
+  border-top: 4px solid #000000;
+  border-right: 4px solid transparent;
+  border-left: 4px solid transparent;
+  content: "";
+  opacity: 0.3;
+  filter: alpha(opacity=30);
+}
+
+.dropdown .caret {
+  margin-top: 8px;
+  margin-left: 2px;
+}
+
+.dropdown:hover .caret,
+.open .caret {
+  opacity: 1;
+  filter: alpha(opacity=100);
+}
+
+.dropdown-menu {
+  position: absolute;
+  top: 100%;
+  left: 0;
+  z-index: 1000;
+  display: none;
+  float: left;
+  min-width: 160px;
+  padding: 4px 0;
+  margin: 1px 0 0;
+  list-style: none;
+  background-color: #ffffff;
+  border: 1px solid #ccc;
+  border: 1px solid rgba(0, 0, 0, 0.2);
+  *border-right-width: 2px;
+  *border-bottom-width: 2px;
+  -webkit-border-radius: 5px;
+     -moz-border-radius: 5px;
+          border-radius: 5px;
+  -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
+     -moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
+          box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
+  -webkit-background-clip: padding-box;
+     -moz-background-clip: padding;
+          background-clip: padding-box;
+}
+
+.dropdown-menu.pull-right {
+  right: 0;
+  left: auto;
+}
+
+.dropdown-menu .divider {
+  *width: 100%;
+  height: 1px;
+  margin: 8px 1px;
+  *margin: -5px 0 5px;
+  overflow: hidden;
+  background-color: #e5e5e5;
+  border-bottom: 1px solid #ffffff;
+}
+
+.dropdown-menu a {
+  display: block;
+  padding: 3px 15px;
+  clear: both;
+  font-weight: normal;
+  line-height: 18px;
+  color: #333333;
+  white-space: nowrap;
+}
+
+.dropdown-menu li > a:hover,
+.dropdown-menu .active > a,
+.dropdown-menu .active > a:hover {
+  color: #ffffff;
+  text-decoration: none;
+  background-color: #0088cc;
+}
+
+.open {
+  *z-index: 1000;
+}
+
+.open > .dropdown-menu {
+  display: block;
+}
+
+.pull-right > .dropdown-menu {
+  right: 0;
+  left: auto;
+}
+
+.dropup .caret,
+.navbar-fixed-bottom .dropdown .caret {
+  border-top: 0;
+  border-bottom: 4px solid #000000;
+  content: "\2191";
+}
+
+.dropup .dropdown-menu,
+.navbar-fixed-bottom .dropdown .dropdown-menu {
+  top: auto;
+  bottom: 100%;
+  margin-bottom: 1px;
+}
+
+.typeahead {
+  margin-top: 2px;
+  -webkit-border-radius: 4px;
+     -moz-border-radius: 4px;
+          border-radius: 4px;
+}
+
+.well {
+  min-height: 20px;
+  padding: 19px;
+  margin-bottom: 20px;
+  background-color: #f5f5f5;
+  border: 1px solid #eee;
+  border: 1px solid rgba(0, 0, 0, 0.05);
+  -webkit-border-radius: 4px;
+     -moz-border-radius: 4px;
+          border-radius: 4px;
+  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
+     -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
+          box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
+}
+
+.well blockquote {
+  border-color: #ddd;
+  border-color: rgba(0, 0, 0, 0.15);
+}
+
+.well-large {
+  padding: 24px;
+  -webkit-border-radius: 6px;
+     -moz-border-radius: 6px;
+          border-radius: 6px;
+}
+
+.well-small {
+  padding: 9px;
+  -webkit-border-radius: 3px;
+     -moz-border-radius: 3px;
+          border-radius: 3px;
+}
+
+.fade {
+  opacity: 0;
+  -webkit-transition: opacity 0.15s linear;
+     -moz-transition: opacity 0.15s linear;
+      -ms-transition: opacity 0.15s linear;
+       -o-transition: opacity 0.15s linear;
+          transition: opacity 0.15s linear;
+}
+
+.fade.in {
+  opacity: 1;
+}
+
+.collapse {
+  position: relative;
+  height: 0;
+  overflow: hidden;
+  -webkit-transition: height 0.35s ease;
+     -moz-transition: height 0.35s ease;
+      -ms-transition: height 0.35s ease;
+       -o-transition: height 0.35s ease;
+          transition: height 0.35s ease;
+}
+
+.collapse.in {
+  height: auto;
+}
+
+.close {
+  float: right;
+  font-size: 20px;
+  font-weight: bold;
+  line-height: 18px;
+  color: #000000;
+  text-shadow: 0 1px 0 #ffffff;
+  opacity: 0.2;
+  filter: alpha(opacity=20);
+}
+
+.close:hover {
+  color: #000000;
+  text-decoration: none;
+  cursor: pointer;
+  opacity: 0.4;
+  filter: alpha(opacity=40);
+}
+
+button.close {
+  padding: 0;
+  cursor: pointer;
+  background: transparent;
+  border: 0;
+  -webkit-appearance: none;
+}
+
+.btn {
+  display: inline-block;
+  *display: inline;
+  padding: 4px 10px 4px;
+  margin-bottom: 0;
+  *margin-left: .3em;
+  font-size: 13px;
+  line-height: 18px;
+  *line-height: 20px;
+  color: #333333;
+  text-align: center;
+  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
+  vertical-align: middle;
+  cursor: pointer;
+  background-color: #f5f5f5;
+  *background-color: #e6e6e6;
+  background-image: -ms-linear-gradient(top, #ffffff, #e6e6e6);
+  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));
+  background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);
+  background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
+  background-image: linear-gradient(top, #ffffff, #e6e6e6);
+  background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
+  background-repeat: repeat-x;
+  border: 1px solid #cccccc;
+  *border: 0;
+  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
+  border-color: #e6e6e6 #e6e6e6 #bfbfbf;
+  border-bottom-color: #b3b3b3;
+  -webkit-border-radius: 4px;
+     -moz-border-radius: 4px;
+          border-radius: 4px;
+  filter: progid:dximagetransform.microsoft.gradient(startColorstr='#ffffff', endColorstr='#e6e6e6', GradientType=0);
+  filter: progid:dximagetransform.microsoft.gradient(enabled=false);
+  *zoom: 1;
+  -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
+     -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
+          box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
+}
+
+.btn:hover,
+.btn:active,
+.btn.active,
+.btn.disabled,
+.btn[disabled] {
+  background-color: #e6e6e6;
+  *background-color: #d9d9d9;
+}
+
+.btn:active,
+.btn.active {
+  background-color: #cccccc \9;
+}
+
+.btn:first-child {
+  *margin-left: 0;
+}
+
+.btn:hover {
+  color: #333333;
+  text-decoration: none;
+  background-color: #e6e6e6;
+  *background-color: #d9d9d9;
+  /* Buttons in IE7 don't get borders, so darken on hover */
+
+  background-position: 0 -15px;
+  -webkit-transition: background-position 0.1s linear;
+     -moz-transition: background-position 0.1s linear;
+      -ms-transition: background-position 0.1s linear;
+       -o-transition: background-position 0.1s linear;
+          transition: background-position 0.1s linear;
+}
+
+.btn:focus {
+  outline: thin dotted #333;
+  outline: 5px auto -webkit-focus-ring-color;
+  outline-offset: -2px;
+}
+
+.btn.active,
+.btn:active {
+  background-color: #e6e6e6;
+  background-color: #d9d9d9 \9;
+  background-image: none;
+  outline: 0;
+  -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
+     -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
+          box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
+}
+
+.btn.disabled,
+.btn[disabled] {
+  cursor: default;
+  background-color: #e6e6e6;
+  background-image: none;
+  opacity: 0.65;
+  filter: alpha(opacity=65);
+  -webkit-box-shadow: none;
+     -moz-box-shadow: none;
+          box-shadow: none;
+}
+
+.btn-large {
+  padding: 9px 14px;
+  font-size: 15px;
+  line-height: normal;
+  -webkit-border-radius: 5px;
+     -moz-border-radius: 5px;
+          border-radius: 5px;
+}
+
+.btn-large [class^="icon-"] {
+  margin-top: 1px;
+}
+
+.btn-small {
+  padding: 5px 9px;
+  font-size: 11px;
+  line-height: 16px;
+}
+
+.btn-small [class^="icon-"] {
+  margin-top: -1px;
+}
+
+.btn-mini {
+  padding: 2px 6px;
+  font-size: 11px;
+  line-height: 14px;
+}
+
+.btn-primary,
+.btn-primary:hover,
+.btn-warning,
+.btn-warning:hover,
+.btn-danger,
+.btn-danger:hover,
+.btn-success,
+.btn-success:hover,
+.btn-info,
+.btn-info:hover,
+.btn-inverse,
+.btn-inverse:hover {
+  color: #ffffff;
+  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
+}
+
+.btn-primary.active,
+.btn-warning.active,
+.btn-danger.active,
+.btn-success.active,
+.btn-info.active,
+.btn-inverse.active {
+  color: rgba(255, 255, 255, 0.75);
+}
+
+.btn {
+  border-color: #ccc;
+  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
+}
+
+.btn-primary {
+  background-color: #0074cc;
+  *background-color: #0055cc;
+  background-image: -ms-linear-gradient(top, #0088cc, #0055cc);
+  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0055cc));
+  background-image: -webkit-linear-gradient(top, #0088cc, #0055cc);
+  background-image: -o-linear-gradient(top, #0088cc, #0055cc);
+  background-image: -moz-linear-gradient(top, #0088cc, #0055cc);
+  background-image: linear-gradient(top, #0088cc, #0055cc);
+  background-repeat: repeat-x;
+  border-color: #0055cc #0055cc #003580;
+  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
+  filter: progid:dximagetransform.microsoft.gradient(startColorstr='#0088cc', endColorstr='#0055cc', GradientType=0);
+  filter: progid:dximagetransform.microsoft.gradient(enabled=false);
+}
+
+.btn-primary:hover,
+.btn-primary:active,
+.btn-primary.active,
+.btn-primary.disabled,
+.btn-primary[disabled] {
+  background-color: #0055cc;
+  *background-color: #004ab3;
+}
+
+.btn-primary:active,
+.btn-primary.active {
+  background-color: #004099 \9;
+}
+
+.btn-warning {
+  background-color: #faa732;
+  *background-color: #f89406;
+  background-image: -ms-linear-gradient(top, #fbb450, #f89406);
+  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406));
+  background-image: -webkit-linear-gradient(top, #fbb450, #f89406);
+  background-image: -o-linear-gradient(top, #fbb450, #f89406);
+  background-image: -moz-linear-gradient(top, #fbb450, #f89406);
+  background-image: linear-gradient(top, #fbb450, #f89406);
+  background-repeat: repeat-x;
+  border-color: #f89406 #f89406 #ad6704;
+  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
+  filter: progid:dximagetransform.microsoft.gradient(startColorstr='#fbb450', endColorstr='#f89406', GradientType=0);
+  filter: progid:dximagetransform.microsoft.gradient(enabled=false);
+}
+
+.btn-warning:hover,
+.btn-warning:active,
+.btn-warning.active,
+.btn-warning.disabled,
+.btn-warning[disabled] {
+  background-color: #f89406;
+  *background-color: #df8505;
+}
+
+.btn-warning:active,
+.btn-warning.active {
+  background-color: #c67605 \9;
+}
+
+.btn-danger {
+  background-color: #da4f49;
+  *background-color: #bd362f;
+  background-image: -ms-linear-gradient(top, #ee5f5b, #bd362f);
+  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#bd362f));
+  background-image: -webkit-linear-gradient(top, #ee5f5b, #bd362f);
+  background-image: -o-linear-gradient(top, #ee5f5b, #bd362f);
+  background-image: -moz-linear-gradient(top, #ee5f5b, #bd362f);
+  background-image: linear-gradient(top, #ee5f5b, #bd362f);
+  background-repeat: repeat-x;
+  border-color: #bd362f #bd362f #802420;
+  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
+  filter: progid:dximagetransform.microsoft.gradient(startColorstr='#ee5f5b', endColorstr='#bd362f', GradientType=0);
+  filter: progid:dximagetransform.microsoft.gradient(enabled=false);
+}
+
+.btn-danger:hover,
+.btn-danger:active,
+.btn-danger.active,
+.btn-danger.disabled,
+.btn-danger[disabled] {
+  background-color: #bd362f;
+  *background-color: #a9302a;
+}
+
+.btn-danger:active,
+.btn-danger.active {
+  background-color: #942a25 \9;
+}
+
+.btn-success {
+  background-color: #5bb75b;
+  *background-color: #51a351;
+  background-image: -ms-linear-gradient(top, #62c462, #51a351);
+  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#51a351));
+  background-image: -webkit-linear-gradient(top, #62c462, #51a351);
+  background-image: -o-linear-gradient(top, #62c462, #51a351);
+  background-image: -moz-linear-gradient(top, #62c462, #51a351);
+  background-image: linear-gradient(top, #62c462, #51a351);
+  background-repeat: repeat-x;
+  border-color: #51a351 #51a351 #387038;
+  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
+  filter: progid:dximagetransform.microsoft.gradient(startColorstr='#62c462', endColorstr='#51a351', GradientType=0);
+  filter: progid:dximagetransform.microsoft.gradient(enabled=false);
+}
+
+.btn-success:hover,
+.btn-success:active,
+.btn-success.active,
+.btn-success.disabled,
+.btn-success[disabled] {
+  background-color: #51a351;
+  *background-color: #499249;
+}
+
+.btn-success:active,
+.btn-success.active {
+  background-color: #408140 \9;
+}
+
+.btn-info {
+  background-color: #49afcd;
+  *background-color: #2f96b4;
+  background-image: -ms-linear-gradient(top, #5bc0de, #2f96b4);
+  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#2f96b4));
+  background-image: -webkit-linear-gradient(top, #5bc0de, #2f96b4);
+  background-image: -o-linear-gradient(top, #5bc0de, #2f96b4);
+  background-image: -moz-linear-gradient(top, #5bc0de, #2f96b4);
+  background-image: linear-gradient(top, #5bc0de, #2f96b4);
+  background-repeat: repeat-x;
+  border-color: #2f96b4 #2f96b4 #1f6377;
+  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
+  filter: progid:dximagetransform.microsoft.gradient(startColorstr='#5bc0de', endColorstr='#2f96b4', GradientType=0);
+  filter: progid:dximagetransform.microsoft.gradient(enabled=false);
+}
+
+.btn-info:hover,
+.btn-info:active,
+.btn-info.active,
+.btn-info.disabled,
+.btn-info[disabled] {
+  background-color: #2f96b4;
+  *background-color: #2a85a0;
+}
+
+.btn-info:active,
+.btn-info.active {
+  background-color: #24748c \9;
+}
+
+.btn-inverse {
+  background-color: #414141;
+  *background-color: #222222;
+  background-image: -ms-linear-gradient(top, #555555, #222222);
+  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#555555), to(#222222));
+  background-image: -webkit-linear-gradient(top, #555555, #222222);
+  background-image: -o-linear-gradient(top, #555555, #222222);
+  background-image: -moz-linear-gradient(top, #555555, #222222);
+  background-image: linear-gradient(top, #555555, #222222);
+  background-repeat: repeat-x;
+  border-color: #222222 #222222 #000000;
+  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
+  filter: progid:dximagetransform.microsoft.gradient(startColorstr='#555555', endColorstr='#222222', GradientType=0);
+  filter: progid:dximagetransform.microsoft.gradient(enabled=false);
+}
+
+.btn-inverse:hover,
+.btn-inverse:active,
+.btn-inverse.active,
+.btn-inverse.disabled,
+.btn-inverse[disabled] {
+  background-color: #222222;
+  *background-color: #151515;
+}
+
+.btn-inverse:active,
+.btn-inverse.active {
+  background-color: #080808 \9;
+}
+
+button.btn,
+input[type="submit"].btn {
+  *padding-top: 2px;
+  *padding-bottom: 2px;
+}
+
+button.btn::-moz-focus-inner,
+input[type="submit"].btn::-moz-focus-inner {
+  padding: 0;
+  border: 0;
+}
+
+button.btn.btn-large,
+input[type="submit"].btn.btn-large {
+  *padding-top: 7px;
+  *padding-bottom: 7px;
+}
+
+button.btn.btn-small,
+input[type="submit"].btn.btn-small {
+  *padding-top: 3px;
+  *padding-bottom: 3px;
+}
+
+button.btn.btn-mini,
+input[type="submit"].btn.btn-mini {
+  *padding-top: 1px;
+  *padding-bottom: 1px;
+}
+
+.btn-group {
+  position: relative;
+  *margin-left: .3em;
+  *zoom: 1;
+}
+
+.btn-group:before,
+.btn-group:after {
+  display: table;
+  content: "";
+}
+
+.btn-group:after {
+  clear: both;
+}
+
+.btn-group:first-child {
+  *margin-left: 0;
+}
+
+.btn-group + .btn-group {
+  margin-left: 5px;
+}
+
+.btn-toolbar {
+  margin-top: 9px;
+  margin-bottom: 9px;
+}
+
+.btn-toolbar .btn-group {
+  display: inline-block;
+  *display: inline;
+  /* IE7 inline-block hack */
+
+  *zoom: 1;
+}
+
+.btn-group > .btn {
+  position: relative;
+  float: left;
+  margin-left: -1px;
+  -webkit-border-radius: 0;
+     -moz-border-radius: 0;
+          border-radius: 0;
+}
+
+.btn-group > .btn:first-child {
+  margin-left: 0;
+  -webkit-border-bottom-left-radius: 4px;
+          border-bottom-left-radius: 4px;
+  -webkit-border-top-left-radius: 4px;
+          border-top-left-radius: 4px;
+  -moz-border-radius-bottomleft: 4px;
+  -moz-border-radius-topleft: 4px;
+}
+
+.btn-group > .btn:last-child,
+.btn-group > .dropdown-toggle {
+  -webkit-border-top-right-radius: 4px;
+          border-top-right-radius: 4px;
+  -webkit-border-bottom-right-radius: 4px;
+          border-bottom-right-radius: 4px;
+  -moz-border-radius-topright: 4px;
+  -moz-border-radius-bottomright: 4px;
+}
+
+.btn-group > .btn.large:first-child {
+  margin-left: 0;
+  -webkit-border-bottom-left-radius: 6px;
+          border-bottom-left-radius: 6px;
+  -webkit-border-top-left-radius: 6px;
+          border-top-left-radius: 6px;
+  -moz-border-radius-bottomleft: 6px;
+  -moz-border-radius-topleft: 6px;
+}
+
+.btn-group > .btn.large:last-child,
+.btn-group > .large.dropdown-toggle {
+  -webkit-border-top-right-radius: 6px;
+          border-top-right-radius: 6px;
+  -webkit-border-bottom-right-radius: 6px;
+          border-bottom-right-radius: 6px;
+  -moz-border-radius-topright: 6px;
+  -moz-border-radius-bottomright: 6px;
+}
+
+.btn-group > .btn:hover,
+.btn-group > .btn:focus,
+.btn-group > .btn:active,
+.btn-group > .btn.active {
+  z-index: 2;
+}
+
+.btn-group .dropdown-toggle:active,
+.btn-group.open .dropdown-toggle {
+  outline: 0;
+}
+
+.btn-group > .dropdown-toggle {
+  *padding-top: 4px;
+  padding-right: 8px;
+  *padding-bottom: 4px;
+  padding-left: 8px;
+  -webkit-box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
+     -moz-box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
+          box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
+}
+
+.btn-group > .btn-mini.dropdown-toggle {
+  padding-right: 5px;
+  padding-left: 5px;
+}
+
+.btn-group > .btn-small.dropdown-toggle {
+  *padding-top: 4px;
+  *padding-bottom: 4px;
+}
+
+.btn-group > .btn-large.dropdown-toggle {
+  padding-right: 12px;
+  padding-left: 12px;
+}
+
+.btn-group.open .dropdown-toggle {
+  background-image: none;
+  -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
+     -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
+          box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
+}
+
+.btn-group.open .btn.dropdown-toggle {
+  background-color: #e6e6e6;
+}
+
+.btn-group.open .btn-primary.dropdown-toggle {
+  background-color: #0055cc;
+}
+
+.btn-group.open .btn-warning.dropdown-toggle {
+  background-color: #f89406;
+}
+
+.btn-group.open .btn-danger.dropdown-toggle {
+  background-color: #bd362f;
+}
+
+.btn-group.open .btn-success.dropdown-toggle {
+  background-color: #51a351;
+}
+
+.btn-group.open .btn-info.dropdown-toggle {
+  background-color: #2f96b4;
+}
+
+.btn-group.open .btn-inverse.dropdown-toggle {
+  background-color: #222222;
+}
+
+.btn .caret {
+  margin-top: 7px;
+  margin-left: 0;
+}
+
+.btn:hover .caret,
+.open.btn-group .caret {
+  opacity: 1;
+  filter: alpha(opacity=100);
+}
+
+.btn-mini .caret {
+  margin-top: 5px;
+}
+
+.btn-small .caret {
+  margin-top: 6px;
+}
+
+.btn-large .caret {
+  margin-top: 6px;
+  border-top-width: 5px;
+  border-right-width: 5px;
+  border-left-width: 5px;
+}
+
+.dropup .btn-large .caret {
+  border-top: 0;
+  border-bottom: 5px solid #000000;
+}
+
+.btn-primary .caret,
+.btn-warning .caret,
+.btn-danger .caret,
+.btn-info .caret,
+.btn-success .caret,
+.btn-inverse .caret {
+  border-top-color: #ffffff;
+  border-bottom-color: #ffffff;
+  opacity: 0.75;
+  filter: alpha(opacity=75);
+}
+
+.alert {
+  padding: 8px 35px 8px 14px;
+  margin-bottom: 18px;
+  color: #c09853;
+  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
+  background-color: #fcf8e3;
+  border: 1px solid #fbeed5;
+  -webkit-border-radius: 4px;
+     -moz-border-radius: 4px;
+          border-radius: 4px;
+}
+
+.alert-heading {
+  color: inherit;
+}
+
+.alert .close {
+  position: relative;
+  top: -2px;
+  right: -21px;
+  line-height: 18px;
+}
+
+.alert-success {
+  color: #468847;
+  background-color: #dff0d8;
+  border-color: #d6e9c6;
+}
+
+.alert-danger,
+.alert-error {
+  color: #b94a48;
+  background-color: #f2dede;
+  border-color: #eed3d7;
+}
+
+.alert-info {
+  color: #3a87ad;
+  background-color: #d9edf7;
+  border-color: #bce8f1;
+}
+
+.alert-block {
+  padding-top: 14px;
+  padding-bottom: 14px;
+}
+
+.alert-block > p,
+.alert-block > ul {
+  margin-bottom: 0;
+}
+
+.alert-block p + p {
+  margin-top: 5px;
+}
+
+.nav {
+  margin-bottom: 18px;
+  margin-left: 0;
+  list-style: none;
+}
+
+.nav > li > a {
+  display: block;
+}
+
+.nav > li > a:hover {
+  text-decoration: none;
+  background-color: #eeeeee;
+}
+
+.nav > .pull-right {
+  float: right;
+}
+
+.nav .nav-header {
+  display: block;
+  padding: 3px 15px;
+  font-size: 11px;
+  font-weight: bold;
+  line-height: 18px;
+  color: #999999;
+  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
+  text-transform: uppercase;
+}
+
+.nav li + .nav-header {
+  margin-top: 9px;
+}
+
+.nav-list {
+  padding-right: 15px;
+  padding-left: 15px;
+  margin-bottom: 0;
+}
+
+.nav-list > li > a,
+.nav-list .nav-header {
+  margin-right: -15px;
+  margin-left: -15px;
+  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
+}
+
+.nav-list > li > a {
+  padding: 3px 15px;
+}
+
+.nav-list > .active > a,
+.nav-list > .active > a:hover {
+  color: #ffffff;
+  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2);
+  background-color: #0088cc;
+}
+
+.nav-list [class^="icon-"] {
+  margin-right: 2px;
+}
+
+.nav-list .divider {
+  *width: 100%;
+  height: 1px;
+  margin: 8px 1px;
+  *margin: -5px 0 5px;
+  overflow: hidden;
+  background-color: #e5e5e5;
+  border-bottom: 1px solid #ffffff;
+}
+
+.nav-tabs,
+.nav-pills {
+  *zoom: 1;
+}
+
+.nav-tabs:before,
+.nav-pills:before,
+.nav-tabs:after,
+.nav-pills:after {
+  display: table;
+  content: "";
+}
+
+.nav-tabs:after,
+.nav-pills:after {
+  clear: both;
+}
+
+.nav-tabs > li,
+.nav-pills > li {
+  float: left;
+}
+
+.nav-tabs > li > a,
+.nav-pills > li > a {
+  padding-right: 12px;
+  padding-left: 12px;
+  margin-right: 2px;
+  line-height: 14px;
+}
+
+.nav-tabs {
+  border-bottom: 1px solid #ddd;
+}
+
+.nav-tabs > li {
+  margin-bottom: -1px;
+}
+
+.nav-tabs > li > a {
+  padding-top: 8px;
+  padding-bottom: 8px;
+  line-height: 18px;
+  border: 1px solid transparent;
+  -webkit-border-radius: 4px 4px 0 0;
+     -moz-border-radius: 4px 4px 0 0;
+          border-radius: 4px 4px 0 0;
+}
+
+.nav-tabs > li > a:hover {
+  border-color: #eeeeee #eeeeee #dddddd;
+}
+
+.nav-tabs > .active > a,
+.nav-tabs > .active > a:hover {
+  color: #555555;
+  cursor: default;
+  background-color: #ffffff;
+  border: 1px solid #ddd;
+  border-bottom-color: transparent;
+}
+
+.nav-pills > li > a {
+  padding-top: 8px;
+  padding-bottom: 8px;
+  margin-top: 2px;
+  margin-bottom: 2px;
+  -webkit-border-radius: 5px;
+     -moz-border-radius: 5px;
+          border-radius: 5px;
+}
+
+.nav-pills > .active > a,
+.nav-pills > .active > a:hover {
+  color: #ffffff;
+  background-color: #0088cc;
+}
+
+.nav-stacked > li {
+  float: none;
+}
+
+.nav-stacked > li > a {
+  margin-right: 0;
+}
+
+.nav-tabs.nav-stacked {
+  border-bottom: 0;
+}
+
+.nav-tabs.nav-stacked > li > a {
+  border: 1px solid #ddd;
+  -webkit-border-radius: 0;
+     -moz-border-radius: 0;
+          border-radius: 0;
+}
+
+.nav-tabs.nav-stacked > li:first-child > a {
+  -webkit-border-radius: 4px 4px 0 0;
+     -moz-border-radius: 4px 4px 0 0;
+          border-radius: 4px 4px 0 0;
+}
+
+.nav-tabs.nav-stacked > li:last-child > a {
+  -webkit-border-radius: 0 0 4px 4px;
+     -moz-border-radius: 0 0 4px 4px;
+          border-radius: 0 0 4px 4px;
+}
+
+.nav-tabs.nav-stacked > li > a:hover {
+  z-index: 2;
+  border-color: #ddd;
+}
+
+.nav-pills.nav-stacked > li > a {
+  margin-bottom: 3px;
+}
+
+.nav-pills.nav-stacked > li:last-child > a {
+  margin-bottom: 1px;
+}
+
+.nav-tabs .dropdown-menu {
+  -webkit-border-radius: 0 0 5px 5px;
+     -moz-border-radius: 0 0 5px 5px;
+          border-radius: 0 0 5px 5px;
+}
+
+.nav-pills .dropdown-menu {
+  -webkit-border-radius: 4px;
+     -moz-border-radius: 4px;
+          border-radius: 4px;
+}
+
+.nav-tabs .dropdown-toggle .caret,
+.nav-pills .dropdown-toggle .caret {
+  margin-top: 6px;
+  border-top-color: #0088cc;
+  border-bottom-color: #0088cc;
+}
+
+.nav-tabs .dropdown-toggle:hover .caret,
+.nav-pills .dropdown-toggle:hover .caret {
+  border-top-color: #005580;
+  border-bottom-color: #005580;
+}
+
+.nav-tabs .active .dropdown-toggle .caret,
+.nav-pills .active .dropdown-toggle .caret {
+  border-top-color: #333333;
+  border-bottom-color: #333333;
+}
+
+.nav > .dropdown.active > a:hover {
+  color: #000000;
+  cursor: pointer;
+}
+
+.nav-tabs .open .dropdown-toggle,
+.nav-pills .open .dropdown-toggle,
+.nav > li.dropdown.open.active > a:hover {
+  color: #ffffff;
+  background-color: #999999;
+  border-color: #999999;
+}
+
+.nav li.dropdown.open .caret,
+.nav li.dropdown.open.active .caret,
+.nav li.dropdown.open a:hover .caret {
+  border-top-color: #ffffff;
+  border-bottom-color: #ffffff;
+  opacity: 1;
+  filter: alpha(opacity=100);
+}
+
+.tabs-stacked .open > a:hover {
+  border-color: #999999;
+}
+
+.tabbable {
+  *zoom: 1;
+}
+
+.tabbable:before,
+.tabbable:after {
+  display: table;
+  content: "";
+}
+
+.tabbable:after {
+  clear: both;
+}
+
+.tab-content {
+  overflow: auto;
+}
+
+.tabs-below > .nav-tabs,
+.tabs-right > .nav-tabs,
+.tabs-left > .nav-tabs {
+  border-bottom: 0;
+}
+
+.tab-content > .tab-pane,
+.pill-content > .pill-pane {
+  display: none;
+}
+
+.tab-content > .active,
+.pill-content > .active {
+  display: block;
+}
+
+.tabs-below > .nav-tabs {
+  border-top: 1px solid #ddd;
+}
+
+.tabs-below > .nav-tabs > li {
+  margin-top: -1px;
+  margin-bottom: 0;
+}
+
+.tabs-below > .nav-tabs > li > a {
+  -webkit-border-radius: 0 0 4px 4px;
+     -moz-border-radius: 0 0 4px 4px;
+          border-radius: 0 0 4px 4px;
+}
+
+.tabs-below > .nav-tabs > li > a:hover {
+  border-top-color: #ddd;
+  border-bottom-color: transparent;
+}
+
+.tabs-below > .nav-tabs > .active > a,
+.tabs-below > .nav-tabs > .active > a:hover {
+  border-color: transparent #ddd #ddd #ddd;
+}
+
+.tabs-left > .nav-tabs > li,
+.tabs-right > .nav-tabs > li {
+  float: none;
+}
+
+.tabs-left > .nav-tabs > li > a,
+.tabs-right > .nav-tabs > li > a {
+  min-width: 74px;
+  margin-right: 0;
+  margin-bottom: 3px;
+}
+
+.tabs-left > .nav-tabs {
+  float: left;
+  margin-right: 19px;
+  border-right: 1px solid #ddd;
+}
+
+.tabs-left > .nav-tabs > li > a {
+  margin-right: -1px;
+  -webkit-border-radius: 4px 0 0 4px;
+     -moz-border-radius: 4px 0 0 4px;
+          border-radius: 4px 0 0 4px;
+}
+
+.tabs-left > .nav-tabs > li > a:hover {
+  border-color: #eeeeee #dddddd #eeeeee #eeeeee;
+}
+
+.tabs-left > .nav-tabs .active > a,
+.tabs-left > .nav-tabs .active > a:hover {
+  border-color: #ddd transparent #ddd #ddd;
+  *border-right-color: #ffffff;
+}
+
+.tabs-right > .nav-tabs {
+  float: right;
+  margin-left: 19px;
+  border-left: 1px solid #ddd;
+}
+
+.tabs-right > .nav-tabs > li > a {
+  margin-left: -1px;
+  -webkit-border-radius: 0 4px 4px 0;
+     -moz-border-radius: 0 4px 4px 0;
+          border-radius: 0 4px 4px 0;
+}
+
+.tabs-right > .nav-tabs > li > a:hover {
+  border-color: #eeeeee #eeeeee #eeeeee #dddddd;
+}
+
+.tabs-right > .nav-tabs .active > a,
+.tabs-right > .nav-tabs .active > a:hover {
+  border-color: #ddd #ddd #ddd transparent;
+  *border-left-color: #ffffff;
+}
+
+.navbar {
+  *position: relative;
+  *z-index: 2;
+  margin-bottom: 18px;
+  overflow: visible;
+}
+
+.navbar-inner {
+  min-height: 40px;
+  padding-right: 20px;
+  padding-left: 20px;
+  background-color: #2c2c2c;
+  background-image: -moz-linear-gradient(top, #333333, #222222);
+  background-image: -ms-linear-gradient(top, #333333, #222222);
+  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#333333), to(#222222));
+  background-image: -webkit-linear-gradient(top, #333333, #222222);
+  background-image: -o-linear-gradient(top, #333333, #222222);
+  background-image: linear-gradient(top, #333333, #222222);
+  background-repeat: repeat-x;
+  -webkit-border-radius: 4px;
+     -moz-border-radius: 4px;
+          border-radius: 4px;
+  filter: progid:dximagetransform.microsoft.gradient(startColorstr='#333333', endColorstr='#222222', GradientType=0);
+  -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), inset 0 -1px 0 rgba(0, 0, 0, 0.1);
+     -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), inset 0 -1px 0 rgba(0, 0, 0, 0.1);
+          box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), inset 0 -1px 0 rgba(0, 0, 0, 0.1);
+}
+
+.navbar .container {
+  width: auto;
+}
+
+.nav-collapse.collapse {
+  height: auto;
+}
+
+.navbar {
+  color: #999999;
+}
+
+.navbar .brand:hover {
+  text-decoration: none;
+}
+
+.navbar .brand {
+  display: block;
+  float: left;
+  padding: 8px 20px 12px;
+  margin-left: -20px;
+  font-size: 20px;
+  font-weight: 200;
+  line-height: 1;
+  color: #999999;
+}
+
+.navbar .navbar-text {
+  margin-bottom: 0;
+  line-height: 40px;
+}
+
+.navbar .navbar-link {
+  color: #999999;
+}
+
+.navbar .navbar-link:hover {
+  color: #ffffff;
+}
+
+.navbar .btn,
+.navbar .btn-group {
+  margin-top: 5px;
+}
+
+.navbar .btn-group .btn {
+  margin: 0;
+}
+
+.navbar-form {
+  margin-bottom: 0;
+  *zoom: 1;
+}
+
+.navbar-form:before,
+.navbar-form:after {
+  display: table;
+  content: "";
+}
+
+.navbar-form:after {
+  clear: both;
+}
+
+.navbar-form input,
+.navbar-form select,
+.navbar-form .radio,
+.navbar-form .checkbox {
+  margin-top: 5px;
+}
+
+.navbar-form input,
+.navbar-form select {
+  display: inline-block;
+  margin-bottom: 0;
+}
+
+.navbar-form input[type="image"],
+.navbar-form input[type="checkbox"],
+.navbar-form input[type="radio"] {
+  margin-top: 3px;
+}
+
+.navbar-form .input-append,
+.navbar-form .input-prepend {
+  margin-top: 6px;
+  white-space: nowrap;
+}
+
+.navbar-form .input-append input,
+.navbar-form .input-prepend input {
+  margin-top: 0;
+}
+
+.navbar-search {
+  position: relative;
+  float: left;
+  margin-top: 6px;
+  margin-bottom: 0;
+}
+
+.navbar-search .search-query {
+  padding: 4px 9px;
+  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
+  font-size: 13px;
+  font-weight: normal;
+  line-height: 1;
+  color: #ffffff;
+  background-color: #626262;
+  border: 1px solid #151515;
+  -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0 rgba(255, 255, 255, 0.15);
+     -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0 rgba(255, 255, 255, 0.15);
+          box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0 rgba(255, 255, 255, 0.15);
+  -webkit-transition: none;
+     -moz-transition: none;
+      -ms-transition: none;
+       -o-transition: none;
+          transition: none;
+}
+
+.navbar-search .search-query:-moz-placeholder {
+  color: #cccccc;
+}
+
+.navbar-search .search-query:-ms-input-placeholder {
+  color: #cccccc;
+}
+
+.navbar-search .search-query::-webkit-input-placeholder {
+  color: #cccccc;
+}
+
+.navbar-search .search-query:focus,
+.navbar-search .search-query.focused {
+  padding: 5px 10px;
+  color: #333333;
+  text-shadow: 0 1px 0 #ffffff;
+  background-color: #ffffff;
+  border: 0;
+  outline: 0;
+  -webkit-box-shadow: 0 0 3px rgba(0, 0, 0, 0.15);
+     -moz-box-shadow: 0 0 3px rgba(0, 0, 0, 0.15);
+          box-shadow: 0 0 3px rgba(0, 0, 0, 0.15);
+}
+
+.navbar-fixed-top,
+.navbar-fixed-bottom {
+  position: fixed;
+  right: 0;
+  left: 0;
+  z-index: 1030;
+  margin-bottom: 0;
+}
+
+.navbar-fixed-top .navbar-inner,
+.navbar-fixed-bottom .navbar-inner {
+  padding-right: 0;
+  padding-left: 0;
+  -webkit-border-radius: 0;
+     -moz-border-radius: 0;
+          border-radius: 0;
+}
+
+.navbar-fixed-top .container,
+.navbar-fixed-bottom .container {
+  width: 940px;
+}
+
+.navbar-fixed-top {
+  top: 0;
+}
+
+.navbar-fixed-bottom {
+  bottom: 0;
+}
+
+.navbar .nav {
+  position: relative;
+  left: 0;
+  display: block;
+  float: left;
+  margin: 0 10px 0 0;
+}
+
+.navbar .nav.pull-right {
+  float: right;
+}
+
+.navbar .nav > li {
+  display: block;
+  float: left;
+}
+
+.navbar .nav > li > a {
+  float: none;
+  padding: 9px 10px 11px;
+  line-height: 19px;
+  color: #999999;
+  text-decoration: none;
+  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
+}
+
+.navbar .btn {
+  display: inline-block;
+  padding: 4px 10px 4px;
+  margin: 5px 5px 6px;
+  line-height: 18px;
+}
+
+.navbar .btn-group {
+  padding: 5px 5px 6px;
+  margin: 0;
+}
+
+.navbar .nav > li > a:hover {
+  color: #ffffff;
+  text-decoration: none;
+  background-color: transparent;
+}
+
+.navbar .nav .active > a,
+.navbar .nav .active > a:hover {
+  color: #ffffff;
+  text-decoration: none;
+  background-color: #222222;
+}
+
+.navbar .divider-vertical {
+  width: 1px;
+  height: 40px;
+  margin: 0 9px;
+  overflow: hidden;
+  background-color: #222222;
+  border-right: 1px solid #333333;
+}
+
+.navbar .nav.pull-right {
+  margin-right: 0;
+  margin-left: 10px;
+}
+
+.navbar .btn-navbar {
+  display: none;
+  float: right;
+  padding: 7px 10px;
+  margin-right: 5px;
+  margin-left: 5px;
+  background-color: #2c2c2c;
+  *background-color: #222222;
+  background-image: -ms-linear-gradient(top, #333333, #222222);
+  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#333333), to(#222222));
+  background-image: -webkit-linear-gradient(top, #333333, #222222);
+  background-image: -o-linear-gradient(top, #333333, #222222);
+  background-image: linear-gradient(top, #333333, #222222);
+  background-image: -moz-linear-gradient(top, #333333, #222222);
+  background-repeat: repeat-x;
+  border-color: #222222 #222222 #000000;
+  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
+  filter: progid:dximagetransform.microsoft.gradient(startColorstr='#333333', endColorstr='#222222', GradientType=0);
+  filter: progid:dximagetransform.microsoft.gradient(enabled=false);
+  -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075);
+     -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075);
+          box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075);
+}
+
+.navbar .btn-navbar:hover,
+.navbar .btn-navbar:active,
+.navbar .btn-navbar.active,
+.navbar .btn-navbar.disabled,
+.navbar .btn-navbar[disabled] {
+  background-color: #222222;
+  *background-color: #151515;
+}
+
+.navbar .btn-navbar:active,
+.navbar .btn-navbar.active {
+  background-color: #080808 \9;
+}
+
+.navbar .btn-navbar .icon-bar {
+  display: block;
+  width: 18px;
+  height: 2px;
+  background-color: #f5f5f5;
+  -webkit-border-radius: 1px;
+     -moz-border-radius: 1px;
+          border-radius: 1px;
+  -webkit-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
+     -moz-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
+          box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
+}
+
+.btn-navbar .icon-bar + .icon-bar {
+  margin-top: 3px;
+}
+
+.navbar .dropdown-menu:before {
+  position: absolute;
+  top: -7px;
+  left: 9px;
+  display: inline-block;
+  border-right: 7px solid transparent;
+  border-bottom: 7px solid #ccc;
+  border-left: 7px solid transparent;
+  border-bottom-color: rgba(0, 0, 0, 0.2);
+  content: '';
+}
+
+.navbar .dropdown-menu:after {
+  position: absolute;
+  top: -6px;
+  left: 10px;
+  display: inline-block;
+  border-right: 6px solid transparent;
+  border-bottom: 6px solid #ffffff;
+  border-left: 6px solid transparent;
+  content: '';
+}
+
+.navbar-fixed-bottom .dropdown-menu:before {
+  top: auto;
+  bottom: -7px;
+  border-top: 7px solid #ccc;
+  border-bottom: 0;
+  border-top-color: rgba(0, 0, 0, 0.2);
+}
+
+.navbar-fixed-bottom .dropdown-menu:after {
+  top: auto;
+  bottom: -6px;
+  border-top: 6px solid #ffffff;
+  border-bottom: 0;
+}
+
+.navbar .nav li.dropdown .dropdown-toggle .caret,
+.navbar .nav li.dropdown.open .caret {
+  border-top-color: #ffffff;
+  border-bottom-color: #ffffff;
+}
+
+.navbar .nav li.dropdown.active .caret {
+  opacity: 1;
+  filter: alpha(opacity=100);
+}
+
+.navbar .nav li.dropdown.open > .dropdown-toggle,
+.navbar .nav li.dropdown.active > .dropdown-toggle,
+.navbar .nav li.dropdown.open.active > .dropdown-toggle {
+  background-color: transparent;
+}
+
+.navbar .nav li.dropdown.active > .dropdown-toggle:hover {
+  color: #ffffff;
+}
+
+.navbar .pull-right .dropdown-menu,
+.navbar .dropdown-menu.pull-right {
+  right: 0;
+  left: auto;
+}
+
+.navbar .pull-right .dropdown-menu:before,
+.navbar .dropdown-menu.pull-right:before {
+  right: 12px;
+  left: auto;
+}
+
+.navbar .pull-right .dropdown-menu:after,
+.navbar .dropdown-menu.pull-right:after {
+  right: 13px;
+  left: auto;
+}
+
+.breadcrumb {
+  padding: 7px 14px;
+  margin: 0 0 18px;
+  list-style: none;
+  background-color: #fbfbfb;
+  background-image: -moz-linear-gradient(top, #ffffff, #f5f5f5);
+  background-image: -ms-linear-gradient(top, #ffffff, #f5f5f5);
+  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#f5f5f5));
+  background-image: -webkit-linear-gradient(top, #ffffff, #f5f5f5);
+  background-image: -o-linear-gradient(top, #ffffff, #f5f5f5);
+  background-image: linear-gradient(top, #ffffff, #f5f5f5);
+  background-repeat: repeat-x;
+  border: 1px solid #ddd;
+  -webkit-border-radius: 3px;
+     -moz-border-radius: 3px;
+          border-radius: 3px;
+  filter: progid:dximagetransform.microsoft.gradient(startColorstr='#ffffff', endColorstr='#f5f5f5', GradientType=0);
+  -webkit-box-shadow: inset 0 1px 0 #ffffff;
+     -moz-box-shadow: inset 0 1px 0 #ffffff;
+          box-shadow: inset 0 1px 0 #ffffff;
+}
+
+.breadcrumb li {
+  display: inline-block;
+  *display: inline;
+  text-shadow: 0 1px 0 #ffffff;
+  *zoom: 1;
+}
+
+.breadcrumb .divider {
+  padding: 0 5px;
+  color: #999999;
+}
+
+.breadcrumb .active a {
+  color: #333333;
+}
+
+.pagination {
+  height: 36px;
+  margin: 18px 0;
+}
+
+.pagination ul {
+  display: inline-block;
+  *display: inline;
+  margin-bottom: 0;
+  margin-left: 0;
+  -webkit-border-radius: 3px;
+     -moz-border-radius: 3px;
+          border-radius: 3px;
+  *zoom: 1;
+  -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
+     -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
+          box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
+}
+
+.pagination li {
+  display: inline;
+}
+
+.pagination a {
+  float: left;
+  padding: 0 14px;
+  line-height: 34px;
+  text-decoration: none;
+  border: 1px solid #ddd;
+  border-left-width: 0;
+}
+
+.pagination a:hover,
+.pagination .active a {
+  background-color: #f5f5f5;
+}
+
+.pagination .active a {
+  color: #999999;
+  cursor: default;
+}
+
+.pagination .disabled span,
+.pagination .disabled a,
+.pagination .disabled a:hover {
+  color: #999999;
+  cursor: default;
+  background-color: transparent;
+}
+
+.pagination li:first-child a {
+  border-left-width: 1px;
+  -webkit-border-radius: 3px 0 0 3px;
+     -moz-border-radius: 3px 0 0 3px;
+          border-radius: 3px 0 0 3px;
+}
+
+.pagination li:last-child a {
+  -webkit-border-radius: 0 3px 3px 0;
+     -moz-border-radius: 0 3px 3px 0;
+          border-radius: 0 3px 3px 0;
+}
+
+.pagination-centered {
+  text-align: center;
+}
+
+.pagination-right {
+  text-align: right;
+}
+
+.pager {
+  margin-bottom: 18px;
+  margin-left: 0;
+  text-align: center;
+  list-style: none;
+  *zoom: 1;
+}
+
+.pager:before,
+.pager:after {
+  display: table;
+  content: "";
+}
+
+.pager:after {
+  clear: both;
+}
+
+.pager li {
+  display: inline;
+}
+
+.pager a {
+  display: inline-block;
+  padding: 5px 14px;
+  background-color: #fff;
+  border: 1px solid #ddd;
+  -webkit-border-radius: 15px;
+     -moz-border-radius: 15px;
+          border-radius: 15px;
+}
+
+.pager a:hover {
+  text-decoration: none;
+  background-color: #f5f5f5;
+}
+
+.pager .next a {
+  float: right;
+}
+
+.pager .previous a {
+  float: left;
+}
+
+.pager .disabled a,
+.pager .disabled a:hover {
+  color: #999999;
+  cursor: default;
+  background-color: #fff;
+}
+
+.modal-open .dropdown-menu {
+  z-index: 2050;
+}
+
+.modal-open .dropdown.open {
+  *z-index: 2050;
+}
+
+.modal-open .popover {
+  z-index: 2060;
+}
+
+.modal-open .tooltip {
+  z-index: 2070;
+}
+
+.modal-backdrop {
+  position: fixed;
+  top: 0;
+  right: 0;
+  bottom: 0;
+  left: 0;
+  z-index: 1040;
+  background-color: #000000;
+}
+
+.modal-backdrop.fade {
+  opacity: 0;
+}
+
+.modal-backdrop,
+.modal-backdrop.fade.in {
+  opacity: 0.8;
+  filter: alpha(opacity=80);
+}
+
+.modal {
+  position: fixed;
+  top: 50%;
+  left: 50%;
+  z-index: 1050;
+  width: 560px;
+  margin: -250px 0 0 -280px;
+  overflow: auto;
+  background-color: #ffffff;
+  border: 1px solid #999;
+  border: 1px solid rgba(0, 0, 0, 0.3);
+  *border: 1px solid #999;
+  -webkit-border-radius: 6px;
+     -moz-border-radius: 6px;
+          border-radius: 6px;
+  -webkit-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);
+     -moz-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);
+          box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);
+  -webkit-background-clip: padding-box;
+     -moz-background-clip: padding-box;
+          background-clip: padding-box;
+}
+
+.modal.fade {
+  top: -25%;
+  -webkit-transition: opacity 0.3s linear, top 0.3s ease-out;
+     -moz-transition: opacity 0.3s linear, top 0.3s ease-out;
+      -ms-transition: opacity 0.3s linear, top 0.3s ease-out;
+       -o-transition: opacity 0.3s linear, top 0.3s ease-out;
+          transition: opacity 0.3s linear, top 0.3s ease-out;
+}
+
+.modal.fade.in {
+  top: 50%;
+}
+
+.modal-header {
+  padding: 9px 15px;
+  border-bottom: 1px solid #eee;
+}
+
+.modal-header .close {
+  margin-top: 2px;
+}
+
+.modal-body {
+  max-height: 400px;
+  padding: 15px;
+  overflow-y: auto;
+}
+
+.modal-form {
+  margin-bottom: 0;
+}
+
+.modal-footer {
+  padding: 14px 15px 15px;
+  margin-bottom: 0;
+  text-align: right;
+  background-color: #f5f5f5;
+  border-top: 1px solid #ddd;
+  -webkit-border-radius: 0 0 6px 6px;
+     -moz-border-radius: 0 0 6px 6px;
+          border-radius: 0 0 6px 6px;
+  *zoom: 1;
+  -webkit-box-shadow: inset 0 1px 0 #ffffff;
+     -moz-box-shadow: inset 0 1px 0 #ffffff;
+          box-shadow: inset 0 1px 0 #ffffff;
+}
+
+.modal-footer:before,
+.modal-footer:after {
+  display: table;
+  content: "";
+}
+
+.modal-footer:after {
+  clear: both;
+}
+
+.modal-footer .btn + .btn {
+  margin-bottom: 0;
+  margin-left: 5px;
+}
+
+.modal-footer .btn-group .btn + .btn {
+  margin-left: -1px;
+}
+
+.tooltip {
+  position: absolute;
+  z-index: 1020;
+  display: block;
+  padding: 5px;
+  font-size: 11px;
+  opacity: 0;
+  filter: alpha(opacity=0);
+  visibility: visible;
+}
+
+.tooltip.in {
+  opacity: 0.8;
+  filter: alpha(opacity=80);
+}
+
+.tooltip.top {
+  margin-top: -2px;
+}
+
+.tooltip.right {
+  margin-left: 2px;
+}
+
+.tooltip.bottom {
+  margin-top: 2px;
+}
+
+.tooltip.left {
+  margin-left: -2px;
+}
+
+.tooltip.top .tooltip-arrow {
+  bottom: 0;
+  left: 50%;
+  margin-left: -5px;
+  border-top: 5px solid #000000;
+  border-right: 5px solid transparent;
+  border-left: 5px solid transparent;
+}
+
+.tooltip.left .tooltip-arrow {
+  top: 50%;
+  right: 0;
+  margin-top: -5px;
+  border-top: 5px solid transparent;
+  border-bottom: 5px solid transparent;
+  border-left: 5px solid #000000;
+}
+
+.tooltip.bottom .tooltip-arrow {
+  top: 0;
+  left: 50%;
+  margin-left: -5px;
+  border-right: 5px solid transparent;
+  border-bottom: 5px solid #000000;
+  border-left: 5px solid transparent;
+}
+
+.tooltip.right .tooltip-arrow {
+  top: 50%;
+  left: 0;
+  margin-top: -5px;
+  border-top: 5px solid transparent;
+  border-right: 5px solid #000000;
+  border-bottom: 5px solid transparent;
+}
+
+.tooltip-inner {
+  max-width: 200px;
+  padding: 3px 8px;
+  color: #ffffff;
+  text-align: center;
+  text-decoration: none;
+  background-color: #000000;
+  -webkit-border-radius: 4px;
+     -moz-border-radius: 4px;
+          border-radius: 4px;
+}
+
+.tooltip-arrow {
+  position: absolute;
+  width: 0;
+  height: 0;
+}
+
+.popover {
+  position: absolute;
+  top: 0;
+  left: 0;
+  z-index: 1010;
+  display: none;
+  padding: 5px;
+}
+
+.popover.top {
+  margin-top: -5px;
+}
+
+.popover.right {
+  margin-left: 5px;
+}
+
+.popover.bottom {
+  margin-top: 5px;
+}
+
+.popover.left {
+  margin-left: -5px;
+}
+
+.popover.top .arrow {
+  bottom: 0;
+  left: 50%;
+  margin-left: -5px;
+  border-top: 5px solid #000000;
+  border-right: 5px solid transparent;
+  border-left: 5px solid transparent;
+}
+
+.popover.right .arrow {
+  top: 50%;
+  left: 0;
+  margin-top: -5px;
+  border-top: 5px solid transparent;
+  border-right: 5px solid #000000;
+  border-bottom: 5px solid transparent;
+}
+
+.popover.bottom .arrow {
+  top: 0;
+  left: 50%;
+  margin-left: -5px;
+  border-right: 5px solid transparent;
+  border-bottom: 5px solid #000000;
+  border-left: 5px solid transparent;
+}
+
+.popover.left .arrow {
+  top: 50%;
+  right: 0;
+  margin-top: -5px;
+  border-top: 5px solid transparent;
+  border-bottom: 5px solid transparent;
+  border-left: 5px solid #000000;
+}
+
+.popover .arrow {
+  position: absolute;
+  width: 0;
+  height: 0;
+}
+
+.popover-inner {
+  width: 280px;
+  padding: 3px;
+  overflow: hidden;
+  background: #000000;
+  background: rgba(0, 0, 0, 0.8);
+  -webkit-border-radius: 6px;
+     -moz-border-radius: 6px;
+          border-radius: 6px;
+  -webkit-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);
+     -moz-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);
+          box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);
+}
+
+.popover-title {
+  padding: 9px 15px;
+  line-height: 1;
+  background-color: #f5f5f5;
+  border-bottom: 1px solid #eee;
+  -webkit-border-radius: 3px 3px 0 0;
+     -moz-border-radius: 3px 3px 0 0;
+          border-radius: 3px 3px 0 0;
+}
+
+.popover-content {
+  padding: 14px;
+  background-color: #ffffff;
+  -webkit-border-radius: 0 0 3px 3px;
+     -moz-border-radius: 0 0 3px 3px;
+          border-radius: 0 0 3px 3px;
+  -webkit-background-clip: padding-box;
+     -moz-background-clip: padding-box;
+          background-clip: padding-box;
+}
+
+.popover-content p,
+.popover-content ul,
+.popover-content ol {
+  margin-bottom: 0;
+}
+
+.thumbnails {
+  margin-left: -20px;
+  list-style: none;
+  *zoom: 1;
+}
+
+.thumbnails:before,
+.thumbnails:after {
+  display: table;
+  content: "";
+}
+
+.thumbnails:after {
+  clear: both;
+}
+
+.row-fluid .thumbnails {
+  margin-left: 0;
+}
+
+.thumbnails > li {
+  float: left;
+  margin-bottom: 18px;
+  margin-left: 20px;
+}
+
+.thumbnail {
+  display: block;
+  padding: 4px;
+  line-height: 1;
+  border: 1px solid #ddd;
+  -webkit-border-radius: 4px;
+     -moz-border-radius: 4px;
+          border-radius: 4px;
+  -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075);
+     -moz-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075);
+          box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075);
+}
+
+a.thumbnail:hover {
+  border-color: #0088cc;
+  -webkit-box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25);
+     -moz-box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25);
+          box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25);
+}
+
+.thumbnail > img {
+  display: block;
+  max-width: 100%;
+  margin-right: auto;
+  margin-left: auto;
+}
+
+.thumbnail .caption {
+  padding: 9px;
+}
+
+.label,
+.badge {
+  font-size: 10.998px;
+  font-weight: bold;
+  line-height: 14px;
+  color: #ffffff;
+  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
+  white-space: nowrap;
+  vertical-align: baseline;
+  background-color: #999999;
+}
+
+.label {
+  padding: 1px 4px 2px;
+  -webkit-border-radius: 3px;
+     -moz-border-radius: 3px;
+          border-radius: 3px;
+}
+
+.badge {
+  padding: 1px 9px 2px;
+  -webkit-border-radius: 9px;
+     -moz-border-radius: 9px;
+          border-radius: 9px;
+}
+
+a.label:hover,
+a.badge:hover {
+  color: #ffffff;
+  text-decoration: none;
+  cursor: pointer;
+}
+
+.label-important,
+.badge

<TRUNCATED>

[35/51] [abbrv] [partial] brooklyn-ui git commit: move subdir from incubator up a level as it is promoted to its own repo (first non-incubator commit!)

Posted by he...@apache.org.
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/js/router.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/js/router.js b/brooklyn-ui/src/main/webapp/assets/js/router.js
deleted file mode 100644
index d80d35c..0000000
--- a/brooklyn-ui/src/main/webapp/assets/js/router.js
+++ /dev/null
@@ -1,240 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-define([
-    "brooklyn", "underscore", "jquery", "backbone",
-    "model/application", "model/app-tree", "model/location", 
-    "model/server-extended-status",
-    "view/home", "view/application-explorer", "view/catalog", "view/script-groovy",
-    "text!tpl/help/page.html","text!tpl/labs/page.html", "text!tpl/home/server-caution.html"
-], function (Brooklyn, _, $, Backbone,
-        Application, AppTree, Location, 
-        serverStatus,
-        HomeView, ExplorerView, CatalogView, ScriptGroovyView,
-        HelpHtml, LabsHtml, ServerCautionHtml) {
-
-    var ServerCautionOverlay = Backbone.View.extend({
-        template: _.template(ServerCautionHtml),
-        scheduledRedirect: false,
-        initialize: function() {
-            var that = this;
-            this.carryOnRegardless = false;
-            _.bindAll(this);
-            serverStatus.addCallback(this.renderAndAddCallback);
-        },
-        renderAndAddCallback: function() {
-            this.renderOnUpdate();
-            serverStatus.addCallback(this.renderAndAddCallback);
-        },
-        renderOnUpdate: function() {
-            var that = this;
-            if (this.carryOnRegardless) return this.renderEmpty();
-            
-            var state = {
-                    loaded: serverStatus.loaded,
-                    up: serverStatus.isUp(),
-                    shuttingDown: serverStatus.isShuttingDown(),
-                    healthy: serverStatus.isHealthy(),
-                    master: serverStatus.isMaster(),
-                    masterUri: serverStatus.getMasterUri(),
-                };
-            
-            if (state.loaded && state.up && state.healthy && state.master) {
-                // this div shows nothing in normal operation
-                return this.renderEmpty();
-            }
-            
-            this.warningActive = true;
-            this.$el.html(this.template(state));
-            $('#application-content').fadeTo(500,0.1);
-            this.$el.fadeTo(200,1);
-            
-            $("#dismiss-standby-warning", this.$el).click(function() {
-                that.carryOnRegardless = true;
-                if (that.redirectPending) {
-                    log("Cancelling redirect, using this non-master instance");
-                    clearTimeout(that.redirectPending);
-                    that.redirectPending = null;
-                }       
-                that.renderOnUpdate();
-            });
-            
-            if (!state.master && state.masterUri) {
-                if (!this.scheduledRedirect && !this.redirectPending) {
-                    log("Not master; will redirect shortly to: "+state.masterUri);
-                    var destination = state.masterUri + "#" + Backbone.history.fragment;
-                    var time = 10;
-                    this.scheduledRedirect = true;
-                    log("Redirecting to " + destination + " in " + time + " seconds");
-                    this.redirectPending = setTimeout(function () {
-                        // re-check, in case the server's status changed in the wait
-                        if (!serverStatus.isMaster()) {
-                            if (that.redirectPending) {
-                                window.location.href = destination;
-                            } else {
-                                log("Cancelled redirect, using this non-master instance");
-                            }
-                        } else {
-                            log("Cancelled redirect, this instance is now master");
-                        }
-                    }, time * 1000);
-                }
-            }
-            return this;
-        },
-        renderEmpty: function() {
-            var that = this;
-            this.warningActive = false;
-            this.$el.fadeTo(200,0.2, function() {
-                if (!that.warningActive)
-                    that.$el.empty();
-            });
-            $('#application-content').fadeTo(200,1);
-            return this;
-        },
-        beforeClose: function() {
-            this.stopListening();
-        },
-        warnIfNotLoaded: function() {
-            if (!this.loaded)
-                this.renderOnUpdate();
-        }
-    });
-    // look for ha-standby-overlay for compatibility with older index.html copies
-    var serverCautionOverlay = new ServerCautionOverlay({ el: $("#server-caution-overlay").length ? $("#server-caution-overlay") : $("#ha-standby-overlay")});
-    serverCautionOverlay.render();
-    
-    var Router = Backbone.Router.extend({
-        routes:{
-            'v1/home/*trail':'homePage',
-            'v1/applications/:app/entities/*trail':'applicationsPage',
-            'v1/applications/*trail':'applicationsPage',
-            'v1/applications':'applicationsPage',
-            'v1/locations':'catalogPage',
-            'v1/catalog/:kind(/:id)':'catalogPage',
-            'v1/catalog':'catalogPage',
-            'v1/script/groovy':'scriptGroovyPage',
-            'v1/help':'helpPage',
-            'labs':'labsPage',
-            '*path':'defaultRoute'
-        },
-
-        showView: function(selector, view) {
-            // close the previous view - does binding clean-up and avoids memory leaks
-            if (this.currentView) {
-                this.currentView.close();
-            }
-            // render the view inside the selector element
-            $(selector).html(view.render().el);
-            this.currentView = view;
-            return view;
-        },
-
-        defaultRoute: function() {
-            this.homePage('auto')
-        },
-
-        applications: new Application.Collection,
-        appTree: new AppTree.Collection,
-        locations: new Location.Collection,
-
-        homePage:function (trail) {
-            var that = this;
-            var veryFirstViewLoad, homeView;
-            // render the page after we fetch the collection -- no rendering on error
-            function render() {
-                homeView = new HomeView({
-                    collection:that.applications,
-                    locations:that.locations,
-                    cautionOverlay:serverCautionOverlay,
-                    appRouter:that
-                });
-                veryFirstViewLoad = !that.currentView;
-                that.showView("#application-content", homeView);
-            }
-            this.applications.fetch({success:function () {
-                render();
-                // show add application wizard if none already exist and this is the first page load
-                if ((veryFirstViewLoad && trail=='auto' && that.applications.isEmpty()) || (trail=='add_application') ) {
-                    if (serverStatus.isMaster()) {
-                        homeView.createApplication();
-                    }
-                }
-            }, error: render});
-        },
-        applicationsPage:function (app, trail, tab) {
-            if (trail === undefined) trail = app
-            var that = this
-            this.appTree.fetch({success:function () {
-                var appExplorer = new ExplorerView({
-                    collection:that.appTree,
-                    appRouter:that
-                })
-                that.showView("#application-content", appExplorer)
-                if (trail !== undefined) appExplorer.show(trail)
-            }})
-        },
-        catalogPage: function (catalogItemKind, id) {
-            var catalogResource = new CatalogView({
-                locations: this.locations,
-                appRouter: this,
-                kind: catalogItemKind,
-                id: id
-            });
-            this.showView("#application-content", catalogResource);
-        },
-        scriptGroovyPage:function () {
-            if (this.scriptGroovyResource === undefined)
-                this.scriptGroovyResource = new ScriptGroovyView({})
-            this.showView("#application-content", this.scriptGroovyResource)
-            $(".nav1").removeClass("active")
-            $(".nav1_script").addClass("active")
-            $(".nav1_script_groovy").addClass("active")
-        },
-        helpPage:function () {
-            $("#application-content").html(_.template(HelpHtml, {}))
-            $(".nav1").removeClass("active")
-            $(".nav1_help").addClass("active")
-        },
-        labsPage:function () {
-            $("#application-content").html(_.template(LabsHtml, {}))
-            $(".nav1").removeClass("active")
-        },
-
-        /** Triggers the Backbone.Router process which drives this GUI through Backbone.history,
-         *  after starting background server health checks and waiting for confirmation of health
-         *  (or user click-through). */
-        startBrooklynGui: function() {
-            serverStatus.whenUp(function() { Backbone.history.start(); });
-            serverStatus.autoUpdate();
-            _.delay(serverCautionOverlay.warnIfNotLoaded, 2*1000)
-        }
-    });
-
-    $.ajax({
-        type: "GET",
-        url: "/v1/server/user",
-        dataType: "text"
-    }).done(function (data) {
-        if (data != null) {
-            $("#user").html(_.escape(data));
-        }
-    });
-
-    return Router
-})

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/js/util/brooklyn-utils.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/js/util/brooklyn-utils.js b/brooklyn-ui/src/main/webapp/assets/js/util/brooklyn-utils.js
deleted file mode 100644
index 5f3915c..0000000
--- a/brooklyn-ui/src/main/webapp/assets/js/util/brooklyn-utils.js
+++ /dev/null
@@ -1,226 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/* brooklyn utility methods */
-
-define([
-    'jquery', 'underscore'
-], function ($, _) {
-
-    var Util = {};
-
-    /**
-     * @return {string} empty string if s is null or undefined, otherwise result of _.escape(s)
-     */
-    Util.escape = function (s) {
-        if (s == undefined || s == null) return "";
-        return _.escape(s);
-    };
-
-    function isWholeNumber(v) {
-        return (Math.abs(Math.round(v) - v) < 0.000000000001);
-    }
-
-    Util.roundIfNumberToNumDecimalPlaces = function (v, mantissa) {
-        if (!_.isNumber(v) || mantissa < 0)
-            return v;
-
-        if (isWholeNumber(v))
-            return Math.round(v);
-
-        var vk = v, xp = 1;
-        for (var i=0; i < mantissa; i++) {
-            vk *= 10;
-            xp *= 10;
-            if (isWholeNumber(vk)) {
-                return Math.round(vk)/xp;
-            }
-        }
-        return Number(v.toFixed(mantissa));
-    };
-
-    Util.toDisplayString = function(data) {
-        if (data==null) return null;
-        data = Util.roundIfNumberToNumDecimalPlaces(data, 4);
-        if (typeof data !== 'string')
-            data = JSON.stringify(data);
-        return Util.escape(data);
-    };
-
-    Util.toTextAreaString = function(data) {
-        if (data==null) return null;
-        data = Util.roundIfNumberToNumDecimalPlaces(data, 8);
-        if (typeof data !== 'string')
-            data = JSON.stringify(data, null, 2);
-        return data;
-    };
-
-    if (!String.prototype.trim) {
-        // some older javascripts do not support 'trim' (including jasmine spec runner) so let's define it
-        String.prototype.trim = function(){
-            return this.replace(/^\s+|\s+$/g, '');
-        };
-    }
-
-    // from http://stackoverflow.com/questions/646628/how-to-check-if-a-string-startswith-another-string
-    if (typeof String.prototype.startsWith != 'function') {
-        String.prototype.startsWith = function (str){
-            return this.slice(0, str.length) == str;
-        };
-    }
-    if (typeof String.prototype.endsWith != 'function') {
-        String.prototype.endsWith = function (str){
-            return this.slice(-str.length) == str;
-        };
-    }
-    
-    // poor-man's copy
-    Util.promptCopyToClipboard = function(text) {
-        window.prompt("To copy to the clipboard, press Ctrl+C then Enter.", text);
-    };
-
-    /**
-     * Returns the path component of a string URL. e.g. http://example.com/bob/bob --> /bob/bob
-     */
-    Util.pathOf = function(string) {
-        if (!string) return "";
-        var a = document.createElement("a");
-        a.href = string;
-        return a.pathname;
-    };
-
-    /**
-     * Extracts the value of the given input. Returns true/false for for checkboxes
-     * rather than "on" or "off".
-     */
-    Util.inputValue = function($input) {
-        if ($input.attr("type") === "checkbox") {
-            return $input.is(":checked");
-        } else {
-            return $input.val();
-        }
-    };
-
-    /**
-     * Updates or initialises the given model with the values of named elements under
-     * the given element. Force-updates the model by setting silent: true.
-     */
-    Util.bindModelFromForm = function(modelOrConstructor, $el) {
-        var model = _.isFunction(modelOrConstructor) ? new modelOrConstructor() : modelOrConstructor;
-        var inputs = {};
-
-        // Look up all named elements
-        $("[name]", $el).each(function(idx, inp) {
-            var input = $(inp);
-            var name = input.attr("name");
-            inputs[name] = Util.inputValue(input);
-        });
-        model.set(inputs, { silent: true });
-        return model;
-    };
-
-    /**
-     * Parses xhrResponse.responseText as JSON and returns its message. Returns
-     * alternate message if parsing fails or the parsed object has no message.
-     * @param {jqXHR} xhrResponse
-     * @param {string} alternateMessage
-     * @param {string=} logMessage if false or null, does not log;
-     *      otherwise it logs a message and the xhrResponse, with logMessage
-     *      (or with alternateMessage if logMessage is true)
-     * @returns {*}
-     */
-    Util.extractError = function (xhrResponse, alternateMessage, logMessage) {
-        if (logMessage) {
-            if (logMessage === true) {
-                console.error(alternateMessage);
-            } else {
-                console.error(logMessage);
-            }
-            console.log(xhrResponse);
-        }
-        
-        try {
-            var response = JSON.parse(xhrResponse.responseText);
-            return response.message ? response.message : alternateMessage;
-        } catch (e) {
-            return alternateMessage;
-        }
-    };
-    
-    secretWords = [ "password", "passwd", "credential", "secret", "private", "access.cert", "access.key" ];
-    
-    Util.isSecret = function (key) {
-        if (!key) return false;
-        key = key.toString().toLowerCase();
-        for (secretWord in secretWords)
-            if (key.indexOf(secretWords[secretWord]) >= 0)
-                return true;
-        return false; 
-    };
-
-    Util.logout = function logout() {
-        $.ajax({
-            type: "POST",
-            dataType: "text",
-            url: "/logout",
-            success: function() {
-                window.location.replace("/");
-            },
-            failure: function() {
-                window.location.replace("/");
-            }
-        });
-    }
-
-    Util.setSelectionRange = function (input, selectionStart, selectionEnd) {
-      if (input.setSelectionRange) {
-        input.focus();
-        input.setSelectionRange(selectionStart, selectionEnd);
-      }
-      else if (input.createTextRange) {
-        var range = input.createTextRange();
-        range.collapse(true);
-        range.moveEnd('character', selectionEnd);
-        range.moveStart('character', selectionStart);
-        range.select();
-      }
-    };
-            
-    Util.setCaretToPos = function (input, pos) {
-      Util.setSelectionRange(input, pos, pos);
-    };
-
-    $.fn.setCaretToStart = function() {
-      this.each(function(index, elem) {
-        Util.setCaretToPos(elem, 0);
-        $(elem).scrollTop(0);
-      });
-      return this;
-    };
-
-    $("#logout-link").on("click", function (e) {
-        e.preventDefault();
-        Util.logout()
-        return false;
-    });
-
-    return Util;
-
-});
-

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/js/util/brooklyn-view.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/js/util/brooklyn-view.js b/brooklyn-ui/src/main/webapp/assets/js/util/brooklyn-view.js
deleted file mode 100644
index 7151ae1..0000000
--- a/brooklyn-ui/src/main/webapp/assets/js/util/brooklyn-view.js
+++ /dev/null
@@ -1,352 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-
-/* brooklyn extensions for supporting views */
-define([
-    "jquery", "underscore", "backbone", "brooklyn-utils",
-    "text!tpl/lib/basic-modal.html",
-    "text!tpl/lib/config-key-type-value-input-pair.html"
-    ], function (
-    $, _, Backbone, Util,
-    ModalHtml, ConfigKeyInputHtml
-) {
-
-    var module = {};
-
-    module.refresh = true;
-
-    /** Toggles automatic refreshes of instances of View. */
-    module.toggleRefresh = function () {
-        this.refresh = !this.refresh;
-        return this.refresh;
-    };
-
-    // TODO this customising of the View prototype could be expanded to include
-    // other methods from viewutils. see discussion at
-    // https://github.com/brooklyncentral/brooklyn/pull/939
-
-    // add close method to all views for clean-up
-    // (NB we have to update the prototype _here_ before any views are instantiated;
-    //  see "close" called below in "showView")
-    Backbone.View.prototype.close = function () {
-        // call user defined close method if exists
-        this.viewIsClosed = true;
-        if (_.isFunction(this.beforeClose)) {
-            this.beforeClose();
-        }
-        _.each(this._periodicFunctions, function (i) {
-            clearInterval(i);
-        });
-        this.remove();
-        this.unbind();
-    };
-
-    Backbone.View.prototype.viewIsClosed = false;
-
-    /**
-     * Registers a callback (cf setInterval) that is unregistered cleanly when the view
-     * closes. The callback is run in the context of the owning view, so callbacks can
-     * refer to 'this' safely.
-     */
-    Backbone.View.prototype.callPeriodically = function (uid, callback, interval) {
-        if (!this._periodicFunctions) {
-            this._periodicFunctions = {};
-        }
-        var old = this._periodicFunctions[uid];
-        if (old) clearInterval(old);
-
-        // Wrap callback in function that checks whether updates are enabled
-        var periodic = function () {
-            if (module.refresh) {
-                callback.apply(this);
-            }
-        };
-        // Bind this to the view
-        periodic = _.bind(periodic, this);
-        this._periodicFunctions[uid] = setInterval(periodic, interval);
-    };
-
-    /**
-     * A form that listens to modifications to its inputs, maintaining a model that is
-     * submitted when a button with class 'submit' is clicked.
-     *
-     * Expects a body view or a template function to render.
-     */
-    module.Form = Backbone.View.extend({
-        events: {
-            "change": "onChange",
-            "submit": "onSubmit"
-        },
-
-        initialize: function() {
-            if (!this.options.body && !this.options.template) {
-                throw new Error("body view or template function required by GenericForm");
-            } else if (!this.options.onSubmit) {
-                throw new Error("onSubmit function required by GenericForm");
-            }
-            this.onSubmitCallback = this.options.onSubmit;
-            this.model = new (this.options.model || Backbone.Model);
-            _.bindAll(this, "onSubmit", "onChange");
-            this.render();
-        },
-
-        beforeClose: function() {
-            if (this.options.body) {
-                this.options.body.close();
-            }
-        },
-
-        render: function() {
-            if (this.options.body) {
-                this.options.body.render();
-                this.$el.html(this.options.body.$el);
-            } else {
-                this.$el.html(this.options.template());
-            }
-            // Initialise the model with existing values
-            Util.bindModelFromForm(this.model, this.$el);
-            return this;
-        },
-
-        onChange: function(e) {
-            var target = $(e.target);
-            var name = target.attr("name");
-            this.model.set(name, Util.inputValue(target), { silent: true });
-        },
-
-        onSubmit: function(e) {
-            e.preventDefault();
-            // Could validate model
-            this.onSubmitCallback(this.model.clone());
-            return false;
-        }
-
-    });
-
-    /**
-     * A view to render another view in a modal. Give another view to render as
-     * the `body' parameter that has an onSubmit function that will be called
-     * when the modal's `Save' button is clicked, and/or an onCancel callback
-     * that will be called when the modal is closed without saving.
-     *
-     * The onSubmit callback should return either:
-     * <ul>
-     *   <li><b>nothing</b>: the callback is treated as successful
-     *   <li><b>true</b> or <b>false</b>: the callback is treated as appropriate
-     *   <li>a <b>promise</b> with `done' and `fail' callbacks (for example a jqXHR object):
-     *     The callback is treated as successful when the promise is done without error.
-     *   <li><b>anything else</b>: the callback is treated as successful
-     * </ul>
-     * When the onSubmit callback is successful the modal is closed.
-     *
-     * The return value of the onCancel callback is ignored.
-     *
-     * The modal will still be open and visible when the onSubmit callback is called.
-     * The modal will have been closed when the onCancel callback is called.
-     */
-    module.Modal = Backbone.View.extend({
-
-        id: _.uniqueId("modal"),
-        className: "modal",
-        template: _.template(ModalHtml),
-
-        events: {
-            "hide": "onClose",
-            "click .modal-submit": "onSubmit"
-        },
-
-        initialize: function() {
-            if (!this.options.body) {
-                throw new Error("Modal view requires body to render");
-            }
-            _.bindAll(this, "onSubmit", "onCancel", "show");
-            if (this.options.autoOpen) {
-                this.show();
-            }
-        },
-
-        beforeClose: function() {
-            if (this.options.body) {
-                this.options.body.close();
-            }
-        },
-
-        render: function() {
-            var optionalTitle = this.options.body.title;
-            var title = _.isFunction(optionalTitle)
-                    ? optionalTitle()
-                    : _.isString(optionalTitle)
-                        ? optionalTitle : this.options.title;
-            this.$el.html(this.template({
-                title: title,
-                submitButtonText: this.options.submitButtonText || "Apply",
-                cancelButtonText: this.options.cancelButtonText || "Cancel"
-            }));
-            this.options.body.render();
-            this.$(".modal-body").html(this.options.body.$el);
-            return this;
-        },
-
-        show: function() {
-            this.render().$el.modal();
-            return this;
-        },
-
-        onSubmit: function(event) {
-            if (_.isFunction(this.options.body.onSubmit)) {
-                var submission = this.options.body.onSubmit.apply(this.options.body, [event]);
-                var self = this;
-                var submissionSuccess = function() {
-                    // Closes view via event.
-                    self.closingSuccessfully = true;
-                    self.$el.modal("hide");
-                };
-                var submissionFailure = function () {
-                    // Better response.
-                    console.log("modal submission failed!", arguments);
-                };
-                // Assuming no value is fine
-                if (!submission) {
-                    submission = true;
-                }
-                if (_.isBoolean(submission) && submission) {
-                    submissionSuccess();
-                } else if (_.isBoolean(submission)) {
-                    submissionFailure();
-                } else if (_.isFunction(submission.done) && _.isFunction(submission.fail)) {
-                    submission.done(submissionSuccess).fail(submissionFailure);
-                } else {
-                    // assuming success and closing modal
-                    submissionSuccess()
-                }
-            }
-            return false;
-        },
-
-        onCancel: function () {
-            if (_.isFunction(this.options.body.onCancel)) {
-                this.options.body.onCancel.apply(this.options.body);
-            }
-        },
-
-        onClose: function () {
-            if (!this.closingSuccessfully) {
-                this.onCancel();
-            }
-            this.close();
-        }
-    });
-
-    /**
-     * Shows a modal with yes/no buttons as a user confirmation prompt.
-     * @param {string} question The message to show in the body of the modal
-     * @param {string} [title] An optional title to show. Uses generic default if not given.
-     * @returns {jquery.Deferred} The promise from a jquery.Deferred object. The
-     *          promise is resolved if the modal was submitted normally and rejected
-     *          otherwise.
-     */
-    module.requestConfirmation = function (question, title) {
-        var deferred = $.Deferred();
-        var Confirmation = Backbone.View.extend({
-            title: title || "Confirm action",
-            render: function () {
-                this.$el.html(question || "");
-            },
-            onSubmit: function () {
-                deferred.resolve();
-            },
-            onCancel: function () {
-                deferred.reject();
-            }
-        });
-        new module.Modal({
-            body: new Confirmation(),
-            autoOpen: true,
-            submitButtonText: "Yes",
-            cancelButtonText: "No"
-        });
-        return deferred.promise();
-    };
-
-    /** Creates, displays and returns a modal with the given view used as its body */
-    module.showModalWith = function (bodyView) {
-        return new module.Modal({body: bodyView}).show();
-    };
-
-    /**
-     * Presents inputs for config key names/values with  buttons to add/remove entries
-     * and a function to extract a map of name->value.
-     */
-    module.ConfigKeyInputPairList = Backbone.View.extend({
-        template: _.template(ConfigKeyInputHtml),
-        // Could listen to input change events and add 'error' class to any type inputs
-        // that duplicate values.
-        events: {
-            "click .config-key-row-remove": "rowRemove",
-            "keypress .last": "rowAdd"
-        },
-        render: function () {
-            if (this.options.configKeys) {
-                var templated = _.map(this.options.configKeys, function (value, key) {
-                    return this.templateRow(key, value);
-                }, this);
-                this.$el.html(templated.join(""));
-            }
-            this.$el.append(this.templateRow());
-            this.markLast();
-            return this;
-        },
-        rowAdd: function (event) {
-            this.$el.append(this.templateRow());
-            this.markLast();
-        },
-        rowRemove: function (event) {
-            $(event.currentTarget).parent().remove();
-            if (this.$el.children().length == 0) {
-                this.rowAdd();
-            }
-            this.markLast();
-        },
-        markLast: function () {
-            this.$(".last").removeClass("last");
-            // Marking inputs rather than parent div to avoid weird behaviour when
-            // remove row button is triggered with the keyboard.
-            this.$(".config-key-type").last().addClass("last");
-            this.$(".config-key-value").last().addClass("last");
-        },
-        templateRow: function (type, value) {
-            return this.template({type: type || "", value: value || ""});
-        },
-        getConfigKeys: function () {
-            var cks = {};
-            this.$(".config-key-type").each(function (index, input) {
-                input = $(input);
-                var type = input.val() && input.val().trim();
-                var value = input.next().val() && input.next().val().trim();
-                if (type && value) {
-                    cks[type] = value;
-                }
-            });
-            return cks;
-        }
-    });
-
-    return module;
-
-});

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/js/util/brooklyn.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/js/util/brooklyn.js b/brooklyn-ui/src/main/webapp/assets/js/util/brooklyn.js
deleted file mode 100644
index 702b59b..0000000
--- a/brooklyn-ui/src/main/webapp/assets/js/util/brooklyn.js
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-
-/** brooklyn extension to make console methods available and simplify access to other utils */
-
-define([
-    "underscore", "brooklyn-view", "brooklyn-utils"
-], function (_, BrooklynViews, BrooklynUtils) {
-
-    /**
-     * Makes the console API safe to use:
-     *  - Stubs missing methods to prevent errors when no console is present.
-     *  - Exposes a global `log` function that preserves line numbering and formatting.
-     *
-     * Idea from https://gist.github.com/bgrins/5108712
-     */
-    (function () {
-        var noop = function () {},
-            consoleMethods = [
-                'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error',
-                'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log',
-                'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd',
-                'timeStamp', 'trace', 'warn'
-            ],
-            length = consoleMethods.length,
-            console = (window.console = window.console || {});
-
-        while (length--) {
-            var method = consoleMethods[length];
-
-            // Only stub undefined methods.
-            if (!console[method]) {
-                console[method] = noop;
-            }
-        }
-
-        if (Function.prototype.bind) {
-            window.log = Function.prototype.bind.call(console.log, console);
-        } else {
-            window.log = function () {
-                Function.prototype.apply.call(console.log, console, arguments);
-            };
-        }
-    })();
-
-    var template = _.template;
-    _.mixin({
-        /**
-         * @param {string} text
-         * @return string The text with HTML comments removed.
-         */
-        stripComments: function (text) {
-            return text.replace(/<!--(.|[\n\r\t])*?-->\r?\n?/g, "");
-        },
-        /**
-         * As the real _.template, calling stripComments on text.
-         */
-        template: function (text, data, settings) {
-            return template(_.stripComments(text), data, settings);
-        }
-    });
-
-    var Brooklyn = {
-        view: BrooklynViews,
-        util: BrooklynUtils
-    };
-
-    return Brooklyn;
-});

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/js/util/dataTables.extensions.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/js/util/dataTables.extensions.js b/brooklyn-ui/src/main/webapp/assets/js/util/dataTables.extensions.js
deleted file mode 100644
index 74a548e..0000000
--- a/brooklyn-ui/src/main/webapp/assets/js/util/dataTables.extensions.js
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- * ---
- *
- * This code has been created by the Apache Brooklyn contributors.
- * It is heavily based on earlier software but rewritten for clarity 
- * and to preserve license integrity.
- *
- * This work is based on the existing jQuery DataTables plug-ins for:
- *
- * * fnStandingRedraw by Jonathan Hoguet, 
- *   http://www.datatables.net/plug-ins/api/fnStandingRedraw
- *
- * * fnProcessingIndicator by Allan Chappell
- *   https://www.datatables.net/plug-ins/api/fnProcessingIndicator
- *
- */
-define([
-    "jquery", "jquery-datatables"
-], function($, dataTables) {
-
-$.fn.dataTableExt.oApi.fnStandingRedraw = function(oSettings) {
-    if (oSettings.oFeatures.bServerSide === false) {
-        // remember and restore cursor position
-        var oldDisplayStart = oSettings._iDisplayStart;
-        oSettings.oApi._fnReDraw(oSettings);
-        oSettings._iDisplayStart = oldDisplayStart;
-        oSettings.oApi._fnCalculateEnd(oSettings);
-    }
-    // and force draw
-    oSettings.oApi._fnDraw(oSettings);
-};
-
-
-jQuery.fn.dataTableExt.oApi.fnProcessingIndicator = function(oSettings, bShow) {
-    if (typeof bShow === "undefined") bShow=true;
-    this.oApi._fnProcessingDisplay(oSettings, bShow);
-};
-
-});

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/js/util/jquery.slideto.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/js/util/jquery.slideto.js b/brooklyn-ui/src/main/webapp/assets/js/util/jquery.slideto.js
deleted file mode 100644
index 17afeed..0000000
--- a/brooklyn-ui/src/main/webapp/assets/js/util/jquery.slideto.js
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- * ---
- *
- * This code has been created by the Apache Brooklyn contributors.
- * It is heavily based on earlier software but rewritten for readability 
- * and to preserve license integrity.
- *
- * Our influences are:
- *
- * * jquery.slideto.min.js in Swagger UI, provenance unknown, added in:
- *   https://github.com/wordnik/swagger-ui/commit/d2eb882e5262e135dfa3f5919796bbc3785880b8#diff-bd86720650a2ebd1ab11e870dc475564
- *
- *   Swagger UI is distributed under ASL but it is not clear that this code originated in that project.
- *   No other original author could be identified.
- *
- * * Nearly identical code referenced here:
- *   http://stackoverflow.com/questions/12375440/scrolling-works-in-chrome-but-not-in-firefox-or-ie
- *
- * Note that the project https://github.com/Sleavely/jQuery-slideto is NOT this.
- *
- */
-(function(jquery){
-jquery.fn.slideto=function(opts) {
-    opts = _.extend( {
-            highlight: true,
-            slide_duration: "slow",
-            highlight_duration: 3000,
-            highlight_color: "#FFFF99" },
-        opts);
-    return this.each(function() {
-        $target=jquery(this);
-        jquery("body").animate(
-            { scrollTop: $target.offset().top },
-            opts.slide_duration,
-            function() {
-                opts.highlight && 
-                jquery.ui.version && 
-                $target.effect(
-                    "highlight",
-                    { color: opts.highlight_color },
-                    opts.highlight_duration)
-            })
-        });
-}}) (jQuery);

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/js/view/activity-details.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/js/view/activity-details.js b/brooklyn-ui/src/main/webapp/assets/js/view/activity-details.js
deleted file mode 100644
index fa8b552..0000000
--- a/brooklyn-ui/src/main/webapp/assets/js/view/activity-details.js
+++ /dev/null
@@ -1,426 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-/**
- * Displays details on an activity/task
- */
-define([
-    "underscore", "jquery", "backbone", "brooklyn-utils", "view/viewutils", "moment",
-    "model/task-summary",
-    "text!tpl/apps/activity-details.html", "text!tpl/apps/activity-table.html", 
-
-    "bootstrap", "jquery-datatables", "datatables-extensions"
-], function (_, $, Backbone, Util, ViewUtils, moment,
-    TaskSummary,
-    ActivityDetailsHtml, ActivityTableHtml) {
-
-    var activityTableTemplate = _.template(ActivityTableHtml),
-        activityDetailsTemplate = _.template(ActivityDetailsHtml);
-
-    function makeActivityTable($el) {
-        $el.html(_.template(ActivityTableHtml));
-        var $subTable = $('.activity-table', $el);
-        $subTable.attr('width', 569-6-6 /* subtract padding */)
-
-        return ViewUtils.myDataTable($subTable, {
-            "fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
-                $(nRow).attr('id', aData[0])
-                $(nRow).addClass('activity-row')
-            },
-            "aoColumnDefs": [ {
-                    "mRender": function ( data, type, row ) { return Util.escape(data) },
-                    "aTargets": [ 1, 2, 3 ]
-                 }, {
-                    "bVisible": false,
-                    "aTargets": [ 0 ]
-                 } ],
-            "aaSorting":[]  // default not sorted (server-side order)
-        });
-    }
-
-    var ActivityDetailsView = Backbone.View.extend({
-        template: activityDetailsTemplate,
-        taskLink: '',
-        task: null,
-        /* children of this task; see HasTaskChildren for difference between this and sub(mitted)Tasks */
-        childrenTable: null,
-        /* tasks in the current execution context (this.collections) whose submittedByTask
-         * is the task we are drilled down on. this defaults to the passed in collection, 
-         * which will be the last-viewed entity's exec-context; when children cross exec-context
-         * boundaries we have to rewire to point to the current entity's exec-context / tasks */
-        subtasksTable: null,
-        children: null,
-        breadcrumbs: [],
-        firstLoad: true,
-        events:{
-            "click #activities-children-table .activity-table tr":"childrenRowClick",
-            "click #activities-submitted-table .activity-table tr":"submittedRowClick",
-            'click .showDrillDownSubmittedByAnchor':'showDrillDownSubmittedByAnchor',
-            'click .showDrillDownBlockerOfAnchor':'showDrillDownBlockerOfAnchor',
-            'click .backDrillDown':'backDrillDown'
-        },
-        // requires taskLink or task; breadcrumbs is optional
-        initialize:function () {
-            var that = this;
-            this.taskLink = this.options.taskLink;
-            this.taskId = this.options.taskId;
-            if (this.options.task)
-                this.task = this.options.task;
-            else if (this.options.tabView)
-                this.task = this.options.tabView.collection.get(this.taskId);
-            if (!this.taskLink && this.task) this.taskLink = this.task.get('links').self;
-            if (!this.taskLink && this.taskId) this.taskLink = "v1/activities/"+this.taskId;;
-            
-            this.tabView = this.options.tabView || null;
-            
-            if (this.options.breadcrumbs) this.breadcrumbs = this.options.breadcrumbs;
-
-            this.$el.html(this.template({ taskLink: this.taskLink, taskId: this.taskId, task: this.task, breadcrumbs: this.breadcrumbs }));
-            this.$el.addClass('activity-detail-panel');
-
-            this.childrenTable = makeActivityTable(this.$('#activities-children-table'));
-            this.subtasksTable = makeActivityTable(this.$('#activities-submitted-table'));
-
-            ViewUtils.attachToggler(this.$el)
-        
-            if (this.task) {
-                this.renderTask()
-                this.setUpPolling()
-            } else {      
-                ViewUtils.fadeToIndicateInitialLoad(this.$el);
-                this.$el.css('cursor', 'wait')
-                $.get(this.taskLink, function(data) {
-                    ViewUtils.cancelFadeOnceLoaded(that.$el);
-                    that.task = new TaskSummary.Model(data)
-                    that.renderTask()
-                    that.setUpPolling();
-                }).fail(function() { log("unable to load "+that.taskLink) })
-            }
-
-            // initial subtasks may be available from parent, so try to render those
-            // (reliable polling for subtasks, and for children, is set up in setUpPolling ) 
-            this.renderSubtasks()
-        },
-        
-        refreshNow: function(initial) {
-            var that = this
-            $.get(this.taskLink, function(data) {
-                that.task = new TaskSummary.Model(data)
-                that.renderTask()
-                if (initial) that.setUpPolling();
-            })
-        },
-        renderTask: function() {
-            // update task fields
-            var that = this, firstLoad = this.firstLoad;
-            this.firstLoad = false;
-            
-            if (firstLoad  && this.task) {
-//                log("rendering "+firstLoad+" "+this.task.get('isError')+" "+this.task.id);
-                if (this.task.get('isError')) {
-                    // on first load, expand the details if there is a problem
-                    var $details = this.$(".toggler-region.task-detail .toggler-header");
-                    ViewUtils.showTogglerClickElement($details);
-                }
-            }
-            
-            this.updateFields('displayName', 'entityDisplayName', 'id', 'description', 'currentStatus', 'blockingDetails');
-            this.updateFieldWith('blockingTask',
-                function(v) { 
-                    return "<a class='showDrillDownBlockerOfAnchor handy' link='"+_.escape(v.link)+"' id='"+v.metadata.id+"'>"+
-                        that.displayTextForLinkedTask(v)+"</a>" })
-            this.updateFieldWith('result',
-                function(v) {
-                    // use display string (JSON.stringify(_.escape(v)) because otherwise list of [null,null] is just ","  
-                    var vs = Util.toDisplayString(v);
-                    if (vs.trim().length==0) {
-                        return " (empty result)";
-                    } else if (vs.length<20 &&  !/\r|\n/.exec(v)) {
-                        return " with result: <span class='result-literal'>"+vs+"</span>";
-                    } else {
-                        return "<div class='result-literal'>"+vs.replace(/\n+/g,"<br>")+"</div>"
-                    }
-                 })
-            this.updateFieldWith('tags', function(tags) {
-                var tagBody = "";
-                for (var tag in tags) {
-                    tagBody += "<div class='activity-tag-giftlabel'>"+Util.toDisplayString(tags[tag])+"</div>";
-                }
-                return tagBody;
-            })
-            
-            var submitTimeUtc = this.updateFieldWith('submitTimeUtc',
-                function(v) { return v <= 0 ? "-" : moment(v).format('D MMM YYYY H:mm:ss.SSS')+" &nbsp; <i>"+moment(v).fromNow()+"</i>" })
-            var startTimeUtc = this.updateFieldWith('startTimeUtc',
-                function(v) { return v <= 0 ? "-" : moment(v).format('D MMM YYYY H:mm:ss.SSS')+" &nbsp; <i>"+moment(v).fromNow()+"</i>" })
-            this.updateFieldWith('endTimeUtc',
-                function(v) { return v <= 0 ? "-" : moment(v).format('D MMM YYYY H:mm:ss.SSS')+" &nbsp; <i>"+moment(v).from(startTimeUtc, true)+" later</i>" })
-
-            ViewUtils.updateTextareaWithData(this.$(".task-json .for-textarea"), 
-                Util.toTextAreaString(this.task), false, false, 150, 400)
-
-            ViewUtils.updateTextareaWithData(this.$(".task-detail .for-textarea"), 
-                this.task.get('detailedStatus'), false, false, 30, 250)
-
-            this.updateFieldWith('streams',
-                function(streams) {
-                    // Stream names presented alphabetically
-                    var keys = _.keys(streams);
-                    keys.sort();
-                    var result = "";
-                    for (var i = 0; i < keys.length; i++) {
-                        var name = keys[i];
-                        var stream = streams[name];
-                        result += "<div class='activity-stream-div'>" +
-                                "<span class='activity-label'>" +
-                                _.escape(name) +
-                                "</span><span>" +
-                                "<a href='" + stream.link + "'>download</a>" +
-                                (stream.metadata["sizeText"] ? " (" + _.escape(stream.metadata["sizeText"]) + ")" : "") +
-                                "</span></div>";
-                    }
-                    return result; 
-                });
-
-            this.updateFieldWith('submittedByTask',
-                function(v) { return "<a class='showDrillDownSubmittedByAnchor handy' link='"+_.escape(v.link)+"' id='"+v.metadata.id+"'>"+
-                    that.displayTextForLinkedTask(v)+"</a>" })
-
-            if (this.task.get("children").length==0)
-                this.$('.toggler-region.tasks-children').hide();
-        },
-        setUpPolling: function() {
-            var that = this
-
-            // on first load, clear any funny cursor
-            this.$el.css('cursor', 'auto')
-
-            this.task.url = this.taskLink;
-            this.task.on("all", this.renderTask, this)
-            
-            ViewUtils.get(this, this.taskLink, function(data) {
-                // if we can get the data, then start fetching certain things repeatedly
-                // (would be good to skip the immediate "doitnow" below but not a big deal)
-                ViewUtils.fetchRepeatedlyWithDelay(that, that.task, { doitnow: true });
-                
-                // and set up to load children (now that the task is guaranteed to be loaded)
-                that.children = new TaskSummary.Collection()
-                that.children.url = that.task.get("links").children
-                that.children.on("reset", that.renderChildren, that)
-                ViewUtils.fetchRepeatedlyWithDelay(that, that.children, { 
-                    fetchOptions: { reset: true }, doitnow: true, fadeTarget: that.$('.tasks-children') });
-            }).fail( function() { that.$('.toggler-region.tasks-children').hide() } );
-
-
-            $.get(this.task.get("links").entity, function(entity) {
-                if (that.collection==null || entity.links.activities != that.collection.url) {
-                    // need to rewire collection to point to the right ExecutionContext
-                    that.collection = new TaskSummary.Collection()
-                    that.collection.url = entity.links.activities
-                    that.collection.on("reset", that.renderSubtasks, that)
-                    ViewUtils.fetchRepeatedlyWithDelay(that, that.collection, { 
-                        fetchOptions: { reset: true }, doitnow: true, fadeTarget: that.$('.tasks-submitted') });
-                } else {
-                    that.collection.on("reset", that.renderSubtasks, that)
-                    that.collection.fetch({reset: true});
-                }
-            });
-        },
-        
-        renderChildren: function() {
-            var that = this
-            var children = this.children
-            ViewUtils.updateMyDataTable(this.childrenTable, children, function(task, index) {
-                return [ task.get("id"),
-                         (task.get("entityId") && task.get("entityId")!=that.task.get("entityId") ? task.get("entityDisplayName") + ": " : "") + 
-                         task.get("displayName"),
-                         task.get("submitTimeUtc") <= 0 ? "-" : moment(task.get("submitTimeUtc")).calendar(),
-                         task.get("currentStatus")
-                    ]; 
-                });
-            if (children && children.length>0) {
-                this.$('.toggler-region.tasks-children').show();
-            } else {
-                this.$('.toggler-region.tasks-children').hide();
-            }
-        },
-        renderSubtasks: function() {
-            var that = this
-            var taskId = this.taskId || (this.task ? this.task.id : null);
-            if (!this.collection) {
-                this.$('.toggler-region.tasks-submitted').hide();
-                return;
-            }
-            if (!taskId) {
-                // task not available yet; just wait for it to be loaded
-                // (and in worst case, if it can't be loaded, this panel stays faded)
-                return;
-            } 
-            
-            // find tasks submitted by this one which aren't included as children
-            // this uses collections -- which is everything in the current execution context
-            var subtasks = []
-            for (var taskI in this.collection.models) {
-                var task = this.collection.models[taskI]
-                var submittedBy = task.get("submittedByTask")
-                if (submittedBy!=null && submittedBy.metadata!=null && submittedBy.metadata["id"] == taskId &&
-                        (!this.children || this.children.get(task.id)==null)) {
-                    subtasks.push(task)
-                }
-            }
-            ViewUtils.updateMyDataTable(this.subtasksTable, subtasks, function(task, index) {
-                return [ task.get("id"),
-                         (task.get("entityId") && (!that.task || task.get("entityId")!=that.task.get("entityId")) ? task.get("entityDisplayName") + ": " : "") + 
-                         task.get("displayName"),
-                         task.get("submitTimeUtc") <= 0 ? "-" : moment(task.get("submitTimeUtc")).calendar(),
-                         task.get("currentStatus")
-                    ];
-                });
-            if (subtasks && subtasks.length>0) {
-                this.$('.toggler-region.tasks-submitted').show();
-            } else {
-                this.$('.toggler-region.tasks-submitted').hide();
-            }
-        },
-        
-        displayTextForLinkedTask: function(v) {
-            return v.metadata.taskName ? 
-                    (v.metadata.entityDisplayName ? _.escape(v.metadata.entityDisplayName)+" <b>"+_.escape(v.metadata.taskName)+"</b>" : 
-                        _.escape(v.metadata.taskName)) :
-                    v.metadata.taskId ? _.escape(v.metadata.taskId) : 
-                    _.escape(v.link)
-        },
-        updateField: function(field) {
-            return this.updateFieldWith(field, _.escape)
-        },
-        updateFields: function() {
-            _.map(arguments, this.updateField, this);
-        },
-        updateFieldWith: function(field, f) {
-            var v = this.task.get(field)
-            if (v !== undefined && v != null && 
-                    (typeof v !== "object" || _.size(v) > 0)) {
-                this.$('.updateField-'+field, this.$el).html( f(v) );
-                this.$('.ifField-'+field, this.$el).show();
-            } else {
-                // blank if there is no value
-                this.$('.updateField-'+field).empty();
-                this.$('.ifField-'+field).hide();
-            }
-            return v
-        },
-        childrenRowClick:function(evt) {
-            var row = $(evt.currentTarget).closest("tr");
-            var id = row.attr("id");
-            this.showDrillDownTask("subtask of", this.children.get(id).get("links").self, id, this.children.get(id))
-        },
-        submittedRowClick:function(evt) {
-            var row = $(evt.currentTarget).closest("tr");
-            var id = row.attr("id");
-            // submitted tasks are guaranteed to be in the collection, so this is safe
-            this.showDrillDownTask("subtask of", this.collection.get(id).get('links').self, id)
-        },
-        
-        showDrillDownSubmittedByAnchor: function(from) {
-            var $a = $(from.target).closest('a');
-            this.showDrillDownTask("submitter of", $a.attr("link"), $a.attr("id"))
-        },
-        showDrillDownBlockerOfAnchor: function(from) {
-            var $a = $(from.target).closest('a');
-            this.showDrillDownTask("blocker of", $a.attr("link"), $a.attr("id"))
-        },
-        showDrillDownTask: function(relation, newTaskLink, newTaskId, newTask) {
-//            log("activities deeper drill down - "+newTaskId +" / "+newTaskLink)
-            var that = this;
-            
-            var newBreadcrumbs = [ relation + ' ' +
-                this.task.get('entityDisplayName') + ' ' +
-                this.task.get('displayName') ].concat(this.breadcrumbs)
-                
-            var activityDetailsPanel = new ActivityDetailsView({
-                taskLink: newTaskLink,
-                taskId: newTaskId,
-                task: newTask,
-                tabView: that.tabView,
-                collection: this.collection,
-                breadcrumbs: newBreadcrumbs
-            });
-            activityDetailsPanel.addToView(this.$el);
-        },
-        addToView: function(parent) {
-            if (this.parent) {
-                log("WARN: adding details to view when already added")
-                this.parent = parent;
-            }
-            
-            if (Backbone.history && (!this.tabView || !this.tabView.openingQueuedTasks)) {
-                Backbone.history.navigate(Backbone.history.fragment+"/"+"subtask"+"/"+this.taskId);
-            }
-
-            var $t = parent.closest('.slide-panel');
-            var $t2 = $t.after('<div>').next();
-            $t2.addClass('slide-panel');
-
-            // load the drill-down page
-            $t2.html(this.render().el)
-
-            var speed = (!this.tabView || !this.tabView.openingQueuedTasks) ? 300 : 0;
-            $t.animate({
-                    left: -600
-                }, speed, function() { 
-                    $t.hide() 
-                });
-
-            $t2.show().css({
-                    left: 600
-                    , top: 0
-                }).animate({
-                    left: 0
-                }, speed);
-        },
-        backDrillDown: function(event) {
-//            log("activities drill back from "+this.taskLink)
-            var that = this
-            var $t2 = this.$el.closest('.slide-panel')
-            var $t = $t2.prev()
-
-            if (Backbone.history) {
-                var fragment = Backbone.history.fragment
-                var thisLoc = fragment.indexOf("/subtask/"+this.taskId);
-                if (thisLoc>=0)
-                    Backbone.history.navigate( fragment.substring(0, thisLoc) );
-            }
-
-            $t2.animate({
-                    left: 569 //prevTable.width()
-                }, 300, function() {
-                    that.$el.empty()
-                    $t2.remove()
-                    that.remove()
-                });
-
-            $t.show().css({
-                    left: -600 //-($t2.width())
-                }).animate({
-                    left: 0
-                }, 300);
-        }
-    });
-
-    return ActivityDetailsView;
-});

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/js/view/add-child-invoke.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/js/view/add-child-invoke.js b/brooklyn-ui/src/main/webapp/assets/js/view/add-child-invoke.js
deleted file mode 100644
index 1105afe..0000000
--- a/brooklyn-ui/src/main/webapp/assets/js/view/add-child-invoke.js
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-/**
- * Render as a modal
- */
-define([
-    "underscore", "jquery", "backbone", "brooklyn", "brooklyn-utils", "view/viewutils",
-    "text!tpl/apps/add-child-modal.html"
-], function(_, $, Backbone, Brooklyn, Util, ViewUtils, 
-        AddChildModalHtml) {
-    return Backbone.View.extend({
-        template: _.template(AddChildModalHtml),
-        initialize: function() {
-            this.title = "Add Child to "+this.options.entity.get('name');
-        },
-        render: function() {
-            this.$el.html(this.template(this.options.entity.attributes));
-            return this;
-        },
-        onSubmit: function (event) {
-            var self = this;
-            var childSpec = this.$("#child-spec").val();
-            var start = this.$("#child-autostart").is(":checked");
-            var url = this.options.entity.get('links').children + (!start ? "?start=false" : "");
-            var ajax = $.ajax({
-                type: "POST",
-                url: url,
-                data: childSpec,
-                contentType: "application/yaml",
-                success: function() {
-                    self.options.target.reload();
-                },
-                error: function(response) {
-                    self.showError(Util.extractError(response, "Error contacting server", url));
-                }
-            });
-            return ajax;
-        },
-        showError: function (message) {
-            this.$(".child-add-error-container").removeClass("hide");
-            this.$(".child-add-error-message").html(message);
-        }
-
-    });
-});


[46/51] [abbrv] [partial] brooklyn-ui git commit: move subdir from incubator up a level as it is promoted to its own repo (first non-incubator commit!)

Posted by he...@apache.org.
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/js/config.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/js/config.js b/brooklyn-ui/src/main/webapp/assets/js/config.js
deleted file mode 100644
index 6710ff1..0000000
--- a/brooklyn-ui/src/main/webapp/assets/js/config.js
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-/*
- * set the require.js configuration for your application
- */
-require.config({
-    /* Give 30s (default is 7s) in case it's a very poor slow network */
-    waitSeconds:30,
-    
-    /* Libraries */
-    baseUrl:"assets/js",
-    paths:{
-        "jquery":"libs/jquery",
-        "underscore":"libs/underscore",
-        "backbone":"libs/backbone",
-        "bootstrap":"libs/bootstrap",
-        "jquery-form":"libs/jquery.form",
-        "jquery-datatables":"libs/jquery.dataTables",
-        "jquery-slideto":"util/jquery.slideto",
-        "jquery-wiggle":"libs/jquery.wiggle.min",
-        "jquery-ba-bbq":"libs/jquery.ba-bbq.min",
-        "moment":"libs/moment",
-        "handlebars":"libs/handlebars-1.0.rc.1",
-        "brooklyn":"util/brooklyn",
-        "brooklyn-view":"util/brooklyn-view",
-        "brooklyn-utils":"util/brooklyn-utils",
-        "datatables-extensions":"util/dataTables.extensions",
-        "googlemaps":"view/googlemaps",
-        "async":"libs/async",  //not explicitly referenced, but needed for google
-        "text":"libs/text",
-        "uri":"libs/URI",
-        "zeroclipboard":"libs/ZeroClipboard",
-        "js-yaml":"libs/js-yaml",
-        
-        "tpl":"../tpl"
-    },
-    
-    shim:{
-        "underscore":{
-            exports:"_"
-        },
-        "backbone":{
-            deps:[ "underscore", "jquery" ],
-            exports:"Backbone"
-        },
-        "jquery-datatables": {
-            deps: [ "jquery" ]
-        },
-        "datatables-extensions":{
-            deps:[ "jquery", "jquery-datatables" ]
-        },
-        "jquery-form": { deps: [ "jquery" ] },
-        "jquery-slideto": { deps: [ "jquery" ] },
-        "jquery-wiggle": { deps: [ "jquery" ] },
-        "jquery-ba-bbq": { deps: [ "jquery" ] },
-        "handlebars": { deps: [ "jquery" ] },
-        "bootstrap": { deps: [ "jquery" ] /* http://stackoverflow.com/questions/9227406/bootstrap-typeerror-undefined-is-not-a-function-has-no-method-tab-when-us */ }
-    }
-});
-
-/*
- * Main application entry point.
- */
-require([
-    "router"
-], function (Router) {
-    new Router().startBrooklynGui();
-});

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/js/libs/URI.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/js/libs/URI.js b/brooklyn-ui/src/main/webapp/assets/js/libs/URI.js
deleted file mode 100644
index e621a06..0000000
--- a/brooklyn-ui/src/main/webapp/assets/js/libs/URI.js
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Taken from http://code.google.com/p/js-uri/ v0.1.  BSD license.
- * No changes in this Brooklyn copy, apart from these header lines.
- * TODO Consider switching to  http://medialize.github.io/URI.js/  which appears more modern.
- * 
- *  
- * An URI datatype.  Based upon examples in RFC3986.
- *
- * TODO %-escaping
- * TODO split apart authority
- * TODO split apart query_string (on demand, anyway)
- *
- * @(#) $Id$
- */
- 
-// Constructor for the URI object.  Parse a string into its components.
-function URI(str) {
-    if (!str) str = "";
-    // Based on the regex in RFC2396 Appendix B.
-    var parser = /^(?:([^:\/?\#]+):)?(?:\/\/([^\/?\#]*))?([^?\#]*)(?:\?([^\#]*))?(?:\#(.*))?/;
-    var result = str.match(parser);
-    this.scheme    = result[1] || null;
-    this.authority = result[2] || null;
-    this.path      = result[3] || null;
-    this.query     = result[4] || null;
-    this.fragment  = result[5] || null;
-}
-
-// Restore the URI to it's stringy glory.
-URI.prototype.toString = function () {
-    var str = "";
-    if (this.scheme) {
-        str += this.scheme + ":";
-    }
-    if (this.authority) {
-        str += "//" + this.authority;
-    }
-    if (this.path) {
-        str += this.path;
-    }
-    if (this.query) {
-        str += "?" + this.query;
-    }
-    if (this.fragment) {
-        str += "#" + this.fragment;
-    }
-    return str;
-};
-
-// Introduce a new scope to define some private helper functions.
-(function () {
-    // RFC3986 §5.2.3 (Merge Paths)
-    function merge(base, rel_path) {
-        var dirname = /^(.*)\//;
-        if (base.authority && !base.path) {
-            return "/" + rel_path;
-        }
-        else {
-            return base.path.match(dirname)[0] + rel_path;
-        }
-    }
-
-    // Match two path segments, where the second is ".." and the first must
-    // not be "..".
-    var DoubleDot = /\/((?!\.\.\/)[^\/]*)\/\.\.\//;
-
-    function remove_dot_segments(path) {
-        if (!path) return "";
-        // Remove any single dots
-        var newpath = path.replace(/\/\.\//g, '/');
-        // Remove any trailing single dots.
-        newpath = newpath.replace(/\/\.$/, '/');
-        // Remove any double dots and the path previous.  NB: We can't use
-        // the "g", modifier because we are changing the string that we're
-        // matching over.
-        while (newpath.match(DoubleDot)) {
-            newpath = newpath.replace(DoubleDot, '/');
-        }
-        // Remove any trailing double dots.
-        newpath = newpath.replace(/\/([^\/]*)\/\.\.$/, '/');
-        // If there are any remaining double dot bits, then they're wrong
-        // and must be nuked.  Again, we can't use the g modifier.
-        while (newpath.match(/\/\.\.\//)) {
-            newpath = newpath.replace(/\/\.\.\//, '/');
-        }
-        return newpath;
-    }
-
-    // RFC3986 §5.2.2. Transform References;
-    URI.prototype.resolve = function (base) {
-        var target = new URI();
-        if (this.scheme) {
-            target.scheme    = this.scheme;
-            target.authority = this.authority;
-            target.path      = remove_dot_segments(this.path);
-            target.query     = this.query;
-        }
-        else {
-            if (this.authority) {
-                target.authority = this.authority;
-                target.path      = remove_dot_segments(this.path);
-                target.query     = this.query;
-            }        
-            else {
-                // XXX Original spec says "if defined and empty"…;
-                if (!this.path) {
-                    target.path = base.path;
-                    if (this.query) {
-                        target.query = this.query;
-                    }
-                    else {
-                        target.query = base.query;
-                    }
-                }
-                else {
-                    if (this.path.charAt(0) === '/') {
-                        target.path = remove_dot_segments(this.path);
-                    } else {
-                        target.path = merge(base, this.path);
-                        target.path = remove_dot_segments(target.path);
-                    }
-                    target.query = this.query;
-                }
-                target.authority = base.authority;
-            }
-            target.scheme = base.scheme;
-        }
-
-        target.fragment = this.fragment;
-
-        return target;
-    };
-})();

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/js/libs/ZeroClipboard.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/js/libs/ZeroClipboard.js b/brooklyn-ui/src/main/webapp/assets/js/libs/ZeroClipboard.js
deleted file mode 100644
index bcdabf5..0000000
--- a/brooklyn-ui/src/main/webapp/assets/js/libs/ZeroClipboard.js
+++ /dev/null
@@ -1,1015 +0,0 @@
-/*!
-* ZeroClipboard
-* The ZeroClipboard library provides an easy way to copy text to the clipboard using an invisible Adobe Flash movie and a JavaScript interface.
-* Copyright (c) 2014 Jon Rohan, James M. Greene
-* Licensed MIT
-* http://zeroclipboard.org/
-* v1.3.1
-*
-* BROOKLYN NOTE: The accompanying SWF artifact can also be built from source using a free toolchain
-* as described at https://github.com/zeroclipboard/zeroclipboard/blob/master/CONTRIBUTING.md .
-* (It has been included in the Apache project as a binary artifact because building it is tedious.
-* Also- it is small!) This paragraph is the only change to this source file.
-*/
-(function() {
-  "use strict";
-  var currentElement;
-  var flashState = {
-    bridge: null,
-    version: "0.0.0",
-    disabled: null,
-    outdated: null,
-    ready: null
-  };
-  var _clipData = {};
-  var clientIdCounter = 0;
-  var _clientMeta = {};
-  var elementIdCounter = 0;
-  var _elementMeta = {};
-  var _amdModuleId = null;
-  var _cjsModuleId = null;
-  var _swfPath = function() {
-    var i, jsDir, tmpJsPath, jsPath, swfPath = "ZeroClipboard.swf";
-    if (document.currentScript && (jsPath = document.currentScript.src)) {} else {
-      var scripts = document.getElementsByTagName("script");
-      if ("readyState" in scripts[0]) {
-        for (i = scripts.length; i--; ) {
-          if (scripts[i].readyState === "interactive" && (jsPath = scripts[i].src)) {
-            break;
-          }
-        }
-      } else if (document.readyState === "loading") {
-        jsPath = scripts[scripts.length - 1].src;
-      } else {
-        for (i = scripts.length; i--; ) {
-          tmpJsPath = scripts[i].src;
-          if (!tmpJsPath) {
-            jsDir = null;
-            break;
-          }
-          tmpJsPath = tmpJsPath.split("#")[0].split("?")[0];
-          tmpJsPath = tmpJsPath.slice(0, tmpJsPath.lastIndexOf("/") + 1);
-          if (jsDir == null) {
-            jsDir = tmpJsPath;
-          } else if (jsDir !== tmpJsPath) {
-            jsDir = null;
-            break;
-          }
-        }
-        if (jsDir !== null) {
-          jsPath = jsDir;
-        }
-      }
-    }
-    if (jsPath) {
-      jsPath = jsPath.split("#")[0].split("?")[0];
-      swfPath = jsPath.slice(0, jsPath.lastIndexOf("/") + 1) + swfPath;
-    }
-    return swfPath;
-  }();
-  var _camelizeCssPropName = function() {
-    var matcherRegex = /\-([a-z])/g, replacerFn = function(match, group) {
-      return group.toUpperCase();
-    };
-    return function(prop) {
-      return prop.replace(matcherRegex, replacerFn);
-    };
-  }();
-  var _getStyle = function(el, prop) {
-    var value, camelProp, tagName, possiblePointers, i, len;
-    if (window.getComputedStyle) {
-      value = window.getComputedStyle(el, null).getPropertyValue(prop);
-    } else {
-      camelProp = _camelizeCssPropName(prop);
-      if (el.currentStyle) {
-        value = el.currentStyle[camelProp];
-      } else {
-        value = el.style[camelProp];
-      }
-    }
-    if (prop === "cursor") {
-      if (!value || value === "auto") {
-        tagName = el.tagName.toLowerCase();
-        if (tagName === "a") {
-          return "pointer";
-        }
-      }
-    }
-    return value;
-  };
-  var _elementMouseOver = function(event) {
-    if (!event) {
-      event = window.event;
-    }
-    var target;
-    if (this !== window) {
-      target = this;
-    } else if (event.target) {
-      target = event.target;
-    } else if (event.srcElement) {
-      target = event.srcElement;
-    }
-    ZeroClipboard.activate(target);
-  };
-  var _addEventHandler = function(element, method, func) {
-    if (!element || element.nodeType !== 1) {
-      return;
-    }
-    if (element.addEventListener) {
-      element.addEventListener(method, func, false);
-    } else if (element.attachEvent) {
-      element.attachEvent("on" + method, func);
-    }
-  };
-  var _removeEventHandler = function(element, method, func) {
-    if (!element || element.nodeType !== 1) {
-      return;
-    }
-    if (element.removeEventListener) {
-      element.removeEventListener(method, func, false);
-    } else if (element.detachEvent) {
-      element.detachEvent("on" + method, func);
-    }
-  };
-  var _addClass = function(element, value) {
-    if (!element || element.nodeType !== 1) {
-      return element;
-    }
-    if (element.classList) {
-      if (!element.classList.contains(value)) {
-        element.classList.add(value);
-      }
-      return element;
-    }
-    if (value && typeof value === "string") {
-      var classNames = (value || "").split(/\s+/);
-      if (element.nodeType === 1) {
-        if (!element.className) {
-          element.className = value;
-        } else {
-          var className = " " + element.className + " ", setClass = element.className;
-          for (var c = 0, cl = classNames.length; c < cl; c++) {
-            if (className.indexOf(" " + classNames[c] + " ") < 0) {
-              setClass += " " + classNames[c];
-            }
-          }
-          element.className = setClass.replace(/^\s+|\s+$/g, "");
-        }
-      }
-    }
-    return element;
-  };
-  var _removeClass = function(element, value) {
-    if (!element || element.nodeType !== 1) {
-      return element;
-    }
-    if (element.classList) {
-      if (element.classList.contains(value)) {
-        element.classList.remove(value);
-      }
-      return element;
-    }
-    if (value && typeof value === "string" || value === undefined) {
-      var classNames = (value || "").split(/\s+/);
-      if (element.nodeType === 1 && element.className) {
-        if (value) {
-          var className = (" " + element.className + " ").replace(/[\n\t]/g, " ");
-          for (var c = 0, cl = classNames.length; c < cl; c++) {
-            className = className.replace(" " + classNames[c] + " ", " ");
-          }
-          element.className = className.replace(/^\s+|\s+$/g, "");
-        } else {
-          element.className = "";
-        }
-      }
-    }
-    return element;
-  };
-  var _getZoomFactor = function() {
-    var rect, physicalWidth, logicalWidth, zoomFactor = 1;
-    if (typeof document.body.getBoundingClientRect === "function") {
-      rect = document.body.getBoundingClientRect();
-      physicalWidth = rect.right - rect.left;
-      logicalWidth = document.body.offsetWidth;
-      zoomFactor = Math.round(physicalWidth / logicalWidth * 100) / 100;
-    }
-    return zoomFactor;
-  };
-  var _getDOMObjectPosition = function(obj, defaultZIndex) {
-    var info = {
-      left: 0,
-      top: 0,
-      width: 0,
-      height: 0,
-      zIndex: _getSafeZIndex(defaultZIndex) - 1
-    };
-    if (obj.getBoundingClientRect) {
-      var rect = obj.getBoundingClientRect();
-      var pageXOffset, pageYOffset, zoomFactor;
-      if ("pageXOffset" in window && "pageYOffset" in window) {
-        pageXOffset = window.pageXOffset;
-        pageYOffset = window.pageYOffset;
-      } else {
-        zoomFactor = _getZoomFactor();
-        pageXOffset = Math.round(document.documentElement.scrollLeft / zoomFactor);
-        pageYOffset = Math.round(document.documentElement.scrollTop / zoomFactor);
-      }
-      var leftBorderWidth = document.documentElement.clientLeft || 0;
-      var topBorderWidth = document.documentElement.clientTop || 0;
-      info.left = rect.left + pageXOffset - leftBorderWidth;
-      info.top = rect.top + pageYOffset - topBorderWidth;
-      info.width = "width" in rect ? rect.width : rect.right - rect.left;
-      info.height = "height" in rect ? rect.height : rect.bottom - rect.top;
-    }
-    return info;
-  };
-  var _cacheBust = function(path, options) {
-    var cacheBust = options == null || options && options.cacheBust === true && options.useNoCache === true;
-    if (cacheBust) {
-      return (path.indexOf("?") === -1 ? "?" : "&") + "noCache=" + new Date().getTime();
-    } else {
-      return "";
-    }
-  };
-  var _vars = function(options) {
-    var i, len, domain, str = [], domains = [], trustedOriginsExpanded = [];
-    if (options.trustedOrigins) {
-      if (typeof options.trustedOrigins === "string") {
-        domains.push(options.trustedOrigins);
-      } else if (typeof options.trustedOrigins === "object" && "length" in options.trustedOrigins) {
-        domains = domains.concat(options.trustedOrigins);
-      }
-    }
-    if (options.trustedDomains) {
-      if (typeof options.trustedDomains === "string") {
-        domains.push(options.trustedDomains);
-      } else if (typeof options.trustedDomains === "object" && "length" in options.trustedDomains) {
-        domains = domains.concat(options.trustedDomains);
-      }
-    }
-    if (domains.length) {
-      for (i = 0, len = domains.length; i < len; i++) {
-        if (domains.hasOwnProperty(i) && domains[i] && typeof domains[i] === "string") {
-          domain = _extractDomain(domains[i]);
-          if (!domain) {
-            continue;
-          }
-          if (domain === "*") {
-            trustedOriginsExpanded = [ domain ];
-            break;
-          }
-          trustedOriginsExpanded.push.apply(trustedOriginsExpanded, [ domain, "//" + domain, window.location.protocol + "//" + domain ]);
-        }
-      }
-    }
-    if (trustedOriginsExpanded.length) {
-      str.push("trustedOrigins=" + encodeURIComponent(trustedOriginsExpanded.join(",")));
-    }
-    if (typeof options.jsModuleId === "string" && options.jsModuleId) {
-      str.push("jsModuleId=" + encodeURIComponent(options.jsModuleId));
-    }
-    return str.join("&");
-  };
-  var _inArray = function(elem, array, fromIndex) {
-    if (typeof array.indexOf === "function") {
-      return array.indexOf(elem, fromIndex);
-    }
-    var i, len = array.length;
-    if (typeof fromIndex === "undefined") {
-      fromIndex = 0;
-    } else if (fromIndex < 0) {
-      fromIndex = len + fromIndex;
-    }
-    for (i = fromIndex; i < len; i++) {
-      if (array.hasOwnProperty(i) && array[i] === elem) {
-        return i;
-      }
-    }
-    return -1;
-  };
-  var _prepClip = function(elements) {
-    if (typeof elements === "string") throw new TypeError("ZeroClipboard doesn't accept query strings.");
-    if (!elements.length) return [ elements ];
-    return elements;
-  };
-  var _dispatchCallback = function(func, context, args, async) {
-    if (async) {
-      window.setTimeout(function() {
-        func.apply(context, args);
-      }, 0);
-    } else {
-      func.apply(context, args);
-    }
-  };
-  var _getSafeZIndex = function(val) {
-    var zIndex, tmp;
-    if (val) {
-      if (typeof val === "number" && val > 0) {
-        zIndex = val;
-      } else if (typeof val === "string" && (tmp = parseInt(val, 10)) && !isNaN(tmp) && tmp > 0) {
-        zIndex = tmp;
-      }
-    }
-    if (!zIndex) {
-      if (typeof _globalConfig.zIndex === "number" && _globalConfig.zIndex > 0) {
-        zIndex = _globalConfig.zIndex;
-      } else if (typeof _globalConfig.zIndex === "string" && (tmp = parseInt(_globalConfig.zIndex, 10)) && !isNaN(tmp) && tmp > 0) {
-        zIndex = tmp;
-      }
-    }
-    return zIndex || 0;
-  };
-  var _deprecationWarning = function(deprecatedApiName, debugEnabled) {
-    if (deprecatedApiName && debugEnabled !== false && typeof console !== "undefined" && console && (console.warn || console.log)) {
-      var deprecationWarning = "`" + deprecatedApiName + "` is deprecated. See docs for more info:\n" + "    https://github.com/zeroclipboard/zeroclipboard/blob/master/docs/instructions.md#deprecations";
-      if (console.warn) {
-        console.warn(deprecationWarning);
-      } else {
-        console.log(deprecationWarning);
-      }
-    }
-  };
-  var _extend = function() {
-    var i, len, arg, prop, src, copy, target = arguments[0] || {};
-    for (i = 1, len = arguments.length; i < len; i++) {
-      if ((arg = arguments[i]) != null) {
-        for (prop in arg) {
-          if (arg.hasOwnProperty(prop)) {
-            src = target[prop];
-            copy = arg[prop];
-            if (target === copy) {
-              continue;
-            }
-            if (copy !== undefined) {
-              target[prop] = copy;
-            }
-          }
-        }
-      }
-    }
-    return target;
-  };
-  var _extractDomain = function(originOrUrl) {
-    if (originOrUrl == null || originOrUrl === "") {
-      return null;
-    }
-    originOrUrl = originOrUrl.replace(/^\s+|\s+$/g, "");
-    if (originOrUrl === "") {
-      return null;
-    }
-    var protocolIndex = originOrUrl.indexOf("//");
-    originOrUrl = protocolIndex === -1 ? originOrUrl : originOrUrl.slice(protocolIndex + 2);
-    var pathIndex = originOrUrl.indexOf("/");
-    originOrUrl = pathIndex === -1 ? originOrUrl : protocolIndex === -1 || pathIndex === 0 ? null : originOrUrl.slice(0, pathIndex);
-    if (originOrUrl && originOrUrl.slice(-4).toLowerCase() === ".swf") {
-      return null;
-    }
-    return originOrUrl || null;
-  };
-  var _determineScriptAccess = function() {
-    var _extractAllDomains = function(origins, resultsArray) {
-      var i, len, tmp;
-      if (origins != null && resultsArray[0] !== "*") {
-        if (typeof origins === "string") {
-          origins = [ origins ];
-        }
-        if (typeof origins === "object" && "length" in origins) {
-          for (i = 0, len = origins.length; i < len; i++) {
-            if (origins.hasOwnProperty(i)) {
-              tmp = _extractDomain(origins[i]);
-              if (tmp) {
-                if (tmp === "*") {
-                  resultsArray.length = 0;
-                  resultsArray.push("*");
-                  break;
-                }
-                if (_inArray(tmp, resultsArray) === -1) {
-                  resultsArray.push(tmp);
-                }
-              }
-            }
-          }
-        }
-      }
-    };
-    var _accessLevelLookup = {
-      always: "always",
-      samedomain: "sameDomain",
-      never: "never"
-    };
-    return function(currentDomain, configOptions) {
-      var asaLower, allowScriptAccess = configOptions.allowScriptAccess;
-      if (typeof allowScriptAccess === "string" && (asaLower = allowScriptAccess.toLowerCase()) && /^always|samedomain|never$/.test(asaLower)) {
-        return _accessLevelLookup[asaLower];
-      }
-      var swfDomain = _extractDomain(configOptions.moviePath);
-      if (swfDomain === null) {
-        swfDomain = currentDomain;
-      }
-      var trustedDomains = [];
-      _extractAllDomains(configOptions.trustedOrigins, trustedDomains);
-      _extractAllDomains(configOptions.trustedDomains, trustedDomains);
-      var len = trustedDomains.length;
-      if (len > 0) {
-        if (len === 1 && trustedDomains[0] === "*") {
-          return "always";
-        }
-        if (_inArray(currentDomain, trustedDomains) !== -1) {
-          if (len === 1 && currentDomain === swfDomain) {
-            return "sameDomain";
-          }
-          return "always";
-        }
-      }
-      return "never";
-    };
-  }();
-  var _objectKeys = function(obj) {
-    if (obj == null) {
-      return [];
-    }
-    if (Object.keys) {
-      return Object.keys(obj);
-    }
-    var keys = [];
-    for (var prop in obj) {
-      if (obj.hasOwnProperty(prop)) {
-        keys.push(prop);
-      }
-    }
-    return keys;
-  };
-  var _deleteOwnProperties = function(obj) {
-    if (obj) {
-      for (var prop in obj) {
-        if (obj.hasOwnProperty(prop)) {
-          delete obj[prop];
-        }
-      }
-    }
-    return obj;
-  };
-  var _detectFlashSupport = function() {
-    var hasFlash = false;
-    if (typeof flashState.disabled === "boolean") {
-      hasFlash = flashState.disabled === false;
-    } else {
-      if (typeof ActiveXObject === "function") {
-        try {
-          if (new ActiveXObject("ShockwaveFlash.ShockwaveFlash")) {
-            hasFlash = true;
-          }
-        } catch (error) {}
-      }
-      if (!hasFlash && navigator.mimeTypes["application/x-shockwave-flash"]) {
-        hasFlash = true;
-      }
-    }
-    return hasFlash;
-  };
-  function _parseFlashVersion(flashVersion) {
-    return flashVersion.replace(/,/g, ".").replace(/[^0-9\.]/g, "");
-  }
-  function _isFlashVersionSupported(flashVersion) {
-    return parseFloat(_parseFlashVersion(flashVersion)) >= 10;
-  }
-  var ZeroClipboard = function(elements, options) {
-    if (!(this instanceof ZeroClipboard)) {
-      return new ZeroClipboard(elements, options);
-    }
-    this.id = "" + clientIdCounter++;
-    _clientMeta[this.id] = {
-      instance: this,
-      elements: [],
-      handlers: {}
-    };
-    if (elements) {
-      this.clip(elements);
-    }
-    if (typeof options !== "undefined") {
-      _deprecationWarning("new ZeroClipboard(elements, options)", _globalConfig.debug);
-      ZeroClipboard.config(options);
-    }
-    this.options = ZeroClipboard.config();
-    if (typeof flashState.disabled !== "boolean") {
-      flashState.disabled = !_detectFlashSupport();
-    }
-    if (flashState.disabled === false && flashState.outdated !== true) {
-      if (flashState.bridge === null) {
-        flashState.outdated = false;
-        flashState.ready = false;
-        _bridge();
-      }
-    }
-  };
-  ZeroClipboard.prototype.setText = function(newText) {
-    if (newText && newText !== "") {
-      _clipData["text/plain"] = newText;
-      if (flashState.ready === true && flashState.bridge) {
-        flashState.bridge.setText(newText);
-      } else {}
-    }
-    return this;
-  };
-  ZeroClipboard.prototype.setSize = function(width, height) {
-    if (flashState.ready === true && flashState.bridge) {
-      flashState.bridge.setSize(width, height);
-    } else {}
-    return this;
-  };
-  var _setHandCursor = function(enabled) {
-    if (flashState.ready === true && flashState.bridge) {
-      flashState.bridge.setHandCursor(enabled);
-    } else {}
-  };
-  ZeroClipboard.prototype.destroy = function() {
-    this.unclip();
-    this.off();
-    delete _clientMeta[this.id];
-  };
-  var _getAllClients = function() {
-    var i, len, client, clients = [], clientIds = _objectKeys(_clientMeta);
-    for (i = 0, len = clientIds.length; i < len; i++) {
-      client = _clientMeta[clientIds[i]].instance;
-      if (client && client instanceof ZeroClipboard) {
-        clients.push(client);
-      }
-    }
-    return clients;
-  };
-  ZeroClipboard.version = "1.3.1";
-  var _globalConfig = {
-    swfPath: _swfPath,
-    trustedDomains: window.location.host ? [ window.location.host ] : [],
-    cacheBust: true,
-    forceHandCursor: false,
-    zIndex: 999999999,
-    debug: true,
-    title: null,
-    autoActivate: true
-  };
-  ZeroClipboard.config = function(options) {
-    if (typeof options === "object" && options !== null) {
-      _extend(_globalConfig, options);
-    }
-    if (typeof options === "string" && options) {
-      if (_globalConfig.hasOwnProperty(options)) {
-        return _globalConfig[options];
-      }
-      return;
-    }
-    var copy = {};
-    for (var prop in _globalConfig) {
-      if (_globalConfig.hasOwnProperty(prop)) {
-        if (typeof _globalConfig[prop] === "object" && _globalConfig[prop] !== null) {
-          if ("length" in _globalConfig[prop]) {
-            copy[prop] = _globalConfig[prop].slice(0);
-          } else {
-            copy[prop] = _extend({}, _globalConfig[prop]);
-          }
-        } else {
-          copy[prop] = _globalConfig[prop];
-        }
-      }
-    }
-    return copy;
-  };
-  ZeroClipboard.destroy = function() {
-    ZeroClipboard.deactivate();
-    for (var clientId in _clientMeta) {
-      if (_clientMeta.hasOwnProperty(clientId) && _clientMeta[clientId]) {
-        var client = _clientMeta[clientId].instance;
-        if (client && typeof client.destroy === "function") {
-          client.destroy();
-        }
-      }
-    }
-    var htmlBridge = _getHtmlBridge(flashState.bridge);
-    if (htmlBridge && htmlBridge.parentNode) {
-      htmlBridge.parentNode.removeChild(htmlBridge);
-      flashState.ready = null;
-      flashState.bridge = null;
-    }
-  };
-  ZeroClipboard.activate = function(element) {
-    if (currentElement) {
-      _removeClass(currentElement, _globalConfig.hoverClass);
-      _removeClass(currentElement, _globalConfig.activeClass);
-    }
-    currentElement = element;
-    _addClass(element, _globalConfig.hoverClass);
-    _reposition();
-    var newTitle = _globalConfig.title || element.getAttribute("title");
-    if (newTitle) {
-      var htmlBridge = _getHtmlBridge(flashState.bridge);
-      if (htmlBridge) {
-        htmlBridge.setAttribute("title", newTitle);
-      }
-    }
-    var useHandCursor = _globalConfig.forceHandCursor === true || _getStyle(element, "cursor") === "pointer";
-    _setHandCursor(useHandCursor);
-  };
-  ZeroClipboard.deactivate = function() {
-    var htmlBridge = _getHtmlBridge(flashState.bridge);
-    if (htmlBridge) {
-      htmlBridge.style.left = "0px";
-      htmlBridge.style.top = "-9999px";
-      htmlBridge.removeAttribute("title");
-    }
-    if (currentElement) {
-      _removeClass(currentElement, _globalConfig.hoverClass);
-      _removeClass(currentElement, _globalConfig.activeClass);
-      currentElement = null;
-    }
-  };
-  var _bridge = function() {
-    var flashBridge, len;
-    var container = document.getElementById("global-zeroclipboard-html-bridge");
-    if (!container) {
-      var opts = ZeroClipboard.config();
-      opts.jsModuleId = typeof _amdModuleId === "string" && _amdModuleId || typeof _cjsModuleId === "string" && _cjsModuleId || null;
-      var allowScriptAccess = _determineScriptAccess(window.location.host, _globalConfig);
-      var flashvars = _vars(opts);
-      var swfUrl = _globalConfig.moviePath + _cacheBust(_globalConfig.moviePath, _globalConfig);
-      var html = '      <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" id="global-zeroclipboard-flash-bridge" width="100%" height="100%">         <param name="movie" value="' + swfUrl + '"/>         <param name="allowScriptAccess" value="' + allowScriptAccess + '"/>         <param name="scale" value="exactfit"/>         <param name="loop" value="false"/>         <param name="menu" value="false"/>         <param name="quality" value="best" />         <param name="bgcolor" value="#ffffff"/>         <param name="wmode" value="transparent"/>         <param name="flashvars" value="' + flashvars + '"/>         <embed src="' + swfUrl + '"           loop="false" menu="false"           quality="best" bgcolor="#ffffff"           width="100%" height="100%"           name="global-zeroclipboard-flash-bridge"           allowScriptAccess="' + allowScriptAccess + '"           allowFullScreen="false"           type="application/x-shockwave-flash"           wmode="transparent"          
  pluginspage="http://www.macromedia.com/go/getflashplayer"           flashvars="' + flashvars + '"           scale="exactfit">         </embed>       </object>';
-      container = document.createElement("div");
-      container.id = "global-zeroclipboard-html-bridge";
-      container.setAttribute("class", "global-zeroclipboard-container");
-      container.style.position = "absolute";
-      container.style.left = "0px";
-      container.style.top = "-9999px";
-      container.style.width = "15px";
-      container.style.height = "15px";
-      container.style.zIndex = "" + _getSafeZIndex(_globalConfig.zIndex);
-      document.body.appendChild(container);
-      container.innerHTML = html;
-    }
-    flashBridge = document["global-zeroclipboard-flash-bridge"];
-    if (flashBridge && (len = flashBridge.length)) {
-      flashBridge = flashBridge[len - 1];
-    }
-    flashState.bridge = flashBridge || container.children[0].lastElementChild;
-  };
-  var _getHtmlBridge = function(flashBridge) {
-    var isFlashElement = /^OBJECT|EMBED$/;
-    var htmlBridge = flashBridge && flashBridge.parentNode;
-    while (htmlBridge && isFlashElement.test(htmlBridge.nodeName) && htmlBridge.parentNode) {
-      htmlBridge = htmlBridge.parentNode;
-    }
-    return htmlBridge || null;
-  };
-  var _reposition = function() {
-    if (currentElement) {
-      var pos = _getDOMObjectPosition(currentElement, _globalConfig.zIndex);
-      var htmlBridge = _getHtmlBridge(flashState.bridge);
-      if (htmlBridge) {
-        htmlBridge.style.top = pos.top + "px";
-        htmlBridge.style.left = pos.left + "px";
-        htmlBridge.style.width = pos.width + "px";
-        htmlBridge.style.height = pos.height + "px";
-        htmlBridge.style.zIndex = pos.zIndex + 1;
-      }
-      if (flashState.ready === true && flashState.bridge) {
-        flashState.bridge.setSize(pos.width, pos.height);
-      }
-    }
-    return this;
-  };
-  ZeroClipboard.prototype.on = function(eventName, func) {
-    var i, len, events, added = {}, handlers = _clientMeta[this.id] && _clientMeta[this.id].handlers;
-    if (typeof eventName === "string" && eventName) {
-      events = eventName.toLowerCase().split(/\s+/);
-    } else if (typeof eventName === "object" && eventName && typeof func === "undefined") {
-      for (i in eventName) {
-        if (eventName.hasOwnProperty(i) && typeof i === "string" && i && typeof eventName[i] === "function") {
-          this.on(i, eventName[i]);
-        }
-      }
-    }
-    if (events && events.length) {
-      for (i = 0, len = events.length; i < len; i++) {
-        eventName = events[i].replace(/^on/, "");
-        added[eventName] = true;
-        if (!handlers[eventName]) {
-          handlers[eventName] = [];
-        }
-        handlers[eventName].push(func);
-      }
-      if (added.noflash && flashState.disabled) {
-        _receiveEvent.call(this, "noflash", {});
-      }
-      if (added.wrongflash && flashState.outdated) {
-        _receiveEvent.call(this, "wrongflash", {
-          flashVersion: flashState.version
-        });
-      }
-      if (added.load && flashState.ready) {
-        _receiveEvent.call(this, "load", {
-          flashVersion: flashState.version
-        });
-      }
-    }
-    return this;
-  };
-  ZeroClipboard.prototype.off = function(eventName, func) {
-    var i, len, foundIndex, events, perEventHandlers, handlers = _clientMeta[this.id] && _clientMeta[this.id].handlers;
-    if (arguments.length === 0) {
-      events = _objectKeys(handlers);
-    } else if (typeof eventName === "string" && eventName) {
-      events = eventName.split(/\s+/);
-    } else if (typeof eventName === "object" && eventName && typeof func === "undefined") {
-      for (i in eventName) {
-        if (eventName.hasOwnProperty(i) && typeof i === "string" && i && typeof eventName[i] === "function") {
-          this.off(i, eventName[i]);
-        }
-      }
-    }
-    if (events && events.length) {
-      for (i = 0, len = events.length; i < len; i++) {
-        eventName = events[i].toLowerCase().replace(/^on/, "");
-        perEventHandlers = handlers[eventName];
-        if (perEventHandlers && perEventHandlers.length) {
-          if (func) {
-            foundIndex = _inArray(func, perEventHandlers);
-            while (foundIndex !== -1) {
-              perEventHandlers.splice(foundIndex, 1);
-              foundIndex = _inArray(func, perEventHandlers, foundIndex);
-            }
-          } else {
-            handlers[eventName].length = 0;
-          }
-        }
-      }
-    }
-    return this;
-  };
-  ZeroClipboard.prototype.handlers = function(eventName) {
-    var prop, copy = null, handlers = _clientMeta[this.id] && _clientMeta[this.id].handlers;
-    if (handlers) {
-      if (typeof eventName === "string" && eventName) {
-        return handlers[eventName] ? handlers[eventName].slice(0) : null;
-      }
-      copy = {};
-      for (prop in handlers) {
-        if (handlers.hasOwnProperty(prop) && handlers[prop]) {
-          copy[prop] = handlers[prop].slice(0);
-        }
-      }
-    }
-    return copy;
-  };
-  var _dispatchClientCallbacks = function(eventName, context, args, async) {
-    var handlers = _clientMeta[this.id] && _clientMeta[this.id].handlers[eventName];
-    if (handlers && handlers.length) {
-      var i, len, func, originalContext = context || this;
-      for (i = 0, len = handlers.length; i < len; i++) {
-        func = handlers[i];
-        context = originalContext;
-        if (typeof func === "string" && typeof window[func] === "function") {
-          func = window[func];
-        }
-        if (typeof func === "object" && func && typeof func.handleEvent === "function") {
-          context = func;
-          func = func.handleEvent;
-        }
-        if (typeof func === "function") {
-          _dispatchCallback(func, context, args, async);
-        }
-      }
-    }
-    return this;
-  };
-  ZeroClipboard.prototype.clip = function(elements) {
-    elements = _prepClip(elements);
-    for (var i = 0; i < elements.length; i++) {
-      if (elements.hasOwnProperty(i) && elements[i] && elements[i].nodeType === 1) {
-        if (!elements[i].zcClippingId) {
-          elements[i].zcClippingId = "zcClippingId_" + elementIdCounter++;
-          _elementMeta[elements[i].zcClippingId] = [ this.id ];
-          if (_globalConfig.autoActivate === true) {
-            _addEventHandler(elements[i], "mouseover", _elementMouseOver);
-          }
-        } else if (_inArray(this.id, _elementMeta[elements[i].zcClippingId]) === -1) {
-          _elementMeta[elements[i].zcClippingId].push(this.id);
-        }
-        var clippedElements = _clientMeta[this.id].elements;
-        if (_inArray(elements[i], clippedElements) === -1) {
-          clippedElements.push(elements[i]);
-        }
-      }
-    }
-    return this;
-  };
-  ZeroClipboard.prototype.unclip = function(elements) {
-    var meta = _clientMeta[this.id];
-    if (meta) {
-      var clippedElements = meta.elements;
-      var arrayIndex;
-      if (typeof elements === "undefined") {
-        elements = clippedElements.slice(0);
-      } else {
-        elements = _prepClip(elements);
-      }
-      for (var i = elements.length; i--; ) {
-        if (elements.hasOwnProperty(i) && elements[i] && elements[i].nodeType === 1) {
-          arrayIndex = 0;
-          while ((arrayIndex = _inArray(elements[i], clippedElements, arrayIndex)) !== -1) {
-            clippedElements.splice(arrayIndex, 1);
-          }
-          var clientIds = _elementMeta[elements[i].zcClippingId];
-          if (clientIds) {
-            arrayIndex = 0;
-            while ((arrayIndex = _inArray(this.id, clientIds, arrayIndex)) !== -1) {
-              clientIds.splice(arrayIndex, 1);
-            }
-            if (clientIds.length === 0) {
-              if (_globalConfig.autoActivate === true) {
-                _removeEventHandler(elements[i], "mouseover", _elementMouseOver);
-              }
-              delete elements[i].zcClippingId;
-            }
-          }
-        }
-      }
-    }
-    return this;
-  };
-  ZeroClipboard.prototype.elements = function() {
-    var meta = _clientMeta[this.id];
-    return meta && meta.elements ? meta.elements.slice(0) : [];
-  };
-  var _getAllClientsClippedToElement = function(element) {
-    var elementMetaId, clientIds, i, len, client, clients = [];
-    if (element && element.nodeType === 1 && (elementMetaId = element.zcClippingId) && _elementMeta.hasOwnProperty(elementMetaId)) {
-      clientIds = _elementMeta[elementMetaId];
-      if (clientIds && clientIds.length) {
-        for (i = 0, len = clientIds.length; i < len; i++) {
-          client = _clientMeta[clientIds[i]].instance;
-          if (client && client instanceof ZeroClipboard) {
-            clients.push(client);
-          }
-        }
-      }
-    }
-    return clients;
-  };
-  _globalConfig.hoverClass = "zeroclipboard-is-hover";
-  _globalConfig.activeClass = "zeroclipboard-is-active";
-  _globalConfig.trustedOrigins = null;
-  _globalConfig.allowScriptAccess = null;
-  _globalConfig.useNoCache = true;
-  _globalConfig.moviePath = "ZeroClipboard.swf";
-  ZeroClipboard.detectFlashSupport = function() {
-    _deprecationWarning("ZeroClipboard.detectFlashSupport", _globalConfig.debug);
-    return _detectFlashSupport();
-  };
-  ZeroClipboard.dispatch = function(eventName, args) {
-    if (typeof eventName === "string" && eventName) {
-      var cleanEventName = eventName.toLowerCase().replace(/^on/, "");
-      if (cleanEventName) {
-        var clients = currentElement ? _getAllClientsClippedToElement(currentElement) : _getAllClients();
-        for (var i = 0, len = clients.length; i < len; i++) {
-          _receiveEvent.call(clients[i], cleanEventName, args);
-        }
-      }
-    }
-  };
-  ZeroClipboard.prototype.setHandCursor = function(enabled) {
-    _deprecationWarning("ZeroClipboard.prototype.setHandCursor", _globalConfig.debug);
-    enabled = typeof enabled === "boolean" ? enabled : !!enabled;
-    _setHandCursor(enabled);
-    _globalConfig.forceHandCursor = enabled;
-    return this;
-  };
-  ZeroClipboard.prototype.reposition = function() {
-    _deprecationWarning("ZeroClipboard.prototype.reposition", _globalConfig.debug);
-    return _reposition();
-  };
-  ZeroClipboard.prototype.receiveEvent = function(eventName, args) {
-    _deprecationWarning("ZeroClipboard.prototype.receiveEvent", _globalConfig.debug);
-    if (typeof eventName === "string" && eventName) {
-      var cleanEventName = eventName.toLowerCase().replace(/^on/, "");
-      if (cleanEventName) {
-        _receiveEvent.call(this, cleanEventName, args);
-      }
-    }
-  };
-  ZeroClipboard.prototype.setCurrent = function(element) {
-    _deprecationWarning("ZeroClipboard.prototype.setCurrent", _globalConfig.debug);
-    ZeroClipboard.activate(element);
-    return this;
-  };
-  ZeroClipboard.prototype.resetBridge = function() {
-    _deprecationWarning("ZeroClipboard.prototype.resetBridge", _globalConfig.debug);
-    ZeroClipboard.deactivate();
-    return this;
-  };
-  ZeroClipboard.prototype.setTitle = function(newTitle) {
-    _deprecationWarning("ZeroClipboard.prototype.setTitle", _globalConfig.debug);
-    newTitle = newTitle || _globalConfig.title || currentElement && currentElement.getAttribute("title");
-    if (newTitle) {
-      var htmlBridge = _getHtmlBridge(flashState.bridge);
-      if (htmlBridge) {
-        htmlBridge.setAttribute("title", newTitle);
-      }
-    }
-    return this;
-  };
-  ZeroClipboard.setDefaults = function(options) {
-    _deprecationWarning("ZeroClipboard.setDefaults", _globalConfig.debug);
-    ZeroClipboard.config(options);
-  };
-  ZeroClipboard.prototype.addEventListener = function(eventName, func) {
-    _deprecationWarning("ZeroClipboard.prototype.addEventListener", _globalConfig.debug);
-    return this.on(eventName, func);
-  };
-  ZeroClipboard.prototype.removeEventListener = function(eventName, func) {
-    _deprecationWarning("ZeroClipboard.prototype.removeEventListener", _globalConfig.debug);
-    return this.off(eventName, func);
-  };
-  ZeroClipboard.prototype.ready = function() {
-    _deprecationWarning("ZeroClipboard.prototype.ready", _globalConfig.debug);
-    return flashState.ready === true;
-  };
-  var _receiveEvent = function(eventName, args) {
-    eventName = eventName.toLowerCase().replace(/^on/, "");
-    var cleanVersion = args && args.flashVersion && _parseFlashVersion(args.flashVersion) || null;
-    var element = currentElement;
-    var performCallbackAsync = true;
-    switch (eventName) {
-     case "load":
-      if (cleanVersion) {
-        if (!_isFlashVersionSupported(cleanVersion)) {
-          _receiveEvent.call(this, "onWrongFlash", {
-            flashVersion: cleanVersion
-          });
-          return;
-        }
-        flashState.outdated = false;
-        flashState.ready = true;
-        flashState.version = cleanVersion;
-      }
-      break;
-
-     case "wrongflash":
-      if (cleanVersion && !_isFlashVersionSupported(cleanVersion)) {
-        flashState.outdated = true;
-        flashState.ready = false;
-        flashState.version = cleanVersion;
-      }
-      break;
-
-     case "mouseover":
-      _addClass(element, _globalConfig.hoverClass);
-      break;
-
-     case "mouseout":
-      if (_globalConfig.autoActivate === true) {
-        ZeroClipboard.deactivate();
-      }
-      break;
-
-     case "mousedown":
-      _addClass(element, _globalConfig.activeClass);
-      break;
-
-     case "mouseup":
-      _removeClass(element, _globalConfig.activeClass);
-      break;
-
-     case "datarequested":
-      var targetId = element.getAttribute("data-clipboard-target"), targetEl = !targetId ? null : document.getElementById(targetId);
-      if (targetEl) {
-        var textContent = targetEl.value || targetEl.textContent || targetEl.innerText;
-        if (textContent) {
-          this.setText(textContent);
-        }
-      } else {
-        var defaultText = element.getAttribute("data-clipboard-text");
-        if (defaultText) {
-          this.setText(defaultText);
-        }
-      }
-      performCallbackAsync = false;
-      break;
-
-     case "complete":
-      _deleteOwnProperties(_clipData);
-      break;
-    }
-    var context = element;
-    var eventArgs = [ this, args ];
-    return _dispatchClientCallbacks.call(this, eventName, context, eventArgs, performCallbackAsync);
-  };
-  if (typeof define === "function" && define.amd) {
-    define([ "require", "exports", "module" ], function(require, exports, module) {
-      _amdModuleId = module && module.id || null;
-      return ZeroClipboard;
-    });
-  } else if (typeof module === "object" && module && typeof module.exports === "object" && module.exports) {
-    _cjsModuleId = module.id || null;
-    module.exports = ZeroClipboard;
-  } else {
-    window.ZeroClipboard = ZeroClipboard;
-  }
-})();

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/js/libs/async.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/js/libs/async.js b/brooklyn-ui/src/main/webapp/assets/js/libs/async.js
deleted file mode 100644
index 535b3b5..0000000
--- a/brooklyn-ui/src/main/webapp/assets/js/libs/async.js
+++ /dev/null
@@ -1,46 +0,0 @@
-/** 
- * FROM https://github.com/p15martin/google-maps-hello-world/blob/master/js/libs/async.js
- * ORIGINALLY https://github.com/millermedeiros/requirejs-plugins
- * 
- * @license
- * RequireJS plugin for async dependency load like JSONP and Google Maps
- * Author: Miller Medeiros
- * Version: 0.1.1 (2011/11/17)
- * Released under the MIT license
- */
-define(function(){
-
-    var DEFAULT_PARAM_NAME = 'callback',
-        _uid = 0;
-
-    function injectScript(src){
-        var s, t;
-        s = document.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = src;
-        t = document.getElementsByTagName('script')[0]; t.parentNode.insertBefore(s,t);
-    }
-
-    function formatUrl(name, id){
-        var paramRegex = /!(.+)/,
-            url = name.replace(paramRegex, ''),
-            param = (paramRegex.test(name))? name.replace(/.+!/, '') : DEFAULT_PARAM_NAME;
-        url += (url.indexOf('?') < 0)? '?' : '&';
-        return url + param +'='+ id;
-    }
-
-    function uid() {
-        _uid += 1;
-        return '__async_req_'+ _uid +'__';
-    }
-
-    return{
-        load : function(name, req, onLoad, config){
-            if(config.isBuild){
-                onLoad(null); //avoid errors on the optimizer
-            }else{
-                var id = uid();
-                window[id] = onLoad; //create a global variable that stores onLoad so callback function can define new module after async load
-                injectScript(formatUrl(name, id));
-            }
-        }
-    };
-});
\ No newline at end of file


[13/51] [abbrv] [partial] brooklyn-ui git commit: move subdir from incubator up a level as it is promoted to its own repo (first non-incubator commit!)

Posted by he...@apache.org.
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/js/libs/bootstrap.js
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/js/libs/bootstrap.js b/src/main/webapp/assets/js/libs/bootstrap.js
new file mode 100644
index 0000000..6bb52bc
--- /dev/null
+++ b/src/main/webapp/assets/js/libs/bootstrap.js
@@ -0,0 +1,1821 @@
+/* ===================================================
+ * bootstrap-transition.js v2.0.4
+ * http://twitter.github.com/bootstrap/javascript.html#transitions
+ * ===================================================
+ * Copyright 2012 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ========================================================== */
+
+
+!function ($) {
+
+  $(function () {
+
+    "use strict"; // jshint ;_;
+
+
+    /* CSS TRANSITION SUPPORT (http://www.modernizr.com/)
+     * ======================================================= */
+
+    $.support.transition = (function () {
+
+        // copied from bootstrap 2.1.1 - adds support for IE10+
+        function transitionEnd() {
+            var el = document.createElement('bootstrap')
+
+            var transEndEventNames = {
+              WebkitTransition : 'webkitTransitionEnd',
+              MozTransition    : 'transitionend',
+              OTransition      : 'oTransitionEnd otransitionend',
+              transition       : 'transitionend'
+            }
+
+            for (var name in transEndEventNames) {
+              if (el.style[name] !== undefined) {
+                return { end: transEndEventNames[name] }
+              }
+            }
+
+            return false // explicit for ie8 (  ._.)
+          }
+
+    })()
+
+  })
+
+}(window.jQuery);/* ==========================================================
+ * bootstrap-alert.js v2.0.4
+ * http://twitter.github.com/bootstrap/javascript.html#alerts
+ * ==========================================================
+ * Copyright 2012 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ========================================================== */
+
+
+!function ($) {
+
+  "use strict"; // jshint ;_;
+
+
+ /* ALERT CLASS DEFINITION
+  * ====================== */
+
+  var dismiss = '[data-dismiss="alert"]'
+    , Alert = function (el) {
+        $(el).on('click', dismiss, this.close)
+      }
+
+  Alert.prototype.close = function (e) {
+    var $this = $(this)
+      , selector = $this.attr('data-target')
+      , $parent
+
+    if (!selector) {
+      selector = $this.attr('href')
+      selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
+    }
+
+    $parent = $(selector)
+
+    e && e.preventDefault()
+
+    $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
+
+    $parent.trigger(e = $.Event('close'))
+
+    if (e.isDefaultPrevented()) return
+
+    $parent.removeClass('in')
+
+    function removeElement() {
+      $parent
+        .trigger('closed')
+        .remove()
+    }
+
+    $.support.transition && $parent.hasClass('fade') ?
+      $parent.on($.support.transition.end, removeElement) :
+      removeElement()
+  }
+
+
+ /* ALERT PLUGIN DEFINITION
+  * ======================= */
+
+  $.fn.alert = function (option) {
+    return this.each(function () {
+      var $this = $(this)
+        , data = $this.data('alert')
+      if (!data) $this.data('alert', (data = new Alert(this)))
+      if (typeof option == 'string') data[option].call($this)
+    })
+  }
+
+  $.fn.alert.Constructor = Alert
+
+
+ /* ALERT DATA-API
+  * ============== */
+
+  $(function () {
+    $('body').on('click.alert.data-api', dismiss, Alert.prototype.close)
+  })
+
+}(window.jQuery);/* ============================================================
+ * bootstrap-button.js v2.0.4
+ * http://twitter.github.com/bootstrap/javascript.html#buttons
+ * ============================================================
+ * Copyright 2012 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============================================================ */
+
+
+!function ($) {
+
+  "use strict"; // jshint ;_;
+
+
+ /* BUTTON PUBLIC CLASS DEFINITION
+  * ============================== */
+
+  var Button = function (element, options) {
+    this.$element = $(element)
+    this.options = $.extend({}, $.fn.button.defaults, options)
+  }
+
+  Button.prototype.setState = function (state) {
+    var d = 'disabled'
+      , $el = this.$element
+      , data = $el.data()
+      , val = $el.is('input') ? 'val' : 'html'
+
+    state = state + 'Text'
+    data.resetText || $el.data('resetText', $el[val]())
+
+    $el[val](data[state] || this.options[state])
+
+    // push to event loop to allow forms to submit
+    setTimeout(function () {
+      state == 'loadingText' ?
+        $el.addClass(d).attr(d, d) :
+        $el.removeClass(d).removeAttr(d)
+    }, 0)
+  }
+
+  Button.prototype.toggle = function () {
+    var $parent = this.$element.parent('[data-toggle="buttons-radio"]')
+
+    $parent && $parent
+      .find('.active')
+      .removeClass('active')
+
+    this.$element.toggleClass('active')
+  }
+
+
+ /* BUTTON PLUGIN DEFINITION
+  * ======================== */
+
+  $.fn.button = function (option) {
+    return this.each(function () {
+      var $this = $(this)
+        , data = $this.data('button')
+        , options = typeof option == 'object' && option
+      if (!data) $this.data('button', (data = new Button(this, options)))
+      if (option == 'toggle') data.toggle()
+      else if (option) data.setState(option)
+    })
+  }
+
+  $.fn.button.defaults = {
+    loadingText: 'loading...'
+  }
+
+  $.fn.button.Constructor = Button
+
+
+ /* BUTTON DATA-API
+  * =============== */
+
+  $(function () {
+    $('body').on('click.button.data-api', '[data-toggle^=button]', function ( e ) {
+      var $btn = $(e.target)
+      if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
+      $btn.button('toggle')
+    })
+  })
+
+}(window.jQuery);/* ==========================================================
+ * bootstrap-carousel.js v2.0.4
+ * http://twitter.github.com/bootstrap/javascript.html#carousel
+ * ==========================================================
+ * Copyright 2012 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ========================================================== */
+
+
+!function ($) {
+
+  "use strict"; // jshint ;_;
+
+
+ /* CAROUSEL CLASS DEFINITION
+  * ========================= */
+
+  var Carousel = function (element, options) {
+    this.$element = $(element)
+    this.options = options
+    this.options.slide && this.slide(this.options.slide)
+    this.options.pause == 'hover' && this.$element
+      .on('mouseenter', $.proxy(this.pause, this))
+      .on('mouseleave', $.proxy(this.cycle, this))
+  }
+
+  Carousel.prototype = {
+
+    cycle: function (e) {
+      if (!e) this.paused = false
+      this.options.interval
+        && !this.paused
+        && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
+      return this
+    }
+
+  , to: function (pos) {
+      var $active = this.$element.find('.active')
+        , children = $active.parent().children()
+        , activePos = children.index($active)
+        , that = this
+
+      if (pos > (children.length - 1) || pos < 0) return
+
+      if (this.sliding) {
+        return this.$element.one('slid', function () {
+          that.to(pos)
+        })
+      }
+
+      if (activePos == pos) {
+        return this.pause().cycle()
+      }
+
+      return this.slide(pos > activePos ? 'next' : 'prev', $(children[pos]))
+    }
+
+  , pause: function (e) {
+      if (!e) this.paused = true
+      clearInterval(this.interval)
+      this.interval = null
+      return this
+    }
+
+  , next: function () {
+      if (this.sliding) return
+      return this.slide('next')
+    }
+
+  , prev: function () {
+      if (this.sliding) return
+      return this.slide('prev')
+    }
+
+  , slide: function (type, next) {
+      var $active = this.$element.find('.active')
+        , $next = next || $active[type]()
+        , isCycling = this.interval
+        , direction = type == 'next' ? 'left' : 'right'
+        , fallback  = type == 'next' ? 'first' : 'last'
+        , that = this
+        , e = $.Event('slide')
+
+      this.sliding = true
+
+      isCycling && this.pause()
+
+      $next = $next.length ? $next : this.$element.find('.item')[fallback]()
+
+      if ($next.hasClass('active')) return
+
+      if ($.support.transition && this.$element.hasClass('slide')) {
+        this.$element.trigger(e)
+        if (e.isDefaultPrevented()) return
+        $next.addClass(type)
+        $next[0].offsetWidth // force reflow
+        $active.addClass(direction)
+        $next.addClass(direction)
+        this.$element.one($.support.transition.end, function () {
+          $next.removeClass([type, direction].join(' ')).addClass('active')
+          $active.removeClass(['active', direction].join(' '))
+          that.sliding = false
+          setTimeout(function () { that.$element.trigger('slid') }, 0)
+        })
+      } else {
+        this.$element.trigger(e)
+        if (e.isDefaultPrevented()) return
+        $active.removeClass('active')
+        $next.addClass('active')
+        this.sliding = false
+        this.$element.trigger('slid')
+      }
+
+      isCycling && this.cycle()
+
+      return this
+    }
+
+  }
+
+
+ /* CAROUSEL PLUGIN DEFINITION
+  * ========================== */
+
+  $.fn.carousel = function (option) {
+    return this.each(function () {
+      var $this = $(this)
+        , data = $this.data('carousel')
+        , options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option)
+      if (!data) $this.data('carousel', (data = new Carousel(this, options)))
+      if (typeof option == 'number') data.to(option)
+      else if (typeof option == 'string' || (option = options.slide)) data[option]()
+      else if (options.interval) data.cycle()
+    })
+  }
+
+  $.fn.carousel.defaults = {
+    interval: 5000
+  , pause: 'hover'
+  }
+
+  $.fn.carousel.Constructor = Carousel
+
+
+ /* CAROUSEL DATA-API
+  * ================= */
+
+  $(function () {
+    $('body').on('click.carousel.data-api', '[data-slide]', function ( e ) {
+      var $this = $(this), href
+        , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
+        , options = !$target.data('modal') && $.extend({}, $target.data(), $this.data())
+      $target.carousel(options)
+      e.preventDefault()
+    })
+  })
+
+}(window.jQuery);/* =============================================================
+ * bootstrap-collapse.js v2.0.4
+ * http://twitter.github.com/bootstrap/javascript.html#collapse
+ * =============================================================
+ * Copyright 2012 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============================================================ */
+
+
+!function ($) {
+
+  "use strict"; // jshint ;_;
+
+
+ /* COLLAPSE PUBLIC CLASS DEFINITION
+  * ================================ */
+
+  var Collapse = function (element, options) {
+    this.$element = $(element)
+    this.options = $.extend({}, $.fn.collapse.defaults, options)
+
+    if (this.options.parent) {
+      this.$parent = $(this.options.parent)
+    }
+
+    this.options.toggle && this.toggle()
+  }
+
+  Collapse.prototype = {
+
+    constructor: Collapse
+
+  , dimension: function () {
+      var hasWidth = this.$element.hasClass('width')
+      return hasWidth ? 'width' : 'height'
+    }
+
+  , show: function () {
+      var dimension
+        , scroll
+        , actives
+        , hasData
+
+      if (this.transitioning) return
+
+      dimension = this.dimension()
+      scroll = $.camelCase(['scroll', dimension].join('-'))
+      actives = this.$parent && this.$parent.find('> .accordion-group > .in')
+
+      if (actives && actives.length) {
+        hasData = actives.data('collapse')
+        if (hasData && hasData.transitioning) return
+        actives.collapse('hide')
+        hasData || actives.data('collapse', null)
+      }
+
+      this.$element[dimension](0)
+      this.transition('addClass', $.Event('show'), 'shown')
+      this.$element[dimension](this.$element[0][scroll])
+    }
+
+  , hide: function () {
+      var dimension
+      if (this.transitioning) return
+      dimension = this.dimension()
+      this.reset(this.$element[dimension]())
+      this.transition('removeClass', $.Event('hide'), 'hidden')
+      this.$element[dimension](0)
+    }
+
+  , reset: function (size) {
+      var dimension = this.dimension()
+
+      this.$element
+        .removeClass('collapse')
+        [dimension](size || 'auto')
+        [0].offsetWidth
+
+      this.$element[size !== null ? 'addClass' : 'removeClass']('collapse')
+
+      return this
+    }
+
+  , transition: function (method, startEvent, completeEvent) {
+      var that = this
+        , complete = function () {
+            if (startEvent.type == 'show') that.reset()
+            that.transitioning = 0
+            that.$element.trigger(completeEvent)
+          }
+
+      this.$element.trigger(startEvent)
+
+      if (startEvent.isDefaultPrevented()) return
+
+      this.transitioning = 1
+
+      this.$element[method]('in')
+
+      $.support.transition && this.$element.hasClass('collapse') ?
+        this.$element.one($.support.transition.end, complete) :
+        complete()
+    }
+
+  , toggle: function () {
+      this[this.$element.hasClass('in') ? 'hide' : 'show']()
+    }
+
+  }
+
+
+ /* COLLAPSIBLE PLUGIN DEFINITION
+  * ============================== */
+
+  $.fn.collapse = function (option) {
+    return this.each(function () {
+      var $this = $(this)
+        , data = $this.data('collapse')
+        , options = typeof option == 'object' && option
+      if (!data) $this.data('collapse', (data = new Collapse(this, options)))
+      if (typeof option == 'string') data[option]()
+    })
+  }
+
+  $.fn.collapse.defaults = {
+    toggle: true
+  }
+
+  $.fn.collapse.Constructor = Collapse
+
+
+ /* COLLAPSIBLE DATA-API
+  * ==================== */
+
+  $(function () {
+    $('body').on('click.collapse.data-api', '[data-toggle=collapse]', function ( e ) {
+      var $this = $(this), href
+        , target = $this.attr('data-target')
+          || e.preventDefault()
+          || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
+        , option = $(target).data('collapse') ? 'toggle' : $this.data()
+      $(target).collapse(option)
+    })
+  })
+
+}(window.jQuery);/* ============================================================
+ * bootstrap-dropdown.js v2.0.4
+ * http://twitter.github.com/bootstrap/javascript.html#dropdowns
+ * ============================================================
+ * Copyright 2012 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============================================================ */
+
+
+!function ($) {
+
+  "use strict"; // jshint ;_;
+
+
+ /* DROPDOWN CLASS DEFINITION
+  * ========================= */
+
+  var toggle = '[data-toggle="dropdown"]'
+    , Dropdown = function (element) {
+        var $el = $(element).on('click.dropdown.data-api', this.toggle)
+        $('html').on('click.dropdown.data-api', function () {
+          $el.parent().removeClass('open')
+        })
+      }
+
+  Dropdown.prototype = {
+
+    constructor: Dropdown
+
+  , toggle: function (e) {
+      var $this = $(this)
+        , $parent
+        , selector
+        , isActive
+
+      if ($this.is('.disabled, :disabled')) return
+
+      selector = $this.attr('data-target')
+
+      if (!selector) {
+        selector = $this.attr('href')
+        selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
+      }
+
+      $parent = $(selector)
+      $parent.length || ($parent = $this.parent())
+
+      isActive = $parent.hasClass('open')
+
+      clearMenus()
+
+      if (!isActive) $parent.toggleClass('open')
+
+      return false
+    }
+
+  }
+
+  function clearMenus() {
+    $(toggle).parent().removeClass('open')
+  }
+
+
+  /* DROPDOWN PLUGIN DEFINITION
+   * ========================== */
+
+  $.fn.dropdown = function (option) {
+    return this.each(function () {
+      var $this = $(this)
+        , data = $this.data('dropdown')
+      if (!data) $this.data('dropdown', (data = new Dropdown(this)))
+      if (typeof option == 'string') data[option].call($this)
+    })
+  }
+
+  $.fn.dropdown.Constructor = Dropdown
+
+
+  /* APPLY TO STANDARD DROPDOWN ELEMENTS
+   * =================================== */
+
+  $(function () {
+    $('html').on('click.dropdown.data-api', clearMenus)
+    $('body')
+      .on('click.dropdown', '.dropdown form', function (e) { e.stopPropagation() })
+      .on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle)
+  })
+
+}(window.jQuery);/* =========================================================
+ * bootstrap-modal.js v2.0.4
+ * http://twitter.github.com/bootstrap/javascript.html#modals
+ * =========================================================
+ * Copyright 2012 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ========================================================= */
+
+
+!function ($) {
+
+  "use strict"; // jshint ;_;
+
+
+ /* MODAL CLASS DEFINITION
+  * ====================== */
+
+  var Modal = function (content, options) {
+    this.options = options
+    this.$element = $(content)
+      .delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
+  }
+
+  Modal.prototype = {
+
+      constructor: Modal
+
+    , toggle: function () {
+        return this[!this.isShown ? 'show' : 'hide']()
+      }
+
+    , show: function () {
+        var that = this
+          , e = $.Event('show')
+
+        this.$element.trigger(e)
+
+        if (this.isShown || e.isDefaultPrevented()) return
+
+        $('body').addClass('modal-open')
+
+        this.isShown = true
+
+        escape.call(this)
+        backdrop.call(this, function () {
+          var transition = $.support.transition && that.$element.hasClass('fade')
+
+          if (!that.$element.parent().length) {
+            that.$element.appendTo(document.body) //don't move modals dom position
+          }
+
+          that.$element
+            .show()
+
+          if (transition) {
+            that.$element[0].offsetWidth // force reflow
+          }
+
+          that.$element.addClass('in')
+
+          transition ?
+            that.$element.one($.support.transition.end, function () { that.$element.trigger('shown') }) :
+            that.$element.trigger('shown')
+
+        })
+      }
+
+    , hide: function (e) {
+        e && e.preventDefault()
+
+        var that = this
+
+        e = $.Event('hide')
+
+        this.$element.trigger(e)
+
+        if (!this.isShown || e.isDefaultPrevented()) return
+
+        this.isShown = false
+
+        $('body').removeClass('modal-open')
+
+        escape.call(this)
+
+        this.$element.removeClass('in')
+
+        $.support.transition && this.$element.hasClass('fade') ?
+          hideWithTransition.call(this) :
+          hideModal.call(this)
+      }
+
+  }
+
+
+ /* MODAL PRIVATE METHODS
+  * ===================== */
+
+  function hideWithTransition() {
+    var that = this
+      , timeout = setTimeout(function () {
+          that.$element.off($.support.transition.end)
+          hideModal.call(that)
+        }, 500)
+
+    this.$element.one($.support.transition.end, function () {
+      clearTimeout(timeout)
+      hideModal.call(that)
+    })
+  }
+
+  function hideModal(that) {
+    this.$element
+      .hide()
+      .trigger('hidden')
+
+    backdrop.call(this)
+  }
+
+  function backdrop(callback) {
+    var that = this
+      , animate = this.$element.hasClass('fade') ? 'fade' : ''
+
+    if (this.isShown && this.options.backdrop) {
+      var doAnimate = $.support.transition && animate
+
+      this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
+        .appendTo(document.body)
+
+      if (this.options.backdrop != 'static') {
+        this.$backdrop.click($.proxy(this.hide, this))
+      }
+
+      if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
+
+      this.$backdrop.addClass('in')
+
+      doAnimate ?
+        this.$backdrop.one($.support.transition.end, callback) :
+        callback()
+
+    } else if (!this.isShown && this.$backdrop) {
+      this.$backdrop.removeClass('in')
+
+      $.support.transition && this.$element.hasClass('fade')?
+        this.$backdrop.one($.support.transition.end, $.proxy(removeBackdrop, this)) :
+        removeBackdrop.call(this)
+
+    } else if (callback) {
+      callback()
+    }
+  }
+
+  function removeBackdrop() {
+    this.$backdrop.remove()
+    this.$backdrop = null
+  }
+
+  function escape() {
+    var that = this
+    if (this.isShown && this.options.keyboard) {
+      $(document).on('keyup.dismiss.modal', function ( e ) {
+        e.which == 27 && that.hide()
+      })
+    } else if (!this.isShown) {
+      $(document).off('keyup.dismiss.modal')
+    }
+  }
+
+
+ /* MODAL PLUGIN DEFINITION
+  * ======================= */
+
+  $.fn.modal = function (option) {
+    return this.each(function () {
+      var $this = $(this)
+        , data = $this.data('modal')
+        , options = $.extend({}, $.fn.modal.defaults, $this.data(), typeof option == 'object' && option)
+      if (!data) $this.data('modal', (data = new Modal(this, options)))
+      if (typeof option == 'string') data[option]()
+      else if (options.show) data.show()
+    })
+  }
+
+  $.fn.modal.defaults = {
+      backdrop: true
+    , keyboard: true
+    , show: true
+  }
+
+  $.fn.modal.Constructor = Modal
+
+
+ /* MODAL DATA-API
+  * ============== */
+
+  $(function () {
+    $('body').on('click.modal.data-api', '[data-toggle="modal"]', function ( e ) {
+      var $this = $(this), href
+        , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
+        , option = $target.data('modal') ? 'toggle' : $.extend({}, $target.data(), $this.data())
+
+      e.preventDefault()
+      $target.modal(option)
+    })
+  })
+
+}(window.jQuery);/* ===========================================================
+ * bootstrap-tooltip.js v2.0.4
+ * http://twitter.github.com/bootstrap/javascript.html#tooltips
+ * Inspired by the original jQuery.tipsy by Jason Frame
+ * ===========================================================
+ * Copyright 2012 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ========================================================== */
+
+
+!function ($) {
+
+  "use strict"; // jshint ;_;
+
+
+ /* TOOLTIP PUBLIC CLASS DEFINITION
+  * =============================== */
+
+  var Tooltip = function (element, options) {
+    this.init('tooltip', element, options)
+  }
+
+  Tooltip.prototype = {
+
+    constructor: Tooltip
+
+  , init: function (type, element, options) {
+      var eventIn
+        , eventOut
+
+      this.type = type
+      this.$element = $(element)
+      this.options = this.getOptions(options)
+      this.enabled = true
+
+      if (this.options.trigger != 'manual') {
+        eventIn  = this.options.trigger == 'hover' ? 'mouseenter' : 'focus'
+        eventOut = this.options.trigger == 'hover' ? 'mouseleave' : 'blur'
+        this.$element.on(eventIn, this.options.selector, $.proxy(this.enter, this))
+        this.$element.on(eventOut, this.options.selector, $.proxy(this.leave, this))
+      }
+
+      this.options.selector ?
+        (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
+        this.fixTitle()
+    }
+
+  , getOptions: function (options) {
+      options = $.extend({}, $.fn[this.type].defaults, options, this.$element.data())
+
+      if (options.delay && typeof options.delay == 'number') {
+        options.delay = {
+          show: options.delay
+        , hide: options.delay
+        }
+      }
+
+      return options
+    }
+
+  , enter: function (e) {
+      var self = $(e.currentTarget)[this.type](this._options).data(this.type)
+
+      if (!self.options.delay || !self.options.delay.show) return self.show()
+
+      clearTimeout(this.timeout)
+      self.hoverState = 'in'
+      this.timeout = setTimeout(function() {
+        if (self.hoverState == 'in') self.show()
+      }, self.options.delay.show)
+    }
+
+  , leave: function (e) {
+      var self = $(e.currentTarget)[this.type](this._options).data(this.type)
+
+      if (this.timeout) clearTimeout(this.timeout)
+      if (!self.options.delay || !self.options.delay.hide) return self.hide()
+
+      self.hoverState = 'out'
+      this.timeout = setTimeout(function() {
+        if (self.hoverState == 'out') self.hide()
+      }, self.options.delay.hide)
+    }
+
+  , show: function () {
+      var $tip
+        , inside
+        , pos
+        , actualWidth
+        , actualHeight
+        , placement
+        , tp
+
+      if (this.hasContent() && this.enabled) {
+        $tip = this.tip()
+        this.setContent()
+
+        if (this.options.animation) {
+          $tip.addClass('fade')
+        }
+
+        placement = typeof this.options.placement == 'function' ?
+          this.options.placement.call(this, $tip[0], this.$element[0]) :
+          this.options.placement
+
+        inside = /in/.test(placement)
+
+        $tip
+          .remove()
+          .css({ top: 0, left: 0, display: 'block' })
+          .appendTo(inside ? this.$element : document.body)
+
+        pos = this.getPosition(inside)
+
+        actualWidth = $tip[0].offsetWidth
+        actualHeight = $tip[0].offsetHeight
+
+        switch (inside ? placement.split(' ')[1] : placement) {
+          case 'bottom':
+            tp = {top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2}
+            break
+          case 'top':
+            tp = {top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2}
+            break
+          case 'left':
+            tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth}
+            break
+          case 'right':
+            tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width}
+            break
+        }
+
+        $tip
+          .css(tp)
+          .addClass(placement)
+          .addClass('in')
+      }
+    }
+
+  , isHTML: function(text) {
+      // html string detection logic adapted from jQuery
+      return typeof text != 'string'
+        || ( text.charAt(0) === "<"
+          && text.charAt( text.length - 1 ) === ">"
+          && text.length >= 3
+        ) || /^(?:[^<]*<[\w\W]+>[^>]*$)/.exec(text)
+    }
+
+  , setContent: function () {
+      var $tip = this.tip()
+        , title = this.getTitle()
+
+      $tip.find('.tooltip-inner')[this.isHTML(title) ? 'html' : 'text'](title)
+      $tip.removeClass('fade in top bottom left right')
+    }
+
+  , hide: function () {
+      var that = this
+        , $tip = this.tip()
+
+      $tip.removeClass('in')
+
+      function removeWithAnimation() {
+        var timeout = setTimeout(function () {
+          $tip.off($.support.transition.end).remove()
+        }, 500)
+
+        $tip.one($.support.transition.end, function () {
+          clearTimeout(timeout)
+          $tip.remove()
+        })
+      }
+
+      $.support.transition && this.$tip.hasClass('fade') ?
+        removeWithAnimation() :
+        $tip.remove()
+    }
+
+  , fixTitle: function () {
+      var $e = this.$element
+      if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
+        $e.attr('data-original-title', $e.attr('title') || '').removeAttr('title')
+      }
+    }
+
+  , hasContent: function () {
+      return this.getTitle()
+    }
+
+  , getPosition: function (inside) {
+      return $.extend({}, (inside ? {top: 0, left: 0} : this.$element.offset()), {
+        width: this.$element[0].offsetWidth
+      , height: this.$element[0].offsetHeight
+      })
+    }
+
+  , getTitle: function () {
+      var title
+        , $e = this.$element
+        , o = this.options
+
+      title = $e.attr('data-original-title')
+        || (typeof o.title == 'function' ? o.title.call($e[0]) :  o.title)
+
+      return title
+    }
+
+  , tip: function () {
+      return this.$tip = this.$tip || $(this.options.template)
+    }
+
+  , validate: function () {
+      if (!this.$element[0].parentNode) {
+        this.hide()
+        this.$element = null
+        this.options = null
+      }
+    }
+
+  , enable: function () {
+      this.enabled = true
+    }
+
+  , disable: function () {
+      this.enabled = false
+    }
+
+  , toggleEnabled: function () {
+      this.enabled = !this.enabled
+    }
+
+  , toggle: function () {
+      this[this.tip().hasClass('in') ? 'hide' : 'show']()
+    }
+
+  }
+
+
+ /* TOOLTIP PLUGIN DEFINITION
+  * ========================= */
+
+  $.fn.tooltip = function ( option ) {
+    return this.each(function () {
+      var $this = $(this)
+        , data = $this.data('tooltip')
+        , options = typeof option == 'object' && option
+      if (!data) $this.data('tooltip', (data = new Tooltip(this, options)))
+      if (typeof option == 'string') data[option]()
+    })
+  }
+
+  $.fn.tooltip.Constructor = Tooltip
+
+  $.fn.tooltip.defaults = {
+    animation: true
+  , placement: 'top'
+  , selector: false
+  , template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
+  , trigger: 'hover'
+  , title: ''
+  , delay: 0
+  }
+
+}(window.jQuery);
+/* ===========================================================
+ * bootstrap-popover.js v2.0.4
+ * http://twitter.github.com/bootstrap/javascript.html#popovers
+ * ===========================================================
+ * Copyright 2012 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =========================================================== */
+
+
+!function ($) {
+
+  "use strict"; // jshint ;_;
+
+
+ /* POPOVER PUBLIC CLASS DEFINITION
+  * =============================== */
+
+  var Popover = function ( element, options ) {
+    this.init('popover', element, options)
+  }
+
+
+  /* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js
+     ========================================== */
+
+  Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype, {
+
+    constructor: Popover
+
+  , setContent: function () {
+      var $tip = this.tip()
+        , title = this.getTitle()
+        , content = this.getContent()
+
+      $tip.find('.popover-title')[this.isHTML(title) ? 'html' : 'text'](title)
+      $tip.find('.popover-content > *')[this.isHTML(content) ? 'html' : 'text'](content)
+
+      $tip.removeClass('fade top bottom left right in')
+    }
+
+  , hasContent: function () {
+      return this.getTitle() || this.getContent()
+    }
+
+  , getContent: function () {
+      var content
+        , $e = this.$element
+        , o = this.options
+
+      content = $e.attr('data-content')
+        || (typeof o.content == 'function' ? o.content.call($e[0]) :  o.content)
+
+      return content
+    }
+
+  , tip: function () {
+      if (!this.$tip) {
+        this.$tip = $(this.options.template)
+      }
+      return this.$tip
+    }
+
+  })
+
+
+ /* POPOVER PLUGIN DEFINITION
+  * ======================= */
+
+  $.fn.popover = function (option) {
+    return this.each(function () {
+      var $this = $(this)
+        , data = $this.data('popover')
+        , options = typeof option == 'object' && option
+      if (!data) $this.data('popover', (data = new Popover(this, options)))
+      if (typeof option == 'string') data[option]()
+    })
+  }
+
+  $.fn.popover.Constructor = Popover
+
+  $.fn.popover.defaults = $.extend({} , $.fn.tooltip.defaults, {
+    placement: 'right'
+  , content: ''
+  , template: '<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"><p></p></div></div></div>'
+  })
+
+}(window.jQuery);/* =============================================================
+ * bootstrap-scrollspy.js v2.0.4
+ * http://twitter.github.com/bootstrap/javascript.html#scrollspy
+ * =============================================================
+ * Copyright 2012 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============================================================== */
+
+
+!function ($) {
+
+  "use strict"; // jshint ;_;
+
+
+  /* SCROLLSPY CLASS DEFINITION
+   * ========================== */
+
+  function ScrollSpy( element, options) {
+    var process = $.proxy(this.process, this)
+      , $element = $(element).is('body') ? $(window) : $(element)
+      , href
+    this.options = $.extend({}, $.fn.scrollspy.defaults, options)
+    this.$scrollElement = $element.on('scroll.scroll.data-api', process)
+    this.selector = (this.options.target
+      || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
+      || '') + ' .nav li > a'
+    this.$body = $('body')
+    this.refresh()
+    this.process()
+  }
+
+  ScrollSpy.prototype = {
+
+      constructor: ScrollSpy
+
+    , refresh: function () {
+        var self = this
+          , $targets
+
+        this.offsets = $([])
+        this.targets = $([])
+
+        $targets = this.$body
+          .find(this.selector)
+          .map(function () {
+            var $el = $(this)
+              , href = $el.data('target') || $el.attr('href')
+              , $href = /^#\w/.test(href) && $(href)
+            return ( $href
+              && href.length
+              && [[ $href.position().top, href ]] ) || null
+          })
+          .sort(function (a, b) { return a[0] - b[0] })
+          .each(function () {
+            self.offsets.push(this[0])
+            self.targets.push(this[1])
+          })
+      }
+
+    , process: function () {
+        var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
+          , scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight
+          , maxScroll = scrollHeight - this.$scrollElement.height()
+          , offsets = this.offsets
+          , targets = this.targets
+          , activeTarget = this.activeTarget
+          , i
+
+        if (scrollTop >= maxScroll) {
+          return activeTarget != (i = targets.last()[0])
+            && this.activate ( i )
+        }
+
+        for (i = offsets.length; i--;) {
+          activeTarget != targets[i]
+            && scrollTop >= offsets[i]
+            && (!offsets[i + 1] || scrollTop <= offsets[i + 1])
+            && this.activate( targets[i] )
+        }
+      }
+
+    , activate: function (target) {
+        var active
+          , selector
+
+        this.activeTarget = target
+
+        $(this.selector)
+          .parent('.active')
+          .removeClass('active')
+
+        selector = this.selector
+          + '[data-target="' + target + '"],'
+          + this.selector + '[href="' + target + '"]'
+
+        active = $(selector)
+          .parent('li')
+          .addClass('active')
+
+        if (active.parent('.dropdown-menu'))  {
+          active = active.closest('li.dropdown').addClass('active')
+        }
+
+        active.trigger('activate')
+      }
+
+  }
+
+
+ /* SCROLLSPY PLUGIN DEFINITION
+  * =========================== */
+
+  $.fn.scrollspy = function ( option ) {
+    return this.each(function () {
+      var $this = $(this)
+        , data = $this.data('scrollspy')
+        , options = typeof option == 'object' && option
+      if (!data) $this.data('scrollspy', (data = new ScrollSpy(this, options)))
+      if (typeof option == 'string') data[option]()
+    })
+  }
+
+  $.fn.scrollspy.Constructor = ScrollSpy
+
+  $.fn.scrollspy.defaults = {
+    offset: 10
+  }
+
+
+ /* SCROLLSPY DATA-API
+  * ================== */
+
+  $(function () {
+    $('[data-spy="scroll"]').each(function () {
+      var $spy = $(this)
+      $spy.scrollspy($spy.data())
+    })
+  })
+
+}(window.jQuery);/* ========================================================
+ * bootstrap-tab.js v2.0.4
+ * http://twitter.github.com/bootstrap/javascript.html#tabs
+ * ========================================================
+ * Copyright 2012 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ======================================================== */
+
+
+!function ($) {
+
+  "use strict"; // jshint ;_;
+
+
+ /* TAB CLASS DEFINITION
+  * ==================== */
+
+  var Tab = function ( element ) {
+    this.element = $(element)
+  }
+
+  Tab.prototype = {
+
+    constructor: Tab
+
+  , show: function () {
+      var $this = this.element
+        , $ul = $this.closest('ul:not(.dropdown-menu)')
+        , selector = $this.attr('data-target')
+        , previous
+        , $target
+        , e
+
+      if (!selector) {
+        selector = $this.attr('href')
+        selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
+      }
+
+      if ( $this.parent('li').hasClass('active') ) return
+
+      previous = $ul.find('.active a').last()[0]
+
+      e = $.Event('show', {
+        relatedTarget: previous
+      })
+
+      $this.trigger(e)
+
+      if (e.isDefaultPrevented()) return
+
+      $target = $(selector)
+
+      this.activate($this.parent('li'), $ul)
+      this.activate($target, $target.parent(), function () {
+        $this.trigger({
+          type: 'shown'
+        , relatedTarget: previous
+        })
+      })
+    }
+
+  , activate: function ( element, container, callback) {
+      var $active = container.find('> .active')
+        , transition = callback
+            && $.support.transition
+            && $active.hasClass('fade')
+
+      function next() {
+        $active
+          .removeClass('active')
+          .find('> .dropdown-menu > .active')
+          .removeClass('active')
+
+        element.addClass('active')
+
+        if (transition) {
+          element[0].offsetWidth // reflow for transition
+          element.addClass('in')
+        } else {
+          element.removeClass('fade')
+        }
+
+        if ( element.parent('.dropdown-menu') ) {
+          element.closest('li.dropdown').addClass('active')
+        }
+
+        callback && callback()
+      }
+
+      transition ?
+        $active.one($.support.transition.end, next) :
+        next()
+
+      $active.removeClass('in')
+    }
+  }
+
+
+ /* TAB PLUGIN DEFINITION
+  * ===================== */
+
+  $.fn.tab = function ( option ) {
+    return this.each(function () {
+      var $this = $(this)
+        , data = $this.data('tab')
+      if (!data) $this.data('tab', (data = new Tab(this)))
+      if (typeof option == 'string') data[option]()
+    })
+  }
+
+  $.fn.tab.Constructor = Tab
+
+
+ /* TAB DATA-API
+  * ============ */
+
+  $(function () {
+    $('body').on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
+      e.preventDefault()
+      $(this).tab('show')
+    })
+  })
+
+}(window.jQuery);/* =============================================================
+ * bootstrap-typeahead.js v2.0.4
+ * http://twitter.github.com/bootstrap/javascript.html#typeahead
+ * =============================================================
+ * Copyright 2012 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============================================================ */
+
+
+!function($){
+
+  "use strict"; // jshint ;_;
+
+
+ /* TYPEAHEAD PUBLIC CLASS DEFINITION
+  * ================================= */
+
+  var Typeahead = function (element, options) {
+    this.$element = $(element)
+    this.options = $.extend({}, $.fn.typeahead.defaults, options)
+    this.matcher = this.options.matcher || this.matcher
+    this.sorter = this.options.sorter || this.sorter
+    this.highlighter = this.options.highlighter || this.highlighter
+    this.updater = this.options.updater || this.updater
+    this.$menu = $(this.options.menu).appendTo('body')
+    this.source = this.options.source
+    this.shown = false
+    this.listen()
+  }
+
+  Typeahead.prototype = {
+
+    constructor: Typeahead
+
+  , select: function () {
+      var val = this.$menu.find('.active').attr('data-value')
+      this.$element
+        .val(this.updater(val))
+        .change()
+      return this.hide()
+    }
+
+  , updater: function (item) {
+      return item
+    }
+
+  , show: function () {
+      var pos = $.extend({}, this.$element.offset(), {
+        height: this.$element[0].offsetHeight
+      })
+
+      this.$menu.css({
+        top: pos.top + pos.height
+      , left: pos.left
+      })
+
+      this.$menu.show()
+      this.shown = true
+      return this
+    }
+
+  , hide: function () {
+      this.$menu.hide()
+      this.shown = false
+      return this
+    }
+
+  , lookup: function (event) {
+      var that = this
+        , items
+        , q
+
+      this.query = this.$element.val()
+
+      if (!this.query) {
+        return this.shown ? this.hide() : this
+      }
+
+      items = $.grep(this.source, function (item) {
+        return that.matcher(item)
+      })
+
+      items = this.sorter(items)
+
+      if (!items.length) {
+        return this.shown ? this.hide() : this
+      }
+
+      return this.render(items.slice(0, this.options.items)).show()
+    }
+
+  , matcher: function (item) {
+      return ~item.toLowerCase().indexOf(this.query.toLowerCase())
+    }
+
+  , sorter: function (items) {
+      var beginswith = []
+        , caseSensitive = []
+        , caseInsensitive = []
+        , item
+
+      while (item = items.shift()) {
+        if (!item.toLowerCase().indexOf(this.query.toLowerCase())) beginswith.push(item)
+        else if (~item.indexOf(this.query)) caseSensitive.push(item)
+        else caseInsensitive.push(item)
+      }
+
+      return beginswith.concat(caseSensitive, caseInsensitive)
+    }
+
+  , highlighter: function (item) {
+      var query = this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&')
+      return item.replace(new RegExp('(' + query + ')', 'ig'), function ($1, match) {
+        return '<strong>' + match + '</strong>'
+      })
+    }
+
+  , render: function (items) {
+      var that = this
+
+      items = $(items).map(function (i, item) {
+        i = $(that.options.item).attr('data-value', item)
+        i.find('a').html(that.highlighter(item))
+        return i[0]
+      })
+
+      items.first().addClass('active')
+      this.$menu.html(items)
+      return this
+    }
+
+  , next: function (event) {
+      var active = this.$menu.find('.active').removeClass('active')
+        , next = active.next()
+
+      if (!next.length) {
+        next = $(this.$menu.find('li')[0])
+      }
+
+      next.addClass('active')
+    }
+
+  , prev: function (event) {
+      var active = this.$menu.find('.active').removeClass('active')
+        , prev = active.prev()
+
+      if (!prev.length) {
+        prev = this.$menu.find('li').last()
+      }
+
+      prev.addClass('active')
+    }
+
+  , listen: function () {
+      this.$element
+        .on('blur',     $.proxy(this.blur, this))
+        .on('keypress', $.proxy(this.keypress, this))
+        .on('keyup',    $.proxy(this.keyup, this))
+
+      if ($.browser.webkit || $.browser.msie) {
+        this.$element.on('keydown', $.proxy(this.keypress, this))
+      }
+
+      this.$menu
+        .on('click', $.proxy(this.click, this))
+        .on('mouseenter', 'li', $.proxy(this.mouseenter, this))
+    }
+
+  , keyup: function (e) {
+      switch(e.keyCode) {
+        case 40: // down arrow
+        case 38: // up arrow
+          break
+
+        case 9: // tab
+        case 13: // enter
+          if (!this.shown) return
+          this.select()
+          break
+
+        case 27: // escape
+          if (!this.shown) return
+          this.hide()
+          break
+
+        default:
+          this.lookup()
+      }
+
+      e.stopPropagation()
+      e.preventDefault()
+  }
+
+  , keypress: function (e) {
+      if (!this.shown) return
+
+      switch(e.keyCode) {
+        case 9: // tab
+        case 13: // enter
+        case 27: // escape
+          e.preventDefault()
+          break
+
+        case 38: // up arrow
+          if (e.type != 'keydown') break
+          e.preventDefault()
+          this.prev()
+          break
+
+        case 40: // down arrow
+          if (e.type != 'keydown') break
+          e.preventDefault()
+          this.next()
+          break
+      }
+
+      e.stopPropagation()
+    }
+
+  , blur: function (e) {
+      var that = this
+      setTimeout(function () { that.hide() }, 150)
+    }
+
+  , click: function (e) {
+      e.stopPropagation()
+      e.preventDefault()
+      this.select()
+    }
+
+  , mouseenter: function (e) {
+      this.$menu.find('.active').removeClass('active')
+      $(e.currentTarget).addClass('active')
+    }
+
+  }
+
+
+  /* TYPEAHEAD PLUGIN DEFINITION
+   * =========================== */
+
+  $.fn.typeahead = function (option) {
+    return this.each(function () {
+      var $this = $(this)
+        , data = $this.data('typeahead')
+        , options = typeof option == 'object' && option
+      if (!data) $this.data('typeahead', (data = new Typeahead(this, options)))
+      if (typeof option == 'string') data[option]()
+    })
+  }
+
+  $.fn.typeahead.defaults = {
+    source: []
+  , items: 8
+  , menu: '<ul class="typeahead dropdown-menu"></ul>'
+  , item: '<li><a href="#"></a></li>'
+  }
+
+  $.fn.typeahead.Constructor = Typeahead
+
+
+ /* TYPEAHEAD DATA-API
+  * ================== */
+
+  $(function () {
+    $('body').on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) {
+      var $this = $(this)
+      if ($this.data('typeahead')) return
+      e.preventDefault()
+      $this.typeahead($this.data())
+    })
+  })
+
+}(window.jQuery);
\ No newline at end of file


[48/51] [abbrv] [partial] brooklyn-ui git commit: move subdir from incubator up a level as it is promoted to its own repo (first non-incubator commit!)

Posted by he...@apache.org.
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/css/bootstrap.css
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/css/bootstrap.css b/brooklyn-ui/src/main/webapp/assets/css/bootstrap.css
deleted file mode 100644
index 107edf8..0000000
--- a/brooklyn-ui/src/main/webapp/assets/css/bootstrap.css
+++ /dev/null
@@ -1,5001 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-/*!
- * Bootstrap v2.0.4
- *
- * Copyright 2012 Twitter, Inc
- * Licensed under the Apache License v2.0
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Designed and built with all the love in the world @twitter by @mdo and @fat.
- */
-
-article,
-aside,
-details,
-figcaption,
-figure,
-footer,
-header,
-hgroup,
-nav,
-section {
-  display: block;
-}
-
-audio,
-canvas,
-video {
-  display: inline-block;
-  *display: inline;
-  *zoom: 1;
-}
-
-audio:not([controls]) {
-  display: none;
-}
-
-html {
-  font-size: 100%;
-  -webkit-text-size-adjust: 100%;
-      -ms-text-size-adjust: 100%;
-}
-
-a:focus {
-  outline: thin dotted #333;
-  outline: 5px auto -webkit-focus-ring-color;
-  outline-offset: -2px;
-}
-
-a:hover,
-a:active {
-  outline: 0;
-}
-
-sub,
-sup {
-  position: relative;
-  font-size: 75%;
-  line-height: 0;
-  vertical-align: baseline;
-}
-
-sup {
-  top: -0.5em;
-}
-
-sub {
-  bottom: -0.25em;
-}
-
-img {
-  max-width: 100%;
-  vertical-align: middle;
-  border: 0;
-  -ms-interpolation-mode: bicubic;
-}
-
-#map_canvas img {
-  max-width: none;
-}
-
-button,
-input,
-select,
-textarea {
-  margin: 0;
-  font-size: 100%;
-  vertical-align: middle;
-}
-
-button,
-input {
-  *overflow: visible;
-  line-height: normal;
-}
-
-button::-moz-focus-inner,
-input::-moz-focus-inner {
-  padding: 0;
-  border: 0;
-}
-
-button,
-input[type="button"],
-input[type="reset"],
-input[type="submit"] {
-  cursor: pointer;
-  -webkit-appearance: button;
-}
-
-input[type="search"] {
-  -webkit-box-sizing: content-box;
-     -moz-box-sizing: content-box;
-          box-sizing: content-box;
-  -webkit-appearance: textfield;
-}
-
-input[type="search"]::-webkit-search-decoration,
-input[type="search"]::-webkit-search-cancel-button {
-  -webkit-appearance: none;
-}
-
-textarea {
-  overflow: auto;
-  vertical-align: top;
-}
-
-.clearfix {
-  *zoom: 1;
-}
-
-.clearfix:before,
-.clearfix:after {
-  display: table;
-  content: "";
-}
-
-.clearfix:after {
-  clear: both;
-}
-
-.hide-text {
-  font: 0/0 a;
-  color: transparent;
-  text-shadow: none;
-  background-color: transparent;
-  border: 0;
-}
-
-.input-block-level {
-  display: block;
-  width: 100%;
-  min-height: 28px;
-  -webkit-box-sizing: border-box;
-     -moz-box-sizing: border-box;
-      -ms-box-sizing: border-box;
-          box-sizing: border-box;
-}
-
-body {
-  margin: 0;
-  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
-  font-size: 13px;
-  line-height: 18px;
-  color: #333333;
-  background-color: #ffffff;
-}
-
-a {
-  color: #0088cc;
-  text-decoration: none;
-}
-
-a:hover {
-  color: #005580;
-  text-decoration: underline;
-}
-
-.row {
-  margin-left: -20px;
-  *zoom: 1;
-}
-
-.row:before,
-.row:after {
-  display: table;
-  content: "";
-}
-
-.row:after {
-  clear: both;
-}
-
-[class*="span"] {
-  float: left;
-  margin-left: 20px;
-}
-
-.container,
-.navbar-fixed-top .container,
-.navbar-fixed-bottom .container {
-  width: 940px;
-}
-
-.span12 {
-  width: 940px;
-}
-
-.span11 {
-  width: 860px;
-}
-
-.span10 {
-  width: 780px;
-}
-
-.span9 {
-  width: 700px;
-}
-
-.span8 {
-  width: 620px;
-}
-
-.span7 {
-  width: 540px;
-}
-
-.span6 {
-  width: 460px;
-}
-
-.span5 {
-  width: 380px;
-}
-
-.span4 {
-  width: 300px;
-}
-
-.span3 {
-  width: 220px;
-}
-
-.span2 {
-  width: 140px;
-}
-
-.span1 {
-  width: 60px;
-}
-
-.offset12 {
-  margin-left: 980px;
-}
-
-.offset11 {
-  margin-left: 900px;
-}
-
-.offset10 {
-  margin-left: 820px;
-}
-
-.offset9 {
-  margin-left: 740px;
-}
-
-.offset8 {
-  margin-left: 660px;
-}
-
-.offset7 {
-  margin-left: 580px;
-}
-
-.offset6 {
-  margin-left: 500px;
-}
-
-.offset5 {
-  margin-left: 420px;
-}
-
-.offset4 {
-  margin-left: 340px;
-}
-
-.offset3 {
-  margin-left: 260px;
-}
-
-.offset2 {
-  margin-left: 180px;
-}
-
-.offset1 {
-  margin-left: 100px;
-}
-
-.row-fluid {
-  width: 100%;
-  *zoom: 1;
-}
-
-.row-fluid:before,
-.row-fluid:after {
-  display: table;
-  content: "";
-}
-
-.row-fluid:after {
-  clear: both;
-}
-
-.row-fluid [class*="span"] {
-  display: block;
-  float: left;
-  width: 100%;
-  min-height: 28px;
-  margin-left: 2.127659574%;
-  *margin-left: 2.0744680846382977%;
-  -webkit-box-sizing: border-box;
-     -moz-box-sizing: border-box;
-      -ms-box-sizing: border-box;
-          box-sizing: border-box;
-}
-
-.row-fluid [class*="span"]:first-child {
-  margin-left: 0;
-}
-
-.row-fluid .span12 {
-  width: 99.99999998999999%;
-  *width: 99.94680850063828%;
-}
-
-.row-fluid .span11 {
-  width: 91.489361693%;
-  *width: 91.4361702036383%;
-}
-
-.row-fluid .span10 {
-  width: 82.97872339599999%;
-  *width: 82.92553190663828%;
-}
-
-.row-fluid .span9 {
-  width: 74.468085099%;
-  *width: 74.4148936096383%;
-}
-
-.row-fluid .span8 {
-  width: 65.95744680199999%;
-  *width: 65.90425531263828%;
-}
-
-.row-fluid .span7 {
-  width: 57.446808505%;
-  *width: 57.3936170156383%;
-}
-
-.row-fluid .span6 {
-  width: 48.93617020799999%;
-  *width: 48.88297871863829%;
-}
-
-.row-fluid .span5 {
-  width: 40.425531911%;
-  *width: 40.3723404216383%;
-}
-
-.row-fluid .span4 {
-  width: 31.914893614%;
-  *width: 31.8617021246383%;
-}
-
-.row-fluid .span3 {
-  width: 23.404255317%;
-  *width: 23.3510638276383%;
-}
-
-.row-fluid .span2 {
-  width: 14.89361702%;
-  *width: 14.8404255306383%;
-}
-
-.row-fluid .span1 {
-  width: 6.382978723%;
-  *width: 6.329787233638298%;
-}
-
-.container {
-  margin-right: auto;
-  margin-left: auto;
-  *zoom: 1;
-}
-
-.container:before,
-.container:after {
-  display: table;
-  content: "";
-}
-
-.container:after {
-  clear: both;
-}
-
-.container-fluid {
-  padding-right: 20px;
-  padding-left: 20px;
-  *zoom: 1;
-}
-
-.container-fluid:before,
-.container-fluid:after {
-  display: table;
-  content: "";
-}
-
-.container-fluid:after {
-  clear: both;
-}
-
-p {
-  margin: 0 0 9px;
-}
-
-p small {
-  font-size: 11px;
-  color: #999999;
-}
-
-.lead {
-  margin-bottom: 18px;
-  font-size: 20px;
-  font-weight: 200;
-  line-height: 27px;
-}
-
-h1,
-h2,
-h3,
-h4,
-h5,
-h6 {
-  margin: 0;
-  font-family: inherit;
-  font-weight: bold;
-  color: inherit;
-  text-rendering: optimizelegibility;
-}
-
-h1 small,
-h2 small,
-h3 small,
-h4 small,
-h5 small,
-h6 small {
-  font-weight: normal;
-  color: #999999;
-}
-
-h1 {
-  font-size: 30px;
-  line-height: 36px;
-}
-
-h1 small {
-  font-size: 18px;
-}
-
-h2 {
-  font-size: 24px;
-  line-height: 36px;
-}
-
-h2 small {
-  font-size: 18px;
-}
-
-h3 {
-  font-size: 18px;
-  line-height: 27px;
-}
-
-h3 small {
-  font-size: 14px;
-}
-
-h4,
-h5,
-h6 {
-  line-height: 18px;
-}
-
-h4 {
-  font-size: 14px;
-}
-
-h4 small {
-  font-size: 12px;
-}
-
-h5 {
-  font-size: 12px;
-}
-
-h6 {
-  font-size: 11px;
-  color: #999999;
-  text-transform: uppercase;
-}
-
-.page-header {
-  padding-bottom: 17px;
-  margin: 18px 0;
-  border-bottom: 1px solid #eeeeee;
-}
-
-.page-header h1 {
-  line-height: 1;
-}
-
-ul,
-ol {
-  padding: 0;
-  margin: 0 0 9px 25px;
-}
-
-ul ul,
-ul ol,
-ol ol,
-ol ul {
-  margin-bottom: 0;
-}
-
-ul {
-  list-style: disc;
-}
-
-ol {
-  list-style: decimal;
-}
-
-li {
-  line-height: 18px;
-}
-
-ul.unstyled,
-ol.unstyled {
-  margin-left: 0;
-  list-style: none;
-}
-
-dl {
-  margin-bottom: 18px;
-}
-
-dt,
-dd {
-  line-height: 18px;
-}
-
-dt {
-  font-weight: bold;
-  line-height: 17px;
-}
-
-dd {
-  margin-left: 9px;
-}
-
-.dl-horizontal dt {
-  float: left;
-  width: 120px;
-  overflow: hidden;
-  clear: left;
-  text-align: right;
-  text-overflow: ellipsis;
-  white-space: nowrap;
-}
-
-.dl-horizontal dd {
-  margin-left: 130px;
-}
-
-hr {
-  margin: 18px 0;
-  border: 0;
-  border-top: 1px solid #eeeeee;
-  border-bottom: 1px solid #ffffff;
-}
-
-strong {
-  font-weight: bold;
-}
-
-em {
-  font-style: italic;
-}
-
-.muted {
-  color: #999999;
-}
-
-abbr[title] {
-  cursor: help;
-  border-bottom: 1px dotted #999999;
-}
-
-abbr.initialism {
-  font-size: 90%;
-  text-transform: uppercase;
-}
-
-blockquote {
-  padding: 0 0 0 15px;
-  margin: 0 0 18px;
-  border-left: 5px solid #eeeeee;
-}
-
-blockquote p {
-  margin-bottom: 0;
-  font-size: 16px;
-  font-weight: 300;
-  line-height: 22.5px;
-}
-
-blockquote small {
-  display: block;
-  line-height: 18px;
-  color: #999999;
-}
-
-blockquote small:before {
-  content: '\2014 \00A0';
-}
-
-blockquote.pull-right {
-  float: right;
-  padding-right: 15px;
-  padding-left: 0;
-  border-right: 5px solid #eeeeee;
-  border-left: 0;
-}
-
-blockquote.pull-right p,
-blockquote.pull-right small {
-  text-align: right;
-}
-
-q:before,
-q:after,
-blockquote:before,
-blockquote:after {
-  content: "";
-}
-
-address {
-  display: block;
-  margin-bottom: 18px;
-  font-style: normal;
-  line-height: 18px;
-}
-
-small {
-  font-size: 100%;
-}
-
-cite {
-  font-style: normal;
-}
-
-code,
-pre {
-  padding: 0 3px 2px;
-  font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
-  font-size: 12px;
-  color: #333333;
-  -webkit-border-radius: 3px;
-     -moz-border-radius: 3px;
-          border-radius: 3px;
-}
-
-code {
-  padding: 2px 4px;
-  color: #d14;
-  background-color: #f7f7f9;
-  border: 1px solid #e1e1e8;
-}
-
-pre {
-  display: block;
-  padding: 8.5px;
-  margin: 0 0 9px;
-  font-size: 12.025px;
-  line-height: 18px;
-  word-break: break-all;
-  word-wrap: break-word;
-  white-space: pre;
-  white-space: pre-wrap;
-  background-color: #f5f5f5;
-  border: 1px solid #ccc;
-  border: 1px solid rgba(0, 0, 0, 0.15);
-  -webkit-border-radius: 4px;
-     -moz-border-radius: 4px;
-          border-radius: 4px;
-}
-
-pre.prettyprint {
-  margin-bottom: 18px;
-}
-
-pre code {
-  padding: 0;
-  color: inherit;
-  background-color: transparent;
-  border: 0;
-}
-
-.pre-scrollable {
-  max-height: 340px;
-  overflow-y: scroll;
-}
-
-form {
-  margin: 0 0 18px;
-}
-
-fieldset {
-  padding: 0;
-  margin: 0;
-  border: 0;
-}
-
-legend {
-  display: block;
-  width: 100%;
-  padding: 0;
-  margin-bottom: 27px;
-  font-size: 19.5px;
-  line-height: 36px;
-  color: #333333;
-  border: 0;
-  border-bottom: 1px solid #e5e5e5;
-}
-
-legend small {
-  font-size: 13.5px;
-  color: #999999;
-}
-
-label,
-input,
-button,
-select,
-textarea {
-  font-size: 13px;
-  font-weight: normal;
-  line-height: 18px;
-}
-
-input,
-button,
-select,
-textarea {
-  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
-}
-
-label {
-  display: block;
-  margin-bottom: 5px;
-}
-
-select,
-textarea,
-input[type="text"],
-input[type="password"],
-input[type="datetime"],
-input[type="datetime-local"],
-input[type="date"],
-input[type="month"],
-input[type="time"],
-input[type="week"],
-input[type="number"],
-input[type="email"],
-input[type="url"],
-input[type="search"],
-input[type="tel"],
-input[type="color"],
-.uneditable-input {
-  display: inline-block;
-  height: 18px;
-  padding: 4px;
-  margin-bottom: 9px;
-  font-size: 13px;
-  line-height: 18px;
-  color: #555555;
-}
-
-input,
-textarea {
-  width: 210px;
-}
-
-textarea {
-  height: auto;
-}
-
-textarea,
-input[type="text"],
-input[type="password"],
-input[type="datetime"],
-input[type="datetime-local"],
-input[type="date"],
-input[type="month"],
-input[type="time"],
-input[type="week"],
-input[type="number"],
-input[type="email"],
-input[type="url"],
-input[type="search"],
-input[type="tel"],
-input[type="color"],
-.uneditable-input {
-  background-color: #ffffff;
-  border: 1px solid #cccccc;
-  -webkit-border-radius: 3px;
-     -moz-border-radius: 3px;
-          border-radius: 3px;
-  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-     -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-          box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-  -webkit-transition: border linear 0.2s, box-shadow linear 0.2s;
-     -moz-transition: border linear 0.2s, box-shadow linear 0.2s;
-      -ms-transition: border linear 0.2s, box-shadow linear 0.2s;
-       -o-transition: border linear 0.2s, box-shadow linear 0.2s;
-          transition: border linear 0.2s, box-shadow linear 0.2s;
-}
-
-textarea:focus,
-input[type="text"]:focus,
-input[type="password"]:focus,
-input[type="datetime"]:focus,
-input[type="datetime-local"]:focus,
-input[type="date"]:focus,
-input[type="month"]:focus,
-input[type="time"]:focus,
-input[type="week"]:focus,
-input[type="number"]:focus,
-input[type="email"]:focus,
-input[type="url"]:focus,
-input[type="search"]:focus,
-input[type="tel"]:focus,
-input[type="color"]:focus,
-.uneditable-input:focus {
-  border-color: rgba(82, 168, 236, 0.8);
-  outline: 0;
-  outline: thin dotted \9;
-  /* IE6-9 */
-
-  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
-     -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
-          box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
-}
-
-input[type="radio"],
-input[type="checkbox"] {
-  margin: 3px 0;
-  *margin-top: 0;
-  /* IE7 */
-
-  line-height: normal;
-  cursor: pointer;
-}
-
-input[type="submit"],
-input[type="reset"],
-input[type="button"],
-input[type="radio"],
-input[type="checkbox"] {
-  width: auto;
-}
-
-.uneditable-textarea {
-  width: auto;
-  height: auto;
-}
-
-select,
-input[type="file"] {
-  height: 28px;
-  /* In IE7, the height of the select element cannot be changed by height, only font-size */
-
-  *margin-top: 4px;
-  /* For IE7, add top margin to align select with labels */
-
-  line-height: 28px;
-}
-
-select {
-  width: 220px;
-  border: 1px solid #bbb;
-}
-
-select[multiple],
-select[size] {
-  height: auto;
-}
-
-select:focus,
-input[type="file"]:focus,
-input[type="radio"]:focus,
-input[type="checkbox"]:focus {
-  outline: thin dotted #333;
-  outline: 5px auto -webkit-focus-ring-color;
-  outline-offset: -2px;
-}
-
-.radio,
-.checkbox {
-  min-height: 18px;
-  padding-left: 18px;
-}
-
-.radio input[type="radio"],
-.checkbox input[type="checkbox"] {
-  float: left;
-  margin-left: -18px;
-}
-
-.controls > .radio:first-child,
-.controls > .checkbox:first-child {
-  padding-top: 5px;
-}
-
-.radio.inline,
-.checkbox.inline {
-  display: inline-block;
-  padding-top: 5px;
-  margin-bottom: 0;
-  vertical-align: middle;
-}
-
-.radio.inline + .radio.inline,
-.checkbox.inline + .checkbox.inline {
-  margin-left: 10px;
-}
-
-.input-mini {
-  width: 60px;
-}
-
-.input-small {
-  width: 90px;
-}
-
-.input-medium {
-  width: 150px;
-}
-
-.input-large {
-  width: 210px;
-}
-
-.input-xlarge {
-  width: 270px;
-}
-
-.input-xxlarge {
-  width: 530px;
-}
-
-input[class*="span"],
-select[class*="span"],
-textarea[class*="span"],
-.uneditable-input[class*="span"],
-.row-fluid input[class*="span"],
-.row-fluid select[class*="span"],
-.row-fluid textarea[class*="span"],
-.row-fluid .uneditable-input[class*="span"] {
-  float: none;
-  margin-left: 0;
-}
-
-.input-append input[class*="span"],
-.input-append .uneditable-input[class*="span"],
-.input-prepend input[class*="span"],
-.input-prepend .uneditable-input[class*="span"],
-.row-fluid .input-prepend [class*="span"],
-.row-fluid .input-append [class*="span"] {
-  display: inline-block;
-}
-
-input,
-textarea,
-.uneditable-input {
-  margin-left: 0;
-}
-
-input.span12,
-textarea.span12,
-.uneditable-input.span12 {
-  width: 930px;
-}
-
-input.span11,
-textarea.span11,
-.uneditable-input.span11 {
-  width: 850px;
-}
-
-input.span10,
-textarea.span10,
-.uneditable-input.span10 {
-  width: 770px;
-}
-
-input.span9,
-textarea.span9,
-.uneditable-input.span9 {
-  width: 690px;
-}
-
-input.span8,
-textarea.span8,
-.uneditable-input.span8 {
-  width: 610px;
-}
-
-input.span7,
-textarea.span7,
-.uneditable-input.span7 {
-  width: 530px;
-}
-
-input.span6,
-textarea.span6,
-.uneditable-input.span6 {
-  width: 450px;
-}
-
-input.span5,
-textarea.span5,
-.uneditable-input.span5 {
-  width: 370px;
-}
-
-input.span4,
-textarea.span4,
-.uneditable-input.span4 {
-  width: 290px;
-}
-
-input.span3,
-textarea.span3,
-.uneditable-input.span3 {
-  width: 210px;
-}
-
-input.span2,
-textarea.span2,
-.uneditable-input.span2 {
-  width: 130px;
-}
-
-input.span1,
-textarea.span1,
-.uneditable-input.span1 {
-  width: 50px;
-}
-
-input[disabled],
-select[disabled],
-textarea[disabled],
-input[readonly],
-select[readonly],
-textarea[readonly] {
-  cursor: not-allowed;
-  background-color: #eeeeee;
-  border-color: #ddd;
-}
-
-input[type="radio"][disabled],
-input[type="checkbox"][disabled],
-input[type="radio"][readonly],
-input[type="checkbox"][readonly] {
-  background-color: transparent;
-}
-
-.control-group.warning > label,
-.control-group.warning .help-block,
-.control-group.warning .help-inline {
-  color: #c09853;
-}
-
-.control-group.warning .checkbox,
-.control-group.warning .radio,
-.control-group.warning input,
-.control-group.warning select,
-.control-group.warning textarea {
-  color: #c09853;
-  border-color: #c09853;
-}
-
-.control-group.warning .checkbox:focus,
-.control-group.warning .radio:focus,
-.control-group.warning input:focus,
-.control-group.warning select:focus,
-.control-group.warning textarea:focus {
-  border-color: #a47e3c;
-  -webkit-box-shadow: 0 0 6px #dbc59e;
-     -moz-box-shadow: 0 0 6px #dbc59e;
-          box-shadow: 0 0 6px #dbc59e;
-}
-
-.control-group.warning .input-prepend .add-on,
-.control-group.warning .input-append .add-on {
-  color: #c09853;
-  background-color: #fcf8e3;
-  border-color: #c09853;
-}
-
-.control-group.error > label,
-.control-group.error .help-block,
-.control-group.error .help-inline {
-  color: #b94a48;
-}
-
-.control-group.error .checkbox,
-.control-group.error .radio,
-.control-group.error input,
-.control-group.error select,
-.control-group.error textarea {
-  color: #b94a48;
-  border-color: #b94a48;
-}
-
-.control-group.error .checkbox:focus,
-.control-group.error .radio:focus,
-.control-group.error input:focus,
-.control-group.error select:focus,
-.control-group.error textarea:focus {
-  border-color: #953b39;
-  -webkit-box-shadow: 0 0 6px #d59392;
-     -moz-box-shadow: 0 0 6px #d59392;
-          box-shadow: 0 0 6px #d59392;
-}
-
-.control-group.error .input-prepend .add-on,
-.control-group.error .input-append .add-on {
-  color: #b94a48;
-  background-color: #f2dede;
-  border-color: #b94a48;
-}
-
-.control-group.success > label,
-.control-group.success .help-block,
-.control-group.success .help-inline {
-  color: #468847;
-}
-
-.control-group.success .checkbox,
-.control-group.success .radio,
-.control-group.success input,
-.control-group.success select,
-.control-group.success textarea {
-  color: #468847;
-  border-color: #468847;
-}
-
-.control-group.success .checkbox:focus,
-.control-group.success .radio:focus,
-.control-group.success input:focus,
-.control-group.success select:focus,
-.control-group.success textarea:focus {
-  border-color: #356635;
-  -webkit-box-shadow: 0 0 6px #7aba7b;
-     -moz-box-shadow: 0 0 6px #7aba7b;
-          box-shadow: 0 0 6px #7aba7b;
-}
-
-.control-group.success .input-prepend .add-on,
-.control-group.success .input-append .add-on {
-  color: #468847;
-  background-color: #dff0d8;
-  border-color: #468847;
-}
-
-input:focus:required:invalid,
-textarea:focus:required:invalid,
-select:focus:required:invalid {
-  color: #b94a48;
-  border-color: #ee5f5b;
-}
-
-input:focus:required:invalid:focus,
-textarea:focus:required:invalid:focus,
-select:focus:required:invalid:focus {
-  border-color: #e9322d;
-  -webkit-box-shadow: 0 0 6px #f8b9b7;
-     -moz-box-shadow: 0 0 6px #f8b9b7;
-          box-shadow: 0 0 6px #f8b9b7;
-}
-
-.form-actions {
-  padding: 17px 20px 18px;
-  margin-top: 18px;
-  margin-bottom: 18px;
-  background-color: #f5f5f5;
-  border-top: 1px solid #e5e5e5;
-  *zoom: 1;
-}
-
-.form-actions:before,
-.form-actions:after {
-  display: table;
-  content: "";
-}
-
-.form-actions:after {
-  clear: both;
-}
-
-.uneditable-input {
-  overflow: hidden;
-  white-space: nowrap;
-  cursor: not-allowed;
-  background-color: #ffffff;
-  border-color: #eee;
-  -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025);
-     -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025);
-          box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025);
-}
-
-:-moz-placeholder {
-  color: #999999;
-}
-
-:-ms-input-placeholder {
-  color: #999999;
-}
-
-::-webkit-input-placeholder {
-  color: #999999;
-}
-
-.help-block,
-.help-inline {
-  color: #555555;
-}
-
-.help-block {
-  display: block;
-  margin-bottom: 9px;
-}
-
-.help-inline {
-  display: inline-block;
-  *display: inline;
-  padding-left: 5px;
-  vertical-align: middle;
-  *zoom: 1;
-}
-
-.input-prepend,
-.input-append {
-  margin-bottom: 5px;
-}
-
-.input-prepend input,
-.input-append input,
-.input-prepend select,
-.input-append select,
-.input-prepend .uneditable-input,
-.input-append .uneditable-input {
-  position: relative;
-  margin-bottom: 0;
-  *margin-left: 0;
-  vertical-align: middle;
-  -webkit-border-radius: 0 3px 3px 0;
-     -moz-border-radius: 0 3px 3px 0;
-          border-radius: 0 3px 3px 0;
-}
-
-.input-prepend input:focus,
-.input-append input:focus,
-.input-prepend select:focus,
-.input-append select:focus,
-.input-prepend .uneditable-input:focus,
-.input-append .uneditable-input:focus {
-  z-index: 2;
-}
-
-.input-prepend .uneditable-input,
-.input-append .uneditable-input {
-  border-left-color: #ccc;
-}
-
-.input-prepend .add-on,
-.input-append .add-on {
-  display: inline-block;
-  width: auto;
-  height: 18px;
-  min-width: 16px;
-  padding: 4px 5px;
-  font-weight: normal;
-  line-height: 18px;
-  text-align: center;
-  text-shadow: 0 1px 0 #ffffff;
-  vertical-align: middle;
-  background-color: #eeeeee;
-  border: 1px solid #ccc;
-}
-
-.input-prepend .add-on,
-.input-append .add-on,
-.input-prepend .btn,
-.input-append .btn {
-  margin-left: -1px;
-  -webkit-border-radius: 0;
-     -moz-border-radius: 0;
-          border-radius: 0;
-}
-
-.input-prepend .active,
-.input-append .active {
-  background-color: #a9dba9;
-  border-color: #46a546;
-}
-
-.input-prepend .add-on,
-.input-prepend .btn {
-  margin-right: -1px;
-}
-
-.input-prepend .add-on:first-child,
-.input-prepend .btn:first-child {
-  -webkit-border-radius: 3px 0 0 3px;
-     -moz-border-radius: 3px 0 0 3px;
-          border-radius: 3px 0 0 3px;
-}
-
-.input-append input,
-.input-append select,
-.input-append .uneditable-input {
-  -webkit-border-radius: 3px 0 0 3px;
-     -moz-border-radius: 3px 0 0 3px;
-          border-radius: 3px 0 0 3px;
-}
-
-.input-append .uneditable-input {
-  border-right-color: #ccc;
-  border-left-color: #eee;
-}
-
-.input-append .add-on:last-child,
-.input-append .btn:last-child {
-  -webkit-border-radius: 0 3px 3px 0;
-     -moz-border-radius: 0 3px 3px 0;
-          border-radius: 0 3px 3px 0;
-}
-
-.input-prepend.input-append input,
-.input-prepend.input-append select,
-.input-prepend.input-append .uneditable-input {
-  -webkit-border-radius: 0;
-     -moz-border-radius: 0;
-          border-radius: 0;
-}
-
-.input-prepend.input-append .add-on:first-child,
-.input-prepend.input-append .btn:first-child {
-  margin-right: -1px;
-  -webkit-border-radius: 3px 0 0 3px;
-     -moz-border-radius: 3px 0 0 3px;
-          border-radius: 3px 0 0 3px;
-}
-
-.input-prepend.input-append .add-on:last-child,
-.input-prepend.input-append .btn:last-child {
-  margin-left: -1px;
-  -webkit-border-radius: 0 3px 3px 0;
-     -moz-border-radius: 0 3px 3px 0;
-          border-radius: 0 3px 3px 0;
-}
-
-.search-query {
-  padding-right: 14px;
-  padding-right: 4px \9;
-  padding-left: 14px;
-  padding-left: 4px \9;
-  /* IE7-8 doesn't have border-radius, so don't indent the padding */
-
-  margin-bottom: 0;
-  -webkit-border-radius: 14px;
-     -moz-border-radius: 14px;
-          border-radius: 14px;
-}
-
-.form-search input,
-.form-inline input,
-.form-horizontal input,
-.form-search textarea,
-.form-inline textarea,
-.form-horizontal textarea,
-.form-search select,
-.form-inline select,
-.form-horizontal select,
-.form-search .help-inline,
-.form-inline .help-inline,
-.form-horizontal .help-inline,
-.form-search .uneditable-input,
-.form-inline .uneditable-input,
-.form-horizontal .uneditable-input,
-.form-search .input-prepend,
-.form-inline .input-prepend,
-.form-horizontal .input-prepend,
-.form-search .input-append,
-.form-inline .input-append,
-.form-horizontal .input-append {
-  display: inline-block;
-  *display: inline;
-  margin-bottom: 0;
-  *zoom: 1;
-}
-
-.form-search .hide,
-.form-inline .hide,
-.form-horizontal .hide {
-  display: none;
-}
-
-.form-search label,
-.form-inline label {
-  display: inline-block;
-}
-
-.form-search .input-append,
-.form-inline .input-append,
-.form-search .input-prepend,
-.form-inline .input-prepend {
-  margin-bottom: 0;
-}
-
-.form-search .radio,
-.form-search .checkbox,
-.form-inline .radio,
-.form-inline .checkbox {
-  padding-left: 0;
-  margin-bottom: 0;
-  vertical-align: middle;
-}
-
-.form-search .radio input[type="radio"],
-.form-search .checkbox input[type="checkbox"],
-.form-inline .radio input[type="radio"],
-.form-inline .checkbox input[type="checkbox"] {
-  float: left;
-  margin-right: 3px;
-  margin-left: 0;
-}
-
-.control-group {
-  margin-bottom: 9px;
-}
-
-legend + .control-group {
-  margin-top: 18px;
-  -webkit-margin-top-collapse: separate;
-}
-
-.form-horizontal .control-group {
-  margin-bottom: 18px;
-  *zoom: 1;
-}
-
-.form-horizontal .control-group:before,
-.form-horizontal .control-group:after {
-  display: table;
-  content: "";
-}
-
-.form-horizontal .control-group:after {
-  clear: both;
-}
-
-.form-horizontal .control-label {
-  float: left;
-  width: 140px;
-  padding-top: 5px;
-  text-align: right;
-}
-
-.form-horizontal .controls {
-  *display: inline-block;
-  *padding-left: 20px;
-  margin-left: 160px;
-  *margin-left: 0;
-}
-
-.form-horizontal .controls:first-child {
-  *padding-left: 160px;
-}
-
-.form-horizontal .help-block {
-  margin-top: 9px;
-  margin-bottom: 0;
-}
-
-.form-horizontal .form-actions {
-  padding-left: 160px;
-}
-
-table {
-  max-width: 100%;
-  background-color: transparent;
-  border-collapse: collapse;
-  border-spacing: 0;
-}
-
-.table {
-  width: 100%;
-  margin-bottom: 18px;
-}
-
-.table th,
-.table td {
-  padding: 8px;
-  line-height: 18px;
-  text-align: left;
-  vertical-align: top;
-  border-top: 1px solid #dddddd;
-}
-
-.table th {
-  font-weight: bold;
-}
-
-.table thead th {
-  vertical-align: bottom;
-}
-
-.table caption + thead tr:first-child th,
-.table caption + thead tr:first-child td,
-.table colgroup + thead tr:first-child th,
-.table colgroup + thead tr:first-child td,
-.table thead:first-child tr:first-child th,
-.table thead:first-child tr:first-child td {
-  border-top: 0;
-}
-
-.table tbody + tbody {
-  border-top: 2px solid #dddddd;
-}
-
-.table-condensed th,
-.table-condensed td {
-  padding: 4px 5px;
-}
-
-.table-bordered {
-  border: 1px solid #dddddd;
-  border-collapse: separate;
-  *border-collapse: collapsed;
-  border-left: 0;
-  -webkit-border-radius: 4px;
-     -moz-border-radius: 4px;
-          border-radius: 4px;
-}
-
-.table-bordered th,
-.table-bordered td {
-  border-left: 1px solid #dddddd;
-}
-
-.table-bordered caption + thead tr:first-child th,
-.table-bordered caption + tbody tr:first-child th,
-.table-bordered caption + tbody tr:first-child td,
-.table-bordered colgroup + thead tr:first-child th,
-.table-bordered colgroup + tbody tr:first-child th,
-.table-bordered colgroup + tbody tr:first-child td,
-.table-bordered thead:first-child tr:first-child th,
-.table-bordered tbody:first-child tr:first-child th,
-.table-bordered tbody:first-child tr:first-child td {
-  border-top: 0;
-}
-
-.table-bordered thead:first-child tr:first-child th:first-child,
-.table-bordered tbody:first-child tr:first-child td:first-child {
-  -webkit-border-top-left-radius: 4px;
-          border-top-left-radius: 4px;
-  -moz-border-radius-topleft: 4px;
-}
-
-.table-bordered thead:first-child tr:first-child th:last-child,
-.table-bordered tbody:first-child tr:first-child td:last-child {
-  -webkit-border-top-right-radius: 4px;
-          border-top-right-radius: 4px;
-  -moz-border-radius-topright: 4px;
-}
-
-.table-bordered thead:last-child tr:last-child th:first-child,
-.table-bordered tbody:last-child tr:last-child td:first-child {
-  -webkit-border-radius: 0 0 0 4px;
-     -moz-border-radius: 0 0 0 4px;
-          border-radius: 0 0 0 4px;
-  -webkit-border-bottom-left-radius: 4px;
-          border-bottom-left-radius: 4px;
-  -moz-border-radius-bottomleft: 4px;
-}
-
-.table-bordered thead:last-child tr:last-child th:last-child,
-.table-bordered tbody:last-child tr:last-child td:last-child {
-  -webkit-border-bottom-right-radius: 4px;
-          border-bottom-right-radius: 4px;
-  -moz-border-radius-bottomright: 4px;
-}
-
-.table-striped tbody tr:nth-child(odd) td,
-.table-striped tbody tr:nth-child(odd) th {
-  background-color: #f9f9f9;
-}
-
-.table tbody tr:hover td,
-.table tbody tr:hover th {
-  background-color: #f5f5f5;
-}
-
-table .span1 {
-  float: none;
-  width: 44px;
-  margin-left: 0;
-}
-
-table .span2 {
-  float: none;
-  width: 124px;
-  margin-left: 0;
-}
-
-table .span3 {
-  float: none;
-  width: 204px;
-  margin-left: 0;
-}
-
-table .span4 {
-  float: none;
-  width: 284px;
-  margin-left: 0;
-}
-
-table .span5 {
-  float: none;
-  width: 364px;
-  margin-left: 0;
-}
-
-table .span6 {
-  float: none;
-  width: 444px;
-  margin-left: 0;
-}
-
-table .span7 {
-  float: none;
-  width: 524px;
-  margin-left: 0;
-}
-
-table .span8 {
-  float: none;
-  width: 604px;
-  margin-left: 0;
-}
-
-table .span9 {
-  float: none;
-  width: 684px;
-  margin-left: 0;
-}
-
-table .span10 {
-  float: none;
-  width: 764px;
-  margin-left: 0;
-}
-
-table .span11 {
-  float: none;
-  width: 844px;
-  margin-left: 0;
-}
-
-table .span12 {
-  float: none;
-  width: 924px;
-  margin-left: 0;
-}
-
-table .span13 {
-  float: none;
-  width: 1004px;
-  margin-left: 0;
-}
-
-table .span14 {
-  float: none;
-  width: 1084px;
-  margin-left: 0;
-}
-
-table .span15 {
-  float: none;
-  width: 1164px;
-  margin-left: 0;
-}
-
-table .span16 {
-  float: none;
-  width: 1244px;
-  margin-left: 0;
-}
-
-table .span17 {
-  float: none;
-  width: 1324px;
-  margin-left: 0;
-}
-
-table .span18 {
-  float: none;
-  width: 1404px;
-  margin-left: 0;
-}
-
-table .span19 {
-  float: none;
-  width: 1484px;
-  margin-left: 0;
-}
-
-table .span20 {
-  float: none;
-  width: 1564px;
-  margin-left: 0;
-}
-
-table .span21 {
-  float: none;
-  width: 1644px;
-  margin-left: 0;
-}
-
-table .span22 {
-  float: none;
-  width: 1724px;
-  margin-left: 0;
-}
-
-table .span23 {
-  float: none;
-  width: 1804px;
-  margin-left: 0;
-}
-
-table .span24 {
-  float: none;
-  width: 1884px;
-  margin-left: 0;
-}
-
-[class^="icon-"],
-[class*=" icon-"] {
-  display: inline-block;
-  width: 14px;
-  height: 14px;
-  *margin-right: .3em;
-  line-height: 14px;
-  vertical-align: text-top;
-  background-image: url("../img/glyphicons-halflings.png");
-  background-position: 14px 14px;
-  background-repeat: no-repeat;
-}
-
-[class^="icon-"]:last-child,
-[class*=" icon-"]:last-child {
-  *margin-left: 0;
-}
-
-.icon-white {
-  background-image: url("../img/glyphicons-halflings-white.png");
-}
-
-.icon-glass {
-  background-position: 0      0;
-}
-
-.icon-music {
-  background-position: -24px 0;
-}
-
-.icon-search {
-  background-position: -48px 0;
-}
-
-.icon-envelope {
-  background-position: -72px 0;
-}
-
-.icon-heart {
-  background-position: -96px 0;
-}
-
-.icon-star {
-  background-position: -120px 0;
-}
-
-.icon-star-empty {
-  background-position: -144px 0;
-}
-
-.icon-user {
-  background-position: -168px 0;
-}
-
-.icon-film {
-  background-position: -192px 0;
-}
-
-.icon-th-large {
-  background-position: -216px 0;
-}
-
-.icon-th {
-  background-position: -240px 0;
-}
-
-.icon-th-list {
-  background-position: -264px 0;
-}
-
-.icon-ok {
-  background-position: -288px 0;
-}
-
-.icon-remove {
-  background-position: -312px 0;
-}
-
-.icon-zoom-in {
-  background-position: -336px 0;
-}
-
-.icon-zoom-out {
-  background-position: -360px 0;
-}
-
-.icon-off {
-  background-position: -384px 0;
-}
-
-.icon-signal {
-  background-position: -408px 0;
-}
-
-.icon-cog {
-  background-position: -432px 0;
-}
-
-.icon-trash {
-  background-position: -456px 0;
-}
-
-.icon-home {
-  background-position: 0 -24px;
-}
-
-.icon-file {
-  background-position: -24px -24px;
-}
-
-.icon-time {
-  background-position: -48px -24px;
-}
-
-.icon-road {
-  background-position: -72px -24px;
-}
-
-.icon-download-alt {
-  background-position: -96px -24px;
-}
-
-.icon-download {
-  background-position: -120px -24px;
-}
-
-.icon-upload {
-  background-position: -144px -24px;
-}
-
-.icon-inbox {
-  background-position: -168px -24px;
-}
-
-.icon-play-circle {
-  background-position: -192px -24px;
-}
-
-.icon-repeat {
-  background-position: -216px -24px;
-}
-
-.icon-refresh {
-  background-position: -240px -24px;
-}
-
-.icon-list-alt {
-  background-position: -264px -24px;
-}
-
-.icon-lock {
-  background-position: -287px -24px;
-}
-
-.icon-flag {
-  background-position: -312px -24px;
-}
-
-.icon-headphones {
-  background-position: -336px -24px;
-}
-
-.icon-volume-off {
-  background-position: -360px -24px;
-}
-
-.icon-volume-down {
-  background-position: -384px -24px;
-}
-
-.icon-volume-up {
-  background-position: -408px -24px;
-}
-
-.icon-qrcode {
-  background-position: -432px -24px;
-}
-
-.icon-barcode {
-  background-position: -456px -24px;
-}
-
-.icon-tag {
-  background-position: 0 -48px;
-}
-
-.icon-tags {
-  background-position: -25px -48px;
-}
-
-.icon-book {
-  background-position: -48px -48px;
-}
-
-.icon-bookmark {
-  background-position: -72px -48px;
-}
-
-.icon-print {
-  background-position: -96px -48px;
-}
-
-.icon-camera {
-  background-position: -120px -48px;
-}
-
-.icon-font {
-  background-position: -144px -48px;
-}
-
-.icon-bold {
-  background-position: -167px -48px;
-}
-
-.icon-italic {
-  background-position: -192px -48px;
-}
-
-.icon-text-height {
-  background-position: -216px -48px;
-}
-
-.icon-text-width {
-  background-position: -240px -48px;
-}
-
-.icon-align-left {
-  background-position: -264px -48px;
-}
-
-.icon-align-center {
-  background-position: -288px -48px;
-}
-
-.icon-align-right {
-  background-position: -312px -48px;
-}
-
-.icon-align-justify {
-  background-position: -336px -48px;
-}
-
-.icon-list {
-  background-position: -360px -48px;
-}
-
-.icon-indent-left {
-  background-position: -384px -48px;
-}
-
-.icon-indent-right {
-  background-position: -408px -48px;
-}
-
-.icon-facetime-video {
-  background-position: -432px -48px;
-}
-
-.icon-picture {
-  background-position: -456px -48px;
-}
-
-.icon-pencil {
-  background-position: 0 -72px;
-}
-
-.icon-map-marker {
-  background-position: -24px -72px;
-}
-
-.icon-adjust {
-  background-position: -48px -72px;
-}
-
-.icon-tint {
-  background-position: -72px -72px;
-}
-
-.icon-edit {
-  background-position: -96px -72px;
-}
-
-.icon-share {
-  background-position: -120px -72px;
-}
-
-.icon-check {
-  background-position: -144px -72px;
-}
-
-.icon-move {
-  background-position: -168px -72px;
-}
-
-.icon-step-backward {
-  background-position: -192px -72px;
-}
-
-.icon-fast-backward {
-  background-position: -216px -72px;
-}
-
-.icon-backward {
-  background-position: -240px -72px;
-}
-
-.icon-play {
-  background-position: -264px -72px;
-}
-
-.icon-pause {
-  background-position: -288px -72px;
-}
-
-.icon-stop {
-  background-position: -312px -72px;
-}
-
-.icon-forward {
-  background-position: -336px -72px;
-}
-
-.icon-fast-forward {
-  background-position: -360px -72px;
-}
-
-.icon-step-forward {
-  background-position: -384px -72px;
-}
-
-.icon-eject {
-  background-position: -408px -72px;
-}
-
-.icon-chevron-left {
-  background-position: -432px -72px;
-}
-
-.icon-chevron-right {
-  background-position: -456px -72px;
-}
-
-.icon-plus-sign {
-  background-position: 0 -96px;
-}
-
-.icon-minus-sign {
-  background-position: -24px -96px;
-}
-
-.icon-remove-sign {
-  background-position: -48px -96px;
-}
-
-.icon-ok-sign {
-  background-position: -72px -96px;
-}
-
-.icon-question-sign {
-  background-position: -96px -96px;
-}
-
-.icon-info-sign {
-  background-position: -120px -96px;
-}
-
-.icon-screenshot {
-  background-position: -144px -96px;
-}
-
-.icon-remove-circle {
-  background-position: -168px -96px;
-}
-
-.icon-ok-circle {
-  background-position: -192px -96px;
-}
-
-.icon-ban-circle {
-  background-position: -216px -96px;
-}
-
-.icon-arrow-left {
-  background-position: -240px -96px;
-}
-
-.icon-arrow-right {
-  background-position: -264px -96px;
-}
-
-.icon-arrow-up {
-  background-position: -289px -96px;
-}
-
-.icon-arrow-down {
-  background-position: -312px -96px;
-}
-
-.icon-share-alt {
-  background-position: -336px -96px;
-}
-
-.icon-resize-full {
-  background-position: -360px -96px;
-}
-
-.icon-resize-small {
-  background-position: -384px -96px;
-}
-
-.icon-plus {
-  background-position: -408px -96px;
-}
-
-.icon-minus {
-  background-position: -433px -96px;
-}
-
-.icon-asterisk {
-  background-position: -456px -96px;
-}
-
-.icon-exclamation-sign {
-  background-position: 0 -120px;
-}
-
-.icon-gift {
-  background-position: -24px -120px;
-}
-
-.icon-leaf {
-  background-position: -48px -120px;
-}
-
-.icon-fire {
-  background-position: -72px -120px;
-}
-
-.icon-eye-open {
-  background-position: -96px -120px;
-}
-
-.icon-eye-close {
-  background-position: -120px -120px;
-}
-
-.icon-warning-sign {
-  background-position: -144px -120px;
-}
-
-.icon-plane {
-  background-position: -168px -120px;
-}
-
-.icon-calendar {
-  background-position: -192px -120px;
-}
-
-.icon-random {
-  background-position: -216px -120px;
-}
-
-.icon-comment {
-  background-position: -240px -120px;
-}
-
-.icon-magnet {
-  background-position: -264px -120px;
-}
-
-.icon-chevron-up {
-  background-position: -288px -120px;
-}
-
-.icon-chevron-down {
-  background-position: -313px -119px;
-}
-
-.icon-retweet {
-  background-position: -336px -120px;
-}
-
-.icon-shopping-cart {
-  background-position: -360px -120px;
-}
-
-.icon-folder-close {
-  background-position: -384px -120px;
-}
-
-.icon-folder-open {
-  background-position: -408px -120px;
-}
-
-.icon-resize-vertical {
-  background-position: -432px -119px;
-}
-
-.icon-resize-horizontal {
-  background-position: -456px -118px;
-}
-
-.icon-hdd {
-  background-position: 0 -144px;
-}
-
-.icon-bullhorn {
-  background-position: -24px -144px;
-}
-
-.icon-bell {
-  background-position: -48px -144px;
-}
-
-.icon-certificate {
-  background-position: -72px -144px;
-}
-
-.icon-thumbs-up {
-  background-position: -96px -144px;
-}
-
-.icon-thumbs-down {
-  background-position: -120px -144px;
-}
-
-.icon-hand-right {
-  background-position: -144px -144px;
-}
-
-.icon-hand-left {
-  background-position: -168px -144px;
-}
-
-.icon-hand-up {
-  background-position: -192px -144px;
-}
-
-.icon-hand-down {
-  background-position: -216px -144px;
-}
-
-.icon-circle-arrow-right {
-  background-position: -240px -144px;
-}
-
-.icon-circle-arrow-left {
-  background-position: -264px -144px;
-}
-
-.icon-circle-arrow-up {
-  background-position: -288px -144px;
-}
-
-.icon-circle-arrow-down {
-  background-position: -312px -144px;
-}
-
-.icon-globe {
-  background-position: -336px -144px;
-}
-
-.icon-wrench {
-  background-position: -360px -144px;
-}
-
-.icon-tasks {
-  background-position: -384px -144px;
-}
-
-.icon-filter {
-  background-position: -408px -144px;
-}
-
-.icon-briefcase {
-  background-position: -432px -144px;
-}
-
-.icon-fullscreen {
-  background-position: -456px -144px;
-}
-
-.dropup,
-.dropdown {
-  position: relative;
-}
-
-.dropdown-toggle {
-  *margin-bottom: -3px;
-}
-
-.dropdown-toggle:active,
-.open .dropdown-toggle {
-  outline: 0;
-}
-
-.caret {
-  display: inline-block;
-  width: 0;
-  height: 0;
-  vertical-align: top;
-  border-top: 4px solid #000000;
-  border-right: 4px solid transparent;
-  border-left: 4px solid transparent;
-  content: "";
-  opacity: 0.3;
-  filter: alpha(opacity=30);
-}
-
-.dropdown .caret {
-  margin-top: 8px;
-  margin-left: 2px;
-}
-
-.dropdown:hover .caret,
-.open .caret {
-  opacity: 1;
-  filter: alpha(opacity=100);
-}
-
-.dropdown-menu {
-  position: absolute;
-  top: 100%;
-  left: 0;
-  z-index: 1000;
-  display: none;
-  float: left;
-  min-width: 160px;
-  padding: 4px 0;
-  margin: 1px 0 0;
-  list-style: none;
-  background-color: #ffffff;
-  border: 1px solid #ccc;
-  border: 1px solid rgba(0, 0, 0, 0.2);
-  *border-right-width: 2px;
-  *border-bottom-width: 2px;
-  -webkit-border-radius: 5px;
-     -moz-border-radius: 5px;
-          border-radius: 5px;
-  -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
-     -moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
-          box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
-  -webkit-background-clip: padding-box;
-     -moz-background-clip: padding;
-          background-clip: padding-box;
-}
-
-.dropdown-menu.pull-right {
-  right: 0;
-  left: auto;
-}
-
-.dropdown-menu .divider {
-  *width: 100%;
-  height: 1px;
-  margin: 8px 1px;
-  *margin: -5px 0 5px;
-  overflow: hidden;
-  background-color: #e5e5e5;
-  border-bottom: 1px solid #ffffff;
-}
-
-.dropdown-menu a {
-  display: block;
-  padding: 3px 15px;
-  clear: both;
-  font-weight: normal;
-  line-height: 18px;
-  color: #333333;
-  white-space: nowrap;
-}
-
-.dropdown-menu li > a:hover,
-.dropdown-menu .active > a,
-.dropdown-menu .active > a:hover {
-  color: #ffffff;
-  text-decoration: none;
-  background-color: #0088cc;
-}
-
-.open {
-  *z-index: 1000;
-}
-
-.open > .dropdown-menu {
-  display: block;
-}
-
-.pull-right > .dropdown-menu {
-  right: 0;
-  left: auto;
-}
-
-.dropup .caret,
-.navbar-fixed-bottom .dropdown .caret {
-  border-top: 0;
-  border-bottom: 4px solid #000000;
-  content: "\2191";
-}
-
-.dropup .dropdown-menu,
-.navbar-fixed-bottom .dropdown .dropdown-menu {
-  top: auto;
-  bottom: 100%;
-  margin-bottom: 1px;
-}
-
-.typeahead {
-  margin-top: 2px;
-  -webkit-border-radius: 4px;
-     -moz-border-radius: 4px;
-          border-radius: 4px;
-}
-
-.well {
-  min-height: 20px;
-  padding: 19px;
-  margin-bottom: 20px;
-  background-color: #f5f5f5;
-  border: 1px solid #eee;
-  border: 1px solid rgba(0, 0, 0, 0.05);
-  -webkit-border-radius: 4px;
-     -moz-border-radius: 4px;
-          border-radius: 4px;
-  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
-     -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
-          box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
-}
-
-.well blockquote {
-  border-color: #ddd;
-  border-color: rgba(0, 0, 0, 0.15);
-}
-
-.well-large {
-  padding: 24px;
-  -webkit-border-radius: 6px;
-     -moz-border-radius: 6px;
-          border-radius: 6px;
-}
-
-.well-small {
-  padding: 9px;
-  -webkit-border-radius: 3px;
-     -moz-border-radius: 3px;
-          border-radius: 3px;
-}
-
-.fade {
-  opacity: 0;
-  -webkit-transition: opacity 0.15s linear;
-     -moz-transition: opacity 0.15s linear;
-      -ms-transition: opacity 0.15s linear;
-       -o-transition: opacity 0.15s linear;
-          transition: opacity 0.15s linear;
-}
-
-.fade.in {
-  opacity: 1;
-}
-
-.collapse {
-  position: relative;
-  height: 0;
-  overflow: hidden;
-  -webkit-transition: height 0.35s ease;
-     -moz-transition: height 0.35s ease;
-      -ms-transition: height 0.35s ease;
-       -o-transition: height 0.35s ease;
-          transition: height 0.35s ease;
-}
-
-.collapse.in {
-  height: auto;
-}
-
-.close {
-  float: right;
-  font-size: 20px;
-  font-weight: bold;
-  line-height: 18px;
-  color: #000000;
-  text-shadow: 0 1px 0 #ffffff;
-  opacity: 0.2;
-  filter: alpha(opacity=20);
-}
-
-.close:hover {
-  color: #000000;
-  text-decoration: none;
-  cursor: pointer;
-  opacity: 0.4;
-  filter: alpha(opacity=40);
-}
-
-button.close {
-  padding: 0;
-  cursor: pointer;
-  background: transparent;
-  border: 0;
-  -webkit-appearance: none;
-}
-
-.btn {
-  display: inline-block;
-  *display: inline;
-  padding: 4px 10px 4px;
-  margin-bottom: 0;
-  *margin-left: .3em;
-  font-size: 13px;
-  line-height: 18px;
-  *line-height: 20px;
-  color: #333333;
-  text-align: center;
-  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
-  vertical-align: middle;
-  cursor: pointer;
-  background-color: #f5f5f5;
-  *background-color: #e6e6e6;
-  background-image: -ms-linear-gradient(top, #ffffff, #e6e6e6);
-  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));
-  background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);
-  background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
-  background-image: linear-gradient(top, #ffffff, #e6e6e6);
-  background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
-  background-repeat: repeat-x;
-  border: 1px solid #cccccc;
-  *border: 0;
-  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
-  border-color: #e6e6e6 #e6e6e6 #bfbfbf;
-  border-bottom-color: #b3b3b3;
-  -webkit-border-radius: 4px;
-     -moz-border-radius: 4px;
-          border-radius: 4px;
-  filter: progid:dximagetransform.microsoft.gradient(startColorstr='#ffffff', endColorstr='#e6e6e6', GradientType=0);
-  filter: progid:dximagetransform.microsoft.gradient(enabled=false);
-  *zoom: 1;
-  -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
-     -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
-          box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
-}
-
-.btn:hover,
-.btn:active,
-.btn.active,
-.btn.disabled,
-.btn[disabled] {
-  background-color: #e6e6e6;
-  *background-color: #d9d9d9;
-}
-
-.btn:active,
-.btn.active {
-  background-color: #cccccc \9;
-}
-
-.btn:first-child {
-  *margin-left: 0;
-}
-
-.btn:hover {
-  color: #333333;
-  text-decoration: none;
-  background-color: #e6e6e6;
-  *background-color: #d9d9d9;
-  /* Buttons in IE7 don't get borders, so darken on hover */
-
-  background-position: 0 -15px;
-  -webkit-transition: background-position 0.1s linear;
-     -moz-transition: background-position 0.1s linear;
-      -ms-transition: background-position 0.1s linear;
-       -o-transition: background-position 0.1s linear;
-          transition: background-position 0.1s linear;
-}
-
-.btn:focus {
-  outline: thin dotted #333;
-  outline: 5px auto -webkit-focus-ring-color;
-  outline-offset: -2px;
-}
-
-.btn.active,
-.btn:active {
-  background-color: #e6e6e6;
-  background-color: #d9d9d9 \9;
-  background-image: none;
-  outline: 0;
-  -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
-     -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
-          box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
-}
-
-.btn.disabled,
-.btn[disabled] {
-  cursor: default;
-  background-color: #e6e6e6;
-  background-image: none;
-  opacity: 0.65;
-  filter: alpha(opacity=65);
-  -webkit-box-shadow: none;
-     -moz-box-shadow: none;
-          box-shadow: none;
-}
-
-.btn-large {
-  padding: 9px 14px;
-  font-size: 15px;
-  line-height: normal;
-  -webkit-border-radius: 5px;
-     -moz-border-radius: 5px;
-          border-radius: 5px;
-}
-
-.btn-large [class^="icon-"] {
-  margin-top: 1px;
-}
-
-.btn-small {
-  padding: 5px 9px;
-  font-size: 11px;
-  line-height: 16px;
-}
-
-.btn-small [class^="icon-"] {
-  margin-top: -1px;
-}
-
-.btn-mini {
-  padding: 2px 6px;
-  font-size: 11px;
-  line-height: 14px;
-}
-
-.btn-primary,
-.btn-primary:hover,
-.btn-warning,
-.btn-warning:hover,
-.btn-danger,
-.btn-danger:hover,
-.btn-success,
-.btn-success:hover,
-.btn-info,
-.btn-info:hover,
-.btn-inverse,
-.btn-inverse:hover {
-  color: #ffffff;
-  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
-}
-
-.btn-primary.active,
-.btn-warning.active,
-.btn-danger.active,
-.btn-success.active,
-.btn-info.active,
-.btn-inverse.active {
-  color: rgba(255, 255, 255, 0.75);
-}
-
-.btn {
-  border-color: #ccc;
-  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
-}
-
-.btn-primary {
-  background-color: #0074cc;
-  *background-color: #0055cc;
-  background-image: -ms-linear-gradient(top, #0088cc, #0055cc);
-  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0055cc));
-  background-image: -webkit-linear-gradient(top, #0088cc, #0055cc);
-  background-image: -o-linear-gradient(top, #0088cc, #0055cc);
-  background-image: -moz-linear-gradient(top, #0088cc, #0055cc);
-  background-image: linear-gradient(top, #0088cc, #0055cc);
-  background-repeat: repeat-x;
-  border-color: #0055cc #0055cc #003580;
-  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
-  filter: progid:dximagetransform.microsoft.gradient(startColorstr='#0088cc', endColorstr='#0055cc', GradientType=0);
-  filter: progid:dximagetransform.microsoft.gradient(enabled=false);
-}
-
-.btn-primary:hover,
-.btn-primary:active,
-.btn-primary.active,
-.btn-primary.disabled,
-.btn-primary[disabled] {
-  background-color: #0055cc;
-  *background-color: #004ab3;
-}
-
-.btn-primary:active,
-.btn-primary.active {
-  background-color: #004099 \9;
-}
-
-.btn-warning {
-  background-color: #faa732;
-  *background-color: #f89406;
-  background-image: -ms-linear-gradient(top, #fbb450, #f89406);
-  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406));
-  background-image: -webkit-linear-gradient(top, #fbb450, #f89406);
-  background-image: -o-linear-gradient(top, #fbb450, #f89406);
-  background-image: -moz-linear-gradient(top, #fbb450, #f89406);
-  background-image: linear-gradient(top, #fbb450, #f89406);
-  background-repeat: repeat-x;
-  border-color: #f89406 #f89406 #ad6704;
-  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
-  filter: progid:dximagetransform.microsoft.gradient(startColorstr='#fbb450', endColorstr='#f89406', GradientType=0);
-  filter: progid:dximagetransform.microsoft.gradient(enabled=false);
-}
-
-.btn-warning:hover,
-.btn-warning:active,
-.btn-warning.active,
-.btn-warning.disabled,
-.btn-warning[disabled] {
-  background-color: #f89406;
-  *background-color: #df8505;
-}
-
-.btn-warning:active,
-.btn-warning.active {
-  background-color: #c67605 \9;
-}
-
-.btn-danger {
-  background-color: #da4f49;
-  *background-color: #bd362f;
-  background-image: -ms-linear-gradient(top, #ee5f5b, #bd362f);
-  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#bd362f));
-  background-image: -webkit-linear-gradient(top, #ee5f5b, #bd362f);
-  background-image: -o-linear-gradient(top, #ee5f5b, #bd362f);
-  background-image: -moz-linear-gradient(top, #ee5f5b, #bd362f);
-  background-image: linear-gradient(top, #ee5f5b, #bd362f);
-  background-repeat: repeat-x;
-  border-color: #bd362f #bd362f #802420;
-  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
-  filter: progid:dximagetransform.microsoft.gradient(startColorstr='#ee5f5b', endColorstr='#bd362f', GradientType=0);
-  filter: progid:dximagetransform.microsoft.gradient(enabled=false);
-}
-
-.btn-danger:hover,
-.btn-danger:active,
-.btn-danger.active,
-.btn-danger.disabled,
-.btn-danger[disabled] {
-  background-color: #bd362f;
-  *background-color: #a9302a;
-}
-
-.btn-danger:active,
-.btn-danger.active {
-  background-color: #942a25 \9;
-}
-
-.btn-success {
-  background-color: #5bb75b;
-  *background-color: #51a351;
-  background-image: -ms-linear-gradient(top, #62c462, #51a351);
-  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#51a351));
-  background-image: -webkit-linear-gradient(top, #62c462, #51a351);
-  background-image: -o-linear-gradient(top, #62c462, #51a351);
-  background-image: -moz-linear-gradient(top, #62c462, #51a351);
-  background-image: linear-gradient(top, #62c462, #51a351);
-  background-repeat: repeat-x;
-  border-color: #51a351 #51a351 #387038;
-  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
-  filter: progid:dximagetransform.microsoft.gradient(startColorstr='#62c462', endColorstr='#51a351', GradientType=0);
-  filter: progid:dximagetransform.microsoft.gradient(enabled=false);
-}
-
-.btn-success:hover,
-.btn-success:active,
-.btn-success.active,
-.btn-success.disabled,
-.btn-success[disabled] {
-  background-color: #51a351;
-  *background-color: #499249;
-}
-
-.btn-success:active,
-.btn-success.active {
-  background-color: #408140 \9;
-}
-
-.btn-info {
-  background-color: #49afcd;
-  *background-color: #2f96b4;
-  background-image: -ms-linear-gradient(top, #5bc0de, #2f96b4);
-  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#2f96b4));
-  background-image: -webkit-linear-gradient(top, #5bc0de, #2f96b4);
-  background-image: -o-linear-gradient(top, #5bc0de, #2f96b4);
-  background-image: -moz-linear-gradient(top, #5bc0de, #2f96b4);
-  background-image: linear-gradient(top, #5bc0de, #2f96b4);
-  background-repeat: repeat-x;
-  border-color: #2f96b4 #2f96b4 #1f6377;
-  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
-  filter: progid:dximagetransform.microsoft.gradient(startColorstr='#5bc0de', endColorstr='#2f96b4', GradientType=0);
-  filter: progid:dximagetransform.microsoft.gradient(enabled=false);
-}
-
-.btn-info:hover,
-.btn-info:active,
-.btn-info.active,
-.btn-info.disabled,
-.btn-info[disabled] {
-  background-color: #2f96b4;
-  *background-color: #2a85a0;
-}
-
-.btn-info:active,
-.btn-info.active {
-  background-color: #24748c \9;
-}
-
-.btn-inverse {
-  background-color: #414141;
-  *background-color: #222222;
-  background-image: -ms-linear-gradient(top, #555555, #222222);
-  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#555555), to(#222222));
-  background-image: -webkit-linear-gradient(top, #555555, #222222);
-  background-image: -o-linear-gradient(top, #555555, #222222);
-  background-image: -moz-linear-gradient(top, #555555, #222222);
-  background-image: linear-gradient(top, #555555, #222222);
-  background-repeat: repeat-x;
-  border-color: #222222 #222222 #000000;
-  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
-  filter: progid:dximagetransform.microsoft.gradient(startColorstr='#555555', endColorstr='#222222', GradientType=0);
-  filter: progid:dximagetransform.microsoft.gradient(enabled=false);
-}
-
-.btn-inverse:hover,
-.btn-inverse:active,
-.btn-inverse.active,
-.btn-inverse.disabled,
-.btn-inverse[disabled] {
-  background-color: #222222;
-  *background-color: #151515;
-}
-
-.btn-inverse:active,
-.btn-inverse.active {
-  background-color: #080808 \9;
-}
-
-button.btn,
-input[type="submit"].btn {
-  *padding-top: 2px;
-  *padding-bottom: 2px;
-}
-
-button.btn::-moz-focus-inner,
-input[type="submit"].btn::-moz-focus-inner {
-  padding: 0;
-  border: 0;
-}
-
-button.btn.btn-large,
-input[type="submit"].btn.btn-large {
-  *padding-top: 7px;
-  *padding-bottom: 7px;
-}
-
-button.btn.btn-small,
-input[type="submit"].btn.btn-small {
-  *padding-top: 3px;
-  *padding-bottom: 3px;
-}
-
-button.btn.btn-mini,
-input[type="submit"].btn.btn-mini {
-  *padding-top: 1px;
-  *padding-bottom: 1px;
-}
-
-.btn-group {
-  position: relative;
-  *margin-left: .3em;
-  *zoom: 1;
-}
-
-.btn-group:before,
-.btn-group:after {
-  display: table;
-  content: "";
-}
-
-.btn-group:after {
-  clear: both;
-}
-
-.btn-group:first-child {
-  *margin-left: 0;
-}
-
-.btn-group + .btn-group {
-  margin-left: 5px;
-}
-
-.btn-toolbar {
-  margin-top: 9px;
-  margin-bottom: 9px;
-}
-
-.btn-toolbar .btn-group {
-  display: inline-block;
-  *display: inline;
-  /* IE7 inline-block hack */
-
-  *zoom: 1;
-}
-
-.btn-group > .btn {
-  position: relative;
-  float: left;
-  margin-left: -1px;
-  -webkit-border-radius: 0;
-     -moz-border-radius: 0;
-          border-radius: 0;
-}
-
-.btn-group > .btn:first-child {
-  margin-left: 0;
-  -webkit-border-bottom-left-radius: 4px;
-          border-bottom-left-radius: 4px;
-  -webkit-border-top-left-radius: 4px;
-          border-top-left-radius: 4px;
-  -moz-border-radius-bottomleft: 4px;
-  -moz-border-radius-topleft: 4px;
-}
-
-.btn-group > .btn:last-child,
-.btn-group > .dropdown-toggle {
-  -webkit-border-top-right-radius: 4px;
-          border-top-right-radius: 4px;
-  -webkit-border-bottom-right-radius: 4px;
-          border-bottom-right-radius: 4px;
-  -moz-border-radius-topright: 4px;
-  -moz-border-radius-bottomright: 4px;
-}
-
-.btn-group > .btn.large:first-child {
-  margin-left: 0;
-  -webkit-border-bottom-left-radius: 6px;
-          border-bottom-left-radius: 6px;
-  -webkit-border-top-left-radius: 6px;
-          border-top-left-radius: 6px;
-  -moz-border-radius-bottomleft: 6px;
-  -moz-border-radius-topleft: 6px;
-}
-
-.btn-group > .btn.large:last-child,
-.btn-group > .large.dropdown-toggle {
-  -webkit-border-top-right-radius: 6px;
-          border-top-right-radius: 6px;
-  -webkit-border-bottom-right-radius: 6px;
-          border-bottom-right-radius: 6px;
-  -moz-border-radius-topright: 6px;
-  -moz-border-radius-bottomright: 6px;
-}
-
-.btn-group > .btn:hover,
-.btn-group > .btn:focus,
-.btn-group > .btn:active,
-.btn-group > .btn.active {
-  z-index: 2;
-}
-
-.btn-group .dropdown-toggle:active,
-.btn-group.open .dropdown-toggle {
-  outline: 0;
-}
-
-.btn-group > .dropdown-toggle {
-  *padding-top: 4px;
-  padding-right: 8px;
-  *padding-bottom: 4px;
-  padding-left: 8px;
-  -webkit-box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
-     -moz-box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
-          box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
-}
-
-.btn-group > .btn-mini.dropdown-toggle {
-  padding-right: 5px;
-  padding-left: 5px;
-}
-
-.btn-group > .btn-small.dropdown-toggle {
-  *padding-top: 4px;
-  *padding-bottom: 4px;
-}
-
-.btn-group > .btn-large.dropdown-toggle {
-  padding-right: 12px;
-  padding-left: 12px;
-}
-
-.btn-group.open .dropdown-toggle {
-  background-image: none;
-  -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
-     -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
-          box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
-}
-
-.btn-group.open .btn.dropdown-toggle {
-  background-color: #e6e6e6;
-}
-
-.btn-group.open .btn-primary.dropdown-toggle {
-  background-color: #0055cc;
-}
-
-.btn-group.open .btn-warning.dropdown-toggle {
-  background-color: #f89406;
-}
-
-.btn-group.open .btn-danger.dropdown-toggle {
-  background-color: #bd362f;
-}
-
-.btn-group.open .btn-success.dropdown-toggle {
-  background-color: #51a351;
-}
-
-.btn-group.open .btn-info.dropdown-toggle {
-  background-color: #2f96b4;
-}
-
-.btn-group.open .btn-inverse.dropdown-toggle {
-  background-color: #222222;
-}
-
-.btn .caret {
-  margin-top: 7px;
-  margin-left: 0;
-}
-
-.btn:hover .caret,
-.open.btn-group .caret {
-  opacity: 1;
-  filter: alpha(opacity=100);
-}
-
-.btn-mini .caret {
-  margin-top: 5px;
-}
-
-.btn-small .caret {
-  margin-top: 6px;
-}
-
-.btn-large .caret {
-  margin-top: 6px;
-  border-top-width: 5px;
-  border-right-width: 5px;
-  border-left-width: 5px;
-}
-
-.dropup .btn-large .caret {
-  border-top: 0;
-  border-bottom: 5px solid #000000;
-}
-
-.btn-primary .caret,
-.btn-warning .caret,
-.btn-danger .caret,
-.btn-info .caret,
-.btn-success .caret,
-.btn-inverse .caret {
-  border-top-color: #ffffff;
-  border-bottom-color: #ffffff;
-  opacity: 0.75;
-  filter: alpha(opacity=75);
-}
-
-.alert {
-  padding: 8px 35px 8px 14px;
-  margin-bottom: 18px;
-  color: #c09853;
-  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
-  background-color: #fcf8e3;
-  border: 1px solid #fbeed5;
-  -webkit-border-radius: 4px;
-     -moz-border-radius: 4px;
-          border-radius: 4px;
-}
-
-.alert-heading {
-  color: inherit;
-}
-
-.alert .close {
-  position: relative;
-  top: -2px;
-  right: -21px;
-  line-height: 18px;
-}
-
-.alert-success {
-  color: #468847;
-  background-color: #dff0d8;
-  border-color: #d6e9c6;
-}
-
-.alert-danger,
-.alert-error {
-  color: #b94a48;
-  background-color: #f2dede;
-  border-color: #eed3d7;
-}
-
-.alert-info {
-  color: #3a87ad;
-  background-color: #d9edf7;
-  border-color: #bce8f1;
-}
-
-.alert-block {
-  padding-top: 14px;
-  padding-bottom: 14px;
-}
-
-.alert-block > p,
-.alert-block > ul {
-  margin-bottom: 0;
-}
-
-.alert-block p + p {
-  margin-top: 5px;
-}
-
-.nav {
-  margin-bottom: 18px;
-  margin-left: 0;
-  list-style: none;
-}
-
-.nav > li > a {
-  display: block;
-}
-
-.nav > li > a:hover {
-  text-decoration: none;
-  background-color: #eeeeee;
-}
-
-.nav > .pull-right {
-  float: right;
-}
-
-.nav .nav-header {
-  display: block;
-  padding: 3px 15px;
-  font-size: 11px;
-  font-weight: bold;
-  line-height: 18px;
-  color: #999999;
-  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
-  text-transform: uppercase;
-}
-
-.nav li + .nav-header {
-  margin-top: 9px;
-}
-
-.nav-list {
-  padding-right: 15px;
-  padding-left: 15px;
-  margin-bottom: 0;
-}
-
-.nav-list > li > a,
-.nav-list .nav-header {
-  margin-right: -15px;
-  margin-left: -15px;
-  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
-}
-
-.nav-list > li > a {
-  padding: 3px 15px;
-}
-
-.nav-list > .active > a,
-.nav-list > .active > a:hover {
-  color: #ffffff;
-  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2);
-  background-color: #0088cc;
-}
-
-.nav-list [class^="icon-"] {
-  margin-right: 2px;
-}
-
-.nav-list .divider {
-  *width: 100%;
-  height: 1px;
-  margin: 8px 1px;
-  *margin: -5px 0 5px;
-  overflow: hidden;
-  background-color: #e5e5e5;
-  border-bottom: 1px solid #ffffff;
-}
-
-.nav-tabs,
-.nav-pills {
-  *zoom: 1;
-}
-
-.nav-tabs:before,
-.nav-pills:before,
-.nav-tabs:after,
-.nav-pills:after {
-  display: table;
-  content: "";
-}
-
-.nav-tabs:after,
-.nav-pills:after {
-  clear: both;
-}
-
-.nav-tabs > li,
-.nav-pills > li {
-  float: left;
-}
-
-.nav-tabs > li > a,
-.nav-pills > li > a {
-  padding-right: 12px;
-  padding-left: 12px;
-  margin-right: 2px;
-  line-height: 14px;
-}
-
-.nav-tabs {
-  border-bottom: 1px solid #ddd;
-}
-
-.nav-tabs > li {
-  margin-bottom: -1px;
-}
-
-.nav-tabs > li > a {
-  padding-top: 8px;
-  padding-bottom: 8px;
-  line-height: 18px;
-  border: 1px solid transparent;
-  -webkit-border-radius: 4px 4px 0 0;
-     -moz-border-radius: 4px 4px 0 0;
-          border-radius: 4px 4px 0 0;
-}
-
-.nav-tabs > li > a:hover {
-  border-color: #eeeeee #eeeeee #dddddd;
-}
-
-.nav-tabs > .active > a,
-.nav-tabs > .active > a:hover {
-  color: #555555;
-  cursor: default;
-  background-color: #ffffff;
-  border: 1px solid #ddd;
-  border-bottom-color: transparent;
-}
-
-.nav-pills > li > a {
-  padding-top: 8px;
-  padding-bottom: 8px;
-  margin-top: 2px;
-  margin-bottom: 2px;
-  -webkit-border-radius: 5px;
-     -moz-border-radius: 5px;
-          border-radius: 5px;
-}
-
-.nav-pills > .active > a,
-.nav-pills > .active > a:hover {
-  color: #ffffff;
-  background-color: #0088cc;
-}
-
-.nav-stacked > li {
-  float: none;
-}
-
-.nav-stacked > li > a {
-  margin-right: 0;
-}
-
-.nav-tabs.nav-stacked {
-  border-bottom: 0;
-}
-
-.nav-tabs.nav-stacked > li > a {
-  border: 1px solid #ddd;
-  -webkit-border-radius: 0;
-     -moz-border-radius: 0;
-          border-radius: 0;
-}
-
-.nav-tabs.nav-stacked > li:first-child > a {
-  -webkit-border-radius: 4px 4px 0 0;
-     -moz-border-radius: 4px 4px 0 0;
-          border-radius: 4px 4px 0 0;
-}
-
-.nav-tabs.nav-stacked > li:last-child > a {
-  -webkit-border-radius: 0 0 4px 4px;
-     -moz-border-radius: 0 0 4px 4px;
-          border-radius: 0 0 4px 4px;
-}
-
-.nav-tabs.nav-stacked > li > a:hover {
-  z-index: 2;
-  border-color: #ddd;
-}
-
-.nav-pills.nav-stacked > li > a {
-  margin-bottom: 3px;
-}
-
-.nav-pills.nav-stacked > li:last-child > a {
-  margin-bottom: 1px;
-}
-
-.nav-tabs .dropdown-menu {
-  -webkit-border-radius: 0 0 5px 5px;
-     -moz-border-radius: 0 0 5px 5px;
-          border-radius: 0 0 5px 5px;
-}
-
-.nav-pills .dropdown-menu {
-  -webkit-border-radius: 4px;
-     -moz-border-radius: 4px;
-          border-radius: 4px;
-}
-
-.nav-tabs .dropdown-toggle .caret,
-.nav-pills .dropdown-toggle .caret {
-  margin-top: 6px;
-  border-top-color: #0088cc;
-  border-bottom-color: #0088cc;
-}
-
-.nav-tabs .dropdown-toggle:hover .caret,
-.nav-pills .dropdown-toggle:hover .caret {
-  border-top-color: #005580;
-  border-bottom-color: #005580;
-}
-
-.nav-tabs .active .dropdown-toggle .caret,
-.nav-pills .active .dropdown-toggle .caret {
-  border-top-color: #333333;
-  border-bottom-color: #333333;
-}
-
-.nav > .dropdown.active > a:hover {
-  color: #000000;
-  cursor: pointer;
-}
-
-.nav-tabs .open .dropdown-toggle,
-.nav-pills .open .dropdown-toggle,
-.nav > li.dropdown.open.active > a:hover {
-  color: #ffffff;
-  background-color: #999999;
-  border-color: #999999;
-}
-
-.nav li.dropdown.open .caret,
-.nav li.dropdown.open.active .caret,
-.nav li.dropdown.open a:hover .caret {
-  border-top-color: #ffffff;
-  border-bottom-color: #ffffff;
-  opacity: 1;
-  filter: alpha(opacity=100);
-}
-
-.tabs-stacked .open > a:hover {
-  border-color: #999999;
-}
-
-.tabbable {
-  *zoom: 1;
-}
-
-.tabbable:before,
-.tabbable:after {
-  display: table;
-  content: "";
-}
-
-.tabbable:after {
-  clear: both;
-}
-
-.tab-content {
-  overflow: auto;
-}
-
-.tabs-below > .nav-tabs,
-.tabs-right > .nav-tabs,
-.tabs-left > .nav-tabs {
-  border-bottom: 0;
-}
-
-.tab-content > .tab-pane,
-.pill-content > .pill-pane {
-  display: none;
-}
-
-.tab-content > .active,
-.pill-content > .active {
-  display: block;
-}
-
-.tabs-below > .nav-tabs {
-  border-top: 1px solid #ddd;
-}
-
-.tabs-below > .nav-tabs > li {
-  margin-top: -1px;
-  margin-bottom: 0;
-}
-
-.tabs-below > .nav-tabs > li > a {
-  -webkit-border-radius: 0 0 4px 4px;
-     -moz-border-radius: 0 0 4px 4px;
-          border-radius: 0 0 4px 4px;
-}
-
-.tabs-below > .nav-tabs > li > a:hover {
-  border-top-color: #ddd;
-  border-bottom-color: transparent;
-}
-
-.tabs-below > .nav-tabs > .active > a,
-.tabs-below > .nav-tabs > .active > a:hover {
-  border-color: transparent #ddd #ddd #ddd;
-}
-
-.tabs-left > .nav-tabs > li,
-.tabs-right > .nav-tabs > li {
-  float: none;
-}
-
-.tabs-left > .nav-tabs > li > a,
-.tabs-right > .nav-tabs > li > a {
-  min-width: 74px;
-  margin-right: 0;
-  margin-bottom: 3px;
-}
-
-.tabs-left > .nav-tabs {
-  float: left;
-  margin-right: 19px;
-  border-right: 1px solid #ddd;
-}
-
-.tabs-left > .nav-tabs > li > a {
-  margin-right: -1px;
-  -webkit-border-radius: 4px 0 0 4px;
-     -moz-border-radius: 4px 0 0 4px;
-          border-radius: 4px 0 0 4px;
-}
-
-.tabs-left > .nav-tabs > li > a:hover {
-  border-color: #eeeeee #dddddd #eeeeee #eeeeee;
-}
-
-.tabs-left > .nav-tabs .active > a,
-.tabs-left > .nav-tabs .active > a:hover {
-  border-color: #ddd transparent #ddd #ddd;
-  *border-right-color: #ffffff;
-}
-
-.tabs-right > .nav-tabs {
-  float: right;
-  margin-left: 19px;
-  border-left: 1px solid #ddd;
-}
-
-.tabs-right > .nav-tabs > li > a {
-  margin-left: -1px;
-  -webkit-border-radius: 0 4px 4px 0;
-     -moz-border-radius: 0 4px 4px 0;
-          border-radius: 0 4px 4px 0;
-}
-
-.tabs-right > .nav-tabs > li > a:hover {
-  border-color: #eeeeee #eeeeee #eeeeee #dddddd;
-}
-
-.tabs-right > .nav-tabs .active > a,
-.tabs-right > .nav-tabs .active > a:hover {
-  border-color: #ddd #ddd #ddd transparent;
-  *border-left-color: #ffffff;
-}
-
-.navbar {
-  *position: relative;
-  *z-index: 2;
-  margin-bottom: 18px;
-  overflow: visible;
-}
-
-.navbar-inner {
-  min-height: 40px;
-  padding-right: 20px;
-  padding-left: 20px;
-  background-color: #2c2c2c;
-  background-image: -moz-linear-gradient(top, #333333, #222222);
-  background-image: -ms-linear-gradient(top, #333333, #222222);
-  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#333333), to(#222222));
-  background-image: -webkit-linear-gradient(top, #333333, #222222);
-  background-image: -o-linear-gradient(top, #333333, #222222);
-  background-image: linear-gradient(top, #333333, #222222);
-  background-repeat: repeat-x;
-  -webkit-border-radius: 4px;
-     -moz-border-radius: 4px;
-          border-radius: 4px;
-  filter: progid:dximagetransform.microsoft.gradient(startColorstr='#333333', endColorstr='#222222', GradientType=0);
-  -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), inset 0 -1px 0 rgba(0, 0, 0, 0.1);
-     -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), inset 0 -1px 0 rgba(0, 0, 0, 0.1);
-          box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), inset 0 -1px 0 rgba(0, 0, 0, 0.1);
-}
-
-.navbar .container {
-  width: auto;
-}
-
-.nav-collapse.collapse {
-  height: auto;
-}
-
-.navbar {
-  color: #999999;
-}
-
-.navbar .brand:hover {
-  text-decoration: none;
-}
-
-.navbar .brand {
-  display: block;
-  float: left;
-  padding: 8px 20px 12px;
-  margin-left: -20px;
-  font-size: 20px;
-  font-weight: 200;
-  line-height: 1;
-  color: #999999;
-}
-
-.navbar .navbar-text {
-  margin-bottom: 0;
-  line-height: 40px;
-}
-
-.navbar .navbar-link {
-  color: #999999;
-}
-
-.navbar .navbar-link:hover {
-  color: #ffffff;
-}
-
-.navbar .btn,
-.navbar .btn-group {
-  margin-top: 5px;
-}
-
-.navbar .btn-group .btn {
-  margin: 0;
-}
-
-.navbar-form {
-  margin-bottom: 0;
-  *zoom: 1;
-}
-
-.navbar-form:before,
-.navbar-form:after {
-  display: table;
-  content: "";
-}
-
-.navbar-form:after {
-  clear: both;
-}
-
-.navbar-form input,
-.navbar-form select,
-.navbar-form .radio,
-.navbar-form .checkbox {
-  margin-top: 5px;
-}
-
-.navbar-form input,
-.navbar-form select {
-  display: inline-block;
-  margin-bottom: 0;
-}
-
-.navbar-form input[type="image"],
-.navbar-form input[type="checkbox"],
-.navbar-form input[type="radio"] {
-  margin-top: 3px;
-}
-
-.navbar-form .input-append,
-.navbar-form .input-prepend {
-  margin-top: 6px;
-  white-space: nowrap;
-}
-
-.navbar-form .input-append input,
-.navbar-form .input-prepend input {
-  margin-top: 0;
-}
-
-.navbar-search {
-  position: relative;
-  float: left;
-  margin-top: 6px;
-  margin-bottom: 0;
-}
-
-.navbar-search .search-query {
-  padding: 4px 9px;
-  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
-  font-size: 13px;
-  font-weight: normal;
-  line-height: 1;
-  color: #ffffff;
-  background-color: #626262;
-  border: 1px solid #151515;
-  -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0 rgba(255, 255, 255, 0.15);
-     -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0 rgba(255, 255, 255, 0.15);
-          box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0 rgba(255, 255, 255, 0.15);
-  -webkit-transition: none;
-     -moz-transition: none;
-      -ms-transition: none;
-       -o-transition: none;
-          transition: none;
-}
-
-.navbar-search .search-query:-moz-placeholder {
-  color: #cccccc;
-}
-
-.navbar-search .search-query:-ms-input-placeholder {
-  color: #cccccc;
-}
-
-.navbar-search .search-query::-webkit-input-placeholder {
-  color: #cccccc;
-}
-
-.navbar-search .search-query:focus,
-.navbar-search .search-query.focused {
-  padding: 5px 10px;
-  color: #333333;
-  text-shadow: 0 1px 0 #ffffff;
-  background-color: #ffffff;
-  border: 0;
-  outline: 0;
-  -webkit-box-shadow: 0 0 3px rgba(0, 0, 0, 0.15);
-     -moz-box-shadow: 0 0 3px rgba(0, 0, 0, 0.15);
-          box-shadow: 0 0 3px rgba(0, 0, 0, 0.15);
-}
-
-.navbar-fixed-top,
-.navbar-fixed-bottom {
-  position: fixed;
-  right: 0;
-  left: 0;
-  z-index: 1030;
-  margin-bottom: 0;
-}
-
-.navbar-fixed-top .navbar-inner,
-.navbar-fixed-bottom .navbar-inner {
-  padding-right: 0;
-  padding-left: 0;
-  -webkit-border-radius: 0;
-     -moz-border-radius: 0;
-          border-radius: 0;
-}
-
-.navbar-fixed-top .container,
-.navbar-fixed-bottom .container {
-  width: 940px;
-}
-
-.navbar-fixed-top {
-  top: 0;
-}
-
-.navbar-fixed-bottom {
-  bottom: 0;
-}
-
-.navbar .nav {
-  position: relative;
-  left: 0;
-  display: block;
-  float: left;
-  margin: 0 10px 0 0;
-}
-
-.navbar .nav.pull-right {
-  float: right;
-}
-
-.navbar .nav > li {
-  display: block;
-  float: left;
-}
-
-.navbar .nav > li > a {
-  float: none;
-  padding: 9px 10px 11px;
-  line-height: 19px;
-  color: #999999;
-  text-decoration: none;
-  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
-}
-
-.navbar .btn {
-  display: inline-block;
-  padding: 4px 10px 4px;
-  margin: 5px 5px 6px;
-  line-height: 18px;
-}
-
-.navbar .btn-group {
-  padding: 5px 5px 6px;
-  margin: 0;
-}
-
-.navbar .nav > li > a:hover {
-  color: #ffffff;
-  text-decoration: none;
-  background-color: transparent;
-}
-
-.navbar .nav .active > a,
-.navbar .nav .active > a:hover {
-  color: #ffffff;
-  text-decoration: none;
-  background-color: #222222;
-}
-
-.navbar .divider-vertical {
-  width: 1px;
-  height: 40px;
-  margin: 0 9px;
-  overflow: hidden;
-  background-color: #222222;
-  border-right: 1px solid #333333;
-}
-
-.navbar .nav.pull-right {
-  margin-right: 0;
-  margin-left: 10px;
-}
-
-.navbar .btn-navbar {
-  display: none;
-  float: right;
-  padding: 7px 10px;
-  margin-right: 5px;
-  margin-left: 5px;
-  background-color: #2c2c2c;
-  *background-color: #222222;
-  background-image: -ms-linear-gradient(top, #333333, #222222);
-  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#333333), to(#222222));
-  background-image: -webkit-linear-gradient(top, #333333, #222222);
-  background-image: -o-linear-gradient(top, #333333, #222222);
-  background-image: linear-gradient(top, #333333, #222222);
-  background-image: -moz-linear-gradient(top, #333333, #222222);
-  background-repeat: repeat-x;
-  border-color: #222222 #222222 #000000;
-  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
-  filter: progid:dximagetransform.microsoft.gradient(startColorstr='#333333', endColorstr='#222222', GradientType=0);
-  filter: progid:dximagetransform.microsoft.gradient(enabled=false);
-  -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075);
-     -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075);
-          box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075);
-}
-
-.navbar .btn-navbar:hover,
-.navbar .btn-navbar:active,
-.navbar .btn-navbar.active,
-.navbar .btn-navbar.disabled,
-.navbar .btn-navbar[disabled] {
-  background-color: #222222;
-  *background-color: #151515;
-}
-
-.navbar .btn-navbar:active,
-.navbar .btn-navbar.active {
-  background-color: #080808 \9;
-}
-
-.navbar .btn-navbar .icon-bar {
-  display: block;
-  width: 18px;
-  height: 2px;
-  background-color: #f5f5f5;
-  -webkit-border-radius: 1px;
-     -moz-border-radius: 1px;
-          border-radius: 1px;
-  -webkit-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
-     -moz-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
-          box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
-}
-
-.btn-navbar .icon-bar + .icon-bar {
-  margin-top: 3px;
-}
-
-.navbar .dropdown-menu:before {
-  position: absolute;
-  top: -7px;
-  left: 9px;
-  display: inline-block;
-  border-right: 7px solid transparent;
-  border-bottom: 7px solid #ccc;
-  border-left: 7px solid transparent;
-  border-bottom-color: rgba(0, 0, 0, 0.2);
-  content: '';
-}
-
-.navbar .dropdown-menu:after {
-  position: absolute;
-  top: -6px;
-  left: 10px;
-  display: inline-block;
-  border-right: 6px solid transparent;
-  border-bottom: 6px solid #ffffff;
-  border-left: 6px solid transparent;
-  content: '';
-}
-
-.navbar-fixed-bottom .dropdown-menu:before {
-  top: auto;
-  bottom: -7px;
-  border-top: 7px solid #ccc;
-  border-bottom: 0;
-  border-top-color: rgba(0, 0, 0, 0.2);
-}
-
-.navbar-fixed-bottom .dropdown-menu:after {
-  top: auto;
-  bottom: -6px;
-  border-top: 6px solid #ffffff;
-  border-bottom: 0;
-}
-
-.navbar .nav li.dropdown .dropdown-toggle .caret,
-.navbar .nav li.dropdown.open .caret {
-  border-top-color: #ffffff;
-  border-bottom-color: #ffffff;
-}
-
-.navbar .nav li.dropdown.active .caret {
-  opacity: 1;
-  filter: alpha(opacity=100);
-}
-
-.navbar .nav li.dropdown.open > .dropdown-toggle,
-.navbar .nav li.dropdown.active > .dropdown-toggle,
-.navbar .nav li.dropdown.open.active > .dropdown-toggle {
-  background-color: transparent;
-}
-
-.navbar .nav li.dropdown.active > .dropdown-toggle:hover {
-  color: #ffffff;
-}
-
-.navbar .pull-right .dropdown-menu,
-.navbar .dropdown-menu.pull-right {
-  right: 0;
-  left: auto;
-}
-
-.navbar .pull-right .dropdown-menu:before,
-.navbar .dropdown-menu.pull-right:before {
-  right: 12px;
-  left: auto;
-}
-
-.navbar .pull-right .dropdown-menu:after,
-.navbar .dropdown-menu.pull-right:after {
-  right: 13px;
-  left: auto;
-}
-
-.breadcrumb {
-  padding: 7px 14px;
-  margin: 0 0 18px;
-  list-style: none;
-  background-color: #fbfbfb;
-  background-image: -moz-linear-gradient(top, #ffffff, #f5f5f5);
-  background-image: -ms-linear-gradient(top, #ffffff, #f5f5f5);
-  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#f5f5f5));
-  background-image: -webkit-linear-gradient(top, #ffffff, #f5f5f5);
-  background-image: -o-linear-gradient(top, #ffffff, #f5f5f5);
-  background-image: linear-gradient(top, #ffffff, #f5f5f5);
-  background-repeat: repeat-x;
-  border: 1px solid #ddd;
-  -webkit-border-radius: 3px;
-     -moz-border-radius: 3px;
-          border-radius: 3px;
-  filter: progid:dximagetransform.microsoft.gradient(startColorstr='#ffffff', endColorstr='#f5f5f5', GradientType=0);
-  -webkit-box-shadow: inset 0 1px 0 #ffffff;
-     -moz-box-shadow: inset 0 1px 0 #ffffff;
-          box-shadow: inset 0 1px 0 #ffffff;
-}
-
-.breadcrumb li {
-  display: inline-block;
-  *display: inline;
-  text-shadow: 0 1px 0 #ffffff;
-  *zoom: 1;
-}
-
-.breadcrumb .divider {
-  padding: 0 5px;
-  color: #999999;
-}
-
-.breadcrumb .active a {
-  color: #333333;
-}
-
-.pagination {
-  height: 36px;
-  margin: 18px 0;
-}
-
-.pagination ul {
-  display: inline-block;
-  *display: inline;
-  margin-bottom: 0;
-  margin-left: 0;
-  -webkit-border-radius: 3px;
-     -moz-border-radius: 3px;
-          border-radius: 3px;
-  *zoom: 1;
-  -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
-     -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
-          box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
-}
-
-.pagination li {
-  display: inline;
-}
-
-.pagination a {
-  float: left;
-  padding: 0 14px;
-  line-height: 34px;
-  text-decoration: none;
-  border: 1px solid #ddd;
-  border-left-width: 0;
-}
-
-.pagination a:hover,
-.pagination .active a {
-  background-color: #f5f5f5;
-}
-
-.pagination .active a {
-  color: #999999;
-  cursor: default;
-}
-
-.pagination .disabled span,
-.pagination .disabled a,
-.pagination .disabled a:hover {
-  color: #999999;
-  cursor: default;
-  background-color: transparent;
-}
-
-.pagination li:first-child a {
-  border-left-width: 1px;
-  -webkit-border-radius: 3px 0 0 3px;
-     -moz-border-radius: 3px 0 0 3px;
-          border-radius: 3px 0 0 3px;
-}
-
-.pagination li:last-child a {
-  -webkit-border-radius: 0 3px 3px 0;
-     -moz-border-radius: 0 3px 3px 0;
-          border-radius: 0 3px 3px 0;
-}
-
-.pagination-centered {
-  text-align: center;
-}
-
-.pagination-right {
-  text-align: right;
-}
-
-.pager {
-  margin-bottom: 18px;
-  margin-left: 0;
-  text-align: center;
-  list-style: none;
-  *zoom: 1;
-}
-
-.pager:before,
-.pager:after {
-  display: table;
-  content: "";
-}
-
-.pager:after {
-  clear: both;
-}
-
-.pager li {
-  display: inline;
-}
-
-.pager a {
-  display: inline-block;
-  padding: 5px 14px;
-  background-color: #fff;
-  border: 1px solid #ddd;
-  -webkit-border-radius: 15px;
-     -moz-border-radius: 15px;
-          border-radius: 15px;
-}
-
-.pager a:hover {
-  text-decoration: none;
-  background-color: #f5f5f5;
-}
-
-.pager .next a {
-  float: right;
-}
-
-.pager .previous a {
-  float: left;
-}
-
-.pager .disabled a,
-.pager .disabled a:hover {
-  color: #999999;
-  cursor: default;
-  background-color: #fff;
-}
-
-.modal-open .dropdown-menu {
-  z-index: 2050;
-}
-
-.modal-open .dropdown.open {
-  *z-index: 2050;
-}
-
-.modal-open .popover {
-  z-index: 2060;
-}
-
-.modal-open .tooltip {
-  z-index: 2070;
-}
-
-.modal-backdrop {
-  position: fixed;
-  top: 0;
-  right: 0;
-  bottom: 0;
-  left: 0;
-  z-index: 1040;
-  background-color: #000000;
-}
-
-.modal-backdrop.fade {
-  opacity: 0;
-}
-
-.modal-backdrop,
-.modal-backdrop.fade.in {
-  opacity: 0.8;
-  filter: alpha(opacity=80);
-}
-
-.modal {
-  position: fixed;
-  top: 50%;
-  left: 50%;
-  z-index: 1050;
-  width: 560px;
-  margin: -250px 0 0 -280px;
-  overflow: auto;
-  background-color: #ffffff;
-  border: 1px solid #999;
-  border: 1px solid rgba(0, 0, 0, 0.3);
-  *border: 1px solid #999;
-  -webkit-border-radius: 6px;
-     -moz-border-radius: 6px;
-          border-radius: 6px;
-  -webkit-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);
-     -moz-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);
-          box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);
-  -webkit-background-clip: padding-box;
-     -moz-background-clip: padding-box;
-          background-clip: padding-box;
-}
-
-.modal.fade {
-  top: -25%;
-  -webkit-transition: opacity 0.3s linear, top 0.3s ease-out;
-     -moz-transition: opacity 0.3s linear, top 0.3s ease-out;
-      -ms-transition: opacity 0.3s linear, top 0.3s ease-out;
-       -o-transition: opacity 0.3s linear, top 0.3s ease-out;
-          transition: opacity 0.3s linear, top 0.3s ease-out;
-}
-
-.modal.fade.in {
-  top: 50%;
-}
-
-.modal-header {
-  padding: 9px 15px;
-  border-bottom: 1px solid #eee;
-}
-
-.modal-header .close {
-  margin-top: 2px;
-}
-
-.modal-body {
-  max-height: 400px;
-  padding: 15px;
-  overflow-y: auto;
-}
-
-.modal-form {
-  margin-bottom: 0;
-}
-
-.modal-footer {
-  padding: 14px 15px 15px;
-  margin-bottom: 0;
-  text-align: right;
-  background-color: #f5f5f5;
-  border-top: 1px solid #ddd;
-  -webkit-border-radius: 0 0 6px 6px;
-     -moz-border-radius: 0 0 6px 6px;
-          border-radius: 0 0 6px 6px;
-  *zoom: 1;
-  -webkit-box-shadow: inset 0 1px 0 #ffffff;
-     -moz-box-shadow: inset 0 1px 0 #ffffff;
-          box-shadow: inset 0 1px 0 #ffffff;
-}
-
-.modal-footer:before,
-.modal-footer:after {
-  display: table;
-  content: "";
-}
-
-.modal-footer:after {
-  clear: both;
-}
-
-.modal-footer .btn + .btn {
-  margin-bottom: 0;
-  margin-left: 5px;
-}
-
-.modal-footer .btn-group .btn + .btn {
-  margin-left: -1px;
-}
-
-.tooltip {
-  position: absolute;
-  z-index: 1020;
-  display: block;
-  padding: 5px;
-  font-size: 11px;
-  opacity: 0;
-  filter: alpha(opacity=0);
-  visibility: visible;
-}
-
-.tooltip.in {
-  opacity: 0.8;
-  filter: alpha(opacity=80);
-}
-
-.tooltip.top {
-  margin-top: -2px;
-}
-
-.tooltip.right {
-  margin-left: 2px;
-}
-
-.tooltip.bottom {
-  margin-top: 2px;
-}
-
-.tooltip.left {
-  margin-left: -2px;
-}
-
-.tooltip.top .tooltip-arrow {
-  bottom: 0;
-  left: 50%;
-  margin-left: -5px;
-  border-top: 5px solid #000000;
-  border-right: 5px solid transparent;
-  border-left: 5px solid transparent;
-}
-
-.tooltip.left .tooltip-arrow {
-  top: 50%;
-  right: 0;
-  margin-top: -5px;
-  border-top: 5px solid transparent;
-  border-bottom: 5px solid transparent;
-  border-left: 5px solid #000000;
-}
-
-.tooltip.bottom .tooltip-arrow {
-  top: 0;
-  left: 50%;
-  margin-left: -5px;
-  border-right: 5px solid transparent;
-  border-bottom: 5px solid #000000;
-  border-left: 5px solid transparent;
-}
-
-.tooltip.right .tooltip-arrow {
-  top: 50%;
-  left: 0;
-  margin-top: -5px;
-  border-top: 5px solid transparent;
-  border-right: 5px solid #000000;
-  border-bottom: 5px solid transparent;
-}
-
-.tooltip-inner {
-  max-width: 200px;
-  padding: 3px 8px;
-  color: #ffffff;
-  text-align: center;
-  text-decoration: none;
-  background-color: #000000;
-  -webkit-border-radius: 4px;
-     -moz-border-radius: 4px;
-          border-radius: 4px;
-}
-
-.tooltip-arrow {
-  position: absolute;
-  width: 0;
-  height: 0;
-}
-
-.popover {
-  position: absolute;
-  top: 0;
-  left: 0;
-  z-index: 1010;
-  display: none;
-  padding: 5px;
-}
-
-.popover.top {
-  margin-top: -5px;
-}
-
-.popover.right {
-  margin-left: 5px;
-}
-
-.popover.bottom {
-  margin-top: 5px;
-}
-
-.popover.left {
-  margin-left: -5px;
-}
-
-.popover.top .arrow {
-  bottom: 0;
-  left: 50%;
-  margin-left: -5px;
-  border-top: 5px solid #000000;
-  border-right: 5px solid transparent;
-  border-left: 5px solid transparent;
-}
-
-.popover.right .arrow {
-  top: 50%;
-  left: 0;
-  margin-top: -5px;
-  border-top: 5px solid transparent;
-  border-right: 5px solid #000000;
-  border-bottom: 5px solid transparent;
-}
-
-.popover.bottom .arrow {
-  top: 0;
-  left: 50%;
-  margin-left: -5px;
-  border-right: 5px solid transparent;
-  border-bottom: 5px solid #000000;
-  border-left: 5px solid transparent;
-}
-
-.popover.left .arrow {
-  top: 50%;
-  right: 0;
-  margin-top: -5px;
-  border-top: 5px solid transparent;
-  border-bottom: 5px solid transparent;
-  border-left: 5px solid #000000;
-}
-
-.popover .arrow {
-  position: absolute;
-  width: 0;
-  height: 0;
-}
-
-.popover-inner {
-  width: 280px;
-  padding: 3px;
-  overflow: hidden;
-  background: #000000;
-  background: rgba(0, 0, 0, 0.8);
-  -webkit-border-radius: 6px;
-     -moz-border-radius: 6px;
-          border-radius: 6px;
-  -webkit-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);
-     -moz-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);
-          box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);
-}
-
-.popover-title {
-  padding: 9px 15px;
-  line-height: 1;
-  background-color: #f5f5f5;
-  border-bottom: 1px solid #eee;
-  -webkit-border-radius: 3px 3px 0 0;
-     -moz-border-radius: 3px 3px 0 0;
-          border-radius: 3px 3px 0 0;
-}
-
-.popover-content {
-  padding: 14px;
-  background-color: #ffffff;
-  -webkit-border-radius: 0 0 3px 3px;
-     -moz-border-radius: 0 0 3px 3px;
-          border-radius: 0 0 3px 3px;
-  -webkit-background-clip: padding-box;
-     -moz-background-clip: padding-box;
-          background-clip: padding-box;
-}
-
-.popover-content p,
-.popover-content ul,
-.popover-content ol {
-  margin-bottom: 0;
-}
-
-.thumbnails {
-  margin-left: -20px;
-  list-style: none;
-  *zoom: 1;
-}
-
-.thumbnails:before,
-.thumbnails:after {
-  display: table;
-  content: "";
-}
-
-.thumbnails:after {
-  clear: both;
-}
-
-.row-fluid .thumbnails {
-  margin-left: 0;
-}
-
-.thumbnails > li {
-  float: left;
-  margin-bottom: 18px;
-  margin-left: 20px;
-}
-
-.thumbnail {
-  display: block;
-  padding: 4px;
-  line-height: 1;
-  border: 1px solid #ddd;
-  -webkit-border-radius: 4px;
-     -moz-border-radius: 4px;
-          border-radius: 4px;
-  -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075);
-     -moz-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075);
-          box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075);
-}
-
-a.thumbnail:hover {
-  border-color: #0088cc;
-  -webkit-box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25);
-     -moz-box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25);
-          box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25);
-}
-
-.thumbnail > img {
-  display: block;
-  max-width: 100%;
-  margin-right: auto;
-  margin-left: auto;
-}
-
-.thumbnail .caption {
-  padding: 9px;
-}
-
-.label,
-.badge {
-  font-size: 10.998px;
-  font-weight: bold;
-  line-height: 14px;
-  color: #ffffff;
-  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
-  white-space: nowrap;
-  vertical-align: baseline;
-  background-color: #999999;
-}
-
-.label {
-  padding: 1px 4px 2px;
-  -webkit-border-radius: 3px;
-     -moz-border-radius: 3px;
-          border-radius: 3px;
-}
-
-.badge {
-  padding: 1px 9px 2px;
-  -webkit-border-radius: 9px;
-     -moz-border-radius: 9px;
-          border-radius: 9px;
-}
-
-a.label:hover,
-a.badge:hover {
-  color: #ffffff;
-  text-decoration: none;

<TRUNCATED>

[18/51] [abbrv] [partial] brooklyn-ui git commit: move subdir from incubator up a level as it is promoted to its own repo (first non-incubator commit!)

Posted by he...@apache.org.
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/license/README.md
----------------------------------------------------------------------
diff --git a/src/main/license/README.md b/src/main/license/README.md
new file mode 100644
index 0000000..2714c67
--- /dev/null
+++ b/src/main/license/README.md
@@ -0,0 +1,7 @@
+
+This directory contains files to generate the custom license for this project.
+The files/ subdir contains the artifacts which are included in the JAR, some
+autogenerated by the dist/licensing scripts.
+
+See usage/dist/licensing/README.md for more information.
+

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/license/files/DISCLAIMER
----------------------------------------------------------------------
diff --git a/src/main/license/files/DISCLAIMER b/src/main/license/files/DISCLAIMER
new file mode 100644
index 0000000..9e6119b
--- /dev/null
+++ b/src/main/license/files/DISCLAIMER
@@ -0,0 +1,8 @@
+
+Apache Brooklyn is an effort undergoing incubation at The Apache Software Foundation (ASF), 
+sponsored by the Apache Incubator. Incubation is required of all newly accepted projects until 
+a further review indicates that the infrastructure, communications, and decision making process 
+have stabilized in a manner consistent with other successful ASF projects. While incubation 
+status is not necessarily a reflection of the completeness or stability of the code, it does 
+indicate that the project has yet to be fully endorsed by the ASF.
+

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/license/files/LICENSE
----------------------------------------------------------------------
diff --git a/src/main/license/files/LICENSE b/src/main/license/files/LICENSE
new file mode 100644
index 0000000..58c78f1
--- /dev/null
+++ b/src/main/license/files/LICENSE
@@ -0,0 +1,440 @@
+
+This software is distributed under the Apache License, version 2.0. See (1) below.
+This software is copyright (c) The Apache Software Foundation and contributors.
+
+Contents:
+
+  (1) This software license: Apache License, version 2.0
+  (2) Notices for bundled software
+  (3) Licenses for bundled software
+
+
+---------------------------------------------------
+
+(1) This software license: Apache License, version 2.0
+
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+
+---------------------------------------------------
+
+(2) Notices for bundled software
+
+This project includes the software: async.js
+  Available at: https://github.com/p15martin/google-maps-hello-world/blob/master/js/libs/async.js
+  Developed by: Miller Medeiros (https://github.com/millermedeiros/)
+  Version used: 0.1.1
+  Used under the following license: The MIT License (http://opensource.org/licenses/MIT)
+  Copyright (c) Miller Medeiros (2011)
+
+This project includes the software: backbone.js
+  Available at: http://backbonejs.org
+  Developed by: DocumentCloud Inc. (http://www.documentcloud.org/)
+  Version used: 1.0.0
+  Used under the following license: The MIT License (http://opensource.org/licenses/MIT)
+  Copyright (c) Jeremy Ashkenas, DocumentCloud Inc. (2010-2013)
+
+This project includes the software: bootstrap.js
+  Available at: http://twitter.github.com/bootstrap/javascript.html#transitions
+  Version used: 2.0.4
+  Used under the following license: Apache License, version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
+  Copyright (c) Twitter, Inc. (2012)
+
+This project includes the software: handlebars.js
+  Available at: https://github.com/wycats/handlebars.js
+  Developed by: Yehuda Katz (https://github.com/wycats/)
+  Inclusive of: handlebars*.js
+  Version used: 1.0-rc1
+  Used under the following license: The MIT License (http://opensource.org/licenses/MIT)
+  Copyright (c) Yehuda Katz (2012)
+
+This project includes the software: jQuery JavaScript Library
+  Available at: http://jquery.com/
+  Developed by: The jQuery Foundation (http://jquery.org/)
+  Inclusive of: jquery.js
+  Version used: 1.7.2
+  Used under the following license: The MIT License (http://opensource.org/licenses/MIT)
+  Copyright (c) John Resig (2005-2011)
+  Includes code fragments from sizzle.js:
+    Copyright (c) The Dojo Foundation
+    Available at http://sizzlejs.com
+    Used under the MIT license
+
+This project includes the software: jQuery BBQ: Back Button & Query Library
+  Available at: http://benalman.com/projects/jquery-bbq-plugin/
+  Developed by: "Cowboy" Ben Alman (http://benalman.com/)
+  Inclusive of: jquery.ba-bbq*.js
+  Version used: 1.2.1
+  Used under the following license: The MIT License (http://opensource.org/licenses/MIT)
+  Copyright (c) "Cowboy" Ben Alman (2010)"
+
+This project includes the software: DataTables Table plug-in for jQuery
+  Available at: http://www.datatables.net/
+  Developed by: SpryMedia Ltd (http://sprymedia.co.uk/)
+  Inclusive of: jquery.dataTables.{js,css}
+  Version used: 1.9.4
+  Used under the following license: The BSD 3-Clause (New BSD) License (http://opensource.org/licenses/BSD-3-Clause)
+  Copyright (c) Allan Jardine (2008-2012)
+
+This project includes the software: jQuery Form Plugin
+  Available at: https://github.com/malsup/form
+  Developed by: Mike Alsup (http://malsup.com/)
+  Inclusive of: jquery.form.js
+  Version used: 3.09
+  Used under the following license: The MIT License (http://opensource.org/licenses/MIT)
+  Copyright (c) M. Alsup (2006-2013)
+
+This project includes the software: jQuery Wiggle
+  Available at: https://github.com/jordanthomas/jquery-wiggle
+  Inclusive of: jquery.wiggle.min.js
+  Version used: swagger-ui:1.0.1
+  Used under the following license: The MIT License (http://opensource.org/licenses/MIT)
+  Copyright (c) WonderGroup and Jordan Thomas (2010)
+  Previously online at http://labs.wondergroup.com/demos/mini-ui/index.html.
+  The version included here is from the Swagger UI distribution.
+
+This project includes the software: js-uri
+  Available at: http://code.google.com/p/js-uri/
+  Developed by: js-uri contributors (https://code.google.com/js-uri)
+  Inclusive of: URI.js
+  Version used: 0.1
+  Used under the following license: The BSD 3-Clause (New BSD) License (http://opensource.org/licenses/BSD-3-Clause)
+  Copyright (c) js-uri contributors (2013)
+
+This project includes the software: js-yaml.js
+  Available at: https://github.com/nodeca/
+  Developed by: Vitaly Puzrin (https://github.com/nodeca/)
+  Version used: 3.2.7
+  Used under the following license: The MIT License (http://opensource.org/licenses/MIT)
+  Copyright (c) Vitaly Puzrin (2011-2015)
+
+This project includes the software: marked.js
+  Available at: https://github.com/chjj/marked
+  Developed by: Christopher Jeffrey (https://github.com/chjj)
+  Version used: 0.3.1
+  Used under the following license: The MIT License (http://opensource.org/licenses/MIT)
+  Copyright (c) Christopher Jeffrey (2011-2014)
+
+This project includes the software: moment.js
+  Available at: http://momentjs.com
+  Developed by: Tim Wood (http://momentjs.com)
+  Version used: 2.1.0
+  Used under the following license: The MIT License (http://opensource.org/licenses/MIT)
+  Copyright (c) Tim Wood, Iskren Chernev, Moment.js contributors (2011-2014)
+
+This project includes the software: RequireJS
+  Available at: http://requirejs.org/
+  Developed by: The Dojo Foundation (http://dojofoundation.org/)
+  Inclusive of: require.js, text.js
+  Version used: 2.0.6
+  Used under the following license: The MIT License (http://opensource.org/licenses/MIT)
+  Copyright (c) The Dojo Foundation (2010-2012)
+
+This project includes the software: RequireJS (r.js maven plugin)
+  Available at: http://github.com/jrburke/requirejs
+  Developed by: The Dojo Foundation (http://dojofoundation.org/)
+  Inclusive of: r.js
+  Version used: 2.1.6
+  Used under the following license: The MIT License (http://opensource.org/licenses/MIT)
+  Copyright (c) The Dojo Foundation (2009-2013)
+  Includes code fragments for source-map and other functionality:
+    Copyright (c) The Mozilla Foundation and contributors (2011)
+    Used under the BSD 2-Clause license.
+  Includes code fragments for parse-js and other functionality:
+    Copyright (c) Mihai Bazon (2010, 2012)
+    Used under the BSD 2-Clause license.
+  Includes code fragments for uglifyjs/consolidator:
+    Copyright (c) Robert Gust-Bardon (2012)
+    Used under the BSD 2-Clause license.
+  Includes code fragments for the esprima parser:
+    Copyright (c):
+      Ariya Hidayat (2011, 2012)
+      Mathias Bynens (2012)
+      Joost-Wim Boekesteijn (2012)
+      Kris Kowal (2012)
+      Yusuke Suzuki (2012)
+      Arpad Borsos (2012)
+    Used under the BSD 2-Clause license.
+
+This project includes the software: Swagger UI
+  Available at: https://github.com/swagger-api/swagger-ui
+  Inclusive of: swagger*.{js,css,html}
+  Version used: 2.1.4
+  Used under the following license: Apache License, version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
+  Copyright (c) SmartBear Software (2011-2015)
+
+This project includes the software: underscore.js
+  Available at: http://underscorejs.org
+  Developed by: DocumentCloud Inc. (http://www.documentcloud.org/)
+  Inclusive of: underscore*.{js,map}
+  Version used: 1.4.4
+  Used under the following license: The MIT License (http://opensource.org/licenses/MIT)
+  Copyright (c) Jeremy Ashkenas, DocumentCloud Inc. (2009-2013)
+
+This project includes the software: ZeroClipboard
+  Available at: http://zeroclipboard.org/
+  Developed by: ZeroClipboard contributors (https://github.com/zeroclipboard)
+  Inclusive of: ZeroClipboard.*
+  Version used: 1.3.1
+  Used under the following license: The MIT License (http://opensource.org/licenses/MIT)
+  Copyright (c) Jon Rohan, James M. Greene (2014)
+
+
+---------------------------------------------------
+
+(3) Licenses for bundled software
+
+Contents:
+
+  The BSD 2-Clause License
+  The BSD 3-Clause License ("New BSD")
+  The MIT License ("MIT")
+
+
+The BSD 2-Clause License
+
+  Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions are met:
+  
+  1. Redistributions of source code must retain the above copyright notice, this
+  list of conditions and the following disclaimer.
+  
+  2. Redistributions in binary form must reproduce the above copyright notice,
+  this list of conditions and the following disclaimer in the documentation
+  and/or other materials provided with the distribution.
+  
+  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+  
+
+The BSD 3-Clause License ("New BSD")
+
+  Redistribution and use in source and binary forms, with or without modification,
+  are permitted provided that the following conditions are met:
+  
+  1. Redistributions of source code must retain the above copyright notice, 
+  this list of conditions and the following disclaimer.
+  
+  2. Redistributions in binary form must reproduce the above copyright notice, 
+  this list of conditions and the following disclaimer in the documentation 
+  and/or other materials provided with the distribution.
+  
+  3. Neither the name of the copyright holder nor the names of its contributors 
+  may be used to endorse or promote products derived from this software without 
+  specific prior written permission.
+  
+  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
+  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
+  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
+  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
+  POSSIBILITY OF SUCH DAMAGE.
+  
+
+The MIT License ("MIT")
+
+  Permission is hereby granted, free of charge, to any person obtaining a copy
+  of this software and associated documentation files (the "Software"), to deal
+  in the Software without restriction, including without limitation the rights
+  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+  copies of the Software, and to permit persons to whom the Software is
+  furnished to do so, subject to the following conditions:
+  
+  The above copyright notice and this permission notice shall be included in
+  all copies or substantial portions of the Software.
+  
+  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+  THE SOFTWARE.
+  
+

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/license/files/NOTICE
----------------------------------------------------------------------
diff --git a/src/main/license/files/NOTICE b/src/main/license/files/NOTICE
new file mode 100644
index 0000000..f790f13
--- /dev/null
+++ b/src/main/license/files/NOTICE
@@ -0,0 +1,5 @@
+Apache Brooklyn
+Copyright 2014-2015 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/license/source-inclusions.yaml
----------------------------------------------------------------------
diff --git a/src/main/license/source-inclusions.yaml b/src/main/license/source-inclusions.yaml
new file mode 100644
index 0000000..8c1945c
--- /dev/null
+++ b/src/main/license/source-inclusions.yaml
@@ -0,0 +1,42 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#  http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+# extras file for org.heneveld.license-audit-maven-plugin
+# listing projects from which *source* files are included
+
+- id: jquery-core:1.7.2
+- id: swagger-ui:2.1.4
+# we use other versions of the above in other projs
+
+- id: jquery.wiggle.min.js
+- id: require.js
+- id: require.js/r.js
+- id: backbone.js
+- id: bootstrap.js
+- id: underscore.js
+- id: async.js
+- id: handlebars.js
+- id: jquery.ba-bbq.js
+- id: moment.js
+- id: ZeroClipboard
+- id: jquery.dataTables
+- id: js-uri
+- id: js-yaml.js
+- id: jquery.form.js
+- id: marked.js

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000..02e7fcc
--- /dev/null
+++ b/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,24 @@
+<!DOCTYPE web-app PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd" >
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+     http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+<web-app>
+  <display-name>Brooklyn</display-name>
+</web-app>

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/css/base.css
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/css/base.css b/src/main/webapp/assets/css/base.css
new file mode 100644
index 0000000..a80f35b
--- /dev/null
+++ b/src/main/webapp/assets/css/base.css
@@ -0,0 +1,1488 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+*/
+/* landing page */
+.logo {
+    float: left;
+}
+
+.menubar-top {
+    display: inline-block;
+    vertical-align: bottom;
+    float: right;
+    text-align: right;
+    padding-top: 30px;
+    padding-right: 60px;
+}
+
+#main-content {
+    position: relative;
+}
+
+#application-content {
+    margin-top: 40px;
+    margin-bottom: 40px;
+}
+.add-app .modal-body {
+    padding: 0;
+}
+.add-app .modal-header{
+    border-bottom: 0;
+}
+.add-app .modal-footer {
+    min-height: 20px;
+}
+
+.add-app .tab-content-scroller {
+    overflow: auto !important;
+}
+#application-content div#details {
+    margin-left: 8px !important;
+}
+#application-content .deploy,
+#application-content .preview {
+    padding: 15px;
+}
+#application-content .tab-content {
+    /* easier to scroll in the main window; but if we wanted to prevent it, we could with this */
+    /* max-height: 720px; */
+    overflow: auto;
+}
+
+#modal-container .tab-content {
+    max-height: 300px;
+    overflow: auto;
+}
+
+#application-content .template-lozenge {
+    cursor: hand; cursor: pointer;
+}
+#application-content div.template-lozenge.frame {
+    display: inline-block;
+    border: 3px solid #EEE;
+    border-radius: 4px;
+    width: 212px;
+    overflow: auto;
+    margin: 4px;
+    padding: 3px;
+    clear: right;
+    float: left;   
+}
+#application-content div.template-lozenge div.icon {
+    margin: 2px 8px 2px 2px;
+}
+#application-content div.template-lozenge div.icon img {
+    max-width: 50px;
+    max-height: 50px;
+    margin-top: 15px;
+}
+#application-content .template-lozenge.frame:hover {
+    border: 3px solid #CCC;
+}
+#application-content .template-lozenge.frame.selected {
+    border: 3px solid #793;
+}
+#application-content .template-lozenge .icon {
+    float: left;
+}
+#application-content .template-lozenge .blurb {
+    overflow-y: auto;
+    height: 80px;
+}
+#application-content .template-lozenge .title {
+    font-weight: 700;
+    font-size: 90%;
+}
+#application-content .template-lozenge .description {
+    font-size: 85%;
+}
+#preview_step {
+    margin-left: 18px;
+}
+#application-content .sensor-value,
+#application-content .config-value {
+    font-weight: 700;
+    max-width: 500px;
+    max-height: 40px;
+    white-space: nowrap;
+    overflow-x: hidden;
+    overflow-y: auto;
+}
+div#create-step-template-entries {
+    width: 472px;
+    margin-left: auto;
+    margin-right: auto;
+    padding-top: 12px;
+    padding-bottom: 36px;
+}
+div#catalog-applications-throbber {
+    margin-top: 100px;
+    text-align: center;
+}
+div#catalog-applications-empty {
+    margin-top: 100px;
+    text-align: center;
+}
+/* menu bar */
+.navbar .nav>li {
+    display: block;
+    float: left;
+    list-style: none;
+    margin: 15px 5px 0px 5px;
+}
+
+.navbar .nav>li>a:hover {
+    background-color: #A8B8B0;
+    foreground-color: #261;
+    color: #261;
+    text-decoration: none;
+    text-shadow: 0 0px 0;
+}
+
+.navbar .nav>li>a {
+    background-color: #261;
+    color: #F0F4E8;
+    padding: 5px 7px 0px 7px;
+    -webkit-border-radius: 5px 5px 0 0;
+    -moz-border-radius: 5px 5px 0 0;
+    border-radius: 5px 5px 0 0;
+    line-height: 19px;
+    text-decoration: none;
+    text-shadow: 0 0px 0;
+}
+.navbar .nav > li > a.active {
+    background-color: #492;
+}
+
+ul.dropdown-menu {
+    text-align: left;
+}
+
+.navbar .dropdown-menu li > a:hover, .dropdown-menu .active > a, .dropdown-menu .active > a:hover {
+    background-color: #58AA33; /* that seems necessary to result in the color we want, viz ~ 77AA3E; */
+}
+
+/* tabs eg catalog page */
+.nav-tabs>li,.nav-pills>li {
+    float: left;
+    margin: 0px 1px -1px 1px;
+}
+
+.nav-tabs {
+    border-bottom: 1px solid #DDD;
+    padding-left: 8px;
+    padding-right: 8px;
+    height: 35px;
+}
+
+.nav-tabs>li>a {
+    padding-top: 5px;
+    padding-bottom: 3px;
+    line-height: 18px;
+    border: 1px solid transparent;
+    -webkit-border-radius: 5px 5px 0 0;
+    -moz-border-radius: 5px 5px 0 0;
+    border-radius: 5px 5px 0 0;
+}
+
+li.text-filter input {
+    width: 10em;
+    margin-top: 3px;
+    /* taken from datatables_filter input */    
+    background-image: url("../img/magnifying-glass-right-icon.png");
+    background-size:12px 12px;
+    background-repeat: no-repeat;
+    background-position: 8px 5px;
+    font-size: 85%;
+    padding: 1px 4px 1px 24px;
+    margin-bottom: 2px;
+    -webkit-border-radius: 1em;
+    -moz-border-radius: 1em;
+    border-radius: 1em;
+}
+
+/* bootstrap overrides */
+a {
+    color: #382;
+}
+a:hover {
+    color: #65AA34;
+}
+code {
+    color: #273;
+}
+/* buttons (override bootstrap) */
+.btn-info {
+  background-color: #90C858;
+  *background-color: #609040;
+  background-image: -ms-linear-gradient(top, #90C858, #609040);
+  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#90C858), to(#609040));
+  background-image: -webkit-linear-gradient(top, #90C858, #609040);
+  background-image: -o-linear-gradient(top, #90C858, #609040);
+  background-image: -moz-linear-gradient(top, #90C858, #609040);
+  background-image: linear-gradient(top, #90C858, #609040);
+  background-repeat: repeat-x;
+  border-color: #609040 #609040 #609040;
+  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
+  filter: progid:dximagetransform.microsoft.gradient(startColorstr='#90C858', endColorstr='#609040', GradientType=0);
+  filter: progid:dximagetransform.microsoft.gradient(enabled=false);
+}
+
+.btn-info:hover,
+.btn-info:active,
+.btn-info.active,
+.btn-info.disabled,
+.btn-info[disabled] {
+  background-color: #609040;
+  *background-color: #508030;
+}
+
+.btn-info:active,
+.btn-info.active {
+  background-color: #508030 \9;
+}
+
+/* unchanged from bootstrap
+.btn-inverse {
+  background-color: #414141;
+  *background-color: #222222;
+  background-image: -ms-linear-gradient(top, #555555, #222222);
+  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#555555), to(#222222));
+  background-image: -webkit-linear-gradient(top, #555555, #222222);
+  background-image: -o-linear-gradient(top, #555555, #222222);
+  background-image: -moz-linear-gradient(top, #555555, #222222);
+  background-image: linear-gradient(top, #555555, #222222);
+  background-repeat: repeat-x;
+  border-color: #222222 #222222 #000000;
+  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
+  filter: progid:dximagetransform.microsoft.gradient(startColorstr='#555555', endColorstr='#222222', GradientType=0);
+  filter: progid:dximagetransform.microsoft.gradient(enabled=false);
+}
+
+.btn-inverse:hover,
+.btn-inverse:active,
+.btn-inverse.active,
+.btn-inverse.disabled,
+.btn-inverse[disabled] {
+  background-color: #222222;
+  *background-color: #151515;
+}
+
+.btn-inverse:active,
+.btn-inverse.active {
+  background-color: #080808 \9;
+}
+*/
+
+textarea:focus,input[type="text"]:focus,input[type="password"]:focus,
+input[type="datetime"]:focus,input[type="datetime-local"]:focus,input[type="date"]:focus,
+input[type="month"]:focus,input[type="time"]:focus,input[type="week"]:focus,input[type="number"]:focus,
+input[type="email"]:focus,input[type="url"]:focus,input[type="search"]:focus,input[type="tel"]:focus,
+input[type="color"]:focus,.uneditable-input:focus {
+    border-color: rgba(120, 180, 70, 0.8);
+    outline: 0;
+    outline: thin dotted 9;
+    -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px
+        rgba(120, 180, 70, 0.6);
+    -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px
+        rgba(120, 180, 70, 0.6);
+    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px
+        rgba(120, 180, 70, 0.6);
+}
+
+/* home page squares */
+
+/* HOME BODY */
+#application-content {
+    background-color: #e8e8e8 !important;
+    padding-top: 30px !important;
+}
+
+.home-first-row {
+    padding: 0px;
+}
+
+.home-summaries-row {
+    text-align: center;
+    margin: 0px 0px 30px 0px;
+}
+
+.roundedSummary {
+    float: left;
+    border: 1px solid #d4d4d4;
+    -webkit-border-radius: 15px;
+    -moz-border-radius: 15px;
+    border-radius: 15px;
+    background-color: #f7f6e8;
+    margin: 10px 15px 0px 0px;
+    padding: 20px 20px;
+    width: 264px;
+    height: 160px;
+    line-height: 1.2;
+    font-size: 140%;
+    display: inline-block;
+    text-align: left;
+    background: #f9f9f9 url(../images/roundedSummary-background.png) top
+        repeat-x !important;
+}
+
+.roundedSummary:last-child {
+    margin-right: 0px;
+}
+
+.roundedSummary:before { /* makes the summary vertically centered */
+    content: '';
+    display: inline-block;
+    height: 100%;
+    vertical-align: middle;
+    margin-right: 0px !important;
+    /* 
+    margin-right: -0.25em; 
+    adjusts for horiz spacing */
+}
+
+.roundedSummaryText {
+    display: inline-block;
+    vertical-align: middle;
+}
+
+.addApplication {
+    border: 1px solid #a1cb8c !important;
+    color: #505050 !important;
+    background: url(../images/addApplication-plus.png) no-repeat !important;
+    padding: 10px 0px 0px 74px !important;
+    width: 298px !important;
+    height: 201px !important;
+    margin-right: 0;
+}
+
+.addApplication:hover {
+    border: 1px solid #58a82e !important;
+    color: #58a82e !important;
+    background: url(../images/addApplication-plus-hover.png) no-repeat
+        !important;
+}
+
+.home-summaries-row {
+    padding: 0px 0px 0px 0px !important;
+    margin: 0px !important;
+}
+
+.big {
+    font-size: 180%;
+}
+
+.home-second-row {
+    background-color: #dddddd !important;
+    padding: 24px 0px 30px 0px !important;
+    border-top: 1px solid #efefef;
+    margin: 30px 0px 0px 0px;
+}
+
+.home-widgets-row {
+    text-align: center;
+}
+
+.map-container {
+    -webkit-border-radius: 13px 13px 13px 13px;
+    -moz-border-radius: 13px 13px 13px 13px;
+    border-radius: 13px 13px 13px 13px;
+    background-color: #f7f7f7;
+    border: 1px solid #d4d4d4;
+    padding: 13px !important;
+    width: 440px;
+    margin: 10px 0px 0px 13px !important;
+    display: inline-block;
+    text-align: left;
+    vertical-align: top;
+    margin: 0px 20px;
+}
+.circles-map {
+    height: 350px;
+    border : 2px solid #909490;
+    -webkit-border-radius: 2px 2px 2px 2px;
+    -moz-border-radius: 2px 2px 2px 2px;
+    border-radius: 2px 2px 2px 2px;
+}
+.circles-map-message:before { /* makes the message vertically centered */
+    content: '';
+    display: inline-block;
+    height: 100%;
+    vertical-align: middle;
+    margin-right: -0.25em; /* adjusts for horiz spacing */
+}
+.circles-map-message {
+    display: inline-block;
+    width: 100%;
+    height: 100%;
+    color: #888;
+    text-align: center;
+    vertical-align: middle;
+}
+#applications-table-body a {
+    color: inherit;
+}
+.apps-summary-container {
+    width: 440px;
+    display: inline-block;
+    text-align: left;
+    vertical-align: top;
+    display: inline-block;
+    margin: 10px -6px 0px 24px;
+    text-align: left;
+    vertical-align: top;
+}
+#new-application-resource {
+    text-align: right;
+}
+
+#reload-brooklyn-properties-resource {
+	text-align: right;
+}
+
+#clear-ha-node-records-resource {
+    text-align: right;
+}
+
+/* general pages */
+.sidebar_at_right {
+    border-right: 4px solid #BBB;
+}
+
+.sidebar_at_left {
+    border-left: 4px solid #BBB;
+    margin-left: -4px !important;
+    padding-left: 24px;
+}
+
+.nav-tabs {
+    margin-bottom: 0px;
+}
+.tab-content-scroller {
+    height: auto;
+    overflow: auto;
+}
+.tab-content {
+    padding: 12px 18px 18px 18px;
+    border-right: 1px solid #DDD;
+    border-left: 1px solid #DDD;
+    min-height: 300px;
+}
+
+.navbar_top {
+    background-color: #D0D8D0;
+    padding: 8px 12px 12px 12px;
+    -webkit-border-radius: 4px 4px 0 0;
+    -moz-border-radius: 4px 4px 0 0;
+    border-radius: 4px 4px 0 0;
+}
+.navbar_main_wrapper {
+    background-color: #F0F4F0;
+    -webkit-border-radius: 0 0 4px 4px;
+    -moz-border-radius: 0 0 4px 4px;
+    border-radius: 0 0 4px 4px;
+}
+.navbar_main {
+    overflow-x: auto;
+    margin: 0;
+    white-space: nowrap;
+}
+
+/* traditional tree-style (clickable + icons) tree-list */
+#tree-list {
+}
+ol.tree {
+    padding: 0;
+}
+#tree-list li input + ol {
+    background: url(../img/toggle-small-expand.png) 40px 5px no-repeat;
+    margin: -1.963em 0 0 -40px; !important;
+    padding: 1.563em 0 0 62px; !important;
+}
+#tree-list li input:checked + ol {
+    background: url(../img/toggle-small.png) 40px 5px no-repeat;
+}
+#tree-list li input + ol > li {
+    padding-left: 1px;
+/*    margin: 0; */
+}
+#tree-list span.leaf {
+    margin-left: 17px !important;
+}
+#tree-list li.application {
+    margin-top: 6px !important;
+}
+#tree-list li input + ol {
+    height: auto;
+}
+.navbar_main_wrapper.treelist {
+    padding: 12px 6px 4px 6px;
+}
+.navbar_main.treelist {
+    padding: 0px 8px 6px 2px;
+}
+
+.label-message {
+    background-color: #DDD;
+    -webkit-border-radius: 2px 2px 2px 2px;
+    -moz-border-radius: 2px 2px 2px 2px;
+    border-radius: 2px 2px 2px 2px;
+    padding: 4px 0px 4px 0px;
+    margin-bottom: 4px;
+    font-weight: bold;
+} 
+.label-important {
+    display: inline;
+    padding: 4px;
+    color: #F0F0F0;
+    font-weight: bold;
+    -webkit-border-radius: 2px 2px 2px 2px;
+    -moz-border-radius: 2px 2px 2px 2px;
+    border-radius: 2px 2px 2px 2px;
+}
+.label-important.full-width {
+    display: block;
+    text-align: center;
+}
+
+/** apps / entity explorer page */
+.apps-tree-toolbar {
+    text-align: right;
+}
+.entity_tree_node, .entity_tree_node a {
+    color: #182018;
+}
+.handy {
+    cursor: hand; cursor: pointer;
+}
+.entity_tree_node:hover {
+    cursor: hand; cursor: pointer;
+}
+.entity_tree_node a:hover {
+    color: #54932b !important;
+    text-decoration: none;
+}
+.entity_tree_node_wrapper.active .entity_tree_node {
+    font-weight: bold;
+}
+.entity_tree_node_wrapper .indirection-icon {
+    opacity: 0.7;
+    margin-left: -5px;
+}
+.tree-box.indirect > .entity_tree_node_wrapper a {
+    font-style: italic !important;
+    color: #666;
+}
+
+#tree label {
+/* remove the folder, and align with + - icons */
+background: none;
+padding-left: 16px;
+line-height: 18px;
+}
+.cssninja ol.tree {
+    padding: 0;
+    width: auto;
+}
+
+/* new lozenge-style tree-list */
+.navbar_main_wrapper .treeloz {
+    padding: 12px 0px 20px 0px;
+}
+.navbar_main .treeloz {
+    padding: 0px 0px 0px 0px;
+}
+.lozenge-app-tree-wrapper {
+    min-width: 100%;
+    min-height: 240px;
+    padding-bottom: 60px; /* for popup menu */
+    margin-top: -2px;
+    position: relative; 
+    float: left;
+}
+.entity_tree_node_wrapper {
+    position: relative;
+}
+.tree-box {
+    border: 1px solid #AAA;
+    border-right: 0px;
+    margin-top: 3px;
+    padding-top: 2px;
+    background-color: #EAECEA;
+}
+.tree-box.outer {
+    margin-left: 12px;
+    margin-right: 0px;
+    margin-bottom: 14px;
+    -webkit-border-radius: 4px 0 0 4px !important;
+    -moz-border-radius: 4px 0 0 4px !important;
+    border-radius: 4px 0 0 4px  !important;
+    padding-left: 4px;
+    padding-bottom: 4px;
+}
+.tree-box.inner {
+    margin-bottom: 2px;
+    border: 1px solid #BBB;
+    border-right: 0px;
+    -webkit-border-radius: 3px 0 0 3px !important;
+    -moz-border-radius: 3px 0 0 3px !important;
+    border-radius: 3px 0 0 3px  !important;
+    padding-left: 6px;
+    padding-bottom: 2px;
+    margin-left: 3px;
+}
+.tree-box.inner.depth-first {
+    margin-left: 8px;
+}
+.tree-box.inner.depth-odd {
+    background-color: #D8DAD8;
+}
+.tree-box.inner.depth-even {
+    background-color: #EAECEA;
+}
+.tree-node {
+    position: relative;
+    padding-top: 2px;
+    padding-bottom: 1px;
+    padding-right: 8px;
+}
+.light-popup {
+    display: none;
+    position: relative;
+    top: 12px;
+    float: left;
+    z-index: 1;
+}
+.toggler-icon .light-popup {
+    padding-top: 4px;
+}
+.light-popup-body {
+    padding: 3px 0px;
+    background-color: #606060;
+    color: #CDC;
+    font-weight: 300;
+    font-size: 85%;
+    line-height: 14px;
+    border: 1px dotted #CDC;
+    -webkit-border-radius: 2px 2px 2px 2px !important;
+    -moz-border-radius: 2px 2px 2px 2px !important;
+    border-radius: 2px 2px 2px 2px !important;
+}
+.light-popup-menu-item {
+    color: #D0D4D0;
+}
+.light-popup-menu-item.tr-default {
+    color: #E0E4E0;
+}
+.light-popup-menu-item {
+    padding: 1px 8px 1px 6px;
+}
+.light-popup-menu-item:hover {
+    background-color: #58AA33;
+    color: #000;
+}
+.light-popup-menu-item.zeroclipboard-is-hover {
+    background-color: #58AA33;
+    color: #000;
+}
+
+.app-summary .inforow > div { display: inline-block; }
+.app-summary .inforow .info-name-value { white-space: nowrap; }
+.app-summary .inforow .info-name-value > div { display: inline-block; }
+.app-summary .inforow .info-name-value .name { font-weight: 700; width: 120px; padding-right: 12px; }
+.app-summary .additional-info-on-problem { color: #D01; }
+.app-summary .additional-info-on-problem a { color: #563; }
+a.open-tab { cursor: hand; cursor: pointer; }
+
+table.dataTable tbody td.row-expansion {
+    background: #D8E4D0;
+}
+table.dataTable.activity-table tbody td.row-expansion {
+    background: #FFFFFF;
+}
+
+#activities-table-group div.for-activity-textarea {
+    /* correct for textarea width oddity */
+    margin-right: 10px;
+    margin-top: 6px;
+}
+#activities-table-group div.for-activity-textarea textarea {
+    margin-bottom: 0px;
+    border-color: #BBB;
+}
+#activities-root .toolbar-row i {
+    background-image: url("../img/glyphicons-halflings.png");
+    width: 18px;
+}
+#activities-root .toolbar-row i.active {
+    background-image: url("../img/glyphicons-halflings-bright-green.png");
+}
+#activities-root .toolbar-row {
+    padding-top: 1px;
+}
+#activities-root .toolbar-row i:hover,
+#activities-root .toolbar-row i.active:hover {
+    background-image: url("../img/glyphicons-halflings-dark-green.png");
+}
+table.dataTable td.row-expansion {
+    padding-top: 0px;
+}
+.opened-row-details {
+    display: block;
+    font-size: 90%;
+    
+    border-top: dotted whiteSmoke 1px;
+    margin-top: 0px;
+    padding-top: 2px;
+    
+    margin-left: -6px;
+    margin-right: -6px;
+    padding-left: 6px;
+    padding-right: 6px;
+    
+    margin-bottom: 4px;
+    padding-bottom: 6px;
+    border-right: dotted gray 1px;
+    border-bottom: dotted gray 1px;
+    border-left: dotted gray 1px;
+    border-bottom-left-radius: 8px;
+    border-bottom-right-radius: 8px;
+    
+    background: #D8E0D4;
+}
+
+/* effector modal dialog */
+#params td {
+    vertical-align: middle;
+}
+#params input {
+    margin-bottom: 0px;
+}
+
+table.dataTable tr.odd td.sorting_1 {
+background-color: #F9F9F9;
+}
+table.dataTable tr.even td.sorting_1 {
+background-color: #FFFFFF;
+}
+table.dataTable tr.odd {
+background-color: #F9F9F9;
+}
+table.dataTable tr.even {
+background-color: #FFFFFF;
+}
+table.dataTable tbody tr.selected,
+table.dataTable tr.odd.selected td.sorting_1,
+table.dataTable tr.even.selected td.sorting_1 {
+    background: #B8C8B0;
+}
+table.nonDatatables tr:hover,
+table.nonDatatables tr.odd:hover,
+table.nonDatatables tr.even:hover,
+table.nonDatatables tr.zeroclipboard-is-hover,
+table.nonDatatables tr.even.zeroclipboard-is-hover,
+table.nonDatatables tr.odd.zeroclipboard-is-hover,
+table.dataTable tr:hover:not(.selected),
+table.dataTable tr.odd:hover:not(.selected),
+table.dataTable tr.even:hover:not(.selected),
+table.dataTable tr.zeroclipboard-is-hover:not(.selected),
+table.dataTable tr.odd.zeroclipboard-is-hover:not(.selected),
+table.dataTable tr.even.zeroclipboard-is-hover:not(.selected),
+table.nonDatatables tr:hover td,
+table.nonDatatables tr.odd:hover td,
+table.nonDatatables tr.even:hover td,
+table.dataTable tr:hover:not(.selected) td:not(.row-expansion),
+table.dataTable tr:hover:not(.selected) td.sorting_1:not(.row-expansion),
+table.dataTable tr.odd:hover:not(.selected) td:not(.row-expansion),
+table.dataTable tr.even:hover:not(.selected) td:not(.row-expansion) {
+    background-color: #E0E4E0;
+}
+table.dataTable tbody tr.selected:hover,
+table.dataTable tr.odd.selected td.sorting_1:hover,
+table.dataTable tr.even.selected td.sorting_1:hover {
+    background: #98B890;
+}
+
+table.dataTable.activity-table tbody tr.activity-row,
+table.nonDatatables#policies-table tbody tr.policy-row {
+    cursor: hand; cursor: pointer;
+}
+
+table.dataTable thead th {
+text-align: left;
+background-color: #E0E4E0;
+line-height: 24px;
+font-size: 110%;
+}
+table.dataTable {
+margin: 0;
+border-width: 2px 0px 2px 0px;
+border-style: solid;
+border-color: black;
+background-color: #fff;
+overflow: scroll;
+/* background-color: #fff;
+ border-top-width: 1px; */
+}
+.bottom {
+    vertical-align: bottom;
+}
+.smallpadside {
+    margin-left: 0.25em;
+    margin-right: 0.25em;
+}
+.table-scroll-wrapper {
+    width: 100%;
+    overflow: auto;
+    background-color: #ececec;
+    border-style: solid;
+    border-color: #e8e8e8;
+    border-width: 1px 1px 1px 1px;
+    border-bottom-left-radius: 7px;
+    border-bottom-right-radius: 7px;
+}
+.table-scroll-wrapper .dataTables_filter {
+    float: left;
+    padding-left: 6px;
+}
+.table-scroll-wrapper .dataTables_filter label {
+    margin-bottom: 5px;
+    margin-top: 4px;
+}
+.dataTables_wrapper .brook-db-top-toolbar {
+    font-size: 85%;
+    float: right;
+    padding-right: 6px;
+    padding-top: 7px;
+}
+.dataTables_wrapper .brook-db-bot-toolbar {
+    font-size: 85%;
+    float: right;
+    padding-right: 6px;
+    padding-left: 5px;
+    padding-top: 5px;
+}
+
+.dataTables_info {
+    padding-top: 5px;
+    padding-left: 8px;
+    padding-bottom: 8px;
+    font-size: 85%;
+    width: auto;
+    align: center;
+    clear: none;
+}
+.dataTables_paginate {
+    font-size: 85%;
+    float: right;
+    margin-top: 6px;
+    margin-bottom: 3px;
+    padding-top: 1px;
+    padding-right: 4px;
+    height: 18px;
+    line-height: 18px;
+}
+.paging_full_numbers a.paginate_active {
+     background-color: #A8B8B0;
+}
+.dataTables_length {
+    float: left;
+    padding-left: 1em;
+    padding-top: 5px;
+}
+.dataTables_length label {
+    font-size: 85%;
+}
+.dataTables_length select {
+    height: auto;
+    font-size: 85%;
+    margin-bottom: 0px;
+    width: 45px;
+}
+.dataTables_paginate.paging_full_numbers a.paginate_button, 
+.dataTables_paginate.paging_full_numbers a.paginate_active {
+-webkit-border-radius: 0px;
+-moz-border-radius: 0px;
+border-radius: 0px;
+padding: 2px 5px;
+margin: 0;
+}
+.dataTables_filter input {
+    background-image: url("../img/magnifying-glass-right-icon.png");
+    /* url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJ5JREFUeNpi+P//PwMQMANxERCfAeI/UBrEZwbJQ9WAFR0A4u1AbAnEbFB6O1ScGaawGoi3wHQiYyBYDZKHKbwHxLo4FOqC5GEKf4Ksw6EQ5IyfIDYTkPEUiNUZsAOQ+F9GRkYJEKcFiDficSOIcRjE4QTiY0C8DuRbqAJLKP8/FP9kQArHUiA+jySJjA8w4LAS5KZd0MAHhaccQIABALsMiBZy4YLtAAAAAElFTkSuQmCC); */
+    background-size:12px 12px;
+    background-repeat: no-repeat;
+    background-position: 8px 5px;
+    width: 12em;
+    font-size: 85%;
+    padding: 1px 4px 1px 24px;
+    margin-bottom: 1px;
+    border-color: #888C88;
+    /*
+    -webkit-border-radius: 1em;
+    -moz-border-radius: 1em;
+    border-radius: 1em;
+    */
+    -webkit-border-radius: 10px;
+    -moz-border-radius: 10px;
+    border-radius: 10px;
+}
+/* nonDatatables environments want to look a bit like our datatables environment */
+table.nonDatatables {
+    border-bottom: 1px solid gray;
+}
+table.nonDatatables thead {
+    border-bottom: 1px solid black;
+}
+table.nonDatatables thead th {
+    background: #ffffff;
+    padding: 3px 18px 3px 5px;
+}
+table.table.nonDatatables tbody > tr:first-child > td {
+    /* need both bottom of head, and top of body, to support empty table and override non-empty row top border */
+    border-top: 1px black solid;
+}
+table.table.nonDatatables tbody tr.selected,
+table.table.nonDatatables tbody tr.selected td {
+    background: #AC8;
+}
+/* we keep the thin gray line between rows for manual tables,
+   subtle difference but seems nice */
+div.for-empty-table {
+    width: 100%;
+    float: left;
+    background-color: #F9F9F9;
+    font-style: italic;
+    padding: 8px 0px;
+    text-align: center;
+    margin-top: -18px;
+    border-bottom: 1px solid gray;
+}
+
+/* add entity modal */
+.editable-entity-group {
+    margin-bottom: 2px;
+    border: 1px solid #E5E5E5;
+    -webkit-border-radius: 4px;
+    -moz-border-radius: 4px;
+    border-radius: 4px;
+}
+.editable-entity-heading {
+    padding: 2px 6px 2px 6px;
+    border-bottom: 1px solid #E5E5E5;
+    margin-bottom: -1px;
+    overflow: hidden;
+    -webkit-border-radius: 4px;
+    -moz-border-radius: 4px;
+    border-radius: 4px;
+    background-color: #F9F9F9;
+    line-height: 30px;
+}
+.editable-entity-heading:hover {
+    background-color: #F0F4F0;
+}
+.editable-entity-body {
+    border-top: 1px solid #E5E5E5;
+    margin-top: -1px;
+    padding: 7px 6px 2px 6px;
+    overflow: hidden;
+    -webkit-border-radius: 4px;
+    -moz-border-radius: 4px;
+    border-radius: 4px;
+}
+
+#app-locations select {
+    min-height: 22px;
+}
+#app-locations #selector-container {
+    margin-bottom: 4px;
+}
+div.application-name-label {
+    margin-bottom: 4px;
+}
+table.config-table {
+    margin-bottom: 6px;
+    margin-left: 2px;
+}
+.app-add-wizard-config-entry input {
+    margin: 3px 0 2px 0;    
+    height: 12px;
+    vertical-align: middle;
+}
+.app-add-wizard-config-entry input {
+    height: 14px;
+}
+tr.app-add-wizard-config-entry:nth-child(odd) {
+    background-color: #f8f8f8;
+}
+tr.app-add-wizard-config-entry:nth-child(even) {
+}
+tr.app-add-wizard-config-entry {
+    height: 20px;
+}
+.app-add-wizard-config-entry {
+    margin-bottom: 9px;
+    margin-top: 2px;
+}
+.app-add-wizard-config-entry button {
+    margin-left: 8px;
+}
+.app-add-wizard-create-entity-label-newline {
+    padding-left: 2px;
+    padding-bottom: 3px;    
+}
+.app-add-wizard-create-entity-label {
+    width: 4em;
+    float: left;
+    padding-top: 3px;
+}
+.app-add-wizard-create-entity-input {
+    width: 300px;
+}
+#add-app-entity {
+    float: right;
+}
+/* help page */
+#help-page p, #help-page ul {
+    margin-top: 8px;
+}
+.help-logo-right {
+    padding-left: 1.5em;
+    padding-top: 1.5em;
+    float: right;
+}
+.help-logo-right img {
+    border: 3px solid #6C6C6C;
+    border-radius: 2px;
+}
+.control-group {
+    margin-top: 6px;
+    margin-bottom: 9px;
+}
+.control-group .deploy-label {
+    font-weight: 700;
+}
+.deploy .control-group {
+    margin-bottom: 18px;
+}
+.deploy input#application-name {
+    /** margin supplied by control group */
+    margin-bottom: 0px;
+}
+
+#application-explorer div#summary textarea {
+    width: 100%;
+    cursor: auto;
+    margin-bottom: 2px;
+}
+
+/* catalog */
+.accordion-head {
+    -webkit-border-radius: 5px;
+    -moz-border-radius: 5px;
+    border-radius: 5px;
+    padding: 4px 10px 4px 8px;
+    font-weight: bold;
+    background-color: #F4F6F4;
+}
+.accordion-head.active {
+    background-color: #F8FAF8;
+}
+.accordion-body {
+    border-top: 1px dashed lightgray;
+    padding: 8px 8px 12px 8px;
+    overflow: auto;
+    max-height: 400px;
+    background-color: white;
+    border-bottom-left-radius: 5px;
+    border-bottom-right-radius: 5px;
+}
+.catalog-details .accordion-body {
+    padding: 0;
+}
+.accordion-head:hover {
+    background-color: #E0E4E0;
+    cursor: hand; cursor: pointer;
+}
+.catalog-accordion-wrapper {
+    margin-bottom: 6px;
+    background-color: #F0F0F0;
+    border-radius: 5px;
+}
+.catalog-accordion-wrapper .accordion-nav-row {
+    white-space: pre;
+    word-wrap: normal;
+}
+.accordion-item {
+    -webkit-border-radius: 5px;
+    -moz-border-radius: 5px;
+    border-radius: 5px;
+    margin-top: -1px;
+    border: 1px solid lightgray;
+}
+.accordion-nav-row:hover {
+    text-decoration: underline;
+    cursor: hand; cursor: pointer;
+}
+.accordion-nav-row.active {
+    font-weight: bold;
+}
+.accordion-nav-child {
+    padding-left: 15px;
+    color: lightgray;
+}
+.accordion-nav-child.active {
+    color: #505050;
+}
+.catalog-details {
+    padding-left: 16px;
+    padding-right: 25px;
+    padding-top: 8px;
+    padding-bottom: 8px;
+}
+.catalog-details h3 {
+    margin-bottom: 8px;
+}
+.catalog-details textarea {
+    width: 100%;
+    cursor: auto;
+}
+.catalog-details#details-empty {
+    padding-top: 60px;
+    padding-bottom: 180px;
+    text-align: center;
+}
+.catalog-save-error {
+    background-color: #f2dede;
+    /* margin matches bootstrap input margin-bottom. */
+    margin: 9px 0 0 0;
+    padding: 7px;
+    border-radius: 3px;
+}
+.catalog-error-message {
+    white-space: pre-wrap;
+}
+
+.float-right {
+    float: right;
+}
+
+/* swagger */
+
+.swagger-ui-container{
+    margin-bottom: 3em;
+}
+
+.swagger-ui-wrap {
+    max-width: 960px;
+    margin-left: auto;
+    margin-right: auto;
+    margin-bottom: 6em;
+}
+
+.icon-btn {
+    cursor: pointer;
+}
+
+#message-bar {
+    min-height: 30px;
+    text-align: center;
+    padding-top: 10px;
+}
+
+.message-success {
+    color: #89BF04;
+}
+
+.message-fail {
+    color: #cc0000;
+}
+
+.code-textarea {
+    width: 100%;
+    height: 8em;
+    margin-right: 4px;
+    font-family: Consolas, Lucida Console, Monaco, monospace;
+    font-size: 8.5pt;
+    line-height: 11pt;
+    white-space: pre;
+    word-wrap: normal;
+    overflow-x: scroll;
+    overflow-y: scroll;
+}
+
+/** groovy script */
+#groovy-ui-container .hide {
+    display: none !important;
+}
+#groovy-ui-container .throbber {
+    padding-top: 8px;
+}
+#groovy-ui-container .input textarea {
+    height: 16em;
+}
+#groovy-ui-container .toggler-region {
+    margin-top: 0.5em;
+    margin-bottom: 1em;
+}
+#groovy-ui-container .groovy-scripting-text {
+    margin-top: 0.5em;
+}
+#groovy-ui-container div.submit {
+   float: right;
+}
+
+#groovy-ui-container .input {
+    width: 48%;
+}
+#groovy-ui-container div.submit {
+    text-align: right;
+}
+
+#groovy-ui-container .output {
+    width: 48%;
+    float: right;
+}
+.toggler-header {
+    cursor: hand; cursor: pointer;
+    margin-bottom: 3px;
+}
+.toggler-icon {
+    float: right;
+}
+.user-hidden .toggler-icon {
+}
+
+/** trick for making textareas with width 100% line up (silly width 100% excludes padding) */
+div.for-textarea {
+    padding-left: 0.8em;
+    padding-right: 0.4em;
+}
+div.for-textarea > textarea {
+    padding-left: 0.3em;
+    padding-right: 0.3em;
+    margin-left: -0.6em;
+}
+#groovy-ui-container p {
+    margin-top: 4px;
+}
+#groovy-ui-container a {
+    color: inherit;
+}
+#groovy-ui-container a:hover {
+    text-decoration: underline;
+    cursor: hand; cursor: pointer;
+}
+
+/** input type="file" should be display:none with hand-rolled nicer looking widgets used instead
+    (the native ones can't be much modified, and are notoriously ugly; but line-height 0 at least makes them line up) */
+input[type="file"] {
+    line-height: 0;
+    width: 300px;
+}
+
+input.error {
+    border-color: #b94a48;
+}
+
+#policy-config-table {
+    table-layout: fixed;
+}
+
+#policy-config-table td.policy-config-name {
+    overflow: hidden;
+    text-overflow: ellipsis;
+}
+
+#policy-config-table td.policy-config-value {
+    overflow-wrap: break-word;
+    word-wrap: break-word;
+}
+
+#policy-config,
+.has-no-policies {
+    margin-bottom: 9px;
+}
+
+.padded-div {
+    padding: 0.5em 1.2em;
+}
+
+/* this is used in activities, for when we slide in a panel e.g. for sub-table */
+.slide-panel-group {
+    width: 569px;
+}
+.slide-panel {
+    position: relative;
+    width: 569px;
+    margin-right: -569px;
+    float: left;
+}
+.subpanel-header-row {
+    color: black;
+    background-color: #B0B8B0;
+    padding-top: 12px;
+    padding-bottom: 12px;
+    margin-bottom: 24px;
+    padding-left: 12px;
+    vertical-align: top;
+    font-weight: 700;
+    font-size: 120%;
+}
+
+.toggler-header {
+    background-color: #D8DCD8;
+    padding: 2px 6px 2px 6px;
+}
+.activity-detail-panel .subpanel-header-row {
+    margin-bottom: 12px;
+}
+.activity-detail-panel .toggler-region {
+    margin-bottom: 12px;
+}
+.activity-detail-panel .toggler-region .activity-details-section {
+    margin: 4px 6px 0px 6px;
+}
+.activity-detail-panel .activity-details-section.activity-description, 
+.activity-detail-panel .activity-details-section.activity-status {
+    margin-bottom: 12px;
+}
+.activity-detail-panel .activity-label {
+    display: inline-block;
+    width: 100px;
+}
+.activity-detail-panel .toggler-region.tasks-submitted .table-scroll-wrapper,
+.activity-detail-panel .toggler-region.tasks-children .table-scroll-wrapper {
+    margin-bottom: 18px;
+}
+
+.activity-detail-results .result-literal {
+    font-style: italic;
+}
+.activity-detail-results div.result-literal {
+    margin-top: 12px;
+}
+.activity-detail-results div.result-literal br {
+    line-height: 24px;
+}
+
+.activity-tag-giftlabel {
+    background-color: #E0E4E0;
+    padding: 2px 4px 2px 4px;
+    margin-bottom: 4px;
+    margin-right: 5px;
+    -webkit-border-radius: 3px 3px 3px 3px !important;
+    -moz-border-radius: 3px 3px 3px 3px !important;
+    border-radius: 3px 3px 3px 3px !important;
+    display: inline-block;
+    white-space: nowrap;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    -o-text-overflow: ellipsis;
+    max-width: 250px;
+}
+.activity-tag-giftlabel:hover {
+    max-width: 100%;
+    white-space: normal;
+}
+
+/* hover menu at left, as used in sensors view */
+.floatGroup .floatLeft {
+	display:none;
+	width: 18px;
+	margin-left: -18px;
+	margin-top: -16px;
+	position: absolute;
+	overflow: visible;
+}
+.floatGroup .floatDown {
+	display:none;
+ 	position: absolute;
+ 	margin-top: -2px;
+	overflow: visible;
+}
+.floatGroup .floatDown .light-popup {
+	display: block;
+    position: absolute;
+    top: auto;
+    z-index: 1;
+}
+
+.ha-standby-overlay {
+    position: absolute;
+    top: 8px;
+    bottom: 0;
+    left: 0;
+    right: 0;
+}
+
+/* Setting opacity in ha-standby-overlay would also apply it to all of
+the element's children, who probably want to control their opacity separately. */
+.overlay-with-opacity {
+    opacity: 0.9;
+    background-color: white;
+}
+
+.overlay-content {
+    position: absolute;
+    top: 100px;
+    left: 50%;
+    width: 400px;
+    /* margin-left = width / 2 */
+    margin: 0 0 0 -200px;
+    padding: 20px;
+    background-color: #ff938c;
+    border: 7px solid #2d2d2d;
+    border-radius: 10px;
+    color: black;
+}
+
+.capitalized {
+    text-transform: capitalize;
+}
+
+.config-key-input-pair {
+    /* matches Bootstrap */
+    margin-bottom: 9px;
+}
+
+textarea.param-value {
+    height: 18px;
+    overflow: auto;
+}
+
+#catalog-details-accordion {
+    margin-top: 12px;
+}
+
+/* For secret things */
+.secret-info span.value {
+    display: none;
+}
+.secret-info.secret-revealed span.value {
+    display: inherit;
+}
+.secret-info.secret-revealed span.secret-indicator {
+    display: none;
+}
+
+.secret-indicator {
+    /* blur */
+    color: transparent;
+    text-shadow: 0 0 5px rgba(0,0,0,0.5);
+}


[24/51] [abbrv] [partial] brooklyn-ui git commit: move subdir from incubator up a level as it is promoted to its own repo (first non-incubator commit!)

Posted by he...@apache.org.
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/swagger-ui/lib/swagger-ui.min.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/swagger-ui/lib/swagger-ui.min.js b/brooklyn-ui/src/main/webapp/assets/swagger-ui/lib/swagger-ui.min.js
deleted file mode 100644
index 70165d3..0000000
--- a/brooklyn-ui/src/main/webapp/assets/swagger-ui/lib/swagger-ui.min.js
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- * swagger-ui - Swagger UI is a dependency-free collection of HTML, JavaScript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API
- * @version v2.1.4
- * @link http://swagger.io
- * @license Apache-2.0
- */
-(function(){function e(){e.history=e.history||[],e.history.push(arguments),this.console&&console.log(Array.prototype.slice.call(arguments)[0])}this.Handlebars=this.Handlebars||{},this.Handlebars.templates=this.Handlebars.templates||{},this.Handlebars.templates.apikey_button_view=Handlebars.template({compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,a="function",o=t.helperMissing,s=this.escapeExpression;return"<!--div class='auth_button' id='apikey_button'><img class='auth_icon' alt='apply api key' src='images/apikey.jpeg'></div-->\n<div class='auth_container' id='apikey_container'>\n  <div class='key_input_container'>\n    <div class='auth_label'><label for='input_apiKey_entry'>"+s((i=null!=(i=t.keyName||(null!=e?e.keyName:e))?i:o,typeof i===a?i.call(e,{name:"keyName",hash:{},data:r}):i))+"</label></div>\n    <input placeholder='api_key' class='auth_input' id='input_apiKey_entry' name='apiKey' type='text'/>\n    <div class='auth_submit'><a class='auth_submit_button' id='ap
 ply_api_key' href='#' data-sw-translate>apply</a></div>\n  </div>\n</div>\n"},useData:!0}),this.Handlebars.templates.basic_auth_button_view=Handlebars.template({compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){return'<div class=\'auth_button\' id=\'basic_auth_button\'><img class=\'auth_icon\' src=\'images/password.jpeg\'></div>\n<div class=\'auth_container\' id=\'basic_auth_container\'>\n  <div class=\'key_input_container\'>\n    <div class="auth_label"><label for="input_username" data-sw-translate>Username</label></div>\n    <input placeholder="username" class="auth_input" id="input_username" name="username" type="text"/>\n    <div class="auth_label"><label for="password" data-sw-translate>Password</label></div>\n    <input placeholder="password" class="auth_input" id="input_password" name="password" type="password"/>\n    <div class=\'auth_submit\'><a class=\'auth_submit_button\' id="apply_basic_auth" href="#">apply</a></div>\n  </div>\n</div>\n\n'},useData:!0}),this.Handleba
 rs.templates.content_type=Handlebars.template({1:function(e,t,n,r){var i,a="";return i=t.each.call(e,null!=e?e.produces:e,{name:"each",hash:{},fn:this.program(2,r),inverse:this.noop,data:r}),null!=i&&(a+=i),a},2:function(e,t,n,r){var i,a=this.lambda,o='	<option value="';return i=a(e,e),null!=i&&(o+=i),o+='">',i=a(e,e),null!=i&&(o+=i),o+"</option>\n"},4:function(e,t,n,r){return'  <option value="application/json">application/json</option>\n'},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,a,o="function",s=t.helperMissing,l=this.escapeExpression,u='<label data-sw-translate for="'+l((a=null!=(a=t.contentTypeId||(null!=e?e.contentTypeId:e))?a:s,typeof a===o?a.call(e,{name:"contentTypeId",hash:{},data:r}):a))+'">Response Content Type</label>\n<select name="contentType" id="'+l((a=null!=(a=t.contentTypeId||(null!=e?e.contentTypeId:e))?a:s,typeof a===o?a.call(e,{name:"contentTypeId",hash:{},data:r}):a))+'">\n';return i=t["if"].call(e,null!=e?e.produces:e,{name:"if",hash:{},fn:t
 his.program(1,r),inverse:this.program(4,r),data:r}),null!=i&&(u+=i),u+"</select>\n"},useData:!0}),$(function(){$.fn.vAlign=function(){return this.each(function(){var e=$(this).height(),t=$(this).parent().height(),n=(t-e)/2;$(this).css("margin-top",n)})},$.fn.stretchFormtasticInputWidthToParent=function(){return this.each(function(){var e=$(this).closest("form").innerWidth(),t=parseInt($(this).closest("form").css("padding-left"),10)+parseInt($(this).closest("form").css("padding-right"),10),n=parseInt($(this).css("padding-left"),10)+parseInt($(this).css("padding-right"),10);$(this).css("width",e-t-n)})},$("form.formtastic li.string input, form.formtastic textarea").stretchFormtasticInputWidthToParent(),$("ul.downplayed li div.content p").vAlign(),$("form.sandbox").submit(function(){var e=!0;return $(this).find("input.required").each(function(){$(this).removeClass("error"),""===$(this).val()&&($(this).addClass("error"),$(this).wiggle(),e=!1)}),e})}),Function.prototype.bind&&console&&"o
 bject"==typeof console.log&&["log","info","warn","error","assert","dir","clear","profile","profileEnd"].forEach(function(e){console[e]=this.bind(console[e],console)},Function.prototype.call),window.Docs={shebang:function(){var e=$.param.fragment().split("/");switch(e.shift(),e.length){case 1:if(e[0].length>0){var t="resource_"+e[0];Docs.expandEndpointListForResource(e[0]),$("#"+t).slideto({highlight:!1})}break;case 2:Docs.expandEndpointListForResource(e[0]),$("#"+t).slideto({highlight:!1});var n=e.join("_"),r=n+"_content";Docs.expandOperation($("#"+r)),$("#"+n).slideto({highlight:!1})}},toggleEndpointListForResource:function(e){var t=$("li#resource_"+Docs.escapeResourceName(e)+" ul.endpoints");t.is(":visible")?Docs.collapseEndpointListForResource(e):Docs.expandEndpointListForResource(e)},expandEndpointListForResource:function(e){var e=Docs.escapeResourceName(e);if(""==e)return void $(".resource ul.endpoints").slideDown();$("li#resource_"+e).addClass("active");var t=$("li#resource_"+
 e+" ul.endpoints");t.slideDown()},collapseEndpointListForResource:function(e){var e=Docs.escapeResourceName(e);if(""==e)return void $(".resource ul.endpoints").slideUp();$("li#resource_"+e).removeClass("active");var t=$("li#resource_"+e+" ul.endpoints");t.slideUp()},expandOperationsForResource:function(e){return Docs.expandEndpointListForResource(e),""==e?void $(".resource ul.endpoints li.operation div.content").slideDown():void $("li#resource_"+Docs.escapeResourceName(e)+" li.operation div.content").each(function(){Docs.expandOperation($(this))})},collapseOperationsForResource:function(e){return Docs.expandEndpointListForResource(e),""==e?void $(".resource ul.endpoints li.operation div.content").slideUp():void $("li#resource_"+Docs.escapeResourceName(e)+" li.operation div.content").each(function(){Docs.collapseOperation($(this))})},escapeResourceName:function(e){return e.replace(/[!"#$%&'()*+,.\/:;<=>?@\[\\\]\^`{|}~]/g,"\\$&")},expandOperation:function(e){e.slideDown()},collapseOpe
 ration:function(e){e.slideUp()}},Handlebars.registerHelper("sanitize",function(e){return e=e.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,""),new Handlebars.SafeString(e)}),Handlebars.registerHelper("renderTextParam",function(e){var t,n="text",r="",i="array"===e.type.toLowerCase()||e.allowMultiple,a=i&&Array.isArray(e["default"])?e["default"].join("\n"):e["default"],o=Object.keys(e).filter(function(e){return null!==e.match(/^X-data-/i)}).reduce(function(t,n){return t+=" "+n.substring(2,n.length)+"='"+e[n]+"'"},"");if("undefined"==typeof a&&(a=""),e.format&&"password"===e.format&&(n="password"),e.valueId&&(r=" id='"+e.valueId+"'"),i)t="<textarea class='body-textarea"+(e.required?" required":"")+"' name='"+e.name+"'"+r+o,t+=" placeholder='Provide multiple values in new lines"+(e.required?" (at least one required).":".")+"'>",t+=a+"</textarea>";else{var s="parameter";e.required&&(s+=" required"),t="<input class='"+s+"' minlength='"+(e.required?1:0)+"'",t+=" name='"+e.n
 ame+"' placeholder='"+(e.required?"(required)":"")+"'"+r+o,t+=" type='"+n+"' value='"+a+"'/>"}return new Handlebars.SafeString(t)}),this.Handlebars.templates.main=Handlebars.template({1:function(e,t,n,r){var i,a=this.lambda,o=this.escapeExpression,s='  <div class="info_title">'+o(a(null!=(i=null!=e?e.info:e)?i.title:i,e))+'</div>\n  <div class="info_description markdown">';return i=a(null!=(i=null!=e?e.info:e)?i.description:i,e),null!=i&&(s+=i),s+="</div>\n",i=t["if"].call(e,null!=e?e.externalDocs:e,{name:"if",hash:{},fn:this.program(2,r),inverse:this.noop,data:r}),null!=i&&(s+=i),s+="  ",i=t["if"].call(e,null!=(i=null!=e?e.info:e)?i.termsOfServiceUrl:i,{name:"if",hash:{},fn:this.program(4,r),inverse:this.noop,data:r}),null!=i&&(s+=i),s+="\n  ",i=t["if"].call(e,null!=(i=null!=(i=null!=e?e.info:e)?i.contact:i)?i.name:i,{name:"if",hash:{},fn:this.program(6,r),inverse:this.noop,data:r}),null!=i&&(s+=i),s+="\n  ",i=t["if"].call(e,null!=(i=null!=(i=null!=e?e.info:e)?i.contact:i)?i.url:i,
 {name:"if",hash:{},fn:this.program(8,r),inverse:this.noop,data:r}),null!=i&&(s+=i),s+="\n  ",i=t["if"].call(e,null!=(i=null!=(i=null!=e?e.info:e)?i.contact:i)?i.email:i,{name:"if",hash:{},fn:this.program(10,r),inverse:this.noop,data:r}),null!=i&&(s+=i),s+="\n  ",i=t["if"].call(e,null!=(i=null!=e?e.info:e)?i.license:i,{name:"if",hash:{},fn:this.program(12,r),inverse:this.noop,data:r}),null!=i&&(s+=i),s+"\n"},2:function(e,t,n,r){var i,a=this.lambda,o=this.escapeExpression;return"  <p>"+o(a(null!=(i=null!=e?e.externalDocs:e)?i.description:i,e))+'</p>\n  <a href="'+o(a(null!=(i=null!=e?e.externalDocs:e)?i.url:i,e))+'" target="_blank">'+o(a(null!=(i=null!=e?e.externalDocs:e)?i.url:i,e))+"</a>\n"},4:function(e,t,n,r){var i,a=this.lambda,o=this.escapeExpression;return'<div class="info_tos"><a href="'+o(a(null!=(i=null!=e?e.info:e)?i.termsOfServiceUrl:i,e))+'" data-sw-translate>Terms of service</a></div>'},6:function(e,t,n,r){var i,a=this.lambda,o=this.escapeExpression;return"<div class='in
 fo_name' data-sw-translate>Created by "+o(a(null!=(i=null!=(i=null!=e?e.info:e)?i.contact:i)?i.name:i,e))+"</div>"},8:function(e,t,n,r){var i,a=this.lambda,o=this.escapeExpression;return"<div class='info_url' data-sw-translate>See more at <a href=\""+o(a(null!=(i=null!=(i=null!=e?e.info:e)?i.contact:i)?i.url:i,e))+'">'+o(a(null!=(i=null!=(i=null!=e?e.info:e)?i.contact:i)?i.url:i,e))+"</a></div>"},10:function(e,t,n,r){var i,a=this.lambda,o=this.escapeExpression;return"<div class='info_email'><a href=\"mailto:"+o(a(null!=(i=null!=(i=null!=e?e.info:e)?i.contact:i)?i.email:i,e))+"?subject="+o(a(null!=(i=null!=e?e.info:e)?i.title:i,e))+'" data-sw-translate>Contact the developer</a></div>'},12:function(e,t,n,r){var i,a=this.lambda,o=this.escapeExpression;return"<div class='info_license'><a href='"+o(a(null!=(i=null!=(i=null!=e?e.info:e)?i.license:i)?i.url:i,e))+"'>"+o(a(null!=(i=null!=(i=null!=e?e.info:e)?i.license:i)?i.name:i,e))+"</a></div>"},14:function(e,t,n,r){var i,a=this.lambda,o=t
 his.escapeExpression;return'  , <span style="font-variant: small-caps" data-sw-translate>api version</span>: '+o(a(null!=(i=null!=e?e.info:e)?i.version:i,e))+"\n    "},16:function(e,t,n,r){var i,a="function",o=t.helperMissing,s=this.escapeExpression;return'    <span style="float:right"><a href="'+s((i=null!=(i=t.validatorUrl||(null!=e?e.validatorUrl:e))?i:o,typeof i===a?i.call(e,{name:"validatorUrl",hash:{},data:r}):i))+"/debug?url="+s((i=null!=(i=t.url||(null!=e?e.url:e))?i:o,typeof i===a?i.call(e,{name:"url",hash:{},data:r}):i))+'"><img id="validator" src="'+s((i=null!=(i=t.validatorUrl||(null!=e?e.validatorUrl:e))?i:o,typeof i===a?i.call(e,{name:"validatorUrl",hash:{},data:r}):i))+"?url="+s((i=null!=(i=t.url||(null!=e?e.url:e))?i:o,typeof i===a?i.call(e,{name:"url",hash:{},data:r}):i))+'"></a>\n    </span>\n'},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,a,o="function",s=t.helperMissing,l=this.escapeExpression,u="<div class='info' id='api_info'>\n";return i=t["if"]
 .call(e,null!=e?e.info:e,{name:"if",hash:{},fn:this.program(1,r),inverse:this.noop,data:r}),null!=i&&(u+=i),u+="</div>\n<div class='container' id='resources_container'>\n  <ul id='resources'></ul>\n\n  <div class=\"footer\">\n    <h4 style=\"color: #999\">[ <span style=\"font-variant: small-caps\">base url</span>: "+l((a=null!=(a=t.basePath||(null!=e?e.basePath:e))?a:s,typeof a===o?a.call(e,{name:"basePath",hash:{},data:r}):a))+"\n",i=t["if"].call(e,null!=(i=null!=e?e.info:e)?i.version:i,{name:"if",hash:{},fn:this.program(14,r),inverse:this.noop,data:r}),null!=i&&(u+=i),u+="]\n",i=t["if"].call(e,null!=e?e.validatorUrl:e,{name:"if",hash:{},fn:this.program(16,r),inverse:this.noop,data:r}),null!=i&&(u+=i),u+"    </h4>\n    </div>\n</div>\n"},useData:!0}),this.Handlebars.templates.operation=Handlebars.template({1:function(e,t,n,r){return"deprecated"},3:function(e,t,n,r){return"            <h4>Warning: Deprecated</h4>\n"},5:function(e,t,n,r){var i,a,o="function",s=t.helperMissing,l='    
     <h4>Implementation Notes</h4>\n        <div class="markdown">';return a=null!=(a=t.description||(null!=e?e.description:e))?a:s,i=typeof a===o?a.call(e,{name:"description",hash:{},data:r}):a,null!=i&&(l+=i),l+"</div>\n"},7:function(e,t,n,r){return'        <div class="auth">\n        <span class="api-ic ic-error">'},9:function(e,t,n,r){var i,a='          <div class="api_information_panel">\n';return i=t.each.call(e,e,{name:"each",hash:{},fn:this.program(10,r),inverse:this.noop,data:r}),null!=i&&(a+=i),a+"          </div>\n"},10:function(e,t,n,r){var i,a=this.lambda,o=this.escapeExpression,s="            <div title='";return i=a(null!=e?e.description:e,e),null!=i&&(s+=i),s+"'>"+o(a(null!=e?e.scope:e,e))+"</div>\n"},12:function(e,t,n,r){return"</span></div>"},14:function(e,t,n,r){return'        <div class=\'access\'>\n          <span class="api-ic ic-off" title="click to authenticate"></span>\n        </div>\n'},16:function(e,t,n,r){var i,a="function",o=t.helperMissing,s=this.escape
 Expression;return"          <h4><span data-sw-translate>Response Class</span> (<span data-sw-translate>Status</span> "+s((i=null!=(i=t.successCode||(null!=e?e.successCode:e))?i:o,typeof i===a?i.call(e,{name:"successCode",hash:{},data:r}):i))+')</h4>\n          <p><span class="model-signature" /></p>\n          <br/>\n          <div class="response-content-type" />\n'},18:function(e,t,n,r){return'          <h4 data-sw-translate>Parameters</h4>\n          <table class=\'fullwidth\'>\n          <thead>\n            <tr>\n            <th style="width: 100px; max-width: 100px" data-sw-translate>Parameter</th>\n            <th style="width: 310px; max-width: 310px" data-sw-translate>Value</th>\n            <th style="width: 200px; max-width: 200px" data-sw-translate>Description</th>\n            <th style="width: 100px; max-width: 100px" data-sw-translate>Parameter Type</th>\n            <th style="width: 220px; max-width: 230px" data-sw-translate>Data Type</th>\n            </tr>\n      
     </thead>\n          <tbody class="operation-params">\n\n          </tbody>\n          </table>\n'},20:function(e,t,n,r){return"          <div style='margin:0;padding:0;display:inline'></div>\n          <h4 data-sw-translate>Response Messages</h4>\n          <table class='fullwidth'>\n            <thead>\n            <tr>\n              <th data-sw-translate>HTTP Status Code</th>\n              <th data-sw-translate>Reason</th>\n              <th data-sw-translate>Response Model</th>\n              <th data-sw-translate>Headers</th>\n            </tr>\n            </thead>\n            <tbody class=\"operation-status\">\n\n            </tbody>\n          </table>\n"},22:function(e,t,n,r){return""},24:function(e,t,n,r){return"          <div class='sandbox_header'>\n            <input class='submit' type='button' value='Try it out!' data-sw-translate/>\n            <a href='#' class='response_hider' style='display:none' data-sw-translate>Hide Response</a>\n            <span class='
 response_throbber' style='display:none'></span>\n          </div>\n"},26:function(e,t,n,r){return"          <h4 data-sw-translate>Request Headers</h4>\n          <div class='block request_headers'></div>\n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,a,o,s="function",l=t.helperMissing,u=this.escapeExpression,c=t.blockHelperMissing,p="\n  <ul class='operations' >\n    <li class='"+u((a=null!=(a=t.method||(null!=e?e.method:e))?a:l,typeof a===s?a.call(e,{name:"method",hash:{},data:r}):a))+" operation' id='"+u((a=null!=(a=t.parentId||(null!=e?e.parentId:e))?a:l,typeof a===s?a.call(e,{name:"parentId",hash:{},data:r}):a))+"_"+u((a=null!=(a=t.nickname||(null!=e?e.nickname:e))?a:l,typeof a===s?a.call(e,{name:"nickname",hash:{},data:r}):a))+"'>\n      <div class='heading'>\n        <h3>\n          <span class='http_method'>\n          <a href='#!/"+u((a=null!=(a=t.encodedParentId||(null!=e?e.encodedParentId:e))?a:l,typeof a===s?a.call(e,{name:"encodedParentId",hash:{},data:r
 }):a))+"/"+u((a=null!=(a=t.nickname||(null!=e?e.nickname:e))?a:l,typeof a===s?a.call(e,{name:"nickname",hash:{},data:r}):a))+'\' class="toggleOperation">'+u((a=null!=(a=t.method||(null!=e?e.method:e))?a:l,typeof a===s?a.call(e,{name:"method",hash:{},data:r}):a))+"</a>\n          </span>\n          <span class='path'>\n          <a href='#!/"+u((a=null!=(a=t.encodedParentId||(null!=e?e.encodedParentId:e))?a:l,typeof a===s?a.call(e,{name:"encodedParentId",hash:{},data:r}):a))+"/"+u((a=null!=(a=t.nickname||(null!=e?e.nickname:e))?a:l,typeof a===s?a.call(e,{name:"nickname",hash:{},data:r}):a))+"' class=\"toggleOperation ";return i=t["if"].call(e,null!=e?e.deprecated:e,{name:"if",hash:{},fn:this.program(1,r),inverse:this.noop,data:r}),null!=i&&(p+=i),p+='">'+u((a=null!=(a=t.path||(null!=e?e.path:e))?a:l,typeof a===s?a.call(e,{name:"path",hash:{},data:r}):a))+"</a>\n          </span>\n        </h3>\n        <ul class='options'>\n          <li>\n          <a href='#!/"+u((a=null!=(a=t.enco
 dedParentId||(null!=e?e.encodedParentId:e))?a:l,typeof a===s?a.call(e,{name:"encodedParentId",hash:{},data:r}):a))+"/"+u((a=null!=(a=t.nickname||(null!=e?e.nickname:e))?a:l,typeof a===s?a.call(e,{name:"nickname",hash:{},data:r}):a))+'\' class="toggleOperation">',a=null!=(a=t.summary||(null!=e?e.summary:e))?a:l,i=typeof a===s?a.call(e,{name:"summary",hash:{},data:r}):a,null!=i&&(p+=i),p+="</a>\n          </li>\n        </ul>\n      </div>\n      <div class='content' id='"+u((a=null!=(a=t.parentId||(null!=e?e.parentId:e))?a:l,typeof a===s?a.call(e,{name:"parentId",hash:{},data:r}):a))+"_"+u((a=null!=(a=t.nickname||(null!=e?e.nickname:e))?a:l,typeof a===s?a.call(e,{name:"nickname",hash:{},data:r}):a))+"_content' style='display:none'>\n",i=t["if"].call(e,null!=e?e.deprecated:e,{name:"if",hash:{},fn:this.program(3,r),inverse:this.noop,data:r}),null!=i&&(p+=i),i=t["if"].call(e,null!=e?e.description:e,{name:"if",hash:{},fn:this.program(5,r),inverse:this.noop,data:r}),null!=i&&(p+=i),a=null
 !=(a=t.oauth||(null!=e?e.oauth:e))?a:l,o={name:"oauth",hash:{},fn:this.program(7,r),inverse:this.noop,data:r},i=typeof a===s?a.call(e,o):a,t.oauth||(i=c.call(e,i,o)),null!=i&&(p+=i),p+="\n",i=t.each.call(e,null!=e?e.oauth:e,{name:"each",hash:{},fn:this.program(9,r),inverse:this.noop,data:r}),null!=i&&(p+=i),p+="        ",a=null!=(a=t.oauth||(null!=e?e.oauth:e))?a:l,o={name:"oauth",hash:{},fn:this.program(12,r),inverse:this.noop,data:r},i=typeof a===s?a.call(e,o):a,t.oauth||(i=c.call(e,i,o)),null!=i&&(p+=i),p+="\n",a=null!=(a=t.oauth||(null!=e?e.oauth:e))?a:l,o={name:"oauth",hash:{},fn:this.program(14,r),inverse:this.noop,data:r},i=typeof a===s?a.call(e,o):a,t.oauth||(i=c.call(e,i,o)),null!=i&&(p+=i),i=t["if"].call(e,null!=e?e.type:e,{name:"if",hash:{},fn:this.program(16,r),inverse:this.noop,data:r}),null!=i&&(p+=i),p+="        <form accept-charset='UTF-8' class='sandbox'>\n          <div style='margin:0;padding:0;display:inline'></div>\n",i=t["if"].call(e,null!=e?e.parameters:e,{nam
 e:"if",hash:{},fn:this.program(18,r),inverse:this.noop,data:r}),null!=i&&(p+=i),i=t["if"].call(e,null!=e?e.responseMessages:e,{name:"if",hash:{},fn:this.program(20,r),inverse:this.noop,data:r}),null!=i&&(p+=i),i=t["if"].call(e,null!=e?e.isReadOnly:e,{name:"if",hash:{},fn:this.program(22,r),inverse:this.program(24,r),data:r}),null!=i&&(p+=i),p+="        </form>\n        <div class='response' style='display:none'>\n          <h4 class='curl'>Curl</h4>\n          <div class='block curl'></div>\n          <h4 data-sw-translate>Request URL</h4>\n          <div class='block request_url'></div>\n",i=t["if"].call(e,null!=e?e.showRequestHeaders:e,{name:"if",hash:{},fn:this.program(26,r),inverse:this.noop,data:r}),null!=i&&(p+=i),p+"          <h4 data-sw-translate>Response Body</h4>\n          <div class='block response_body'></div>\n          <h4 data-sw-translate>Response Code</h4>\n          <div class='block response_code'></div>\n          <h4 data-sw-translate>Response Headers</h4>\n   
        <div class='block response_headers'></div>\n        </div>\n      </div>\n    </li>\n  </ul>\n"},useData:!0}),this.Handlebars.templates.param_list=Handlebars.template({1:function(e,t,n,r){return" required"},3:function(e,t,n,r){return' multiple="multiple"'},5:function(e,t,n,r){return" required "},7:function(e,t,n,r){var i,a="      <option ";return i=t.unless.call(e,null!=e?e.hasDefault:e,{name:"unless",hash:{},fn:this.program(8,r),inverse:this.noop,data:r}),null!=i&&(a+=i),a+" value=''></option>\n"},8:function(e,t,n,r){return'  selected="" '},10:function(e,t,n,r){var i,a,o="function",s=t.helperMissing,l=this.escapeExpression,u="\n      <option ";return i=t["if"].call(e,null!=e?e.isDefault:e,{name:"if",hash:{},fn:this.program(11,r),inverse:this.noop,data:r}),null!=i&&(u+=i),u+="  value='"+l((a=null!=(a=t.value||(null!=e?e.value:e))?a:s,typeof a===o?a.call(e,{name:"value",hash:{},data:r}):a))+"'> "+l((a=null!=(a=t.value||(null!=e?e.value:e))?a:s,typeof a===o?a.call(e,{name:"valu
 e",hash:{},data:r}):a))+" ",i=t["if"].call(e,null!=e?e.isDefault:e,{name:"if",hash:{},fn:this.program(13,r),inverse:this.noop,data:r}),null!=i&&(u+=i),u+" </option>\n\n"},11:function(e,t,n,r){return' selected=""  '},13:function(e,t,n,r){return" (default) "},15:function(e,t,n,r){return"<strong>"},17:function(e,t,n,r){return"</strong>"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,a,o="function",s=t.helperMissing,l=this.escapeExpression,u="<td class='code";return i=t["if"].call(e,null!=e?e.required:e,{name:"if",hash:{},fn:this.program(1,r),inverse:this.noop,data:r}),null!=i&&(u+=i),u+="'><label for='"+l((a=null!=(a=t.valueId||(null!=e?e.valueId:e))?a:s,typeof a===o?a.call(e,{name:"valueId",hash:{},data:r}):a))+"'>"+l((a=null!=(a=t.name||(null!=e?e.name:e))?a:s,typeof a===o?a.call(e,{name:"name",hash:{},data:r}):a))+"</label></td>\n<td>\n  <select ",i=(t.isArray||e&&e.isArray||s).call(e,e,{name:"isArray",hash:{},fn:this.program(3,r),inverse:this.noop,data:r}),null!=i&&(u
 +=i),u+=' class="parameter ',i=t["if"].call(e,null!=e?e.required:e,{name:"if",hash:{},fn:this.program(5,r),inverse:this.noop,data:r}),null!=i&&(u+=i),u+='" name="'+l((a=null!=(a=t.name||(null!=e?e.name:e))?a:s,typeof a===o?a.call(e,{name:"name",hash:{},data:r}):a))+'" id="'+l((a=null!=(a=t.valueId||(null!=e?e.valueId:e))?a:s,typeof a===o?a.call(e,{name:"valueId",hash:{},data:r}):a))+'">\n\n',i=t.unless.call(e,null!=e?e.required:e,{name:"unless",hash:{},fn:this.program(7,r),inverse:this.noop,data:r}),null!=i&&(u+=i),u+="\n",i=t.each.call(e,null!=(i=null!=e?e.allowableValues:e)?i.descriptiveValues:i,{name:"each",hash:{},fn:this.program(10,r),inverse:this.noop,data:r}),null!=i&&(u+=i),u+='\n  </select>\n</td>\n<td class="markdown">',i=t["if"].call(e,null!=e?e.required:e,{name:"if",hash:{},fn:this.program(15,r),inverse:this.noop,data:r}),null!=i&&(u+=i),a=null!=(a=t.description||(null!=e?e.description:e))?a:s,i=typeof a===o?a.call(e,{name:"description",hash:{},data:r}):a,null!=i&&(u+=i)
 ,i=t["if"].call(e,null!=e?e.required:e,{name:"if",hash:{},fn:this.program(17,r),inverse:this.noop,data:r}),null!=i&&(u+=i),u+="</td>\n<td>",a=null!=(a=t.paramType||(null!=e?e.paramType:e))?a:s,i=typeof a===o?a.call(e,{name:"paramType",hash:{},data:r}):a,null!=i&&(u+=i),u+'</td>\n<td><span class="model-signature"></span></td>\n'},useData:!0}),this.Handlebars.templates.param_readonly_required=Handlebars.template({1:function(e,t,n,r){var i,a="function",o=t.helperMissing,s=this.escapeExpression;return"        <textarea class='body-textarea' readonly='readonly' placeholder='(required)' name='"+s((i=null!=(i=t.name||(null!=e?e.name:e))?i:o,typeof i===a?i.call(e,{name:"name",hash:{},data:r}):i))+"' id='"+s((i=null!=(i=t.valueId||(null!=e?e.valueId:e))?i:o,typeof i===a?i.call(e,{name:"valueId",hash:{},data:r}):i))+"'>"+s((i=null!=(i=t["default"]||(null!=e?e["default"]:e))?i:o,typeof i===a?i.call(e,{name:"default",hash:{},data:r}):i))+"</textarea>\n"},3:function(e,t,n,r){var i,a="";return i=
 t["if"].call(e,null!=e?e["default"]:e,{name:"if",hash:{},fn:this.program(4,r),inverse:this.program(6,r),data:r}),null!=i&&(a+=i),a},4:function(e,t,n,r){var i,a="function",o=t.helperMissing,s=this.escapeExpression;return"            "+s((i=null!=(i=t["default"]||(null!=e?e["default"]:e))?i:o,typeof i===a?i.call(e,{name:"default",hash:{},data:r}):i))+"\n"},6:function(e,t,n,r){return"            (empty)\n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,a,o="function",s=t.helperMissing,l=this.escapeExpression,u="<td class='code required'><label for='"+l((a=null!=(a=t.valueId||(null!=e?e.valueId:e))?a:s,typeof a===o?a.call(e,{name:"valueId",hash:{},data:r}):a))+"'>"+l((a=null!=(a=t.name||(null!=e?e.name:e))?a:s,typeof a===o?a.call(e,{name:"name",hash:{},data:r}):a))+"</label></td>\n<td>\n";return i=t["if"].call(e,null!=e?e.isBody:e,{name:"if",hash:{},fn:this.program(1,r),inverse:this.program(3,r),data:r}),null!=i&&(u+=i),u+='</td>\n<td class="markdown">',a=null!=(a=t.descri
 ption||(null!=e?e.description:e))?a:s,i=typeof a===o?a.call(e,{name:"description",hash:{},data:r}):a,null!=i&&(u+=i),u+="</td>\n<td>",a=null!=(a=t.paramType||(null!=e?e.paramType:e))?a:s,i=typeof a===o?a.call(e,{name:"paramType",hash:{},data:r}):a,null!=i&&(u+=i),u+'</td>\n<td><span class="model-signature"></span></td>\n'},useData:!0}),this.Handlebars.templates.param_readonly=Handlebars.template({1:function(e,t,n,r){var i,a="function",o=t.helperMissing,s=this.escapeExpression;return"        <textarea class='body-textarea' readonly='readonly' name='"+s((i=null!=(i=t.name||(null!=e?e.name:e))?i:o,typeof i===a?i.call(e,{name:"name",hash:{},data:r}):i))+"' id='"+s((i=null!=(i=t.valueId||(null!=e?e.valueId:e))?i:o,typeof i===a?i.call(e,{name:"valueId",hash:{},data:r}):i))+"'>"+s((i=null!=(i=t["default"]||(null!=e?e["default"]:e))?i:o,typeof i===a?i.call(e,{name:"default",hash:{},data:r}):i))+"</textarea>\n"},3:function(e,t,n,r){var i,a="";return i=t["if"].call(e,null!=e?e["default"]:e,{n
 ame:"if",hash:{},fn:this.program(4,r),inverse:this.program(6,r),data:r}),null!=i&&(a+=i),a},4:function(e,t,n,r){var i,a="function",o=t.helperMissing,s=this.escapeExpression;return"            "+s((i=null!=(i=t["default"]||(null!=e?e["default"]:e))?i:o,typeof i===a?i.call(e,{name:"default",hash:{},data:r}):i))+"\n"},6:function(e,t,n,r){return"            (empty)\n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,a,o="function",s=t.helperMissing,l=this.escapeExpression,u="<td class='code'><label for='"+l((a=null!=(a=t.valueId||(null!=e?e.valueId:e))?a:s,typeof a===o?a.call(e,{name:"valueId",hash:{},data:r}):a))+"'>"+l((a=null!=(a=t.name||(null!=e?e.name:e))?a:s,typeof a===o?a.call(e,{name:"name",hash:{},data:r}):a))+"</label></td>\n<td>\n";return i=t["if"].call(e,null!=e?e.isBody:e,{name:"if",hash:{},fn:this.program(1,r),inverse:this.program(3,r),data:r}),null!=i&&(u+=i),u+='</td>\n<td class="markdown">',a=null!=(a=t.description||(null!=e?e.description:e))?a:s,i=typeof a=
 ==o?a.call(e,{name:"description",hash:{},data:r}):a,null!=i&&(u+=i),u+="</td>\n<td>",a=null!=(a=t.paramType||(null!=e?e.paramType:e))?a:s,i=typeof a===o?a.call(e,{name:"paramType",hash:{},data:r}):a,null!=i&&(u+=i),u+'</td>\n<td><span class="model-signature"></span></td>\n'},useData:!0}),this.Handlebars.templates.param_required=Handlebars.template({1:function(e,t,n,r){var i,a="";return i=t["if"].call(e,null!=e?e.isFile:e,{name:"if",hash:{},fn:this.program(2,r),inverse:this.program(4,r),data:r}),null!=i&&(a+=i),a},2:function(e,t,n,r){var i,a="function",o=t.helperMissing,s=this.escapeExpression;return'			<input type="file" name=\''+s((i=null!=(i=t.name||(null!=e?e.name:e))?i:o,typeof i===a?i.call(e,{name:"name",hash:{},data:r}):i))+"' id='"+s((i=null!=(i=t.valueId||(null!=e?e.valueId:e))?i:o,typeof i===a?i.call(e,{name:"valueId",hash:{},data:r}):i))+"'/>\n"},4:function(e,t,n,r){var i,a="";return i=t["if"].call(e,null!=e?e["default"]:e,{name:"if",hash:{},fn:this.program(5,r),inverse:th
 is.program(7,r),data:r}),null!=i&&(a+=i),a},5:function(e,t,n,r){var i,a="function",o=t.helperMissing,s=this.escapeExpression;return"				<textarea class='body-textarea required' placeholder='(required)' name='"+s((i=null!=(i=t.name||(null!=e?e.name:e))?i:o,typeof i===a?i.call(e,{name:"name",hash:{},data:r}):i))+"' id=\""+s((i=null!=(i=t.valueId||(null!=e?e.valueId:e))?i:o,typeof i===a?i.call(e,{name:"valueId",hash:{},data:r}):i))+'">'+s((i=null!=(i=t["default"]||(null!=e?e["default"]:e))?i:o,typeof i===a?i.call(e,{name:"default",hash:{},data:r}):i))+'</textarea>\n        <br />\n        <div class="parameter-content-type" />\n'},7:function(e,t,n,r){var i,a="function",o=t.helperMissing,s=this.escapeExpression;return"				<textarea class='body-textarea required' placeholder='(required)' name='"+s((i=null!=(i=t.name||(null!=e?e.name:e))?i:o,typeof i===a?i.call(e,{name:"name",hash:{},data:r}):i))+"' id='"+s((i=null!=(i=t.valueId||(null!=e?e.valueId:e))?i:o,typeof i===a?i.call(e,{name:"val
 ueId",hash:{},data:r}):i))+'\'></textarea>\n				<br />\n				<div class="parameter-content-type" />\n'},9:function(e,t,n,r){var i,a="";return i=t["if"].call(e,null!=e?e.isFile:e,{name:"if",hash:{},fn:this.program(10,r),inverse:this.program(12,r),data:r}),null!=i&&(a+=i),a},10:function(e,t,n,r){var i,a="function",o=t.helperMissing,s=this.escapeExpression;return"			<input class='parameter' class='required' type='file' name='"+s((i=null!=(i=t.name||(null!=e?e.name:e))?i:o,typeof i===a?i.call(e,{name:"name",hash:{},data:r}):i))+"' id='"+s((i=null!=(i=t.valueId||(null!=e?e.valueId:e))?i:o,typeof i===a?i.call(e,{name:"valueId",hash:{},data:r}):i))+"'/>\n"},12:function(e,t,n,r){var i,a=t.helperMissing,o="";return i=(t.renderTextParam||e&&e.renderTextParam||a).call(e,e,{name:"renderTextParam",hash:{},fn:this.program(13,r),inverse:this.noop,data:r}),null!=i&&(o+=i),o},13:function(e,t,n,r){return""},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,a,o="function",s=t.helperMissing,l=
 this.escapeExpression,u="<td class='code required'><label for='"+l((a=null!=(a=t.valueId||(null!=e?e.valueId:e))?a:s,typeof a===o?a.call(e,{name:"valueId",hash:{},data:r}):a))+"'>"+l((a=null!=(a=t.name||(null!=e?e.name:e))?a:s,typeof a===o?a.call(e,{name:"name",hash:{},data:r}):a))+"</label></td>\n<td>\n";return i=t["if"].call(e,null!=e?e.isBody:e,{name:"if",hash:{},fn:this.program(1,r),inverse:this.program(9,r),data:r}),null!=i&&(u+=i),u+='</td>\n<td>\n	<strong><span class="markdown">',a=null!=(a=t.description||(null!=e?e.description:e))?a:s,i=typeof a===o?a.call(e,{name:"description",hash:{},data:r}):a,null!=i&&(u+=i),u+="</span></strong>\n</td>\n<td>",a=null!=(a=t.paramType||(null!=e?e.paramType:e))?a:s,i=typeof a===o?a.call(e,{name:"paramType",hash:{},data:r}):a,null!=i&&(u+=i),u+'</td>\n<td><span class="model-signature"></span></td>\n'},useData:!0}),this.Handlebars.templates.param=Handlebars.template({1:function(e,t,n,r){var i,a="";return i=t["if"].call(e,null!=e?e.isFile:e,{na
 me:"if",hash:{},fn:this.program(2,r),inverse:this.program(4,r),data:r}),null!=i&&(a+=i),a},2:function(e,t,n,r){var i,a="function",o=t.helperMissing,s=this.escapeExpression;return'			<input type="file" name=\''+s((i=null!=(i=t.name||(null!=e?e.name:e))?i:o,typeof i===a?i.call(e,{name:"name",hash:{},data:r}):i))+"' id='"+s((i=null!=(i=t.valueId||(null!=e?e.valueId:e))?i:o,typeof i===a?i.call(e,{name:"valueId",hash:{},data:r}):i))+'\'/>\n			<div class="parameter-content-type" />\n'},4:function(e,t,n,r){var i,a="";return i=t["if"].call(e,null!=e?e["default"]:e,{name:"if",hash:{},fn:this.program(5,r),inverse:this.program(7,r),data:r}),null!=i&&(a+=i),a},5:function(e,t,n,r){var i,a="function",o=t.helperMissing,s=this.escapeExpression;return"				<textarea class='body-textarea' name='"+s((i=null!=(i=t.name||(null!=e?e.name:e))?i:o,typeof i===a?i.call(e,{name:"name",hash:{},data:r}):i))+"' id='"+s((i=null!=(i=t.valueId||(null!=e?e.valueId:e))?i:o,typeof i===a?i.call(e,{name:"valueId",hash:{}
 ,data:r}):i))+"'>"+s((i=null!=(i=t["default"]||(null!=e?e["default"]:e))?i:o,typeof i===a?i.call(e,{
-name:"default",hash:{},data:r}):i))+'</textarea>\n        <br />\n        <div class="parameter-content-type" />\n'},7:function(e,t,n,r){var i,a="function",o=t.helperMissing,s=this.escapeExpression;return"				<textarea class='body-textarea' name='"+s((i=null!=(i=t.name||(null!=e?e.name:e))?i:o,typeof i===a?i.call(e,{name:"name",hash:{},data:r}):i))+"' id='"+s((i=null!=(i=t.valueId||(null!=e?e.valueId:e))?i:o,typeof i===a?i.call(e,{name:"valueId",hash:{},data:r}):i))+'\'></textarea>\n				<br />\n				<div class="parameter-content-type" />\n'},9:function(e,t,n,r){var i,a="";return i=t["if"].call(e,null!=e?e.isFile:e,{name:"if",hash:{},fn:this.program(2,r),inverse:this.program(10,r),data:r}),null!=i&&(a+=i),a},10:function(e,t,n,r){var i,a=t.helperMissing,o="";return i=(t.renderTextParam||e&&e.renderTextParam||a).call(e,e,{name:"renderTextParam",hash:{},fn:this.program(11,r),inverse:this.noop,data:r}),null!=i&&(o+=i),o},11:function(e,t,n,r){return""},compiler:[6,">= 2.0.0-beta.1"],main:f
 unction(e,t,n,r){var i,a,o="function",s=t.helperMissing,l=this.escapeExpression,u="<td class='code'><label for='"+l((a=null!=(a=t.valueId||(null!=e?e.valueId:e))?a:s,typeof a===o?a.call(e,{name:"valueId",hash:{},data:r}):a))+"'>"+l((a=null!=(a=t.name||(null!=e?e.name:e))?a:s,typeof a===o?a.call(e,{name:"name",hash:{},data:r}):a))+"</label></td>\n<td>\n\n";return i=t["if"].call(e,null!=e?e.isBody:e,{name:"if",hash:{},fn:this.program(1,r),inverse:this.program(9,r),data:r}),null!=i&&(u+=i),u+='\n</td>\n<td class="markdown">',a=null!=(a=t.description||(null!=e?e.description:e))?a:s,i=typeof a===o?a.call(e,{name:"description",hash:{},data:r}):a,null!=i&&(u+=i),u+="</td>\n<td>",a=null!=(a=t.paramType||(null!=e?e.paramType:e))?a:s,i=typeof a===o?a.call(e,{name:"paramType",hash:{},data:r}):a,null!=i&&(u+=i),u+'</td>\n<td>\n	<span class="model-signature"></span>\n</td>\n'},useData:!0}),this.Handlebars.templates.parameter_content_type=Handlebars.template({1:function(e,t,n,r){var i,a="";return
  i=t.each.call(e,null!=e?e.consumes:e,{name:"each",hash:{},fn:this.program(2,r),inverse:this.noop,data:r}),null!=i&&(a+=i),a},2:function(e,t,n,r){var i,a=this.lambda,o='  <option value="';return i=a(e,e),null!=i&&(o+=i),o+='">',i=a(e,e),null!=i&&(o+=i),o+"</option>\n"},4:function(e,t,n,r){return'  <option value="application/json">application/json</option>\n'},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,a,o="function",s=t.helperMissing,l=this.escapeExpression,u='<label for="'+l((a=null!=(a=t.parameterContentTypeId||(null!=e?e.parameterContentTypeId:e))?a:s,typeof a===o?a.call(e,{name:"parameterContentTypeId",hash:{},data:r}):a))+'">Parameter content type:</label>\n<select name="parameterContentType" id="'+l((a=null!=(a=t.parameterContentTypeId||(null!=e?e.parameterContentTypeId:e))?a:s,typeof a===o?a.call(e,{name:"parameterContentTypeId",hash:{},data:r}):a))+'">\n';return i=t["if"].call(e,null!=e?e.consumes:e,{name:"if",hash:{},fn:this.program(1,r),inverse:this.progra
 m(4,r),data:r}),null!=i&&(u+=i),u+"</select>\n"},useData:!0}),this.Handlebars.templates.resource=Handlebars.template({1:function(e,t,n,r){return" : "},3:function(e,t,n,r){var i,a="function",o=t.helperMissing,s=this.escapeExpression;return"    <li>\n      <a href='"+s((i=null!=(i=t.url||(null!=e?e.url:e))?i:o,typeof i===a?i.call(e,{name:"url",hash:{},data:r}):i))+"' data-sw-translate>Raw</a>\n    </li>\n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,a,o,s="function",l=t.helperMissing,u=this.escapeExpression,c=t.blockHelperMissing,p="<div class='heading'>\n  <h2>\n    <a href='#!/"+u((a=null!=(a=t.id||(null!=e?e.id:e))?a:l,typeof a===s?a.call(e,{name:"id",hash:{},data:r}):a))+'\' class="toggleEndpointList" data-id="'+u((a=null!=(a=t.id||(null!=e?e.id:e))?a:l,typeof a===s?a.call(e,{name:"id",hash:{},data:r}):a))+'">'+u((a=null!=(a=t.name||(null!=e?e.name:e))?a:l,typeof a===s?a.call(e,{name:"name",hash:{},data:r}):a))+"</a> ";return a=null!=(a=t.summary||(null!=e?e.summa
 ry:e))?a:l,o={name:"summary",hash:{},fn:this.program(1,r),inverse:this.noop,data:r},i=typeof a===s?a.call(e,o):a,t.summary||(i=c.call(e,i,o)),null!=i&&(p+=i),a=null!=(a=t.summary||(null!=e?e.summary:e))?a:l,i=typeof a===s?a.call(e,{name:"summary",hash:{},data:r}):a,null!=i&&(p+=i),p+="\n  </h2>\n  <ul class='options'>\n    <li>\n      <a href='#!/"+u((a=null!=(a=t.id||(null!=e?e.id:e))?a:l,typeof a===s?a.call(e,{name:"id",hash:{},data:r}):a))+"' id='endpointListTogger_"+u((a=null!=(a=t.id||(null!=e?e.id:e))?a:l,typeof a===s?a.call(e,{name:"id",hash:{},data:r}):a))+'\' class="toggleEndpointList" data-id="'+u((a=null!=(a=t.id||(null!=e?e.id:e))?a:l,typeof a===s?a.call(e,{name:"id",hash:{},data:r}):a))+'" data-sw-translate>Show/Hide</a>\n    </li>\n    <li>\n      <a href=\'#\' class="collapseResource" data-id="'+u((a=null!=(a=t.id||(null!=e?e.id:e))?a:l,typeof a===s?a.call(e,{name:"id",hash:{},data:r}):a))+'" data-sw-translate>\n        List Operations\n      </a>\n    </li>\n    <li>
 \n      <a href=\'#\' class="expandResource" data-id="'+u((a=null!=(a=t.id||(null!=e?e.id:e))?a:l,typeof a===s?a.call(e,{name:"id",hash:{},data:r}):a))+'" data-sw-translate>\n        Expand Operations\n      </a>\n    </li>\n',i=t["if"].call(e,null!=e?e.url:e,{name:"if",hash:{},fn:this.program(3,r),inverse:this.noop,data:r}),null!=i&&(p+=i),p+"  </ul>\n</div>\n<ul class='endpoints' id='"+u((a=null!=(a=t.id||(null!=e?e.id:e))?a:l,typeof a===s?a.call(e,{name:"id",hash:{},data:r}):a))+"_endpoint_list' style='display:none'>\n\n</ul>\n"},useData:!0}),this.Handlebars.templates.response_content_type=Handlebars.template({1:function(e,t,n,r){var i,a="";return i=t.each.call(e,null!=e?e.produces:e,{name:"each",hash:{},fn:this.program(2,r),inverse:this.noop,data:r}),null!=i&&(a+=i),a},2:function(e,t,n,r){var i,a=this.lambda,o='  <option value="';return i=a(e,e),null!=i&&(o+=i),o+='">',i=a(e,e),null!=i&&(o+=i),o+"</option>\n"},4:function(e,t,n,r){return'  <option value="application/json">applica
 tion/json</option>\n'},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,a,o="function",s=t.helperMissing,l=this.escapeExpression,u='<label data-sw-translate for="'+l((a=null!=(a=t.responseContentTypeId||(null!=e?e.responseContentTypeId:e))?a:s,typeof a===o?a.call(e,{name:"responseContentTypeId",hash:{},data:r}):a))+'">Response Content Type</label>\n<select name="responseContentType" id="'+l((a=null!=(a=t.responseContentTypeId||(null!=e?e.responseContentTypeId:e))?a:s,typeof a===o?a.call(e,{name:"responseContentTypeId",hash:{},data:r}):a))+'">\n';return i=t["if"].call(e,null!=e?e.produces:e,{name:"if",hash:{},fn:this.program(1,r),inverse:this.program(4,r),data:r}),null!=i&&(u+=i),u+"</select>\n"},useData:!0}),this.Handlebars.templates.signature=Handlebars.template({compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,a,o="function",s=t.helperMissing,l=this.escapeExpression,u='<div>\n<ul class="signature-nav">\n  <li><a class="description-link" href="#" data-sw-trans
 late>Model</a></li>\n  <li><a class="snippet-link" href="#" data-sw-translate>Model Schema</a></li>\n</ul>\n<div>\n\n<div class="signature-container">\n  <div class="description">\n    ';return a=null!=(a=t.signature||(null!=e?e.signature:e))?a:s,i=typeof a===o?a.call(e,{name:"signature",hash:{},data:r}):a,null!=i&&(u+=i),u+'\n  </div>\n\n  <div class="snippet">\n    <pre><code>'+l((a=null!=(a=t.sampleJSON||(null!=e?e.sampleJSON:e))?a:s,typeof a===o?a.call(e,{name:"sampleJSON",hash:{},data:r}):a))+'</code></pre>\n    <small class="notice"></small>\n  </div>\n</div>\n\n'},useData:!0}),this.Handlebars.templates.status_code=Handlebars.template({1:function(e,t,n,r){var i=this.lambda,a=this.escapeExpression;return"      <tr>\n        <td>"+a(i(r&&r.key,e))+"</td>\n        <td>"+a(i(null!=e?e.description:e,e))+"</td>\n        <td>"+a(i(null!=e?e.type:e,e))+"</td>\n      </tr>\n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,a,o="function",s=t.helperMissing,l=this.escapeExpr
 ession,u="<td width='15%' class='code'>"+l((a=null!=(a=t.code||(null!=e?e.code:e))?a:s,typeof a===o?a.call(e,{name:"code",hash:{},data:r}):a))+'</td>\n<td class="markdown">';return a=null!=(a=t.message||(null!=e?e.message:e))?a:s,i=typeof a===o?a.call(e,{name:"message",hash:{},data:r}):a,null!=i&&(u+=i),u+='</td>\n<td width=\'50%\'><span class="model-signature" /></td>\n<td class="headers">\n  <table>\n    <tbody>\n',i=t.each.call(e,null!=e?e.headers:e,{name:"each",hash:{},fn:this.program(1,r),inverse:this.noop,data:r}),null!=i&&(u+=i),u+"    </tbody>\n  </table>\n</td>"},useData:!0}),function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.SwaggerClient=e()}}(function(){var e;return function t(e,n,r){function i(o,s){if(!n[o]){if(!e[o]){var l="function"==typeof require&&require;i
 f(!s&&l)return l(o,!0);if(a)return a(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var c=n[o]={exports:{}};e[o][0].call(c.exports,function(t){var n=e[o][1][t];return i(n?n:t)},c,c.exports,t,e,n,r)}return n[o].exports}for(var a="function"==typeof require&&require,o=0;o<r.length;o++)i(r[o]);return i}({1:[function(e,t,n){"use strict";var r=e("./lib/auth"),i=e("./lib/helpers"),a=e("./lib/client"),o=function(e,t){return i.log('This is deprecated, use "new SwaggerClient" instead.'),new a(e,t)};Array.prototype.indexOf||(Array.prototype.indexOf=function(e,t){for(var n=t||0,r=this.length;r>n;n++)if(this[n]===e)return n;return-1}),String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")}),String.prototype.endsWith||(String.prototype.endsWith=function(e){return-1!==this.indexOf(e,this.length-e.length)}),t.exports=a,a.ApiKeyAuthorization=r.ApiKeyAuthorization,a.PasswordAuthorization=r.PasswordAuthorization,a.CookieAuth
 orization=r.CookieAuthorization,a.SwaggerApi=o,a.SwaggerClient=o,a.SchemaMarkup=e("./lib/schema-markup")},{"./lib/auth":2,"./lib/client":3,"./lib/helpers":4,"./lib/schema-markup":7}],2:[function(e,t,n){"use strict";var r=e("./helpers"),i=e("btoa"),a=e("cookiejar"),o={each:e("lodash-compat/collection/each"),includes:e("lodash-compat/collection/includes"),isObject:e("lodash-compat/lang/isObject"),isArray:e("lodash-compat/lang/isArray")},s=t.exports.SwaggerAuthorizations=function(e){this.authz=e||{}};s.prototype.add=function(e,t){if(o.isObject(e))for(var n in e)this.authz[n]=e[n];else"string"==typeof e&&(this.authz[e]=t);return t},s.prototype.remove=function(e){return delete this.authz[e]},s.prototype.apply=function(e,t){var n=!0,r=!t,i=[];return o.each(t,function(e,t){"string"==typeof t&&i.push(t),o.each(e,function(e,t){i.push(t)})}),o.each(this.authz,function(t,a){if(r||o.includes(i,a)){var s=t.apply(e);n=n&&!!s}}),n};var l=t.exports.ApiKeyAuthorization=function(e,t,n){this.name=e,th
 is.value=t,this.type=n};l.prototype.apply=function(e){return"query"===this.type?(e.url.indexOf("?")>0?e.url=e.url+"&"+this.name+"="+this.value:e.url=e.url+"?"+this.name+"="+this.value,!0):"header"===this.type?("undefined"==typeof e.headers[this.name]&&(e.headers[this.name]=this.value),!0):void 0};var u=t.exports.CookieAuthorization=function(e){this.cookie=e};u.prototype.apply=function(e){return e.cookieJar=e.cookieJar||new a,e.cookieJar.setCookie(this.cookie),!0};var c=t.exports.PasswordAuthorization=function(e,t){3===arguments.length&&(r.log("PasswordAuthorization: the 'name' argument has been removed, pass only username and password"),e=arguments[1],t=arguments[2]),this.username=e,this.password=t};c.prototype.apply=function(e){return"undefined"==typeof e.headers.Authorization&&(e.headers.Authorization="Basic "+i(this.username+":"+this.password)),!0}},{"./helpers":4,btoa:18,cookiejar:19,"lodash-compat/collection/each":55,"lodash-compat/collection/includes":58,"lodash-compat/lang/is
 Array":143,"lodash-compat/lang/isObject":147}],3:[function(e,t,n){"use strict";var r={bind:e("lodash-compat/function/bind"),cloneDeep:e("lodash-compat/lang/cloneDeep"),find:e("lodash-compat/collection/find"),forEach:e("lodash-compat/collection/forEach"),indexOf:e("lodash-compat/array/indexOf"),isArray:e("lodash-compat/lang/isArray"),isObject:e("lodash-compat/lang/isObject"),isFunction:e("lodash-compat/lang/isFunction"),isPlainObject:e("lodash-compat/lang/isPlainObject"),isUndefined:e("lodash-compat/lang/isUndefined")},i=e("./auth"),a=e("./helpers"),o=e("./types/model"),s=e("./types/operation"),l=e("./types/operationGroup"),u=e("./resolver"),c=e("./http"),p=e("./spec-converter"),f=["apis","authorizationScheme","authorizations","basePath","build","buildFrom1_1Spec","buildFrom1_2Spec","buildFromSpec","clientAuthorizations","convertInfo","debug","defaultErrorCallback","defaultSuccessCallback","fail","failure","finish","help","idFromOp","info","initialize","isBuilt","isValid","modelPrope
 rtyMacro","models","modelsArray","options","parameterMacro","parseUri","progress","resourceCount","sampleModels","selfReflect","setConsolidatedModels","spec","supportedSubmitMethods","swaggerRequestHeaders","tagFromLabel","title","url","useJQuery"],h=["apis","asCurl","description","externalDocs","help","label","name","operation","operations","operationsArray","path","tag"],d=["delete","get","head","options","patch","post","put"],m=t.exports=function(e,t){return this.authorizations=null,this.authorizationScheme=null,this.basePath=null,this.debug=!1,this.info=null,this.isBuilt=!1,this.isValid=!1,this.modelsArray=[],this.resourceCount=0,this.url=null,this.useJQuery=!1,this.swaggerObject={},this.clientAuthorizations=new i.SwaggerAuthorizations,"undefined"!=typeof e?this.initialize(e,t):this};m.prototype.initialize=function(e,t){this.models={},this.sampleModels={},"string"==typeof e?this.url=e:r.isObject(e)&&(t=e,this.url=t.url),t=t||{},this.clientAuthorizations.add(t.authorizations),thi
 s.swaggerRequestHeaders=t.swaggerRequestHeaders||"application/json;charset=utf-8,*/*",this.defaultSuccessCallback=t.defaultSuccessCallback||null,this.defaultErrorCallback=t.defaultErrorCallback||null,this.modelPropertyMacro=t.modelPropertyMacro||null,this.parameterMacro=t.parameterMacro||null,"function"==typeof t.success&&(this.success=t.success),t.useJQuery&&(this.useJQuery=t.useJQuery),this.options=t||{},this.supportedSubmitMethods=t.supportedSubmitMethods||[],this.failure=t.failure||function(){},this.progress=t.progress||function(){},this.spec=r.cloneDeep(t.spec),t.scheme&&(this.scheme=t.scheme),"function"==typeof t.success&&(this.ready=!0,this.build())},m.prototype.build=function(e){if(this.isBuilt)return this;var t=this;this.progress("fetching resource list: "+this.url+"; Please wait.");var n={useJQuery:this.useJQuery,url:this.url,method:"get",headers:{accept:this.swaggerRequestHeaders},on:{error:function(e){return"http"!==t.url.substring(0,4)?t.fail("Please specify the protoco
 l for "+t.url):0===e.status?t.fail("Can't read from server.  It may not have the appropriate access-control-origin settings."):404===e.status?t.fail("Can't read swagger JSON from "+t.url):t.fail(e.status+" : "+e.statusText+" "+t.url)},response:function(e){var n=e.obj;if(!n)return t.fail("failed to parse JSON/YAML response");if(t.swaggerVersion=n.swaggerVersion,t.swaggerObject=n,n.swagger&&2===parseInt(n.swagger))t.swaggerVersion=n.swagger,(new u).resolve(n,t.url,t.buildFromSpec,t),t.isValid=!0;else{var r=new p;t.oldSwaggerObject=t.swaggerObject,r.setDocumentationLocation(t.url),r.convert(n,t.clientAuthorizations,function(e){t.swaggerObject=e,(new u).resolve(e,t.url,t.buildFromSpec,t),t.isValid=!0})}}}};if(this.spec)t.swaggerObject=this.spec,setTimeout(function(){(new u).resolve(t.spec,t.buildFromSpec,t)},10);else{if(this.clientAuthorizations.apply(n),e)return n;(new c).execute(n,this.options)}return this},m.prototype.buildFromSpec=function(e){if(this.isBuilt)return this;this.apis={}
 ,this.apisArray=[],this.basePath=e.basePath||"",this.consumes=e.consumes,this.host=e.host||"",this.info=e.info||{},this.produces=e.produces,this.schemes=e.schemes||[],this.securityDefinitions=e.securityDefinitions,this.title=e.title||"",e.externalDocs&&(this.externalDocs=e.externalDocs),this.authSchemes=e.securityDefinitions;var t,n={};if(Array.isArray(e.tags))for(n={},t=0;t<e.tags.length;t++){var i=e.tags[t];n[i.name]=i}var u;"string"==typeof this.url?(u=this.parseUri(this.url),"undefined"==typeof this.scheme&&"undefined"==typeof this.schemes||0===this.schemes.length?this.scheme=u.scheme||"http":"undefined"==typeof this.scheme&&(this.scheme=this.schemes[0]),("undefined"==typeof this.host||""===this.host)&&(this.host=u.host,u.port&&(this.host=this.host+":"+u.port))):"undefined"==typeof this.schemes||0===this.schemes.length?this.scheme="http":"undefined"==typeof this.scheme&&(this.scheme=this.schemes[0]),this.definitions=e.definitions;var c;for(c in this.definitions){var p=new o(c,th
 is.definitions[c],this.models,this.modelPropertyMacro);p&&(this.models[c]=p)}var m=this;return m.apis.help=r.bind(m.help,m),r.forEach(e.paths,function(e,t){r.isPlainObject(e)&&r.forEach(d,function(i){var o=e[i];if(!r.isUndefined(o)){if(!r.isPlainObject(o))return void a.log("The '"+i+"' operation for '"+t+"' path is not an Operation Object");var u=o.tags;(r.isUndefined(u)||!r.isArray(u)||0===u.length)&&(u=o.tags=["default"]);var c=m.idFromOp(t,i,o),p=new s(m,o.scheme,c,i,t,o,m.definitions,m.models,m.clientAuthorizations);r.forEach(u,function(e){var t=r.indexOf(f,e)>-1?"_"+e:e,i=r.indexOf(h,e)>-1?"_"+e:e,o=m[t];if(t!==e&&a.log("The '"+e+"' tag conflicts with a SwaggerClient function/property name.  Use 'client."+t+"' or 'client.apis."+e+"' instead of 'client."+e+"'."),i!==e&&a.log("The '"+e+"' tag conflicts with a SwaggerClient operation function/property name.  Use 'client.apis."+i+"' instead of 'client.apis."+e+"'."),r.indexOf(h,c)>-1&&(a.log("The '"+c+"' operationId conflicts with 
 a SwaggerClient operation function/property name.  Use 'client.apis."+i+"._"+c+"' instead of 'client.apis."+i+"."+c+"'."),c="_"+c,p.nickname=c),r.isUndefined(o)){o=m[t]=m.apis[i]={},o.operations={},o.label=i,o.apis={};var s=n[e];r.isUndefined(s)||(o.description=s.description,o.externalDocs=s.externalDocs),m[t].help=r.bind(m.help,o),m.apisArray.push(new l(e,o.description,o.externalDocs,p))}r.isFunction(o.help)||(o.help=r.bind(m.help,o)),m.apis[i][c]=o[c]=r.bind(p.execute,p),m.apis[i][c].help=o[c].help=r.bind(p.help,p),m.apis[i][c].asCurl=o[c].asCurl=r.bind(p.asCurl,p),o.apis[c]=o.operations[c]=p;var u=r.find(m.apisArray,function(t){return t.tag===e});u&&u.operationsArray.push(p)})}})}),this.isBuilt=!0,this.success&&(this.isValid=!0,this.isBuilt=!0,this.success()),this},m.prototype.parseUri=function(e){var t=/^(((([^:\/#\?]+:)?(?:(\/\/)((?:(([^:@\/#\?]+)(?:\:([^:@\/#\?]+))?)@)?(([^:\/#\?\]\[]+|\[[^\/\]@#?]+\])(?:\:([0-9]+))?))?)?)?((\/?(?:[^\/\?#]+\/+)*)([^\?#]*)))?(\?[^#]+)?)(#.*)?/,
 n=t.exec(e);return{scheme:n[4].replace(":",""),host:n[11],port:n[12],path:n[15]}},m.prototype.help=function(e){var t="";return this instanceof m?r.forEach(this.apis,function(e,n){r.isPlainObject(e)&&(t+="operations for the '"+n+"' tag\n",r.forEach(e.operations,function(e,n){t+="  * "+n+": "+e.summary+"\n"}))}):(this instanceof l||r.isPlainObject(this))&&(t+="operations for the '"+this.label+"' tag\n",r.forEach(this.apis,function(e,n){t+="  * "+n+": "+e.summary+"\n"})),e?t:(a.log(t),t)},m.prototype.tagFromLabel=function(e){return e},m.prototype.idFromOp=function(e,t,n){n&&n.operationId||(n=n||{},n.operationId=t+"_"+e);var r=n.operationId.replace(/[\s!@#$%^&*()_+=\[{\]};:<>|.\/?,\\'""-]/g,"_")||e.substring(1)+"_"+t;return r=r.replace(/((_){2,})/g,"_"),r=r.replace(/^(_)*/g,""),r=r.replace(/([_])*$/g,"")},m.prototype.setHost=function(e){this.host=e,this.apis&&r.forEach(this.apis,function(t){t.operations&&r.forEach(t.operations,function(t){t.host=e})})},m.prototype.setBasePath=function(e
 ){this.basePath=e,this.apis&&r.forEach(this.apis,function(t){t.operations&&r.forEach(t.operations,function(t){t.basePath=e})})},m.prototype.fail=function(e){throw this.failure(e),e}},{"./auth":2,"./helpers":4,"./http":5,"./resolver":6,"./spec-converter":8,"./types/model":9,"./types/operation":10,"./types/operationGroup":11,"lodash-compat/array/indexOf":52,"lodash-compat/collection/find":56,"lodash-compat/collection/forEach":57,"lodash-compat/function/bind":61,"lodash-compat/lang/cloneDeep":141,"lodash-compat/lang/isArray":143,"lodash-compat/lang/isFunction":145,"lodash-compat/lang/isObject":147,"lodash-compat/lang/isPlainObject":148,"lodash-compat/lang/isUndefined":151}],4:[function(e,t,n){(function(n){"use strict";var r={isPlainObject:e("lodash-compat/lang/isPlainObject"),indexOf:e("lodash-compat/array/indexOf")};t.exports.__bind=function(e,t){return function(){return e.apply(t,arguments)}};var i=t.exports.log=function(){console&&"test"!==n.env.NODE_ENV&&console.log(Array.prototype
 .slice.call(arguments)[0])};t.exports.fail=function(e){i(e)};var a=(t.exports.optionHtml=function(e,t){return'<tr><td class="optionName">'+e+":</td><td>"+t+"</td></tr>"},t.exports.resolveSchema=function(e){return r.isPlainObject(e.schema)&&(e=a(e.schema)),e});t.exports.simpleRef=function(e){return"undefined"==typeof e?null:0===e.indexOf("#/definitions/")?e.substring("#/definitions/".length):e}}).call(this,e("_process"))},{_process:17,"lodash-compat/array/indexOf":52,"lodash-compat/lang/isPlainObject":148}],5:[function(e,t,n){"use strict";var r=e("./helpers"),i=e("jquery"),a=e("superagent"),o=e("js-yaml"),s={isObject:e("lodash-compat/lang/isObject")},l=function(){},u=function(){},c=t.exports=function(){};c.prototype.execute=function(e,t){var n;n=t&&t.client?t.client:new u(t),(e&&e.useJQuery===!0||this.isInternetExplorer())&&(n=new l(t));var r=e.on.response,i=function(e){t&&t.responseInterceptor&&(e=t.responseInterceptor.apply(e)),r(e)};e.on.response=function(e){i(e)},s.isObject(e)&&s
 .isObject(e.body)&&(e.body.type&&"formData"===e.body.type?(e.contentType=!1,e.processData=!1,delete e.headers["Content-Type"]):e.body=JSON.stringify(e.body)),n.execute(e)},c.prototype.isInternetExplorer=function(){var e=!1;if("undefined"!=typeof navigator&&navigator.userAgent){var t=navigator.userAgent.toLowerCase();if(-1!==t.indexOf("msie")){var n=parseInt(t.split("msie")[1]);8>=n&&(e=!0)}}return e},l.prototype.execute=function(e){var t=e.on,n=e;return e.type=e.method,e.cache=!1,delete e.useJQuery,e.data=e.body,delete e.body,e.complete=function(e){for(var i={},a=e.getAllResponseHeaders().split("\n"),s=0;s<a.length;s++){var l=a[s].trim();if(0!==l.length){var u=l.indexOf(":");if(-1!==u){var c=l.substring(0,u).trim(),p=l.substring(u+1).trim();i[c]=p}else i[l]=null}}var f={url:n.url,method:n.method,status:e.status,statusText:e.statusText,data:e.responseText,headers:i};try{var h=e.responseJSON||o.safeLoad(e.responseText);f.obj="string"==typeof h?{}:h}catch(d){r.log("unable to parse JSON
 /YAML content")}if(f.obj=f.obj||null,e.status>=200&&e.status<300)t.response(f);else{if(!(0===e.status||e.status>=400&&e.status<599))return t.response(f);t.error(f)}},i.support.cors=!0,i.ajax(e)},u.prototype.execute=function(e){var t=e.method.toLowerCase();"delete"===t&&(t="del");var n,i=e.headers||{},s=a[t](e.url);for(n in i)s.set(n,i[n]);e.body&&s.send(e.body),"function"==typeof s.buffer&&s.buffer(),s.end(function(t,n){n=n||{status:0,headers:{error:"no response from server"}};var i,a={url:e.url,method:e.method,headers:n.headers};if(!t&&n.error&&(t=n.error),t&&e.on&&e.on.error)a.obj=t,a.status=n?n.status:500,a.statusText=n?n.text:t.message,i=e.on.error;else if(n&&e.on&&e.on.response){var s;if(n.body&&Object.keys(n.body).length>0)s=n.body;else try{s=o.safeLoad(n.text),s="string"==typeof s?null:s}catch(l){r.log("cannot parse JSON/YAML content")}a.obj=s||null,a.status=n.status,a.statusText=n.text,i=e.on.response}a.data=a.statusText,i&&i(a)})}},{"./helpers":4,jquery:20,"js-yaml":21,"lod
 ash-compat/lang/isObject":147,superagent:160}],6:[function(e,t,n){"use strict";var r=e("./http"),i={isObject:e("lodash-compat/lang/isObject"),isArray:e("lodash-compat/lang/isArray")},a=t.exports=function(){};a.prototype.processAllOf=function(e,t,n,r,i){var a,o,s;t["x-resolved-from"]=["#/definitions/"+e];var l=t.allOf;for(l.sort(function(e,t){return e.$ref&&t.$ref?0:e.$ref?-1:1}),a=0;a<l.length;a++)s=l[a],o="/definitions/"+e+"/allOf",this.resolveInline(null,i,s,n,r,o)},a.prototype.resolve=function(e,t,n,a){var o,s,l=t,u=n,c=a;"function"==typeof t&&(l=null,u=t,c=n);var p=l;this.scope=c||this,this.iteration=this.iteration||0;var f,h,d,m,g=0,y={},v={},b=[];for(f in e.definitions){var w=e.definitions[f];for(m in w.properties)d=w.properties[m],i.isArray(d.allOf)?this.processAllOf(f,d,b,v,e):this.resolveTo(l,d,b,"/definitions");w.allOf&&this.processAllOf(f,w,b,v,e)}for(f in e.paths){var x,S,A;h=e.paths[f];for(x in h)if("$ref"===x)o="/paths"+f,this.resolveInline(l,e,h,b,v,o);else{S=h[x];var
  C=S.parameters;for(s in C){var E=C[s];o="/paths"+f+"/"+x+"/parameters","body"===E["in"]&&E.schema&&this.resolveTo(l,E.schema,b,o),E.$ref&&this.resolveInline(l,e,E,b,v,E.$ref)}for(A in S.responses){var k=S.responses[A];o="/paths"+f+"/"+x+"/responses/"+A,i.isObject(k)&&(k.$ref&&this.resolveInline(l,e,k,b,v,o),k.schema&&this.resolveTo(l,k.schema,b,o))}}}var O,j=0,T=[],I=b;for(s=0;s<I.length;s++){var _=I[s];if(l===_.root){if("ref"===_.resolveAs){var D,L=((_.root||"")+"/"+_.key).split("/"),P=[],N="";if(_.key.indexOf("../")>=0){for(var $=0;$<L.length;$++)".."===L[$]?P=P.slice(0,P.length-1):P.push(L[$]);for(D=0;D<P.length;D++)D>0&&(N+="/"),N+=P[D];_.root=N,T.push(_)}else if(O=_.key.split("#"),2===O.length){(0===O[0].indexOf("http://")||0===O[0].indexOf("https://"))&&(_.root=O[0]),o=O[1].split("/");var M,R=e;for(D=0;D<o.length;D++){var F=o[D];if(""!==F){if(R=R[F],"undefined"==typeof R){M=null;break}M=R}}null===M&&T.push(_)}}else if("inline"===_.resolveAs){if(_.key&&-1===_.key.indexOf("#")&
 &"/"!==_.key.charAt(0)){for(O=_.root.split("/"),o="",s=0;s<O.length-1;s++)o+=O[s]+"/";o+=_.key,_.root=o,_.location=""}T.push(_)}}else T.push(_)}j=T.length;for(var U=0;U<T.length;U++)!function(t,n){if(null===t.root||t.root===l)n.resolveItem(e,p,b,y,v,t),g+=1,g===j&&n.finish(e,l,b,y,v,u);else{var i={useJQuery:!1,url:t.root,method:"get",headers:{accept:n.scope.swaggerRequestHeaders||"application/json"},on:{error:function(){g+=1,v[t.key]={root:t.root,location:t.location},g===j&&n.finish(e,p,b,y,v,u)},response:function(r){var i=r.obj;n.resolveItem(i,t.root,b,y,v,t),g+=1,g===j&&n.finish(e,p,b,y,v,u)}}};c&&c.clientAuthorizations&&c.clientAuthorizations.apply(i),(new r).execute(i)}}(T[U],this);0===Object.keys(T).length&&this.finish(e,p,b,y,v,u)},a.prototype.resolveItem=function(e,t,n,r,i,a){var o=a.location,s=e,l=o.split("/");if(""!==o)for(var u=0;u<l.length;u++){var c=l[u];if(-1!==c.indexOf("~1")&&(c=l[u].replace(/~0/g,"~").replace(/~1/g,"/"),"/"!==c.charAt(0)&&(c="/"+c)),"undefined"==type
 of s||null===s)break;if(""===c&&u===l.length-1&&l.length>1){s=null;break}c.length>0&&(s=s[c])}var p=a.key;l=a.key.split("/");var f=l[l.length-1];f.indexOf("#")>=0&&(f=f.split("#")[1]),null!==s&&"undefined"!=typeof s?r[p]={name:f,obj:s,key:a.key,root:a.root}:i[p]={root:a.root,location:a.location}},a.prototype.finish=function(e,t,n,r,i,a){var o;for(o in n){var s=n[o],l=s.key,u=r[l];if(u)if(e.definitions=e.definitions||{},"ref"===s.resolveAs){for(l in u.obj)var c=this.retainRoot(u.obj[l],s.root);e.definitions[u.name]=u.obj,s.obj.$ref="#/definitions/"+u.name}else if("inline"===s.resolveAs){var p=s.obj;p["x-resolved-from"]=[s.key],delete p.$ref;for(l in u.obj){var c=this.retainRoot(u.obj[l],s.root);p[l]=c}}}var f=this.countUnresolvedRefs(e);0===f.length||this.iteration>5?(this.resolveAllOf(e.definitions),a.call(this.scope,e,i)):(this.iteration+=1,this.resolve(e,t,a,this.scope))},a.prototype.countUnresolvedRefs=function(e){var t,n=this.getRefs(e),r=[],i=[];for(t in n)0===t.indexOf("#")?r.
 push(t.substring(1)):i.push(t);for(t=0;t<r.length;t++)for(var a=r[t],o=a.split("/"),s=e,l=0;l<o.length;l++){var u=o[l];if(""!==u&&(s=s[u],"undefined"==typeof s)){i.push(a);break}}return i.length},a.prototype.getRefs=function(e,t){t=t||e;var n={};for(var r in t)if(t.hasOwnProperty(r)){var a=t[r];if("$ref"===r&&"string"==typeof a)n[a]=null;else if(i.isObject(a)){var o=this.getRefs(a);for(var s in o)n[s]=null}}return n},a.prototype.retainRoot=function(e,t){for(var n in e){var r=e[n];"$ref"===n&&"string"==typeof r?0!==r.indexOf("http://")&&0!==r.indexOf("https://")&&(0!==r.indexOf("#")&&(r="#"+r),r=(t||"")+r,e[n]=r):i.isObject(r)&&this.retainRoot(r,t)}return e},a.prototype.resolveInline=function(e,t,n,r,i,a){var o,s,l,u,c=n.$ref,p=n.$ref,f=!1;if(p){if(0===p.indexOf("../")){for(s=p.split("../"),l=e.split("/"),p="",o=0;o<s.length;o++)""===s[o]?l=l.slice(0,l.length-1):p+=s[o];for(e="",o=0;o<l.length-1;o++)o>0&&(e+="/"),e+=l[o];f=!0}if(p.indexOf("#")>=0)if(0===p.indexOf("/"))u=p.split("#"),
 s=e.split("//"),l=s[1].split("/"),e=s[0]+"//"+l[0]+u[0],a=u[1];else{if(u=p.split("#"),""!==u[0]){if(l=e.split("/"),l=l.slice(0,l.length-1),!f){e="";for(var h=0;h<l.length;h++)h>0&&(e+="/"),e+=l[h]}e+="/"+p.split("#")[0]}a=u[1]}0===p.indexOf("http")?(p.indexOf("#")>=0?(e=p.split("#")[0],a=p.split("#")[1]):(e=p,a=""),r.push({obj:n,resolveAs:"inline",root:e,key:c,location:a})):0===p.indexOf("#")?(a=p.split("#")[1],r.push({obj:n,resolveAs:"inline",root:e,key:c,location:a})):r.push({obj:n,resolveAs:"inline",root:e,key:c,location:a})}else"array"===n.type&&this.resolveTo(e,n.items,r,a)},a.prototype.resolveTo=function(e,t,n,r){var i,a,o=t.$ref,s=e;if("undefined"!=typeof o){if(o.indexOf("#")>=0){var l=o.split("#");if(l[0]&&0===o.indexOf("/"));else if(l[0]&&0===l[0].indexOf("http"))s=l[0],o=l[1];else if(l[0]&&l[0].length>0){for(i=e.split("/"),s="",a=0;a<i.length-1;a++)s+=i[a]+"/";s+=l[0]}r=l[1]}else if(0===o.indexOf("http://")||0===o.indexOf("https://"))s=o,r="";else{for(i=e.split("/"),s="",a
 =0;a<i.length-1;a++)s+=i[a]+"/";s+=o,r=""}n.push({obj:t,resolveAs:"ref",root:s,key:o,location:r})}else if("array"===t.type){var u=t.items;this.resolveTo(e,u,n,r)}},a.prototype.resolveAllOf=function(e,t,n){n=n||0,t=t||e;var r;for(var a in t)if(t.hasOwnProperty(a)){var o=t[a];if(null===o)throw new TypeError("Swagger 2.0 does not support null types ("+t+").  See https://github.com/swagger-api/swagger-spec/issues/229.");if("object"==typeof o&&this.resolveAllOf(e,o,n+1),o&&"undefined"!=typeof o.allOf){var s=o.allOf;if(i.isArray(s)){var l={};l["x-composed"]=!0,"undefined"!=typeof o["x-resolved-from"]&&(l["x-resolved-from"]=o["x-resolved-from"]),l.properties={},o.example&&(l.example=o.example);for(var u=0;u<s.length;u++){var c=s[u],p="self";"undefined"!=typeof c["x-resolved-from"]&&(p=c["x-resolved-from"][0]);for(var f in c)if(l.hasOwnProperty(f))if("properties"===f){var h=c[f];for(r in h){l.properties[r]=JSON.parse(JSON.stringify(h[r]));var d=h[r]["x-resolved-from"];("undefined"==typeof d
 ||"self"===d)&&(d=p),l.properties[r]["x-resolved-from"]=d}}else if("required"===f){for(var m=l.required.concat(c[f]),g=0;g<m.length;++g)for(var y=g+1;y<m.length;++y)m[g]===m[y]&&m.splice(y--,1);l.required=m}else"x-resolved-from"===f&&l["x-resolved-from"].push(p);else if(l[f]=JSON.parse(JSON.stringify(c[f])),"properties"===f)for(r in l[f])l[f][r]["x-resolved-from"]=p}t[a]=l}}i.isObject(o)&&this.resolveAllOf(e,o,n+1)}}},{"./http":5,"lodash-compat/lang/isArray":143,"lodash-compat/lang/isObject":147}],7:[function(e,t,n){"use strict";function r(e,t){return'<tr><td class="optionName">'+e+":</td><td>"+t+"</td></tr>"}function i(e,t){var n;return"integer"===e&&"int32"===t?n="integer":"integer"===e&&"int64"===t?n="long":"integer"===e&&"undefined"==typeof t?n="long":"string"===e&&"date-time"===t?n="date-time":"string"===e&&"date"===t?n="date":"number"===e&&"float"===t?n="float":"number"===e&&"double"===t?n="double":"number"===e&&"undefined"==typeof t?n="double":"boolean"===e?n="boolean":"strin
 g"===e&&(n="string"),n}function a(e,t){var n="";return"undefined"!=typeof e.$ref?n+=l.simpleRef(e.$ref):"undefined"==typeof e.type?n+="object":"array"===e.type?t?n+=a(e.items||e.$ref||{}):(n+="Array[",
-n+=a(e.items||e.$ref||{}),n+="]"):n+="integer"===e.type&&"int32"===e.format?"integer":"integer"===e.type&&"int64"===e.format?"long":"integer"===e.type&&"undefined"==typeof e.format?"long":"string"===e.type&&"date-time"===e.format?"date-time":"string"===e.type&&"date"===e.format?"date":"string"===e.type&&"undefined"==typeof e.format?"string":"number"===e.type&&"float"===e.format?"float":"number"===e.type&&"double"===e.format?"double":"number"===e.type&&"undefined"==typeof e.format?"double":"boolean"===e.type?"boolean":e.$ref?l.simpleRef(e.$ref):e.type,n}function o(e,t,n,r){e=l.resolveSchema(e),"function"!=typeof r&&(r=function(e){return(e||{})["default"]}),n=n||{};var i,a,s=e.type||"object",c=e.format;return u.isUndefined(e.example)?u.isUndefined(e.items)&&u.isArray(e["enum"])&&(a=e["enum"][0]):a=e.example,u.isUndefined(a)&&(e.$ref?(i=t[l.simpleRef(e.$ref)],u.isUndefined(i)||(u.isUndefined(n[i.name])?(n[i.name]=i,a=o(i.definition,t,n,r),delete n[i.name]):a="array"===i.type?[]:{})):u.
 isUndefined(e["default"])?"string"===s?a="date-time"===c?(new Date).toISOString():"date"===c?(new Date).toISOString().split("T")[0]:"string":"integer"===s?a=0:"number"===s?a=0:"boolean"===s?a=!0:"object"===s?(a={},u.forEach(e.properties,function(e,i){var s=u.cloneDeep(e);s["default"]=r(e),a[i]=o(s,t,n,r)})):"array"===s&&(a=[],u.isArray(e.items)?u.forEach(e.items,function(e){a.push(o(e,t,n,r))}):u.isPlainObject(e.items)?a.push(o(e.items,t,n,r)):u.isUndefined(e.items)?a.push({}):l.log("Array type's 'items' property is not an array or an object, cannot process")):a=e["default"]),a}function s(e,t,n,i){function a(e,t,r){var i,a=t;return e.$ref?(a=e.title||l.simpleRef(e.$ref),i=n[a]):u.isUndefined(t)&&(a=e.title||"Inline Model "+ ++m,i={definition:e}),r!==!0&&(h[a]=u.isUndefined(i)?{}:i.definition),a}function o(e){var t='<span class="propType">',n=e.type||"object";return e.$ref?t+=a(e,l.simpleRef(e.$ref)):"object"===n?t+=u.isUndefined(e.properties)?"object":a(e):"array"===n?(t+="Array[",u
 .isArray(e.items)?t+=u.map(e.items,a).join(","):u.isPlainObject(e.items)?t+=u.isUndefined(e.items.$ref)?u.isUndefined(e.items.type)||-1!==u.indexOf(["array","object"],e.items.type)?a(e.items):e.items.type:a(e.items,l.simpleRef(e.items.$ref)):(l.log("Array type's 'items' schema is not an array or an object, cannot process"),t+="object"),t+="]"):t+=e.type,t+="</span>"}function s(e,t){var n="",i=e.type||"object",a="array"===i;switch(a&&(i=u.isPlainObject(e.items)&&!u.isUndefined(e.items.type)?e.items.type:"object"),u.isUndefined(e["default"])||(n+=r("Default",e["default"])),i){case"string":e.minLength&&(n+=r("Min. Length",e.minLength)),e.maxLength&&(n+=r("Max. Length",e.maxLength)),e.pattern&&(n+=r("Reg. Exp.",e.pattern));break;case"integer":case"number":e.minimum&&(n+=r("Min. Value",e.minimum)),e.exclusiveMinimum&&(n+=r("Exclusive Min.","true")),e.maximum&&(n+=r("Max. Value",e.maximum)),e.exclusiveMaximum&&(n+=r("Exclusive Max.","true")),e.multipleOf&&(n+=r("Multiple Of",e.multipleOf)
 )}if(a&&(e.minItems&&(n+=r("Min. Items",e.minItems)),e.maxItems&&(n+=r("Max. Items",e.maxItems)),e.uniqueItems&&(n+=r("Unique Items","true")),e.collectionFormat&&(n+=r("Coll. Format",e.collectionFormat))),u.isUndefined(e.items)&&u.isArray(e["enum"])){var o;o="number"===i||"integer"===i?e["enum"].join(", "):'"'+e["enum"].join('", "')+'"',n+=r("Enum",o)}return n.length>0&&(t='<span class="propWrap">'+t+'<table class="optionsWrapper"><tr><th colspan="2">'+i+"</th></tr>"+n+"</table></span>"),t}function c(e,t){var r=e.type||"object",c="array"===e.type,h=p+t+" "+(c?"[":"{")+f;return t&&d.push(t),c?u.isArray(e.items)?h+="<div>"+u.map(e.items,function(e){var t=e.type||"object";return u.isUndefined(e.$ref)?u.indexOf(["array","object"],t)>-1?"object"===t&&u.isUndefined(e.properties)?"object":a(e):s(e,t):a(e,l.simpleRef(e.$ref))}).join(",</div><div>"):u.isPlainObject(e.items)?h+=u.isUndefined(e.items.$ref)?u.indexOf(["array","object"],e.items.type||"object")>-1?(u.isUndefined(e.items.type)||"o
 bject"===e.items.type)&&u.isUndefined(e.items.properties)?"<div>object</div>":"<div>"+a(e.items)+"</div>":"<div>"+s(e.items,e.items.type)+"</div>":"<div>"+a(e.items,l.simpleRef(e.items.$ref))+"</div>":(l.log("Array type's 'items' property is not an array or an object, cannot process"),h+="<div>object</div>"):e.$ref?h+="<div>"+a(e,t)+"</div>":"object"===r?(h+="<div>",u.isPlainObject(e.properties)&&(h+=u.map(e.properties,function(t,r){var a,c=u.indexOf(e.required,r)>=0,p=u.cloneDeep(t),f=c?"required":"",h='<span class="propName '+f+'">'+r+"</span> (";return p["default"]=i(p),p=l.resolveSchema(p),u.isUndefined(p.$ref)||(a=n[l.simpleRef(p.$ref)],u.isUndefined(a)||-1!==u.indexOf([void 0,"array","object"],a.definition.type)||(p=l.resolveSchema(a.definition))),h+=o(p),c||(h+=', <span class="propOptKey">optional</span>'),h+=")",u.isUndefined(p.description)||(h+=': <span class="propDesc">'+p.description+"</span>"),p["enum"]&&(h+=' = <span class="propVals">[\''+p["enum"].join("', '")+"']</spa
 n>"),s(p,h)}).join(",</div><div>")),h+="</div>"):h+="<div>"+s(e,r)+"</div>",h+p+(c?"]":"}")+f}var p='<span class="strong">',f="</span>";if(u.isObject(arguments[0])&&(e=void 0,t=arguments[0],n=arguments[1],i=arguments[2]),n=n||{},t=l.resolveSchema(t),u.isEmpty(t))return p+"Empty"+f;if("string"==typeof t.$ref&&(e=l.simpleRef(t.$ref),t=n[e],"undefined"==typeof t))return p+e+" is not defined!"+f;"string"!=typeof e&&(e=t.title||"Inline Model"),t.definition&&(t=t.definition),"function"!=typeof i&&(i=function(e){return(e||{})["default"]});for(var h={},d=[],m=0,g=c(t,e);u.keys(h).length>0;)u.forEach(h,function(e,t){var n=u.indexOf(d,t)>-1;delete h[t],n||(d.push(t),g+="<br />"+c(e,t))});return g}var l=e("./helpers"),u={isPlainObject:e("lodash-compat/lang/isPlainObject"),isUndefined:e("lodash-compat/lang/isUndefined"),isArray:e("lodash-compat/lang/isArray"),isObject:e("lodash-compat/lang/isObject"),isEmpty:e("lodash-compat/lang/isEmpty"),map:e("lodash-compat/collection/map"),indexOf:e("lodash
 -compat/array/indexOf"),cloneDeep:e("lodash-compat/lang/cloneDeep"),keys:e("lodash-compat/object/keys"),forEach:e("lodash-compat/collection/forEach")};t.exports.optionHtml=r,t.exports.typeFromJsonSchema=i,t.exports.getStringSignature=a,t.exports.schemaToHTML=s,t.exports.schemaToJSON=o},{"./helpers":4,"lodash-compat/array/indexOf":52,"lodash-compat/collection/forEach":57,"lodash-compat/collection/map":59,"lodash-compat/lang/cloneDeep":141,"lodash-compat/lang/isArray":143,"lodash-compat/lang/isEmpty":144,"lodash-compat/lang/isObject":147,"lodash-compat/lang/isPlainObject":148,"lodash-compat/lang/isUndefined":151,"lodash-compat/object/keys":152}],8:[function(e,t,n){"use strict";var r=e("./http"),i={isObject:e("lodash-compat/lang/isObject")},a=t.exports=function(){this.errors=[],this.warnings=[],this.modelMap={}};a.prototype.setDocumentationLocation=function(e){this.docLocation=e},a.prototype.convert=function(e,t,n){if(!e||!Array.isArray(e.apis))return this.finish(n,null);this.clientAut
 horizations=t;var r={swagger:"2.0"};r.originalVersion=e.swaggerVersion,this.apiInfo(e,r),this.securityDefinitions(e,r),e.basePath&&this.setDocumentationLocation(e.basePath);var i,a=!1;for(i=0;i<e.apis.length;i++){var o=e.apis[i];Array.isArray(o.operations)&&(a=!0)}a?(this.declaration(e,r),this.finish(n,r)):this.resourceListing(e,r,n)},a.prototype.declaration=function(e,t){var n,r,a,o;if(e.apis){0===e.basePath.indexOf("http://")?(a=e.basePath.substring("http://".length),o=a.indexOf("/"),o>0?(t.host=a.substring(0,o),t.basePath=a.substring(o)):(t.host=a,t.basePath="/")):0===e.basePath.indexOf("https://")?(a=e.basePath.substring("https://".length),o=a.indexOf("/"),o>0?(t.host=a.substring(0,o),t.basePath=a.substring(o)):(t.host=a,t.basePath="/")):t.basePath=e.basePath;var s;if(e.authorizations&&(s=e.authorizations),e.consumes&&(t.consumes=e.consumes),e.produces&&(t.produces=e.produces),i.isObject(e))for(n in e.models){var l=e.models[n],u=l.id||n;this.modelMap[u]=n}for(r=0;r<e.apis.length
 ;r++){var c=e.apis[r],p=c.path,f=c.operations;this.operations(p,e.resourcePath,f,s,t)}var h=e.models||{};this.models(h,t)}},a.prototype.models=function(e,t){if(i.isObject(e)){var n;t.definitions=t.definitions||{};for(n in e){var r,a=e[n],o=[],s={properties:{}};for(r in a.properties){var l=a.properties[r],u={};this.dataType(l,u),l.description&&(u.description=l.description),l["enum"]&&(u["enum"]=l["enum"]),"boolean"==typeof l.required&&l.required===!0&&o.push(r),"string"==typeof l.required&&"true"===l.required&&o.push(r),s.properties[r]=u}o.length>0&&(s["enum"]=o),s.required=a.required,t.definitions[n]=s}}},a.prototype.extractTag=function(e){var t=e||"default";return(0===t.indexOf("http:")||0===t.indexOf("https:"))&&(t=t.split(["/"]),t=t[t.length-1].substring()),t.endsWith(".json")&&(t=t.substring(0,t.length-".json".length)),t.replace("/","")},a.prototype.operations=function(e,t,n,r,i){if(Array.isArray(n)){var a;i.paths||(i.paths={});var o=i.paths[e]||{},s=this.extractTag(t);i.tags=i.
 tags||[];var l=!1;for(a=0;a<i.tags.length;a++){var u=i.tags[a];u.name===s&&(l=!0)}for(l||i.tags.push({name:s}),a=0;a<n.length;a++){var c=n[a],p=(c.method||c.httpMethod).toLowerCase(),f={tags:[s]},h=c.authorizations;if(h&&0===Object.keys(h).length&&(h=r),"undefined"!=typeof h){var d;for(var m in h){f.security=f.security||[];var g=h[m];if(g){var y=[];for(var v in g)y.push(g[v].scope);d={},d[m]=y,f.security.push(d)}else d={},d[m]=[],f.security.push(d)}}c.consumes?f.consumes=c.consumes:i.consumes&&(f.consumes=i.consumes),c.produces?f.produces=c.produces:i.produces&&(f.produces=i.produces),c.summary&&(f.summary=c.summary),c.notes&&(f.description=c.notes),c.nickname&&(f.operationId=c.nickname),c.deprecated&&(f.deprecated=c.deprecated),this.authorizations(h,i),this.parameters(f,c.parameters,i),this.responseMessages(f,c,i),o[p]=f}i.paths[e]=o}},a.prototype.responseMessages=function(e,t){if(i.isObject(t)){var n={};this.dataType(t,n),!n.schema&&n.type&&(n={schema:n}),e.responses=e.responses||
 {};var r=!1;if(Array.isArray(t.responseMessages)){var a,o=t.responseMessages;for(a=0;a<o.length;a++){var s=o[a],l={description:s.message};200===s.code&&(r=!0),s.responseModel&&(l.schema={$ref:s.responseModel}),e.responses[""+s.code]=l}}r?e.responses["default"]=n:e.responses[200]=n}},a.prototype.authorizations=function(e){!i.isObject(e)},a.prototype.parameters=function(e,t){if(Array.isArray(t)){var n;for(n=0;n<t.length;n++){var r=t[n],i={};if(i.name=r.name,i.description=r.description,i.required=r.required,i["in"]=r.paramType,"body"===i["in"]&&(i.name="body"),"form"===i["in"]&&(i["in"]="formData"),r["enum"]&&(i["enum"]=r["enum"]),r.allowMultiple===!0||"true"===r.allowMultiple){var a={};if(this.dataType(r,a),i.type="array",i.items=a,r.allowableValues){var o=r.allowableValues;"LIST"===o.valueType&&(i["enum"]=o.values)}}else this.dataType(r,i);"undefined"!=typeof r.defaultValue&&(i["default"]=r.defaultValue),e.parameters=e.parameters||[],e.parameters.push(i)}}},a.prototype.dataType=funct
 ion(e,t){if(i.isObject(e)){e.minimum&&(t.minimum=e.minimum),e.maximum&&(t.maximum=e.maximum),e.format&&(t.format=e.format),"undefined"!=typeof e.defaultValue&&(t["default"]=e.defaultValue);var n=this.toJsonSchema(e);n&&(t=t||{},n.type&&(t.type=n.type),n.format&&(t.format=n.format),n.$ref&&(t.schema={$ref:n.$ref}),n.items&&(t.items=n.items))}},a.prototype.toJsonSchema=function(e){if(!e)return"object";var t=e.type||e.dataType||e.responseClass||"",n=t.toLowerCase(),r=(e.format||"").toLowerCase();if(0===n.indexOf("list[")){var i=t.substring(5,t.length-1),a=this.toJsonSchema({type:i});return{type:"array",items:a}}if("int"===n||"integer"===n&&"int32"===r)return{type:"integer",format:"int32"};if("long"===n||"integer"===n&&"int64"===r)return{type:"integer",format:"int64"};if("integer"===n)return{type:"integer",format:"int64"};if("float"===n||"number"===n&&"float"===r)return{type:"number",format:"float"};if("double"===n||"number"===n&&"double"===r)return{type:"number",format:"double"};if("st
 ring"===n&&"date-time"===r||"date"===n)return{type:"string",format:"date-time"};if("string"===n)return{type:"string"};if("file"===n)return{type:"file"};if("boolean"===n)return{type:"boolean"};if("array"===n||"list"===n){if(e.items){var o=this.toJsonSchema(e.items);return{type:"array",items:o}}return{type:"array",items:{type:"object"}}}return e.$ref?{$ref:"#/definitions/"+this.modelMap[e.$ref]||e.$ref}:"void"===n||""===n?{}:{$ref:"#/definitions/"+this.modelMap[e.type]||e.type}},a.prototype.resourceListing=function(e,t,n){var i,a=0,o=this,s=e.apis.length,l=t;for(0===s&&this.finish(n,t),i=0;s>i;i++){var u=e.apis[i],c=u.path,p=this.getAbsolutePath(e.swaggerVersion,this.docLocation,c);u.description&&(t.tags=t.tags||[],t.tags.push({name:this.extractTag(u.path),description:u.description||""}));var f={url:p,headers:{accept:"application/json"},on:{},method:"get"};f.on.response=function(e){a+=1;var t=e.obj;t&&o.declaration(t,l),a===s&&o.finish(n,l)},f.on.error=function(e){console.error(e),a+=
 1,a===s&&o.finish(n,l)},this.clientAuthorizations&&"function"==typeof this.clientAuthorizations.apply&&this.clientAuthorizations.apply(f),(new r).execute(f)}},a.prototype.getAbsolutePath=function(e,t,n){if("1.0"===e&&t.endsWith(".json")){var r=t.lastIndexOf("/");r>0&&(t=t.substring(0,r))}var i=t;return 0===n.indexOf("http://")||0===n.indexOf("https://")?i=n:(t.endsWith("/")&&(i=t.substring(0,t.length-1)),i+=n),i=i.replace("{format}","json")},a.prototype.securityDefinitions=function(e,t){if(e.authorizations){var n;for(n in e.authorizations){var r=!1,i={},a=e.authorizations[n];if("apiKey"===a.type)i.type="apiKey",i["in"]=a.passAs,i.name=a.keyname||n,r=!0;else if("oauth2"===a.type){var o,s=a.scopes||[],l={};for(o in s){var u=s[o];l[u.scope]=u.description}if(i.type="oauth2",o>0&&(i.scopes=l),a.grantTypes){if(a.grantTypes.implicit){var c=a.grantTypes.implicit;i.flow="implicit",i.authorizationUrl=c.loginEndpoint,r=!0}if(a.grantTypes.authorization_code&&!i.flow){var p=a.grantTypes.authoriz
 ation_code;i.flow="accessCode",i.authorizationUrl=p.tokenRequestEndpoint.url,i.tokenUrl=p.tokenEndpoint.url,r=!0}}}r&&(t.securityDefinitions=t.securityDefinitions||{},t.securityDefinitions[n]=i)}}},a.prototype.apiInfo=function(e,t){if(e.info){var n=e.info;t.info={},n.contact&&(t.info.contact={},t.info.contact.email=n.contact),n.description&&(t.info.description=n.description),n.title&&(t.info.title=n.title),n.termsOfServiceUrl&&(t.info.termsOfService=n.termsOfServiceUrl),(n.license||n.licenseUrl)&&(t.license={},n.license&&(t.license.name=n.license),n.licenseUrl&&(t.license.url=n.licenseUrl))}else this.warnings.push("missing info section")},a.prototype.finish=function(e,t){e(t)}},{"./http":5,"lodash-compat/lang/isObject":147}],9:[function(e,t,n){"use strict";var r={isPlainObject:e("lodash-compat/lang/isPlainObject"),isString:e("lodash-compat/lang/isString")},i=e("../schema-markup.js"),a=e("js-yaml"),o=t.exports=function(e,t,n,r){return this.definition=t||{},this.isArray="array"===t.ty
 pe,this.models=n||{},this.name=t.title||e||"Inline Model",this.modelPropertyMacro=r||function(e){return e["default"]},this};o.prototype.createJSONSample=o.prototype.getSampleValue=function(e){return e=e||{},e[this.name]=this,this.examples&&r.isPlainObject(this.examples)&&this.examples["application/json"]?(this.definition.example=this.examples["application/json"],r.isString(this.definition.example)&&(this.definition.example=a.safeLoad(this.definition.example))):this.definition.example||(this.definition.example=this.examples),i.schemaToJSON(this.definition,this.models,e,this.modelPropertyMacro)},o.prototype.getMockSignature=function(){return i.schemaToHTML(this.name,this.definition,this.models,this.modelPropertyMacro)}},{"../schema-markup.js":7,"js-yaml":21,"lodash-compat/lang/isPlainObject":148,"lodash-compat/lang/isString":149}],10:[function(e,t,n){"use strict";function r(e,t){if(i.isEmpty(t))return e[0];for(var n=0,r=t.length;r>n;n++)if(e.indexOf(t[n])>-1)return t[n];return e[0]}va
 r i={cloneDeep:e("lodash-compat/lang/cloneDeep"),isUndefined:e("lodash-compat/lang/isUndefined"),isEmpty:e("lodash-compat/lang/isEmpty"),isObject:e("lodash-compat/lang/isObject")},a=e("../helpers"),o=e("./model"),s=e("../http"),l=t.exports=function(e,t,n,r,i,a,s,l,u){var c=[];if(e=e||{},a=a||{},e&&e.options&&(this.client=e.options.client||null,this.responseInterceptor=e.options.responseInterceptor||null),this.authorizations=a.security,this.basePath=e.basePath||"/",this.clientAuthorizations=u,this.consumes=a.consumes||e.consumes||["application/json"],this.produces=a.produces||e.produces||["application/json"],this.deprecated=a.deprecated,this.description=a.description,this.host=e.host||"localhost",this.method=r||c.push("Operation "+n+" is missing method."),this.models=l||{},this.nickname=n||c.push("Operations must have a nickname."),this.operation=a,this.operations={},this.parameters=null!==a?a.parameters||[]:{},this.parent=e,this.path=i||c.push("Operation "+this.nickname+" is missing
  path."),this.responses=a.responses||{},this.scheme=t||e.scheme||"http",this.schemes=a.schemes||e.schemes,this.security=a.security,this.summary=a.summary||"",this.type=null,this.useJQuery=e.useJQuery,this.parameterMacro=e.parameterMacro||function(e,t){return t["default"]},this.inlineModels=[],"string"==typeof this.deprecated)switch(this.deprecated.toLowerCase()){case"true":case"yes":case"1":this.deprecated=!0;break;case"false":case"no":case"0":case null:this.deprecated=!1;break;default:this.deprecated=Boolean(this.deprecated)}var p,f;if(s){var h;for(h in s)f=new o(h,s[h],this.models,e.modelPropertyMacro),f&&(this.models[h]=f)}else s={};for(p=0;p<this.parameters.length;p++){var d=this.parameters[p];d["default"]=this.parameterMacro(this,d),"array"===d.type&&(d.isList=!0,d.allowMultiple=!0,d.items&&d.items["enum"]&&(d["enum"]=d.items["enum"]));var m=this.getType(d);if(m&&"boolean"===m.toString().toLowerCase()&&(d.allowableValues={},d.isList=!0,d["enum"]=[!0,!1]),d["x-examples"]){var g=
 d["x-examples"]["default"];"undefined"!=typeof g&&(d["default"]=g)}if("undefined"!=typeof d["enum"]){var y;for(d.allowableValues={},d.allowableValues.values=[],d.allowableValues.descriptiveValues=[],y=0;y<d["enum"].length;y++){var v=d["enum"][y],b=v===d["default"]||v+""===d["default"];d.allowableValues.values.push(v),d.allowableValues.descriptiveValues.push({value:v+"",isDefault:b})}}"array"===d.type&&(m=[m],"undefined"==typeof d.allowableValues&&(delete d.isList,delete d.allowMultiple)),d.signature=this.getModelSignature(m,this.models).toString(),d.sampleJSON=this.getModelSampleJSON(m,this.models),d.responseClassSignature=d.signature}var w,x,S=this.responses;if(S[200]?(x=S[200],w="200"):S[201]?(x=S[201],w="201"):S[202]?(x=S[202],w="202"):S[203]?(x=S[203],w="203"):S[204]?(x=S[204],w="204"):S[205]?(x=S[205],w="205"):S[206]?(x=S[206],w="206"):S["default"]&&(x=S["default"],w="default"),x&&x.schema){var A,C=this.resolveModel(x.schema,s);delete S[w],C?(this.successResponse={},A=this.succ
 essResponse[w]=C):x.schema.type&&"object"!==x.schema.type&&"array"!==x.schema.type?(this.successResponse={},A=this.successResponse[w]=x.schema):(this.successResponse={},A=this.successResponse[w]=new o(void 0,x.schema||{},this.models,e.modelPropertyMacro)),A&&(x.description&&(A.description=x.description),x.examples&&(A.examples=x.examples),x.headers&&(A.headers=x.headers)),this.type=x}return c.length>0&&this.resource&&this.resource.api&&this.resource.api.fail&&this.resource.api.fail(c),this};l.prototype.isDefaultArrayItemValue=function(e,t){return t["default"]&&Array.isArray(t["default"])?-1!==t["default"].indexOf(e):e===t["default"]},l.prototype.getType=function(e){var t,n=e.type,r=e.format,i=!1;"integer"===n&&"int32"===r?t="integer":"integer"===n&&"int64"===r?t="long":"integer"===n?t="integer":"string"===n?t="date-time"===r?"date-time":"date"===r?"date":"string":"number"===n&&"float"===r?t="float":"number"===n&&"double"===r?t="double":"number"===n?t="double":"boolean"===n?t="boolea
 n":"array"===n&&(i=!0,e.items&&(t=this.getType(e.items))),e.$ref&&(t=a.simpleRef(e.$ref));var o=e.schema;if(o){var s=o.$ref;return s?(s=a.simpleRef(s),i?[s]:s):"object"===o.type?this.addInlineModel(o):this.getType(o)}return i?[t]:t},l.prototype.addInlineModel=function(e){var t=this.inlineModels.length,n=this.resolveModel(e,{});return n?(this.inlineModels.push(n),"Inline Model "+t):null},l.prototype.getInlineModel=function(e){if(/^Inline Model \d+$/.test(e)){var t=parseInt(e.substr("Inline Model".length).trim(),10),n=this.inlineModels[t];return n}return null},l.prototype.resolveModel=function(e,t){if("undefined"!=typeof e.$ref){var n=e.$ref;if(0===n.indexOf("#/definitions/")&&(n=n.substring("#/definitions/".length)),t[n])return new o(n,t[n],this.models,this.parent.modelPropertyMacro)}else if(e&&"object"==typeof e&&("object"===e.type||i.isUndefined(e.type)))return new o(void 0,e,this.models,this.parent.modelPropertyMacro);return null},l.prototype.help=function(e){for(var t=this.nickna
 me+": "+this.summary+"\n",n=0;n<this.parameters.length;n++){var r=this.parameters[n],i=r.signature;t+="\n  * "+r.name+" ("+i+"): "+r.description}return"undefined"==typeof e&&a.log(t),t},l.prototype.getModelSignature=function(e,t){var n,r;return e instanceof Array&&(r=!0,e=e[0]),"undefined"==typeof e?(e="undefined",n=!0):t[e]?(e=t[e],n=!1):this.getInlineModel(e)?(e=this.getInlineModel(e),n=!1):n=!0,n?r?"Array["+e+"]":e.toString():r?"Array["+e.getMockSignature()+"]":e.getMockSignature()},l.prototype.supportHeaderParams=function(){return!0},l.prototype.supportedSubmitMethods=function(){return this.parent.supportedSubmitMethods},l.prototype.getHeaderParams=function(e){for(var t=this.setContentTypes(e,{}),n=0;n<this.parameters.length;n++){var r=this.parameters[n];if("undefined"!=typeof e[r.name]&&"header"===r["in"]){var i=e[r.name];Array.isArray(i)&&(i=i.toString()),t[r.name]=i}}return t},l.prototype.urlify=function(e){for(var t={},n=this.path,r="",i=0;i<this.parameters.length;i++){var a
 =this.parameters[i];if("undefined"!=typeof e[a.name])if("path"===a["in"]){var o=new RegExp("{"+a.name+"}","gi"),s=e[a.name];s=Array.isArray(s)?this.encodePathCollection(a.collectionFormat,a.name,s):this.encodePathParam(s),n=n.replace(o,s)}else if("query"===a["in"]&&"undefined"!=typeof e[a.name])if(r+=""===r?"?":"&","undefined"!=typeof a.collectionFormat){var l=e[a.name];r+=Array.isArray(l)?this.encodeQueryCollection(a.collectionFormat,a.name,l):this.encodeQueryParam(a.name)+"="+this.encodeQueryParam(e[a.name])}else r+=this.encodeQueryParam(a.name)+"="+this.encodeQueryParam(e[a.name]);else"formData"===a["in"]&&(t[a.name]=e[a.name])}var u=this.scheme+"://"+this.host;return"/"!==this.basePath&&(u+=this.basePath),u+n+r},l.prototype.getMissingParams=function(e){var t,n=[];for(t=0;t<this.parameters.length;t++){var r=this.parameters[t];r.required===!0&&"undefined"==typeof e[r.name]&&(n=r.name)}return n},l.prototype.getBody=function(e,t,n){for(var r,i,a,o={},s=!1,l=0;l<this.parameters.lengt
 h;l++){var u=this.parameters[l];"undefined"!=typeof t[u.name]?"body"===u["in"]?r=t[u.name]:"formData"===u["in"]&&(o[u.name]=t[u.name]):"body"===u["in"]&&(s=!0)}if(s&&"undefined"==typeof r){var c=e["Content-Type"];c&&0===c.indexOf("application/json")&&(r="{}")}if("application/x-www-form-urlencoded"===e["Content-Type"]&&"formData"===u["in"]){var p="";for(i in o)a=o[i],"undefined"!=typeof a&&(""!==p&&(p+="&"),p+=encodeURIComponent(i)+"="+encodeURIComponent(a));r=p}else if(e["Content-Type"]&&e["Content-Type"].indexOf("multipart/form-data")>=0&&n.useJQuery){var f=new FormData;f.type="formData";for(i in o)a=t[i],"undefined"!=typeof a&&("file"===a.type&&a.value?(delete e["Content-Type"],f.append(i,a.value)):f.append(i,a));r=f}return r},l.prototype.getModelSampleJSON=function(e,t){var n,r,a;if(t=t||{},n=e instanceof Array,a=n?e[0]:e,t[a]?r=t[a].c

<TRUNCATED>

[08/51] [abbrv] [partial] brooklyn-ui git commit: move subdir from incubator up a level as it is promoted to its own repo (first non-incubator commit!)

Posted by he...@apache.org.
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/js/libs/jquery.wiggle.min.js
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/js/libs/jquery.wiggle.min.js b/src/main/webapp/assets/js/libs/jquery.wiggle.min.js
new file mode 100644
index 0000000..2adb0d6
--- /dev/null
+++ b/src/main/webapp/assets/js/libs/jquery.wiggle.min.js
@@ -0,0 +1,8 @@
+/*
+jQuery Wiggle
+Author: WonderGroup, Jordan Thomas
+URL: http://labs.wondergroup.com/demos/mini-ui/index.html
+License: MIT (http://en.wikipedia.org/wiki/MIT_License)
+*/
+jQuery.fn.wiggle=function(o){var d={speed:50,wiggles:3,travel:5,callback:null};var o=jQuery.extend(d,o);return this.each(function(){var cache=this;var wrap=jQuery(this).wrap('<div class="wiggle-wrap"></div>').css("position","relative");var calls=0;for(i=1;i<=o.wiggles;i++){jQuery(this).animate({left:"-="+o.travel},o.speed).animate({left:"+="+o.travel*2},o.speed*2).animate({left:"-="+o.travel},o.speed,function(){calls++;if(jQuery(cache).parent().hasClass('wiggle-wrap')){jQuery(cache).parent().replaceWith(cache);}
+if(calls==o.wiggles&&jQuery.isFunction(o.callback)){o.callback();}});}});};
\ No newline at end of file


[44/51] [abbrv] [partial] brooklyn-ui git commit: move subdir from incubator up a level as it is promoted to its own repo (first non-incubator commit!)

Posted by he...@apache.org.
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/js/libs/bootstrap.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/js/libs/bootstrap.js b/brooklyn-ui/src/main/webapp/assets/js/libs/bootstrap.js
deleted file mode 100644
index 6bb52bc..0000000
--- a/brooklyn-ui/src/main/webapp/assets/js/libs/bootstrap.js
+++ /dev/null
@@ -1,1821 +0,0 @@
-/* ===================================================
- * bootstrap-transition.js v2.0.4
- * http://twitter.github.com/bootstrap/javascript.html#transitions
- * ===================================================
- * Copyright 2012 Twitter, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================================================== */
-
-
-!function ($) {
-
-  $(function () {
-
-    "use strict"; // jshint ;_;
-
-
-    /* CSS TRANSITION SUPPORT (http://www.modernizr.com/)
-     * ======================================================= */
-
-    $.support.transition = (function () {
-
-        // copied from bootstrap 2.1.1 - adds support for IE10+
-        function transitionEnd() {
-            var el = document.createElement('bootstrap')
-
-            var transEndEventNames = {
-              WebkitTransition : 'webkitTransitionEnd',
-              MozTransition    : 'transitionend',
-              OTransition      : 'oTransitionEnd otransitionend',
-              transition       : 'transitionend'
-            }
-
-            for (var name in transEndEventNames) {
-              if (el.style[name] !== undefined) {
-                return { end: transEndEventNames[name] }
-              }
-            }
-
-            return false // explicit for ie8 (  ._.)
-          }
-
-    })()
-
-  })
-
-}(window.jQuery);/* ==========================================================
- * bootstrap-alert.js v2.0.4
- * http://twitter.github.com/bootstrap/javascript.html#alerts
- * ==========================================================
- * Copyright 2012 Twitter, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================================================== */
-
-
-!function ($) {
-
-  "use strict"; // jshint ;_;
-
-
- /* ALERT CLASS DEFINITION
-  * ====================== */
-
-  var dismiss = '[data-dismiss="alert"]'
-    , Alert = function (el) {
-        $(el).on('click', dismiss, this.close)
-      }
-
-  Alert.prototype.close = function (e) {
-    var $this = $(this)
-      , selector = $this.attr('data-target')
-      , $parent
-
-    if (!selector) {
-      selector = $this.attr('href')
-      selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
-    }
-
-    $parent = $(selector)
-
-    e && e.preventDefault()
-
-    $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
-
-    $parent.trigger(e = $.Event('close'))
-
-    if (e.isDefaultPrevented()) return
-
-    $parent.removeClass('in')
-
-    function removeElement() {
-      $parent
-        .trigger('closed')
-        .remove()
-    }
-
-    $.support.transition && $parent.hasClass('fade') ?
-      $parent.on($.support.transition.end, removeElement) :
-      removeElement()
-  }
-
-
- /* ALERT PLUGIN DEFINITION
-  * ======================= */
-
-  $.fn.alert = function (option) {
-    return this.each(function () {
-      var $this = $(this)
-        , data = $this.data('alert')
-      if (!data) $this.data('alert', (data = new Alert(this)))
-      if (typeof option == 'string') data[option].call($this)
-    })
-  }
-
-  $.fn.alert.Constructor = Alert
-
-
- /* ALERT DATA-API
-  * ============== */
-
-  $(function () {
-    $('body').on('click.alert.data-api', dismiss, Alert.prototype.close)
-  })
-
-}(window.jQuery);/* ============================================================
- * bootstrap-button.js v2.0.4
- * http://twitter.github.com/bootstrap/javascript.html#buttons
- * ============================================================
- * Copyright 2012 Twitter, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============================================================ */
-
-
-!function ($) {
-
-  "use strict"; // jshint ;_;
-
-
- /* BUTTON PUBLIC CLASS DEFINITION
-  * ============================== */
-
-  var Button = function (element, options) {
-    this.$element = $(element)
-    this.options = $.extend({}, $.fn.button.defaults, options)
-  }
-
-  Button.prototype.setState = function (state) {
-    var d = 'disabled'
-      , $el = this.$element
-      , data = $el.data()
-      , val = $el.is('input') ? 'val' : 'html'
-
-    state = state + 'Text'
-    data.resetText || $el.data('resetText', $el[val]())
-
-    $el[val](data[state] || this.options[state])
-
-    // push to event loop to allow forms to submit
-    setTimeout(function () {
-      state == 'loadingText' ?
-        $el.addClass(d).attr(d, d) :
-        $el.removeClass(d).removeAttr(d)
-    }, 0)
-  }
-
-  Button.prototype.toggle = function () {
-    var $parent = this.$element.parent('[data-toggle="buttons-radio"]')
-
-    $parent && $parent
-      .find('.active')
-      .removeClass('active')
-
-    this.$element.toggleClass('active')
-  }
-
-
- /* BUTTON PLUGIN DEFINITION
-  * ======================== */
-
-  $.fn.button = function (option) {
-    return this.each(function () {
-      var $this = $(this)
-        , data = $this.data('button')
-        , options = typeof option == 'object' && option
-      if (!data) $this.data('button', (data = new Button(this, options)))
-      if (option == 'toggle') data.toggle()
-      else if (option) data.setState(option)
-    })
-  }
-
-  $.fn.button.defaults = {
-    loadingText: 'loading...'
-  }
-
-  $.fn.button.Constructor = Button
-
-
- /* BUTTON DATA-API
-  * =============== */
-
-  $(function () {
-    $('body').on('click.button.data-api', '[data-toggle^=button]', function ( e ) {
-      var $btn = $(e.target)
-      if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
-      $btn.button('toggle')
-    })
-  })
-
-}(window.jQuery);/* ==========================================================
- * bootstrap-carousel.js v2.0.4
- * http://twitter.github.com/bootstrap/javascript.html#carousel
- * ==========================================================
- * Copyright 2012 Twitter, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================================================== */
-
-
-!function ($) {
-
-  "use strict"; // jshint ;_;
-
-
- /* CAROUSEL CLASS DEFINITION
-  * ========================= */
-
-  var Carousel = function (element, options) {
-    this.$element = $(element)
-    this.options = options
-    this.options.slide && this.slide(this.options.slide)
-    this.options.pause == 'hover' && this.$element
-      .on('mouseenter', $.proxy(this.pause, this))
-      .on('mouseleave', $.proxy(this.cycle, this))
-  }
-
-  Carousel.prototype = {
-
-    cycle: function (e) {
-      if (!e) this.paused = false
-      this.options.interval
-        && !this.paused
-        && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
-      return this
-    }
-
-  , to: function (pos) {
-      var $active = this.$element.find('.active')
-        , children = $active.parent().children()
-        , activePos = children.index($active)
-        , that = this
-
-      if (pos > (children.length - 1) || pos < 0) return
-
-      if (this.sliding) {
-        return this.$element.one('slid', function () {
-          that.to(pos)
-        })
-      }
-
-      if (activePos == pos) {
-        return this.pause().cycle()
-      }
-
-      return this.slide(pos > activePos ? 'next' : 'prev', $(children[pos]))
-    }
-
-  , pause: function (e) {
-      if (!e) this.paused = true
-      clearInterval(this.interval)
-      this.interval = null
-      return this
-    }
-
-  , next: function () {
-      if (this.sliding) return
-      return this.slide('next')
-    }
-
-  , prev: function () {
-      if (this.sliding) return
-      return this.slide('prev')
-    }
-
-  , slide: function (type, next) {
-      var $active = this.$element.find('.active')
-        , $next = next || $active[type]()
-        , isCycling = this.interval
-        , direction = type == 'next' ? 'left' : 'right'
-        , fallback  = type == 'next' ? 'first' : 'last'
-        , that = this
-        , e = $.Event('slide')
-
-      this.sliding = true
-
-      isCycling && this.pause()
-
-      $next = $next.length ? $next : this.$element.find('.item')[fallback]()
-
-      if ($next.hasClass('active')) return
-
-      if ($.support.transition && this.$element.hasClass('slide')) {
-        this.$element.trigger(e)
-        if (e.isDefaultPrevented()) return
-        $next.addClass(type)
-        $next[0].offsetWidth // force reflow
-        $active.addClass(direction)
-        $next.addClass(direction)
-        this.$element.one($.support.transition.end, function () {
-          $next.removeClass([type, direction].join(' ')).addClass('active')
-          $active.removeClass(['active', direction].join(' '))
-          that.sliding = false
-          setTimeout(function () { that.$element.trigger('slid') }, 0)
-        })
-      } else {
-        this.$element.trigger(e)
-        if (e.isDefaultPrevented()) return
-        $active.removeClass('active')
-        $next.addClass('active')
-        this.sliding = false
-        this.$element.trigger('slid')
-      }
-
-      isCycling && this.cycle()
-
-      return this
-    }
-
-  }
-
-
- /* CAROUSEL PLUGIN DEFINITION
-  * ========================== */
-
-  $.fn.carousel = function (option) {
-    return this.each(function () {
-      var $this = $(this)
-        , data = $this.data('carousel')
-        , options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option)
-      if (!data) $this.data('carousel', (data = new Carousel(this, options)))
-      if (typeof option == 'number') data.to(option)
-      else if (typeof option == 'string' || (option = options.slide)) data[option]()
-      else if (options.interval) data.cycle()
-    })
-  }
-
-  $.fn.carousel.defaults = {
-    interval: 5000
-  , pause: 'hover'
-  }
-
-  $.fn.carousel.Constructor = Carousel
-
-
- /* CAROUSEL DATA-API
-  * ================= */
-
-  $(function () {
-    $('body').on('click.carousel.data-api', '[data-slide]', function ( e ) {
-      var $this = $(this), href
-        , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
-        , options = !$target.data('modal') && $.extend({}, $target.data(), $this.data())
-      $target.carousel(options)
-      e.preventDefault()
-    })
-  })
-
-}(window.jQuery);/* =============================================================
- * bootstrap-collapse.js v2.0.4
- * http://twitter.github.com/bootstrap/javascript.html#collapse
- * =============================================================
- * Copyright 2012 Twitter, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============================================================ */
-
-
-!function ($) {
-
-  "use strict"; // jshint ;_;
-
-
- /* COLLAPSE PUBLIC CLASS DEFINITION
-  * ================================ */
-
-  var Collapse = function (element, options) {
-    this.$element = $(element)
-    this.options = $.extend({}, $.fn.collapse.defaults, options)
-
-    if (this.options.parent) {
-      this.$parent = $(this.options.parent)
-    }
-
-    this.options.toggle && this.toggle()
-  }
-
-  Collapse.prototype = {
-
-    constructor: Collapse
-
-  , dimension: function () {
-      var hasWidth = this.$element.hasClass('width')
-      return hasWidth ? 'width' : 'height'
-    }
-
-  , show: function () {
-      var dimension
-        , scroll
-        , actives
-        , hasData
-
-      if (this.transitioning) return
-
-      dimension = this.dimension()
-      scroll = $.camelCase(['scroll', dimension].join('-'))
-      actives = this.$parent && this.$parent.find('> .accordion-group > .in')
-
-      if (actives && actives.length) {
-        hasData = actives.data('collapse')
-        if (hasData && hasData.transitioning) return
-        actives.collapse('hide')
-        hasData || actives.data('collapse', null)
-      }
-
-      this.$element[dimension](0)
-      this.transition('addClass', $.Event('show'), 'shown')
-      this.$element[dimension](this.$element[0][scroll])
-    }
-
-  , hide: function () {
-      var dimension
-      if (this.transitioning) return
-      dimension = this.dimension()
-      this.reset(this.$element[dimension]())
-      this.transition('removeClass', $.Event('hide'), 'hidden')
-      this.$element[dimension](0)
-    }
-
-  , reset: function (size) {
-      var dimension = this.dimension()
-
-      this.$element
-        .removeClass('collapse')
-        [dimension](size || 'auto')
-        [0].offsetWidth
-
-      this.$element[size !== null ? 'addClass' : 'removeClass']('collapse')
-
-      return this
-    }
-
-  , transition: function (method, startEvent, completeEvent) {
-      var that = this
-        , complete = function () {
-            if (startEvent.type == 'show') that.reset()
-            that.transitioning = 0
-            that.$element.trigger(completeEvent)
-          }
-
-      this.$element.trigger(startEvent)
-
-      if (startEvent.isDefaultPrevented()) return
-
-      this.transitioning = 1
-
-      this.$element[method]('in')
-
-      $.support.transition && this.$element.hasClass('collapse') ?
-        this.$element.one($.support.transition.end, complete) :
-        complete()
-    }
-
-  , toggle: function () {
-      this[this.$element.hasClass('in') ? 'hide' : 'show']()
-    }
-
-  }
-
-
- /* COLLAPSIBLE PLUGIN DEFINITION
-  * ============================== */
-
-  $.fn.collapse = function (option) {
-    return this.each(function () {
-      var $this = $(this)
-        , data = $this.data('collapse')
-        , options = typeof option == 'object' && option
-      if (!data) $this.data('collapse', (data = new Collapse(this, options)))
-      if (typeof option == 'string') data[option]()
-    })
-  }
-
-  $.fn.collapse.defaults = {
-    toggle: true
-  }
-
-  $.fn.collapse.Constructor = Collapse
-
-
- /* COLLAPSIBLE DATA-API
-  * ==================== */
-
-  $(function () {
-    $('body').on('click.collapse.data-api', '[data-toggle=collapse]', function ( e ) {
-      var $this = $(this), href
-        , target = $this.attr('data-target')
-          || e.preventDefault()
-          || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
-        , option = $(target).data('collapse') ? 'toggle' : $this.data()
-      $(target).collapse(option)
-    })
-  })
-
-}(window.jQuery);/* ============================================================
- * bootstrap-dropdown.js v2.0.4
- * http://twitter.github.com/bootstrap/javascript.html#dropdowns
- * ============================================================
- * Copyright 2012 Twitter, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============================================================ */
-
-
-!function ($) {
-
-  "use strict"; // jshint ;_;
-
-
- /* DROPDOWN CLASS DEFINITION
-  * ========================= */
-
-  var toggle = '[data-toggle="dropdown"]'
-    , Dropdown = function (element) {
-        var $el = $(element).on('click.dropdown.data-api', this.toggle)
-        $('html').on('click.dropdown.data-api', function () {
-          $el.parent().removeClass('open')
-        })
-      }
-
-  Dropdown.prototype = {
-
-    constructor: Dropdown
-
-  , toggle: function (e) {
-      var $this = $(this)
-        , $parent
-        , selector
-        , isActive
-
-      if ($this.is('.disabled, :disabled')) return
-
-      selector = $this.attr('data-target')
-
-      if (!selector) {
-        selector = $this.attr('href')
-        selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
-      }
-
-      $parent = $(selector)
-      $parent.length || ($parent = $this.parent())
-
-      isActive = $parent.hasClass('open')
-
-      clearMenus()
-
-      if (!isActive) $parent.toggleClass('open')
-
-      return false
-    }
-
-  }
-
-  function clearMenus() {
-    $(toggle).parent().removeClass('open')
-  }
-
-
-  /* DROPDOWN PLUGIN DEFINITION
-   * ========================== */
-
-  $.fn.dropdown = function (option) {
-    return this.each(function () {
-      var $this = $(this)
-        , data = $this.data('dropdown')
-      if (!data) $this.data('dropdown', (data = new Dropdown(this)))
-      if (typeof option == 'string') data[option].call($this)
-    })
-  }
-
-  $.fn.dropdown.Constructor = Dropdown
-
-
-  /* APPLY TO STANDARD DROPDOWN ELEMENTS
-   * =================================== */
-
-  $(function () {
-    $('html').on('click.dropdown.data-api', clearMenus)
-    $('body')
-      .on('click.dropdown', '.dropdown form', function (e) { e.stopPropagation() })
-      .on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle)
-  })
-
-}(window.jQuery);/* =========================================================
- * bootstrap-modal.js v2.0.4
- * http://twitter.github.com/bootstrap/javascript.html#modals
- * =========================================================
- * Copyright 2012 Twitter, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================================================= */
-
-
-!function ($) {
-
-  "use strict"; // jshint ;_;
-
-
- /* MODAL CLASS DEFINITION
-  * ====================== */
-
-  var Modal = function (content, options) {
-    this.options = options
-    this.$element = $(content)
-      .delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
-  }
-
-  Modal.prototype = {
-
-      constructor: Modal
-
-    , toggle: function () {
-        return this[!this.isShown ? 'show' : 'hide']()
-      }
-
-    , show: function () {
-        var that = this
-          , e = $.Event('show')
-
-        this.$element.trigger(e)
-
-        if (this.isShown || e.isDefaultPrevented()) return
-
-        $('body').addClass('modal-open')
-
-        this.isShown = true
-
-        escape.call(this)
-        backdrop.call(this, function () {
-          var transition = $.support.transition && that.$element.hasClass('fade')
-
-          if (!that.$element.parent().length) {
-            that.$element.appendTo(document.body) //don't move modals dom position
-          }
-
-          that.$element
-            .show()
-
-          if (transition) {
-            that.$element[0].offsetWidth // force reflow
-          }
-
-          that.$element.addClass('in')
-
-          transition ?
-            that.$element.one($.support.transition.end, function () { that.$element.trigger('shown') }) :
-            that.$element.trigger('shown')
-
-        })
-      }
-
-    , hide: function (e) {
-        e && e.preventDefault()
-
-        var that = this
-
-        e = $.Event('hide')
-
-        this.$element.trigger(e)
-
-        if (!this.isShown || e.isDefaultPrevented()) return
-
-        this.isShown = false
-
-        $('body').removeClass('modal-open')
-
-        escape.call(this)
-
-        this.$element.removeClass('in')
-
-        $.support.transition && this.$element.hasClass('fade') ?
-          hideWithTransition.call(this) :
-          hideModal.call(this)
-      }
-
-  }
-
-
- /* MODAL PRIVATE METHODS
-  * ===================== */
-
-  function hideWithTransition() {
-    var that = this
-      , timeout = setTimeout(function () {
-          that.$element.off($.support.transition.end)
-          hideModal.call(that)
-        }, 500)
-
-    this.$element.one($.support.transition.end, function () {
-      clearTimeout(timeout)
-      hideModal.call(that)
-    })
-  }
-
-  function hideModal(that) {
-    this.$element
-      .hide()
-      .trigger('hidden')
-
-    backdrop.call(this)
-  }
-
-  function backdrop(callback) {
-    var that = this
-      , animate = this.$element.hasClass('fade') ? 'fade' : ''
-
-    if (this.isShown && this.options.backdrop) {
-      var doAnimate = $.support.transition && animate
-
-      this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
-        .appendTo(document.body)
-
-      if (this.options.backdrop != 'static') {
-        this.$backdrop.click($.proxy(this.hide, this))
-      }
-
-      if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
-
-      this.$backdrop.addClass('in')
-
-      doAnimate ?
-        this.$backdrop.one($.support.transition.end, callback) :
-        callback()
-
-    } else if (!this.isShown && this.$backdrop) {
-      this.$backdrop.removeClass('in')
-
-      $.support.transition && this.$element.hasClass('fade')?
-        this.$backdrop.one($.support.transition.end, $.proxy(removeBackdrop, this)) :
-        removeBackdrop.call(this)
-
-    } else if (callback) {
-      callback()
-    }
-  }
-
-  function removeBackdrop() {
-    this.$backdrop.remove()
-    this.$backdrop = null
-  }
-
-  function escape() {
-    var that = this
-    if (this.isShown && this.options.keyboard) {
-      $(document).on('keyup.dismiss.modal', function ( e ) {
-        e.which == 27 && that.hide()
-      })
-    } else if (!this.isShown) {
-      $(document).off('keyup.dismiss.modal')
-    }
-  }
-
-
- /* MODAL PLUGIN DEFINITION
-  * ======================= */
-
-  $.fn.modal = function (option) {
-    return this.each(function () {
-      var $this = $(this)
-        , data = $this.data('modal')
-        , options = $.extend({}, $.fn.modal.defaults, $this.data(), typeof option == 'object' && option)
-      if (!data) $this.data('modal', (data = new Modal(this, options)))
-      if (typeof option == 'string') data[option]()
-      else if (options.show) data.show()
-    })
-  }
-
-  $.fn.modal.defaults = {
-      backdrop: true
-    , keyboard: true
-    , show: true
-  }
-
-  $.fn.modal.Constructor = Modal
-
-
- /* MODAL DATA-API
-  * ============== */
-
-  $(function () {
-    $('body').on('click.modal.data-api', '[data-toggle="modal"]', function ( e ) {
-      var $this = $(this), href
-        , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
-        , option = $target.data('modal') ? 'toggle' : $.extend({}, $target.data(), $this.data())
-
-      e.preventDefault()
-      $target.modal(option)
-    })
-  })
-
-}(window.jQuery);/* ===========================================================
- * bootstrap-tooltip.js v2.0.4
- * http://twitter.github.com/bootstrap/javascript.html#tooltips
- * Inspired by the original jQuery.tipsy by Jason Frame
- * ===========================================================
- * Copyright 2012 Twitter, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================================================== */
-
-
-!function ($) {
-
-  "use strict"; // jshint ;_;
-
-
- /* TOOLTIP PUBLIC CLASS DEFINITION
-  * =============================== */
-
-  var Tooltip = function (element, options) {
-    this.init('tooltip', element, options)
-  }
-
-  Tooltip.prototype = {
-
-    constructor: Tooltip
-
-  , init: function (type, element, options) {
-      var eventIn
-        , eventOut
-
-      this.type = type
-      this.$element = $(element)
-      this.options = this.getOptions(options)
-      this.enabled = true
-
-      if (this.options.trigger != 'manual') {
-        eventIn  = this.options.trigger == 'hover' ? 'mouseenter' : 'focus'
-        eventOut = this.options.trigger == 'hover' ? 'mouseleave' : 'blur'
-        this.$element.on(eventIn, this.options.selector, $.proxy(this.enter, this))
-        this.$element.on(eventOut, this.options.selector, $.proxy(this.leave, this))
-      }
-
-      this.options.selector ?
-        (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
-        this.fixTitle()
-    }
-
-  , getOptions: function (options) {
-      options = $.extend({}, $.fn[this.type].defaults, options, this.$element.data())
-
-      if (options.delay && typeof options.delay == 'number') {
-        options.delay = {
-          show: options.delay
-        , hide: options.delay
-        }
-      }
-
-      return options
-    }
-
-  , enter: function (e) {
-      var self = $(e.currentTarget)[this.type](this._options).data(this.type)
-
-      if (!self.options.delay || !self.options.delay.show) return self.show()
-
-      clearTimeout(this.timeout)
-      self.hoverState = 'in'
-      this.timeout = setTimeout(function() {
-        if (self.hoverState == 'in') self.show()
-      }, self.options.delay.show)
-    }
-
-  , leave: function (e) {
-      var self = $(e.currentTarget)[this.type](this._options).data(this.type)
-
-      if (this.timeout) clearTimeout(this.timeout)
-      if (!self.options.delay || !self.options.delay.hide) return self.hide()
-
-      self.hoverState = 'out'
-      this.timeout = setTimeout(function() {
-        if (self.hoverState == 'out') self.hide()
-      }, self.options.delay.hide)
-    }
-
-  , show: function () {
-      var $tip
-        , inside
-        , pos
-        , actualWidth
-        , actualHeight
-        , placement
-        , tp
-
-      if (this.hasContent() && this.enabled) {
-        $tip = this.tip()
-        this.setContent()
-
-        if (this.options.animation) {
-          $tip.addClass('fade')
-        }
-
-        placement = typeof this.options.placement == 'function' ?
-          this.options.placement.call(this, $tip[0], this.$element[0]) :
-          this.options.placement
-
-        inside = /in/.test(placement)
-
-        $tip
-          .remove()
-          .css({ top: 0, left: 0, display: 'block' })
-          .appendTo(inside ? this.$element : document.body)
-
-        pos = this.getPosition(inside)
-
-        actualWidth = $tip[0].offsetWidth
-        actualHeight = $tip[0].offsetHeight
-
-        switch (inside ? placement.split(' ')[1] : placement) {
-          case 'bottom':
-            tp = {top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2}
-            break
-          case 'top':
-            tp = {top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2}
-            break
-          case 'left':
-            tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth}
-            break
-          case 'right':
-            tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width}
-            break
-        }
-
-        $tip
-          .css(tp)
-          .addClass(placement)
-          .addClass('in')
-      }
-    }
-
-  , isHTML: function(text) {
-      // html string detection logic adapted from jQuery
-      return typeof text != 'string'
-        || ( text.charAt(0) === "<"
-          && text.charAt( text.length - 1 ) === ">"
-          && text.length >= 3
-        ) || /^(?:[^<]*<[\w\W]+>[^>]*$)/.exec(text)
-    }
-
-  , setContent: function () {
-      var $tip = this.tip()
-        , title = this.getTitle()
-
-      $tip.find('.tooltip-inner')[this.isHTML(title) ? 'html' : 'text'](title)
-      $tip.removeClass('fade in top bottom left right')
-    }
-
-  , hide: function () {
-      var that = this
-        , $tip = this.tip()
-
-      $tip.removeClass('in')
-
-      function removeWithAnimation() {
-        var timeout = setTimeout(function () {
-          $tip.off($.support.transition.end).remove()
-        }, 500)
-
-        $tip.one($.support.transition.end, function () {
-          clearTimeout(timeout)
-          $tip.remove()
-        })
-      }
-
-      $.support.transition && this.$tip.hasClass('fade') ?
-        removeWithAnimation() :
-        $tip.remove()
-    }
-
-  , fixTitle: function () {
-      var $e = this.$element
-      if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
-        $e.attr('data-original-title', $e.attr('title') || '').removeAttr('title')
-      }
-    }
-
-  , hasContent: function () {
-      return this.getTitle()
-    }
-
-  , getPosition: function (inside) {
-      return $.extend({}, (inside ? {top: 0, left: 0} : this.$element.offset()), {
-        width: this.$element[0].offsetWidth
-      , height: this.$element[0].offsetHeight
-      })
-    }
-
-  , getTitle: function () {
-      var title
-        , $e = this.$element
-        , o = this.options
-
-      title = $e.attr('data-original-title')
-        || (typeof o.title == 'function' ? o.title.call($e[0]) :  o.title)
-
-      return title
-    }
-
-  , tip: function () {
-      return this.$tip = this.$tip || $(this.options.template)
-    }
-
-  , validate: function () {
-      if (!this.$element[0].parentNode) {
-        this.hide()
-        this.$element = null
-        this.options = null
-      }
-    }
-
-  , enable: function () {
-      this.enabled = true
-    }
-
-  , disable: function () {
-      this.enabled = false
-    }
-
-  , toggleEnabled: function () {
-      this.enabled = !this.enabled
-    }
-
-  , toggle: function () {
-      this[this.tip().hasClass('in') ? 'hide' : 'show']()
-    }
-
-  }
-
-
- /* TOOLTIP PLUGIN DEFINITION
-  * ========================= */
-
-  $.fn.tooltip = function ( option ) {
-    return this.each(function () {
-      var $this = $(this)
-        , data = $this.data('tooltip')
-        , options = typeof option == 'object' && option
-      if (!data) $this.data('tooltip', (data = new Tooltip(this, options)))
-      if (typeof option == 'string') data[option]()
-    })
-  }
-
-  $.fn.tooltip.Constructor = Tooltip
-
-  $.fn.tooltip.defaults = {
-    animation: true
-  , placement: 'top'
-  , selector: false
-  , template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
-  , trigger: 'hover'
-  , title: ''
-  , delay: 0
-  }
-
-}(window.jQuery);
-/* ===========================================================
- * bootstrap-popover.js v2.0.4
- * http://twitter.github.com/bootstrap/javascript.html#popovers
- * ===========================================================
- * Copyright 2012 Twitter, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * =========================================================== */
-
-
-!function ($) {
-
-  "use strict"; // jshint ;_;
-
-
- /* POPOVER PUBLIC CLASS DEFINITION
-  * =============================== */
-
-  var Popover = function ( element, options ) {
-    this.init('popover', element, options)
-  }
-
-
-  /* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js
-     ========================================== */
-
-  Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype, {
-
-    constructor: Popover
-
-  , setContent: function () {
-      var $tip = this.tip()
-        , title = this.getTitle()
-        , content = this.getContent()
-
-      $tip.find('.popover-title')[this.isHTML(title) ? 'html' : 'text'](title)
-      $tip.find('.popover-content > *')[this.isHTML(content) ? 'html' : 'text'](content)
-
-      $tip.removeClass('fade top bottom left right in')
-    }
-
-  , hasContent: function () {
-      return this.getTitle() || this.getContent()
-    }
-
-  , getContent: function () {
-      var content
-        , $e = this.$element
-        , o = this.options
-
-      content = $e.attr('data-content')
-        || (typeof o.content == 'function' ? o.content.call($e[0]) :  o.content)
-
-      return content
-    }
-
-  , tip: function () {
-      if (!this.$tip) {
-        this.$tip = $(this.options.template)
-      }
-      return this.$tip
-    }
-
-  })
-
-
- /* POPOVER PLUGIN DEFINITION
-  * ======================= */
-
-  $.fn.popover = function (option) {
-    return this.each(function () {
-      var $this = $(this)
-        , data = $this.data('popover')
-        , options = typeof option == 'object' && option
-      if (!data) $this.data('popover', (data = new Popover(this, options)))
-      if (typeof option == 'string') data[option]()
-    })
-  }
-
-  $.fn.popover.Constructor = Popover
-
-  $.fn.popover.defaults = $.extend({} , $.fn.tooltip.defaults, {
-    placement: 'right'
-  , content: ''
-  , template: '<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"><p></p></div></div></div>'
-  })
-
-}(window.jQuery);/* =============================================================
- * bootstrap-scrollspy.js v2.0.4
- * http://twitter.github.com/bootstrap/javascript.html#scrollspy
- * =============================================================
- * Copyright 2012 Twitter, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============================================================== */
-
-
-!function ($) {
-
-  "use strict"; // jshint ;_;
-
-
-  /* SCROLLSPY CLASS DEFINITION
-   * ========================== */
-
-  function ScrollSpy( element, options) {
-    var process = $.proxy(this.process, this)
-      , $element = $(element).is('body') ? $(window) : $(element)
-      , href
-    this.options = $.extend({}, $.fn.scrollspy.defaults, options)
-    this.$scrollElement = $element.on('scroll.scroll.data-api', process)
-    this.selector = (this.options.target
-      || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
-      || '') + ' .nav li > a'
-    this.$body = $('body')
-    this.refresh()
-    this.process()
-  }
-
-  ScrollSpy.prototype = {
-
-      constructor: ScrollSpy
-
-    , refresh: function () {
-        var self = this
-          , $targets
-
-        this.offsets = $([])
-        this.targets = $([])
-
-        $targets = this.$body
-          .find(this.selector)
-          .map(function () {
-            var $el = $(this)
-              , href = $el.data('target') || $el.attr('href')
-              , $href = /^#\w/.test(href) && $(href)
-            return ( $href
-              && href.length
-              && [[ $href.position().top, href ]] ) || null
-          })
-          .sort(function (a, b) { return a[0] - b[0] })
-          .each(function () {
-            self.offsets.push(this[0])
-            self.targets.push(this[1])
-          })
-      }
-
-    , process: function () {
-        var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
-          , scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight
-          , maxScroll = scrollHeight - this.$scrollElement.height()
-          , offsets = this.offsets
-          , targets = this.targets
-          , activeTarget = this.activeTarget
-          , i
-
-        if (scrollTop >= maxScroll) {
-          return activeTarget != (i = targets.last()[0])
-            && this.activate ( i )
-        }
-
-        for (i = offsets.length; i--;) {
-          activeTarget != targets[i]
-            && scrollTop >= offsets[i]
-            && (!offsets[i + 1] || scrollTop <= offsets[i + 1])
-            && this.activate( targets[i] )
-        }
-      }
-
-    , activate: function (target) {
-        var active
-          , selector
-
-        this.activeTarget = target
-
-        $(this.selector)
-          .parent('.active')
-          .removeClass('active')
-
-        selector = this.selector
-          + '[data-target="' + target + '"],'
-          + this.selector + '[href="' + target + '"]'
-
-        active = $(selector)
-          .parent('li')
-          .addClass('active')
-
-        if (active.parent('.dropdown-menu'))  {
-          active = active.closest('li.dropdown').addClass('active')
-        }
-
-        active.trigger('activate')
-      }
-
-  }
-
-
- /* SCROLLSPY PLUGIN DEFINITION
-  * =========================== */
-
-  $.fn.scrollspy = function ( option ) {
-    return this.each(function () {
-      var $this = $(this)
-        , data = $this.data('scrollspy')
-        , options = typeof option == 'object' && option
-      if (!data) $this.data('scrollspy', (data = new ScrollSpy(this, options)))
-      if (typeof option == 'string') data[option]()
-    })
-  }
-
-  $.fn.scrollspy.Constructor = ScrollSpy
-
-  $.fn.scrollspy.defaults = {
-    offset: 10
-  }
-
-
- /* SCROLLSPY DATA-API
-  * ================== */
-
-  $(function () {
-    $('[data-spy="scroll"]').each(function () {
-      var $spy = $(this)
-      $spy.scrollspy($spy.data())
-    })
-  })
-
-}(window.jQuery);/* ========================================================
- * bootstrap-tab.js v2.0.4
- * http://twitter.github.com/bootstrap/javascript.html#tabs
- * ========================================================
- * Copyright 2012 Twitter, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ======================================================== */
-
-
-!function ($) {
-
-  "use strict"; // jshint ;_;
-
-
- /* TAB CLASS DEFINITION
-  * ==================== */
-
-  var Tab = function ( element ) {
-    this.element = $(element)
-  }
-
-  Tab.prototype = {
-
-    constructor: Tab
-
-  , show: function () {
-      var $this = this.element
-        , $ul = $this.closest('ul:not(.dropdown-menu)')
-        , selector = $this.attr('data-target')
-        , previous
-        , $target
-        , e
-
-      if (!selector) {
-        selector = $this.attr('href')
-        selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
-      }
-
-      if ( $this.parent('li').hasClass('active') ) return
-
-      previous = $ul.find('.active a').last()[0]
-
-      e = $.Event('show', {
-        relatedTarget: previous
-      })
-
-      $this.trigger(e)
-
-      if (e.isDefaultPrevented()) return
-
-      $target = $(selector)
-
-      this.activate($this.parent('li'), $ul)
-      this.activate($target, $target.parent(), function () {
-        $this.trigger({
-          type: 'shown'
-        , relatedTarget: previous
-        })
-      })
-    }
-
-  , activate: function ( element, container, callback) {
-      var $active = container.find('> .active')
-        , transition = callback
-            && $.support.transition
-            && $active.hasClass('fade')
-
-      function next() {
-        $active
-          .removeClass('active')
-          .find('> .dropdown-menu > .active')
-          .removeClass('active')
-
-        element.addClass('active')
-
-        if (transition) {
-          element[0].offsetWidth // reflow for transition
-          element.addClass('in')
-        } else {
-          element.removeClass('fade')
-        }
-
-        if ( element.parent('.dropdown-menu') ) {
-          element.closest('li.dropdown').addClass('active')
-        }
-
-        callback && callback()
-      }
-
-      transition ?
-        $active.one($.support.transition.end, next) :
-        next()
-
-      $active.removeClass('in')
-    }
-  }
-
-
- /* TAB PLUGIN DEFINITION
-  * ===================== */
-
-  $.fn.tab = function ( option ) {
-    return this.each(function () {
-      var $this = $(this)
-        , data = $this.data('tab')
-      if (!data) $this.data('tab', (data = new Tab(this)))
-      if (typeof option == 'string') data[option]()
-    })
-  }
-
-  $.fn.tab.Constructor = Tab
-
-
- /* TAB DATA-API
-  * ============ */
-
-  $(function () {
-    $('body').on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
-      e.preventDefault()
-      $(this).tab('show')
-    })
-  })
-
-}(window.jQuery);/* =============================================================
- * bootstrap-typeahead.js v2.0.4
- * http://twitter.github.com/bootstrap/javascript.html#typeahead
- * =============================================================
- * Copyright 2012 Twitter, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============================================================ */
-
-
-!function($){
-
-  "use strict"; // jshint ;_;
-
-
- /* TYPEAHEAD PUBLIC CLASS DEFINITION
-  * ================================= */
-
-  var Typeahead = function (element, options) {
-    this.$element = $(element)
-    this.options = $.extend({}, $.fn.typeahead.defaults, options)
-    this.matcher = this.options.matcher || this.matcher
-    this.sorter = this.options.sorter || this.sorter
-    this.highlighter = this.options.highlighter || this.highlighter
-    this.updater = this.options.updater || this.updater
-    this.$menu = $(this.options.menu).appendTo('body')
-    this.source = this.options.source
-    this.shown = false
-    this.listen()
-  }
-
-  Typeahead.prototype = {
-
-    constructor: Typeahead
-
-  , select: function () {
-      var val = this.$menu.find('.active').attr('data-value')
-      this.$element
-        .val(this.updater(val))
-        .change()
-      return this.hide()
-    }
-
-  , updater: function (item) {
-      return item
-    }
-
-  , show: function () {
-      var pos = $.extend({}, this.$element.offset(), {
-        height: this.$element[0].offsetHeight
-      })
-
-      this.$menu.css({
-        top: pos.top + pos.height
-      , left: pos.left
-      })
-
-      this.$menu.show()
-      this.shown = true
-      return this
-    }
-
-  , hide: function () {
-      this.$menu.hide()
-      this.shown = false
-      return this
-    }
-
-  , lookup: function (event) {
-      var that = this
-        , items
-        , q
-
-      this.query = this.$element.val()
-
-      if (!this.query) {
-        return this.shown ? this.hide() : this
-      }
-
-      items = $.grep(this.source, function (item) {
-        return that.matcher(item)
-      })
-
-      items = this.sorter(items)
-
-      if (!items.length) {
-        return this.shown ? this.hide() : this
-      }
-
-      return this.render(items.slice(0, this.options.items)).show()
-    }
-
-  , matcher: function (item) {
-      return ~item.toLowerCase().indexOf(this.query.toLowerCase())
-    }
-
-  , sorter: function (items) {
-      var beginswith = []
-        , caseSensitive = []
-        , caseInsensitive = []
-        , item
-
-      while (item = items.shift()) {
-        if (!item.toLowerCase().indexOf(this.query.toLowerCase())) beginswith.push(item)
-        else if (~item.indexOf(this.query)) caseSensitive.push(item)
-        else caseInsensitive.push(item)
-      }
-
-      return beginswith.concat(caseSensitive, caseInsensitive)
-    }
-
-  , highlighter: function (item) {
-      var query = this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&')
-      return item.replace(new RegExp('(' + query + ')', 'ig'), function ($1, match) {
-        return '<strong>' + match + '</strong>'
-      })
-    }
-
-  , render: function (items) {
-      var that = this
-
-      items = $(items).map(function (i, item) {
-        i = $(that.options.item).attr('data-value', item)
-        i.find('a').html(that.highlighter(item))
-        return i[0]
-      })
-
-      items.first().addClass('active')
-      this.$menu.html(items)
-      return this
-    }
-
-  , next: function (event) {
-      var active = this.$menu.find('.active').removeClass('active')
-        , next = active.next()
-
-      if (!next.length) {
-        next = $(this.$menu.find('li')[0])
-      }
-
-      next.addClass('active')
-    }
-
-  , prev: function (event) {
-      var active = this.$menu.find('.active').removeClass('active')
-        , prev = active.prev()
-
-      if (!prev.length) {
-        prev = this.$menu.find('li').last()
-      }
-
-      prev.addClass('active')
-    }
-
-  , listen: function () {
-      this.$element
-        .on('blur',     $.proxy(this.blur, this))
-        .on('keypress', $.proxy(this.keypress, this))
-        .on('keyup',    $.proxy(this.keyup, this))
-
-      if ($.browser.webkit || $.browser.msie) {
-        this.$element.on('keydown', $.proxy(this.keypress, this))
-      }
-
-      this.$menu
-        .on('click', $.proxy(this.click, this))
-        .on('mouseenter', 'li', $.proxy(this.mouseenter, this))
-    }
-
-  , keyup: function (e) {
-      switch(e.keyCode) {
-        case 40: // down arrow
-        case 38: // up arrow
-          break
-
-        case 9: // tab
-        case 13: // enter
-          if (!this.shown) return
-          this.select()
-          break
-
-        case 27: // escape
-          if (!this.shown) return
-          this.hide()
-          break
-
-        default:
-          this.lookup()
-      }
-
-      e.stopPropagation()
-      e.preventDefault()
-  }
-
-  , keypress: function (e) {
-      if (!this.shown) return
-
-      switch(e.keyCode) {
-        case 9: // tab
-        case 13: // enter
-        case 27: // escape
-          e.preventDefault()
-          break
-
-        case 38: // up arrow
-          if (e.type != 'keydown') break
-          e.preventDefault()
-          this.prev()
-          break
-
-        case 40: // down arrow
-          if (e.type != 'keydown') break
-          e.preventDefault()
-          this.next()
-          break
-      }
-
-      e.stopPropagation()
-    }
-
-  , blur: function (e) {
-      var that = this
-      setTimeout(function () { that.hide() }, 150)
-    }
-
-  , click: function (e) {
-      e.stopPropagation()
-      e.preventDefault()
-      this.select()
-    }
-
-  , mouseenter: function (e) {
-      this.$menu.find('.active').removeClass('active')
-      $(e.currentTarget).addClass('active')
-    }
-
-  }
-
-
-  /* TYPEAHEAD PLUGIN DEFINITION
-   * =========================== */
-
-  $.fn.typeahead = function (option) {
-    return this.each(function () {
-      var $this = $(this)
-        , data = $this.data('typeahead')
-        , options = typeof option == 'object' && option
-      if (!data) $this.data('typeahead', (data = new Typeahead(this, options)))
-      if (typeof option == 'string') data[option]()
-    })
-  }
-
-  $.fn.typeahead.defaults = {
-    source: []
-  , items: 8
-  , menu: '<ul class="typeahead dropdown-menu"></ul>'
-  , item: '<li><a href="#"></a></li>'
-  }
-
-  $.fn.typeahead.Constructor = Typeahead
-
-
- /* TYPEAHEAD DATA-API
-  * ================== */
-
-  $(function () {
-    $('body').on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) {
-      var $this = $(this)
-      if ($this.data('typeahead')) return
-      e.preventDefault()
-      $this.typeahead($this.data())
-    })
-  })
-
-}(window.jQuery);
\ No newline at end of file


[42/51] [abbrv] [partial] brooklyn-ui git commit: move subdir from incubator up a level as it is promoted to its own repo (first non-incubator commit!)

Posted by he...@apache.org.
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/js/libs/jquery.dataTables.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/js/libs/jquery.dataTables.js b/brooklyn-ui/src/main/webapp/assets/js/libs/jquery.dataTables.js
deleted file mode 100644
index 6b4d452..0000000
--- a/brooklyn-ui/src/main/webapp/assets/js/libs/jquery.dataTables.js
+++ /dev/null
@@ -1,12098 +0,0 @@
-/**
- * @summary     DataTables
- * @description Paginate, search and sort HTML tables
- * @version     1.9.4
- * @file        jquery.dataTables.js
- * @author      Allan Jardine (www.sprymedia.co.uk)
- * @contact     www.sprymedia.co.uk/contact
- *
- * @copyright Copyright 2008-2012 Allan Jardine, all rights reserved.
- *
- * This source file is free software, under either the GPL v2 license or a
- * BSD style license, available at:
- *   http://datatables.net/license_gpl2
- *   http://datatables.net/license_bsd
- * 
- * This source file is distributed in the hope that it will be useful, but 
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
- * or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.
- * 
- * For details please refer to: http://www.datatables.net
- */
-
-/*jslint evil: true, undef: true, browser: true */
-/*globals $, jQuery,define,_fnExternApiFunc,_fnInitialise,_fnInitComplete,_fnLanguageCompat,_fnAddColumn,_fnColumnOptions,_fnAddData,_fnCreateTr,_fnGatherData,_fnBuildHead,_fnDrawHead,_fnDraw,_fnReDraw,_fnAjaxUpdate,_fnAjaxParameters,_fnAjaxUpdateDraw,_fnServerParams,_fnAddOptionsHtml,_fnFeatureHtmlTable,_fnScrollDraw,_fnAdjustColumnSizing,_fnFeatureHtmlFilter,_fnFilterComplete,_fnFilterCustom,_fnFilterColumn,_fnFilter,_fnBuildSearchArray,_fnBuildSearchRow,_fnFilterCreateSearch,_fnDataToSearch,_fnSort,_fnSortAttachListener,_fnSortingClasses,_fnFeatureHtmlPaginate,_fnPageChange,_fnFeatureHtmlInfo,_fnUpdateInfo,_fnFeatureHtmlLength,_fnFeatureHtmlProcessing,_fnProcessingDisplay,_fnVisibleToColumnIndex,_fnColumnIndexToVisible,_fnNodeToDataIndex,_fnVisbleColumns,_fnCalculateEnd,_fnConvertToWidth,_fnCalculateColumnWidths,_fnScrollingWidthAdjust,_fnGetWidestNode,_fnGetMaxLenString,_fnStringToCss,_fnDetectType,_fnSettingsFromNode,_fnGetDataMaster,_fnGetTrNodes,_fnGetTdNodes,_fnEscapeRegex,_
 fnDeleteIndex,_fnReOrderIndex,_fnColumnOrdering,_fnLog,_fnClearTable,_fnSaveState,_fnLoadState,_fnCreateCookie,_fnReadCookie,_fnDetectHeader,_fnGetUniqueThs,_fnScrollBarWidth,_fnApplyToChildren,_fnMap,_fnGetRowData,_fnGetCellData,_fnSetCellData,_fnGetObjectDataFn,_fnSetObjectDataFn,_fnApplyColumnDefs,_fnBindAction,_fnCallbackReg,_fnCallbackFire,_fnJsonString,_fnRender,_fnNodeToColumnIndex,_fnInfoMacros,_fnBrowserDetect,_fnGetColumns*/
-
-(/** @lends <global> */function( window, document, undefined ) {
-
-(function( factory ) {
-    "use strict";
-
-    // Define as an AMD module if possible
-    if ( typeof define === 'function' && define.amd )
-    {
-        define( ['jquery'], factory );
-    }
-    /* Define using browser globals otherwise
-     * Prevent multiple instantiations if the script is loaded twice
-     */
-    else if ( jQuery && !jQuery.fn.dataTable )
-    {
-        factory( jQuery );
-    }
-}
-(/** @lends <global> */function( $ ) {
-    "use strict";
-    /** 
-     * DataTables is a plug-in for the jQuery Javascript library. It is a 
-     * highly flexible tool, based upon the foundations of progressive 
-     * enhancement, which will add advanced interaction controls to any 
-     * HTML table. For a full list of features please refer to
-     * <a href="http://datatables.net">DataTables.net</a>.
-     *
-     * Note that the <i>DataTable</i> object is not a global variable but is
-     * aliased to <i>jQuery.fn.DataTable</i> and <i>jQuery.fn.dataTable</i> through which 
-     * it may be  accessed.
-     *
-     *  @class
-     *  @param {object} [oInit={}] Configuration object for DataTables. Options
-     *    are defined by {@link DataTable.defaults}
-     *  @requires jQuery 1.3+
-     * 
-     *  @example
-     *    // Basic initialisation
-     *    $(document).ready( function {
-     *      $('#example').dataTable();
-     *    } );
-     *  
-     *  @example
-     *    // Initialisation with configuration options - in this case, disable
-     *    // pagination and sorting.
-     *    $(document).ready( function {
-     *      $('#example').dataTable( {
-     *        "bPaginate": false,
-     *        "bSort": false 
-     *      } );
-     *    } );
-     */
-    var DataTable = function( oInit )
-    {
-        
-        
-        /**
-         * Add a column to the list used for the table with default values
-         *  @param {object} oSettings dataTables settings object
-         *  @param {node} nTh The th element for this column
-         *  @memberof DataTable#oApi
-         */
-        function _fnAddColumn( oSettings, nTh )
-        {
-            var oDefaults = DataTable.defaults.columns;
-            var iCol = oSettings.aoColumns.length;
-            var oCol = $.extend( {}, DataTable.models.oColumn, oDefaults, {
-                "sSortingClass": oSettings.oClasses.sSortable,
-                "sSortingClassJUI": oSettings.oClasses.sSortJUI,
-                "nTh": nTh ? nTh : document.createElement('th'),
-                "sTitle":    oDefaults.sTitle    ? oDefaults.sTitle    : nTh ? nTh.innerHTML : '',
-                "aDataSort": oDefaults.aDataSort ? oDefaults.aDataSort : [iCol],
-                "mData": oDefaults.mData ? oDefaults.oDefaults : iCol
-            } );
-            oSettings.aoColumns.push( oCol );
-            
-            /* Add a column specific filter */
-            if ( oSettings.aoPreSearchCols[ iCol ] === undefined || oSettings.aoPreSearchCols[ iCol ] === null )
-            {
-                oSettings.aoPreSearchCols[ iCol ] = $.extend( {}, DataTable.models.oSearch );
-            }
-            else
-            {
-                var oPre = oSettings.aoPreSearchCols[ iCol ];
-                
-                /* Don't require that the user must specify bRegex, bSmart or bCaseInsensitive */
-                if ( oPre.bRegex === undefined )
-                {
-                    oPre.bRegex = true;
-                }
-                
-                if ( oPre.bSmart === undefined )
-                {
-                    oPre.bSmart = true;
-                }
-                
-                if ( oPre.bCaseInsensitive === undefined )
-                {
-                    oPre.bCaseInsensitive = true;
-                }
-            }
-            
-            /* Use the column options function to initialise classes etc */
-            _fnColumnOptions( oSettings, iCol, null );
-        }
-        
-        
-        /**
-         * Apply options for a column
-         *  @param {object} oSettings dataTables settings object
-         *  @param {int} iCol column index to consider
-         *  @param {object} oOptions object with sType, bVisible and bSearchable etc
-         *  @memberof DataTable#oApi
-         */
-        function _fnColumnOptions( oSettings, iCol, oOptions )
-        {
-            var oCol = oSettings.aoColumns[ iCol ];
-            
-            /* User specified column options */
-            if ( oOptions !== undefined && oOptions !== null )
-            {
-                /* Backwards compatibility for mDataProp */
-                if ( oOptions.mDataProp && !oOptions.mData )
-                {
-                    oOptions.mData = oOptions.mDataProp;
-                }
-        
-                if ( oOptions.sType !== undefined )
-                {
-                    oCol.sType = oOptions.sType;
-                    oCol._bAutoType = false;
-                }
-                
-                $.extend( oCol, oOptions );
-                _fnMap( oCol, oOptions, "sWidth", "sWidthOrig" );
-        
-                /* iDataSort to be applied (backwards compatibility), but aDataSort will take
-                 * priority if defined
-                 */
-                if ( oOptions.iDataSort !== undefined )
-                {
-                    oCol.aDataSort = [ oOptions.iDataSort ];
-                }
-                _fnMap( oCol, oOptions, "aDataSort" );
-            }
-        
-            /* Cache the data get and set functions for speed */
-            var mRender = oCol.mRender ? _fnGetObjectDataFn( oCol.mRender ) : null;
-            var mData = _fnGetObjectDataFn( oCol.mData );
-        
-            oCol.fnGetData = function (oData, sSpecific) {
-                var innerData = mData( oData, sSpecific );
-        
-                if ( oCol.mRender && (sSpecific && sSpecific !== '') )
-                {
-                    return mRender( innerData, sSpecific, oData );
-                }
-                return innerData;
-            };
-            oCol.fnSetData = _fnSetObjectDataFn( oCol.mData );
-            
-            /* Feature sorting overrides column specific when off */
-            if ( !oSettings.oFeatures.bSort )
-            {
-                oCol.bSortable = false;
-            }
-            
-            /* Check that the class assignment is correct for sorting */
-            if ( !oCol.bSortable ||
-                 ($.inArray('asc', oCol.asSorting) == -1 && $.inArray('desc', oCol.asSorting) == -1) )
-            {
-                oCol.sSortingClass = oSettings.oClasses.sSortableNone;
-                oCol.sSortingClassJUI = "";
-            }
-            else if ( $.inArray('asc', oCol.asSorting) == -1 && $.inArray('desc', oCol.asSorting) == -1 )
-            {
-                oCol.sSortingClass = oSettings.oClasses.sSortable;
-                oCol.sSortingClassJUI = oSettings.oClasses.sSortJUI;
-            }
-            else if ( $.inArray('asc', oCol.asSorting) != -1 && $.inArray('desc', oCol.asSorting) == -1 )
-            {
-                oCol.sSortingClass = oSettings.oClasses.sSortableAsc;
-                oCol.sSortingClassJUI = oSettings.oClasses.sSortJUIAscAllowed;
-            }
-            else if ( $.inArray('asc', oCol.asSorting) == -1 && $.inArray('desc', oCol.asSorting) != -1 )
-            {
-                oCol.sSortingClass = oSettings.oClasses.sSortableDesc;
-                oCol.sSortingClassJUI = oSettings.oClasses.sSortJUIDescAllowed;
-            }
-        }
-        
-        
-        /**
-         * Adjust the table column widths for new data. Note: you would probably want to 
-         * do a redraw after calling this function!
-         *  @param {object} oSettings dataTables settings object
-         *  @memberof DataTable#oApi
-         */
-        function _fnAdjustColumnSizing ( oSettings )
-        {
-            /* Not interested in doing column width calculation if auto-width is disabled */
-            if ( oSettings.oFeatures.bAutoWidth === false )
-            {
-                return false;
-            }
-            
-            _fnCalculateColumnWidths( oSettings );
-            for ( var i=0 , iLen=oSettings.aoColumns.length ; i<iLen ; i++ )
-            {
-                oSettings.aoColumns[i].nTh.style.width = oSettings.aoColumns[i].sWidth;
-            }
-        }
-        
-        
-        /**
-         * Covert the index of a visible column to the index in the data array (take account
-         * of hidden columns)
-         *  @param {object} oSettings dataTables settings object
-         *  @param {int} iMatch Visible column index to lookup
-         *  @returns {int} i the data index
-         *  @memberof DataTable#oApi
-         */
-        function _fnVisibleToColumnIndex( oSettings, iMatch )
-        {
-            var aiVis = _fnGetColumns( oSettings, 'bVisible' );
-        
-            return typeof aiVis[iMatch] === 'number' ?
-                aiVis[iMatch] :
-                null;
-        }
-        
-        
-        /**
-         * Covert the index of an index in the data array and convert it to the visible
-         *   column index (take account of hidden columns)
-         *  @param {int} iMatch Column index to lookup
-         *  @param {object} oSettings dataTables settings object
-         *  @returns {int} i the data index
-         *  @memberof DataTable#oApi
-         */
-        function _fnColumnIndexToVisible( oSettings, iMatch )
-        {
-            var aiVis = _fnGetColumns( oSettings, 'bVisible' );
-            var iPos = $.inArray( iMatch, aiVis );
-        
-            return iPos !== -1 ? iPos : null;
-        }
-        
-        
-        /**
-         * Get the number of visible columns
-         *  @param {object} oSettings dataTables settings object
-         *  @returns {int} i the number of visible columns
-         *  @memberof DataTable#oApi
-         */
-        function _fnVisbleColumns( oSettings )
-        {
-            return _fnGetColumns( oSettings, 'bVisible' ).length;
-        }
-        
-        
-        /**
-         * Get an array of column indexes that match a given property
-         *  @param {object} oSettings dataTables settings object
-         *  @param {string} sParam Parameter in aoColumns to look for - typically 
-         *    bVisible or bSearchable
-         *  @returns {array} Array of indexes with matched properties
-         *  @memberof DataTable#oApi
-         */
-        function _fnGetColumns( oSettings, sParam )
-        {
-            var a = [];
-        
-            $.map( oSettings.aoColumns, function(val, i) {
-                if ( val[sParam] ) {
-                    a.push( i );
-                }
-            } );
-        
-            return a;
-        }
-        
-        
-        /**
-         * Get the sort type based on an input string
-         *  @param {string} sData data we wish to know the type of
-         *  @returns {string} type (defaults to 'string' if no type can be detected)
-         *  @memberof DataTable#oApi
-         */
-        function _fnDetectType( sData )
-        {
-            var aTypes = DataTable.ext.aTypes;
-            var iLen = aTypes.length;
-            
-            for ( var i=0 ; i<iLen ; i++ )
-            {
-                var sType = aTypes[i]( sData );
-                if ( sType !== null )
-                {
-                    return sType;
-                }
-            }
-            
-            return 'string';
-        }
-        
-        
-        /**
-         * Figure out how to reorder a display list
-         *  @param {object} oSettings dataTables settings object
-         *  @returns array {int} aiReturn index list for reordering
-         *  @memberof DataTable#oApi
-         */
-        function _fnReOrderIndex ( oSettings, sColumns )
-        {
-            var aColumns = sColumns.split(',');
-            var aiReturn = [];
-            
-            for ( var i=0, iLen=oSettings.aoColumns.length ; i<iLen ; i++ )
-            {
-                for ( var j=0 ; j<iLen ; j++ )
-                {
-                    if ( oSettings.aoColumns[i].sName == aColumns[j] )
-                    {
-                        aiReturn.push( j );
-                        break;
-                    }
-                }
-            }
-            
-            return aiReturn;
-        }
-        
-        
-        /**
-         * Get the column ordering that DataTables expects
-         *  @param {object} oSettings dataTables settings object
-         *  @returns {string} comma separated list of names
-         *  @memberof DataTable#oApi
-         */
-        function _fnColumnOrdering ( oSettings )
-        {
-            var sNames = '';
-            for ( var i=0, iLen=oSettings.aoColumns.length ; i<iLen ; i++ )
-            {
-                sNames += oSettings.aoColumns[i].sName+',';
-            }
-            if ( sNames.length == iLen )
-            {
-                return "";
-            }
-            return sNames.slice(0, -1);
-        }
-        
-        
-        /**
-         * Take the column definitions and static columns arrays and calculate how
-         * they relate to column indexes. The callback function will then apply the
-         * definition found for a column to a suitable configuration object.
-         *  @param {object} oSettings dataTables settings object
-         *  @param {array} aoColDefs The aoColumnDefs array that is to be applied
-         *  @param {array} aoCols The aoColumns array that defines columns individually
-         *  @param {function} fn Callback function - takes two parameters, the calculated
-         *    column index and the definition for that column.
-         *  @memberof DataTable#oApi
-         */
-        function _fnApplyColumnDefs( oSettings, aoColDefs, aoCols, fn )
-        {
-            var i, iLen, j, jLen, k, kLen;
-        
-            // Column definitions with aTargets
-            if ( aoColDefs )
-            {
-                /* Loop over the definitions array - loop in reverse so first instance has priority */
-                for ( i=aoColDefs.length-1 ; i>=0 ; i-- )
-                {
-                    /* Each definition can target multiple columns, as it is an array */
-                    var aTargets = aoColDefs[i].aTargets;
-                    if ( !$.isArray( aTargets ) )
-                    {
-                        _fnLog( oSettings, 1, 'aTargets must be an array of targets, not a '+(typeof aTargets) );
-                    }
-        
-                    for ( j=0, jLen=aTargets.length ; j<jLen ; j++ )
-                    {
-                        if ( typeof aTargets[j] === 'number' && aTargets[j] >= 0 )
-                        {
-                            /* Add columns that we don't yet know about */
-                            while( oSettings.aoColumns.length <= aTargets[j] )
-                            {
-                                _fnAddColumn( oSettings );
-                            }
-        
-                            /* Integer, basic index */
-                            fn( aTargets[j], aoColDefs[i] );
-                        }
-                        else if ( typeof aTargets[j] === 'number' && aTargets[j] < 0 )
-                        {
-                            /* Negative integer, right to left column counting */
-                            fn( oSettings.aoColumns.length+aTargets[j], aoColDefs[i] );
-                        }
-                        else if ( typeof aTargets[j] === 'string' )
-                        {
-                            /* Class name matching on TH element */
-                            for ( k=0, kLen=oSettings.aoColumns.length ; k<kLen ; k++ )
-                            {
-                                if ( aTargets[j] == "_all" ||
-                                     $(oSettings.aoColumns[k].nTh).hasClass( aTargets[j] ) )
-                                {
-                                    fn( k, aoColDefs[i] );
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-        
-            // Statically defined columns array
-            if ( aoCols )
-            {
-                for ( i=0, iLen=aoCols.length ; i<iLen ; i++ )
-                {
-                    fn( i, aoCols[i] );
-                }
-            }
-        }
-        
-        /**
-         * Add a data array to the table, creating DOM node etc. This is the parallel to 
-         * _fnGatherData, but for adding rows from a Javascript source, rather than a
-         * DOM source.
-         *  @param {object} oSettings dataTables settings object
-         *  @param {array} aData data array to be added
-         *  @returns {int} >=0 if successful (index of new aoData entry), -1 if failed
-         *  @memberof DataTable#oApi
-         */
-        function _fnAddData ( oSettings, aDataSupplied )
-        {
-            var oCol;
-            
-            /* Take an independent copy of the data source so we can bash it about as we wish */
-            var aDataIn = ($.isArray(aDataSupplied)) ?
-                aDataSupplied.slice() :
-                $.extend( true, {}, aDataSupplied );
-            
-            /* Create the object for storing information about this new row */
-            var iRow = oSettings.aoData.length;
-            var oData = $.extend( true, {}, DataTable.models.oRow );
-            oData._aData = aDataIn;
-            oSettings.aoData.push( oData );
-        
-            /* Create the cells */
-            var nTd, sThisType;
-            for ( var i=0, iLen=oSettings.aoColumns.length ; i<iLen ; i++ )
-            {
-                oCol = oSettings.aoColumns[i];
-        
-                /* Use rendered data for filtering / sorting */
-                if ( typeof oCol.fnRender === 'function' && oCol.bUseRendered && oCol.mData !== null )
-                {
-                    _fnSetCellData( oSettings, iRow, i, _fnRender(oSettings, iRow, i) );
-                }
-                else
-                {
-                    _fnSetCellData( oSettings, iRow, i, _fnGetCellData( oSettings, iRow, i ) );
-                }
-                
-                /* See if we should auto-detect the column type */
-                if ( oCol._bAutoType && oCol.sType != 'string' )
-                {
-                    /* Attempt to auto detect the type - same as _fnGatherData() */
-                    var sVarType = _fnGetCellData( oSettings, iRow, i, 'type' );
-                    if ( sVarType !== null && sVarType !== '' )
-                    {
-                        sThisType = _fnDetectType( sVarType );
-                        if ( oCol.sType === null )
-                        {
-                            oCol.sType = sThisType;
-                        }
-                        else if ( oCol.sType != sThisType && oCol.sType != "html" )
-                        {
-                            /* String is always the 'fallback' option */
-                            oCol.sType = 'string';
-                        }
-                    }
-                }
-            }
-            
-            /* Add to the display array */
-            oSettings.aiDisplayMaster.push( iRow );
-        
-            /* Create the DOM information */
-            if ( !oSettings.oFeatures.bDeferRender )
-            {
-                _fnCreateTr( oSettings, iRow );
-            }
-        
-            return iRow;
-        }
-        
-        
-        /**
-         * Read in the data from the target table from the DOM
-         *  @param {object} oSettings dataTables settings object
-         *  @memberof DataTable#oApi
-         */
-        function _fnGatherData( oSettings )
-        {
-            var iLoop, i, iLen, j, jLen, jInner,
-                nTds, nTrs, nTd, nTr, aLocalData, iThisIndex,
-                iRow, iRows, iColumn, iColumns, sNodeName,
-                oCol, oData;
-            
-            /*
-             * Process by row first
-             * Add the data object for the whole table - storing the tr node. Note - no point in getting
-             * DOM based data if we are going to go and replace it with Ajax source data.
-             */
-            if ( oSettings.bDeferLoading || oSettings.sAjaxSource === null )
-            {
-                nTr = oSettings.nTBody.firstChild;
-                while ( nTr )
-                {
-                    if ( nTr.nodeName.toUpperCase() == "TR" )
-                    {
-                        iThisIndex = oSettings.aoData.length;
-                        nTr._DT_RowIndex = iThisIndex;
-                        oSettings.aoData.push( $.extend( true, {}, DataTable.models.oRow, {
-                            "nTr": nTr
-                        } ) );
-        
-                        oSettings.aiDisplayMaster.push( iThisIndex );
-                        nTd = nTr.firstChild;
-                        jInner = 0;
-                        while ( nTd )
-                        {
-                            sNodeName = nTd.nodeName.toUpperCase();
-                            if ( sNodeName == "TD" || sNodeName == "TH" )
-                            {
-                                _fnSetCellData( oSettings, iThisIndex, jInner, $.trim(nTd.innerHTML) );
-                                jInner++;
-                            }
-                            nTd = nTd.nextSibling;
-                        }
-                    }
-                    nTr = nTr.nextSibling;
-                }
-            }
-            
-            /* Gather in the TD elements of the Table - note that this is basically the same as
-             * fnGetTdNodes, but that function takes account of hidden columns, which we haven't yet
-             * setup!
-             */
-            nTrs = _fnGetTrNodes( oSettings );
-            nTds = [];
-            for ( i=0, iLen=nTrs.length ; i<iLen ; i++ )
-            {
-                nTd = nTrs[i].firstChild;
-                while ( nTd )
-                {
-                    sNodeName = nTd.nodeName.toUpperCase();
-                    if ( sNodeName == "TD" || sNodeName == "TH" )
-                    {
-                        nTds.push( nTd );
-                    }
-                    nTd = nTd.nextSibling;
-                }
-            }
-            
-            /* Now process by column */
-            for ( iColumn=0, iColumns=oSettings.aoColumns.length ; iColumn<iColumns ; iColumn++ )
-            {
-                oCol = oSettings.aoColumns[iColumn];
-        
-                /* Get the title of the column - unless there is a user set one */
-                if ( oCol.sTitle === null )
-                {
-                    oCol.sTitle = oCol.nTh.innerHTML;
-                }
-                
-                var
-                    bAutoType = oCol._bAutoType,
-                    bRender = typeof oCol.fnRender === 'function',
-                    bClass = oCol.sClass !== null,
-                    bVisible = oCol.bVisible,
-                    nCell, sThisType, sRendered, sValType;
-                
-                /* A single loop to rule them all (and be more efficient) */
-                if ( bAutoType || bRender || bClass || !bVisible )
-                {
-                    for ( iRow=0, iRows=oSettings.aoData.length ; iRow<iRows ; iRow++ )
-                    {
-                        oData = oSettings.aoData[iRow];
-                        nCell = nTds[ (iRow*iColumns) + iColumn ];
-                        
-                        /* Type detection */
-                        if ( bAutoType && oCol.sType != 'string' )
-                        {
-                            sValType = _fnGetCellData( oSettings, iRow, iColumn, 'type' );
-                            if ( sValType !== '' )
-                            {
-                                sThisType = _fnDetectType( sValType );
-                                if ( oCol.sType === null )
-                                {
-                                    oCol.sType = sThisType;
-                                }
-                                else if ( oCol.sType != sThisType && 
-                                          oCol.sType != "html" )
-                                {
-                                    /* String is always the 'fallback' option */
-                                    oCol.sType = 'string';
-                                }
-                            }
-                        }
-        
-                        if ( oCol.mRender )
-                        {
-                            // mRender has been defined, so we need to get the value and set it
-                            nCell.innerHTML = _fnGetCellData( oSettings, iRow, iColumn, 'display' );
-                        }
-                        else if ( oCol.mData !== iColumn )
-                        {
-                            // If mData is not the same as the column number, then we need to
-                            // get the dev set value. If it is the column, no point in wasting
-                            // time setting the value that is already there!
-                            nCell.innerHTML = _fnGetCellData( oSettings, iRow, iColumn, 'display' );
-                        }
-                        
-                        /* Rendering */
-                        if ( bRender )
-                        {
-                            sRendered = _fnRender( oSettings, iRow, iColumn );
-                            nCell.innerHTML = sRendered;
-                            if ( oCol.bUseRendered )
-                            {
-                                /* Use the rendered data for filtering / sorting */
-                                _fnSetCellData( oSettings, iRow, iColumn, sRendered );
-                            }
-                        }
-                        
-                        /* Classes */
-                        if ( bClass )
-                        {
-                            nCell.className += ' '+oCol.sClass;
-                        }
-                        
-                        /* Column visibility */
-                        if ( !bVisible )
-                        {
-                            oData._anHidden[iColumn] = nCell;
-                            nCell.parentNode.removeChild( nCell );
-                        }
-                        else
-                        {
-                            oData._anHidden[iColumn] = null;
-                        }
-        
-                        if ( oCol.fnCreatedCell )
-                        {
-                            oCol.fnCreatedCell.call( oSettings.oInstance,
-                                nCell, _fnGetCellData( oSettings, iRow, iColumn, 'display' ), oData._aData, iRow, iColumn
-                            );
-                        }
-                    }
-                }
-            }
-        
-            /* Row created callbacks */
-            if ( oSettings.aoRowCreatedCallback.length !== 0 )
-            {
-                for ( i=0, iLen=oSettings.aoData.length ; i<iLen ; i++ )
-                {
-                    oData = oSettings.aoData[i];
-                    _fnCallbackFire( oSettings, 'aoRowCreatedCallback', null, [oData.nTr, oData._aData, i] );
-                }
-            }
-        }
-        
-        
-        /**
-         * Take a TR element and convert it to an index in aoData
-         *  @param {object} oSettings dataTables settings object
-         *  @param {node} n the TR element to find
-         *  @returns {int} index if the node is found, null if not
-         *  @memberof DataTable#oApi
-         */
-        function _fnNodeToDataIndex( oSettings, n )
-        {
-            return (n._DT_RowIndex!==undefined) ? n._DT_RowIndex : null;
-        }
-        
-        
-        /**
-         * Take a TD element and convert it into a column data index (not the visible index)
-         *  @param {object} oSettings dataTables settings object
-         *  @param {int} iRow The row number the TD/TH can be found in
-         *  @param {node} n The TD/TH element to find
-         *  @returns {int} index if the node is found, -1 if not
-         *  @memberof DataTable#oApi
-         */
-        function _fnNodeToColumnIndex( oSettings, iRow, n )
-        {
-            var anCells = _fnGetTdNodes( oSettings, iRow );
-        
-            for ( var i=0, iLen=oSettings.aoColumns.length ; i<iLen ; i++ )
-            {
-                if ( anCells[i] === n )
-                {
-                    return i;
-                }
-            }
-            return -1;
-        }
-        
-        
-        /**
-         * Get an array of data for a given row from the internal data cache
-         *  @param {object} oSettings dataTables settings object
-         *  @param {int} iRow aoData row id
-         *  @param {string} sSpecific data get type ('type' 'filter' 'sort')
-         *  @param {array} aiColumns Array of column indexes to get data from
-         *  @returns {array} Data array
-         *  @memberof DataTable#oApi
-         */
-        function _fnGetRowData( oSettings, iRow, sSpecific, aiColumns )
-        {
-            var out = [];
-            for ( var i=0, iLen=aiColumns.length ; i<iLen ; i++ )
-            {
-                out.push( _fnGetCellData( oSettings, iRow, aiColumns[i], sSpecific ) );
-            }
-            return out;
-        }
-        
-        
-        /**
-         * Get the data for a given cell from the internal cache, taking into account data mapping
-         *  @param {object} oSettings dataTables settings object
-         *  @param {int} iRow aoData row id
-         *  @param {int} iCol Column index
-         *  @param {string} sSpecific data get type ('display', 'type' 'filter' 'sort')
-         *  @returns {*} Cell data
-         *  @memberof DataTable#oApi
-         */
-        function _fnGetCellData( oSettings, iRow, iCol, sSpecific )
-        {
-            var sData;
-            var oCol = oSettings.aoColumns[iCol];
-            var oData = oSettings.aoData[iRow]._aData;
-        
-            if ( (sData=oCol.fnGetData( oData, sSpecific )) === undefined )
-            {
-                if ( oSettings.iDrawError != oSettings.iDraw && oCol.sDefaultContent === null )
-                {
-                    _fnLog( oSettings, 0, "Requested unknown parameter "+
-                        (typeof oCol.mData=='function' ? '{mData function}' : "'"+oCol.mData+"'")+
-                        " from the data source for row "+iRow );
-                    oSettings.iDrawError = oSettings.iDraw;
-                }
-                return oCol.sDefaultContent;
-            }
-        
-            /* When the data source is null, we can use default column data */
-            if ( sData === null && oCol.sDefaultContent !== null )
-            {
-                sData = oCol.sDefaultContent;
-            }
-            else if ( typeof sData === 'function' )
-            {
-                /* If the data source is a function, then we run it and use the return */
-                return sData();
-            }
-        
-            if ( sSpecific == 'display' && sData === null )
-            {
-                return '';
-            }
-            return sData;
-        }
-        
-        
-        /**
-         * Set the value for a specific cell, into the internal data cache
-         *  @param {object} oSettings dataTables settings object
-         *  @param {int} iRow aoData row id
-         *  @param {int} iCol Column index
-         *  @param {*} val Value to set
-         *  @memberof DataTable#oApi
-         */
-        function _fnSetCellData( oSettings, iRow, iCol, val )
-        {
-            var oCol = oSettings.aoColumns[iCol];
-            var oData = oSettings.aoData[iRow]._aData;
-        
-            oCol.fnSetData( oData, val );
-        }
-        
-        
-        // Private variable that is used to match array syntax in the data property object
-        var __reArray = /\[.*?\]$/;
-        
-        /**
-         * Return a function that can be used to get data from a source object, taking
-         * into account the ability to use nested objects as a source
-         *  @param {string|int|function} mSource The data source for the object
-         *  @returns {function} Data get function
-         *  @memberof DataTable#oApi
-         */
-        function _fnGetObjectDataFn( mSource )
-        {
-            if ( mSource === null )
-            {
-                /* Give an empty string for rendering / sorting etc */
-                return function (data, type) {
-                    return null;
-                };
-            }
-            else if ( typeof mSource === 'function' )
-            {
-                return function (data, type, extra) {
-                    return mSource( data, type, extra );
-                };
-            }
-            else if ( typeof mSource === 'string' && (mSource.indexOf('.') !== -1 || mSource.indexOf('[') !== -1) )
-            {
-                /* If there is a . in the source string then the data source is in a 
-                 * nested object so we loop over the data for each level to get the next
-                 * level down. On each loop we test for undefined, and if found immediately
-                 * return. This allows entire objects to be missing and sDefaultContent to
-                 * be used if defined, rather than throwing an error
-                 */
-                var fetchData = function (data, type, src) {
-                    var a = src.split('.');
-                    var arrayNotation, out, innerSrc;
-        
-                    if ( src !== "" )
-                    {
-                        for ( var i=0, iLen=a.length ; i<iLen ; i++ )
-                        {
-                            // Check if we are dealing with an array notation request
-                            arrayNotation = a[i].match(__reArray);
-        
-                            if ( arrayNotation ) {
-                                a[i] = a[i].replace(__reArray, '');
-        
-                                // Condition allows simply [] to be passed in
-                                if ( a[i] !== "" ) {
-                                    data = data[ a[i] ];
-                                }
-                                out = [];
-                                
-                                // Get the remainder of the nested object to get
-                                a.splice( 0, i+1 );
-                                innerSrc = a.join('.');
-        
-                                // Traverse each entry in the array getting the properties requested
-                                for ( var j=0, jLen=data.length ; j<jLen ; j++ ) {
-                                    out.push( fetchData( data[j], type, innerSrc ) );
-                                }
-        
-                                // If a string is given in between the array notation indicators, that
-                                // is used to join the strings together, otherwise an array is returned
-                                var join = arrayNotation[0].substring(1, arrayNotation[0].length-1);
-                                data = (join==="") ? out : out.join(join);
-        
-                                // The inner call to fetchData has already traversed through the remainder
-                                // of the source requested, so we exit from the loop
-                                break;
-                            }
-        
-                            if ( data === null || data[ a[i] ] === undefined )
-                            {
-                                return undefined;
-                            }
-                            data = data[ a[i] ];
-                        }
-                    }
-        
-                    return data;
-                };
-        
-                return function (data, type) {
-                    return fetchData( data, type, mSource );
-                };
-            }
-            else
-            {
-                /* Array or flat object mapping */
-                return function (data, type) {
-                    return data[mSource];   
-                };
-            }
-        }
-        
-        
-        /**
-         * Return a function that can be used to set data from a source object, taking
-         * into account the ability to use nested objects as a source
-         *  @param {string|int|function} mSource The data source for the object
-         *  @returns {function} Data set function
-         *  @memberof DataTable#oApi
-         */
-        function _fnSetObjectDataFn( mSource )
-        {
-            if ( mSource === null )
-            {
-                /* Nothing to do when the data source is null */
-                return function (data, val) {};
-            }
-            else if ( typeof mSource === 'function' )
-            {
-                return function (data, val) {
-                    mSource( data, 'set', val );
-                };
-            }
-            else if ( typeof mSource === 'string' && (mSource.indexOf('.') !== -1 || mSource.indexOf('[') !== -1) )
-            {
-                /* Like the get, we need to get data from a nested object */
-                var setData = function (data, val, src) {
-                    var a = src.split('.'), b;
-                    var arrayNotation, o, innerSrc;
-        
-                    for ( var i=0, iLen=a.length-1 ; i<iLen ; i++ )
-                    {
-                        // Check if we are dealing with an array notation request
-                        arrayNotation = a[i].match(__reArray);
-        
-                        if ( arrayNotation )
-                        {
-                            a[i] = a[i].replace(__reArray, '');
-                            data[ a[i] ] = [];
-                            
-                            // Get the remainder of the nested object to set so we can recurse
-                            b = a.slice();
-                            b.splice( 0, i+1 );
-                            innerSrc = b.join('.');
-        
-                            // Traverse each entry in the array setting the properties requested
-                            for ( var j=0, jLen=val.length ; j<jLen ; j++ )
-                            {
-                                o = {};
-                                setData( o, val[j], innerSrc );
-                                data[ a[i] ].push( o );
-                            }
-        
-                            // The inner call to setData has already traversed through the remainder
-                            // of the source and has set the data, thus we can exit here
-                            return;
-                        }
-        
-                        // If the nested object doesn't currently exist - since we are
-                        // trying to set the value - create it
-                        if ( data[ a[i] ] === null || data[ a[i] ] === undefined )
-                        {
-                            data[ a[i] ] = {};
-                        }
-                        data = data[ a[i] ];
-                    }
-        
-                    // If array notation is used, we just want to strip it and use the property name
-                    // and assign the value. If it isn't used, then we get the result we want anyway
-                    data[ a[a.length-1].replace(__reArray, '') ] = val;
-                };
-        
-                return function (data, val) {
-                    return setData( data, val, mSource );
-                };
-            }
-            else
-            {
-                /* Array or flat object mapping */
-                return function (data, val) {
-                    data[mSource] = val;    
-                };
-            }
-        }
-        
-        
-        /**
-         * Return an array with the full table data
-         *  @param {object} oSettings dataTables settings object
-         *  @returns array {array} aData Master data array
-         *  @memberof DataTable#oApi
-         */
-        function _fnGetDataMaster ( oSettings )
-        {
-            var aData = [];
-            var iLen = oSettings.aoData.length;
-            for ( var i=0 ; i<iLen; i++ )
-            {
-                aData.push( oSettings.aoData[i]._aData );
-            }
-            return aData;
-        }
-        
-        
-        /**
-         * Nuke the table
-         *  @param {object} oSettings dataTables settings object
-         *  @memberof DataTable#oApi
-         */
-        function _fnClearTable( oSettings )
-        {
-            oSettings.aoData.splice( 0, oSettings.aoData.length );
-            oSettings.aiDisplayMaster.splice( 0, oSettings.aiDisplayMaster.length );
-            oSettings.aiDisplay.splice( 0, oSettings.aiDisplay.length );
-            _fnCalculateEnd( oSettings );
-        }
-        
-        
-         /**
-         * Take an array of integers (index array) and remove a target integer (value - not 
-         * the key!)
-         *  @param {array} a Index array to target
-         *  @param {int} iTarget value to find
-         *  @memberof DataTable#oApi
-         */
-        function _fnDeleteIndex( a, iTarget )
-        {
-            var iTargetIndex = -1;
-            
-            for ( var i=0, iLen=a.length ; i<iLen ; i++ )
-            {
-                if ( a[i] == iTarget )
-                {
-                    iTargetIndex = i;
-                }
-                else if ( a[i] > iTarget )
-                {
-                    a[i]--;
-                }
-            }
-            
-            if ( iTargetIndex != -1 )
-            {
-                a.splice( iTargetIndex, 1 );
-            }
-        }
-        
-        
-         /**
-         * Call the developer defined fnRender function for a given cell (row/column) with
-         * the required parameters and return the result.
-         *  @param {object} oSettings dataTables settings object
-         *  @param {int} iRow aoData index for the row
-         *  @param {int} iCol aoColumns index for the column
-         *  @returns {*} Return of the developer's fnRender function
-         *  @memberof DataTable#oApi
-         */
-        function _fnRender( oSettings, iRow, iCol )
-        {
-            var oCol = oSettings.aoColumns[iCol];
-        
-            return oCol.fnRender( {
-                "iDataRow":    iRow,
-                "iDataColumn": iCol,
-                "oSettings":   oSettings,
-                "aData":       oSettings.aoData[iRow]._aData,
-                "mDataProp":   oCol.mData
-            }, _fnGetCellData(oSettings, iRow, iCol, 'display') );
-        }
-        /**
-         * Create a new TR element (and it's TD children) for a row
-         *  @param {object} oSettings dataTables settings object
-         *  @param {int} iRow Row to consider
-         *  @memberof DataTable#oApi
-         */
-        function _fnCreateTr ( oSettings, iRow )
-        {
-            var oData = oSettings.aoData[iRow];
-            var nTd;
-        
-            if ( oData.nTr === null )
-            {
-                oData.nTr = document.createElement('tr');
-        
-                /* Use a private property on the node to allow reserve mapping from the node
-                 * to the aoData array for fast look up
-                 */
-                oData.nTr._DT_RowIndex = iRow;
-        
-                /* Special parameters can be given by the data source to be used on the row */
-                if ( oData._aData.DT_RowId )
-                {
-                    oData.nTr.id = oData._aData.DT_RowId;
-                }
-        
-                if ( oData._aData.DT_RowClass )
-                {
-                    oData.nTr.className = oData._aData.DT_RowClass;
-                }
-        
-                /* Process each column */
-                for ( var i=0, iLen=oSettings.aoColumns.length ; i<iLen ; i++ )
-                {
-                    var oCol = oSettings.aoColumns[i];
-                    nTd = document.createElement( oCol.sCellType );
-        
-                    /* Render if needed - if bUseRendered is true then we already have the rendered
-                     * value in the data source - so can just use that
-                     */
-                    nTd.innerHTML = (typeof oCol.fnRender === 'function' && (!oCol.bUseRendered || oCol.mData === null)) ?
-                        _fnRender( oSettings, iRow, i ) :
-                        _fnGetCellData( oSettings, iRow, i, 'display' );
-                
-                    /* Add user defined class */
-                    if ( oCol.sClass !== null )
-                    {
-                        nTd.className = oCol.sClass;
-                    }
-                    
-                    if ( oCol.bVisible )
-                    {
-                        oData.nTr.appendChild( nTd );
-                        oData._anHidden[i] = null;
-                    }
-                    else
-                    {
-                        oData._anHidden[i] = nTd;
-                    }
-        
-                    if ( oCol.fnCreatedCell )
-                    {
-                        oCol.fnCreatedCell.call( oSettings.oInstance,
-                            nTd, _fnGetCellData( oSettings, iRow, i, 'display' ), oData._aData, iRow, i
-                        );
-                    }
-                }
-        
-                _fnCallbackFire( oSettings, 'aoRowCreatedCallback', null, [oData.nTr, oData._aData, iRow] );
-            }
-        }
-        
-        
-        /**
-         * Create the HTML header for the table
-         *  @param {object} oSettings dataTables settings object
-         *  @memberof DataTable#oApi
-         */
-        function _fnBuildHead( oSettings )
-        {
-            var i, nTh, iLen, j, jLen;
-            var iThs = $('th, td', oSettings.nTHead).length;
-            var iCorrector = 0;
-            var jqChildren;
-            
-            /* If there is a header in place - then use it - otherwise it's going to get nuked... */
-            if ( iThs !== 0 )
-            {
-                /* We've got a thead from the DOM, so remove hidden columns and apply width to vis cols */
-                for ( i=0, iLen=oSettings.aoColumns.length ; i<iLen ; i++ )
-                {
-                    nTh = oSettings.aoColumns[i].nTh;
-                    nTh.setAttribute('role', 'columnheader');
-                    if ( oSettings.aoColumns[i].bSortable )
-                    {
-                        nTh.setAttribute('tabindex', oSettings.iTabIndex);
-                        nTh.setAttribute('aria-controls', oSettings.sTableId);
-                    }
-        
-                    if ( oSettings.aoColumns[i].sClass !== null )
-                    {
-                        $(nTh).addClass( oSettings.aoColumns[i].sClass );
-                    }
-                    
-                    /* Set the title of the column if it is user defined (not what was auto detected) */
-                    if ( oSettings.aoColumns[i].sTitle != nTh.innerHTML )
-                    {
-                        nTh.innerHTML = oSettings.aoColumns[i].sTitle;
-                    }
-                }
-            }
-            else
-            {
-                /* We don't have a header in the DOM - so we are going to have to create one */
-                var nTr = document.createElement( "tr" );
-                
-                for ( i=0, iLen=oSettings.aoColumns.length ; i<iLen ; i++ )
-                {
-                    nTh = oSettings.aoColumns[i].nTh;
-                    nTh.innerHTML = oSettings.aoColumns[i].sTitle;
-                    nTh.setAttribute('tabindex', '0');
-                    
-                    if ( oSettings.aoColumns[i].sClass !== null )
-                    {
-                        $(nTh).addClass( oSettings.aoColumns[i].sClass );
-                    }
-                    
-                    nTr.appendChild( nTh );
-                }
-                $(oSettings.nTHead).html( '' )[0].appendChild( nTr );
-                _fnDetectHeader( oSettings.aoHeader, oSettings.nTHead );
-            }
-            
-            /* ARIA role for the rows */    
-            $(oSettings.nTHead).children('tr').attr('role', 'row');
-            
-            /* Add the extra markup needed by jQuery UI's themes */
-            if ( oSettings.bJUI )
-            {
-                for ( i=0, iLen=oSettings.aoColumns.length ; i<iLen ; i++ )
-                {
-                    nTh = oSettings.aoColumns[i].nTh;
-                    
-                    var nDiv = document.createElement('div');
-                    nDiv.className = oSettings.oClasses.sSortJUIWrapper;
-                    $(nTh).contents().appendTo(nDiv);
-                    
-                    var nSpan = document.createElement('span');
-                    nSpan.className = oSettings.oClasses.sSortIcon;
-                    nDiv.appendChild( nSpan );
-                    nTh.appendChild( nDiv );
-                }
-            }
-            
-            if ( oSettings.oFeatures.bSort )
-            {
-                for ( i=0 ; i<oSettings.aoColumns.length ; i++ )
-                {
-                    if ( oSettings.aoColumns[i].bSortable !== false )
-                    {
-                        _fnSortAttachListener( oSettings, oSettings.aoColumns[i].nTh, i );
-                    }
-                    else
-                    {
-                        $(oSettings.aoColumns[i].nTh).addClass( oSettings.oClasses.sSortableNone );
-                    }
-                }
-            }
-            
-            /* Deal with the footer - add classes if required */
-            if ( oSettings.oClasses.sFooterTH !== "" )
-            {
-                $(oSettings.nTFoot).children('tr').children('th').addClass( oSettings.oClasses.sFooterTH );
-            }
-            
-            /* Cache the footer elements */
-            if ( oSettings.nTFoot !== null )
-            {
-                var anCells = _fnGetUniqueThs( oSettings, null, oSettings.aoFooter );
-                for ( i=0, iLen=oSettings.aoColumns.length ; i<iLen ; i++ )
-                {
-                    if ( anCells[i] )
-                    {
-                        oSettings.aoColumns[i].nTf = anCells[i];
-                        if ( oSettings.aoColumns[i].sClass )
-                        {
-                            $(anCells[i]).addClass( oSettings.aoColumns[i].sClass );
-                        }
-                    }
-                }
-            }
-        }
-        
-        
-        /**
-         * Draw the header (or footer) element based on the column visibility states. The
-         * methodology here is to use the layout array from _fnDetectHeader, modified for
-         * the instantaneous column visibility, to construct the new layout. The grid is
-         * traversed over cell at a time in a rows x columns grid fashion, although each 
-         * cell insert can cover multiple elements in the grid - which is tracks using the
-         * aApplied array. Cell inserts in the grid will only occur where there isn't
-         * already a cell in that position.
-         *  @param {object} oSettings dataTables settings object
-         *  @param array {objects} aoSource Layout array from _fnDetectHeader
-         *  @param {boolean} [bIncludeHidden=false] If true then include the hidden columns in the calc, 
-         *  @memberof DataTable#oApi
-         */
-        function _fnDrawHead( oSettings, aoSource, bIncludeHidden )
-        {
-            var i, iLen, j, jLen, k, kLen, n, nLocalTr;
-            var aoLocal = [];
-            var aApplied = [];
-            var iColumns = oSettings.aoColumns.length;
-            var iRowspan, iColspan;
-        
-            if (  bIncludeHidden === undefined )
-            {
-                bIncludeHidden = false;
-            }
-        
-            /* Make a copy of the master layout array, but without the visible columns in it */
-            for ( i=0, iLen=aoSource.length ; i<iLen ; i++ )
-            {
-                aoLocal[i] = aoSource[i].slice();
-                aoLocal[i].nTr = aoSource[i].nTr;
-        
-                /* Remove any columns which are currently hidden */
-                for ( j=iColumns-1 ; j>=0 ; j-- )
-                {
-                    if ( !oSettings.aoColumns[j].bVisible && !bIncludeHidden )
-                    {
-                        aoLocal[i].splice( j, 1 );
-                    }
-                }
-        
-                /* Prep the applied array - it needs an element for each row */
-                aApplied.push( [] );
-            }
-        
-            for ( i=0, iLen=aoLocal.length ; i<iLen ; i++ )
-            {
-                nLocalTr = aoLocal[i].nTr;
-                
-                /* All cells are going to be replaced, so empty out the row */
-                if ( nLocalTr )
-                {
-                    while( (n = nLocalTr.firstChild) )
-                    {
-                        nLocalTr.removeChild( n );
-                    }
-                }
-        
-                for ( j=0, jLen=aoLocal[i].length ; j<jLen ; j++ )
-                {
-                    iRowspan = 1;
-                    iColspan = 1;
-        
-                    /* Check to see if there is already a cell (row/colspan) covering our target
-                     * insert point. If there is, then there is nothing to do.
-                     */
-                    if ( aApplied[i][j] === undefined )
-                    {
-                        nLocalTr.appendChild( aoLocal[i][j].cell );
-                        aApplied[i][j] = 1;
-        
-                        /* Expand the cell to cover as many rows as needed */
-                        while ( aoLocal[i+iRowspan] !== undefined &&
-                                aoLocal[i][j].cell == aoLocal[i+iRowspan][j].cell )
-                        {
-                            aApplied[i+iRowspan][j] = 1;
-                            iRowspan++;
-                        }
-        
-                        /* Expand the cell to cover as many columns as needed */
-                        while ( aoLocal[i][j+iColspan] !== undefined &&
-                                aoLocal[i][j].cell == aoLocal[i][j+iColspan].cell )
-                        {
-                            /* Must update the applied array over the rows for the columns */
-                            for ( k=0 ; k<iRowspan ; k++ )
-                            {
-                                aApplied[i+k][j+iColspan] = 1;
-                            }
-                            iColspan++;
-                        }
-        
-                        /* Do the actual expansion in the DOM */
-                        aoLocal[i][j].cell.rowSpan = iRowspan;
-                        aoLocal[i][j].cell.colSpan = iColspan;
-                    }
-                }
-            }
-        }
-        
-        
-        /**
-         * Insert the required TR nodes into the table for display
-         *  @param {object} oSettings dataTables settings object
-         *  @memberof DataTable#oApi
-         */
-        function _fnDraw( oSettings )
-        {
-            /* Provide a pre-callback function which can be used to cancel the draw is false is returned */
-            var aPreDraw = _fnCallbackFire( oSettings, 'aoPreDrawCallback', 'preDraw', [oSettings] );
-            if ( $.inArray( false, aPreDraw ) !== -1 )
-            {
-                _fnProcessingDisplay( oSettings, false );
-                return;
-            }
-            
-            var i, iLen, n;
-            var anRows = [];
-            var iRowCount = 0;
-            var iStripes = oSettings.asStripeClasses.length;
-            var iOpenRows = oSettings.aoOpenRows.length;
-            
-            oSettings.bDrawing = true;
-            
-            /* Check and see if we have an initial draw position from state saving */
-            if ( oSettings.iInitDisplayStart !== undefined && oSettings.iInitDisplayStart != -1 )
-            {
-                if ( oSettings.oFeatures.bServerSide )
-                {
-                    oSettings._iDisplayStart = oSettings.iInitDisplayStart;
-                }
-                else
-                {
-                    oSettings._iDisplayStart = (oSettings.iInitDisplayStart >= oSettings.fnRecordsDisplay()) ?
-                        0 : oSettings.iInitDisplayStart;
-                }
-                oSettings.iInitDisplayStart = -1;
-                _fnCalculateEnd( oSettings );
-            }
-            
-            /* Server-side processing draw intercept */
-            if ( oSettings.bDeferLoading )
-            {
-                oSettings.bDeferLoading = false;
-                oSettings.iDraw++;
-            }
-            else if ( !oSettings.oFeatures.bServerSide )
-            {
-                oSettings.iDraw++;
-            }
-            else if ( !oSettings.bDestroying && !_fnAjaxUpdate( oSettings ) )
-            {
-                return;
-            }
-            
-            if ( oSettings.aiDisplay.length !== 0 )
-            {
-                var iStart = oSettings._iDisplayStart;
-                var iEnd = oSettings._iDisplayEnd;
-                
-                if ( oSettings.oFeatures.bServerSide )
-                {
-                    iStart = 0;
-                    iEnd = oSettings.aoData.length;
-                }
-                
-                for ( var j=iStart ; j<iEnd ; j++ )
-                {
-                    var aoData = oSettings.aoData[ oSettings.aiDisplay[j] ];
-                    if ( aoData.nTr === null )
-                    {
-                        _fnCreateTr( oSettings, oSettings.aiDisplay[j] );
-                    }
-        
-                    var nRow = aoData.nTr;
-                    
-                    /* Remove the old striping classes and then add the new one */
-                    if ( iStripes !== 0 )
-                    {
-                        var sStripe = oSettings.asStripeClasses[ iRowCount % iStripes ];
-                        if ( aoData._sRowStripe != sStripe )
-                        {
-                            $(nRow).removeClass( aoData._sRowStripe ).addClass( sStripe );
-                            aoData._sRowStripe = sStripe;
-                        }
-                    }
-                    
-                    /* Row callback functions - might want to manipulate the row */
-                    _fnCallbackFire( oSettings, 'aoRowCallback', null, 
-                        [nRow, oSettings.aoData[ oSettings.aiDisplay[j] ]._aData, iRowCount, j] );
-                    
-                    anRows.push( nRow );
-                    iRowCount++;
-                    
-                    /* If there is an open row - and it is attached to this parent - attach it on redraw */
-                    if ( iOpenRows !== 0 )
-                    {
-                        for ( var k=0 ; k<iOpenRows ; k++ )
-                        {
-                            if ( nRow == oSettings.aoOpenRows[k].nParent )
-                            {
-                                anRows.push( oSettings.aoOpenRows[k].nTr );
-                                break;
-                            }
-                        }
-                    }
-                }
-            }
-            else
-            {
-                /* Table is empty - create a row with an empty message in it */
-                anRows[ 0 ] = document.createElement( 'tr' );
-                
-                if ( oSettings.asStripeClasses[0] )
-                {
-                    anRows[ 0 ].className = oSettings.asStripeClasses[0];
-                }
-        
-                var oLang = oSettings.oLanguage;
-                var sZero = oLang.sZeroRecords;
-                if ( oSettings.iDraw == 1 && oSettings.sAjaxSource !== null && !oSettings.oFeatures.bServerSide )
-                {
-                    sZero = oLang.sLoadingRecords;
-                }
-                else if ( oLang.sEmptyTable && oSettings.fnRecordsTotal() === 0 )
-                {
-                    sZero = oLang.sEmptyTable;
-                }
-        
-                var nTd = document.createElement( 'td' );
-                nTd.setAttribute( 'valign', "top" );
-                nTd.colSpan = _fnVisbleColumns( oSettings );
-                nTd.className = oSettings.oClasses.sRowEmpty;
-                nTd.innerHTML = _fnInfoMacros( oSettings, sZero );
-                
-                anRows[ iRowCount ].appendChild( nTd );
-            }
-            
-            /* Header and footer callbacks */
-            _fnCallbackFire( oSettings, 'aoHeaderCallback', 'header', [ $(oSettings.nTHead).children('tr')[0], 
-                _fnGetDataMaster( oSettings ), oSettings._iDisplayStart, oSettings.fnDisplayEnd(), oSettings.aiDisplay ] );
-            
-            _fnCallbackFire( oSettings, 'aoFooterCallback', 'footer', [ $(oSettings.nTFoot).children('tr')[0], 
-                _fnGetDataMaster( oSettings ), oSettings._iDisplayStart, oSettings.fnDisplayEnd(), oSettings.aiDisplay ] );
-            
-            /* 
-             * Need to remove any old row from the display - note we can't just empty the tbody using
-             * $().html('') since this will unbind the jQuery event handlers (even although the node 
-             * still exists!) - equally we can't use innerHTML, since IE throws an exception.
-             */
-            var
-                nAddFrag = document.createDocumentFragment(),
-                nRemoveFrag = document.createDocumentFragment(),
-                nBodyPar, nTrs;
-            
-            if ( oSettings.nTBody )
-            {
-                nBodyPar = oSettings.nTBody.parentNode;
-                nRemoveFrag.appendChild( oSettings.nTBody );
-                
-                /* When doing infinite scrolling, only remove child rows when sorting, filtering or start
-                 * up. When not infinite scroll, always do it.
-                 */
-                if ( !oSettings.oScroll.bInfinite || !oSettings._bInitComplete ||
-                    oSettings.bSorted || oSettings.bFiltered )
-                {
-                    while( (n = oSettings.nTBody.firstChild) )
-                    {
-                        oSettings.nTBody.removeChild( n );
-                    }
-                }
-                
-                /* Put the draw table into the dom */
-                for ( i=0, iLen=anRows.length ; i<iLen ; i++ )
-                {
-                    nAddFrag.appendChild( anRows[i] );
-                }
-                
-                oSettings.nTBody.appendChild( nAddFrag );
-                if ( nBodyPar !== null )
-                {
-                    nBodyPar.appendChild( oSettings.nTBody );
-                }
-            }
-            
-            /* Call all required callback functions for the end of a draw */
-            _fnCallbackFire( oSettings, 'aoDrawCallback', 'draw', [oSettings] );
-            
-            /* Draw is complete, sorting and filtering must be as well */
-            oSettings.bSorted = false;
-            oSettings.bFiltered = false;
-            oSettings.bDrawing = false;
-            
-            if ( oSettings.oFeatures.bServerSide )
-            {
-                _fnProcessingDisplay( oSettings, false );
-                if ( !oSettings._bInitComplete )
-                {
-                    _fnInitComplete( oSettings );
-                }
-            }
-        }
-        
-        
-        /**
-         * Redraw the table - taking account of the various features which are enabled
-         *  @param {object} oSettings dataTables settings object
-         *  @memberof DataTable#oApi
-         */
-        function _fnReDraw( oSettings )
-        {
-            if ( oSettings.oFeatures.bSort )
-            {
-                /* Sorting will refilter and draw for us */
-                _fnSort( oSettings, oSettings.oPreviousSearch );
-            }
-            else if ( oSettings.oFeatures.bFilter )
-            {
-                /* Filtering will redraw for us */
-                _fnFilterComplete( oSettings, oSettings.oPreviousSearch );
-            }
-            else
-            {
-                _fnCalculateEnd( oSettings );
-                _fnDraw( oSettings );
-            }
-        }
-        
-        
-        /**
-         * Add the options to the page HTML for the table
-         *  @param {object} oSettings dataTables settings object
-         *  @memberof DataTable#oApi
-         */
-        function _fnAddOptionsHtml ( oSettings )
-        {
-            /*
-             * Create a temporary, empty, div which we can later on replace with what we have generated
-             * we do it this way to rendering the 'options' html offline - speed :-)
-             */
-            var nHolding = $('<div></div>')[0];
-            oSettings.nTable.parentNode.insertBefore( nHolding, oSettings.nTable );
-            
-            /* 
-             * All DataTables are wrapped in a div
-             */
-            oSettings.nTableWrapper = $('<div id="'+oSettings.sTableId+'_wrapper" class="'+oSettings.oClasses.sWrapper+'" role="grid"></div>')[0];
-            oSettings.nTableReinsertBefore = oSettings.nTable.nextSibling;
-        
-            /* Track where we want to insert the option */
-            var nInsertNode = oSettings.nTableWrapper;
-            
-            /* Loop over the user set positioning and place the elements as needed */
-            var aDom = oSettings.sDom.split('');
-            var nTmp, iPushFeature, cOption, nNewNode, cNext, sAttr, j;
-            for ( var i=0 ; i<aDom.length ; i++ )
-            {
-                iPushFeature = 0;
-                cOption = aDom[i];
-                
-                if ( cOption == '<' )
-                {
-                    /* New container div */
-                    nNewNode = $('<div></div>')[0];
-                    
-                    /* Check to see if we should append an id and/or a class name to the container */
-                    cNext = aDom[i+1];
-                    if ( cNext == "'" || cNext == '"' )
-                    {
-                        sAttr = "";
-                        j = 2;
-                        while ( aDom[i+j] != cNext )
-                        {
-                            sAttr += aDom[i+j];
-                            j++;
-                        }
-                        
-                        /* Replace jQuery UI constants */
-                        if ( sAttr == "H" )
-                        {
-                            sAttr = oSettings.oClasses.sJUIHeader;
-                        }
-                        else if ( sAttr == "F" )
-                        {
-                            sAttr = oSettings.oClasses.sJUIFooter;
-                        }
-                        
-                        /* The attribute can be in the format of "#id.class", "#id" or "class" This logic
-                         * breaks the string into parts and applies them as needed
-                         */
-                        if ( sAttr.indexOf('.') != -1 )
-                        {
-                            var aSplit = sAttr.split('.');
-                            nNewNode.id = aSplit[0].substr(1, aSplit[0].length-1);
-                            nNewNode.className = aSplit[1];
-                        }
-                        else if ( sAttr.charAt(0) == "#" )
-                        {
-                            nNewNode.id = sAttr.substr(1, sAttr.length-1);
-                        }
-                        else
-                        {
-                            nNewNode.className = sAttr;
-                        }
-                        
-                        i += j; /* Move along the position array */
-                    }
-                    
-                    nInsertNode.appendChild( nNewNode );
-                    nInsertNode = nNewNode;
-                }
-                else if ( cOption == '>' )
-                {
-                    /* End container div */
-                    nInsertNode = nInsertNode.parentNode;
-                }
-                else if ( cOption == 'l' && oSettings.oFeatures.bPaginate && oSettings.oFeatures.bLengthChange )
-                {
-                    /* Length */
-                    nTmp = _fnFeatureHtmlLength( oSettings );
-                    iPushFeature = 1;
-                }
-                else if ( cOption == 'f' && oSettings.oFeatures.bFilter )
-                {
-                    /* Filter */
-                    nTmp = _fnFeatureHtmlFilter( oSettings );
-                    iPushFeature = 1;
-                }
-                else if ( cOption == 'r' && oSettings.oFeatures.bProcessing )
-                {
-                    /* pRocessing */
-                    nTmp = _fnFeatureHtmlProcessing( oSettings );
-                    iPushFeature = 1;
-                }
-                else if ( cOption == 't' )
-                {
-                    /* Table */
-                    nTmp = _fnFeatureHtmlTable( oSettings );
-                    iPushFeature = 1;
-                }
-                else if ( cOption ==  'i' && oSettings.oFeatures.bInfo )
-                {
-                    /* Info */
-                    nTmp = _fnFeatureHtmlInfo( oSettings );
-                    iPushFeature = 1;
-                }
-                else if ( cOption == 'p' && oSettings.oFeatures.bPaginate )
-                {
-                    /* Pagination */
-                    nTmp = _fnFeatureHtmlPaginate( oSettings );
-                    iPushFeature = 1;
-                }
-                else if ( DataTable.ext.aoFeatures.length !== 0 )
-                {
-                    /* Plug-in features */
-                    var aoFeatures = DataTable.ext.aoFeatures;
-                    for ( var k=0, kLen=aoFeatures.length ; k<kLen ; k++ )
-                    {
-                        if ( cOption == aoFeatures[k].cFeature )
-                        {
-                            nTmp = aoFeatures[k].fnInit( oSettings );
-                            if ( nTmp )
-                            {
-                                iPushFeature = 1;
-                            }
-                            break;
-                        }
-                    }
-                }
-                
-                /* Add to the 2D features array */
-                if ( iPushFeature == 1 && nTmp !== null )
-                {
-                    if ( typeof oSettings.aanFeatures[cOption] !== 'object' )
-                    {
-                        oSettings.aanFeatures[cOption] = [];
-                    }
-                    oSettings.aanFeatures[cOption].push( nTmp );
-                    nInsertNode.appendChild( nTmp );
-                }
-            }
-            
-            /* Built our DOM structure - replace the holding div with what we want */
-            nHolding.parentNode.replaceChild( oSettings.nTableWrapper, nHolding );
-        }
-        
-        
-        /**
-         * Use the DOM source to create up an array of header cells. The idea here is to
-         * create a layout grid (array) of rows x columns, which contains a reference
-         * to the cell that that point in the grid (regardless of col/rowspan), such that
-         * any column / row could be removed and the new grid constructed
-         *  @param array {object} aLayout Array to store the calculated layout in
-         *  @param {node} nThead The header/footer element for the table
-         *  @memberof DataTable#oApi
-         */
-        function _fnDetectHeader ( aLayout, nThead )
-        {
-            var nTrs = $(nThead).children('tr');
-            var nTr, nCell;
-            var i, k, l, iLen, jLen, iColShifted, iColumn, iColspan, iRowspan;
-            var bUnique;
-            var fnShiftCol = function ( a, i, j ) {
-                var k = a[i];
-                        while ( k[j] ) {
-                    j++;
-                }
-                return j;
-            };
-        
-            aLayout.splice( 0, aLayout.length );
-            
-            /* We know how many rows there are in the layout - so prep it */
-            for ( i=0, iLen=nTrs.length ; i<iLen ; i++ )
-            {
-                aLayout.push( [] );
-            }
-            
-            /* Calculate a layout array */
-            for ( i=0, iLen=nTrs.length ; i<iLen ; i++ )
-            {
-                nTr = nTrs[i];
-                iColumn = 0;
-                
-                /* For every cell in the row... */
-                nCell = nTr.firstChild;
-                while ( nCell ) {
-                    if ( nCell.nodeName.toUpperCase() == "TD" ||
-                         nCell.nodeName.toUpperCase() == "TH" )
-                    {
-                        /* Get the col and rowspan attributes from the DOM and sanitise them */
-                        iColspan = nCell.getAttribute('colspan') * 1;
-                        iRowspan = nCell.getAttribute('rowspan') * 1;
-                        iColspan = (!iColspan || iColspan===0 || iColspan===1) ? 1 : iColspan;
-                        iRowspan = (!iRowspan || iRowspan===0 || iRowspan===1) ? 1 : iRowspan;
-        
-                        /* There might be colspan cells already in this row, so shift our target 
-                         * accordingly
-                         */
-                        iColShifted = fnShiftCol( aLayout, i, iColumn );
-                        
-                        /* Cache calculation for unique columns */
-                        bUnique = iColspan === 1 ? true : false;
-                        
-                        /* If there is col / rowspan, copy the information into the layout grid */
-                        for ( l=0 ; l<iColspan ; l++ )
-                        {
-                            for ( k=0 ; k<iRowspan ; k++ )
-                            {
-                                aLayout[i+k][iColShifted+l] = {
-                                    "cell": nCell,
-                                    "unique": bUnique
-                                };
-                                aLayout[i+k].nTr = nTr;
-                            }
-                        }
-                    }
-                    nCell = nCell.nextSibling;
-                }
-            }
-        }
-        
-        
-        /**
-         * Get an array of unique th elements, one for each column
-         *  @param {object} oSettings dataTables settings object
-         *  @param {node} nHeader automatically detect the layout from this node - optional
-         *  @param {array} aLayout thead/tfoot layout from _fnDetectHeader - optional
-         *  @returns array {node} aReturn list of unique th's
-         *  @memberof DataTable#oApi
-         */
-        function _fnGetUniqueThs ( oSettings, nHeader, aLayout )
-        {
-            var aReturn = [];
-            if ( !aLayout )
-            {
-                aLayout = oSettings.aoHeader;
-                if ( nHeader )
-                {
-                    aLayout = [];
-                    _fnDetectHeader( aLayout, nHeader );
-                }
-            }
-        
-            for ( var i=0, iLen=aLayout.length ; i<iLen ; i++ )
-            {
-                for ( var j=0, jLen=aLayout[i].length ; j<jLen ; j++ )
-                {
-                    if ( aLayout[i][j].unique && 
-                         (!aReturn[j] || !oSettings.bSortCellsTop) )
-                    {
-                        aReturn[j] = aLayout[i][j].cell;
-                    }
-                }
-            }
-            
-            return aReturn;
-        }
-        
-        
-        
-        /**
-         * Update the table using an Ajax call
-         *  @param {object} oSettings dataTables settings object
-         *  @returns {boolean} Block the table drawing or not
-         *  @memberof DataTable#oApi
-         */
-        function _fnAjaxUpdate( oSettings )
-        {
-            if ( oSettings.bAjaxDataGet )
-            {
-                oSettings.iDraw++;
-                _fnProcessingDisplay( oSettings, true );
-                var iColumns = oSettings.aoColumns.length;
-                var aoData = _fnAjaxParameters( oSettings );
-                _fnServerParams( oSettings, aoData );
-                
-                oSettings.fnServerData.call( oSettings.oInstance, oSettings.sAjaxSource, aoData,
-                    function(json) {
-                        _fnAjaxUpdateDraw( oSettings, json );
-                    }, oSettings );
-                return false;
-            }
-            else
-            {
-                return true;
-            }
-        }
-        
-        
-        /**
-         * Build up the parameters in an object needed for a server-side processing request
-         *  @param {object} oSettings dataTables settings object
-         *  @returns {bool} block the table drawing or not
-         *  @memberof DataTable#oApi
-         */
-        function _fnAjaxParameters( oSettings )
-        {
-            var iColumns = oSettings.aoColumns.length;
-            var aoData = [], mDataProp, aaSort, aDataSort;
-            var i, j;
-            
-            aoData.push( { "name": "sEcho",          "value": oSettings.iDraw } );
-            aoData.push( { "name": "iColumns",       "value": iColumns } );
-            aoData.push( { "name": "sColumns",       "value": _fnColumnOrdering(oSettings) } );
-            aoData.push( { "name": "iDisplayStart",  "value": oSettings._iDisplayStart } );
-            aoData.push( { "name": "iDisplayLength", "value": oSettings.oFeatures.bPaginate !== false ?
-                oSettings._iDisplayLength : -1 } );
-                
-            for ( i=0 ; i<iColumns ; i++ )
-            {
-              mDataProp = oSettings.aoColumns[i].mData;
-                aoData.push( { "name": "mDataProp_"+i, "value": typeof(mDataProp)==="function" ? 'function' : mDataProp } );
-            }
-            
-            /* Filtering */
-            if ( oSettings.oFeatures.bFilter !== false )
-            {
-                aoData.push( { "name": "sSearch", "value": oSettings.oPreviousSearch.sSearch } );
-                aoData.push( { "name": "bRegex",  "value": oSettings.oPreviousSearch.bRegex } );
-                for ( i=0 ; i<iColumns ; i++ )
-                {
-                    aoData.push( { "name": "sSearch_"+i,     "value": oSettings.aoPreSearchCols[i].sSearch } );
-                    aoData.push( { "name": "bRegex_"+i,      "value": oSettings.aoPreSearchCols[i].bRegex } );
-                    aoData.push( { "name": "bSearchable_"+i, "value": oSettings.aoColumns[i].bSearchable } );
-                }
-            }
-            
-            /* Sorting */
-            if ( oSettings.oFeatures.bSort !== false )
-            {
-                var iCounter = 0;
-        
-                aaSort = ( oSettings.aaSortingFixed !== null ) ?
-                    oSettings.aaSortingFixed.concat( oSettings.aaSorting ) :
-                    oSettings.aaSorting.slice();
-                
-                for ( i=0 ; i<aaSort.length ; i++ )
-                {
-                    aDataSort = oSettings.aoColumns[ aaSort[i][0] ].aDataSort;
-                    
-                    for ( j=0 ; j<aDataSort.length ; j++ )
-                    {
-                        aoData.push( { "name": "iSortCol_"+iCounter,  "value": aDataSort[j] } );
-                        aoData.push( { "name": "sSortDir_"+iCounter,  "value": aaSort[i][1] } );
-                        iCounter++;
-                    }
-                }
-                aoData.push( { "name": "iSortingCols",   "value": iCounter } );
-                
-                for ( i=0 ; i<iColumns ; i++ )
-                {
-                    aoData.push( { "name": "bSortable_"+i,  "value": oSettings.aoColumns[i].bSortable } );
-                }
-            }
-            
-            return aoData;
-        }
-        
-        
-        /**
-         * Add Ajax parameters from plug-ins
-         *  @param {object} oSettings dataTables settings object
-         *  @param array {objects} aoData name/value pairs to send to the server
-         *  @memberof DataTable#oApi
-         */
-        function _fnServerParams( oSettings, aoData )
-        {
-            _fnCallbackFire( oSettings, 'aoServerParams', 'serverParams', [aoData] );
-        }
-        
-        
-        /**
-         * Data the data from the server (nuking the old) and redraw the table
-         *  @param {object} oSettings dataTables settings object
-         *  @param {object} json json data return from the server.
-         *  @param {string} json.sEcho Tracking flag for DataTables to match requests
-         *  @param {int} json.iTotalRecords Number of records in the data set, not accounting for filtering
-         *  @param {int} json.iTotalDisplayRecords Number of records in the data set, accounting for filtering
-         *  @param {array} json.aaData The data to display on this page
-         *  @param {string} [json.sColumns] Column ordering (sName, comma separated)
-         *  @memberof DataTable#oApi
-         */
-        function _fnAjaxUpdateDraw ( oSettings, json )
-        {
-            if ( json.sEcho !== undefined )
-            {
-                /* Protect against old returns over-writing a new one. Possible when you get
-                 * very fast interaction, and later queries are completed much faster
-                 */
-                if ( json.sEcho*1 < oSettings.iDraw )
-                {
-                    return;
-                }
-                else
-                {
-                    oSettings.iDraw = json.sEcho * 1;
-                }
-            }
-            
-            if ( !oSettings.oScroll.bInfinite ||
-                   (oSettings.oScroll.bInfinite && (oSettings.bSorted || oSettings.bFiltered)) )
-            {
-                _fnClearTable( oSettings );
-            }
-            oSettings._iRecordsTotal = parseInt(json.iTotalRecords, 10);
-            oSettings._iRecordsDisplay = parseInt(json.iTotalDisplayRecords, 10);
-            
-            /* Determine if reordering is required */
-            var sOrdering = _fnColumnOrdering(oSettings);
-            var bReOrder = (json.sColumns !== undefined && sOrdering !== "" && json.sColumns != sOrdering );
-            var aiIndex;
-            if ( bReOrder )
-            {
-                aiIndex = _fnReOrderIndex( oSettings, json.sColumns );
-            }
-            
-            var aData = _fnGetObjectDataFn( oSettings.sAjaxDataProp )( json );
-            for ( var i=0, iLen=aData.length ; i<iLen ; i++ )
-            {
-                if ( bReOrder )
-                {
-                    /* If we need to re-order, then create a new array with the correct order and add it */
-                    var aDataSorted = [];
-                    for ( var j=0, jLen=oSettings.aoColumns.length ; j<jLen ; j++ )
-                    {
-                        aDataSorted.push( aData[i][ aiIndex[j] ] );
-                    }
-                    _fnAddData( oSettings, aDataSorted );
-                }
-                else
-                {
-                    /* No re-order required, sever got it "right" - just straight add */
-                    _fnAddData( oSettings, aData[i] );
-                }
-            }
-            oSettings.aiDisplay = oSettings.aiDisplayMaster.slice();
-            
-            oSettings.bAjaxDataGet = false;
-            _fnDraw( oSettings );
-            oSettings.bAjaxDataGet = true;
-            _fnProcessingDisplay( oSettings, false );
-        }
-        
-        
-        
-        /**
-         * Generate the node required for filtering text
-         *  @returns {node} Filter control element
-         *  @param {object} oSettings dataTables settings object
-         *  @memberof DataTable#oApi
-         */
-        function _fnFeatureHtmlFilter ( oSettings )
-        {
-            var oPreviousSearch = oSettings.oPreviousSearch;
-            
-            var sSearchStr = oSettings.oLanguage.sSearch;
-            sSearchStr = (sSearchStr.indexOf('_INPUT_') !== -1) ?
-              sSearchStr.replace('_INPUT_', '<input type="text" />') :
-              sSearchStr==="" ? '<input type="text" />' : sSearchStr+' <input type="text" />';
-            
-            var nFilter = document.createElement( 'div' );
-            nFilter.className = oSettings.oClasses.sFilter;
-            nFilter.innerHTML = '<label>'+sSearchStr+'</label>';
-            if ( !oSettings.aanFeatures.f )
-            {
-                nFilter.id = oSettings.sTableId+'_filter';
-            }
-            
-            var jqFilter = $('input[type="text"]', nFilter);
-        
-            // Store a reference to the input element, so other input elements could be
-            // added to the filter wrapper if needed (submit button for example)
-            nFilter._DT_Input = jqFilter[0];
-        
-            jqFilter.val( oPreviousSearch.sSearch.replace('"','&quot;') );
-            jqFilter.bind( 'keyup.DT', function(e) {
-                /* Update all other filter input elements for the new display */
-                var n = oSett

<TRUNCATED>

[23/51] [abbrv] [partial] brooklyn-ui git commit: move subdir from incubator up a level as it is promoted to its own repo (first non-incubator commit!)

Posted by he...@apache.org.
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/swagger-ui/lib/underscore-min.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/swagger-ui/lib/underscore-min.js b/brooklyn-ui/src/main/webapp/assets/swagger-ui/lib/underscore-min.js
deleted file mode 100644
index a2ffab9..0000000
--- a/brooklyn-ui/src/main/webapp/assets/swagger-ui/lib/underscore-min.js
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-//     Underscore.js 1.7.0
-//     http://underscorejs.org
-//     (c) 2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
-//     Underscore may be freely distributed under the MIT license.
-(function(){var n=this,t=n._,r=Array.prototype,e=Object.prototype,u=Function.prototype,i=r.push,a=r.slice,o=r.concat,l=e.toString,c=e.hasOwnProperty,f=Array.isArray,s=Object.keys,p=u.bind,h=function(n){return n instanceof h?n:this instanceof h?void(this._wrapped=n):new h(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=h),exports._=h):n._=h,h.VERSION="1.7.0";var g=function(n,t,r){if(t===void 0)return n;switch(null==r?3:r){case 1:return function(r){return n.call(t,r)};case 2:return function(r,e){return n.call(t,r,e)};case 3:return function(r,e,u){return n.call(t,r,e,u)};case 4:return function(r,e,u,i){return n.call(t,r,e,u,i)}}return function(){return n.apply(t,arguments)}};h.iteratee=function(n,t,r){return null==n?h.identity:h.isFunction(n)?g(n,t,r):h.isObject(n)?h.matches(n):h.property(n)},h.each=h.forEach=function(n,t,r){if(null==n)return n;t=g(t,r);var e,u=n.length;if(u===+u)for(e=0;u>e;e++)t(n[e],e,n);else{var i=h.keys(n);for(e
 =0,u=i.length;u>e;e++)t(n[i[e]],i[e],n)}return n},h.map=h.collect=function(n,t,r){if(null==n)return[];t=h.iteratee(t,r);for(var e,u=n.length!==+n.length&&h.keys(n),i=(u||n).length,a=Array(i),o=0;i>o;o++)e=u?u[o]:o,a[o]=t(n[e],e,n);return a};var v="Reduce of empty array with no initial value";h.reduce=h.foldl=h.inject=function(n,t,r,e){null==n&&(n=[]),t=g(t,e,4);var u,i=n.length!==+n.length&&h.keys(n),a=(i||n).length,o=0;if(arguments.length<3){if(!a)throw new TypeError(v);r=n[i?i[o++]:o++]}for(;a>o;o++)u=i?i[o]:o,r=t(r,n[u],u,n);return r},h.reduceRight=h.foldr=function(n,t,r,e){null==n&&(n=[]),t=g(t,e,4);var u,i=n.length!==+n.length&&h.keys(n),a=(i||n).length;if(arguments.length<3){if(!a)throw new TypeError(v);r=n[i?i[--a]:--a]}for(;a--;)u=i?i[a]:a,r=t(r,n[u],u,n);return r},h.find=h.detect=function(n,t,r){var e;return t=h.iteratee(t,r),h.some(n,function(n,r,u){return t(n,r,u)?(e=n,!0):void 0}),e},h.filter=h.select=function(n,t,r){var e=[];return null==n?e:(t=h.iteratee(t,r),h.each(n,
 function(n,r,u){t(n,r,u)&&e.push(n)}),e)},h.reject=function(n,t,r){return h.filter(n,h.negate(h.iteratee(t)),r)},h.every=h.all=function(n,t,r){if(null==n)return!0;t=h.iteratee(t,r);var e,u,i=n.length!==+n.length&&h.keys(n),a=(i||n).length;for(e=0;a>e;e++)if(u=i?i[e]:e,!t(n[u],u,n))return!1;return!0},h.some=h.any=function(n,t,r){if(null==n)return!1;t=h.iteratee(t,r);var e,u,i=n.length!==+n.length&&h.keys(n),a=(i||n).length;for(e=0;a>e;e++)if(u=i?i[e]:e,t(n[u],u,n))return!0;return!1},h.contains=h.include=function(n,t){return null==n?!1:(n.length!==+n.length&&(n=h.values(n)),h.indexOf(n,t)>=0)},h.invoke=function(n,t){var r=a.call(arguments,2),e=h.isFunction(t);return h.map(n,function(n){return(e?t:n[t]).apply(n,r)})},h.pluck=function(n,t){return h.map(n,h.property(t))},h.where=function(n,t){return h.filter(n,h.matches(t))},h.findWhere=function(n,t){return h.find(n,h.matches(t))},h.max=function(n,t,r){var e,u,i=-1/0,a=-1/0;if(null==t&&null!=n){n=n.length===+n.length?n:h.values(n);for(va
 r o=0,l=n.length;l>o;o++)e=n[o],e>i&&(i=e)}else t=h.iteratee(t,r),h.each(n,function(n,r,e){u=t(n,r,e),(u>a||u===-1/0&&i===-1/0)&&(i=n,a=u)});return i},h.min=function(n,t,r){var e,u,i=1/0,a=1/0;if(null==t&&null!=n){n=n.length===+n.length?n:h.values(n);for(var o=0,l=n.length;l>o;o++)e=n[o],i>e&&(i=e)}else t=h.iteratee(t,r),h.each(n,function(n,r,e){u=t(n,r,e),(a>u||1/0===u&&1/0===i)&&(i=n,a=u)});return i},h.shuffle=function(n){for(var t,r=n&&n.length===+n.length?n:h.values(n),e=r.length,u=Array(e),i=0;e>i;i++)t=h.random(0,i),t!==i&&(u[i]=u[t]),u[t]=r[i];return u},h.sample=function(n,t,r){return null==t||r?(n.length!==+n.length&&(n=h.values(n)),n[h.random(n.length-1)]):h.shuffle(n).slice(0,Math.max(0,t))},h.sortBy=function(n,t,r){return t=h.iteratee(t,r),h.pluck(h.map(n,function(n,r,e){return{value:n,index:r,criteria:t(n,r,e)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(r>e||r===void 0)return 1;if(e>r||e===void 0)return-1}return n.index-t.index}),"value")};var m=func
 tion(n){return function(t,r,e){var u={};return r=h.iteratee(r,e),h.each(t,function(e,i){var a=r(e,i,t);n(u,e,a)}),u}};h.groupBy=m(function(n,t,r){h.has(n,r)?n[r].push(t):n[r]=[t]}),h.indexBy=m(function(n,t,r){n[r]=t}),h.countBy=m(function(n,t,r){h.has(n,r)?n[r]++:n[r]=1}),h.sortedIndex=function(n,t,r,e){r=h.iteratee(r,e,1);for(var u=r(t),i=0,a=n.length;a>i;){var o=i+a>>>1;r(n[o])<u?i=o+1:a=o}return i},h.toArray=function(n){return n?h.isArray(n)?a.call(n):n.length===+n.length?h.map(n,h.identity):h.values(n):[]},h.size=function(n){return null==n?0:n.length===+n.length?n.length:h.keys(n).length},h.partition=function(n,t,r){t=h.iteratee(t,r);var e=[],u=[];return h.each(n,function(n,r,i){(t(n,r,i)?e:u).push(n)}),[e,u]},h.first=h.head=h.take=function(n,t,r){return null==n?void 0:null==t||r?n[0]:0>t?[]:a.call(n,0,t)},h.initial=function(n,t,r){return a.call(n,0,Math.max(0,n.length-(null==t||r?1:t)))},h.last=function(n,t,r){return null==n?void 0:null==t||r?n[n.length-1]:a.call(n,Math.max(n.l
 ength-t,0))},h.rest=h.tail=h.drop=function(n,t,r){return a.call(n,null==t||r?1:t)},h.compact=function(n){return h.filter(n,h.identity)};var y=function(n,t,r,e){if(t&&h.every(n,h.isArray))return o.apply(e,n);for(var u=0,a=n.length;a>u;u++){var l=n[u];h.isArray(l)||h.isArguments(l)?t?i.apply(e,l):y(l,t,r,e):r||e.push(l)}return e};h.flatten=function(n,t){return y(n,t,!1,[])},h.without=function(n){return h.difference(n,a.call(arguments,1))},h.uniq=h.unique=function(n,t,r,e){if(null==n)return[];h.isBoolean(t)||(e=r,r=t,t=!1),null!=r&&(r=h.iteratee(r,e));for(var u=[],i=[],a=0,o=n.length;o>a;a++){var l=n[a];if(t)a&&i===l||u.push(l),i=l;else if(r){var c=r(l,a,n);h.indexOf(i,c)<0&&(i.push(c),u.push(l))}else h.indexOf(u,l)<0&&u.push(l)}return u},h.union=function(){return h.uniq(y(arguments,!0,!0,[]))},h.intersection=function(n){if(null==n)return[];for(var t=[],r=arguments.length,e=0,u=n.length;u>e;e++){var i=n[e];if(!h.contains(t,i)){for(var a=1;r>a&&h.contains(arguments[a],i);a++);a===r&&t.p
 ush(i)}}return t},h.difference=function(n){var t=y(a.call(arguments,1),!0,!0,[]);return h.filter(n,function(n){return!h.contains(t,n)})},h.zip=function(n){if(null==n)return[];for(var t=h.max(arguments,"length").length,r=Array(t),e=0;t>e;e++)r[e]=h.pluck(arguments,e);return r},h.object=function(n,t){if(null==n)return{};for(var r={},e=0,u=n.length;u>e;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},h.indexOf=function(n,t,r){if(null==n)return-1;var e=0,u=n.length;if(r){if("number"!=typeof r)return e=h.sortedIndex(n,t),n[e]===t?e:-1;e=0>r?Math.max(0,u+r):r}for(;u>e;e++)if(n[e]===t)return e;return-1},h.lastIndexOf=function(n,t,r){if(null==n)return-1;var e=n.length;for("number"==typeof r&&(e=0>r?e+r+1:Math.min(e,r+1));--e>=0;)if(n[e]===t)return e;return-1},h.range=function(n,t,r){arguments.length<=1&&(t=n||0,n=0),r=r||1;for(var e=Math.max(Math.ceil((t-n)/r),0),u=Array(e),i=0;e>i;i++,n+=r)u[i]=n;return u};var d=function(){};h.bind=function(n,t){var r,e;if(p&&n.bind===p)return p.apply(n,a.c
 all(arguments,1));if(!h.isFunction(n))throw new TypeError("Bind must be called on a function");return r=a.call(arguments,2),e=function(){if(!(this instanceof e))return n.apply(t,r.concat(a.call(arguments)));d.prototype=n.prototype;var u=new d;d.prototype=null;var i=n.apply(u,r.concat(a.call(arguments)));return h.isObject(i)?i:u}},h.partial=function(n){var t=a.call(arguments,1);return function(){for(var r=0,e=t.slice(),u=0,i=e.length;i>u;u++)e[u]===h&&(e[u]=arguments[r++]);for(;r<arguments.length;)e.push(arguments[r++]);return n.apply(this,e)}},h.bindAll=function(n){var t,r,e=arguments.length;if(1>=e)throw new Error("bindAll must be passed function names");for(t=1;e>t;t++)r=arguments[t],n[r]=h.bind(n[r],n);return n},h.memoize=function(n,t){var r=function(e){var u=r.cache,i=t?t.apply(this,arguments):e;return h.has(u,i)||(u[i]=n.apply(this,arguments)),u[i]};return r.cache={},r},h.delay=function(n,t){var r=a.call(arguments,2);return setTimeout(function(){return n.apply(null,r)},t)},h.de
 fer=function(n){return h.delay.apply(h,[n,1].concat(a.call(arguments,1)))},h.throttle=function(n,t,r){var e,u,i,a=null,o=0;r||(r={});var l=function(){o=r.leading===!1?0:h.now(),a=null,i=n.apply(e,u),a||(e=u=null)};return function(){var c=h.now();o||r.leading!==!1||(o=c);var f=t-(c-o);return e=this,u=arguments,0>=f||f>t?(clearTimeout(a),a=null,o=c,i=n.apply(e,u),a||(e=u=null)):a||r.trailing===!1||(a=setTimeout(l,f)),i}},h.debounce=function(n,t,r){var e,u,i,a,o,l=function(){var c=h.now()-a;t>c&&c>0?e=setTimeout(l,t-c):(e=null,r||(o=n.apply(i,u),e||(i=u=null)))};return function(){i=this,u=arguments,a=h.now();var c=r&&!e;return e||(e=setTimeout(l,t)),c&&(o=n.apply(i,u),i=u=null),o}},h.wrap=function(n,t){return h.partial(t,n)},h.negate=function(n){return function(){return!n.apply(this,arguments)}},h.compose=function(){var n=arguments,t=n.length-1;return function(){for(var r=t,e=n[t].apply(this,arguments);r--;)e=n[r].call(this,e);return e}},h.after=function(n,t){return function(){return--
 n<1?t.apply(this,arguments):void 0}},h.before=function(n,t){var r;return function(){return--n>0?r=t.apply(this,arguments):t=null,r}},h.once=h.partial(h.before,2),h.keys=function(n){if(!h.isObject(n))return[];if(s)return s(n);var t=[];for(var r in n)h.has(n,r)&&t.push(r);return t},h.values=function(n){for(var t=h.keys(n),r=t.length,e=Array(r),u=0;r>u;u++)e[u]=n[t[u]];return e},h.pairs=function(n){for(var t=h.keys(n),r=t.length,e=Array(r),u=0;r>u;u++)e[u]=[t[u],n[t[u]]];return e},h.invert=function(n){for(var t={},r=h.keys(n),e=0,u=r.length;u>e;e++)t[n[r[e]]]=r[e];return t},h.functions=h.methods=function(n){var t=[];for(var r in n)h.isFunction(n[r])&&t.push(r);return t.sort()},h.extend=function(n){if(!h.isObject(n))return n;for(var t,r,e=1,u=arguments.length;u>e;e++){t=arguments[e];for(r in t)c.call(t,r)&&(n[r]=t[r])}return n},h.pick=function(n,t,r){var e,u={};if(null==n)return u;if(h.isFunction(t)){t=g(t,r);for(e in n){var i=n[e];t(i,e,n)&&(u[e]=i)}}else{var l=o.apply([],a.call(argume
 nts,1));n=new Object(n);for(var c=0,f=l.length;f>c;c++)e=l[c],e in n&&(u[e]=n[e])}return u},h.omit=function(n,t,r){if(h.isFunction(t))t=h.negate(t);else{var e=h.map(o.apply([],a.call(arguments,1)),String);t=function(n,t){return!h.contains(e,t)}}return h.pick(n,t,r)},h.defaults=function(n){if(!h.isObject(n))return n;for(var t=1,r=arguments.length;r>t;t++){var e=arguments[t];for(var u in e)n[u]===void 0&&(n[u]=e[u])}return n},h.clone=function(n){return h.isObject(n)?h.isArray(n)?n.slice():h.extend({},n):n},h.tap=function(n,t){return t(n),n};var b=function(n,t,r,e){if(n===t)return 0!==n||1/n===1/t;if(null==n||null==t)return n===t;n instanceof h&&(n=n._wrapped),t instanceof h&&(t=t._wrapped);var u=l.call(n);if(u!==l.call(t))return!1;switch(u){case"[object RegExp]":case"[object String]":return""+n==""+t;case"[object Number]":return+n!==+n?+t!==+t:0===+n?1/+n===1/t:+n===+t;case"[object Date]":case"[object Boolean]":return+n===+t}if("object"!=typeof n||"object"!=typeof t)return!1;for(var i
 =r.length;i--;)if(r[i]===n)return e[i]===t;var a=n.constructor,o=t.constructor;if(a!==o&&"constructor"in n&&"constructor"in t&&!(h.isFunction(a)&&a instanceof a&&h.isFunction(o)&&o instanceof o))return!1;r.push(n),e.push(t);var c,f;if("[object Array]"===u){if(c=n.length,f=c===t.length)for(;c--&&(f=b(n[c],t[c],r,e)););}else{var s,p=h.keys(n);if(c=p.length,f=h.keys(t).length===c)for(;c--&&(s=p[c],f=h.has(t,s)&&b(n[s],t[s],r,e)););}return r.pop(),e.pop(),f};h.isEqual=function(n,t){return b(n,t,[],[])},h.isEmpty=function(n){if(null==n)return!0;if(h.isArray(n)||h.isString(n)||h.isArguments(n))return 0===n.length;for(var t in n)if(h.has(n,t))return!1;return!0},h.isElement=function(n){return!(!n||1!==n.nodeType)},h.isArray=f||function(n){return"[object Array]"===l.call(n)},h.isObject=function(n){var t=typeof n;return"function"===t||"object"===t&&!!n},h.each(["Arguments","Function","String","Number","Date","RegExp"],function(n){h["is"+n]=function(t){return l.call(t)==="[object "+n+"]"}}),h.
 isArguments(arguments)||(h.isArguments=function(n){return h.has(n,"callee")}),"function"!=typeof/./&&(h.isFunction=function(n){return"function"==typeof n||!1}),h.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},h.isNaN=function(n){return h.isNumber(n)&&n!==+n},h.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"===l.call(n)},h.isNull=function(n){return null===n},h.isUndefined=function(n){return n===void 0},h.has=function(n,t){return null!=n&&c.call(n,t)},h.noConflict=function(){return n._=t,this},h.identity=function(n){return n},h.constant=function(n){return function(){return n}},h.noop=function(){},h.property=function(n){return function(t){return t[n]}},h.matches=function(n){var t=h.pairs(n),r=t.length;return function(n){if(null==n)return!r;n=new Object(n);for(var e=0;r>e;e++){var u=t[e],i=u[0];if(u[1]!==n[i]||!(i in n))return!1}return!0}},h.times=function(n,t,r){var e=Array(Math.max(0,n));t=g(t,r,1);for(var u=0;n>u;u++)e[u]=t(u);return e},h.random=funct
 ion(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))},h.now=Date.now||function(){return(new Date).getTime()};var _={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},w=h.invert(_),j=function(n){var t=function(t){return n[t]},r="(?:"+h.keys(n).join("|")+")",e=RegExp(r),u=RegExp(r,"g");return function(n){return n=null==n?"":""+n,e.test(n)?n.replace(u,t):n}};h.escape=j(_),h.unescape=j(w),h.result=function(n,t){if(null==n)return void 0;var r=n[t];return h.isFunction(r)?n[t]():r};var x=0;h.uniqueId=function(n){var t=++x+"";return n?n+t:t},h.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var A=/(.)^/,k={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},O=/\\|'|\r|\n|\u2028|\u2029/g,F=function(n){return"\\"+k[n]};h.template=function(n,t,r){!t&&r&&(t=r),t=h.defaults({},t,h.templateSettings);var e=RegExp([(t.escape||A).source,(t.interpolate||A).source,(t.evaluate||A).source]
 .join("|")+"|$","g"),u=0,i="__p+='";n.replace(e,function(t,r,e,a,o){return i+=n.slice(u,o).replace(O,F),u=o+t.length,r?i+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'":e?i+="'+\n((__t=("+e+"))==null?'':__t)+\n'":a&&(i+="';\n"+a+"\n__p+='"),t}),i+="';\n",t.variable||(i="with(obj||{}){\n"+i+"}\n"),i="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+i+"return __p;\n";try{var a=new Function(t.variable||"obj","_",i)}catch(o){throw o.source=i,o}var l=function(n){return a.call(this,n,h)},c=t.variable||"obj";return l.source="function("+c+"){\n"+i+"}",l},h.chain=function(n){var t=h(n);return t._chain=!0,t};var E=function(n){return this._chain?h(n).chain():n};h.mixin=function(n){h.each(h.functions(n),function(t){var r=h[t]=n[t];h.prototype[t]=function(){var n=[this._wrapped];return i.apply(n,arguments),E.call(this,r.apply(h,n))}})},h.mixin(h),h.each(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=r[n];h.prototype[n]=
 function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!==n&&"splice"!==n||0!==r.length||delete r[0],E.call(this,r)}}),h.each(["concat","join","slice"],function(n){var t=r[n];h.prototype[n]=function(){return E.call(this,t.apply(this._wrapped,arguments))}}),h.prototype.value=function(){return this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return h})}).call(this);
-//# sourceMappingURL=underscore-min.map
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/swagger-ui/lib/underscore-min.map
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/swagger-ui/lib/underscore-min.map b/brooklyn-ui/src/main/webapp/assets/swagger-ui/lib/underscore-min.map
deleted file mode 100644
index b31e435..0000000
--- a/brooklyn-ui/src/main/webapp/assets/swagger-ui/lib/underscore-min.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"underscore-min.js","sources":["underscore.js"],"names":["createReduce","dir","iterator","obj","iteratee","memo","keys","index","length","currentKey","context","optimizeCb","isArrayLike","_","arguments","createIndexFinder","array","predicate","cb","collectNonEnumProps","nonEnumIdx","nonEnumerableProps","constructor","proto","isFunction","prototype","ObjProto","prop","has","contains","push","root","this","previousUnderscore","ArrayProto","Array","Object","FuncProto","Function","slice","toString","hasOwnProperty","nativeIsArray","isArray","nativeKeys","nativeBind","bind","nativeCreate","create","Ctor","_wrapped","exports","module","VERSION","func","argCount","value","call","other","collection","accumulator","apply","identity","isObject","matcher","property","Infinity","createAssigner","keysFunc","undefinedOnly","source","l","i","key","baseCreate","result","MAX_ARRAY_INDEX","Math","pow","each","forEach","map","collect","results","reduce","foldl","inject","reduceRigh
 t","foldr","find","detect","findIndex","findKey","filter","select","list","reject","negate","every","all","some","any","includes","include","target","fromIndex","values","indexOf","invoke","method","args","isFunc","pluck","where","attrs","findWhere","max","computed","lastComputed","min","shuffle","rand","set","shuffled","random","sample","n","guard","sortBy","criteria","sort","left","right","a","b","group","behavior","groupBy","indexBy","countBy","toArray","size","partition","pass","fail","first","head","take","initial","last","rest","tail","drop","compact","flatten","input","shallow","strict","startIndex","output","idx","isArguments","j","len","without","difference","uniq","unique","isSorted","isBoolean","seen","union","intersection","argsLength","item","zip","unzip","object","sortedIndex","isNaN","lastIndexOf","from","findLastIndex","low","high","mid","floor","range","start","stop","step","ceil","executeBound","sourceFunc","boundFunc","callingContext","self","TypeError","bound","c
 oncat","partial","boundArgs","position","bindAll","Error","memoize","hasher","cache","address","delay","wait","setTimeout","defer","throttle","options","timeout","previous","later","leading","now","remaining","clearTimeout","trailing","debounce","immediate","timestamp","callNow","wrap","wrapper","compose","after","times","before","once","hasEnumBug","propertyIsEnumerable","allKeys","mapObject","pairs","invert","functions","methods","names","extend","extendOwn","assign","pick","oiteratee","omit","String","defaults","clone","tap","interceptor","isMatch","eq","aStack","bStack","className","areArrays","aCtor","bCtor","pop","isEqual","isEmpty","isString","isElement","nodeType","type","name","Int8Array","isFinite","parseFloat","isNumber","isNull","isUndefined","noConflict","constant","noop","propertyOf","matches","accum","Date","getTime","escapeMap","&","<",">","\"","'","`","unescapeMap","createEscaper","escaper","match","join","testRegexp","RegExp","replaceRegexp","string","test","replac
 e","escape","unescape","fallback","idCounter","uniqueId","prefix","id","templateSettings","evaluate","interpolate","noMatch","escapes","\\","\r","\n","
","
","escapeChar","template","text","settings","oldSettings","offset","variable","render","e","data","argument","chain","instance","_chain","mixin","valueOf","toJSON","define","amd"],"mappings":";;;;CAKC,WAoKC,QAASA,GAAaC,GAGpB,QAASC,GAASC,EAAKC,EAAUC,EAAMC,EAAMC,EAAOC,GAClD,KAAOD,GAAS,GAAaC,EAARD,EAAgBA,GAASN,EAAK,CACjD,GAAIQ,GAAaH,EAAOA,EAAKC,GAASA,CACtCF,GAAOD,EAASC,EAAMF,EAAIM,GAAaA,EAAYN,GAErD,MAAOE,GAGT,MAAO,UAASF,EAAKC,EAAUC,EAAMK,GACnCN,EAAWO,EAAWP,EAAUM,EAAS,EACzC,IAAIJ,IAAQM,EAAYT,IAAQU,EAAEP,KAAKH,GACnCK,GAAUF,GAAQH,GAAKK,OACvBD,EAAQN,EAAM,EAAI,EAAIO,EAAS,CAMnC,OAJIM,WAAUN,OAAS,IACrBH,EAAOF,EAAIG,EAAOA,EAAKC,GAASA,GAChCA,GAASN,GAEJC,EAASC,EAAKC,EAAUC,EAAMC,EAAMC,EAAOC,IA+btD,QAASO,GAAkBd,GACzB,MAAO,UAASe,EAAOC,EAAWP,GAChCO,EAAYC,EAAGD,EAAWP,EAG1B,KAFA,GAAIF,GAAkB,MAATQ,GAAiBA,EAAMR,OAChCD,EAAQN,EAAM,EAAI,EAAIO,EAAS,EA
 C5BD,GAAS,GAAaC,EAARD,EAAgBA,GAASN,EAC5C,GAAIgB,EAAUD,EAAMT,GAAQA,EAAOS,GAAQ,MAAOT,EAEpD,QAAQ,GAgQZ,QAASY,GAAoBhB,EAAKG,GAChC,GAAIc,GAAaC,EAAmBb,OAChCc,EAAcnB,EAAImB,YAClBC,EAASV,EAAEW,WAAWF,IAAgBA,EAAYG,WAAcC,EAGhEC,EAAO,aAGX,KAFId,EAAEe,IAAIzB,EAAKwB,KAAUd,EAAEgB,SAASvB,EAAMqB,IAAOrB,EAAKwB,KAAKH,GAEpDP,KACLO,EAAON,EAAmBD,GACtBO,IAAQxB,IAAOA,EAAIwB,KAAUJ,EAAMI,KAAUd,EAAEgB,SAASvB,EAAMqB,IAChErB,EAAKwB,KAAKH,GAt4BhB,GAAII,GAAOC,KAGPC,EAAqBF,EAAKlB,EAG1BqB,EAAaC,MAAMV,UAAWC,EAAWU,OAAOX,UAAWY,EAAYC,SAASb,UAIlFK,EAAmBI,EAAWJ,KAC9BS,EAAmBL,EAAWK,MAC9BC,EAAmBd,EAASc,SAC5BC,EAAmBf,EAASe,eAK5BC,EAAqBP,MAAMQ,QAC3BC,EAAqBR,OAAO9B,KAC5BuC,EAAqBR,EAAUS,KAC/BC,EAAqBX,OAAOY,OAG1BC,EAAO,aAGPpC,EAAI,SAASV,GACf,MAAIA,aAAeU,GAAUV,EACvB6B,eAAgBnB,QACtBmB,KAAKkB,SAAW/C,GADiB,GAAIU,GAAEV,GAOlB,oBAAZgD,UACa,mBAAXC,SAA0BA,OAAOD,UAC1CA,QAAUC,OAAOD,QAAUtC,GAE7BsC,QAAQtC,EAAIA,GAEZkB,EAAKlB,EAAIA,EAIXA,EAAEwC,QAAU,OAKZ,IAAI1C,GAAa,SAAS2C,EAAM5C,EAAS6C,GACvC,GAAI7C,QAAiB,GAAG,MAAO4C,EAC/B,QAAoB,MAAZC,EAAmB,
 EAAIA,GAC7B,IAAK,GAAG,MAAO,UAASC,GACtB,MAAOF,GAAKG,KAAK/C,EAAS8C,GAE5B,KAAK,GAAG,MAAO,UAASA,EAAOE,GAC7B,MAAOJ,GAAKG,KAAK/C,EAAS8C,EAAOE,GAEnC,KAAK,GAAG,MAAO,UAASF,EAAOjD,EAAOoD,GACpC,MAAOL,GAAKG,KAAK/C,EAAS8C,EAAOjD,EAAOoD,GAE1C,KAAK,GAAG,MAAO,UAASC,EAAaJ,EAAOjD,EAAOoD,GACjD,MAAOL,GAAKG,KAAK/C,EAASkD,EAAaJ,EAAOjD,EAAOoD,IAGzD,MAAO,YACL,MAAOL,GAAKO,MAAMnD,EAASI,aAO3BI,EAAK,SAASsC,EAAO9C,EAAS6C,GAChC,MAAa,OAATC,EAAsB3C,EAAEiD,SACxBjD,EAAEW,WAAWgC,GAAe7C,EAAW6C,EAAO9C,EAAS6C,GACvD1C,EAAEkD,SAASP,GAAe3C,EAAEmD,QAAQR,GACjC3C,EAAEoD,SAAST,GAEpB3C,GAAET,SAAW,SAASoD,EAAO9C,GAC3B,MAAOQ,GAAGsC,EAAO9C,EAASwD,KAI5B,IAAIC,GAAiB,SAASC,EAAUC,GACtC,MAAO,UAASlE,GACd,GAAIK,GAASM,UAAUN,MACvB,IAAa,EAATA,GAAqB,MAAPL,EAAa,MAAOA,EACtC,KAAK,GAAII,GAAQ,EAAWC,EAARD,EAAgBA,IAIlC,IAAK,GAHD+D,GAASxD,UAAUP,GACnBD,EAAO8D,EAASE,GAChBC,EAAIjE,EAAKE,OACJgE,EAAI,EAAOD,EAAJC,EAAOA,IAAK,CAC1B,GAAIC,GAAMnE,EAAKkE,EACVH,IAAiBlE,EAAIsE,SAAc,KAAGtE,EAAIsE,GAAOH,EAAOG,IAGjE,MAAOtE,KAKPuE,EAAa,SAASjD,GACxB,IAAKZ,EAAEkD,SAASt
 C,GAAY,QAC5B,IAAIsB,EAAc,MAAOA,GAAatB,EACtCwB,GAAKxB,UAAYA,CACjB,IAAIkD,GAAS,GAAI1B,EAEjB,OADAA,GAAKxB,UAAY,KACVkD,GAMLC,EAAkBC,KAAKC,IAAI,EAAG,IAAM,EACpClE,EAAc,SAAS+C,GACzB,GAAInD,GAASmD,GAAcA,EAAWnD,MACtC,OAAwB,gBAAVA,IAAsBA,GAAU,GAAeoE,GAAVpE,EASrDK,GAAEkE,KAAOlE,EAAEmE,QAAU,SAAS7E,EAAKC,EAAUM,GAC3CN,EAAWO,EAAWP,EAAUM,EAChC,IAAI8D,GAAGhE,CACP,IAAII,EAAYT,GACd,IAAKqE,EAAI,EAAGhE,EAASL,EAAIK,OAAYA,EAAJgE,EAAYA,IAC3CpE,EAASD,EAAIqE,GAAIA,EAAGrE,OAEjB,CACL,GAAIG,GAAOO,EAAEP,KAAKH,EAClB,KAAKqE,EAAI,EAAGhE,EAASF,EAAKE,OAAYA,EAAJgE,EAAYA,IAC5CpE,EAASD,EAAIG,EAAKkE,IAAKlE,EAAKkE,GAAIrE,GAGpC,MAAOA,IAITU,EAAEoE,IAAMpE,EAAEqE,QAAU,SAAS/E,EAAKC,EAAUM,GAC1CN,EAAWc,EAAGd,EAAUM,EAIxB,KAAK,GAHDJ,IAAQM,EAAYT,IAAQU,EAAEP,KAAKH,GACnCK,GAAUF,GAAQH,GAAKK,OACvB2E,EAAUhD,MAAM3B,GACXD,EAAQ,EAAWC,EAARD,EAAgBA,IAAS,CAC3C,GAAIE,GAAaH,EAAOA,EAAKC,GAASA,CACtC4E,GAAQ5E,GAASH,EAASD,EAAIM,GAAaA,EAAYN,GAEzD,MAAOgF,IA+BTtE,EAAEuE,OAASvE,EAAEwE,MAAQxE,EAAEyE,OAAStF,EAAa,GAG7Ca,EAAE0E,YAAc1E,EAAE2E,MAAQxF,GAAc,GA
 GxCa,EAAE4E,KAAO5E,EAAE6E,OAAS,SAASvF,EAAKc,EAAWP,GAC3C,GAAI+D,EAMJ,OAJEA,GADE7D,EAAYT,GACRU,EAAE8E,UAAUxF,EAAKc,EAAWP,GAE5BG,EAAE+E,QAAQzF,EAAKc,EAAWP,GAE9B+D,QAAa,IAAKA,KAAS,EAAUtE,EAAIsE,GAA7C,QAKF5D,EAAEgF,OAAShF,EAAEiF,OAAS,SAAS3F,EAAKc,EAAWP,GAC7C,GAAIyE,KAKJ,OAJAlE,GAAYC,EAAGD,EAAWP,GAC1BG,EAAEkE,KAAK5E,EAAK,SAASqD,EAAOjD,EAAOwF,GAC7B9E,EAAUuC,EAAOjD,EAAOwF,IAAOZ,EAAQrD,KAAK0B,KAE3C2B,GAITtE,EAAEmF,OAAS,SAAS7F,EAAKc,EAAWP,GAClC,MAAOG,GAAEgF,OAAO1F,EAAKU,EAAEoF,OAAO/E,EAAGD,IAAaP,IAKhDG,EAAEqF,MAAQrF,EAAEsF,IAAM,SAAShG,EAAKc,EAAWP,GACzCO,EAAYC,EAAGD,EAAWP,EAG1B,KAAK,GAFDJ,IAAQM,EAAYT,IAAQU,EAAEP,KAAKH,GACnCK,GAAUF,GAAQH,GAAKK,OAClBD,EAAQ,EAAWC,EAARD,EAAgBA,IAAS,CAC3C,GAAIE,GAAaH,EAAOA,EAAKC,GAASA,CACtC,KAAKU,EAAUd,EAAIM,GAAaA,EAAYN,GAAM,OAAO,EAE3D,OAAO,GAKTU,EAAEuF,KAAOvF,EAAEwF,IAAM,SAASlG,EAAKc,EAAWP,GACxCO,EAAYC,EAAGD,EAAWP,EAG1B,KAAK,GAFDJ,IAAQM,EAAYT,IAAQU,EAAEP,KAAKH,GACnCK,GAAUF,GAAQH,GAAKK,OAClBD,EAAQ,EAAWC,EAARD,EAAgBA,IAAS,CAC3C,GAAIE,GAAaH,EAAOA,EAAKC,GAASA,CACtC,IA
 AIU,EAAUd,EAAIM,GAAaA,EAAYN,GAAM,OAAO,EAE1D,OAAO,GAKTU,EAAEgB,SAAWhB,EAAEyF,SAAWzF,EAAE0F,QAAU,SAASpG,EAAKqG,EAAQC,GAE1D,MADK7F,GAAYT,KAAMA,EAAMU,EAAE6F,OAAOvG,IAC/BU,EAAE8F,QAAQxG,EAAKqG,EAA4B,gBAAbC,IAAyBA,IAAc,GAI9E5F,EAAE+F,OAAS,SAASzG,EAAK0G,GACvB,GAAIC,GAAOvE,EAAMkB,KAAK3C,UAAW,GAC7BiG,EAASlG,EAAEW,WAAWqF,EAC1B,OAAOhG,GAAEoE,IAAI9E,EAAK,SAASqD,GACzB,GAAIF,GAAOyD,EAASF,EAASrD,EAAMqD,EACnC,OAAe,OAARvD,EAAeA,EAAOA,EAAKO,MAAML,EAAOsD,MAKnDjG,EAAEmG,MAAQ,SAAS7G,EAAKsE,GACtB,MAAO5D,GAAEoE,IAAI9E,EAAKU,EAAEoD,SAASQ,KAK/B5D,EAAEoG,MAAQ,SAAS9G,EAAK+G,GACtB,MAAOrG,GAAEgF,OAAO1F,EAAKU,EAAEmD,QAAQkD,KAKjCrG,EAAEsG,UAAY,SAAShH,EAAK+G,GAC1B,MAAOrG,GAAE4E,KAAKtF,EAAKU,EAAEmD,QAAQkD,KAI/BrG,EAAEuG,IAAM,SAASjH,EAAKC,EAAUM,GAC9B,GACI8C,GAAO6D,EADP1C,GAAUT,IAAUoD,GAAgBpD,GAExC,IAAgB,MAAZ9D,GAA2B,MAAPD,EAAa,CACnCA,EAAMS,EAAYT,GAAOA,EAAMU,EAAE6F,OAAOvG,EACxC,KAAK,GAAIqE,GAAI,EAAGhE,EAASL,EAAIK,OAAYA,EAAJgE,EAAYA,IAC/ChB,EAAQrD,EAAIqE,GACRhB,EAAQmB,IACVA,EAASnB,OAIbpD,GAAWc,EAAGd,EAAUM,GACxBG,EAAEk
 E,KAAK5E,EAAK,SAASqD,EAAOjD,EAAOwF,GACjCsB,EAAWjH,EAASoD,EAAOjD,EAAOwF,IAC9BsB,EAAWC,GAAgBD,KAAcnD,KAAYS,KAAYT,OACnES,EAASnB,EACT8D,EAAeD,IAIrB,OAAO1C,IAIT9D,EAAE0G,IAAM,SAASpH,EAAKC,EAAUM,GAC9B,GACI8C,GAAO6D,EADP1C,EAAST,IAAUoD,EAAepD,GAEtC,IAAgB,MAAZ9D,GAA2B,MAAPD,EAAa,CACnCA,EAAMS,EAAYT,GAAOA,EAAMU,EAAE6F,OAAOvG,EACxC,KAAK,GAAIqE,GAAI,EAAGhE,EAASL,EAAIK,OAAYA,EAAJgE,EAAYA,IAC/ChB,EAAQrD,EAAIqE,GACAG,EAARnB,IACFmB,EAASnB,OAIbpD,GAAWc,EAAGd,EAAUM,GACxBG,EAAEkE,KAAK5E,EAAK,SAASqD,EAAOjD,EAAOwF,GACjCsB,EAAWjH,EAASoD,EAAOjD,EAAOwF,IACnBuB,EAAXD,GAAwCnD,MAAbmD,GAAoCnD,MAAXS,KACtDA,EAASnB,EACT8D,EAAeD,IAIrB,OAAO1C,IAKT9D,EAAE2G,QAAU,SAASrH,GAInB,IAAK,GAAesH,GAHhBC,EAAM9G,EAAYT,GAAOA,EAAMU,EAAE6F,OAAOvG,GACxCK,EAASkH,EAAIlH,OACbmH,EAAWxF,MAAM3B,GACZD,EAAQ,EAAiBC,EAARD,EAAgBA,IACxCkH,EAAO5G,EAAE+G,OAAO,EAAGrH,GACfkH,IAASlH,IAAOoH,EAASpH,GAASoH,EAASF,IAC/CE,EAASF,GAAQC,EAAInH,EAEvB,OAAOoH,IAMT9G,EAAEgH,OAAS,SAAS1H,EAAK2H,EAAGC,GAC1B,MAAS,OAALD,GAAaC,GACVnH,EAAYT,KAAMA,EAAMU,EAAE6F,OAAOvG,I
 AC/BA,EAAIU,EAAE+G,OAAOzH,EAAIK,OAAS,KAE5BK,EAAE2G,QAAQrH,GAAKoC,MAAM,EAAGsC,KAAKuC,IAAI,EAAGU,KAI7CjH,EAAEmH,OAAS,SAAS7H,EAAKC,EAAUM,GAEjC,MADAN,GAAWc,EAAGd,EAAUM,GACjBG,EAAEmG,MAAMnG,EAAEoE,IAAI9E,EAAK,SAASqD,EAAOjD,EAAOwF,GAC/C,OACEvC,MAAOA,EACPjD,MAAOA,EACP0H,SAAU7H,EAASoD,EAAOjD,EAAOwF,MAElCmC,KAAK,SAASC,EAAMC,GACrB,GAAIC,GAAIF,EAAKF,SACTK,EAAIF,EAAMH,QACd,IAAII,IAAMC,EAAG,CACX,GAAID,EAAIC,GAAKD,QAAW,GAAG,MAAO,EAClC,IAAQC,EAAJD,GAASC,QAAW,GAAG,OAAQ,EAErC,MAAOH,GAAK5H,MAAQ6H,EAAM7H,QACxB,SAIN,IAAIgI,GAAQ,SAASC,GACnB,MAAO,UAASrI,EAAKC,EAAUM,GAC7B,GAAIiE,KAMJ,OALAvE,GAAWc,EAAGd,EAAUM,GACxBG,EAAEkE,KAAK5E,EAAK,SAASqD,EAAOjD,GAC1B,GAAIkE,GAAMrE,EAASoD,EAAOjD,EAAOJ,EACjCqI,GAAS7D,EAAQnB,EAAOiB,KAEnBE,GAMX9D,GAAE4H,QAAUF,EAAM,SAAS5D,EAAQnB,EAAOiB,GACpC5D,EAAEe,IAAI+C,EAAQF,GAAME,EAAOF,GAAK3C,KAAK0B,GAAamB,EAAOF,IAAQjB,KAKvE3C,EAAE6H,QAAUH,EAAM,SAAS5D,EAAQnB,EAAOiB,GACxCE,EAAOF,GAAOjB,IAMhB3C,EAAE8H,QAAUJ,EAAM,SAAS5D,EAAQnB,EAAOiB,GACpC5D,EAAEe,IAAI+C,EAAQF,GAAME,EAAOF,KAAaE,EAAOF,GAAO
 ,IAI5D5D,EAAE+H,QAAU,SAASzI,GACnB,MAAKA,GACDU,EAAE8B,QAAQxC,GAAaoC,EAAMkB,KAAKtD,GAClCS,EAAYT,GAAaU,EAAEoE,IAAI9E,EAAKU,EAAEiD,UACnCjD,EAAE6F,OAAOvG,OAIlBU,EAAEgI,KAAO,SAAS1I,GAChB,MAAW,OAAPA,EAAoB,EACjBS,EAAYT,GAAOA,EAAIK,OAASK,EAAEP,KAAKH,GAAKK,QAKrDK,EAAEiI,UAAY,SAAS3I,EAAKc,EAAWP,GACrCO,EAAYC,EAAGD,EAAWP,EAC1B,IAAIqI,MAAWC,IAIf,OAHAnI,GAAEkE,KAAK5E,EAAK,SAASqD,EAAOiB,EAAKtE,IAC9Bc,EAAUuC,EAAOiB,EAAKtE,GAAO4I,EAAOC,GAAMlH,KAAK0B,MAE1CuF,EAAMC,IAShBnI,EAAEoI,MAAQpI,EAAEqI,KAAOrI,EAAEsI,KAAO,SAASnI,EAAO8G,EAAGC,GAC7C,MAAa,OAAT/G,MAA2B,GACtB,MAAL8G,GAAaC,EAAc/G,EAAM,GAC9BH,EAAEuI,QAAQpI,EAAOA,EAAMR,OAASsH,IAMzCjH,EAAEuI,QAAU,SAASpI,EAAO8G,EAAGC,GAC7B,MAAOxF,GAAMkB,KAAKzC,EAAO,EAAG6D,KAAKuC,IAAI,EAAGpG,EAAMR,QAAe,MAALsH,GAAaC,EAAQ,EAAID,MAKnFjH,EAAEwI,KAAO,SAASrI,EAAO8G,EAAGC,GAC1B,MAAa,OAAT/G,MAA2B,GACtB,MAAL8G,GAAaC,EAAc/G,EAAMA,EAAMR,OAAS,GAC7CK,EAAEyI,KAAKtI,EAAO6D,KAAKuC,IAAI,EAAGpG,EAAMR,OAASsH,KAMlDjH,EAAEyI,KAAOzI,EAAE0I,KAAO1I,EAAE2I,KAAO,SAASxI,EAAO8G,EAAGC,GAC5C,MAAOxF,GAA
 MkB,KAAKzC,EAAY,MAAL8G,GAAaC,EAAQ,EAAID,IAIpDjH,EAAE4I,QAAU,SAASzI,GACnB,MAAOH,GAAEgF,OAAO7E,EAAOH,EAAEiD,UAI3B,IAAI4F,GAAU,SAASC,EAAOC,EAASC,EAAQC,GAE7C,IAAK,GADDC,MAAaC,EAAM,EACdxF,EAAIsF,GAAc,EAAGtJ,EAASmJ,GAASA,EAAMnJ,OAAYA,EAAJgE,EAAYA,IAAK,CAC7E,GAAIhB,GAAQmG,EAAMnF,EAClB,IAAI5D,EAAY4C,KAAW3C,EAAE8B,QAAQa,IAAU3C,EAAEoJ,YAAYzG,IAAS,CAE/DoG,IAASpG,EAAQkG,EAAQlG,EAAOoG,EAASC,GAC9C,IAAIK,GAAI,EAAGC,EAAM3G,EAAMhD,MAEvB,KADAuJ,EAAOvJ,QAAU2J,EACNA,EAAJD,GACLH,EAAOC,KAASxG,EAAM0G,SAEdL,KACVE,EAAOC,KAASxG,GAGpB,MAAOuG,GAITlJ,GAAE6I,QAAU,SAAS1I,EAAO4I,GAC1B,MAAOF,GAAQ1I,EAAO4I,GAAS,IAIjC/I,EAAEuJ,QAAU,SAASpJ,GACnB,MAAOH,GAAEwJ,WAAWrJ,EAAOuB,EAAMkB,KAAK3C,UAAW,KAMnDD,EAAEyJ,KAAOzJ,EAAE0J,OAAS,SAASvJ,EAAOwJ,EAAUpK,EAAUM,GACtD,GAAa,MAATM,EAAe,QACdH,GAAE4J,UAAUD,KACf9J,EAAUN,EACVA,EAAWoK,EACXA,GAAW,GAEG,MAAZpK,IAAkBA,EAAWc,EAAGd,EAAUM,GAG9C,KAAK,GAFDiE,MACA+F,KACKlG,EAAI,EAAGhE,EAASQ,EAAMR,OAAYA,EAAJgE,EAAYA,IAAK,CACtD,GAAIhB,GAAQxC,EAAMwD,GACd6C,EAAWjH,EAAWA,EAASoD,EAAOgB,EAAGxD,GAASwC,CAC
 lDgH,IACGhG,GAAKkG,IAASrD,GAAU1C,EAAO7C,KAAK0B,GACzCkH,EAAOrD,GACEjH,EACJS,EAAEgB,SAAS6I,EAAMrD,KACpBqD,EAAK5I,KAAKuF,GACV1C,EAAO7C,KAAK0B,IAEJ3C,EAAEgB,SAAS8C,EAAQnB,IAC7BmB,EAAO7C,KAAK0B,GAGhB,MAAOmB,IAKT9D,EAAE8J,MAAQ,WACR,MAAO9J,GAAEyJ,KAAKZ,EAAQ5I,WAAW,GAAM,KAKzCD,EAAE+J,aAAe,SAAS5J,GACxB,GAAa,MAATA,EAAe,QAGnB,KAAK,GAFD2D,MACAkG,EAAa/J,UAAUN,OAClBgE,EAAI,EAAGhE,EAASQ,EAAMR,OAAYA,EAAJgE,EAAYA,IAAK,CACtD,GAAIsG,GAAO9J,EAAMwD,EACjB,KAAI3D,EAAEgB,SAAS8C,EAAQmG,GAAvB,CACA,IAAK,GAAIZ,GAAI,EAAOW,EAAJX,GACTrJ,EAAEgB,SAASf,UAAUoJ,GAAIY,GADAZ,KAG5BA,IAAMW,GAAYlG,EAAO7C,KAAKgJ,IAEpC,MAAOnG,IAKT9D,EAAEwJ,WAAa,SAASrJ,GACtB,GAAIsI,GAAOI,EAAQ5I,WAAW,GAAM,EAAM,EAC1C,OAAOD,GAAEgF,OAAO7E,EAAO,SAASwC,GAC9B,OAAQ3C,EAAEgB,SAASyH,EAAM9F,MAM7B3C,EAAEkK,IAAM,WACN,MAAOlK,GAAEmK,MAAMlK,YAKjBD,EAAEmK,MAAQ,SAAShK,GAIjB,IAAK,GAHDR,GAASQ,GAASH,EAAEuG,IAAIpG,EAAO,UAAUR,QAAU,EACnDmE,EAASxC,MAAM3B,GAEVD,EAAQ,EAAWC,EAARD,EAAgBA,IAClCoE,EAAOpE,GAASM,EAAEmG,MAAMhG,EAAOT,EAEjC,OAAOoE,IAMT9D,EAAEoK,OAAS,SAASlF,EAAM
 W,GAExB,IAAK,GADD/B,MACKH,EAAI,EAAGhE,EAASuF,GAAQA,EAAKvF,OAAYA,EAAJgE,EAAYA,IACpDkC,EACF/B,EAAOoB,EAAKvB,IAAMkC,EAAOlC,GAEzBG,EAAOoB,EAAKvB,GAAG,IAAMuB,EAAKvB,GAAG,EAGjC,OAAOG,IAOT9D,EAAE8F,QAAU,SAAS3F,EAAO8J,EAAMN,GAChC,GAAIhG,GAAI,EAAGhE,EAASQ,GAASA,EAAMR,MACnC,IAAuB,gBAAZgK,GACThG,EAAe,EAAXgG,EAAe3F,KAAKuC,IAAI,EAAG5G,EAASgK,GAAYA,MAC/C,IAAIA,GAAYhK,EAErB,MADAgE,GAAI3D,EAAEqK,YAAYlK,EAAO8J,GAClB9J,EAAMwD,KAAOsG,EAAOtG,GAAK,CAElC,IAAIsG,IAASA,EACX,MAAOjK,GAAE8E,UAAUpD,EAAMkB,KAAKzC,EAAOwD,GAAI3D,EAAEsK,MAE7C,MAAW3K,EAAJgE,EAAYA,IAAK,GAAIxD,EAAMwD,KAAOsG,EAAM,MAAOtG,EACtD,QAAQ,GAGV3D,EAAEuK,YAAc,SAASpK,EAAO8J,EAAMO,GACpC,GAAIrB,GAAMhJ,EAAQA,EAAMR,OAAS,CAIjC,IAHmB,gBAAR6K,KACTrB,EAAa,EAAPqB,EAAWrB,EAAMqB,EAAO,EAAIxG,KAAK0C,IAAIyC,EAAKqB,EAAO,IAErDP,IAASA,EACX,MAAOjK,GAAEyK,cAAc/I,EAAMkB,KAAKzC,EAAO,EAAGgJ,GAAMnJ,EAAEsK,MAEtD,QAASnB,GAAO,GAAG,GAAIhJ,EAAMgJ,KAASc,EAAM,MAAOd,EACnD,QAAQ,GAiBVnJ,EAAE8E,UAAY5E,EAAkB,GAEhCF,EAAEyK,cAAgBvK,GAAmB,GAIrCF,EAAEqK,YAAc,SAASlK,EAAOb,EAAKC,EAAUM,
 GAC7CN,EAAWc,EAAGd,EAAUM,EAAS,EAGjC,KAFA,GAAI8C,GAAQpD,EAASD,GACjBoL,EAAM,EAAGC,EAAOxK,EAAMR,OACbgL,EAAND,GAAY,CACjB,GAAIE,GAAM5G,KAAK6G,OAAOH,EAAMC,GAAQ,EAChCpL,GAASY,EAAMyK,IAAQjI,EAAO+H,EAAME,EAAM,EAAQD,EAAOC,EAE/D,MAAOF,IAMT1K,EAAE8K,MAAQ,SAASC,EAAOC,EAAMC,GAC1BhL,UAAUN,QAAU,IACtBqL,EAAOD,GAAS,EAChBA,EAAQ,GAEVE,EAAOA,GAAQ,CAKf,KAAK,GAHDtL,GAASqE,KAAKuC,IAAIvC,KAAKkH,MAAMF,EAAOD,GAASE,GAAO,GACpDH,EAAQxJ,MAAM3B,GAETwJ,EAAM,EAASxJ,EAANwJ,EAAcA,IAAO4B,GAASE,EAC9CH,EAAM3B,GAAO4B,CAGf,OAAOD,GAQT,IAAIK,GAAe,SAASC,EAAYC,EAAWxL,EAASyL,EAAgBrF,GAC1E,KAAMqF,YAA0BD,IAAY,MAAOD,GAAWpI,MAAMnD,EAASoG,EAC7E,IAAIsF,GAAO1H,EAAWuH,EAAWxK,WAC7BkD,EAASsH,EAAWpI,MAAMuI,EAAMtF,EACpC,OAAIjG,GAAEkD,SAASY,GAAgBA,EACxByH,EAMTvL,GAAEiC,KAAO,SAASQ,EAAM5C,GACtB,GAAImC,GAAcS,EAAKR,OAASD,EAAY,MAAOA,GAAWgB,MAAMP,EAAMf,EAAMkB,KAAK3C,UAAW,GAChG,KAAKD,EAAEW,WAAW8B,GAAO,KAAM,IAAI+I,WAAU,oCAC7C,IAAIvF,GAAOvE,EAAMkB,KAAK3C,UAAW,GAC7BwL,EAAQ,WACV,MAAON,GAAa1I,EAAMgJ,EAAO5L,EAASsB,KAAM8E,EAAKyF,OAAOhK,EAAMkB,KAAK3C,aAEz
 E,OAAOwL,IAMTzL,EAAE2L,QAAU,SAASlJ,GACnB,GAAImJ,GAAYlK,EAAMkB,KAAK3C,UAAW,GAClCwL,EAAQ,WAGV,IAAK,GAFDI,GAAW,EAAGlM,EAASiM,EAAUjM,OACjCsG,EAAO3E,MAAM3B,GACRgE,EAAI,EAAOhE,EAAJgE,EAAYA,IAC1BsC,EAAKtC,GAAKiI,EAAUjI,KAAO3D,EAAIC,UAAU4L,KAAcD,EAAUjI,EAEnE,MAAOkI,EAAW5L,UAAUN,QAAQsG,EAAKhF,KAAKhB,UAAU4L,KACxD,OAAOV,GAAa1I,EAAMgJ,EAAOtK,KAAMA,KAAM8E,GAE/C,OAAOwF,IAMTzL,EAAE8L,QAAU,SAASxM,GACnB,GAAIqE,GAA8BC,EAA3BjE,EAASM,UAAUN,MAC1B,IAAc,GAAVA,EAAa,KAAM,IAAIoM,OAAM,wCACjC,KAAKpI,EAAI,EAAOhE,EAAJgE,EAAYA,IACtBC,EAAM3D,UAAU0D,GAChBrE,EAAIsE,GAAO5D,EAAEiC,KAAK3C,EAAIsE,GAAMtE,EAE9B,OAAOA,IAITU,EAAEgM,QAAU,SAASvJ,EAAMwJ,GACzB,GAAID,GAAU,SAASpI,GACrB,GAAIsI,GAAQF,EAAQE,MAChBC,EAAU,IAAMF,EAASA,EAAOjJ,MAAM7B,KAAMlB,WAAa2D,EAE7D,OADK5D,GAAEe,IAAImL,EAAOC,KAAUD,EAAMC,GAAW1J,EAAKO,MAAM7B,KAAMlB,YACvDiM,EAAMC,GAGf,OADAH,GAAQE,SACDF,GAKThM,EAAEoM,MAAQ,SAAS3J,EAAM4J,GACvB,GAAIpG,GAAOvE,EAAMkB,KAAK3C,UAAW,EACjC,OAAOqM,YAAW,WAChB,MAAO7J,GAAKO,MAAM,KAAMiD,IACvBoG,IAKLrM,EAAEuM,MAAQvM,EAAE2L,QAAQ3L,EAAEoM,
 MAAOpM,EAAG,GAOhCA,EAAEwM,SAAW,SAAS/J,EAAM4J,EAAMI,GAChC,GAAI5M,GAASoG,EAAMnC,EACf4I,EAAU,KACVC,EAAW,CACVF,KAASA,KACd,IAAIG,GAAQ,WACVD,EAAWF,EAAQI,WAAY,EAAQ,EAAI7M,EAAE8M,MAC7CJ,EAAU,KACV5I,EAASrB,EAAKO,MAAMnD,EAASoG,GACxByG,IAAS7M,EAAUoG,EAAO,MAEjC,OAAO,YACL,GAAI6G,GAAM9M,EAAE8M,KACPH,IAAYF,EAAQI,WAAY,IAAOF,EAAWG,EACvD,IAAIC,GAAYV,GAAQS,EAAMH,EAc9B,OAbA9M,GAAUsB,KACV8E,EAAOhG,UACU,GAAb8M,GAAkBA,EAAYV,GAC5BK,IACFM,aAAaN,GACbA,EAAU,MAEZC,EAAWG,EACXhJ,EAASrB,EAAKO,MAAMnD,EAASoG,GACxByG,IAAS7M,EAAUoG,EAAO,OACrByG,GAAWD,EAAQQ,YAAa,IAC1CP,EAAUJ,WAAWM,EAAOG,IAEvBjJ,IAQX9D,EAAEkN,SAAW,SAASzK,EAAM4J,EAAMc,GAChC,GAAIT,GAASzG,EAAMpG,EAASuN,EAAWtJ,EAEnC8I,EAAQ,WACV,GAAIpE,GAAOxI,EAAE8M,MAAQM,CAEVf,GAAP7D,GAAeA,GAAQ,EACzBkE,EAAUJ,WAAWM,EAAOP,EAAO7D,IAEnCkE,EAAU,KACLS,IACHrJ,EAASrB,EAAKO,MAAMnD,EAASoG,GACxByG,IAAS7M,EAAUoG,EAAO,QAKrC,OAAO,YACLpG,EAAUsB,KACV8E,EAAOhG,UACPmN,EAAYpN,EAAE8M,KACd,IAAIO,GAAUF,IAAcT,CAO5B,OANKA,KAASA,EAAUJ,WAAWM,EAAOP,IACtCgB,IACFvJ,EAASrB,EAAKO,MAAMnD,EAASoG,GAC7BpG,E
 AAUoG,EAAO,MAGZnC,IAOX9D,EAAEsN,KAAO,SAAS7K,EAAM8K,GACtB,MAAOvN,GAAE2L,QAAQ4B,EAAS9K,IAI5BzC,EAAEoF,OAAS,SAAShF,GAClB,MAAO,YACL,OAAQA,EAAU4C,MAAM7B,KAAMlB,aAMlCD,EAAEwN,QAAU,WACV,GAAIvH,GAAOhG,UACP8K,EAAQ9E,EAAKtG,OAAS,CAC1B,OAAO,YAGL,IAFA,GAAIgE,GAAIoH,EACJjH,EAASmC,EAAK8E,GAAO/H,MAAM7B,KAAMlB,WAC9B0D,KAAKG,EAASmC,EAAKtC,GAAGf,KAAKzB,KAAM2C,EACxC,OAAOA,KAKX9D,EAAEyN,MAAQ,SAASC,EAAOjL,GACxB,MAAO,YACL,QAAMiL,EAAQ,EACLjL,EAAKO,MAAM7B,KAAMlB,WAD1B,SAOJD,EAAE2N,OAAS,SAASD,EAAOjL,GACzB,GAAIjD,EACJ,OAAO,YAKL,QAJMkO,EAAQ,IACZlO,EAAOiD,EAAKO,MAAM7B,KAAMlB,YAEb,GAATyN,IAAYjL,EAAO,MAChBjD,IAMXQ,EAAE4N,KAAO5N,EAAE2L,QAAQ3L,EAAE2N,OAAQ,EAM7B,IAAIE,KAAelM,SAAU,MAAMmM,qBAAqB,YACpDtN,GAAsB,UAAW,gBAAiB,WAClC,uBAAwB,iBAAkB,iBAqB9DR,GAAEP,KAAO,SAASH,GAChB,IAAKU,EAAEkD,SAAS5D,GAAM,QACtB,IAAIyC,EAAY,MAAOA,GAAWzC,EAClC,IAAIG,KACJ,KAAK,GAAImE,KAAOtE,GAASU,EAAEe,IAAIzB,EAAKsE,IAAMnE,EAAKwB,KAAK2C,EAGpD,OADIiK,IAAYvN,EAAoBhB,EAAKG,GAClCA,GAITO,EAAE+N,QAAU,SAASzO,GACnB,IAAKU,EAAEkD,SAAS5D,GAAM,QACtB,IAAIG,K
 ACJ,KAAK,GAAImE,KAAOtE,GAAKG,EAAKwB,KAAK2C,EAG/B,OADIiK,IAAYvN,EAAoBhB,EAAKG,GAClCA,GAITO,EAAE6F,OAAS,SAASvG,GAIlB,IAAK,GAHDG,GAAOO,EAAEP,KAAKH,GACdK,EAASF,EAAKE,OACdkG,EAASvE,MAAM3B,GACVgE,EAAI,EAAOhE,EAAJgE,EAAYA,IAC1BkC,EAAOlC,GAAKrE,EAAIG,EAAKkE,GAEvB,OAAOkC,IAKT7F,EAAEgO,UAAY,SAAS1O,EAAKC,EAAUM,GACpCN,EAAWc,EAAGd,EAAUM,EAKtB,KAAK,GADDD,GAHFH,EAAQO,EAAEP,KAAKH,GACbK,EAASF,EAAKE,OACd2E,KAEK5E,EAAQ,EAAWC,EAARD,EAAgBA,IAClCE,EAAaH,EAAKC,GAClB4E,EAAQ1E,GAAcL,EAASD,EAAIM,GAAaA,EAAYN,EAE9D,OAAOgF,IAIXtE,EAAEiO,MAAQ,SAAS3O,GAIjB,IAAK,GAHDG,GAAOO,EAAEP,KAAKH,GACdK,EAASF,EAAKE,OACdsO,EAAQ3M,MAAM3B,GACTgE,EAAI,EAAOhE,EAAJgE,EAAYA,IAC1BsK,EAAMtK,IAAMlE,EAAKkE,GAAIrE,EAAIG,EAAKkE,IAEhC,OAAOsK,IAITjO,EAAEkO,OAAS,SAAS5O,GAGlB,IAAK,GAFDwE,MACArE,EAAOO,EAAEP,KAAKH,GACTqE,EAAI,EAAGhE,EAASF,EAAKE,OAAYA,EAAJgE,EAAYA,IAChDG,EAAOxE,EAAIG,EAAKkE,KAAOlE,EAAKkE,EAE9B,OAAOG,IAKT9D,EAAEmO,UAAYnO,EAAEoO,QAAU,SAAS9O,GACjC,GAAI+O,KACJ,KAAK,GAAIzK,KAAOtE,GACVU,EAAEW,WAAWrB,EAAIsE,KAAOyK,EAAMpN,KAAK2C,EAEzC,O
 AAOyK,GAAMhH,QAIfrH,EAAEsO,OAAShL,EAAetD,EAAE+N,SAI5B/N,EAAEuO,UAAYvO,EAAEwO,OAASlL,EAAetD,EAAEP,MAG1CO,EAAE+E,QAAU,SAASzF,EAAKc,EAAWP,GACnCO,EAAYC,EAAGD,EAAWP,EAE1B,KAAK,GADmB+D,GAApBnE,EAAOO,EAAEP,KAAKH,GACTqE,EAAI,EAAGhE,EAASF,EAAKE,OAAYA,EAAJgE,EAAYA,IAEhD,GADAC,EAAMnE,EAAKkE,GACPvD,EAAUd,EAAIsE,GAAMA,EAAKtE,GAAM,MAAOsE,IAK9C5D,EAAEyO,KAAO,SAASrE,EAAQsE,EAAW7O,GACnC,GAA+BN,GAAUE,EAArCqE,KAAaxE,EAAM8K,CACvB,IAAW,MAAP9K,EAAa,MAAOwE,EACpB9D,GAAEW,WAAW+N,IACfjP,EAAOO,EAAE+N,QAAQzO,GACjBC,EAAWO,EAAW4O,EAAW7O,KAEjCJ,EAAOoJ,EAAQ5I,WAAW,GAAO,EAAO,GACxCV,EAAW,SAASoD,EAAOiB,EAAKtE,GAAO,MAAOsE,KAAOtE,IACrDA,EAAMiC,OAAOjC,GAEf,KAAK,GAAIqE,GAAI,EAAGhE,EAASF,EAAKE,OAAYA,EAAJgE,EAAYA,IAAK,CACrD,GAAIC,GAAMnE,EAAKkE,GACXhB,EAAQrD,EAAIsE,EACZrE,GAASoD,EAAOiB,EAAKtE,KAAMwE,EAAOF,GAAOjB,GAE/C,MAAOmB,IAIT9D,EAAE2O,KAAO,SAASrP,EAAKC,EAAUM,GAC/B,GAAIG,EAAEW,WAAWpB,GACfA,EAAWS,EAAEoF,OAAO7F,OACf,CACL,GAAIE,GAAOO,EAAEoE,IAAIyE,EAAQ5I,WAAW,GAAO,EAAO,GAAI2O,OACtDrP,GAAW,SAASoD,EAAOiB,GACzB,OAAQ5D,EAAEgB,S
 AASvB,EAAMmE,IAG7B,MAAO5D,GAAEyO,KAAKnP,EAAKC,EAAUM,IAI/BG,EAAE6O,SAAWvL,EAAetD,EAAE+N,SAAS,GAGvC/N,EAAE8O,MAAQ,SAASxP,GACjB,MAAKU,GAAEkD,SAAS5D,GACTU,EAAE8B,QAAQxC,GAAOA,EAAIoC,QAAU1B,EAAEsO,UAAWhP,GADtBA,GAO/BU,EAAE+O,IAAM,SAASzP,EAAK0P,GAEpB,MADAA,GAAY1P,GACLA,GAITU,EAAEiP,QAAU,SAAS7E,EAAQ/D,GAC3B,GAAI5G,GAAOO,EAAEP,KAAK4G,GAAQ1G,EAASF,EAAKE,MACxC,IAAc,MAAVyK,EAAgB,OAAQzK,CAE5B,KAAK,GADDL,GAAMiC,OAAO6I,GACRzG,EAAI,EAAOhE,EAAJgE,EAAYA,IAAK,CAC/B,GAAIC,GAAMnE,EAAKkE,EACf,IAAI0C,EAAMzC,KAAStE,EAAIsE,MAAUA,IAAOtE,IAAM,OAAO,EAEvD,OAAO,EAKT,IAAI4P,GAAK,SAAS1H,EAAGC,EAAG0H,EAAQC,GAG9B,GAAI5H,IAAMC,EAAG,MAAa,KAAND,GAAW,EAAIA,IAAM,EAAIC,CAE7C,IAAS,MAALD,GAAkB,MAALC,EAAW,MAAOD,KAAMC,CAErCD,aAAaxH,KAAGwH,EAAIA,EAAEnF,UACtBoF,YAAazH,KAAGyH,EAAIA,EAAEpF,SAE1B,IAAIgN,GAAY1N,EAASiB,KAAK4E,EAC9B,IAAI6H,IAAc1N,EAASiB,KAAK6E,GAAI,OAAO,CAC3C,QAAQ4H,GAEN,IAAK,kBAEL,IAAK,kBAGH,MAAO,GAAK7H,GAAM,GAAKC,CACzB,KAAK,kBAGH,OAAKD,KAAOA,GAAWC,KAAOA,EAEhB,KAAND,EAAU,GAAKA,IAAM,EAAIC,GAAKD,KAAOC,CAC/C,KAAK,gBAC
 L,IAAK,mBAIH,OAAQD,KAAOC,EAGnB,GAAI6H,GAA0B,mBAAdD,CAChB,KAAKC,EAAW,CACd,GAAgB,gBAAL9H,IAA6B,gBAALC,GAAe,OAAO,CAIzD,IAAI8H,GAAQ/H,EAAE/G,YAAa+O,EAAQ/H,EAAEhH,WACrC,IAAI8O,IAAUC,KAAWxP,EAAEW,WAAW4O,IAAUA,YAAiBA,IACxCvP,EAAEW,WAAW6O,IAAUA,YAAiBA,KACzC,eAAiBhI,IAAK,eAAiBC,GAC7D,OAAO,EAQX0H,EAASA,MACTC,EAASA,KAET,KADA,GAAIzP,GAASwP,EAAOxP,OACbA,KAGL,GAAIwP,EAAOxP,KAAY6H,EAAG,MAAO4H,GAAOzP,KAAY8H,CAQtD,IAJA0H,EAAOlO,KAAKuG,GACZ4H,EAAOnO,KAAKwG,GAGR6H,EAAW,CAGb,GADA3P,EAAS6H,EAAE7H,OACPA,IAAW8H,EAAE9H,OAAQ,OAAO,CAEhC,MAAOA,KACL,IAAKuP,EAAG1H,EAAE7H,GAAS8H,EAAE9H,GAASwP,EAAQC,GAAS,OAAO,MAEnD,CAEL,GAAsBxL,GAAlBnE,EAAOO,EAAEP,KAAK+H,EAGlB,IAFA7H,EAASF,EAAKE,OAEVK,EAAEP,KAAKgI,GAAG9H,SAAWA,EAAQ,OAAO,CACxC,MAAOA,KAGL,GADAiE,EAAMnE,EAAKE,IACLK,EAAEe,IAAI0G,EAAG7D,KAAQsL,EAAG1H,EAAE5D,GAAM6D,EAAE7D,GAAMuL,EAAQC,GAAU,OAAO,EAMvE,MAFAD,GAAOM,MACPL,EAAOK,OACA,EAITzP,GAAE0P,QAAU,SAASlI,EAAGC,GACtB,MAAOyH,GAAG1H,EAAGC,IAKfzH,EAAE2P,QAAU,SAASrQ,GACnB,MAAW,OAAPA,GAAoB,EACpBS,EAAYT,KAASU,EAAE8B,QAAQxC,IA
 AQU,EAAE4P,SAAStQ,IAAQU,EAAEoJ,YAAY9J,IAA6B,IAAfA,EAAIK,OAChE,IAAvBK,EAAEP,KAAKH,GAAKK,QAIrBK,EAAE6P,UAAY,SAASvQ,GACrB,SAAUA,GAAwB,IAAjBA,EAAIwQ,WAKvB9P,EAAE8B,QAAUD,GAAiB,SAASvC,GACpC,MAA8B,mBAAvBqC,EAASiB,KAAKtD,IAIvBU,EAAEkD,SAAW,SAAS5D,GACpB,GAAIyQ,SAAczQ,EAClB,OAAgB,aAATyQ,GAAgC,WAATA,KAAuBzQ,GAIvDU,EAAEkE,MAAM,YAAa,WAAY,SAAU,SAAU,OAAQ,SAAU,SAAU,SAAS8L,GACxFhQ,EAAE,KAAOgQ,GAAQ,SAAS1Q,GACxB,MAAOqC,GAASiB,KAAKtD,KAAS,WAAa0Q,EAAO,OAMjDhQ,EAAEoJ,YAAYnJ,aACjBD,EAAEoJ,YAAc,SAAS9J,GACvB,MAAOU,GAAEe,IAAIzB,EAAK,YAMJ,kBAAP,KAAyC,gBAAb2Q,aACrCjQ,EAAEW,WAAa,SAASrB,GACtB,MAAqB,kBAAPA,KAAqB,IAKvCU,EAAEkQ,SAAW,SAAS5Q,GACpB,MAAO4Q,UAAS5Q,KAASgL,MAAM6F,WAAW7Q,KAI5CU,EAAEsK,MAAQ,SAAShL,GACjB,MAAOU,GAAEoQ,SAAS9Q,IAAQA,KAASA,GAIrCU,EAAE4J,UAAY,SAAStK,GACrB,MAAOA,MAAQ,GAAQA,KAAQ,GAAgC,qBAAvBqC,EAASiB,KAAKtD,IAIxDU,EAAEqQ,OAAS,SAAS/Q,GAClB,MAAe,QAARA,GAITU,EAAEsQ,YAAc,SAAShR,GACvB,MAAOA,SAAa,IAKtBU,EAAEe,IAAM,SAASzB,EAAKsE,GACpB,MAAc,OAAPtE,GAAesC,EAAegB,KAAKtD,EAAKsE,IAQjD5D,EAAEuQ,WAAa,WAEb,MADAr
 P,GAAKlB,EAAIoB,EACFD,MAITnB,EAAEiD,SAAW,SAASN,GACpB,MAAOA,IAIT3C,EAAEwQ,SAAW,SAAS7N,GACpB,MAAO,YACL,MAAOA,KAIX3C,EAAEyQ,KAAO,aAETzQ,EAAEoD,SAAW,SAASQ,GACpB,MAAO,UAAStE,GACd,MAAc,OAAPA,MAAmB,GAAIA,EAAIsE,KAKtC5D,EAAE0Q,WAAa,SAASpR,GACtB,MAAc,OAAPA,EAAc,aAAe,SAASsE,GAC3C,MAAOtE,GAAIsE,KAMf5D,EAAEmD,QAAUnD,EAAE2Q,QAAU,SAAStK,GAE/B,MADAA,GAAQrG,EAAEuO,aAAclI,GACjB,SAAS/G,GACd,MAAOU,GAAEiP,QAAQ3P,EAAK+G,KAK1BrG,EAAE0N,MAAQ,SAASzG,EAAG1H,EAAUM,GAC9B,GAAI+Q,GAAQtP,MAAM0C,KAAKuC,IAAI,EAAGU,GAC9B1H,GAAWO,EAAWP,EAAUM,EAAS,EACzC,KAAK,GAAI8D,GAAI,EAAOsD,EAAJtD,EAAOA,IAAKiN,EAAMjN,GAAKpE,EAASoE,EAChD,OAAOiN,IAIT5Q,EAAE+G,OAAS,SAASL,EAAKH,GAKvB,MAJW,OAAPA,IACFA,EAAMG,EACNA,EAAM,GAEDA,EAAM1C,KAAK6G,MAAM7G,KAAK+C,UAAYR,EAAMG,EAAM,KAIvD1G,EAAE8M,IAAM+D,KAAK/D,KAAO,WAClB,OAAO,GAAI+D,OAAOC,UAIpB,IAAIC,IACFC,IAAK,QACLC,IAAK,OACLC,IAAK,OACLC,IAAK,SACLC,IAAK,SACLC,IAAK,UAEHC,EAActR,EAAEkO,OAAO6C,GAGvBQ,EAAgB,SAASnN,GAC3B,GAAIoN,GAAU,SAASC,GACrB,MAAOrN,GAAIqN,IAGThO,EAAS,MAAQzD,EAAEP,KAAK2E,GAAKsN,KAAK,K
 AAO,IACzCC,EAAaC,OAAOnO,GACpBoO,EAAgBD,OAAOnO,EAAQ,IACnC,OAAO,UAASqO,GAEd,MADAA,GAAmB,MAAVA,EAAiB,GAAK,GAAKA,EAC7BH,EAAWI,KAAKD,GAAUA,EAAOE,QAAQH,EAAeL,GAAWM,GAG9E9R,GAAEiS,OAASV,EAAcR,GACzB/Q,EAAEkS,SAAWX,EAAcD,GAI3BtR,EAAE8D,OAAS,SAASsG,EAAQhH,EAAU+O,GACpC,GAAIxP,GAAkB,MAAVyH,MAAsB,GAAIA,EAAOhH,EAI7C,OAHIT,SAAe,KACjBA,EAAQwP,GAEHnS,EAAEW,WAAWgC,GAASA,EAAMC,KAAKwH,GAAUzH,EAKpD,IAAIyP,GAAY,CAChBpS,GAAEqS,SAAW,SAASC,GACpB,GAAIC,KAAOH,EAAY,EACvB,OAAOE,GAASA,EAASC,EAAKA,GAKhCvS,EAAEwS,kBACAC,SAAc,kBACdC,YAAc,mBACdT,OAAc,mBAMhB,IAAIU,GAAU,OAIVC,GACFxB,IAAU,IACVyB,KAAU,KACVC,KAAU,IACVC,KAAU,IACVC,SAAU,QACVC,SAAU,SAGRzB,EAAU,4BAEV0B,EAAa,SAASzB,GACxB,MAAO,KAAOmB,EAAQnB,GAOxBzR,GAAEmT,SAAW,SAASC,EAAMC,EAAUC,IAC/BD,GAAYC,IAAaD,EAAWC,GACzCD,EAAWrT,EAAE6O,YAAawE,EAAUrT,EAAEwS,iBAGtC,IAAIrP,GAAUyO,SACXyB,EAASpB,QAAUU,GAASlP,QAC5B4P,EAASX,aAAeC,GAASlP,QACjC4P,EAASZ,UAAYE,GAASlP,QAC/BiO,KAAK,KAAO,KAAM,KAGhBhS,EAAQ,EACR+D,EAAS,QACb2P,GAAKpB,QAAQ7O,EAAS,SAASsO,EAAOQ,EAAQS,EAAaD,EAAUc,GAanE,MAZA9P,
 IAAU2P,EAAK1R,MAAMhC,EAAO6T,GAAQvB,QAAQR,EAAS0B,GACrDxT,EAAQ6T,EAAS9B,EAAM9R,OAEnBsS,EACFxO,GAAU,cAAgBwO,EAAS,iCAC1BS,EACTjP,GAAU,cAAgBiP,EAAc,uBAC/BD,IACThP,GAAU,OAASgP,EAAW,YAIzBhB,IAEThO,GAAU,OAGL4P,EAASG,WAAU/P,EAAS,mBAAqBA,EAAS,OAE/DA,EAAS,2CACP,oDACAA,EAAS,eAEX,KACE,GAAIgQ,GAAS,GAAIhS,UAAS4R,EAASG,UAAY,MAAO,IAAK/P,GAC3D,MAAOiQ,GAEP,KADAA,GAAEjQ,OAASA,EACLiQ,EAGR,GAAIP,GAAW,SAASQ,GACtB,MAAOF,GAAO7Q,KAAKzB,KAAMwS,EAAM3T,IAI7B4T,EAAWP,EAASG,UAAY,KAGpC,OAFAL,GAAS1P,OAAS,YAAcmQ,EAAW,OAASnQ,EAAS,IAEtD0P,GAITnT,EAAE6T,MAAQ,SAASvU,GACjB,GAAIwU,GAAW9T,EAAEV,EAEjB,OADAwU,GAASC,QAAS,EACXD,EAUT,IAAIhQ,GAAS,SAASgQ,EAAUxU,GAC9B,MAAOwU,GAASC,OAAS/T,EAAEV,GAAKuU,QAAUvU,EAI5CU,GAAEgU,MAAQ,SAAS1U,GACjBU,EAAEkE,KAAKlE,EAAEmO,UAAU7O,GAAM,SAAS0Q,GAChC,GAAIvN,GAAOzC,EAAEgQ,GAAQ1Q,EAAI0Q,EACzBhQ,GAAEY,UAAUoP,GAAQ,WAClB,GAAI/J,IAAQ9E,KAAKkB,SAEjB,OADApB,GAAK+B,MAAMiD,EAAMhG,WACV6D,EAAO3C,KAAMsB,EAAKO,MAAMhD,EAAGiG,QAMxCjG,EAAEgU,MAAMhU,GAGRA,EAAEkE,MAAM,MAAO,OAAQ,UAAW,QAAS,OAAQ,SAAU,WAAY,SAAS8L,GAChF
 ,GAAIhK,GAAS3E,EAAW2O,EACxBhQ,GAAEY,UAAUoP,GAAQ,WAClB,GAAI1Q,GAAM6B,KAAKkB,QAGf,OAFA2D,GAAOhD,MAAM1D,EAAKW,WACJ,UAAT+P,GAA6B,WAATA,GAAqC,IAAf1Q,EAAIK,cAAqBL,GAAI,GACrEwE,EAAO3C,KAAM7B,MAKxBU,EAAEkE,MAAM,SAAU,OAAQ,SAAU,SAAS8L,GAC3C,GAAIhK,GAAS3E,EAAW2O,EACxBhQ,GAAEY,UAAUoP,GAAQ,WAClB,MAAOlM,GAAO3C,KAAM6E,EAAOhD,MAAM7B,KAAKkB,SAAUpC,eAKpDD,EAAEY,UAAU+B,MAAQ,WAClB,MAAOxB,MAAKkB,UAKdrC,EAAEY,UAAUqT,QAAUjU,EAAEY,UAAUsT,OAASlU,EAAEY,UAAU+B,MAEvD3C,EAAEY,UAAUe,SAAW,WACrB,MAAO,GAAKR,KAAKkB,UAUG,kBAAX8R,SAAyBA,OAAOC,KACzCD,OAAO,gBAAkB,WACvB,MAAOnU,OAGX4C,KAAKzB"}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/tpl/app-add-wizard/create-entity-entry.html
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/tpl/app-add-wizard/create-entity-entry.html b/brooklyn-ui/src/main/webapp/assets/tpl/app-add-wizard/create-entity-entry.html
deleted file mode 100644
index 6f334fd..0000000
--- a/brooklyn-ui/src/main/webapp/assets/tpl/app-add-wizard/create-entity-entry.html
+++ /dev/null
@@ -1,64 +0,0 @@
-
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<div class="editable-entity-group">
-    <div class="editable-entity-heading hide">
-        <span id="entity-name-header"><i>(new entity)</i></span>
-        <div style="float: right;">
-            <button class="btn btn-info btn-mini"><i class="icon-chevron-down"></i></button>
-        </div>
-    </div>
-    
-    <div class="editable-entity-body">
-        <div class="entity-info-message label-message hide">
-            <span class="label-important">ERROR</span>  Invalid entity/type definition
-        </div>
-        
-        <div style="float: right;">
-            <button class="btn btn-info btn-mini remove-entity-button">
-                <i class="icon-remove"></i> </button>
-            <button class="btn btn-info btn-mini editable-entity-button">
-                <i class="icon-chevron-up"></i> </button>
-        </div>
-        <div class="control-group">
-            <div class="controls">
-                <div class="app-add-wizard-create-entity-label">Name</div>
-                <input id="entity-name" type="text" class="input-large app-add-wizard-create-entity-input" name="name" placeholder="name">
-            </div>
-        </div>
-
-        <div class="control-group">
-            <div class="controls">
-                <div class="app-add-wizard-create-entity-label">Type</div>
-                <input id="entity-type" type="text" name="type" class="input-large app-add-wizard-create-entity-input entity-type-input" placeholder="type">
-            </div>
-        </div>
-
-        <div class="control-group">
-            <div class="app-add-wizard-create-entity-label-newline">Configuration</div>
-            <div class="controls">
-            </div>
-            <div>
-                <button id="add-config" class="btn btn-mini btn-info">
-                    Add Configuration</button>
-            </div>
-        </div>
-    </div>
-</div>

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/tpl/app-add-wizard/create-step-template-entry.html
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/tpl/app-add-wizard/create-step-template-entry.html b/brooklyn-ui/src/main/webapp/assets/tpl/app-add-wizard/create-step-template-entry.html
deleted file mode 100644
index 3234c2d..0000000
--- a/brooklyn-ui/src/main/webapp/assets/tpl/app-add-wizard/create-step-template-entry.html
+++ /dev/null
@@ -1,33 +0,0 @@
-
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<div class="template-lozenge frame" id="<%- id %>" data-type="<%- type %>" data-name="<%- name %>" data-yaml="<%- planYaml %>">
-    <% if (iconUrl) { %>
-    <div class="icon">
-        <img src="<%- iconUrl %>" alt="(icon)" />
-    </div>
-    <% } %>
-    <div class="blurb">
-        <div class="title"><%- name %></div>
-        <div class="description">
-            <%- description ? description : "" %>
-        </div>
-    </div>
-</div>

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/tpl/app-add-wizard/create.html
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/tpl/app-add-wizard/create.html b/brooklyn-ui/src/main/webapp/assets/tpl/app-add-wizard/create.html
deleted file mode 100644
index 5ec0150..0000000
--- a/brooklyn-ui/src/main/webapp/assets/tpl/app-add-wizard/create.html
+++ /dev/null
@@ -1,101 +0,0 @@
-
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<div class="info-message label-message hide">
-	<!-- default content, should not be used -->
-    Failure performing specified action
-</div>
-<div class="error-message label-message hide">
-    <div class="label-important">ERROR</div>  <span class="error-message-text">Failure performing specified action</span>
-</div>
-
-<div id="app-add-wizard-create-body">
-
-    <ul class="nav nav-tabs" id="app-add-wizard-create-tab">
-        <li class="active"><a href="#templateTab" data-toggle="tab">Catalog</a></li>
-        <li><a href="#yamlTab" data-toggle="tab">YAML</a></li>
-        
-        <li class="dropdown"><a class="dropdown-toggle" id="dropLanguage"
-            role="button" data-toggle="dropdown" href="#">Other <b class="caret"></b></a>
-            <ul id="menuLanguage" class="dropdown-menu" role="menu" aria-labelledby="dropLanguage">
-                <li><a tabindex="-1" data-toggle="tab" href="#entitiesTab">Build from Entities</a></li>
-                <li><a tabindex="-1" data-toggle="tab" href="#appClassTab">Specify App Class</a></li>
-<!-- TODO
-                <li class="divider"></li>
-                <li><a tabindex="-1" data-toggle="tab" href="#jsonTab">JSON</a></li>
-                <li><a tabindex="-1" data-toggle="tab" href="#xmlTab">XML</a></li>
-                <li><a tabindex="-1" data-toggle="tab" href="#groovyTab">Groovy</a></li>
-                <li><a tabindex="-1" data-toggle="tab" href="#uploadTab">JAR</a></li>
- -->
-            </ul>
-        </li>
-       <li class="text-filter pull-right"><input type="text"/></li>
-    </ul>
-
- <div class="tab-content-scroller">
- <div class="tab-content">
- 
-  <div class="tab-pane active" id="templateTab">
-    <div id="catalog-applications-throbber"><img src="/assets/images/throbber.gif"/></div>
-    <div id="catalog-applications-empty" class="hide">
-      The applications catalog is empty.
-      <br/><br/><br/><br/>
-      <button id="catalog-add" type="button" class="btn btn-mini btn-info">Add to Catalog</button>
-      &nbsp;&nbsp;&nbsp;&nbsp;
-      <button id="catalog-yaml" type="button" class="btn btn-mini btn-info">YAML Blueprint</button>
-    </div>
-    <div id="create-step-template-entries"/>
-  </div>
-  
-  <div class="tab-pane" id="yamlTab">
-    <div id="yamlAccordionish" style="margin: 12px 20px 12px 12px;">
-        <textarea id="yaml_code" spellcheck="false" style="width: 100%; height: 260px;" class="code-textarea" placeholder="Enter CAMP Plan YAML code here"></textarea>
-    </div>
-  </div>
-
-  <div class="tab-pane" id="entitiesTab">
-    <div id="entitiesAccordionish"></div>
-    <button id="add-app-entity" class="btn btn-info btn-mini" style="margin:5px;">Add Additional Entity</button>
-  </div>
-
-  <div class="tab-pane" id="appClassTab">
-        <div class="control-group">
-            <div class="app-add-wizard-create-entity-label-newline">Type</div>
-            <div class="controls app-type">
-                <input id="app-java-type" type="text" name="type" class="input-large app-add-wizard-create-entity-input application-type-input" placeholder="type">
-            </div>
-        </div>
-  </div>
-
-  <div class="tab-pane" id="jsonTab">
-    <br/><br/><i>coming soon!</i>
-  </div>
-  <div class="tab-pane" id="xmlTab">
-    <br/><br/><i>coming soon!</i>
-  </div>
-  <div class="tab-pane" id="groovyTab">
-    <br/><br/><i>coming soon!</i>
-  </div>
-  <div class="tab-pane" id="uploadTab">
-    <br/><br/><i>coming soon!</i>
-  </div>
-    
- </div></div>
-</div>

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/tpl/app-add-wizard/deploy-location-option.html
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/tpl/app-add-wizard/deploy-location-option.html b/brooklyn-ui/src/main/webapp/assets/tpl/app-add-wizard/deploy-location-option.html
deleted file mode 100644
index 6611618..0000000
--- a/brooklyn-ui/src/main/webapp/assets/tpl/app-add-wizard/deploy-location-option.html
+++ /dev/null
@@ -1,23 +0,0 @@
-
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<option value="<%= typeof id !== 'undefined' ? id : url /* both add app wizard and effector (eg addRegion) should now use id, but url left just in case */ %>">
-    <span class="provider"><%= name %></span>
-</option>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/tpl/app-add-wizard/deploy-location-row.html
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/tpl/app-add-wizard/deploy-location-row.html b/brooklyn-ui/src/main/webapp/assets/tpl/app-add-wizard/deploy-location-row.html
deleted file mode 100644
index bb41b44..0000000
--- a/brooklyn-ui/src/main/webapp/assets/tpl/app-add-wizard/deploy-location-row.html
+++ /dev/null
@@ -1,26 +0,0 @@
-
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<div id="location-row-<%= rowId %>" rowId="<%= rowId %>" initialValue="<%= initialValue %>" class="location-selector-row">
-    <select class="select-location" style="margin:4px 0 4px 0; width:80%"></select>
-    <% if (rowId > 0) { %>
-        <button id="remove-app-location" class="btn btn-info btn-mini" type="button"><i class="icon-minus-sign"></i></button>
-    <% } %>    
-</div>

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/tpl/app-add-wizard/deploy-version-option.html
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/tpl/app-add-wizard/deploy-version-option.html b/brooklyn-ui/src/main/webapp/assets/tpl/app-add-wizard/deploy-version-option.html
deleted file mode 100644
index 72bed97..0000000
--- a/brooklyn-ui/src/main/webapp/assets/tpl/app-add-wizard/deploy-version-option.html
+++ /dev/null
@@ -1,23 +0,0 @@
-
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<option value="<%- version %>">
-    <span class="provider"><%- version %></span>
-</option>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/tpl/app-add-wizard/deploy.html
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/tpl/app-add-wizard/deploy.html b/brooklyn-ui/src/main/webapp/assets/tpl/app-add-wizard/deploy.html
deleted file mode 100644
index d2ea9a9..0000000
--- a/brooklyn-ui/src/main/webapp/assets/tpl/app-add-wizard/deploy.html
+++ /dev/null
@@ -1,64 +0,0 @@
-
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<!-- New application wizard step 1: set name and locations -->
-<div class="deploy">
-
-    <div class="info-message label-message hide">
-        <!-- placeholder, details filled in later -->
-        <span class="label-important">Important</span> More information required 
-    </div>
-    <div class="error-message label-message hide">
-        <!-- placeholder, details usually filled in later -->
-        <div class="label-important">ERROR</div>  <span class="error-message-text">Failure performing specified action</span>
-    </div>
-
-    <div id="app-versions" class="control-group">
-        <div class="deploy-label">Version</div>
-        <select class="select-version" style="margin:4px 0 4px 0; width:80%"></select>
-    </div>
-
-    <div id="app-locations" class="control-group">
-        <div class="deploy-label">Locations</div>
-        <div id="selector-container-location"></div>
-        <button id="add-selector-container" class="btn btn-info btn-mini">
-            Add Additional Location</button>
-    </div>
-
-    <div class="control-group">
-        <div class="application-name-label deploy-label">Name (optional)</div>
-        <div class="controls">
-            <input id="application-name" name="name" type="text"
-                style="width: 80%">
-        </div>
-    </div>
-
-    <div class="control-group">
-        <div class="app-add-wizard-create-entity-label-newline deploy-label">Configuration</div>
-        <div class="required-config-loading"><i>Loading...</i></div>
-        <table class="config-table controls" cellspacing="5">
-        </table>
-        <div>
-            <button id="add-config" class="btn btn-mini btn-info">
-             Add Configuration</button>
-        </div>
-    </div>
-
-</div>

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/tpl/app-add-wizard/edit-config-entry.html
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/tpl/app-add-wizard/edit-config-entry.html b/brooklyn-ui/src/main/webapp/assets/tpl/app-add-wizard/edit-config-entry.html
deleted file mode 100644
index 04ef726..0000000
--- a/brooklyn-ui/src/main/webapp/assets/tpl/app-add-wizard/edit-config-entry.html
+++ /dev/null
@@ -1,28 +0,0 @@
-
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<tr class="controls app-add-wizard-config-entry">
-    <td><input id="key" type="text" class="input-medium" name="key" placeholder="key"></td> 
-    <td><input id="value" type="text" class="input-medium" name="value" placeholder="value" style="width: 250px"></td>
-    
-    <td><button id="remove-config" class="btn btn-info btn-mini" type="button">
-        <i class="icon-minus-sign"></i>
-    </button></td>
-</tr>

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/tpl/app-add-wizard/modal-wizard.html
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/tpl/app-add-wizard/modal-wizard.html b/brooklyn-ui/src/main/webapp/assets/tpl/app-add-wizard/modal-wizard.html
deleted file mode 100644
index 183a4ab..0000000
--- a/brooklyn-ui/src/main/webapp/assets/tpl/app-add-wizard/modal-wizard.html
+++ /dev/null
@@ -1,35 +0,0 @@
-
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<div class="modal-header">
-    <button type="button" class="close" data-dismiss="modal">x</button>
-    <h3 id="step_title">Title placeholder</h3>
-
-    <p id="step_instructions">Instructions placeholder</p>
-</div>
-
-<div class="modal-body"></div>
-
-<div class="modal-footer">
-    <button id="prev_step" type="button button-previous" class="btn btn-mini btn-info">Back</button>
-    <button id="next_step" type="button button-next" class="btn btn-mini btn-info">Next</button>
-    <button id="preview_step" type="button button-preview" class="btn btn-mini btn-info">Preview</button>
-    <button id="finish_step" type="button button-finish" class="btn btn-mini btn-info">Finish</button>
-</div>

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/tpl/app-add-wizard/required-config-entry.html
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/tpl/app-add-wizard/required-config-entry.html b/brooklyn-ui/src/main/webapp/assets/tpl/app-add-wizard/required-config-entry.html
deleted file mode 100644
index 45c8770..0000000
--- a/brooklyn-ui/src/main/webapp/assets/tpl/app-add-wizard/required-config-entry.html
+++ /dev/null
@@ -1,47 +0,0 @@
-
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<tr class="controls app-add-wizard-config-entry">
-    <td><% if (data.label) { %><%= data.label %><% } else { %><%= data.name %><% } %>
-    <input id="key" type="text" class="input-medium" name="key" value="<%= data.name %>" style="display: none;">
-    &nbsp;&nbsp;&nbsp;
-    </td>
-    <td> 
-    <% if (data.type==="java.lang.Boolean" || data.type==="boolean") { %>
-      <input id="checkboxValue" type="checkbox" class="input-medium" name="checkboxValue<%
-        if (data.defaultValue===true) { %>" checked="true<% } 
-        %>">
-    <% } else if (data.type==="java.lang.Enum") { %>
-      <select id="value" class="input-medium" name="value" style="width: 250px">
-        <% var length = data.possibleValues.length,
-            element = null;
-        for (var i = 0; i < length; i++) {
-          element = data.possibleValues[i]; %>
-        <option value="<%= element.value %>"<% if (data.defaultValue == element.value) { %> selected="selected"<% } %>><%= element.description %></option>
-        <% } %>
-      </select>
-    <% } else { %>
-     <input id="value" type="text" class="input-medium" name="value" value="<% 
-        if (typeof data.defaultValue !== "undefined") { %><%- data.defaultValue %><% } 
-        %>" style="width: 250px">
-    <% } %>
-    </td>
-    <td></td>
-</tr>

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/tpl/apps/activities.html
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/tpl/apps/activities.html b/brooklyn-ui/src/main/webapp/assets/tpl/apps/activities.html
deleted file mode 100644
index d8a2e76..0000000
--- a/brooklyn-ui/src/main/webapp/assets/tpl/apps/activities.html
+++ /dev/null
@@ -1,30 +0,0 @@
-
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<div id="activities-table-group" class="slide-panel-group">
-    <div id="activities-root" class="table-scroll-wrapper slide-panel" width="569">
-    </div>
-</div>
-
-<div>&nbsp;</div>
-
-<div id="activity-details">
-</div>
-

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/tpl/apps/activity-details.html
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/tpl/apps/activity-details.html b/brooklyn-ui/src/main/webapp/assets/tpl/apps/activity-details.html
deleted file mode 100644
index 50773ed..0000000
--- a/brooklyn-ui/src/main/webapp/assets/tpl/apps/activity-details.html
+++ /dev/null
@@ -1,141 +0,0 @@
-
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<div class="subpanel-header-row">
-    <div>
-     <div style="float: left;"><i class="backDrillDown icon-chevron-left handy" rel="tooltip" title="Back up one level" style="margin-top: 3px;"></i>&nbsp;</div>
-     <div style="margin-bottom: 6px;">
-      <span style="font-weight: 400;" class="ifField-entityDisplayName hide"><span class="updateField-entityDisplayName"/>:</span>
-      <div style="display: inline-block;" class="updateField-displayName">Loading...</div>
-     </div>
-     <% for (crumb in breadcrumbs) { %>
-     <div style="margin-right: 20px; font-weight: 400; font-size: 80%; text-align: right; line-height: 14px;">
-        <%= breadcrumbs[crumb] %></span>
-     </div>
-     <% } %>
-    </div>
-</div>
-
-<div class="activity-details-section activity-description">
-    <span class="updateField-description"/>
-</div>
-<div class="activity-details-section activity-status">
-    <b><span class="updateField-currentStatus"/></b>
-    <span class="ifField-blockingDetails hide">- <span class="updateField-blockingDetails"/></span>
-    <span class="ifField-blockingTask hide"> (blocked on <span class="updateField-blockingTask"/>)</span>
-    <span class="updateField-result activity-detail-results"/>
-</div>
-
-  <div class="toggler-region task-summary">
-    <div class="toggler-header">
-      <div class="toggler-icon icon-chevron-down"></div>
-      <div><b>Summary</b></div>
-    </div>
-    <div>
-
-<div class="activity-details-section activity-name-and-id">
-    <span class="activity-label">Name:</span> <span class="updateField-displayName">Loading...</span> <br/>
-    <span class="activity-label">ID:</span> <span class="updateField-id"><%= taskId %></span>
-</div>
-<div class="activity-details-section activity-time">
-    <!-- these are dynamic -->
-    <div class="ifField-submitTimeUtc"><span class="activity-label">Submitted:</span> 
-        <span class="updateField-submitTimeUtc"/></div>
-    <div class="ifField-startTimeUtc"><span class="activity-label">Started:</span>
-        <span class="updateField-startTimeUtc"/></div>
-    <div class="ifField-endTimeUtc"><span class="activity-label">Finished:</span>
-        <span class="updateField-endTimeUtc"/></div>
-</div>
-<div class="ifField-submittedByTask">
-  <div class="activity-details-section activity-tags">
-    <span class="activity-label">Submitted by:</span> 
-        <span class="updateField-submittedByTask"/>
-  </div>
-</div>
-
-    </div>
-  </div>
-    
-  <div class="toggler-region tasks-streams ifField-streams">
-    <div class="toggler-header">
-      <div class="toggler-icon icon-chevron-down"></div>
-      <div><b>Available Streams</b></div>
-    </div>
-    <div class="activity-details-section updateField-streams">
-    </div>
-  </div>
-    
-  <div class="toggler-region tasks-children">
-    <div class="toggler-header">
-      <div class="toggler-icon icon-chevron-down"></div>
-      <div><b>Children Tasks</b></div>
-    </div>
-    <div class="activity-details-section activity-tasks-children">
-      <div id="activities-children-table" class="table-scroll-wrapper">
-      </div>
-    </div>
-  </div>
-    
-  <div class="toggler-region tasks-submitted">
-    <div class="toggler-header user-hidden">
-      <div class="toggler-icon icon-chevron-left"></div>
-      <div><b>Background Tasks</b></div>
-    </div>
-    <div class="activity-details-section activity-tasks-submitted hide">
-      <div id="activities-submitted-table" class="table-scroll-wrapper">
-      </div>
-    </div>
-  </div>
-
-  <div class="ifField-tags toggler-region task-tags">
-    <div class="toggler-header user-hidden">
-      <div class="toggler-icon icon-chevron-left"></div>
-      <div><b>Tags</b></div>
-    </div>
-    <div class="activity-details-section activity-tags hide">
-        <span class="updateField-tags"></span>
-    </div>
-  </div>
-
-  <div class="toggler-region task-detail">
-    <div class="toggler-header user-hidden">
-      <div class="toggler-icon icon-chevron-left"></div>
-      <div><b>Detailed Status</b></div>
-    </div>
-    <div class="activity-details-section activity-detailStatus hide">
-     <div class="for-textarea">
-      <textarea id="detailStatus-textrea" readonly="readonly" style="width: 100%;"></textarea>
-     </div>
-    </div>
-  </div>
-        
-  <div class="toggler-region task-json">
-    <div class="toggler-header user-hidden">
-      <div class="toggler-icon icon-chevron-left"></div>
-      <div><b>JSON</b></div>
-    </div>
-    <div class="activity-details-section activity-json hide">
-     <div class="for-textarea">
-      <textarea id="json-textrea" readonly="readonly" style="width: 100%;"></textarea>
-     </div>
-    </div>     
-  </div>
-    
-</div>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/tpl/apps/activity-full-details.html
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/tpl/apps/activity-full-details.html b/brooklyn-ui/src/main/webapp/assets/tpl/apps/activity-full-details.html
deleted file mode 100644
index 065a080..0000000
--- a/brooklyn-ui/src/main/webapp/assets/tpl/apps/activity-full-details.html
+++ /dev/null
@@ -1,25 +0,0 @@
-
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<div class="for-activity-textarea">
-    <textarea readonly="readonly" rows="1" style="width:100%;"><%= 
-        task.attributes.detailedStatus 
-    %></textarea>
-</div>

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/tpl/apps/activity-row-details-main.html
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/tpl/apps/activity-row-details-main.html b/brooklyn-ui/src/main/webapp/assets/tpl/apps/activity-row-details-main.html
deleted file mode 100644
index b804cfa..0000000
--- a/brooklyn-ui/src/main/webapp/assets/tpl/apps/activity-row-details-main.html
+++ /dev/null
@@ -1,28 +0,0 @@
-
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-    <% if (task.startTimeUtc) { %>started <%= moment(task.startTimeUtc).fromNow() %><% 
-        if (task.submitTimeUtc != task.startTimeUtc) { %> (submitted <%= moment(task.submitTimeUtc).from(task.startTimeUtc, true) %> earlier)<% } 
-        if (task.endTimeUtc) { %>, finished after <%= moment(task.endTimeUtc).from(task.startTimeUtc, true) %> 
-        <% } else { %>, in progress
-        <% } %>
-    <% } else { %>
-       submitted <%= moment(task.submitTimeUtc).fromNow() %>, waiting
-    <% } %>

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/tpl/apps/activity-row-details.html
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/tpl/apps/activity-row-details.html b/brooklyn-ui/src/main/webapp/assets/tpl/apps/activity-row-details.html
deleted file mode 100644
index f01b357..0000000
--- a/brooklyn-ui/src/main/webapp/assets/tpl/apps/activity-row-details.html
+++ /dev/null
@@ -1,39 +0,0 @@
-
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<div class="opened-row-details <% if (!updateOnly) { %> hide<% } %>">
-<% if (task == null) { %> <i>No information available</i> <% } else { %>
-  <div>
-    <div class="expansion-header">
-      <div style="float: right;" class="toolbar-row">
-        <!--  <a class="handy icon-book toggleLog"></a> -->
-        <a href="<%= link %>"><i class="handy icon-file showJson" rel="tooltip" title="JSON direct link"></i></a>
-        <i class="handy icon-inbox toggleFullDetail" rel="tooltip" title="Show even more detail"></i>
-        <i class="handy icon-chevron-right showDrillDown" rel="tooltip" title="Drill into sub-tasks"></i>
-      </div>
-      <b><i><span class="task-description"><%= task.description %></span></i></b>
-    </div>
-    <div class="expansion-main">
-    </div>
-    <div class="expansion-footer">
-    </div>
-  </div>
-<% } %>
-</div>

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/tpl/apps/activity-table.html
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/tpl/apps/activity-table.html b/brooklyn-ui/src/main/webapp/assets/tpl/apps/activity-table.html
deleted file mode 100644
index c745cdd..0000000
--- a/brooklyn-ui/src/main/webapp/assets/tpl/apps/activity-table.html
+++ /dev/null
@@ -1,31 +0,0 @@
-
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<table class="activity-table" width="569">
-    <thead>
-    <tr>
-        <th width="0%"></th>
-        <th width="40%">Task</th>
-        <th width="30%">Submitted</th>
-        <th width="30%">Status</th>
-    </tr>
-    </thead>
-    <tbody></tbody>
-</table>

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/tpl/apps/add-child-modal.html
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/tpl/apps/add-child-modal.html b/brooklyn-ui/src/main/webapp/assets/tpl/apps/add-child-modal.html
deleted file mode 100644
index 015372f..0000000
--- a/brooklyn-ui/src/main/webapp/assets/tpl/apps/add-child-modal.html
+++ /dev/null
@@ -1,35 +0,0 @@
-
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<!-- modal to render effector-->
-
-    <h4 style="margin-bottom: 9px;">YAML Specification</h4>
-    <p>Add a child or children to this entity by providing a YAML blueprint</p>
-
-    <div class="for-textarea">
-      <textarea id="child-spec" class="code-textarea" style="height: 120px;"/>
-    </div>
-    
-    <label><input type="checkbox" id="child-autostart" checked="checked"/> Auto-start </label>
-
-    <div class="hide alert alert-error child-add-error-container" style="margin-top: 9px;">
-        <strong>Error</strong>
-        <span class="child-add-error-message"></span>
-    </div>

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/tpl/apps/advanced.html
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/tpl/apps/advanced.html b/brooklyn-ui/src/main/webapp/assets/tpl/apps/advanced.html
deleted file mode 100644
index 19fb8fc..0000000
--- a/brooklyn-ui/src/main/webapp/assets/tpl/apps/advanced.html
+++ /dev/null
@@ -1,75 +0,0 @@
-
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<div id="advanced-summary">
-  <button id="change-name" class="btn pull-right">Change Name</button>
-  <h3><span id="entity-name">Entity</span></h3>
-
-<div style="text-align: center; padding-top: 24px;">
-  <button id="add-child" class="btn">Add Child</button>
-  <button id="add-new-policy" class="btn">Attach New Policy</button>
-  <button id="reset-problems" class="btn">Reset Problems</button>
-<!-- TODO:
-  <button id="set-config" class="btn">Set Config</button>
-  <button id="edit-sensor" class="btn">Set Sensor</button>
- -->
-  <button id="expunge" class="btn">Expunge</button>
-  <button id="unmanage" class="btn">Unmanage</button>
-</div>
-
-<div id="change-name-modal" class="modal hide fade"></div>
-<div id="add-child-modal" class="modal hide fade"></div>
-<div id="policy-modal" class="modal hide fade"></div>
-
-<div id="advanced-tab-error-section" class="hide" style="margin-top: 36px; color: red;">
-  <div id="advanced-tab-error-closer" style="float: right;"><button type="button" class="close" data-dismiss="modal">x</button></div>
-  <div id="advanced-tab-error-message"></div>
-</div>
-
-  <div class="toggler-region region-config" style="margin-top: 18px;">
-    <div class="toggler-header user-hidden">
-      <div class="toggler-icon icon-chevron-left"></div>
-      <div><b>Tags</b></div>
-    </div>
-    <div id="advanced-entity-tags" class="hide">Tags not loaded</div>
-  </div>
-
-  <!-- TODO persistence -->
-  
-  <div class="toggler-region region-config" style="margin-top: 18px;">
-    <div class="toggler-header user-hidden">
-      <div class="toggler-icon icon-chevron-left"></div>
-      <div><b>Entity Resource JSON</b></div>
-    </div>
-    <div id="advanced-entity-json" class="for-textarea hide">
-      <textarea readonly="readonly" class="code-textarea"/>
-    </div>
-  </div>
-
-  <div class="toggler-region region-config" style="margin-top: 18px;">
-    <div class="toggler-header user-hidden">
-      <div class="toggler-icon icon-chevron-left"></div>
-      <div><b>Locations JSON</b></div>
-    </div>
-    <div id="advanced-locations" class="for-textarea hide">
-      <!-- TODO a nicer view than just the JSON -->
-      <textarea readonly="readonly" class="code-textarea"/>
-    </div>
-  </div>


[15/51] [abbrv] [partial] brooklyn-ui git commit: move subdir from incubator up a level as it is promoted to its own repo (first non-incubator commit!)

Posted by he...@apache.org.
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/js/config.js
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/js/config.js b/src/main/webapp/assets/js/config.js
new file mode 100644
index 0000000..6710ff1
--- /dev/null
+++ b/src/main/webapp/assets/js/config.js
@@ -0,0 +1,84 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+*/
+/*
+ * set the require.js configuration for your application
+ */
+require.config({
+    /* Give 30s (default is 7s) in case it's a very poor slow network */
+    waitSeconds:30,
+    
+    /* Libraries */
+    baseUrl:"assets/js",
+    paths:{
+        "jquery":"libs/jquery",
+        "underscore":"libs/underscore",
+        "backbone":"libs/backbone",
+        "bootstrap":"libs/bootstrap",
+        "jquery-form":"libs/jquery.form",
+        "jquery-datatables":"libs/jquery.dataTables",
+        "jquery-slideto":"util/jquery.slideto",
+        "jquery-wiggle":"libs/jquery.wiggle.min",
+        "jquery-ba-bbq":"libs/jquery.ba-bbq.min",
+        "moment":"libs/moment",
+        "handlebars":"libs/handlebars-1.0.rc.1",
+        "brooklyn":"util/brooklyn",
+        "brooklyn-view":"util/brooklyn-view",
+        "brooklyn-utils":"util/brooklyn-utils",
+        "datatables-extensions":"util/dataTables.extensions",
+        "googlemaps":"view/googlemaps",
+        "async":"libs/async",  //not explicitly referenced, but needed for google
+        "text":"libs/text",
+        "uri":"libs/URI",
+        "zeroclipboard":"libs/ZeroClipboard",
+        "js-yaml":"libs/js-yaml",
+        
+        "tpl":"../tpl"
+    },
+    
+    shim:{
+        "underscore":{
+            exports:"_"
+        },
+        "backbone":{
+            deps:[ "underscore", "jquery" ],
+            exports:"Backbone"
+        },
+        "jquery-datatables": {
+            deps: [ "jquery" ]
+        },
+        "datatables-extensions":{
+            deps:[ "jquery", "jquery-datatables" ]
+        },
+        "jquery-form": { deps: [ "jquery" ] },
+        "jquery-slideto": { deps: [ "jquery" ] },
+        "jquery-wiggle": { deps: [ "jquery" ] },
+        "jquery-ba-bbq": { deps: [ "jquery" ] },
+        "handlebars": { deps: [ "jquery" ] },
+        "bootstrap": { deps: [ "jquery" ] /* http://stackoverflow.com/questions/9227406/bootstrap-typeerror-undefined-is-not-a-function-has-no-method-tab-when-us */ }
+    }
+});
+
+/*
+ * Main application entry point.
+ */
+require([
+    "router"
+], function (Router) {
+    new Router().startBrooklynGui();
+});

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/js/libs/URI.js
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/js/libs/URI.js b/src/main/webapp/assets/js/libs/URI.js
new file mode 100644
index 0000000..e621a06
--- /dev/null
+++ b/src/main/webapp/assets/js/libs/URI.js
@@ -0,0 +1,133 @@
+/*
+ * Taken from http://code.google.com/p/js-uri/ v0.1.  BSD license.
+ * No changes in this Brooklyn copy, apart from these header lines.
+ * TODO Consider switching to  http://medialize.github.io/URI.js/  which appears more modern.
+ * 
+ *  
+ * An URI datatype.  Based upon examples in RFC3986.
+ *
+ * TODO %-escaping
+ * TODO split apart authority
+ * TODO split apart query_string (on demand, anyway)
+ *
+ * @(#) $Id$
+ */
+ 
+// Constructor for the URI object.  Parse a string into its components.
+function URI(str) {
+    if (!str) str = "";
+    // Based on the regex in RFC2396 Appendix B.
+    var parser = /^(?:([^:\/?\#]+):)?(?:\/\/([^\/?\#]*))?([^?\#]*)(?:\?([^\#]*))?(?:\#(.*))?/;
+    var result = str.match(parser);
+    this.scheme    = result[1] || null;
+    this.authority = result[2] || null;
+    this.path      = result[3] || null;
+    this.query     = result[4] || null;
+    this.fragment  = result[5] || null;
+}
+
+// Restore the URI to it's stringy glory.
+URI.prototype.toString = function () {
+    var str = "";
+    if (this.scheme) {
+        str += this.scheme + ":";
+    }
+    if (this.authority) {
+        str += "//" + this.authority;
+    }
+    if (this.path) {
+        str += this.path;
+    }
+    if (this.query) {
+        str += "?" + this.query;
+    }
+    if (this.fragment) {
+        str += "#" + this.fragment;
+    }
+    return str;
+};
+
+// Introduce a new scope to define some private helper functions.
+(function () {
+    // RFC3986 §5.2.3 (Merge Paths)
+    function merge(base, rel_path) {
+        var dirname = /^(.*)\//;
+        if (base.authority && !base.path) {
+            return "/" + rel_path;
+        }
+        else {
+            return base.path.match(dirname)[0] + rel_path;
+        }
+    }
+
+    // Match two path segments, where the second is ".." and the first must
+    // not be "..".
+    var DoubleDot = /\/((?!\.\.\/)[^\/]*)\/\.\.\//;
+
+    function remove_dot_segments(path) {
+        if (!path) return "";
+        // Remove any single dots
+        var newpath = path.replace(/\/\.\//g, '/');
+        // Remove any trailing single dots.
+        newpath = newpath.replace(/\/\.$/, '/');
+        // Remove any double dots and the path previous.  NB: We can't use
+        // the "g", modifier because we are changing the string that we're
+        // matching over.
+        while (newpath.match(DoubleDot)) {
+            newpath = newpath.replace(DoubleDot, '/');
+        }
+        // Remove any trailing double dots.
+        newpath = newpath.replace(/\/([^\/]*)\/\.\.$/, '/');
+        // If there are any remaining double dot bits, then they're wrong
+        // and must be nuked.  Again, we can't use the g modifier.
+        while (newpath.match(/\/\.\.\//)) {
+            newpath = newpath.replace(/\/\.\.\//, '/');
+        }
+        return newpath;
+    }
+
+    // RFC3986 §5.2.2. Transform References;
+    URI.prototype.resolve = function (base) {
+        var target = new URI();
+        if (this.scheme) {
+            target.scheme    = this.scheme;
+            target.authority = this.authority;
+            target.path      = remove_dot_segments(this.path);
+            target.query     = this.query;
+        }
+        else {
+            if (this.authority) {
+                target.authority = this.authority;
+                target.path      = remove_dot_segments(this.path);
+                target.query     = this.query;
+            }        
+            else {
+                // XXX Original spec says "if defined and empty"…;
+                if (!this.path) {
+                    target.path = base.path;
+                    if (this.query) {
+                        target.query = this.query;
+                    }
+                    else {
+                        target.query = base.query;
+                    }
+                }
+                else {
+                    if (this.path.charAt(0) === '/') {
+                        target.path = remove_dot_segments(this.path);
+                    } else {
+                        target.path = merge(base, this.path);
+                        target.path = remove_dot_segments(target.path);
+                    }
+                    target.query = this.query;
+                }
+                target.authority = base.authority;
+            }
+            target.scheme = base.scheme;
+        }
+
+        target.fragment = this.fragment;
+
+        return target;
+    };
+})();

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/js/libs/ZeroClipboard.js
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/js/libs/ZeroClipboard.js b/src/main/webapp/assets/js/libs/ZeroClipboard.js
new file mode 100644
index 0000000..bcdabf5
--- /dev/null
+++ b/src/main/webapp/assets/js/libs/ZeroClipboard.js
@@ -0,0 +1,1015 @@
+/*!
+* ZeroClipboard
+* The ZeroClipboard library provides an easy way to copy text to the clipboard using an invisible Adobe Flash movie and a JavaScript interface.
+* Copyright (c) 2014 Jon Rohan, James M. Greene
+* Licensed MIT
+* http://zeroclipboard.org/
+* v1.3.1
+*
+* BROOKLYN NOTE: The accompanying SWF artifact can also be built from source using a free toolchain
+* as described at https://github.com/zeroclipboard/zeroclipboard/blob/master/CONTRIBUTING.md .
+* (It has been included in the Apache project as a binary artifact because building it is tedious.
+* Also- it is small!) This paragraph is the only change to this source file.
+*/
+(function() {
+  "use strict";
+  var currentElement;
+  var flashState = {
+    bridge: null,
+    version: "0.0.0",
+    disabled: null,
+    outdated: null,
+    ready: null
+  };
+  var _clipData = {};
+  var clientIdCounter = 0;
+  var _clientMeta = {};
+  var elementIdCounter = 0;
+  var _elementMeta = {};
+  var _amdModuleId = null;
+  var _cjsModuleId = null;
+  var _swfPath = function() {
+    var i, jsDir, tmpJsPath, jsPath, swfPath = "ZeroClipboard.swf";
+    if (document.currentScript && (jsPath = document.currentScript.src)) {} else {
+      var scripts = document.getElementsByTagName("script");
+      if ("readyState" in scripts[0]) {
+        for (i = scripts.length; i--; ) {
+          if (scripts[i].readyState === "interactive" && (jsPath = scripts[i].src)) {
+            break;
+          }
+        }
+      } else if (document.readyState === "loading") {
+        jsPath = scripts[scripts.length - 1].src;
+      } else {
+        for (i = scripts.length; i--; ) {
+          tmpJsPath = scripts[i].src;
+          if (!tmpJsPath) {
+            jsDir = null;
+            break;
+          }
+          tmpJsPath = tmpJsPath.split("#")[0].split("?")[0];
+          tmpJsPath = tmpJsPath.slice(0, tmpJsPath.lastIndexOf("/") + 1);
+          if (jsDir == null) {
+            jsDir = tmpJsPath;
+          } else if (jsDir !== tmpJsPath) {
+            jsDir = null;
+            break;
+          }
+        }
+        if (jsDir !== null) {
+          jsPath = jsDir;
+        }
+      }
+    }
+    if (jsPath) {
+      jsPath = jsPath.split("#")[0].split("?")[0];
+      swfPath = jsPath.slice(0, jsPath.lastIndexOf("/") + 1) + swfPath;
+    }
+    return swfPath;
+  }();
+  var _camelizeCssPropName = function() {
+    var matcherRegex = /\-([a-z])/g, replacerFn = function(match, group) {
+      return group.toUpperCase();
+    };
+    return function(prop) {
+      return prop.replace(matcherRegex, replacerFn);
+    };
+  }();
+  var _getStyle = function(el, prop) {
+    var value, camelProp, tagName, possiblePointers, i, len;
+    if (window.getComputedStyle) {
+      value = window.getComputedStyle(el, null).getPropertyValue(prop);
+    } else {
+      camelProp = _camelizeCssPropName(prop);
+      if (el.currentStyle) {
+        value = el.currentStyle[camelProp];
+      } else {
+        value = el.style[camelProp];
+      }
+    }
+    if (prop === "cursor") {
+      if (!value || value === "auto") {
+        tagName = el.tagName.toLowerCase();
+        if (tagName === "a") {
+          return "pointer";
+        }
+      }
+    }
+    return value;
+  };
+  var _elementMouseOver = function(event) {
+    if (!event) {
+      event = window.event;
+    }
+    var target;
+    if (this !== window) {
+      target = this;
+    } else if (event.target) {
+      target = event.target;
+    } else if (event.srcElement) {
+      target = event.srcElement;
+    }
+    ZeroClipboard.activate(target);
+  };
+  var _addEventHandler = function(element, method, func) {
+    if (!element || element.nodeType !== 1) {
+      return;
+    }
+    if (element.addEventListener) {
+      element.addEventListener(method, func, false);
+    } else if (element.attachEvent) {
+      element.attachEvent("on" + method, func);
+    }
+  };
+  var _removeEventHandler = function(element, method, func) {
+    if (!element || element.nodeType !== 1) {
+      return;
+    }
+    if (element.removeEventListener) {
+      element.removeEventListener(method, func, false);
+    } else if (element.detachEvent) {
+      element.detachEvent("on" + method, func);
+    }
+  };
+  var _addClass = function(element, value) {
+    if (!element || element.nodeType !== 1) {
+      return element;
+    }
+    if (element.classList) {
+      if (!element.classList.contains(value)) {
+        element.classList.add(value);
+      }
+      return element;
+    }
+    if (value && typeof value === "string") {
+      var classNames = (value || "").split(/\s+/);
+      if (element.nodeType === 1) {
+        if (!element.className) {
+          element.className = value;
+        } else {
+          var className = " " + element.className + " ", setClass = element.className;
+          for (var c = 0, cl = classNames.length; c < cl; c++) {
+            if (className.indexOf(" " + classNames[c] + " ") < 0) {
+              setClass += " " + classNames[c];
+            }
+          }
+          element.className = setClass.replace(/^\s+|\s+$/g, "");
+        }
+      }
+    }
+    return element;
+  };
+  var _removeClass = function(element, value) {
+    if (!element || element.nodeType !== 1) {
+      return element;
+    }
+    if (element.classList) {
+      if (element.classList.contains(value)) {
+        element.classList.remove(value);
+      }
+      return element;
+    }
+    if (value && typeof value === "string" || value === undefined) {
+      var classNames = (value || "").split(/\s+/);
+      if (element.nodeType === 1 && element.className) {
+        if (value) {
+          var className = (" " + element.className + " ").replace(/[\n\t]/g, " ");
+          for (var c = 0, cl = classNames.length; c < cl; c++) {
+            className = className.replace(" " + classNames[c] + " ", " ");
+          }
+          element.className = className.replace(/^\s+|\s+$/g, "");
+        } else {
+          element.className = "";
+        }
+      }
+    }
+    return element;
+  };
+  var _getZoomFactor = function() {
+    var rect, physicalWidth, logicalWidth, zoomFactor = 1;
+    if (typeof document.body.getBoundingClientRect === "function") {
+      rect = document.body.getBoundingClientRect();
+      physicalWidth = rect.right - rect.left;
+      logicalWidth = document.body.offsetWidth;
+      zoomFactor = Math.round(physicalWidth / logicalWidth * 100) / 100;
+    }
+    return zoomFactor;
+  };
+  var _getDOMObjectPosition = function(obj, defaultZIndex) {
+    var info = {
+      left: 0,
+      top: 0,
+      width: 0,
+      height: 0,
+      zIndex: _getSafeZIndex(defaultZIndex) - 1
+    };
+    if (obj.getBoundingClientRect) {
+      var rect = obj.getBoundingClientRect();
+      var pageXOffset, pageYOffset, zoomFactor;
+      if ("pageXOffset" in window && "pageYOffset" in window) {
+        pageXOffset = window.pageXOffset;
+        pageYOffset = window.pageYOffset;
+      } else {
+        zoomFactor = _getZoomFactor();
+        pageXOffset = Math.round(document.documentElement.scrollLeft / zoomFactor);
+        pageYOffset = Math.round(document.documentElement.scrollTop / zoomFactor);
+      }
+      var leftBorderWidth = document.documentElement.clientLeft || 0;
+      var topBorderWidth = document.documentElement.clientTop || 0;
+      info.left = rect.left + pageXOffset - leftBorderWidth;
+      info.top = rect.top + pageYOffset - topBorderWidth;
+      info.width = "width" in rect ? rect.width : rect.right - rect.left;
+      info.height = "height" in rect ? rect.height : rect.bottom - rect.top;
+    }
+    return info;
+  };
+  var _cacheBust = function(path, options) {
+    var cacheBust = options == null || options && options.cacheBust === true && options.useNoCache === true;
+    if (cacheBust) {
+      return (path.indexOf("?") === -1 ? "?" : "&") + "noCache=" + new Date().getTime();
+    } else {
+      return "";
+    }
+  };
+  var _vars = function(options) {
+    var i, len, domain, str = [], domains = [], trustedOriginsExpanded = [];
+    if (options.trustedOrigins) {
+      if (typeof options.trustedOrigins === "string") {
+        domains.push(options.trustedOrigins);
+      } else if (typeof options.trustedOrigins === "object" && "length" in options.trustedOrigins) {
+        domains = domains.concat(options.trustedOrigins);
+      }
+    }
+    if (options.trustedDomains) {
+      if (typeof options.trustedDomains === "string") {
+        domains.push(options.trustedDomains);
+      } else if (typeof options.trustedDomains === "object" && "length" in options.trustedDomains) {
+        domains = domains.concat(options.trustedDomains);
+      }
+    }
+    if (domains.length) {
+      for (i = 0, len = domains.length; i < len; i++) {
+        if (domains.hasOwnProperty(i) && domains[i] && typeof domains[i] === "string") {
+          domain = _extractDomain(domains[i]);
+          if (!domain) {
+            continue;
+          }
+          if (domain === "*") {
+            trustedOriginsExpanded = [ domain ];
+            break;
+          }
+          trustedOriginsExpanded.push.apply(trustedOriginsExpanded, [ domain, "//" + domain, window.location.protocol + "//" + domain ]);
+        }
+      }
+    }
+    if (trustedOriginsExpanded.length) {
+      str.push("trustedOrigins=" + encodeURIComponent(trustedOriginsExpanded.join(",")));
+    }
+    if (typeof options.jsModuleId === "string" && options.jsModuleId) {
+      str.push("jsModuleId=" + encodeURIComponent(options.jsModuleId));
+    }
+    return str.join("&");
+  };
+  var _inArray = function(elem, array, fromIndex) {
+    if (typeof array.indexOf === "function") {
+      return array.indexOf(elem, fromIndex);
+    }
+    var i, len = array.length;
+    if (typeof fromIndex === "undefined") {
+      fromIndex = 0;
+    } else if (fromIndex < 0) {
+      fromIndex = len + fromIndex;
+    }
+    for (i = fromIndex; i < len; i++) {
+      if (array.hasOwnProperty(i) && array[i] === elem) {
+        return i;
+      }
+    }
+    return -1;
+  };
+  var _prepClip = function(elements) {
+    if (typeof elements === "string") throw new TypeError("ZeroClipboard doesn't accept query strings.");
+    if (!elements.length) return [ elements ];
+    return elements;
+  };
+  var _dispatchCallback = function(func, context, args, async) {
+    if (async) {
+      window.setTimeout(function() {
+        func.apply(context, args);
+      }, 0);
+    } else {
+      func.apply(context, args);
+    }
+  };
+  var _getSafeZIndex = function(val) {
+    var zIndex, tmp;
+    if (val) {
+      if (typeof val === "number" && val > 0) {
+        zIndex = val;
+      } else if (typeof val === "string" && (tmp = parseInt(val, 10)) && !isNaN(tmp) && tmp > 0) {
+        zIndex = tmp;
+      }
+    }
+    if (!zIndex) {
+      if (typeof _globalConfig.zIndex === "number" && _globalConfig.zIndex > 0) {
+        zIndex = _globalConfig.zIndex;
+      } else if (typeof _globalConfig.zIndex === "string" && (tmp = parseInt(_globalConfig.zIndex, 10)) && !isNaN(tmp) && tmp > 0) {
+        zIndex = tmp;
+      }
+    }
+    return zIndex || 0;
+  };
+  var _deprecationWarning = function(deprecatedApiName, debugEnabled) {
+    if (deprecatedApiName && debugEnabled !== false && typeof console !== "undefined" && console && (console.warn || console.log)) {
+      var deprecationWarning = "`" + deprecatedApiName + "` is deprecated. See docs for more info:\n" + "    https://github.com/zeroclipboard/zeroclipboard/blob/master/docs/instructions.md#deprecations";
+      if (console.warn) {
+        console.warn(deprecationWarning);
+      } else {
+        console.log(deprecationWarning);
+      }
+    }
+  };
+  var _extend = function() {
+    var i, len, arg, prop, src, copy, target = arguments[0] || {};
+    for (i = 1, len = arguments.length; i < len; i++) {
+      if ((arg = arguments[i]) != null) {
+        for (prop in arg) {
+          if (arg.hasOwnProperty(prop)) {
+            src = target[prop];
+            copy = arg[prop];
+            if (target === copy) {
+              continue;
+            }
+            if (copy !== undefined) {
+              target[prop] = copy;
+            }
+          }
+        }
+      }
+    }
+    return target;
+  };
+  var _extractDomain = function(originOrUrl) {
+    if (originOrUrl == null || originOrUrl === "") {
+      return null;
+    }
+    originOrUrl = originOrUrl.replace(/^\s+|\s+$/g, "");
+    if (originOrUrl === "") {
+      return null;
+    }
+    var protocolIndex = originOrUrl.indexOf("//");
+    originOrUrl = protocolIndex === -1 ? originOrUrl : originOrUrl.slice(protocolIndex + 2);
+    var pathIndex = originOrUrl.indexOf("/");
+    originOrUrl = pathIndex === -1 ? originOrUrl : protocolIndex === -1 || pathIndex === 0 ? null : originOrUrl.slice(0, pathIndex);
+    if (originOrUrl && originOrUrl.slice(-4).toLowerCase() === ".swf") {
+      return null;
+    }
+    return originOrUrl || null;
+  };
+  var _determineScriptAccess = function() {
+    var _extractAllDomains = function(origins, resultsArray) {
+      var i, len, tmp;
+      if (origins != null && resultsArray[0] !== "*") {
+        if (typeof origins === "string") {
+          origins = [ origins ];
+        }
+        if (typeof origins === "object" && "length" in origins) {
+          for (i = 0, len = origins.length; i < len; i++) {
+            if (origins.hasOwnProperty(i)) {
+              tmp = _extractDomain(origins[i]);
+              if (tmp) {
+                if (tmp === "*") {
+                  resultsArray.length = 0;
+                  resultsArray.push("*");
+                  break;
+                }
+                if (_inArray(tmp, resultsArray) === -1) {
+                  resultsArray.push(tmp);
+                }
+              }
+            }
+          }
+        }
+      }
+    };
+    var _accessLevelLookup = {
+      always: "always",
+      samedomain: "sameDomain",
+      never: "never"
+    };
+    return function(currentDomain, configOptions) {
+      var asaLower, allowScriptAccess = configOptions.allowScriptAccess;
+      if (typeof allowScriptAccess === "string" && (asaLower = allowScriptAccess.toLowerCase()) && /^always|samedomain|never$/.test(asaLower)) {
+        return _accessLevelLookup[asaLower];
+      }
+      var swfDomain = _extractDomain(configOptions.moviePath);
+      if (swfDomain === null) {
+        swfDomain = currentDomain;
+      }
+      var trustedDomains = [];
+      _extractAllDomains(configOptions.trustedOrigins, trustedDomains);
+      _extractAllDomains(configOptions.trustedDomains, trustedDomains);
+      var len = trustedDomains.length;
+      if (len > 0) {
+        if (len === 1 && trustedDomains[0] === "*") {
+          return "always";
+        }
+        if (_inArray(currentDomain, trustedDomains) !== -1) {
+          if (len === 1 && currentDomain === swfDomain) {
+            return "sameDomain";
+          }
+          return "always";
+        }
+      }
+      return "never";
+    };
+  }();
+  var _objectKeys = function(obj) {
+    if (obj == null) {
+      return [];
+    }
+    if (Object.keys) {
+      return Object.keys(obj);
+    }
+    var keys = [];
+    for (var prop in obj) {
+      if (obj.hasOwnProperty(prop)) {
+        keys.push(prop);
+      }
+    }
+    return keys;
+  };
+  var _deleteOwnProperties = function(obj) {
+    if (obj) {
+      for (var prop in obj) {
+        if (obj.hasOwnProperty(prop)) {
+          delete obj[prop];
+        }
+      }
+    }
+    return obj;
+  };
+  var _detectFlashSupport = function() {
+    var hasFlash = false;
+    if (typeof flashState.disabled === "boolean") {
+      hasFlash = flashState.disabled === false;
+    } else {
+      if (typeof ActiveXObject === "function") {
+        try {
+          if (new ActiveXObject("ShockwaveFlash.ShockwaveFlash")) {
+            hasFlash = true;
+          }
+        } catch (error) {}
+      }
+      if (!hasFlash && navigator.mimeTypes["application/x-shockwave-flash"]) {
+        hasFlash = true;
+      }
+    }
+    return hasFlash;
+  };
+  function _parseFlashVersion(flashVersion) {
+    return flashVersion.replace(/,/g, ".").replace(/[^0-9\.]/g, "");
+  }
+  function _isFlashVersionSupported(flashVersion) {
+    return parseFloat(_parseFlashVersion(flashVersion)) >= 10;
+  }
+  var ZeroClipboard = function(elements, options) {
+    if (!(this instanceof ZeroClipboard)) {
+      return new ZeroClipboard(elements, options);
+    }
+    this.id = "" + clientIdCounter++;
+    _clientMeta[this.id] = {
+      instance: this,
+      elements: [],
+      handlers: {}
+    };
+    if (elements) {
+      this.clip(elements);
+    }
+    if (typeof options !== "undefined") {
+      _deprecationWarning("new ZeroClipboard(elements, options)", _globalConfig.debug);
+      ZeroClipboard.config(options);
+    }
+    this.options = ZeroClipboard.config();
+    if (typeof flashState.disabled !== "boolean") {
+      flashState.disabled = !_detectFlashSupport();
+    }
+    if (flashState.disabled === false && flashState.outdated !== true) {
+      if (flashState.bridge === null) {
+        flashState.outdated = false;
+        flashState.ready = false;
+        _bridge();
+      }
+    }
+  };
+  ZeroClipboard.prototype.setText = function(newText) {
+    if (newText && newText !== "") {
+      _clipData["text/plain"] = newText;
+      if (flashState.ready === true && flashState.bridge) {
+        flashState.bridge.setText(newText);
+      } else {}
+    }
+    return this;
+  };
+  ZeroClipboard.prototype.setSize = function(width, height) {
+    if (flashState.ready === true && flashState.bridge) {
+      flashState.bridge.setSize(width, height);
+    } else {}
+    return this;
+  };
+  var _setHandCursor = function(enabled) {
+    if (flashState.ready === true && flashState.bridge) {
+      flashState.bridge.setHandCursor(enabled);
+    } else {}
+  };
+  ZeroClipboard.prototype.destroy = function() {
+    this.unclip();
+    this.off();
+    delete _clientMeta[this.id];
+  };
+  var _getAllClients = function() {
+    var i, len, client, clients = [], clientIds = _objectKeys(_clientMeta);
+    for (i = 0, len = clientIds.length; i < len; i++) {
+      client = _clientMeta[clientIds[i]].instance;
+      if (client && client instanceof ZeroClipboard) {
+        clients.push(client);
+      }
+    }
+    return clients;
+  };
+  ZeroClipboard.version = "1.3.1";
+  var _globalConfig = {
+    swfPath: _swfPath,
+    trustedDomains: window.location.host ? [ window.location.host ] : [],
+    cacheBust: true,
+    forceHandCursor: false,
+    zIndex: 999999999,
+    debug: true,
+    title: null,
+    autoActivate: true
+  };
+  ZeroClipboard.config = function(options) {
+    if (typeof options === "object" && options !== null) {
+      _extend(_globalConfig, options);
+    }
+    if (typeof options === "string" && options) {
+      if (_globalConfig.hasOwnProperty(options)) {
+        return _globalConfig[options];
+      }
+      return;
+    }
+    var copy = {};
+    for (var prop in _globalConfig) {
+      if (_globalConfig.hasOwnProperty(prop)) {
+        if (typeof _globalConfig[prop] === "object" && _globalConfig[prop] !== null) {
+          if ("length" in _globalConfig[prop]) {
+            copy[prop] = _globalConfig[prop].slice(0);
+          } else {
+            copy[prop] = _extend({}, _globalConfig[prop]);
+          }
+        } else {
+          copy[prop] = _globalConfig[prop];
+        }
+      }
+    }
+    return copy;
+  };
+  ZeroClipboard.destroy = function() {
+    ZeroClipboard.deactivate();
+    for (var clientId in _clientMeta) {
+      if (_clientMeta.hasOwnProperty(clientId) && _clientMeta[clientId]) {
+        var client = _clientMeta[clientId].instance;
+        if (client && typeof client.destroy === "function") {
+          client.destroy();
+        }
+      }
+    }
+    var htmlBridge = _getHtmlBridge(flashState.bridge);
+    if (htmlBridge && htmlBridge.parentNode) {
+      htmlBridge.parentNode.removeChild(htmlBridge);
+      flashState.ready = null;
+      flashState.bridge = null;
+    }
+  };
+  ZeroClipboard.activate = function(element) {
+    if (currentElement) {
+      _removeClass(currentElement, _globalConfig.hoverClass);
+      _removeClass(currentElement, _globalConfig.activeClass);
+    }
+    currentElement = element;
+    _addClass(element, _globalConfig.hoverClass);
+    _reposition();
+    var newTitle = _globalConfig.title || element.getAttribute("title");
+    if (newTitle) {
+      var htmlBridge = _getHtmlBridge(flashState.bridge);
+      if (htmlBridge) {
+        htmlBridge.setAttribute("title", newTitle);
+      }
+    }
+    var useHandCursor = _globalConfig.forceHandCursor === true || _getStyle(element, "cursor") === "pointer";
+    _setHandCursor(useHandCursor);
+  };
+  ZeroClipboard.deactivate = function() {
+    var htmlBridge = _getHtmlBridge(flashState.bridge);
+    if (htmlBridge) {
+      htmlBridge.style.left = "0px";
+      htmlBridge.style.top = "-9999px";
+      htmlBridge.removeAttribute("title");
+    }
+    if (currentElement) {
+      _removeClass(currentElement, _globalConfig.hoverClass);
+      _removeClass(currentElement, _globalConfig.activeClass);
+      currentElement = null;
+    }
+  };
+  var _bridge = function() {
+    var flashBridge, len;
+    var container = document.getElementById("global-zeroclipboard-html-bridge");
+    if (!container) {
+      var opts = ZeroClipboard.config();
+      opts.jsModuleId = typeof _amdModuleId === "string" && _amdModuleId || typeof _cjsModuleId === "string" && _cjsModuleId || null;
+      var allowScriptAccess = _determineScriptAccess(window.location.host, _globalConfig);
+      var flashvars = _vars(opts);
+      var swfUrl = _globalConfig.moviePath + _cacheBust(_globalConfig.moviePath, _globalConfig);
+      var html = '      <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" id="global-zeroclipboard-flash-bridge" width="100%" height="100%">         <param name="movie" value="' + swfUrl + '"/>         <param name="allowScriptAccess" value="' + allowScriptAccess + '"/>         <param name="scale" value="exactfit"/>         <param name="loop" value="false"/>         <param name="menu" value="false"/>         <param name="quality" value="best" />         <param name="bgcolor" value="#ffffff"/>         <param name="wmode" value="transparent"/>         <param name="flashvars" value="' + flashvars + '"/>         <embed src="' + swfUrl + '"           loop="false" menu="false"           quality="best" bgcolor="#ffffff"           width="100%" height="100%"           name="global-zeroclipboard-flash-bridge"           allowScriptAccess="' + allowScriptAccess + '"           allowFullScreen="false"           type="application/x-shockwave-flash"           wmode="transparent"          
  pluginspage="http://www.macromedia.com/go/getflashplayer"           flashvars="' + flashvars + '"           scale="exactfit">         </embed>       </object>';
+      container = document.createElement("div");
+      container.id = "global-zeroclipboard-html-bridge";
+      container.setAttribute("class", "global-zeroclipboard-container");
+      container.style.position = "absolute";
+      container.style.left = "0px";
+      container.style.top = "-9999px";
+      container.style.width = "15px";
+      container.style.height = "15px";
+      container.style.zIndex = "" + _getSafeZIndex(_globalConfig.zIndex);
+      document.body.appendChild(container);
+      container.innerHTML = html;
+    }
+    flashBridge = document["global-zeroclipboard-flash-bridge"];
+    if (flashBridge && (len = flashBridge.length)) {
+      flashBridge = flashBridge[len - 1];
+    }
+    flashState.bridge = flashBridge || container.children[0].lastElementChild;
+  };
+  var _getHtmlBridge = function(flashBridge) {
+    var isFlashElement = /^OBJECT|EMBED$/;
+    var htmlBridge = flashBridge && flashBridge.parentNode;
+    while (htmlBridge && isFlashElement.test(htmlBridge.nodeName) && htmlBridge.parentNode) {
+      htmlBridge = htmlBridge.parentNode;
+    }
+    return htmlBridge || null;
+  };
+  var _reposition = function() {
+    if (currentElement) {
+      var pos = _getDOMObjectPosition(currentElement, _globalConfig.zIndex);
+      var htmlBridge = _getHtmlBridge(flashState.bridge);
+      if (htmlBridge) {
+        htmlBridge.style.top = pos.top + "px";
+        htmlBridge.style.left = pos.left + "px";
+        htmlBridge.style.width = pos.width + "px";
+        htmlBridge.style.height = pos.height + "px";
+        htmlBridge.style.zIndex = pos.zIndex + 1;
+      }
+      if (flashState.ready === true && flashState.bridge) {
+        flashState.bridge.setSize(pos.width, pos.height);
+      }
+    }
+    return this;
+  };
+  ZeroClipboard.prototype.on = function(eventName, func) {
+    var i, len, events, added = {}, handlers = _clientMeta[this.id] && _clientMeta[this.id].handlers;
+    if (typeof eventName === "string" && eventName) {
+      events = eventName.toLowerCase().split(/\s+/);
+    } else if (typeof eventName === "object" && eventName && typeof func === "undefined") {
+      for (i in eventName) {
+        if (eventName.hasOwnProperty(i) && typeof i === "string" && i && typeof eventName[i] === "function") {
+          this.on(i, eventName[i]);
+        }
+      }
+    }
+    if (events && events.length) {
+      for (i = 0, len = events.length; i < len; i++) {
+        eventName = events[i].replace(/^on/, "");
+        added[eventName] = true;
+        if (!handlers[eventName]) {
+          handlers[eventName] = [];
+        }
+        handlers[eventName].push(func);
+      }
+      if (added.noflash && flashState.disabled) {
+        _receiveEvent.call(this, "noflash", {});
+      }
+      if (added.wrongflash && flashState.outdated) {
+        _receiveEvent.call(this, "wrongflash", {
+          flashVersion: flashState.version
+        });
+      }
+      if (added.load && flashState.ready) {
+        _receiveEvent.call(this, "load", {
+          flashVersion: flashState.version
+        });
+      }
+    }
+    return this;
+  };
+  ZeroClipboard.prototype.off = function(eventName, func) {
+    var i, len, foundIndex, events, perEventHandlers, handlers = _clientMeta[this.id] && _clientMeta[this.id].handlers;
+    if (arguments.length === 0) {
+      events = _objectKeys(handlers);
+    } else if (typeof eventName === "string" && eventName) {
+      events = eventName.split(/\s+/);
+    } else if (typeof eventName === "object" && eventName && typeof func === "undefined") {
+      for (i in eventName) {
+        if (eventName.hasOwnProperty(i) && typeof i === "string" && i && typeof eventName[i] === "function") {
+          this.off(i, eventName[i]);
+        }
+      }
+    }
+    if (events && events.length) {
+      for (i = 0, len = events.length; i < len; i++) {
+        eventName = events[i].toLowerCase().replace(/^on/, "");
+        perEventHandlers = handlers[eventName];
+        if (perEventHandlers && perEventHandlers.length) {
+          if (func) {
+            foundIndex = _inArray(func, perEventHandlers);
+            while (foundIndex !== -1) {
+              perEventHandlers.splice(foundIndex, 1);
+              foundIndex = _inArray(func, perEventHandlers, foundIndex);
+            }
+          } else {
+            handlers[eventName].length = 0;
+          }
+        }
+      }
+    }
+    return this;
+  };
+  ZeroClipboard.prototype.handlers = function(eventName) {
+    var prop, copy = null, handlers = _clientMeta[this.id] && _clientMeta[this.id].handlers;
+    if (handlers) {
+      if (typeof eventName === "string" && eventName) {
+        return handlers[eventName] ? handlers[eventName].slice(0) : null;
+      }
+      copy = {};
+      for (prop in handlers) {
+        if (handlers.hasOwnProperty(prop) && handlers[prop]) {
+          copy[prop] = handlers[prop].slice(0);
+        }
+      }
+    }
+    return copy;
+  };
+  var _dispatchClientCallbacks = function(eventName, context, args, async) {
+    var handlers = _clientMeta[this.id] && _clientMeta[this.id].handlers[eventName];
+    if (handlers && handlers.length) {
+      var i, len, func, originalContext = context || this;
+      for (i = 0, len = handlers.length; i < len; i++) {
+        func = handlers[i];
+        context = originalContext;
+        if (typeof func === "string" && typeof window[func] === "function") {
+          func = window[func];
+        }
+        if (typeof func === "object" && func && typeof func.handleEvent === "function") {
+          context = func;
+          func = func.handleEvent;
+        }
+        if (typeof func === "function") {
+          _dispatchCallback(func, context, args, async);
+        }
+      }
+    }
+    return this;
+  };
+  ZeroClipboard.prototype.clip = function(elements) {
+    elements = _prepClip(elements);
+    for (var i = 0; i < elements.length; i++) {
+      if (elements.hasOwnProperty(i) && elements[i] && elements[i].nodeType === 1) {
+        if (!elements[i].zcClippingId) {
+          elements[i].zcClippingId = "zcClippingId_" + elementIdCounter++;
+          _elementMeta[elements[i].zcClippingId] = [ this.id ];
+          if (_globalConfig.autoActivate === true) {
+            _addEventHandler(elements[i], "mouseover", _elementMouseOver);
+          }
+        } else if (_inArray(this.id, _elementMeta[elements[i].zcClippingId]) === -1) {
+          _elementMeta[elements[i].zcClippingId].push(this.id);
+        }
+        var clippedElements = _clientMeta[this.id].elements;
+        if (_inArray(elements[i], clippedElements) === -1) {
+          clippedElements.push(elements[i]);
+        }
+      }
+    }
+    return this;
+  };
+  ZeroClipboard.prototype.unclip = function(elements) {
+    var meta = _clientMeta[this.id];
+    if (meta) {
+      var clippedElements = meta.elements;
+      var arrayIndex;
+      if (typeof elements === "undefined") {
+        elements = clippedElements.slice(0);
+      } else {
+        elements = _prepClip(elements);
+      }
+      for (var i = elements.length; i--; ) {
+        if (elements.hasOwnProperty(i) && elements[i] && elements[i].nodeType === 1) {
+          arrayIndex = 0;
+          while ((arrayIndex = _inArray(elements[i], clippedElements, arrayIndex)) !== -1) {
+            clippedElements.splice(arrayIndex, 1);
+          }
+          var clientIds = _elementMeta[elements[i].zcClippingId];
+          if (clientIds) {
+            arrayIndex = 0;
+            while ((arrayIndex = _inArray(this.id, clientIds, arrayIndex)) !== -1) {
+              clientIds.splice(arrayIndex, 1);
+            }
+            if (clientIds.length === 0) {
+              if (_globalConfig.autoActivate === true) {
+                _removeEventHandler(elements[i], "mouseover", _elementMouseOver);
+              }
+              delete elements[i].zcClippingId;
+            }
+          }
+        }
+      }
+    }
+    return this;
+  };
+  ZeroClipboard.prototype.elements = function() {
+    var meta = _clientMeta[this.id];
+    return meta && meta.elements ? meta.elements.slice(0) : [];
+  };
+  var _getAllClientsClippedToElement = function(element) {
+    var elementMetaId, clientIds, i, len, client, clients = [];
+    if (element && element.nodeType === 1 && (elementMetaId = element.zcClippingId) && _elementMeta.hasOwnProperty(elementMetaId)) {
+      clientIds = _elementMeta[elementMetaId];
+      if (clientIds && clientIds.length) {
+        for (i = 0, len = clientIds.length; i < len; i++) {
+          client = _clientMeta[clientIds[i]].instance;
+          if (client && client instanceof ZeroClipboard) {
+            clients.push(client);
+          }
+        }
+      }
+    }
+    return clients;
+  };
+  _globalConfig.hoverClass = "zeroclipboard-is-hover";
+  _globalConfig.activeClass = "zeroclipboard-is-active";
+  _globalConfig.trustedOrigins = null;
+  _globalConfig.allowScriptAccess = null;
+  _globalConfig.useNoCache = true;
+  _globalConfig.moviePath = "ZeroClipboard.swf";
+  ZeroClipboard.detectFlashSupport = function() {
+    _deprecationWarning("ZeroClipboard.detectFlashSupport", _globalConfig.debug);
+    return _detectFlashSupport();
+  };
+  ZeroClipboard.dispatch = function(eventName, args) {
+    if (typeof eventName === "string" && eventName) {
+      var cleanEventName = eventName.toLowerCase().replace(/^on/, "");
+      if (cleanEventName) {
+        var clients = currentElement ? _getAllClientsClippedToElement(currentElement) : _getAllClients();
+        for (var i = 0, len = clients.length; i < len; i++) {
+          _receiveEvent.call(clients[i], cleanEventName, args);
+        }
+      }
+    }
+  };
+  ZeroClipboard.prototype.setHandCursor = function(enabled) {
+    _deprecationWarning("ZeroClipboard.prototype.setHandCursor", _globalConfig.debug);
+    enabled = typeof enabled === "boolean" ? enabled : !!enabled;
+    _setHandCursor(enabled);
+    _globalConfig.forceHandCursor = enabled;
+    return this;
+  };
+  ZeroClipboard.prototype.reposition = function() {
+    _deprecationWarning("ZeroClipboard.prototype.reposition", _globalConfig.debug);
+    return _reposition();
+  };
+  ZeroClipboard.prototype.receiveEvent = function(eventName, args) {
+    _deprecationWarning("ZeroClipboard.prototype.receiveEvent", _globalConfig.debug);
+    if (typeof eventName === "string" && eventName) {
+      var cleanEventName = eventName.toLowerCase().replace(/^on/, "");
+      if (cleanEventName) {
+        _receiveEvent.call(this, cleanEventName, args);
+      }
+    }
+  };
+  ZeroClipboard.prototype.setCurrent = function(element) {
+    _deprecationWarning("ZeroClipboard.prototype.setCurrent", _globalConfig.debug);
+    ZeroClipboard.activate(element);
+    return this;
+  };
+  ZeroClipboard.prototype.resetBridge = function() {
+    _deprecationWarning("ZeroClipboard.prototype.resetBridge", _globalConfig.debug);
+    ZeroClipboard.deactivate();
+    return this;
+  };
+  ZeroClipboard.prototype.setTitle = function(newTitle) {
+    _deprecationWarning("ZeroClipboard.prototype.setTitle", _globalConfig.debug);
+    newTitle = newTitle || _globalConfig.title || currentElement && currentElement.getAttribute("title");
+    if (newTitle) {
+      var htmlBridge = _getHtmlBridge(flashState.bridge);
+      if (htmlBridge) {
+        htmlBridge.setAttribute("title", newTitle);
+      }
+    }
+    return this;
+  };
+  ZeroClipboard.setDefaults = function(options) {
+    _deprecationWarning("ZeroClipboard.setDefaults", _globalConfig.debug);
+    ZeroClipboard.config(options);
+  };
+  ZeroClipboard.prototype.addEventListener = function(eventName, func) {
+    _deprecationWarning("ZeroClipboard.prototype.addEventListener", _globalConfig.debug);
+    return this.on(eventName, func);
+  };
+  ZeroClipboard.prototype.removeEventListener = function(eventName, func) {
+    _deprecationWarning("ZeroClipboard.prototype.removeEventListener", _globalConfig.debug);
+    return this.off(eventName, func);
+  };
+  ZeroClipboard.prototype.ready = function() {
+    _deprecationWarning("ZeroClipboard.prototype.ready", _globalConfig.debug);
+    return flashState.ready === true;
+  };
+  var _receiveEvent = function(eventName, args) {
+    eventName = eventName.toLowerCase().replace(/^on/, "");
+    var cleanVersion = args && args.flashVersion && _parseFlashVersion(args.flashVersion) || null;
+    var element = currentElement;
+    var performCallbackAsync = true;
+    switch (eventName) {
+     case "load":
+      if (cleanVersion) {
+        if (!_isFlashVersionSupported(cleanVersion)) {
+          _receiveEvent.call(this, "onWrongFlash", {
+            flashVersion: cleanVersion
+          });
+          return;
+        }
+        flashState.outdated = false;
+        flashState.ready = true;
+        flashState.version = cleanVersion;
+      }
+      break;
+
+     case "wrongflash":
+      if (cleanVersion && !_isFlashVersionSupported(cleanVersion)) {
+        flashState.outdated = true;
+        flashState.ready = false;
+        flashState.version = cleanVersion;
+      }
+      break;
+
+     case "mouseover":
+      _addClass(element, _globalConfig.hoverClass);
+      break;
+
+     case "mouseout":
+      if (_globalConfig.autoActivate === true) {
+        ZeroClipboard.deactivate();
+      }
+      break;
+
+     case "mousedown":
+      _addClass(element, _globalConfig.activeClass);
+      break;
+
+     case "mouseup":
+      _removeClass(element, _globalConfig.activeClass);
+      break;
+
+     case "datarequested":
+      var targetId = element.getAttribute("data-clipboard-target"), targetEl = !targetId ? null : document.getElementById(targetId);
+      if (targetEl) {
+        var textContent = targetEl.value || targetEl.textContent || targetEl.innerText;
+        if (textContent) {
+          this.setText(textContent);
+        }
+      } else {
+        var defaultText = element.getAttribute("data-clipboard-text");
+        if (defaultText) {
+          this.setText(defaultText);
+        }
+      }
+      performCallbackAsync = false;
+      break;
+
+     case "complete":
+      _deleteOwnProperties(_clipData);
+      break;
+    }
+    var context = element;
+    var eventArgs = [ this, args ];
+    return _dispatchClientCallbacks.call(this, eventName, context, eventArgs, performCallbackAsync);
+  };
+  if (typeof define === "function" && define.amd) {
+    define([ "require", "exports", "module" ], function(require, exports, module) {
+      _amdModuleId = module && module.id || null;
+      return ZeroClipboard;
+    });
+  } else if (typeof module === "object" && module && typeof module.exports === "object" && module.exports) {
+    _cjsModuleId = module.id || null;
+    module.exports = ZeroClipboard;
+  } else {
+    window.ZeroClipboard = ZeroClipboard;
+  }
+})();

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/js/libs/async.js
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/js/libs/async.js b/src/main/webapp/assets/js/libs/async.js
new file mode 100644
index 0000000..535b3b5
--- /dev/null
+++ b/src/main/webapp/assets/js/libs/async.js
@@ -0,0 +1,46 @@
+/** 
+ * FROM https://github.com/p15martin/google-maps-hello-world/blob/master/js/libs/async.js
+ * ORIGINALLY https://github.com/millermedeiros/requirejs-plugins
+ * 
+ * @license
+ * RequireJS plugin for async dependency load like JSONP and Google Maps
+ * Author: Miller Medeiros
+ * Version: 0.1.1 (2011/11/17)
+ * Released under the MIT license
+ */
+define(function(){
+
+    var DEFAULT_PARAM_NAME = 'callback',
+        _uid = 0;
+
+    function injectScript(src){
+        var s, t;
+        s = document.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = src;
+        t = document.getElementsByTagName('script')[0]; t.parentNode.insertBefore(s,t);
+    }
+
+    function formatUrl(name, id){
+        var paramRegex = /!(.+)/,
+            url = name.replace(paramRegex, ''),
+            param = (paramRegex.test(name))? name.replace(/.+!/, '') : DEFAULT_PARAM_NAME;
+        url += (url.indexOf('?') < 0)? '?' : '&';
+        return url + param +'='+ id;
+    }
+
+    function uid() {
+        _uid += 1;
+        return '__async_req_'+ _uid +'__';
+    }
+
+    return{
+        load : function(name, req, onLoad, config){
+            if(config.isBuild){
+                onLoad(null); //avoid errors on the optimizer
+            }else{
+                var id = uid();
+                window[id] = onLoad; //create a global variable that stores onLoad so callback function can define new module after async load
+                injectScript(formatUrl(name, id));
+            }
+        }
+    };
+});
\ No newline at end of file


[06/51] [abbrv] [partial] brooklyn-ui git commit: move subdir from incubator up a level as it is promoted to its own repo (first non-incubator commit!)

Posted by he...@apache.org.
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/js/libs/moment.js
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/js/libs/moment.js b/src/main/webapp/assets/js/libs/moment.js
new file mode 100644
index 0000000..c8a870e
--- /dev/null
+++ b/src/main/webapp/assets/js/libs/moment.js
@@ -0,0 +1,1662 @@
+// moment.js
+// version : 2.1.0
+// author : Tim Wood
+// license : MIT
+// momentjs.com
+
+(function (undefined) {
+
+    /************************************
+        Constants
+    ************************************/
+
+    var moment,
+        VERSION = "2.1.0",
+        round = Math.round, i,
+        // internal storage for language config files
+        languages = {},
+
+        // check for nodeJS
+        hasModule = (typeof module !== 'undefined' && module.exports),
+
+        // ASP.NET json date format regex
+        aspNetJsonRegex = /^\/?Date\((\-?\d+)/i,
+        aspNetTimeSpanJsonRegex = /(\-)?(\d*)?\.?(\d+)\:(\d+)\:(\d+)\.?(\d{3})?/,
+
+        // format tokens
+        formattingTokens = /(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|SS?S?|X|zz?|ZZ?|.)/g,
+        localFormattingTokens = /(\[[^\[]*\])|(\\)?(LT|LL?L?L?|l{1,4})/g,
+
+        // parsing token regexes
+        parseTokenOneOrTwoDigits = /\d\d?/, // 0 - 99
+        parseTokenOneToThreeDigits = /\d{1,3}/, // 0 - 999
+        parseTokenThreeDigits = /\d{3}/, // 000 - 999
+        parseTokenFourDigits = /\d{1,4}/, // 0 - 9999
+        parseTokenSixDigits = /[+\-]?\d{1,6}/, // -999,999 - 999,999
+        parseTokenWord = /[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i, // any word (or two) characters or numbers including two/three word month in arabic.
+        parseTokenTimezone = /Z|[\+\-]\d\d:?\d\d/i, // +00:00 -00:00 +0000 -0000 or Z
+        parseTokenT = /T/i, // T (ISO seperator)
+        parseTokenTimestampMs = /[\+\-]?\d+(\.\d{1,3})?/, // 123456789 123456789.123
+
+        // preliminary iso regex
+        // 0000-00-00 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000
+        isoRegex = /^\s*\d{4}-\d\d-\d\d((T| )(\d\d(:\d\d(:\d\d(\.\d\d?\d?)?)?)?)?([\+\-]\d\d:?\d\d)?)?/,
+        isoFormat = 'YYYY-MM-DDTHH:mm:ssZ',
+
+        // iso time formats and regexes
+        isoTimes = [
+            ['HH:mm:ss.S', /(T| )\d\d:\d\d:\d\d\.\d{1,3}/],
+            ['HH:mm:ss', /(T| )\d\d:\d\d:\d\d/],
+            ['HH:mm', /(T| )\d\d:\d\d/],
+            ['HH', /(T| )\d\d/]
+        ],
+
+        // timezone chunker "+10:00" > ["10", "00"] or "-1530" > ["-15", "30"]
+        parseTimezoneChunker = /([\+\-]|\d\d)/gi,
+
+        // getter and setter names
+        proxyGettersAndSetters = 'Date|Hours|Minutes|Seconds|Milliseconds'.split('|'),
+        unitMillisecondFactors = {
+            'Milliseconds' : 1,
+            'Seconds' : 1e3,
+            'Minutes' : 6e4,
+            'Hours' : 36e5,
+            'Days' : 864e5,
+            'Months' : 2592e6,
+            'Years' : 31536e6
+        },
+
+        unitAliases = {
+            ms : 'millisecond',
+            s : 'second',
+            m : 'minute',
+            h : 'hour',
+            d : 'day',
+            w : 'week',
+            M : 'month',
+            y : 'year'
+        },
+
+        // format function strings
+        formatFunctions = {},
+
+        // tokens to ordinalize and pad
+        ordinalizeTokens = 'DDD w W M D d'.split(' '),
+        paddedTokens = 'M D H h m s w W'.split(' '),
+
+        formatTokenFunctions = {
+            M    : function () {
+                return this.month() + 1;
+            },
+            MMM  : function (format) {
+                return this.lang().monthsShort(this, format);
+            },
+            MMMM : function (format) {
+                return this.lang().months(this, format);
+            },
+            D    : function () {
+                return this.date();
+            },
+            DDD  : function () {
+                return this.dayOfYear();
+            },
+            d    : function () {
+                return this.day();
+            },
+            dd   : function (format) {
+                return this.lang().weekdaysMin(this, format);
+            },
+            ddd  : function (format) {
+                return this.lang().weekdaysShort(this, format);
+            },
+            dddd : function (format) {
+                return this.lang().weekdays(this, format);
+            },
+            w    : function () {
+                return this.week();
+            },
+            W    : function () {
+                return this.isoWeek();
+            },
+            YY   : function () {
+                return leftZeroFill(this.year() % 100, 2);
+            },
+            YYYY : function () {
+                return leftZeroFill(this.year(), 4);
+            },
+            YYYYY : function () {
+                return leftZeroFill(this.year(), 5);
+            },
+            gg   : function () {
+                return leftZeroFill(this.weekYear() % 100, 2);
+            },
+            gggg : function () {
+                return this.weekYear();
+            },
+            ggggg : function () {
+                return leftZeroFill(this.weekYear(), 5);
+            },
+            GG   : function () {
+                return leftZeroFill(this.isoWeekYear() % 100, 2);
+            },
+            GGGG : function () {
+                return this.isoWeekYear();
+            },
+            GGGGG : function () {
+                return leftZeroFill(this.isoWeekYear(), 5);
+            },
+            e : function () {
+                return this.weekday();
+            },
+            E : function () {
+                return this.isoWeekday();
+            },
+            a    : function () {
+                return this.lang().meridiem(this.hours(), this.minutes(), true);
+            },
+            A    : function () {
+                return this.lang().meridiem(this.hours(), this.minutes(), false);
+            },
+            H    : function () {
+                return this.hours();
+            },
+            h    : function () {
+                return this.hours() % 12 || 12;
+            },
+            m    : function () {
+                return this.minutes();
+            },
+            s    : function () {
+                return this.seconds();
+            },
+            S    : function () {
+                return ~~(this.milliseconds() / 100);
+            },
+            SS   : function () {
+                return leftZeroFill(~~(this.milliseconds() / 10), 2);
+            },
+            SSS  : function () {
+                return leftZeroFill(this.milliseconds(), 3);
+            },
+            Z    : function () {
+                var a = -this.zone(),
+                    b = "+";
+                if (a < 0) {
+                    a = -a;
+                    b = "-";
+                }
+                return b + leftZeroFill(~~(a / 60), 2) + ":" + leftZeroFill(~~a % 60, 2);
+            },
+            ZZ   : function () {
+                var a = -this.zone(),
+                    b = "+";
+                if (a < 0) {
+                    a = -a;
+                    b = "-";
+                }
+                return b + leftZeroFill(~~(10 * a / 6), 4);
+            },
+            z : function () {
+                return this.zoneAbbr();
+            },
+            zz : function () {
+                return this.zoneName();
+            },
+            X    : function () {
+                return this.unix();
+            }
+        };
+
+    function padToken(func, count) {
+        return function (a) {
+            return leftZeroFill(func.call(this, a), count);
+        };
+    }
+    function ordinalizeToken(func, period) {
+        return function (a) {
+            return this.lang().ordinal(func.call(this, a), period);
+        };
+    }
+
+    while (ordinalizeTokens.length) {
+        i = ordinalizeTokens.pop();
+        formatTokenFunctions[i + 'o'] = ordinalizeToken(formatTokenFunctions[i], i);
+    }
+    while (paddedTokens.length) {
+        i = paddedTokens.pop();
+        formatTokenFunctions[i + i] = padToken(formatTokenFunctions[i], 2);
+    }
+    formatTokenFunctions.DDDD = padToken(formatTokenFunctions.DDD, 3);
+
+
+    /************************************
+        Constructors
+    ************************************/
+
+    function Language() {
+
+    }
+
+    // Moment prototype object
+    function Moment(config) {
+        extend(this, config);
+    }
+
+    // Duration Constructor
+    function Duration(duration) {
+        var years = duration.years || duration.year || duration.y || 0,
+            months = duration.months || duration.month || duration.M || 0,
+            weeks = duration.weeks || duration.week || duration.w || 0,
+            days = duration.days || duration.day || duration.d || 0,
+            hours = duration.hours || duration.hour || duration.h || 0,
+            minutes = duration.minutes || duration.minute || duration.m || 0,
+            seconds = duration.seconds || duration.second || duration.s || 0,
+            milliseconds = duration.milliseconds || duration.millisecond || duration.ms || 0;
+
+        // store reference to input for deterministic cloning
+        this._input = duration;
+
+        // representation for dateAddRemove
+        this._milliseconds = milliseconds +
+            seconds * 1e3 + // 1000
+            minutes * 6e4 + // 1000 * 60
+            hours * 36e5; // 1000 * 60 * 60
+        // Because of dateAddRemove treats 24 hours as different from a
+        // day when working around DST, we need to store them separately
+        this._days = days +
+            weeks * 7;
+        // It is impossible translate months into days without knowing
+        // which months you are are talking about, so we have to store
+        // it separately.
+        this._months = months +
+            years * 12;
+
+        this._data = {};
+
+        this._bubble();
+    }
+
+
+    /************************************
+        Helpers
+    ************************************/
+
+
+    function extend(a, b) {
+        for (var i in b) {
+            if (b.hasOwnProperty(i)) {
+                a[i] = b[i];
+            }
+        }
+        return a;
+    }
+
+    function absRound(number) {
+        if (number < 0) {
+            return Math.ceil(number);
+        } else {
+            return Math.floor(number);
+        }
+    }
+
+    // left zero fill a number
+    // see http://jsperf.com/left-zero-filling for performance comparison
+    function leftZeroFill(number, targetLength) {
+        var output = number + '';
+        while (output.length < targetLength) {
+            output = '0' + output;
+        }
+        return output;
+    }
+
+    // helper function for _.addTime and _.subtractTime
+    function addOrSubtractDurationFromMoment(mom, duration, isAdding, ignoreUpdateOffset) {
+        var milliseconds = duration._milliseconds,
+            days = duration._days,
+            months = duration._months,
+            minutes,
+            hours,
+            currentDate;
+
+        if (milliseconds) {
+            mom._d.setTime(+mom._d + milliseconds * isAdding);
+        }
+        // store the minutes and hours so we can restore them
+        if (days || months) {
+            minutes = mom.minute();
+            hours = mom.hour();
+        }
+        if (days) {
+            mom.date(mom.date() + days * isAdding);
+        }
+        if (months) {
+            mom.month(mom.month() + months * isAdding);
+        }
+        if (milliseconds && !ignoreUpdateOffset) {
+            moment.updateOffset(mom);
+        }
+        // restore the minutes and hours after possibly changing dst
+        if (days || months) {
+            mom.minute(minutes);
+            mom.hour(hours);
+        }
+    }
+
+    // check if is an array
+    function isArray(input) {
+        return Object.prototype.toString.call(input) === '[object Array]';
+    }
+
+    // compare two arrays, return the number of differences
+    function compareArrays(array1, array2) {
+        var len = Math.min(array1.length, array2.length),
+            lengthDiff = Math.abs(array1.length - array2.length),
+            diffs = 0,
+            i;
+        for (i = 0; i < len; i++) {
+            if (~~array1[i] !== ~~array2[i]) {
+                diffs++;
+            }
+        }
+        return diffs + lengthDiff;
+    }
+
+    function normalizeUnits(units) {
+        return units ? unitAliases[units] || units.toLowerCase().replace(/(.)s$/, '$1') : units;
+    }
+
+
+    /************************************
+        Languages
+    ************************************/
+
+
+    Language.prototype = {
+        set : function (config) {
+            var prop, i;
+            for (i in config) {
+                prop = config[i];
+                if (typeof prop === 'function') {
+                    this[i] = prop;
+                } else {
+                    this['_' + i] = prop;
+                }
+            }
+        },
+
+        _months : "January_February_March_April_May_June_July_August_September_October_November_December".split("_"),
+        months : function (m) {
+            return this._months[m.month()];
+        },
+
+        _monthsShort : "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),
+        monthsShort : function (m) {
+            return this._monthsShort[m.month()];
+        },
+
+        monthsParse : function (monthName) {
+            var i, mom, regex;
+
+            if (!this._monthsParse) {
+                this._monthsParse = [];
+            }
+
+            for (i = 0; i < 12; i++) {
+                // make the regex if we don't have it already
+                if (!this._monthsParse[i]) {
+                    mom = moment([2000, i]);
+                    regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');
+                    this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');
+                }
+                // test the regex
+                if (this._monthsParse[i].test(monthName)) {
+                    return i;
+                }
+            }
+        },
+
+        _weekdays : "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),
+        weekdays : function (m) {
+            return this._weekdays[m.day()];
+        },
+
+        _weekdaysShort : "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),
+        weekdaysShort : function (m) {
+            return this._weekdaysShort[m.day()];
+        },
+
+        _weekdaysMin : "Su_Mo_Tu_We_Th_Fr_Sa".split("_"),
+        weekdaysMin : function (m) {
+            return this._weekdaysMin[m.day()];
+        },
+
+        weekdaysParse : function (weekdayName) {
+            var i, mom, regex;
+
+            if (!this._weekdaysParse) {
+                this._weekdaysParse = [];
+            }
+
+            for (i = 0; i < 7; i++) {
+                // make the regex if we don't have it already
+                if (!this._weekdaysParse[i]) {
+                    mom = moment([2000, 1]).day(i);
+                    regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, '');
+                    this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');
+                }
+                // test the regex
+                if (this._weekdaysParse[i].test(weekdayName)) {
+                    return i;
+                }
+            }
+        },
+
+        _longDateFormat : {
+            LT : "h:mm A",
+            L : "MM/DD/YYYY",
+            LL : "MMMM D YYYY",
+            LLL : "MMMM D YYYY LT",
+            LLLL : "dddd, MMMM D YYYY LT"
+        },
+        longDateFormat : function (key) {
+            var output = this._longDateFormat[key];
+            if (!output && this._longDateFormat[key.toUpperCase()]) {
+                output = this._longDateFormat[key.toUpperCase()].replace(/MMMM|MM|DD|dddd/g, function (val) {
+                    return val.slice(1);
+                });
+                this._longDateFormat[key] = output;
+            }
+            return output;
+        },
+
+        isPM : function (input) {
+            return ((input + '').toLowerCase()[0] === 'p');
+        },
+
+        _meridiemParse : /[ap]\.?m?\.?/i,
+        meridiem : function (hours, minutes, isLower) {
+            if (hours > 11) {
+                return isLower ? 'pm' : 'PM';
+            } else {
+                return isLower ? 'am' : 'AM';
+            }
+        },
+
+        _calendar : {
+            sameDay : '[Today at] LT',
+            nextDay : '[Tomorrow at] LT',
+            nextWeek : 'dddd [at] LT',
+            lastDay : '[Yesterday at] LT',
+            lastWeek : '[Last] dddd [at] LT',
+            sameElse : 'L'
+        },
+        calendar : function (key, mom) {
+            var output = this._calendar[key];
+            return typeof output === 'function' ? output.apply(mom) : output;
+        },
+
+        _relativeTime : {
+            future : "in %s",
+            past : "%s ago",
+            s : "a few seconds",
+            m : "a minute",
+            mm : "%d minutes",
+            h : "an hour",
+            hh : "%d hours",
+            d : "a day",
+            dd : "%d days",
+            M : "a month",
+            MM : "%d months",
+            y : "a year",
+            yy : "%d years"
+        },
+        relativeTime : function (number, withoutSuffix, string, isFuture) {
+            var output = this._relativeTime[string];
+            return (typeof output === 'function') ?
+                output(number, withoutSuffix, string, isFuture) :
+                output.replace(/%d/i, number);
+        },
+        pastFuture : function (diff, output) {
+            var format = this._relativeTime[diff > 0 ? 'future' : 'past'];
+            return typeof format === 'function' ? format(output) : format.replace(/%s/i, output);
+        },
+
+        ordinal : function (number) {
+            return this._ordinal.replace("%d", number);
+        },
+        _ordinal : "%d",
+
+        preparse : function (string) {
+            return string;
+        },
+
+        postformat : function (string) {
+            return string;
+        },
+
+        week : function (mom) {
+            return weekOfYear(mom, this._week.dow, this._week.doy).week;
+        },
+        _week : {
+            dow : 0, // Sunday is the first day of the week.
+            doy : 6  // The week that contains Jan 1st is the first week of the year.
+        }
+    };
+
+    // Loads a language definition into the `languages` cache.  The function
+    // takes a key and optionally values.  If not in the browser and no values
+    // are provided, it will load the language file module.  As a convenience,
+    // this function also returns the language values.
+    function loadLang(key, values) {
+        values.abbr = key;
+        if (!languages[key]) {
+            languages[key] = new Language();
+        }
+        languages[key].set(values);
+        return languages[key];
+    }
+
+    // Determines which language definition to use and returns it.
+    //
+    // With no parameters, it will return the global language.  If you
+    // pass in a language key, such as 'en', it will return the
+    // definition for 'en', so long as 'en' has already been loaded using
+    // moment.lang.
+    function getLangDefinition(key) {
+        if (!key) {
+            return moment.fn._lang;
+        }
+        if (!languages[key] && hasModule) {
+            try {
+                require('./lang/' + key);
+            } catch (e) {
+                // call with no params to set to default
+                return moment.fn._lang;
+            }
+        }
+        return languages[key];
+    }
+
+
+    /************************************
+        Formatting
+    ************************************/
+
+
+    function removeFormattingTokens(input) {
+        if (input.match(/\[.*\]/)) {
+            return input.replace(/^\[|\]$/g, "");
+        }
+        return input.replace(/\\/g, "");
+    }
+
+    function makeFormatFunction(format) {
+        var array = format.match(formattingTokens), i, length;
+
+        for (i = 0, length = array.length; i < length; i++) {
+            if (formatTokenFunctions[array[i]]) {
+                array[i] = formatTokenFunctions[array[i]];
+            } else {
+                array[i] = removeFormattingTokens(array[i]);
+            }
+        }
+
+        return function (mom) {
+            var output = "";
+            for (i = 0; i < length; i++) {
+                output += array[i] instanceof Function ? array[i].call(mom, format) : array[i];
+            }
+            return output;
+        };
+    }
+
+    // format date using native date object
+    function formatMoment(m, format) {
+        var i = 5;
+
+        function replaceLongDateFormatTokens(input) {
+            return m.lang().longDateFormat(input) || input;
+        }
+
+        while (i-- && localFormattingTokens.test(format)) {
+            format = format.replace(localFormattingTokens, replaceLongDateFormatTokens);
+        }
+
+        if (!formatFunctions[format]) {
+            formatFunctions[format] = makeFormatFunction(format);
+        }
+
+        return formatFunctions[format](m);
+    }
+
+
+    /************************************
+        Parsing
+    ************************************/
+
+
+    // get the regex to find the next token
+    function getParseRegexForToken(token, config) {
+        switch (token) {
+        case 'DDDD':
+            return parseTokenThreeDigits;
+        case 'YYYY':
+            return parseTokenFourDigits;
+        case 'YYYYY':
+            return parseTokenSixDigits;
+        case 'S':
+        case 'SS':
+        case 'SSS':
+        case 'DDD':
+            return parseTokenOneToThreeDigits;
+        case 'MMM':
+        case 'MMMM':
+        case 'dd':
+        case 'ddd':
+        case 'dddd':
+            return parseTokenWord;
+        case 'a':
+        case 'A':
+            return getLangDefinition(config._l)._meridiemParse;
+        case 'X':
+            return parseTokenTimestampMs;
+        case 'Z':
+        case 'ZZ':
+            return parseTokenTimezone;
+        case 'T':
+            return parseTokenT;
+        case 'MM':
+        case 'DD':
+        case 'YY':
+        case 'HH':
+        case 'hh':
+        case 'mm':
+        case 'ss':
+        case 'M':
+        case 'D':
+        case 'd':
+        case 'H':
+        case 'h':
+        case 'm':
+        case 's':
+            return parseTokenOneOrTwoDigits;
+        default :
+            return new RegExp(token.replace('\\', ''));
+        }
+    }
+
+    function timezoneMinutesFromString(string) {
+        var tzchunk = (parseTokenTimezone.exec(string) || [])[0],
+            parts = (tzchunk + '').match(parseTimezoneChunker) || ['-', 0, 0],
+            minutes = +(parts[1] * 60) + ~~parts[2];
+
+        return parts[0] === '+' ? -minutes : minutes;
+    }
+
+    // function to convert string input to date
+    function addTimeToArrayFromToken(token, input, config) {
+        var a, datePartArray = config._a;
+
+        switch (token) {
+        // MONTH
+        case 'M' : // fall through to MM
+        case 'MM' :
+            datePartArray[1] = (input == null) ? 0 : ~~input - 1;
+            break;
+        case 'MMM' : // fall through to MMMM
+        case 'MMMM' :
+            a = getLangDefinition(config._l).monthsParse(input);
+            // if we didn't find a month name, mark the date as invalid.
+            if (a != null) {
+                datePartArray[1] = a;
+            } else {
+                config._isValid = false;
+            }
+            break;
+        // DAY OF MONTH
+        case 'D' : // fall through to DDDD
+        case 'DD' : // fall through to DDDD
+        case 'DDD' : // fall through to DDDD
+        case 'DDDD' :
+            if (input != null) {
+                datePartArray[2] = ~~input;
+            }
+            break;
+        // YEAR
+        case 'YY' :
+            datePartArray[0] = ~~input + (~~input > 68 ? 1900 : 2000);
+            break;
+        case 'YYYY' :
+        case 'YYYYY' :
+            datePartArray[0] = ~~input;
+            break;
+        // AM / PM
+        case 'a' : // fall through to A
+        case 'A' :
+            config._isPm = getLangDefinition(config._l).isPM(input);
+            break;
+        // 24 HOUR
+        case 'H' : // fall through to hh
+        case 'HH' : // fall through to hh
+        case 'h' : // fall through to hh
+        case 'hh' :
+            datePartArray[3] = ~~input;
+            break;
+        // MINUTE
+        case 'm' : // fall through to mm
+        case 'mm' :
+            datePartArray[4] = ~~input;
+            break;
+        // SECOND
+        case 's' : // fall through to ss
+        case 'ss' :
+            datePartArray[5] = ~~input;
+            break;
+        // MILLISECOND
+        case 'S' :
+        case 'SS' :
+        case 'SSS' :
+            datePartArray[6] = ~~ (('0.' + input) * 1000);
+            break;
+        // UNIX TIMESTAMP WITH MS
+        case 'X':
+            config._d = new Date(parseFloat(input) * 1000);
+            break;
+        // TIMEZONE
+        case 'Z' : // fall through to ZZ
+        case 'ZZ' :
+            config._useUTC = true;
+            config._tzm = timezoneMinutesFromString(input);
+            break;
+        }
+
+        // if the input is null, the date is not valid
+        if (input == null) {
+            config._isValid = false;
+        }
+    }
+
+    // convert an array to a date.
+    // the array should mirror the parameters below
+    // note: all values past the year are optional and will default to the lowest possible value.
+    // [year, month, day , hour, minute, second, millisecond]
+    function dateFromArray(config) {
+        var i, date, input = [];
+
+        if (config._d) {
+            return;
+        }
+
+        for (i = 0; i < 7; i++) {
+            config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];
+        }
+
+        // add the offsets to the time to be parsed so that we can have a clean array for checking isValid
+        input[3] += ~~((config._tzm || 0) / 60);
+        input[4] += ~~((config._tzm || 0) % 60);
+
+        date = new Date(0);
+
+        if (config._useUTC) {
+            date.setUTCFullYear(input[0], input[1], input[2]);
+            date.setUTCHours(input[3], input[4], input[5], input[6]);
+        } else {
+            date.setFullYear(input[0], input[1], input[2]);
+            date.setHours(input[3], input[4], input[5], input[6]);
+        }
+
+        config._d = date;
+    }
+
+    // date from string and format string
+    function makeDateFromStringAndFormat(config) {
+        // This array is used to make a Date, either with `new Date` or `Date.UTC`
+        var tokens = config._f.match(formattingTokens),
+            string = config._i,
+            i, parsedInput;
+
+        config._a = [];
+
+        for (i = 0; i < tokens.length; i++) {
+            parsedInput = (getParseRegexForToken(tokens[i], config).exec(string) || [])[0];
+            if (parsedInput) {
+                string = string.slice(string.indexOf(parsedInput) + parsedInput.length);
+            }
+            // don't parse if its not a known token
+            if (formatTokenFunctions[tokens[i]]) {
+                addTimeToArrayFromToken(tokens[i], parsedInput, config);
+            }
+        }
+
+        // add remaining unparsed input to the string
+        if (string) {
+            config._il = string;
+        }
+
+        // handle am pm
+        if (config._isPm && config._a[3] < 12) {
+            config._a[3] += 12;
+        }
+        // if is 12 am, change hours to 0
+        if (config._isPm === false && config._a[3] === 12) {
+            config._a[3] = 0;
+        }
+        // return
+        dateFromArray(config);
+    }
+
+    // date from string and array of format strings
+    function makeDateFromStringAndArray(config) {
+        var tempConfig,
+            tempMoment,
+            bestMoment,
+
+            scoreToBeat = 99,
+            i,
+            currentScore;
+
+        for (i = 0; i < config._f.length; i++) {
+            tempConfig = extend({}, config);
+            tempConfig._f = config._f[i];
+            makeDateFromStringAndFormat(tempConfig);
+            tempMoment = new Moment(tempConfig);
+
+            currentScore = compareArrays(tempConfig._a, tempMoment.toArray());
+
+            // if there is any input that was not parsed
+            // add a penalty for that format
+            if (tempMoment._il) {
+                currentScore += tempMoment._il.length;
+            }
+
+            if (currentScore < scoreToBeat) {
+                scoreToBeat = currentScore;
+                bestMoment = tempMoment;
+            }
+        }
+
+        extend(config, bestMoment);
+    }
+
+    // date from iso format
+    function makeDateFromString(config) {
+        var i,
+            string = config._i,
+            match = isoRegex.exec(string);
+
+        if (match) {
+            // match[2] should be "T" or undefined
+            config._f = 'YYYY-MM-DD' + (match[2] || " ");
+            for (i = 0; i < 4; i++) {
+                if (isoTimes[i][1].exec(string)) {
+                    config._f += isoTimes[i][0];
+                    break;
+                }
+            }
+            if (parseTokenTimezone.exec(string)) {
+                config._f += " Z";
+            }
+            makeDateFromStringAndFormat(config);
+        } else {
+            config._d = new Date(string);
+        }
+    }
+
+    function makeDateFromInput(config) {
+        var input = config._i,
+            matched = aspNetJsonRegex.exec(input);
+
+        if (input === undefined) {
+            config._d = new Date();
+        } else if (matched) {
+            config._d = new Date(+matched[1]);
+        } else if (typeof input === 'string') {
+            makeDateFromString(config);
+        } else if (isArray(input)) {
+            config._a = input.slice(0);
+            dateFromArray(config);
+        } else {
+            config._d = input instanceof Date ? new Date(+input) : new Date(input);
+        }
+    }
+
+
+    /************************************
+        Relative Time
+    ************************************/
+
+
+    // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize
+    function substituteTimeAgo(string, number, withoutSuffix, isFuture, lang) {
+        return lang.relativeTime(number || 1, !!withoutSuffix, string, isFuture);
+    }
+
+    function relativeTime(milliseconds, withoutSuffix, lang) {
+        var seconds = round(Math.abs(milliseconds) / 1000),
+            minutes = round(seconds / 60),
+            hours = round(minutes / 60),
+            days = round(hours / 24),
+            years = round(days / 365),
+            args = seconds < 45 && ['s', seconds] ||
+                minutes === 1 && ['m'] ||
+                minutes < 45 && ['mm', minutes] ||
+                hours === 1 && ['h'] ||
+                hours < 22 && ['hh', hours] ||
+                days === 1 && ['d'] ||
+                days <= 25 && ['dd', days] ||
+                days <= 45 && ['M'] ||
+                days < 345 && ['MM', round(days / 30)] ||
+                years === 1 && ['y'] || ['yy', years];
+        args[2] = withoutSuffix;
+        args[3] = milliseconds > 0;
+        args[4] = lang;
+        return substituteTimeAgo.apply({}, args);
+    }
+
+
+    /************************************
+        Week of Year
+    ************************************/
+
+
+    // firstDayOfWeek       0 = sun, 6 = sat
+    //                      the day of the week that starts the week
+    //                      (usually sunday or monday)
+    // firstDayOfWeekOfYear 0 = sun, 6 = sat
+    //                      the first week is the week that contains the first
+    //                      of this day of the week
+    //                      (eg. ISO weeks use thursday (4))
+    function weekOfYear(mom, firstDayOfWeek, firstDayOfWeekOfYear) {
+        var end = firstDayOfWeekOfYear - firstDayOfWeek,
+            daysToDayOfWeek = firstDayOfWeekOfYear - mom.day(),
+            adjustedMoment;
+
+
+        if (daysToDayOfWeek > end) {
+            daysToDayOfWeek -= 7;
+        }
+
+        if (daysToDayOfWeek < end - 7) {
+            daysToDayOfWeek += 7;
+        }
+
+        adjustedMoment = moment(mom).add('d', daysToDayOfWeek);
+        return {
+            week: Math.ceil(adjustedMoment.dayOfYear() / 7),
+            year: adjustedMoment.year()
+        };
+    }
+
+
+    /************************************
+        Top Level Functions
+    ************************************/
+
+    function makeMoment(config) {
+        var input = config._i,
+            format = config._f;
+
+        if (input === null || input === '') {
+            return null;
+        }
+
+        if (typeof input === 'string') {
+            config._i = input = getLangDefinition().preparse(input);
+        }
+
+        if (moment.isMoment(input)) {
+            config = extend({}, input);
+            config._d = new Date(+input._d);
+        } else if (format) {
+            if (isArray(format)) {
+                makeDateFromStringAndArray(config);
+            } else {
+                makeDateFromStringAndFormat(config);
+            }
+        } else {
+            makeDateFromInput(config);
+        }
+
+        return new Moment(config);
+    }
+
+    moment = function (input, format, lang) {
+        return makeMoment({
+            _i : input,
+            _f : format,
+            _l : lang,
+            _isUTC : false
+        });
+    };
+
+    // creating with utc
+    moment.utc = function (input, format, lang) {
+        return makeMoment({
+            _useUTC : true,
+            _isUTC : true,
+            _l : lang,
+            _i : input,
+            _f : format
+        });
+    };
+
+    // creating with unix timestamp (in seconds)
+    moment.unix = function (input) {
+        return moment(input * 1000);
+    };
+
+    // duration
+    moment.duration = function (input, key) {
+        var isDuration = moment.isDuration(input),
+            isNumber = (typeof input === 'number'),
+            duration = (isDuration ? input._input : (isNumber ? {} : input)),
+            matched = aspNetTimeSpanJsonRegex.exec(input),
+            sign,
+            ret;
+
+        if (isNumber) {
+            if (key) {
+                duration[key] = input;
+            } else {
+                duration.milliseconds = input;
+            }
+        } else if (matched) {
+            sign = (matched[1] === "-") ? -1 : 1;
+            duration = {
+                y: 0,
+                d: ~~matched[2] * sign,
+                h: ~~matched[3] * sign,
+                m: ~~matched[4] * sign,
+                s: ~~matched[5] * sign,
+                ms: ~~matched[6] * sign
+            };
+        }
+
+        ret = new Duration(duration);
+
+        if (isDuration && input.hasOwnProperty('_lang')) {
+            ret._lang = input._lang;
+        }
+
+        return ret;
+    };
+
+    // version number
+    moment.version = VERSION;
+
+    // default format
+    moment.defaultFormat = isoFormat;
+
+    // This function will be called whenever a moment is mutated.
+    // It is intended to keep the offset in sync with the timezone.
+    moment.updateOffset = function () {};
+
+    // This function will load languages and then set the global language.  If
+    // no arguments are passed in, it will simply return the current global
+    // language key.
+    moment.lang = function (key, values) {
+        if (!key) {
+            return moment.fn._lang._abbr;
+        }
+        if (values) {
+            loadLang(key, values);
+        } else if (!languages[key]) {
+            getLangDefinition(key);
+        }
+        moment.duration.fn._lang = moment.fn._lang = getLangDefinition(key);
+    };
+
+    // returns language data
+    moment.langData = function (key) {
+        if (key && key._lang && key._lang._abbr) {
+            key = key._lang._abbr;
+        }
+        return getLangDefinition(key);
+    };
+
+    // compare moment object
+    moment.isMoment = function (obj) {
+        return obj instanceof Moment;
+    };
+
+    // for typechecking Duration objects
+    moment.isDuration = function (obj) {
+        return obj instanceof Duration;
+    };
+
+
+    /************************************
+        Moment Prototype
+    ************************************/
+
+
+    moment.fn = Moment.prototype = {
+
+        clone : function () {
+            return moment(this);
+        },
+
+        valueOf : function () {
+            return +this._d + ((this._offset || 0) * 60000);
+        },
+
+        unix : function () {
+            return Math.floor(+this / 1000);
+        },
+
+        toString : function () {
+            return this.format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ");
+        },
+
+        toDate : function () {
+            return this._offset ? new Date(+this) : this._d;
+        },
+
+        toISOString : function () {
+            return formatMoment(moment(this).utc(), 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]');
+        },
+
+        toArray : function () {
+            var m = this;
+            return [
+                m.year(),
+                m.month(),
+                m.date(),
+                m.hours(),
+                m.minutes(),
+                m.seconds(),
+                m.milliseconds()
+            ];
+        },
+
+        isValid : function () {
+            if (this._isValid == null) {
+                if (this._a) {
+                    this._isValid = !compareArrays(this._a, (this._isUTC ? moment.utc(this._a) : moment(this._a)).toArray());
+                } else {
+                    this._isValid = !isNaN(this._d.getTime());
+                }
+            }
+            return !!this._isValid;
+        },
+
+        utc : function () {
+            return this.zone(0);
+        },
+
+        local : function () {
+            this.zone(0);
+            this._isUTC = false;
+            return this;
+        },
+
+        format : function (inputString) {
+            var output = formatMoment(this, inputString || moment.defaultFormat);
+            return this.lang().postformat(output);
+        },
+
+        add : function (input, val) {
+            var dur;
+            // switch args to support add('s', 1) and add(1, 's')
+            if (typeof input === 'string') {
+                dur = moment.duration(+val, input);
+            } else {
+                dur = moment.duration(input, val);
+            }
+            addOrSubtractDurationFromMoment(this, dur, 1);
+            return this;
+        },
+
+        subtract : function (input, val) {
+            var dur;
+            // switch args to support subtract('s', 1) and subtract(1, 's')
+            if (typeof input === 'string') {
+                dur = moment.duration(+val, input);
+            } else {
+                dur = moment.duration(input, val);
+            }
+            addOrSubtractDurationFromMoment(this, dur, -1);
+            return this;
+        },
+
+        diff : function (input, units, asFloat) {
+            var that = this._isUTC ? moment(input).zone(this._offset || 0) : moment(input).local(),
+                zoneDiff = (this.zone() - that.zone()) * 6e4,
+                diff, output;
+
+            units = normalizeUnits(units);
+
+            if (units === 'year' || units === 'month') {
+                // average number of days in the months in the given dates
+                diff = (this.daysInMonth() + that.daysInMonth()) * 432e5; // 24 * 60 * 60 * 1000 / 2
+                // difference in months
+                output = ((this.year() - that.year()) * 12) + (this.month() - that.month());
+                // adjust by taking difference in days, average number of days
+                // and dst in the given months.
+                output += ((this - moment(this).startOf('month')) -
+                        (that - moment(that).startOf('month'))) / diff;
+                // same as above but with zones, to negate all dst
+                output -= ((this.zone() - moment(this).startOf('month').zone()) -
+                        (that.zone() - moment(that).startOf('month').zone())) * 6e4 / diff;
+                if (units === 'year') {
+                    output = output / 12;
+                }
+            } else {
+                diff = (this - that);
+                output = units === 'second' ? diff / 1e3 : // 1000
+                    units === 'minute' ? diff / 6e4 : // 1000 * 60
+                    units === 'hour' ? diff / 36e5 : // 1000 * 60 * 60
+                    units === 'day' ? (diff - zoneDiff) / 864e5 : // 1000 * 60 * 60 * 24, negate dst
+                    units === 'week' ? (diff - zoneDiff) / 6048e5 : // 1000 * 60 * 60 * 24 * 7, negate dst
+                    diff;
+            }
+            return asFloat ? output : absRound(output);
+        },
+
+        from : function (time, withoutSuffix) {
+            return moment.duration(this.diff(time)).lang(this.lang()._abbr).humanize(!withoutSuffix);
+        },
+
+        fromNow : function (withoutSuffix) {
+            return this.from(moment(), withoutSuffix);
+        },
+
+        calendar : function () {
+            var diff = this.diff(moment().startOf('day'), 'days', true),
+                format = diff < -6 ? 'sameElse' :
+                diff < -1 ? 'lastWeek' :
+                diff < 0 ? 'lastDay' :
+                diff < 1 ? 'sameDay' :
+                diff < 2 ? 'nextDay' :
+                diff < 7 ? 'nextWeek' : 'sameElse';
+            return this.format(this.lang().calendar(format, this));
+        },
+
+        isLeapYear : function () {
+            var year = this.year();
+            return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
+        },
+
+        isDST : function () {
+            return (this.zone() < this.clone().month(0).zone() ||
+                this.zone() < this.clone().month(5).zone());
+        },
+
+        day : function (input) {
+            var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();
+            if (input != null) {
+                if (typeof input === 'string') {
+                    input = this.lang().weekdaysParse(input);
+                    if (typeof input !== 'number') {
+                        return this;
+                    }
+                }
+                return this.add({ d : input - day });
+            } else {
+                return day;
+            }
+        },
+
+        month : function (input) {
+            var utc = this._isUTC ? 'UTC' : '',
+                dayOfMonth,
+                daysInMonth;
+
+            if (input != null) {
+                if (typeof input === 'string') {
+                    input = this.lang().monthsParse(input);
+                    if (typeof input !== 'number') {
+                        return this;
+                    }
+                }
+
+                dayOfMonth = this.date();
+                this.date(1);
+                this._d['set' + utc + 'Month'](input);
+                this.date(Math.min(dayOfMonth, this.daysInMonth()));
+
+                moment.updateOffset(this);
+                return this;
+            } else {
+                return this._d['get' + utc + 'Month']();
+            }
+        },
+
+        startOf: function (units) {
+            units = normalizeUnits(units);
+            // the following switch intentionally omits break keywords
+            // to utilize falling through the cases.
+            switch (units) {
+            case 'year':
+                this.month(0);
+                /* falls through */
+            case 'month':
+                this.date(1);
+                /* falls through */
+            case 'week':
+            case 'day':
+                this.hours(0);
+                /* falls through */
+            case 'hour':
+                this.minutes(0);
+                /* falls through */
+            case 'minute':
+                this.seconds(0);
+                /* falls through */
+            case 'second':
+                this.milliseconds(0);
+                /* falls through */
+            }
+
+            // weeks are a special case
+            if (units === 'week') {
+                this.weekday(0);
+            }
+
+            return this;
+        },
+
+        endOf: function (units) {
+            return this.startOf(units).add(units, 1).subtract('ms', 1);
+        },
+
+        isAfter: function (input, units) {
+            units = typeof units !== 'undefined' ? units : 'millisecond';
+            return +this.clone().startOf(units) > +moment(input).startOf(units);
+        },
+
+        isBefore: function (input, units) {
+            units = typeof units !== 'undefined' ? units : 'millisecond';
+            return +this.clone().startOf(units) < +moment(input).startOf(units);
+        },
+
+        isSame: function (input, units) {
+            units = typeof units !== 'undefined' ? units : 'millisecond';
+            return +this.clone().startOf(units) === +moment(input).startOf(units);
+        },
+
+        min: function (other) {
+            other = moment.apply(null, arguments);
+            return other < this ? this : other;
+        },
+
+        max: function (other) {
+            other = moment.apply(null, arguments);
+            return other > this ? this : other;
+        },
+
+        zone : function (input) {
+            var offset = this._offset || 0;
+            if (input != null) {
+                if (typeof input === "string") {
+                    input = timezoneMinutesFromString(input);
+                }
+                if (Math.abs(input) < 16) {
+                    input = input * 60;
+                }
+                this._offset = input;
+                this._isUTC = true;
+                if (offset !== input) {
+                    addOrSubtractDurationFromMoment(this, moment.duration(offset - input, 'm'), 1, true);
+                }
+            } else {
+                return this._isUTC ? offset : this._d.getTimezoneOffset();
+            }
+            return this;
+        },
+
+        zoneAbbr : function () {
+            return this._isUTC ? "UTC" : "";
+        },
+
+        zoneName : function () {
+            return this._isUTC ? "Coordinated Universal Time" : "";
+        },
+
+        daysInMonth : function () {
+            return moment.utc([this.year(), this.month() + 1, 0]).date();
+        },
+
+        dayOfYear : function (input) {
+            var dayOfYear = round((moment(this).startOf('day') - moment(this).startOf('year')) / 864e5) + 1;
+            return input == null ? dayOfYear : this.add("d", (input - dayOfYear));
+        },
+
+        weekYear : function (input) {
+            var year = weekOfYear(this, this.lang()._week.dow, this.lang()._week.doy).year;
+            return input == null ? year : this.add("y", (input - year));
+        },
+
+        isoWeekYear : function (input) {
+            var year = weekOfYear(this, 1, 4).year;
+            return input == null ? year : this.add("y", (input - year));
+        },
+
+        week : function (input) {
+            var week = this.lang().week(this);
+            return input == null ? week : this.add("d", (input - week) * 7);
+        },
+
+        isoWeek : function (input) {
+            var week = weekOfYear(this, 1, 4).week;
+            return input == null ? week : this.add("d", (input - week) * 7);
+        },
+
+        weekday : function (input) {
+            var weekday = (this._d.getDay() + 7 - this.lang()._week.dow) % 7;
+            return input == null ? weekday : this.add("d", input - weekday);
+        },
+
+        isoWeekday : function (input) {
+            // behaves the same as moment#day except
+            // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)
+            // as a setter, sunday should belong to the previous week.
+            return input == null ? this.day() || 7 : this.day(this.day() % 7 ? input : input - 7);
+        },
+
+        // If passed a language key, it will set the language for this
+        // instance.  Otherwise, it will return the language configuration
+        // variables for this instance.
+        lang : function (key) {
+            if (key === undefined) {
+                return this._lang;
+            } else {
+                this._lang = getLangDefinition(key);
+                return this;
+            }
+        }
+    };
+
+    // helper for adding shortcuts
+    function makeGetterAndSetter(name, key) {
+        moment.fn[name] = moment.fn[name + 's'] = function (input) {
+            var utc = this._isUTC ? 'UTC' : '';
+            if (input != null) {
+                this._d['set' + utc + key](input);
+                moment.updateOffset(this);
+                return this;
+            } else {
+                return this._d['get' + utc + key]();
+            }
+        };
+    }
+
+    // loop through and add shortcuts (Month, Date, Hours, Minutes, Seconds, Milliseconds)
+    for (i = 0; i < proxyGettersAndSetters.length; i ++) {
+        makeGetterAndSetter(proxyGettersAndSetters[i].toLowerCase().replace(/s$/, ''), proxyGettersAndSetters[i]);
+    }
+
+    // add shortcut for year (uses different syntax than the getter/setter 'year' == 'FullYear')
+    makeGetterAndSetter('year', 'FullYear');
+
+    // add plural methods
+    moment.fn.days = moment.fn.day;
+    moment.fn.months = moment.fn.month;
+    moment.fn.weeks = moment.fn.week;
+    moment.fn.isoWeeks = moment.fn.isoWeek;
+
+    // add aliased format methods
+    moment.fn.toJSON = moment.fn.toISOString;
+
+    /************************************
+        Duration Prototype
+    ************************************/
+
+
+    moment.duration.fn = Duration.prototype = {
+        _bubble : function () {
+            var milliseconds = this._milliseconds,
+                days = this._days,
+                months = this._months,
+                data = this._data,
+                seconds, minutes, hours, years;
+
+            // The following code bubbles up values, see the tests for
+            // examples of what that means.
+            data.milliseconds = milliseconds % 1000;
+
+            seconds = absRound(milliseconds / 1000);
+            data.seconds = seconds % 60;
+
+            minutes = absRound(seconds / 60);
+            data.minutes = minutes % 60;
+
+            hours = absRound(minutes / 60);
+            data.hours = hours % 24;
+
+            days += absRound(hours / 24);
+            data.days = days % 30;
+
+            months += absRound(days / 30);
+            data.months = months % 12;
+
+            years = absRound(months / 12);
+            data.years = years;
+        },
+
+        weeks : function () {
+            return absRound(this.days() / 7);
+        },
+
+        valueOf : function () {
+            return this._milliseconds +
+              this._days * 864e5 +
+              (this._months % 12) * 2592e6 +
+              ~~(this._months / 12) * 31536e6;
+        },
+
+        humanize : function (withSuffix) {
+            var difference = +this,
+                output = relativeTime(difference, !withSuffix, this.lang());
+
+            if (withSuffix) {
+                output = this.lang().pastFuture(difference, output);
+            }
+
+            return this.lang().postformat(output);
+        },
+
+        add : function (input, val) {
+            // supports only 2.0-style add(1, 's') or add(moment)
+            var dur = moment.duration(input, val);
+
+            this._milliseconds += dur._milliseconds;
+            this._days += dur._days;
+            this._months += dur._months;
+
+            this._bubble();
+
+            return this;
+        },
+
+        subtract : function (input, val) {
+            var dur = moment.duration(input, val);
+
+            this._milliseconds -= dur._milliseconds;
+            this._days -= dur._days;
+            this._months -= dur._months;
+
+            this._bubble();
+
+            return this;
+        },
+
+        get : function (units) {
+            units = normalizeUnits(units);
+            return this[units.toLowerCase() + 's']();
+        },
+
+        as : function (units) {
+            units = normalizeUnits(units);
+            return this['as' + units.charAt(0).toUpperCase() + units.slice(1) + 's']();
+        },
+
+        lang : moment.fn.lang
+    };
+
+    function makeDurationGetter(name) {
+        moment.duration.fn[name] = function () {
+            return this._data[name];
+        };
+    }
+
+    function makeDurationAsGetter(name, factor) {
+        moment.duration.fn['as' + name] = function () {
+            return +this / factor;
+        };
+    }
+
+    for (i in unitMillisecondFactors) {
+        if (unitMillisecondFactors.hasOwnProperty(i)) {
+            makeDurationAsGetter(i, unitMillisecondFactors[i]);
+            makeDurationGetter(i.toLowerCase());
+        }
+    }
+
+    makeDurationAsGetter('Weeks', 6048e5);
+    moment.duration.fn.asMonths = function () {
+        return (+this - this.years() * 31536e6) / 2592e6 + this.years() * 12;
+    };
+
+
+    /************************************
+        Default Lang
+    ************************************/
+
+
+    // Set default language, other languages will inherit from English.
+    moment.lang('en', {
+        ordinal : function (number) {
+            var b = number % 10,
+                output = (~~ (number % 100 / 10) === 1) ? 'th' :
+                (b === 1) ? 'st' :
+                (b === 2) ? 'nd' :
+                (b === 3) ? 'rd' : 'th';
+            return number + output;
+        }
+    });
+
+
+    /************************************
+        Exposing Moment
+    ************************************/
+
+
+    // CommonJS module is defined
+    if (hasModule) {
+        module.exports = moment;
+    }
+    /*global ender:false */
+    if (typeof ender === 'undefined') {
+        // here, `this` means `window` in the browser, or `global` on the server
+        // add `moment` as a global object via a string identifier,
+        // for Closure Compiler "advanced" mode
+        this['moment'] = moment;
+    }
+    /*global define:false */
+    if (typeof define === "function" && define.amd) {
+        define("moment", [], function () {
+            return moment;
+        });
+    }
+}).call(this);

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/js/libs/require.js
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/js/libs/require.js b/src/main/webapp/assets/js/libs/require.js
new file mode 100644
index 0000000..7df0d60
--- /dev/null
+++ b/src/main/webapp/assets/js/libs/require.js
@@ -0,0 +1,35 @@
+/*
+ RequireJS 2.0.6 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
+ Available via the MIT or new BSD license.
+ see: http://github.com/jrburke/requirejs for details
+*/
+var requirejs,require,define;
+(function(Z){function x(b){return J.call(b)==="[object Function]"}function E(b){return J.call(b)==="[object Array]"}function o(b,e){if(b){var f;for(f=0;f<b.length;f+=1)if(b[f]&&e(b[f],f,b))break}}function M(b,e){if(b){var f;for(f=b.length-1;f>-1;f-=1)if(b[f]&&e(b[f],f,b))break}}function y(b,e){for(var f in b)if(b.hasOwnProperty(f)&&e(b[f],f))break}function N(b,e,f,h){e&&y(e,function(e,j){if(f||!F.call(b,j))h&&typeof e!=="string"?(b[j]||(b[j]={}),N(b[j],e,f,h)):b[j]=e});return b}function t(b,e){return function(){return e.apply(b,
+arguments)}}function $(b){if(!b)return b;var e=Z;o(b.split("."),function(b){e=e[b]});return e}function aa(b,e,f){return function(){var h=ga.call(arguments,0),c;if(f&&x(c=h[h.length-1]))c.__requireJsBuild=!0;h.push(e);return b.apply(null,h)}}function ba(b,e,f){o([["toUrl"],["undef"],["defined","requireDefined"],["specified","requireSpecified"]],function(h){var c=h[1]||h[0];b[h[0]]=e?aa(e[c],f):function(){var b=z[O];return b[c].apply(b,arguments)}})}function G(b,e,f,h){e=Error(e+"\nhttp://requirejs.org/docs/errors.html#"+
+b);e.requireType=b;e.requireModules=h;if(f)e.originalError=f;return e}function ha(){if(H&&H.readyState==="interactive")return H;M(document.getElementsByTagName("script"),function(b){if(b.readyState==="interactive")return H=b});return H}var j,p,u,B,s,C,H,I,ca,da,ia=/(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,ja=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,ea=/\.js$/,ka=/^\.\//;p=Object.prototype;var J=p.toString,F=p.hasOwnProperty;p=Array.prototype;var ga=p.slice,la=p.splice,w=!!(typeof window!==
+"undefined"&&navigator&&document),fa=!w&&typeof importScripts!=="undefined",ma=w&&navigator.platform==="PLAYSTATION 3"?/^complete$/:/^(complete|loaded)$/,O="_",S=typeof opera!=="undefined"&&opera.toString()==="[object Opera]",z={},r={},P=[],K=!1;if(typeof define==="undefined"){if(typeof requirejs!=="undefined"){if(x(requirejs))return;r=requirejs;requirejs=void 0}typeof require!=="undefined"&&!x(require)&&(r=require,require=void 0);j=requirejs=function(b,e,f,h){var c,o=O;!E(b)&&typeof b!=="string"&&
+(c=b,E(e)?(b=e,e=f,f=h):b=[]);if(c&&c.context)o=c.context;(h=z[o])||(h=z[o]=j.s.newContext(o));c&&h.configure(c);return h.require(b,e,f)};j.config=function(b){return j(b)};require||(require=j);j.version="2.0.6";j.jsExtRegExp=/^\/|:|\?|\.js$/;j.isBrowser=w;p=j.s={contexts:z,newContext:function(b){function e(a,d,k){var l,b,i,v,e,c,f,g=d&&d.split("/");l=g;var h=m.map,j=h&&h["*"];if(a&&a.charAt(0)===".")if(d){l=m.pkgs[d]?g=[d]:g.slice(0,g.length-1);d=a=l.concat(a.split("/"));for(l=0;d[l];l+=1)if(b=d[l],
+b===".")d.splice(l,1),l-=1;else if(b==="..")if(l===1&&(d[2]===".."||d[0]===".."))break;else l>0&&(d.splice(l-1,2),l-=2);l=m.pkgs[d=a[0]];a=a.join("/");l&&a===d+"/"+l.main&&(a=d)}else a.indexOf("./")===0&&(a=a.substring(2));if(k&&(g||j)&&h){d=a.split("/");for(l=d.length;l>0;l-=1){i=d.slice(0,l).join("/");if(g)for(b=g.length;b>0;b-=1)if(k=h[g.slice(0,b).join("/")])if(k=k[i]){v=k;e=l;break}if(v)break;!c&&j&&j[i]&&(c=j[i],f=l)}!v&&c&&(v=c,e=f);v&&(d.splice(0,e,v),a=d.join("/"))}return a}function f(a){w&&
+o(document.getElementsByTagName("script"),function(d){if(d.getAttribute("data-requiremodule")===a&&d.getAttribute("data-requirecontext")===g.contextName)return d.parentNode.removeChild(d),!0})}function h(a){var d=m.paths[a];if(d&&E(d)&&d.length>1)return f(a),d.shift(),g.undef(a),g.require([a]),!0}function c(a,d,k,l){var b,i,v=a?a.indexOf("!"):-1,c=null,f=d?d.name:null,h=a,j=!0,m="";a||(j=!1,a="_@r"+(M+=1));v!==-1&&(c=a.substring(0,v),a=a.substring(v+1,a.length));c&&(c=e(c,f,l),i=q[c]);a&&(c?m=i&&
+i.normalize?i.normalize(a,function(a){return e(a,f,l)}):e(a,f,l):(m=e(a,f,l),b=g.nameToUrl(m)));a=c&&!i&&!k?"_unnormalized"+(O+=1):"";return{prefix:c,name:m,parentMap:d,unnormalized:!!a,url:b,originalName:h,isDefine:j,id:(c?c+"!"+m:m)+a}}function p(a){var d=a.id,k=n[d];k||(k=n[d]=new g.Module(a));return k}function r(a,d,k){var b=a.id,c=n[b];if(F.call(q,b)&&(!c||c.defineEmitComplete))d==="defined"&&k(q[b]);else p(a).on(d,k)}function A(a,d){var k=a.requireModules,b=!1;if(d)d(a);else if(o(k,function(d){if(d=
+n[d])d.error=a,d.events.error&&(b=!0,d.emit("error",a))}),!b)j.onError(a)}function s(){P.length&&(la.apply(D,[D.length-1,0].concat(P)),P=[])}function u(a,d,k){a=a&&a.map;d=aa(k||g.require,a,d);ba(d,g,a);d.isBrowser=w;return d}function z(a){delete n[a];o(L,function(d,k){if(d.map.id===a)return L.splice(k,1),d.defined||(g.waitCount-=1),!0})}function B(a,d,k){var b=a.map.id,c=a.depMaps,i;if(a.inited){if(d[b])return a;d[b]=!0;o(c,function(a){var a=a.id,b=n[a];return!b||k[a]||!b.inited||!b.enabled?void 0:
+i=B(b,d,k)});k[b]=!0;return i}}function C(a,d,b){var l=a.map.id,c=a.depMaps;if(a.inited&&a.map.isDefine){if(d[l])return q[l];d[l]=a;o(c,function(i){var i=i.id,c=n[i];!Q[i]&&c&&(!c.inited||!c.enabled?b[l]=!0:(c=C(c,d,b),b[i]||a.defineDepById(i,c)))});a.check(!0);return q[l]}}function I(a){a.check()}function T(){var a,d,b,l,c=(b=m.waitSeconds*1E3)&&g.startTime+b<(new Date).getTime(),i=[],e=!1,j=!0;if(!U){U=!0;y(n,function(b){a=b.map;d=a.id;if(b.enabled&&!b.error)if(!b.inited&&c)h(d)?e=l=!0:(i.push(d),
+f(d));else if(!b.inited&&b.fetched&&a.isDefine&&(e=!0,!a.prefix))return j=!1});if(c&&i.length)return b=G("timeout","Load timeout for modules: "+i,null,i),b.contextName=g.contextName,A(b);j&&(o(L,function(a){if(!a.defined){var a=B(a,{},{}),d={};a&&(C(a,d,{}),y(d,I))}}),y(n,I));if((!c||l)&&e)if((w||fa)&&!V)V=setTimeout(function(){V=0;T()},50);U=!1}}function W(a){p(c(a[0],null,!0)).init(a[1],a[2])}function J(a){var a=a.currentTarget||a.srcElement,d=g.onScriptLoad;a.detachEvent&&!S?a.detachEvent("onreadystatechange",
+d):a.removeEventListener("load",d,!1);d=g.onScriptError;a.detachEvent&&!S||a.removeEventListener("error",d,!1);return{node:a,id:a&&a.getAttribute("data-requiremodule")}}var U,X,g,Q,V,m={waitSeconds:7,baseUrl:"./",paths:{},pkgs:{},shim:{}},n={},Y={},D=[],q={},R={},M=1,O=1,L=[];Q={require:function(a){return u(a)},exports:function(a){a.usingExports=!0;if(a.map.isDefine)return a.exports=q[a.map.id]={}},module:function(a){return a.module={id:a.map.id,uri:a.map.url,config:function(){return m.config&&m.config[a.map.id]||
+{}},exports:q[a.map.id]}}};X=function(a){this.events=Y[a.id]||{};this.map=a;this.shim=m.shim[a.id];this.depExports=[];this.depMaps=[];this.depMatched=[];this.pluginMaps={};this.depCount=0};X.prototype={init:function(a,d,b,c){c=c||{};if(!this.inited){this.factory=d;if(b)this.on("error",b);else this.events.error&&(b=t(this,function(a){this.emit("error",a)}));this.depMaps=a&&a.slice(0);this.depMaps.rjsSkipMap=a.rjsSkipMap;this.errback=b;this.inited=!0;this.ignore=c.ignore;c.enabled||this.enabled?this.enable():
+this.check()}},defineDepById:function(a,d){var b;o(this.depMaps,function(d,c){if(d.id===a)return b=c,!0});return this.defineDep(b,d)},defineDep:function(a,d){this.depMatched[a]||(this.depMatched[a]=!0,this.depCount-=1,this.depExports[a]=d)},fetch:function(){if(!this.fetched){this.fetched=!0;g.startTime=(new Date).getTime();var a=this.map;if(this.shim)u(this,!0)(this.shim.deps||[],t(this,function(){return a.prefix?this.callPlugin():this.load()}));else return a.prefix?this.callPlugin():this.load()}},
+load:function(){var a=this.map.url;R[a]||(R[a]=!0,g.load(this.map.id,a))},check:function(a){if(this.enabled&&!this.enabling){var d,b,c=this.map.id;b=this.depExports;var e=this.exports,i=this.factory;if(this.inited)if(this.error)this.emit("error",this.error);else{if(!this.defining){this.defining=!0;if(this.depCount<1&&!this.defined){if(x(i)){if(this.events.error)try{e=g.execCb(c,i,b,e)}catch(f){d=f}else e=g.execCb(c,i,b,e);if(this.map.isDefine)if((b=this.module)&&b.exports!==void 0&&b.exports!==this.exports)e=
+b.exports;else if(e===void 0&&this.usingExports)e=this.exports;if(d)return d.requireMap=this.map,d.requireModules=[this.map.id],d.requireType="define",A(this.error=d)}else e=i;this.exports=e;if(this.map.isDefine&&!this.ignore&&(q[c]=e,j.onResourceLoad))j.onResourceLoad(g,this.map,this.depMaps);delete n[c];this.defined=!0;g.waitCount-=1;g.waitCount===0&&(L=[])}this.defining=!1;if(!a&&this.defined&&!this.defineEmitted)this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0}}else this.fetch()}},
+callPlugin:function(){var a=this.map,d=a.id,b=c(a.prefix,null,!1,!0);r(b,"defined",t(this,function(b){var k;k=this.map.name;var i=this.map.parentMap?this.map.parentMap.name:null;if(this.map.unnormalized){if(b.normalize&&(k=b.normalize(k,function(a){return e(a,i,!0)})||""),b=c(a.prefix+"!"+k,this.map.parentMap,!1,!0),r(b,"defined",t(this,function(a){this.init([],function(){return a},null,{enabled:!0,ignore:!0})})),b=n[b.id]){if(this.events.error)b.on("error",t(this,function(a){this.emit("error",a)}));
+b.enable()}}else k=t(this,function(a){this.init([],function(){return a},null,{enabled:!0})}),k.error=t(this,function(a){this.inited=!0;this.error=a;a.requireModules=[d];y(n,function(a){a.map.id.indexOf(d+"_unnormalized")===0&&z(a.map.id)});A(a)}),k.fromText=function(a,b){var d=K;d&&(K=!1);p(c(a));j.exec(b);d&&(K=!0);g.completeLoad(a)},b.load(a.name,u(a.parentMap,!0,function(a,b,d){a.rjsSkipMap=!0;return g.require(a,b,d)}),k,m)}));g.enable(b,this);this.pluginMaps[b.id]=b},enable:function(){this.enabled=
+!0;if(!this.waitPushed)L.push(this),g.waitCount+=1,this.waitPushed=!0;this.enabling=!0;o(this.depMaps,t(this,function(a,b){var k,e;if(typeof a==="string"){a=c(a,this.map.isDefine?this.map:this.map.parentMap,!1,!this.depMaps.rjsSkipMap);this.depMaps[b]=a;if(k=Q[a.id]){this.depExports[b]=k(this);return}this.depCount+=1;r(a,"defined",t(this,function(a){this.defineDep(b,a);this.check()}));this.errback&&r(a,"error",this.errback)}k=a.id;e=n[k];!Q[k]&&e&&!e.enabled&&g.enable(a,this)}));y(this.pluginMaps,
+t(this,function(a){var b=n[a.id];b&&!b.enabled&&g.enable(a,this)}));this.enabling=!1;this.check()},on:function(a,b){var c=this.events[a];c||(c=this.events[a]=[]);c.push(b)},emit:function(a,b){o(this.events[a],function(a){a(b)});a==="error"&&delete this.events[a]}};return g={config:m,contextName:b,registry:n,defined:q,urlFetched:R,waitCount:0,defQueue:D,Module:X,makeModuleMap:c,configure:function(a){a.baseUrl&&a.baseUrl.charAt(a.baseUrl.length-1)!=="/"&&(a.baseUrl+="/");var b=m.pkgs,e=m.shim,f=m.paths,
+j=m.map;N(m,a,!0);m.paths=N(f,a.paths,!0);if(a.map)m.map=N(j||{},a.map,!0,!0);if(a.shim)y(a.shim,function(a,b){E(a)&&(a={deps:a});if(a.exports&&!a.exports.__buildReady)a.exports=g.makeShimExports(a.exports);e[b]=a}),m.shim=e;if(a.packages)o(a.packages,function(a){a=typeof a==="string"?{name:a}:a;b[a.name]={name:a.name,location:a.location||a.name,main:(a.main||"main").replace(ka,"").replace(ea,"")}}),m.pkgs=b;y(n,function(a,b){if(!a.inited&&!a.map.unnormalized)a.map=c(b)});if(a.deps||a.callback)g.require(a.deps||
+[],a.callback)},makeShimExports:function(a){var b;return typeof a==="string"?(b=function(){return $(a)},b.exports=a,b):function(){return a.apply(Z,arguments)}},requireDefined:function(a,b){var e=c(a,b,!1,!0).id;return F.call(q,e)},requireSpecified:function(a,b){a=c(a,b,!1,!0).id;return F.call(q,a)||F.call(n,a)},require:function(a,d,e,f){var h;if(typeof a==="string"){if(x(d))return A(G("requireargs","Invalid require call"),e);if(j.get)return j.get(g,a,d);a=c(a,d,!1,!0);a=a.id;return!F.call(q,a)?A(G("notloaded",
+'Module name "'+a+'" has not been loaded yet for context: '+b)):q[a]}e&&!x(e)&&(f=e,e=void 0);d&&!x(d)&&(f=d,d=void 0);for(s();D.length;)if(h=D.shift(),h[0]===null)return A(G("mismatch","Mismatched anonymous define() module: "+h[h.length-1]));else W(h);p(c(null,f)).init(a,d,e,{enabled:!0});T();return g.require},undef:function(a){s();var b=c(a,null,!0),e=n[a];delete q[a];delete R[b.url];delete Y[a];if(e){if(e.events.defined)Y[a]=e.events;z(a)}},enable:function(a){n[a.id]&&p(a).enable()},completeLoad:function(a){var b,
+c,e=m.shim[a]||{},f=e.exports&&e.exports.exports;for(s();D.length;){c=D.shift();if(c[0]===null){c[0]=a;if(b)break;b=!0}else c[0]===a&&(b=!0);W(c)}c=n[a];if(!b&&!q[a]&&c&&!c.inited)if(m.enforceDefine&&(!f||!$(f)))if(h(a))return;else return A(G("nodefine","No define call for "+a,null,[a]));else W([a,e.deps||[],e.exports]);T()},toUrl:function(a,b){var c=a.lastIndexOf("."),f=null;c!==-1&&(f=a.substring(c,a.length),a=a.substring(0,c));return g.nameToUrl(e(a,b&&b.id,!0),f)},nameToUrl:function(a,b){var c,
+e,f,i,h,g;if(j.jsExtRegExp.test(a))i=a+(b||"");else{c=m.paths;e=m.pkgs;i=a.split("/");for(h=i.length;h>0;h-=1)if(g=i.slice(0,h).join("/"),f=e[g],g=c[g]){E(g)&&(g=g[0]);i.splice(0,h,g);break}else if(f){c=a===f.name?f.location+"/"+f.main:f.location;i.splice(0,h,c);break}i=i.join("/");i+=b||(/\?/.test(i)?"":".js");i=(i.charAt(0)==="/"||i.match(/^[\w\+\.\-]+:/)?"":m.baseUrl)+i}return m.urlArgs?i+((i.indexOf("?")===-1?"?":"&")+m.urlArgs):i},load:function(a,b){j.load(g,a,b)},execCb:function(a,b,c,e){return b.apply(e,
+c)},onScriptLoad:function(a){if(a.type==="load"||ma.test((a.currentTarget||a.srcElement).readyState))H=null,a=J(a),g.completeLoad(a.id)},onScriptError:function(a){var b=J(a);if(!h(b.id))return A(G("scripterror","Script error",a,[b.id]))}}}};j({});ba(j);if(w&&(u=p.head=document.getElementsByTagName("head")[0],B=document.getElementsByTagName("base")[0]))u=p.head=B.parentNode;j.onError=function(b){throw b;};j.load=function(b,e,f){var h=b&&b.config||{},c;if(w)return c=h.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml",
+"html:script"):document.createElement("script"),c.type=h.scriptType||"text/javascript",c.charset="utf-8",c.async=!0,c.setAttribute("data-requirecontext",b.contextName),c.setAttribute("data-requiremodule",e),c.attachEvent&&!(c.attachEvent.toString&&c.attachEvent.toString().indexOf("[native code")<0)&&!S?(K=!0,c.attachEvent("onreadystatechange",b.onScriptLoad)):(c.addEventListener("load",b.onScriptLoad,!1),c.addEventListener("error",b.onScriptError,!1)),c.src=f,I=c,B?u.insertBefore(c,B):u.appendChild(c),
+I=null,c;else fa&&(importScripts(f),b.completeLoad(e))};w&&M(document.getElementsByTagName("script"),function(b){if(!u)u=b.parentNode;if(s=b.getAttribute("data-main")){if(!r.baseUrl)C=s.split("/"),ca=C.pop(),da=C.length?C.join("/")+"/":"./",r.baseUrl=da,s=ca;s=s.replace(ea,"");r.deps=r.deps?r.deps.concat(s):[s];return!0}});define=function(b,e,f){var h,c;typeof b!=="string"&&(f=e,e=b,b=null);E(e)||(f=e,e=[]);!e.length&&x(f)&&f.length&&(f.toString().replace(ia,"").replace(ja,function(b,c){e.push(c)}),
+e=(f.length===1?["require"]:["require","exports","module"]).concat(e));if(K&&(h=I||ha()))b||(b=h.getAttribute("data-requiremodule")),c=z[h.getAttribute("data-requirecontext")];(c?c.defQueue:P).push([b,e,f])};define.amd={jQuery:!0};j.exec=function(b){return eval(b)};j(r)}})(this);

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/js/libs/text.js
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/js/libs/text.js b/src/main/webapp/assets/js/libs/text.js
new file mode 100644
index 0000000..b4623c5
--- /dev/null
+++ b/src/main/webapp/assets/js/libs/text.js
@@ -0,0 +1,367 @@
+/**
+ * @license RequireJS text 2.0.6 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/requirejs/text for details
+ */
+/*jslint regexp: true */
+/*global require, XMLHttpRequest, ActiveXObject,
+  define, window, process, Packages,
+  java, location, Components, FileUtils */
+
+define(['module'], function (module) {
+    'use strict';
+
+    var text, fs, Cc, Ci,
+        progIds = ['Msxml2.XMLHTTP', 'Microsoft.XMLHTTP', 'Msxml2.XMLHTTP.4.0'],
+        xmlRegExp = /^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,
+        bodyRegExp = /<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,
+        hasLocation = typeof location !== 'undefined' && location.href,
+        defaultProtocol = hasLocation && location.protocol && location.protocol.replace(/\:/, ''),
+        defaultHostName = hasLocation && location.hostname,
+        defaultPort = hasLocation && (location.port || undefined),
+        buildMap = [],
+        masterConfig = (module.config && module.config()) || {};
+
+    text = {
+        version: '2.0.6',
+
+        strip: function (content) {
+            //Strips <?xml ...?> declarations so that external SVG and XML
+            //documents can be added to a document without worry. Also, if the string
+            //is an HTML document, only the part inside the body tag is returned.
+            if (content) {
+                content = content.replace(xmlRegExp, "");
+                var matches = content.match(bodyRegExp);
+                if (matches) {
+                    content = matches[1];
+                }
+            } else {
+                content = "";
+            }
+            return content;
+        },
+
+        jsEscape: function (content) {
+            return content.replace(/(['\\])/g, '\\$1')
+                .replace(/[\f]/g, "\\f")
+                .replace(/[\b]/g, "\\b")
+                .replace(/[\n]/g, "\\n")
+                .replace(/[\t]/g, "\\t")
+                .replace(/[\r]/g, "\\r")
+                .replace(/[\u2028]/g, "\\u2028")
+                .replace(/[\u2029]/g, "\\u2029");
+        },
+
+        createXhr: masterConfig.createXhr || function () {
+            //Would love to dump the ActiveX crap in here. Need IE 6 to die first.
+            var xhr, i, progId;
+            if (typeof XMLHttpRequest !== "undefined") {
+                return new XMLHttpRequest();
+            } else if (typeof ActiveXObject !== "undefined") {
+                for (i = 0; i < 3; i += 1) {
+                    progId = progIds[i];
+                    try {
+                        xhr = new ActiveXObject(progId);
+                    } catch (e) {}
+
+                    if (xhr) {
+                        progIds = [progId];  // so faster next time
+                        break;
+                    }
+                }
+            }
+
+            return xhr;
+        },
+
+        /**
+         * Parses a resource name into its component parts. Resource names
+         * look like: module/name.ext!strip, where the !strip part is
+         * optional.
+         * @param {String} name the resource name
+         * @returns {Object} with properties "moduleName", "ext" and "strip"
+         * where strip is a boolean.
+         */
+        parseName: function (name) {
+            var modName, ext, temp,
+                strip = false,
+                index = name.indexOf("."),
+                isRelative = name.indexOf('./') === 0 ||
+                             name.indexOf('../') === 0;
+
+            if (index !== -1 && (!isRelative || index > 1)) {
+                modName = name.substring(0, index);
+                ext = name.substring(index + 1, name.length);
+            } else {
+                modName = name;
+            }
+
+            temp = ext || modName;
+            index = temp.indexOf("!");
+            if (index !== -1) {
+                //Pull off the strip arg.
+                strip = temp.substring(index + 1) === "strip";
+                temp = temp.substring(0, index);
+                if (ext) {
+                    ext = temp;
+                } else {
+                    modName = temp;
+                }
+            }
+
+            return {
+                moduleName: modName,
+                ext: ext,
+                strip: strip
+            };
+        },
+
+        xdRegExp: /^((\w+)\:)?\/\/([^\/\\]+)/,
+
+        /**
+         * Is an URL on another domain. Only works for browser use, returns
+         * false in non-browser environments. Only used to know if an
+         * optimized .js version of a text resource should be loaded
+         * instead.
+         * @param {String} url
+         * @returns Boolean
+         */
+        useXhr: function (url, protocol, hostname, port) {
+            var uProtocol, uHostName, uPort,
+                match = text.xdRegExp.exec(url);
+            if (!match) {
+                return true;
+            }
+            uProtocol = match[2];
+            uHostName = match[3];
+
+            uHostName = uHostName.split(':');
+            uPort = uHostName[1];
+            uHostName = uHostName[0];
+
+            return (!uProtocol || uProtocol === protocol) &&
+                   (!uHostName || uHostName.toLowerCase() === hostname.toLowerCase()) &&
+                   ((!uPort && !uHostName) || uPort === port);
+        },
+
+        finishLoad: function (name, strip, content, onLoad) {
+            content = strip ? text.strip(content) : content;
+            if (masterConfig.isBuild) {
+                buildMap[name] = content;
+            }
+            onLoad(content);
+        },
+
+        load: function (name, req, onLoad, config) {
+            //Name has format: some.module.filext!strip
+            //The strip part is optional.
+            //if strip is present, then that means only get the string contents
+            //inside a body tag in an HTML string. For XML/SVG content it means
+            //removing the <?xml ...?> declarations so the content can be inserted
+            //into the current doc without problems.
+
+            // Do not bother with the work if a build and text will
+            // not be inlined.
+            if (config.isBuild && !config.inlineText) {
+                onLoad();
+                return;
+            }
+
+            masterConfig.isBuild = config.isBuild;
+
+            var parsed = text.parseName(name),
+                nonStripName = parsed.moduleName +
+                    (parsed.ext ? '.' + parsed.ext : ''),
+                url = req.toUrl(nonStripName),
+                useXhr = (masterConfig.useXhr) ||
+                         text.useXhr;
+
+            //Load the text. Use XHR if possible and in a browser.
+            if (!hasLocation || useXhr(url, defaultProtocol, defaultHostName, defaultPort)) {
+                text.get(url, function (content) {
+                    text.finishLoad(name, parsed.strip, content, onLoad);
+                }, function (err) {
+                    if (onLoad.error) {
+                        onLoad.error(err);
+                    }
+                });
+            } else {
+                //Need to fetch the resource across domains. Assume
+                //the resource has been optimized into a JS module. Fetch
+                //by the module name + extension, but do not include the
+                //!strip part to avoid file system issues.
+                req([nonStripName], function (content) {
+                    text.finishLoad(parsed.moduleName + '.' + parsed.ext,
+                                    parsed.strip, content, onLoad);
+                });
+            }
+        },
+
+        write: function (pluginName, moduleName, write, config) {
+            if (buildMap.hasOwnProperty(moduleName)) {
+                var content = text.jsEscape(buildMap[moduleName]);
+                write.asModule(pluginName + "!" + moduleName,
+                               "define(function () { return '" +
+                                   content +
+                               "';});\n");
+            }
+        },
+
+        writeFile: function (pluginName, moduleName, req, write, config) {
+            var parsed = text.parseName(moduleName),
+                extPart = parsed.ext ? '.' + parsed.ext : '',
+                nonStripName = parsed.moduleName + extPart,
+                //Use a '.js' file name so that it indicates it is a
+                //script that can be loaded across domains.
+                fileName = req.toUrl(parsed.moduleName + extPart) + '.js';
+
+            //Leverage own load() method to load plugin value, but only
+            //write out values that do not have the strip argument,
+            //to avoid any potential issues with ! in file names.
+            text.load(nonStripName, req, function (value) {
+                //Use own write() method to construct full module value.
+                //But need to create shell that translates writeFile's
+                //write() to the right interface.
+                var textWrite = function (contents) {
+                    return write(fileName, contents);
+                };
+                textWrite.asModule = function (moduleName, contents) {
+                    return write.asModule(moduleName, fileName, contents);
+                };
+
+                text.write(pluginName, nonStripName, textWrite, config);
+            }, config);
+        }
+    };
+
+    if (masterConfig.env === 'node' || (!masterConfig.env &&
+            typeof process !== "undefined" &&
+            process.versions &&
+            !!process.versions.node)) {
+        //Using special require.nodeRequire, something added by r.js.
+        fs = require.nodeRequire('fs');
+
+        text.get = function (url, callback) {
+            var file = fs.readFileSync(url, 'utf8');
+            //Remove BOM (Byte Mark Order) from utf8 files if it is there.
+            if (file.indexOf('\uFEFF') === 0) {
+                file = file.substring(1);
+            }
+            callback(file);
+        };
+    } else if (masterConfig.env === 'xhr' || (!masterConfig.env &&
+            text.createXhr())) {
+        text.get = function (url, callback, errback, headers) {
+            var xhr = text.createXhr(), header;
+            xhr.open('GET', url, true);
+
+            //Allow plugins direct access to xhr headers
+            if (headers) {
+                for (header in headers) {
+                    if (headers.hasOwnProperty(header)) {
+                        xhr.setRequestHeader(header.toLowerCase(), headers[header]);
+                    }
+                }
+            }
+
+            //Allow overrides specified in config
+            if (masterConfig.onXhr) {
+                masterConfig.onXhr(xhr, url);
+            }
+
+            xhr.onreadystatechange = function (evt) {
+                var status, err;
+                //Do not explicitly handle errors, those should be
+                //visible via console output in the browser.
+                if (xhr.readyState === 4) {
+                    status = xhr.status;
+                    if (status > 399 && status < 600) {
+                        //An http 4xx or 5xx error. Signal an error.
+                        err = new Error(url + ' HTTP status: ' + status);
+                        err.xhr = xhr;
+                        errback(err);
+                    } else {
+                        callback(xhr.responseText);
+                    }
+
+                    if (masterConfig.onXhrComplete) {
+                        masterConfig.onXhrComplete(xhr, url);
+                    }
+                }
+            };
+            xhr.send(null);
+        };
+    } else if (masterConfig.env === 'rhino' || (!masterConfig.env &&
+            typeof Packages !== 'undefined' && typeof java !== 'undefined')) {
+        //Why Java, why is this so awkward?
+        text.get = function (url, callback) {
+            var stringBuffer, line,
+                encoding = "utf-8",
+                file = new java.io.File(url),
+                lineSeparator = java.lang.System.getProperty("line.separator"),
+                input = new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(file), encoding)),
+                content = '';
+            try {
+                stringBuffer = new java.lang.StringBuffer();
+                line = input.readLine();
+
+                // Byte Order Mark (BOM) - The Unicode Standard, version 3.0, page 324
+                // http://www.unicode.org/faq/utf_bom.html
+
+                // Note that when we use utf-8, the BOM should appear as "EF BB BF", but it doesn't due to this bug in the JDK:
+                // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4508058
+                if (line && line.length() && line.charAt(0) === 0xfeff) {
+                    // Eat the BOM, since we've already found the encoding on this file,
+                    // and we plan to concatenating this buffer with others; the BOM should
+                    // only appear at the top of a file.
+                    line = line.substring(1);
+                }
+
+                stringBuffer.append(line);
+
+                while ((line = input.readLine()) !== null) {
+                    stringBuffer.append(lineSeparator);
+                    stringBuffer.append(line);
+                }
+                //Make sure we return a JavaScript string and not a Java string.
+                content = String(stringBuffer.toString()); //String
+            } finally {
+                input.close();
+            }
+            callback(content);
+        };
+    } else if (masterConfig.env === 'xpconnect' || (!masterConfig.env &&
+            typeof Components !== 'undefined' && Components.classes &&
+            Components.interfaces)) {
+        //Avert your gaze!
+        Cc = Components.classes,
+        Ci = Components.interfaces;
+        Components.utils['import']('resource://gre/modules/FileUtils.jsm');
+
+        text.get = function (url, callback) {
+            var inStream, convertStream,
+                readData = {},
+                fileObj = new FileUtils.File(url);
+
+            //XPCOM, you so crazy
+            try {
+                inStream = Cc['@mozilla.org/network/file-input-stream;1']
+                           .createInstance(Ci.nsIFileInputStream);
+                inStream.init(fileObj, 1, 0, false);
+
+                convertStream = Cc['@mozilla.org/intl/converter-input-stream;1']
+                                .createInstance(Ci.nsIConverterInputStream);
+                convertStream.init(inStream, "utf-8", inStream.available(),
+                Ci.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER);
+
+                convertStream.readString(inStream.available(), readData);
+                convertStream.close();
+                inStream.close();
+                callback(readData.value);
+            } catch (e) {
+                throw new Error((fileObj && fileObj.path || '') + ': ' + e);
+            }
+        };
+    }
+    return text;
+});


[40/51] [abbrv] [partial] brooklyn-ui git commit: move subdir from incubator up a level as it is promoted to its own repo (first non-incubator commit!)

Posted by he...@apache.org.
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/js/libs/jquery.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/js/libs/jquery.js b/brooklyn-ui/src/main/webapp/assets/js/libs/jquery.js
deleted file mode 100644
index 3774ff9..0000000
--- a/brooklyn-ui/src/main/webapp/assets/js/libs/jquery.js
+++ /dev/null
@@ -1,9404 +0,0 @@
-/*!
- * jQuery JavaScript Library v1.7.2
- * http://jquery.com/
- *
- * Copyright 2011, John Resig
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * Includes Sizzle.js
- * http://sizzlejs.com/
- * Copyright 2011, The Dojo Foundation
- * Released under the MIT, BSD, and GPL Licenses.
- *
- * Date: Wed Mar 21 12:46:34 2012 -0700
- */
-(function( window, undefined ) {
-
-// Use the correct document accordingly with window argument (sandbox)
-var document = window.document,
-	navigator = window.navigator,
-	location = window.location;
-var jQuery = (function() {
-
-// Define a local copy of jQuery
-var jQuery = function( selector, context ) {
-		// The jQuery object is actually just the init constructor 'enhanced'
-		return new jQuery.fn.init( selector, context, rootjQuery );
-	},
-
-	// Map over jQuery in case of overwrite
-	_jQuery = window.jQuery,
-
-	// Map over the $ in case of overwrite
-	_$ = window.$,
-
-	// A central reference to the root jQuery(document)
-	rootjQuery,
-
-	// A simple way to check for HTML strings or ID strings
-	// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
-	quickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,
-
-	// Check if a string has a non-whitespace character in it
-	rnotwhite = /\S/,
-
-	// Used for trimming whitespace
-	trimLeft = /^\s+/,
-	trimRight = /\s+$/,
-
-	// Match a standalone tag
-	rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
-
-	// JSON RegExp
-	rvalidchars = /^[\],:{}\s]*$/,
-	rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
-	rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
-	rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
-
-	// Useragent RegExp
-	rwebkit = /(webkit)[ \/]([\w.]+)/,
-	ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/,
-	rmsie = /(msie) ([\w.]+)/,
-	rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/,
-
-	// Matches dashed string for camelizing
-	rdashAlpha = /-([a-z]|[0-9])/ig,
-	rmsPrefix = /^-ms-/,
-
-	// Used by jQuery.camelCase as callback to replace()
-	fcamelCase = function( all, letter ) {
-		return ( letter + "" ).toUpperCase();
-	},
-
-	// Keep a UserAgent string for use with jQuery.browser
-	userAgent = navigator.userAgent,
-
-	// For matching the engine and version of the browser
-	browserMatch,
-
-	// The deferred used on DOM ready
-	readyList,
-
-	// The ready event handler
-	DOMContentLoaded,
-
-	// Save a reference to some core methods
-	toString = Object.prototype.toString,
-	hasOwn = Object.prototype.hasOwnProperty,
-	push = Array.prototype.push,
-	slice = Array.prototype.slice,
-	trim = String.prototype.trim,
-	indexOf = Array.prototype.indexOf,
-
-	// [[Class]] -> type pairs
-	class2type = {};
-
-jQuery.fn = jQuery.prototype = {
-	constructor: jQuery,
-	init: function( selector, context, rootjQuery ) {
-		var match, elem, ret, doc;
-
-		// Handle $(""), $(null), or $(undefined)
-		if ( !selector ) {
-			return this;
-		}
-
-		// Handle $(DOMElement)
-		if ( selector.nodeType ) {
-			this.context = this[0] = selector;
-			this.length = 1;
-			return this;
-		}
-
-		// The body element only exists once, optimize finding it
-		if ( selector === "body" && !context && document.body ) {
-			this.context = document;
-			this[0] = document.body;
-			this.selector = selector;
-			this.length = 1;
-			return this;
-		}
-
-		// Handle HTML strings
-		if ( typeof selector === "string" ) {
-			// Are we dealing with HTML string or an ID?
-			if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
-				// Assume that strings that start and end with <> are HTML and skip the regex check
-				match = [ null, selector, null ];
-
-			} else {
-				match = quickExpr.exec( selector );
-			}
-
-			// Verify a match, and that no context was specified for #id
-			if ( match && (match[1] || !context) ) {
-
-				// HANDLE: $(html) -> $(array)
-				if ( match[1] ) {
-					context = context instanceof jQuery ? context[0] : context;
-					doc = ( context ? context.ownerDocument || context : document );
-
-					// If a single string is passed in and it's a single tag
-					// just do a createElement and skip the rest
-					ret = rsingleTag.exec( selector );
-
-					if ( ret ) {
-						if ( jQuery.isPlainObject( context ) ) {
-							selector = [ document.createElement( ret[1] ) ];
-							jQuery.fn.attr.call( selector, context, true );
-
-						} else {
-							selector = [ doc.createElement( ret[1] ) ];
-						}
-
-					} else {
-						ret = jQuery.buildFragment( [ match[1] ], [ doc ] );
-						selector = ( ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment ).childNodes;
-					}
-
-					return jQuery.merge( this, selector );
-
-				// HANDLE: $("#id")
-				} else {
-					elem = document.getElementById( match[2] );
-
-					// Check parentNode to catch when Blackberry 4.6 returns
-					// nodes that are no longer in the document #6963
-					if ( elem && elem.parentNode ) {
-						// Handle the case where IE and Opera return items
-						// by name instead of ID
-						if ( elem.id !== match[2] ) {
-							return rootjQuery.find( selector );
-						}
-
-						// Otherwise, we inject the element directly into the jQuery object
-						this.length = 1;
-						this[0] = elem;
-					}
-
-					this.context = document;
-					this.selector = selector;
-					return this;
-				}
-
-			// HANDLE: $(expr, $(...))
-			} else if ( !context || context.jquery ) {
-				return ( context || rootjQuery ).find( selector );
-
-			// HANDLE: $(expr, context)
-			// (which is just equivalent to: $(context).find(expr)
-			} else {
-				return this.constructor( context ).find( selector );
-			}
-
-		// HANDLE: $(function)
-		// Shortcut for document ready
-		} else if ( jQuery.isFunction( selector ) ) {
-			return rootjQuery.ready( selector );
-		}
-
-		if ( selector.selector !== undefined ) {
-			this.selector = selector.selector;
-			this.context = selector.context;
-		}
-
-		return jQuery.makeArray( selector, this );
-	},
-
-	// Start with an empty selector
-	selector: "",
-
-	// The current version of jQuery being used
-	jquery: "1.7.2",
-
-	// The default length of a jQuery object is 0
-	length: 0,
-
-	// The number of elements contained in the matched element set
-	size: function() {
-		return this.length;
-	},
-
-	toArray: function() {
-		return slice.call( this, 0 );
-	},
-
-	// Get the Nth element in the matched element set OR
-	// Get the whole matched element set as a clean array
-	get: function( num ) {
-		return num == null ?
-
-			// Return a 'clean' array
-			this.toArray() :
-
-			// Return just the object
-			( num < 0 ? this[ this.length + num ] : this[ num ] );
-	},
-
-	// Take an array of elements and push it onto the stack
-	// (returning the new matched element set)
-	pushStack: function( elems, name, selector ) {
-		// Build a new jQuery matched element set
-		var ret = this.constructor();
-
-		if ( jQuery.isArray( elems ) ) {
-			push.apply( ret, elems );
-
-		} else {
-			jQuery.merge( ret, elems );
-		}
-
-		// Add the old object onto the stack (as a reference)
-		ret.prevObject = this;
-
-		ret.context = this.context;
-
-		if ( name === "find" ) {
-			ret.selector = this.selector + ( this.selector ? " " : "" ) + selector;
-		} else if ( name ) {
-			ret.selector = this.selector + "." + name + "(" + selector + ")";
-		}
-
-		// Return the newly-formed element set
-		return ret;
-	},
-
-	// Execute a callback for every element in the matched set.
-	// (You can seed the arguments with an array of args, but this is
-	// only used internally.)
-	each: function( callback, args ) {
-		return jQuery.each( this, callback, args );
-	},
-
-	ready: function( fn ) {
-		// Attach the listeners
-		jQuery.bindReady();
-
-		// Add the callback
-		readyList.add( fn );
-
-		return this;
-	},
-
-	eq: function( i ) {
-		i = +i;
-		return i === -1 ?
-			this.slice( i ) :
-			this.slice( i, i + 1 );
-	},
-
-	first: function() {
-		return this.eq( 0 );
-	},
-
-	last: function() {
-		return this.eq( -1 );
-	},
-
-	slice: function() {
-		return this.pushStack( slice.apply( this, arguments ),
-			"slice", slice.call(arguments).join(",") );
-	},
-
-	map: function( callback ) {
-		return this.pushStack( jQuery.map(this, function( elem, i ) {
-			return callback.call( elem, i, elem );
-		}));
-	},
-
-	end: function() {
-		return this.prevObject || this.constructor(null);
-	},
-
-	// For internal use only.
-	// Behaves like an Array's method, not like a jQuery method.
-	push: push,
-	sort: [].sort,
-	splice: [].splice
-};
-
-// Give the init function the jQuery prototype for later instantiation
-jQuery.fn.init.prototype = jQuery.fn;
-
-jQuery.extend = jQuery.fn.extend = function() {
-	var options, name, src, copy, copyIsArray, clone,
-		target = arguments[0] || {},
-		i = 1,
-		length = arguments.length,
-		deep = false;
-
-	// Handle a deep copy situation
-	if ( typeof target === "boolean" ) {
-		deep = target;
-		target = arguments[1] || {};
-		// skip the boolean and the target
-		i = 2;
-	}
-
-	// Handle case when target is a string or something (possible in deep copy)
-	if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
-		target = {};
-	}
-
-	// extend jQuery itself if only one argument is passed
-	if ( length === i ) {
-		target = this;
-		--i;
-	}
-
-	for ( ; i < length; i++ ) {
-		// Only deal with non-null/undefined values
-		if ( (options = arguments[ i ]) != null ) {
-			// Extend the base object
-			for ( name in options ) {
-				src = target[ name ];
-				copy = options[ name ];
-
-				// Prevent never-ending loop
-				if ( target === copy ) {
-					continue;
-				}
-
-				// Recurse if we're merging plain objects or arrays
-				if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
-					if ( copyIsArray ) {
-						copyIsArray = false;
-						clone = src && jQuery.isArray(src) ? src : [];
-
-					} else {
-						clone = src && jQuery.isPlainObject(src) ? src : {};
-					}
-
-					// Never move original objects, clone them
-					target[ name ] = jQuery.extend( deep, clone, copy );
-
-				// Don't bring in undefined values
-				} else if ( copy !== undefined ) {
-					target[ name ] = copy;
-				}
-			}
-		}
-	}
-
-	// Return the modified object
-	return target;
-};
-
-jQuery.extend({
-	noConflict: function( deep ) {
-		if ( window.$ === jQuery ) {
-			window.$ = _$;
-		}
-
-		if ( deep && window.jQuery === jQuery ) {
-			window.jQuery = _jQuery;
-		}
-
-		return jQuery;
-	},
-
-	// Is the DOM ready to be used? Set to true once it occurs.
-	isReady: false,
-
-	// A counter to track how many items to wait for before
-	// the ready event fires. See #6781
-	readyWait: 1,
-
-	// Hold (or release) the ready event
-	holdReady: function( hold ) {
-		if ( hold ) {
-			jQuery.readyWait++;
-		} else {
-			jQuery.ready( true );
-		}
-	},
-
-	// Handle when the DOM is ready
-	ready: function( wait ) {
-		// Either a released hold or an DOMready/load event and not yet ready
-		if ( (wait === true && !--jQuery.readyWait) || (wait !== true && !jQuery.isReady) ) {
-			// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
-			if ( !document.body ) {
-				return setTimeout( jQuery.ready, 1 );
-			}
-
-			// Remember that the DOM is ready
-			jQuery.isReady = true;
-
-			// If a normal DOM Ready event fired, decrement, and wait if need be
-			if ( wait !== true && --jQuery.readyWait > 0 ) {
-				return;
-			}
-
-			// If there are functions bound, to execute
-			readyList.fireWith( document, [ jQuery ] );
-
-			// Trigger any bound ready events
-			if ( jQuery.fn.trigger ) {
-				jQuery( document ).trigger( "ready" ).off( "ready" );
-			}
-		}
-	},
-
-	bindReady: function() {
-		if ( readyList ) {
-			return;
-		}
-
-		readyList = jQuery.Callbacks( "once memory" );
-
-		// Catch cases where $(document).ready() is called after the
-		// browser event has already occurred.
-		if ( document.readyState === "complete" ) {
-			// Handle it asynchronously to allow scripts the opportunity to delay ready
-			return setTimeout( jQuery.ready, 1 );
-		}
-
-		// Mozilla, Opera and webkit nightlies currently support this event
-		if ( document.addEventListener ) {
-			// Use the handy event callback
-			document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
-
-			// A fallback to window.onload, that will always work
-			window.addEventListener( "load", jQuery.ready, false );
-
-		// If IE event model is used
-		} else if ( document.attachEvent ) {
-			// ensure firing before onload,
-			// maybe late but safe also for iframes
-			document.attachEvent( "onreadystatechange", DOMContentLoaded );
-
-			// A fallback to window.onload, that will always work
-			window.attachEvent( "onload", jQuery.ready );
-
-			// If IE and not a frame
-			// continually check to see if the document is ready
-			var toplevel = false;
-
-			try {
-				toplevel = window.frameElement == null;
-			} catch(e) {}
-
-			if ( document.documentElement.doScroll && toplevel ) {
-				doScrollCheck();
-			}
-		}
-	},
-
-	// See test/unit/core.js for details concerning isFunction.
-	// Since version 1.3, DOM methods and functions like alert
-	// aren't supported. They return false on IE (#2968).
-	isFunction: function( obj ) {
-		return jQuery.type(obj) === "function";
-	},
-
-	isArray: Array.isArray || function( obj ) {
-		return jQuery.type(obj) === "array";
-	},
-
-	isWindow: function( obj ) {
-		return obj != null && obj == obj.window;
-	},
-
-	isNumeric: function( obj ) {
-		return !isNaN( parseFloat(obj) ) && isFinite( obj );
-	},
-
-	type: function( obj ) {
-		return obj == null ?
-			String( obj ) :
-			class2type[ toString.call(obj) ] || "object";
-	},
-
-	isPlainObject: function( obj ) {
-		// Must be an Object.
-		// Because of IE, we also have to check the presence of the constructor property.
-		// Make sure that DOM nodes and window objects don't pass through, as well
-		if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
-			return false;
-		}
-
-		try {
-			// Not own constructor property must be Object
-			if ( obj.constructor &&
-				!hasOwn.call(obj, "constructor") &&
-				!hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
-				return false;
-			}
-		} catch ( e ) {
-			// IE8,9 Will throw exceptions on certain host objects #9897
-			return false;
-		}
-
-		// Own properties are enumerated firstly, so to speed up,
-		// if last one is own, then all properties are own.
-
-		var key;
-		for ( key in obj ) {}
-
-		return key === undefined || hasOwn.call( obj, key );
-	},
-
-	isEmptyObject: function( obj ) {
-		for ( var name in obj ) {
-			return false;
-		}
-		return true;
-	},
-
-	error: function( msg ) {
-		throw new Error( msg );
-	},
-
-	parseJSON: function( data ) {
-		if ( typeof data !== "string" || !data ) {
-			return null;
-		}
-
-		// Make sure leading/trailing whitespace is removed (IE can't handle it)
-		data = jQuery.trim( data );
-
-		// Attempt to parse using the native JSON parser first
-		if ( window.JSON && window.JSON.parse ) {
-			return window.JSON.parse( data );
-		}
-
-		// Make sure the incoming data is actual JSON
-		// Logic borrowed from http://json.org/json2.js
-		if ( rvalidchars.test( data.replace( rvalidescape, "@" )
-			.replace( rvalidtokens, "]" )
-			.replace( rvalidbraces, "")) ) {
-
-			return ( new Function( "return " + data ) )();
-
-		}
-		jQuery.error( "Invalid JSON: " + data );
-	},
-
-	// Cross-browser xml parsing
-	parseXML: function( data ) {
-		if ( typeof data !== "string" || !data ) {
-			return null;
-		}
-		var xml, tmp;
-		try {
-			if ( window.DOMParser ) { // Standard
-				tmp = new DOMParser();
-				xml = tmp.parseFromString( data , "text/xml" );
-			} else { // IE
-				xml = new ActiveXObject( "Microsoft.XMLDOM" );
-				xml.async = "false";
-				xml.loadXML( data );
-			}
-		} catch( e ) {
-			xml = undefined;
-		}
-		if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
-			jQuery.error( "Invalid XML: " + data );
-		}
-		return xml;
-	},
-
-	noop: function() {},
-
-	// Evaluates a script in a global context
-	// Workarounds based on findings by Jim Driscoll
-	// http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
-	globalEval: function( data ) {
-		if ( data && rnotwhite.test( data ) ) {
-			// We use execScript on Internet Explorer
-			// We use an anonymous function so that context is window
-			// rather than jQuery in Firefox
-			( window.execScript || function( data ) {
-				window[ "eval" ].call( window, data );
-			} )( data );
-		}
-	},
-
-	// Convert dashed to camelCase; used by the css and data modules
-	// Microsoft forgot to hump their vendor prefix (#9572)
-	camelCase: function( string ) {
-		return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
-	},
-
-	nodeName: function( elem, name ) {
-		return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
-	},
-
-	// args is for internal usage only
-	each: function( object, callback, args ) {
-		var name, i = 0,
-			length = object.length,
-			isObj = length === undefined || jQuery.isFunction( object );
-
-		if ( args ) {
-			if ( isObj ) {
-				for ( name in object ) {
-					if ( callback.apply( object[ name ], args ) === false ) {
-						break;
-					}
-				}
-			} else {
-				for ( ; i < length; ) {
-					if ( callback.apply( object[ i++ ], args ) === false ) {
-						break;
-					}
-				}
-			}
-
-		// A special, fast, case for the most common use of each
-		} else {
-			if ( isObj ) {
-				for ( name in object ) {
-					if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
-						break;
-					}
-				}
-			} else {
-				for ( ; i < length; ) {
-					if ( callback.call( object[ i ], i, object[ i++ ] ) === false ) {
-						break;
-					}
-				}
-			}
-		}
-
-		return object;
-	},
-
-	// Use native String.trim function wherever possible
-	trim: trim ?
-		function( text ) {
-			return text == null ?
-				"" :
-				trim.call( text );
-		} :
-
-		// Otherwise use our own trimming functionality
-		function( text ) {
-			return text == null ?
-				"" :
-				text.toString().replace( trimLeft, "" ).replace( trimRight, "" );
-		},
-
-	// results is for internal usage only
-	makeArray: function( array, results ) {
-		var ret = results || [];
-
-		if ( array != null ) {
-			// The window, strings (and functions) also have 'length'
-			// Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930
-			var type = jQuery.type( array );
-
-			if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) {
-				push.call( ret, array );
-			} else {
-				jQuery.merge( ret, array );
-			}
-		}
-
-		return ret;
-	},
-
-	inArray: function( elem, array, i ) {
-		var len;
-
-		if ( array ) {
-			if ( indexOf ) {
-				return indexOf.call( array, elem, i );
-			}
-
-			len = array.length;
-			i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
-
-			for ( ; i < len; i++ ) {
-				// Skip accessing in sparse arrays
-				if ( i in array && array[ i ] === elem ) {
-					return i;
-				}
-			}
-		}
-
-		return -1;
-	},
-
-	merge: function( first, second ) {
-		var i = first.length,
-			j = 0;
-
-		if ( typeof second.length === "number" ) {
-			for ( var l = second.length; j < l; j++ ) {
-				first[ i++ ] = second[ j ];
-			}
-
-		} else {
-			while ( second[j] !== undefined ) {
-				first[ i++ ] = second[ j++ ];
-			}
-		}
-
-		first.length = i;
-
-		return first;
-	},
-
-	grep: function( elems, callback, inv ) {
-		var ret = [], retVal;
-		inv = !!inv;
-
-		// Go through the array, only saving the items
-		// that pass the validator function
-		for ( var i = 0, length = elems.length; i < length; i++ ) {
-			retVal = !!callback( elems[ i ], i );
-			if ( inv !== retVal ) {
-				ret.push( elems[ i ] );
-			}
-		}
-
-		return ret;
-	},
-
-	// arg is for internal usage only
-	map: function( elems, callback, arg ) {
-		var value, key, ret = [],
-			i = 0,
-			length = elems.length,
-			// jquery objects are treated as arrays
-			isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ;
-
-		// Go through the array, translating each of the items to their
-		if ( isArray ) {
-			for ( ; i < length; i++ ) {
-				value = callback( elems[ i ], i, arg );
-
-				if ( value != null ) {
-					ret[ ret.length ] = value;
-				}
-			}
-
-		// Go through every key on the object,
-		} else {
-			for ( key in elems ) {
-				value = callback( elems[ key ], key, arg );
-
-				if ( value != null ) {
-					ret[ ret.length ] = value;
-				}
-			}
-		}
-
-		// Flatten any nested arrays
-		return ret.concat.apply( [], ret );
-	},
-
-	// A global GUID counter for objects
-	guid: 1,
-
-	// Bind a function to a context, optionally partially applying any
-	// arguments.
-	proxy: function( fn, context ) {
-		if ( typeof context === "string" ) {
-			var tmp = fn[ context ];
-			context = fn;
-			fn = tmp;
-		}
-
-		// Quick check to determine if target is callable, in the spec
-		// this throws a TypeError, but we will just return undefined.
-		if ( !jQuery.isFunction( fn ) ) {
-			return undefined;
-		}
-
-		// Simulated bind
-		var args = slice.call( arguments, 2 ),
-			proxy = function() {
-				return fn.apply( context, args.concat( slice.call( arguments ) ) );
-			};
-
-		// Set the guid of unique handler to the same of original handler, so it can be removed
-		proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
-
-		return proxy;
-	},
-
-	// Mutifunctional method to get and set values to a collection
-	// The value/s can optionally be executed if it's a function
-	access: function( elems, fn, key, value, chainable, emptyGet, pass ) {
-		var exec,
-			bulk = key == null,
-			i = 0,
-			length = elems.length;
-
-		// Sets many values
-		if ( key && typeof key === "object" ) {
-			for ( i in key ) {
-				jQuery.access( elems, fn, i, key[i], 1, emptyGet, value );
-			}
-			chainable = 1;
-
-		// Sets one value
-		} else if ( value !== undefined ) {
-			// Optionally, function values get executed if exec is true
-			exec = pass === undefined && jQuery.isFunction( value );
-
-			if ( bulk ) {
-				// Bulk operations only iterate when executing function values
-				if ( exec ) {
-					exec = fn;
-					fn = function( elem, key, value ) {
-						return exec.call( jQuery( elem ), value );
-					};
-
-				// Otherwise they run against the entire set
-				} else {
-					fn.call( elems, value );
-					fn = null;
-				}
-			}
-
-			if ( fn ) {
-				for (; i < length; i++ ) {
-					fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
-				}
-			}
-
-			chainable = 1;
-		}
-
-		return chainable ?
-			elems :
-
-			// Gets
-			bulk ?
-				fn.call( elems ) :
-				length ? fn( elems[0], key ) : emptyGet;
-	},
-
-	now: function() {
-		return ( new Date() ).getTime();
-	},
-
-	// Use of jQuery.browser is frowned upon.
-	// More details: http://docs.jquery.com/Utilities/jQuery.browser
-	uaMatch: function( ua ) {
-		ua = ua.toLowerCase();
-
-		var match = rwebkit.exec( ua ) ||
-			ropera.exec( ua ) ||
-			rmsie.exec( ua ) ||
-			ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) ||
-			[];
-
-		return { browser: match[1] || "", version: match[2] || "0" };
-	},
-
-	sub: function() {
-		function jQuerySub( selector, context ) {
-			return new jQuerySub.fn.init( selector, context );
-		}
-		jQuery.extend( true, jQuerySub, this );
-		jQuerySub.superclass = this;
-		jQuerySub.fn = jQuerySub.prototype = this();
-		jQuerySub.fn.constructor = jQuerySub;
-		jQuerySub.sub = this.sub;
-		jQuerySub.fn.init = function init( selector, context ) {
-			if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) {
-				context = jQuerySub( context );
-			}
-
-			return jQuery.fn.init.call( this, selector, context, rootjQuerySub );
-		};
-		jQuerySub.fn.init.prototype = jQuerySub.fn;
-		var rootjQuerySub = jQuerySub(document);
-		return jQuerySub;
-	},
-
-	browser: {}
-});
-
-// Populate the class2type map
-jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) {
-	class2type[ "[object " + name + "]" ] = name.toLowerCase();
-});
-
-browserMatch = jQuery.uaMatch( userAgent );
-if ( browserMatch.browser ) {
-	jQuery.browser[ browserMatch.browser ] = true;
-	jQuery.browser.version = browserMatch.version;
-}
-
-// Deprecated, use jQuery.browser.webkit instead
-if ( jQuery.browser.webkit ) {
-	jQuery.browser.safari = true;
-}
-
-// IE doesn't match non-breaking spaces with \s
-if ( rnotwhite.test( "\xA0" ) ) {
-	trimLeft = /^[\s\xA0]+/;
-	trimRight = /[\s\xA0]+$/;
-}
-
-// All jQuery objects should point back to these
-rootjQuery = jQuery(document);
-
-// Cleanup functions for the document ready method
-if ( document.addEventListener ) {
-	DOMContentLoaded = function() {
-		document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
-		jQuery.ready();
-	};
-
-} else if ( document.attachEvent ) {
-	DOMContentLoaded = function() {
-		// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
-		if ( document.readyState === "complete" ) {
-			document.detachEvent( "onreadystatechange", DOMContentLoaded );
-			jQuery.ready();
-		}
-	};
-}
-
-// The DOM ready check for Internet Explorer
-function doScrollCheck() {
-	if ( jQuery.isReady ) {
-		return;
-	}
-
-	try {
-		// If IE is used, use the trick by Diego Perini
-		// http://javascript.nwbox.com/IEContentLoaded/
-		document.documentElement.doScroll("left");
-	} catch(e) {
-		setTimeout( doScrollCheck, 1 );
-		return;
-	}
-
-	// and execute any waiting functions
-	jQuery.ready();
-}
-
-return jQuery;
-
-})();
-
-
-// String to Object flags format cache
-var flagsCache = {};
-
-// Convert String-formatted flags into Object-formatted ones and store in cache
-function createFlags( flags ) {
-	var object = flagsCache[ flags ] = {},
-		i, length;
-	flags = flags.split( /\s+/ );
-	for ( i = 0, length = flags.length; i < length; i++ ) {
-		object[ flags[i] ] = true;
-	}
-	return object;
-}
-
-/*
- * Create a callback list using the following parameters:
- *
- *	flags:	an optional list of space-separated flags that will change how
- *			the callback list behaves
- *
- * By default a callback list will act like an event callback list and can be
- * "fired" multiple times.
- *
- * Possible flags:
- *
- *	once:			will ensure the callback list can only be fired once (like a Deferred)
- *
- *	memory:			will keep track of previous values and will call any callback added
- *					after the list has been fired right away with the latest "memorized"
- *					values (like a Deferred)
- *
- *	unique:			will ensure a callback can only be added once (no duplicate in the list)
- *
- *	stopOnFalse:	interrupt callings when a callback returns false
- *
- */
-jQuery.Callbacks = function( flags ) {
-
-	// Convert flags from String-formatted to Object-formatted
-	// (we check in cache first)
-	flags = flags ? ( flagsCache[ flags ] || createFlags( flags ) ) : {};
-
-	var // Actual callback list
-		list = [],
-		// Stack of fire calls for repeatable lists
-		stack = [],
-		// Last fire value (for non-forgettable lists)
-		memory,
-		// Flag to know if list was already fired
-		fired,
-		// Flag to know if list is currently firing
-		firing,
-		// First callback to fire (used internally by add and fireWith)
-		firingStart,
-		// End of the loop when firing
-		firingLength,
-		// Index of currently firing callback (modified by remove if needed)
-		firingIndex,
-		// Add one or several callbacks to the list
-		add = function( args ) {
-			var i,
-				length,
-				elem,
-				type,
-				actual;
-			for ( i = 0, length = args.length; i < length; i++ ) {
-				elem = args[ i ];
-				type = jQuery.type( elem );
-				if ( type === "array" ) {
-					// Inspect recursively
-					add( elem );
-				} else if ( type === "function" ) {
-					// Add if not in unique mode and callback is not in
-					if ( !flags.unique || !self.has( elem ) ) {
-						list.push( elem );
-					}
-				}
-			}
-		},
-		// Fire callbacks
-		fire = function( context, args ) {
-			args = args || [];
-			memory = !flags.memory || [ context, args ];
-			fired = true;
-			firing = true;
-			firingIndex = firingStart || 0;
-			firingStart = 0;
-			firingLength = list.length;
-			for ( ; list && firingIndex < firingLength; firingIndex++ ) {
-				if ( list[ firingIndex ].apply( context, args ) === false && flags.stopOnFalse ) {
-					memory = true; // Mark as halted
-					break;
-				}
-			}
-			firing = false;
-			if ( list ) {
-				if ( !flags.once ) {
-					if ( stack && stack.length ) {
-						memory = stack.shift();
-						self.fireWith( memory[ 0 ], memory[ 1 ] );
-					}
-				} else if ( memory === true ) {
-					self.disable();
-				} else {
-					list = [];
-				}
-			}
-		},
-		// Actual Callbacks object
-		self = {
-			// Add a callback or a collection of callbacks to the list
-			add: function() {
-				if ( list ) {
-					var length = list.length;
-					add( arguments );
-					// Do we need to add the callbacks to the
-					// current firing batch?
-					if ( firing ) {
-						firingLength = list.length;
-					// With memory, if we're not firing then
-					// we should call right away, unless previous
-					// firing was halted (stopOnFalse)
-					} else if ( memory && memory !== true ) {
-						firingStart = length;
-						fire( memory[ 0 ], memory[ 1 ] );
-					}
-				}
-				return this;
-			},
-			// Remove a callback from the list
-			remove: function() {
-				if ( list ) {
-					var args = arguments,
-						argIndex = 0,
-						argLength = args.length;
-					for ( ; argIndex < argLength ; argIndex++ ) {
-						for ( var i = 0; i < list.length; i++ ) {
-							if ( args[ argIndex ] === list[ i ] ) {
-								// Handle firingIndex and firingLength
-								if ( firing ) {
-									if ( i <= firingLength ) {
-										firingLength--;
-										if ( i <= firingIndex ) {
-											firingIndex--;
-										}
-									}
-								}
-								// Remove the element
-								list.splice( i--, 1 );
-								// If we have some unicity property then
-								// we only need to do this once
-								if ( flags.unique ) {
-									break;
-								}
-							}
-						}
-					}
-				}
-				return this;
-			},
-			// Control if a given callback is in the list
-			has: function( fn ) {
-				if ( list ) {
-					var i = 0,
-						length = list.length;
-					for ( ; i < length; i++ ) {
-						if ( fn === list[ i ] ) {
-							return true;
-						}
-					}
-				}
-				return false;
-			},
-			// Remove all callbacks from the list
-			empty: function() {
-				list = [];
-				return this;
-			},
-			// Have the list do nothing anymore
-			disable: function() {
-				list = stack = memory = undefined;
-				return this;
-			},
-			// Is it disabled?
-			disabled: function() {
-				return !list;
-			},
-			// Lock the list in its current state
-			lock: function() {
-				stack = undefined;
-				if ( !memory || memory === true ) {
-					self.disable();
-				}
-				return this;
-			},
-			// Is it locked?
-			locked: function() {
-				return !stack;
-			},
-			// Call all callbacks with the given context and arguments
-			fireWith: function( context, args ) {
-				if ( stack ) {
-					if ( firing ) {
-						if ( !flags.once ) {
-							stack.push( [ context, args ] );
-						}
-					} else if ( !( flags.once && memory ) ) {
-						fire( context, args );
-					}
-				}
-				return this;
-			},
-			// Call all the callbacks with the given arguments
-			fire: function() {
-				self.fireWith( this, arguments );
-				return this;
-			},
-			// To know if the callbacks have already been called at least once
-			fired: function() {
-				return !!fired;
-			}
-		};
-
-	return self;
-};
-
-
-
-
-var // Static reference to slice
-	sliceDeferred = [].slice;
-
-jQuery.extend({
-
-	Deferred: function( func ) {
-		var doneList = jQuery.Callbacks( "once memory" ),
-			failList = jQuery.Callbacks( "once memory" ),
-			progressList = jQuery.Callbacks( "memory" ),
-			state = "pending",
-			lists = {
-				resolve: doneList,
-				reject: failList,
-				notify: progressList
-			},
-			promise = {
-				done: doneList.add,
-				fail: failList.add,
-				progress: progressList.add,
-
-				state: function() {
-					return state;
-				},
-
-				// Deprecated
-				isResolved: doneList.fired,
-				isRejected: failList.fired,
-
-				then: function( doneCallbacks, failCallbacks, progressCallbacks ) {
-					deferred.done( doneCallbacks ).fail( failCallbacks ).progress( progressCallbacks );
-					return this;
-				},
-				always: function() {
-					deferred.done.apply( deferred, arguments ).fail.apply( deferred, arguments );
-					return this;
-				},
-				pipe: function( fnDone, fnFail, fnProgress ) {
-					return jQuery.Deferred(function( newDefer ) {
-						jQuery.each( {
-							done: [ fnDone, "resolve" ],
-							fail: [ fnFail, "reject" ],
-							progress: [ fnProgress, "notify" ]
-						}, function( handler, data ) {
-							var fn = data[ 0 ],
-								action = data[ 1 ],
-								returned;
-							if ( jQuery.isFunction( fn ) ) {
-								deferred[ handler ](function() {
-									returned = fn.apply( this, arguments );
-									if ( returned && jQuery.isFunction( returned.promise ) ) {
-										returned.promise().then( newDefer.resolve, newDefer.reject, newDefer.notify );
-									} else {
-										newDefer[ action + "With" ]( this === deferred ? newDefer : this, [ returned ] );
-									}
-								});
-							} else {
-								deferred[ handler ]( newDefer[ action ] );
-							}
-						});
-					}).promise();
-				},
-				// Get a promise for this deferred
-				// If obj is provided, the promise aspect is added to the object
-				promise: function( obj ) {
-					if ( obj == null ) {
-						obj = promise;
-					} else {
-						for ( var key in promise ) {
-							obj[ key ] = promise[ key ];
-						}
-					}
-					return obj;
-				}
-			},
-			deferred = promise.promise({}),
-			key;
-
-		for ( key in lists ) {
-			deferred[ key ] = lists[ key ].fire;
-			deferred[ key + "With" ] = lists[ key ].fireWith;
-		}
-
-		// Handle state
-		deferred.done( function() {
-			state = "resolved";
-		}, failList.disable, progressList.lock ).fail( function() {
-			state = "rejected";
-		}, doneList.disable, progressList.lock );
-
-		// Call given func if any
-		if ( func ) {
-			func.call( deferred, deferred );
-		}
-
-		// All done!
-		return deferred;
-	},
-
-	// Deferred helper
-	when: function( firstParam ) {
-		var args = sliceDeferred.call( arguments, 0 ),
-			i = 0,
-			length = args.length,
-			pValues = new Array( length ),
-			count = length,
-			pCount = length,
-			deferred = length <= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ?
-				firstParam :
-				jQuery.Deferred(),
-			promise = deferred.promise();
-		function resolveFunc( i ) {
-			return function( value ) {
-				args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;
-				if ( !( --count ) ) {
-					deferred.resolveWith( deferred, args );
-				}
-			};
-		}
-		function progressFunc( i ) {
-			return function( value ) {
-				pValues[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;
-				deferred.notifyWith( promise, pValues );
-			};
-		}
-		if ( length > 1 ) {
-			for ( ; i < length; i++ ) {
-				if ( args[ i ] && args[ i ].promise && jQuery.isFunction( args[ i ].promise ) ) {
-					args[ i ].promise().then( resolveFunc(i), deferred.reject, progressFunc(i) );
-				} else {
-					--count;
-				}
-			}
-			if ( !count ) {
-				deferred.resolveWith( deferred, args );
-			}
-		} else if ( deferred !== firstParam ) {
-			deferred.resolveWith( deferred, length ? [ firstParam ] : [] );
-		}
-		return promise;
-	}
-});
-
-
-
-
-jQuery.support = (function() {
-
-	var support,
-		all,
-		a,
-		select,
-		opt,
-		input,
-		fragment,
-		tds,
-		events,
-		eventName,
-		i,
-		isSupported,
-		div = document.createElement( "div" ),
-		documentElement = document.documentElement;
-
-	// Preliminary tests
-	div.setAttribute("className", "t");
-	div.innerHTML = "   <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
-
-	all = div.getElementsByTagName( "*" );
-	a = div.getElementsByTagName( "a" )[ 0 ];
-
-	// Can't get basic test support
-	if ( !all || !all.length || !a ) {
-		return {};
-	}
-
-	// First batch of supports tests
-	select = document.createElement( "select" );
-	opt = select.appendChild( document.createElement("option") );
-	input = div.getElementsByTagName( "input" )[ 0 ];
-
-	support = {
-		// IE strips leading whitespace when .innerHTML is used
-		leadingWhitespace: ( div.firstChild.nodeType === 3 ),
-
-		// Make sure that tbody elements aren't automatically inserted
-		// IE will insert them into empty tables
-		tbody: !div.getElementsByTagName("tbody").length,
-
-		// Make sure that link elements get serialized correctly by innerHTML
-		// This requires a wrapper element in IE
-		htmlSerialize: !!div.getElementsByTagName("link").length,
-
-		// Get the style information from getAttribute
-		// (IE uses .cssText instead)
-		style: /top/.test( a.getAttribute("style") ),
-
-		// Make sure that URLs aren't manipulated
-		// (IE normalizes it by default)
-		hrefNormalized: ( a.getAttribute("href") === "/a" ),
-
-		// Make sure that element opacity exists
-		// (IE uses filter instead)
-		// Use a regex to work around a WebKit issue. See #5145
-		opacity: /^0.55/.test( a.style.opacity ),
-
-		// Verify style float existence
-		// (IE uses styleFloat instead of cssFloat)
-		cssFloat: !!a.style.cssFloat,
-
-		// Make sure that if no value is specified for a checkbox
-		// that it defaults to "on".
-		// (WebKit defaults to "" instead)
-		checkOn: ( input.value === "on" ),
-
-		// Make sure that a selected-by-default option has a working selected property.
-		// (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
-		optSelected: opt.selected,
-
-		// Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
-		getSetAttribute: div.className !== "t",
-
-		// Tests for enctype support on a form(#6743)
-		enctype: !!document.createElement("form").enctype,
-
-		// Makes sure cloning an html5 element does not cause problems
-		// Where outerHTML is undefined, this still works
-		html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>",
-
-		// Will be defined later
-		submitBubbles: true,
-		changeBubbles: true,
-		focusinBubbles: false,
-		deleteExpando: true,
-		noCloneEvent: true,
-		inlineBlockNeedsLayout: false,
-		shrinkWrapBlocks: false,
-		reliableMarginRight: true,
-		pixelMargin: true
-	};
-
-	// jQuery.boxModel DEPRECATED in 1.3, use jQuery.support.boxModel instead
-	jQuery.boxModel = support.boxModel = (document.compatMode === "CSS1Compat");
-
-	// Make sure checked status is properly cloned
-	input.checked = true;
-	support.noCloneChecked = input.cloneNode( true ).checked;
-
-	// Make sure that the options inside disabled selects aren't marked as disabled
-	// (WebKit marks them as disabled)
-	select.disabled = true;
-	support.optDisabled = !opt.disabled;
-
-	// Test to see if it's possible to delete an expando from an element
-	// Fails in Internet Explorer
-	try {
-		delete div.test;
-	} catch( e ) {
-		support.deleteExpando = false;
-	}
-
-	if ( !div.addEventListener && div.attachEvent && div.fireEvent ) {
-		div.attachEvent( "onclick", function() {
-			// Cloning a node shouldn't copy over any
-			// bound event handlers (IE does this)
-			support.noCloneEvent = false;
-		});
-		div.cloneNode( true ).fireEvent( "onclick" );
-	}
-
-	// Check if a radio maintains its value
-	// after being appended to the DOM
-	input = document.createElement("input");
-	input.value = "t";
-	input.setAttribute("type", "radio");
-	support.radioValue = input.value === "t";
-
-	input.setAttribute("checked", "checked");
-
-	// #11217 - WebKit loses check when the name is after the checked attribute
-	input.setAttribute( "name", "t" );
-
-	div.appendChild( input );
-	fragment = document.createDocumentFragment();
-	fragment.appendChild( div.lastChild );
-
-	// WebKit doesn't clone checked state correctly in fragments
-	support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
-
-	// Check if a disconnected checkbox will retain its checked
-	// value of true after appended to the DOM (IE6/7)
-	support.appendChecked = input.checked;
-
-	fragment.removeChild( input );
-	fragment.appendChild( div );
-
-	// Technique from Juriy Zaytsev
-	// http://perfectionkills.com/detecting-event-support-without-browser-sniffing/
-	// We only care about the case where non-standard event systems
-	// are used, namely in IE. Short-circuiting here helps us to
-	// avoid an eval call (in setAttribute) which can cause CSP
-	// to go haywire. See: https://developer.mozilla.org/en/Security/CSP
-	if ( div.attachEvent ) {
-		for ( i in {
-			submit: 1,
-			change: 1,
-			focusin: 1
-		}) {
-			eventName = "on" + i;
-			isSupported = ( eventName in div );
-			if ( !isSupported ) {
-				div.setAttribute( eventName, "return;" );
-				isSupported = ( typeof div[ eventName ] === "function" );
-			}
-			support[ i + "Bubbles" ] = isSupported;
-		}
-	}
-
-	fragment.removeChild( div );
-
-	// Null elements to avoid leaks in IE
-	fragment = select = opt = div = input = null;
-
-	// Run tests that need a body at doc ready
-	jQuery(function() {
-		var container, outer, inner, table, td, offsetSupport,
-			marginDiv, conMarginTop, style, html, positionTopLeftWidthHeight,
-			paddingMarginBorderVisibility, paddingMarginBorder,
-			body = document.getElementsByTagName("body")[0];
-
-		if ( !body ) {
-			// Return for frameset docs that don't have a body
-			return;
-		}
-
-		conMarginTop = 1;
-		paddingMarginBorder = "padding:0;margin:0;border:";
-		positionTopLeftWidthHeight = "position:absolute;top:0;left:0;width:1px;height:1px;";
-		paddingMarginBorderVisibility = paddingMarginBorder + "0;visibility:hidden;";
-		style = "style='" + positionTopLeftWidthHeight + paddingMarginBorder + "5px solid #000;";
-		html = "<div " + style + "display:block;'><div style='" + paddingMarginBorder + "0;display:block;overflow:hidden;'></div></div>" +
-			"<table " + style + "' cellpadding='0' cellspacing='0'>" +
-			"<tr><td></td></tr></table>";
-
-		container = document.createElement("div");
-		container.style.cssText = paddingMarginBorderVisibility + "width:0;height:0;position:static;top:0;margin-top:" + conMarginTop + "px";
-		body.insertBefore( container, body.firstChild );
-
-		// Construct the test element
-		div = document.createElement("div");
-		container.appendChild( div );
-
-		// Check if table cells still have offsetWidth/Height when they are set
-		// to display:none and there are still other visible table cells in a
-		// table row; if so, offsetWidth/Height are not reliable for use when
-		// determining if an element has been hidden directly using
-		// display:none (it is still safe to use offsets if a parent element is
-		// hidden; don safety goggles and see bug #4512 for more information).
-		// (only IE 8 fails this test)
-		div.innerHTML = "<table><tr><td style='" + paddingMarginBorder + "0;display:none'></td><td>t</td></tr></table>";
-		tds = div.getElementsByTagName( "td" );
-		isSupported = ( tds[ 0 ].offsetHeight === 0 );
-
-		tds[ 0 ].style.display = "";
-		tds[ 1 ].style.display = "none";
-
-		// Check if empty table cells still have offsetWidth/Height
-		// (IE <= 8 fail this test)
-		support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
-
-		// Check if div with explicit width and no margin-right incorrectly
-		// gets computed margin-right based on width of container. For more
-		// info see bug #3333
-		// Fails in WebKit before Feb 2011 nightlies
-		// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
-		if ( window.getComputedStyle ) {
-			div.innerHTML = "";
-			marginDiv = document.createElement( "div" );
-			marginDiv.style.width = "0";
-			marginDiv.style.marginRight = "0";
-			div.style.width = "2px";
-			div.appendChild( marginDiv );
-			support.reliableMarginRight =
-				( parseInt( ( window.getComputedStyle( marginDiv, null ) || { marginRight: 0 } ).marginRight, 10 ) || 0 ) === 0;
-		}
-
-		if ( typeof div.style.zoom !== "undefined" ) {
-			// Check if natively block-level elements act like inline-block
-			// elements when setting their display to 'inline' and giving
-			// them layout
-			// (IE < 8 does this)
-			div.innerHTML = "";
-			div.style.width = div.style.padding = "1px";
-			div.style.border = 0;
-			div.style.overflow = "hidden";
-			div.style.display = "inline";
-			div.style.zoom = 1;
-			support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 );
-
-			// Check if elements with layout shrink-wrap their children
-			// (IE 6 does this)
-			div.style.display = "block";
-			div.style.overflow = "visible";
-			div.innerHTML = "<div style='width:5px;'></div>";
-			support.shrinkWrapBlocks = ( div.offsetWidth !== 3 );
-		}
-
-		div.style.cssText = positionTopLeftWidthHeight + paddingMarginBorderVisibility;
-		div.innerHTML = html;
-
-		outer = div.firstChild;
-		inner = outer.firstChild;
-		td = outer.nextSibling.firstChild.firstChild;
-
-		offsetSupport = {
-			doesNotAddBorder: ( inner.offsetTop !== 5 ),
-			doesAddBorderForTableAndCells: ( td.offsetTop === 5 )
-		};
-
-		inner.style.position = "fixed";
-		inner.style.top = "20px";
-
-		// safari subtracts parent border width here which is 5px
-		offsetSupport.fixedPosition = ( inner.offsetTop === 20 || inner.offsetTop === 15 );
-		inner.style.position = inner.style.top = "";
-
-		outer.style.overflow = "hidden";
-		outer.style.position = "relative";
-
-		offsetSupport.subtractsBorderForOverflowNotVisible = ( inner.offsetTop === -5 );
-		offsetSupport.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== conMarginTop );
-
-		if ( window.getComputedStyle ) {
-			div.style.marginTop = "1%";
-			support.pixelMargin = ( window.getComputedStyle( div, null ) || { marginTop: 0 } ).marginTop !== "1%";
-		}
-
-		if ( typeof container.style.zoom !== "undefined" ) {
-			container.style.zoom = 1;
-		}
-
-		body.removeChild( container );
-		marginDiv = div = container = null;
-
-		jQuery.extend( support, offsetSupport );
-	});
-
-	return support;
-})();
-
-
-
-
-var rbrace = /^(?:\{.*\}|\[.*\])$/,
-	rmultiDash = /([A-Z])/g;
-
-jQuery.extend({
-	cache: {},
-
-	// Please use with caution
-	uuid: 0,
-
-	// Unique for each copy of jQuery on the page
-	// Non-digits removed to match rinlinejQuery
-	expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ),
-
-	// The following elements throw uncatchable exceptions if you
-	// attempt to add expando properties to them.
-	noData: {
-		"embed": true,
-		// Ban all objects except for Flash (which handle expandos)
-		"object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
-		"applet": true
-	},
-
-	hasData: function( elem ) {
-		elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
-		return !!elem && !isEmptyDataObject( elem );
-	},
-
-	data: function( elem, name, data, pvt /* Internal Use Only */ ) {
-		if ( !jQuery.acceptData( elem ) ) {
-			return;
-		}
-
-		var privateCache, thisCache, ret,
-			internalKey = jQuery.expando,
-			getByName = typeof name === "string",
-
-			// We have to handle DOM nodes and JS objects differently because IE6-7
-			// can't GC object references properly across the DOM-JS boundary
-			isNode = elem.nodeType,
-
-			// Only DOM nodes need the global jQuery cache; JS object data is
-			// attached directly to the object so GC can occur automatically
-			cache = isNode ? jQuery.cache : elem,
-
-			// Only defining an ID for JS objects if its cache already exists allows
-			// the code to shortcut on the same path as a DOM node with no cache
-			id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey,
-			isEvents = name === "events";
-
-		// Avoid doing any more work than we need to when trying to get data on an
-		// object that has no data at all
-		if ( (!id || !cache[id] || (!isEvents && !pvt && !cache[id].data)) && getByName && data === undefined ) {
-			return;
-		}
-
-		if ( !id ) {
-			// Only DOM nodes need a new unique ID for each element since their data
-			// ends up in the global cache
-			if ( isNode ) {
-				elem[ internalKey ] = id = ++jQuery.uuid;
-			} else {
-				id = internalKey;
-			}
-		}
-
-		if ( !cache[ id ] ) {
-			cache[ id ] = {};
-
-			// Avoids exposing jQuery metadata on plain JS objects when the object
-			// is serialized using JSON.stringify
-			if ( !isNode ) {
-				cache[ id ].toJSON = jQuery.noop;
-			}
-		}
-
-		// An object can be passed to jQuery.data instead of a key/value pair; this gets
-		// shallow copied over onto the existing cache
-		if ( typeof name === "object" || typeof name === "function" ) {
-			if ( pvt ) {
-				cache[ id ] = jQuery.extend( cache[ id ], name );
-			} else {
-				cache[ id ].data = jQuery.extend( cache[ id ].data, name );
-			}
-		}
-
-		privateCache = thisCache = cache[ id ];
-
-		// jQuery data() is stored in a separate object inside the object's internal data
-		// cache in order to avoid key collisions between internal data and user-defined
-		// data.
-		if ( !pvt ) {
-			if ( !thisCache.data ) {
-				thisCache.data = {};
-			}
-
-			thisCache = thisCache.data;
-		}
-
-		if ( data !== undefined ) {
-			thisCache[ jQuery.camelCase( name ) ] = data;
-		}
-
-		// Users should not attempt to inspect the internal events object using jQuery.data,
-		// it is undocumented and subject to change. But does anyone listen? No.
-		if ( isEvents && !thisCache[ name ] ) {
-			return privateCache.events;
-		}
-
-		// Check for both converted-to-camel and non-converted data property names
-		// If a data property was specified
-		if ( getByName ) {
-
-			// First Try to find as-is property data
-			ret = thisCache[ name ];
-
-			// Test for null|undefined property data
-			if ( ret == null ) {
-
-				// Try to find the camelCased property
-				ret = thisCache[ jQuery.camelCase( name ) ];
-			}
-		} else {
-			ret = thisCache;
-		}
-
-		return ret;
-	},
-
-	removeData: function( elem, name, pvt /* Internal Use Only */ ) {
-		if ( !jQuery.acceptData( elem ) ) {
-			return;
-		}
-
-		var thisCache, i, l,
-
-			// Reference to internal data cache key
-			internalKey = jQuery.expando,
-
-			isNode = elem.nodeType,
-
-			// See jQuery.data for more information
-			cache = isNode ? jQuery.cache : elem,
-
-			// See jQuery.data for more information
-			id = isNode ? elem[ internalKey ] : internalKey;
-
-		// If there is already no cache entry for this object, there is no
-		// purpose in continuing
-		if ( !cache[ id ] ) {
-			return;
-		}
-
-		if ( name ) {
-
-			thisCache = pvt ? cache[ id ] : cache[ id ].data;
-
-			if ( thisCache ) {
-
-				// Support array or space separated string names for data keys
-				if ( !jQuery.isArray( name ) ) {
-
-					// try the string as a key before any manipulation
-					if ( name in thisCache ) {
-						name = [ name ];
-					} else {
-
-						// split the camel cased version by spaces unless a key with the spaces exists
-						name = jQuery.camelCase( name );
-						if ( name in thisCache ) {
-							name = [ name ];
-						} else {
-							name = name.split( " " );
-						}
-					}
-				}
-
-				for ( i = 0, l = name.length; i < l; i++ ) {
-					delete thisCache[ name[i] ];
-				}
-
-				// If there is no data left in the cache, we want to continue
-				// and let the cache object itself get destroyed
-				if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) {
-					return;
-				}
-			}
-		}
-
-		// See jQuery.data for more information
-		if ( !pvt ) {
-			delete cache[ id ].data;
-
-			// Don't destroy the parent cache unless the internal data object
-			// had been the only thing left in it
-			if ( !isEmptyDataObject(cache[ id ]) ) {
-				return;
-			}
-		}
-
-		// Browsers that fail expando deletion also refuse to delete expandos on
-		// the window, but it will allow it on all other JS objects; other browsers
-		// don't care
-		// Ensure that `cache` is not a window object #10080
-		if ( jQuery.support.deleteExpando || !cache.setInterval ) {
-			delete cache[ id ];
-		} else {
-			cache[ id ] = null;
-		}
-
-		// We destroyed the cache and need to eliminate the expando on the node to avoid
-		// false lookups in the cache for entries that no longer exist
-		if ( isNode ) {
-			// IE does not allow us to delete expando properties from nodes,
-			// nor does it have a removeAttribute function on Document nodes;
-			// we must handle all of these cases
-			if ( jQuery.support.deleteExpando ) {
-				delete elem[ internalKey ];
-			} else if ( elem.removeAttribute ) {
-				elem.removeAttribute( internalKey );
-			} else {
-				elem[ internalKey ] = null;
-			}
-		}
-	},
-
-	// For internal use only.
-	_data: function( elem, name, data ) {
-		return jQuery.data( elem, name, data, true );
-	},
-
-	// A method for determining if a DOM node can handle the data expando
-	acceptData: function( elem ) {
-		if ( elem.nodeName ) {
-			var match = jQuery.noData[ elem.nodeName.toLowerCase() ];
-
-			if ( match ) {
-				return !(match === true || elem.getAttribute("classid") !== match);
-			}
-		}
-
-		return true;
-	}
-});
-
-jQuery.fn.extend({
-	data: function( key, value ) {
-		var parts, part, attr, name, l,
-			elem = this[0],
-			i = 0,
-			data = null;
-
-		// Gets all values
-		if ( key === undefined ) {
-			if ( this.length ) {
-				data = jQuery.data( elem );
-
-				if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {
-					attr = elem.attributes;
-					for ( l = attr.length; i < l; i++ ) {
-						name = attr[i].name;
-
-						if ( name.indexOf( "data-" ) === 0 ) {
-							name = jQuery.camelCase( name.substring(5) );
-
-							dataAttr( elem, name, data[ name ] );
-						}
-					}
-					jQuery._data( elem, "parsedAttrs", true );
-				}
-			}
-
-			return data;
-		}
-
-		// Sets multiple values
-		if ( typeof key === "object" ) {
-			return this.each(function() {
-				jQuery.data( this, key );
-			});
-		}
-
-		parts = key.split( ".", 2 );
-		parts[1] = parts[1] ? "." + parts[1] : "";
-		part = parts[1] + "!";
-
-		return jQuery.access( this, function( value ) {
-
-			if ( value === undefined ) {
-				data = this.triggerHandler( "getData" + part, [ parts[0] ] );
-
-				// Try to fetch any internally stored data first
-				if ( data === undefined && elem ) {
-					data = jQuery.data( elem, key );
-					data = dataAttr( elem, key, data );
-				}
-
-				return data === undefined && parts[1] ?
-					this.data( parts[0] ) :
-					data;
-			}
-
-			parts[1] = value;
-			this.each(function() {
-				var self = jQuery( this );
-
-				self.triggerHandler( "setData" + part, parts );
-				jQuery.data( this, key, value );
-				self.triggerHandler( "changeData" + part, parts );
-			});
-		}, null, value, arguments.length > 1, null, false );
-	},
-
-	removeData: function( key ) {
-		return this.each(function() {
-			jQuery.removeData( this, key );
-		});
-	}
-});
-
-function dataAttr( elem, key, data ) {
-	// If nothing was found internally, try to fetch any
-	// data from the HTML5 data-* attribute
-	if ( data === undefined && elem.nodeType === 1 ) {
-
-		var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
-
-		data = elem.getAttribute( name );
-
-		if ( typeof data === "string" ) {
-			try {
-				data = data === "true" ? true :
-				data === "false" ? false :
-				data === "null" ? null :
-				jQuery.isNumeric( data ) ? +data :
-					rbrace.test( data ) ? jQuery.parseJSON( data ) :
-					data;
-			} catch( e ) {}
-
-			// Make sure we set the data so it isn't changed later
-			jQuery.data( elem, key, data );
-
-		} else {
-			data = undefined;
-		}
-	}
-
-	return data;
-}
-
-// checks a cache object for emptiness
-function isEmptyDataObject( obj ) {
-	for ( var name in obj ) {
-
-		// if the public data object is empty, the private is still empty
-		if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {
-			continue;
-		}
-		if ( name !== "toJSON" ) {
-			return false;
-		}
-	}
-
-	return true;
-}
-
-
-
-
-function handleQueueMarkDefer( elem, type, src ) {
-	var deferDataKey = type + "defer",
-		queueDataKey = type + "queue",
-		markDataKey = type + "mark",
-		defer = jQuery._data( elem, deferDataKey );
-	if ( defer &&
-		( src === "queue" || !jQuery._data(elem, queueDataKey) ) &&
-		( src === "mark" || !jQuery._data(elem, markDataKey) ) ) {
-		// Give room for hard-coded callbacks to fire first
-		// and eventually mark/queue something else on the element
-		setTimeout( function() {
-			if ( !jQuery._data( elem, queueDataKey ) &&
-				!jQuery._data( elem, markDataKey ) ) {
-				jQuery.removeData( elem, deferDataKey, true );
-				defer.fire();
-			}
-		}, 0 );
-	}
-}
-
-jQuery.extend({
-
-	_mark: function( elem, type ) {
-		if ( elem ) {
-			type = ( type || "fx" ) + "mark";
-			jQuery._data( elem, type, (jQuery._data( elem, type ) || 0) + 1 );
-		}
-	},
-
-	_unmark: function( force, elem, type ) {
-		if ( force !== true ) {
-			type = elem;
-			elem = force;
-			force = false;
-		}
-		if ( elem ) {
-			type = type || "fx";
-			var key = type + "mark",
-				count = force ? 0 : ( (jQuery._data( elem, key ) || 1) - 1 );
-			if ( count ) {
-				jQuery._data( elem, key, count );
-			} else {
-				jQuery.removeData( elem, key, true );
-				handleQueueMarkDefer( elem, type, "mark" );
-			}
-		}
-	},
-
-	queue: function( elem, type, data ) {
-		var q;
-		if ( elem ) {
-			type = ( type || "fx" ) + "queue";
-			q = jQuery._data( elem, type );
-
-			// Speed up dequeue by getting out quickly if this is just a lookup
-			if ( data ) {
-				if ( !q || jQuery.isArray(data) ) {
-					q = jQuery._data( elem, type, jQuery.makeArray(data) );
-				} else {
-					q.push( data );
-				}
-			}
-			return q || [];
-		}
-	},
-
-	dequeue: function( elem, type ) {
-		type = type || "fx";
-
-		var queue = jQuery.queue( elem, type ),
-			fn = queue.shift(),
-			hooks = {};
-
-		// If the fx queue is dequeued, always remove the progress sentinel
-		if ( fn === "inprogress" ) {
-			fn = queue.shift();
-		}
-
-		if ( fn ) {
-			// Add a progress sentinel to prevent the fx queue from being
-			// automatically dequeued
-			if ( type === "fx" ) {
-				queue.unshift( "inprogress" );
-			}
-
-			jQuery._data( elem, type + ".run", hooks );
-			fn.call( elem, function() {
-				jQuery.dequeue( elem, type );
-			}, hooks );
-		}
-
-		if ( !queue.length ) {
-			jQuery.removeData( elem, type + "queue " + type + ".run", true );
-			handleQueueMarkDefer( elem, type, "queue" );
-		}
-	}
-});
-
-jQuery.fn.extend({
-	queue: function( type, data ) {
-		var setter = 2;
-
-		if ( typeof type !== "string" ) {
-			data = type;
-			type = "fx";
-			setter--;
-		}
-
-		if ( arguments.length < setter ) {
-			return jQuery.queue( this[0], type );
-		}
-
-		return data === undefined ?
-			this :
-			this.each(function() {
-				var queue = jQuery.queue( this, type, data );
-
-				if ( type === "fx" && queue[0] !== "inprogress" ) {
-					jQuery.dequeue( this, type );
-				}
-			});
-	},
-	dequeue: function( type ) {
-		return this.each(function() {
-			jQuery.dequeue( this, type );
-		});
-	},
-	// Based off of the plugin by Clint Helfers, with permission.
-	// http://blindsignals.com/index.php/2009/07/jquery-delay/
-	delay: function( time, type ) {
-		time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
-		type = type || "fx";
-
-		return this.queue( type, function( next, hooks ) {
-			var timeout = setTimeout( next, time );
-			hooks.stop = function() {
-				clearTimeout( timeout );
-			};
-		});
-	},
-	clearQueue: function( type ) {
-		return this.queue( type || "fx", [] );
-	},
-	// Get a promise resolved when queues of a certain type
-	// are emptied (fx is the type by default)
-	promise: function( type, object ) {
-		if ( typeof type !== "string" ) {
-			object = type;
-			type = undefined;
-		}
-		type = type || "fx";
-		var defer = jQuery.Deferred(),
-			elements = this,
-			i = elements.length,
-			count = 1,
-			deferDataKey = type + "defer",
-			queueDataKey = type + "queue",
-			markDataKey = type + "mark",
-			tmp;
-		function resolve() {
-			if ( !( --count ) ) {
-				defer.resolveWith( elements, [ elements ] );
-			}
-		}
-		while( i-- ) {
-			if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) ||
-					( jQuery.data( elements[ i ], queueDataKey, undefined, true ) ||
-						jQuery.data( elements[ i ], markDataKey, undefined, true ) ) &&
-					jQuery.data( elements[ i ], deferDataKey, jQuery.Callbacks( "once memory" ), true ) )) {
-				count++;
-				tmp.add( resolve );
-			}
-		}
-		resolve();
-		return defer.promise( object );
-	}
-});
-
-
-
-
-var rclass = /[\n\t\r]/g,
-	rspace = /\s+/,
-	rreturn = /\r/g,
-	rtype = /^(?:button|input)$/i,
-	rfocusable = /^(?:button|input|object|select|textarea)$/i,
-	rclickable = /^a(?:rea)?$/i,
-	rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
-	getSetAttribute = jQuery.support.getSetAttribute,
-	nodeHook, boolHook, fixSpecified;
-
-jQuery.fn.extend({
-	attr: function( name, value ) {
-		return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 );
-	},
-
-	removeAttr: function( name ) {
-		return this.each(function() {
-			jQuery.removeAttr( this, name );
-		});
-	},
-
-	prop: function( name, value ) {
-		return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 );
-	},
-
-	removeProp: function( name ) {
-		name = jQuery.propFix[ name ] || name;
-		return this.each(function() {
-			// try/catch handles cases where IE balks (such as removing a property on window)
-			try {
-				this[ name ] = undefined;
-				delete this[ name ];
-			} catch( e ) {}
-		});
-	},
-
-	addClass: function( value ) {
-		var classNames, i, l, elem,
-			setClass, c, cl;
-
-		if ( jQuery.isFunction( value ) ) {
-			return this.each(function( j ) {
-				jQuery( this ).addClass( value.call(this, j, this.className) );
-			});
-		}
-
-		if ( value && typeof value === "string" ) {
-			classNames = value.split( rspace );
-
-			for ( i = 0, l = this.length; i < l; i++ ) {
-				elem = this[ i ];
-
-				if ( elem.nodeType === 1 ) {
-					if ( !elem.className && classNames.length === 1 ) {
-						elem.className = value;
-
-					} else {
-						setClass = " " + elem.className + " ";
-
-						for ( c = 0, cl = classNames.length; c < cl; c++ ) {
-							if ( !~setClass.indexOf( " " + classNames[ c ] + " " ) ) {
-								setClass += classNames[ c ] + " ";
-							}
-						}
-						elem.className = jQuery.trim( setClass );
-					}
-				}
-			}
-		}
-
-		return this;
-	},
-
-	removeClass: function( value ) {
-		var classNames, i, l, elem, className, c, cl;
-
-		if ( jQuery.isFunction( value ) ) {
-			return this.each(function( j ) {
-				jQuery( this ).removeClass( value.call(this, j, this.className) );
-			});
-		}
-
-		if ( (value && typeof value === "string") || value === undefined ) {
-			classNames = ( value || "" ).split( rspace );
-
-			for ( i = 0, l = this.length; i < l; i++ ) {
-				elem = this[ i ];
-
-				if ( elem.nodeType === 1 && elem.className ) {
-					if ( value ) {
-						className = (" " + elem.className + " ").replace( rclass, " " );
-						for ( c = 0, cl = classNames.length; c < cl; c++ ) {
-							className = className.replace(" " + classNames[ c ] + " ", " ");
-						}
-						elem.className = jQuery.trim( className );
-
-					} else {
-						elem.className = "";
-					}
-				}
-			}
-		}
-
-		return this;
-	},
-
-	toggleClass: function( value, stateVal ) {
-		var type = typeof value,
-			isBool = typeof stateVal === "boolean";
-
-		if ( jQuery.isFunction( value ) ) {
-			return this.each(function( i ) {
-				jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
-			});
-		}
-
-		return this.each(function() {
-			if ( type === "string" ) {
-				// toggle individual class names
-				var className,
-					i = 0,
-					self = jQuery( this ),
-					state = stateVal,
-					classNames = value.split( rspace );
-
-				while ( (className = classNames[ i++ ]) ) {
-					// check each className given, space seperated list
-					state = isBool ? state : !self.hasClass( className );
-					self[ state ? "addClass" : "removeClass" ]( className );
-				}
-
-			} else if ( type === "undefined" || type === "boolean" ) {
-				if ( this.className ) {
-					// store className if set
-					jQuery._data( this, "__className__", this.className );
-				}
-
-				// toggle whole className
-				this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
-			}
-		});
-	},
-
-	hasClass: function( selector ) {
-		var className = " " + selector + " ",
-			i = 0,
-			l = this.length;
-		for ( ; i < l; i++ ) {
-			if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
-				return true;
-			}
-		}
-
-		return false;
-	},
-
-	val: function( value ) {
-		var hooks, ret, isFunction,
-			elem = this[0];
-
-		if ( !arguments.length ) {
-			if ( elem ) {
-				hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
-
-				if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
-					return ret;
-				}
-
-				ret = elem.value;
-
-				return typeof ret === "string" ?
-					// handle most common string cases
-					ret.replace(rreturn, "") :
-					// handle cases where value is null/undef or number
-					ret == null ? "" : ret;
-			}
-
-			return;
-		}
-
-		isFunction = jQuery.isFunction( value );
-
-		return this.each(function( i ) {
-			var self = jQuery(this), val;
-
-			if ( this.nodeType !== 1 ) {
-				return;
-			}
-
-			if ( isFunction ) {
-				val = value.call( this, i, self.val() );
-			} else {
-				val = value;
-			}
-
-			// Treat null/undefined as ""; convert numbers to string
-			if ( val == null ) {
-				val = "";
-			} else if ( typeof val === "number" ) {
-				val += "";
-			} else if ( jQuery.isArray( val ) ) {
-				val = jQuery.map(val, function ( value ) {
-					return value == null ? "" : value + "";
-				});
-			}
-
-			hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
-
-			// If set returns undefined, fall back to normal setting
-			if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
-				this.value = val;
-			}
-		});
-	}
-});
-
-jQuery.extend({
-	valHooks: {
-		option: {
-			get: function( elem ) {
-				// attributes.value is undefined in Blackberry 4.7 but
-				// uses .value. See #6932
-				var val = elem.attributes.value;
-				return !val || val.specified ? elem.value : elem.text;
-			}
-		},
-		select: {
-			get: function( elem ) {
-				var value, i, max, option,
-					index = elem.selectedIndex,
-					values = [],
-					options = elem.options,
-					one = elem.type === "select-one";
-
-				// Nothing was selected
-				if ( index < 0 ) {
-					return null;
-				}
-
-				// Loop through all the selected options
-				i = one ? index : 0;
-				max = one ? index + 1 : options.length;
-				for ( ; i < max; i++ ) {
-					option = options[ i ];
-
-					// Don't return options that are disabled or in a disabled optgroup
-					if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) &&
-							(!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) {
-
-						// Get the specific value for the option
-						value = jQuery( option ).val();
-
-						// We don't need an array for one selects
-						if ( one ) {
-							return value;
-						}
-
-						// Multi-Selects return an array
-						values.push( value );
-					}
-				}
-
-				// Fixes Bug #2551 -- select.val() broken in IE after form.reset()
-				if ( one && !values.length && options.length ) {
-					return jQuery( options[ index ] ).val();
-				}
-
-				return values;
-			},
-
-			set: function( elem, value ) {
-				var values = jQuery.makeArray( value );
-
-				jQuery(elem).find("option").each(function() {
-					this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
-				});
-
-				if ( !values.length ) {
-					elem.selectedIndex = -1;
-				}
-				return values;
-			}
-		}
-	},
-
-	attrFn: {
-		val: true,
-		css: true,
-		html: true,
-		text: true,
-		data: true,
-		width: true,
-		height: true,
-		offset: true
-	},
-
-	attr: function( elem, name, value, pass ) {
-		var ret, hooks, notxml,
-			nType = elem.nodeType;
-
-		// don't get/set attributes on text, comment and attribute nodes
-		if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
-			return;
-		}
-
-		if ( pass && name in jQuery.attrFn ) {
-			return jQuery( elem )[ name ]( value );
-		}
-
-		// Fallback to prop when attributes are not supported
-		if ( typeof elem.getAttribute === "undefined" ) {
-			return jQuery.prop( elem, name, value );
-		}
-
-		notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
-
-		// All attributes are lowercase
-		// Grab necessary hook if one is defined
-		if ( notxml ) {
-			name = name.toLowerCase();
-			hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook );
-		}
-
-		if ( value !== undefined ) {
-
-			if ( value === null ) {
-				jQuery.removeAttr( elem, name );
-				return;
-
-			} else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) {
-				return ret;
-
-			} else {
-				elem.setAttribute( name, "" + value );
-				return value;
-			}
-
-		} else if ( hooks && "get" in hooks && notxml && (ret = hooks.get( elem, name )) !== null ) {
-			return ret;
-
-		} else {
-
-			ret = elem.getAttribute( name );
-
-			// Non-existent attributes return null, we normalize to undefined
-			return ret === null ?
-				undefined :
-				ret;
-		}
-	},
-
-	removeAttr: function( elem, value ) {
-		var propName, attrNames, name, l, isBool,
-			i = 0;
-
-		if ( value && elem.nodeType === 1 ) {
-			attrNames = value.toLowerCase().split( rspace );
-			l = attrNames.length;
-
-			for ( ; i < l; i++ ) {
-				name = attrNames[ i ];
-
-				if ( name ) {
-					propName = jQuery.propFix[ name ] || name;
-					isBool = rboolean.test( name );
-
-					// See #9699 for explanation of this approach (setting first, then removal)
-					// Do not do this for boolean attributes (see #10870)
-					if ( !isBool ) {
-						jQuery.attr( elem, name, "" );
-					}
-					elem.removeAttribute( getSetAttribute ? name : propName );
-
-					// Set corresponding property to false for boolean attributes
-					if ( isBool && propName in elem ) {
-						elem[ propName ] = false;
-					}
-				}
-			}
-		}
-	},
-
-	attrHooks: {
-		type: {
-			set: function( elem, value ) {
-				// We can't allow the type property to be changed (since it causes problems in IE)
-				if ( rtype.test( elem.nodeName ) && elem.parentNode ) {
-					jQuery.error( "type property can't be changed" );
-				} else if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
-					// Setting the type on a radio button after the value resets the value in IE6-9
-					// Reset value to it's default in case type is set after value
-					// This is for element creation
-					var val = elem.value;
-					elem.setAttribute( "type", value );
-					if ( val ) {
-						elem.value = val;
-					}
-					return value;
-				}
-			}
-		},
-		// Use the value property for back compat
-		// Use the nodeHook for button elements in IE6/7 (#1954)
-		value: {
-			get: function( elem, name ) {
-				if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
-					return nodeHook.get( elem, name );
-				}
-				return name in elem ?
-					elem.value :
-					null;
-			},
-			set: function( elem, value, name ) {
-				if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
-					return nodeHook.set( elem, value, name );
-				}
-				// Does not return so that setAttribute is also used
-				elem.value = value;
-			}
-		}
-	},
-
-	propFix: {
-		tabindex: "tabIndex",
-		readonly: "readOnly",
-		"for": "htmlFor",
-		"class": "className",
-		maxlength: "maxLength",
-		cellspacing: "cellSpacing",
-		cellpadding: "cellPadding",
-		rowspan: "rowSpan",
-		colspan: "colSpan",
-		usemap: "useMap",
-		frameborder: "frameBorder",
-		contenteditable: "contentEditable"
-	},
-
-	prop: function( elem, name, value ) {
-		var ret, hooks, notxml,
-			nType = elem.nodeType;
-
-		// don't get/set properties on text, comment and attribute nodes
-		if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
-			return;
-		}
-
-		notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
-
-		if ( notxml ) {
-			// Fix name and attach hooks
-			name = jQuery.propFix[ name ] || name;
-			hooks = jQuery.propHooks[ name ];
-		}
-
-		if ( value !== undefined ) {
-			if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
-				return ret;
-
-			} else {
-				return ( elem[ name ] = value );
-			}
-
-		} else {
-			if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
-				return ret;
-
-			} else {
-				return elem[ name ];
-			}
-		}
-	},
-
-	propHooks: {
-		tabIndex: {
-			get: function( elem ) {
-				// elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
-				// http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
-				var attributeNode = elem.getAttributeNode("tabindex");
-
-				return attributeNode && attributeNode.specified ?
-					parseInt( attributeNode.value, 10 ) :
-					rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
-						0 :
-						undefined;
-			}
-		}
-	}
-});
-
-// Add the tabIndex propHook to attrHooks for back-compat (different case is intentional)
-jQuery.attrHooks.tabindex = jQuery.propHooks.tabIndex;
-
-// Hook for boolean attributes
-boolHook = {
-	get: function( elem, name ) {
-		// Align boolean attributes with corresponding properties
-		// Fall back to attribute presence where some booleans are not supported
-		var attrNode,
-			property = jQuery.prop( elem, name );
-		return property === true || typeof property !== "boolean" && ( attrNode = elem.getAttributeNode(name) ) && attrNode.nodeValue !== false ?
-			name.toLowerCase() :
-			undefined;
-	},
-	set: function( elem, value, name ) {
-		var propName;
-		if ( value === false ) {
-			// Remove boolean attributes when set to false
-			jQuery.removeAttr( elem, name );
-		} else {
-			// value is true since we know at this point it's type boolean and not false
-			// Set boolean attributes to the same name and set the DOM property
-			propName = jQuery.propFix[ name ] || name;
-			if ( propName in elem ) {
-				// Only set the IDL specifically if it already exists on the element
-				elem[ propName ] = true;
-			}
-
-			elem.setAttribute( name, name.toLowerCase() );
-		}
-		return name;
-	}
-};
-
-// IE6/7 do not support getting/setting some attributes with get/setAttribute
-if ( !getSetAttribute ) {
-
-	fixSpecified = {
-		name: true,
-		id: true,
-		coords: true
-	};
-
-	// Use this for any attribute in IE6/7
-	// This fixes almost every IE6/7 issue
-	nodeHook = jQuery.valHooks.button = {
-		get: function( elem, name ) {
-			var ret;
-			ret = elem.getAttributeNode( name );
-			return ret && ( fixSpecified[ name ] ? ret.nodeValue !== "" : ret.specified ) ?
-				ret.nodeValue :
-				undefined;
-		},
-		set: function( elem, value, name ) {
-			// Set the existing or create a new attribute node
-			var ret = elem.getAttributeNode( name );
-			if ( !ret ) {
-				ret = document.createAttribute( name );
-				elem.setAttributeNode( ret );
-			}
-			return ( ret.nodeValue = value + "" );
-		}
-	};
-
-	// Apply the nodeHook to tabindex
-	jQuery.attrHooks.tabindex.set = nodeHook.set;
-
-	// Set width and height to auto instead of 0 on empty string( Bug #8150 )
-	// This is for removals
-	jQuery.each([ "width", "height" ], function( i, name ) {
-		jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
-			set: function( elem, value ) {
-				if ( value === "" ) {
-					elem.setAttribute( name, "auto" );
-					return value;
-				}
-			}
-		});
-	});
-
-	// Set contenteditable to false on removals(#10429)
-	// Setting to empty string throws an error as an invalid value
-	jQuery.attrHooks.contenteditable = {
-		get: nodeHook.get,
-		set: function( elem, value, name ) {
-			if ( value === "" ) {
-				value = "false";
-			}
-			nodeHook.set( elem, value, name );
-		}
-	};
-}
-
-
-// Some attributes require a special call on IE
-if ( !jQuery.support.hrefNormalized ) {
-	jQuery.each([ "href", "src", "width", "height" ], function( i, name ) {
-		jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
-			get: function( elem ) {
-				var ret = elem.getAttribute( name, 2 );
-				return ret === null ? undefined : ret;
-			}
-		});
-	});
-}
-
-if ( !jQuery.support.style ) {
-	jQuery.attrHooks.style = {
-		get: function( elem ) {
-			// Return undefined in the case of empty string
-			// Normalize to lowercase since IE uppercases css property names
-			return elem.style.cssText.toLowerCase() || undefined;
-		},
-		set: function( elem, value ) {
-			return ( elem.style.cssText = "" + value );
-		}
-	};
-}
-
-// Safari mis-reports the default selected property of an option
-// Accessing the parent's selectedIndex property fixes it
-if ( !jQuery.support.optSelected ) {
-	jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, {
-		get: function( elem ) {
-			var parent = elem.parentNode;
-
-			if ( parent ) {
-				parent.selectedIndex;
-
-				// Make sure that it also works with optgroups, see #5701
-				if ( parent.parentNode ) {
-					parent.parentNode.selectedIndex;
-				}
-			}
-			return null;
-		}
-	});
-}
-
-// IE6/7 call enctype encoding
-if ( !jQuery.support.enctype ) {
-	jQuery.propFix.enctype = "encoding";
-}
-
-// Radios and checkboxes getter/setter
-if ( !jQuery.support.checkOn ) {
-	jQuery.each([ "radio", "checkbox" ], function() {
-		jQuery.valHooks[ this ] = {
-			get: function( elem ) {
-				// Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
-				return elem.getAttribute("value") === null ? "on" : elem.value;
-			}
-		};
-	});
-}
-jQuery.each([ "radio", "checkbox" ], function() {
-	jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], {
-		set: function( elem, value ) {
-			if ( jQuery.isArray( value ) ) {
-				return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
-			}
-		}
-	});
-});
-
-
-
-
-var rformElems = /^(?:textarea|input|select)$/i,
-	rtypenamespace = /^([^\.]*)?(?:\.(.+))?$/,
-	rhoverHack = /(?:^|\s)hover(\.\S+)?\b/,
-	rkeyEvent = /^key/,
-	rmouseEvent = /^(?:mouse|contextmenu)|click/,
-	rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
-	rquickIs = /^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,
-	quickParse = function( selector ) {
-		var quick = rquickIs.exec( selector );
-		if ( quick ) {
-			//   0  1    2   3
-			// [ _, tag, id, class ]
-			quick[1] = ( quick[1] || "" ).toLowerCase();
-			quick[3] = quick[3] && new RegExp( "(?:^|\\s)" + quick[3] + "(?:\\s|$)" );
-		}
-		return quick;
-	},
-	quickIs = function( elem, m ) {
-		var attrs = elem.attributes || {};
-		return (
-			(!m[1] || elem.nodeName.toLowerCase() === m[1]) &&
-			(!m[2] || (attrs.id || {}).value === m[2]) &&
-			(!m[3] || m[3].test( (attrs[ "class" ] || {}).value ))
-		);
-	},
-	hoverHack = function( events ) {
-		return jQuery.event.special.hover ? events : events.replace( rhoverHack, "mouseenter$1 mouseleave$1" );
-	};
-
-/*
- * Helper functions for managing events -- not part of the public interface.
- * Props to Dean Edwards' addEvent library for many of the ideas.
- */
-jQuery.event = {
-
-	add: function( elem, types, handler, data, selector ) {
-
-		var elemData, eventHandle, events,
-			t, tns, type, namespaces, handleObj,
-			handleObjIn, quick, handlers, special;
-
-		// Don't attach events to noData or text/comment nodes (allow plain objects tho)
-		if ( elem.nodeType === 3 || elem.nodeType === 8 || !types || !handler || !(elemData = jQuery._data( elem )) ) {
-			return;
-		}
-
-		// Caller can pass in an object of custom data in lieu of the handler
-		if ( handler.handler ) {
-			handleObjIn = handler;
-			handler = handleObjIn.handler;
-			selector = handleObjIn.selector;
-		}
-
-		// Make sure that the handler has a unique ID, used to find/remove it later
-		if ( !handler.guid ) {
-			handler.guid = jQuery.guid++;
-		}
-
-		// Init the element's event structure and main handler, if this is the first
-		events = elemData.events;
-		if ( !events ) {
-			elemData.events = events = {};
-		}
-		eventHandle = elemData.handle;
-		if ( !eventHandle ) {
-			elemData.handle = eventHandle = function( e ) {
-				// Discard the second event of a jQuery.event.trigger() and
-				// when an event is called after a page has unloaded
-				return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ?
-					jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
-					undefined;
-			};
-			// Add elem as a property of the handle fn to prevent a memory leak with IE non-native events
-			eventHandle.elem = elem;
-		}
-
-		// Handle multiple events separated by a space
-		// jQuery(...).bind("mouseover mouseout", fn);
-		types = jQuery.trim( hoverHack(types) ).split( " " );
-		for ( t = 0; t < types.length; t++ ) {
-
-			tns = rtypenamespace.exec( types[t] ) || [];
-			type = tns[1];
-			namespaces = ( tns[2] || "" ).split( "." ).sort();
-
-			// If event changes its type, use the special event handlers for the changed type
-			special = jQuery.event.special[ type ] || {};
-
-			// If selector defined, determine special event api type, otherwise given type
-			type = ( selector ? special.delegateType : special.bindType ) || type;
-
-			// Update special based on newly reset type
-			special = jQuery.event.special[ type ] || {};
-
-			// handleObj is passed to all event handlers
-			handleObj = jQuery.extend({
-				type: type,
-				origType: tns[1],
-				data: data,
-				handler: handler,
-				guid: handler.guid,
-				selector: selector,
-				quick: selector && quickParse( selector ),
-				namespace: namespaces.join(".")
-			}, handleObjIn );
-
-			// Init the event handler queue if we're the first
-			handlers = events[ type ];
-			if ( !handlers ) {
-				handlers = events[ type ] = [];
-				handlers.delegateCount = 0;
-
-				// Only use addEventListener/attachEvent if the special events handler returns false
-				if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
-					// Bind the global event handler to the element
-					if ( elem.addEventListener ) {
-						elem.addEventListener( type, eventHandle, false );
-
-					} else if ( elem.attachEvent ) {
-						elem.attachEvent( "on" + type, eventHandle );
-					}
-				}
-			}
-
-			if ( special.add ) {
-				special.add.call( elem, handleObj );
-
-				if ( !handleObj.handler.guid ) {
-					handleObj.handler.guid = handler.guid;
-				}
-			}
-
-			// Add to the element's handler list, delegates in front
-			if ( selector ) {
-				handlers.splice( handlers.delegateCount++, 0, handleObj );
-			} else {
-				handlers.push( handleObj );
-			}
-
-			// Keep track of which events have ever been used, for event optimization
-			jQuery.event.global[ type ] = true;
-		}
-
-		// Nullify elem to prevent memory leaks in IE
-		elem = null;
-	},
-
-	global: {},
-
-	// Detach an event or set of events from an element
-	remove: function( elem, types, handler, selector, mappedTypes ) {
-
-		var elemData = jQuery.hasData( elem ) && jQuery._data( elem ),
-			t, tns, type, origType, namespaces, origCount,
-			j, events, special, handle, eventType, handleObj;
-
-		if ( !elemData || !(events = elemData.events) ) {
-			return;
-		}
-
-		// Once for each type.namespace in types; type may be omitted
-		types = jQuery.trim( hoverHack( types || "" ) ).split(" ");
-		for ( t = 0; t < types.length; t++ ) {
-			tns = rtypenamespace.exec( types[t] ) || [];
-			type = origType = tns[1];
-			namespaces = tns[2];
-
-			// Unbind all events (on this namespace, if provided) for the element
-			if ( !type ) {
-				for ( type in events ) {
-					jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
-				}
-				continue;
-			}
-
-			special = jQuery.event.special[ type ] || {};
-			type = ( selector? special.delegateType : special.bindType ) || type;
-			eventType = events[ type ] || [];
-			origCount = eventType.length;
-			namespaces = namespaces ? new RegExp("(^|\\.)" + namespaces.split(".").sort().join("\\.(?:.*\\.)?") + "(\\.|$)") : null;
-
-			// Remove matching events
-			for ( j = 0; j < eventType.length; j++ ) {
-				handleObj = eventType[ j ];
-
-				if ( ( mappedTypes || origType === handleObj.origType ) &&
-					 ( !handler || handler.guid === handleObj.guid ) &&
-					 ( !namespaces || namespaces.test( handleObj.namespace ) ) &&
-					 ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
-					eventType.splice( j--, 1 );
-
-					if ( handleObj.selector ) {
-						eventType.delegateCount--;
-					}
-					if ( special.remove ) {
-						special.remove.call( elem, handleObj );
-					}
-				}
-			}
-
-			// Remove generic event handler if we removed something and no more handlers exist
-			// (avoids potential for endless recursion during removal of special event handlers)
-			if ( eventType.length === 0 && origCount !== eventType.length ) {
-				if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
-					jQuery.removeEvent( elem, type, elemData.handle );
-				}
-
-				delete events[ type ];
-			}
-		}
-
-		// Remove the expando if it's no longer used
-		if ( jQuery.isEmptyObject( events ) ) {
-			handle = elemData.handle;
-			if ( handle ) {
-				handle.elem = null;
-			}
-
-			// removeData also checks for emptiness and clears the expando if empty
-			// so use it instead of delete
-			jQuery.removeData( elem, [ "events", "handle" ], true );
-		}
-	},
-
-	// Events that are safe to short-circuit if no handlers are attached.
-	// Native DOM events should not be added, they may have inline handlers.
-	customEvent: {
-		"getData": true,
-		"setData": true,
-		"changeData": true
-	},
-
-	trigger: function( event, data, elem, onlyHandlers ) {
-		// Don't do events on text and comment nodes
-		if ( elem && (elem.nodeType === 3 || elem.nodeType === 8) ) {
-			return;
-		}
-
-		// Event object or event type
-		var type = event.type || event,
-			namespaces = [],
-			cache, exclusive, i, cur, old, ontype, special, handle, eventPath, bubbleType;
-
-		// focus/blur morphs to focusin/out; ensure we're not firing them right now
-		if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
-			return;
-		}
-
-		if ( type.indexOf( "!" ) >= 0 ) {
-			// Exclusive events trigger only for the exact event (no namespaces)
-			type = type.slice(0, -1);
-			exclusive = true;
-		}
-
-		if ( type.indexOf( "." ) >= 0 ) {
-			// Namespaced trigger; create a regexp to match event type in handle()
-			namespaces = type.split(".");
-			type = namespaces.shift();
-			namespaces.sort();
-		}
-
-		if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) {
-			// No jQuery handlers for this event type, and it can't have inline handlers
-			return;
-		}
-
-		// Caller can pass in an Event, Object, or just an event type string
-		event = typeof event === "object" ?
-			// jQuery.Event object
-			event[ jQuery.expando ] ? event :
-			// Object literal
-			new jQuery.Event( type, event ) :
-			// Just the event type (string)
-			new jQuery.Event( type );
-
-		event.type = type;
-		event.isTrigger = true;
-		event.exclusive = exclusive;
-		event.namespace = namespaces.join( "." );
-		event.namespace_re = event.namespace? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)") : null;
-		ontype = type.indexOf( ":" ) < 0 ? "on" + type : "";
-
-		// Handle a global trigger
-		if ( !elem ) {
-
-			// TODO: Stop taunting the data cache; remove global events and always attach to document
-			cache = jQuery.cache;
-			for ( i in cache ) {
-				if ( cache[ i ].events && cache[ i ].events[ type ] ) {
-					jQuery.event.trigger( event, data, cache[ i ].handle.elem, true );
-				}
-			}
-			return;
-		}
-
-

<TRUNCATED>

[07/51] [abbrv] [partial] brooklyn-ui git commit: move subdir from incubator up a level as it is promoted to its own repo (first non-incubator commit!)

Posted by he...@apache.org.
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/js/libs/js-yaml.js
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/js/libs/js-yaml.js b/src/main/webapp/assets/js/libs/js-yaml.js
new file mode 100644
index 0000000..890b00e
--- /dev/null
+++ b/src/main/webapp/assets/js/libs/js-yaml.js
@@ -0,0 +1,3666 @@
+/* js-yaml 3.2.7 https://github.com/nodeca/js-yaml */!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.jsyaml=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
+'use strict';
+
+
+var loader = require('./js-yaml/loader');
+var dumper = require('./js-yaml/dumper');
+
+
+function deprecated(name) {
+  return function () {
+    throw new Error('Function ' + name + ' is deprecated and cannot be used.');
+  };
+}
+
+
+module.exports.Type                = require('./js-yaml/type');
+module.exports.Schema              = require('./js-yaml/schema');
+module.exports.FAILSAFE_SCHEMA     = require('./js-yaml/schema/failsafe');
+module.exports.JSON_SCHEMA         = require('./js-yaml/schema/json');
+module.exports.CORE_SCHEMA         = require('./js-yaml/schema/core');
+module.exports.DEFAULT_SAFE_SCHEMA = require('./js-yaml/schema/default_safe');
+module.exports.DEFAULT_FULL_SCHEMA = require('./js-yaml/schema/default_full');
+module.exports.load                = loader.load;
+module.exports.loadAll             = loader.loadAll;
+module.exports.safeLoad            = loader.safeLoad;
+module.exports.safeLoadAll         = loader.safeLoadAll;
+module.exports.dump                = dumper.dump;
+module.exports.safeDump            = dumper.safeDump;
+module.exports.YAMLException       = require('./js-yaml/exception');
+
+// Deprecared schema names from JS-YAML 2.0.x
+module.exports.MINIMAL_SCHEMA = require('./js-yaml/schema/failsafe');
+module.exports.SAFE_SCHEMA    = require('./js-yaml/schema/default_safe');
+module.exports.DEFAULT_SCHEMA = require('./js-yaml/schema/default_full');
+
+// Deprecated functions from JS-YAML 1.x.x
+module.exports.scan           = deprecated('scan');
+module.exports.parse          = deprecated('parse');
+module.exports.compose        = deprecated('compose');
+module.exports.addConstructor = deprecated('addConstructor');
+
+},{"./js-yaml/dumper":3,"./js-yaml/exception":4,"./js-yaml/loader":5,"./js-yaml/schema":7,"./js-yaml/schema/core":8,"./js-yaml/schema/default_full":9,"./js-yaml/schema/default_safe":10,"./js-yaml/schema/failsafe":11,"./js-yaml/schema/json":12,"./js-yaml/type":13}],2:[function(require,module,exports){
+'use strict';
+
+
+function isNothing(subject) {
+  return (undefined === subject) || (null === subject);
+}
+
+
+function isObject(subject) {
+  return ('object' === typeof subject) && (null !== subject);
+}
+
+
+function toArray(sequence) {
+  if (Array.isArray(sequence)) {
+    return sequence;
+  } else if (isNothing(sequence)) {
+    return [];
+  } else {
+    return [ sequence ];
+  }
+}
+
+
+function extend(target, source) {
+  var index, length, key, sourceKeys;
+
+  if (source) {
+    sourceKeys = Object.keys(source);
+
+    for (index = 0, length = sourceKeys.length; index < length; index += 1) {
+      key = sourceKeys[index];
+      target[key] = source[key];
+    }
+  }
+
+  return target;
+}
+
+
+function repeat(string, count) {
+  var result = '', cycle;
+
+  for (cycle = 0; cycle < count; cycle += 1) {
+    result += string;
+  }
+
+  return result;
+}
+
+
+function isNegativeZero(number) {
+  return (0 === number) && (Number.NEGATIVE_INFINITY === 1 / number);
+}
+
+
+module.exports.isNothing      = isNothing;
+module.exports.isObject       = isObject;
+module.exports.toArray        = toArray;
+module.exports.repeat         = repeat;
+module.exports.isNegativeZero = isNegativeZero;
+module.exports.extend         = extend;
+
+},{}],3:[function(require,module,exports){
+'use strict';
+
+
+var common              = require('./common');
+var YAMLException       = require('./exception');
+var DEFAULT_FULL_SCHEMA = require('./schema/default_full');
+var DEFAULT_SAFE_SCHEMA = require('./schema/default_safe');
+
+
+var _toString       = Object.prototype.toString;
+var _hasOwnProperty = Object.prototype.hasOwnProperty;
+
+
+var CHAR_TAB                  = 0x09; /* Tab */
+var CHAR_LINE_FEED            = 0x0A; /* LF */
+var CHAR_CARRIAGE_RETURN      = 0x0D; /* CR */
+var CHAR_SPACE                = 0x20; /* Space */
+var CHAR_EXCLAMATION          = 0x21; /* ! */
+var CHAR_DOUBLE_QUOTE         = 0x22; /* " */
+var CHAR_SHARP                = 0x23; /* # */
+var CHAR_PERCENT              = 0x25; /* % */
+var CHAR_AMPERSAND            = 0x26; /* & */
+var CHAR_SINGLE_QUOTE         = 0x27; /* ' */
+var CHAR_ASTERISK             = 0x2A; /* * */
+var CHAR_COMMA                = 0x2C; /* , */
+var CHAR_MINUS                = 0x2D; /* - */
+var CHAR_COLON                = 0x3A; /* : */
+var CHAR_GREATER_THAN         = 0x3E; /* > */
+var CHAR_QUESTION             = 0x3F; /* ? */
+var CHAR_COMMERCIAL_AT        = 0x40; /* @ */
+var CHAR_LEFT_SQUARE_BRACKET  = 0x5B; /* [ */
+var CHAR_RIGHT_SQUARE_BRACKET = 0x5D; /* ] */
+var CHAR_GRAVE_ACCENT         = 0x60; /* ` */
+var CHAR_LEFT_CURLY_BRACKET   = 0x7B; /* { */
+var CHAR_VERTICAL_LINE        = 0x7C; /* | */
+var CHAR_RIGHT_CURLY_BRACKET  = 0x7D; /* } */
+
+
+var ESCAPE_SEQUENCES = {};
+
+ESCAPE_SEQUENCES[0x00]   = '\\0';
+ESCAPE_SEQUENCES[0x07]   = '\\a';
+ESCAPE_SEQUENCES[0x08]   = '\\b';
+ESCAPE_SEQUENCES[0x09]   = '\\t';
+ESCAPE_SEQUENCES[0x0A]   = '\\n';
+ESCAPE_SEQUENCES[0x0B]   = '\\v';
+ESCAPE_SEQUENCES[0x0C]   = '\\f';
+ESCAPE_SEQUENCES[0x0D]   = '\\r';
+ESCAPE_SEQUENCES[0x1B]   = '\\e';
+ESCAPE_SEQUENCES[0x22]   = '\\"';
+ESCAPE_SEQUENCES[0x5C]   = '\\\\';
+ESCAPE_SEQUENCES[0x85]   = '\\N';
+ESCAPE_SEQUENCES[0xA0]   = '\\_';
+ESCAPE_SEQUENCES[0x2028] = '\\L';
+ESCAPE_SEQUENCES[0x2029] = '\\P';
+
+
+var DEPRECATED_BOOLEANS_SYNTAX = [
+  'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON',
+  'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF'
+];
+
+
+function compileStyleMap(schema, map) {
+  var result, keys, index, length, tag, style, type;
+
+  if (null === map) {
+    return {};
+  }
+
+  result = {};
+  keys = Object.keys(map);
+
+  for (index = 0, length = keys.length; index < length; index += 1) {
+    tag = keys[index];
+    style = String(map[tag]);
+
+    if ('!!' === tag.slice(0, 2)) {
+      tag = 'tag:yaml.org,2002:' + tag.slice(2);
+    }
+
+    type = schema.compiledTypeMap[tag];
+
+    if (type && _hasOwnProperty.call(type.styleAliases, style)) {
+      style = type.styleAliases[style];
+    }
+
+    result[tag] = style;
+  }
+
+  return result;
+}
+
+
+function encodeHex(character) {
+  var string, handle, length;
+
+  string = character.toString(16).toUpperCase();
+
+  if (character <= 0xFF) {
+    handle = 'x';
+    length = 2;
+  } else if (character <= 0xFFFF) {
+    handle = 'u';
+    length = 4;
+  } else if (character <= 0xFFFFFFFF) {
+    handle = 'U';
+    length = 8;
+  } else {
+    throw new YAMLException('code point within a string may not be greater than 0xFFFFFFFF');
+  }
+
+  return '\\' + handle + common.repeat('0', length - string.length) + string;
+}
+
+
+function State(options) {
+  this.schema      = options['schema'] || DEFAULT_FULL_SCHEMA;
+  this.indent      = Math.max(1, (options['indent'] || 2));
+  this.skipInvalid = options['skipInvalid'] || false;
+  this.flowLevel   = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']);
+  this.styleMap    = compileStyleMap(this.schema, options['styles'] || null);
+
+  this.implicitTypes = this.schema.compiledImplicit;
+  this.explicitTypes = this.schema.compiledExplicit;
+
+  this.tag = null;
+  this.result = '';
+
+  this.duplicates = [];
+  this.usedDuplicates = null;
+}
+
+
+function generateNextLine(state, level) {
+  return '\n' + common.repeat(' ', state.indent * level);
+}
+
+function testImplicitResolving(state, str) {
+  var index, length, type;
+
+  for (index = 0, length = state.implicitTypes.length; index < length; index += 1) {
+    type = state.implicitTypes[index];
+
+    if (type.resolve(str)) {
+      return true;
+    }
+  }
+
+  return false;
+}
+
+function writeScalar(state, object) {
+  var isQuoted, checkpoint, position, length, character, first;
+
+  state.dump = '';
+  isQuoted = false;
+  checkpoint = 0;
+  first = object.charCodeAt(0) || 0;
+
+  if (-1 !== DEPRECATED_BOOLEANS_SYNTAX.indexOf(object)) {
+    // Ensure compatibility with YAML 1.0/1.1 loaders.
+    isQuoted = true;
+  } else if (0 === object.length) {
+    // Quote empty string
+    isQuoted = true;
+  } else if (CHAR_SPACE    === first ||
+             CHAR_SPACE    === object.charCodeAt(object.length - 1)) {
+    isQuoted = true;
+  } else if (CHAR_MINUS    === first ||
+             CHAR_QUESTION === first) {
+    // Don't check second symbol for simplicity
+    isQuoted = true;
+  }
+
+  for (position = 0, length = object.length; position < length; position += 1) {
+    character = object.charCodeAt(position);
+
+    if (!isQuoted) {
+      if (CHAR_TAB                  === character ||
+          CHAR_LINE_FEED            === character ||
+          CHAR_CARRIAGE_RETURN      === character ||
+          CHAR_COMMA                === character ||
+          CHAR_LEFT_SQUARE_BRACKET  === character ||
+          CHAR_RIGHT_SQUARE_BRACKET === character ||
+          CHAR_LEFT_CURLY_BRACKET   === character ||
+          CHAR_RIGHT_CURLY_BRACKET  === character ||
+          CHAR_SHARP                === character ||
+          CHAR_AMPERSAND            === character ||
+          CHAR_ASTERISK             === character ||
+          CHAR_EXCLAMATION          === character ||
+          CHAR_VERTICAL_LINE        === character ||
+          CHAR_GREATER_THAN         === character ||
+          CHAR_SINGLE_QUOTE         === character ||
+          CHAR_DOUBLE_QUOTE         === character ||
+          CHAR_PERCENT              === character ||
+          CHAR_COMMERCIAL_AT        === character ||
+          CHAR_COLON                === character ||
+          CHAR_GRAVE_ACCENT         === character) {
+        isQuoted = true;
+      }
+    }
+
+    if (ESCAPE_SEQUENCES[character] ||
+        !((0x00020 <= character && character <= 0x00007E) ||
+          (0x00085 === character)                         ||
+          (0x000A0 <= character && character <= 0x00D7FF) ||
+          (0x0E000 <= character && character <= 0x00FFFD) ||
+          (0x10000 <= character && character <= 0x10FFFF))) {
+      state.dump += object.slice(checkpoint, position);
+      state.dump += ESCAPE_SEQUENCES[character] || encodeHex(character);
+      checkpoint = position + 1;
+      isQuoted = true;
+    }
+  }
+
+  if (checkpoint < position) {
+    state.dump += object.slice(checkpoint, position);
+  }
+
+  if (!isQuoted && testImplicitResolving(state, state.dump)) {
+    isQuoted = true;
+  }
+
+  if (isQuoted) {
+    state.dump = '"' + state.dump + '"';
+  }
+}
+
+function writeFlowSequence(state, level, object) {
+  var _result = '',
+      _tag    = state.tag,
+      index,
+      length;
+
+  for (index = 0, length = object.length; index < length; index += 1) {
+    // Write only valid elements.
+    if (writeNode(state, level, object[index], false, false)) {
+      if (0 !== index) {
+        _result += ', ';
+      }
+      _result += state.dump;
+    }
+  }
+
+  state.tag = _tag;
+  state.dump = '[' + _result + ']';
+}
+
+function writeBlockSequence(state, level, object, compact) {
+  var _result = '',
+      _tag    = state.tag,
+      index,
+      length;
+
+  for (index = 0, length = object.length; index < length; index += 1) {
+    // Write only valid elements.
+    if (writeNode(state, level + 1, object[index], true, true)) {
+      if (!compact || 0 !== index) {
+        _result += generateNextLine(state, level);
+      }
+      _result += '- ' + state.dump;
+    }
+  }
+
+  state.tag = _tag;
+  state.dump = _result || '[]'; // Empty sequence if no valid values.
+}
+
+function writeFlowMapping(state, level, object) {
+  var _result       = '',
+      _tag          = state.tag,
+      objectKeyList = Object.keys(object),
+      index,
+      length,
+      objectKey,
+      objectValue,
+      pairBuffer;
+
+  for (index = 0, length = objectKeyList.length; index < length; index += 1) {
+    pairBuffer = '';
+
+    if (0 !== index) {
+      pairBuffer += ', ';
+    }
+
+    objectKey = objectKeyList[index];
+    objectValue = object[objectKey];
+
+    if (!writeNode(state, level, objectKey, false, false)) {
+      continue; // Skip this pair because of invalid key;
+    }
+
+    if (state.dump.length > 1024) {
+      pairBuffer += '? ';
+    }
+
+    pairBuffer += state.dump + ': ';
+
+    if (!writeNode(state, level, objectValue, false, false)) {
+      continue; // Skip this pair because of invalid value.
+    }
+
+    pairBuffer += state.dump;
+
+    // Both key and value are valid.
+    _result += pairBuffer;
+  }
+
+  state.tag = _tag;
+  state.dump = '{' + _result + '}';
+}
+
+function writeBlockMapping(state, level, object, compact) {
+  var _result       = '',
+      _tag          = state.tag,
+      objectKeyList = Object.keys(object),
+      index,
+      length,
+      objectKey,
+      objectValue,
+      explicitPair,
+      pairBuffer;
+
+  for (index = 0, length = objectKeyList.length; index < length; index += 1) {
+    pairBuffer = '';
+
+    if (!compact || 0 !== index) {
+      pairBuffer += generateNextLine(state, level);
+    }
+
+    objectKey = objectKeyList[index];
+    objectValue = object[objectKey];
+
+    if (!writeNode(state, level + 1, objectKey, true, true)) {
+      continue; // Skip this pair because of invalid key.
+    }
+
+    explicitPair = (null !== state.tag && '?' !== state.tag) ||
+                   (state.dump && state.dump.length > 1024);
+
+    if (explicitPair) {
+      if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
+        pairBuffer += '?';
+      } else {
+        pairBuffer += '? ';
+      }
+    }
+
+    pairBuffer += state.dump;
+
+    if (explicitPair) {
+      pairBuffer += generateNextLine(state, level);
+    }
+
+    if (!writeNode(state, level + 1, objectValue, true, explicitPair)) {
+      continue; // Skip this pair because of invalid value.
+    }
+
+    if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
+      pairBuffer += ':';
+    } else {
+      pairBuffer += ': ';
+    }
+
+    pairBuffer += state.dump;
+
+    // Both key and value are valid.
+    _result += pairBuffer;
+  }
+
+  state.tag = _tag;
+  state.dump = _result || '{}'; // Empty mapping if no valid pairs.
+}
+
+function detectType(state, object, explicit) {
+  var _result, typeList, index, length, type, style;
+
+  typeList = explicit ? state.explicitTypes : state.implicitTypes;
+
+  for (index = 0, length = typeList.length; index < length; index += 1) {
+    type = typeList[index];
+
+    if ((type.instanceOf  || type.predicate) &&
+        (!type.instanceOf || (('object' === typeof object) && (object instanceof type.instanceOf))) &&
+        (!type.predicate  || type.predicate(object))) {
+
+      state.tag = explicit ? type.tag : '?';
+
+      if (type.represent) {
+        style = state.styleMap[type.tag] || type.defaultStyle;
+
+        if ('[object Function]' === _toString.call(type.represent)) {
+          _result = type.represent(object, style);
+        } else if (_hasOwnProperty.call(type.represent, style)) {
+          _result = type.represent[style](object, style);
+        } else {
+          throw new YAMLException('!<' + type.tag + '> tag resolver accepts not "' + style + '" style');
+        }
+
+        state.dump = _result;
+      }
+
+      return true;
+    }
+  }
+
+  return false;
+}
+
+// Serializes `object` and writes it to global `result`.
+// Returns true on success, or false on invalid object.
+//
+function writeNode(state, level, object, block, compact) {
+  state.tag = null;
+  state.dump = object;
+
+  if (!detectType(state, object, false)) {
+    detectType(state, object, true);
+  }
+
+  var type = _toString.call(state.dump);
+
+  if (block) {
+    block = (0 > state.flowLevel || state.flowLevel > level);
+  }
+
+  if ((null !== state.tag && '?' !== state.tag) || (2 !== state.indent && level > 0)) {
+    compact = false;
+  }
+
+  var objectOrArray = '[object Object]' === type || '[object Array]' === type,
+      duplicateIndex,
+      duplicate;
+
+  if (objectOrArray) {
+    duplicateIndex = state.duplicates.indexOf(object);
+    duplicate = duplicateIndex !== -1;
+  }
+
+  if (duplicate && state.usedDuplicates[duplicateIndex]) {
+    state.dump = '*ref_' + duplicateIndex;
+  } else {
+    if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) {
+      state.usedDuplicates[duplicateIndex] = true;
+    }
+    if ('[object Object]' === type) {
+      if (block && (0 !== Object.keys(state.dump).length)) {
+        writeBlockMapping(state, level, state.dump, compact);
+        if (duplicate) {
+          state.dump = '&ref_' + duplicateIndex + (0 === level ? '\n' : '') + state.dump;
+        }
+      } else {
+        writeFlowMapping(state, level, state.dump);
+        if (duplicate) {
+          state.dump = '&ref_' + duplicateIndex + ' ' + state.dump;
+        }
+      }
+    } else if ('[object Array]' === type) {
+      if (block && (0 !== state.dump.length)) {
+        writeBlockSequence(state, level, state.dump, compact);
+        if (duplicate) {
+          state.dump = '&ref_' + duplicateIndex + (0 === level ? '\n' : '') + state.dump;
+        }
+      } else {
+        writeFlowSequence(state, level, state.dump);
+        if (duplicate) {
+          state.dump = '&ref_' + duplicateIndex + ' ' + state.dump;
+        }
+      }
+    } else if ('[object String]' === type) {
+      if ('?' !== state.tag) {
+        writeScalar(state, state.dump);
+      }
+    } else if (state.skipInvalid) {
+      return false;
+    } else {
+      throw new YAMLException('unacceptable kind of an object to dump ' + type);
+    }
+
+    if (null !== state.tag && '?' !== state.tag) {
+      state.dump = '!<' + state.tag + '> ' + state.dump;
+    }
+  }
+
+  return true;
+}
+
+function getDuplicateReferences(object, state) {
+  var objects = [],
+      duplicatesIndexes = [],
+      index,
+      length;
+
+  inspectNode(object, objects, duplicatesIndexes);
+
+  for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) {
+    state.duplicates.push(objects[duplicatesIndexes[index]]);
+  }
+  state.usedDuplicates = new Array(length);
+}
+
+function inspectNode(object, objects, duplicatesIndexes) {
+  var type = _toString.call(object),
+      objectKeyList,
+      index,
+      length;
+
+  if (null !== object && 'object' === typeof object) {
+    index = objects.indexOf(object);
+    if (-1 !== index) {
+      if (-1 === duplicatesIndexes.indexOf(index)) {
+        duplicatesIndexes.push(index);
+      }
+    } else {
+      objects.push(object);
+    
+      if(Array.isArray(object)) {
+        for (index = 0, length = object.length; index < length; index += 1) {
+          inspectNode(object[index], objects, duplicatesIndexes);
+        }
+      } else {
+        objectKeyList = Object.keys(object);
+
+        for (index = 0, length = objectKeyList.length; index < length; index += 1) {
+          inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes);
+        }
+      }
+    }
+  }
+}
+
+function dump(input, options) {
+  options = options || {};
+
+  var state = new State(options);
+
+  getDuplicateReferences(input, state);
+
+  if (writeNode(state, 0, input, true, true)) {
+    return state.dump + '\n';
+  } else {
+    return '';
+  }
+}
+
+
+function safeDump(input, options) {
+  return dump(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
+}
+
+
+module.exports.dump     = dump;
+module.exports.safeDump = safeDump;
+
+},{"./common":2,"./exception":4,"./schema/default_full":9,"./schema/default_safe":10}],4:[function(require,module,exports){
+'use strict';
+
+
+function YAMLException(reason, mark) {
+  this.name    = 'YAMLException';
+  this.reason  = reason;
+  this.mark    = mark;
+  this.message = this.toString(false);
+}
+
+
+YAMLException.prototype.toString = function toString(compact) {
+  var result;
+
+  result = 'JS-YAML: ' + (this.reason || '(unknown reason)');
+
+  if (!compact && this.mark) {
+    result += ' ' + this.mark.toString();
+  }
+
+  return result;
+};
+
+
+module.exports = YAMLException;
+
+},{}],5:[function(require,module,exports){
+'use strict';
+
+
+var common              = require('./common');
+var YAMLException       = require('./exception');
+var Mark                = require('./mark');
+var DEFAULT_SAFE_SCHEMA = require('./schema/default_safe');
+var DEFAULT_FULL_SCHEMA = require('./schema/default_full');
+
+
+var _hasOwnProperty = Object.prototype.hasOwnProperty;
+
+
+var CONTEXT_FLOW_IN   = 1;
+var CONTEXT_FLOW_OUT  = 2;
+var CONTEXT_BLOCK_IN  = 3;
+var CONTEXT_BLOCK_OUT = 4;
+
+
+var CHOMPING_CLIP  = 1;
+var CHOMPING_STRIP = 2;
+var CHOMPING_KEEP  = 3;
+
+
+var PATTERN_NON_PRINTABLE         = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uD800-\uDFFF\uFFFE\uFFFF]/;
+var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/;
+var PATTERN_FLOW_INDICATORS       = /[,\[\]\{\}]/;
+var PATTERN_TAG_HANDLE            = /^(?:!|!!|![a-z\-]+!)$/i;
+var PATTERN_TAG_URI               = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
+
+
+function is_EOL(c) {
+  return (c === 0x0A/* LF */) || (c === 0x0D/* CR */);
+}
+
+function is_WHITE_SPACE(c) {
+  return (c === 0x09/* Tab */) || (c === 0x20/* Space */);
+}
+
+function is_WS_OR_EOL(c) {
+  return (c === 0x09/* Tab */) ||
+         (c === 0x20/* Space */) ||
+         (c === 0x0A/* LF */) ||
+         (c === 0x0D/* CR */);
+}
+
+function is_FLOW_INDICATOR(c) {
+  return 0x2C/* , */ === c ||
+         0x5B/* [ */ === c ||
+         0x5D/* ] */ === c ||
+         0x7B/* { */ === c ||
+         0x7D/* } */ === c;
+}
+
+function fromHexCode(c) {
+  var lc;
+
+  if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) {
+    return c - 0x30;
+  }
+
+  lc = c | 0x20;
+  if ((0x61/* a */ <= lc) && (lc <= 0x66/* f */)) {
+    return lc - 0x61 + 10;
+  }
+
+  return -1;
+}
+
+function escapedHexLen(c) {
+  if (c === 0x78/* x */) { return 2; }
+  if (c === 0x75/* u */) { return 4; }
+  if (c === 0x55/* U */) { return 8; }
+  return 0;
+}
+
+function fromDecimalCode(c) {
+  if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) {
+    return c - 0x30;
+  }
+
+  return -1;
+}
+
+function simpleEscapeSequence(c) {
+ return (c === 0x30/* 0 */) ? '\x00' :
+        (c === 0x61/* a */) ? '\x07' :
+        (c === 0x62/* b */) ? '\x08' :
+        (c === 0x74/* t */) ? '\x09' :
+        (c === 0x09/* Tab */) ? '\x09' :
+        (c === 0x6E/* n */) ? '\x0A' :
+        (c === 0x76/* v */) ? '\x0B' :
+        (c === 0x66/* f */) ? '\x0C' :
+        (c === 0x72/* r */) ? '\x0D' :
+        (c === 0x65/* e */) ? '\x1B' :
+        (c === 0x20/* Space */) ? ' ' :
+        (c === 0x22/* " */) ? '\x22' :
+        (c === 0x2F/* / */) ? '/' :
+        (c === 0x5C/* \ */) ? '\x5C' :
+        (c === 0x4E/* N */) ? '\x85' :
+        (c === 0x5F/* _ */) ? '\xA0' :
+        (c === 0x4C/* L */) ? '\u2028' :
+        (c === 0x50/* P */) ? '\u2029' : '';
+}
+
+function charFromCodepoint(c) {
+  if (c <= 0xFFFF) {
+    return String.fromCharCode(c);
+  } else {
+    // Encode UTF-16 surrogate pair
+    // https://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B010000_to_U.2B10FFFF
+    return String.fromCharCode(((c - 0x010000) >> 10) + 0xD800,
+                               ((c - 0x010000) & 0x03FF) + 0xDC00);
+  }
+}
+
+var simpleEscapeCheck = new Array(256); // integer, for fast access
+var simpleEscapeMap = new Array(256);
+for (var i = 0; i < 256; i++) {
+  simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0;
+  simpleEscapeMap[i] = simpleEscapeSequence(i);
+}
+
+
+function State(input, options) {
+  this.input = input;
+
+  this.filename  = options['filename']  || null;
+  this.schema    = options['schema']    || DEFAULT_FULL_SCHEMA;
+  this.onWarning = options['onWarning'] || null;
+  this.legacy    = options['legacy']    || false;
+
+  this.implicitTypes = this.schema.compiledImplicit;
+  this.typeMap       = this.schema.compiledTypeMap;
+
+  this.length     = input.length;
+  this.position   = 0;
+  this.line       = 0;
+  this.lineStart  = 0;
+  this.lineIndent = 0;
+
+  this.documents = [];
+
+  /*
+  this.version;
+  this.checkLineBreaks;
+  this.tagMap;
+  this.anchorMap;
+  this.tag;
+  this.anchor;
+  this.kind;
+  this.result;*/
+
+}
+
+
+function generateError(state, message) {
+  return new YAMLException(
+    message,
+    new Mark(state.filename, state.input, state.position, state.line, (state.position - state.lineStart)));
+}
+
+function throwError(state, message) {
+  throw generateError(state, message);
+}
+
+function throwWarning(state, message) {
+  var error = generateError(state, message);
+
+  if (state.onWarning) {
+    state.onWarning.call(null, error);
+  } else {
+    throw error;
+  }
+}
+
+
+var directiveHandlers = {
+
+  'YAML': function handleYamlDirective(state, name, args) {
+
+      var match, major, minor;
+
+      if (null !== state.version) {
+        throwError(state, 'duplication of %YAML directive');
+      }
+
+      if (1 !== args.length) {
+        throwError(state, 'YAML directive accepts exactly one argument');
+      }
+
+      match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]);
+
+      if (null === match) {
+        throwError(state, 'ill-formed argument of the YAML directive');
+      }
+
+      major = parseInt(match[1], 10);
+      minor = parseInt(match[2], 10);
+
+      if (1 !== major) {
+        throwError(state, 'unacceptable YAML version of the document');
+      }
+
+      state.version = args[0];
+      state.checkLineBreaks = (minor < 2);
+
+      if (1 !== minor && 2 !== minor) {
+        throwWarning(state, 'unsupported YAML version of the document');
+      }
+    },
+
+  'TAG': function handleTagDirective(state, name, args) {
+
+      var handle, prefix;
+
+      if (2 !== args.length) {
+        throwError(state, 'TAG directive accepts exactly two arguments');
+      }
+
+      handle = args[0];
+      prefix = args[1];
+
+      if (!PATTERN_TAG_HANDLE.test(handle)) {
+        throwError(state, 'ill-formed tag handle (first argument) of the TAG directive');
+      }
+
+      if (_hasOwnProperty.call(state.tagMap, handle)) {
+        throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle');
+      }
+
+      if (!PATTERN_TAG_URI.test(prefix)) {
+        throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive');
+      }
+
+      state.tagMap[handle] = prefix;
+    }
+};
+
+
+function captureSegment(state, start, end, checkJson) {
+  var _position, _length, _character, _result;
+
+  if (start < end) {
+    _result = state.input.slice(start, end);
+
+    if (checkJson) {
+      for (_position = 0, _length = _result.length;
+           _position < _length;
+           _position += 1) {
+        _character = _result.charCodeAt(_position);
+        if (!(0x09 === _character ||
+              0x20 <= _character && _character <= 0x10FFFF)) {
+          throwError(state, 'expected valid JSON character');
+        }
+      }
+    }
+
+    state.result += _result;
+  }
+}
+
+function mergeMappings(state, destination, source) {
+  var sourceKeys, key, index, quantity;
+
+  if (!common.isObject(source)) {
+    throwError(state, 'cannot merge mappings; the provided source object is unacceptable');
+  }
+
+  sourceKeys = Object.keys(source);
+
+  for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {
+    key = sourceKeys[index];
+
+    if (!_hasOwnProperty.call(destination, key)) {
+      destination[key] = source[key];
+    }
+  }
+}
+
+function storeMappingPair(state, _result, keyTag, keyNode, valueNode) {
+  var index, quantity;
+
+  keyNode = String(keyNode);
+
+  if (null === _result) {
+    _result = {};
+  }
+
+  if ('tag:yaml.org,2002:merge' === keyTag) {
+    if (Array.isArray(valueNode)) {
+      for (index = 0, quantity = valueNode.length; index < quantity; index += 1) {
+        mergeMappings(state, _result, valueNode[index]);
+      }
+    } else {
+      mergeMappings(state, _result, valueNode);
+    }
+  } else {
+    _result[keyNode] = valueNode;
+  }
+
+  return _result;
+}
+
+function readLineBreak(state) {
+  var ch;
+
+  ch = state.input.charCodeAt(state.position);
+
+  if (0x0A/* LF */ === ch) {
+    state.position++;
+  } else if (0x0D/* CR */ === ch) {
+    state.position++;
+    if (0x0A/* LF */ === state.input.charCodeAt(state.position)) {
+      state.position++;
+    }
+  } else {
+    throwError(state, 'a line break is expected');
+  }
+
+  state.line += 1;
+  state.lineStart = state.position;
+}
+
+function skipSeparationSpace(state, allowComments, checkIndent) {
+  var lineBreaks = 0,
+      ch = state.input.charCodeAt(state.position);
+
+  while (0 !== ch) {
+    while (is_WHITE_SPACE(ch)) {
+      ch = state.input.charCodeAt(++state.position);
+    }
+
+    if (allowComments && 0x23/* # */ === ch) {
+      do {
+        ch = state.input.charCodeAt(++state.position);
+      } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && 0 !== ch);
+    }
+
+    if (is_EOL(ch)) {
+      readLineBreak(state);
+
+      ch = state.input.charCodeAt(state.position);
+      lineBreaks++;
+      state.lineIndent = 0;
+
+      while (0x20/* Space */ === ch) {
+        state.lineIndent++;
+        ch = state.input.charCodeAt(++state.position);
+      }
+    } else {
+      break;
+    }
+  }
+
+  if (-1 !== checkIndent && 0 !== lineBreaks && state.lineIndent < checkIndent) {
+    throwWarning(state, 'deficient indentation');
+  }
+
+  return lineBreaks;
+}
+
+function testDocumentSeparator(state) {
+  var _position = state.position,
+      ch;
+
+  ch = state.input.charCodeAt(_position);
+
+  // Condition state.position === state.lineStart is tested
+  // in parent on each call, for efficiency. No needs to test here again.
+  if ((0x2D/* - */ === ch || 0x2E/* . */ === ch) &&
+      state.input.charCodeAt(_position + 1) === ch &&
+      state.input.charCodeAt(_position+ 2) === ch) {
+
+    _position += 3;
+
+    ch = state.input.charCodeAt(_position);
+
+    if (ch === 0 || is_WS_OR_EOL(ch)) {
+      return true;
+    }
+  }
+
+  return false;
+}
+
+function writeFoldedLines(state, count) {
+  if (1 === count) {
+    state.result += ' ';
+  } else if (count > 1) {
+    state.result += common.repeat('\n', count - 1);
+  }
+}
+
+
+function readPlainScalar(state, nodeIndent, withinFlowCollection) {
+  var preceding,
+      following,
+      captureStart,
+      captureEnd,
+      hasPendingContent,
+      _line,
+      _lineStart,
+      _lineIndent,
+      _kind = state.kind,
+      _result = state.result,
+      ch;
+
+  ch = state.input.charCodeAt(state.position);
+
+  if (is_WS_OR_EOL(ch)             ||
+      is_FLOW_INDICATOR(ch)        ||
+      0x23/* # */           === ch ||
+      0x26/* & */           === ch ||
+      0x2A/* * */           === ch ||
+      0x21/* ! */           === ch ||
+      0x7C/* | */           === ch ||
+      0x3E/* > */           === ch ||
+      0x27/* ' */           === ch ||
+      0x22/* " */           === ch ||
+      0x25/* % */           === ch ||
+      0x40/* @ */           === ch ||
+      0x60/* ` */           === ch) {
+    return false;
+  }
+
+  if (0x3F/* ? */ === ch || 0x2D/* - */ === ch) {
+    following = state.input.charCodeAt(state.position + 1);
+
+    if (is_WS_OR_EOL(following) ||
+        withinFlowCollection && is_FLOW_INDICATOR(following)) {
+      return false;
+    }
+  }
+
+  state.kind = 'scalar';
+  state.result = '';
+  captureStart = captureEnd = state.position;
+  hasPendingContent = false;
+
+  while (0 !== ch) {
+    if (0x3A/* : */ === ch) {
+      following = state.input.charCodeAt(state.position+1);
+
+      if (is_WS_OR_EOL(following) ||
+          withinFlowCollection && is_FLOW_INDICATOR(following)) {
+        break;
+      }
+
+    } else if (0x23/* # */ === ch) {
+      preceding = state.input.charCodeAt(state.position - 1);
+
+      if (is_WS_OR_EOL(preceding)) {
+        break;
+      }
+
+    } else if ((state.position === state.lineStart && testDocumentSeparator(state)) ||
+               withinFlowCollection && is_FLOW_INDICATOR(ch)) {
+      break;
+
+    } else if (is_EOL(ch)) {
+      _line = state.line;
+      _lineStart = state.lineStart;
+      _lineIndent = state.lineIndent;
+      skipSeparationSpace(state, false, -1);
+
+      if (state.lineIndent >= nodeIndent) {
+        hasPendingContent = true;
+        ch = state.input.charCodeAt(state.position);
+        continue;
+      } else {
+        state.position = captureEnd;
+        state.line = _line;
+        state.lineStart = _lineStart;
+        state.lineIndent = _lineIndent;
+        break;
+      }
+    }
+
+    if (hasPendingContent) {
+      captureSegment(state, captureStart, captureEnd, false);
+      writeFoldedLines(state, state.line - _line);
+      captureStart = captureEnd = state.position;
+      hasPendingContent = false;
+    }
+
+    if (!is_WHITE_SPACE(ch)) {
+      captureEnd = state.position + 1;
+    }
+
+    ch = state.input.charCodeAt(++state.position);
+  }
+
+  captureSegment(state, captureStart, captureEnd, false);
+
+  if (state.result) {
+    return true;
+  } else {
+    state.kind = _kind;
+    state.result = _result;
+    return false;
+  }
+}
+
+function readSingleQuotedScalar(state, nodeIndent) {
+  var ch,
+      captureStart, captureEnd;
+
+  ch = state.input.charCodeAt(state.position);
+
+  if (0x27/* ' */ !== ch) {
+    return false;
+  }
+
+  state.kind = 'scalar';
+  state.result = '';
+  state.position++;
+  captureStart = captureEnd = state.position;
+
+  while (0 !== (ch = state.input.charCodeAt(state.position))) {
+    if (0x27/* ' */ === ch) {
+      captureSegment(state, captureStart, state.position, true);
+      ch = state.input.charCodeAt(++state.position);
+
+      if (0x27/* ' */ === ch) {
+        captureStart = captureEnd = state.position;
+        state.position++;
+      } else {
+        return true;
+      }
+
+    } else if (is_EOL(ch)) {
+      captureSegment(state, captureStart, captureEnd, true);
+      writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
+      captureStart = captureEnd = state.position;
+
+    } else if (state.position === state.lineStart && testDocumentSeparator(state)) {
+      throwError(state, 'unexpected end of the document within a single quoted scalar');
+
+    } else {
+      state.position++;
+      captureEnd = state.position;
+    }
+  }
+
+  throwError(state, 'unexpected end of the stream within a single quoted scalar');
+}
+
+function readDoubleQuotedScalar(state, nodeIndent) {
+  var captureStart,
+      captureEnd,
+      hexLength,
+      hexResult,
+      tmp, tmpEsc,
+      ch;
+
+  ch = state.input.charCodeAt(state.position);
+
+  if (0x22/* " */ !== ch) {
+    return false;
+  }
+
+  state.kind = 'scalar';
+  state.result = '';
+  state.position++;
+  captureStart = captureEnd = state.position;
+
+  while (0 !== (ch = state.input.charCodeAt(state.position))) {
+    if (0x22/* " */ === ch) {
+      captureSegment(state, captureStart, state.position, true);
+      state.position++;
+      return true;
+
+    } else if (0x5C/* \ */ === ch) {
+      captureSegment(state, captureStart, state.position, true);
+      ch = state.input.charCodeAt(++state.position);
+
+      if (is_EOL(ch)) {
+        skipSeparationSpace(state, false, nodeIndent);
+
+        //TODO: rework to inline fn with no type cast?
+      } else if (ch < 256 && simpleEscapeCheck[ch]) {
+        state.result += simpleEscapeMap[ch];
+        state.position++;
+
+      } else if ((tmp = escapedHexLen(ch)) > 0) {
+        hexLength = tmp;
+        hexResult = 0;
+
+        for (; hexLength > 0; hexLength--) {
+          ch = state.input.charCodeAt(++state.position);
+
+          if ((tmp = fromHexCode(ch)) >= 0) {
+            hexResult = (hexResult << 4) + tmp;
+
+          } else {
+            throwError(state, 'expected hexadecimal character');
+          }
+        }
+
+        state.result += charFromCodepoint(hexResult);
+
+        state.position++;
+
+      } else {
+        throwError(state, 'unknown escape sequence');
+      }
+
+      captureStart = captureEnd = state.position;
+
+    } else if (is_EOL(ch)) {
+      captureSegment(state, captureStart, captureEnd, true);
+      writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
+      captureStart = captureEnd = state.position;
+
+    } else if (state.position === state.lineStart && testDocumentSeparator(state)) {
+      throwError(state, 'unexpected end of the document within a double quoted scalar');
+
+    } else {
+      state.position++;
+      captureEnd = state.position;
+    }
+  }
+
+  throwError(state, 'unexpected end of the stream within a double quoted scalar');
+}
+
+function readFlowCollection(state, nodeIndent) {
+  var readNext = true,
+      _line,
+      _tag     = state.tag,
+      _result,
+      _anchor  = state.anchor,
+      following,
+      terminator,
+      isPair,
+      isExplicitPair,
+      isMapping,
+      keyNode,
+      keyTag,
+      valueNode,
+      ch;
+
+  ch = state.input.charCodeAt(state.position);
+
+  if (ch === 0x5B/* [ */) {
+    terminator = 0x5D/* ] */;
+    isMapping = false;
+    _result = [];
+  } else if (ch === 0x7B/* { */) {
+    terminator = 0x7D/* } */;
+    isMapping = true;
+    _result = {};
+  } else {
+    return false;
+  }
+
+  if (null !== state.anchor) {
+    state.anchorMap[state.anchor] = _result;
+  }
+
+  ch = state.input.charCodeAt(++state.position);
+
+  while (0 !== ch) {
+    skipSeparationSpace(state, true, nodeIndent);
+
+    ch = state.input.charCodeAt(state.position);
+
+    if (ch === terminator) {
+      state.position++;
+      state.tag = _tag;
+      state.anchor = _anchor;
+      state.kind = isMapping ? 'mapping' : 'sequence';
+      state.result = _result;
+      return true;
+    } else if (!readNext) {
+      throwError(state, 'missed comma between flow collection entries');
+    }
+
+    keyTag = keyNode = valueNode = null;
+    isPair = isExplicitPair = false;
+
+    if (0x3F/* ? */ === ch) {
+      following = state.input.charCodeAt(state.position + 1);
+
+      if (is_WS_OR_EOL(following)) {
+        isPair = isExplicitPair = true;
+        state.position++;
+        skipSeparationSpace(state, true, nodeIndent);
+      }
+    }
+
+    _line = state.line;
+    composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
+    keyTag = state.tag;
+    keyNode = state.result;
+    skipSeparationSpace(state, true, nodeIndent);
+
+    ch = state.input.charCodeAt(state.position);
+
+    if ((isExplicitPair || state.line === _line) && 0x3A/* : */ === ch) {
+      isPair = true;
+      ch = state.input.charCodeAt(++state.position);
+      skipSeparationSpace(state, true, nodeIndent);
+      composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
+      valueNode = state.result;
+    }
+
+    if (isMapping) {
+      storeMappingPair(state, _result, keyTag, keyNode, valueNode);
+    } else if (isPair) {
+      _result.push(storeMappingPair(state, null, keyTag, keyNode, valueNode));
+    } else {
+      _result.push(keyNode);
+    }
+
+    skipSeparationSpace(state, true, nodeIndent);
+
+    ch = state.input.charCodeAt(state.position);
+
+    if (0x2C/* , */ === ch) {
+      readNext = true;
+      ch = state.input.charCodeAt(++state.position);
+    } else {
+      readNext = false;
+    }
+  }
+
+  throwError(state, 'unexpected end of the stream within a flow collection');
+}
+
+function readBlockScalar(state, nodeIndent) {
+  var captureStart,
+      folding,
+      chomping       = CHOMPING_CLIP,
+      detectedIndent = false,
+      textIndent     = nodeIndent,
+      emptyLines     = 0,
+      atMoreIndented = false,
+      tmp,
+      ch;
+
+  ch = state.input.charCodeAt(state.position);
+
+  if (ch === 0x7C/* | */) {
+    folding = false;
+  } else if (ch === 0x3E/* > */) {
+    folding = true;
+  } else {
+    return false;
+  }
+
+  state.kind = 'scalar';
+  state.result = '';
+
+  while (0 !== ch) {
+    ch = state.input.charCodeAt(++state.position);
+
+    if (0x2B/* + */ === ch || 0x2D/* - */ === ch) {
+      if (CHOMPING_CLIP === chomping) {
+        chomping = (0x2B/* + */ === ch) ? CHOMPING_KEEP : CHOMPING_STRIP;
+      } else {
+        throwError(state, 'repeat of a chomping mode identifier');
+      }
+
+    } else if ((tmp = fromDecimalCode(ch)) >= 0) {
+      if (tmp === 0) {
+        throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one');
+      } else if (!detectedIndent) {
+        textIndent = nodeIndent + tmp - 1;
+        detectedIndent = true;
+      } else {
+        throwError(state, 'repeat of an indentation width identifier');
+      }
+
+    } else {
+      break;
+    }
+  }
+
+  if (is_WHITE_SPACE(ch)) {
+    do { ch = state.input.charCodeAt(++state.position); }
+    while (is_WHITE_SPACE(ch));
+
+    if (0x23/* # */ === ch) {
+      do { ch = state.input.charCodeAt(++state.position); }
+      while (!is_EOL(ch) && (0 !== ch));
+    }
+  }
+
+  while (0 !== ch) {
+    readLineBreak(state);
+    state.lineIndent = 0;
+
+    ch = state.input.charCodeAt(state.position);
+
+    while ((!detectedIndent || state.lineIndent < textIndent) &&
+           (0x20/* Space */ === ch)) {
+      state.lineIndent++;
+      ch = state.input.charCodeAt(++state.position);
+    }
+
+    if (!detectedIndent && state.lineIndent > textIndent) {
+      textIndent = state.lineIndent;
+    }
+
+    if (is_EOL(ch)) {
+      emptyLines++;
+      continue;
+    }
+
+    // End of the scalar.
+    if (state.lineIndent < textIndent) {
+
+      // Perform the chomping.
+      if (chomping === CHOMPING_KEEP) {
+        state.result += common.repeat('\n', emptyLines);
+      } else if (chomping === CHOMPING_CLIP) {
+        if (detectedIndent) { // i.e. only if the scalar is not empty.
+          state.result += '\n';
+        }
+      }
+
+      // Break this `while` cycle and go to the funciton's epilogue.
+      break;
+    }
+
+    // Folded style: use fancy rules to handle line breaks.
+    if (folding) {
+
+      // Lines starting with white space characters (more-indented lines) are not folded.
+      if (is_WHITE_SPACE(ch)) {
+        atMoreIndented = true;
+        state.result += common.repeat('\n', emptyLines + 1);
+
+      // End of more-indented block.
+      } else if (atMoreIndented) {
+        atMoreIndented = false;
+        state.result += common.repeat('\n', emptyLines + 1);
+
+      // Just one line break - perceive as the same line.
+      } else if (0 === emptyLines) {
+        if (detectedIndent) { // i.e. only if we have already read some scalar content.
+          state.result += ' ';
+        }
+
+      // Several line breaks - perceive as different lines.
+      } else {
+        state.result += common.repeat('\n', emptyLines);
+      }
+
+    // Literal style: just add exact number of line breaks between content lines.
+    } else {
+
+      // If current line isn't the first one - count line break from the last content line.
+      if (detectedIndent) {
+        state.result += common.repeat('\n', emptyLines + 1);
+
+      // In case of the first content line - count only empty lines.
+      } else {
+        state.result += common.repeat('\n', emptyLines);
+      }
+    }
+
+    detectedIndent = true;
+    emptyLines = 0;
+    captureStart = state.position;
+
+    while (!is_EOL(ch) && (0 !== ch))
+    { ch = state.input.charCodeAt(++state.position); }
+
+    captureSegment(state, captureStart, state.position, false);
+  }
+
+  return true;
+}
+
+function readBlockSequence(state, nodeIndent) {
+  var _line,
+      _tag      = state.tag,
+      _anchor   = state.anchor,
+      _result   = [],
+      following,
+      detected  = false,
+      ch;
+
+  if (null !== state.anchor) {
+    state.anchorMap[state.anchor] = _result;
+  }
+
+  ch = state.input.charCodeAt(state.position);
+
+  while (0 !== ch) {
+
+    if (0x2D/* - */ !== ch) {
+      break;
+    }
+
+    following = state.input.charCodeAt(state.position + 1);
+
+    if (!is_WS_OR_EOL(following)) {
+      break;
+    }
+
+    detected = true;
+    state.position++;
+
+    if (skipSeparationSpace(state, true, -1)) {
+      if (state.lineIndent <= nodeIndent) {
+        _result.push(null);
+        ch = state.input.charCodeAt(state.position);
+        continue;
+      }
+    }
+
+    _line = state.line;
+    composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true);
+    _result.push(state.result);
+    skipSeparationSpace(state, true, -1);
+
+    ch = state.input.charCodeAt(state.position);
+
+    if ((state.line === _line || state.lineIndent > nodeIndent) && (0 !== ch)) {
+      throwError(state, 'bad indentation of a sequence entry');
+    } else if (state.lineIndent < nodeIndent) {
+      break;
+    }
+  }
+
+  if (detected) {
+    state.tag = _tag;
+    state.anchor = _anchor;
+    state.kind = 'sequence';
+    state.result = _result;
+    return true;
+  } else {
+    return false;
+  }
+}
+
+function readBlockMapping(state, nodeIndent, flowIndent) {
+  var following,
+      allowCompact,
+      _line,
+      _tag          = state.tag,
+      _anchor       = state.anchor,
+      _result       = {},
+      keyTag        = null,
+      keyNode       = null,
+      valueNode     = null,
+      atExplicitKey = false,
+      detected      = false,
+      ch;
+
+  if (null !== state.anchor) {
+    state.anchorMap[state.anchor] = _result;
+  }
+
+  ch = state.input.charCodeAt(state.position);
+
+  while (0 !== ch) {
+    following = state.input.charCodeAt(state.position + 1);
+    _line = state.line; // Save the current line.
+
+    //
+    // Explicit notation case. There are two separate blocks:
+    // first for the key (denoted by "?") and second for the value (denoted by ":")
+    //
+    if ((0x3F/* ? */ === ch || 0x3A/* : */  === ch) && is_WS_OR_EOL(following)) {
+
+      if (0x3F/* ? */ === ch) {
+        if (atExplicitKey) {
+          storeMappingPair(state, _result, keyTag, keyNode, null);
+          keyTag = keyNode = valueNode = null;
+        }
+
+        detected = true;
+        atExplicitKey = true;
+        allowCompact = true;
+
+      } else if (atExplicitKey) {
+        // i.e. 0x3A/* : */ === character after the explicit key.
+        atExplicitKey = false;
+        allowCompact = true;
+
+      } else {
+        throwError(state, 'incomplete explicit mapping pair; a key node is missed');
+      }
+
+      state.position += 1;
+      ch = following;
+
+    //
+    // Implicit notation case. Flow-style node as the key first, then ":", and the value.
+    //
+    } else if (composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) {
+
+      if (state.line === _line) {
+        ch = state.input.charCodeAt(state.position);
+
+        while (is_WHITE_SPACE(ch)) {
+          ch = state.input.charCodeAt(++state.position);
+        }
+
+        if (0x3A/* : */ === ch) {
+          ch = state.input.charCodeAt(++state.position);
+
+          if (!is_WS_OR_EOL(ch)) {
+            throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping');
+          }
+
+          if (atExplicitKey) {
+            storeMappingPair(state, _result, keyTag, keyNode, null);
+            keyTag = keyNode = valueNode = null;
+          }
+
+          detected = true;
+          atExplicitKey = false;
+          allowCompact = false;
+          keyTag = state.tag;
+          keyNode = state.result;
+
+        } else if (detected) {
+          throwError(state, 'can not read an implicit mapping pair; a colon is missed');
+
+        } else {
+          state.tag = _tag;
+          state.anchor = _anchor;
+          return true; // Keep the result of `composeNode`.
+        }
+
+      } else if (detected) {
+        throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key');
+
+      } else {
+        state.tag = _tag;
+        state.anchor = _anchor;
+        return true; // Keep the result of `composeNode`.
+      }
+
+    } else {
+      break; // Reading is done. Go to the epilogue.
+    }
+
+    //
+    // Common reading code for both explicit and implicit notations.
+    //
+    if (state.line === _line || state.lineIndent > nodeIndent) {
+      if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) {
+        if (atExplicitKey) {
+          keyNode = state.result;
+        } else {
+          valueNode = state.result;
+        }
+      }
+
+      if (!atExplicitKey) {
+        storeMappingPair(state, _result, keyTag, keyNode, valueNode);
+        keyTag = keyNode = valueNode = null;
+      }
+
+      skipSeparationSpace(state, true, -1);
+      ch = state.input.charCodeAt(state.position);
+    }
+
+    if (state.lineIndent > nodeIndent && (0 !== ch)) {
+      throwError(state, 'bad indentation of a mapping entry');
+    } else if (state.lineIndent < nodeIndent) {
+      break;
+    }
+  }
+
+  //
+  // Epilogue.
+  //
+
+  // Special case: last mapping's node contains only the key in explicit notation.
+  if (atExplicitKey) {
+    storeMappingPair(state, _result, keyTag, keyNode, null);
+  }
+
+  // Expose the resulting mapping.
+  if (detected) {
+    state.tag = _tag;
+    state.anchor = _anchor;
+    state.kind = 'mapping';
+    state.result = _result;
+  }
+
+  return detected;
+}
+
+function readTagProperty(state) {
+  var _position,
+      isVerbatim = false,
+      isNamed    = false,
+      tagHandle,
+      tagName,
+      ch;
+
+  ch = state.input.charCodeAt(state.position);
+
+  if (0x21/* ! */ !== ch) {
+    return false;
+  }
+
+  if (null !== state.tag) {
+    throwError(state, 'duplication of a tag property');
+  }
+
+  ch = state.input.charCodeAt(++state.position);
+
+  if (0x3C/* < */ === ch) {
+    isVerbatim = true;
+    ch = state.input.charCodeAt(++state.position);
+
+  } else if (0x21/* ! */ === ch) {
+    isNamed = true;
+    tagHandle = '!!';
+    ch = state.input.charCodeAt(++state.position);
+
+  } else {
+    tagHandle = '!';
+  }
+
+  _position = state.position;
+
+  if (isVerbatim) {
+    do { ch = state.input.charCodeAt(++state.position); }
+    while (0 !== ch && 0x3E/* > */ !== ch);
+
+    if (state.position < state.length) {
+      tagName = state.input.slice(_position, state.position);
+      ch = state.input.charCodeAt(++state.position);
+    } else {
+      throwError(state, 'unexpected end of the stream within a verbatim tag');
+    }
+  } else {
+    while (0 !== ch && !is_WS_OR_EOL(ch)) {
+
+      if (0x21/* ! */ === ch) {
+        if (!isNamed) {
+          tagHandle = state.input.slice(_position - 1, state.position + 1);
+
+          if (!PATTERN_TAG_HANDLE.test(tagHandle)) {
+            throwError(state, 'named tag handle cannot contain such characters');
+          }
+
+          isNamed = true;
+          _position = state.position + 1;
+        } else {
+          throwError(state, 'tag suffix cannot contain exclamation marks');
+        }
+      }
+
+      ch = state.input.charCodeAt(++state.position);
+    }
+
+    tagName = state.input.slice(_position, state.position);
+
+    if (PATTERN_FLOW_INDICATORS.test(tagName)) {
+      throwError(state, 'tag suffix cannot contain flow indicator characters');
+    }
+  }
+
+  if (tagName && !PATTERN_TAG_URI.test(tagName)) {
+    throwError(state, 'tag name cannot contain such characters: ' + tagName);
+  }
+
+  if (isVerbatim) {
+    state.tag = tagName;
+
+  } else if (_hasOwnProperty.call(state.tagMap, tagHandle)) {
+    state.tag = state.tagMap[tagHandle] + tagName;
+
+  } else if ('!' === tagHandle) {
+    state.tag = '!' + tagName;
+
+  } else if ('!!' === tagHandle) {
+    state.tag = 'tag:yaml.org,2002:' + tagName;
+
+  } else {
+    throwError(state, 'undeclared tag handle "' + tagHandle + '"');
+  }
+
+  return true;
+}
+
+function readAnchorProperty(state) {
+  var _position,
+      ch;
+
+  ch = state.input.charCodeAt(state.position);
+
+  if (0x26/* & */ !== ch) {
+    return false;
+  }
+
+  if (null !== state.anchor) {
+    throwError(state, 'duplication of an anchor property');
+  }
+
+  ch = state.input.charCodeAt(++state.position);
+  _position = state.position;
+
+  while (0 !== ch && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
+    ch = state.input.charCodeAt(++state.position);
+  }
+
+  if (state.position === _position) {
+    throwError(state, 'name of an anchor node must contain at least one character');
+  }
+
+  state.anchor = state.input.slice(_position, state.position);
+  return true;
+}
+
+function readAlias(state) {
+  var _position, alias,
+      len = state.length,
+      input = state.input,
+      ch;
+
+  ch = state.input.charCodeAt(state.position);
+
+  if (0x2A/* * */ !== ch) {
+    return false;
+  }
+
+  ch = state.input.charCodeAt(++state.position);
+  _position = state.position;
+
+  while (0 !== ch && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
+    ch = state.input.charCodeAt(++state.position);
+  }
+
+  if (state.position === _position) {
+    throwError(state, 'name of an alias node must contain at least one character');
+  }
+
+  alias = state.input.slice(_position, state.position);
+
+  if (!state.anchorMap.hasOwnProperty(alias)) {
+    throwError(state, 'unidentified alias "' + alias + '"');
+  }
+
+  state.result = state.anchorMap[alias];
+  skipSeparationSpace(state, true, -1);
+  return true;
+}
+
+function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) {
+  var allowBlockStyles,
+      allowBlockScalars,
+      allowBlockCollections,
+      indentStatus = 1, // 1: this>parent, 0: this=parent, -1: this<parent
+      atNewLine  = false,
+      hasContent = false,
+      typeIndex,
+      typeQuantity,
+      type,
+      flowIndent,
+      blockIndent,
+      _result;
+
+  state.tag    = null;
+  state.anchor = null;
+  state.kind   = null;
+  state.result = null;
+
+  allowBlockStyles = allowBlockScalars = allowBlockCollections =
+    CONTEXT_BLOCK_OUT === nodeContext ||
+    CONTEXT_BLOCK_IN  === nodeContext;
+
+  if (allowToSeek) {
+    if (skipSeparationSpace(state, true, -1)) {
+      atNewLine = true;
+
+      if (state.lineIndent > parentIndent) {
+        indentStatus = 1;
+      } else if (state.lineIndent === parentIndent) {
+        indentStatus = 0;
+      } else if (state.lineIndent < parentIndent) {
+        indentStatus = -1;
+      }
+    }
+  }
+
+  if (1 === indentStatus) {
+    while (readTagProperty(state) || readAnchorProperty(state)) {
+      if (skipSeparationSpace(state, true, -1)) {
+        atNewLine = true;
+        allowBlockCollections = allowBlockStyles;
+
+        if (state.lineIndent > parentIndent) {
+          indentStatus = 1;
+        } else if (state.lineIndent === parentIndent) {
+          indentStatus = 0;
+        } else if (state.lineIndent < parentIndent) {
+          indentStatus = -1;
+        }
+      } else {
+        allowBlockCollections = false;
+      }
+    }
+  }
+
+  if (allowBlockCollections) {
+    allowBlockCollections = atNewLine || allowCompact;
+  }
+
+  if (1 === indentStatus || CONTEXT_BLOCK_OUT === nodeContext) {
+    if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) {
+      flowIndent = parentIndent;
+    } else {
+      flowIndent = parentIndent + 1;
+    }
+
+    blockIndent = state.position - state.lineStart;
+
+    if (1 === indentStatus) {
+      if (allowBlockCollections &&
+          (readBlockSequence(state, blockIndent) ||
+           readBlockMapping(state, blockIndent, flowIndent)) ||
+          readFlowCollection(state, flowIndent)) {
+        hasContent = true;
+      } else {
+        if ((allowBlockScalars && readBlockScalar(state, flowIndent)) ||
+            readSingleQuotedScalar(state, flowIndent) ||
+            readDoubleQuotedScalar(state, flowIndent)) {
+          hasContent = true;
+
+        } else if (readAlias(state)) {
+          hasContent = true;
+
+          if (null !== state.tag || null !== state.anchor) {
+            throwError(state, 'alias node should not have any properties');
+          }
+
+        } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) {
+          hasContent = true;
+
+          if (null === state.tag) {
+            state.tag = '?';
+          }
+        }
+
+        if (null !== state.anchor) {
+          state.anchorMap[state.anchor] = state.result;
+        }
+      }
+    } else if (0 === indentStatus) {
+      // Special case: block sequences are allowed to have same indentation level as the parent.
+      // http://www.yaml.org/spec/1.2/spec.html#id2799784
+      hasContent = allowBlockCollections && readBlockSequence(state, blockIndent);
+    }
+  }
+
+  if (null !== state.tag && '!' !== state.tag) {
+    if ('?' === state.tag) {
+      for (typeIndex = 0, typeQuantity = state.implicitTypes.length;
+           typeIndex < typeQuantity;
+           typeIndex += 1) {
+        type = state.implicitTypes[typeIndex];
+
+        // Implicit resolving is not allowed for non-scalar types, and '?'
+        // non-specific tag is only assigned to plain scalars. So, it isn't
+        // needed to check for 'kind' conformity.
+
+        if (type.resolve(state.result)) { // `state.result` updated in resolver if matched
+          state.result = type.construct(state.result);
+          state.tag = type.tag;
+          if (null !== state.anchor) {
+            state.anchorMap[state.anchor] = state.result;
+          }
+          break;
+        }
+      }
+    } else if (_hasOwnProperty.call(state.typeMap, state.tag)) {
+      type = state.typeMap[state.tag];
+
+      if (null !== state.result && type.kind !== state.kind) {
+        throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"');
+      }
+
+      if (!type.resolve(state.result)) { // `state.result` updated in resolver if matched
+        throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag');
+      } else {
+        state.result = type.construct(state.result);
+        if (null !== state.anchor) {
+          state.anchorMap[state.anchor] = state.result;
+        }
+      }
+    } else {
+      throwWarning(state, 'unknown tag !<' + state.tag + '>');
+    }
+  }
+
+  return null !== state.tag || null !== state.anchor || hasContent;
+}
+
+function readDocument(state) {
+  var documentStart = state.position,
+      _position,
+      directiveName,
+      directiveArgs,
+      hasDirectives = false,
+      ch;
+
+  state.version = null;
+  state.checkLineBreaks = state.legacy;
+  state.tagMap = {};
+  state.anchorMap = {};
+
+  while (0 !== (ch = state.input.charCodeAt(state.position))) {
+    skipSeparationSpace(state, true, -1);
+
+    ch = state.input.charCodeAt(state.position);
+
+    if (state.lineIndent > 0 || 0x25/* % */ !== ch) {
+      break;
+    }
+
+    hasDirectives = true;
+    ch = state.input.charCodeAt(++state.position);
+    _position = state.position;
+
+    while (0 !== ch && !is_WS_OR_EOL(ch)) {
+      ch = state.input.charCodeAt(++state.position);
+    }
+
+    directiveName = state.input.slice(_position, state.position);
+    directiveArgs = [];
+
+    if (directiveName.length < 1) {
+      throwError(state, 'directive name must not be less than one character in length');
+    }
+
+    while (0 !== ch) {
+      while (is_WHITE_SPACE(ch)) {
+        ch = state.input.charCodeAt(++state.position);
+      }
+
+      if (0x23/* # */ === ch) {
+        do { ch = state.input.charCodeAt(++state.position); }
+        while (0 !== ch && !is_EOL(ch));
+        break;
+      }
+
+      if (is_EOL(ch)) {
+        break;
+      }
+
+      _position = state.position;
+
+      while (0 !== ch && !is_WS_OR_EOL(ch)) {
+        ch = state.input.charCodeAt(++state.position);
+      }
+
+      directiveArgs.push(state.input.slice(_position, state.position));
+    }
+
+    if (0 !== ch) {
+      readLineBreak(state);
+    }
+
+    if (_hasOwnProperty.call(directiveHandlers, directiveName)) {
+      directiveHandlers[directiveName](state, directiveName, directiveArgs);
+    } else {
+      throwWarning(state, 'unknown document directive "' + directiveName + '"');
+    }
+  }
+
+  skipSeparationSpace(state, true, -1);
+
+  if (0 === state.lineIndent &&
+      0x2D/* - */ === state.input.charCodeAt(state.position) &&
+      0x2D/* - */ === state.input.charCodeAt(state.position + 1) &&
+      0x2D/* - */ === state.input.charCodeAt(state.position + 2)) {
+    state.position += 3;
+    skipSeparationSpace(state, true, -1);
+
+  } else if (hasDirectives) {
+    throwError(state, 'directives end mark is expected');
+  }
+
+  composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true);
+  skipSeparationSpace(state, true, -1);
+
+  if (state.checkLineBreaks &&
+      PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) {
+    throwWarning(state, 'non-ASCII line breaks are interpreted as content');
+  }
+
+  state.documents.push(state.result);
+
+  if (state.position === state.lineStart && testDocumentSeparator(state)) {
+
+    if (0x2E/* . */ === state.input.charCodeAt(state.position)) {
+      state.position += 3;
+      skipSeparationSpace(state, true, -1);
+    }
+    return;
+  }
+
+  if (state.position < (state.length - 1)) {
+    throwError(state, 'end of the stream or a document separator is expected');
+  } else {
+    return;
+  }
+}
+
+
+function loadDocuments(input, options) {
+  input = String(input);
+  options = options || {};
+
+  if (0 !== input.length &&
+      0x0A/* LF */ !== input.charCodeAt(input.length - 1) &&
+      0x0D/* CR */ !== input.charCodeAt(input.length - 1)) {
+    input += '\n';
+  }
+
+  var state = new State(input, options);
+
+  if (PATTERN_NON_PRINTABLE.test(state.input)) {
+    throwError(state, 'the stream contains non-printable characters');
+  }
+
+  // Use 0 as string terminator. That significantly simplifies bounds check.
+  state.input += '\0';
+
+  while (0x20/* Space */ === state.input.charCodeAt(state.position)) {
+    state.lineIndent += 1;
+    state.position += 1;
+  }
+
+  while (state.position < (state.length - 1)) {
+    readDocument(state);
+  }
+
+  return state.documents;
+}
+
+
+function loadAll(input, iterator, options) {
+  var documents = loadDocuments(input, options), index, length;
+
+  for (index = 0, length = documents.length; index < length; index += 1) {
+    iterator(documents[index]);
+  }
+}
+
+
+function load(input, options) {
+  var documents = loadDocuments(input, options), index, length;
+
+  if (0 === documents.length) {
+    return undefined;
+  } else if (1 === documents.length) {
+    return documents[0];
+  } else {
+    throw new YAMLException('expected a single document in the stream, but found more');
+  }
+}
+
+
+function safeLoadAll(input, output, options) {
+  loadAll(input, output, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
+}
+
+
+function safeLoad(input, options) {
+  return load(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
+}
+
+
+module.exports.loadAll     = loadAll;
+module.exports.load        = load;
+module.exports.safeLoadAll = safeLoadAll;
+module.exports.safeLoad    = safeLoad;
+
+},{"./common":2,"./exception":4,"./mark":6,"./schema/default_full":9,"./schema/default_safe":10}],6:[function(require,module,exports){
+'use strict';
+
+
+var common = require('./common');
+
+
+function Mark(name, buffer, position, line, column) {
+  this.name     = name;
+  this.buffer   = buffer;
+  this.position = position;
+  this.line     = line;
+  this.column   = column;
+}
+
+
+Mark.prototype.getSnippet = function getSnippet(indent, maxLength) {
+  var head, start, tail, end, snippet;
+
+  if (!this.buffer) {
+    return null;
+  }
+
+  indent = indent || 4;
+  maxLength = maxLength || 75;
+
+  head = '';
+  start = this.position;
+
+  while (start > 0 && -1 === '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(start - 1))) {
+    start -= 1;
+    if (this.position - start > (maxLength / 2 - 1)) {
+      head = ' ... ';
+      start += 5;
+      break;
+    }
+  }
+
+  tail = '';
+  end = this.position;
+
+  while (end < this.buffer.length && -1 === '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(end))) {
+    end += 1;
+    if (end - this.position > (maxLength / 2 - 1)) {
+      tail = ' ... ';
+      end -= 5;
+      break;
+    }
+  }
+
+  snippet = this.buffer.slice(start, end);
+
+  return common.repeat(' ', indent) + head + snippet + tail + '\n' +
+         common.repeat(' ', indent + this.position - start + head.length) + '^';
+};
+
+
+Mark.prototype.toString = function toString(compact) {
+  var snippet, where = '';
+
+  if (this.name) {
+    where += 'in "' + this.name + '" ';
+  }
+
+  where += 'at line ' + (this.line + 1) + ', column ' + (this.column + 1);
+
+  if (!compact) {
+    snippet = this.getSnippet();
+
+    if (snippet) {
+      where += ':\n' + snippet;
+    }
+  }
+
+  return where;
+};
+
+
+module.exports = Mark;
+
+},{"./common":2}],7:[function(require,module,exports){
+'use strict';
+
+
+var common        = require('./common');
+var YAMLException = require('./exception');
+var Type          = require('./type');
+
+
+function compileList(schema, name, result) {
+  var exclude = [];
+
+  schema.include.forEach(function (includedSchema) {
+    result = compileList(includedSchema, name, result);
+  });
+
+  schema[name].forEach(function (currentType) {
+    result.forEach(function (previousType, previousIndex) {
+      if (previousType.tag === currentType.tag) {
+        exclude.push(previousIndex);
+      }
+    });
+
+    result.push(currentType);
+  });
+
+  return result.filter(function (type, index) {
+    return -1 === exclude.indexOf(index);
+  });
+}
+
+
+function compileMap(/* lists... */) {
+  var result = {}, index, length;
+
+  function collectType(type) {
+    result[type.tag] = type;
+  }
+
+  for (index = 0, length = arguments.length; index < length; index += 1) {
+    arguments[index].forEach(collectType);
+  }
+
+  return result;
+}
+
+
+function Schema(definition) {
+  this.include  = definition.include  || [];
+  this.implicit = definition.implicit || [];
+  this.explicit = definition.explicit || [];
+
+  this.implicit.forEach(function (type) {
+    if (type.loadKind && 'scalar' !== type.loadKind) {
+      throw new YAMLException('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.');
+    }
+  });
+
+  this.compiledImplicit = compileList(this, 'implicit', []);
+  this.compiledExplicit = compileList(this, 'explicit', []);
+  this.compiledTypeMap  = compileMap(this.compiledImplicit, this.compiledExplicit);
+}
+
+
+Schema.DEFAULT = null;
+
+
+Schema.create = function createSchema() {
+  var schemas, types;
+
+  switch (arguments.length) {
+  case 1:
+    schemas = Schema.DEFAULT;
+    types = arguments[0];
+    break;
+
+  case 2:
+    schemas = arguments[0];
+    types = arguments[1];
+    break;
+
+  default:
+    throw new YAMLException('Wrong number of arguments for Schema.create function');
+  }
+
+  schemas = common.toArray(schemas);
+  types = common.toArray(types);
+
+  if (!schemas.every(function (schema) { return schema instanceof Schema; })) {
+    throw new YAMLException('Specified list of super schemas (or a single Schema object) contains a non-Schema object.');
+  }
+
+  if (!types.every(function (type) { return type instanceof Type; })) {
+    throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.');
+  }
+
+  return new Schema({
+    include: schemas,
+    explicit: types
+  });
+};
+
+
+module.exports = Schema;
+
+},{"./common":2,"./exception":4,"./type":13}],8:[function(require,module,exports){
+// Standard YAML's Core schema.
+// http://www.yaml.org/spec/1.2/spec.html#id2804923
+//
+// NOTE: JS-YAML does not support schema-specific tag resolution restrictions.
+// So, Core schema has no distinctions from JSON schema is JS-YAML.
+
+
+'use strict';
+
+
+var Schema = require('../schema');
+
+
+module.exports = new Schema({
+  include: [
+    require('./json')
+  ]
+});
+
+},{"../schema":7,"./json":12}],9:[function(require,module,exports){
+// JS-YAML's default schema for `load` function.
+// It is not described in the YAML specification.
+//
+// This schema is based on JS-YAML's default safe schema and includes
+// JavaScript-specific types: !!js/undefined, !!js/regexp and !!js/function.
+//
+// Also this schema is used as default base schema at `Schema.create` function.
+
+
+'use strict';
+
+
+var Schema = require('../schema');
+
+
+module.exports = Schema.DEFAULT = new Schema({
+  include: [
+    require('./default_safe')
+  ],
+  explicit: [
+    require('../type/js/undefined'),
+    require('../type/js/regexp'),
+    require('../type/js/function')
+  ]
+});
+
+},{"../schema":7,"../type/js/function":18,"../type/js/regexp":19,"../type/js/undefined":20,"./default_safe":10}],10:[function(require,module,exports){
+// JS-YAML's default schema for `safeLoad` function.
+// It is not described in the YAML specification.
+//
+// This schema is based on standard YAML's Core schema and includes most of
+// extra types described at YAML tag repository. (http://yaml.org/type/)
+
+
+'use strict';
+
+
+var Schema = require('../schema');
+
+
+module.exports = new Schema({
+  include: [
+    require('./core')
+  ],
+  implicit: [
+    require('../type/timestamp'),
+    require('../type/merge')
+  ],
+  explicit: [
+    require('../type/binary'),
+    require('../type/omap'),
+    require('../type/pairs'),
+    require('../type/set')
+  ]
+});
+
+},{"../schema":7,"../type/binary":14,"../type/merge":22,"../type/omap":24,"../type/pairs":25,"../type/set":27,"../type/timestamp":29,"./core":8}],11:[function(require,module,exports){
+// Standard YAML's Failsafe schema.
+// http://www.yaml.org/spec/1.2/spec.html#id2802346
+
+
+'use strict';
+
+
+var Schema = require('../schema');
+
+
+module.exports = new Schema({
+  explicit: [
+    require('../type/str'),
+    require('../type/seq'),
+    require('../type/map')
+  ]
+});
+
+},{"../schema":7,"../type/map":21,"../type/seq":26,"../type/str":28}],12:[function(require,module,exports){
+// Standard YAML's JSON schema.
+// http://www.yaml.org/spec/1.2/spec.html#id2803231
+//
+// NOTE: JS-YAML does not support schema-specific tag resolution restrictions.
+// So, this schema is not such strict as defined in the YAML specification.
+// It allows numbers in binary notaion, use `Null` and `NULL` as `null`, etc.
+
+
+'use strict';
+
+
+var Schema = require('../schema');
+
+
+module.exports = new Schema({
+  include: [
+    require('./failsafe')
+  ],
+  implicit: [
+    require('../type/null'),
+    require('../type/bool'),
+    require('../type/int'),
+    require('../type/float')
+  ]
+});
+
+},{"../schema":7,"../type/bool":15,"../type/float":16,"../type/int":17,"../type/null":23,"./failsafe":11}],13:[function(require,module,exports){
+'use strict';
+
+var YAMLException = require('./exception');
+
+var TYPE_CONSTRUCTOR_OPTIONS = [
+  'kind',
+  'resolve',
+  'construct',
+  'instanceOf',
+  'predicate',
+  'represent',
+  'defaultStyle',
+  'styleAliases'
+];
+
+var YAML_NODE_KINDS = [
+  'scalar',
+  'sequence',
+  'mapping'
+];
+
+function compileStyleAliases(map) {
+  var result = {};
+
+  if (null !== map) {
+    Object.keys(map).forEach(function (style) {
+      map[style].forEach(function (alias) {
+        result[String(alias)] = style;
+      });
+    });
+  }
+
+  return result;
+}
+
+function Type(tag, options) {
+  options = options || {};
+
+  Object.keys(options).forEach(function (name) {
+    if (-1 === TYPE_CONSTRUCTOR_OPTIONS.indexOf(name)) {
+      throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.');
+    }
+  });
+
+  // TODO: Add tag format check.
+  this.tag          = tag;
+  this.kind         = options['kind']         || null;
+  this.resolve      = options['resolve']      || function () { return true; };
+  this.construct    = options['construct']    || function (data) { return data; };
+  this.instanceOf   = options['instanceOf']   || null;
+  this.predicate    = options['predicate']    || null;
+  this.represent    = options['represent']    || null;
+  this.defaultStyle = options['defaultStyle'] || null;
+  this.styleAliases = compileStyleAliases(options['styleAliases'] || null);
+
+  if (-1 === YAML_NODE_KINDS.indexOf(this.kind)) {
+    throw new YAMLException('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.');
+  }
+}
+
+module.exports = Type;
+
+},{"./exception":4}],14:[function(require,module,exports){
+'use strict';
+
+
+// A trick for browserified version.
+// Since we make browserifier to ignore `buffer` module, NodeBuffer will be undefined
+var NodeBuffer = require('buffer').Buffer;
+var Type       = require('../type');
+
+
+// [ 64, 65, 66 ] -> [ padding, CR, LF ]
+var BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r';
+
+
+function resolveYamlBinary(data) {
+  if (null === data) {
+    return false;
+  }
+
+  var code, idx, bitlen = 0, len = 0, max = data.length, map = BASE64_MAP;
+
+  // Convert one by one.
+  for (idx = 0; idx < max; idx ++) {
+    code = map.indexOf(data.charAt(idx));
+
+    // Skip CR/LF
+    if (code > 64) { continue; }
+
+    // Fail on illegal characters
+    if (code < 0) { return false; }
+
+    bitlen += 6;
+  }
+
+  // If there are any bits left, source was corrupted
+  return (bitlen % 8) === 0;
+}
+
+function constructYamlBinary(data) {
+  var code, idx, tailbits,
+      input = data.replace(/[\r\n=]/g, ''), // remove CR/LF & padding to simplify scan
+      max = input.length,
+      map = BASE64_MAP,
+      bits = 0,
+      result = [];
+
+  // Collect by 6*4 bits (3 bytes)
+
+  for (idx = 0; idx < max; idx++) {
+    if ((idx % 4 === 0) && idx) {
+      result.push((bits >> 16) & 0xFF);
+      result.push((bits >> 8) & 0xFF);
+      result.push(bits & 0xFF);
+    }
+
+    bits = (bits << 6) | map.indexOf(input.charAt(idx));
+  }
+
+  // Dump tail
+
+  tailbits = (max % 4)*6;
+
+  if (tailbits === 0) {
+    result.push((bits >> 16) & 0xFF);
+    result.push((bits >> 8) & 0xFF);
+    result.push(bits & 0xFF);
+  } else if (tailbits === 18) {
+    result.push((bits >> 10) & 0xFF);
+    result.push((bits >> 2) & 0xFF);
+  } else if (tailbits === 12) {
+    result.push((bits >> 4) & 0xFF);
+  }
+
+  // Wrap into Buffer for NodeJS and leave Array for browser
+  if (NodeBuffer) {
+    return new NodeBuffer(result);
+  }
+
+  return result;
+}
+
+function representYamlBinary(object /*, style*/) {
+  var result = '', bits = 0, idx, tail,
+      max = object.length,
+      map = BASE64_MAP;
+
+  // Convert every three bytes to 4 ASCII characters.
+
+  for (idx = 0; idx < max; idx++) {
+    if ((idx % 3 === 0) && idx) {
+      result += map[(bits >> 18) & 0x3F];
+      result += map[(bits >> 12) & 0x3F];
+      result += map[(bits >> 6) & 0x3F];
+      result += map[bits & 0x3F];
+    }
+
+    bits = (bits << 8) + object[idx];
+  }
+
+  // Dump tail
+
+  tail = max % 3;
+
+  if (tail === 0) {
+    result += map[(bits >> 18) & 0x3F];
+    result += map[(bits >> 12) & 0x3F];
+    result += map[(bits >> 6) & 0x3F];
+    result += map[bits & 0x3F];
+  } else if (tail === 2) {
+    result += map[(bits >> 10) & 0x3F];
+    result += map[(bits >> 4) & 0x3F];
+    result += map[(bits << 2) & 0x3F];
+    result += map[64];
+  } else if (tail === 1) {
+    result += map[(bits >> 2) & 0x3F];
+    result += map[(bits << 4) & 0x3F];
+    result += map[64];
+    result += map[64];
+  }
+
+  return result;
+}
+
+function isBinary(object) {
+  return NodeBuffer && NodeBuffer.isBuffer(object);
+}
+
+module.exports = new Type('tag:yaml.org,2002:binary', {
+  kind: 'scalar',
+  resolve: resolveYamlBinary,
+  construct: constructYamlBinary,
+  predicate: isBinary,
+  represent: representYamlBinary
+});
+
+},{"../type":13,"buffer":30}],15:[function(require,module,exports){
+'use strict';
+
+var Type = require('../type');
+
+function resolveYamlBoolean(data) {
+  if (null === data) {
+    return false;
+  }
+
+  var max = data.length;
+
+  return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) ||
+         (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE'));
+}
+
+function constructYamlBoolean(data) {
+  return data === 'true' ||
+         data === 'True' ||
+         data === 'TRUE';
+}
+
+function isBoolean(object) {
+  return '[object Boolean]' === Object.prototype.toString.call(object);
+}
+
+module.exports = new Type('tag:yaml.org,2002:bool', {
+  kind: 'scalar',
+  resolve: resolveYamlBoolean,
+  construct: constructYamlBoolean,
+  predicate: isBoolean,
+  represent: {
+    lowercase: function (object) { return object ? 'true' : 'false'; },
+    uppercase: function (object) { return object ? 'TRUE' : 'FALSE'; },
+    camelcase: function (object) { return object ? 'True' : 'False'; }
+  },
+  defaultStyle: 'lowercase'
+});
+
+},{"../type":13}],16:[function(require,module,exports){
+'use strict';
+
+var common = require('../common');
+var Type   = require('../type');
+
+var YAML_FLOAT_PATTERN = new RegExp(
+  '^(?:[-+]?(?:[0-9][0-9_]*)\\.[0-9_]*(?:[eE][-+][0-9]+)?' +
+  '|\\.[0-9_]+(?:[eE][-+][0-9]+)?' +
+  '|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*' +
+  '|[-+]?\\.(?:inf|Inf|INF)' +
+  '|\\.(?:nan|NaN|NAN))$');
+
+function resolveYamlFloat(data) {
+  if (null === data) {
+    return false;
+  }
+
+  var value, sign, base, digits;
+
+  if (!YAML_FLOAT_PATTERN.test(data)) {
+    return false;
+  }
+  return true;
+}
+
+function constructYamlFloat(data) {
+  var value, sign, base, digits;
+
+  value  = data.replace(/_/g, '').toLowerCase();
+  sign   = '-' === value[0] ? -1 : 1;
+  digits = [];
+
+  if (0 <= '+-'.indexOf(value[0])) {
+    value = value.slice(1);
+  }
+
+  if ('.inf' === value) {
+    return (1 === sign) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;
+
+  } else if ('.nan' === value) {
+    return NaN;
+
+  } else if (0 <= value.indexOf(':')) {
+    value.split(':').forEach(function (v) {
+      digits.unshift(parseFloat(v, 10));
+    });
+
+    value = 0.0;
+    base = 1;
+
+    digits.forEach(function (d) {
+      value += d * base;
+      base *= 60;
+    });
+
+    return sign * value;
+
+  } else {
+    return sign * parseFloat(value, 10);
+  }
+}
+
+function representYamlFloat(object, style) {
+  if (isNaN(object)) {
+    switch (style) {
+    case 'lowercase':
+      return '.nan';
+    case 'uppercase':
+      return '.NAN';
+    case 'camelcase':
+      return '.NaN';
+    }
+  } else if (Number.POSITIVE_INFINITY === object) {
+    switch (style) {
+    case 'lowercase':
+      return '.inf';
+    case 'uppercase':
+      return '.INF';
+    case 'camelcase':
+      return '.Inf';
+    }
+  } else if (Number.NEGATIVE_INFINITY === object) {
+    switch (style) {
+    case 'lowercase':
+      return '-.inf';
+    case 'uppercase':
+      return '-.INF';
+    case 'camelcase':
+      return '-.Inf';
+    }
+  } else if (common.isNegativeZero(object)) {
+    return '-0.0';
+  } else {
+    return object.toString(10);
+  }
+}
+
+function isFloat(object) {
+  return ('[object Number]' === Object.prototype.toString.call(object)) &&
+         (0 !== object % 1 || common.isNegativeZero(object));
+}
+
+module.exports = new Type('tag:yaml.org,2002:float', {
+  kind: 'scalar',
+  resolve: resolveYamlFloat,
+  construct: constructYamlFloat,
+  predicate: isFloat,
+  represent: representYamlFloat,
+  defaultStyle: 'lowercase'
+});
+
+},{"../common":2,"../type":13}],17:[function(require,module,exports){
+'use strict';
+
+var common = require('../common');
+var Type   = require('../type');
+
+function isHexCode(c) {
+  return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) ||
+         ((0x41/* A */ <= c) && (c <= 0x46/* F */)) ||
+         ((0x61/* a */ <= c) && (c <= 0x66/* f */));
+}
+
+function isOctCode(c) {
+  return ((0x30/* 0 */ <= c) && (c <= 0x37/* 7 */));
+}
+
+function isDecCode(c) {
+  return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */));
+}
+
+function resolveYamlInteger(data) {
+  if (null === data) {
+    return false;
+  }
+
+  var max = data.length,
+      index = 0,
+      hasDigits = false,
+      ch;
+
+  if (!max) { return false; }
+
+  ch = data[index];
+
+  // sign
+  if (ch === '-' || ch === '+') {
+    ch = data[++index];
+  }
+
+  if (ch === '0') {
+    // 0
+    if (index+1 === max) { return true; }
+    ch = data[++index];
+
+    // base 2, base 8, base 16
+
+    if (ch === 'b') {
+      // base 2
+      index++;
+
+      for (; index < max; index++) {
+        ch = data[index];
+        if (ch === '_') { continue; }
+        if (ch !== '0' && ch !== '1') {
+          return false;
+        }
+        hasDigits = true;
+      }
+      return hasDigits;
+    }
+
+
+    if (ch === 'x') {
+      // base 16
+      index++;
+
+      for (; index < max; index++) {
+        ch = data[index];
+        if (ch === '_') { continue; }
+        if (!isHexCode(data.charCodeAt(index))) {
+          return false;
+        }
+        hasDigits = true;
+      }
+      return hasDigits;
+    }
+
+    // base 8
+    for (; index < max; index++) {
+      ch = data[index];
+      if (ch === '_') { continue; }
+      if (!isOctCode(data.charCodeAt(index))) {
+        return false;
+      }
+      hasDigits = true;
+    }
+    return hasDigits;
+  }
+
+  // base 10 (except 0) or base 60
+
+  for (; index < max; index++) {
+    ch = data[index];
+    if (ch === '_') { continue; }
+    if (ch === ':') { break; }
+    if (!isDecCode(data.charCodeAt(index))) {
+      return false;
+    }
+    hasDigits = true;
+  }
+
+  if (!hasDigits) { return false; }
+
+  // if !base60 - done;
+  if (ch !== ':') { return true; }
+
+  // base60 almost not used, no needs to optimize
+  return /^(:[0-5]?[0-9])+$/.test(data.slice(index));
+}
+
+function constructYamlInteger(data) {
+  var value = data, sign = 1, ch, base, digits = [];
+
+  if (value.indexOf('_') !== -1) {
+    value = value.replace(/_/g, '');
+  }
+
+  ch = value[0];
+
+  if (ch === '-' || ch === '+') {
+    if (ch === '-') { sign = -1; }
+    value = value.slice(1);
+    ch = value[0];
+  }
+
+  if ('0' === value) {
+    return 0;
+  }
+
+  if (ch === '0') {
+    if (value[1] === 'b') {
+      return sign * parseInt(value.slice(2), 2);
+    }
+    if (value[1] === 'x') {
+      return sign * parseInt(value, 16);
+    }
+    return sign * parseInt(value, 8);
+
+  }
+
+  if (value.indexOf(':') !== -1) {
+    value.split(':').forEach(function (v) {
+      digits.unshift(parseInt(v, 10));
+    });
+
+    value = 0;
+    base = 1;
+
+    digits.forEach(function (d) {
+      value += (d * base);
+      base *= 60;
+    });
+
+    return sign * value;
+
+  }
+
+  return sign * parseInt(value, 10);
+}
+
+function isInteger(object) {
+  return ('[object Number]' === Object.prototype.toString.call(object)) &&
+         (0 === object % 1 && !common.isNegativeZero(object));
+}
+
+module.exports = new Type('tag:yaml.org,2002:int', {
+  kind: 'scalar',
+  resolve: resolveYamlInteger,
+  construct: constructYamlInteger,
+  predicate: isInteger,
+  represent: {
+    binary:      function (object) { return '0b' + object.toString(2); },
+    octal:       function (object) { return '0'  + object.toString(8); },
+    decimal:     function (object) { return        object.toString(10); },
+    hexadecimal: function (object) { return '0x' + object.toString(16).toUpperCase(); }
+  },
+  defaultStyle: 'decimal',
+  styleAliases: {
+    binary:      [ 2,  'bin' ],
+    octal:       [ 8,  'oct' ],
+    decimal:     [ 10, 'dec' ],
+    hexadecimal: [ 16, 'hex' ]
+  }
+});
+
+},{"../common":2,"../type":13}],18:[function(require,module,exports){
+'use strict';
+
+var esprima;
+
+// Browserified version does not have esprima
+//
+// 1. For node.js just require module as deps
+// 2. For browser try to require mudule via external AMD system.
+//    If not found - try to fallback to window.esprima. If not
+//    found too - then fail to parse.
+//
+try {
+  esprima = require('esprima');
+} catch (_) {
+  /*global window */
+  if (typeof window !== 'undefined') { esprima = window.esprima; }
+}
+
+var Type = require('../../type');
+
+function resolveJavascriptFunction(data) {
+  if (null === data) {
+    return false;
+  }
+
+  try {
+    var source = '(' + data + ')',
+        ast    = esprima.parse(source, { range: true }),
+        params = [],
+        body;
+
+    if ('Program'             !== ast.type         ||
+        1                     !== ast.body.length  ||
+        'ExpressionStatement' !== ast.body[0].type ||
+        'FunctionExpression'  !== ast.body[0].expression.type) {
+      return false;
+    }
+
+    return true;
+  } catch (err) {
+    return false;
+  }
+}
+
+function constructJavascriptFunction(data) {
+  /*jslint evil:true*/
+
+  var source = '(' + data + ')',
+      ast    = esprima.parse(source, { range: true }),
+      params = [],
+      body;
+
+  if ('Program'             !== ast.type         ||
+      1                     !== ast.body.length  ||
+      'ExpressionStatement' !== ast.body[0].type ||
+      'FunctionExpression'  !== ast.body[0].expression.type) {
+    throw new Error('Failed to resolve function');
+  }
+
+  ast.body[0].expression.params.forEach(function (param) {
+    params.push(param.name);
+  });
+
+  body = ast.body[0].expression.body.range;
+
+  // Esprima's ranges include the first '{' and the last '}' characters on
+  // function expressions. So cut them out.
+  return new Function(params, source.slice(body[0]+1, body[1]-1));
+}
+
+function representJavascriptFunction(object /*, style*/) {
+  return object.toString();
+}
+
+function isFunction(object) {
+  return '[object Function]' === Object.prototype.toString.call(object);
+}
+
+module.exports = new Type('tag:yaml.org,2002:js/function', {
+  kind: 'scalar',
+  resolve: resolveJavascriptFunction,
+  construct: constructJavascriptFunction,
+  predicate: isFunction,
+  represent: representJavascriptFunction
+});
+
+},{"../../type":13,"esprima":"esprima"}],19:[function(require,module,exports){
+'use strict';
+
+var Type = require('../../type');
+
+function resolveJavascriptRegExp(data) {
+  if (null === data) {
+    return false;
+  }
+
+  if (0 === data.length) {
+    return false;
+  }
+
+  var regexp = data,
+      tail   = /\/([gim]*)$/.exec(data),
+      modifiers = '';
+
+  // if regexp starts with '/' it can have modifiers and must be properly closed
+  // `/foo/gim` - modifiers tail can be maximum 3 chars
+  if ('/' === regexp[0]) {
+    if (tail) {
+      modifiers = tail[1];
+    }
+
+    if (modifiers.length > 3) { return false; }
+    // if expression starts with /, is should be properly terminated
+    if (regexp[regexp.length - modifiers.length - 1] !== '/') { return false; }
+
+    regexp = regexp.slice(1, regexp.length - modifiers.length - 1);
+  }
+
+  try {
+    var dummy = new RegExp(regexp, modifiers);
+    return true;
+  } catch (error) {
+    return false;
+  }
+}
+
+function constructJavascriptRegExp(data) {
+  var regexp = data,
+      tail   = /\/([gim]*)$/.exec(data),
+      modifiers = '';
+
+  // `/foo/gim` - tail can be maximum 4 chars
+  if ('/' === regexp[0]) {
+    if (tail) {
+      modifiers = tail[1];
+    }
+    regexp = regexp.slice(1, regexp.length - modifiers.length - 1);
+  }
+
+  return new RegExp(regexp, modifiers);
+}
+
+function representJavascriptRegExp(object /*, style*/) {
+  var result = '/' + object.source + '/';
+
+  if (object.global) {
+    result += 'g';
+  }
+
+  if (object.multiline) {
+    result += 'm';
+  }
+
+  if (object.ignoreCase) {
+    result += 'i';
+  }
+
+  return result;
+}
+
+function isRegExp(object) {
+  return '[object RegExp]' === Object.prototype.toString.call(object);
+}
+
+module.exports = new Type('tag:yaml.org,2002:js/regexp', {
+  kind: 'scalar',
+  resolve: resolveJavascriptRegExp,
+  construct: constructJavascriptRegExp,
+  predicate

<TRUNCATED>

[47/51] [abbrv] [partial] brooklyn-ui git commit: move subdir from incubator up a level as it is promoted to its own repo (first non-incubator commit!)

Posted by he...@apache.org.
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/css/brooklyn.css
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/css/brooklyn.css b/brooklyn-ui/src/main/webapp/assets/css/brooklyn.css
deleted file mode 100644
index fde2a3c..0000000
--- a/brooklyn-ui/src/main/webapp/assets/css/brooklyn.css
+++ /dev/null
@@ -1,271 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-/* KROME STYLES */
-BODY {
-    background-color: #e8e8e8 !important;
-    color: #505050 !important;
-}
-
-textarea {
-    white-space: pre;
-    word-wrap: normal;
-    overflow-x: scroll;
-}
-
-/* HEADER  */
-.logo {
-    height: 44px !important;
-    width: 195px !important;
-    background: url(../images/brooklyn-logo.png) no-repeat;
-    margin-top: 50px;
-    margin-left: 40px;
-}
-
-.navbar-inner {
-    min-height: 105px !important;
-    border-bottom: 2px solid #a9a9a9;
-    background: #383737 url(../images/brooklyn-header-background.png)
-        repeat-x top;
-}
-
-.menubar-top {
-    padding-right: 0px !important
-}
-
-.userName-top {
-    display: inline-block;
-    vertical-align: bottom;
-    float: right;
-    text-align: bottom;
-    font-weight:bold;
-    font-size:15px;
-    padding: 75px 10px 0 0;
-}
-
-.navbar .nav {
-    margin-right: 0px !important;
-}
-
-.navbar .nav>li {
-    margin: 35px 0px 0px 3px !important;
-}
-
-.navbar .nav>li>a {
-    border: 1px solid #151515;
-    padding: 8px 11px !important;
-    font-size: 15px !important;
-    background: url(../images/main-menu-tab.png) top !important;
-}
-
-.navbar .nav>li>a.active {
-    background: url(../images/main-menu-tab-active.png) top !important;
-    margin-top: 3px !important
-}
-
-.navbar .nav>li>a:hover {
-    color: #FFF !important;
-    background: url(../images/main-menu-tab-hover.png) top !important;
-}
-
-.table-bordered thead:first-child tr:first-child th:first-child,.table-bordered tbody:first-child tr:first-child td:first-child
-    {
-    -webkit-border-top-left-radius: 13px !important;
-    -moz-border-top-left-radius: 13px !important;
-    border-top-left-radius: 13px !important;
-    background-color: #f7f7f7 !important;
-}
-
-.table-bordered thead:first-child tr:first-child th:last-child,.table-bordered tbody:first-child tr:first-child td:last-child
-    {
-    -webkit-border-top-right-radius: 13px !important;
-    -moz-border-top-right-radius: 13px !important;
-    border-top-right-radius: 13px !important;
-    background-color: #f7f7f7 !important;
-}
-
-.table-condensed th {
-    background-color: #f7f7f7;
-    padding: 8px;
-}
-
-.table-bordered tr td {
-    background-color: #f7f7f7;
-    padding: 8px;
-}
-
-.table-bordered thead:last-child tr:last-child th:first-child,.table-bordered tbody:last-child tr:last-child td:first-child
-    {
-    -webkit-border-top-right-radius: 0 0 0 13px !important;
-    -moz-border-top-right-radius: 0 0 0 13px !important;
-    border-bottom-left-radius: 13px;
-}
-
-.table-bordered thead:last-child tr:last-child th:last-child,.table-bordered tbody:last-child tr:last-child td:last-child
-    {
-    -webkit-border-top-right-radius: 0 0 13px 0 !important;
-    -moz-border-top-right-radius: 0 0 13px 0 !important;
-    border-bottom-right-radius: 13px;
-}
-/*HOME BODY */
-
-/*APP PAGE*/
-.row-fluid .span4 {
-    width: 300px !important;
-    margin-left: 34px !important;
-    margin-top: 10px !important
-}
-
-.row-fluid .span8 {
-    width: 618px !important;
-    margin-right: -26px !important;
-    margin-top: 10px !important
-}
-
-.navbar_top {
-    background-color: #f0f0f0 !important;
-    -webkit-border-radius: 13px 13px 0 0 !important;
-    -moz-border-radius: 13px 13px 0 0 !important;
-    border-radius: 13px 13px 0 0 !important;
-    border: 1px solid #d3d3d3;
-    border-bottom: none;
-}
-
-.navbar_top  h3 {
-    line-height: 24px !important;
-}
-
-.navbar_main_wrapper {
-    background-color: #ffffff !important;
-    -webkit-border-radius: 0 0 13px 13px !important;
-    -moz-border-radius: 0 0 13px 13px !important;
-    border-radius: 0 0 13px 13px !important;
-    border: 1px solid #d3d3d3;
-    border-top: 4px solid #e2e2e2;
-}
-
-.apps-tree-toolbar {
-    float: right;
-    margin: 0px !important;
-    margin-top: -18px !important;
-}
-
-.icon-br-plus-sign {
-    background: url(../images/application-icon-add.png) top left !important;
-    width: 15px !important;
-    height: 15px !important;
-}
-
-.icon-br-plus-sign:hover {
-    background: url(../images/application-icon-add-hover.png) top left
-        !important;
-}
-
-.icon-br-refresh {
-    background: url(../images/application-icon-refresh.png) top left
-        !important;
-    width: 15px !important;
-    height: 15px !important;
-}
-.icon-br-refresh:hover {
-    background: url(../images/application-icon-refresh-hover.png) top left
-        !important;
-}
-
-.table-toolbar-icon:hover {
-    opacity: .7;
-}
-
-#details {
-    background-color: #f0f0f0 !important;
-    -webkit-border-radius: 13px 13px 13px 13px !important;
-    -moz-border-radius: 13px 13px 13px 13px !important;
-    border-radius: 13px 13px 13px 13px !important;
-    border: 1px solid #d3d3d3;
-    padding-top: 9px;
-}
-
-.tab-content {
-    background-color: #ffffff !important;
-    border: none !important;
-    -webkit-border-radius: 0 0 13px 13px !important;
-    -moz-border-radius: 0 0 13px 13px !important;
-    border-radius: 0 0 13px 13px !important;
-}
-
-.nav-tabs {
-    border-bottom: 4px solid #e2e2e2 !important;
-}
-
-.nav-tabs>.active>a,.nav-tabs>.active {
-    color: #549e2b;
-}
-
-.nav-tabs>.active>a,.nav-tabs>.active a {
-    background: #ffffff !important;
-}
-
-.nav-tabs .dropdown-menu li > a:hover,
-.nav-tabs .dropdown-menu .active > a,
-.nav-tabs .dropdown-menu .active > a:hover {
-    color: white;
-    background-color: #549e2b !important;
-}
-
-.nav-tabs>li>a {
-    color: #444444 !important;
-    border: 1px solid #dddddd !important;
-    background: #ffffff url(../images/nav-tabs-background.png) top
-        !important;
-    padding-bottom: 7px !important;
-    padding-top: 9px !important;
-}
-
-.nav-tabs>li>a:hover {
-    color: #549e2b !important;
-    background: #ffffff none !important;
-}
-.nav-tabs .dropdown-toggle .caret, .nav-pills .dropdown-toggle .caret {
-    opacity: 0.5;
-    margin-top: 6px;
-    border-top-color: #000;
-    border-bottom-color: #000;
-}
-.nav-tabs .dropdown-toggle:hover .caret, .nav-pills .dropdown-toggle:hover .caret {
-    opacity: 0.8;
-    border-top-color: #549e2b;
-    border-bottom-color: #549e2b;
-}
-
-#advanced-summary button.btn {
-    margin-left: 6px;
-}
-/*APP PAGE*/
-
-/* END KROME STYLES */
-
-.view_not_available {
-    /*
-    // nothing yet; idea is to put CSS here which will show a 'Not Available' message.
-    // but it is hard to position it without assuming or introducing position-absolute on the parent.
-    // probably need to mess with the hierarchy, or make such an assumption.
-    // also there is the issue the (currently) the parent view has had opacity set to 0.2.
-    // used in viewutils.js fade/cancelFade methods (and should be only those!)
-    content: 'Not Available';
-    */
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/css/jquery.dataTables.css
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/css/jquery.dataTables.css b/brooklyn-ui/src/main/webapp/assets/css/jquery.dataTables.css
deleted file mode 100644
index 3197c7c..0000000
--- a/brooklyn-ui/src/main/webapp/assets/css/jquery.dataTables.css
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-
-/*
- * Table
- */
-table.dataTable {
-    margin: 0 auto;
-    clear: both;
-    width: 100%;
-}
-
-table.dataTable thead th {
-    padding: 3px 18px 3px 10px;
-    border-bottom: 1px solid black;
-    font-weight: bold;
-    cursor: pointer;
-    *cursor: hand;
-}
-
-table.dataTable tfoot th {
-    padding: 3px 18px 3px 10px;
-    border-top: 1px solid black;
-    font-weight: bold;
-}
-
-table.dataTable td {
-    padding: 3px 10px;
-}
-
-table.dataTable td.center,
-table.dataTable td.dataTables_empty {
-    text-align: center;
-}
-
-table.dataTable tr.odd { background-color: #E2E4FF; }
-table.dataTable tr.even { background-color: white; }
-
-table.dataTable tr.odd td.sorting_1 { background-color: #D3D6FF; }
-table.dataTable tr.odd td.sorting_2 { background-color: #DADCFF; }
-table.dataTable tr.odd td.sorting_3 { background-color: #E0E2FF; }
-table.dataTable tr.even td.sorting_1 { background-color: #EAEBFF; }
-table.dataTable tr.even td.sorting_2 { background-color: #F2F3FF; }
-table.dataTable tr.even td.sorting_3 { background-color: #F9F9FF; }
-
-
-/*
- * Table wrapper
- */
-.dataTables_wrapper {
-    position: relative;
-    clear: both;
-    *zoom: 1;
-}
-
-
-/*
- * Page length menu
- */
-.dataTables_length {
-    float: left;
-}
-
-
-/*
- * Filter
- */
-.dataTables_filter {
-    float: right;
-    text-align: right;
-}
-
-
-/*
- * Table information
- */
-.dataTables_info {
-    clear: both;
-    float: left;
-}
-
-
-/*
- * Pagination
- */
-.dataTables_paginate {
-    float: right;
-    text-align: right;
-}
-
-/* Two button pagination - previous / next */
-.paginate_disabled_previous,
-.paginate_enabled_previous,
-.paginate_disabled_next,
-.paginate_enabled_next {
-    height: 19px;
-    float: left;
-    cursor: pointer;
-    *cursor: hand;
-    color: #111 !important;
-}
-.paginate_disabled_previous:hover,
-.paginate_enabled_previous:hover,
-.paginate_disabled_next:hover,
-.paginate_enabled_next:hover {
-    text-decoration: none !important;
-}
-.paginate_disabled_previous:active,
-.paginate_enabled_previous:active,
-.paginate_disabled_next:active,
-.paginate_enabled_next:active {
-    outline: none;
-}
-
-.paginate_disabled_previous,
-.paginate_disabled_next {
-    color: #666 !important;
-}
-.paginate_disabled_previous,
-.paginate_enabled_previous {
-    padding-left: 23px;
-}
-.paginate_disabled_next,
-.paginate_enabled_next {
-    padding-right: 23px;
-    margin-left: 10px;
-}
-
-.paginate_enabled_previous { background: url('../images/back_enabled.png') no-repeat top left; }
-.paginate_enabled_previous:hover { background: url('../images/back_enabled_hover.png') no-repeat top left; }
-.paginate_disabled_previous { background: url('../images/back_disabled.png') no-repeat top left; }
-
-.paginate_enabled_next { background: url('../images/forward_enabled.png') no-repeat top right; }
-.paginate_enabled_next:hover { background: url('../images/forward_enabled_hover.png') no-repeat top right; }
-.paginate_disabled_next { background: url('../images/forward_disabled.png') no-repeat top right; }
-
-/* Full number pagination */
-.paging_full_numbers {
-    height: 22px;
-    line-height: 22px;
-}
-.paging_full_numbers a:active {
-    outline: none
-}
-.paging_full_numbers a:hover {
-    text-decoration: none;
-}
-
-.paging_full_numbers a.paginate_button,
-.paging_full_numbers a.paginate_active {
-    border: 1px solid #aaa;
-    -webkit-border-radius: 5px;
-    -moz-border-radius: 5px;
-    border-radius: 5px;
-    padding: 2px 5px;
-    margin: 0 3px;
-    cursor: pointer;
-    *cursor: hand;
-    color: #333 !important;
-}
-
-.paging_full_numbers a.paginate_button {
-    background-color: #ddd;
-}
-
-.paging_full_numbers a.paginate_button:hover {
-    background-color: #ccc;
-    text-decoration: none !important;
-}
-
-.paging_full_numbers a.paginate_active {
-    background-color: #99B3FF;
-}
-
-
-/*
- * Processing indicator
- */
-.dataTables_processing {
-    position: absolute;
-    top: 50%;
-    left: 50%;
-    width: 250px;
-    height: 30px;
-    margin-left: -125px;
-    margin-top: -15px;
-    padding: 14px 0 2px 0;
-    border: 1px solid #ddd;
-    text-align: center;
-    color: #999;
-    font-size: 14px;
-    background-color: white;
-}
-
-
-/*
- * Sorting
- */
-.sorting { background: url('../images/sort_both.png') no-repeat center right; }
-.sorting_asc { background: url('../images/sort_asc.png') no-repeat center right; }
-.sorting_desc { background: url('../images/sort_desc.png') no-repeat center right; }
-
-.sorting_asc_disabled { background: url('../images/sort_asc_disabled.png') no-repeat center right; }
-.sorting_desc_disabled { background: url('../images/sort_desc_disabled.png') no-repeat center right; }
- 
-table.dataTable th:active {
-    outline: none;
-}
-
-
-/*
- * Scrolling
- */
-.dataTables_scroll {
-    clear: both;
-}
-
-.dataTables_scrollBody {
-    *margin-top: -1px;
-    -webkit-overflow-scrolling: touch;
-}
-

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/css/styles.css
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/css/styles.css b/brooklyn-ui/src/main/webapp/assets/css/styles.css
deleted file mode 100644
index bfb5b40..0000000
--- a/brooklyn-ui/src/main/webapp/assets/css/styles.css
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-@import url('bootstrap.css');
-@import url('jquery.dataTables.css');
-@import url('base.css');
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/css/swagger.css
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/css/swagger.css b/brooklyn-ui/src/main/webapp/assets/css/swagger.css
deleted file mode 100644
index b344d70..0000000
--- a/brooklyn-ui/src/main/webapp/assets/css/swagger.css
+++ /dev/null
@@ -1,1567 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-/* BROOKLYN removed
-
-html, body, div, span, applet, object, iframe,
-h1, h2, h3, h4, h5, h6, p, blockquote, pre,
-a, abbr, acronym, address, big, cite, code,
-del, dfn, em, img, ins, kbd, q, s, samp,
-small, strike, strong, sub, sup, tt, var,
-b, u, i, center,
-dl, dt, dd, ol, ul, li,
-fieldset, form, label, legend,
-table, caption, tbody, tfoot, thead, tr, th, td,
-article, aside, canvas, details, embed,
-figure, figcaption, footer, header, hgroup,
-menu, nav, output, ruby, section, summary,
-time, mark, audio, video {
-    margin: 0;
-    padding: 0;
-    border: 0;
-    font-size: 100%;
-    vertical-align: baseline;
-}
-
-body {
-    line-height: 1;
-}
-
- */
- 
-ol, ul {
-    list-style: none;
-}
-
-table {
-    border-collapse: collapse;
-    border-spacing: 0;
-}
-
-caption, th, td {
-    text-align: left;
-    font-weight: normal;
-    vertical-align: middle;
-}
-
-q, blockquote {
-    quotes: none;
-}
-
-q:before, q:after, blockquote:before, blockquote:after {
-    content: "";
-    content: none;
-}
-
-a img {
-    border: none;
-}
-
-article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section, summary {
-    display: block;
-}
-
-h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
-    text-decoration: none;
-}
-
-h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover, h5 a:hover, h6 a:hover {
-    text-decoration: underline;
-}
-
-h1 span.divider, h2 span.divider, h3 span.divider, h4 span.divider, h5 span.divider, h6 span.divider {
-    color: #aaaaaa;
-}
-
-h1 {
-    color: #547f00;
-    color: black;
-    font-size: 1.5em;
-    line-height: 1.3em;
-    padding: 10px 0 10px 0;
-/*    font-family: "Droid Sans", sans-serif; */
-    font-weight: bold;
-}
-
-h2 {
-    color: #89bf04;
-    color: black;
-    font-size: 1.3em;
-/*    padding: 10px 0 10px 0; */
-}
-
-h2 a {
-    color: black;
-}
-
-h2 span.sub {
-    font-size: 0.7em;
-    color: #999999;
-    font-style: italic;
-}
-
-h2 span.sub a {
-    color: #777777;
-}
-
-h3 {
-    color: black;
-    font-size: 1.1em;
-    padding: 10px 0 10px 0;
-}
-
-div.heading_with_menu {
-    float: none;
-    clear: both;
-    overflow: hidden;
-    display: block;
-}
-
-div.heading_with_menu h1, div.heading_with_menu h2, div.heading_with_menu h3, div.heading_with_menu h4, div.heading_with_menu h5, div.heading_with_menu h6 {
-    display: block;
-    clear: none;
-    float: left;
-    -moz-box-sizing: border-box;
-    -webkit-box-sizing: border-box;
-    -ms-box-sizing: border-box;
-    box-sizing: border-box;
-    width: 60%;
-}
-
-div.heading_with_menu ul {
-    display: block;
-    clear: none;
-    float: right;
-    -moz-box-sizing: border-box;
-    -webkit-box-sizing: border-box;
-    -ms-box-sizing: border-box;
-    box-sizing: border-box;
-    margin-top: 10px;
-}
-
-.body-textarea {
-    width: 300px;
-    height: 100px;
-}
-
-p {
-    line-height: 1.4em;
-    padding: 0 0 10px 0;
-    color: #333333;
-}
-
-ol {
-    margin: 0px 0 10px 0;
-    padding: 0 0 0 18px;
-    list-style-type: decimal;
-}
-
-ol li {
-    padding: 5px 0px;
-    font-size: 0.9em;
-    color: #333333;
-}
-
-.markdown h3 {
-    color: #547f00;
-}
-
-.markdown h4 {
-    color: #666666;
-}
-
-.markdown pre {
-    font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
-    background-color: #fcf6db;
-    border: 1px solid black;
-    border-color: #e5e0c6;
-    padding: 10px;
-    margin: 0 0 10px 0;
-}
-
-.markdown pre code {
-    line-height: 1.6em;
-}
-
-.markdown p code, .markdown li code {
-    font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
-    background-color: #f0f0f0;
-    color: black;
-    padding: 1px 3px;
-}
-
-.markdown ol, .markdown ul {
-/*    font-family: "Droid Sans", sans-serif; */
-    margin: 5px 0 10px 0;
-    padding: 0 0 0 18px;
-    list-style-type: disc;
-}
-
-.markdown ol li, .markdown ul li {
-    padding: 3px 0px;
-    line-height: 1.4em;
-    color: #333333;
-}
-
-div.gist {
-    margin: 20px 0 25px 0 !important;
-}
-
-p.big, div.big p {
-    font-size: 1em;
-    margin-bottom: 10px;
-}
-
-span.weak {
-    color: #666666;
-}
-
-span.blank, span.empty {
-    color: #888888;
-    font-style: italic;
-}
-
-a {
-    color: #547f00;
-}
-
-strong {
-/*    font-family: "Droid Sans", sans-serif; */
-    font-weight: bold;
-}
-
-.code {
-    font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
-}
-
-pre {
-    font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
-    background-color: #fcf6db;
-    border: 1px solid black;
-    border-color: #e5e0c6;
-    padding: 10px;
-    /* white-space: pre-line */
-}
-
-pre code {
-    line-height: 1.6em;
-}
-
-.required {
-    font-weight: bold;
-}
-
-table.fullwidth {
-    width: 100%;
-}
-
-table thead tr th {
-    padding: 5px;
-    font-size: 0.9em;
-    color: #666666;
-    border-bottom: 1px solid #999999;
-}
-
-table tbody tr.offset {
-    background-color: #f5f5f5;
-}
-
-table tbody tr td {
-    padding: 6px;
-    font-size: 0.9em;
-    border-bottom: 1px solid #cccccc;
-    vertical-align: top;
-    line-height: 1.3em;
-}
-
-table tbody tr:last-child td {
-    border-bottom: none;
-}
-
-table tbody tr.offset {
-    background-color: #f0f0f0;
-}
-
-form.form_box {
-    background-color: #ebf3f9;
-    border: 1px solid black;
-    border-color: #c3d9ec;
-    padding: 10px;
-}
-
-form.form_box label {
-    color: #0f6ab4 !important;
-}
-
-form.form_box input[type=submit] {
-    display: block;
-    padding: 10px;
-}
-
-form.form_box p {
-    font-size: 0.9em;
-    padding: 0 0 15px 0;
-    color: #7e7b6d;
-}
-
-form.form_box p a {
-    color: #646257;
-}
-
-form.form_box p strong {
-    color: black;
-}
-
-form.form_box p.weak {
-    font-size: 0.8em;
-}
-
-form.formtastic fieldset.inputs ol li p.inline-hints {
-    margin-left: 0;
-    font-style: italic;
-    font-size: 0.9em;
-    margin: 0;
-}
-
-form.formtastic fieldset.inputs ol li label {
-    display: block;
-    clear: both;
-    width: auto;
-    padding: 0 0 3px 0;
-    color: #666666;
-}
-
-form.formtastic fieldset.inputs ol li label abbr {
-    padding-left: 3px;
-    color: #888888;
-}
-
-form.formtastic fieldset.inputs ol li.required label {
-    color: black;
-}
-
-form.formtastic fieldset.inputs ol li.string input, form.formtastic fieldset.inputs ol li.url input, form.formtastic fieldset.inputs ol li.numeric input {
-    display: block;
-    padding: 4px;
-    width: auto;
-    clear: both;
-}
-
-form.formtastic fieldset.inputs ol li.string input.title, form.formtastic fieldset.inputs ol li.url input.title, form.formtastic fieldset.inputs ol li.numeric input.title {
-    font-size: 1.3em;
-}
-
-form.formtastic fieldset.inputs ol li.text textarea {
-/*    font-family: "Droid Sans", sans-serif; */
-    height: 250px;
-    padding: 4px;
-    display: block;
-    clear: both;
-}
-
-form.formtastic fieldset.inputs ol li.select select {
-    display: block;
-    clear: both;
-}
-
-form.formtastic fieldset.inputs ol li.boolean {
-    float: none;
-    clear: both;
-    overflow: hidden;
-    display: block;
-}
-
-form.formtastic fieldset.inputs ol li.boolean input {
-    display: block;
-    float: left;
-    clear: none;
-    margin: 0 5px 0 0;
-}
-
-form.formtastic fieldset.inputs ol li.boolean label {
-    display: block;
-    float: left;
-    clear: none;
-    margin: 0;
-    padding: 0;
-}
-
-form.formtastic fieldset.buttons {
-    margin: 0;
-    padding: 0;
-}
-
-form.fullwidth ol li.string input, form.fullwidth ol li.url input, form.fullwidth ol li.text textarea, form.fullwidth ol li.numeric input {
-    width: 500px !important;
-}
-
-body {
-/*    font-family: "Droid Sans", sans-serif; */
-}
-
-body #content_message {
-    margin: 10px 15px;
-    font-style: italic;
-    color: #999999;
-}
-
-body #header {
-    background-color: #89bf04;
-    padding: 14px;
-}
-
-body #header a#logo {
-    font-size: 1.5em;
-    font-weight: bold;
-    text-decoration: none;
-    background: transparent url(../images/logo_small.png) no-repeat left center;
-    padding: 20px 0 20px 40px;
-    color: white;
-}
-
-body #header form#api_selector {
-    display: block;
-    clear: none;
-    float: right;
-}
-
-body #header form#api_selector .input {
-    display: block;
-    clear: none;
-    float: left;
-    margin: 0 10px 0 0;
-}
-
-body #header form#api_selector .input input {
-    font-size: 0.9em;
-    padding: 3px;
-    margin: 0;
-}
-
-body #header form#api_selector .input input#input_baseUrl {
-    width: 400px;
-}
-
-body #header form#api_selector .input input#input_apiKey {
-    width: 200px;
-}
-
-body #header form#api_selector .input a#explore {
-    display: block;
-    text-decoration: none;
-    font-weight: bold;
-    padding: 6px 8px;
-    font-size: 0.9em;
-    color: white;
-    background-color: #547f00;
-    -moz-border-radius: 4px;
-    -webkit-border-radius: 4px;
-    -o-border-radius: 4px;
-    -ms-border-radius: 4px;
-    -khtml-border-radius: 4px;
-    border-radius: 4px;
-}
-
-body #header form#api_selector .input a#explore:hover {
-    background-color: #547f00;
-}
-
-body p#colophon {
-    margin: 0 15px 40px 15px;
-    padding: 10px 0;
-    font-size: 0.8em;
-    border-top: 1px solid #dddddd;
-/*    font-family: "Droid Sans", sans-serif; */
-    color: #999999;
-    font-style: italic;
-}
-
-body p#colophon a {
-    text-decoration: none;
-    color: #547f00;
-}
-
-body ul#resources {
-/*    font-family: "Droid Sans", sans-serif; */
-    font-size: 0.9em;
-}
-
-body ul#resources li.resource {
-    border-bottom: 1px solid #dddddd;
-}
-
-body ul#resources li.resource:last-child {
-    border-bottom: none;
-}
-
-body ul#resources li.resource div.heading {
-    border: 1px solid transparent;
-    float: none;
-    clear: both;
-    overflow: hidden;
-    display: block;
-}
-
-body ul#resources li.resource div.heading h2 {
-    color: #999999;
-    padding-left: 0px;
-    display: block;
-    clear: none;
-    float: left;
-/*    font-family: "Droid Sans", sans-serif; */
-    font-weight: bold;
-}
-
-body ul#resources li.resource div.heading h2 a {
-    color: #999999;
-}
-
-body ul#resources li.resource div.heading h2 a:hover {
-    color: black;
-}
-
-body ul#resources li.resource div.heading ul.options {
-    float: none;
-    clear: both;
-    overflow: hidden;
-    margin: 0;
-    padding: 0;
-    display: block;
-    clear: none;
-    float: right;
-    margin: 14px 10px 0 0;
-}
-
-body ul#resources li.resource div.heading ul.options li {
-    float: left;
-    clear: none;
-    margin: 0;
-    padding: 2px 10px;
-    border-right: 1px solid #dddddd;
-}
-
-body ul#resources li.resource div.heading ul.options li:first-child, body ul#resources li.resource div.heading ul.options li.first {
-    padding-left: 0;
-}
-
-body ul#resources li.resource div.heading ul.options li:last-child, body ul#resources li.resource div.heading ul.options li.last {
-    padding-right: 0;
-    border-right: none;
-}
-
-body ul#resources li.resource div.heading ul.options li {
-    color: #666666;
-    font-size: 0.9em;
-}
-
-body ul#resources li.resource div.heading ul.options li a {
-    color: #aaaaaa;
-    text-decoration: none;
-}
-
-body ul#resources li.resource div.heading ul.options li a:hover {
-    text-decoration: underline;
-    color: black;
-}
-
-body ul#resources li.resource:hover div.heading h2 a, body ul#resources li.resource.active div.heading h2 a {
-    color: black;
-}
-
-body ul#resources li.resource:hover div.heading ul.options li a, body ul#resources li.resource.active div.heading ul.options li a {
-    color: #555555;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get {
-    float: none;
-    clear: both;
-    overflow: hidden;
-    display: block;
-    margin: 0 0 10px 0;
-    padding: 0 0 0 0px;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading {
-    float: none;
-    clear: both;
-    overflow: hidden;
-    display: block;
-    margin: 0 0 0 0;
-    padding: 0;
-    background-color: #e7f0f7;
-    border: 1px solid black;
-    border-color: #c3d9ec;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading h3 {
-    display: block;
-    clear: none;
-    float: left;
-    width: auto;
-    margin: 0;
-    padding: 0;
-    line-height: 1.1em;
-    color: black;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading h3 span {
-    margin: 0;
-    padding: 0;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading h3 span.http_method a {
-    text-transform: uppercase;
-    background-color: #0f6ab4;
-    text-decoration: none;
-    color: white;
-    display: inline-block;
-    width: 50px;
-    font-size: 0.7em;
-    text-align: center;
-    padding: 7px 0 4px 0;
-    -moz-border-radius: 2px;
-    -webkit-border-radius: 2px;
-    -o-border-radius: 2px;
-    -ms-border-radius: 2px;
-    -khtml-border-radius: 2px;
-    border-radius: 2px;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading h3 span.path {
-    padding-left: 10px;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading h3 span.path a {
-    color: black;
-    text-decoration: none;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading h3 span.path a:hover {
-    text-decoration: underline;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options {
-    float: none;
-    clear: both;
-    overflow: hidden;
-    margin: 0;
-    padding: 0;
-    display: block;
-    clear: none;
-    float: right;
-    margin: 6px 10px 0 0;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li {
-    float: left;
-    clear: none;
-    margin: 0;
-    padding: 2px 10px;
-    border-right: 1px solid #dddddd;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li:first-child, body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li.first {
-    padding-left: 0;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li:last-child, body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li.last {
-    padding-right: 0;
-    border-right: none;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li {
-    border-right-color: #c3d9ec;
-    color: #0f6ab4;
-    font-size: 0.9em;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li a {
-    color: #0f6ab4;
-    text-decoration: none;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li a:hover, body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li a:active, body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li a.active {
-    text-decoration: underline;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content {
-    background-color: #ebf3f9;
-    border: 1px solid black;
-    border-color: #c3d9ec;
-    border-top: none;
-    padding: 10px;
-    -moz-border-radius-bottomleft: 6px;
-    -webkit-border-bottom-left-radius: 6px;
-    -o-border-bottom-left-radius: 6px;
-    -ms-border-bottom-left-radius: 6px;
-    -khtml-border-bottom-left-radius: 6px;
-    border-bottom-left-radius: 6px;
-    -moz-border-radius-bottomright: 6px;
-    -webkit-border-bottom-right-radius: 6px;
-    -o-border-bottom-right-radius: 6px;
-    -ms-border-bottom-right-radius: 6px;
-    -khtml-border-bottom-right-radius: 6px;
-    border-bottom-right-radius: 6px;
-    margin: 0 0 20px 0;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content h4 {
-    color: #0f6ab4;
-    font-size: 1.1em;
-    margin: 0;
-    padding: 15px 0 5px 0px;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content form input[type='text'].error {
-    outline: 2px solid black;
-    outline-color: #cc0000;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content div.sandbox_header {
-    float: none;
-    clear: both;
-    overflow: hidden;
-    display: block;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content div.sandbox_header input.submit {
-    display: block;
-    clear: none;
-    float: left;
-    padding: 6px 8px;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content div.sandbox_header img {
-    display: block;
-    display: block;
-    clear: none;
-    float: right;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content div.sandbox_header a {
-    padding: 4px 0 0 10px;
-    color: #6fa5d2;
-    display: inline-block;
-    font-size: 0.9em;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content div.response div.block {
-    background-color: #fcf6db;
-    border: 1px solid black;
-    border-color: #e5e0c6;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content div.response div.block pre {
-    font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
-    padding: 10px;
-    font-size: 0.9em;
-    max-height: 400px;
-    overflow-y: auto;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post {
-    float: none;
-    clear: both;
-    overflow: hidden;
-    display: block;
-    margin: 0 0 10px 0;
-    padding: 0 0 0 0px;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading {
-    float: none;
-    clear: both;
-    overflow: hidden;
-    display: block;
-    margin: 0 0 0 0;
-    padding: 0;
-    background-color: #e7f6ec;
-    border: 1px solid black;
-    border-color: #c3e8d1;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading h3 {
-    display: block;
-    clear: none;
-    float: left;
-    width: auto;
-    margin: 0;
-    padding: 0;
-    line-height: 1.1em;
-    color: black;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading h3 span {
-    margin: 0;
-    padding: 0;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading h3 span.http_method a {
-    text-transform: uppercase;
-    background-color: #10a54a;
-    text-decoration: none;
-    color: white;
-    display: inline-block;
-    width: 50px;
-    font-size: 0.7em;
-    text-align: center;
-    padding: 7px 0 4px 0;
-    -moz-border-radius: 2px;
-    -webkit-border-radius: 2px;
-    -o-border-radius: 2px;
-    -ms-border-radius: 2px;
-    -khtml-border-radius: 2px;
-    border-radius: 2px;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading h3 span.path {
-    padding-left: 10px;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading h3 span.path a {
-    color: black;
-    text-decoration: none;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading h3 span.path a:hover {
-    text-decoration: underline;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options {
-    float: none;
-    clear: both;
-    overflow: hidden;
-    margin: 0;
-    padding: 0;
-    display: block;
-    clear: none;
-    float: right;
-    margin: 6px 10px 0 0;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li {
-    float: left;
-    clear: none;
-    margin: 0;
-    padding: 2px 10px;
-    border-right: 1px solid #dddddd;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li:first-child, body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li.first {
-    padding-left: 0;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li:last-child, body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li.last {
-    padding-right: 0;
-    border-right: none;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li {
-    border-right-color: #c3e8d1;
-    color: #10a54a;
-    font-size: 0.9em;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li a {
-    color: #10a54a;
-    text-decoration: none;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li a:hover, body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li a:active, body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li a.active {
-    text-decoration: underline;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content {
-    background-color: #ebf7f0;
-    border: 1px solid black;
-    border-color: #c3e8d1;
-    border-top: none;
-    padding: 10px;
-    -moz-border-radius-bottomleft: 6px;
-    -webkit-border-bottom-left-radius: 6px;
-    -o-border-bottom-left-radius: 6px;
-    -ms-border-bottom-left-radius: 6px;
-    -khtml-border-bottom-left-radius: 6px;
-    border-bottom-left-radius: 6px;
-    -moz-border-radius-bottomright: 6px;
-    -webkit-border-bottom-right-radius: 6px;
-    -o-border-bottom-right-radius: 6px;
-    -ms-border-bottom-right-radius: 6px;
-    -khtml-border-bottom-right-radius: 6px;
-    border-bottom-right-radius: 6px;
-    margin: 0 0 20px 0;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content h4 {
-    color: #10a54a;
-    font-size: 1.1em;
-    margin: 0;
-    padding: 15px 0 5px 0px;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content form input[type='text'].error {
-    outline: 2px solid black;
-    outline-color: #cc0000;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content div.sandbox_header {
-    float: none;
-    clear: both;
-    overflow: hidden;
-    display: block;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content div.sandbox_header input.submit {
-    display: block;
-    clear: none;
-    float: left;
-    padding: 6px 8px;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content div.sandbox_header img {
-    display: block;
-    display: block;
-    clear: none;
-    float: right;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content div.sandbox_header a {
-    padding: 4px 0 0 10px;
-    color: #6fc992;
-    display: inline-block;
-    font-size: 0.9em;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content div.response div.block {
-    background-color: #fcf6db;
-    border: 1px solid black;
-    border-color: #e5e0c6;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content div.response div.block pre {
-    font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
-    padding: 10px;
-    font-size: 0.9em;
-    max-height: 400px;
-    overflow-y: auto;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put {
-    float: none;
-    clear: both;
-    overflow: hidden;
-    display: block;
-    margin: 0 0 10px 0;
-    padding: 0 0 0 0px;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading {
-    float: none;
-    clear: both;
-    overflow: hidden;
-    display: block;
-    margin: 0 0 0 0;
-    padding: 0;
-    background-color: #f9f2e9;
-    border: 1px solid black;
-    border-color: #f0e0ca;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading h3 {
-    display: block;
-    clear: none;
-    float: left;
-    width: auto;
-    margin: 0;
-    padding: 0;
-    line-height: 1.1em;
-    color: black;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading h3 span {
-    margin: 0;
-    padding: 0;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading h3 span.http_method a {
-    text-transform: uppercase;
-    background-color: #c5862b;
-    text-decoration: none;
-    color: white;
-    display: inline-block;
-    width: 50px;
-    font-size: 0.7em;
-    text-align: center;
-    padding: 7px 0 4px 0;
-    -moz-border-radius: 2px;
-    -webkit-border-radius: 2px;
-    -o-border-radius: 2px;
-    -ms-border-radius: 2px;
-    -khtml-border-radius: 2px;
-    border-radius: 2px;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading h3 span.path {
-    padding-left: 10px;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading h3 span.path a {
-    color: black;
-    text-decoration: none;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading h3 span.path a:hover {
-    text-decoration: underline;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options {
-    float: none;
-    clear: both;
-    overflow: hidden;
-    margin: 0;
-    padding: 0;
-    display: block;
-    clear: none;
-    float: right;
-    margin: 6px 10px 0 0;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li {
-    float: left;
-    clear: none;
-    margin: 0;
-    padding: 2px 10px;
-    border-right: 1px solid #dddddd;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li:first-child, body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li.first {
-    padding-left: 0;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li:last-child, body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li.last {
-    padding-right: 0;
-    border-right: none;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li {
-    border-right-color: #f0e0ca;
-    color: #c5862b;
-    font-size: 0.9em;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li a {
-    color: #c5862b;
-    text-decoration: none;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li a:hover, body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li a:active, body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li a.active {
-    text-decoration: underline;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content {
-    background-color: #faf5ee;
-    border: 1px solid black;
-    border-color: #f0e0ca;
-    border-top: none;
-    padding: 10px;
-    -moz-border-radius-bottomleft: 6px;
-    -webkit-border-bottom-left-radius: 6px;
-    -o-border-bottom-left-radius: 6px;
-    -ms-border-bottom-left-radius: 6px;
-    -khtml-border-bottom-left-radius: 6px;
-    border-bottom-left-radius: 6px;
-    -moz-border-radius-bottomright: 6px;
-    -webkit-border-bottom-right-radius: 6px;
-    -o-border-bottom-right-radius: 6px;
-    -ms-border-bottom-right-radius: 6px;
-    -khtml-border-bottom-right-radius: 6px;
-    border-bottom-right-radius: 6px;
-    margin: 0 0 20px 0;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content h4 {
-    color: #c5862b;
-    font-size: 1.1em;
-    margin: 0;
-    padding: 15px 0 5px 0px;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content form input[type='text'].error {
-    outline: 2px solid black;
-    outline-color: #cc0000;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content div.sandbox_header {
-    float: none;
-    clear: both;
-    overflow: hidden;
-    display: block;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content div.sandbox_header input.submit {
-    display: block;
-    clear: none;
-    float: left;
-    padding: 6px 8px;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content div.sandbox_header img {
-    display: block;
-    display: block;
-    clear: none;
-    float: right;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content div.sandbox_header a {
-    padding: 4px 0 0 10px;
-    color: #dcb67f;
-    display: inline-block;
-    font-size: 0.9em;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content div.response div.block {
-    background-color: #fcf6db;
-    border: 1px solid black;
-    border-color: #e5e0c6;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content div.response div.block pre {
-    font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
-    padding: 10px;
-    font-size: 0.9em;
-    max-height: 400px;
-    overflow-y: auto;
-}
-
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch {
-    float: none;
-    clear: both;
-    overflow: hidden;
-    display: block;
-    margin: 0 0 10px 0;
-    padding: 0 0 0 0px;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading {
-    float: none;
-    clear: both;
-    overflow: hidden;
-    display: block;
-    margin: 0 0 0 0;
-    padding: 0;
-    background-color: #faebf2;
-    border: 1px solid black;
-    border-color: #f0cecb;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading h3 {
-    display: block;
-    clear: none;
-    float: left;
-    width: auto;
-    margin: 0;
-    padding: 0;
-    line-height: 1.1em;
-    color: black;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading h3 span {
-    margin: 0;
-    padding: 0;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading h3 span.http_method a {
-    text-transform: uppercase;
-    background-color: #993300;
-    text-decoration: none;
-    color: white;
-    display: inline-block;
-    width: 50px;
-    font-size: 0.7em;
-    text-align: center;
-    padding: 7px 0 4px 0;
-    -moz-border-radius: 2px;
-    -webkit-border-radius: 2px;
-    -o-border-radius: 2px;
-    -ms-border-radius: 2px;
-    -khtml-border-radius: 2px;
-    border-radius: 2px;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading h3 span.path {
-    padding-left: 10px;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading h3 span.path a {
-    color: black;
-    text-decoration: none;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading h3 span.path a:hover {
-    text-decoration: underline;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options {
-    float: none;
-    clear: both;
-    overflow: hidden;
-    margin: 0;
-    padding: 0;
-    display: block;
-    clear: none;
-    float: right;
-    margin: 6px 10px 0 0;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li {
-    float: left;
-    clear: none;
-    margin: 0;
-    padding: 2px 10px;
-    border-right: 1px solid #dddddd;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li:first-child, body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li.first {
-    padding-left: 0;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li:last-child, body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li.last {
-    padding-right: 0;
-    border-right: none;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li {
-    border-right-color: #f0cecb;
-    color: #993300;
-    font-size: 0.9em;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li a {
-    color: #993300;
-    text-decoration: none;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li a:hover, body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li a:active, body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li a.active {
-    text-decoration: underline;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content {
-    background-color: #faf0ef;
-    border: 1px solid black;
-    border-color: #f0cecb;
-    border-top: none;
-    padding: 10px;
-    -moz-border-radius-bottomleft: 6px;
-    -webkit-border-bottom-left-radius: 6px;
-    -o-border-bottom-left-radius: 6px;
-    -ms-border-bottom-left-radius: 6px;
-    -khtml-border-bottom-left-radius: 6px;
-    border-bottom-left-radius: 6px;
-    -moz-border-radius-bottomright: 6px;
-    -webkit-border-bottom-right-radius: 6px;
-    -o-border-bottom-right-radius: 6px;
-    -ms-border-bottom-right-radius: 6px;
-    -khtml-border-bottom-right-radius: 6px;
-    border-bottom-right-radius: 6px;
-    margin: 0 0 20px 0;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content h4 {
-    color: #993300;
-    font-size: 1.1em;
-    margin: 0;
-    padding: 15px 0 5px 0px;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content form input[type='text'].error {
-    outline: 2px solid black;
-    outline-color: #cc0000;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content div.sandbox_header {
-    float: none;
-    clear: both;
-    overflow: hidden;
-    display: block;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content div.sandbox_header input.submit {
-    display: block;
-    clear: none;
-    float: left;
-    padding: 6px 8px;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content div.sandbox_header img {
-    display: block;
-    display: block;
-    clear: none;
-    float: right;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content div.sandbox_header a {
-    padding: 4px 0 0 10px;
-    color: #dcb67f;
-    display: inline-block;
-    font-size: 0.9em;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content div.response div.block {
-    background-color: #fcf6db;
-    border: 1px solid black;
-    border-color: #e5e0c6;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content div.response div.block pre {
-    font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
-    padding: 10px;
-    font-size: 0.9em;
-    max-height: 400px;
-    overflow-y: auto;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete {
-    float: none;
-    clear: both;
-    overflow: hidden;
-    display: block;
-    margin: 0 0 10px 0;
-    padding: 0 0 0 0px;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading {
-    float: none;
-    clear: both;
-    overflow: hidden;
-    display: block;
-    margin: 0 0 0 0;
-    padding: 0;
-    background-color: #f5e8e8;
-    border: 1px solid black;
-    border-color: #e8c6c7;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading h3 {
-    display: block;
-    clear: none;
-    float: left;
-    width: auto;
-    margin: 0;
-    padding: 0;
-    line-height: 1.1em;
-    color: black;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading h3 span {
-    margin: 0;
-    padding: 0;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading h3 span.http_method a {
-    text-transform: uppercase;
-    background-color: #a41e22;
-    text-decoration: none;
-    color: white;
-    display: inline-block;
-    width: 50px;
-    font-size: 0.7em;
-    text-align: center;
-    padding: 7px 0 4px 0;
-    -moz-border-radius: 2px;
-    -webkit-border-radius: 2px;
-    -o-border-radius: 2px;
-    -ms-border-radius: 2px;
-    -khtml-border-radius: 2px;
-    border-radius: 2px;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading h3 span.path {
-    padding-left: 10px;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading h3 span.path a {
-    color: black;
-    text-decoration: none;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading h3 span.path a:hover {
-    text-decoration: underline;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options {
-    float: none;
-    clear: both;
-    overflow: hidden;
-    margin: 0;
-    padding: 0;
-    display: block;
-    clear: none;
-    float: right;
-    margin: 6px 10px 0 0;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li {
-    float: left;
-    clear: none;
-    margin: 0;
-    padding: 2px 10px;
-    border-right: 1px solid #dddddd;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li:first-child, body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li.first {
-    padding-left: 0;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li:last-child, body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li.last {
-    padding-right: 0;
-    border-right: none;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li {
-    border-right-color: #e8c6c7;
-    color: #a41e22;
-    font-size: 0.9em;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li a {
-    color: #a41e22;
-    text-decoration: none;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li a:hover, body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li a:active, body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li a.active {
-    text-decoration: underline;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content {
-    background-color: #f7eded;
-    border: 1px solid black;
-    border-color: #e8c6c7;
-    border-top: none;
-    padding: 10px;
-    -moz-border-radius-bottomleft: 6px;
-    -webkit-border-bottom-left-radius: 6px;
-    -o-border-bottom-left-radius: 6px;
-    -ms-border-bottom-left-radius: 6px;
-    -khtml-border-bottom-left-radius: 6px;
-    border-bottom-left-radius: 6px;
-    -moz-border-radius-bottomright: 6px;
-    -webkit-border-bottom-right-radius: 6px;
-    -o-border-bottom-right-radius: 6px;
-    -ms-border-bottom-right-radius: 6px;
-    -khtml-border-bottom-right-radius: 6px;
-    border-bottom-right-radius: 6px;
-    margin: 0 0 20px 0;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content h4 {
-    color: #a41e22;
-    font-size: 1.1em;
-    margin: 0;
-    padding: 15px 0 5px 0px;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content form input[type='text'].error {
-    outline: 2px solid black;
-    outline-color: #cc0000;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content div.sandbox_header {
-    float: none;
-    clear: both;
-    overflow: hidden;
-    display: block;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content div.sandbox_header input.submit {
-    display: block;
-    clear: none;
-    float: left;
-    padding: 6px 8px;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content div.sandbox_header img {
-    display: block;
-    display: block;
-    clear: none;
-    float: right;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content div.sandbox_header a {
-    padding: 4px 0 0 10px;
-    color: #c8787a;
-    display: inline-block;
-    font-size: 0.9em;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content div.response div.block {
-    background-color: #fcf6db;
-    border: 1px solid black;
-    border-color: #e5e0c6;
-}
-
-body ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content div.response div.block pre {
-    font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
-    padding: 10px;
-    font-size: 0.9em;
-    max-height: 400px;
-    overflow-y: auto;
-}
-
-
-.model-signature {
-/*    font-family: "Droid Sans", sans-serif; */
-    font-size: 1em;
-    line-height: 1.5em;
-}
-.model-signature span {
-    font-size: 0.9em;
-    line-height: 1.5em;
-}
-.model-signature span:nth-child(odd)    { color:#333; }
-.model-signature span:nth-child(even)    { color:#C5862B; }
-
-/* BROOKLYN removed 
-#message-bar {
-    margin-top: 45px;
-}
- */
- 
-a {
-    cursor: hand; cursor: pointer;
-}
-
-
-/** BROOKLYN added
-*/
-div#message-bar {
-    text-align: left;
-    margin-top: 12px;
-    margin-bottom: 12px;
-}
-div.apidoc-title {
-    font-weight: bold;
-    padding-left: 24px;
-    font-size: 1.8em;
-    color: #668866;
-    padding-top: 24px;
-    padding-bottom: 24px;
-}
-form.sandbox > table {
-    margin-bottom: 30px;
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/html/swagger-ui.html
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/html/swagger-ui.html b/brooklyn-ui/src/main/webapp/assets/html/swagger-ui.html
deleted file mode 100644
index 499c855..0000000
--- a/brooklyn-ui/src/main/webapp/assets/html/swagger-ui.html
+++ /dev/null
@@ -1,78 +0,0 @@
-<!DOCTYPE html>
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing,
-  software distributed under the License is distributed on an
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  KIND, either express or implied.  See the License for the
-  specific language governing permissions and limitations
-  under the License.
-  -->
-<!-- Brooklyn SHA-1: GIT_SHA_1 -->
-<html>
-<head>
-    <meta charset="UTF-8">
-    <title>Brooklyn API Docs</title>
-    <link rel="icon" type="image/x-icon" href="/favicon.ico" sizes="16x16"/>
-    <link href='../swagger-ui/css/typography.css' media='screen' rel='stylesheet' type='text/css'/>
-    <link href='../swagger-ui/css/reset.css' media='screen' rel='stylesheet' type='text/css'/>
-    <link href='../swagger-ui/css/screen.css' media='screen' rel='stylesheet' type='text/css'/>
-    <link href='../swagger-ui/css/reset.css' media='print' rel='stylesheet' type='text/css'/>
-    <link href='../swagger-ui/css/print.css' media='print' rel='stylesheet' type='text/css'/>
-    <link href='../swagger-ui/css/style.css' media='print' rel='stylesheet' type='text/css'/>
-    <script src='../swagger-ui/lib/jquery-1.8.0.min.js' type='text/javascript'></script>
-    <script src='../swagger-ui/lib/jquery.wiggle.min.js' type='text/javascript'></script>
-    <script src='../swagger-ui/lib/jquery.ba-bbq.min.js' type='text/javascript'></script>
-    <script src='../swagger-ui/lib/handlebars-2.0.0.js' type='text/javascript'></script>
-    <script src='../swagger-ui/lib/underscore-min.js' type='text/javascript'></script>
-    <script src='../swagger-ui/lib/backbone-min.js' type='text/javascript'></script>
-    <script src='../swagger-ui/lib/swagger-ui.min.js' type='text/javascript'></script>
-    <script src='../swagger-ui/lib/marked.js' type='text/javascript'></script>
-
-    <script type="text/javascript">
-        $(function () {
-            window.swaggerUi = new SwaggerUi({
-                url: "/v1/apidoc/swagger.json",
-                dom_id: "swagger-ui-container",
-                supportHeaderParams: false,
-                supportedSubmitMethods: ['get', 'post', 'put', 'delete'],
-                onComplete: function (swaggerApi, swaggerUi) {
-                    log("Brooklyn swagger api doc loaded");
-                },
-                onFailure: function (data) {
-                    log("Unable to Load SwaggerUI");
-                },
-                docExpansion: "none",
-                apisSorter: "alpha",
-                showRequestHeaders: false
-            });
-            window.swaggerUi.load();
-
-            function log() {
-                if ('console' in window) {
-                    console.log.apply(console, arguments);
-                }
-            }
-        });
-    </script>
-    <style>
-        #validator {
-            display: none;
-        }
-    </style>
-</head>
-
-<body class="swagger-section">
-<div id="message-bar" class="swagger-ui-wrap" data-sw-translate>&nbsp;</div>
-<div id="swagger-ui-container" class="swagger-ui-wrap"></div>
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/images/Sorting icons.psd
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/images/Sorting icons.psd b/brooklyn-ui/src/main/webapp/assets/images/Sorting icons.psd
deleted file mode 100644
index 53b2e06..0000000
Binary files a/brooklyn-ui/src/main/webapp/assets/images/Sorting icons.psd and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/images/addApplication-plus-hover.png
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/images/addApplication-plus-hover.png b/brooklyn-ui/src/main/webapp/assets/images/addApplication-plus-hover.png
deleted file mode 100755
index 7137d51..0000000
Binary files a/brooklyn-ui/src/main/webapp/assets/images/addApplication-plus-hover.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/images/addApplication-plus.png
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/images/addApplication-plus.png b/brooklyn-ui/src/main/webapp/assets/images/addApplication-plus.png
deleted file mode 100755
index c4ff5e6..0000000
Binary files a/brooklyn-ui/src/main/webapp/assets/images/addApplication-plus.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/images/application-icon-add-hover.png
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/images/application-icon-add-hover.png b/brooklyn-ui/src/main/webapp/assets/images/application-icon-add-hover.png
deleted file mode 100755
index 95c9bc8..0000000
Binary files a/brooklyn-ui/src/main/webapp/assets/images/application-icon-add-hover.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/images/application-icon-add.png
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/images/application-icon-add.png b/brooklyn-ui/src/main/webapp/assets/images/application-icon-add.png
deleted file mode 100755
index b795bc5..0000000
Binary files a/brooklyn-ui/src/main/webapp/assets/images/application-icon-add.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/images/application-icon-refresh-hover.png
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/images/application-icon-refresh-hover.png b/brooklyn-ui/src/main/webapp/assets/images/application-icon-refresh-hover.png
deleted file mode 100755
index 6d23b8f..0000000
Binary files a/brooklyn-ui/src/main/webapp/assets/images/application-icon-refresh-hover.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/images/application-icon-refresh.png
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/images/application-icon-refresh.png b/brooklyn-ui/src/main/webapp/assets/images/application-icon-refresh.png
deleted file mode 100755
index 4f13df4..0000000
Binary files a/brooklyn-ui/src/main/webapp/assets/images/application-icon-refresh.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/images/back_disabled.png
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/images/back_disabled.png b/brooklyn-ui/src/main/webapp/assets/images/back_disabled.png
deleted file mode 100644
index 881de79..0000000
Binary files a/brooklyn-ui/src/main/webapp/assets/images/back_disabled.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/images/back_enabled.png
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/images/back_enabled.png b/brooklyn-ui/src/main/webapp/assets/images/back_enabled.png
deleted file mode 100644
index c608682..0000000
Binary files a/brooklyn-ui/src/main/webapp/assets/images/back_enabled.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/images/back_enabled_hover.png
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/images/back_enabled_hover.png b/brooklyn-ui/src/main/webapp/assets/images/back_enabled_hover.png
deleted file mode 100644
index d300f10..0000000
Binary files a/brooklyn-ui/src/main/webapp/assets/images/back_enabled_hover.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/images/brooklyn-header-background.png
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/images/brooklyn-header-background.png b/brooklyn-ui/src/main/webapp/assets/images/brooklyn-header-background.png
deleted file mode 100755
index 3399da7..0000000
Binary files a/brooklyn-ui/src/main/webapp/assets/images/brooklyn-header-background.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/images/brooklyn-logo.png
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/images/brooklyn-logo.png b/brooklyn-ui/src/main/webapp/assets/images/brooklyn-logo.png
deleted file mode 100755
index 27b2e5a..0000000
Binary files a/brooklyn-ui/src/main/webapp/assets/images/brooklyn-logo.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/images/favicon.ico
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/images/favicon.ico b/brooklyn-ui/src/main/webapp/assets/images/favicon.ico
deleted file mode 100644
index 6eeaa2a..0000000
Binary files a/brooklyn-ui/src/main/webapp/assets/images/favicon.ico and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/images/forward_disabled.png
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/images/forward_disabled.png b/brooklyn-ui/src/main/webapp/assets/images/forward_disabled.png
deleted file mode 100644
index 6a6ded7..0000000
Binary files a/brooklyn-ui/src/main/webapp/assets/images/forward_disabled.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/images/forward_enabled.png
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/images/forward_enabled.png b/brooklyn-ui/src/main/webapp/assets/images/forward_enabled.png
deleted file mode 100644
index a4e6b53..0000000
Binary files a/brooklyn-ui/src/main/webapp/assets/images/forward_enabled.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/images/forward_enabled_hover.png
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/images/forward_enabled_hover.png b/brooklyn-ui/src/main/webapp/assets/images/forward_enabled_hover.png
deleted file mode 100644
index fc46c5e..0000000
Binary files a/brooklyn-ui/src/main/webapp/assets/images/forward_enabled_hover.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/images/main-menu-tab-active.png
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/images/main-menu-tab-active.png b/brooklyn-ui/src/main/webapp/assets/images/main-menu-tab-active.png
deleted file mode 100755
index 539f19a..0000000
Binary files a/brooklyn-ui/src/main/webapp/assets/images/main-menu-tab-active.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/images/main-menu-tab-hover.png
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/images/main-menu-tab-hover.png b/brooklyn-ui/src/main/webapp/assets/images/main-menu-tab-hover.png
deleted file mode 100755
index cb8a106..0000000
Binary files a/brooklyn-ui/src/main/webapp/assets/images/main-menu-tab-hover.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/images/main-menu-tab.png
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/images/main-menu-tab.png b/brooklyn-ui/src/main/webapp/assets/images/main-menu-tab.png
deleted file mode 100755
index ae62fd5..0000000
Binary files a/brooklyn-ui/src/main/webapp/assets/images/main-menu-tab.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/images/nav-tabs-background.png
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/images/nav-tabs-background.png b/brooklyn-ui/src/main/webapp/assets/images/nav-tabs-background.png
deleted file mode 100755
index 043df7c..0000000
Binary files a/brooklyn-ui/src/main/webapp/assets/images/nav-tabs-background.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/images/roundedSummary-background.png
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/images/roundedSummary-background.png b/brooklyn-ui/src/main/webapp/assets/images/roundedSummary-background.png
deleted file mode 100755
index 4e6f579..0000000
Binary files a/brooklyn-ui/src/main/webapp/assets/images/roundedSummary-background.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/images/sort_asc.png
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/images/sort_asc.png b/brooklyn-ui/src/main/webapp/assets/images/sort_asc.png
deleted file mode 100644
index a88d797..0000000
Binary files a/brooklyn-ui/src/main/webapp/assets/images/sort_asc.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/images/sort_asc_disabled.png
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/images/sort_asc_disabled.png b/brooklyn-ui/src/main/webapp/assets/images/sort_asc_disabled.png
deleted file mode 100644
index 4e144cf..0000000
Binary files a/brooklyn-ui/src/main/webapp/assets/images/sort_asc_disabled.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/images/sort_both.png
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/images/sort_both.png b/brooklyn-ui/src/main/webapp/assets/images/sort_both.png
deleted file mode 100644
index 1867040..0000000
Binary files a/brooklyn-ui/src/main/webapp/assets/images/sort_both.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/images/sort_desc.png
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/images/sort_desc.png b/brooklyn-ui/src/main/webapp/assets/images/sort_desc.png
deleted file mode 100644
index def071e..0000000
Binary files a/brooklyn-ui/src/main/webapp/assets/images/sort_desc.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/images/sort_desc_disabled.png
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/images/sort_desc_disabled.png b/brooklyn-ui/src/main/webapp/assets/images/sort_desc_disabled.png
deleted file mode 100644
index 7824973..0000000
Binary files a/brooklyn-ui/src/main/webapp/assets/images/sort_desc_disabled.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/images/throbber.gif
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/images/throbber.gif b/brooklyn-ui/src/main/webapp/assets/images/throbber.gif
deleted file mode 100644
index 0639388..0000000
Binary files a/brooklyn-ui/src/main/webapp/assets/images/throbber.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/img/bridge.png
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/img/bridge.png b/brooklyn-ui/src/main/webapp/assets/img/bridge.png
deleted file mode 100644
index 811c79d..0000000
Binary files a/brooklyn-ui/src/main/webapp/assets/img/bridge.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/img/brooklyn.png
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/img/brooklyn.png b/brooklyn-ui/src/main/webapp/assets/img/brooklyn.png
deleted file mode 100644
index 6efaed5..0000000
Binary files a/brooklyn-ui/src/main/webapp/assets/img/brooklyn.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/img/document.png
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/img/document.png b/brooklyn-ui/src/main/webapp/assets/img/document.png
deleted file mode 100644
index 75f92b0..0000000
Binary files a/brooklyn-ui/src/main/webapp/assets/img/document.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/img/fire.png
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/img/fire.png b/brooklyn-ui/src/main/webapp/assets/img/fire.png
deleted file mode 100644
index a238ba9..0000000
Binary files a/brooklyn-ui/src/main/webapp/assets/img/fire.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/img/folder-horizontal.png
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/img/folder-horizontal.png b/brooklyn-ui/src/main/webapp/assets/img/folder-horizontal.png
deleted file mode 100644
index 260b415..0000000
Binary files a/brooklyn-ui/src/main/webapp/assets/img/folder-horizontal.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/img/glyphicons-halflings-bright-green.png
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/img/glyphicons-halflings-bright-green.png b/brooklyn-ui/src/main/webapp/assets/img/glyphicons-halflings-bright-green.png
deleted file mode 100644
index 39473e0..0000000
Binary files a/brooklyn-ui/src/main/webapp/assets/img/glyphicons-halflings-bright-green.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/img/glyphicons-halflings-dark-green.png
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/img/glyphicons-halflings-dark-green.png b/brooklyn-ui/src/main/webapp/assets/img/glyphicons-halflings-dark-green.png
deleted file mode 100644
index 6671579..0000000
Binary files a/brooklyn-ui/src/main/webapp/assets/img/glyphicons-halflings-dark-green.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/img/glyphicons-halflings-green.png
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/img/glyphicons-halflings-green.png b/brooklyn-ui/src/main/webapp/assets/img/glyphicons-halflings-green.png
deleted file mode 100644
index 0616efb..0000000
Binary files a/brooklyn-ui/src/main/webapp/assets/img/glyphicons-halflings-green.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/img/glyphicons-halflings-white.png
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/img/glyphicons-halflings-white.png b/brooklyn-ui/src/main/webapp/assets/img/glyphicons-halflings-white.png
deleted file mode 100644
index 3bf6484..0000000
Binary files a/brooklyn-ui/src/main/webapp/assets/img/glyphicons-halflings-white.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/img/glyphicons-halflings.png
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/img/glyphicons-halflings.png b/brooklyn-ui/src/main/webapp/assets/img/glyphicons-halflings.png
deleted file mode 100644
index 79bc568..0000000
Binary files a/brooklyn-ui/src/main/webapp/assets/img/glyphicons-halflings.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/img/icon-status-onfire.png
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/img/icon-status-onfire.png b/brooklyn-ui/src/main/webapp/assets/img/icon-status-onfire.png
deleted file mode 100644
index a238ba9..0000000
Binary files a/brooklyn-ui/src/main/webapp/assets/img/icon-status-onfire.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/img/icon-status-running-onfire.png
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/img/icon-status-running-onfire.png b/brooklyn-ui/src/main/webapp/assets/img/icon-status-running-onfire.png
deleted file mode 100644
index d0af3d7..0000000
Binary files a/brooklyn-ui/src/main/webapp/assets/img/icon-status-running-onfire.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/img/icon-status-running.png
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/img/icon-status-running.png b/brooklyn-ui/src/main/webapp/assets/img/icon-status-running.png
deleted file mode 100644
index 8bb39f8..0000000
Binary files a/brooklyn-ui/src/main/webapp/assets/img/icon-status-running.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/img/icon-status-starting.gif
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/img/icon-status-starting.gif b/brooklyn-ui/src/main/webapp/assets/img/icon-status-starting.gif
deleted file mode 100644
index 0b0de23..0000000
Binary files a/brooklyn-ui/src/main/webapp/assets/img/icon-status-starting.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/img/icon-status-stopped-onfire.png
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/img/icon-status-stopped-onfire.png b/brooklyn-ui/src/main/webapp/assets/img/icon-status-stopped-onfire.png
deleted file mode 100644
index 03eceb5..0000000
Binary files a/brooklyn-ui/src/main/webapp/assets/img/icon-status-stopped-onfire.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/img/icon-status-stopped.png
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/img/icon-status-stopped.png b/brooklyn-ui/src/main/webapp/assets/img/icon-status-stopped.png
deleted file mode 100644
index effb768..0000000
Binary files a/brooklyn-ui/src/main/webapp/assets/img/icon-status-stopped.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/img/icon-status-stopping.gif
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/img/icon-status-stopping.gif b/brooklyn-ui/src/main/webapp/assets/img/icon-status-stopping.gif
deleted file mode 100644
index a966b12..0000000
Binary files a/brooklyn-ui/src/main/webapp/assets/img/icon-status-stopping.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/img/magnifying-glass-right-icon.png
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/img/magnifying-glass-right-icon.png b/brooklyn-ui/src/main/webapp/assets/img/magnifying-glass-right-icon.png
deleted file mode 100644
index 16d4819..0000000
Binary files a/brooklyn-ui/src/main/webapp/assets/img/magnifying-glass-right-icon.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/img/magnifying-glass-right.png
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/img/magnifying-glass-right.png b/brooklyn-ui/src/main/webapp/assets/img/magnifying-glass-right.png
deleted file mode 100644
index 90e5c9f..0000000
Binary files a/brooklyn-ui/src/main/webapp/assets/img/magnifying-glass-right.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/img/magnifying-glass.gif
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/img/magnifying-glass.gif b/brooklyn-ui/src/main/webapp/assets/img/magnifying-glass.gif
deleted file mode 100644
index 18e046b..0000000
Binary files a/brooklyn-ui/src/main/webapp/assets/img/magnifying-glass.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/img/toggle-small-expand.png
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/img/toggle-small-expand.png b/brooklyn-ui/src/main/webapp/assets/img/toggle-small-expand.png
deleted file mode 100644
index 79c5ff7..0000000
Binary files a/brooklyn-ui/src/main/webapp/assets/img/toggle-small-expand.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/img/toggle-small.png
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/img/toggle-small.png b/brooklyn-ui/src/main/webapp/assets/img/toggle-small.png
deleted file mode 100644
index f783a6f..0000000
Binary files a/brooklyn-ui/src/main/webapp/assets/img/toggle-small.png and /dev/null differ


[27/51] [abbrv] [partial] brooklyn-ui git commit: move subdir from incubator up a level as it is promoted to its own repo (first non-incubator commit!)

Posted by he...@apache.org.
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/swagger-ui/lib/backbone-min.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/swagger-ui/lib/backbone-min.js b/brooklyn-ui/src/main/webapp/assets/swagger-ui/lib/backbone-min.js
deleted file mode 100644
index c09dbeb..0000000
--- a/brooklyn-ui/src/main/webapp/assets/swagger-ui/lib/backbone-min.js
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-// Backbone.js 1.1.2
-
-(function(t,e){if(typeof define==="function"&&define.amd){define(["underscore","jquery","exports"],function(i,r,s){t.Backbone=e(t,s,i,r)})}else if(typeof exports!=="undefined"){var i=require("underscore");e(t,exports,i)}else{t.Backbone=e(t,{},t._,t.jQuery||t.Zepto||t.ender||t.$)}})(this,function(t,e,i,r){var s=t.Backbone;var n=[];var a=n.push;var o=n.slice;var h=n.splice;e.VERSION="1.1.2";e.$=r;e.noConflict=function(){t.Backbone=s;return this};e.emulateHTTP=false;e.emulateJSON=false;var u=e.Events={on:function(t,e,i){if(!c(this,"on",t,[e,i])||!e)return this;this._events||(this._events={});var r=this._events[t]||(this._events[t]=[]);r.push({callback:e,context:i,ctx:i||this});return this},once:function(t,e,r){if(!c(this,"once",t,[e,r])||!e)return this;var s=this;var n=i.once(function(){s.off(t,n);e.apply(this,arguments)});n._callback=e;return this.on(t,n,r)},off:function(t,e,r){var s,n,a,o,h,u,l,f;if(!this._events||!c(this,"off",t,[e,r]))return this;if(!t&&!e&&!r){this._events=void 0;
 return this}o=t?[t]:i.keys(this._events);for(h=0,u=o.length;h<u;h++){t=o[h];if(a=this._events[t]){this._events[t]=s=[];if(e||r){for(l=0,f=a.length;l<f;l++){n=a[l];if(e&&e!==n.callback&&e!==n.callback._callback||r&&r!==n.context){s.push(n)}}}if(!s.length)delete this._events[t]}}return this},trigger:function(t){if(!this._events)return this;var e=o.call(arguments,1);if(!c(this,"trigger",t,e))return this;var i=this._events[t];var r=this._events.all;if(i)f(i,e);if(r)f(r,arguments);return this},stopListening:function(t,e,r){var s=this._listeningTo;if(!s)return this;var n=!e&&!r;if(!r&&typeof e==="object")r=this;if(t)(s={})[t._listenId]=t;for(var a in s){t=s[a];t.off(e,r,this);if(n||i.isEmpty(t._events))delete this._listeningTo[a]}return this}};var l=/\s+/;var c=function(t,e,i,r){if(!i)return true;if(typeof i==="object"){for(var s in i){t[e].apply(t,[s,i[s]].concat(r))}return false}if(l.test(i)){var n=i.split(l);for(var a=0,o=n.length;a<o;a++){t[e].apply(t,[n[a]].concat(r))}return false}re
 turn true};var f=function(t,e){var i,r=-1,s=t.length,n=e[0],a=e[1],o=e[2];switch(e.length){case 0:while(++r<s)(i=t[r]).callback.call(i.ctx);return;case 1:while(++r<s)(i=t[r]).callback.call(i.ctx,n);return;case 2:while(++r<s)(i=t[r]).callback.call(i.ctx,n,a);return;case 3:while(++r<s)(i=t[r]).callback.call(i.ctx,n,a,o);return;default:while(++r<s)(i=t[r]).callback.apply(i.ctx,e);return}};var d={listenTo:"on",listenToOnce:"once"};i.each(d,function(t,e){u[e]=function(e,r,s){var n=this._listeningTo||(this._listeningTo={});var a=e._listenId||(e._listenId=i.uniqueId("l"));n[a]=e;if(!s&&typeof r==="object")s=this;e[t](r,s,this);return this}});u.bind=u.on;u.unbind=u.off;i.extend(e,u);var p=e.Model=function(t,e){var r=t||{};e||(e={});this.cid=i.uniqueId("c");this.attributes={};if(e.collection)this.collection=e.collection;if(e.parse)r=this.parse(r,e)||{};r=i.defaults({},r,i.result(this,"defaults"));this.set(r,e);this.changed={};this.initialize.apply(this,arguments)};i.extend(p.prototype,u,{cha
 nged:null,validationError:null,idAttribute:"id",initialize:function(){},toJSON:function(t){return i.clone(this.attributes)},sync:function(){return e.sync.apply(this,arguments)},get:function(t){return this.attributes[t]},escape:function(t){return i.escape(this.get(t))},has:function(t){return this.get(t)!=null},set:function(t,e,r){var s,n,a,o,h,u,l,c;if(t==null)return this;if(typeof t==="object"){n=t;r=e}else{(n={})[t]=e}r||(r={});if(!this._validate(n,r))return false;a=r.unset;h=r.silent;o=[];u=this._changing;this._changing=true;if(!u){this._previousAttributes=i.clone(this.attributes);this.changed={}}c=this.attributes,l=this._previousAttributes;if(this.idAttribute in n)this.id=n[this.idAttribute];for(s in n){e=n[s];if(!i.isEqual(c[s],e))o.push(s);if(!i.isEqual(l[s],e)){this.changed[s]=e}else{delete this.changed[s]}a?delete c[s]:c[s]=e}if(!h){if(o.length)this._pending=r;for(var f=0,d=o.length;f<d;f++){this.trigger("change:"+o[f],this,c[o[f]],r)}}if(u)return this;if(!h){while(this._pend
 ing){r=this._pending;this._pending=false;this.trigger("change",this,r)}}this._pending=false;this._changing=false;return this},unset:function(t,e){return this.set(t,void 0,i.extend({},e,{unset:true}))},clear:function(t){var e={};for(var r in this.attributes)e[r]=void 0;return this.set(e,i.extend({},t,{unset:true}))},hasChanged:function(t){if(t==null)return!i.isEmpty(this.changed);return i.has(this.changed,t)},changedAttributes:function(t){if(!t)return this.hasChanged()?i.clone(this.changed):false;var e,r=false;var s=this._changing?this._previousAttributes:this.attributes;for(var n in t){if(i.isEqual(s[n],e=t[n]))continue;(r||(r={}))[n]=e}return r},previous:function(t){if(t==null||!this._previousAttributes)return null;return this._previousAttributes[t]},previousAttributes:function(){return i.clone(this._previousAttributes)},fetch:function(t){t=t?i.clone(t):{};if(t.parse===void 0)t.parse=true;var e=this;var r=t.success;t.success=function(i){if(!e.set(e.parse(i,t),t))return false;if(r)r
 (e,i,t);e.trigger("sync",e,i,t)};q(this,t);return this.sync("read",this,t)},save:function(t,e,r){var s,n,a,o=this.attributes;if(t==null||typeof t==="object"){s=t;r=e}else{(s={})[t]=e}r=i.extend({validate:true},r);if(s&&!r.wait){if(!this.set(s,r))return false}else{if(!this._validate(s,r))return false}if(s&&r.wait){this.attributes=i.extend({},o,s)}if(r.parse===void 0)r.parse=true;var h=this;var u=r.success;r.success=function(t){h.attributes=o;var e=h.parse(t,r);if(r.wait)e=i.extend(s||{},e);if(i.isObject(e)&&!h.set(e,r)){return false}if(u)u(h,t,r);h.trigger("sync",h,t,r)};q(this,r);n=this.isNew()?"create":r.patch?"patch":"update";if(n==="patch")r.attrs=s;a=this.sync(n,this,r);if(s&&r.wait)this.attributes=o;return a},destroy:function(t){t=t?i.clone(t):{};var e=this;var r=t.success;var s=function(){e.trigger("destroy",e,e.collection,t)};t.success=function(i){if(t.wait||e.isNew())s();if(r)r(e,i,t);if(!e.isNew())e.trigger("sync",e,i,t)};if(this.isNew()){t.success();return false}q(this,t);
 var n=this.sync("delete",this,t);if(!t.wait)s();return n},url:function(){var t=i.result(this,"urlRoot")||i.result(this.collection,"url")||M();if(this.isNew())return t;return t.replace(/([^\/])$/,"$1/")+encodeURIComponent(this.id)},parse:function(t,e){return t},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return!this.has(this.idAttribute)},isValid:function(t){return this._validate({},i.extend(t||{},{validate:true}))},_validate:function(t,e){if(!e.validate||!this.validate)return true;t=i.extend({},this.attributes,t);var r=this.validationError=this.validate(t,e)||null;if(!r)return true;this.trigger("invalid",this,r,i.extend(e,{validationError:r}));return false}});var v=["keys","values","pairs","invert","pick","omit"];i.each(v,function(t){p.prototype[t]=function(){var e=o.call(arguments);e.unshift(this.attributes);return i[t].apply(i,e)}});var g=e.Collection=function(t,e){e||(e={});if(e.model)this.model=e.model;if(e.comparator!==void 0)this.comparator=
 e.comparator;this._reset();this.initialize.apply(this,arguments);if(t)this.reset(t,i.extend({silent:true},e))};var m={add:true,remove:true,merge:true};var y={add:true,remove:false};i.extend(g.prototype,u,{model:p,initialize:function(){},toJSON:function(t){return this.map(function(e){return e.toJSON(t)})},sync:function(){return e.sync.apply(this,arguments)},add:function(t,e){return this.set(t,i.extend({merge:false},e,y))},remove:function(t,e){var r=!i.isArray(t);t=r?[t]:i.clone(t);e||(e={});var s,n,a,o;for(s=0,n=t.length;s<n;s++){o=t[s]=this.get(t[s]);if(!o)continue;delete this._byId[o.id];delete this._byId[o.cid];a=this.indexOf(o);this.models.splice(a,1);this.length--;if(!e.silent){e.index=a;o.trigger("remove",o,this,e)}this._removeReference(o,e)}return r?t[0]:t},set:function(t,e){e=i.defaults({},e,m);if(e.parse)t=this.parse(t,e);var r=!i.isArray(t);t=r?t?[t]:[]:i.clone(t);var s,n,a,o,h,u,l;var c=e.at;var f=this.model;var d=this.comparator&&c==null&&e.sort!==false;var v=i.isString(t
 his.comparator)?this.comparator:null;var g=[],y=[],_={};var b=e.add,w=e.merge,x=e.remove;var E=!d&&b&&x?[]:false;for(s=0,n=t.length;s<n;s++){h=t[s]||{};if(h instanceof p){a=o=h}else{a=h[f.prototype.idAttribute||"id"]}if(u=this.get(a)){if(x)_[u.cid]=true;if(w){h=h===o?o.attributes:h;if(e.parse)h=u.parse(h,e);u.set(h,e);if(d&&!l&&u.hasChanged(v))l=true}t[s]=u}else if(b){o=t[s]=this._prepareModel(h,e);if(!o)continue;g.push(o);this._addReference(o,e)}o=u||o;if(E&&(o.isNew()||!_[o.id]))E.push(o);_[o.id]=true}if(x){for(s=0,n=this.length;s<n;++s){if(!_[(o=this.models[s]).cid])y.push(o)}if(y.length)this.remove(y,e)}if(g.length||E&&E.length){if(d)l=true;this.length+=g.length;if(c!=null){for(s=0,n=g.length;s<n;s++){this.models.splice(c+s,0,g[s])}}else{if(E)this.models.length=0;var k=E||g;for(s=0,n=k.length;s<n;s++){this.models.push(k[s])}}}if(l)this.sort({silent:true});if(!e.silent){for(s=0,n=g.length;s<n;s++){(o=g[s]).trigger("add",o,this,e)}if(l||E&&E.length)this.trigger("sort",this,e)}retu
 rn r?t[0]:t},reset:function(t,e){e||(e={});for(var r=0,s=this.models.length;r<s;r++){this._removeReference(this.models[r],e)}e.previousModels=this.models;this._reset();t=this.add(t,i.extend({silent:true},e));if(!e.silent)this.trigger("reset",this,e);return t},push:function(t,e){return this.add(t,i.extend({at:this.length},e))},pop:function(t){var e=this.at(this.length-1);this.remove(e,t);return e},unshift:function(t,e){return this.add(t,i.extend({at:0},e))},shift:function(t){var e=this.at(0);this.remove(e,t);return e},slice:function(){return o.apply(this.models,arguments)},get:function(t){if(t==null)return void 0;return this._byId[t]||this._byId[t.id]||this._byId[t.cid]},at:function(t){return this.models[t]},where:function(t,e){if(i.isEmpty(t))return e?void 0:[];return this[e?"find":"filter"](function(e){for(var i in t){if(t[i]!==e.get(i))return false}return true})},findWhere:function(t){return this.where(t,true)},sort:function(t){if(!this.comparator)throw new Error("Cannot sort a se
 t without a comparator");t||(t={});if(i.isString(this.comparator)||this.comparator.length===1){this.models=this.sortBy(this.comparator,this)}else{this.models.sort(i.bind(this.comparator,this))}if(!t.silent)this.trigger("sort",this,t);return this},pluck:function(t){return i.invoke(this.models,"get",t)},fetch:function(t){t=t?i.clone(t):{};if(t.parse===void 0)t.parse=true;var e=t.success;var r=this;t.success=function(i){var s=t.reset?"reset":"set";r[s](i,t);if(e)e(r,i,t);r.trigger("sync",r,i,t)};q(this,t);return this.sync("read",this,t)},create:function(t,e){e=e?i.clone(e):{};if(!(t=this._prepareModel(t,e)))return false;if(!e.wait)this.add(t,e);var r=this;var s=e.success;e.success=function(t,i){if(e.wait)r.add(t,e);if(s)s(t,i,e)};t.save(null,e);return t},parse:function(t,e){return t},clone:function(){return new this.constructor(this.models)},_reset:function(){this.length=0;this.models=[];this._byId={}},_prepareModel:function(t,e){if(t instanceof p)return t;e=e?i.clone(e):{};e.collectio
 n=this;var r=new this.model(t,e);if(!r.validationError)return r;this.trigger("invalid",this,r.validationError,e);return false},_addReference:function(t,e){this._byId[t.cid]=t;if(t.id!=null)this._byId[t.id]=t;if(!t.collection)t.collection=this;t.on("all",this._onModelEvent,this)},_removeReference:function(t,e){if(this===t.collection)delete t.collection;t.off("all",this._onModelEvent,this)},_onModelEvent:function(t,e,i,r){if((t==="add"||t==="remove")&&i!==this)return;if(t==="destroy")this.remove(e,r);if(e&&t==="change:"+e.idAttribute){delete this._byId[e.previous(e.idAttribute)];if(e.id!=null)this._byId[e.id]=e}this.trigger.apply(this,arguments)}});var _=["forEach","each","map","collect","reduce","foldl","inject","reduceRight","foldr","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","max","min","toArray","size","first","head","take","initial","rest","tail","drop","last","without","difference","indexOf","shuffle","lastIndexOf","isEmpty
 ","chain","sample"];i.each(_,function(t){g.prototype[t]=function(){var e=o.call(arguments);e.unshift(this.models);return i[t].apply(i,e)}});var b=["groupBy","countBy","sortBy","indexBy"];i.each(b,function(t){g.prototype[t]=function(e,r){var s=i.isFunction(e)?e:function(t){return t.get(e)};return i[t](this.models,s,r)}});var w=e.View=function(t){this.cid=i.uniqueId("view");t||(t={});i.extend(this,i.pick(t,E));this._ensureElement();this.initialize.apply(this,arguments);this.delegateEvents()};var x=/^(\S+)\s*(.*)$/;var E=["model","collection","el","id","attributes","className","tagName","events"];i.extend(w.prototype,u,{tagName:"div",$:function(t){return this.$el.find(t)},initialize:function(){},render:function(){return this},remove:function(){this.$el.remove();this.stopListening();return this},setElement:function(t,i){if(this.$el)this.undelegateEvents();this.$el=t instanceof e.$?t:e.$(t);this.el=this.$el[0];if(i!==false)this.delegateEvents();return this},delegateEvents:function(t){if(
 !(t||(t=i.result(this,"events"))))return this;this.undelegateEvents();for(var e in t){var r=t[e];if(!i.isFunction(r))r=this[t[e]];if(!r)continue;var s=e.match(x);var n=s[1],a=s[2];r=i.bind(r,this);n+=".delegateEvents"+this.cid;if(a===""){this.$el.on(n,r)}else{this.$el.on(n,a,r)}}return this},undelegateEvents:function(){this.$el.off(".delegateEvents"+this.cid);return this},_ensureElement:function(){if(!this.el){var t=i.extend({},i.result(this,"attributes"));if(this.id)t.id=i.result(this,"id");if(this.className)t["class"]=i.result(this,"className");var r=e.$("<"+i.result(this,"tagName")+">").attr(t);this.setElement(r,false)}else{this.setElement(i.result(this,"el"),false)}}});e.sync=function(t,r,s){var n=T[t];i.defaults(s||(s={}),{emulateHTTP:e.emulateHTTP,emulateJSON:e.emulateJSON});var a={type:n,dataType:"json"};if(!s.url){a.url=i.result(r,"url")||M()}if(s.data==null&&r&&(t==="create"||t==="update"||t==="patch")){a.contentType="application/json";a.data=JSON.stringify(s.attrs||r.toJSO
 N(s))}if(s.emulateJSON){a.contentType="application/x-www-form-urlencoded";a.data=a.data?{model:a.data}:{}}if(s.emulateHTTP&&(n==="PUT"||n==="DELETE"||n==="PATCH")){a.type="POST";if(s.emulateJSON)a.data._method=n;var o=s.beforeSend;s.beforeSend=function(t){t.setRequestHeader("X-HTTP-Method-Override",n);if(o)return o.apply(this,arguments)}}if(a.type!=="GET"&&!s.emulateJSON){a.processData=false}if(a.type==="PATCH"&&k){a.xhr=function(){return new ActiveXObject("Microsoft.XMLHTTP")}}var h=s.xhr=e.ajax(i.extend(a,s));r.trigger("request",r,h,s);return h};var k=typeof window!=="undefined"&&!!window.ActiveXObject&&!(window.XMLHttpRequest&&(new XMLHttpRequest).dispatchEvent);var T={create:"POST",update:"PUT",patch:"PATCH","delete":"DELETE",read:"GET"};e.ajax=function(){return e.$.ajax.apply(e.$,arguments)};var $=e.Router=function(t){t||(t={});if(t.routes)this.routes=t.routes;this._bindRoutes();this.initialize.apply(this,arguments)};var S=/\((.*?)\)/g;var H=/(\(\?)?:\w+/g;var A=/\*\w+/g;var I=
 /[\-{}\[\]+?.,\\\^$|#\s]/g;i.extend($.prototype,u,{initialize:function(){},route:function(t,r,s){if(!i.isRegExp(t))t=this._routeToRegExp(t);if(i.isFunction(r)){s=r;r=""}if(!s)s=this[r];var n=this;e.history.route(t,function(i){var a=n._extractParameters(t,i);n.execute(s,a);n.trigger.apply(n,["route:"+r].concat(a));n.trigger("route",r,a);e.history.trigger("route",n,r,a)});return this},execute:function(t,e){if(t)t.apply(this,e)},navigate:function(t,i){e.history.navigate(t,i);return this},_bindRoutes:function(){if(!this.routes)return;this.routes=i.result(this,"routes");var t,e=i.keys(this.routes);while((t=e.pop())!=null){this.route(t,this.routes[t])}},_routeToRegExp:function(t){t=t.replace(I,"\\$&").replace(S,"(?:$1)?").replace(H,function(t,e){return e?t:"([^/?]+)"}).replace(A,"([^?]*?)");return new RegExp("^"+t+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(t,e){var r=t.exec(e).slice(1);return i.map(r,function(t,e){if(e===r.length-1)return t||null;return t?decodeURIComponent(t):n
 ull})}});var N=e.History=function(){this.handlers=[];i.bindAll(this,"checkUrl");if(typeof window!=="undefined"){this.location=window.location;this.history=window.history}};var R=/^[#\/]|\s+$/g;var O=/^\/+|\/+$/g;var P=/msie [\w.]+/;var C=/\/$/;var j=/#.*$/;N.started=false;i.extend(N.prototype,u,{interval:50,atRoot:function(){return this.location.pathname.replace(/[^\/]$/,"$&/")===this.root},getHash:function(t){var e=(t||this).location.href.match(/#(.*)$/);return e?e[1]:""},getFragment:function(t,e){if(t==null){if(this._hasPushState||!this._wantsHashChange||e){t=decodeURI(this.location.pathname+this.location.search);var i=this.root.replace(C,"");if(!t.indexOf(i))t=t.slice(i.length)}else{t=this.getHash()}}return t.replace(R,"")},start:function(t){if(N.started)throw new Error("Backbone.history has already been started");N.started=true;this.options=i.extend({root:"/"},this.options,t);this.root=this.options.root;this._wantsHashChange=this.options.hashChange!==false;this._wantsPushState=!
 !this.options.pushState;this._hasPushState=!!(this.options.pushState&&this.history&&this.history.pushState);var r=this.getFragment();var s=document.documentMode;var n=P.exec(navigator.userAgent.toLowerCase())&&(!s||s<=7);this.root=("/"+this.root+"/").replace(O,"/");if(n&&this._wantsHashChange){var a=e.$('<iframe src="javascript:0" tabindex="-1">');this.iframe=a.hide().appendTo("body")[0].contentWindow;this.navigate(r)}if(this._hasPushState){e.$(window).on("popstate",this.checkUrl)}else if(this._wantsHashChange&&"onhashchange"in window&&!n){e.$(window).on("hashchange",this.checkUrl)}else if(this._wantsHashChange){this._checkUrlInterval=setInterval(this.checkUrl,this.interval)}this.fragment=r;var o=this.location;if(this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot()){this.fragment=this.getFragment(null,true);this.location.replace(this.root+"#"+this.fragment);return true}else if(this._hasPushState&&this.atRoot()&&o.hash){this.fragment=this.getHash().repl
 ace(R,"");this.history.replaceState({},document.title,this.root+this.fragment)}}if(!this.options.silent)return this.loadUrl()},stop:function(){e.$(window).off("popstate",this.checkUrl).off("hashchange",this.checkUrl);if(this._checkUrlInterval)clearInterval(this._checkUrlInterval);N.started=false},route:function(t,e){this.handlers.unshift({route:t,callback:e})},checkUrl:function(t){var e=this.getFragment();if(e===this.fragment&&this.iframe){e=this.getFragment(this.getHash(this.iframe))}if(e===this.fragment)return false;if(this.iframe)this.navigate(e);this.loadUrl()},loadUrl:function(t){t=this.fragment=this.getFragment(t);return i.any(this.handlers,function(e){if(e.route.test(t)){e.callback(t);return true}})},navigate:function(t,e){if(!N.started)return false;if(!e||e===true)e={trigger:!!e};var i=this.root+(t=this.getFragment(t||""));t=t.replace(j,"");if(this.fragment===t)return;this.fragment=t;if(t===""&&i!=="/")i=i.slice(0,-1);if(this._hasPushState){this.history[e.replace?"replaceSta
 te":"pushState"]({},document.title,i)}else if(this._wantsHashChange){this._updateHash(this.location,t,e.replace);if(this.iframe&&t!==this.getFragment(this.getHash(this.iframe))){if(!e.replace)this.iframe.document.open().close();this._updateHash(this.iframe.location,t,e.replace)}}else{return this.location.assign(i)}if(e.trigger)return this.loadUrl(t)},_updateHash:function(t,e,i){if(i){var r=t.href.replace(/(javascript:|#).*$/,"");t.replace(r+"#"+e)}else{t.hash="#"+e}}});e.history=new N;var U=function(t,e){var r=this;var s;if(t&&i.has(t,"constructor")){s=t.constructor}else{s=function(){return r.apply(this,arguments)}}i.extend(s,r,e);var n=function(){this.constructor=s};n.prototype=r.prototype;s.prototype=new n;if(t)i.extend(s.prototype,t);s.__super__=r.prototype;return s};p.extend=g.extend=$.extend=w.extend=N.extend=U;var M=function(){throw new Error('A "url" property or function must be specified')};var q=function(t,e){var i=e.error;e.error=function(r){if(i)i(t,r,e);t.trigger("error"
 ,t,r,e)}};return e});
-
-// From http://stackoverflow.com/a/19431552
-// Compatibility override - Backbone 1.1 got rid of the 'options' binding
-// automatically to views in the constructor - we need to keep that.
-Backbone.View = (function(View) {
-   return View.extend({
-        constructor: function(options) {
-            this.options = options || {};
-            View.apply(this, arguments);
-        }
-    });
-})(Backbone.View);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/swagger-ui/lib/handlebars-2.0.0.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/swagger-ui/lib/handlebars-2.0.0.js b/brooklyn-ui/src/main/webapp/assets/swagger-ui/lib/handlebars-2.0.0.js
deleted file mode 100644
index a2060a7..0000000
--- a/brooklyn-ui/src/main/webapp/assets/swagger-ui/lib/handlebars-2.0.0.js
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-!function(a,b){"function"==typeof define&&define.amd?define([],b):"object"==typeof exports?module.exports=b():a.Handlebars=a.Handlebars||b()}(this,function(){var a=function(){"use strict";function a(a){this.string=a}var b;return a.prototype.toString=function(){return""+this.string},b=a}(),b=function(a){"use strict";function b(a){return i[a]}function c(a){for(var b=1;b<arguments.length;b++)for(var c in arguments[b])Object.prototype.hasOwnProperty.call(arguments[b],c)&&(a[c]=arguments[b][c]);return a}function d(a){return a instanceof h?a.toString():null==a?"":a?(a=""+a,k.test(a)?a.replace(j,b):a):a+""}function e(a){return a||0===a?n(a)&&0===a.length?!0:!1:!0}function f(a,b){return(a?a+".":"")+b}var g={},h=a,i={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},j=/[&<>"'`]/g,k=/[&<>"'`]/;g.extend=c;var l=Object.prototype.toString;g.toString=l;var m=function(a){return"function"==typeof a};m(/x/)&&(m=function(a){return"function"==typeof a&&"[object Function]"===l.c
 all(a)});var m;g.isFunction=m;var n=Array.isArray||function(a){return a&&"object"==typeof a?"[object Array]"===l.call(a):!1};return g.isArray=n,g.escapeExpression=d,g.isEmpty=e,g.appendContextPath=f,g}(a),c=function(){"use strict";function a(a,b){var d;b&&b.firstLine&&(d=b.firstLine,a+=" - "+d+":"+b.firstColumn);for(var e=Error.prototype.constructor.call(this,a),f=0;f<c.length;f++)this[c[f]]=e[c[f]];d&&(this.lineNumber=d,this.column=b.firstColumn)}var b,c=["description","fileName","lineNumber","message","name","number","stack"];return a.prototype=new Error,b=a}(),d=function(a,b){"use strict";function c(a,b){this.helpers=a||{},this.partials=b||{},d(this)}function d(a){a.registerHelper("helperMissing",function(){if(1===arguments.length)return void 0;throw new g("Missing helper: '"+arguments[arguments.length-1].name+"'")}),a.registerHelper("blockHelperMissing",function(b,c){var d=c.inverse,e=c.fn;if(b===!0)return e(this);if(b===!1||null==b)return d(this);if(k(b))return b.length>0?(c.id
 s&&(c.ids=[c.name]),a.helpers.each(b,c)):d(this);if(c.data&&c.ids){var g=q(c.data);g.contextPath=f.appendContextPath(c.data.contextPath,c.name),c={data:g}}return e(b,c)}),a.registerHelper("each",function(a,b){if(!b)throw new g("Must pass iterator to #each");var c,d,e=b.fn,h=b.inverse,i=0,j="";if(b.data&&b.ids&&(d=f.appendContextPath(b.data.contextPath,b.ids[0])+"."),l(a)&&(a=a.call(this)),b.data&&(c=q(b.data)),a&&"object"==typeof a)if(k(a))for(var m=a.length;m>i;i++)c&&(c.index=i,c.first=0===i,c.last=i===a.length-1,d&&(c.contextPath=d+i)),j+=e(a[i],{data:c});else for(var n in a)a.hasOwnProperty(n)&&(c&&(c.key=n,c.index=i,c.first=0===i,d&&(c.contextPath=d+n)),j+=e(a[n],{data:c}),i++);return 0===i&&(j=h(this)),j}),a.registerHelper("if",function(a,b){return l(a)&&(a=a.call(this)),!b.hash.includeZero&&!a||f.isEmpty(a)?b.inverse(this):b.fn(this)}),a.registerHelper("unless",function(b,c){return a.helpers["if"].call(this,b,{fn:c.inverse,inverse:c.fn,hash:c.hash})}),a.registerHelper("with",
 function(a,b){l(a)&&(a=a.call(this));var c=b.fn;if(f.isEmpty(a))return b.inverse(this);if(b.data&&b.ids){var d=q(b.data);d.contextPath=f.appendContextPath(b.data.contextPath,b.ids[0]),b={data:d}}return c(a,b)}),a.registerHelper("log",function(b,c){var d=c.data&&null!=c.data.level?parseInt(c.data.level,10):1;a.log(d,b)}),a.registerHelper("lookup",function(a,b){return a&&a[b]})}var e={},f=a,g=b,h="2.0.0";e.VERSION=h;var i=6;e.COMPILER_REVISION=i;var j={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1"};e.REVISION_CHANGES=j;var k=f.isArray,l=f.isFunction,m=f.toString,n="[object Object]";e.HandlebarsEnvironment=c,c.prototype={constructor:c,logger:o,log:p,registerHelper:function(a,b){if(m.call(a)===n){if(b)throw new g("Arg not supported with multiple helpers");f.extend(this.helpers,a)}else this.helpers[a]=b},unregisterHelper:function(a){delete this.helpers[a]},registerPartial:function(a,b){m.call(a)===n?f.extend(this.partials,a):thi
 s.partials[a]=b},unregisterPartial:function(a){delete this.partials[a]}};var o={methodMap:{0:"debug",1:"info",2:"warn",3:"error"},DEBUG:0,INFO:1,WARN:2,ERROR:3,level:3,log:function(a,b){if(o.level<=a){var c=o.methodMap[a];"undefined"!=typeof console&&console[c]&&console[c].call(console,b)}}};e.logger=o;var p=o.log;e.log=p;var q=function(a){var b=f.extend({},a);return b._parent=a,b};return e.createFrame=q,e}(b,c),e=function(a,b,c){"use strict";function d(a){var b=a&&a[0]||1,c=m;if(b!==c){if(c>b){var d=n[c],e=n[b];throw new l("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+d+") or downgrade your runtime to an older version ("+e+").")}throw new l("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+a[1]+").")}}function e(a,b){if(!b)throw new l("No environment passed to template");if(!a||!a.main)throw new l("Unkno
 wn template object: "+typeof a);b.VM.checkRevision(a.compiler);var c=function(c,d,e,f,g,h,i,j,m){g&&(f=k.extend({},f,g));var n=b.VM.invokePartial.call(this,c,e,f,h,i,j,m);if(null==n&&b.compile){var o={helpers:h,partials:i,data:j,depths:m};i[e]=b.compile(c,{data:void 0!==j,compat:a.compat},b),n=i[e](f,o)}if(null!=n){if(d){for(var p=n.split("\n"),q=0,r=p.length;r>q&&(p[q]||q+1!==r);q++)p[q]=d+p[q];n=p.join("\n")}return n}throw new l("The partial "+e+" could not be compiled when running in runtime-only mode")},d={lookup:function(a,b){for(var c=a.length,d=0;c>d;d++)if(a[d]&&null!=a[d][b])return a[d][b]},lambda:function(a,b){return"function"==typeof a?a.call(b):a},escapeExpression:k.escapeExpression,invokePartial:c,fn:function(b){return a[b]},programs:[],program:function(a,b,c){var d=this.programs[a],e=this.fn(a);return b||c?d=f(this,a,e,b,c):d||(d=this.programs[a]=f(this,a,e)),d},data:function(a,b){for(;a&&b--;)a=a._parent;return a},merge:function(a,b){var c=a||b;return a&&b&&a!==b&&(c=
 k.extend({},b,a)),c},noop:b.VM.noop,compilerInfo:a.compiler},e=function(b,c){c=c||{};var f=c.data;e._setup(c),!c.partial&&a.useData&&(f=i(b,f));var g;return a.useDepths&&(g=c.depths?[b].concat(c.depths):[b]),a.main.call(d,b,d.helpers,d.partials,f,g)};return e.isTop=!0,e._setup=function(c){c.partial?(d.helpers=c.helpers,d.partials=c.partials):(d.helpers=d.merge(c.helpers,b.helpers),a.usePartial&&(d.partials=d.merge(c.partials,b.partials)))},e._child=function(b,c,e){if(a.useDepths&&!e)throw new l("must pass parent depths");return f(d,b,a[b],c,e)},e}function f(a,b,c,d,e){var f=function(b,f){return f=f||{},c.call(a,b,a.helpers,a.partials,f.data||d,e&&[b].concat(e))};return f.program=b,f.depth=e?e.length:0,f}function g(a,b,c,d,e,f,g){var h={partial:!0,helpers:d,partials:e,data:f,depths:g};if(void 0===a)throw new l("The partial "+b+" could not be found");return a instanceof Function?a(c,h):void 0}function h(){return""}function i(a,b){return b&&"root"in b||(b=b?o(b):{},b.root=a),b}var j={}
 ,k=a,l=b,m=c.COMPILER_REVISION,n=c.REVISION_CHANGES,o=c.createFrame;return j.checkRevision=d,j.template=e,j.program=f,j.invokePartial=g,j.noop=h,j}(b,c,d),f=function(a,b,c,d,e){"use strict";var f,g=a,h=b,i=c,j=d,k=e,l=function(){var a=new g.HandlebarsEnvironment;return j.extend(a,g),a.SafeString=h,a.Exception=i,a.Utils=j,a.escapeExpression=j.escapeExpression,a.VM=k,a.template=function(b){return k.template(b,a)},a},m=l();return m.create=l,m["default"]=m,f=m}(d,a,c,b,e),g=function(a){"use strict";function b(a){a=a||{},this.firstLine=a.first_line,this.firstColumn=a.first_column,this.lastColumn=a.last_column,this.lastLine=a.last_line}var c,d=a,e={ProgramNode:function(a,c,d){b.call(this,d),this.type="program",this.statements=a,this.strip=c},MustacheNode:function(a,c,d,f,g){if(b.call(this,g),this.type="mustache",this.strip=f,null!=d&&d.charAt){var h=d.charAt(3)||d.charAt(2);this.escaped="{"!==h&&"&"!==h}else this.escaped=!!d;this.sexpr=a instanceof e.SexprNode?a:new e.SexprNode(a,c),this.
 id=this.sexpr.id,this.params=this.sexpr.params,this.hash=this.sexpr.hash,this.eligibleHelper=this.sexpr.eligibleHelper,this.isHelper=this.sexpr.isHelper},SexprNode:function(a,c,d){b.call(this,d),this.type="sexpr",this.hash=c;var e=this.id=a[0],f=this.params=a.slice(1);this.isHelper=!(!f.length&&!c),this.eligibleHelper=this.isHelper||e.isSimple},PartialNode:function(a,c,d,e,f){b.call(this,f),this.type="partial",this.partialName=a,this.context=c,this.hash=d,this.strip=e,this.strip.inlineStandalone=!0},BlockNode:function(a,c,d,e,f){b.call(this,f),this.type="block",this.mustache=a,this.program=c,this.inverse=d,this.strip=e,d&&!c&&(this.isInverse=!0)},RawBlockNode:function(a,c,f,g){if(b.call(this,g),a.sexpr.id.original!==f)throw new d(a.sexpr.id.original+" doesn't match "+f,this);c=new e.ContentNode(c,g),this.type="block",this.mustache=a,this.program=new e.ProgramNode([c],{},g)},ContentNode:function(a,c){b.call(this,c),this.type="content",this.original=this.string=a},HashNode:function(a,
 c){b.call(this,c),this.type="hash",this.pairs=a},IdNode:function(a,c){b.call(this,c),this.type="ID";for(var e="",f=[],g=0,h="",i=0,j=a.length;j>i;i++){var k=a[i].part;if(e+=(a[i].separator||"")+k,".."===k||"."===k||"this"===k){if(f.length>0)throw new d("Invalid path: "+e,this);".."===k?(g++,h+="../"):this.isScoped=!0}else f.push(k)}this.original=e,this.parts=f,this.string=f.join("."),this.depth=g,this.idName=h+this.string,this.isSimple=1===a.length&&!this.isScoped&&0===g,this.stringModeValue=this.string},PartialNameNode:function(a,c){b.call(this,c),this.type="PARTIAL_NAME",this.name=a.original},DataNode:function(a,c){b.call(this,c),this.type="DATA",this.id=a,this.stringModeValue=a.stringModeValue,this.idName="@"+a.stringModeValue},StringNode:function(a,c){b.call(this,c),this.type="STRING",this.original=this.string=this.stringModeValue=a},NumberNode:function(a,c){b.call(this,c),this.type="NUMBER",this.original=this.number=a,this.stringModeValue=Number(a)},BooleanNode:function(a,c){b.
 call(this,c),this.type="BOOLEAN",this.bool=a,this.stringModeValue="true"===a},CommentNode:function(a,c){b.call(this,c),this.type="comment",this.comment=a,this.strip={inlineStandalone:!0}}};return c=e}(c),h=function(){"use strict";var a,b=function(){function a(){this.yy={}}var b={trace:function(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,program_repetition0:6,statement:7,mustache:8,block:9,rawBlock:10,partial:11,CONTENT:12,COMMENT:13,openRawBlock:14,END_RAW_BLOCK:15,OPEN_RAW_BLOCK:16,sexpr:17,CLOSE_RAW_BLOCK:18,openBlock:19,block_option0:20,closeBlock:21,openInverse:22,block_option1:23,OPEN_BLOCK:24,CLOSE:25,OPEN_INVERSE:26,inverseAndProgram:27,INVERSE:28,OPEN_ENDBLOCK:29,path:30,OPEN:31,OPEN_UNESCAPED:32,CLOSE_UNESCAPED:33,OPEN_PARTIAL:34,partialName:35,param:36,partial_option0:37,partial_option1:38,sexpr_repetition0:39,sexpr_option0:40,dataName:41,STRING:42,NUMBER:43,BOOLEAN:44,OPEN_SEXPR:45,CLOSE_SEXPR:46,hash:47,hash_repetition_plus0:48,hashSegment:49,ID:50,EQUALS:51,DATA:
 52,pathSegments:53,SEP:54,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",12:"CONTENT",13:"COMMENT",15:"END_RAW_BLOCK",16:"OPEN_RAW_BLOCK",18:"CLOSE_RAW_BLOCK",24:"OPEN_BLOCK",25:"CLOSE",26:"OPEN_INVERSE",28:"INVERSE",29:"OPEN_ENDBLOCK",31:"OPEN",32:"OPEN_UNESCAPED",33:"CLOSE_UNESCAPED",34:"OPEN_PARTIAL",42:"STRING",43:"NUMBER",44:"BOOLEAN",45:"OPEN_SEXPR",46:"CLOSE_SEXPR",50:"ID",51:"EQUALS",52:"DATA",54:"SEP"},productions_:[0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[10,3],[14,3],[9,4],[9,4],[19,3],[22,3],[27,2],[21,3],[8,3],[8,3],[11,5],[11,4],[17,3],[17,1],[36,1],[36,1],[36,1],[36,1],[36,1],[36,3],[47,1],[49,3],[35,1],[35,1],[35,1],[41,2],[30,1],[53,3],[53,1],[6,0],[6,2],[20,0],[20,1],[23,0],[23,1],[37,0],[37,1],[38,0],[38,1],[39,0],[39,2],[40,0],[40,1],[48,1],[48,2]],performAction:function(a,b,c,d,e,f){var g=f.length-1;switch(e){case 1:return d.prepareProgram(f[g-1].statements,!0),f[g-1];case 2:this.$=new d.ProgramNode(d.prepareProgram(f[g]),{},this._$);break;case 3:this
 .$=f[g];break;case 4:this.$=f[g];break;case 5:this.$=f[g];break;case 6:this.$=f[g];break;case 7:this.$=new d.ContentNode(f[g],this._$);break;case 8:this.$=new d.CommentNode(f[g],this._$);break;case 9:this.$=new d.RawBlockNode(f[g-2],f[g-1],f[g],this._$);break;case 10:this.$=new d.MustacheNode(f[g-1],null,"","",this._$);break;case 11:this.$=d.prepareBlock(f[g-3],f[g-2],f[g-1],f[g],!1,this._$);break;case 12:this.$=d.prepareBlock(f[g-3],f[g-2],f[g-1],f[g],!0,this._$);break;case 13:this.$=new d.MustacheNode(f[g-1],null,f[g-2],d.stripFlags(f[g-2],f[g]),this._$);break;case 14:this.$=new d.MustacheNode(f[g-1],null,f[g-2],d.stripFlags(f[g-2],f[g]),this._$);break;case 15:this.$={strip:d.stripFlags(f[g-1],f[g-1]),program:f[g]};break;case 16:this.$={path:f[g-1],strip:d.stripFlags(f[g-2],f[g])};break;case 17:this.$=new d.MustacheNode(f[g-1],null,f[g-2],d.stripFlags(f[g-2],f[g]),this._$);break;case 18:this.$=new d.MustacheNode(f[g-1],null,f[g-2],d.stripFlags(f[g-2],f[g]),this._$);break;case 19:t
 his.$=new d.PartialNode(f[g-3],f[g-2],f[g-1],d.stripFlags(f[g-4],f[g]),this._$);break;case 20:this.$=new d.PartialNode(f[g-2],void 0,f[g-1],d.stripFlags(f[g-3],f[g]),this._$);break;case 21:this.$=new d.SexprNode([f[g-2]].concat(f[g-1]),f[g],this._$);break;case 22:this.$=new d.SexprNode([f[g]],null,this._$);break;case 23:this.$=f[g];break;case 24:this.$=new d.StringNode(f[g],this._$);break;case 25:this.$=new d.NumberNode(f[g],this._$);break;case 26:this.$=new d.BooleanNode(f[g],this._$);break;case 27:this.$=f[g];break;case 28:f[g-1].isHelper=!0,this.$=f[g-1];break;case 29:this.$=new d.HashNode(f[g],this._$);break;case 30:this.$=[f[g-2],f[g]];break;case 31:this.$=new d.PartialNameNode(f[g],this._$);break;case 32:this.$=new d.PartialNameNode(new d.StringNode(f[g],this._$),this._$);break;case 33:this.$=new d.PartialNameNode(new d.NumberNode(f[g],this._$));break;case 34:this.$=new d.DataNode(f[g],this._$);break;case 35:this.$=new d.IdNode(f[g],this._$);break;case 36:f[g-2].push({part:f[g
 ],separator:f[g-1]}),this.$=f[g-2];break;case 37:this.$=[{part:f[g]}];break;case 38:this.$=[];break;case 39:f[g-1].push(f[g]);break;case 48:this.$=[];break;case 49:f[g-1].push(f[g]);break;case 52:this.$=[f[g]];break;case 53:f[g-1].push(f[g])}},table:[{3:1,4:2,5:[2,38],6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],31:[2,38],32:[2,38],34:[2,38]},{1:[3]},{5:[1,4]},{5:[2,2],7:5,8:6,9:7,10:8,11:9,12:[1,10],13:[1,11],14:16,16:[1,20],19:14,22:15,24:[1,18],26:[1,19],28:[2,2],29:[2,2],31:[1,12],32:[1,13],34:[1,17]},{1:[2,1]},{5:[2,39],12:[2,39],13:[2,39],16:[2,39],24:[2,39],26:[2,39],28:[2,39],29:[2,39],31:[2,39],32:[2,39],34:[2,39]},{5:[2,3],12:[2,3],13:[2,3],16:[2,3],24:[2,3],26:[2,3],28:[2,3],29:[2,3],31:[2,3],32:[2,3],34:[2,3]},{5:[2,4],12:[2,4],13:[2,4],16:[2,4],24:[2,4],26:[2,4],28:[2,4],29:[2,4],31:[2,4],32:[2,4],34:[2,4]},{5:[2,5],12:[2,5],13:[2,5],16:[2,5],24:[2,5],26:[2,5],28:[2,5],29:[2,5],31:[2,5],32:[2,5],34:[2,5]},{5:[2,6],12:[2,6],13:[2,6],16:[2,6],24:[2,6],26:[2,6],28
 :[2,6],29:[2,6],31:[2,6],32:[2,6],34:[2,6]},{5:[2,7],12:[2,7],13:[2,7],16:[2,7],24:[2,7],26:[2,7],28:[2,7],29:[2,7],31:[2,7],32:[2,7],34:[2,7]},{5:[2,8],12:[2,8],13:[2,8],16:[2,8],24:[2,8],26:[2,8],28:[2,8],29:[2,8],31:[2,8],32:[2,8],34:[2,8]},{17:21,30:22,41:23,50:[1,26],52:[1,25],53:24},{17:27,30:22,41:23,50:[1,26],52:[1,25],53:24},{4:28,6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],28:[2,38],29:[2,38],31:[2,38],32:[2,38],34:[2,38]},{4:29,6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],28:[2,38],29:[2,38],31:[2,38],32:[2,38],34:[2,38]},{12:[1,30]},{30:32,35:31,42:[1,33],43:[1,34],50:[1,26],53:24},{17:35,30:22,41:23,50:[1,26],52:[1,25],53:24},{17:36,30:22,41:23,50:[1,26],52:[1,25],53:24},{17:37,30:22,41:23,50:[1,26],52:[1,25],53:24},{25:[1,38]},{18:[2,48],25:[2,48],33:[2,48],39:39,42:[2,48],43:[2,48],44:[2,48],45:[2,48],46:[2,48],50:[2,48],52:[2,48]},{18:[2,22],25:[2,22],33:[2,22],46:[2,22]},{18:[2,35],25:[2,35],33:[2,35],42:[2,35],43:[2,35],44:[2,35],45:[2,35],46:[2,
 35],50:[2,35],52:[2,35],54:[1,40]},{30:41,50:[1,26],53:24},{18:[2,37],25:[2,37],33:[2,37],42:[2,37],43:[2,37],44:[2,37],45:[2,37],46:[2,37],50:[2,37],52:[2,37],54:[2,37]},{33:[1,42]},{20:43,27:44,28:[1,45],29:[2,40]},{23:46,27:47,28:[1,45],29:[2,42]},{15:[1,48]},{25:[2,46],30:51,36:49,38:50,41:55,42:[1,52],43:[1,53],44:[1,54],45:[1,56],47:57,48:58,49:60,50:[1,59],52:[1,25],53:24},{25:[2,31],42:[2,31],43:[2,31],44:[2,31],45:[2,31],50:[2,31],52:[2,31]},{25:[2,32],42:[2,32],43:[2,32],44:[2,32],45:[2,32],50:[2,32],52:[2,32]},{25:[2,33],42:[2,33],43:[2,33],44:[2,33],45:[2,33],50:[2,33],52:[2,33]},{25:[1,61]},{25:[1,62]},{18:[1,63]},{5:[2,17],12:[2,17],13:[2,17],16:[2,17],24:[2,17],26:[2,17],28:[2,17],29:[2,17],31:[2,17],32:[2,17],34:[2,17]},{18:[2,50],25:[2,50],30:51,33:[2,50],36:65,40:64,41:55,42:[1,52],43:[1,53],44:[1,54],45:[1,56],46:[2,50],47:66,48:58,49:60,50:[1,59],52:[1,25],53:24},{50:[1,67]},{18:[2,34],25:[2,34],33:[2,34],42:[2,34],43:[2,34],44:[2,34],45:[2,34],46:[2,34],50:[2,34
 ],52:[2,34]},{5:[2,18],12:[2,18],13:[2,18],16:[2,18],24:[2,18],26:[2,18],28:[2,18],29:[2,18],31:[2,18],32:[2,18],34:[2,18]},{21:68,29:[1,69]},{29:[2,41]},{4:70,6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],29:[2,38],31:[2,38],32:[2,38],34:[2,38]},{21:71,29:[1,69]},{29:[2,43]},{5:[2,9],12:[2,9],13:[2,9],16:[2,9],24:[2,9],26:[2,9],28:[2,9],29:[2,9],31:[2,9],32:[2,9],34:[2,9]},{25:[2,44],37:72,47:73,48:58,49:60,50:[1,74]},{25:[1,75]},{18:[2,23],25:[2,23],33:[2,23],42:[2,23],43:[2,23],44:[2,23],45:[2,23],46:[2,23],50:[2,23],52:[2,23]},{18:[2,24],25:[2,24],33:[2,24],42:[2,24],43:[2,24],44:[2,24],45:[2,24],46:[2,24],50:[2,24],52:[2,24]},{18:[2,25],25:[2,25],33:[2,25],42:[2,25],43:[2,25],44:[2,25],45:[2,25],46:[2,25],50:[2,25],52:[2,25]},{18:[2,26],25:[2,26],33:[2,26],42:[2,26],43:[2,26],44:[2,26],45:[2,26],46:[2,26],50:[2,26],52:[2,26]},{18:[2,27],25:[2,27],33:[2,27],42:[2,27],43:[2,27],44:[2,27],45:[2,27],46:[2,27],50:[2,27],52:[2,27]},{17:76,30:22,41:23,50:[1,26],52:[1,25],53:24
 },{25:[2,47]},{18:[2,29],25:[2,29],33:[2,29],46:[2,29],49:77,50:[1,74]},{18:[2,37],25:[2,37],33:[2,37],42:[2,37],43:[2,37],44:[2,37],45:[2,37],46:[2,37],50:[2,37],51:[1,78],52:[2,37],54:[2,37]},{18:[2,52],25:[2,52],33:[2,52],46:[2,52],50:[2,52]},{12:[2,13],13:[2,13],16:[2,13],24:[2,13],26:[2,13],28:[2,13],29:[2,13],31:[2,13],32:[2,13],34:[2,13]},{12:[2,14],13:[2,14],16:[2,14],24:[2,14],26:[2,14],28:[2,14],29:[2,14],31:[2,14],32:[2,14],34:[2,14]},{12:[2,10]},{18:[2,21],25:[2,21],33:[2,21],46:[2,21]},{18:[2,49],25:[2,49],33:[2,49],42:[2,49],43:[2,49],44:[2,49],45:[2,49],46:[2,49],50:[2,49],52:[2,49]},{18:[2,51],25:[2,51],33:[2,51],46:[2,51]},{18:[2,36],25:[2,36],33:[2,36],42:[2,36],43:[2,36],44:[2,36],45:[2,36],46:[2,36],50:[2,36],52:[2,36],54:[2,36]},{5:[2,11],12:[2,11],13:[2,11],16:[2,11],24:[2,11],26:[2,11],28:[2,11],29:[2,11],31:[2,11],32:[2,11],34:[2,11]},{30:79,50:[1,26],53:24},{29:[2,15]},{5:[2,12],12:[2,12],13:[2,12],16:[2,12],24:[2,12],26:[2,12],28:[2,12],29:[2,12],31:[2,12],
 32:[2,12],34:[2,12]},{25:[1,80]},{25:[2,45]},{51:[1,78]},{5:[2,20],12:[2,20],13:[2,20],16:[2,20],24:[2,20],26:[2,20],28:[2,20],29:[2,20],31:[2,20],32:[2,20],34:[2,20]},{46:[1,81]},{18:[2,53],25:[2,53],33:[2,53],46:[2,53],50:[2,53]},{30:51,36:82,41:55,42:[1,52],43:[1,53],44:[1,54],45:[1,56],50:[1,26],52:[1,25],53:24},{25:[1,83]},{5:[2,19],12:[2,19],13:[2,19],16:[2,19],24:[2,19],26:[2,19],28:[2,19],29:[2,19],31:[2,19],32:[2,19],34:[2,19]},{18:[2,28],25:[2,28],33:[2,28],42:[2,28],43:[2,28],44:[2,28],45:[2,28],46:[2,28],50:[2,28],52:[2,28]},{18:[2,30],25:[2,30],33:[2,30],46:[2,30],50:[2,30]},{5:[2,16],12:[2,16],13:[2,16],16:[2,16],24:[2,16],26:[2,16],28:[2,16],29:[2,16],31:[2,16],32:[2,16],34:[2,16]}],defaultActions:{4:[2,1],44:[2,41],47:[2,43],57:[2,47],63:[2,10],70:[2,15],73:[2,45]},parseError:function(a){throw new Error(a)},parse:function(a){function b(){var a;return a=c.lexer.lex()||1,"number"!=typeof a&&(a=c.symbols_[a]||a),a}var c=this,d=[0],e=[null],f=[],g=this.table,h="",i=0,j=0
 ,k=0;this.lexer.setInput(a),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,"undefined"==typeof this.lexer.yylloc&&(this.lexer.yylloc={});var l=this.lexer.yylloc;f.push(l);var m=this.lexer.options&&this.lexer.options.ranges;"function"==typeof this.yy.parseError&&(this.parseError=this.yy.parseError);for(var n,o,p,q,r,s,t,u,v,w={};;){if(p=d[d.length-1],this.defaultActions[p]?q=this.defaultActions[p]:((null===n||"undefined"==typeof n)&&(n=b()),q=g[p]&&g[p][n]),"undefined"==typeof q||!q.length||!q[0]){var x="";if(!k){v=[];for(s in g[p])this.terminals_[s]&&s>2&&v.push("'"+this.terminals_[s]+"'");x=this.lexer.showPosition?"Parse error on line "+(i+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+v.join(", ")+", got '"+(this.terminals_[n]||n)+"'":"Parse error on line "+(i+1)+": Unexpected "+(1==n?"end of input":"'"+(this.terminals_[n]||n)+"'"),this.parseError(x,{text:this.lexer.match,token:this.terminals_[n]||n,line:this.lexer.yylineno,loc:l,expected:v})}}if(q[0]instanc
 eof Array&&q.length>1)throw new Error("Parse Error: multiple actions possible at state: "+p+", token: "+n);switch(q[0]){case 1:d.push(n),e.push(this.lexer.yytext),f.push(this.lexer.yylloc),d.push(q[1]),n=null,o?(n=o,o=null):(j=this.lexer.yyleng,h=this.lexer.yytext,i=this.lexer.yylineno,l=this.lexer.yylloc,k>0&&k--);break;case 2:if(t=this.productions_[q[1]][1],w.$=e[e.length-t],w._$={first_line:f[f.length-(t||1)].first_line,last_line:f[f.length-1].last_line,first_column:f[f.length-(t||1)].first_column,last_column:f[f.length-1].last_column},m&&(w._$.range=[f[f.length-(t||1)].range[0],f[f.length-1].range[1]]),r=this.performAction.call(w,h,j,i,this.yy,q[1],e,f),"undefined"!=typeof r)return r;t&&(d=d.slice(0,-1*t*2),e=e.slice(0,-1*t),f=f.slice(0,-1*t)),d.push(this.productions_[q[1]][0]),e.push(w.$),f.push(w._$),u=g[d[d.length-2]][d[d.length-1]],d.push(u);break;case 3:return!0}}return!0}},c=function(){var a={EOF:1,parseError:function(a,b){if(!this.yy.parser)throw new Error(a);this.yy.pars
 er.parseError(a,b)},setInput:function(a){return this._input=a,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var a=this._input[0];this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a;var b=a.match(/(?:\r\n?|\n).*/g);return b?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a},unput:function(a){var b=a.length,c=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-b-1),this.offset-=b;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),c.length-1&&(this.yylineno-=c.length-1);var e=this.yylloc
 .range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===d.length?this.yylloc.first_column:0)+d[d.length-c.length].length-c[0].length:this.yylloc.first_column-b},this.options.ranges&&(this.yylloc.range=[e[0],e[0]+this.yyleng-b]),this},more:function(){return this._more=!0,this},less:function(a){this.unput(this.match.slice(a))},pastInput:function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var a=this.pastInput(),b=new Array(a.length+1).join("-");return a+this.upcomingInput()+"\n"+b+"^"},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var a,b,c,d,e;this._more||(this.yytext="",this.match="");for(var f=th
 is._currentRules(),g=0;g<f.length&&(c=this._input.match(this.rules[f[g]]),!c||b&&!(c[0].length>b[0].length)||(b=c,d=g,this.options.flex));g++);return b?(e=b[0].match(/(?:\r\n?|\n).*/g),e&&(this.yylineno+=e.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:e?e[e.length-1].length-e[e.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+b[0].length},this.yytext+=b[0],this.match+=b[0],this.matches=b,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(b[0].length),this.matched+=b[0],a=this.performAction.call(this,this.yy,this,f[d],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),a?a:void 0):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},le
 x:function(){var a=this.next();return"undefined"!=typeof a?a:this.lex()},begin:function(a){this.conditionStack.push(a)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(a){this.begin(a)}};return a.options={},a.performAction=function(a,b,c,d){function e(a,c){return b.yytext=b.yytext.substr(a,b.yyleng-c)}switch(c){case 0:if("\\\\"===b.yytext.slice(-2)?(e(0,1),this.begin("mu")):"\\"===b.yytext.slice(-1)?(e(0,1),this.begin("emu")):this.begin("mu"),b.yytext)return 12;break;case 1:return 12;case 2:return this.popState(),12;case 3:return b.yytext=b.yytext.substr(5,b.yyleng-9),this.popState(),15;case 4:return 12;case 5:return e(0,4),this.popState(),13;case 6:return 45;case 7:return 46;case 8:return 16;case 9:return this.popState(),this.begin("raw"),18;case 10:return 34;case 11:return 24
 ;case 12:return 29;case 13:return this.popState(),28;case 14:return this.popState(),28;case 15:return 26;case 16:return 26;case 17:return 32;case 18:return 31;case 19:this.popState(),this.begin("com");break;case 20:return e(3,5),this.popState(),13;case 21:return 31;case 22:return 51;case 23:return 50;case 24:return 50;case 25:return 54;case 26:break;case 27:return this.popState(),33;case 28:return this.popState(),25;case 29:return b.yytext=e(1,2).replace(/\\"/g,'"'),42;case 30:return b.yytext=e(1,2).replace(/\\'/g,"'"),42;case 31:return 52;case 32:return 44;case 33:return 44;case 34:return 43;case 35:return 50;case 36:return b.yytext=e(1,2),50;case 37:return"INVALID";case 38:return 5}},a.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]*?(?=(\{\{\{\{\/)))/,/^(?:[\s\S]*?--\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{
 (~)?#)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{!--)/,/^(?:\{\{![\s\S]*?\}\})/,/^(?:\{\{(~)?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)]))))/,/^(?:\[[^\]]*\])/,/^(?:.)/,/^(?:$)/],a.conditions={mu:{rules:[6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[5],inclusive:!1},raw:{rules:[3,4],inclusive:!1},INITIAL:{rules:[0,1,38],inclusive:!0}},a}();return b.lexer=c,a.prototype=b,b.Parser=a,new a}();return a=b}(),i=function(a){"use strict";function b(a,b){return{left:"~"===a.charAt(2),right:"~"===b.charAt
 (b.length-3)}}function c(a,b,c,d,i,k){if(a.sexpr.id.original!==d.path.original)throw new j(a.sexpr.id.original+" doesn't match "+d.path.original,a);var l=c&&c.program,m={left:a.strip.left,right:d.strip.right,openStandalone:f(b.statements),closeStandalone:e((l||b).statements)};if(a.strip.right&&g(b.statements,null,!0),l){var n=c.strip;n.left&&h(b.statements,null,!0),n.right&&g(l.statements,null,!0),d.strip.left&&h(l.statements,null,!0),e(b.statements)&&f(l.statements)&&(h(b.statements),g(l.statements))}else d.strip.left&&h(b.statements,null,!0);return i?new this.BlockNode(a,l,b,m,k):new this.BlockNode(a,b,l,m,k)}function d(a,b){for(var c=0,d=a.length;d>c;c++){var i=a[c],j=i.strip;if(j){var k=e(a,c,b,"partial"===i.type),l=f(a,c,b),m=j.openStandalone&&k,n=j.closeStandalone&&l,o=j.inlineStandalone&&k&&l;j.right&&g(a,c,!0),j.left&&h(a,c,!0),o&&(g(a,c),h(a,c)&&"partial"===i.type&&(i.indent=/([ \t]+$)/.exec(a[c-1].original)?RegExp.$1:"")),m&&(g((i.program||i.inverse).statements),h(a,c)),n&
 &(g(a,c),h((i.inverse||i.program).statements))}}return a}function e(a,b,c){void 0===b&&(b=a.length);var d=a[b-1],e=a[b-2];return d?"content"===d.type?(e||!c?/\r?\n\s*?$/:/(^|\r?\n)\s*?$/).test(d.original):void 0:c}function f(a,b,c){void 0===b&&(b=-1);var d=a[b+1],e=a[b+2];return d?"content"===d.type?(e||!c?/^\s*?\r?\n/:/^\s*?(\r?\n|$)/).test(d.original):void 0:c}function g(a,b,c){var d=a[null==b?0:b+1];if(d&&"content"===d.type&&(c||!d.rightStripped)){var e=d.string;d.string=d.string.replace(c?/^\s+/:/^[ \t]*\r?\n?/,""),d.rightStripped=d.string!==e}}function h(a,b,c){var d=a[null==b?a.length-1:b-1];if(d&&"content"===d.type&&(c||!d.leftStripped)){var e=d.string;return d.string=d.string.replace(c?/\s+$/:/[ \t]+$/,""),d.leftStripped=d.string!==e,d.leftStripped}}var i={},j=a;return i.stripFlags=b,i.prepareBlock=c,i.prepareProgram=d,i}(c),j=function(a,b,c,d){"use strict";function e(a){return a.constructor===h.ProgramNode?a:(g.yy=k,g.parse(a))}var f={},g=a,h=b,i=c,j=d.extend;f.parser=g;var
  k={};return j(k,i,h),f.parse=e,f}(h,g,i,b),k=function(a,b){"use strict";function c(){}function d(a,b,c){if(null==a||"string"!=typeof a&&a.constructor!==c.AST.ProgramNode)throw new h("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+a);b=b||{},"data"in b||(b.data=!0),b.compat&&(b.useDepths=!0);var d=c.parse(a),e=(new c.Compiler).compile(d,b);return(new c.JavaScriptCompiler).compile(e,b)}function e(a,b,c){function d(){var d=c.parse(a),e=(new c.Compiler).compile(d,b),f=(new c.JavaScriptCompiler).compile(e,b,void 0,!0);return c.template(f)}if(null==a||"string"!=typeof a&&a.constructor!==c.AST.ProgramNode)throw new h("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+a);b=b||{},"data"in b||(b.data=!0),b.compat&&(b.useDepths=!0);var e,f=function(a,b){return e||(e=d()),e.call(this,a,b)};return f._setup=function(a){return e||(e=d()),e._setup(a)},f._child=function(a,b,c){return e||(e=d()),e._child(a,b,c)},f}function f(a,b){if(a===b)r
 eturn!0;if(i(a)&&i(b)&&a.length===b.length){for(var c=0;c<a.length;c++)if(!f(a[c],b[c]))return!1;return!0}}var g={},h=a,i=b.isArray,j=[].slice;return g.Compiler=c,c.prototype={compiler:c,equals:function(a){var b=this.opcodes.length;if(a.opcodes.length!==b)return!1;for(var c=0;b>c;c++){var d=this.opcodes[c],e=a.opcodes[c];if(d.opcode!==e.opcode||!f(d.args,e.args))return!1}for(b=this.children.length,c=0;b>c;c++)if(!this.children[c].equals(a.children[c]))return!1;return!0},guid:0,compile:function(a,b){this.opcodes=[],this.children=[],this.depths={list:[]},this.options=b,this.stringParams=b.stringParams,this.trackIds=b.trackIds;var c=this.options.knownHelpers;if(this.options.knownHelpers={helperMissing:!0,blockHelperMissing:!0,each:!0,"if":!0,unless:!0,"with":!0,log:!0,lookup:!0},c)for(var d in c)this.options.knownHelpers[d]=c[d];return this.accept(a)},accept:function(a){return this[a.type](a)},program:function(a){for(var b=a.statements,c=0,d=b.length;d>c;c++)this.accept(b[c]);return th
 is.isSimple=1===d,this.depths.list=this.depths.list.sort(function(a,b){return a-b}),this},compileProgram:function(a){var b,c=(new this.compiler).compile(a,this.options),d=this.guid++;
-this.usePartial=this.usePartial||c.usePartial,this.children[d]=c;for(var e=0,f=c.depths.list.length;f>e;e++)b=c.depths.list[e],2>b||this.addDepth(b-1);return d},block:function(a){var b=a.mustache,c=a.program,d=a.inverse;c&&(c=this.compileProgram(c)),d&&(d=this.compileProgram(d));var e=b.sexpr,f=this.classifySexpr(e);"helper"===f?this.helperSexpr(e,c,d):"simple"===f?(this.simpleSexpr(e),this.opcode("pushProgram",c),this.opcode("pushProgram",d),this.opcode("emptyHash"),this.opcode("blockValue",e.id.original)):(this.ambiguousSexpr(e,c,d),this.opcode("pushProgram",c),this.opcode("pushProgram",d),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue")),this.opcode("append")},hash:function(a){var b,c,d=a.pairs;for(this.opcode("pushHash"),b=0,c=d.length;c>b;b++)this.pushParam(d[b][1]);for(;b--;)this.opcode("assignToHash",d[b][0]);this.opcode("popHash")},partial:function(a){var b=a.partialName;this.usePartial=!0,a.hash?this.accept(a.hash):this.opcode("push","undefined"),a.context?this.a
 ccept(a.context):(this.opcode("getContext",0),this.opcode("pushContext")),this.opcode("invokePartial",b.name,a.indent||""),this.opcode("append")},content:function(a){a.string&&this.opcode("appendContent",a.string)},mustache:function(a){this.sexpr(a.sexpr),a.escaped&&!this.options.noEscape?this.opcode("appendEscaped"):this.opcode("append")},ambiguousSexpr:function(a,b,c){var d=a.id,e=d.parts[0],f=null!=b||null!=c;this.opcode("getContext",d.depth),this.opcode("pushProgram",b),this.opcode("pushProgram",c),this.ID(d),this.opcode("invokeAmbiguous",e,f)},simpleSexpr:function(a){var b=a.id;"DATA"===b.type?this.DATA(b):b.parts.length?this.ID(b):(this.addDepth(b.depth),this.opcode("getContext",b.depth),this.opcode("pushContext")),this.opcode("resolvePossibleLambda")},helperSexpr:function(a,b,c){var d=this.setupFullMustacheParams(a,b,c),e=a.id,f=e.parts[0];if(this.options.knownHelpers[f])this.opcode("invokeKnownHelper",d.length,f);else{if(this.options.knownHelpersOnly)throw new h("You specifi
 ed knownHelpersOnly, but used the unknown helper "+f,a);e.falsy=!0,this.ID(e),this.opcode("invokeHelper",d.length,e.original,e.isSimple)}},sexpr:function(a){var b=this.classifySexpr(a);"simple"===b?this.simpleSexpr(a):"helper"===b?this.helperSexpr(a):this.ambiguousSexpr(a)},ID:function(a){this.addDepth(a.depth),this.opcode("getContext",a.depth);var b=a.parts[0];b?this.opcode("lookupOnContext",a.parts,a.falsy,a.isScoped):this.opcode("pushContext")},DATA:function(a){this.options.data=!0,this.opcode("lookupData",a.id.depth,a.id.parts)},STRING:function(a){this.opcode("pushString",a.string)},NUMBER:function(a){this.opcode("pushLiteral",a.number)},BOOLEAN:function(a){this.opcode("pushLiteral",a.bool)},comment:function(){},opcode:function(a){this.opcodes.push({opcode:a,args:j.call(arguments,1)})},addDepth:function(a){0!==a&&(this.depths[a]||(this.depths[a]=!0,this.depths.list.push(a)))},classifySexpr:function(a){var b=a.isHelper,c=a.eligibleHelper,d=this.options;if(c&&!b){var e=a.id.parts[
 0];d.knownHelpers[e]?b=!0:d.knownHelpersOnly&&(c=!1)}return b?"helper":c?"ambiguous":"simple"},pushParams:function(a){for(var b=0,c=a.length;c>b;b++)this.pushParam(a[b])},pushParam:function(a){this.stringParams?(a.depth&&this.addDepth(a.depth),this.opcode("getContext",a.depth||0),this.opcode("pushStringParam",a.stringModeValue,a.type),"sexpr"===a.type&&this.sexpr(a)):(this.trackIds&&this.opcode("pushId",a.type,a.idName||a.stringModeValue),this.accept(a))},setupFullMustacheParams:function(a,b,c){var d=a.params;return this.pushParams(d),this.opcode("pushProgram",b),this.opcode("pushProgram",c),a.hash?this.hash(a.hash):this.opcode("emptyHash"),d}},g.precompile=d,g.compile=e,g}(c,b),l=function(a,b){"use strict";function c(a){this.value=a}function d(){}var e,f=a.COMPILER_REVISION,g=a.REVISION_CHANGES,h=b;d.prototype={nameLookup:function(a,b){return d.isValidJavaScriptVariableName(b)?a+"."+b:a+"['"+b+"']"},depthedLookup:function(a){return this.aliases.lookup="this.lookup",'lookup(depths, 
 "'+a+'")'},compilerInfo:function(){var a=f,b=g[a];return[a,b]},appendToBuffer:function(a){return this.environment.isSimple?"return "+a+";":{appendToBuffer:!0,content:a,toString:function(){return"buffer += "+a+";"}}},initializeBuffer:function(){return this.quotedString("")},namespace:"Handlebars",compile:function(a,b,c,d){this.environment=a,this.options=b,this.stringParams=this.options.stringParams,this.trackIds=this.options.trackIds,this.precompile=!d,this.name=this.environment.name,this.isChild=!!c,this.context=c||{programs:[],environments:[]},this.preamble(),this.stackSlot=0,this.stackVars=[],this.aliases={},this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.compileChildren(a,b),this.useDepths=this.useDepths||a.depths.list.length||this.options.compat;var e,f,g,i=a.opcodes;for(f=0,g=i.length;g>f;f++)e=i[f],this[e.opcode].apply(this,e.args);if(this.pushSource(""),this.stackSlot||this.inlineStack.length||this.compileStack.length)throw new h("Compile
  completed with content left on stack");var j=this.createFunctionContext(d);if(this.isChild)return j;var k={compiler:this.compilerInfo(),main:j},l=this.context.programs;for(f=0,g=l.length;g>f;f++)l[f]&&(k[f]=l[f]);return this.environment.usePartial&&(k.usePartial=!0),this.options.data&&(k.useData=!0),this.useDepths&&(k.useDepths=!0),this.options.compat&&(k.compat=!0),d||(k.compiler=JSON.stringify(k.compiler),k=this.objectLiteral(k)),k},preamble:function(){this.lastContext=0,this.source=[]},createFunctionContext:function(a){var b="",c=this.stackVars.concat(this.registers.list);c.length>0&&(b+=", "+c.join(", "));for(var d in this.aliases)this.aliases.hasOwnProperty(d)&&(b+=", "+d+"="+this.aliases[d]);var e=["depth0","helpers","partials","data"];this.useDepths&&e.push("depths");var f=this.mergeSource(b);return a?(e.push(f),Function.apply(this,e)):"function("+e.join(",")+") {\n  "+f+"}"},mergeSource:function(a){for(var b,c,d="",e=!this.forceBuffer,f=0,g=this.source.length;g>f;f++){var h
 =this.source[f];h.appendToBuffer?b=b?b+"\n    + "+h.content:h.content:(b&&(d?d+="buffer += "+b+";\n  ":(c=!0,d=b+";\n  "),b=void 0),d+=h+"\n  ",this.environment.isSimple||(e=!1))}return e?(b||!d)&&(d+="return "+(b||'""')+";\n"):(a+=", buffer = "+(c?"":this.initializeBuffer()),d+=b?"return buffer + "+b+";\n":"return buffer;\n"),a&&(d="var "+a.substring(2)+(c?"":";\n  ")+d),d},blockValue:function(a){this.aliases.blockHelperMissing="helpers.blockHelperMissing";var b=[this.contextName(0)];this.setupParams(a,0,b);var c=this.popStack();b.splice(1,0,c),this.push("blockHelperMissing.call("+b.join(", ")+")")},ambiguousBlockValue:function(){this.aliases.blockHelperMissing="helpers.blockHelperMissing";var a=[this.contextName(0)];this.setupParams("",0,a,!0),this.flushInline();var b=this.topStack();a.splice(1,0,b),this.pushSource("if (!"+this.lastHelper+") { "+b+" = blockHelperMissing.call("+a.join(", ")+"); }")},appendContent:function(a){this.pendingContent&&(a=this.pendingContent+a),this.pendi
 ngContent=a},append:function(){this.flushInline();var a=this.popStack();this.pushSource("if ("+a+" != null) { "+this.appendToBuffer(a)+" }"),this.environment.isSimple&&this.pushSource("else { "+this.appendToBuffer("''")+" }")},appendEscaped:function(){this.aliases.escapeExpression="this.escapeExpression",this.pushSource(this.appendToBuffer("escapeExpression("+this.popStack()+")"))},getContext:function(a){this.lastContext=a},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function(a,b,c){var d=0,e=a.length;for(c||!this.options.compat||this.lastContext?this.pushContext():this.push(this.depthedLookup(a[d++]));e>d;d++)this.replaceStack(function(c){var e=this.nameLookup(c,a[d],"context");return b?" && "+e:" != null ? "+e+" : "+c})},lookupData:function(a,b){a?this.pushStackLiteral("this.data(data, "+a+")"):this.pushStackLiteral("data");for(var c=b.length,d=0;c>d;d++)this.replaceStack(function(a){return" && "+this.nameLookup(a,b[d],"data")}
 )},resolvePossibleLambda:function(){this.aliases.lambda="this.lambda",this.push("lambda("+this.popStack()+", "+this.contextName(0)+")")},pushStringParam:function(a,b){this.pushContext(),this.pushString(b),"sexpr"!==b&&("string"==typeof a?this.pushString(a):this.pushStackLiteral(a))},emptyHash:function(){this.pushStackLiteral("{}"),this.trackIds&&this.push("{}"),this.stringParams&&(this.push("{}"),this.push("{}"))},pushHash:function(){this.hash&&this.hashes.push(this.hash),this.hash={values:[],types:[],contexts:[],ids:[]}},popHash:function(){var a=this.hash;this.hash=this.hashes.pop(),this.trackIds&&this.push("{"+a.ids.join(",")+"}"),this.stringParams&&(this.push("{"+a.contexts.join(",")+"}"),this.push("{"+a.types.join(",")+"}")),this.push("{\n    "+a.values.join(",\n    ")+"\n  }")},pushString:function(a){this.pushStackLiteral(this.quotedString(a))},push:function(a){return this.inlineStack.push(a),a},pushLiteral:function(a){this.pushStackLiteral(a)},pushProgram:function(a){null!=a?t
 his.pushStackLiteral(this.programExpression(a)):this.pushStackLiteral(null)},invokeHelper:function(a,b,c){this.aliases.helperMissing="helpers.helperMissing";var d=this.popStack(),e=this.setupHelper(a,b),f=(c?e.name+" || ":"")+d+" || helperMissing";this.push("(("+f+").call("+e.callParams+"))")},invokeKnownHelper:function(a,b){var c=this.setupHelper(a,b);this.push(c.name+".call("+c.callParams+")")},invokeAmbiguous:function(a,b){this.aliases.functionType='"function"',this.aliases.helperMissing="helpers.helperMissing",this.useRegister("helper");var c=this.popStack();this.emptyHash();var d=this.setupHelper(0,a,b),e=this.lastHelper=this.nameLookup("helpers",a,"helper");this.push("((helper = (helper = "+e+" || "+c+") != null ? helper : helperMissing"+(d.paramsInit?"),("+d.paramsInit:"")+"),(typeof helper === functionType ? helper.call("+d.callParams+") : helper))")},invokePartial:function(a,b){var c=[this.nameLookup("partials",a,"partial"),"'"+b+"'","'"+a+"'",this.popStack(),this.popStack(
 ),"helpers","partials"];this.options.data?c.push("data"):this.options.compat&&c.push("undefined"),this.options.compat&&c.push("depths"),this.push("this.invokePartial("+c.join(", ")+")")},assignToHash:function(a){var b,c,d,e=this.popStack();this.trackIds&&(d=this.popStack()),this.stringParams&&(c=this.popStack(),b=this.popStack());var f=this.hash;b&&f.contexts.push("'"+a+"': "+b),c&&f.types.push("'"+a+"': "+c),d&&f.ids.push("'"+a+"': "+d),f.values.push("'"+a+"': ("+e+")")},pushId:function(a,b){"ID"===a||"DATA"===a?this.pushString(b):"sexpr"===a?this.pushStackLiteral("true"):this.pushStackLiteral("null")},compiler:d,compileChildren:function(a,b){for(var c,d,e=a.children,f=0,g=e.length;g>f;f++){c=e[f],d=new this.compiler;var h=this.matchExistingProgram(c);null==h?(this.context.programs.push(""),h=this.context.programs.length,c.index=h,c.name="program"+h,this.context.programs[h]=d.compile(c,b,this.context,!this.precompile),this.context.environments[h]=c,this.useDepths=this.useDepths||d.
 useDepths):(c.index=h,c.name="program"+h)}},matchExistingProgram:function(a){for(var b=0,c=this.context.environments.length;c>b;b++){var d=this.context.environments[b];if(d&&d.equals(a))return b}},programExpression:function(a){var b=this.environment.children[a],c=(b.depths.list,this.useDepths),d=[b.index,"data"];return c&&d.push("depths"),"this.program("+d.join(", ")+")"},useRegister:function(a){this.registers[a]||(this.registers[a]=!0,this.registers.list.push(a))},pushStackLiteral:function(a){return this.push(new c(a))},pushSource:function(a){this.pendingContent&&(this.source.push(this.appendToBuffer(this.quotedString(this.pendingContent))),this.pendingContent=void 0),a&&this.source.push(a)},pushStack:function(a){this.flushInline();var b=this.incrStack();return this.pushSource(b+" = "+a+";"),this.compileStack.push(b),b},replaceStack:function(a){{var b,d,e,f="";this.isInline()}if(!this.isInline())throw new h("replaceStack on non-inline");var g=this.popStack(!0);if(g instanceof c)f=b
 =g.value,e=!0;else{d=!this.stackSlot;var i=d?this.incrStack():this.topStackName();f="("+this.push(i)+" = "+g+")",b=this.topStack()}var j=a.call(this,b);e||this.popStack(),d&&this.stackSlot--,this.push("("+f+j+")")},incrStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var a=this.inlineStack;if(a.length){this.inlineStack=[];for(var b=0,d=a.length;d>b;b++){var e=a[b];e instanceof c?this.compileStack.push(e):this.pushStack(e)}}},isInline:function(){return this.inlineStack.length},popStack:function(a){var b=this.isInline(),d=(b?this.inlineStack:this.compileStack).pop();if(!a&&d instanceof c)return d.value;if(!b){if(!this.stackSlot)throw new h("Invalid stack pop");this.stackSlot--}return d},topStack:function(){var a=this.isInline()?this.inlineStack:this.compileStack,b=a[a.length-1];return b instanceof c?b.value:b},conte
 xtName:function(a){return this.useDepths&&a?"depths["+a+"]":"depth"+a},quotedString:function(a){return'"'+a.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")+'"'},objectLiteral:function(a){var b=[];for(var c in a)a.hasOwnProperty(c)&&b.push(this.quotedString(c)+":"+a[c]);return"{"+b.join(",")+"}"},setupHelper:function(a,b,c){var d=[],e=this.setupParams(b,a,d,c),f=this.nameLookup("helpers",b,"helper");return{params:d,paramsInit:e,name:f,callParams:[this.contextName(0)].concat(d).join(", ")}},setupOptions:function(a,b,c){var d,e,f,g={},h=[],i=[],j=[];g.name=this.quotedString(a),g.hash=this.popStack(),this.trackIds&&(g.hashIds=this.popStack()),this.stringParams&&(g.hashTypes=this.popStack(),g.hashContexts=this.popStack()),e=this.popStack(),f=this.popStack(),(f||e)&&(f||(f="this.noop"),e||(e="this.noop"),g.fn=f,g.inverse=e);for(var k=b;k--;)d=this.popStack(),c[k]=d,this.trackIds&&(j[k]=this.popSt
 ack()),this.stringParams&&(i[k]=this.popStack(),h[k]=this.popStack());return this.trackIds&&(g.ids="["+j.join(",")+"]"),this.stringParams&&(g.types="["+i.join(",")+"]",g.contexts="["+h.join(",")+"]"),this.options.data&&(g.data="data"),g},setupParams:function(a,b,c,d){var e=this.objectLiteral(this.setupOptions(a,b,c));return d?(this.useRegister("options"),c.push("options"),"options="+e):(c.push(e),"")}};for(var i="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield".split(" "),j=d.RESERVED_WORDS={},k=0,l=i.length;l>k;k++)j[i[k]]=!0;return d.isValidJavaScriptVariableName=function(a){return!d.RESERVED_WORDS[a]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(a)},e=d}(d,c),m
 =function(a,b,c,d,e){"use strict";var f,g=a,h=b,i=c.parser,j=c.parse,k=d.Compiler,l=d.compile,m=d.precompile,n=e,o=g.create,p=function(){var a=o();return a.compile=function(b,c){return l(b,c,a)},a.precompile=function(b,c){return m(b,c,a)},a.AST=h,a.Compiler=k,a.JavaScriptCompiler=n,a.Parser=i,a.parse=j,a};return g=p(),g.create=p,g["default"]=g,f=g}(f,g,j,k,l);return m});
\ No newline at end of file


[21/51] [abbrv] [partial] brooklyn-ui git commit: move subdir from incubator up a level as it is promoted to its own repo (first non-incubator commit!)

Posted by he...@apache.org.
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/tpl/lib/basic-modal.html
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/tpl/lib/basic-modal.html b/brooklyn-ui/src/main/webapp/assets/tpl/lib/basic-modal.html
deleted file mode 100644
index c046548..0000000
--- a/brooklyn-ui/src/main/webapp/assets/tpl/lib/basic-modal.html
+++ /dev/null
@@ -1,29 +0,0 @@
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-<div class="modal-header">
-    <button type="button" class="close" data-dismiss="modal">&times;</button>
-    <h3><% if (title) { %><%= title %><% } else { %>&nbsp;<% } %></h3>
-</div>
-
-<div class="modal-body"></div>
-
-<div class="modal-footer">
-    <a href="#" class="btn" data-dismiss="modal"><%= cancelButtonText %></a>
-    <a href="#" class="btn btn-info modal-submit"><%= submitButtonText %></a>
-</div>

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/tpl/lib/config-key-type-value-input-pair.html
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/tpl/lib/config-key-type-value-input-pair.html b/brooklyn-ui/src/main/webapp/assets/tpl/lib/config-key-type-value-input-pair.html
deleted file mode 100644
index cbf88b1..0000000
--- a/brooklyn-ui/src/main/webapp/assets/tpl/lib/config-key-type-value-input-pair.html
+++ /dev/null
@@ -1,23 +0,0 @@
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-<div class="config-key-input-pair form-inline">
-    <input type="text" class="config-key-type" placeholder="Name" value="<%= type %>"/>
-    <input type="text" class="config-key-value" placeholder="Value" value="<%= value %>"/>
-    <button type="button" class="btn config-key-row-remove">-</button>
-</div>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/tpl/script/groovy.html
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/tpl/script/groovy.html b/brooklyn-ui/src/main/webapp/assets/tpl/script/groovy.html
deleted file mode 100644
index 06fc9d1..0000000
--- a/brooklyn-ui/src/main/webapp/assets/tpl/script/groovy.html
+++ /dev/null
@@ -1,93 +0,0 @@
-
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<div id="groovy-ui-container" class="single-main-container">
-
-    <div style="padding-bottom: 12px;">
-        <div><h3>Groovy Scripting</h3></div>
-    </div>
-
-    <div id="message-bar" class="label-important hide style="padding-bottom: 12px;">
-    </div>
-            
-    
-    <div class="output">
-        <div class="throbber"><img src="/assets/images/throbber.gif"/></div>
-        
-        <div class="toggler-region error">
-            <div class="toggler-header">
-                <div class="toggler-icon icon-chevron-down"></div>
-                <div><b>Error</b></div>
-            </div>
-            <div class="for-textarea"><textarea readonly="readonly" placeholder="no details available" class="code-textarea"></textarea></div>
-        </div>
-            
-        <div class="toggler-region result">
-            <div class="toggler-header">
-                <div class="toggler-icon icon-chevron-down"></div>
-                <div><b>Result</b></div>
-            </div>
-            <div class="for-textarea"><textarea readonly="readonly" placeholder="no details available" class="code-textarea"></textarea></div>
-        </div>
-
-        <div class="toggler-region stdout">
-            <div class="toggler-header">
-                <div class="toggler-icon icon-chevron-down"></div>
-                <div><b>Output (stdout)</b></div>
-            </div>
-            <div class="for-textarea"><textarea readonly="readonly" class="code-textarea"></textarea></div>
-        </div>
-
-        <div class="toggler-region stderr">
-            <div class="toggler-header">
-                <div class="toggler-icon icon-chevron-down"></div>
-                <div><b>Output (stderr)</b></div>
-            </div>
-            <div class="for-textarea"><textarea readonly="readonly" class="code-textarea"></textarea></div>
-        </div>
-    </div>
-
-    <div class="input">
-        <div class="toggler-region">
-            <div class="toggler-header">
-                <div class="toggler-icon icon-chevron-down"></div>
-                <div><b>Instructions</b></div>
-            </div>
-            
-            <div class="groovy-scripting-text">
-                Enter code to run on the Brooklyn Server.
-                <p><ul>
-                <li><code>mgmt</code> is the management context</li>
-                <li><code>last</code> is the result of your last successful script</li>
-                <li><code>data</code> is user-session map for storing your data</li>
-                </ul><p>
-                <a id="load-example">Click to load an example.</a>
-            </div>
-        </div>
-        
-        <div class="toggler-region for-textarea">
-            <textarea id="script" placeholder="Enter script here" class="code-textarea"></textarea>
-        </div>
-        <div class="submit">
-            <button id="submit" class="btn btn-info btn-mini">Submit</button>
-        </div>
-    </div>
-
-</div>

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/tpl/script/swagger.html
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/tpl/script/swagger.html b/brooklyn-ui/src/main/webapp/assets/tpl/script/swagger.html
deleted file mode 100644
index 89b2bc4..0000000
--- a/brooklyn-ui/src/main/webapp/assets/tpl/script/swagger.html
+++ /dev/null
@@ -1,30 +0,0 @@
-
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-<div class="single-main-container">
-
-<link rel="stylesheet" href="/assets/css/swagger.css">
-
-<div class="apidoc-title"> REST API Reference </div>
-<div class="throbber"><img src="/assets/images/throbber.gif"/></div>
-<div id="message-bar" class="swagger-ui-wrap">&nbsp;</div>
-
-<div id="swagger-ui-container" class="swagger-ui-wrap"></div>
-
-</div>

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/favicon.ico
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/favicon.ico b/brooklyn-ui/src/main/webapp/favicon.ico
deleted file mode 100644
index bdf37d2..0000000
Binary files a/brooklyn-ui/src/main/webapp/favicon.ico and /dev/null differ

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/index.html
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/index.html b/brooklyn-ui/src/main/webapp/index.html
deleted file mode 100644
index a7c8121..0000000
--- a/brooklyn-ui/src/main/webapp/index.html
+++ /dev/null
@@ -1,77 +0,0 @@
-<!DOCTYPE html>
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing,
-  software distributed under the License is distributed on an
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  KIND, either express or implied.  See the License for the
-  specific language governing permissions and limitations
-  under the License.
-  -->
-<!-- Brooklyn SHA-1: GIT_SHA_1 -->
-<html>
-<head>
-    <meta charset='utf-8'/>
-    <meta name="viewport" content="width=device-width, initial-scale=1.0">
-    <meta name="description" content="Brooklyn Web Console (Javascript GUI)">
-
-    <title>Brooklyn JS REST client</title>
-
-    <link rel="stylesheet" href="/assets/css/styles.css">
-    <link rel="stylesheet" href="/assets/css/brooklyn.css">
-    <style>
-        body {
-            padding-top: 60px; /* 60px to make the container go all the way to the bottom of the topbar */
-        }
-    </style>
-
-    <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
-    <!--[if lt IE 9]>
-    <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
-    <![endif]-->
-</head>
-<body>
-
-<div class="navbar navbar-fixed-top">
-    <div class="navbar-inner">
-        <div class="userName-top"><span id="user"></span> | <a href="/logout" id="logout-link">Log out</a></div>
-        <div class="container">
-            <a class="logo" href="#" title="Brooklyn, Version 0.9.0-SNAPSHOT"><!-- Logo added via CSS --></a> <!-- BROOKLYN_VERSION -->
-            <div class="menubar-top">
-                <ul class="nav">
-                    <li><a href="#v1/home" class="nav1 nav1_home">Home</a></li>
-                    <li><a href="#v1/applications" class="nav1 nav1_apps">Applications</a></li>
-                    <li><a href="#v1/catalog" class="nav1 nav1_catalog">Catalog</a></li>
-                    <li class="dropdown">
-                        <a href="#" class="nav1 nav1_script dropdown-toggle" data-toggle="dropdown">Script</a>
-                        <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
-                            <li><a href="/assets/html/swagger-ui.html" target="_blank" class="nav1 nav1_apidoc">REST API</a></li>
-                            <li><a href="#v1/script/groovy" class="nav1 nav1_groovy">Groovy</a></li>
-                        </ul>
-                    </li>
-                    <li><a href="#v1/help" class="nav1 nav1_help"><b>?</b></a></li>
-                </ul>
-            </div>
-        </div>
-    </div>
-</div>
-
-<div id="main-content">
-    <div id="application-content"></div>
-    <div id="server-caution-overlay"></div>
-</div>
-
-<!-- load our code with require.js. data-main is replaced with optimised file at build -->
-<script type="text/javascript" data-main="assets/js/config.js" src="assets/js/libs/require.js"></script>
-
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/test/javascript/config.txt
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/test/javascript/config.txt b/brooklyn-ui/src/test/javascript/config.txt
deleted file mode 100644
index 0fec281..0000000
--- a/brooklyn-ui/src/test/javascript/config.txt
+++ /dev/null
@@ -1,72 +0,0 @@
-    /*
-     * Licensed to the Apache Software Foundation (ASF) under one
-     * or more contributor license agreements.  See the NOTICE file
-     * distributed with this work for additional information
-     * regarding copyright ownership.  The ASF licenses this file
-     * to you under the Apache License, Version 2.0 (the
-     * "License"); you may not use this file except in compliance
-     * with the License.  You may obtain a copy of the License at
-     *
-     *  http://www.apache.org/licenses/LICENSE-2.0
-     *
-     * Unless required by applicable law or agreed to in writing,
-     * software distributed under the License is distributed on an
-     * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-     * KIND, either express or implied.  See the License for the
-     * specific language governing permissions and limitations
-     * under the License.
-     */
-
-    /* Custom configuration for Jasmine tests. */
-
-    /* Libraries */
-    paths:{
-        "jquery":"js/libs/jquery",
-        "underscore":"js/libs/underscore",
-        "backbone":"js/libs/backbone",
-        "bootstrap":"js/libs/bootstrap",
-        "jquery-form":"js/libs/jquery.form",
-        "jquery-datatables":"js/libs/jquery.dataTables",
-        "jquery-slideto":"js/util/jquery.slideto",
-        "jquery-wiggle":"js/libs/jquery.wiggle.min",
-        "jquery-ba-bbq":"js/libs/jquery.ba-bbq.min",
-        "moment":"js/libs/moment",
-        "handlebars":"js/libs/handlebars-1.0.rc.1",
-        "brooklyn":"js/util/brooklyn",
-        "brooklyn-view":"js/util/brooklyn-view",
-        "brooklyn-utils":"js/util/brooklyn-utils",
-        "datatables-extensions":"js/util/dataTables.extensions",
-        "googlemaps":"view/googlemaps",
-        // async deliberately excluded
-        "text":"js/libs/text",
-        "uri":"js/libs/URI",
-        "zeroclipboard":"js/libs/ZeroClipboard",
-        "js-yaml":"js/libs/js-yaml",
-
-        "model":"js/model",
-        "view":"js/view",
-        "router":"js/router"
-    },
-    shim:{
-        "underscore":{
-            exports:"_"
-        },
-        "backbone":{
-            deps:[ "underscore", "jquery" ],
-            exports:"Backbone"
-        },
-        "jquery-datatables": {
-            deps: [ "jquery" ]
-        },
-        "datatables-extensions":{
-            deps:[ "jquery", "jquery-datatables" ]
-        },
-        "jquery-form": { deps: [ "jquery" ] },
-        "jquery-slideto": { deps: [ "jquery" ] },
-        "jquery-wiggle": { deps: [ "jquery" ] },
-        "jquery-ba-bbq": { deps: [ "jquery" ] },
-        "handlebars": { deps: [ "jquery" ] },
-        "bootstrap": { deps: [ "jquery" ] /* http://stackoverflow.com/questions/9227406/bootstrap-typeerror-undefined-is-not-a-function-has-no-method-tab-when-us */ }
-    },
-    // Seconds require will wait before timing out. Defaults to seven seconds.
-    waitSeconds: 300

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/test/javascript/specs/home-spec.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/test/javascript/specs/home-spec.js b/brooklyn-ui/src/test/javascript/specs/home-spec.js
deleted file mode 100644
index 8933fb6..0000000
--- a/brooklyn-ui/src/test/javascript/specs/home-spec.js
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-/**
- * Jasmine test specs for Application Template and Template rendering. We test for HTML structure,
- * ID's, classes that we use, etc.
- *
- * Tests go like this:
- * - we test that all templates are on the page
- * - we test that the templates contain all the divs, buttons with the right id's and classes
- * - we test that rendering produces the right stuff
- */
-define([
-    "underscore", "jquery", "model/application", "model/location", "view/home"
-], function (_, $, Application, Location, HomeView) {
-
-    describe('view/home-spec', function () {
-
-        describe('view/home HomePageView', function () {
-            var view,
-                apps = new Application.Collection,
-                locs = new Location.Collection
-            apps.url = "fixtures/application-list.json"
-            apps.fetch({async:false})
-            locs.url = "fixtures/location-list.json"
-            locs.fetch({async:false})
-
-            beforeEach(function () {
-                view = new HomeView({
-                    collection:apps,
-                    locations:locs,
-                    offline:true
-                }).render()
-            })
-
-            afterEach(function () {
-                view.close()
-            })
-
-            it('should have a div#home-first-row and div#home-second-row', function () {
-                expect(view.$('div.home-first-row').length).toEqual(1)
-                expect(view.$('div.home-second-row').length).toEqual(1)
-            })
-
-            it('should contain an apps table and a new button', function () {
-                expect(view.$('div#new-application-resource').length).toEqual(1)
-                expect(view.$('div#applications').length).toEqual(1)
-            })
-
-            it('div#new-application-resource must have button#add-new-application-resource', function () {
-                expect(view.$('div button#add-new-application').length).toEqual(1)
-            })
-
-            it('div#applications must have table with tbody#applications-table-body', function () {
-                expect(view.$('div#applications table').length).toEqual(1)
-                expect(view.$('div#applications tbody#applications-table-body').length).toEqual(1)
-            })
-
-            it('must have div#modal-container', function () {
-                expect(view.$('div#modal-container').length).toEqual(1)
-            })
-        })
-
-        describe('view/home ApplicationEntryView rendering', function () {
-            var model = new Application.Model({
-                status:'STARTING',
-                spec:new Application.Spec({
-                    name:'sample',
-                    entities:[
-                        { name:'entity-01',
-                            type:'org.apache.TomcatServer'}
-                    ],
-                    locations:['/some/where/over/the/rainbow']
-                })
-            })
-            var view = new HomeView.AppEntryView({
-                model:model
-            }).render()
-
-            it('must have 2 td tags', function () {
-                expect(view.$('td').length).toEqual(2)
-            })
-
-//            it('must have a td with button.delete', function () {
-//                expect(view.$('button.delete').length).toEqual(1)
-//                expect(view.$('button.delete').parent().is('td')).toEqual(true)
-//                expect(view.$("button.delete").attr("id")).toBe(model.cid)
-//            })
-        })
-    })
-})
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/test/javascript/specs/library-spec.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/test/javascript/specs/library-spec.js b/brooklyn-ui/src/test/javascript/specs/library-spec.js
deleted file mode 100644
index 7a0421f..0000000
--- a/brooklyn-ui/src/test/javascript/specs/library-spec.js
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-/**
- * Test for availability of JavaScript functions/libraries.
- * We test for a certain version. People need to be aware they can break stuff when upgrading.
- * TODO: find a way to test bootstrap.js version ?
- */
-
-define([
-    'underscore', 'jquery', 'backbone',
-], function (_, $, Backbone) {
-
-    describe('Test the libraries', function () {
-
-        describe('underscore.js', function () {
-            it('must be version 1.4.4', function () {
-                expect(_.VERSION).toEqual('1.4.4')
-            })
-        })
-
-        describe('jquery', function () {
-            it('must be version 1.7.2', function () {
-                expect(jQuery.fn.jquery).toEqual('1.7.2')
-                expect(jQuery).toEqual($);
-            })
-        })
-
-        describe('backbone', function () {
-            it('must be version 1.0.0', function () {
-                expect(Backbone.VERSION).toEqual('1.0.0')
-            })
-        })
-    })
-})

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/test/javascript/specs/model/app-tree-spec.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/test/javascript/specs/model/app-tree-spec.js b/brooklyn-ui/src/test/javascript/specs/model/app-tree-spec.js
deleted file mode 100644
index 7cbacf4..0000000
--- a/brooklyn-ui/src/test/javascript/specs/model/app-tree-spec.js
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-define([
-    "model/app-tree"
-], function (AppTree) {
-
-    /** TODO the application-tree.json is hacked together and out of date, 
-     *  reflects a combo of what comes back from server and what used to come back and was expected */
-    
-    $.ajaxSetup({ async:false });
-    var apps = new AppTree.Collection
-    apps.url = "fixtures/application-tree.json"
-    apps.fetch({ async:false })
-    
-    describe("model/app-tree", function () {
-
-        it("loads fixture data", function () {
-            expect(apps.length).toBe(2)
-            var app1 = apps.at(0)
-            expect(app1.get("name")).toBe("test")
-            expect(app1.get("id")).toBe("riBZUjMq")
-            expect(app1.get("type")).toBe("")
-            expect(app1.get("children").length).toBe(1)
-            expect(app1.get("children")[0].name).toBe("tomcat1")
-            expect(app1.get("children")[0].type).toBe("org.apache.brooklyn.entity.webapp.tomcat.TomcatServer")
-            expect(apps.at(1).get("children").length).toBe(2)
-        })
-
-        it("has working getDisplayName", function () {
-            var app1 = apps.at(0)
-            expect(app1.getDisplayName()).toBe("test")
-        })
-
-        it("has working hasChildren method", function () {
-            expect(apps.at(0).hasChildren()).toBeTruthy()
-        })
-
-        it("returns AppTree.Collection for getChildren", function () {
-            var app1 = apps.at(0),
-                children = new AppTree.Collection(app1.get("children"))
-            expect(children.length).toBe(1)
-            expect(children.at(0).getDisplayName()).toBe("tomcat1")
-        })
-
-        it("returns entity names for ids", function() {
-            expect(apps.getEntityNameFromId("fXyyQ7Ap")).toBe("tomcat1");
-            expect(apps.getEntityNameFromId("child-02")).toBe("tomcat2");
-            expect(apps.getEntityNameFromId("child-04")).toBe("tomcat04");
-            expect(apps.getEntityNameFromId("nonexistant")).toBeFalsy();
-        });
-    })
-})
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/test/javascript/specs/model/application-spec.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/test/javascript/specs/model/application-spec.js b/brooklyn-ui/src/test/javascript/specs/model/application-spec.js
deleted file mode 100644
index 1b76e3b..0000000
--- a/brooklyn-ui/src/test/javascript/specs/model/application-spec.js
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-define([
-    "model/application", "model/entity"
-], function (Application, Entity) {
-
-    $.ajaxSetup({ async:false });
-
-    describe('model/application Application model', function () {
-
-        var application = new Application.Model()
-
-        application.url = 'fixtures/application.json'
-        application.fetch({async:false})
-
-        it('loads all model properties defined in fixtures/application.json', function () {
-            expect(application.get("status")).toEqual('STARTING')
-            expect(application.getLinkByName('self')).toEqual('/v1/applications/myapp')
-            expect(application.getLinkByName('entities')).toEqual('fixtures/entity-summary-list.json')
-        })
-
-        it("loads the spec from fixtures/application.json", function () {
-            var applicationSpec = application.getSpec(),
-                entity = new Entity.Model(applicationSpec.get("entities")[0])
-
-            expect(applicationSpec.get("name")).toEqual('myapp')
-            expect(applicationSpec.get("locations")[0]).toEqual('/v1/locations/1')
-            expect(entity.get("name")).toEqual('Vanilla Java App')
-        })
-
-        it('fetches entities from the spec url: fixtures/entity-summary-list.json', function () {
-            expect(application.getLinkByName('entities')).toBe('fixtures/entity-summary-list.json')
-        })
-    })
-
-    describe('model/application', function () {
-
-        var spec, location, entity
-
-        beforeEach(function () {
-            spec = new Application.Spec
-            location = "/v1/locations/2"
-            entity = new Entity.Model({name:'test'})
-
-            spec.url = 'fixtures/application-spec.json'
-            spec.fetch({async:false})
-        })
-
-        it('loads the properties from fixtures/application-spec.json', function () {
-            expect(spec.get("name")).toEqual('myapp')
-            expect(spec.get("locations")[0]).toEqual('/v1/locations/1')
-            expect(spec.get("entities").length).toBe(1)
-        })
-
-        it("loads the entity from fixtures/application-spec.json", function () {
-            var entity = new Entity.Model(spec.get("entities")[0])
-            expect(entity.get("name")).toEqual('Vanilla Java App')
-            expect(entity.get("type")).toEqual('org.apache.brooklyn.entity.java.VanillaJavaApp')
-            expect(entity.getConfigByName('initialSize')).toEqual('1')
-            expect(entity.getConfigByName('creationScriptUrl')).toEqual('http://my.brooklyn.io/storage/foo.sql')
-        })
-
-        it("triggers 'change' when we add a location", function () {
-            spyOn(spec, "trigger").andCallThrough()
-            spec.addLocation(location)
-            expect(spec.trigger).toHaveBeenCalled()
-            expect(spec.get("locations").length).toEqual(2)
-        })
-
-        it("triggers 'change' when we remove a location", function () {
-            spec.addLocation(location)
-            spyOn(spec, "trigger").andCallThrough()
-
-            spec.removeLocation('/v1/invalid/location')
-            expect(spec.trigger).not.toHaveBeenCalled()
-            spec.removeLocation(location)
-            expect(spec.trigger).toHaveBeenCalled()
-            expect(spec.get("locations").length).toEqual(1)
-        })
-
-        it('allows you to add the same location twice', function () {
-            var spec = new Application.Spec,
-                location = '/ion/23'
-            spec.addLocation(location)
-            spec.addLocation(location)
-            expect(spec.get("locations").length).toEqual(2)
-        })
-
-        it("triggers 'change' when you add an entity", function () {
-            spyOn(spec, "trigger").andCallThrough()
-            spec.removeEntityByName(entity.get("name"))
-            expect(spec.trigger).not.toHaveBeenCalled()
-            spec.addEntity(entity)
-            expect(spec.trigger).toHaveBeenCalled()
-        })
-
-        it("triggers 'change' when you remove an entity", function () {
-            spec.addEntity(entity)
-            spyOn(spec, "trigger").andCallThrough()
-            spec.removeEntityByName(entity.get("name"))
-            expect(spec.trigger).toHaveBeenCalled()
-        })
-
-        it('allows you to add the same entity twice', function () {
-            var spec = new Application.Spec,
-                entity = new Entity.Model({ name:'test-entity'})
-            spec.addEntity(entity)
-            spec.addEntity(entity)
-            expect(spec.get("entities").length).toEqual(2)
-        })
-    })
-})

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/test/javascript/specs/model/catalog-application-spec.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/test/javascript/specs/model/catalog-application-spec.js b/brooklyn-ui/src/test/javascript/specs/model/catalog-application-spec.js
deleted file mode 100644
index d6a1c27..0000000
--- a/brooklyn-ui/src/test/javascript/specs/model/catalog-application-spec.js
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-define([
-    'underscore', 'model/catalog-application'
-], function (_, CatalogApplication) {
-    var catalogApplication = new CatalogApplication.Model
-    catalogApplication.url = 'fixtures/catalog-application.json'
-    catalogApplication.fetch({async:false})
-
-    describe('model/catalog-application', function() {
-        it('loads data from fixture file', function () {
-            expect(catalogApplication.get('id')).toEqual('com.example.app:1.1')
-            expect(catalogApplication.get('type')).toEqual('com.example.app')
-            expect(catalogApplication.get('name')).toEqual('My example application')
-            expect(catalogApplication.get('version')).toEqual('1.1')
-            expect(catalogApplication.get('description')).toEqual('My awesome example application, as a catalog item')
-            expect(catalogApplication.get('planYaml')).toEqual('services:\n- type: org.apache.brooklyn.entity.software.base.VanillaSoftwareProcess\n  launch.command: echo \"Launch application\"\n  checkRunning.command: echo \"Check running application\"')
-            expect(catalogApplication.get('iconUrl')).toEqual('http://my.example.com/icon.png')
-        })
-    })
-    describe("model/catalog-application", function () {
-        it('fetches from /v1/locations', function () {
-            var catalogApplicationCollection = new CatalogApplication.Collection()
-            expect(catalogApplicationCollection.url).toEqual('/v1/catalog/applications')
-        })
-
-        // keep these in describe so jasmine-maven will load them from the file pointed by URL
-        var catalogApplicationFixture = new CatalogApplication.Collection
-        catalogApplicationFixture.url = 'fixtures/catalog-application-list.json'
-        catalogApplicationFixture.fetch()
-
-        it('loads all model properties defined in fixtures/catalog-application.json', function () {
-            expect(catalogApplicationFixture.length).toEqual(3)
-
-            var catalogApplication1 = catalogApplicationFixture.at(0)
-            expect(catalogApplication1.get('id')).toEqual('com.example.app:1.1')
-            expect(catalogApplication1.get('type')).toEqual('com.example.app')
-            expect(catalogApplication1.get('name')).toEqual('My example application')
-            expect(catalogApplication1.get('version')).toEqual('1.1')
-            expect(catalogApplication1.get('description')).toEqual('My awesome example application, as a catalog item')
-            expect(catalogApplication1.get('planYaml')).toEqual('services:\n- type: org.apache.brooklyn.entity.software.base.VanillaSoftwareProcess\n  launch.command: echo \"Launch application\"\n  checkRunning.command: echo \"Check running application\"')
-            expect(catalogApplication1.get('iconUrl')).toEqual('http://my.example.com/icon.png')
-
-            var catalogApplication2 = catalogApplicationFixture.at(1)
-            expect(catalogApplication2.get('id')).toEqual('com.example.app:2.0')
-            expect(catalogApplication2.get('type')).toEqual('com.example.app')
-            expect(catalogApplication2.get('name')).toEqual('My example application')
-            expect(catalogApplication2.get('version')).toEqual('2.0')
-            expect(catalogApplication2.get('description')).toEqual('My awesome example application, as a catalog item')
-            expect(catalogApplication2.get('planYaml')).toEqual('services:\n- type: org.apache.brooklyn.entity.software.base.VanillaSoftwareProcess\n  launch.command: echo \"Launch application\"\n  checkRunning.command: echo \"Check running application\"')
-            expect(catalogApplication2.get('iconUrl')).toEqual('http://my.example.com/icon.png')
-
-            var catalogApplication3 = catalogApplicationFixture.at(2)
-            expect(catalogApplication3.get('id')).toEqual('com.example.other.app:1.0')
-            expect(catalogApplication3.get('type')).toEqual('com.example.other.app')
-            expect(catalogApplication3.get('name')).toEqual('Another example application')
-            expect(catalogApplication3.get('version')).toEqual('1.0')
-            expect(catalogApplication3.get('description')).toEqual('Another awesome example application, as a catalog item')
-            expect(catalogApplication3.get('planYaml')).toEqual('services:\n- type: org.apache.brooklyn.entity.software.base.VanillaSoftwareProcess\n  launch.command: echo \"Launch other application\"\n  checkRunning.command: echo \"Check running other application\"')
-            expect(catalogApplication3.get('iconUrl')).toEqual('http://my.other.example.com/icon.png')
-        })
-
-        it ('Collection#getDistinctApplications returns all available applications, group by type', function() {
-            var groupBy = catalogApplicationFixture.getDistinctApplications()
-
-            expect(Object.keys(groupBy).length).toBe(2)
-            expect(groupBy.hasOwnProperty('com.example.app')).toBeTruthy()
-            expect(groupBy['com.example.app'].length).toBe(2)
-            expect(groupBy['com.example.app'][0].get('version')).toEqual('1.1')
-            expect(groupBy['com.example.app'][1].get('version')).toEqual('2.0')
-            expect(groupBy.hasOwnProperty('com.example.other.app')).toBeTruthy()
-            expect(groupBy['com.example.other.app'].length).toBe(1)
-            expect(groupBy['com.example.other.app'][0].get('version')).toEqual('1.0')
-        })
-
-        it('Collection#getTypes() returns only distinct types', function() {
-            var types = catalogApplicationFixture.getTypes()
-
-            expect(types.length).toBe(2)
-            expect(types[0]).toEqual('com.example.app')
-            expect(types[1]).toEqual('com.example.other.app')
-        })
-
-        describe('Collection#hasType()', function() {
-            it('Returns true if the given type exists within the applications list', function() {
-                var ret = catalogApplicationFixture.hasType('com.example.other.app')
-
-                expect(ret).toBeTruthy()
-            })
-
-            it('Returns false if the given type exists within the applications list', function() {
-                var ret = catalogApplicationFixture.hasType('com.example.other.app.that.does.not.exist')
-
-                expect(ret).toBeFalsy()
-            })
-        })
-
-        describe('Collection#getVersions()', function() {
-            it('Returns an empty array if no applications exist with the given type', function() {
-                var versions = catalogApplicationFixture.getVersions('com.example.other.app.that.does.not.exist')
-
-                expect(versions.length).toBe(0)
-            })
-
-            it('Returns the expected array of versions if applications exist with the given type', function() {
-                var versions = catalogApplicationFixture.getVersions('com.example.app')
-
-                expect(versions.length).toBe(2)
-                expect(versions[0]).toEqual('1.1')
-                expect(versions[1]).toEqual('2.0')
-            })
-        })
-    })
-})
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/test/javascript/specs/model/effector-spec.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/test/javascript/specs/model/effector-spec.js b/brooklyn-ui/src/test/javascript/specs/model/effector-spec.js
deleted file mode 100644
index 5ffdebd..0000000
--- a/brooklyn-ui/src/test/javascript/specs/model/effector-spec.js
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-define([
-    "model/effector-summary", "model/effector-param"
-], function (EffectorSummary, EffectorParam) {
-
-    $.ajaxSetup({async: false});
-
-    describe("effector-spec: EffectorSummary model", function () {
-        var effectorCollection = new EffectorSummary.Collection;
-        effectorCollection.url = "fixtures/effector-summary-list.json";
-        effectorCollection.fetch();
-
-        it("must have start, stop and restart effectors", function () {
-            var actual = effectorCollection.pluck("name").sort();
-            var expected = ["restart", "start", "stop"].sort();
-            expect(actual).toEqual(expected);
-        });
-
-        describe("the start effector", function () {
-            var startEffector = effectorCollection.at(0);
-            it("has void return type and two parameters", function () {
-                expect(startEffector.get("name")).toBe("start");
-                expect(startEffector.get("returnType")).toBe("void");
-                expect(startEffector.get("parameters").length).toBe(2);
-            });
-
-            it("has a parameter named 'locations'", function () {
-                var parameter = new EffectorParam.Model(startEffector.getParameterByName("locations"));
-                expect(parameter.get("name")).toBe("locations");
-                expect(parameter.get("type")).toBe("java.util.Collection");
-                expect(parameter.get("description")).toBe("A list of locations");
-            });
-
-            it("has a parameter named 'booleanValue'", function () {
-                var parameter = new EffectorParam.Model(startEffector.getParameterByName("booleanValue"));
-                expect(parameter.get("name")).toBe("booleanValue");
-                expect(parameter.get("type")).toBe("java.lang.Boolean");
-                expect(parameter.get("description")).toBe("True or false");
-                expect(parameter.get("defaultValue")).toBe(true);
-            });
-        })
-    })
-});

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/test/javascript/specs/model/entity-spec.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/test/javascript/specs/model/entity-spec.js b/brooklyn-ui/src/test/javascript/specs/model/entity-spec.js
deleted file mode 100644
index 6b3c80e..0000000
--- a/brooklyn-ui/src/test/javascript/specs/model/entity-spec.js
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-define([
-    "underscore", "model/entity"
-], function (_, Entity) {
-    $.ajaxSetup({ async:false });
-    
-    describe("model/entity", function () {
-        // keep these in describe so jasmine-maven will load them from the file pointed by URL
-        var entityFixture = new Entity.Collection
-        entityFixture.url = 'fixtures/entity.json'
-        entityFixture.fetch()
-
-        it('loads all model properties defined in fixtures/entity.json', function () {
-            expect(entityFixture.length).toEqual(1)
-            var entity = entityFixture.at(0)
-            expect(entity.get("name")).toEqual('Vanilla Java App')
-            expect(entity.get("type")).toEqual('org.apache.brooklyn.entity.java.VanillaJavaApp')
-            expect(entity.get("config")).toEqual({})
-        })
-    })
-})

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/test/javascript/specs/model/entity-summary-spec.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/test/javascript/specs/model/entity-summary-spec.js b/brooklyn-ui/src/test/javascript/specs/model/entity-summary-spec.js
deleted file mode 100644
index 230b331..0000000
--- a/brooklyn-ui/src/test/javascript/specs/model/entity-summary-spec.js
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-define(
-    ["model/entity-summary" ],
-    function (EntitySummary) {
-
-        describe('model/entity-summary EntitySummary model and collection', function () {
-            var summaries = new EntitySummary.Collection
-            summaries.url = 'fixtures/entity-summary-list.json'
-            summaries.fetch({async:false})
-            var eSummary = summaries.at(0)
-
-            it('the collection element must be of type TomcatServer and have expected properties', function () {
-                expect(eSummary.getLinkByName('catalog'))
-                    .toBe('/v1/catalog/entities/org.apache.brooklyn.entity.webapp.tomcat.TomcatServer')
-                expect(eSummary.get("type")).toBe('org.apache.brooklyn.entity.webapp.tomcat.TomcatServer')
-                expect(eSummary.getLinkByName('sensors')).toBe('fixtures/sensor-summary-list.json')
-                expect(eSummary.getDisplayName()).toBe('TomcatServer:zQsqdXzi')
-            })
-
-            it('collection has working findByDisplayName function', function () {
-                expect(summaries.findByDisplayName('test').length).toBe(0)
-                expect(summaries.findByDisplayName(eSummary.getDisplayName()).length).toBe(1)
-                expect(JSON.stringify(summaries.findByDisplayName(eSummary.getDisplayName()).pop().toJSON())).toBe(JSON.stringify(eSummary.toJSON()))
-            })
-
-            it('collection must have one element', function () {
-                expect(summaries.length).toBe(1)
-            })
-
-        })
-    })
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/test/javascript/specs/model/location-spec.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/test/javascript/specs/model/location-spec.js b/brooklyn-ui/src/test/javascript/specs/model/location-spec.js
deleted file mode 100644
index f72fc8c..0000000
--- a/brooklyn-ui/src/test/javascript/specs/model/location-spec.js
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-define([
-    "underscore", "model/location"
-], function (_, Location) {
-
-    var location = new Location.Model
-    location.url = "fixtures/location-summary.json"
-    location.fetch({async:false})
-
-    describe('model/location', function () {
-        it("loads data from fixture file", function () {
-            expect(location.get("spec")).toBe("localhost")
-            expect(location.getLinkByName("self")).toBe("/v1/locations/123")
-        })
-    })
-
-    describe('model/location', function () {
-        // keep these in describe so jasmine-maven will load them from the file pointed by URL
-        var locationFixtures = new Location.Collection
-        locationFixtures.url = 'fixtures/location-list.json'
-        locationFixtures.fetch()
-        it('loads all model properties defined in fixtures/location-list.json', function () {
-            expect(locationFixtures.length).toEqual(1)
-            var spec = locationFixtures.at(0)
-            expect(spec.get("id")).toEqual('123')
-            expect(spec.get("name")).toEqual('localhost')
-            expect(spec.get("spec")).toEqual('localhost')
-            expect(spec.get("config")).toEqual({})
-            expect(spec.hasSelfUrl('/v1/locations/123')).toBeTruthy()
-            expect(spec.getLinkByName("self")).toEqual('/v1/locations/123')
-        })
-
-        var locationCollection = new Location.Collection()
-        it('fetches from /v1/locations', function () {
-            expect(locationCollection.url).toEqual('/v1/locations')
-        })
-        it('has model LocationSpec', function () {
-            expect(locationCollection.model).toEqual(Location.Model)
-        })
-    })
-})

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/test/javascript/specs/model/sensor-summary-spec.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/test/javascript/specs/model/sensor-summary-spec.js b/brooklyn-ui/src/test/javascript/specs/model/sensor-summary-spec.js
deleted file mode 100644
index 222df70..0000000
--- a/brooklyn-ui/src/test/javascript/specs/model/sensor-summary-spec.js
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-define(['model/sensor-summary'], function (SensorSummary) {
-
-    describe('SensorSummary model', function () {
-        var sensorCollection = new SensorSummary.Collection
-        sensorCollection.url = 'fixtures/sensor-summary-list.json'
-        sensorCollection.fetch()
-
-        it('collection must have 4 sensors', function () {
-            expect(sensorCollection.length).toBe(4)
-        })
-
-        it('must have a sensor named service.state', function () {
-            var filteredSensors = sensorCollection.where({ 'name':'service.state'})
-            expect(filteredSensors.length).toBe(1)
-            var ourSensor = filteredSensors.pop()
-            expect(ourSensor.get("name")).toBe('service.state')
-            expect(ourSensor.get("type")).toBe('org.apache.brooklyn.entity.lifecycle.Lifecycle')
-            expect(ourSensor.get("description")).toBe('Service lifecycle state')
-            expect(ourSensor.getLinkByName('self')).toBe('fixtures/service-state.json')
-            expect(ourSensor.getLinkByName()).toBe(undefined)
-        })
-    })
-})

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/test/javascript/specs/model/task-summary-spec.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/test/javascript/specs/model/task-summary-spec.js b/brooklyn-ui/src/test/javascript/specs/model/task-summary-spec.js
deleted file mode 100644
index b7e488c..0000000
--- a/brooklyn-ui/src/test/javascript/specs/model/task-summary-spec.js
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-define([
-    "model/task-summary"
-], function (TaskSummary) {
-
-    describe("model/task-summary spec", function () {
-        var tasks = new TaskSummary.Collection
-        tasks.url = "fixtures/task-summary-list.json"
-        tasks.fetch({async:false})
-
-        it("loads the collection from 'fixtures/task-summary-list.json'", function () {
-            var task = tasks.at(0)
-            expect(task.get("entityId")).toBe("VzK45RFC")
-            expect(task.get("displayName")).toBe("start")
-            expect(task.get("rawSubmitTimeUtc")).toBe(1348663165550)
-        })
-    })
-})
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/test/javascript/specs/router-spec.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/test/javascript/specs/router-spec.js b/brooklyn-ui/src/test/javascript/specs/router-spec.js
deleted file mode 100644
index 8f54bb8..0000000
--- a/brooklyn-ui/src/test/javascript/specs/router-spec.js
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-define([
-    "brooklyn", "router"
-], function (Brooklyn, Router) {
-
-    var View = Backbone.View.extend({
-        render:function () {
-            this.$el.html("<p>fake view</p>")
-            return this
-        }
-    })
-
-    describe("router", function () {
-        var view, router
-
-        beforeEach(function () {
-            view = new View
-            router = new Router
-            $("body").append('<div id="container"></div>')
-        })
-
-        afterEach(function () {
-            $("#container").remove()
-        })
-
-        it("shows the view inside div#container", function () {
-            expect($("body #container").length).toBe(1)
-            expect($("#container").text()).toBe("")
-            router.showView("#container", view)
-            expect($("#container").text()).toBe("fake view")
-        })
-
-        it("should call 'close' of old views", function () {
-            spyOn(view, "close")
-
-            router.showView("#container", view)
-            expect(view.close).not.toHaveBeenCalled()
-            // it should close the old view
-            router.showView("#container", new View)
-            expect(view.close).toHaveBeenCalled()
-        })
-    })
-
-    describe("Periodic functions", function() {
-        var CallbackView = View.extend({
-            initialize: function() {
-                this.counter = 0;
-                this.callPeriodically("test-callback", function() {
-                        this.counter += 1;
-                    }, 3)
-            }
-        });
-
-        // Expects callback to have been called at least once
-        it("should have 'this' set to the owning view", function() {
-            Brooklyn.view.refresh = true;
-            var view = new CallbackView();
-            waits(15);
-            runs(function() {
-                expect(view.counter).toBeGreaterThan(0);
-            });
-        });
-
-        it("should not be run if Brooklyn.view.refresh is false", function() {
-            Brooklyn.view.refresh = false;
-            var view = new CallbackView();
-            waits(15);
-            runs(function() {
-                expect(view.counter).toEqual(0);
-                Brooklyn.view.refresh = true;
-            });
-        });
-    });
-
-})
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/test/javascript/specs/util/brooklyn-spec.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/test/javascript/specs/util/brooklyn-spec.js b/brooklyn-ui/src/test/javascript/specs/util/brooklyn-spec.js
deleted file mode 100644
index 4098235..0000000
--- a/brooklyn-ui/src/test/javascript/specs/util/brooklyn-spec.js
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-define([
-    "brooklyn", "backbone"
-], function (B, Backbone) {
-
-    describe("view", function () {
-        describe("form", function() {
-            var formTemplate = _.template('<form>' +
-                '<input name="id" type="text"/>' +
-                '<input name="initialvalue" type="text" value="present"/>' +
-                '<button type="submit" class="submit">Submit</button>' +
-                '</form>');
-
-            it("should set existing values on the model", function() {
-                var form = new B.view.Form({template: formTemplate, onSubmit: function() {}});
-                expect(form.model.get("initialvalue")).toBe("present");
-                expect(form.model.get("id")).toBe("");
-            });
-
-            it("should maintain a model as inputs change", function () {
-                var form = new B.view.Form({
-                    template: formTemplate,
-                    onSubmit: function() {}
-                });
-                // simulate id entry
-                form.$("[name=id]").val("987");
-                form.$("[name=id]").trigger("change");
-                expect(form.model.get("id")).toBe("987");
-            });
-
-            it("should call the onSubmit callback when the form is submitted", function () {
-                var wasCalled = false;
-                var onSubmit = function (model) {
-                    wasCalled = true;
-                };
-                var form = new B.view.Form({
-                    template: formTemplate,
-                    onSubmit: onSubmit
-                });
-                form.$("form").trigger("submit");
-                expect(wasCalled).toBe(true);
-            });
-
-            it("should fail if called without template or onSubmit", function () {
-                try {
-                    new B.view.Form({template: ""});
-                    fail;
-                } catch (e) {
-                    // expected
-                }
-                try {
-                    new B.view.Form({onSubmit: function() {}});
-                    fail;
-                } catch (e) {
-                    // expected
-                }
-
-            });
-        });
-    });
-
-    describe("_.stripComments", function () {
-        it("should strip a basic comment", function () {
-            var text = "<p>abc</p>\n <!-- comment-here --> <p>cba</p>";
-            expect(_.stripComments(text)).toBe("<p>abc</p>\n  <p>cba</p>");
-        });
-
-        it("should return an empty string for an empty comment", function () {
-            expect(_.stripComments("<!---->")).toBe("");
-            expect(_.stripComments("<!-- -->")).toBe("");
-        });
-
-        it("should strip multiple comments", function () {
-            var text = "a<!-- one -->b<!--two-->c<!-- three  -->";
-            expect(_.stripComments(text)).toBe("abc");
-        });
-
-        it("should strip trailing newlines", function () {
-            expect(_.stripComments("<!-- a -->\nb")).toBe("b");
-            expect(_.stripComments("<!-- a -->\rb")).toBe("b");
-        });
-
-        it("should leave text with no comments untouched", function () {
-            var text = "<p>abc</p>";
-            expect(_.stripComments(text)).toBe(text);
-        });
-
-        it("should remove the Apache license header from an HTML template", function () {
-            var text = "<!--\n" +
-                    "Licensed to the Apache Software Foundation (ASF) under one\n" +
-                    "or more contributor license agreements.  See the NOTICE file\n" +
-                    "distributed with this work for additional information\n" +
-                    "regarding copyright ownership.  The ASF licenses this file\n" +
-                    "to you under the Apache License, Version 2.0 (the\n" +
-                    "\"License\"); you may not use this file except in compliance\n" +
-                    "with the License.  You may obtain a copy of the License at\n" +
-                    "\n" +
-                     "http://www.apache.org/licenses/LICENSE-2.0\n" +
-                    "\n" +
-                    "Unless required by applicable law or agreed to in writing,\n" +
-                    "software distributed under the License is distributed on an\n" +
-                    "\"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n" +
-                    "KIND, either express or implied.  See the License for the\n" +
-                    "specific language governing permissions and limitations\n" +
-                    "under the License.\n" +
-                    "-->\n" +
-                    "real content";
-            expect(_.stripComments(text)).toBe("real content");
-        });
-    });
-});
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/test/javascript/specs/util/brooklyn-utils-spec.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/test/javascript/specs/util/brooklyn-utils-spec.js b/brooklyn-ui/src/test/javascript/specs/util/brooklyn-utils-spec.js
deleted file mode 100644
index 4c21f50..0000000
--- a/brooklyn-ui/src/test/javascript/specs/util/brooklyn-utils-spec.js
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-define([
-    'brooklyn-utils', "backbone"
-], function (Util, Backbone) {
-
-    describe('Rounding numbers', function () {
-
-        var round = Util.roundIfNumberToNumDecimalPlaces;
-
-        it("should round in the correct direction", function() {
-            // unchanged
-            expect(round(1, 2)).toBe(1);
-            expect(round(1.1, 1)).toBe(1.1);
-            expect(round(1.9, 1)).toBe(1.9);
-            expect(round(1.123123123, 6)).toBe(1.123123);
-            expect(round(-22.222, 3)).toBe(-22.222);
-
-            // up
-            expect(round(1.9, 0)).toBe(2);
-            expect(round(1.5, 0)).toBe(2);
-            expect(round(1.49, 1)).toBe(1.5);
-
-            // down
-            expect(round(1.01, 1)).toBe(1.0);
-            expect(round(1.49, 0)).toBe(1);
-            expect(round(1.249, 1)).toBe(1.2);
-            expect(round(1.0000000000000000000001, 0)).toBe(1);
-        });
-
-        it("should round negative numbers correctly", function() {
-            // up
-            expect(round(-10, 0)).toBe(-10);
-            expect(round(-10.49999, 0)).toBe(-10);
-
-            // down
-            expect(round(-10.5, 0)).toBe(-11);
-            expect(round(-10.50001, 0)).toBe(-11);
-            expect(round(-10.49999, 1)).toBe(-10.5);
-        });
-
-        it("should ignore non-numeric values", function() {
-            expect(round("xyz", 1)).toBe("xyz");
-            expect(round("2.4", 0)).toBe("2.4");
-            expect(round({a: 2}, 0)).toEqual({a: 2});
-        });
-
-        it("should ignore negative mantissas", function() {
-            expect(round(10.5, -1)).toBe(10.5);
-            expect(round(100, -1)).toBe(100);
-            expect(round(0, -1)).toBe(0);
-        });
-
-    });
-
-    describe("pathOf", function() {
-
-        it("should extract the path component of a URI", function() {
-            expect(Util.pathOf("http://www.example.com/path/to/resource#more?a=b&c=d")).toBe("/path/to/resource");
-        });
-
-        it("should return an empty path for an empty URL", function() {
-            expect(Util.pathOf("")).toBe("");
-        });
-
-        it("should handle input without domain", function() {
-            expect(Util.pathOf("/a/b/c/d#e")).toBe("/a/b/c/d");
-        })
-    });
-
-    describe("inputValue", function () {
-        it("should return inputs as strings", function () {
-            expect(Util.inputValue($('<input type="text" value="bob"/>'))).toBe("bob");
-            expect(Util.inputValue($('<textarea rows="10" cols="5">content</textarea>'))).toBe("content");
-        });
-
-        it("should return true/false for checkboxes", function () {
-            var input = $('<input type="checkbox" checked/>');
-            expect(Util.inputValue(input)).toBe(true);
-            input = $('<input type="checkbox" />');
-            expect(Util.inputValue(input)).toBe(false);
-        });
-    });
-
-    describe("bindModelFromForm", function () {
-        // pretend to be a Backbone model without bringing in Backbone as a dependency
-        var TestModel = Backbone.Model.extend({
-            urlRoot: function () {
-                return "/foo/bar/";
-            }
-        });
-        var form = $("<form>" +
-            "<input name='id' type='input' value='text'/>" +
-            "<input name='bool' type='checkbox' checked/>" +
-            "</form>");
-
-        it("should create a new model if given a constructor", function () {
-            var model = Util.bindModelFromForm(TestModel, form);
-            expect(model instanceof TestModel).toBe(true);
-            expect(model.url()).toBe("/foo/bar/text");
-            var inputs = model.attributes;
-            expect(_.keys(inputs).length).toBe(2);
-            expect(inputs.id).toBe("text");
-            expect(inputs.bool).toBe(true);
-        });
-
-        it("should update an existing model", function () {
-            var model = new TestModel({initialAttribute: "xyz"});
-            Util.bindModelFromForm(model, form);
-            var inputs = model.attributes;
-            expect(_.keys(inputs).length).toBe(3);
-            expect(inputs.id).toBe("text");
-            expect(inputs.bool).toBe(true);
-            expect(inputs.initialAttribute).toBe("xyz");
-        });
-    });
-
-    describe("extractError", function () {
-        it("should extract the response message", function () {
-            var m = Util.extractError({ responseText: '{"message": "hello"}'}, "default");
-            expect(m).toBe("hello");
-        });
-
-        it("should return the default on invalid JSON", function () {
-            var m = Util.extractError({ responseText: "<html></html>"}, "default");
-            expect(m).toBe("default");
-        });
-
-        it("should return the default if the response has no message", function () {
-            var m = Util.extractError({ a: '{"b": "c"}'}, "default");
-            expect(m).toBe("default");
-        });
-    });
-
-});

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/test/javascript/specs/view/application-add-wizard-spec.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/test/javascript/specs/view/application-add-wizard-spec.js b/brooklyn-ui/src/test/javascript/specs/view/application-add-wizard-spec.js
deleted file mode 100644
index 29a0b09..0000000
--- a/brooklyn-ui/src/test/javascript/specs/view/application-add-wizard-spec.js
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-/**
- * Test the ModalWizard can build a modal to view, edit and submit an application.
- */
-define([
-    "underscore", "jquery", "backbone", "view/application-add-wizard", "model/application", "model/location"
-//    "text!tpl/home/step1.html", "text!tpl/home/step2.html", "text!tpl/home/step3.html",
-//    "text!tpl/home/step1-location-row.html", "text!tpl/home/step1-location-option.html",
-//    "text!tpl/home/step2-entity-entry.html", "text!tpl/home/step2-config-entry.html"
-], function (_, $, Backbone, AppAddWizard, Application, Locations
-//        , 
-//        Entities,
-//      Step1Html, Step2Html, Step3Html,
-//      Step1LocationRowHtml, LocationOptionHtml,  
-//      Step2EntityEntryHtml, Step2ConfigEntryHtml
-        ) {
-
-    /* TEST disabled until we can more cleanly supply javascript.
-     * should probably move to have one big model,
-     * rather than passing around lots of small model items.
-     */
-    
-//    Backbone.View.prototype.close = function () {
-//        if (this.beforeClose) {
-//            this.beforeClose()
-//        }
-//        this.remove()
-//        this.unbind()
-//    }
-//
-//    var fakeRouter = new Backbone.Router()
-//    var modal = new ModalWizard({appRouter:fakeRouter});
-//
-//    describe("view/modal-wizard", function () {
-//
-//        it("creates an empty Application.Spec", function () {
-//            expect(modal.model.get("name")).toBe("")
-//            expect(modal.model.get("entities")).toEqual([])
-//            expect(modal.model.get("locations")).toEqual([])
-//        })
-//
-//        it("creates a view for each of the 3 steps", function () {
-//            expect(modal.steps.length).toBe(3)
-//            expect(modal.steps[0].view instanceof ModalWizard.Step1).toBeTruthy()
-//            expect(modal.steps[1].view instanceof ModalWizard.Step2).toBeTruthy()
-//            expect(modal.steps[2].view instanceof ModalWizard.Step3).toBeTruthy()
-//        })
-//
-//        it("beforeClose method closes all 3 subviews", function () {
-//            spyOn(Backbone.View.prototype, "close").andCallThrough()
-//            modal.beforeClose()
-//            expect(modal.steps[0].view.close).toHaveBeenCalled()
-//            expect(modal.steps[1].view.close).toHaveBeenCalled()
-//            expect(modal.steps[2].view.close).toHaveBeenCalled()
-//        })
-//    })
-//
-//    describe("view/modal-wizard step1", function () {
-//        var app, view
-//
-//        beforeEach(function () {
-//            app = new Application.Spec
-//            view = new ModalWizard.Step1({model:app})
-//            view.locations.url = "fixtures/location-list.json"
-//            view.locations.fetch({async:false})
-//            view.render()
-//        })
-//
-//        afterEach(function () {
-//            view.close()
-//        })
-//
-//        it("does not validate empty view", function () {
-//            expect(view.validate()).toBe(false)
-//            expect(view.$("#app-locations ul").html()).toBe("")
-//            expect(view.$("#application-name").text()).toBe("")
-//        })
-//
-//        it("updates the name on blur", function () {
-//            view.$("#application-name").val("myapp")
-//            view.$("#application-name").trigger("blur")
-//            expect(app.get("name")).toBe("myapp")
-//        })
-//
-//        it("adds and removes location", function () {
-//            expect(app.get("locations").length).toBe(0)
-//            view.$("#add-app-location").trigger("click")
-//            expect(app.get("locations").length).toBe(1)
-//            view.$(".remove").trigger("click")
-//            expect(app.get("locations").length).toBe(0)
-//        })
-//
-//    })
-//
-//    describe("view/modal-wizard step2", function () {
-//        var app, view
-//
-//        beforeEach(function () {
-//            app = new Application.Spec
-//            view = new ModalWizard.Step2({model:app})
-//            // TODO supply catalog entities
-//            view.render()
-//        })
-//
-//        afterEach(function () {
-//            view.close()
-//        })
-//
-//        // to be added
-//    })
-//
-//    describe("view/modal-wizard step3", function () {
-//        var app, view
-//
-//        beforeEach(function () {
-//            app = new Application.Spec
-//            view = new ModalWizard.Step3({model:app})
-//            view.render()
-//        })
-//
-//        afterEach(function () {
-//            view.close()
-//        })
-//
-//        it("has #app-summary to render the application", function () {
-//            expect(view.$("#app-summary").length).toBe(1)
-//        })
-//
-//        it("validates only when application spec contains data", function () {
-//            expect(view.validate()).toBe(false)
-//            app.set({name:"myapp", locations:["/dummy/1"], entities:[
-//                {}
-//            ]})
-//            expect(view.validate()).toBe(true)
-//        })
-//    })
-//
-//    describe('tpl/home/step1.html', function () {
-//        var $step = $(Step1Html)
-//
-//        it('must have input#application-name', function () {
-//            expect($step.find('input#application-name').length).toEqual(1);
-//        });
-//
-//        it('must have div#app-locations', function () {
-//            var $appLocations = $step.filter('div#app-locations');
-//            expect($appLocations.length).toEqual(1);
-//            expect($appLocations.find('h4').length).toEqual(1);
-//            expect($appLocations.find('ul').length).toEqual(1);
-//            expect($appLocations.find('button#toggle-selector-container').length).toEqual(1);
-//        });
-//
-//        it('must have select#select-location', function () {
-//            expect($step.find('select#select-location').length).toEqual(1);
-//        });
-//
-//        it('must have button#add-app-location', function () {
-//            expect($step.find('button#add-app-location').length).toEqual(1);
-//        });
-//        it('must have div.info-message', function () {
-//            expect($step.filter('div.info-message').length).toEqual(1);
-//        })
-//    });
-//
-//    describe('tpl/home/step2.html', function () {
-//        var $step = $(Step2Html);
-//
-//        it('must have div#entities with h4 and ul', function () {
-//            var $div = $step.filter('div#entities');
-//            expect($div.length).toEqual(1);
-//            expect($div.find('h4').length).toEqual(1);
-//            expect($div.find('ul').length).toEqual(1);
-//            expect($div.find('button#toggle-entity-form').length).toEqual(1);
-//        });
-//
-//        it('must have div#new-entity with all components', function () {
-//            var $div = $step.filter('div#new-entity');
-//            expect($div.length).toEqual(1);
-//            expect($div.find('div#entity-form').length).toEqual(1);
-//            expect($div.find('button#add-app-entity').length).toEqual(1);
-//            expect($div.find('div.entity-info-message').length).toEqual(1);
-//        });
-//        it('must have div.info-message', function () {
-//            expect($step.filter('div.info-message').length).toEqual(1);
-//        });
-//    });
-//
-//    describe('tpl/home/step3.html', function () {
-//        var $step = $(Step3Html);
-//        it('div.body must have h3 and textarea#app-summary', function () {
-//            expect($step.find('h3').length).toEqual(1);
-//            expect($step.find('textarea#app-summary').length).toEqual(1);
-//        });
-//        it('must have div.info-message', function () {
-//            expect($step.filter('div.info-message').length).toEqual(1);
-//        });
-//    });
-})
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/test/javascript/specs/view/application-explorer-spec.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/test/javascript/specs/view/application-explorer-spec.js b/brooklyn-ui/src/test/javascript/specs/view/application-explorer-spec.js
deleted file mode 100644
index 3e3dd96..0000000
--- a/brooklyn-ui/src/test/javascript/specs/view/application-explorer-spec.js
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-/**
- * Tests for application tree - view explorer.
- */
-define([
-    "underscore", "jquery", "model/app-tree", "view/application-explorer",
-    "model/entity-summary", "model/application"
-], function (_, $, AppTree, ApplicationExplorerView, EntitySummary, Application) {
-
-    describe('view/application-explorer-spec', function () {
-
-        describe('Application Explorer', function () {
-            var apps = new AppTree.Collection,
-                view
-            apps.url = 'fixtures/application-tree.json'
-            apps.fetch({async:false})
-
-            var entityFetch, applicationFetch, defer;
-
-            beforeEach(function () {
-                // ApplicationTree makes fetch requests to EntitySummary and Application models
-                // with hard-coded URLs, causing long stacktraces in mvn output. This workaround
-                // turns their fetch methods into empty functions.
-                entityFetch = EntitySummary.Model.prototype.fetch;
-                applicationFetch = Application.Model.prototype.fetch;
-                defer = _.defer;
-                _.defer = EntitySummary.Model.prototype.fetch = Application.Model.prototype.fetch = function() {};
-                view = new ApplicationExplorerView({ collection:apps }).render()
-            })
-
-            afterEach(function() {
-                EntitySummary.Model.prototype.fetch = entityFetch;
-                Application.Model.prototype.fetch = applicationFetch;
-                _.defer = defer;
-            });
-
-            it('must contain div.row with two spans: #tree and #details', function () {
-                expect(view.$el.is('#application-explorer')).toBeTruthy()
-                expect(view.$el.is('div.container.container-fluid')).toBeTruthy()
-                expect(view.$("div#tree").is('.span4')).toBeTruthy()
-                expect(view.$("div#details").is('.span8')).toBeTruthy()
-            })
-
-            it("must have a i.refresh element inside #tree header", function () {
-                expect(view.$("#tree h3").length).toBe(1)
-                expect(view.$("#tree i.application-tree-refresh").length).toBe(1)
-            })
-
-            it("must have div#app-tree for rendering the applications", function () {
-                expect(view.$("div#app-tree").length).toBe(1)
-            })
-
-            it("triggers collection fetch on application refresh", function () {
-                spyOn(apps, "fetch").andCallThrough()
-                view.$(".application-tree-refresh").trigger("click")
-                waits(100)
-                runs(function () {
-                    expect(view.collection.fetch).toHaveBeenCalled()
-                })
-            })
-        })
-    })
-})
\ No newline at end of file


[05/51] [abbrv] [partial] brooklyn-ui git commit: move subdir from incubator up a level as it is promoted to its own repo (first non-incubator commit!)

Posted by he...@apache.org.
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/js/libs/underscore.js
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/js/libs/underscore.js b/src/main/webapp/assets/js/libs/underscore.js
new file mode 100644
index 0000000..32ca0c1
--- /dev/null
+++ b/src/main/webapp/assets/js/libs/underscore.js
@@ -0,0 +1,1227 @@
+// Underscore.js 1.4.4
+// ===================
+
+// > http://underscorejs.org
+// > (c) 2009-2013 Jeremy Ashkenas, DocumentCloud Inc.
+// > Underscore may be freely distributed under the MIT license.
+
+// Baseline setup
+// --------------
+(function() {
+
+  // Establish the root object, `window` in the browser, or `global` on the server.
+  var root = this;
+
+  // Save the previous value of the `_` variable.
+  var previousUnderscore = root._;
+
+  // Establish the object that gets returned to break out of a loop iteration.
+  var breaker = {};
+
+  // Save bytes in the minified (but not gzipped) version:
+  var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype;
+
+  // Create quick reference variables for speed access to core prototypes.
+  var push             = ArrayProto.push,
+      slice            = ArrayProto.slice,
+      concat           = ArrayProto.concat,
+      toString         = ObjProto.toString,
+      hasOwnProperty   = ObjProto.hasOwnProperty;
+
+  // All **ECMAScript 5** native function implementations that we hope to use
+  // are declared here.
+  var
+    nativeForEach      = ArrayProto.forEach,
+    nativeMap          = ArrayProto.map,
+    nativeReduce       = ArrayProto.reduce,
+    nativeReduceRight  = ArrayProto.reduceRight,
+    nativeFilter       = ArrayProto.filter,
+    nativeEvery        = ArrayProto.every,
+    nativeSome         = ArrayProto.some,
+    nativeIndexOf      = ArrayProto.indexOf,
+    nativeLastIndexOf  = ArrayProto.lastIndexOf,
+    nativeIsArray      = Array.isArray,
+    nativeKeys         = Object.keys,
+    nativeBind         = FuncProto.bind;
+
+  // Create a safe reference to the Underscore object for use below.
+  var _ = function(obj) {
+    if (obj instanceof _) return obj;
+    if (!(this instanceof _)) return new _(obj);
+    this._wrapped = obj;
+  };
+
+  // Export the Underscore object for **Node.js**, with
+  // backwards-compatibility for the old `require()` API. If we're in
+  // the browser, add `_` as a global object via a string identifier,
+  // for Closure Compiler "advanced" mode.
+  if (typeof exports !== 'undefined') {
+    if (typeof module !== 'undefined' && module.exports) {
+      exports = module.exports = _;
+    }
+    exports._ = _;
+  } else {
+    root._ = _;
+  }
+
+  // Current version.
+  _.VERSION = '1.4.4';
+
+  // Collection Functions
+  // --------------------
+
+  // The cornerstone, an `each` implementation, aka `forEach`.
+  // Handles objects with the built-in `forEach`, arrays, and raw objects.
+  // Delegates to **ECMAScript 5**'s native `forEach` if available.
+  var each = _.each = _.forEach = function(obj, iterator, context) {
+    if (obj == null) return;
+    if (nativeForEach && obj.forEach === nativeForEach) {
+      obj.forEach(iterator, context);
+    } else if (obj.length === +obj.length) {
+      for (var i = 0, l = obj.length; i < l; i++) {
+        if (iterator.call(context, obj[i], i, obj) === breaker) return;
+      }
+    } else {
+      for (var key in obj) {
+        if (_.has(obj, key)) {
+          if (iterator.call(context, obj[key], key, obj) === breaker) return;
+        }
+      }
+    }
+  };
+
+  // Return the results of applying the iterator to each element.
+  // Delegates to **ECMAScript 5**'s native `map` if available.
+  _.map = _.collect = function(obj, iterator, context) {
+    var results = [];
+    if (obj == null) return results;
+    if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context);
+    each(obj, function(value, index, list) {
+      results[results.length] = iterator.call(context, value, index, list);
+    });
+    return results;
+  };
+
+  var reduceError = 'Reduce of empty array with no initial value';
+
+  // **Reduce** builds up a single result from a list of values, aka `inject`,
+  // or `foldl`. Delegates to **ECMAScript 5**'s native `reduce` if available.
+  _.reduce = _.foldl = _.inject = function(obj, iterator, memo, context) {
+    var initial = arguments.length > 2;
+    if (obj == null) obj = [];
+    if (nativeReduce && obj.reduce === nativeReduce) {
+      if (context) iterator = _.bind(iterator, context);
+      return initial ? obj.reduce(iterator, memo) : obj.reduce(iterator);
+    }
+    each(obj, function(value, index, list) {
+      if (!initial) {
+        memo = value;
+        initial = true;
+      } else {
+        memo = iterator.call(context, memo, value, index, list);
+      }
+    });
+    if (!initial) throw new TypeError(reduceError);
+    return memo;
+  };
+
+  // The right-associative version of reduce, also known as `foldr`.
+  // Delegates to **ECMAScript 5**'s native `reduceRight` if available.
+  _.reduceRight = _.foldr = function(obj, iterator, memo, context) {
+    var initial = arguments.length > 2;
+    if (obj == null) obj = [];
+    if (nativeReduceRight && obj.reduceRight === nativeReduceRight) {
+      if (context) iterator = _.bind(iterator, context);
+      return initial ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator);
+    }
+    var length = obj.length;
+    if (length !== +length) {
+      var keys = _.keys(obj);
+      length = keys.length;
+    }
+    each(obj, function(value, index, list) {
+      index = keys ? keys[--length] : --length;
+      if (!initial) {
+        memo = obj[index];
+        initial = true;
+      } else {
+        memo = iterator.call(context, memo, obj[index], index, list);
+      }
+    });
+    if (!initial) throw new TypeError(reduceError);
+    return memo;
+  };
+
+  // Return the first value which passes a truth test. Aliased as `detect`.
+  _.find = _.detect = function(obj, iterator, context) {
+    var result;
+    any(obj, function(value, index, list) {
+      if (iterator.call(context, value, index, list)) {
+        result = value;
+        return true;
+      }
+    });
+    return result;
+  };
+
+  // Return all the elements that pass a truth test.
+  // Delegates to **ECMAScript 5**'s native `filter` if available.
+  // Aliased as `select`.
+  _.filter = _.select = function(obj, iterator, context) {
+    var results = [];
+    if (obj == null) return results;
+    if (nativeFilter && obj.filter === nativeFilter) return obj.filter(iterator, context);
+    each(obj, function(value, index, list) {
+      if (iterator.call(context, value, index, list)) results[results.length] = value;
+    });
+    return results;
+  };
+
+  // Return all the elements for which a truth test fails.
+  _.reject = function(obj, iterator, context) {
+    return _.filter(obj, function(value, index, list) {
+      return !iterator.call(context, value, index, list);
+    }, context);
+  };
+
+  // Determine whether all of the elements match a truth test.
+  // Delegates to **ECMAScript 5**'s native `every` if available.
+  // Aliased as `all`.
+  _.every = _.all = function(obj, iterator, context) {
+    iterator || (iterator = _.identity);
+    var result = true;
+    if (obj == null) return result;
+    if (nativeEvery && obj.every === nativeEvery) return obj.every(iterator, context);
+    each(obj, function(value, index, list) {
+      if (!(result = result && iterator.call(context, value, index, list))) return breaker;
+    });
+    return !!result;
+  };
+
+  // Determine if at least one element in the object matches a truth test.
+  // Delegates to **ECMAScript 5**'s native `some` if available.
+  // Aliased as `any`.
+  var any = _.some = _.any = function(obj, iterator, context) {
+    iterator || (iterator = _.identity);
+    var result = false;
+    if (obj == null) return result;
+    if (nativeSome && obj.some === nativeSome) return obj.some(iterator, context);
+    each(obj, function(value, index, list) {
+      if (result || (result = iterator.call(context, value, index, list))) return breaker;
+    });
+    return !!result;
+  };
+
+  // Determine if the array or object contains a given value (using `===`).
+  // Aliased as `include`.
+  _.contains = _.include = function(obj, target) {
+    if (obj == null) return false;
+    if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1;
+    return any(obj, function(value) {
+      return value === target;
+    });
+  };
+
+  // Invoke a method (with arguments) on every item in a collection.
+  _.invoke = function(obj, method) {
+    var args = slice.call(arguments, 2);
+    var isFunc = _.isFunction(method);
+    return _.map(obj, function(value) {
+      return (isFunc ? method : value[method]).apply(value, args);
+    });
+  };
+
+  // Convenience version of a common use case of `map`: fetching a property.
+  _.pluck = function(obj, key) {
+    return _.map(obj, function(value){ return value[key]; });
+  };
+
+  // Convenience version of a common use case of `filter`: selecting only objects
+  // containing specific `key:value` pairs.
+  _.where = function(obj, attrs, first) {
+    if (_.isEmpty(attrs)) return first ? null : [];
+    return _[first ? 'find' : 'filter'](obj, function(value) {
+      for (var key in attrs) {
+        if (attrs[key] !== value[key]) return false;
+      }
+      return true;
+    });
+  };
+
+  // Convenience version of a common use case of `find`: getting the first object
+  // containing specific `key:value` pairs.
+  _.findWhere = function(obj, attrs) {
+    return _.where(obj, attrs, true);
+  };
+
+  // Return the maximum element or (element-based computation).
+  // Can't optimize arrays of integers longer than 65,535 elements.
+  // See: https://bugs.webkit.org/show_bug.cgi?id=80797
+  _.max = function(obj, iterator, context) {
+    if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) {
+      return Math.max.apply(Math, obj);
+    }
+    if (!iterator && _.isEmpty(obj)) return -Infinity;
+    var result = {computed : -Infinity, value: -Infinity};
+    each(obj, function(value, index, list) {
+      var computed = iterator ? iterator.call(context, value, index, list) : value;
+      computed >= result.computed && (result = {value : value, computed : computed});
+    });
+    return result.value;
+  };
+
+  // Return the minimum element (or element-based computation).
+  _.min = function(obj, iterator, context) {
+    if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) {
+      return Math.min.apply(Math, obj);
+    }
+    if (!iterator && _.isEmpty(obj)) return Infinity;
+    var result = {computed : Infinity, value: Infinity};
+    each(obj, function(value, index, list) {
+      var computed = iterator ? iterator.call(context, value, index, list) : value;
+      computed < result.computed && (result = {value : value, computed : computed});
+    });
+    return result.value;
+  };
+
+  // Shuffle an array.
+  _.shuffle = function(obj) {
+    var rand;
+    var index = 0;
+    var shuffled = [];
+    each(obj, function(value) {
+      rand = _.random(index++);
+      shuffled[index - 1] = shuffled[rand];
+      shuffled[rand] = value;
+    });
+    return shuffled;
+  };
+
+  // An internal function to generate lookup iterators.
+  var lookupIterator = function(value) {
+    return _.isFunction(value) ? value : function(obj){ return obj[value]; };
+  };
+
+  // Sort the object's values by a criterion produced by an iterator.
+  _.sortBy = function(obj, value, context) {
+    var iterator = lookupIterator(value);
+    return _.pluck(_.map(obj, function(value, index, list) {
+      return {
+        value : value,
+        index : index,
+        criteria : iterator.call(context, value, index, list)
+      };
+    }).sort(function(left, right) {
+      var a = left.criteria;
+      var b = right.criteria;
+      if (a !== b) {
+        if (a > b || a === void 0) return 1;
+        if (a < b || b === void 0) return -1;
+      }
+      return left.index < right.index ? -1 : 1;
+    }), 'value');
+  };
+
+  // An internal function used for aggregate "group by" operations.
+  var group = function(obj, value, context, behavior) {
+    var result = {};
+    var iterator = lookupIterator(value || _.identity);
+    each(obj, function(value, index) {
+      var key = iterator.call(context, value, index, obj);
+      behavior(result, key, value);
+    });
+    return result;
+  };
+
+  // Groups the object's values by a criterion. Pass either a string attribute
+  // to group by, or a function that returns the criterion.
+  _.groupBy = function(obj, value, context) {
+    return group(obj, value, context, function(result, key, value) {
+      (_.has(result, key) ? result[key] : (result[key] = [])).push(value);
+    });
+  };
+
+  // Counts instances of an object that group by a certain criterion. Pass
+  // either a string attribute to count by, or a function that returns the
+  // criterion.
+  _.countBy = function(obj, value, context) {
+    return group(obj, value, context, function(result, key) {
+      if (!_.has(result, key)) result[key] = 0;
+      result[key]++;
+    });
+  };
+
+  // Use a comparator function to figure out the smallest index at which
+  // an object should be inserted so as to maintain order. Uses binary search.
+  _.sortedIndex = function(array, obj, iterator, context) {
+    iterator = iterator == null ? _.identity : lookupIterator(iterator);
+    var value = iterator.call(context, obj);
+    var low = 0, high = array.length;
+    while (low < high) {
+      var mid = (low + high) >>> 1;
+      iterator.call(context, array[mid]) < value ? low = mid + 1 : high = mid;
+    }
+    return low;
+  };
+
+  // Safely convert anything iterable into a real, live array.
+  _.toArray = function(obj) {
+    if (!obj) return [];
+    if (_.isArray(obj)) return slice.call(obj);
+    if (obj.length === +obj.length) return _.map(obj, _.identity);
+    return _.values(obj);
+  };
+
+  // Return the number of elements in an object.
+  _.size = function(obj) {
+    if (obj == null) return 0;
+    return (obj.length === +obj.length) ? obj.length : _.keys(obj).length;
+  };
+
+  // Array Functions
+  // ---------------
+
+  // Get the first element of an array. Passing **n** will return the first N
+  // values in the array. Aliased as `head` and `take`. The **guard** check
+  // allows it to work with `_.map`.
+  _.first = _.head = _.take = function(array, n, guard) {
+    if (array == null) return void 0;
+    return (n != null) && !guard ? slice.call(array, 0, n) : array[0];
+  };
+
+  // Returns everything but the last entry of the array. Especially useful on
+  // the arguments object. Passing **n** will return all the values in
+  // the array, excluding the last N. The **guard** check allows it to work with
+  // `_.map`.
+  _.initial = function(array, n, guard) {
+    return slice.call(array, 0, array.length - ((n == null) || guard ? 1 : n));
+  };
+
+  // Get the last element of an array. Passing **n** will return the last N
+  // values in the array. The **guard** check allows it to work with `_.map`.
+  _.last = function(array, n, guard) {
+    if (array == null) return void 0;
+    if ((n != null) && !guard) {
+      return slice.call(array, Math.max(array.length - n, 0));
+    } else {
+      return array[array.length - 1];
+    }
+  };
+
+  // Returns everything but the first entry of the array. Aliased as `tail` and `drop`.
+  // Especially useful on the arguments object. Passing an **n** will return
+  // the rest N values in the array. The **guard**
+  // check allows it to work with `_.map`.
+  _.rest = _.tail = _.drop = function(array, n, guard) {
+    return slice.call(array, (n == null) || guard ? 1 : n);
+  };
+
+  // Trim out all falsy values from an array.
+  _.compact = function(array) {
+    return _.filter(array, _.identity);
+  };
+
+  // Internal implementation of a recursive `flatten` function.
+  var flatten = function(input, shallow, output) {
+    each(input, function(value) {
+      if (_.isArray(value)) {
+        shallow ? push.apply(output, value) : flatten(value, shallow, output);
+      } else {
+        output.push(value);
+      }
+    });
+    return output;
+  };
+
+  // Return a completely flattened version of an array.
+  _.flatten = function(array, shallow) {
+    return flatten(array, shallow, []);
+  };
+
+  // Return a version of the array that does not contain the specified value(s).
+  _.without = function(array) {
+    return _.difference(array, slice.call(arguments, 1));
+  };
+
+  // Produce a duplicate-free version of the array. If the array has already
+  // been sorted, you have the option of using a faster algorithm.
+  // Aliased as `unique`.
+  _.uniq = _.unique = function(array, isSorted, iterator, context) {
+    if (_.isFunction(isSorted)) {
+      context = iterator;
+      iterator = isSorted;
+      isSorted = false;
+    }
+    var initial = iterator ? _.map(array, iterator, context) : array;
+    var results = [];
+    var seen = [];
+    each(initial, function(value, index) {
+      if (isSorted ? (!index || seen[seen.length - 1] !== value) : !_.contains(seen, value)) {
+        seen.push(value);
+        results.push(array[index]);
+      }
+    });
+    return results;
+  };
+
+  // Produce an array that contains the union: each distinct element from all of
+  // the passed-in arrays.
+  _.union = function() {
+    return _.uniq(concat.apply(ArrayProto, arguments));
+  };
+
+  // Produce an array that contains every item shared between all the
+  // passed-in arrays.
+  _.intersection = function(array) {
+    var rest = slice.call(arguments, 1);
+    return _.filter(_.uniq(array), function(item) {
+      return _.every(rest, function(other) {
+        return _.indexOf(other, item) >= 0;
+      });
+    });
+  };
+
+  // Take the difference between one array and a number of other arrays.
+  // Only the elements present in just the first array will remain.
+  _.difference = function(array) {
+    var rest = concat.apply(ArrayProto, slice.call(arguments, 1));
+    return _.filter(array, function(value){ return !_.contains(rest, value); });
+  };
+
+  // Zip together multiple lists into a single array -- elements that share
+  // an index go together.
+  _.zip = function() {
+    var args = slice.call(arguments);
+    var length = _.max(_.pluck(args, 'length'));
+    var results = new Array(length);
+    for (var i = 0; i < length; i++) {
+      results[i] = _.pluck(args, "" + i);
+    }
+    return results;
+  };
+
+  // Converts lists into objects. Pass either a single array of `[key, value]`
+  // pairs, or two parallel arrays of the same length -- one of keys, and one of
+  // the corresponding values.
+  _.object = function(list, values) {
+    if (list == null) return {};
+    var result = {};
+    for (var i = 0, l = list.length; i < l; i++) {
+      if (values) {
+        result[list[i]] = values[i];
+      } else {
+        result[list[i][0]] = list[i][1];
+      }
+    }
+    return result;
+  };
+
+  // If the browser doesn't supply us with indexOf (I'm looking at you, **MSIE**),
+  // we need this function. Return the position of the first occurrence of an
+  // item in an array, or -1 if the item is not included in the array.
+  // Delegates to **ECMAScript 5**'s native `indexOf` if available.
+  // If the array is large and already in sort order, pass `true`
+  // for **isSorted** to use binary search.
+  _.indexOf = function(array, item, isSorted) {
+    if (array == null) return -1;
+    var i = 0, l = array.length;
+    if (isSorted) {
+      if (typeof isSorted == 'number') {
+        i = (isSorted < 0 ? Math.max(0, l + isSorted) : isSorted);
+      } else {
+        i = _.sortedIndex(array, item);
+        return array[i] === item ? i : -1;
+      }
+    }
+    if (nativeIndexOf && array.indexOf === nativeIndexOf) return array.indexOf(item, isSorted);
+    for (; i < l; i++) if (array[i] === item) return i;
+    return -1;
+  };
+
+  // Delegates to **ECMAScript 5**'s native `lastIndexOf` if available.
+  _.lastIndexOf = function(array, item, from) {
+    if (array == null) return -1;
+    var hasIndex = from != null;
+    if (nativeLastIndexOf && array.lastIndexOf === nativeLastIndexOf) {
+      return hasIndex ? array.lastIndexOf(item, from) : array.lastIndexOf(item);
+    }
+    var i = (hasIndex ? from : array.length);
+    while (i--) if (array[i] === item) return i;
+    return -1;
+  };
+
+  // Generate an integer Array containing an arithmetic progression. A port of
+  // the native Python `range()` function. See
+  // [the Python documentation](http://docs.python.org/library/functions.html#range).
+  _.range = function(start, stop, step) {
+    if (arguments.length <= 1) {
+      stop = start || 0;
+      start = 0;
+    }
+    step = arguments[2] || 1;
+
+    var len = Math.max(Math.ceil((stop - start) / step), 0);
+    var idx = 0;
+    var range = new Array(len);
+
+    while(idx < len) {
+      range[idx++] = start;
+      start += step;
+    }
+
+    return range;
+  };
+
+  // Function (ahem) Functions
+  // ------------------
+
+  // Create a function bound to a given object (assigning `this`, and arguments,
+  // optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if
+  // available.
+  _.bind = function(func, context) {
+    if (func.bind === nativeBind && nativeBind) return nativeBind.apply(func, slice.call(arguments, 1));
+    var args = slice.call(arguments, 2);
+    return function() {
+      return func.apply(context, args.concat(slice.call(arguments)));
+    };
+  };
+
+  // Partially apply a function by creating a version that has had some of its
+  // arguments pre-filled, without changing its dynamic `this` context.
+  _.partial = function(func) {
+    var args = slice.call(arguments, 1);
+    return function() {
+      return func.apply(this, args.concat(slice.call(arguments)));
+    };
+  };
+
+  // Bind all of an object's methods to that object. Useful for ensuring that
+  // all callbacks defined on an object belong to it.
+  _.bindAll = function(obj) {
+    var funcs = slice.call(arguments, 1);
+    if (funcs.length === 0) funcs = _.functions(obj);
+    each(funcs, function(f) { obj[f] = _.bind(obj[f], obj); });
+    return obj;
+  };
+
+  // Memoize an expensive function by storing its results.
+  _.memoize = function(func, hasher) {
+    var memo = {};
+    hasher || (hasher = _.identity);
+    return function() {
+      var key = hasher.apply(this, arguments);
+      return _.has(memo, key) ? memo[key] : (memo[key] = func.apply(this, arguments));
+    };
+  };
+
+  // Delays a function for the given number of milliseconds, and then calls
+  // it with the arguments supplied.
+  _.delay = function(func, wait) {
+    var args = slice.call(arguments, 2);
+    return setTimeout(function(){ return func.apply(null, args); }, wait);
+  };
+
+  // Defers a function, scheduling it to run after the current call stack has
+  // cleared.
+  _.defer = function(func) {
+    return _.delay.apply(_, [func, 1].concat(slice.call(arguments, 1)));
+  };
+
+  // Returns a function, that, when invoked, will only be triggered at most once
+  // during a given window of time.
+  _.throttle = function(func, wait) {
+    var context, args, timeout, result;
+    var previous = 0;
+    var later = function() {
+      previous = new Date;
+      timeout = null;
+      result = func.apply(context, args);
+    };
+    return function() {
+      var now = new Date;
+      var remaining = wait - (now - previous);
+      context = this;
+      args = arguments;
+      if (remaining <= 0) {
+        clearTimeout(timeout);
+        timeout = null;
+        previous = now;
+        result = func.apply(context, args);
+      } else if (!timeout) {
+        timeout = setTimeout(later, remaining);
+      }
+      return result;
+    };
+  };
+
+  // Returns a function, that, as long as it continues to be invoked, will not
+  // be triggered. The function will be called after it stops being called for
+  // N milliseconds. If `immediate` is passed, trigger the function on the
+  // leading edge, instead of the trailing.
+  _.debounce = function(func, wait, immediate) {
+    var timeout, result;
+    return function() {
+      var context = this, args = arguments;
+      var later = function() {
+        timeout = null;
+        if (!immediate) result = func.apply(context, args);
+      };
+      var callNow = immediate && !timeout;
+      clearTimeout(timeout);
+      timeout = setTimeout(later, wait);
+      if (callNow) result = func.apply(context, args);
+      return result;
+    };
+  };
+
+  // Returns a function that will be executed at most one time, no matter how
+  // often you call it. Useful for lazy initialization.
+  _.once = function(func) {
+    var ran = false, memo;
+    return function() {
+      if (ran) return memo;
+      ran = true;
+      memo = func.apply(this, arguments);
+      func = null;
+      return memo;
+    };
+  };
+
+  // Returns the first function passed as an argument to the second,
+  // allowing you to adjust arguments, run code before and after, and
+  // conditionally execute the original function.
+  _.wrap = function(func, wrapper) {
+    return function() {
+      var args = [func];
+      push.apply(args, arguments);
+      return wrapper.apply(this, args);
+    };
+  };
+
+  // Returns a function that is the composition of a list of functions, each
+  // consuming the return value of the function that follows.
+  _.compose = function() {
+    var funcs = arguments;
+    return function() {
+      var args = arguments;
+      for (var i = funcs.length - 1; i >= 0; i--) {
+        args = [funcs[i].apply(this, args)];
+      }
+      return args[0];
+    };
+  };
+
+  // Returns a function that will only be executed after being called N times.
+  _.after = function(times, func) {
+    if (times <= 0) return func();
+    return function() {
+      if (--times < 1) {
+        return func.apply(this, arguments);
+      }
+    };
+  };
+
+  // Object Functions
+  // ----------------
+
+  // Retrieve the names of an object's properties.
+  // Delegates to **ECMAScript 5**'s native `Object.keys`
+  _.keys = nativeKeys || function(obj) {
+    if (obj !== Object(obj)) throw new TypeError('Invalid object');
+    var keys = [];
+    for (var key in obj) if (_.has(obj, key)) keys[keys.length] = key;
+    return keys;
+  };
+
+  // Retrieve the values of an object's properties.
+  _.values = function(obj) {
+    var values = [];
+    for (var key in obj) if (_.has(obj, key)) values.push(obj[key]);
+    return values;
+  };
+
+  // Convert an object into a list of `[key, value]` pairs.
+  _.pairs = function(obj) {
+    var pairs = [];
+    for (var key in obj) if (_.has(obj, key)) pairs.push([key, obj[key]]);
+    return pairs;
+  };
+
+  // Invert the keys and values of an object. The values must be serializable.
+  _.invert = function(obj) {
+    var result = {};
+    for (var key in obj) if (_.has(obj, key)) result[obj[key]] = key;
+    return result;
+  };
+
+  // Return a sorted list of the function names available on the object.
+  // Aliased as `methods`
+  _.functions = _.methods = function(obj) {
+    var names = [];
+    for (var key in obj) {
+      if (_.isFunction(obj[key])) names.push(key);
+    }
+    return names.sort();
+  };
+
+  // Extend a given object with all the properties in passed-in object(s).
+  _.extend = function(obj) {
+    each(slice.call(arguments, 1), function(source) {
+      if (source) {
+        for (var prop in source) {
+          obj[prop] = source[prop];
+        }
+      }
+    });
+    return obj;
+  };
+
+  // Return a copy of the object only containing the whitelisted properties.
+  _.pick = function(obj) {
+    var copy = {};
+    var keys = concat.apply(ArrayProto, slice.call(arguments, 1));
+    each(keys, function(key) {
+      if (key in obj) copy[key] = obj[key];
+    });
+    return copy;
+  };
+
+   // Return a copy of the object without the blacklisted properties.
+  _.omit = function(obj) {
+    var copy = {};
+    var keys = concat.apply(ArrayProto, slice.call(arguments, 1));
+    for (var key in obj) {
+      if (!_.contains(keys, key)) copy[key] = obj[key];
+    }
+    return copy;
+  };
+
+  // Fill in a given object with default properties.
+  _.defaults = function(obj) {
+    each(slice.call(arguments, 1), function(source) {
+      if (source) {
+        for (var prop in source) {
+          if (obj[prop] == null) obj[prop] = source[prop];
+        }
+      }
+    });
+    return obj;
+  };
+
+  // Create a (shallow-cloned) duplicate of an object.
+  _.clone = function(obj) {
+    if (!_.isObject(obj)) return obj;
+    return _.isArray(obj) ? obj.slice() : _.extend({}, obj);
+  };
+
+  // Invokes interceptor with the obj, and then returns obj.
+  // The primary purpose of this method is to "tap into" a method chain, in
+  // order to perform operations on intermediate results within the chain.
+  _.tap = function(obj, interceptor) {
+    interceptor(obj);
+    return obj;
+  };
+
+  // Internal recursive comparison function for `isEqual`.
+  var eq = function(a, b, aStack, bStack) {
+    // Identical objects are equal. `0 === -0`, but they aren't identical.
+    // See the Harmony `egal` proposal: http://wiki.ecmascript.org/doku.php?id=harmony:egal.
+    if (a === b) return a !== 0 || 1 / a == 1 / b;
+    // A strict comparison is necessary because `null == undefined`.
+    if (a == null || b == null) return a === b;
+    // Unwrap any wrapped objects.
+    if (a instanceof _) a = a._wrapped;
+    if (b instanceof _) b = b._wrapped;
+    // Compare `[[Class]]` names.
+    var className = toString.call(a);
+    if (className != toString.call(b)) return false;
+    switch (className) {
+      // Strings, numbers, dates, and booleans are compared by value.
+      case '[object String]':
+        // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is
+        // equivalent to `new String("5")`.
+        return a == String(b);
+      case '[object Number]':
+        // `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for
+        // other numeric values.
+        return a != +a ? b != +b : (a == 0 ? 1 / a == 1 / b : a == +b);
+      case '[object Date]':
+      case '[object Boolean]':
+        // Coerce dates and booleans to numeric primitive values. Dates are compared by their
+        // millisecond representations. Note that invalid dates with millisecond representations
+        // of `NaN` are not equivalent.
+        return +a == +b;
+      // RegExps are compared by their source patterns and flags.
+      case '[object RegExp]':
+        return a.source == b.source &&
+               a.global == b.global &&
+               a.multiline == b.multiline &&
+               a.ignoreCase == b.ignoreCase;
+    }
+    if (typeof a != 'object' || typeof b != 'object') return false;
+    // Assume equality for cyclic structures. The algorithm for detecting cyclic
+    // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.
+    var length = aStack.length;
+    while (length--) {
+      // Linear search. Performance is inversely proportional to the number of
+      // unique nested structures.
+      if (aStack[length] == a) return bStack[length] == b;
+    }
+    // Add the first object to the stack of traversed objects.
+    aStack.push(a);
+    bStack.push(b);
+    var size = 0, result = true;
+    // Recursively compare objects and arrays.
+    if (className == '[object Array]') {
+      // Compare array lengths to determine if a deep comparison is necessary.
+      size = a.length;
+      result = size == b.length;
+      if (result) {
+        // Deep compare the contents, ignoring non-numeric properties.
+        while (size--) {
+          if (!(result = eq(a[size], b[size], aStack, bStack))) break;
+        }
+      }
+    } else {
+      // Objects with different constructors are not equivalent, but `Object`s
+      // from different frames are.
+      var aCtor = a.constructor, bCtor = b.constructor;
+      if (aCtor !== bCtor && !(_.isFunction(aCtor) && (aCtor instanceof aCtor) &&
+                               _.isFunction(bCtor) && (bCtor instanceof bCtor))) {
+        return false;
+      }
+      // Deep compare objects.
+      for (var key in a) {
+        if (_.has(a, key)) {
+          // Count the expected number of properties.
+          size++;
+          // Deep compare each member.
+          if (!(result = _.has(b, key) && eq(a[key], b[key], aStack, bStack))) break;
+        }
+      }
+      // Ensure that both objects contain the same number of properties.
+      if (result) {
+        for (key in b) {
+          if (_.has(b, key) && !(size--)) break;
+        }
+        result = !size;
+      }
+    }
+    // Remove the first object from the stack of traversed objects.
+    aStack.pop();
+    bStack.pop();
+    return result;
+  };
+
+  // Perform a deep comparison to check if two objects are equal.
+  _.isEqual = function(a, b) {
+    return eq(a, b, [], []);
+  };
+
+  // Is a given array, string, or object empty?
+  // An "empty" object has no enumerable own-properties.
+  _.isEmpty = function(obj) {
+    if (obj == null) return true;
+    if (_.isArray(obj) || _.isString(obj)) return obj.length === 0;
+    for (var key in obj) if (_.has(obj, key)) return false;
+    return true;
+  };
+
+  // Is a given value a DOM element?
+  _.isElement = function(obj) {
+    return !!(obj && obj.nodeType === 1);
+  };
+
+  // Is a given value an array?
+  // Delegates to ECMA5's native Array.isArray
+  _.isArray = nativeIsArray || function(obj) {
+    return toString.call(obj) == '[object Array]';
+  };
+
+  // Is a given variable an object?
+  _.isObject = function(obj) {
+    return obj === Object(obj);
+  };
+
+  // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp.
+  each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp'], function(name) {
+    _['is' + name] = function(obj) {
+      return toString.call(obj) == '[object ' + name + ']';
+    };
+  });
+
+  // Define a fallback version of the method in browsers (ahem, IE), where
+  // there isn't any inspectable "Arguments" type.
+  if (!_.isArguments(arguments)) {
+    _.isArguments = function(obj) {
+      return !!(obj && _.has(obj, 'callee'));
+    };
+  }
+
+  // Optimize `isFunction` if appropriate.
+  if (typeof (/./) !== 'function') {
+    _.isFunction = function(obj) {
+      return typeof obj === 'function';
+    };
+  }
+
+  // Is a given object a finite number?
+  _.isFinite = function(obj) {
+    return isFinite(obj) && !isNaN(parseFloat(obj));
+  };
+
+  // Is the given value `NaN`? (NaN is the only number which does not equal itself).
+  _.isNaN = function(obj) {
+    return _.isNumber(obj) && obj != +obj;
+  };
+
+  // Is a given value a boolean?
+  _.isBoolean = function(obj) {
+    return obj === true || obj === false || toString.call(obj) == '[object Boolean]';
+  };
+
+  // Is a given value equal to null?
+  _.isNull = function(obj) {
+    return obj === null;
+  };
+
+  // Is a given variable undefined?
+  _.isUndefined = function(obj) {
+    return obj === void 0;
+  };
+
+  // Shortcut function for checking if an object has a given property directly
+  // on itself (in other words, not on a prototype).
+  _.has = function(obj, key) {
+    return hasOwnProperty.call(obj, key);
+  };
+
+  // Utility Functions
+  // -----------------
+
+  // Run Underscore.js in *noConflict* mode, returning the `_` variable to its
+  // previous owner. Returns a reference to the Underscore object.
+  _.noConflict = function() {
+    root._ = previousUnderscore;
+    return this;
+  };
+
+  // Keep the identity function around for default iterators.
+  _.identity = function(value) {
+    return value;
+  };
+
+  // Run a function **n** times.
+  _.times = function(n, iterator, context) {
+    var accum = Array(n);
+    for (var i = 0; i < n; i++) accum[i] = iterator.call(context, i);
+    return accum;
+  };
+
+  // Return a random integer between min and max (inclusive).
+  _.random = function(min, max) {
+    if (max == null) {
+      max = min;
+      min = 0;
+    }
+    return min + Math.floor(Math.random() * (max - min + 1));
+  };
+
+  // List of HTML entities for escaping.
+  var entityMap = {
+    escape: {
+      '&': '&amp;',
+      '<': '&lt;',
+      '>': '&gt;',
+      '"': '&quot;',
+      "'": '&#x27;',
+      '/': '&#x2F;'
+    }
+  };
+  entityMap.unescape = _.invert(entityMap.escape);
+
+  // Regexes containing the keys and values listed immediately above.
+  var entityRegexes = {
+    escape:   new RegExp('[' + _.keys(entityMap.escape).join('') + ']', 'g'),
+    unescape: new RegExp('(' + _.keys(entityMap.unescape).join('|') + ')', 'g')
+  };
+
+  // Functions for escaping and unescaping strings to/from HTML interpolation.
+  _.each(['escape', 'unescape'], function(method) {
+    _[method] = function(string) {
+      if (string == null) return '';
+      return ('' + string).replace(entityRegexes[method], function(match) {
+        return entityMap[method][match];
+      });
+    };
+  });
+
+  // If the value of the named property is a function then invoke it;
+  // otherwise, return it.
+  _.result = function(object, property) {
+    if (object == null) return null;
+    var value = object[property];
+    return _.isFunction(value) ? value.call(object) : value;
+  };
+
+  // Add your own custom functions to the Underscore object.
+  _.mixin = function(obj) {
+    each(_.functions(obj), function(name){
+      var func = _[name] = obj[name];
+      _.prototype[name] = function() {
+        var args = [this._wrapped];
+        push.apply(args, arguments);
+        return result.call(this, func.apply(_, args));
+      };
+    });
+  };
+
+  // Generate a unique integer id (unique within the entire client session).
+  // Useful for temporary DOM ids.
+  var idCounter = 0;
+  _.uniqueId = function(prefix) {
+    var id = ++idCounter + '';
+    return prefix ? prefix + id : id;
+  };
+
+  // By default, Underscore uses ERB-style template delimiters, change the
+  // following template settings to use alternative delimiters.
+  _.templateSettings = {
+    evaluate    : /<%([\s\S]+?)%>/g,
+    interpolate : /<%=([\s\S]+?)%>/g,
+    escape      : /<%-([\s\S]+?)%>/g
+  };
+
+  // When customizing `templateSettings`, if you don't want to define an
+  // interpolation, evaluation or escaping regex, we need one that is
+  // guaranteed not to match.
+  var noMatch = /(.)^/;
+
+  // Certain characters need to be escaped so that they can be put into a
+  // string literal.
+  var escapes = {
+    "'":      "'",
+    '\\':     '\\',
+    '\r':     'r',
+    '\n':     'n',
+    '\t':     't',
+    '\u2028': 'u2028',
+    '\u2029': 'u2029'
+  };
+
+  var escaper = /\\|'|\r|\n|\t|\u2028|\u2029/g;
+
+  // JavaScript micro-templating, similar to John Resig's implementation.
+  // Underscore templating handles arbitrary delimiters, preserves whitespace,
+  // and correctly escapes quotes within interpolated code.
+  _.template = function(text, data, settings) {
+    var render;
+    settings = _.defaults({}, settings, _.templateSettings);
+
+    // Combine delimiters into one regular expression via alternation.
+    var matcher = new RegExp([
+      (settings.escape || noMatch).source,
+      (settings.interpolate || noMatch).source,
+      (settings.evaluate || noMatch).source
+    ].join('|') + '|$', 'g');
+
+    // Compile the template source, escaping string literals appropriately.
+    var index = 0;
+    var source = "__p+='";
+    text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {
+      source += text.slice(index, offset)
+        .replace(escaper, function(match) { return '\\' + escapes[match]; });
+
+      if (escape) {
+        source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'";
+      }
+      if (interpolate) {
+        source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'";
+      }
+      if (evaluate) {
+        source += "';\n" + evaluate + "\n__p+='";
+      }
+      index = offset + match.length;
+      return match;
+    });
+    source += "';\n";
+
+    // If a variable is not specified, place data values in local scope.
+    if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n';
+
+    source = "var __t,__p='',__j=Array.prototype.join," +
+      "print=function(){__p+=__j.call(arguments,'');};\n" +
+      source + "return __p;\n";
+
+    try {
+      render = new Function(settings.variable || 'obj', '_', source);
+    } catch (e) {
+      e.source = source;
+      throw e;
+    }
+
+    if (data) return render(data, _);
+    var template = function(data) {
+      return render.call(this, data, _);
+    };
+
+    // Provide the compiled function source as a convenience for precompilation.
+    template.source = 'function(' + (settings.variable || 'obj') + '){\n' + source + '}';
+
+    return template;
+  };
+
+  // Add a "chain" function, which will delegate to the wrapper.
+  _.chain = function(obj) {
+    return _(obj).chain();
+  };
+
+  // OOP
+  // ---------------
+  // If Underscore is called as a function, it returns a wrapped object that
+  // can be used OO-style. This wrapper holds altered versions of all the
+  // underscore functions. Wrapped objects may be chained.
+
+  // Helper function to continue chaining intermediate results.
+  var result = function(obj) {
+    return this._chain ? _(obj).chain() : obj;
+  };
+
+  // Add all of the Underscore functions to the wrapper object.
+  _.mixin(_);
+
+  // Add all mutator Array functions to the wrapper.
+  each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {
+    var method = ArrayProto[name];
+    _.prototype[name] = function() {
+      var obj = this._wrapped;
+      method.apply(obj, arguments);
+      if ((name == 'shift' || name == 'splice') && obj.length === 0) delete obj[0];
+      return result.call(this, obj);
+    };
+  });
+
+  // Add all accessor Array functions to the wrapper.
+  each(['concat', 'join', 'slice'], function(name) {
+    var method = ArrayProto[name];
+    _.prototype[name] = function() {
+      return result.call(this, method.apply(this._wrapped, arguments));
+    };
+  });
+
+  _.extend(_.prototype, {
+
+    // Start chaining a wrapped Underscore object.
+    chain: function() {
+      this._chain = true;
+      return this;
+    },
+
+    // Extracts the result from a wrapped and chained object.
+    value: function() {
+      return this._wrapped;
+    }
+
+  });
+
+}).call(this);

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/js/model/app-tree.js
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/js/model/app-tree.js b/src/main/webapp/assets/js/model/app-tree.js
new file mode 100644
index 0000000..67efd91
--- /dev/null
+++ b/src/main/webapp/assets/js/model/app-tree.js
@@ -0,0 +1,130 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+*/
+define([
+    "underscore", "backbone"
+], function (_, Backbone) {
+
+    var AppTree = {};
+
+    AppTree.Model = Backbone.Model.extend({
+        defaults: function() {
+            return {
+                id: "",
+                name: "",
+                type: "",
+                iconUrl: "",
+                serviceUp: "",
+                serviceState: "",
+                applicationId: "",
+                parentId: "",
+                children: [],
+                members: []
+            };
+        },
+        getDisplayName: function() {
+            return this.get("name");
+        },
+        hasChildren: function() {
+            return this.get("children").length > 0;
+        },
+        hasMembers: function() {
+            return this.get("members").length > 0;
+        }
+    })
+
+    AppTree.Collection = Backbone.Collection.extend({
+        model: AppTree.Model,
+        includedEntities: [],
+
+        getApplications: function() {
+            var entities = [];
+            _.each(this.models, function(it) {
+                if (it.get('id') == it.get('applicationId'))
+                    entities.push(it.get('id'));
+            });
+            return entities;
+        },
+
+        getNonApplications: function() {
+            var entities = [];
+            _.each(this.models, function(it) {
+                if (it.get('id') != it.get('applicationId'))
+                    entities.push(it.get('id'));
+            });
+            return entities;
+        },
+
+        includeEntities: function(entities) {
+            // accepts id as string or object with id field
+            var oldLength = this.includedEntities.length;
+            var newList = [].concat(this.includedEntities);
+            for (entityId in entities) {
+                var entity = entities[entityId];
+                if (typeof entity === 'string')
+                    newList.push(entity);
+                else
+                    newList.push(entity.id);
+            }
+            this.includedEntities = _.uniq(newList);
+            return (this.includedEntities.length > oldLength);
+        },
+
+        /**
+         * Depth-first search of entries in this.models for the first entity whose ID matches the
+         * function's argument. Includes each entity's children.
+         */
+        getEntityNameFromId: function (id) {
+            if (!this.models.length) return undefined;
+
+            for (var i = 0, l = this.models.length; i < l; i++) {
+                var model = this.models[i];
+                if (model.get("id") === id) {
+                    return model.getDisplayName();
+                } else {
+                    // slice(0) makes a shallow clone of the array
+                    var queue = model.get("children").slice(0);
+                    while (queue.length) {
+                        var child = queue.pop();
+                        if (child.id === id) {
+                            return child.name;
+                        } else {
+                            if (_.has(child, 'children')) {
+                                queue = queue.concat(child.children);
+                            }
+                        }
+                    }
+                }
+            }
+
+            // Is this surprising? If we returned undefined and the caller concatenates it with
+            // a string they'll get "stringundefined", whereas this way they'll just get "string".
+            return "";
+        },
+
+        url: function() {
+            if (this.includedEntities.length) {
+                var ids = this.includedEntities.join(",");
+                return "/v1/applications/fetch?items="+ids;
+            } else
+                return "/v1/applications/fetch";
+        }
+    });
+
+    return AppTree;
+})
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/js/model/application.js
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/js/model/application.js b/src/main/webapp/assets/js/model/application.js
new file mode 100644
index 0000000..589ea40
--- /dev/null
+++ b/src/main/webapp/assets/js/model/application.js
@@ -0,0 +1,151 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+*/
+/**
+ * Models an application.
+ */
+define([
+    "underscore", "backbone"
+], function (_, Backbone) {
+
+    var Application = {}
+
+    Application.Spec = Backbone.Model.extend({
+        defaults:function () {
+            return {
+                id:null,
+                name:"",
+                type:null,
+                entities:null,
+                locations:[]
+            }
+        },
+        hasLocation:function (location) {
+            if (location) return _.include(this.get('locations'), location)
+        },
+        addLocation:function (location) {
+            var locations = this.get('locations')
+            locations.push(location)
+            this.set('locations', locations)
+            this.trigger("change")
+            this.trigger("change:locations")
+        },
+        removeLocation:function (location) {
+            var newLocations = [],
+                currentLocations = this.get("locations")
+            for (var index in currentLocations) {
+                if (currentLocations[index] != location && index != null)
+                    newLocations.push(currentLocations[index])
+            }
+            this.set('locations', newLocations)
+        },
+        removeLocationIndex:function (locationNumber) {
+            var newLocations = [],
+                currentLocations = this.get("locations")
+            for (var index=0; index<currentLocations.length; index++) {
+                if (index != locationNumber)
+                    newLocations.push(currentLocations[index])
+            }
+            this.set('locations', newLocations)
+        },
+        /* Drops falsy locations */
+        pruneLocations: function() {
+            var newLocations = _.compact(this.get('locations'));
+            if (newLocations && _.size(newLocations)) this.set('locations', newLocations);
+            else this.unset("locations");
+        },
+        setLocationAtIndex:function (locationNumber, val) {
+            var newLocations = [],
+                currentLocations = this.get("locations")
+            for (var index=0; index<currentLocations.length; index++) {
+                if (index != locationNumber)
+                    newLocations.push(currentLocations[index])
+                else
+                    newLocations.push(val)
+            }
+            this.set('locations', newLocations)
+        },
+        getEntities: function() {
+            var entities = this.get('entities')
+            if (entities === undefined) return [];
+            return entities;
+        },
+        addEntity:function (entity) {
+            var entities = this.getEntities()
+            if (!entities) {
+                entities = []
+                this.set("entities", entities)
+            }
+            entities.push(entity.toJSON())
+            this.set('entities', entities)
+            this.trigger("change")
+            this.trigger("change:entities")
+        },
+        removeEntityIndex:function (indexToRemove) {
+            var newEntities = [],
+                currentEntities = this.getEntities()
+            for (var index=0; index<currentEntities.length; index++) {
+                if (index != indexToRemove)
+                    newEntities.push(currentEntities[index])
+            }
+            this.set('entities', newEntities)
+        },
+        removeEntityByName:function (name) {
+            var newEntities = [],
+                currentEntities = this.getEntities()
+            for (var index in currentEntities) {
+                if (currentEntities[index].name != name)
+                    newEntities.push(currentEntities[index])
+            }
+            this.set('entities', newEntities)
+        },
+        hasEntityWithName:function (name) {
+            return _.any(this.getEntities(), function (entity) {
+                return entity.name === name
+            })
+        }
+    })
+
+    Application.Model = Backbone.Model.extend({
+        defaults:function () {
+            return{
+                id:null,
+                spec:{},
+                status:"UNKNOWN",
+                links:{}
+            }
+        },
+        initialize:function () {
+            this.id = this.get("id")
+        },
+        getSpec:function () {
+            return new Application.Spec(this.get('spec'))
+        },
+        getLinkByName:function (name) {
+            if (name) return this.get("links")[name]
+        }
+    })
+
+    Application.Collection = Backbone.Collection.extend({
+        model:Application.Model,
+        url:'/v1/applications'
+    })
+
+    return Application
+})
+

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/js/model/catalog-application.js
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/js/model/catalog-application.js b/src/main/webapp/assets/js/model/catalog-application.js
new file mode 100644
index 0000000..73b4d03
--- /dev/null
+++ b/src/main/webapp/assets/js/model/catalog-application.js
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+*/
+define(["underscore", "backbone"], function (_, Backbone) {
+    
+    var CatalogApplication = {}
+
+    CatalogApplication.Model = Backbone.Model.extend({
+        defaults: function () {
+            return {
+                id: "",
+                type: "",
+                name: "",
+                version: "",
+                description: "",
+                planYaml: "",
+                iconUrl: ""
+            }
+        }
+    })
+
+    CatalogApplication.Collection = Backbone.Collection.extend({
+        model: CatalogApplication.Model,
+        url: '/v1/catalog/applications',
+        getDistinctApplications: function() {
+            return this.groupBy('type');
+        },
+        getTypes: function(type) {
+            return _.uniq(this.chain().map(function(model) {return model.get('type')}).value());
+        },
+        hasType: function(type) {
+            return this.where({type: type}).length > 0;
+        },
+        getVersions: function(type) {
+            return this.chain().filter(function(model) {return model.get('type') === type}).map(function(model) {return model.get('version')}).value();
+        }
+    })
+
+    return CatalogApplication
+})
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/js/model/catalog-item-summary.js
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/js/model/catalog-item-summary.js b/src/main/webapp/assets/js/model/catalog-item-summary.js
new file mode 100644
index 0000000..60d1eda
--- /dev/null
+++ b/src/main/webapp/assets/js/model/catalog-item-summary.js
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+*/
+define(["underscore", "backbone"], function (_, Backbone) {
+
+    // NB: THIS IS NOT USED CURRENTLY
+    // the logic in application-add-wizard.js simply loads and manipulates json;
+    // logic in catalog.js (view) defines its own local model
+    // TODO change those so that they use this backbone model + collection,
+    // allowing a way to specify on creation what we are looking up in the catalog -- apps or entities or policies
+    
+    var CatalogItem = {}
+
+    CatalogItem.Model = Backbone.Model.extend({
+        defaults:function () {
+            return {
+                id:"",
+                name:"",
+                type:"",
+                description:"",
+                planYaml:"",
+                iconUrl:""
+            }
+        }
+    })
+
+    CatalogItem.Collection = Backbone.Collection.extend({
+        model:CatalogItem.Model,
+        url:'/v1/catalog'  // TODO is this application or entities or policies? (but note THIS IS NOT USED)
+    })
+
+    return CatalogItem
+})
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/js/model/config-summary.js
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/js/model/config-summary.js b/src/main/webapp/assets/js/model/config-summary.js
new file mode 100644
index 0000000..2f6102b
--- /dev/null
+++ b/src/main/webapp/assets/js/model/config-summary.js
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+*/
+define([
+    "jquery", 'backbone'
+], function ($, Backbone) {
+
+    var ConfigSummary = {}
+
+    ConfigSummary.Model = Backbone.Model.extend({
+        defaults:function () {
+            return {
+                name:'',
+                type:'',
+                description:'',
+                links:{}
+            }
+        },
+        getLinkByName:function (name) {
+            if (name) return this.get("links")[name]
+        }
+    })
+
+    ConfigSummary.Collection = Backbone.Collection.extend({
+        model:ConfigSummary.Model
+    })
+
+    return ConfigSummary
+})
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/js/model/effector-param.js
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/js/model/effector-param.js b/src/main/webapp/assets/js/model/effector-param.js
new file mode 100644
index 0000000..ea0d510
--- /dev/null
+++ b/src/main/webapp/assets/js/model/effector-param.js
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+*/
+define([
+    "backbone"
+], function (Backbone) {
+
+    var Param = {}
+
+    Param.Model = Backbone.Model.extend({
+        defaults:function () {
+            return {
+                name:"",
+                type:"",
+                description:"",
+                defaultValue:""
+            }
+        }
+    })
+
+    Param.Collection = Backbone.Collection.extend({
+        model:Param.Model
+    })
+
+    return Param
+})
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/js/model/effector-summary.js
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/js/model/effector-summary.js b/src/main/webapp/assets/js/model/effector-summary.js
new file mode 100644
index 0000000..0524a23
--- /dev/null
+++ b/src/main/webapp/assets/js/model/effector-summary.js
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+*/
+define([
+    "underscore", "backbone"
+], function (_, Backbone) {
+
+    var EffectorSummary = {}
+
+    EffectorSummary.Model = Backbone.Model.extend({
+        idAttribute: 'name',
+        defaults:function () {
+            return {
+                name:"",
+                description:"",
+                returnType:"",
+                parameters:[],
+                links:{
+                    self:"",
+                    entity:"",
+                    application:""
+                }
+            }
+        },
+        getParameterByName:function (name) {
+            if (name) {
+                return _.find(this.get("parameters"), function (param) {
+                    return param.name == name
+                })
+            }
+        },
+        getLinkByName:function (name) {
+            if (name) return this.get("links")[name]
+        }
+    })
+
+    EffectorSummary.Collection = Backbone.Collection.extend({
+        model:EffectorSummary.Model
+    })
+
+    return EffectorSummary
+})
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/js/model/entity-summary.js
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/js/model/entity-summary.js b/src/main/webapp/assets/js/model/entity-summary.js
new file mode 100644
index 0000000..d8a3d66
--- /dev/null
+++ b/src/main/webapp/assets/js/model/entity-summary.js
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+*/
+define(["underscore", "backbone"], function (_, Backbone) {
+
+    var EntitySummary = {}
+
+    EntitySummary.Model = Backbone.Model.extend({
+        defaults:function () {
+            return {
+                'id':'',
+                'name':'',
+                'type':'',
+                'catalogItemId':'',
+                'links':{}
+            }
+        },
+        getLinkByName:function (name) {
+            if (name) return this.get("links")[name]
+        },
+        getDisplayName:function () {
+            var name = this.get("name")
+            if (name) return name;
+            var type = this.get("type")
+            var appId = this.getLinkByName('self')
+            if (type && appId) {
+                return type.slice(type.lastIndexOf('.') + 1) + ':' + appId.slice(appId.lastIndexOf('/') + 1)
+            }
+        },
+        getSensorUpdateUrl:function () {
+            return this.getLinkByName("self") + "/sensors/current-state"
+        },
+        getConfigUpdateUrl:function () {
+            return this.getLinkByName("self") + "/config/current-state"
+        }
+    })
+
+    EntitySummary.Collection = Backbone.Collection.extend({
+        model:EntitySummary.Model,
+        url:'entity-summary-collection',
+        findByDisplayName:function (displayName) {
+            if (displayName) return this.filter(function (element) {
+                return element.getDisplayName() === displayName
+            })
+        }
+    })
+
+    return EntitySummary
+})
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/js/model/entity.js
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/js/model/entity.js b/src/main/webapp/assets/js/model/entity.js
new file mode 100644
index 0000000..fc83743
--- /dev/null
+++ b/src/main/webapp/assets/js/model/entity.js
@@ -0,0 +1,79 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+*/
+define(["underscore", "backbone"], function (_, Backbone) {
+
+    var Entity = {}
+
+    Entity.Model = Backbone.Model.extend({
+        defaults:function () {
+            return {
+                name:"",
+                type:"",
+                config:{}
+            }
+        },
+        getVersionedAttr: function(name) {
+            var attr = this.get(name);
+            var version = this.get('version');
+            if (version && version != '0.0.0.SNAPSHOT') {
+                return attr + ':' + version;
+            } else {
+                return attr;
+            }
+        },
+        url: function() {
+            var base = _.result(this, 'urlRoot') || _.result(this.collection, 'url') || urlError();
+            if (this.isNew()) return base;
+            return base + (base.charAt(base.length - 1) === '/' ? '' : '/') + 
+                encodeURIComponent(this.get("symbolicName")) + '/' + encodeURIComponent(this.get("version"));
+        },
+        getConfigByName:function (key) {
+            if (key) return this.get("config")[key]
+        },
+        addConfig:function (key, value) {
+            if (key) {
+                var configs = this.get("config")
+                configs[key] = value
+                this.set('config', configs)
+                this.trigger("change")
+                this.trigger("change:config")
+                return true
+            }
+            return false
+        },
+        removeConfig:function (key) {
+            if (key) {
+                var configs = this.get('config')
+                delete configs[key]
+                this.set('config', configs)
+                this.trigger("change")
+                this.trigger("change:config")
+                return true
+            }
+            return false
+        }
+    })
+
+    Entity.Collection = Backbone.Collection.extend({
+        model:Entity.Model,
+        url:'entity-collection'
+    })
+
+    return Entity
+})
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/js/model/location.js
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/js/model/location.js b/src/main/webapp/assets/js/model/location.js
new file mode 100644
index 0000000..4e33860
--- /dev/null
+++ b/src/main/webapp/assets/js/model/location.js
@@ -0,0 +1,92 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+*/
+define(["underscore", "backbone"], function (_, Backbone) {
+
+    var Location = {}
+
+    Location.Model = Backbone.Model.extend({
+        urlRoot:'/v1/locations',
+        defaults:function () {
+            return {
+                name:'',
+                spec:'',
+                config:{}
+            }
+        },
+        idFromSelfLink:function () {
+            return this.get('id');
+        },
+        initialize:function () {
+        },
+        addConfig:function (key, value) {
+            if (key) {
+                var configs = this.get("config")
+                configs[key] = value
+                this.set('config', configs)
+                return true
+            }
+            return false
+        },
+        removeConfig:function (key) {
+            if (key) {
+                var configs = this.get('config')
+                delete configs[key]
+                this.set('config', configs)
+                return true
+            }
+            return false
+        },
+        getConfigByName:function (name) {
+            if (name) return this.get("config")[name]
+        },
+        getLinkByName:function (name) {
+            if (name) return this.get("links")[name]
+        },
+        hasSelfUrl:function (url) {
+            return (this.getLinkByName("self") === url)
+        },
+        getPrettyName: function() {
+            var name = null;
+            if (this.get('config') && this.get('config')['displayName'])
+                name = this.get('config')['displayName'];
+            if (name!=null && name.length>0) return name
+            name = this.get('name')
+            if (name!=null && name.length>0) return name
+            return this.get('spec')
+        },
+        getIdentifierName: function() {
+            var name = null;
+            name = this.get('name')
+            if (name!=null && name.length>0) return name
+            return this.get('spec')
+        }
+
+    })
+
+    Location.Collection = Backbone.Collection.extend({
+        model:Location.Model,
+        url:'/v1/locations'
+    })
+
+    Location.UsageLocated = Backbone.Model.extend({
+        url:'/v1/locations/usage/LocatedLocations'
+    })
+
+    return Location
+})
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/js/model/policy-config-summary.js
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/js/model/policy-config-summary.js b/src/main/webapp/assets/js/model/policy-config-summary.js
new file mode 100644
index 0000000..4c1da98
--- /dev/null
+++ b/src/main/webapp/assets/js/model/policy-config-summary.js
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+*/
+define([
+    "underscore", "backbone"
+], function (_, Backbone) {
+
+    var PolicyConfigSummary = {}
+
+    PolicyConfigSummary.Model = Backbone.Model.extend({
+        defaults:function () {
+            return {
+                name:"",
+                type:"",
+                description:"",
+                defaultValue:"",
+                value:"",
+                reconfigurable:"",
+                links:{
+                    self:"",
+                    application:"",
+                    entity:"",
+                    policy:"",
+                    edit:""
+                }
+            }
+        },
+        getLinkByName:function (name) {
+            if (name) return this.get("links")[name]
+        }
+    })
+
+    PolicyConfigSummary.Collection = Backbone.Collection.extend({
+        model:PolicyConfigSummary.Model
+    })
+
+    return PolicyConfigSummary
+})
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/js/model/policy-summary.js
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/js/model/policy-summary.js b/src/main/webapp/assets/js/model/policy-summary.js
new file mode 100644
index 0000000..9dc6932
--- /dev/null
+++ b/src/main/webapp/assets/js/model/policy-summary.js
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+*/
+define([
+    "underscore", "backbone"
+], function (_, Backbone) {
+
+    var PolicySummary = {}
+
+    PolicySummary.Model = Backbone.Model.extend({
+        defaults:function () {
+            return {
+                id:"",
+                name:"",
+                state:"",
+                links:{
+                    self:"",
+                    config:"",
+                    start:"",
+                    stop:"",
+                    destroy:"",
+                    entity:"",
+                    application:""
+                }
+            }
+        },
+        getLinkByName:function (name) {
+            if (name) return this.get("links")[name]
+        },
+        getPolicyConfigUpdateUrl:function () {
+            return this.getLinkByName("self") + "/config/current-state"
+        }
+    })
+
+    PolicySummary.Collection = Backbone.Collection.extend({
+        model:PolicySummary.Model
+    })
+
+    return PolicySummary
+})
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/js/model/sensor-summary.js
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/js/model/sensor-summary.js b/src/main/webapp/assets/js/model/sensor-summary.js
new file mode 100644
index 0000000..5f9bcbe
--- /dev/null
+++ b/src/main/webapp/assets/js/model/sensor-summary.js
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+*/
+define([
+    "jquery", 'backbone'
+], function ($, Backbone) {
+
+    var SensorSummary = {}
+
+    SensorSummary.Model = Backbone.Model.extend({
+        defaults:function () {
+            return {
+                name:'',
+                type:'',
+                description:'',
+                links:{}
+            }
+        },
+        getLinkByName:function (name) {
+            if (name) return this.get("links")[name]
+        }
+    })
+
+    SensorSummary.Collection = Backbone.Collection.extend({
+        model:SensorSummary.Model
+    })
+
+    return SensorSummary
+})
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/js/model/server-extended-status.js
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/js/model/server-extended-status.js b/src/main/webapp/assets/js/model/server-extended-status.js
new file mode 100644
index 0000000..aa9e5fa
--- /dev/null
+++ b/src/main/webapp/assets/js/model/server-extended-status.js
@@ -0,0 +1,102 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+*/
+define(["backbone", "brooklyn", "view/viewutils"], function (Backbone, Brooklyn, ViewUtils) {
+
+    var ServerExtendedStatus = Backbone.Model.extend({
+        callbacks: [],
+        loaded: false,
+        url: "/v1/server/up/extended",
+        onError: function(thiz,xhr,modelish) {
+            log("ServerExtendedStatus: error contacting Brooklyn server");
+            log(xhr);
+            if (xhr.readyState==0) {
+                // server not contactable
+                this.loaded = false;
+            } else {
+                // server error
+                log(xhr.responseText);
+                // simply set unhealthy
+                this.set("healthy", false);
+            }
+            this.applyCallbacks();
+        },
+        whenUp: function(f) {
+            var that = this;
+            if (this.isUp()) {
+                f();
+            } else {
+                this.addCallback(function() { that.whenUp(f); });
+            }
+        },
+        onLoad: function(f) {
+            if (this.loaded) {
+                f();
+            } else {
+                this.addCallback(f);
+            }
+        },
+        addCallback: function(f) {
+            this.callbacks.push(f);
+        },
+        autoUpdate: function() {
+            var that = this;
+            // to debug:
+//            serverExtendedStatus.onLoad(function() { log("loaded server status:"); log(that.attributes); })
+            ViewUtils.fetchModelRepeatedlyWithDelay(this, { doitnow: true, backoffMaxPeriod: 3000 });
+        },
+
+        isUp: function() { return this.get("up") },
+        isShuttingDown: function() { return this.get("shuttingDown") },
+        isHealthy: function() { return this.get("healthy") },
+        isMaster: function() {
+            ha = this.get("ha") || {};
+            ownId = ha.ownId;
+            if (!ownId) return null;
+            return ha.masterId == ownId;
+        },
+        getMasterUri: function() {
+            // Might be undefined if first fetch hasn't completed
+            ha = this.get("ha") || {};
+            nodes = ha.nodes || {};
+            master = nodes[ha.masterId];
+            if (!master || master.status != "MASTER") {
+                return null;
+            } else {
+                return master.nodeUri;
+            }
+        },
+        applyCallbacks: function() {
+            var currentCallbacks = this.callbacks;
+            this.callbacks = [];
+            _.invoke(currentCallbacks, "apply");
+        },
+    });
+
+    var serverExtendedStatus = new ServerExtendedStatus();
+    serverExtendedStatus.on("sync", function() {
+        serverExtendedStatus.loaded = true;
+        serverExtendedStatus.applyCallbacks();
+    });
+    serverExtendedStatus.on("error", serverExtendedStatus.onError);
+
+    // Will returning the instance rather than the object be confusing?
+    // It breaks the pattern used by all the other models.
+    return serverExtendedStatus;
+
+});
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/js/model/task-summary.js
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/js/model/task-summary.js b/src/main/webapp/assets/js/model/task-summary.js
new file mode 100644
index 0000000..6a54e4b
--- /dev/null
+++ b/src/main/webapp/assets/js/model/task-summary.js
@@ -0,0 +1,81 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+*/
+define([
+    "underscore", "backbone"
+], function (_, Backbone) {
+
+    var TaskSummary = {};
+
+    TaskSummary.Model = Backbone.Model.extend({
+        defaults:function () {
+            return {
+                id:"",
+                links:{},
+                displayName:"",
+                description:"",
+                entityId:"",
+                entityDisplayName:"",
+                tags:{},
+                submitTimeUtc:null,
+                startTimeUtc:null,
+                endTimeUtc:null,
+                currentStatus:"",
+                result:null,
+                isError:null,
+                isCancelled:null,
+                children:[],
+                detailedStatus:"",
+                blockingTask:null,
+                blockingDetails:null,
+                // missing some from TaskSummary (e.g. streams, isError), 
+                // but that's fine, worst case they come back null / undefined
+            };
+        },
+        getTagByName:function (name) {
+            if (name) return this.get("tags")[name];
+        },
+        isError: function() { return this.attributes.isError==true; },
+        isGlobalTopLevel: function() {
+            return this.attributes.submittedByTask == null;
+        },
+        isLocalTopLevel: function() {
+            var submitter = this.attributes.submittedByTask;
+            return (submitter==null ||
+                    (submitter.metadata && submitter.metadata.id != this.id)); 
+        },
+        
+        // added from https://github.com/jashkenas/backbone/issues/1069#issuecomment-17511573
+        // to clear attributes locally if they aren't in the server-side function
+        parse: function(resp) {
+            _.forEach(_.keys(this.attributes), function(key) {
+              if (resp[key] === undefined) {
+                resp[key] = null;
+              }
+            });
+
+            return resp;
+        }
+    });
+
+    TaskSummary.Collection = Backbone.Collection.extend({
+        model:TaskSummary.Model
+    });
+
+    return TaskSummary;
+});


[41/51] [abbrv] [partial] brooklyn-ui git commit: move subdir from incubator up a level as it is promoted to its own repo (first non-incubator commit!)

Posted by he...@apache.org.
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/js/libs/jquery.form.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/js/libs/jquery.form.js b/brooklyn-ui/src/main/webapp/assets/js/libs/jquery.form.js
deleted file mode 100644
index 796db12..0000000
--- a/brooklyn-ui/src/main/webapp/assets/js/libs/jquery.form.js
+++ /dev/null
@@ -1,1076 +0,0 @@
-/*!
- * jQuery Form Plugin
- * version: 3.09 (16-APR-2012)
- * @requires jQuery v1.3.2 or later
- *
- * Examples and documentation at: http://malsup.com/jquery/form/
- * Project repository: https://github.com/malsup/form
- * Dual licensed under the MIT and GPL licenses:
- *    http://malsup.github.com/mit-license.txt
- *    http://malsup.github.com/gpl-license-v2.txt
- */
-/*global ActiveXObject alert */
-;(function($) {
-"use strict";
-
-/*
-    Usage Note:
-    -----------
-    Do not use both ajaxSubmit and ajaxForm on the same form.  These
-    functions are mutually exclusive.  Use ajaxSubmit if you want
-    to bind your own submit handler to the form.  For example,
-
-    $(document).ready(function() {
-        $('#myForm').on('submit', function(e) {
-            e.preventDefault(); // <-- important
-            $(this).ajaxSubmit({
-                target: '#output'
-            });
-        });
-    });
-
-    Use ajaxForm when you want the plugin to manage all the event binding
-    for you.  For example,
-
-    $(document).ready(function() {
-        $('#myForm').ajaxForm({
-            target: '#output'
-        });
-    });
-    
-    You can also use ajaxForm with delegation (requires jQuery v1.7+), so the
-    form does not have to exist when you invoke ajaxForm:
-
-    $('#myForm').ajaxForm({
-        delegation: true,
-        target: '#output'
-    });
-    
-    When using ajaxForm, the ajaxSubmit function will be invoked for you
-    at the appropriate time.
-*/
-
-/**
- * Feature detection
- */
-var feature = {};
-feature.fileapi = $("<input type='file'/>").get(0).files !== undefined;
-feature.formdata = window.FormData !== undefined;
-
-/**
- * ajaxSubmit() provides a mechanism for immediately submitting
- * an HTML form using AJAX.
- */
-$.fn.ajaxSubmit = function(options) {
-    /*jshint scripturl:true */
-
-    // fast fail if nothing selected (http://dev.jquery.com/ticket/2752)
-    if (!this.length) {
-        log('ajaxSubmit: skipping submit process - no element selected');
-        return this;
-    }
-    
-    var method, action, url, $form = this;
-
-    if (typeof options == 'function') {
-        options = { success: options };
-    }
-
-    method = this.attr('method');
-    action = this.attr('action');
-    url = (typeof action === 'string') ? $.trim(action) : '';
-    url = url || window.location.href || '';
-    if (url) {
-        // clean url (don't include hash vaue)
-        url = (url.match(/^([^#]+)/)||[])[1];
-    }
-
-    options = $.extend(true, {
-        url:  url,
-        success: $.ajaxSettings.success,
-        type: method || 'GET',
-        iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank'
-    }, options);
-
-    // hook for manipulating the form data before it is extracted;
-    // convenient for use with rich editors like tinyMCE or FCKEditor
-    var veto = {};
-    this.trigger('form-pre-serialize', [this, options, veto]);
-    if (veto.veto) {
-        log('ajaxSubmit: submit vetoed via form-pre-serialize trigger');
-        return this;
-    }
-
-    // provide opportunity to alter form data before it is serialized
-    if (options.beforeSerialize && options.beforeSerialize(this, options) === false) {
-        log('ajaxSubmit: submit aborted via beforeSerialize callback');
-        return this;
-    }
-
-    var traditional = options.traditional;
-    if ( traditional === undefined ) {
-        traditional = $.ajaxSettings.traditional;
-    }
-    
-    var elements = [];
-    var qx, a = this.formToArray(options.semantic, elements);
-    if (options.data) {
-        options.extraData = options.data;
-        qx = $.param(options.data, traditional);
-    }
-
-    // give pre-submit callback an opportunity to abort the submit
-    if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) {
-        log('ajaxSubmit: submit aborted via beforeSubmit callback');
-        return this;
-    }
-
-    // fire vetoable 'validate' event
-    this.trigger('form-submit-validate', [a, this, options, veto]);
-    if (veto.veto) {
-        log('ajaxSubmit: submit vetoed via form-submit-validate trigger');
-        return this;
-    }
-
-    var q = $.param(a, traditional);
-    if (qx) {
-        q = ( q ? (q + '&' + qx) : qx );
-    }    
-    if (options.type.toUpperCase() == 'GET') {
-        options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q;
-        options.data = null;  // data is null for 'get'
-    }
-    else {
-        options.data = q; // data is the query string for 'post'
-    }
-
-    var callbacks = [];
-    if (options.resetForm) {
-        callbacks.push(function() { $form.resetForm(); });
-    }
-    if (options.clearForm) {
-        callbacks.push(function() { $form.clearForm(options.includeHidden); });
-    }
-
-    // perform a load on the target only if dataType is not provided
-    if (!options.dataType && options.target) {
-        var oldSuccess = options.success || function(){};
-        callbacks.push(function(data) {
-            var fn = options.replaceTarget ? 'replaceWith' : 'html';
-            $(options.target)[fn](data).each(oldSuccess, arguments);
-        });
-    }
-    else if (options.success) {
-        callbacks.push(options.success);
-    }
-
-    options.success = function(data, status, xhr) { // jQuery 1.4+ passes xhr as 3rd arg
-        var context = options.context || options;    // jQuery 1.4+ supports scope context 
-        for (var i=0, max=callbacks.length; i < max; i++) {
-            callbacks[i].apply(context, [data, status, xhr || $form, $form]);
-        }
-    };
-
-    // are there files to upload?
-    var fileInputs = $('input:file:enabled[value]', this); // [value] (issue #113)
-    var hasFileInputs = fileInputs.length > 0;
-    var mp = 'multipart/form-data';
-    var multipart = ($form.attr('enctype') == mp || $form.attr('encoding') == mp);
-
-    var fileAPI = feature.fileapi && feature.formdata;
-    log("fileAPI :" + fileAPI);
-    var shouldUseFrame = (hasFileInputs || multipart) && !fileAPI;
-
-    // options.iframe allows user to force iframe mode
-    // 06-NOV-09: now defaulting to iframe mode if file input is detected
-    if (options.iframe !== false && (options.iframe || shouldUseFrame)) {
-        // hack to fix Safari hang (thanks to Tim Molendijk for this)
-        // see:  http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d
-        if (options.closeKeepAlive) {
-            $.get(options.closeKeepAlive, function() {
-                fileUploadIframe(a);
-            });
-        }
-          else {
-            fileUploadIframe(a);
-          }
-    }
-    else if ((hasFileInputs || multipart) && fileAPI) {
-        fileUploadXhr(a);
-    }
-    else {
-        $.ajax(options);
-    }
-
-    // clear element array
-    for (var k=0; k < elements.length; k++)
-        elements[k] = null;
-
-    // fire 'notify' event
-    this.trigger('form-submit-notify', [this, options]);
-    return this;
-
-     // XMLHttpRequest Level 2 file uploads (big hat tip to francois2metz)
-    function fileUploadXhr(a) {
-        var formdata = new FormData();
-
-        for (var i=0; i < a.length; i++) {
-            formdata.append(a[i].name, a[i].value);
-        }
-
-        if (options.extraData) {
-            for (var p in options.extraData)
-                if (options.extraData.hasOwnProperty(p))
-                    formdata.append(p, options.extraData[p]);
-        }
-
-        options.data = null;
-
-        var s = $.extend(true, {}, $.ajaxSettings, options, {
-            contentType: false,
-            processData: false,
-            cache: false,
-            type: 'POST'
-        });
-        
-        if (options.uploadProgress) {
-            // workaround because jqXHR does not expose upload property
-            s.xhr = function() {
-                var xhr = jQuery.ajaxSettings.xhr();
-                if (xhr.upload) {
-                    xhr.upload.onprogress = function(event) {
-                        var percent = 0;
-                        var position = event.loaded || event.position; /*event.position is deprecated*/
-                        var total = event.total;
-                        if (event.lengthComputable) {
-                            percent = Math.ceil(position / total * 100);
-                        }
-                        options.uploadProgress(event, position, total, percent);
-                    };
-                }
-                return xhr;
-            };
-        }
-
-        s.data = null;
-          var beforeSend = s.beforeSend;
-          s.beforeSend = function(xhr, o) {
-              o.data = formdata;
-            if(beforeSend)
-                beforeSend.call(o, xhr, options);
-        };
-        $.ajax(s);
-    }
-
-    // private function for handling file uploads (hat tip to YAHOO!)
-    function fileUploadIframe(a) {
-        var form = $form[0], el, i, s, g, id, $io, io, xhr, sub, n, timedOut, timeoutHandle;
-        var useProp = !!$.fn.prop;
-
-        if ($(':input[name=submit],:input[id=submit]', form).length) {
-            // if there is an input with a name or id of 'submit' then we won't be
-            // able to invoke the submit fn on the form (at least not x-browser)
-            alert('Error: Form elements must not have name or id of "submit".');
-            return;
-        }
-        
-        if (a) {
-            // ensure that every serialized input is still enabled
-            for (i=0; i < elements.length; i++) {
-                el = $(elements[i]);
-                if ( useProp )
-                    el.prop('disabled', false);
-                else
-                    el.removeAttr('disabled');
-            }
-        }
-
-        s = $.extend(true, {}, $.ajaxSettings, options);
-        s.context = s.context || s;
-        id = 'jqFormIO' + (new Date().getTime());
-        if (s.iframeTarget) {
-            $io = $(s.iframeTarget);
-            n = $io.attr('name');
-            if (!n)
-                 $io.attr('name', id);
-            else
-                id = n;
-        }
-        else {
-            $io = $('<iframe name="' + id + '" src="'+ s.iframeSrc +'" />');
-            $io.css({ position: 'absolute', top: '-1000px', left: '-1000px' });
-        }
-        io = $io[0];
-
-
-        xhr = { // mock object
-            aborted: 0,
-            responseText: null,
-            responseXML: null,
-            status: 0,
-            statusText: 'n/a',
-            getAllResponseHeaders: function() {},
-            getResponseHeader: function() {},
-            setRequestHeader: function() {},
-            abort: function(status) {
-                var e = (status === 'timeout' ? 'timeout' : 'aborted');
-                log('aborting upload... ' + e);
-                this.aborted = 1;
-                $io.attr('src', s.iframeSrc); // abort op in progress
-                xhr.error = e;
-                if (s.error)
-                    s.error.call(s.context, xhr, e, status);
-                if (g)
-                    $.event.trigger("ajaxError", [xhr, s, e]);
-                if (s.complete)
-                    s.complete.call(s.context, xhr, e);
-            }
-        };
-
-        g = s.global;
-        // trigger ajax global events so that activity/block indicators work like normal
-        if (g && 0 === $.active++) {
-            $.event.trigger("ajaxStart");
-        }
-        if (g) {
-            $.event.trigger("ajaxSend", [xhr, s]);
-        }
-
-        if (s.beforeSend && s.beforeSend.call(s.context, xhr, s) === false) {
-            if (s.global) {
-                $.active--;
-            }
-            return;
-        }
-        if (xhr.aborted) {
-            return;
-        }
-
-        // add submitting element to data if we know it
-        sub = form.clk;
-        if (sub) {
-            n = sub.name;
-            if (n && !sub.disabled) {
-                s.extraData = s.extraData || {};
-                s.extraData[n] = sub.value;
-                if (sub.type == "image") {
-                    s.extraData[n+'.x'] = form.clk_x;
-                    s.extraData[n+'.y'] = form.clk_y;
-                }
-            }
-        }
-        
-        var CLIENT_TIMEOUT_ABORT = 1;
-        var SERVER_ABORT = 2;
-
-        function getDoc(frame) {
-            var doc = frame.contentWindow ? frame.contentWindow.document : frame.contentDocument ? frame.contentDocument : frame.document;
-            return doc;
-        }
-        
-        // Rails CSRF hack (thanks to Yvan Barthelemy)
-        var csrf_token = $('meta[name=csrf-token]').attr('content');
-        var csrf_param = $('meta[name=csrf-param]').attr('content');
-        if (csrf_param && csrf_token) {
-            s.extraData = s.extraData || {};
-            s.extraData[csrf_param] = csrf_token;
-        }
-
-        // take a breath so that pending repaints get some cpu time before the upload starts
-        function doSubmit() {
-            // make sure form attrs are set
-            var t = $form.attr('target'), a = $form.attr('action');
-
-            // update form attrs in IE friendly way
-            form.setAttribute('target',id);
-            if (!method) {
-                form.setAttribute('method', 'POST');
-            }
-            if (a != s.url) {
-                form.setAttribute('action', s.url);
-            }
-
-            // ie borks in some cases when setting encoding
-            if (! s.skipEncodingOverride && (!method || /post/i.test(method))) {
-                $form.attr({
-                    encoding: 'multipart/form-data',
-                    enctype:  'multipart/form-data'
-                });
-            }
-
-            // support timout
-            if (s.timeout) {
-                timeoutHandle = setTimeout(function() { timedOut = true; cb(CLIENT_TIMEOUT_ABORT); }, s.timeout);
-            }
-            
-            // look for server aborts
-            function checkState() {
-                try {
-                    var state = getDoc(io).readyState;
-                    log('state = ' + state);
-                    if (state && state.toLowerCase() == 'uninitialized')
-                        setTimeout(checkState,50);
-                }
-                catch(e) {
-                    log('Server abort: ' , e, ' (', e.name, ')');
-                    cb(SERVER_ABORT);
-                    if (timeoutHandle)
-                        clearTimeout(timeoutHandle);
-                    timeoutHandle = undefined;
-                }
-            }
-
-            // add "extra" data to form if provided in options
-            var extraInputs = [];
-            try {
-                if (s.extraData) {
-                    for (var n in s.extraData) {
-                        if (s.extraData.hasOwnProperty(n)) {
-                            extraInputs.push(
-                                $('<input type="hidden" name="'+n+'">').attr('value',s.extraData[n])
-                                    .appendTo(form)[0]);
-                        }
-                    }
-                }
-
-                if (!s.iframeTarget) {
-                    // add iframe to doc and submit the form
-                    $io.appendTo('body');
-                    if (io.attachEvent)
-                        io.attachEvent('onload', cb);
-                    else
-                        io.addEventListener('load', cb, false);
-                }
-                setTimeout(checkState,15);
-                form.submit();
-            }
-            finally {
-                // reset attrs and remove "extra" input elements
-                form.setAttribute('action',a);
-                if(t) {
-                    form.setAttribute('target', t);
-                } else {
-                    $form.removeAttr('target');
-                }
-                $(extraInputs).remove();
-            }
-        }
-
-        if (s.forceSync) {
-            doSubmit();
-        }
-        else {
-            setTimeout(doSubmit, 10); // this lets dom updates render
-        }
-
-        var data, doc, domCheckCount = 50, callbackProcessed;
-
-        function cb(e) {
-            if (xhr.aborted || callbackProcessed) {
-                return;
-            }
-            try {
-                doc = getDoc(io);
-            }
-            catch(ex) {
-                log('cannot access response document: ', ex);
-                e = SERVER_ABORT;
-            }
-            if (e === CLIENT_TIMEOUT_ABORT && xhr) {
-                xhr.abort('timeout');
-                return;
-            }
-            else if (e == SERVER_ABORT && xhr) {
-                xhr.abort('server abort');
-                return;
-            }
-
-            if (!doc || doc.location.href == s.iframeSrc) {
-                // response not received yet
-                if (!timedOut)
-                    return;
-            }
-            if (io.detachEvent)
-                io.detachEvent('onload', cb);
-            else    
-                io.removeEventListener('load', cb, false);
-
-            var status = 'success', errMsg;
-            try {
-                if (timedOut) {
-                    throw 'timeout';
-                }
-
-                var isXml = s.dataType == 'xml' || doc.XMLDocument || $.isXMLDoc(doc);
-                log('isXml='+isXml);
-                if (!isXml && window.opera && (doc.body === null || !doc.body.innerHTML)) {
-                    if (--domCheckCount) {
-                        // in some browsers (Opera) the iframe DOM is not always traversable when
-                        // the onload callback fires, so we loop a bit to accommodate
-                        log('requeing onLoad callback, DOM not available');
-                        setTimeout(cb, 250);
-                        return;
-                    }
-                    // let this fall through because server response could be an empty document
-                    //log('Could not access iframe DOM after mutiple tries.');
-                    //throw 'DOMException: not available';
-                }
-
-                //log('response detected');
-                var docRoot = doc.body ? doc.body : doc.documentElement;
-                xhr.responseText = docRoot ? docRoot.innerHTML : null;
-                xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc;
-                if (isXml)
-                    s.dataType = 'xml';
-                xhr.getResponseHeader = function(header){
-                    var headers = {'content-type': s.dataType};
-                    return headers[header];
-                };
-                // support for XHR 'status' & 'statusText' emulation :
-                if (docRoot) {
-                    xhr.status = Number( docRoot.getAttribute('status') ) || xhr.status;
-                    xhr.statusText = docRoot.getAttribute('statusText') || xhr.statusText;
-                }
-
-                var dt = (s.dataType || '').toLowerCase();
-                var scr = /(json|script|text)/.test(dt);
-                if (scr || s.textarea) {
-                    // see if user embedded response in textarea
-                    var ta = doc.getElementsByTagName('textarea')[0];
-                    if (ta) {
-                        xhr.responseText = ta.value;
-                        // support for XHR 'status' & 'statusText' emulation :
-                        xhr.status = Number( ta.getAttribute('status') ) || xhr.status;
-                        xhr.statusText = ta.getAttribute('statusText') || xhr.statusText;
-                    }
-                    else if (scr) {
-                        // account for browsers injecting pre around json response
-                        var pre = doc.getElementsByTagName('pre')[0];
-                        var b = doc.getElementsByTagName('body')[0];
-                        if (pre) {
-                            xhr.responseText = pre.textContent ? pre.textContent : pre.innerText;
-                        }
-                        else if (b) {
-                            xhr.responseText = b.textContent ? b.textContent : b.innerText;
-                        }
-                    }
-                }
-                else if (dt == 'xml' && !xhr.responseXML && xhr.responseText) {
-                    xhr.responseXML = toXml(xhr.responseText);
-                }
-
-                try {
-                    data = httpData(xhr, dt, s);
-                }
-                catch (e) {
-                    status = 'parsererror';
-                    xhr.error = errMsg = (e || status);
-                }
-            }
-            catch (e) {
-                log('error caught: ',e);
-                status = 'error';
-                xhr.error = errMsg = (e || status);
-            }
-
-            if (xhr.aborted) {
-                log('upload aborted');
-                status = null;
-            }
-
-            if (xhr.status) { // we've set xhr.status
-                status = (xhr.status >= 200 && xhr.status < 300 || xhr.status === 304) ? 'success' : 'error';
-            }
-
-            // ordering of these callbacks/triggers is odd, but that's how $.ajax does it
-            if (status === 'success') {
-                if (s.success)
-                    s.success.call(s.context, data, 'success', xhr);
-                if (g)
-                    $.event.trigger("ajaxSuccess", [xhr, s]);
-            }
-            else if (status) {
-                if (errMsg === undefined)
-                    errMsg = xhr.statusText;
-                if (s.error)
-                    s.error.call(s.context, xhr, status, errMsg);
-                if (g)
-                    $.event.trigger("ajaxError", [xhr, s, errMsg]);
-            }
-
-            if (g)
-                $.event.trigger("ajaxComplete", [xhr, s]);
-
-            if (g && ! --$.active) {
-                $.event.trigger("ajaxStop");
-            }
-
-            if (s.complete)
-                s.complete.call(s.context, xhr, status);
-
-            callbackProcessed = true;
-            if (s.timeout)
-                clearTimeout(timeoutHandle);
-
-            // clean up
-            setTimeout(function() {
-                if (!s.iframeTarget)
-                    $io.remove();
-                xhr.responseXML = null;
-            }, 100);
-        }
-
-        var toXml = $.parseXML || function(s, doc) { // use parseXML if available (jQuery 1.5+)
-            if (window.ActiveXObject) {
-                doc = new ActiveXObject('Microsoft.XMLDOM');
-                doc.async = 'false';
-                doc.loadXML(s);
-            }
-            else {
-                doc = (new DOMParser()).parseFromString(s, 'text/xml');
-            }
-            return (doc && doc.documentElement && doc.documentElement.nodeName != 'parsererror') ? doc : null;
-        };
-        var parseJSON = $.parseJSON || function(s) {
-            /*jslint evil:true */
-            return window['eval']('(' + s + ')');
-        };
-
-        var httpData = function( xhr, type, s ) { // mostly lifted from jq1.4.4
-
-            var ct = xhr.getResponseHeader('content-type') || '',
-                xml = type === 'xml' || !type && ct.indexOf('xml') >= 0,
-                data = xml ? xhr.responseXML : xhr.responseText;
-
-            if (xml && data.documentElement.nodeName === 'parsererror') {
-                if ($.error)
-                    $.error('parsererror');
-            }
-            if (s && s.dataFilter) {
-                data = s.dataFilter(data, type);
-            }
-            if (typeof data === 'string') {
-                if (type === 'json' || !type && ct.indexOf('json') >= 0) {
-                    data = parseJSON(data);
-                } else if (type === "script" || !type && ct.indexOf("javascript") >= 0) {
-                    $.globalEval(data);
-                }
-            }
-            return data;
-        };
-    }
-};
-
-/**
- * ajaxForm() provides a mechanism for fully automating form submission.
- *
- * The advantages of using this method instead of ajaxSubmit() are:
- *
- * 1: This method will include coordinates for <input type="image" /> elements (if the element
- *    is used to submit the form).
- * 2. This method will include the submit element's name/value data (for the element that was
- *    used to submit the form).
- * 3. This method binds the submit() method to the form for you.
- *
- * The options argument for ajaxForm works exactly as it does for ajaxSubmit.  ajaxForm merely
- * passes the options argument along after properly binding events for submit elements and
- * the form itself.
- */
-$.fn.ajaxForm = function(options) {
-    options = options || {};
-    options.delegation = options.delegation && $.isFunction($.fn.on);
-    
-    // in jQuery 1.3+ we can fix mistakes with the ready state
-    if (!options.delegation && this.length === 0) {
-        var o = { s: this.selector, c: this.context };
-        if (!$.isReady && o.s) {
-            log('DOM not ready, queuing ajaxForm');
-            $(function() {
-                $(o.s,o.c).ajaxForm(options);
-            });
-            return this;
-        }
-        // is your DOM ready?  http://docs.jquery.com/Tutorials:Introducing_$(document).ready()
-        log('terminating; zero elements found by selector' + ($.isReady ? '' : ' (DOM not ready)'));
-        return this;
-    }
-
-    if ( options.delegation ) {
-        $(document)
-            .off('submit.form-plugin', this.selector, doAjaxSubmit)
-            .off('click.form-plugin', this.selector, captureSubmittingElement)
-            .on('submit.form-plugin', this.selector, options, doAjaxSubmit)
-            .on('click.form-plugin', this.selector, options, captureSubmittingElement);
-        return this;
-    }
-
-    return this.ajaxFormUnbind()
-        .bind('submit.form-plugin', options, doAjaxSubmit)
-        .bind('click.form-plugin', options, captureSubmittingElement);
-};
-
-// private event handlers    
-function doAjaxSubmit(e) {
-    /*jshint validthis:true */
-    var options = e.data;
-    if (!e.isDefaultPrevented()) { // if event has been canceled, don't proceed
-        e.preventDefault();
-        $(this).ajaxSubmit(options);
-    }
-}
-    
-function captureSubmittingElement(e) {
-    /*jshint validthis:true */
-    var target = e.target;
-    var $el = $(target);
-    if (!($el.is(":submit,input:image"))) {
-        // is this a child element of the submit el?  (ex: a span within a button)
-        var t = $el.closest(':submit');
-        if (t.length === 0) {
-            return;
-        }
-        target = t[0];
-    }
-    var form = this;
-    form.clk = target;
-    if (target.type == 'image') {
-        if (e.offsetX !== undefined) {
-            form.clk_x = e.offsetX;
-            form.clk_y = e.offsetY;
-        } else if (typeof $.fn.offset == 'function') {
-            var offset = $el.offset();
-            form.clk_x = e.pageX - offset.left;
-            form.clk_y = e.pageY - offset.top;
-        } else {
-            form.clk_x = e.pageX - target.offsetLeft;
-            form.clk_y = e.pageY - target.offsetTop;
-        }
-    }
-    // clear form vars
-    setTimeout(function() { form.clk = form.clk_x = form.clk_y = null; }, 100);
-}
-
-
-// ajaxFormUnbind unbinds the event handlers that were bound by ajaxForm
-$.fn.ajaxFormUnbind = function() {
-    return this.unbind('submit.form-plugin click.form-plugin');
-};
-
-/**
- * formToArray() gathers form element data into an array of objects that can
- * be passed to any of the following ajax functions: $.get, $.post, or load.
- * Each object in the array has both a 'name' and 'value' property.  An example of
- * an array for a simple login form might be:
- *
- * [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ]
- *
- * It is this array that is passed to pre-submit callback functions provided to the
- * ajaxSubmit() and ajaxForm() methods.
- */
-$.fn.formToArray = function(semantic, elements) {
-    var a = [];
-    if (this.length === 0) {
-        return a;
-    }
-
-    var form = this[0];
-    var els = semantic ? form.getElementsByTagName('*') : form.elements;
-    if (!els) {
-        return a;
-    }
-
-    var i,j,n,v,el,max,jmax;
-    for(i=0, max=els.length; i < max; i++) {
-        el = els[i];
-        n = el.name;
-        if (!n) {
-            continue;
-        }
-
-        if (semantic && form.clk && el.type == "image") {
-            // handle image inputs on the fly when semantic == true
-            if(!el.disabled && form.clk == el) {
-                a.push({name: n, value: $(el).val(), type: el.type });
-                a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
-            }
-            continue;
-        }
-
-        v = $.fieldValue(el, true);
-        if (v && v.constructor == Array) {
-            if (elements) 
-                elements.push(el);
-            for(j=0, jmax=v.length; j < jmax; j++) {
-                a.push({name: n, value: v[j]});
-            }
-        }
-        else if (feature.fileapi && el.type == 'file' && !el.disabled) {
-            if (elements) 
-                elements.push(el);
-            var files = el.files;
-            if (files.length) {
-                for (j=0; j < files.length; j++) {
-                    a.push({name: n, value: files[j], type: el.type});
-                }
-            }
-            else {
-                // #180
-                a.push({ name: n, value: '', type: el.type });
-            }
-        }
-        else if (v !== null && typeof v != 'undefined') {
-            if (elements) 
-                elements.push(el);
-            a.push({name: n, value: v, type: el.type, required: el.required});
-        }
-    }
-
-    if (!semantic && form.clk) {
-        // input type=='image' are not found in elements array! handle it here
-        var $input = $(form.clk), input = $input[0];
-        n = input.name;
-        if (n && !input.disabled && input.type == 'image') {
-            a.push({name: n, value: $input.val()});
-            a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
-        }
-    }
-    return a;
-};
-
-/**
- * Serializes form data into a 'submittable' string. This method will return a string
- * in the format: name1=value1&amp;name2=value2
- */
-$.fn.formSerialize = function(semantic) {
-    //hand off to jQuery.param for proper encoding
-    return $.param(this.formToArray(semantic));
-};
-
-/**
- * Serializes all field elements in the jQuery object into a query string.
- * This method will return a string in the format: name1=value1&amp;name2=value2
- */
-$.fn.fieldSerialize = function(successful) {
-    var a = [];
-    this.each(function() {
-        var n = this.name;
-        if (!n) {
-            return;
-        }
-        var v = $.fieldValue(this, successful);
-        if (v && v.constructor == Array) {
-            for (var i=0,max=v.length; i < max; i++) {
-                a.push({name: n, value: v[i]});
-            }
-        }
-        else if (v !== null && typeof v != 'undefined') {
-            a.push({name: this.name, value: v});
-        }
-    });
-    //hand off to jQuery.param for proper encoding
-    return $.param(a);
-};
-
-/**
- * Returns the value(s) of the element in the matched set.  For example, consider the following form:
- *
- *  <form><fieldset>
- *      <input name="A" type="text" />
- *      <input name="A" type="text" />
- *      <input name="B" type="checkbox" value="B1" />
- *      <input name="B" type="checkbox" value="B2"/>
- *      <input name="C" type="radio" value="C1" />
- *      <input name="C" type="radio" value="C2" />
- *  </fieldset></form>
- *
- *  var v = $(':text').fieldValue();
- *  // if no values are entered into the text inputs
- *  v == ['','']
- *  // if values entered into the text inputs are 'foo' and 'bar'
- *  v == ['foo','bar']
- *
- *  var v = $(':checkbox').fieldValue();
- *  // if neither checkbox is checked
- *  v === undefined
- *  // if both checkboxes are checked
- *  v == ['B1', 'B2']
- *
- *  var v = $(':radio').fieldValue();
- *  // if neither radio is checked
- *  v === undefined
- *  // if first radio is checked
- *  v == ['C1']
- *
- * The successful argument controls whether or not the field element must be 'successful'
- * (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
- * The default value of the successful argument is true.  If this value is false the value(s)
- * for each element is returned.
- *
- * Note: This method *always* returns an array.  If no valid value can be determined the
- *    array will be empty, otherwise it will contain one or more values.
- */
-$.fn.fieldValue = function(successful) {
-    for (var val=[], i=0, max=this.length; i < max; i++) {
-        var el = this[i];
-        var v = $.fieldValue(el, successful);
-        if (v === null || typeof v == 'undefined' || (v.constructor == Array && !v.length)) {
-            continue;
-        }
-        if (v.constructor == Array)
-            $.merge(val, v);
-        else
-            val.push(v);
-    }
-    return val;
-};
-
-/**
- * Returns the value of the field element.
- */
-$.fieldValue = function(el, successful) {
-    var n = el.name, t = el.type, tag = el.tagName.toLowerCase();
-    if (successful === undefined) {
-        successful = true;
-    }
-
-    if (successful && (!n || el.disabled || t == 'reset' || t == 'button' ||
-        (t == 'checkbox' || t == 'radio') && !el.checked ||
-        (t == 'submit' || t == 'image') && el.form && el.form.clk != el ||
-        tag == 'select' && el.selectedIndex == -1)) {
-            return null;
-    }
-
-    if (tag == 'select') {
-        var index = el.selectedIndex;
-        if (index < 0) {
-            return null;
-        }
-        var a = [], ops = el.options;
-        var one = (t == 'select-one');
-        var max = (one ? index+1 : ops.length);
-        for(var i=(one ? index : 0); i < max; i++) {
-            var op = ops[i];
-            if (op.selected) {
-                var v = op.value;
-                if (!v) { // extra pain for IE...
-                    v = (op.attributes && op.attributes['value'] && !(op.attributes['value'].specified)) ? op.text : op.value;
-                }
-                if (one) {
-                    return v;
-                }
-                a.push(v);
-            }
-        }
-        return a;
-    }
-    return $(el).val();
-};
-
-/**
- * Clears the form data.  Takes the following actions on the form's input fields:
- *  - input text fields will have their 'value' property set to the empty string
- *  - select elements will have their 'selectedIndex' property set to -1
- *  - checkbox and radio inputs will have their 'checked' property set to false
- *  - inputs of type submit, button, reset, and hidden will *not* be effected
- *  - button elements will *not* be effected
- */
-$.fn.clearForm = function(includeHidden) {
-    return this.each(function() {
-        $('input,select,textarea', this).clearFields(includeHidden);
-    });
-};
-
-/**
- * Clears the selected form elements.
- */
-$.fn.clearFields = $.fn.clearInputs = function(includeHidden) {
-    var re = /^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i; // 'hidden' is not in this list
-    return this.each(function() {
-        var t = this.type, tag = this.tagName.toLowerCase();
-        if (re.test(t) || tag == 'textarea') {
-            this.value = '';
-        }
-        else if (t == 'checkbox' || t == 'radio') {
-            this.checked = false;
-        }
-        else if (tag == 'select') {
-            this.selectedIndex = -1;
-        }
-        else if (includeHidden) {
-            // includeHidden can be the valud true, or it can be a selector string
-            // indicating a special test; for example:
-            //  $('#myForm').clearForm('.special:hidden')
-            // the above would clean hidden inputs that have the class of 'special'
-            if ( (includeHidden === true && /hidden/.test(t)) ||
-                 (typeof includeHidden == 'string' && $(this).is(includeHidden)) )
-                this.value = '';
-        }
-    });
-};
-
-/**
- * Resets the form data.  Causes all form elements to be reset to their original value.
- */
-$.fn.resetForm = function() {
-    return this.each(function() {
-        // guard against an input with the name of 'reset'
-        // note that IE reports the reset function as an 'object'
-        if (typeof this.reset == 'function' || (typeof this.reset == 'object' && !this.reset.nodeType)) {
-            this.reset();
-        }
-    });
-};
-
-/**
- * Enables or disables any matching elements.
- */
-$.fn.enable = function(b) {
-    if (b === undefined) {
-        b = true;
-    }
-    return this.each(function() {
-        this.disabled = !b;
-    });
-};
-
-/**
- * Checks/unchecks any matching checkboxes or radio buttons and
- * selects/deselects and matching option elements.
- */
-$.fn.selected = function(select) {
-    if (select === undefined) {
-        select = true;
-    }
-    return this.each(function() {
-        var t = this.type;
-        if (t == 'checkbox' || t == 'radio') {
-            this.checked = select;
-        }
-        else if (this.tagName.toLowerCase() == 'option') {
-            var $sel = $(this).parent('select');
-            if (select && $sel[0] && $sel[0].type == 'select-one') {
-                // deselect all other options
-                $sel.find('option').selected(false);
-            }
-            this.selected = select;
-        }
-    });
-};
-
-// expose debug var
-$.fn.ajaxSubmit.debug = false;
-
-// helper fn for console logging
-function log() {
-    if (!$.fn.ajaxSubmit.debug) 
-        return;
-    var msg = '[jquery.form] ' + Array.prototype.join.call(arguments,'');
-    if (window.console && window.console.log) {
-        window.console.log(msg);
-    }
-    else if (window.opera && window.opera.postError) {
-        window.opera.postError(msg);
-    }
-}
-
-})(jQuery);


[20/51] [abbrv] [partial] brooklyn-ui git commit: move subdir from incubator up a level as it is promoted to its own repo (first non-incubator commit!)

Posted by he...@apache.org.
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/test/javascript/specs/view/application-tree-spec.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/test/javascript/specs/view/application-tree-spec.js b/brooklyn-ui/src/test/javascript/specs/view/application-tree-spec.js
deleted file mode 100644
index 410f6d4..0000000
--- a/brooklyn-ui/src/test/javascript/specs/view/application-tree-spec.js
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-define([
-    "underscore", "jquery", "model/app-tree", "view/application-tree",
-    "model/entity-summary", "model/application"
-], function (_, $, AppTree, ApplicationTreeView, EntitySummary, Application) {
-
-    // TODO json content must be updated to reflect new "batch" style result
-    // now used by the tree
-    
-//    var apps = new AppTree.Collection
-//    apps.url = 'fixtures/application-tree.json'
-//    apps.fetch({async:true})
-//
-//    describe('view/application-tree renders the list of applications as a tree', function () {
-//        var view, entityFetch, applicationFetch, defer;
-//
-//        beforeEach(function () {
-//            // ApplicationTree makes fetch requests to EntitySummary and Application models
-//            // with hard-coded URLs, causing long stacktraces in mvn output. This workaround
-//            // turns their fetch methods into empty functions.
-//            entityFetch = EntitySummary.Model.prototype.fetch;
-//            applicationFetch = Application.Model.prototype.fetch;
-//            defer = _.defer;
-//            _.defer = EntitySummary.Model.prototype.fetch = Application.Model.prototype.fetch = function() {};
-//
-//            // Append a #details div for not found test
-//            $("body").append('<div id="details"></div>');
-//
-//            view = new ApplicationTreeView({
-//                collection:apps
-//            }).render()
-//        })
-//
-//        // Restore EntitySummary and Application fetch.
-//        afterEach(function() {
-//            EntitySummary.Model.prototype.fetch = entityFetch;
-//            Application.Model.prototype.fetch = applicationFetch;
-//            _.defer = defer;
-//            $("#details").remove();
-//        });
-//
-//        it("builds the entity tree for each application", function () {
-//            expect(view.$("#riBZUjMq").length).toBe(1)
-//            expect(view.$("#fXyyQ7Ap").length).toBe(1)
-//            expect(view.$("#child-02").length).toBe(1)
-//            expect(view.$("#child-03").length).toBe(1)
-//            expect(view.$("#child-04").length).toBe(1)
-//            
-//            expect(view.$("#child-nonesuch").length).toBe(0)
-//        })
-//
-//        it("shows a 'not found' error for unknown entities", function() {
-//            view.displayEntityId("nonexistant");
-//            expect($("#details").text().toLowerCase()).toContain("failed to load entity nonexistant");
-//        });
-//    })
-    
-})
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/test/javascript/specs/view/effector-invoke-spec.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/test/javascript/specs/view/effector-invoke-spec.js b/brooklyn-ui/src/test/javascript/specs/view/effector-invoke-spec.js
deleted file mode 100644
index a2685bc..0000000
--- a/brooklyn-ui/src/test/javascript/specs/view/effector-invoke-spec.js
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-define([
-    "underscore", "view/effector-invoke", "model/effector-summary", "model/entity", "model/location"
-], function (_, EffectorInvokeView, EffectorSummary, Entity, Location) {
-
-    var collection = new EffectorSummary.Collection()
-    collection.url = "fixtures/effector-summary-list.json"
-    collection.fetch()
-    
-    var entityFixture = new Entity.Collection
-    entityFixture.url = 'fixtures/entity.json'
-    entityFixture.fetch()
-    
-    var locationsFixture = new Location.Collection
-    locationsFixture.url = 'fixtures/location-list.json'
-    locationsFixture.fetch()
-
-    const effector = collection.at(0);
-
-    var modalView = new EffectorInvokeView({
-        tagName:"div",
-        className:"modal",
-        model: effector,
-        entity:entityFixture.at(0),
-        locations: locationsFixture
-    })
-
-    describe("view/effector-invoke", function () {
-        // render and keep the reference to the view
-        modalView.render()
-
-        it("must render a bootstrap modal", function () {
-            expect(modalView.$(".modal-header").length).toBe(1)
-            expect(modalView.$(".modal-body").length).toBe(1)
-            expect(modalView.$(".modal-footer").length).toBe(1)
-        })
-
-        it("must have effector name, entity name, and effector description in header", function () {
-            expect(modalView.$(".modal-header h3").html()).toContain("start")
-            expect(modalView.$(".modal-header h3").html()).toContain("Vanilla")
-            expect(modalView.$(".modal-header p").html()).toBe("Start the process/service represented by an entity")
-        })
-
-        it("must have the list of parameters in body", function () {
-            expect(modalView.$(".modal-body table").length).toBe(1);
-            // +1 because one <tr> from table head
-            expect(modalView.$(".modal-body tr").length).toBe(effector.get("parameters").length + 1)
-        });
-
-        it("must properly extract parameters from table", function () {
-            // Select the third item in the option list rather than the "None" and
-            // horizontal bar placeholders.
-            window.m = modalView;
-            modalView.$(".select-location option:eq(2)").attr("selected", "selected");
-
-            var params = modalView.extractParamsFromTable();
-            console.log(params);
-            expect(params["locations"]).toBe("123")
-            expect(params).toEqual({
-                "locations": "123",
-                "booleanValue": "true"
-            });
-        });
-    })
-})
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/test/javascript/specs/view/entity-activities-spec.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/test/javascript/specs/view/entity-activities-spec.js b/brooklyn-ui/src/test/javascript/specs/view/entity-activities-spec.js
deleted file mode 100644
index 310eb11..0000000
--- a/brooklyn-ui/src/test/javascript/specs/view/entity-activities-spec.js
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-define([
-    "model/task-summary", "view/entity-activities"
-], function (TaskSummary, ActivityView) {
-
-    describe("view/entity-activity", function () {
-        var entity, view
-
-        beforeEach(function () {
-            entity = new Entity()
-            entity.url = "fixtures/entity-summary.json"
-            entity.fetch({async:false})
-            view = new ActivityView({ model:entity})
-        })
-    })
-
-})
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/test/javascript/specs/view/entity-details-spec.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/test/javascript/specs/view/entity-details-spec.js b/brooklyn-ui/src/test/javascript/specs/view/entity-details-spec.js
deleted file mode 100644
index 3ca76ef..0000000
--- a/brooklyn-ui/src/test/javascript/specs/view/entity-details-spec.js
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-define([
-    "underscore", "jquery", "backbone", "model/entity-summary", "view/entity-details", "view/entity-summary",
-    "view/entity-sensors", "model/application"
-], function (_, $, Backbone, EntitySummary, EntityDetailsView, EntitySummaryView, EntitySensorsView, Application) {
-
-    EntitySummary.Model.prototype.getSensorUpdateUrl = function () {
-        return "fixtures/sensor-current-state.json";
-    };
-
-    // TODO test complains about various things; $.get in entity-config gives weird errors;
-    // previously complains about 'url' needing to be set
-    // but i can't figure out where 'url' is missing
-    // (may get sorted out if state is stored centrally)
-//    describe('view/entity-details-spec EntityDetailsView', function () {
-//        var entity, view, app
-//
-//        beforeEach(function () {
-//            entity = new EntitySummary.Model
-//            entity.url = 'fixtures/entity-summary.json'
-//            entity.fetch({async:false})
-//            app = new Application.Model
-//            app.url = "fixtures/application.json"
-//            app.fetch({async:false})
-//            
-//            // entity-summary calls $.ajax on a sensor url that doesn't exist in tests.
-//            // make $.ajax a black hole for the creation of the view. Note it's important
-//            // that this is done _after_ the fetches above!
-////            jqueryGet = $.get;
-////            $.get = function() {
-////                return {
-////                    fail: function() {}
-////                };
-////            };
-//
-//            view = new EntityDetailsView({
-//                model:entity,
-//                application:app
-//            });
-//            view.render();
-//        });
-//
-//        //
-//        // Restore $.ajax
-////        afterEach(function() {
-////            $.get = jqueryGet;
-////        });
-//
-//        it('renders to a bootstrap tabbable', function () {
-//            expect(view.$('#summary').length).toBe(1)
-//            expect(view.$('#sensors').length).toBe(1)
-//            expect(view.$('#effectors').length).toBe(1)
-//        })
-//    })
-
-    describe('view/entity-details-spec/Summary', function () {
-        var view=null;
-
-        beforeEach(function () {
-            var entity, app;
-            entity = new EntitySummary.Model;
-            entity.url = 'fixtures/entity-summary.json';
-            entity.fetch({async:false});
-            app = new Application.Model;
-            app.url = "fixtures/application.json";
-            app.fetch({async:false});
-
-            view = new EntitySummaryView({
-                model:entity,
-                application:app
-            });
-            view.render();
-        });
-
-    });
-
-    // TODO complains about instanceof on a non-object in underscore; probably because we are now doing $.get 
-    // rather than collections.fetch 
-//    describe('view/entity-details-spec/Summary', function () {
-//        var sampleEntity, view
-//
-//        beforeEach(function () {
-//            sampleEntity = new EntitySummary.Model
-//            sampleEntity.url = 'fixtures/entity-summary.json'
-//            sampleEntity.fetch({async:false})
-//            view = new EntitySensorsView({ model:sampleEntity}).render()
-//            view.toggleFilterEmpty()
-//        })
-//
-//        it('must render as a table with sensor data', function () {
-//            expect(view.$('table#sensors-table').length).toBe(1)
-//            expect(view.$('th').length).toBe(3)
-//            var $body
-//            $body = view.$('tbody')
-//
-//            expect($body.find('tr:first .sensor-name').html()).toBe('jmx.context')
-//            expect($body.find('tr:first .sensor-name').attr('data-original-title')).toMatch("JMX context path")
-//            expect($body.find('tr:last .sensor-name').attr('data-original-title')).toMatch("Suggested shutdown port")
-//            expect($body.find("tr:last .sensor-name").attr("rel")).toBe("tooltip")
-//        })
-//    })
-    
-});
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/test/javascript/specs/view/entity-effector-view-spec.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/test/javascript/specs/view/entity-effector-view-spec.js b/brooklyn-ui/src/test/javascript/specs/view/entity-effector-view-spec.js
deleted file mode 100644
index eae2101..0000000
--- a/brooklyn-ui/src/test/javascript/specs/view/entity-effector-view-spec.js
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-define([
-    "underscore", "jquery", "backbone", "view/entity-effectors", "model/entity-summary"
-], function (_, $, Backbone, EntityEffectorsView, EntitySummary) {
-
-    var entitySummary = new EntitySummary.Model
-    entitySummary.url = "fixtures/entity-summary.json"
-
-    entitySummary.fetch({success:function () {
-
-        var $ROOT = $("<div/>"),
-            entityEffectorsView = new EntityEffectorsView({
-                el:$ROOT,
-                model:entitySummary
-            })
-
-        describe("view/entity-effectors", function () {
-
-            it("has table#effectors-table after initialization", function () {
-                expect($ROOT.find('table#effectors-table').length).toBe(1)
-            })
-
-            it("renders 3 effectors in the table", function () {
-                entityEffectorsView.render()
-                var $table = $ROOT.find("tbody")
-                expect($table.find("tr").length).toBe(3)
-                expect($table.find("tr:first .effector-name").html()).toBe("start")
-                expect($table.find("tr:last .effector-name").html()).toBe("stop")
-            })
-        })
-    }})
-})
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/test/javascript/specs/view/entity-sensors-spec.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/test/javascript/specs/view/entity-sensors-spec.js b/brooklyn-ui/src/test/javascript/specs/view/entity-sensors-spec.js
deleted file mode 100644
index d2bea28..0000000
--- a/brooklyn-ui/src/test/javascript/specs/view/entity-sensors-spec.js
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-define([
-    "underscore", "view/entity-sensors",
-    "text!tpl/apps/sensor-name.html"
-], function (_, EntitySensorsView, SensorNameHtml) {
-
-    function contains(string, value) {
-        return string.indexOf(value) != -1;
-    }
-
-    describe("template/sensor-name", function () {
-        var sensorNameHtml = _.template(SensorNameHtml);
-        var context = {name: "name", description: "description", type: "type"};
-
-        it("should not create an anchor tag in name", function() {
-            var templated = sensorNameHtml(_.extend(context, {href: "href"}));
-            expect(contains(templated, "<a href=\"href\"")).toBe(false);
-        });
-        
-        it("should not fail if context.href is undefined", function() {
-            var templated = sensorNameHtml(_.extend(context, {href: undefined}));
-            expect(contains(templated, "<a href=")).toBe(false);
-        });
-    })
-
-})
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/test/license/DISCLAIMER
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/test/license/DISCLAIMER b/brooklyn-ui/src/test/license/DISCLAIMER
deleted file mode 100644
index 9e6119b..0000000
--- a/brooklyn-ui/src/test/license/DISCLAIMER
+++ /dev/null
@@ -1,8 +0,0 @@
-
-Apache Brooklyn is an effort undergoing incubation at The Apache Software Foundation (ASF), 
-sponsored by the Apache Incubator. Incubation is required of all newly accepted projects until 
-a further review indicates that the infrastructure, communications, and decision making process 
-have stabilized in a manner consistent with other successful ASF projects. While incubation 
-status is not necessarily a reflection of the completeness or stability of the code, it does 
-indicate that the project has yet to be fully endorsed by the ASF.
-

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/test/license/LICENSE
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/test/license/LICENSE b/brooklyn-ui/src/test/license/LICENSE
deleted file mode 100644
index 67db858..0000000
--- a/brooklyn-ui/src/test/license/LICENSE
+++ /dev/null
@@ -1,175 +0,0 @@
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/test/license/NOTICE
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/test/license/NOTICE b/brooklyn-ui/src/test/license/NOTICE
deleted file mode 100644
index f790f13..0000000
--- a/brooklyn-ui/src/test/license/NOTICE
+++ /dev/null
@@ -1,5 +0,0 @@
-Apache Brooklyn
-Copyright 2014-2015 The Apache Software Foundation
-
-This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..3c5acf0
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,440 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache</groupId>
+        <artifactId>apache</artifactId>
+        <version>17</version>
+        <relativePath></relativePath> <!-- prevent loading of ../pom.xml as the "parent" -->
+    </parent>
+
+    <groupId>org.apache.brooklyn</groupId>
+    <artifactId>brooklyn-jsgui</artifactId>
+    <version>0.9.0-SNAPSHOT</version>  <!-- BROOKLYN_VERSION -->
+    <packaging>war</packaging>
+
+    <name>Brooklyn REST JavaScript Web GUI</name>
+
+    <description>
+        JavaScript+HTML GUI for interacting with Brooklyn, using the REST API
+    </description>
+
+    <properties>
+        <project.build.webapp>
+            ${project.build.directory}/${project.build.finalName}
+        </project.build.webapp>
+        <nodejs.path>${project.basedir}/target/nodejs/node</nodejs.path>
+        <jasmine-maven-plugin.version>1.3.1.5</jasmine-maven-plugin.version>
+        <maven-dependency-plugin.version>2.8</maven-dependency-plugin.version>
+        <nodejs-maven-plugin.version>1.0.3</nodejs-maven-plugin.version>
+        <maven-war-plugin.version>2.4</maven-war-plugin.version>
+        <nodejs-maven-binaries.version>0.10.25</nodejs-maven-binaries.version>
+        <requirejs-maven-plugin.version>2.0.0</requirejs-maven-plugin.version>
+        <maven-replacer-plugin.version>1.5.2</maven-replacer-plugin.version>
+        <maven-resources-plugin.version>2.7</maven-resources-plugin.version>
+    </properties>
+
+    <build>
+        <resources>
+            <resource>
+                <directory>${project.basedir}/src/test/resources/fixtures</directory>
+                <targetPath>${project.build.directory}/jasmine/fixtures</targetPath>
+            </resource>
+        </resources>
+        <!-- Insert special LICENSE/NOTICE into the <test-jar>/META-INF folder -->
+        <testResources>
+            <testResource>
+                <directory>${project.basedir}/src/test/resources</directory>
+            </testResource>
+            <testResource>
+                <targetPath>META-INF</targetPath>
+                <directory>${basedir}/src/test/license/files</directory>
+            </testResource>
+        </testResources>
+        <plugins>
+            <!--
+                 run js tests with: $ mvn clean process-test-resources jasmine:test
+                 run tests in the browser with: $ mvn jasmine:bdd
+            -->
+            <plugin>
+                <artifactId>maven-resources-plugin</artifactId>
+                <version>${maven-resources-plugin.version}</version>
+                <executions>
+                    <execution>
+                        <id>copy-fixtures</id>
+                        <phase>process-test-resources</phase>
+                        <goals>
+                            <goal>copy-resources</goal>
+                        </goals>
+                        <configuration>
+                            <outputDirectory>${project.build.directory}/jasmine/fixtures</outputDirectory>
+                            <resources>
+                                <resource>
+                                    <!-- copy rest-api fixtures from brooklyn-server submodule repo -->
+                                    <directory>${project.basedir}/../brooklyn-server/rest/rest-api/src/test/resources/fixtures</directory>
+                                </resource>
+                            </resources>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>com.github.searls</groupId>
+                <artifactId>jasmine-maven-plugin</artifactId>
+                <version>${jasmine-maven-plugin.version}</version>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>test</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <!--Uses the require.js test spec-->
+                    <specRunnerTemplate>REQUIRE_JS</specRunnerTemplate>
+                    <preloadSources>
+                        <source>js/libs/require.js</source>
+                    </preloadSources>
+
+                    <!--Sources-->
+                    <jsSrcDir>${project.basedir}/src/main/webapp/assets</jsSrcDir>
+                    <jsTestSrcDir>${project.basedir}/src/test/javascript/specs</jsTestSrcDir>
+                    <customRunnerConfiguration>
+                        ${project.basedir}/src/test/javascript/config.txt
+                    </customRunnerConfiguration>
+                    <!-- Makes output terser -->
+                    <format>progress</format>
+                    <additionalContexts>
+                        <!-- If context roots start with a / the resource will be available on the server at //root. -->
+                        <!-- It is an error for context roots to end with a /. -->
+                        <context>
+                            <contextRoot>fixtures</contextRoot>
+                            <directory>${project.build.directory}/jasmine/fixtures</directory>
+                        </context>
+                    </additionalContexts>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-war-plugin</artifactId>
+                <version>${maven-war-plugin.version}</version>
+                <configuration>
+                    <useCache>true</useCache> <!-- to prevent replaced files being overwritten -->
+                    <!-- Insert special LICENSE/NOTICE into the <war>/META-INF folder -->
+                    <webResources>
+                        <webResource>
+                            <targetPath>META-INF</targetPath>
+                            <directory>${basedir}/src/main/license/files</directory>
+                        </webResource>
+                    </webResources>
+                    <archive>
+                        <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
+                    </archive>
+                </configuration>
+            </plugin>
+            <!-- Disable the automatic LICENSE/NOTICE placement from the upstream pom, because we need to include
+                 bundled dependencies. See "webResources" section above for where we include the new LICENSE/NOTICE -->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-remote-resources-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>process</goal>
+                        </goals>
+                        <configuration>
+                            <skip>true</skip>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <version>2.5.4</version>
+                <executions>
+                    <execution>
+                        <id>bundle-manifest</id>
+                        <phase>process-classes</phase>
+                        <goals>
+                            <goal>manifest</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <supportedProjectTypes>
+                        <supportedProjectType>war</supportedProjectType>
+                    </supportedProjectTypes>
+                    <instructions>
+                        <Web-ContextPath>/</Web-ContextPath>
+                    </instructions>
+                </configuration>
+            </plugin>
+        </plugins>
+
+        <pluginManagement>
+            <plugins>
+                <plugin>
+                    <groupId>org.apache.rat</groupId>
+                    <artifactId>apache-rat-plugin</artifactId>
+                    <configuration>
+                        <excludes combine.children="append">
+                            <!--
+                                JavaScript code that is not copyright of Apache Foundation. It is included in NOTICE.
+                            -->
+                            <exclude>**/src/main/webapp/assets/js/libs/*</exclude>
+                            <exclude>**/src/build/requirejs-maven-plugin/r.js</exclude>
+
+                            <!--
+                                Copy of swagger-ui from https://github.com/swagger-api/swagger-ui tag::v2.1.3
+                            -->
+                            <exclude>**/src/main/webapp/assets/swagger-ui/**</exclude>
+
+                            <!--
+                                Trivial Json controlling the build,  "without any degree of creativity".
+                                Json does not support comments, therefore far easier to just omit the license header!
+                            -->
+                            <exclude>**//src/build/optimize-css.json</exclude>
+                            <exclude>**//src/build/optimize-js.json</exclude>
+                        </excludes>
+                    </configuration>
+                </plugin>
+                <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
+                <plugin>
+                	<groupId>org.eclipse.m2e</groupId>
+                	<artifactId>lifecycle-mapping</artifactId>
+                	<version>1.0.0</version>
+                	<configuration>
+                		<lifecycleMappingMetadata>
+                			<pluginExecutions>
+                				<pluginExecution>
+                					<pluginExecutionFilter>
+                						<groupId>
+                							com.github.skwakman.nodejs-maven-plugin
+                						</groupId>
+                						<artifactId>
+                							nodejs-maven-plugin
+                						</artifactId>
+                						<versionRange>
+                							[1.0.3,)
+                						</versionRange>
+                						<goals>
+                							<goal>extract</goal>
+                						</goals>
+                					</pluginExecutionFilter>
+                					<action>
+                						<ignore></ignore>
+                					</action>
+                				</pluginExecution>
+                			</pluginExecutions>
+                		</lifecycleMappingMetadata>
+                	</configuration>
+                </plugin>
+            </plugins>
+        </pluginManagement>
+    </build>
+
+    <profiles>
+        <profile>
+            <id>nodejs-path-override</id>
+            <activation>
+                <os><family>linux</family></os>
+            </activation>
+            <properties>
+                <nodejs.path>${project.basedir}/src/build/nodejs</nodejs.path>
+            </properties>
+            <dependencies>
+                <dependency>
+                    <groupId>com.github.skwakman.nodejs-maven-binaries</groupId>
+                    <artifactId>nodejs-maven-binaries</artifactId>
+                    <version>${nodejs-maven-binaries.version}</version>
+                    <classifier>linux-x64</classifier>
+                    <type>zip</type>
+                </dependency>
+            </dependencies>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-dependency-plugin</artifactId>
+                        <version>${maven-dependency-plugin.version}</version>
+                        <executions>
+                          <execution>
+                            <id>unpack-nodejs64</id>
+                            <phase>prepare-package</phase>
+                            <goals>
+                              <goal>unpack-dependencies</goal>
+                            </goals>
+                            <configuration>
+                              <includeGroupIds>com.github.skwakman.nodejs-maven-binaries</includeGroupIds>
+                              <includeArtifactIds>nodejs-maven-binaries</includeArtifactIds>
+                              <outputDirectory>
+                                 ${project.basedir}/target/nodejs64/
+                              </outputDirectory>
+                            </configuration>
+                          </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+
+        <profile>
+            <id>Optimize resources</id>
+            <activation>
+                <property>
+                    <name>!skipOptimization</name>
+                </property>
+            </activation>
+            <build>
+                <plugins>
+                    <!-- Installs node.js in target/. Means we get the benefits of node's speed
+                         (compared to Rhino) without having to install it manually. -->
+                    <plugin>
+                        <groupId>com.github.skwakman.nodejs-maven-plugin</groupId>
+                        <artifactId>nodejs-maven-plugin</artifactId>
+                        <version>${nodejs-maven-plugin.version}</version>
+                        <executions>
+                            <execution>
+                                <goals>
+                                    <goal>extract</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                        <configuration>
+                            <!-- target directory for node binaries -->
+                            <targetDirectory>${project.basedir}/target/nodejs/</targetDirectory>
+                        </configuration>
+                    </plugin>
+
+                    <!-- Including the exploded goal means sources are in place ready for the replacer plugin. -->
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-war-plugin</artifactId>
+                        <version>${maven-war-plugin.version}</version>
+                        <executions>
+                            <execution>
+                                <id>prepare-war</id>
+                                <phase>prepare-package</phase>
+                                <goals>
+                                    <goal>exploded</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+
+                    <!-- Runs the require.js optimizer with node to produce a single artifact. -->
+                    <plugin>
+                        <groupId>com.github.mcheely</groupId>
+                        <artifactId>requirejs-maven-plugin</artifactId>
+                        <version>${requirejs-maven-plugin.version}</version>
+                        <executions>
+                            <execution>
+                                <id>optimize-js</id>
+                                <phase>prepare-package</phase>
+                                <goals>
+                                    <goal>optimize</goal>
+                                </goals>
+                                <configuration>
+                                    <configFile>${project.basedir}/src/build/optimize-js.json</configFile>
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>optimize-css</id>
+                                <phase>prepare-package</phase>
+                                <goals>
+                                    <goal>optimize</goal>
+                                </goals>
+                                <configuration>
+                                    <configFile>${project.basedir}/src/build/optimize-css.json</configFile>
+                                </configuration>
+                            </execution>
+                        </executions>
+                        <configuration>
+                            <nodeExecutable>${nodejs.path}</nodeExecutable>
+                            <optimizerFile>${project.basedir}/src/build/requirejs-maven-plugin/r.js</optimizerFile>
+                            <!-- Replaces Maven tokens in the build file with their values -->
+                            <filterConfig>true</filterConfig>
+                        </configuration>
+                    </plugin>
+
+                    <!-- Modify index.html to point to the optimized resources generated above. -->
+                    <plugin>
+                        <groupId>com.google.code.maven-replacer-plugin</groupId>
+                        <artifactId>replacer</artifactId>
+                        <version>${maven-replacer-plugin.version}</version>
+                        <executions>
+                            <execution>
+                                <id>modify-for-optimized</id>
+                                <phase>prepare-package</phase>
+                                <goals>
+                                    <goal>replace</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                        <configuration>
+                            <file>${project.build.webapp}/index.html</file>
+                            <replacements>
+                                <replacement>
+                                    <token>assets/js/config.js</token>
+                                    <value>assets/js/gui.all.min.js</value>
+                                </replacement>
+                                <replacement>
+                                    <token>assets/css/styles.css</token>
+                                    <value>assets/css/styles.min.css</value>
+                                </replacement>
+                                <replacement>
+                                    <token>GIT_SHA_1</token>
+                                    <value>${buildNumber}</value>
+                                </replacement>
+                            </replacements>
+                        </configuration>
+                    </plugin>
+
+                    <!-- Compress the minified files. Jetty will serve the gzipped content instead. -->
+                    <plugin>
+                        <artifactId>maven-antrun-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <id>Compress resources</id>
+                                <phase>prepare-package</phase>
+                                <goals>
+                                    <goal>run</goal>
+                                </goals>
+                                <configuration>
+                                    <target>
+                                        <gzip src="${project.build.webapp}/assets/css/styles.min.css" destfile="${project.build.webapp}/assets/css/styles.min.css.gz" />
+                                        <gzip src="${project.build.webapp}/assets/css/brooklyn.css" destfile="${project.build.webapp}/assets/css/brooklyn.css.gz" />
+                                        <gzip src="${project.build.webapp}/assets/js/gui.all.min.js" destfile="${project.build.webapp}/assets/js/gui.all.min.js.gz" />
+                                        <gzip src="${project.build.webapp}/assets/js/libs/require.js" destfile="${project.build.webapp}/assets/js/libs/require.js.gz" />
+                                    </target>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+
+</project>
+

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/build/.gitattributes
----------------------------------------------------------------------
diff --git a/src/build/.gitattributes b/src/build/.gitattributes
new file mode 100644
index 0000000..83a693d
--- /dev/null
+++ b/src/build/.gitattributes
@@ -0,0 +1,2 @@
+#Don't auto-convert line endings for shell scripts on Windows (breaks the scripts)
+nodejs text eol=lf

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/build/nodejs
----------------------------------------------------------------------
diff --git a/src/build/nodejs b/src/build/nodejs
new file mode 100755
index 0000000..2b00792
--- /dev/null
+++ b/src/build/nodejs
@@ -0,0 +1,41 @@
+#!/bin/sh
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#  http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# nodejs-maven-plugin incorrectly detects the architecture on 
+# Linux x64 running 32 bit Java leading to the installation of
+# invalid nodejs binary - 32 bit on 64 bit OS. This is a
+# wrapper which makes a check for the architecture again and
+# forces the usage of the 64 bit binary. The 64 bit nodejs
+# is installed in advance in case we need it.
+#
+# target/nodejs64/node - the forcibly installed 64 bit binary
+# target/nodejs/node - the binary installed by nodejs-maven-plugin
+#                      could be 32 bit or 64 bit.
+#
+
+MACHINE_TYPE=`uname -m`
+if [ $MACHINE_TYPE = 'x86_64' ]; then
+  NODE_PATH=$( dirname "$0" )/../../target/nodejs64/node
+  chmod +x $NODE_PATH
+  echo Forcing 64 bit nodejs at $NODE_PATH
+else
+  NODE_PATH=$( dirname "$0" )/../../target/nodejs/node
+fi
+
+$NODE_PATH "$@"

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/build/optimize-css.json
----------------------------------------------------------------------
diff --git a/src/build/optimize-css.json b/src/build/optimize-css.json
new file mode 100644
index 0000000..d27d7ac
--- /dev/null
+++ b/src/build/optimize-css.json
@@ -0,0 +1,12 @@
+({
+    cssIn: "${project.build.webapp}/assets/css/styles.css",
+    out: "${project.build.webapp}/assets/css/styles.min.css",
+
+    // CSS optimization options are:
+    //  - "standard": @import inlining, comment removal and line returns.
+    //  - "standard.keepLines": like "standard" but keeps line returns.
+    //  - "standard.keepComments": keeps the file comments, but removes line returns.
+    //  - "standard.keepComments.keepLines": keeps the file comments and line returns.
+    //  - "none": skip CSS optimizations.
+    optimizeCss: "standard"
+})

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/build/optimize-js.json
----------------------------------------------------------------------
diff --git a/src/build/optimize-js.json b/src/build/optimize-js.json
new file mode 100644
index 0000000..60855d9
--- /dev/null
+++ b/src/build/optimize-js.json
@@ -0,0 +1,18 @@
+({
+    // The entry point to the application. Brooklyn's is in config.js.
+    name: "config",
+    baseUrl: "${project.build.webapp}/assets/js",
+    mainConfigFile: "${project.build.webapp}/assets/js/config.js",
+    paths: {
+        // Include paths to external resources (e.g. on a CDN) here.
+
+        // Optimiser looks for js/requireLib.js by default.
+        "requireLib": "libs/require"
+    },
+
+    // Place the optimised file in target/<war>/assets.
+    out: "${project.build.webapp}/assets/js/gui.all.min.js",
+
+    // Set to "none" to skip minification
+    optimize: "uglify"
+})


[31/51] [abbrv] [partial] brooklyn-ui git commit: move subdir from incubator up a level as it is promoted to its own repo (first non-incubator commit!)

Posted by he...@apache.org.
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/js/view/viewutils.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/js/view/viewutils.js b/brooklyn-ui/src/main/webapp/assets/js/view/viewutils.js
deleted file mode 100644
index 95fcd5d..0000000
--- a/brooklyn-ui/src/main/webapp/assets/js/view/viewutils.js
+++ /dev/null
@@ -1,560 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-define([
-        "underscore", "jquery", "brooklyn"
-], function (_, $, BrooklynConfig) {
-
-    var ViewUtils = {
-        myDataTable:function($table, extra) {
-            $.fn.dataTableExt.sErrMode = 'throw';
-            var settings = {
-                "bDestroy": true,
-                "iDisplayLength": 25,
-                "bDeferRender": true,
-                "sPaginationType": "full_numbers",
-                "sDom": "fp<'brook-db-top-toolbar'>tilp<'brook-db-bot-toolbar'>",
-                "oLanguage": {
-                    "sSearch": "",
-                    "sInfo": "Showing _START_ - _END_ of _TOTAL_ ",
-                    "sInfoEmpty": "<i>No data</i> ",
-                    "sEmptyTable": "<i>No matching records available</i>",
-                    "sZeroRecords": "<i>No matching records found</i>",
-                    "oPaginate": {
-                        "sFirst": "&lt;&lt;",
-                        "sPrevious": "&lt;",
-                        "sNext": "&gt;",
-                        "sLast": "&gt;&gt;"
-                    },
-                    "sInfoFiltered": "(of _MAX_)",
-                    "sLengthMenu": '( <select>' +
-                                        '<option value="10">10</option>' +
-                                        '<option value="25">25</option>' +
-                                        '<option value="50">50</option>' +
-                                        '<option value="-1">all</option>' +
-                                    '</select> / page )'
-                }
-            };
-            _.extend(settings, extra);
-            
-            ViewUtils.fadeToIndicateInitialLoad($table);
- 
-            return $table.dataTable(settings);
-        },
-        myDataTableToolbarAddHtml: function($table,html) {
-            $('.brook-db-bot-toolbar', $table.parent().parent()).append(html)
-            $('.brook-db-top-toolbar', $table.parent().parent()).append(html)
-        },
-        addRefreshButton: function($table) {
-            this.myDataTableToolbarAddHtml($table,
-                '<i class="refresh table-toolbar-icon bootstrap-glyph icon-refresh handy smallpadside" rel="tooltip" title="Reload content immediately"></i>');
-        },
-        addFilterEmptyButton: function($table) {
-            this.myDataTableToolbarAddHtml($table,
-                '<i class="filterEmpty table-toolbar-icon bootstrap-glyph icon-eye-open handy bottom smallpadside" rel="tooltip" title="Show/hide empty records"></i>');
-        },
-        addAutoRefreshButton: function($table) {
-            this.myDataTableToolbarAddHtml($table,
-                '<i class="toggleAutoRefresh table-toolbar-icon bootstrap-glyph icon-pause handy smallpadside" rel="tooltip" title="Toggle auto-refresh"></i>');
-        },
-        /* fnConvertData takes the entries in collection (value, optionalKeyOrIndex) and returns a list
-         * whose first element is the ID (hidden first column of table)
-         * and other elements are the other columns in the table;
-         * alternatively it can return null if the entry should be excluded
-         * 
-         * option refreshAllRows can be passed to force all rows to be re-rendered;
-         * useful if rendering data may have changed even if value has not
-         */ 
-        updateMyDataTable: function(table, collection, fnConvertData, options) {
-            if (table==null) return;
-            if (options==null) options = {}
-            var oldDisplayDataList = []
-            try {
-                oldDisplayDataList = table.dataTable().fnGetData();
-            } catch (e) {
-                // (used to) sometimes get error accessing column 1 of row 0, though table seems empty
-                // caused by previous attempt to refresh from a closed view
-                log("WARNING: could not fetch data; clearing")
-                log(e)
-                log(e.stack)
-                table.dataTable().fnClearTable()
-            }
-            var oldDisplayIndexMap = {}
-            var oldDisplayData = {}
-            for (var idx in oldDisplayDataList) {
-                var data = oldDisplayDataList[idx]
-                oldDisplayIndexMap[data[0]] = idx
-                oldDisplayData[data[0]] = data
-            }
-            var newDisplayData = {}
-            var updateDisplayData = []
-            ViewUtils.each(collection, function(data,index) { 
-                var newRow = fnConvertData(data, index)
-                if (newRow!=null) {
-                    var id = newRow[0]
-
-                    var displayIndex = oldDisplayIndexMap[id];
-                    if (displayIndex!=null) {
-                        updateDisplayData[displayIndex] = newRow
-                        delete oldDisplayIndexMap[id]
-                    } else {
-                        newDisplayData[id] = newRow
-                    }
-                }
-            })
-            // first update (so indices don't change)
-            for (var prop in updateDisplayData) {
-                var rowProps = updateDisplayData[prop]
-                var oldProps = oldDisplayData[rowProps[0]]
-                for (idx in rowProps) {
-                    var v = rowProps[idx]
-                    if (options['refreshAllRows'] || !_.isEqual(v,oldProps[idx])) {
-                        // update individual columns as values change
-                        try {
-                            table.fnUpdate( v, Number(prop), idx, false, false )
-                        } catch (e) {
-                            // often occurs if we haven't properly closed view, e.g. on entity switch
-                            log("WARNING: cannot update row")
-                            log(e)
-                            log(e.stack)
-                            log(v)
-                            log(prop)
-                            log(idx)
-                        }
-                    } else {
-//                        log("NO CHANGE")
-                    }
-                }
-            }
-            // then delete old ones
-            for (var prop in oldDisplayIndexMap) {
-                var index = oldDisplayIndexMap[prop]
-                table.fnDeleteRow( Number(index), null, false )
-            }
-            // and now add new ones
-            for (var prop in newDisplayData) {
-                try {
-                    table.fnAddData( newDisplayData[prop], false )
-                } catch (e) {
-                    // errors sometimes if we load async
-                    log("WARNING: cannot add to row")
-                    log(e)
-                    log(e.stack)
-                    log(prop)
-                    log(newDisplayData[prop])
-                }
-            }
-            try {
-                // redraw, but keeping pagination
-                table.fnStandingRedraw();
-            } catch (e) {
-                log("WARNING: could not redraw")
-                log(e)
-                log(e.stack)                
-            }
-            ViewUtils.cancelFadeOnceLoaded(table)
-        },
-        toggleFilterEmpty: function($table, column) {
-            var hideEmpties = $('.filterEmpty', $table.parent().parent()).toggleClass('icon-eye-open icon-eye-close').hasClass('icon-eye-close');
-            if (hideEmpties) {
-                $table.dataTable().fnFilter('.+', column, true);
-            } else {
-                $table.dataTable().fnFilter('.*', column, true);
-            }
-        },
-        toggleAutoRefresh: function(pane) {
-            var isEnabled = $('.toggleAutoRefresh', pane.$el).toggleClass('icon-pause icon-play').hasClass('icon-pause');
-            pane.enableAutoRefresh(isEnabled);
-        },
-        attachToggler: function($scope) {
-            var $togglers;
-            if ($scope === undefined) {
-                $togglers = $(".toggler-header");
-            } else {
-                $togglers = $(".toggler-header", $scope);
-            }
-            $togglers.click(this.onTogglerClick);
-        },
-        onTogglerClick: function(event) {
-            ViewUtils.onTogglerClickElement($(event.currentTarget).closest(".toggler-header"));
-        },
-        onTogglerClickElement: function(root) {
-            root.toggleClass("user-hidden");
-            $(".toggler-icon", root).toggleClass("icon-chevron-left").toggleClass("icon-chevron-down");
-            var next = root.next();
-            if (root.hasClass("user-hidden")) {
-                next.slideUp('fast');
-            } else {
-                next.slideDown('fast');
-            }
-        },
-        showTogglerClickElement: function(root) {
-            root.removeClass("user-hidden");
-            $(".toggler-icon", root).removeClass("icon-chevron-left").addClass("icon-chevron-down");
-            root.next().slideDown('fast');
-        },
-        updateTextareaWithData: function($div, data, showIfEmpty, doSlideDown, minPx, maxPx) {
-            var $ta = $("textarea", $div);
-            var show = showIfEmpty;
-            if (data !== undefined) {
-                $ta.val(data);
-                show = true;
-            } else {
-                $ta.val("");
-            }
-            if (show) {
-                this.setHeightAutomatically($ta, minPx, maxPx, false);
-                if (doSlideDown) { $div.slideDown(100); }
-            } else {
-                $div.hide();
-            }
-        },
-        setHeightAutomatically: function($ta, minPx, maxPx, deferred) {
-            var height = $ta.prop("scrollHeight"), that = this;
-            if ($ta.css("padding-top")) height -= parseInt($ta.css("padding-top"), 10)
-            if ($ta.css("padding-bottom")) height -= parseInt($ta.css("padding-bottom"), 10)
-//            log("scroll height "+height+" - old real height "+$ta.css("height"))
-            if (height==0 && !deferred) {
-                _.defer(function() { that.setHeightAutomatically($ta, minPx, maxPx, true) })
-            } else {
-                height = Math.min(height, maxPx);
-                height = Math.max(height, minPx);
-                $ta.css("height", height);
-            }
-            return height;
-        },
-        each: function(collection, fn) {
-            if (_.isFunction(collection.each)) {
-                // some objects (such as backbone collections) are not iterable
-                // (either by "for x in" or "_.each") so call the "each" method explicitly on them 
-                return collection.each(fn)
-            } else {
-                // try underscore
-                return _.each(collection, fn);
-            }
-        },
-        // makes tooltips appear as white-on-black-bubbles rather than boring black-on-yellow-boxes
-        // but NB if the html is updated the tooltip can remain visible until page refresh
-        processTooltips: function($el) {
-            $el.find('*[rel="tooltip"]').tooltip();
-        },
-        fadeToIndicateInitialLoad: function($el) {
-            // in case the server response time is low, fade out while it refreshes
-            // (since we can't show updated details until we've retrieved app + entity details)
-            try {                
-                $el.fadeTo(1000, 0.3)
-//                    .queue(
-//                        function() {
-//                            // does nothing yet -- see comment in brooklyn.css on .view_not_available
-//                            $el.append('<div class="view_not_available"></div>')
-//                        });
-                // above works to insert the div, though we don't have styling on it
-                // but curiously it also causes the parent to go to opacity 0 !?! 
-            } catch (e) {
-                // ignore - normal during tests
-            }
-        },
-        cancelFadeOnceLoaded: function($el) {
-            try {
-//                $el.children('.view_not_available').remove();
-                $el.stop(true, false).fadeTo(200, 1);
-            } catch (e) {
-                // ignore - normal during tests
-            }
-        },
-        
-        
-        
-        // TODO the get and fetch methods below should possibly be on a BrooklynView prototype
-        // see also notes in router.js
-        // (perhaps as part of that introduce a callWithFixedDelay method which does the tracking, 
-        // so we can cleanly unregister, and perhaps an onServerFailure method, and with that we 
-        // could perhaps get rid of, or at least dramatically simplify, the get/fetch)
-        
-        /* variant of $.get with automatic failure handling and recovery;
-         * options should be omitted except by getRepeatedlyWithDelay */
-        get: function(view, url, success, options) {
-            if (view.viewIsClosed) return ;
-            
-            if (!options) options = {}
-            if (!options.count) options.count = 1
-            else options.count++;
-//          log("getting, count "+options.count+", delay "+period+": "+url)
-            
-            var disabled = (options['enablement'] && !options['enablement']()) 
-                || !BrooklynConfig.view.refresh
-            if (options.count > 1 && disabled) {
-                // not enabled, just requeue
-                if (options['period']) 
-                    setTimeout(function() { ViewUtils.get(view, url, success, options)}, options['period'])
-                return;
-            }
-            
-            /* inspects the status object returned from an ajax call in a view;
-             * if not valid, it fades the view and increases backoff delays and resubmits;
-             * if it is valid, it returns true so the caller can continue
-             * (restoring things such as the view, timer, etc, if they were disabled);
-             * 
-             * takes some of the options as per fetchRepeatedlyWithDelay
-             * (though they are less well tested here)
-             * 
-             * note that the status text object is rarely useful; normally the fail(handler) is invoked,
-             * as above (#get)
-             */
-            var checkAjaxStatusObject = function(status, view, options) {
-                if (view.viewIsClosed) return false;
-                if (status == "success" || status == "notmodified") {
-                    // unfade and restore
-                    if (view._loadingProblem) {
-                        log("getting view data is back to normal - "+url)
-                        log(view)
-                        view._loadingProblem = false;
-                        
-                        var fadeTarget = view.$el;
-                        if ("fadeTarget" in options) {
-                            fadeTarget = options["fadeTarget"]
-                        }
-                        if (fadeTarget) ViewUtils.cancelFadeOnceLoaded(fadeTarget)
-                        
-                        if (options['originalPeriod']) 
-                            options.period = options['originalPeriod']; 
-                    }
-                    
-                    return true;
-                }
-                if (status == "error" || status == "timeout" || status == "parsererror") {
-                    // fade and log problem
-                    if (!view._loadingProblem) {
-                        log("error getting view data from "+url+" - is the server reachable?")
-                        view._loadingProblem = true;
-                    }
-                    // fade the view, on error
-                    var fadeTarget = view.$el;
-                    if ("fadeTarget" in options) {
-                        fadeTarget = options["fadeTarget"]
-                    }
-                    if (fadeTarget) ViewUtils.fadeToIndicateInitialLoad(fadeTarget)
-
-                    if (options['period']) {
-                        if (!options['originalPeriod']) options.originalPeriod = options['period'];
-                        var period = options['period'];
-                        
-                        // attempt exponential backoff up to every 15m
-                        period *= 2;
-                        var max = (options['backoffMaxPeriod'] || 15*60*1000);
-                        if (period > max) period = max;
-                        options.period = period
-                        setTimeout(function() { ViewUtils.get(view, url, success, options)}, period)
-                    } 
-                    
-                    return false;
-                }
-                return true;
-            }
-            
-            return $.get(url, function(data, status) {
-                if (!checkAjaxStatusObject(status, view, options)) {
-                    return;
-                }
-                if (success) success(data);
-                if (options['period']) 
-                    setTimeout(function() { ViewUtils.get(view, url, success, options)}, options['period'])
-            }).fail(function() {
-                checkAjaxStatusObject("error", view, options)
-            })
-        },
-        /** invokes a get against the given url repeatedly, with fading and backoff on failures,
-         * cf fetchRepeatedlyWithDelay, but here the user's callback function is invoked on success
-         */
-        getRepeatedlyWithDelay: function(view, url, success, options) {
-            if (!options) options = {}
-            if (!options['period']) options.period = 3000
-            ViewUtils.get(view, url, success, options)
-        },
-
-        /** As fetchRepeatedlyWithDelay(view, model, options), but without updating a view. */
-        fetchModelRepeatedlyWithDelay: function(model, options) {
-            this.fetchRepeatedlyWithDelay(undefined, model, options);
-        },
-
-        /* invokes fetch on the model, associated with the view.
-         * automatically closes when view closes, 
-         * and fades display and exponentially-backs off on problems.
-         * options include:
-         * 
-         *   enablement (function returning t/f whether the invocation is enabled)
-         *   period (millis, currently 3000 = 3s default);
-         *   originalPeriod (millis, becomes the period if successful; primarily for internal use);
-         *   backoffMaxPeriod (millis, max time to wait between retries, currently 15*60*1000 = 10m default);
-         *    
-         *   doitnow (if true, kicks off a run immediately, else only after the timer)
-         *   
-         *   fadeTarget (jquery element to fade; defaults to view.$el; null can be set to prevent fade);
-         *   
-         *   fetchOptions (additional options to pass to fetch; however success and error should not be present);
-         *   success (function to invoke on success, before re-queueing);
-         *   error (optional function to invoke on error, before requeueing);
-         */
-        fetchRepeatedlyWithDelay: function(view, model, options) {
-            if (view && view.viewIsClosed) return;
-            
-            if (!options) options = {}
-            if (!options.count) options.count = 1
-            else options.count++;
-            
-            var period = options['period'] || 3000
-            var originalPeriod = options['originalPeriod'] || period
-//            log("fetching, count "+options.count+", delay "+period+": "+model.url)
-            
-            var fetcher = function() {
-                if (view && view.viewIsClosed) return;
-                var disabled = (options['enablement'] && !options['enablement']()) 
-                    || !BrooklynConfig.view.refresh
-                if (options.count > 1 && disabled) {
-                    // not enabled, just requeue
-                    ViewUtils.fetchRepeatedlyWithDelay(view, model, options);
-                    return;
-                }
-                var fetchOptions = options['fetchOptions'] ? _.clone(options['fetchOptions']) : {}
-                fetchOptions.success = function(modelR,response,optionsR) {
-                        var fn = options['success']
-                        if (fn) fn(modelR,response,optionsR);
-                        if (view && view._loadingProblem) {
-                            log("fetching view data is back to normal - "+model.url)
-                            view._loadingProblem = false;
-                            
-                            var fadeTarget = view.$el;
-                            if ("fadeTarget" in options) {
-                                fadeTarget = options["fadeTarget"]
-                            }
-                            if (fadeTarget) ViewUtils.cancelFadeOnceLoaded(fadeTarget)
-                        }
-                        options.period = originalPeriod;
-                        ViewUtils.fetchRepeatedlyWithDelay(view, model, options);
-                }
-                fetchOptions.error = function(modelR,response,optionsR) {
-                        var fn = options['error']
-                        if (fn) fn(modelR,response,optionsR);
-                        if (view && !view._loadingProblem) {
-                            log("error fetching view data from "+model.url+" - is the server reachable?")
-                            log(response)
-                            view._loadingProblem = true;
-                        }
-                        // fade the view, on error
-                        if (view) {
-                            var fadeTarget = view.$el;
-                            if ("fadeTarget" in options) {
-                                fadeTarget = options["fadeTarget"]
-                            }
-                            if (fadeTarget) ViewUtils.fadeToIndicateInitialLoad(fadeTarget)
-                        }
-                        // attempt exponential backoff up to every 15m
-                        period *= 2;
-                        var max = (options['backoffMaxPeriod'] || 15*60*1000);
-                        if (period > max) period = max;
-                        options = _.clone(options)
-                        options.originalPeriod = originalPeriod;
-                        options.period = period;
-                        ViewUtils.fetchRepeatedlyWithDelay(view, model, options);
-                };
-                model.fetch(fetchOptions)
-            };
-            if (options['doitnow']) {
-                options.doitnow = false;
-                fetcher();
-            } else {
-                setTimeout(fetcher, period);
-            }
-        },
-        /** @deprecated since 0.7.0 use computeStatusIconInfo */
-        computeStatusIcon: function(serviceUp, lifecycleState) {
-            return this.computeStatusIconInfo(serviceUp, lifecycleState).url;
-        },
-        /** returns object with properties:
-         *  String word;
-         *  String url;
-         *  boolean problem;
-         */
-        computeStatusIconInfo: function(serviceUp, lifecycleState) {
-            var result = {};
-            
-            if (lifecycleState != null)
-                lifecycleState = lifecycleState.toLowerCase();
-            
-            if (serviceUp===false || serviceUp=="false") serviceUp=false;
-            else if (serviceUp===true || serviceUp=="true") serviceUp=true;
-            else {
-                if (serviceUp!=null && serviceUp !== "" && serviceUp !== undefined && serviceUp.toLowerCase().indexOf("loading")<0) {
-                    log("Unknown 'serviceUp' value:")
-                    log(serviceUp)
-                }
-                serviceUp = null;
-            }
-            var mode = null;
-            var imgext = "png";
-            var problem = false;
-            
-            if (lifecycleState=="running") {
-                if (serviceUp==false) {
-                    mode = "running-onfire";
-                    problem = true;
-                } else {
-                    mode = "running";
-                }
-            } else if (lifecycleState=="stopped" || lifecycleState=="created") {
-                if (serviceUp==true) {
-                    mode = "stopped-onfire";
-                    problem = true;
-                } else {
-                    mode = "stopped";
-                }
-            } else if (lifecycleState=="starting") {
-                mode = "starting";
-                imgext = "gif";  //animated
-            } else if (lifecycleState=="stopping") {
-                mode = "stopping";
-                imgext = "gif";  //animated
-            } else if (lifecycleState=="on_fire" || /* just in case */ lifecycleState=="on-fire" || lifecycleState=="onfire") {
-                mode = "onfire";
-                problem = true;
-            }
-            
-            if (mode==null) {
-                // no lifecycle state, rely on serviceUp
-                if (lifecycleState!=null && lifecycleState !== "" && lifecycleState !== undefined && lifecycleState.toLowerCase().indexOf("loading")<0) {
-                    log("Unknown 'lifecycleState' value:")
-                    log(lifecycleState)
-                }
-                if (serviceUp) mode = "running"; 
-                else if (serviceUp===false) mode = "stopped";
-            }
-
-            result.word = mode;
-            result.problem = problem;
-            if (mode==null) {
-                // no status info at all
-                result.url = null;
-            } else {
-                result.url = "/assets/img/"+"icon-status-"+mode+"."+imgext;
-            }
-            
-            return result;
-        }
-    };
-    return ViewUtils;
-});

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/swagger-ui/css/print.css
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/swagger-ui/css/print.css b/brooklyn-ui/src/main/webapp/assets/swagger-ui/css/print.css
deleted file mode 100644
index 7e22c7e..0000000
--- a/brooklyn-ui/src/main/webapp/assets/swagger-ui/css/print.css
+++ /dev/null
@@ -1,1195 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-
-/* Original style from softwaremaniacs.org (c) Ivan Sagalaev <Ma...@SoftwareManiacs.Org> */
-.swagger-section pre code {
-  display: block;
-  padding: 0.5em;
-  background: #F0F0F0;
-}
-.swagger-section pre code,
-.swagger-section pre .subst,
-.swagger-section pre .tag .title,
-.swagger-section pre .lisp .title,
-.swagger-section pre .clojure .built_in,
-.swagger-section pre .nginx .title {
-  color: black;
-}
-.swagger-section pre .string,
-.swagger-section pre .title,
-.swagger-section pre .constant,
-.swagger-section pre .parent,
-.swagger-section pre .tag .value,
-.swagger-section pre .rules .value,
-.swagger-section pre .rules .value .number,
-.swagger-section pre .preprocessor,
-.swagger-section pre .ruby .symbol,
-.swagger-section pre .ruby .symbol .string,
-.swagger-section pre .aggregate,
-.swagger-section pre .template_tag,
-.swagger-section pre .django .variable,
-.swagger-section pre .smalltalk .class,
-.swagger-section pre .addition,
-.swagger-section pre .flow,
-.swagger-section pre .stream,
-.swagger-section pre .bash .variable,
-.swagger-section pre .apache .tag,
-.swagger-section pre .apache .cbracket,
-.swagger-section pre .tex .command,
-.swagger-section pre .tex .special,
-.swagger-section pre .erlang_repl .function_or_atom,
-.swagger-section pre .markdown .header {
-  color: #800;
-}
-.swagger-section pre .comment,
-.swagger-section pre .annotation,
-.swagger-section pre .template_comment,
-.swagger-section pre .diff .header,
-.swagger-section pre .chunk,
-.swagger-section pre .markdown .blockquote {
-  color: #888;
-}
-.swagger-section pre .number,
-.swagger-section pre .date,
-.swagger-section pre .regexp,
-.swagger-section pre .literal,
-.swagger-section pre .smalltalk .symbol,
-.swagger-section pre .smalltalk .char,
-.swagger-section pre .go .constant,
-.swagger-section pre .change,
-.swagger-section pre .markdown .bullet,
-.swagger-section pre .markdown .link_url {
-  color: #080;
-}
-.swagger-section pre .label,
-.swagger-section pre .javadoc,
-.swagger-section pre .ruby .string,
-.swagger-section pre .decorator,
-.swagger-section pre .filter .argument,
-.swagger-section pre .localvars,
-.swagger-section pre .array,
-.swagger-section pre .attr_selector,
-.swagger-section pre .important,
-.swagger-section pre .pseudo,
-.swagger-section pre .pi,
-.swagger-section pre .doctype,
-.swagger-section pre .deletion,
-.swagger-section pre .envvar,
-.swagger-section pre .shebang,
-.swagger-section pre .apache .sqbracket,
-.swagger-section pre .nginx .built_in,
-.swagger-section pre .tex .formula,
-.swagger-section pre .erlang_repl .reserved,
-.swagger-section pre .prompt,
-.swagger-section pre .markdown .link_label,
-.swagger-section pre .vhdl .attribute,
-.swagger-section pre .clojure .attribute,
-.swagger-section pre .coffeescript .property {
-  color: #88F;
-}
-.swagger-section pre .keyword,
-.swagger-section pre .id,
-.swagger-section pre .phpdoc,
-.swagger-section pre .title,
-.swagger-section pre .built_in,
-.swagger-section pre .aggregate,
-.swagger-section pre .css .tag,
-.swagger-section pre .javadoctag,
-.swagger-section pre .phpdoc,
-.swagger-section pre .yardoctag,
-.swagger-section pre .smalltalk .class,
-.swagger-section pre .winutils,
-.swagger-section pre .bash .variable,
-.swagger-section pre .apache .tag,
-.swagger-section pre .go .typename,
-.swagger-section pre .tex .command,
-.swagger-section pre .markdown .strong,
-.swagger-section pre .request,
-.swagger-section pre .status {
-  font-weight: bold;
-}
-.swagger-section pre .markdown .emphasis {
-  font-style: italic;
-}
-.swagger-section pre .nginx .built_in {
-  font-weight: normal;
-}
-.swagger-section pre .coffeescript .javascript,
-.swagger-section pre .javascript .xml,
-.swagger-section pre .tex .formula,
-.swagger-section pre .xml .javascript,
-.swagger-section pre .xml .vbscript,
-.swagger-section pre .xml .css,
-.swagger-section pre .xml .cdata {
-  opacity: 0.5;
-}
-.swagger-section .swagger-ui-wrap {
-  line-height: 1;
-  font-family: "Droid Sans", sans-serif;
-  max-width: 960px;
-  margin-left: auto;
-  margin-right: auto;
-}
-.swagger-section .swagger-ui-wrap b,
-.swagger-section .swagger-ui-wrap strong {
-  font-family: "Droid Sans", sans-serif;
-  font-weight: bold;
-}
-.swagger-section .swagger-ui-wrap q,
-.swagger-section .swagger-ui-wrap blockquote {
-  quotes: none;
-}
-.swagger-section .swagger-ui-wrap p {
-  line-height: 1.4em;
-  padding: 0 0 10px;
-  color: #333333;
-}
-.swagger-section .swagger-ui-wrap q:before,
-.swagger-section .swagger-ui-wrap q:after,
-.swagger-section .swagger-ui-wrap blockquote:before,
-.swagger-section .swagger-ui-wrap blockquote:after {
-  content: none;
-}
-.swagger-section .swagger-ui-wrap .heading_with_menu h1,
-.swagger-section .swagger-ui-wrap .heading_with_menu h2,
-.swagger-section .swagger-ui-wrap .heading_with_menu h3,
-.swagger-section .swagger-ui-wrap .heading_with_menu h4,
-.swagger-section .swagger-ui-wrap .heading_with_menu h5,
-.swagger-section .swagger-ui-wrap .heading_with_menu h6 {
-  display: block;
-  clear: none;
-  float: left;
-  -moz-box-sizing: border-box;
-  -webkit-box-sizing: border-box;
-  -ms-box-sizing: border-box;
-  box-sizing: border-box;
-  width: 60%;
-}
-.swagger-section .swagger-ui-wrap table {
-  border-collapse: collapse;
-  border-spacing: 0;
-}
-.swagger-section .swagger-ui-wrap table thead tr th {
-  padding: 5px;
-  font-size: 0.9em;
-  color: #666666;
-  border-bottom: 1px solid #999999;
-}
-.swagger-section .swagger-ui-wrap table tbody tr:last-child td {
-  border-bottom: none;
-}
-.swagger-section .swagger-ui-wrap table tbody tr.offset {
-  background-color: #f0f0f0;
-}
-.swagger-section .swagger-ui-wrap table tbody tr td {
-  padding: 6px;
-  font-size: 0.9em;
-  border-bottom: 1px solid #cccccc;
-  vertical-align: top;
-  line-height: 1.3em;
-}
-.swagger-section .swagger-ui-wrap ol {
-  margin: 0px 0 10px;
-  padding: 0 0 0 18px;
-  list-style-type: decimal;
-}
-.swagger-section .swagger-ui-wrap ol li {
-  padding: 5px 0px;
-  font-size: 0.9em;
-  color: #333333;
-}
-.swagger-section .swagger-ui-wrap ol,
-.swagger-section .swagger-ui-wrap ul {
-  list-style: none;
-}
-.swagger-section .swagger-ui-wrap h1 a,
-.swagger-section .swagger-ui-wrap h2 a,
-.swagger-section .swagger-ui-wrap h3 a,
-.swagger-section .swagger-ui-wrap h4 a,
-.swagger-section .swagger-ui-wrap h5 a,
-.swagger-section .swagger-ui-wrap h6 a {
-  text-decoration: none;
-}
-.swagger-section .swagger-ui-wrap h1 a:hover,
-.swagger-section .swagger-ui-wrap h2 a:hover,
-.swagger-section .swagger-ui-wrap h3 a:hover,
-.swagger-section .swagger-ui-wrap h4 a:hover,
-.swagger-section .swagger-ui-wrap h5 a:hover,
-.swagger-section .swagger-ui-wrap h6 a:hover {
-  text-decoration: underline;
-}
-.swagger-section .swagger-ui-wrap h1 span.divider,
-.swagger-section .swagger-ui-wrap h2 span.divider,
-.swagger-section .swagger-ui-wrap h3 span.divider,
-.swagger-section .swagger-ui-wrap h4 span.divider,
-.swagger-section .swagger-ui-wrap h5 span.divider,
-.swagger-section .swagger-ui-wrap h6 span.divider {
-  color: #aaaaaa;
-}
-.swagger-section .swagger-ui-wrap a {
-  color: #547f00;
-}
-.swagger-section .swagger-ui-wrap a img {
-  border: none;
-}
-.swagger-section .swagger-ui-wrap article,
-.swagger-section .swagger-ui-wrap aside,
-.swagger-section .swagger-ui-wrap details,
-.swagger-section .swagger-ui-wrap figcaption,
-.swagger-section .swagger-ui-wrap figure,
-.swagger-section .swagger-ui-wrap footer,
-.swagger-section .swagger-ui-wrap header,
-.swagger-section .swagger-ui-wrap hgroup,
-.swagger-section .swagger-ui-wrap menu,
-.swagger-section .swagger-ui-wrap nav,
-.swagger-section .swagger-ui-wrap section,
-.swagger-section .swagger-ui-wrap summary {
-  display: block;
-}
-.swagger-section .swagger-ui-wrap pre {
-  font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
-  background-color: #fcf6db;
-  border: 1px solid #e5e0c6;
-  padding: 10px;
-}
-.swagger-section .swagger-ui-wrap pre code {
-  line-height: 1.6em;
-  background: none;
-}
-.swagger-section .swagger-ui-wrap .content > .content-type > div > label {
-  clear: both;
-  display: block;
-  color: #0F6AB4;
-  font-size: 1.1em;
-  margin: 0;
-  padding: 15px 0 5px;
-}
-.swagger-section .swagger-ui-wrap .content pre {
-  font-size: 12px;
-  margin-top: 5px;
-  padding: 5px;
-}
-.swagger-section .swagger-ui-wrap .icon-btn {
-  cursor: pointer;
-}
-.swagger-section .swagger-ui-wrap .info_title {
-  padding-bottom: 10px;
-  font-weight: bold;
-  font-size: 25px;
-}
-.swagger-section .swagger-ui-wrap .footer {
-  margin-top: 20px;
-}
-.swagger-section .swagger-ui-wrap p.big,
-.swagger-section .swagger-ui-wrap div.big p {
-  font-size: 1em;
-  margin-bottom: 10px;
-}
-.swagger-section .swagger-ui-wrap form.fullwidth ol li.string input,
-.swagger-section .swagger-ui-wrap form.fullwidth ol li.url input,
-.swagger-section .swagger-ui-wrap form.fullwidth ol li.text textarea,
-.swagger-section .swagger-ui-wrap form.fullwidth ol li.numeric input {
-  width: 500px !important;
-}
-.swagger-section .swagger-ui-wrap .info_license {
-  padding-bottom: 5px;
-}
-.swagger-section .swagger-ui-wrap .info_tos {
-  padding-bottom: 5px;
-}
-.swagger-section .swagger-ui-wrap .message-fail {
-  color: #cc0000;
-}
-.swagger-section .swagger-ui-wrap .info_url {
-  padding-bottom: 5px;
-}
-.swagger-section .swagger-ui-wrap .info_email {
-  padding-bottom: 5px;
-}
-.swagger-section .swagger-ui-wrap .info_name {
-  padding-bottom: 5px;
-}
-.swagger-section .swagger-ui-wrap .info_description {
-  padding-bottom: 10px;
-  font-size: 15px;
-}
-.swagger-section .swagger-ui-wrap .markdown ol li,
-.swagger-section .swagger-ui-wrap .markdown ul li {
-  padding: 3px 0px;
-  line-height: 1.4em;
-  color: #333333;
-}
-.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.string input,
-.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.url input,
-.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.numeric input {
-  display: block;
-  padding: 4px;
-  width: auto;
-  clear: both;
-}
-.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.string input.title,
-.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.url input.title,
-.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.numeric input.title {
-  font-size: 1.3em;
-}
-.swagger-section .swagger-ui-wrap table.fullwidth {
-  width: 100%;
-}
-.swagger-section .swagger-ui-wrap .model-signature {
-  font-family: "Droid Sans", sans-serif;
-  font-size: 1em;
-  line-height: 1.5em;
-}
-.swagger-section .swagger-ui-wrap .model-signature .signature-nav a {
-  text-decoration: none;
-  color: #AAA;
-}
-.swagger-section .swagger-ui-wrap .model-signature .signature-nav a:hover {
-  text-decoration: underline;
-  color: black;
-}
-.swagger-section .swagger-ui-wrap .model-signature .signature-nav .selected {
-  color: black;
-  text-decoration: none;
-}
-.swagger-section .swagger-ui-wrap .model-signature .propType {
-  color: #5555aa;
-}
-.swagger-section .swagger-ui-wrap .model-signature pre:hover {
-  background-color: #ffffdd;
-}
-.swagger-section .swagger-ui-wrap .model-signature pre {
-  font-size: .85em;
-  line-height: 1.2em;
-  overflow: auto;
-  max-height: 200px;
-  cursor: pointer;
-}
-.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav {
-  display: block;
-  margin: 0;
-  padding: 0;
-}
-.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav li:last-child {
-  padding-right: 0;
-  border-right: none;
-}
-.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav li {
-  float: left;
-  margin: 0 5px 5px 0;
-  padding: 2px 5px 2px 0;
-  border-right: 1px solid #ddd;
-}
-.swagger-section .swagger-ui-wrap .model-signature .propOpt {
-  color: #555;
-}
-.swagger-section .swagger-ui-wrap .model-signature .snippet small {
-  font-size: 0.75em;
-}
-.swagger-section .swagger-ui-wrap .model-signature .propOptKey {
-  font-style: italic;
-}
-.swagger-section .swagger-ui-wrap .model-signature .description .strong {
-  font-weight: bold;
-  color: #000;
-  font-size: .9em;
-}
-.swagger-section .swagger-ui-wrap .model-signature .description div {
-  font-size: 0.9em;
-  line-height: 1.5em;
-  margin-left: 1em;
-}
-.swagger-section .swagger-ui-wrap .model-signature .description .stronger {
-  font-weight: bold;
-  color: #000;
-}
-.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper {
-  border-spacing: 0;
-  position: absolute;
-  background-color: #ffffff;
-  border: 1px solid #bbbbbb;
-  display: none;
-  font-size: 11px;
-  max-width: 400px;
-  line-height: 30px;
-  color: black;
-  padding: 5px;
-  margin-left: 10px;
-}
-.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper th {
-  text-align: center;
-  background-color: #eeeeee;
-  border: 1px solid #bbbbbb;
-  font-size: 11px;
-  color: #666666;
-  font-weight: bold;
-  padding: 5px;
-  line-height: 15px;
-}
-.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper .optionName {
-  font-weight: bold;
-}
-.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown > p:first-child,
-.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown > p:last-child {
-  display: inline;
-}
-.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown > p:not(:first-child):before {
-  display: block;
-  content: '';
-}
-.swagger-section .swagger-ui-wrap .model-signature .description span:last-of-type.propDesc.markdown > p:only-child {
-  margin-right: -3px;
-}
-.swagger-section .swagger-ui-wrap .model-signature .propName {
-  font-weight: bold;
-}
-.swagger-section .swagger-ui-wrap .model-signature .signature-container {
-  clear: both;
-}
-.swagger-section .swagger-ui-wrap .body-textarea {
-  width: 300px;
-  height: 100px;
-  border: 1px solid #aaa;
-}
-.swagger-section .swagger-ui-wrap .markdown p code,
-.swagger-section .swagger-ui-wrap .markdown li code {
-  font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
-  background-color: #f0f0f0;
-  color: black;
-  padding: 1px 3px;
-}
-.swagger-section .swagger-ui-wrap .required {
-  font-weight: bold;
-}
-.swagger-section .swagger-ui-wrap input.parameter {
-  width: 300px;
-  border: 1px solid #aaa;
-}
-.swagger-section .swagger-ui-wrap h1 {
-  color: black;
-  font-size: 1.5em;
-  line-height: 1.3em;
-  padding: 10px 0 10px 0;
-  font-family: "Droid Sans", sans-serif;
-  font-weight: bold;
-}
-.swagger-section .swagger-ui-wrap .heading_with_menu {
-  float: none;
-  clear: both;
-  overflow: hidden;
-  display: block;
-}
-.swagger-section .swagger-ui-wrap .heading_with_menu ul {
-  display: block;
-  clear: none;
-  float: right;
-  -moz-box-sizing: border-box;
-  -webkit-box-sizing: border-box;
-  -ms-box-sizing: border-box;
-  box-sizing: border-box;
-  margin-top: 10px;
-}
-.swagger-section .swagger-ui-wrap h2 {
-  color: black;
-  font-size: 1.3em;
-  padding: 10px 0 10px 0;
-}
-.swagger-section .swagger-ui-wrap h2 a {
-  color: black;
-}
-.swagger-section .swagger-ui-wrap h2 span.sub {
-  font-size: 0.7em;
-  color: #999999;
-  font-style: italic;
-}
-.swagger-section .swagger-ui-wrap h2 span.sub a {
-  color: #777777;
-}
-.swagger-section .swagger-ui-wrap span.weak {
-  color: #666666;
-}
-.swagger-section .swagger-ui-wrap .message-success {
-  color: #89BF04;
-}
-.swagger-section .swagger-ui-wrap caption,
-.swagger-section .swagger-ui-wrap th,
-.swagger-section .swagger-ui-wrap td {
-  text-align: left;
-  font-weight: normal;
-  vertical-align: middle;
-}
-.swagger-section .swagger-ui-wrap .code {
-  font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
-}
-.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.text textarea {
-  font-family: "Droid Sans", sans-serif;
-  height: 250px;
-  padding: 4px;
-  display: block;
-  clear: both;
-}
-.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.select select {
-  display: block;
-  clear: both;
-}
-.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean {
-  float: none;
-  clear: both;
-  overflow: hidden;
-  display: block;
-}
-.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean label {
-  display: block;
-  float: left;
-  clear: none;
-  margin: 0;
-  padding: 0;
-}
-.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean input {
-  display: block;
-  float: left;
-  clear: none;
-  margin: 0 5px 0 0;
-}
-.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.required label {
-  color: black;
-}
-.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li label {
-  display: block;
-  clear: both;
-  width: auto;
-  padding: 0 0 3px;
-  color: #666666;
-}
-.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li label abbr {
-  padding-left: 3px;
-  color: #888888;
-}
-.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li p.inline-hints {
-  margin-left: 0;
-  font-style: italic;
-  font-size: 0.9em;
-  margin: 0;
-}
-.swagger-section .swagger-ui-wrap form.formtastic fieldset.buttons {
-  margin: 0;
-  padding: 0;
-}
-.swagger-section .swagger-ui-wrap span.blank,
-.swagger-section .swagger-ui-wrap span.empty {
-  color: #888888;
-  font-style: italic;
-}
-.swagger-section .swagger-ui-wrap .markdown h3 {
-  color: #547f00;
-}
-.swagger-section .swagger-ui-wrap .markdown h4 {
-  color: #666666;
-}
-.swagger-section .swagger-ui-wrap .markdown pre {
-  font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
-  background-color: #fcf6db;
-  border: 1px solid #e5e0c6;
-  padding: 10px;
-  margin: 0 0 10px 0;
-}
-.swagger-section .swagger-ui-wrap .markdown pre code {
-  line-height: 1.6em;
-}
-.swagger-section .swagger-ui-wrap div.gist {
-  margin: 20px 0 25px 0 !important;
-}
-.swagger-section .swagger-ui-wrap ul#resources {
-  font-family: "Droid Sans", sans-serif;
-  font-size: 0.9em;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource {
-  border-bottom: 1px solid #dddddd;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource:hover div.heading h2 a,
-.swagger-section .swagger-ui-wrap ul#resources li.resource.active div.heading h2 a {
-  color: black;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource:hover div.heading ul.options li a,
-.swagger-section .swagger-ui-wrap ul#resources li.resource.active div.heading ul.options li a {
-  color: #555555;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource:last-child {
-  border-bottom: none;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading {
-  border: 1px solid transparent;
-  float: none;
-  clear: both;
-  overflow: hidden;
-  display: block;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options {
-  overflow: hidden;
-  padding: 0;
-  display: block;
-  clear: none;
-  float: right;
-  margin: 14px 10px 0 0;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li {
-  float: left;
-  clear: none;
-  margin: 0;
-  padding: 2px 10px;
-  border-right: 1px solid #dddddd;
-  color: #666666;
-  font-size: 0.9em;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a {
-  color: #aaaaaa;
-  text-decoration: none;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:hover {
-  text-decoration: underline;
-  color: black;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:hover,
-.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:active,
-.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a.active {
-  text-decoration: underline;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li:first-child,
-.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li.first {
-  padding-left: 0;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li:last-child,
-.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li.last {
-  padding-right: 0;
-  border-right: none;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options:first-child,
-.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options.first {
-  padding-left: 0;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 {
-  color: #999999;
-  padding-left: 0;
-  display: block;
-  clear: none;
-  float: left;
-  font-family: "Droid Sans", sans-serif;
-  font-weight: bold;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a {
-  color: #999999;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a:hover {
-  color: black;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation {
-  float: none;
-  clear: both;
-  overflow: hidden;
-  display: block;
-  margin: 0 0 10px;
-  padding: 0;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading {
-  float: none;
-  clear: both;
-  overflow: hidden;
-  display: block;
-  margin: 0;
-  padding: 0;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 {
-  display: block;
-  clear: none;
-  float: left;
-  width: auto;
-  margin: 0;
-  padding: 0;
-  line-height: 1.1em;
-  color: black;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path {
-  padding-left: 10px;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a {
-  color: black;
-  text-decoration: none;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a:hover {
-  text-decoration: underline;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.http_method a {
-  text-transform: uppercase;
-  text-decoration: none;
-  color: white;
-  display: inline-block;
-  width: 50px;
-  font-size: 0.7em;
-  text-align: center;
-  padding: 7px 0 4px;
-  -moz-border-radius: 2px;
-  -webkit-border-radius: 2px;
-  -o-border-radius: 2px;
-  -ms-border-radius: 2px;
-  -khtml-border-radius: 2px;
-  border-radius: 2px;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span {
-  margin: 0;
-  padding: 0;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options {
-  overflow: hidden;
-  padding: 0;
-  display: block;
-  clear: none;
-  float: right;
-  margin: 6px 10px 0 0;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li {
-  float: left;
-  clear: none;
-  margin: 0;
-  padding: 2px 10px;
-  font-size: 0.9em;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li a {
-  text-decoration: none;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li.access {
-  color: black;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content {
-  border-top: none;
-  padding: 10px;
-  -moz-border-radius-bottomleft: 6px;
-  -webkit-border-bottom-left-radius: 6px;
-  -o-border-bottom-left-radius: 6px;
-  -ms-border-bottom-left-radius: 6px;
-  -khtml-border-bottom-left-radius: 6px;
-  border-bottom-left-radius: 6px;
-  -moz-border-radius-bottomright: 6px;
-  -webkit-border-bottom-right-radius: 6px;
-  -o-border-bottom-right-radius: 6px;
-  -ms-border-bottom-right-radius: 6px;
-  -khtml-border-bottom-right-radius: 6px;
-  border-bottom-right-radius: 6px;
-  margin: 0 0 20px;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content h4 {
-  font-size: 1.1em;
-  margin: 0;
-  padding: 15px 0 5px;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header {
-  float: none;
-  clear: both;
-  overflow: hidden;
-  display: block;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header a {
-  padding: 4px 0 0 10px;
-  display: inline-block;
-  font-size: 0.9em;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header input.submit {
-  display: block;
-  clear: none;
-  float: left;
-  padding: 6px 8px;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header span.response_throbber {
-  background-image: url('../images/throbber.gif');
-  width: 128px;
-  height: 16px;
-  display: block;
-  clear: none;
-  float: right;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content form input[type='text'].error {
-  outline: 2px solid black;
-  outline-color: #cc0000;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content form select[name='parameterContentType'] {
-  max-width: 300px;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.response div.block pre {
-  font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
-  padding: 10px;
-  font-size: 0.9em;
-  max-height: 400px;
-  overflow-y: auto;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading {
-  background-color: #f9f2e9;
-  border: 1px solid #f0e0ca;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading h3 span.http_method a {
-  background-color: #c5862b;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li {
-  border-right: 1px solid #dddddd;
-  border-right-color: #f0e0ca;
-  color: #c5862b;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li a {
-  color: #c5862b;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content {
-  background-color: #faf5ee;
-  border: 1px solid #f0e0ca;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content h4 {
-  color: #c5862b;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content div.sandbox_header a {
-  color: #dcb67f;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading {
-  background-color: #fcffcd;
-  border: 1px solid black;
-  border-color: #ffd20f;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading h3 span.http_method a {
-  text-transform: uppercase;
-  background-color: #ffd20f;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li {
-  border-right: 1px solid #dddddd;
-  border-right-color: #ffd20f;
-  color: #ffd20f;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li a {
-  color: #ffd20f;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content {
-  background-color: #fcffcd;
-  border: 1px solid black;
-  border-color: #ffd20f;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content h4 {
-  color: #ffd20f;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content div.sandbox_header a {
-  color: #6fc992;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading {
-  background-color: #f5e8e8;
-  border: 1px solid #e8c6c7;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading h3 span.http_method a {
-  text-transform: uppercase;
-  background-color: #a41e22;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li {
-  border-right: 1px solid #dddddd;
-  border-right-color: #e8c6c7;
-  color: #a41e22;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li a {
-  color: #a41e22;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content {
-  background-color: #f7eded;
-  border: 1px solid #e8c6c7;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content h4 {
-  color: #a41e22;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content div.sandbox_header a {
-  color: #c8787a;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading {
-  background-color: #e7f6ec;
-  border: 1px solid #c3e8d1;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading h3 span.http_method a {
-  background-color: #10a54a;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li {
-  border-right: 1px solid #dddddd;
-  border-right-color: #c3e8d1;
-  color: #10a54a;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li a {
-  color: #10a54a;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content {
-  background-color: #ebf7f0;
-  border: 1px solid #c3e8d1;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content h4 {
-  color: #10a54a;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content div.sandbox_header a {
-  color: #6fc992;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading {
-  background-color: #FCE9E3;
-  border: 1px solid #F5D5C3;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading h3 span.http_method a {
-  background-color: #D38042;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li {
-  border-right: 1px solid #dddddd;
-  border-right-color: #f0cecb;
-  color: #D38042;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li a {
-  color: #D38042;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content {
-  background-color: #faf0ef;
-  border: 1px solid #f0cecb;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content h4 {
-  color: #D38042;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content div.sandbox_header a {
-  color: #dcb67f;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading {
-  background-color: #e7f0f7;
-  border: 1px solid #c3d9ec;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading h3 span.http_method a {
-  background-color: #0f6ab4;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li {
-  border-right: 1px solid #dddddd;
-  border-right-color: #c3d9ec;
-  color: #0f6ab4;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li a {
-  color: #0f6ab4;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content {
-  background-color: #ebf3f9;
-  border: 1px solid #c3d9ec;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content h4 {
-  color: #0f6ab4;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content div.sandbox_header a {
-  color: #6fa5d2;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading {
-  background-color: #e7f0f7;
-  border: 1px solid #c3d9ec;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading h3 span.http_method a {
-  background-color: #0f6ab4;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading ul.options li {
-  border-right: 1px solid #dddddd;
-  border-right-color: #c3d9ec;
-  color: #0f6ab4;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading ul.options li a {
-  color: #0f6ab4;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content {
-  background-color: #ebf3f9;
-  border: 1px solid #c3d9ec;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content h4 {
-  color: #0f6ab4;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content div.sandbox_header a {
-  color: #6fa5d2;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content,
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content,
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content,
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content,
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content,
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content {
-  border-top: none;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li:last-child,
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li:last-child,
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li:last-child,
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li:last-child,
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li:last-child,
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li:last-child,
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li.last,
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li.last,
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li.last,
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li.last,
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li.last,
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li.last {
-  padding-right: 0;
-  border-right: none;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a:hover,
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a:active,
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a.active {
-  text-decoration: underline;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li:first-child,
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li.first {
-  padding-left: 0;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations:first-child,
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations.first {
-  padding-left: 0;
-}
-.swagger-section .swagger-ui-wrap p#colophon {
-  margin: 0 15px 40px 15px;
-  padding: 10px 0;
-  font-size: 0.8em;
-  border-top: 1px solid #dddddd;
-  font-family: "Droid Sans", sans-serif;
-  color: #999999;
-  font-style: italic;
-}
-.swagger-section .swagger-ui-wrap p#colophon a {
-  text-decoration: none;
-  color: #547f00;
-}
-.swagger-section .swagger-ui-wrap h3 {
-  color: black;
-  font-size: 1.1em;
-  padding: 10px 0 10px 0;
-}
-.swagger-section .swagger-ui-wrap .markdown ol,
-.swagger-section .swagger-ui-wrap .markdown ul {
-  font-family: "Droid Sans", sans-serif;
-  margin: 5px 0 10px;
-  padding: 0 0 0 18px;
-  list-style-type: disc;
-}
-.swagger-section .swagger-ui-wrap form.form_box {
-  background-color: #ebf3f9;
-  border: 1px solid #c3d9ec;
-  padding: 10px;
-}
-.swagger-section .swagger-ui-wrap form.form_box label {
-  color: #0f6ab4 !important;
-}
-.swagger-section .swagger-ui-wrap form.form_box input[type=submit] {
-  display: block;
-  padding: 10px;
-}
-.swagger-section .swagger-ui-wrap form.form_box p.weak {
-  font-size: 0.8em;
-}
-.swagger-section .swagger-ui-wrap form.form_box p {
-  font-size: 0.9em;
-  padding: 0 0 15px;
-  color: #7e7b6d;
-}
-.swagger-section .swagger-ui-wrap form.form_box p a {
-  color: #646257;
-}
-.swagger-section .swagger-ui-wrap form.form_box p strong {
-  color: black;
-}
-.swagger-section .swagger-ui-wrap .operation-status td.markdown > p:last-child {
-  padding-bottom: 0;
-}
-.swagger-section .title {
-  font-style: bold;
-}
-.swagger-section .secondary_form {
-  display: none;
-}
-.swagger-section .main_image {
-  display: block;
-  margin-left: auto;
-  margin-right: auto;
-}
-.swagger-section .oauth_body {
-  margin-left: 100px;
-  margin-right: 100px;
-}
-.swagger-section .oauth_submit {
-  text-align: center;
-}
-.swagger-section .api-popup-dialog {
-  z-index: 10000;
-  position: absolute;
-  width: 500px;
-  background: #FFF;
-  padding: 20px;
-  border: 1px solid #ccc;
-  border-radius: 5px;
-  display: none;
-  font-size: 13px;
-  color: #777;
-}
-.swagger-section .api-popup-dialog .api-popup-title {
-  font-size: 24px;
-  padding: 10px 0;
-}
-.swagger-section .api-popup-dialog .api-popup-title {
-  font-size: 24px;
-  padding: 10px 0;
-}
-.swagger-section .api-popup-dialog p.error-msg {
-  padding-left: 5px;
-  padding-bottom: 5px;
-}
-.swagger-section .api-popup-dialog button.api-popup-authbtn {
-  height: 30px;
-}
-.swagger-section .api-popup-dialog button.api-popup-cancel {
-  height: 30px;
-}
-.swagger-section .api-popup-scopes {
-  padding: 10px 20px;
-}
-.swagger-section .api-popup-scopes li {
-  padding: 5px 0;
-  line-height: 20px;
-}
-.swagger-section .api-popup-scopes .api-scope-desc {
-  padding-left: 20px;
-  font-style: italic;
-}
-.swagger-section .api-popup-scopes li input {
-  position: relative;
-  top: 2px;
-}
-.swagger-section .api-popup-actions {
-  padding-top: 10px;
-}
-#header {
-  display: none;
-}
-.swagger-section .swagger-ui-wrap .model-signature pre {
-  max-height: none;
-}
-.swagger-section .swagger-ui-wrap .body-textarea {
-  width: 100px;
-}
-.swagger-section .swagger-ui-wrap input.parameter {
-  width: 100px;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options {
-  display: none;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints {
-  display: block !important;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content {
-  display: block !important;
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/swagger-ui/css/reset.css
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/swagger-ui/css/reset.css b/brooklyn-ui/src/main/webapp/assets/swagger-ui/css/reset.css
deleted file mode 100644
index 10188c3..0000000
--- a/brooklyn-ui/src/main/webapp/assets/swagger-ui/css/reset.css
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/* http://meyerweb.com/eric/tools/css/reset/ v2.0 | 20110126 */
-html,
-body,
-div,
-span,
-applet,
-object,
-iframe,
-h1,
-h2,
-h3,
-h4,
-h5,
-h6,
-p,
-blockquote,
-pre,
-a,
-abbr,
-acronym,
-address,
-big,
-cite,
-code,
-del,
-dfn,
-em,
-img,
-ins,
-kbd,
-q,
-s,
-samp,
-small,
-strike,
-strong,
-sub,
-sup,
-tt,
-var,
-b,
-u,
-i,
-center,
-dl,
-dt,
-dd,
-ol,
-ul,
-li,
-fieldset,
-form,
-label,
-legend,
-table,
-caption,
-tbody,
-tfoot,
-thead,
-tr,
-th,
-td,
-article,
-aside,
-canvas,
-details,
-embed,
-figure,
-figcaption,
-footer,
-header,
-hgroup,
-menu,
-nav,
-output,
-ruby,
-section,
-summary,
-time,
-mark,
-audio,
-video {
-  margin: 0;
-  padding: 0;
-  border: 0;
-  font-size: 100%;
-  font: inherit;
-  vertical-align: baseline;
-}
-/* HTML5 display-role reset for older browsers */
-article,
-aside,
-details,
-figcaption,
-figure,
-footer,
-header,
-hgroup,
-menu,
-nav,
-section {
-  display: block;
-}
-body {
-  line-height: 1;
-}
-ol,
-ul {
-  list-style: none;
-}
-blockquote,
-q {
-  quotes: none;
-}
-blockquote:before,
-blockquote:after,
-q:before,
-q:after {
-  content: '';
-  content: none;
-}
-table {
-  border-collapse: collapse;
-  border-spacing: 0;
-}


[49/51] [abbrv] [partial] brooklyn-ui git commit: move subdir from incubator up a level as it is promoted to its own repo (first non-incubator commit!)

Posted by he...@apache.org.
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/license/README.md
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/license/README.md b/brooklyn-ui/src/main/license/README.md
deleted file mode 100644
index 2714c67..0000000
--- a/brooklyn-ui/src/main/license/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-
-This directory contains files to generate the custom license for this project.
-The files/ subdir contains the artifacts which are included in the JAR, some
-autogenerated by the dist/licensing scripts.
-
-See usage/dist/licensing/README.md for more information.
-

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/license/files/DISCLAIMER
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/license/files/DISCLAIMER b/brooklyn-ui/src/main/license/files/DISCLAIMER
deleted file mode 100644
index 9e6119b..0000000
--- a/brooklyn-ui/src/main/license/files/DISCLAIMER
+++ /dev/null
@@ -1,8 +0,0 @@
-
-Apache Brooklyn is an effort undergoing incubation at The Apache Software Foundation (ASF), 
-sponsored by the Apache Incubator. Incubation is required of all newly accepted projects until 
-a further review indicates that the infrastructure, communications, and decision making process 
-have stabilized in a manner consistent with other successful ASF projects. While incubation 
-status is not necessarily a reflection of the completeness or stability of the code, it does 
-indicate that the project has yet to be fully endorsed by the ASF.
-

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/license/files/LICENSE
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/license/files/LICENSE b/brooklyn-ui/src/main/license/files/LICENSE
deleted file mode 100644
index 58c78f1..0000000
--- a/brooklyn-ui/src/main/license/files/LICENSE
+++ /dev/null
@@ -1,440 +0,0 @@
-
-This software is distributed under the Apache License, version 2.0. See (1) below.
-This software is copyright (c) The Apache Software Foundation and contributors.
-
-Contents:
-
-  (1) This software license: Apache License, version 2.0
-  (2) Notices for bundled software
-  (3) Licenses for bundled software
-
-
----------------------------------------------------
-
-(1) This software license: Apache License, version 2.0
-
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-
----------------------------------------------------
-
-(2) Notices for bundled software
-
-This project includes the software: async.js
-  Available at: https://github.com/p15martin/google-maps-hello-world/blob/master/js/libs/async.js
-  Developed by: Miller Medeiros (https://github.com/millermedeiros/)
-  Version used: 0.1.1
-  Used under the following license: The MIT License (http://opensource.org/licenses/MIT)
-  Copyright (c) Miller Medeiros (2011)
-
-This project includes the software: backbone.js
-  Available at: http://backbonejs.org
-  Developed by: DocumentCloud Inc. (http://www.documentcloud.org/)
-  Version used: 1.0.0
-  Used under the following license: The MIT License (http://opensource.org/licenses/MIT)
-  Copyright (c) Jeremy Ashkenas, DocumentCloud Inc. (2010-2013)
-
-This project includes the software: bootstrap.js
-  Available at: http://twitter.github.com/bootstrap/javascript.html#transitions
-  Version used: 2.0.4
-  Used under the following license: Apache License, version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
-  Copyright (c) Twitter, Inc. (2012)
-
-This project includes the software: handlebars.js
-  Available at: https://github.com/wycats/handlebars.js
-  Developed by: Yehuda Katz (https://github.com/wycats/)
-  Inclusive of: handlebars*.js
-  Version used: 1.0-rc1
-  Used under the following license: The MIT License (http://opensource.org/licenses/MIT)
-  Copyright (c) Yehuda Katz (2012)
-
-This project includes the software: jQuery JavaScript Library
-  Available at: http://jquery.com/
-  Developed by: The jQuery Foundation (http://jquery.org/)
-  Inclusive of: jquery.js
-  Version used: 1.7.2
-  Used under the following license: The MIT License (http://opensource.org/licenses/MIT)
-  Copyright (c) John Resig (2005-2011)
-  Includes code fragments from sizzle.js:
-    Copyright (c) The Dojo Foundation
-    Available at http://sizzlejs.com
-    Used under the MIT license
-
-This project includes the software: jQuery BBQ: Back Button & Query Library
-  Available at: http://benalman.com/projects/jquery-bbq-plugin/
-  Developed by: "Cowboy" Ben Alman (http://benalman.com/)
-  Inclusive of: jquery.ba-bbq*.js
-  Version used: 1.2.1
-  Used under the following license: The MIT License (http://opensource.org/licenses/MIT)
-  Copyright (c) "Cowboy" Ben Alman (2010)"
-
-This project includes the software: DataTables Table plug-in for jQuery
-  Available at: http://www.datatables.net/
-  Developed by: SpryMedia Ltd (http://sprymedia.co.uk/)
-  Inclusive of: jquery.dataTables.{js,css}
-  Version used: 1.9.4
-  Used under the following license: The BSD 3-Clause (New BSD) License (http://opensource.org/licenses/BSD-3-Clause)
-  Copyright (c) Allan Jardine (2008-2012)
-
-This project includes the software: jQuery Form Plugin
-  Available at: https://github.com/malsup/form
-  Developed by: Mike Alsup (http://malsup.com/)
-  Inclusive of: jquery.form.js
-  Version used: 3.09
-  Used under the following license: The MIT License (http://opensource.org/licenses/MIT)
-  Copyright (c) M. Alsup (2006-2013)
-
-This project includes the software: jQuery Wiggle
-  Available at: https://github.com/jordanthomas/jquery-wiggle
-  Inclusive of: jquery.wiggle.min.js
-  Version used: swagger-ui:1.0.1
-  Used under the following license: The MIT License (http://opensource.org/licenses/MIT)
-  Copyright (c) WonderGroup and Jordan Thomas (2010)
-  Previously online at http://labs.wondergroup.com/demos/mini-ui/index.html.
-  The version included here is from the Swagger UI distribution.
-
-This project includes the software: js-uri
-  Available at: http://code.google.com/p/js-uri/
-  Developed by: js-uri contributors (https://code.google.com/js-uri)
-  Inclusive of: URI.js
-  Version used: 0.1
-  Used under the following license: The BSD 3-Clause (New BSD) License (http://opensource.org/licenses/BSD-3-Clause)
-  Copyright (c) js-uri contributors (2013)
-
-This project includes the software: js-yaml.js
-  Available at: https://github.com/nodeca/
-  Developed by: Vitaly Puzrin (https://github.com/nodeca/)
-  Version used: 3.2.7
-  Used under the following license: The MIT License (http://opensource.org/licenses/MIT)
-  Copyright (c) Vitaly Puzrin (2011-2015)
-
-This project includes the software: marked.js
-  Available at: https://github.com/chjj/marked
-  Developed by: Christopher Jeffrey (https://github.com/chjj)
-  Version used: 0.3.1
-  Used under the following license: The MIT License (http://opensource.org/licenses/MIT)
-  Copyright (c) Christopher Jeffrey (2011-2014)
-
-This project includes the software: moment.js
-  Available at: http://momentjs.com
-  Developed by: Tim Wood (http://momentjs.com)
-  Version used: 2.1.0
-  Used under the following license: The MIT License (http://opensource.org/licenses/MIT)
-  Copyright (c) Tim Wood, Iskren Chernev, Moment.js contributors (2011-2014)
-
-This project includes the software: RequireJS
-  Available at: http://requirejs.org/
-  Developed by: The Dojo Foundation (http://dojofoundation.org/)
-  Inclusive of: require.js, text.js
-  Version used: 2.0.6
-  Used under the following license: The MIT License (http://opensource.org/licenses/MIT)
-  Copyright (c) The Dojo Foundation (2010-2012)
-
-This project includes the software: RequireJS (r.js maven plugin)
-  Available at: http://github.com/jrburke/requirejs
-  Developed by: The Dojo Foundation (http://dojofoundation.org/)
-  Inclusive of: r.js
-  Version used: 2.1.6
-  Used under the following license: The MIT License (http://opensource.org/licenses/MIT)
-  Copyright (c) The Dojo Foundation (2009-2013)
-  Includes code fragments for source-map and other functionality:
-    Copyright (c) The Mozilla Foundation and contributors (2011)
-    Used under the BSD 2-Clause license.
-  Includes code fragments for parse-js and other functionality:
-    Copyright (c) Mihai Bazon (2010, 2012)
-    Used under the BSD 2-Clause license.
-  Includes code fragments for uglifyjs/consolidator:
-    Copyright (c) Robert Gust-Bardon (2012)
-    Used under the BSD 2-Clause license.
-  Includes code fragments for the esprima parser:
-    Copyright (c):
-      Ariya Hidayat (2011, 2012)
-      Mathias Bynens (2012)
-      Joost-Wim Boekesteijn (2012)
-      Kris Kowal (2012)
-      Yusuke Suzuki (2012)
-      Arpad Borsos (2012)
-    Used under the BSD 2-Clause license.
-
-This project includes the software: Swagger UI
-  Available at: https://github.com/swagger-api/swagger-ui
-  Inclusive of: swagger*.{js,css,html}
-  Version used: 2.1.4
-  Used under the following license: Apache License, version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
-  Copyright (c) SmartBear Software (2011-2015)
-
-This project includes the software: underscore.js
-  Available at: http://underscorejs.org
-  Developed by: DocumentCloud Inc. (http://www.documentcloud.org/)
-  Inclusive of: underscore*.{js,map}
-  Version used: 1.4.4
-  Used under the following license: The MIT License (http://opensource.org/licenses/MIT)
-  Copyright (c) Jeremy Ashkenas, DocumentCloud Inc. (2009-2013)
-
-This project includes the software: ZeroClipboard
-  Available at: http://zeroclipboard.org/
-  Developed by: ZeroClipboard contributors (https://github.com/zeroclipboard)
-  Inclusive of: ZeroClipboard.*
-  Version used: 1.3.1
-  Used under the following license: The MIT License (http://opensource.org/licenses/MIT)
-  Copyright (c) Jon Rohan, James M. Greene (2014)
-
-
----------------------------------------------------
-
-(3) Licenses for bundled software
-
-Contents:
-
-  The BSD 2-Clause License
-  The BSD 3-Clause License ("New BSD")
-  The MIT License ("MIT")
-
-
-The BSD 2-Clause License
-
-  Redistribution and use in source and binary forms, with or without
-  modification, are permitted provided that the following conditions are met:
-  
-  1. Redistributions of source code must retain the above copyright notice, this
-  list of conditions and the following disclaimer.
-  
-  2. Redistributions in binary form must reproduce the above copyright notice,
-  this list of conditions and the following disclaimer in the documentation
-  and/or other materials provided with the distribution.
-  
-  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
-  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-  
-
-The BSD 3-Clause License ("New BSD")
-
-  Redistribution and use in source and binary forms, with or without modification,
-  are permitted provided that the following conditions are met:
-  
-  1. Redistributions of source code must retain the above copyright notice, 
-  this list of conditions and the following disclaimer.
-  
-  2. Redistributions in binary form must reproduce the above copyright notice, 
-  this list of conditions and the following disclaimer in the documentation 
-  and/or other materials provided with the distribution.
-  
-  3. Neither the name of the copyright holder nor the names of its contributors 
-  may be used to endorse or promote products derived from this software without 
-  specific prior written permission.
-  
-  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
-  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
-  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
-  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
-  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
-  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
-  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
-  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
-  POSSIBILITY OF SUCH DAMAGE.
-  
-
-The MIT License ("MIT")
-
-  Permission is hereby granted, free of charge, to any person obtaining a copy
-  of this software and associated documentation files (the "Software"), to deal
-  in the Software without restriction, including without limitation the rights
-  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-  copies of the Software, and to permit persons to whom the Software is
-  furnished to do so, subject to the following conditions:
-  
-  The above copyright notice and this permission notice shall be included in
-  all copies or substantial portions of the Software.
-  
-  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-  THE SOFTWARE.
-  
-

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/license/files/NOTICE
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/license/files/NOTICE b/brooklyn-ui/src/main/license/files/NOTICE
deleted file mode 100644
index f790f13..0000000
--- a/brooklyn-ui/src/main/license/files/NOTICE
+++ /dev/null
@@ -1,5 +0,0 @@
-Apache Brooklyn
-Copyright 2014-2015 The Apache Software Foundation
-
-This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/license/source-inclusions.yaml
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/license/source-inclusions.yaml b/brooklyn-ui/src/main/license/source-inclusions.yaml
deleted file mode 100644
index 8c1945c..0000000
--- a/brooklyn-ui/src/main/license/source-inclusions.yaml
+++ /dev/null
@@ -1,42 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#  http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-# extras file for org.heneveld.license-audit-maven-plugin
-# listing projects from which *source* files are included
-
-- id: jquery-core:1.7.2
-- id: swagger-ui:2.1.4
-# we use other versions of the above in other projs
-
-- id: jquery.wiggle.min.js
-- id: require.js
-- id: require.js/r.js
-- id: backbone.js
-- id: bootstrap.js
-- id: underscore.js
-- id: async.js
-- id: handlebars.js
-- id: jquery.ba-bbq.js
-- id: moment.js
-- id: ZeroClipboard
-- id: jquery.dataTables
-- id: js-uri
-- id: js-yaml.js
-- id: jquery.form.js
-- id: marked.js

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/WEB-INF/web.xml b/brooklyn-ui/src/main/webapp/WEB-INF/web.xml
deleted file mode 100644
index 02e7fcc..0000000
--- a/brooklyn-ui/src/main/webapp/WEB-INF/web.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<!DOCTYPE web-app PUBLIC
- "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
- "http://java.sun.com/dtd/web-app_2_3.dtd" >
-<!--
-    Licensed to the Apache Software Foundation (ASF) under one
-    or more contributor license agreements.  See the NOTICE file
-    distributed with this work for additional information
-    regarding copyright ownership.  The ASF licenses this file
-    to you under the Apache License, Version 2.0 (the
-    "License"); you may not use this file except in compliance
-    with the License.  You may obtain a copy of the License at
-    
-     http://www.apache.org/licenses/LICENSE-2.0
-    
-    Unless required by applicable law or agreed to in writing,
-    software distributed under the License is distributed on an
-    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    KIND, either express or implied.  See the License for the
-    specific language governing permissions and limitations
-    under the License.
--->
-<web-app>
-  <display-name>Brooklyn</display-name>
-</web-app>

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/css/base.css
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/css/base.css b/brooklyn-ui/src/main/webapp/assets/css/base.css
deleted file mode 100644
index a80f35b..0000000
--- a/brooklyn-ui/src/main/webapp/assets/css/base.css
+++ /dev/null
@@ -1,1488 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-/* landing page */
-.logo {
-    float: left;
-}
-
-.menubar-top {
-    display: inline-block;
-    vertical-align: bottom;
-    float: right;
-    text-align: right;
-    padding-top: 30px;
-    padding-right: 60px;
-}
-
-#main-content {
-    position: relative;
-}
-
-#application-content {
-    margin-top: 40px;
-    margin-bottom: 40px;
-}
-.add-app .modal-body {
-    padding: 0;
-}
-.add-app .modal-header{
-    border-bottom: 0;
-}
-.add-app .modal-footer {
-    min-height: 20px;
-}
-
-.add-app .tab-content-scroller {
-    overflow: auto !important;
-}
-#application-content div#details {
-    margin-left: 8px !important;
-}
-#application-content .deploy,
-#application-content .preview {
-    padding: 15px;
-}
-#application-content .tab-content {
-    /* easier to scroll in the main window; but if we wanted to prevent it, we could with this */
-    /* max-height: 720px; */
-    overflow: auto;
-}
-
-#modal-container .tab-content {
-    max-height: 300px;
-    overflow: auto;
-}
-
-#application-content .template-lozenge {
-    cursor: hand; cursor: pointer;
-}
-#application-content div.template-lozenge.frame {
-    display: inline-block;
-    border: 3px solid #EEE;
-    border-radius: 4px;
-    width: 212px;
-    overflow: auto;
-    margin: 4px;
-    padding: 3px;
-    clear: right;
-    float: left;   
-}
-#application-content div.template-lozenge div.icon {
-    margin: 2px 8px 2px 2px;
-}
-#application-content div.template-lozenge div.icon img {
-    max-width: 50px;
-    max-height: 50px;
-    margin-top: 15px;
-}
-#application-content .template-lozenge.frame:hover {
-    border: 3px solid #CCC;
-}
-#application-content .template-lozenge.frame.selected {
-    border: 3px solid #793;
-}
-#application-content .template-lozenge .icon {
-    float: left;
-}
-#application-content .template-lozenge .blurb {
-    overflow-y: auto;
-    height: 80px;
-}
-#application-content .template-lozenge .title {
-    font-weight: 700;
-    font-size: 90%;
-}
-#application-content .template-lozenge .description {
-    font-size: 85%;
-}
-#preview_step {
-    margin-left: 18px;
-}
-#application-content .sensor-value,
-#application-content .config-value {
-    font-weight: 700;
-    max-width: 500px;
-    max-height: 40px;
-    white-space: nowrap;
-    overflow-x: hidden;
-    overflow-y: auto;
-}
-div#create-step-template-entries {
-    width: 472px;
-    margin-left: auto;
-    margin-right: auto;
-    padding-top: 12px;
-    padding-bottom: 36px;
-}
-div#catalog-applications-throbber {
-    margin-top: 100px;
-    text-align: center;
-}
-div#catalog-applications-empty {
-    margin-top: 100px;
-    text-align: center;
-}
-/* menu bar */
-.navbar .nav>li {
-    display: block;
-    float: left;
-    list-style: none;
-    margin: 15px 5px 0px 5px;
-}
-
-.navbar .nav>li>a:hover {
-    background-color: #A8B8B0;
-    foreground-color: #261;
-    color: #261;
-    text-decoration: none;
-    text-shadow: 0 0px 0;
-}
-
-.navbar .nav>li>a {
-    background-color: #261;
-    color: #F0F4E8;
-    padding: 5px 7px 0px 7px;
-    -webkit-border-radius: 5px 5px 0 0;
-    -moz-border-radius: 5px 5px 0 0;
-    border-radius: 5px 5px 0 0;
-    line-height: 19px;
-    text-decoration: none;
-    text-shadow: 0 0px 0;
-}
-.navbar .nav > li > a.active {
-    background-color: #492;
-}
-
-ul.dropdown-menu {
-    text-align: left;
-}
-
-.navbar .dropdown-menu li > a:hover, .dropdown-menu .active > a, .dropdown-menu .active > a:hover {
-    background-color: #58AA33; /* that seems necessary to result in the color we want, viz ~ 77AA3E; */
-}
-
-/* tabs eg catalog page */
-.nav-tabs>li,.nav-pills>li {
-    float: left;
-    margin: 0px 1px -1px 1px;
-}
-
-.nav-tabs {
-    border-bottom: 1px solid #DDD;
-    padding-left: 8px;
-    padding-right: 8px;
-    height: 35px;
-}
-
-.nav-tabs>li>a {
-    padding-top: 5px;
-    padding-bottom: 3px;
-    line-height: 18px;
-    border: 1px solid transparent;
-    -webkit-border-radius: 5px 5px 0 0;
-    -moz-border-radius: 5px 5px 0 0;
-    border-radius: 5px 5px 0 0;
-}
-
-li.text-filter input {
-    width: 10em;
-    margin-top: 3px;
-    /* taken from datatables_filter input */    
-    background-image: url("../img/magnifying-glass-right-icon.png");
-    background-size:12px 12px;
-    background-repeat: no-repeat;
-    background-position: 8px 5px;
-    font-size: 85%;
-    padding: 1px 4px 1px 24px;
-    margin-bottom: 2px;
-    -webkit-border-radius: 1em;
-    -moz-border-radius: 1em;
-    border-radius: 1em;
-}
-
-/* bootstrap overrides */
-a {
-    color: #382;
-}
-a:hover {
-    color: #65AA34;
-}
-code {
-    color: #273;
-}
-/* buttons (override bootstrap) */
-.btn-info {
-  background-color: #90C858;
-  *background-color: #609040;
-  background-image: -ms-linear-gradient(top, #90C858, #609040);
-  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#90C858), to(#609040));
-  background-image: -webkit-linear-gradient(top, #90C858, #609040);
-  background-image: -o-linear-gradient(top, #90C858, #609040);
-  background-image: -moz-linear-gradient(top, #90C858, #609040);
-  background-image: linear-gradient(top, #90C858, #609040);
-  background-repeat: repeat-x;
-  border-color: #609040 #609040 #609040;
-  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
-  filter: progid:dximagetransform.microsoft.gradient(startColorstr='#90C858', endColorstr='#609040', GradientType=0);
-  filter: progid:dximagetransform.microsoft.gradient(enabled=false);
-}
-
-.btn-info:hover,
-.btn-info:active,
-.btn-info.active,
-.btn-info.disabled,
-.btn-info[disabled] {
-  background-color: #609040;
-  *background-color: #508030;
-}
-
-.btn-info:active,
-.btn-info.active {
-  background-color: #508030 \9;
-}
-
-/* unchanged from bootstrap
-.btn-inverse {
-  background-color: #414141;
-  *background-color: #222222;
-  background-image: -ms-linear-gradient(top, #555555, #222222);
-  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#555555), to(#222222));
-  background-image: -webkit-linear-gradient(top, #555555, #222222);
-  background-image: -o-linear-gradient(top, #555555, #222222);
-  background-image: -moz-linear-gradient(top, #555555, #222222);
-  background-image: linear-gradient(top, #555555, #222222);
-  background-repeat: repeat-x;
-  border-color: #222222 #222222 #000000;
-  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
-  filter: progid:dximagetransform.microsoft.gradient(startColorstr='#555555', endColorstr='#222222', GradientType=0);
-  filter: progid:dximagetransform.microsoft.gradient(enabled=false);
-}
-
-.btn-inverse:hover,
-.btn-inverse:active,
-.btn-inverse.active,
-.btn-inverse.disabled,
-.btn-inverse[disabled] {
-  background-color: #222222;
-  *background-color: #151515;
-}
-
-.btn-inverse:active,
-.btn-inverse.active {
-  background-color: #080808 \9;
-}
-*/
-
-textarea:focus,input[type="text"]:focus,input[type="password"]:focus,
-input[type="datetime"]:focus,input[type="datetime-local"]:focus,input[type="date"]:focus,
-input[type="month"]:focus,input[type="time"]:focus,input[type="week"]:focus,input[type="number"]:focus,
-input[type="email"]:focus,input[type="url"]:focus,input[type="search"]:focus,input[type="tel"]:focus,
-input[type="color"]:focus,.uneditable-input:focus {
-    border-color: rgba(120, 180, 70, 0.8);
-    outline: 0;
-    outline: thin dotted 9;
-    -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px
-        rgba(120, 180, 70, 0.6);
-    -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px
-        rgba(120, 180, 70, 0.6);
-    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px
-        rgba(120, 180, 70, 0.6);
-}
-
-/* home page squares */
-
-/* HOME BODY */
-#application-content {
-    background-color: #e8e8e8 !important;
-    padding-top: 30px !important;
-}
-
-.home-first-row {
-    padding: 0px;
-}
-
-.home-summaries-row {
-    text-align: center;
-    margin: 0px 0px 30px 0px;
-}
-
-.roundedSummary {
-    float: left;
-    border: 1px solid #d4d4d4;
-    -webkit-border-radius: 15px;
-    -moz-border-radius: 15px;
-    border-radius: 15px;
-    background-color: #f7f6e8;
-    margin: 10px 15px 0px 0px;
-    padding: 20px 20px;
-    width: 264px;
-    height: 160px;
-    line-height: 1.2;
-    font-size: 140%;
-    display: inline-block;
-    text-align: left;
-    background: #f9f9f9 url(../images/roundedSummary-background.png) top
-        repeat-x !important;
-}
-
-.roundedSummary:last-child {
-    margin-right: 0px;
-}
-
-.roundedSummary:before { /* makes the summary vertically centered */
-    content: '';
-    display: inline-block;
-    height: 100%;
-    vertical-align: middle;
-    margin-right: 0px !important;
-    /* 
-    margin-right: -0.25em; 
-    adjusts for horiz spacing */
-}
-
-.roundedSummaryText {
-    display: inline-block;
-    vertical-align: middle;
-}
-
-.addApplication {
-    border: 1px solid #a1cb8c !important;
-    color: #505050 !important;
-    background: url(../images/addApplication-plus.png) no-repeat !important;
-    padding: 10px 0px 0px 74px !important;
-    width: 298px !important;
-    height: 201px !important;
-    margin-right: 0;
-}
-
-.addApplication:hover {
-    border: 1px solid #58a82e !important;
-    color: #58a82e !important;
-    background: url(../images/addApplication-plus-hover.png) no-repeat
-        !important;
-}
-
-.home-summaries-row {
-    padding: 0px 0px 0px 0px !important;
-    margin: 0px !important;
-}
-
-.big {
-    font-size: 180%;
-}
-
-.home-second-row {
-    background-color: #dddddd !important;
-    padding: 24px 0px 30px 0px !important;
-    border-top: 1px solid #efefef;
-    margin: 30px 0px 0px 0px;
-}
-
-.home-widgets-row {
-    text-align: center;
-}
-
-.map-container {
-    -webkit-border-radius: 13px 13px 13px 13px;
-    -moz-border-radius: 13px 13px 13px 13px;
-    border-radius: 13px 13px 13px 13px;
-    background-color: #f7f7f7;
-    border: 1px solid #d4d4d4;
-    padding: 13px !important;
-    width: 440px;
-    margin: 10px 0px 0px 13px !important;
-    display: inline-block;
-    text-align: left;
-    vertical-align: top;
-    margin: 0px 20px;
-}
-.circles-map {
-    height: 350px;
-    border : 2px solid #909490;
-    -webkit-border-radius: 2px 2px 2px 2px;
-    -moz-border-radius: 2px 2px 2px 2px;
-    border-radius: 2px 2px 2px 2px;
-}
-.circles-map-message:before { /* makes the message vertically centered */
-    content: '';
-    display: inline-block;
-    height: 100%;
-    vertical-align: middle;
-    margin-right: -0.25em; /* adjusts for horiz spacing */
-}
-.circles-map-message {
-    display: inline-block;
-    width: 100%;
-    height: 100%;
-    color: #888;
-    text-align: center;
-    vertical-align: middle;
-}
-#applications-table-body a {
-    color: inherit;
-}
-.apps-summary-container {
-    width: 440px;
-    display: inline-block;
-    text-align: left;
-    vertical-align: top;
-    display: inline-block;
-    margin: 10px -6px 0px 24px;
-    text-align: left;
-    vertical-align: top;
-}
-#new-application-resource {
-    text-align: right;
-}
-
-#reload-brooklyn-properties-resource {
-	text-align: right;
-}
-
-#clear-ha-node-records-resource {
-    text-align: right;
-}
-
-/* general pages */
-.sidebar_at_right {
-    border-right: 4px solid #BBB;
-}
-
-.sidebar_at_left {
-    border-left: 4px solid #BBB;
-    margin-left: -4px !important;
-    padding-left: 24px;
-}
-
-.nav-tabs {
-    margin-bottom: 0px;
-}
-.tab-content-scroller {
-    height: auto;
-    overflow: auto;
-}
-.tab-content {
-    padding: 12px 18px 18px 18px;
-    border-right: 1px solid #DDD;
-    border-left: 1px solid #DDD;
-    min-height: 300px;
-}
-
-.navbar_top {
-    background-color: #D0D8D0;
-    padding: 8px 12px 12px 12px;
-    -webkit-border-radius: 4px 4px 0 0;
-    -moz-border-radius: 4px 4px 0 0;
-    border-radius: 4px 4px 0 0;
-}
-.navbar_main_wrapper {
-    background-color: #F0F4F0;
-    -webkit-border-radius: 0 0 4px 4px;
-    -moz-border-radius: 0 0 4px 4px;
-    border-radius: 0 0 4px 4px;
-}
-.navbar_main {
-    overflow-x: auto;
-    margin: 0;
-    white-space: nowrap;
-}
-
-/* traditional tree-style (clickable + icons) tree-list */
-#tree-list {
-}
-ol.tree {
-    padding: 0;
-}
-#tree-list li input + ol {
-    background: url(../img/toggle-small-expand.png) 40px 5px no-repeat;
-    margin: -1.963em 0 0 -40px; !important;
-    padding: 1.563em 0 0 62px; !important;
-}
-#tree-list li input:checked + ol {
-    background: url(../img/toggle-small.png) 40px 5px no-repeat;
-}
-#tree-list li input + ol > li {
-    padding-left: 1px;
-/*    margin: 0; */
-}
-#tree-list span.leaf {
-    margin-left: 17px !important;
-}
-#tree-list li.application {
-    margin-top: 6px !important;
-}
-#tree-list li input + ol {
-    height: auto;
-}
-.navbar_main_wrapper.treelist {
-    padding: 12px 6px 4px 6px;
-}
-.navbar_main.treelist {
-    padding: 0px 8px 6px 2px;
-}
-
-.label-message {
-    background-color: #DDD;
-    -webkit-border-radius: 2px 2px 2px 2px;
-    -moz-border-radius: 2px 2px 2px 2px;
-    border-radius: 2px 2px 2px 2px;
-    padding: 4px 0px 4px 0px;
-    margin-bottom: 4px;
-    font-weight: bold;
-} 
-.label-important {
-    display: inline;
-    padding: 4px;
-    color: #F0F0F0;
-    font-weight: bold;
-    -webkit-border-radius: 2px 2px 2px 2px;
-    -moz-border-radius: 2px 2px 2px 2px;
-    border-radius: 2px 2px 2px 2px;
-}
-.label-important.full-width {
-    display: block;
-    text-align: center;
-}
-
-/** apps / entity explorer page */
-.apps-tree-toolbar {
-    text-align: right;
-}
-.entity_tree_node, .entity_tree_node a {
-    color: #182018;
-}
-.handy {
-    cursor: hand; cursor: pointer;
-}
-.entity_tree_node:hover {
-    cursor: hand; cursor: pointer;
-}
-.entity_tree_node a:hover {
-    color: #54932b !important;
-    text-decoration: none;
-}
-.entity_tree_node_wrapper.active .entity_tree_node {
-    font-weight: bold;
-}
-.entity_tree_node_wrapper .indirection-icon {
-    opacity: 0.7;
-    margin-left: -5px;
-}
-.tree-box.indirect > .entity_tree_node_wrapper a {
-    font-style: italic !important;
-    color: #666;
-}
-
-#tree label {
-/* remove the folder, and align with + - icons */
-background: none;
-padding-left: 16px;
-line-height: 18px;
-}
-.cssninja ol.tree {
-    padding: 0;
-    width: auto;
-}
-
-/* new lozenge-style tree-list */
-.navbar_main_wrapper .treeloz {
-    padding: 12px 0px 20px 0px;
-}
-.navbar_main .treeloz {
-    padding: 0px 0px 0px 0px;
-}
-.lozenge-app-tree-wrapper {
-    min-width: 100%;
-    min-height: 240px;
-    padding-bottom: 60px; /* for popup menu */
-    margin-top: -2px;
-    position: relative; 
-    float: left;
-}
-.entity_tree_node_wrapper {
-    position: relative;
-}
-.tree-box {
-    border: 1px solid #AAA;
-    border-right: 0px;
-    margin-top: 3px;
-    padding-top: 2px;
-    background-color: #EAECEA;
-}
-.tree-box.outer {
-    margin-left: 12px;
-    margin-right: 0px;
-    margin-bottom: 14px;
-    -webkit-border-radius: 4px 0 0 4px !important;
-    -moz-border-radius: 4px 0 0 4px !important;
-    border-radius: 4px 0 0 4px  !important;
-    padding-left: 4px;
-    padding-bottom: 4px;
-}
-.tree-box.inner {
-    margin-bottom: 2px;
-    border: 1px solid #BBB;
-    border-right: 0px;
-    -webkit-border-radius: 3px 0 0 3px !important;
-    -moz-border-radius: 3px 0 0 3px !important;
-    border-radius: 3px 0 0 3px  !important;
-    padding-left: 6px;
-    padding-bottom: 2px;
-    margin-left: 3px;
-}
-.tree-box.inner.depth-first {
-    margin-left: 8px;
-}
-.tree-box.inner.depth-odd {
-    background-color: #D8DAD8;
-}
-.tree-box.inner.depth-even {
-    background-color: #EAECEA;
-}
-.tree-node {
-    position: relative;
-    padding-top: 2px;
-    padding-bottom: 1px;
-    padding-right: 8px;
-}
-.light-popup {
-    display: none;
-    position: relative;
-    top: 12px;
-    float: left;
-    z-index: 1;
-}
-.toggler-icon .light-popup {
-    padding-top: 4px;
-}
-.light-popup-body {
-    padding: 3px 0px;
-    background-color: #606060;
-    color: #CDC;
-    font-weight: 300;
-    font-size: 85%;
-    line-height: 14px;
-    border: 1px dotted #CDC;
-    -webkit-border-radius: 2px 2px 2px 2px !important;
-    -moz-border-radius: 2px 2px 2px 2px !important;
-    border-radius: 2px 2px 2px 2px !important;
-}
-.light-popup-menu-item {
-    color: #D0D4D0;
-}
-.light-popup-menu-item.tr-default {
-    color: #E0E4E0;
-}
-.light-popup-menu-item {
-    padding: 1px 8px 1px 6px;
-}
-.light-popup-menu-item:hover {
-    background-color: #58AA33;
-    color: #000;
-}
-.light-popup-menu-item.zeroclipboard-is-hover {
-    background-color: #58AA33;
-    color: #000;
-}
-
-.app-summary .inforow > div { display: inline-block; }
-.app-summary .inforow .info-name-value { white-space: nowrap; }
-.app-summary .inforow .info-name-value > div { display: inline-block; }
-.app-summary .inforow .info-name-value .name { font-weight: 700; width: 120px; padding-right: 12px; }
-.app-summary .additional-info-on-problem { color: #D01; }
-.app-summary .additional-info-on-problem a { color: #563; }
-a.open-tab { cursor: hand; cursor: pointer; }
-
-table.dataTable tbody td.row-expansion {
-    background: #D8E4D0;
-}
-table.dataTable.activity-table tbody td.row-expansion {
-    background: #FFFFFF;
-}
-
-#activities-table-group div.for-activity-textarea {
-    /* correct for textarea width oddity */
-    margin-right: 10px;
-    margin-top: 6px;
-}
-#activities-table-group div.for-activity-textarea textarea {
-    margin-bottom: 0px;
-    border-color: #BBB;
-}
-#activities-root .toolbar-row i {
-    background-image: url("../img/glyphicons-halflings.png");
-    width: 18px;
-}
-#activities-root .toolbar-row i.active {
-    background-image: url("../img/glyphicons-halflings-bright-green.png");
-}
-#activities-root .toolbar-row {
-    padding-top: 1px;
-}
-#activities-root .toolbar-row i:hover,
-#activities-root .toolbar-row i.active:hover {
-    background-image: url("../img/glyphicons-halflings-dark-green.png");
-}
-table.dataTable td.row-expansion {
-    padding-top: 0px;
-}
-.opened-row-details {
-    display: block;
-    font-size: 90%;
-    
-    border-top: dotted whiteSmoke 1px;
-    margin-top: 0px;
-    padding-top: 2px;
-    
-    margin-left: -6px;
-    margin-right: -6px;
-    padding-left: 6px;
-    padding-right: 6px;
-    
-    margin-bottom: 4px;
-    padding-bottom: 6px;
-    border-right: dotted gray 1px;
-    border-bottom: dotted gray 1px;
-    border-left: dotted gray 1px;
-    border-bottom-left-radius: 8px;
-    border-bottom-right-radius: 8px;
-    
-    background: #D8E0D4;
-}
-
-/* effector modal dialog */
-#params td {
-    vertical-align: middle;
-}
-#params input {
-    margin-bottom: 0px;
-}
-
-table.dataTable tr.odd td.sorting_1 {
-background-color: #F9F9F9;
-}
-table.dataTable tr.even td.sorting_1 {
-background-color: #FFFFFF;
-}
-table.dataTable tr.odd {
-background-color: #F9F9F9;
-}
-table.dataTable tr.even {
-background-color: #FFFFFF;
-}
-table.dataTable tbody tr.selected,
-table.dataTable tr.odd.selected td.sorting_1,
-table.dataTable tr.even.selected td.sorting_1 {
-    background: #B8C8B0;
-}
-table.nonDatatables tr:hover,
-table.nonDatatables tr.odd:hover,
-table.nonDatatables tr.even:hover,
-table.nonDatatables tr.zeroclipboard-is-hover,
-table.nonDatatables tr.even.zeroclipboard-is-hover,
-table.nonDatatables tr.odd.zeroclipboard-is-hover,
-table.dataTable tr:hover:not(.selected),
-table.dataTable tr.odd:hover:not(.selected),
-table.dataTable tr.even:hover:not(.selected),
-table.dataTable tr.zeroclipboard-is-hover:not(.selected),
-table.dataTable tr.odd.zeroclipboard-is-hover:not(.selected),
-table.dataTable tr.even.zeroclipboard-is-hover:not(.selected),
-table.nonDatatables tr:hover td,
-table.nonDatatables tr.odd:hover td,
-table.nonDatatables tr.even:hover td,
-table.dataTable tr:hover:not(.selected) td:not(.row-expansion),
-table.dataTable tr:hover:not(.selected) td.sorting_1:not(.row-expansion),
-table.dataTable tr.odd:hover:not(.selected) td:not(.row-expansion),
-table.dataTable tr.even:hover:not(.selected) td:not(.row-expansion) {
-    background-color: #E0E4E0;
-}
-table.dataTable tbody tr.selected:hover,
-table.dataTable tr.odd.selected td.sorting_1:hover,
-table.dataTable tr.even.selected td.sorting_1:hover {
-    background: #98B890;
-}
-
-table.dataTable.activity-table tbody tr.activity-row,
-table.nonDatatables#policies-table tbody tr.policy-row {
-    cursor: hand; cursor: pointer;
-}
-
-table.dataTable thead th {
-text-align: left;
-background-color: #E0E4E0;
-line-height: 24px;
-font-size: 110%;
-}
-table.dataTable {
-margin: 0;
-border-width: 2px 0px 2px 0px;
-border-style: solid;
-border-color: black;
-background-color: #fff;
-overflow: scroll;
-/* background-color: #fff;
- border-top-width: 1px; */
-}
-.bottom {
-    vertical-align: bottom;
-}
-.smallpadside {
-    margin-left: 0.25em;
-    margin-right: 0.25em;
-}
-.table-scroll-wrapper {
-    width: 100%;
-    overflow: auto;
-    background-color: #ececec;
-    border-style: solid;
-    border-color: #e8e8e8;
-    border-width: 1px 1px 1px 1px;
-    border-bottom-left-radius: 7px;
-    border-bottom-right-radius: 7px;
-}
-.table-scroll-wrapper .dataTables_filter {
-    float: left;
-    padding-left: 6px;
-}
-.table-scroll-wrapper .dataTables_filter label {
-    margin-bottom: 5px;
-    margin-top: 4px;
-}
-.dataTables_wrapper .brook-db-top-toolbar {
-    font-size: 85%;
-    float: right;
-    padding-right: 6px;
-    padding-top: 7px;
-}
-.dataTables_wrapper .brook-db-bot-toolbar {
-    font-size: 85%;
-    float: right;
-    padding-right: 6px;
-    padding-left: 5px;
-    padding-top: 5px;
-}
-
-.dataTables_info {
-    padding-top: 5px;
-    padding-left: 8px;
-    padding-bottom: 8px;
-    font-size: 85%;
-    width: auto;
-    align: center;
-    clear: none;
-}
-.dataTables_paginate {
-    font-size: 85%;
-    float: right;
-    margin-top: 6px;
-    margin-bottom: 3px;
-    padding-top: 1px;
-    padding-right: 4px;
-    height: 18px;
-    line-height: 18px;
-}
-.paging_full_numbers a.paginate_active {
-     background-color: #A8B8B0;
-}
-.dataTables_length {
-    float: left;
-    padding-left: 1em;
-    padding-top: 5px;
-}
-.dataTables_length label {
-    font-size: 85%;
-}
-.dataTables_length select {
-    height: auto;
-    font-size: 85%;
-    margin-bottom: 0px;
-    width: 45px;
-}
-.dataTables_paginate.paging_full_numbers a.paginate_button, 
-.dataTables_paginate.paging_full_numbers a.paginate_active {
--webkit-border-radius: 0px;
--moz-border-radius: 0px;
-border-radius: 0px;
-padding: 2px 5px;
-margin: 0;
-}
-.dataTables_filter input {
-    background-image: url("../img/magnifying-glass-right-icon.png");
-    /* url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJ5JREFUeNpi+P//PwMQMANxERCfAeI/UBrEZwbJQ9WAFR0A4u1AbAnEbFB6O1ScGaawGoi3wHQiYyBYDZKHKbwHxLo4FOqC5GEKf4Ksw6EQ5IyfIDYTkPEUiNUZsAOQ+F9GRkYJEKcFiDficSOIcRjE4QTiY0C8DuRbqAJLKP8/FP9kQArHUiA+jySJjA8w4LAS5KZd0MAHhaccQIABALsMiBZy4YLtAAAAAElFTkSuQmCC); */
-    background-size:12px 12px;
-    background-repeat: no-repeat;
-    background-position: 8px 5px;
-    width: 12em;
-    font-size: 85%;
-    padding: 1px 4px 1px 24px;
-    margin-bottom: 1px;
-    border-color: #888C88;
-    /*
-    -webkit-border-radius: 1em;
-    -moz-border-radius: 1em;
-    border-radius: 1em;
-    */
-    -webkit-border-radius: 10px;
-    -moz-border-radius: 10px;
-    border-radius: 10px;
-}
-/* nonDatatables environments want to look a bit like our datatables environment */
-table.nonDatatables {
-    border-bottom: 1px solid gray;
-}
-table.nonDatatables thead {
-    border-bottom: 1px solid black;
-}
-table.nonDatatables thead th {
-    background: #ffffff;
-    padding: 3px 18px 3px 5px;
-}
-table.table.nonDatatables tbody > tr:first-child > td {
-    /* need both bottom of head, and top of body, to support empty table and override non-empty row top border */
-    border-top: 1px black solid;
-}
-table.table.nonDatatables tbody tr.selected,
-table.table.nonDatatables tbody tr.selected td {
-    background: #AC8;
-}
-/* we keep the thin gray line between rows for manual tables,
-   subtle difference but seems nice */
-div.for-empty-table {
-    width: 100%;
-    float: left;
-    background-color: #F9F9F9;
-    font-style: italic;
-    padding: 8px 0px;
-    text-align: center;
-    margin-top: -18px;
-    border-bottom: 1px solid gray;
-}
-
-/* add entity modal */
-.editable-entity-group {
-    margin-bottom: 2px;
-    border: 1px solid #E5E5E5;
-    -webkit-border-radius: 4px;
-    -moz-border-radius: 4px;
-    border-radius: 4px;
-}
-.editable-entity-heading {
-    padding: 2px 6px 2px 6px;
-    border-bottom: 1px solid #E5E5E5;
-    margin-bottom: -1px;
-    overflow: hidden;
-    -webkit-border-radius: 4px;
-    -moz-border-radius: 4px;
-    border-radius: 4px;
-    background-color: #F9F9F9;
-    line-height: 30px;
-}
-.editable-entity-heading:hover {
-    background-color: #F0F4F0;
-}
-.editable-entity-body {
-    border-top: 1px solid #E5E5E5;
-    margin-top: -1px;
-    padding: 7px 6px 2px 6px;
-    overflow: hidden;
-    -webkit-border-radius: 4px;
-    -moz-border-radius: 4px;
-    border-radius: 4px;
-}
-
-#app-locations select {
-    min-height: 22px;
-}
-#app-locations #selector-container {
-    margin-bottom: 4px;
-}
-div.application-name-label {
-    margin-bottom: 4px;
-}
-table.config-table {
-    margin-bottom: 6px;
-    margin-left: 2px;
-}
-.app-add-wizard-config-entry input {
-    margin: 3px 0 2px 0;    
-    height: 12px;
-    vertical-align: middle;
-}
-.app-add-wizard-config-entry input {
-    height: 14px;
-}
-tr.app-add-wizard-config-entry:nth-child(odd) {
-    background-color: #f8f8f8;
-}
-tr.app-add-wizard-config-entry:nth-child(even) {
-}
-tr.app-add-wizard-config-entry {
-    height: 20px;
-}
-.app-add-wizard-config-entry {
-    margin-bottom: 9px;
-    margin-top: 2px;
-}
-.app-add-wizard-config-entry button {
-    margin-left: 8px;
-}
-.app-add-wizard-create-entity-label-newline {
-    padding-left: 2px;
-    padding-bottom: 3px;    
-}
-.app-add-wizard-create-entity-label {
-    width: 4em;
-    float: left;
-    padding-top: 3px;
-}
-.app-add-wizard-create-entity-input {
-    width: 300px;
-}
-#add-app-entity {
-    float: right;
-}
-/* help page */
-#help-page p, #help-page ul {
-    margin-top: 8px;
-}
-.help-logo-right {
-    padding-left: 1.5em;
-    padding-top: 1.5em;
-    float: right;
-}
-.help-logo-right img {
-    border: 3px solid #6C6C6C;
-    border-radius: 2px;
-}
-.control-group {
-    margin-top: 6px;
-    margin-bottom: 9px;
-}
-.control-group .deploy-label {
-    font-weight: 700;
-}
-.deploy .control-group {
-    margin-bottom: 18px;
-}
-.deploy input#application-name {
-    /** margin supplied by control group */
-    margin-bottom: 0px;
-}
-
-#application-explorer div#summary textarea {
-    width: 100%;
-    cursor: auto;
-    margin-bottom: 2px;
-}
-
-/* catalog */
-.accordion-head {
-    -webkit-border-radius: 5px;
-    -moz-border-radius: 5px;
-    border-radius: 5px;
-    padding: 4px 10px 4px 8px;
-    font-weight: bold;
-    background-color: #F4F6F4;
-}
-.accordion-head.active {
-    background-color: #F8FAF8;
-}
-.accordion-body {
-    border-top: 1px dashed lightgray;
-    padding: 8px 8px 12px 8px;
-    overflow: auto;
-    max-height: 400px;
-    background-color: white;
-    border-bottom-left-radius: 5px;
-    border-bottom-right-radius: 5px;
-}
-.catalog-details .accordion-body {
-    padding: 0;
-}
-.accordion-head:hover {
-    background-color: #E0E4E0;
-    cursor: hand; cursor: pointer;
-}
-.catalog-accordion-wrapper {
-    margin-bottom: 6px;
-    background-color: #F0F0F0;
-    border-radius: 5px;
-}
-.catalog-accordion-wrapper .accordion-nav-row {
-    white-space: pre;
-    word-wrap: normal;
-}
-.accordion-item {
-    -webkit-border-radius: 5px;
-    -moz-border-radius: 5px;
-    border-radius: 5px;
-    margin-top: -1px;
-    border: 1px solid lightgray;
-}
-.accordion-nav-row:hover {
-    text-decoration: underline;
-    cursor: hand; cursor: pointer;
-}
-.accordion-nav-row.active {
-    font-weight: bold;
-}
-.accordion-nav-child {
-    padding-left: 15px;
-    color: lightgray;
-}
-.accordion-nav-child.active {
-    color: #505050;
-}
-.catalog-details {
-    padding-left: 16px;
-    padding-right: 25px;
-    padding-top: 8px;
-    padding-bottom: 8px;
-}
-.catalog-details h3 {
-    margin-bottom: 8px;
-}
-.catalog-details textarea {
-    width: 100%;
-    cursor: auto;
-}
-.catalog-details#details-empty {
-    padding-top: 60px;
-    padding-bottom: 180px;
-    text-align: center;
-}
-.catalog-save-error {
-    background-color: #f2dede;
-    /* margin matches bootstrap input margin-bottom. */
-    margin: 9px 0 0 0;
-    padding: 7px;
-    border-radius: 3px;
-}
-.catalog-error-message {
-    white-space: pre-wrap;
-}
-
-.float-right {
-    float: right;
-}
-
-/* swagger */
-
-.swagger-ui-container{
-    margin-bottom: 3em;
-}
-
-.swagger-ui-wrap {
-    max-width: 960px;
-    margin-left: auto;
-    margin-right: auto;
-    margin-bottom: 6em;
-}
-
-.icon-btn {
-    cursor: pointer;
-}
-
-#message-bar {
-    min-height: 30px;
-    text-align: center;
-    padding-top: 10px;
-}
-
-.message-success {
-    color: #89BF04;
-}
-
-.message-fail {
-    color: #cc0000;
-}
-
-.code-textarea {
-    width: 100%;
-    height: 8em;
-    margin-right: 4px;
-    font-family: Consolas, Lucida Console, Monaco, monospace;
-    font-size: 8.5pt;
-    line-height: 11pt;
-    white-space: pre;
-    word-wrap: normal;
-    overflow-x: scroll;
-    overflow-y: scroll;
-}
-
-/** groovy script */
-#groovy-ui-container .hide {
-    display: none !important;
-}
-#groovy-ui-container .throbber {
-    padding-top: 8px;
-}
-#groovy-ui-container .input textarea {
-    height: 16em;
-}
-#groovy-ui-container .toggler-region {
-    margin-top: 0.5em;
-    margin-bottom: 1em;
-}
-#groovy-ui-container .groovy-scripting-text {
-    margin-top: 0.5em;
-}
-#groovy-ui-container div.submit {
-   float: right;
-}
-
-#groovy-ui-container .input {
-    width: 48%;
-}
-#groovy-ui-container div.submit {
-    text-align: right;
-}
-
-#groovy-ui-container .output {
-    width: 48%;
-    float: right;
-}
-.toggler-header {
-    cursor: hand; cursor: pointer;
-    margin-bottom: 3px;
-}
-.toggler-icon {
-    float: right;
-}
-.user-hidden .toggler-icon {
-}
-
-/** trick for making textareas with width 100% line up (silly width 100% excludes padding) */
-div.for-textarea {
-    padding-left: 0.8em;
-    padding-right: 0.4em;
-}
-div.for-textarea > textarea {
-    padding-left: 0.3em;
-    padding-right: 0.3em;
-    margin-left: -0.6em;
-}
-#groovy-ui-container p {
-    margin-top: 4px;
-}
-#groovy-ui-container a {
-    color: inherit;
-}
-#groovy-ui-container a:hover {
-    text-decoration: underline;
-    cursor: hand; cursor: pointer;
-}
-
-/** input type="file" should be display:none with hand-rolled nicer looking widgets used instead
-    (the native ones can't be much modified, and are notoriously ugly; but line-height 0 at least makes them line up) */
-input[type="file"] {
-    line-height: 0;
-    width: 300px;
-}
-
-input.error {
-    border-color: #b94a48;
-}
-
-#policy-config-table {
-    table-layout: fixed;
-}
-
-#policy-config-table td.policy-config-name {
-    overflow: hidden;
-    text-overflow: ellipsis;
-}
-
-#policy-config-table td.policy-config-value {
-    overflow-wrap: break-word;
-    word-wrap: break-word;
-}
-
-#policy-config,
-.has-no-policies {
-    margin-bottom: 9px;
-}
-
-.padded-div {
-    padding: 0.5em 1.2em;
-}
-
-/* this is used in activities, for when we slide in a panel e.g. for sub-table */
-.slide-panel-group {
-    width: 569px;
-}
-.slide-panel {
-    position: relative;
-    width: 569px;
-    margin-right: -569px;
-    float: left;
-}
-.subpanel-header-row {
-    color: black;
-    background-color: #B0B8B0;
-    padding-top: 12px;
-    padding-bottom: 12px;
-    margin-bottom: 24px;
-    padding-left: 12px;
-    vertical-align: top;
-    font-weight: 700;
-    font-size: 120%;
-}
-
-.toggler-header {
-    background-color: #D8DCD8;
-    padding: 2px 6px 2px 6px;
-}
-.activity-detail-panel .subpanel-header-row {
-    margin-bottom: 12px;
-}
-.activity-detail-panel .toggler-region {
-    margin-bottom: 12px;
-}
-.activity-detail-panel .toggler-region .activity-details-section {
-    margin: 4px 6px 0px 6px;
-}
-.activity-detail-panel .activity-details-section.activity-description, 
-.activity-detail-panel .activity-details-section.activity-status {
-    margin-bottom: 12px;
-}
-.activity-detail-panel .activity-label {
-    display: inline-block;
-    width: 100px;
-}
-.activity-detail-panel .toggler-region.tasks-submitted .table-scroll-wrapper,
-.activity-detail-panel .toggler-region.tasks-children .table-scroll-wrapper {
-    margin-bottom: 18px;
-}
-
-.activity-detail-results .result-literal {
-    font-style: italic;
-}
-.activity-detail-results div.result-literal {
-    margin-top: 12px;
-}
-.activity-detail-results div.result-literal br {
-    line-height: 24px;
-}
-
-.activity-tag-giftlabel {
-    background-color: #E0E4E0;
-    padding: 2px 4px 2px 4px;
-    margin-bottom: 4px;
-    margin-right: 5px;
-    -webkit-border-radius: 3px 3px 3px 3px !important;
-    -moz-border-radius: 3px 3px 3px 3px !important;
-    border-radius: 3px 3px 3px 3px !important;
-    display: inline-block;
-    white-space: nowrap;
-    overflow: hidden;
-    text-overflow: ellipsis;
-    -o-text-overflow: ellipsis;
-    max-width: 250px;
-}
-.activity-tag-giftlabel:hover {
-    max-width: 100%;
-    white-space: normal;
-}
-
-/* hover menu at left, as used in sensors view */
-.floatGroup .floatLeft {
-	display:none;
-	width: 18px;
-	margin-left: -18px;
-	margin-top: -16px;
-	position: absolute;
-	overflow: visible;
-}
-.floatGroup .floatDown {
-	display:none;
- 	position: absolute;
- 	margin-top: -2px;
-	overflow: visible;
-}
-.floatGroup .floatDown .light-popup {
-	display: block;
-    position: absolute;
-    top: auto;
-    z-index: 1;
-}
-
-.ha-standby-overlay {
-    position: absolute;
-    top: 8px;
-    bottom: 0;
-    left: 0;
-    right: 0;
-}
-
-/* Setting opacity in ha-standby-overlay would also apply it to all of
-the element's children, who probably want to control their opacity separately. */
-.overlay-with-opacity {
-    opacity: 0.9;
-    background-color: white;
-}
-
-.overlay-content {
-    position: absolute;
-    top: 100px;
-    left: 50%;
-    width: 400px;
-    /* margin-left = width / 2 */
-    margin: 0 0 0 -200px;
-    padding: 20px;
-    background-color: #ff938c;
-    border: 7px solid #2d2d2d;
-    border-radius: 10px;
-    color: black;
-}
-
-.capitalized {
-    text-transform: capitalize;
-}
-
-.config-key-input-pair {
-    /* matches Bootstrap */
-    margin-bottom: 9px;
-}
-
-textarea.param-value {
-    height: 18px;
-    overflow: auto;
-}
-
-#catalog-details-accordion {
-    margin-top: 12px;
-}
-
-/* For secret things */
-.secret-info span.value {
-    display: none;
-}
-.secret-info.secret-revealed span.value {
-    display: inherit;
-}
-.secret-info.secret-revealed span.secret-indicator {
-    display: none;
-}
-
-.secret-indicator {
-    /* blur */
-    color: transparent;
-    text-shadow: 0 0 5px rgba(0,0,0,0.5);
-}


[04/51] [abbrv] [partial] brooklyn-ui git commit: move subdir from incubator up a level as it is promoted to its own repo (first non-incubator commit!)

Posted by he...@apache.org.
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/js/router.js
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/js/router.js b/src/main/webapp/assets/js/router.js
new file mode 100644
index 0000000..d80d35c
--- /dev/null
+++ b/src/main/webapp/assets/js/router.js
@@ -0,0 +1,240 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+define([
+    "brooklyn", "underscore", "jquery", "backbone",
+    "model/application", "model/app-tree", "model/location", 
+    "model/server-extended-status",
+    "view/home", "view/application-explorer", "view/catalog", "view/script-groovy",
+    "text!tpl/help/page.html","text!tpl/labs/page.html", "text!tpl/home/server-caution.html"
+], function (Brooklyn, _, $, Backbone,
+        Application, AppTree, Location, 
+        serverStatus,
+        HomeView, ExplorerView, CatalogView, ScriptGroovyView,
+        HelpHtml, LabsHtml, ServerCautionHtml) {
+
+    var ServerCautionOverlay = Backbone.View.extend({
+        template: _.template(ServerCautionHtml),
+        scheduledRedirect: false,
+        initialize: function() {
+            var that = this;
+            this.carryOnRegardless = false;
+            _.bindAll(this);
+            serverStatus.addCallback(this.renderAndAddCallback);
+        },
+        renderAndAddCallback: function() {
+            this.renderOnUpdate();
+            serverStatus.addCallback(this.renderAndAddCallback);
+        },
+        renderOnUpdate: function() {
+            var that = this;
+            if (this.carryOnRegardless) return this.renderEmpty();
+            
+            var state = {
+                    loaded: serverStatus.loaded,
+                    up: serverStatus.isUp(),
+                    shuttingDown: serverStatus.isShuttingDown(),
+                    healthy: serverStatus.isHealthy(),
+                    master: serverStatus.isMaster(),
+                    masterUri: serverStatus.getMasterUri(),
+                };
+            
+            if (state.loaded && state.up && state.healthy && state.master) {
+                // this div shows nothing in normal operation
+                return this.renderEmpty();
+            }
+            
+            this.warningActive = true;
+            this.$el.html(this.template(state));
+            $('#application-content').fadeTo(500,0.1);
+            this.$el.fadeTo(200,1);
+            
+            $("#dismiss-standby-warning", this.$el).click(function() {
+                that.carryOnRegardless = true;
+                if (that.redirectPending) {
+                    log("Cancelling redirect, using this non-master instance");
+                    clearTimeout(that.redirectPending);
+                    that.redirectPending = null;
+                }       
+                that.renderOnUpdate();
+            });
+            
+            if (!state.master && state.masterUri) {
+                if (!this.scheduledRedirect && !this.redirectPending) {
+                    log("Not master; will redirect shortly to: "+state.masterUri);
+                    var destination = state.masterUri + "#" + Backbone.history.fragment;
+                    var time = 10;
+                    this.scheduledRedirect = true;
+                    log("Redirecting to " + destination + " in " + time + " seconds");
+                    this.redirectPending = setTimeout(function () {
+                        // re-check, in case the server's status changed in the wait
+                        if (!serverStatus.isMaster()) {
+                            if (that.redirectPending) {
+                                window.location.href = destination;
+                            } else {
+                                log("Cancelled redirect, using this non-master instance");
+                            }
+                        } else {
+                            log("Cancelled redirect, this instance is now master");
+                        }
+                    }, time * 1000);
+                }
+            }
+            return this;
+        },
+        renderEmpty: function() {
+            var that = this;
+            this.warningActive = false;
+            this.$el.fadeTo(200,0.2, function() {
+                if (!that.warningActive)
+                    that.$el.empty();
+            });
+            $('#application-content').fadeTo(200,1);
+            return this;
+        },
+        beforeClose: function() {
+            this.stopListening();
+        },
+        warnIfNotLoaded: function() {
+            if (!this.loaded)
+                this.renderOnUpdate();
+        }
+    });
+    // look for ha-standby-overlay for compatibility with older index.html copies
+    var serverCautionOverlay = new ServerCautionOverlay({ el: $("#server-caution-overlay").length ? $("#server-caution-overlay") : $("#ha-standby-overlay")});
+    serverCautionOverlay.render();
+    
+    var Router = Backbone.Router.extend({
+        routes:{
+            'v1/home/*trail':'homePage',
+            'v1/applications/:app/entities/*trail':'applicationsPage',
+            'v1/applications/*trail':'applicationsPage',
+            'v1/applications':'applicationsPage',
+            'v1/locations':'catalogPage',
+            'v1/catalog/:kind(/:id)':'catalogPage',
+            'v1/catalog':'catalogPage',
+            'v1/script/groovy':'scriptGroovyPage',
+            'v1/help':'helpPage',
+            'labs':'labsPage',
+            '*path':'defaultRoute'
+        },
+
+        showView: function(selector, view) {
+            // close the previous view - does binding clean-up and avoids memory leaks
+            if (this.currentView) {
+                this.currentView.close();
+            }
+            // render the view inside the selector element
+            $(selector).html(view.render().el);
+            this.currentView = view;
+            return view;
+        },
+
+        defaultRoute: function() {
+            this.homePage('auto')
+        },
+
+        applications: new Application.Collection,
+        appTree: new AppTree.Collection,
+        locations: new Location.Collection,
+
+        homePage:function (trail) {
+            var that = this;
+            var veryFirstViewLoad, homeView;
+            // render the page after we fetch the collection -- no rendering on error
+            function render() {
+                homeView = new HomeView({
+                    collection:that.applications,
+                    locations:that.locations,
+                    cautionOverlay:serverCautionOverlay,
+                    appRouter:that
+                });
+                veryFirstViewLoad = !that.currentView;
+                that.showView("#application-content", homeView);
+            }
+            this.applications.fetch({success:function () {
+                render();
+                // show add application wizard if none already exist and this is the first page load
+                if ((veryFirstViewLoad && trail=='auto' && that.applications.isEmpty()) || (trail=='add_application') ) {
+                    if (serverStatus.isMaster()) {
+                        homeView.createApplication();
+                    }
+                }
+            }, error: render});
+        },
+        applicationsPage:function (app, trail, tab) {
+            if (trail === undefined) trail = app
+            var that = this
+            this.appTree.fetch({success:function () {
+                var appExplorer = new ExplorerView({
+                    collection:that.appTree,
+                    appRouter:that
+                })
+                that.showView("#application-content", appExplorer)
+                if (trail !== undefined) appExplorer.show(trail)
+            }})
+        },
+        catalogPage: function (catalogItemKind, id) {
+            var catalogResource = new CatalogView({
+                locations: this.locations,
+                appRouter: this,
+                kind: catalogItemKind,
+                id: id
+            });
+            this.showView("#application-content", catalogResource);
+        },
+        scriptGroovyPage:function () {
+            if (this.scriptGroovyResource === undefined)
+                this.scriptGroovyResource = new ScriptGroovyView({})
+            this.showView("#application-content", this.scriptGroovyResource)
+            $(".nav1").removeClass("active")
+            $(".nav1_script").addClass("active")
+            $(".nav1_script_groovy").addClass("active")
+        },
+        helpPage:function () {
+            $("#application-content").html(_.template(HelpHtml, {}))
+            $(".nav1").removeClass("active")
+            $(".nav1_help").addClass("active")
+        },
+        labsPage:function () {
+            $("#application-content").html(_.template(LabsHtml, {}))
+            $(".nav1").removeClass("active")
+        },
+
+        /** Triggers the Backbone.Router process which drives this GUI through Backbone.history,
+         *  after starting background server health checks and waiting for confirmation of health
+         *  (or user click-through). */
+        startBrooklynGui: function() {
+            serverStatus.whenUp(function() { Backbone.history.start(); });
+            serverStatus.autoUpdate();
+            _.delay(serverCautionOverlay.warnIfNotLoaded, 2*1000)
+        }
+    });
+
+    $.ajax({
+        type: "GET",
+        url: "/v1/server/user",
+        dataType: "text"
+    }).done(function (data) {
+        if (data != null) {
+            $("#user").html(_.escape(data));
+        }
+    });
+
+    return Router
+})

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/js/util/brooklyn-utils.js
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/js/util/brooklyn-utils.js b/src/main/webapp/assets/js/util/brooklyn-utils.js
new file mode 100644
index 0000000..5f3915c
--- /dev/null
+++ b/src/main/webapp/assets/js/util/brooklyn-utils.js
@@ -0,0 +1,226 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/* brooklyn utility methods */
+
+define([
+    'jquery', 'underscore'
+], function ($, _) {
+
+    var Util = {};
+
+    /**
+     * @return {string} empty string if s is null or undefined, otherwise result of _.escape(s)
+     */
+    Util.escape = function (s) {
+        if (s == undefined || s == null) return "";
+        return _.escape(s);
+    };
+
+    function isWholeNumber(v) {
+        return (Math.abs(Math.round(v) - v) < 0.000000000001);
+    }
+
+    Util.roundIfNumberToNumDecimalPlaces = function (v, mantissa) {
+        if (!_.isNumber(v) || mantissa < 0)
+            return v;
+
+        if (isWholeNumber(v))
+            return Math.round(v);
+
+        var vk = v, xp = 1;
+        for (var i=0; i < mantissa; i++) {
+            vk *= 10;
+            xp *= 10;
+            if (isWholeNumber(vk)) {
+                return Math.round(vk)/xp;
+            }
+        }
+        return Number(v.toFixed(mantissa));
+    };
+
+    Util.toDisplayString = function(data) {
+        if (data==null) return null;
+        data = Util.roundIfNumberToNumDecimalPlaces(data, 4);
+        if (typeof data !== 'string')
+            data = JSON.stringify(data);
+        return Util.escape(data);
+    };
+
+    Util.toTextAreaString = function(data) {
+        if (data==null) return null;
+        data = Util.roundIfNumberToNumDecimalPlaces(data, 8);
+        if (typeof data !== 'string')
+            data = JSON.stringify(data, null, 2);
+        return data;
+    };
+
+    if (!String.prototype.trim) {
+        // some older javascripts do not support 'trim' (including jasmine spec runner) so let's define it
+        String.prototype.trim = function(){
+            return this.replace(/^\s+|\s+$/g, '');
+        };
+    }
+
+    // from http://stackoverflow.com/questions/646628/how-to-check-if-a-string-startswith-another-string
+    if (typeof String.prototype.startsWith != 'function') {
+        String.prototype.startsWith = function (str){
+            return this.slice(0, str.length) == str;
+        };
+    }
+    if (typeof String.prototype.endsWith != 'function') {
+        String.prototype.endsWith = function (str){
+            return this.slice(-str.length) == str;
+        };
+    }
+    
+    // poor-man's copy
+    Util.promptCopyToClipboard = function(text) {
+        window.prompt("To copy to the clipboard, press Ctrl+C then Enter.", text);
+    };
+
+    /**
+     * Returns the path component of a string URL. e.g. http://example.com/bob/bob --> /bob/bob
+     */
+    Util.pathOf = function(string) {
+        if (!string) return "";
+        var a = document.createElement("a");
+        a.href = string;
+        return a.pathname;
+    };
+
+    /**
+     * Extracts the value of the given input. Returns true/false for for checkboxes
+     * rather than "on" or "off".
+     */
+    Util.inputValue = function($input) {
+        if ($input.attr("type") === "checkbox") {
+            return $input.is(":checked");
+        } else {
+            return $input.val();
+        }
+    };
+
+    /**
+     * Updates or initialises the given model with the values of named elements under
+     * the given element. Force-updates the model by setting silent: true.
+     */
+    Util.bindModelFromForm = function(modelOrConstructor, $el) {
+        var model = _.isFunction(modelOrConstructor) ? new modelOrConstructor() : modelOrConstructor;
+        var inputs = {};
+
+        // Look up all named elements
+        $("[name]", $el).each(function(idx, inp) {
+            var input = $(inp);
+            var name = input.attr("name");
+            inputs[name] = Util.inputValue(input);
+        });
+        model.set(inputs, { silent: true });
+        return model;
+    };
+
+    /**
+     * Parses xhrResponse.responseText as JSON and returns its message. Returns
+     * alternate message if parsing fails or the parsed object has no message.
+     * @param {jqXHR} xhrResponse
+     * @param {string} alternateMessage
+     * @param {string=} logMessage if false or null, does not log;
+     *      otherwise it logs a message and the xhrResponse, with logMessage
+     *      (or with alternateMessage if logMessage is true)
+     * @returns {*}
+     */
+    Util.extractError = function (xhrResponse, alternateMessage, logMessage) {
+        if (logMessage) {
+            if (logMessage === true) {
+                console.error(alternateMessage);
+            } else {
+                console.error(logMessage);
+            }
+            console.log(xhrResponse);
+        }
+        
+        try {
+            var response = JSON.parse(xhrResponse.responseText);
+            return response.message ? response.message : alternateMessage;
+        } catch (e) {
+            return alternateMessage;
+        }
+    };
+    
+    secretWords = [ "password", "passwd", "credential", "secret", "private", "access.cert", "access.key" ];
+    
+    Util.isSecret = function (key) {
+        if (!key) return false;
+        key = key.toString().toLowerCase();
+        for (secretWord in secretWords)
+            if (key.indexOf(secretWords[secretWord]) >= 0)
+                return true;
+        return false; 
+    };
+
+    Util.logout = function logout() {
+        $.ajax({
+            type: "POST",
+            dataType: "text",
+            url: "/logout",
+            success: function() {
+                window.location.replace("/");
+            },
+            failure: function() {
+                window.location.replace("/");
+            }
+        });
+    }
+
+    Util.setSelectionRange = function (input, selectionStart, selectionEnd) {
+      if (input.setSelectionRange) {
+        input.focus();
+        input.setSelectionRange(selectionStart, selectionEnd);
+      }
+      else if (input.createTextRange) {
+        var range = input.createTextRange();
+        range.collapse(true);
+        range.moveEnd('character', selectionEnd);
+        range.moveStart('character', selectionStart);
+        range.select();
+      }
+    };
+            
+    Util.setCaretToPos = function (input, pos) {
+      Util.setSelectionRange(input, pos, pos);
+    };
+
+    $.fn.setCaretToStart = function() {
+      this.each(function(index, elem) {
+        Util.setCaretToPos(elem, 0);
+        $(elem).scrollTop(0);
+      });
+      return this;
+    };
+
+    $("#logout-link").on("click", function (e) {
+        e.preventDefault();
+        Util.logout()
+        return false;
+    });
+
+    return Util;
+
+});
+

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/js/util/brooklyn-view.js
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/js/util/brooklyn-view.js b/src/main/webapp/assets/js/util/brooklyn-view.js
new file mode 100644
index 0000000..7151ae1
--- /dev/null
+++ b/src/main/webapp/assets/js/util/brooklyn-view.js
@@ -0,0 +1,352 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+*/
+
+/* brooklyn extensions for supporting views */
+define([
+    "jquery", "underscore", "backbone", "brooklyn-utils",
+    "text!tpl/lib/basic-modal.html",
+    "text!tpl/lib/config-key-type-value-input-pair.html"
+    ], function (
+    $, _, Backbone, Util,
+    ModalHtml, ConfigKeyInputHtml
+) {
+
+    var module = {};
+
+    module.refresh = true;
+
+    /** Toggles automatic refreshes of instances of View. */
+    module.toggleRefresh = function () {
+        this.refresh = !this.refresh;
+        return this.refresh;
+    };
+
+    // TODO this customising of the View prototype could be expanded to include
+    // other methods from viewutils. see discussion at
+    // https://github.com/brooklyncentral/brooklyn/pull/939
+
+    // add close method to all views for clean-up
+    // (NB we have to update the prototype _here_ before any views are instantiated;
+    //  see "close" called below in "showView")
+    Backbone.View.prototype.close = function () {
+        // call user defined close method if exists
+        this.viewIsClosed = true;
+        if (_.isFunction(this.beforeClose)) {
+            this.beforeClose();
+        }
+        _.each(this._periodicFunctions, function (i) {
+            clearInterval(i);
+        });
+        this.remove();
+        this.unbind();
+    };
+
+    Backbone.View.prototype.viewIsClosed = false;
+
+    /**
+     * Registers a callback (cf setInterval) that is unregistered cleanly when the view
+     * closes. The callback is run in the context of the owning view, so callbacks can
+     * refer to 'this' safely.
+     */
+    Backbone.View.prototype.callPeriodically = function (uid, callback, interval) {
+        if (!this._periodicFunctions) {
+            this._periodicFunctions = {};
+        }
+        var old = this._periodicFunctions[uid];
+        if (old) clearInterval(old);
+
+        // Wrap callback in function that checks whether updates are enabled
+        var periodic = function () {
+            if (module.refresh) {
+                callback.apply(this);
+            }
+        };
+        // Bind this to the view
+        periodic = _.bind(periodic, this);
+        this._periodicFunctions[uid] = setInterval(periodic, interval);
+    };
+
+    /**
+     * A form that listens to modifications to its inputs, maintaining a model that is
+     * submitted when a button with class 'submit' is clicked.
+     *
+     * Expects a body view or a template function to render.
+     */
+    module.Form = Backbone.View.extend({
+        events: {
+            "change": "onChange",
+            "submit": "onSubmit"
+        },
+
+        initialize: function() {
+            if (!this.options.body && !this.options.template) {
+                throw new Error("body view or template function required by GenericForm");
+            } else if (!this.options.onSubmit) {
+                throw new Error("onSubmit function required by GenericForm");
+            }
+            this.onSubmitCallback = this.options.onSubmit;
+            this.model = new (this.options.model || Backbone.Model);
+            _.bindAll(this, "onSubmit", "onChange");
+            this.render();
+        },
+
+        beforeClose: function() {
+            if (this.options.body) {
+                this.options.body.close();
+            }
+        },
+
+        render: function() {
+            if (this.options.body) {
+                this.options.body.render();
+                this.$el.html(this.options.body.$el);
+            } else {
+                this.$el.html(this.options.template());
+            }
+            // Initialise the model with existing values
+            Util.bindModelFromForm(this.model, this.$el);
+            return this;
+        },
+
+        onChange: function(e) {
+            var target = $(e.target);
+            var name = target.attr("name");
+            this.model.set(name, Util.inputValue(target), { silent: true });
+        },
+
+        onSubmit: function(e) {
+            e.preventDefault();
+            // Could validate model
+            this.onSubmitCallback(this.model.clone());
+            return false;
+        }
+
+    });
+
+    /**
+     * A view to render another view in a modal. Give another view to render as
+     * the `body' parameter that has an onSubmit function that will be called
+     * when the modal's `Save' button is clicked, and/or an onCancel callback
+     * that will be called when the modal is closed without saving.
+     *
+     * The onSubmit callback should return either:
+     * <ul>
+     *   <li><b>nothing</b>: the callback is treated as successful
+     *   <li><b>true</b> or <b>false</b>: the callback is treated as appropriate
+     *   <li>a <b>promise</b> with `done' and `fail' callbacks (for example a jqXHR object):
+     *     The callback is treated as successful when the promise is done without error.
+     *   <li><b>anything else</b>: the callback is treated as successful
+     * </ul>
+     * When the onSubmit callback is successful the modal is closed.
+     *
+     * The return value of the onCancel callback is ignored.
+     *
+     * The modal will still be open and visible when the onSubmit callback is called.
+     * The modal will have been closed when the onCancel callback is called.
+     */
+    module.Modal = Backbone.View.extend({
+
+        id: _.uniqueId("modal"),
+        className: "modal",
+        template: _.template(ModalHtml),
+
+        events: {
+            "hide": "onClose",
+            "click .modal-submit": "onSubmit"
+        },
+
+        initialize: function() {
+            if (!this.options.body) {
+                throw new Error("Modal view requires body to render");
+            }
+            _.bindAll(this, "onSubmit", "onCancel", "show");
+            if (this.options.autoOpen) {
+                this.show();
+            }
+        },
+
+        beforeClose: function() {
+            if (this.options.body) {
+                this.options.body.close();
+            }
+        },
+
+        render: function() {
+            var optionalTitle = this.options.body.title;
+            var title = _.isFunction(optionalTitle)
+                    ? optionalTitle()
+                    : _.isString(optionalTitle)
+                        ? optionalTitle : this.options.title;
+            this.$el.html(this.template({
+                title: title,
+                submitButtonText: this.options.submitButtonText || "Apply",
+                cancelButtonText: this.options.cancelButtonText || "Cancel"
+            }));
+            this.options.body.render();
+            this.$(".modal-body").html(this.options.body.$el);
+            return this;
+        },
+
+        show: function() {
+            this.render().$el.modal();
+            return this;
+        },
+
+        onSubmit: function(event) {
+            if (_.isFunction(this.options.body.onSubmit)) {
+                var submission = this.options.body.onSubmit.apply(this.options.body, [event]);
+                var self = this;
+                var submissionSuccess = function() {
+                    // Closes view via event.
+                    self.closingSuccessfully = true;
+                    self.$el.modal("hide");
+                };
+                var submissionFailure = function () {
+                    // Better response.
+                    console.log("modal submission failed!", arguments);
+                };
+                // Assuming no value is fine
+                if (!submission) {
+                    submission = true;
+                }
+                if (_.isBoolean(submission) && submission) {
+                    submissionSuccess();
+                } else if (_.isBoolean(submission)) {
+                    submissionFailure();
+                } else if (_.isFunction(submission.done) && _.isFunction(submission.fail)) {
+                    submission.done(submissionSuccess).fail(submissionFailure);
+                } else {
+                    // assuming success and closing modal
+                    submissionSuccess()
+                }
+            }
+            return false;
+        },
+
+        onCancel: function () {
+            if (_.isFunction(this.options.body.onCancel)) {
+                this.options.body.onCancel.apply(this.options.body);
+            }
+        },
+
+        onClose: function () {
+            if (!this.closingSuccessfully) {
+                this.onCancel();
+            }
+            this.close();
+        }
+    });
+
+    /**
+     * Shows a modal with yes/no buttons as a user confirmation prompt.
+     * @param {string} question The message to show in the body of the modal
+     * @param {string} [title] An optional title to show. Uses generic default if not given.
+     * @returns {jquery.Deferred} The promise from a jquery.Deferred object. The
+     *          promise is resolved if the modal was submitted normally and rejected
+     *          otherwise.
+     */
+    module.requestConfirmation = function (question, title) {
+        var deferred = $.Deferred();
+        var Confirmation = Backbone.View.extend({
+            title: title || "Confirm action",
+            render: function () {
+                this.$el.html(question || "");
+            },
+            onSubmit: function () {
+                deferred.resolve();
+            },
+            onCancel: function () {
+                deferred.reject();
+            }
+        });
+        new module.Modal({
+            body: new Confirmation(),
+            autoOpen: true,
+            submitButtonText: "Yes",
+            cancelButtonText: "No"
+        });
+        return deferred.promise();
+    };
+
+    /** Creates, displays and returns a modal with the given view used as its body */
+    module.showModalWith = function (bodyView) {
+        return new module.Modal({body: bodyView}).show();
+    };
+
+    /**
+     * Presents inputs for config key names/values with  buttons to add/remove entries
+     * and a function to extract a map of name->value.
+     */
+    module.ConfigKeyInputPairList = Backbone.View.extend({
+        template: _.template(ConfigKeyInputHtml),
+        // Could listen to input change events and add 'error' class to any type inputs
+        // that duplicate values.
+        events: {
+            "click .config-key-row-remove": "rowRemove",
+            "keypress .last": "rowAdd"
+        },
+        render: function () {
+            if (this.options.configKeys) {
+                var templated = _.map(this.options.configKeys, function (value, key) {
+                    return this.templateRow(key, value);
+                }, this);
+                this.$el.html(templated.join(""));
+            }
+            this.$el.append(this.templateRow());
+            this.markLast();
+            return this;
+        },
+        rowAdd: function (event) {
+            this.$el.append(this.templateRow());
+            this.markLast();
+        },
+        rowRemove: function (event) {
+            $(event.currentTarget).parent().remove();
+            if (this.$el.children().length == 0) {
+                this.rowAdd();
+            }
+            this.markLast();
+        },
+        markLast: function () {
+            this.$(".last").removeClass("last");
+            // Marking inputs rather than parent div to avoid weird behaviour when
+            // remove row button is triggered with the keyboard.
+            this.$(".config-key-type").last().addClass("last");
+            this.$(".config-key-value").last().addClass("last");
+        },
+        templateRow: function (type, value) {
+            return this.template({type: type || "", value: value || ""});
+        },
+        getConfigKeys: function () {
+            var cks = {};
+            this.$(".config-key-type").each(function (index, input) {
+                input = $(input);
+                var type = input.val() && input.val().trim();
+                var value = input.next().val() && input.next().val().trim();
+                if (type && value) {
+                    cks[type] = value;
+                }
+            });
+            return cks;
+        }
+    });
+
+    return module;
+
+});

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/js/util/brooklyn.js
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/js/util/brooklyn.js b/src/main/webapp/assets/js/util/brooklyn.js
new file mode 100644
index 0000000..702b59b
--- /dev/null
+++ b/src/main/webapp/assets/js/util/brooklyn.js
@@ -0,0 +1,86 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+
+/** brooklyn extension to make console methods available and simplify access to other utils */
+
+define([
+    "underscore", "brooklyn-view", "brooklyn-utils"
+], function (_, BrooklynViews, BrooklynUtils) {
+
+    /**
+     * Makes the console API safe to use:
+     *  - Stubs missing methods to prevent errors when no console is present.
+     *  - Exposes a global `log` function that preserves line numbering and formatting.
+     *
+     * Idea from https://gist.github.com/bgrins/5108712
+     */
+    (function () {
+        var noop = function () {},
+            consoleMethods = [
+                'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error',
+                'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log',
+                'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd',
+                'timeStamp', 'trace', 'warn'
+            ],
+            length = consoleMethods.length,
+            console = (window.console = window.console || {});
+
+        while (length--) {
+            var method = consoleMethods[length];
+
+            // Only stub undefined methods.
+            if (!console[method]) {
+                console[method] = noop;
+            }
+        }
+
+        if (Function.prototype.bind) {
+            window.log = Function.prototype.bind.call(console.log, console);
+        } else {
+            window.log = function () {
+                Function.prototype.apply.call(console.log, console, arguments);
+            };
+        }
+    })();
+
+    var template = _.template;
+    _.mixin({
+        /**
+         * @param {string} text
+         * @return string The text with HTML comments removed.
+         */
+        stripComments: function (text) {
+            return text.replace(/<!--(.|[\n\r\t])*?-->\r?\n?/g, "");
+        },
+        /**
+         * As the real _.template, calling stripComments on text.
+         */
+        template: function (text, data, settings) {
+            return template(_.stripComments(text), data, settings);
+        }
+    });
+
+    var Brooklyn = {
+        view: BrooklynViews,
+        util: BrooklynUtils
+    };
+
+    return Brooklyn;
+});

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/js/util/dataTables.extensions.js
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/js/util/dataTables.extensions.js b/src/main/webapp/assets/js/util/dataTables.extensions.js
new file mode 100644
index 0000000..74a548e
--- /dev/null
+++ b/src/main/webapp/assets/js/util/dataTables.extensions.js
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ * ---
+ *
+ * This code has been created by the Apache Brooklyn contributors.
+ * It is heavily based on earlier software but rewritten for clarity 
+ * and to preserve license integrity.
+ *
+ * This work is based on the existing jQuery DataTables plug-ins for:
+ *
+ * * fnStandingRedraw by Jonathan Hoguet, 
+ *   http://www.datatables.net/plug-ins/api/fnStandingRedraw
+ *
+ * * fnProcessingIndicator by Allan Chappell
+ *   https://www.datatables.net/plug-ins/api/fnProcessingIndicator
+ *
+ */
+define([
+    "jquery", "jquery-datatables"
+], function($, dataTables) {
+
+$.fn.dataTableExt.oApi.fnStandingRedraw = function(oSettings) {
+    if (oSettings.oFeatures.bServerSide === false) {
+        // remember and restore cursor position
+        var oldDisplayStart = oSettings._iDisplayStart;
+        oSettings.oApi._fnReDraw(oSettings);
+        oSettings._iDisplayStart = oldDisplayStart;
+        oSettings.oApi._fnCalculateEnd(oSettings);
+    }
+    // and force draw
+    oSettings.oApi._fnDraw(oSettings);
+};
+
+
+jQuery.fn.dataTableExt.oApi.fnProcessingIndicator = function(oSettings, bShow) {
+    if (typeof bShow === "undefined") bShow=true;
+    this.oApi._fnProcessingDisplay(oSettings, bShow);
+};
+
+});

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/js/util/jquery.slideto.js
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/js/util/jquery.slideto.js b/src/main/webapp/assets/js/util/jquery.slideto.js
new file mode 100644
index 0000000..17afeed
--- /dev/null
+++ b/src/main/webapp/assets/js/util/jquery.slideto.js
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ * ---
+ *
+ * This code has been created by the Apache Brooklyn contributors.
+ * It is heavily based on earlier software but rewritten for readability 
+ * and to preserve license integrity.
+ *
+ * Our influences are:
+ *
+ * * jquery.slideto.min.js in Swagger UI, provenance unknown, added in:
+ *   https://github.com/wordnik/swagger-ui/commit/d2eb882e5262e135dfa3f5919796bbc3785880b8#diff-bd86720650a2ebd1ab11e870dc475564
+ *
+ *   Swagger UI is distributed under ASL but it is not clear that this code originated in that project.
+ *   No other original author could be identified.
+ *
+ * * Nearly identical code referenced here:
+ *   http://stackoverflow.com/questions/12375440/scrolling-works-in-chrome-but-not-in-firefox-or-ie
+ *
+ * Note that the project https://github.com/Sleavely/jQuery-slideto is NOT this.
+ *
+ */
+(function(jquery){
+jquery.fn.slideto=function(opts) {
+    opts = _.extend( {
+            highlight: true,
+            slide_duration: "slow",
+            highlight_duration: 3000,
+            highlight_color: "#FFFF99" },
+        opts);
+    return this.each(function() {
+        $target=jquery(this);
+        jquery("body").animate(
+            { scrollTop: $target.offset().top },
+            opts.slide_duration,
+            function() {
+                opts.highlight && 
+                jquery.ui.version && 
+                $target.effect(
+                    "highlight",
+                    { color: opts.highlight_color },
+                    opts.highlight_duration)
+            })
+        });
+}}) (jQuery);

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/js/view/activity-details.js
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/js/view/activity-details.js b/src/main/webapp/assets/js/view/activity-details.js
new file mode 100644
index 0000000..fa8b552
--- /dev/null
+++ b/src/main/webapp/assets/js/view/activity-details.js
@@ -0,0 +1,426 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+*/
+/**
+ * Displays details on an activity/task
+ */
+define([
+    "underscore", "jquery", "backbone", "brooklyn-utils", "view/viewutils", "moment",
+    "model/task-summary",
+    "text!tpl/apps/activity-details.html", "text!tpl/apps/activity-table.html", 
+
+    "bootstrap", "jquery-datatables", "datatables-extensions"
+], function (_, $, Backbone, Util, ViewUtils, moment,
+    TaskSummary,
+    ActivityDetailsHtml, ActivityTableHtml) {
+
+    var activityTableTemplate = _.template(ActivityTableHtml),
+        activityDetailsTemplate = _.template(ActivityDetailsHtml);
+
+    function makeActivityTable($el) {
+        $el.html(_.template(ActivityTableHtml));
+        var $subTable = $('.activity-table', $el);
+        $subTable.attr('width', 569-6-6 /* subtract padding */)
+
+        return ViewUtils.myDataTable($subTable, {
+            "fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
+                $(nRow).attr('id', aData[0])
+                $(nRow).addClass('activity-row')
+            },
+            "aoColumnDefs": [ {
+                    "mRender": function ( data, type, row ) { return Util.escape(data) },
+                    "aTargets": [ 1, 2, 3 ]
+                 }, {
+                    "bVisible": false,
+                    "aTargets": [ 0 ]
+                 } ],
+            "aaSorting":[]  // default not sorted (server-side order)
+        });
+    }
+
+    var ActivityDetailsView = Backbone.View.extend({
+        template: activityDetailsTemplate,
+        taskLink: '',
+        task: null,
+        /* children of this task; see HasTaskChildren for difference between this and sub(mitted)Tasks */
+        childrenTable: null,
+        /* tasks in the current execution context (this.collections) whose submittedByTask
+         * is the task we are drilled down on. this defaults to the passed in collection, 
+         * which will be the last-viewed entity's exec-context; when children cross exec-context
+         * boundaries we have to rewire to point to the current entity's exec-context / tasks */
+        subtasksTable: null,
+        children: null,
+        breadcrumbs: [],
+        firstLoad: true,
+        events:{
+            "click #activities-children-table .activity-table tr":"childrenRowClick",
+            "click #activities-submitted-table .activity-table tr":"submittedRowClick",
+            'click .showDrillDownSubmittedByAnchor':'showDrillDownSubmittedByAnchor',
+            'click .showDrillDownBlockerOfAnchor':'showDrillDownBlockerOfAnchor',
+            'click .backDrillDown':'backDrillDown'
+        },
+        // requires taskLink or task; breadcrumbs is optional
+        initialize:function () {
+            var that = this;
+            this.taskLink = this.options.taskLink;
+            this.taskId = this.options.taskId;
+            if (this.options.task)
+                this.task = this.options.task;
+            else if (this.options.tabView)
+                this.task = this.options.tabView.collection.get(this.taskId);
+            if (!this.taskLink && this.task) this.taskLink = this.task.get('links').self;
+            if (!this.taskLink && this.taskId) this.taskLink = "v1/activities/"+this.taskId;;
+            
+            this.tabView = this.options.tabView || null;
+            
+            if (this.options.breadcrumbs) this.breadcrumbs = this.options.breadcrumbs;
+
+            this.$el.html(this.template({ taskLink: this.taskLink, taskId: this.taskId, task: this.task, breadcrumbs: this.breadcrumbs }));
+            this.$el.addClass('activity-detail-panel');
+
+            this.childrenTable = makeActivityTable(this.$('#activities-children-table'));
+            this.subtasksTable = makeActivityTable(this.$('#activities-submitted-table'));
+
+            ViewUtils.attachToggler(this.$el)
+        
+            if (this.task) {
+                this.renderTask()
+                this.setUpPolling()
+            } else {      
+                ViewUtils.fadeToIndicateInitialLoad(this.$el);
+                this.$el.css('cursor', 'wait')
+                $.get(this.taskLink, function(data) {
+                    ViewUtils.cancelFadeOnceLoaded(that.$el);
+                    that.task = new TaskSummary.Model(data)
+                    that.renderTask()
+                    that.setUpPolling();
+                }).fail(function() { log("unable to load "+that.taskLink) })
+            }
+
+            // initial subtasks may be available from parent, so try to render those
+            // (reliable polling for subtasks, and for children, is set up in setUpPolling ) 
+            this.renderSubtasks()
+        },
+        
+        refreshNow: function(initial) {
+            var that = this
+            $.get(this.taskLink, function(data) {
+                that.task = new TaskSummary.Model(data)
+                that.renderTask()
+                if (initial) that.setUpPolling();
+            })
+        },
+        renderTask: function() {
+            // update task fields
+            var that = this, firstLoad = this.firstLoad;
+            this.firstLoad = false;
+            
+            if (firstLoad  && this.task) {
+//                log("rendering "+firstLoad+" "+this.task.get('isError')+" "+this.task.id);
+                if (this.task.get('isError')) {
+                    // on first load, expand the details if there is a problem
+                    var $details = this.$(".toggler-region.task-detail .toggler-header");
+                    ViewUtils.showTogglerClickElement($details);
+                }
+            }
+            
+            this.updateFields('displayName', 'entityDisplayName', 'id', 'description', 'currentStatus', 'blockingDetails');
+            this.updateFieldWith('blockingTask',
+                function(v) { 
+                    return "<a class='showDrillDownBlockerOfAnchor handy' link='"+_.escape(v.link)+"' id='"+v.metadata.id+"'>"+
+                        that.displayTextForLinkedTask(v)+"</a>" })
+            this.updateFieldWith('result',
+                function(v) {
+                    // use display string (JSON.stringify(_.escape(v)) because otherwise list of [null,null] is just ","  
+                    var vs = Util.toDisplayString(v);
+                    if (vs.trim().length==0) {
+                        return " (empty result)";
+                    } else if (vs.length<20 &&  !/\r|\n/.exec(v)) {
+                        return " with result: <span class='result-literal'>"+vs+"</span>";
+                    } else {
+                        return "<div class='result-literal'>"+vs.replace(/\n+/g,"<br>")+"</div>"
+                    }
+                 })
+            this.updateFieldWith('tags', function(tags) {
+                var tagBody = "";
+                for (var tag in tags) {
+                    tagBody += "<div class='activity-tag-giftlabel'>"+Util.toDisplayString(tags[tag])+"</div>";
+                }
+                return tagBody;
+            })
+            
+            var submitTimeUtc = this.updateFieldWith('submitTimeUtc',
+                function(v) { return v <= 0 ? "-" : moment(v).format('D MMM YYYY H:mm:ss.SSS')+" &nbsp; <i>"+moment(v).fromNow()+"</i>" })
+            var startTimeUtc = this.updateFieldWith('startTimeUtc',
+                function(v) { return v <= 0 ? "-" : moment(v).format('D MMM YYYY H:mm:ss.SSS')+" &nbsp; <i>"+moment(v).fromNow()+"</i>" })
+            this.updateFieldWith('endTimeUtc',
+                function(v) { return v <= 0 ? "-" : moment(v).format('D MMM YYYY H:mm:ss.SSS')+" &nbsp; <i>"+moment(v).from(startTimeUtc, true)+" later</i>" })
+
+            ViewUtils.updateTextareaWithData(this.$(".task-json .for-textarea"), 
+                Util.toTextAreaString(this.task), false, false, 150, 400)
+
+            ViewUtils.updateTextareaWithData(this.$(".task-detail .for-textarea"), 
+                this.task.get('detailedStatus'), false, false, 30, 250)
+
+            this.updateFieldWith('streams',
+                function(streams) {
+                    // Stream names presented alphabetically
+                    var keys = _.keys(streams);
+                    keys.sort();
+                    var result = "";
+                    for (var i = 0; i < keys.length; i++) {
+                        var name = keys[i];
+                        var stream = streams[name];
+                        result += "<div class='activity-stream-div'>" +
+                                "<span class='activity-label'>" +
+                                _.escape(name) +
+                                "</span><span>" +
+                                "<a href='" + stream.link + "'>download</a>" +
+                                (stream.metadata["sizeText"] ? " (" + _.escape(stream.metadata["sizeText"]) + ")" : "") +
+                                "</span></div>";
+                    }
+                    return result; 
+                });
+
+            this.updateFieldWith('submittedByTask',
+                function(v) { return "<a class='showDrillDownSubmittedByAnchor handy' link='"+_.escape(v.link)+"' id='"+v.metadata.id+"'>"+
+                    that.displayTextForLinkedTask(v)+"</a>" })
+
+            if (this.task.get("children").length==0)
+                this.$('.toggler-region.tasks-children').hide();
+        },
+        setUpPolling: function() {
+            var that = this
+
+            // on first load, clear any funny cursor
+            this.$el.css('cursor', 'auto')
+
+            this.task.url = this.taskLink;
+            this.task.on("all", this.renderTask, this)
+            
+            ViewUtils.get(this, this.taskLink, function(data) {
+                // if we can get the data, then start fetching certain things repeatedly
+                // (would be good to skip the immediate "doitnow" below but not a big deal)
+                ViewUtils.fetchRepeatedlyWithDelay(that, that.task, { doitnow: true });
+                
+                // and set up to load children (now that the task is guaranteed to be loaded)
+                that.children = new TaskSummary.Collection()
+                that.children.url = that.task.get("links").children
+                that.children.on("reset", that.renderChildren, that)
+                ViewUtils.fetchRepeatedlyWithDelay(that, that.children, { 
+                    fetchOptions: { reset: true }, doitnow: true, fadeTarget: that.$('.tasks-children') });
+            }).fail( function() { that.$('.toggler-region.tasks-children').hide() } );
+
+
+            $.get(this.task.get("links").entity, function(entity) {
+                if (that.collection==null || entity.links.activities != that.collection.url) {
+                    // need to rewire collection to point to the right ExecutionContext
+                    that.collection = new TaskSummary.Collection()
+                    that.collection.url = entity.links.activities
+                    that.collection.on("reset", that.renderSubtasks, that)
+                    ViewUtils.fetchRepeatedlyWithDelay(that, that.collection, { 
+                        fetchOptions: { reset: true }, doitnow: true, fadeTarget: that.$('.tasks-submitted') });
+                } else {
+                    that.collection.on("reset", that.renderSubtasks, that)
+                    that.collection.fetch({reset: true});
+                }
+            });
+        },
+        
+        renderChildren: function() {
+            var that = this
+            var children = this.children
+            ViewUtils.updateMyDataTable(this.childrenTable, children, function(task, index) {
+                return [ task.get("id"),
+                         (task.get("entityId") && task.get("entityId")!=that.task.get("entityId") ? task.get("entityDisplayName") + ": " : "") + 
+                         task.get("displayName"),
+                         task.get("submitTimeUtc") <= 0 ? "-" : moment(task.get("submitTimeUtc")).calendar(),
+                         task.get("currentStatus")
+                    ]; 
+                });
+            if (children && children.length>0) {
+                this.$('.toggler-region.tasks-children').show();
+            } else {
+                this.$('.toggler-region.tasks-children').hide();
+            }
+        },
+        renderSubtasks: function() {
+            var that = this
+            var taskId = this.taskId || (this.task ? this.task.id : null);
+            if (!this.collection) {
+                this.$('.toggler-region.tasks-submitted').hide();
+                return;
+            }
+            if (!taskId) {
+                // task not available yet; just wait for it to be loaded
+                // (and in worst case, if it can't be loaded, this panel stays faded)
+                return;
+            } 
+            
+            // find tasks submitted by this one which aren't included as children
+            // this uses collections -- which is everything in the current execution context
+            var subtasks = []
+            for (var taskI in this.collection.models) {
+                var task = this.collection.models[taskI]
+                var submittedBy = task.get("submittedByTask")
+                if (submittedBy!=null && submittedBy.metadata!=null && submittedBy.metadata["id"] == taskId &&
+                        (!this.children || this.children.get(task.id)==null)) {
+                    subtasks.push(task)
+                }
+            }
+            ViewUtils.updateMyDataTable(this.subtasksTable, subtasks, function(task, index) {
+                return [ task.get("id"),
+                         (task.get("entityId") && (!that.task || task.get("entityId")!=that.task.get("entityId")) ? task.get("entityDisplayName") + ": " : "") + 
+                         task.get("displayName"),
+                         task.get("submitTimeUtc") <= 0 ? "-" : moment(task.get("submitTimeUtc")).calendar(),
+                         task.get("currentStatus")
+                    ];
+                });
+            if (subtasks && subtasks.length>0) {
+                this.$('.toggler-region.tasks-submitted').show();
+            } else {
+                this.$('.toggler-region.tasks-submitted').hide();
+            }
+        },
+        
+        displayTextForLinkedTask: function(v) {
+            return v.metadata.taskName ? 
+                    (v.metadata.entityDisplayName ? _.escape(v.metadata.entityDisplayName)+" <b>"+_.escape(v.metadata.taskName)+"</b>" : 
+                        _.escape(v.metadata.taskName)) :
+                    v.metadata.taskId ? _.escape(v.metadata.taskId) : 
+                    _.escape(v.link)
+        },
+        updateField: function(field) {
+            return this.updateFieldWith(field, _.escape)
+        },
+        updateFields: function() {
+            _.map(arguments, this.updateField, this);
+        },
+        updateFieldWith: function(field, f) {
+            var v = this.task.get(field)
+            if (v !== undefined && v != null && 
+                    (typeof v !== "object" || _.size(v) > 0)) {
+                this.$('.updateField-'+field, this.$el).html( f(v) );
+                this.$('.ifField-'+field, this.$el).show();
+            } else {
+                // blank if there is no value
+                this.$('.updateField-'+field).empty();
+                this.$('.ifField-'+field).hide();
+            }
+            return v
+        },
+        childrenRowClick:function(evt) {
+            var row = $(evt.currentTarget).closest("tr");
+            var id = row.attr("id");
+            this.showDrillDownTask("subtask of", this.children.get(id).get("links").self, id, this.children.get(id))
+        },
+        submittedRowClick:function(evt) {
+            var row = $(evt.currentTarget).closest("tr");
+            var id = row.attr("id");
+            // submitted tasks are guaranteed to be in the collection, so this is safe
+            this.showDrillDownTask("subtask of", this.collection.get(id).get('links').self, id)
+        },
+        
+        showDrillDownSubmittedByAnchor: function(from) {
+            var $a = $(from.target).closest('a');
+            this.showDrillDownTask("submitter of", $a.attr("link"), $a.attr("id"))
+        },
+        showDrillDownBlockerOfAnchor: function(from) {
+            var $a = $(from.target).closest('a');
+            this.showDrillDownTask("blocker of", $a.attr("link"), $a.attr("id"))
+        },
+        showDrillDownTask: function(relation, newTaskLink, newTaskId, newTask) {
+//            log("activities deeper drill down - "+newTaskId +" / "+newTaskLink)
+            var that = this;
+            
+            var newBreadcrumbs = [ relation + ' ' +
+                this.task.get('entityDisplayName') + ' ' +
+                this.task.get('displayName') ].concat(this.breadcrumbs)
+                
+            var activityDetailsPanel = new ActivityDetailsView({
+                taskLink: newTaskLink,
+                taskId: newTaskId,
+                task: newTask,
+                tabView: that.tabView,
+                collection: this.collection,
+                breadcrumbs: newBreadcrumbs
+            });
+            activityDetailsPanel.addToView(this.$el);
+        },
+        addToView: function(parent) {
+            if (this.parent) {
+                log("WARN: adding details to view when already added")
+                this.parent = parent;
+            }
+            
+            if (Backbone.history && (!this.tabView || !this.tabView.openingQueuedTasks)) {
+                Backbone.history.navigate(Backbone.history.fragment+"/"+"subtask"+"/"+this.taskId);
+            }
+
+            var $t = parent.closest('.slide-panel');
+            var $t2 = $t.after('<div>').next();
+            $t2.addClass('slide-panel');
+
+            // load the drill-down page
+            $t2.html(this.render().el)
+
+            var speed = (!this.tabView || !this.tabView.openingQueuedTasks) ? 300 : 0;
+            $t.animate({
+                    left: -600
+                }, speed, function() { 
+                    $t.hide() 
+                });
+
+            $t2.show().css({
+                    left: 600
+                    , top: 0
+                }).animate({
+                    left: 0
+                }, speed);
+        },
+        backDrillDown: function(event) {
+//            log("activities drill back from "+this.taskLink)
+            var that = this
+            var $t2 = this.$el.closest('.slide-panel')
+            var $t = $t2.prev()
+
+            if (Backbone.history) {
+                var fragment = Backbone.history.fragment
+                var thisLoc = fragment.indexOf("/subtask/"+this.taskId);
+                if (thisLoc>=0)
+                    Backbone.history.navigate( fragment.substring(0, thisLoc) );
+            }
+
+            $t2.animate({
+                    left: 569 //prevTable.width()
+                }, 300, function() {
+                    that.$el.empty()
+                    $t2.remove()
+                    that.remove()
+                });
+
+            $t.show().css({
+                    left: -600 //-($t2.width())
+                }).animate({
+                    left: 0
+                }, 300);
+        }
+    });
+
+    return ActivityDetailsView;
+});

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/js/view/add-child-invoke.js
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/js/view/add-child-invoke.js b/src/main/webapp/assets/js/view/add-child-invoke.js
new file mode 100644
index 0000000..1105afe
--- /dev/null
+++ b/src/main/webapp/assets/js/view/add-child-invoke.js
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+*/
+/**
+ * Render as a modal
+ */
+define([
+    "underscore", "jquery", "backbone", "brooklyn", "brooklyn-utils", "view/viewutils",
+    "text!tpl/apps/add-child-modal.html"
+], function(_, $, Backbone, Brooklyn, Util, ViewUtils, 
+        AddChildModalHtml) {
+    return Backbone.View.extend({
+        template: _.template(AddChildModalHtml),
+        initialize: function() {
+            this.title = "Add Child to "+this.options.entity.get('name');
+        },
+        render: function() {
+            this.$el.html(this.template(this.options.entity.attributes));
+            return this;
+        },
+        onSubmit: function (event) {
+            var self = this;
+            var childSpec = this.$("#child-spec").val();
+            var start = this.$("#child-autostart").is(":checked");
+            var url = this.options.entity.get('links').children + (!start ? "?start=false" : "");
+            var ajax = $.ajax({
+                type: "POST",
+                url: url,
+                data: childSpec,
+                contentType: "application/yaml",
+                success: function() {
+                    self.options.target.reload();
+                },
+                error: function(response) {
+                    self.showError(Util.extractError(response, "Error contacting server", url));
+                }
+            });
+            return ajax;
+        },
+        showError: function (message) {
+            this.$(".child-add-error-container").removeClass("hide");
+            this.$(".child-add-error-message").html(message);
+        }
+
+    });
+});


[25/51] [abbrv] [partial] brooklyn-ui git commit: move subdir from incubator up a level as it is promoted to its own repo (first non-incubator commit!)

Posted by he...@apache.org.
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/swagger-ui/lib/jquery.ba-bbq.min.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/swagger-ui/lib/jquery.ba-bbq.min.js b/brooklyn-ui/src/main/webapp/assets/swagger-ui/lib/jquery.ba-bbq.min.js
deleted file mode 100644
index f8678aa..0000000
--- a/brooklyn-ui/src/main/webapp/assets/swagger-ui/lib/jquery.ba-bbq.min.js
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-(function($,p){var i,m=Array.prototype.slice,r=decodeURIComponent,a=$.param,c,l,v,b=$.bbq=$.bbq||{},q,u,j,e=$.event.special,d="hashchange",A="querystring",D="fragment",y="elemUrlAttr",g="location",k="href",t="src",x=/^.*\?|#.*$/g,w=/^.*\#/,h,C={};function E(F){return typeof F==="string"}function B(G){var F=m.call(arguments,1);return function(){return G.apply(this,F.concat(m.call(arguments)))}}function n(F){return F.replace(/^[^#]*#?(.*)$/,"$1")}function o(F){return F.replace(/(?:^[^?#]*\?([^#]*).*$)?.*/,"$1")}function f(H,M,F,I,G){var O,L,K,N,J;if(I!==i){K=F.match(H?/^([^#]*)\#?(.*)$/:/^([^#?]*)\??([^#]*)(#?.*)/);J=K[3]||"";if(G===2&&E(I)){L=I.replace(H?w:x,"")}else{N=l(K[2]);I=E(I)?l[H?D:A](I):I;L=G===2?I:G===1?$.extend({},I,N):$.extend({},N,I);L=a(L);if(H){L=L.replace(h,r)}}O=K[1]+(H?"#":L||!K[1]?"?":"")+L+J}else{O=M(F!==i?F:p[g][k])}return O}a[A]=B(f,0,o);a[D]=c=B(f,1,n);c.noEscape=function(G){G=G||"";var F=$.map(G.split(""),encodeURIComponent);h=new RegExp(F.join("|"),"g")};c.no
 Escape(",/");$.deparam=l=function(I,F){var H={},G={"true":!0,"false":!1,"null":null};$.each(I.replace(/\+/g," ").split("&"),function(L,Q){var K=Q.split("="),P=r(K[0]),J,O=H,M=0,R=P.split("]["),N=R.length-1;if(/\[/.test(R[0])&&/\]$/.test(R[N])){R[N]=R[N].replace(/\]$/,"");R=R.shift().split("[").concat(R);N=R.length-1}else{N=0}if(K.length===2){J=r(K[1]);if(F){J=J&&!isNaN(J)?+J:J==="undefined"?i:G[J]!==i?G[J]:J}if(N){for(;M<=N;M++){P=R[M]===""?O.length:R[M];O=O[P]=M<N?O[P]||(R[M+1]&&isNaN(R[M+1])?{}:[]):J}}else{if($.isArray(H[P])){H[P].push(J)}else{if(H[P]!==i){H[P]=[H[P],J]}else{H[P]=J}}}}else{if(P){H[P]=F?i:""}}});return H};function z(H,F,G){if(F===i||typeof F==="boolean"){G=F;F=a[H?D:A]()}else{F=E(F)?F.replace(H?w:x,""):F}return l(F,G)}l[A]=B(z,0);l[D]=v=B(z,1);$[y]||($[y]=function(F){return $.extend(C,F)})({a:k,base:k,iframe:t,img:t,input:t,form:"action",link:k,script:t});j=$[y];function s(I,G,H,F){if(!E(H)&&typeof H!=="object"){F=H;H=G;G=i}return this.each(function(){var L=$(this)
 ,J=G||j()[(this.nodeName||"").toLowerCase()]||"",K=J&&L.attr(J)||"";L.attr(J,a[I](K,H,F))})}$.fn[A]=B(s,A);$.fn[D]=B(s,D);b.pushState=q=function(I,F){if(E(I)&&/^#/.test(I)&&F===i){F=2}var H=I!==i,G=c(p[g][k],H?I:{},H?F:2);p[g][k]=G+(/#/.test(G)?"":"#")};b.getState=u=function(F,G){return F===i||typeof F==="boolean"?v(F):v(G)[F]};b.removeState=function(F){var G={};if(F!==i){G=u();$.each($.isArray(F)?F:arguments,function(I,H){delete G[H]})}q(G,2)};e[d]=$.extend(e[d],{add:function(F){var H;function G(J){var I=J[D]=c();J.getState=function(K,L){return K===i||typeof K==="boolean"?l(I,K):l(I,L)[K]};H.apply(this,arguments)}if($.isFunction(F)){H=F;return G}else{H=F.handler;F.handler=G}}})})(jQuery,this);
-/*
- * jQuery hashchange event - v1.2 - 2/11/2010
- * http://benalman.com/projects/jquery-hashchange-plugin/
- * 
- * Copyright (c) 2010 "Cowboy" Ben Alman
- * Dual licensed under the MIT and GPL licenses.
- * http://benalman.com/about/license/
- */
-(function($,i,b){var j,k=$.event.special,c="location",d="hashchange",l="href",f=$.browser,g=document.documentMode,h=f.msie&&(g===b||g<8),e="on"+d in i&&!h;function a(m){m=m||i[c][l];return m.replace(/^[^#]*#?(.*)$/,"$1")}$[d+"Delay"]=100;k[d]=$.extend(k[d],{setup:function(){if(e){return false}$(j.start)},teardown:function(){if(e){return false}$(j.stop)}});j=(function(){var m={},r,n,o,q;function p(){o=q=function(s){return s};if(h){n=$('<iframe src="javascript:0"/>').hide().insertAfter("body")[0].contentWindow;q=function(){return a(n.document[c][l])};o=function(u,s){if(u!==s){var t=n.document;t.open().close();t[c].hash="#"+u}};o(a())}}m.start=function(){if(r){return}var t=a();o||p();(function s(){var v=a(),u=q(t);if(v!==t){o(t=v,u);$(i).trigger(d)}else{if(u!==t){i[c][l]=i[c][l].replace(/#.*/,"")+"#"+u}}r=setTimeout(s,$[d+"Delay"])})()};m.stop=function(){if(!n){r&&clearTimeout(r);r=0}};return m})()})(jQuery,this);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/swagger-ui/lib/jquery.wiggle.min.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/swagger-ui/lib/jquery.wiggle.min.js b/brooklyn-ui/src/main/webapp/assets/swagger-ui/lib/jquery.wiggle.min.js
deleted file mode 100644
index 75a37ce..0000000
--- a/brooklyn-ui/src/main/webapp/assets/swagger-ui/lib/jquery.wiggle.min.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/*
-jQuery Wiggle
-Author: WonderGroup, Jordan Thomas
-URL: http://labs.wondergroup.com/demos/mini-ui/index.html
-License: MIT (http://en.wikipedia.org/wiki/MIT_License)
-*/
-jQuery.fn.wiggle=function(o){var d={speed:50,wiggles:3,travel:5,callback:null};var o=jQuery.extend(d,o);return this.each(function(){var cache=this;var wrap=jQuery(this).wrap('<div class="wiggle-wrap"></div>').css("position","relative");var calls=0;for(i=1;i<=o.wiggles;i++){jQuery(this).animate({left:"-="+o.travel},o.speed).animate({left:"+="+o.travel*2},o.speed*2).animate({left:"-="+o.travel},o.speed,function(){calls++;if(jQuery(cache).parent().hasClass('wiggle-wrap')){jQuery(cache).parent().replaceWith(cache);}
-if(calls==o.wiggles&&jQuery.isFunction(o.callback)){o.callback();}});}});};
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/swagger-ui/lib/marked.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/swagger-ui/lib/marked.js b/brooklyn-ui/src/main/webapp/assets/swagger-ui/lib/marked.js
deleted file mode 100644
index b47cfef..0000000
--- a/brooklyn-ui/src/main/webapp/assets/swagger-ui/lib/marked.js
+++ /dev/null
@@ -1,1285 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-;(function() {
-
-/**
- * Block-Level Grammar
- */
-
-var block = {
-  newline: /^\n+/,
-  code: /^( {4}[^\n]+\n*)+/,
-  fences: noop,
-  hr: /^( *[-*_]){3,} *(?:\n+|$)/,
-  heading: /^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,
-  nptable: noop,
-  lheading: /^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,
-  blockquote: /^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,
-  list: /^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,
-  html: /^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,
-  def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,
-  table: noop,
-  paragraph: /^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,
-  text: /^[^\n]+/
-};
-
-block.bullet = /(?:[*+-]|\d+\.)/;
-block.item = /^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/;
-block.item = replace(block.item, 'gm')
-  (/bull/g, block.bullet)
-  ();
-
-block.list = replace(block.list)
-  (/bull/g, block.bullet)
-  ('hr', '\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))')
-  ('def', '\\n+(?=' + block.def.source + ')')
-  ();
-
-block.blockquote = replace(block.blockquote)
-  ('def', block.def)
-  ();
-
-block._tag = '(?!(?:'
-  + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code'
-  + '|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo'
-  + '|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b';
-
-block.html = replace(block.html)
-  ('comment', /<!--[\s\S]*?-->/)
-  ('closed', /<(tag)[\s\S]+?<\/\1>/)
-  ('closing', /<tag(?:"[^"]*"|'[^']*'|[^'">])*?>/)
-  (/tag/g, block._tag)
-  ();
-
-block.paragraph = replace(block.paragraph)
-  ('hr', block.hr)
-  ('heading', block.heading)
-  ('lheading', block.lheading)
-  ('blockquote', block.blockquote)
-  ('tag', '<' + block._tag)
-  ('def', block.def)
-  ();
-
-/**
- * Normal Block Grammar
- */
-
-block.normal = merge({}, block);
-
-/**
- * GFM Block Grammar
- */
-
-block.gfm = merge({}, block.normal, {
-  fences: /^ *(`{3,}|~{3,}) *(\S+)? *\n([\s\S]+?)\s*\1 *(?:\n+|$)/,
-  paragraph: /^/
-});
-
-block.gfm.paragraph = replace(block.paragraph)
-  ('(?!', '(?!'
-    + block.gfm.fences.source.replace('\\1', '\\2') + '|'
-    + block.list.source.replace('\\1', '\\3') + '|')
-  ();
-
-/**
- * GFM + Tables Block Grammar
- */
-
-block.tables = merge({}, block.gfm, {
-  nptable: /^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,
-  table: /^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/
-});
-
-/**
- * Block Lexer
- */
-
-function Lexer(options) {
-  this.tokens = [];
-  this.tokens.links = {};
-  this.options = options || marked.defaults;
-  this.rules = block.normal;
-
-  if (this.options.gfm) {
-    if (this.options.tables) {
-      this.rules = block.tables;
-    } else {
-      this.rules = block.gfm;
-    }
-  }
-}
-
-/**
- * Expose Block Rules
- */
-
-Lexer.rules = block;
-
-/**
- * Static Lex Method
- */
-
-Lexer.lex = function(src, options) {
-  var lexer = new Lexer(options);
-  return lexer.lex(src);
-};
-
-/**
- * Preprocessing
- */
-
-Lexer.prototype.lex = function(src) {
-  src = src
-    .replace(/\r\n|\r/g, '\n')
-    .replace(/\t/g, '    ')
-    .replace(/\u00a0/g, ' ')
-    .replace(/\u2424/g, '\n');
-
-  return this.token(src, true);
-};
-
-/**
- * Lexing
- */
-
-Lexer.prototype.token = function(src, top, bq) {
-  var src = src.replace(/^ +$/gm, '')
-    , next
-    , loose
-    , cap
-    , bull
-    , b
-    , item
-    , space
-    , i
-    , l;
-
-  while (src) {
-    // newline
-    if (cap = this.rules.newline.exec(src)) {
-      src = src.substring(cap[0].length);
-      if (cap[0].length > 1) {
-        this.tokens.push({
-          type: 'space'
-        });
-      }
-    }
-
-    // code
-    if (cap = this.rules.code.exec(src)) {
-      src = src.substring(cap[0].length);
-      cap = cap[0].replace(/^ {4}/gm, '');
-      this.tokens.push({
-        type: 'code',
-        text: !this.options.pedantic
-          ? cap.replace(/\n+$/, '')
-          : cap
-      });
-      continue;
-    }
-
-    // fences (gfm)
-    if (cap = this.rules.fences.exec(src)) {
-      src = src.substring(cap[0].length);
-      this.tokens.push({
-        type: 'code',
-        lang: cap[2],
-        text: cap[3]
-      });
-      continue;
-    }
-
-    // heading
-    if (cap = this.rules.heading.exec(src)) {
-      src = src.substring(cap[0].length);
-      this.tokens.push({
-        type: 'heading',
-        depth: cap[1].length,
-        text: cap[2]
-      });
-      continue;
-    }
-
-    // table no leading pipe (gfm)
-    if (top && (cap = this.rules.nptable.exec(src))) {
-      src = src.substring(cap[0].length);
-
-      item = {
-        type: 'table',
-        header: cap[1].replace(/^ *| *\| *$/g, '').split(/ *\| */),
-        align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */),
-        cells: cap[3].replace(/\n$/, '').split('\n')
-      };
-
-      for (i = 0; i < item.align.length; i++) {
-        if (/^ *-+: *$/.test(item.align[i])) {
-          item.align[i] = 'right';
-        } else if (/^ *:-+: *$/.test(item.align[i])) {
-          item.align[i] = 'center';
-        } else if (/^ *:-+ *$/.test(item.align[i])) {
-          item.align[i] = 'left';
-        } else {
-          item.align[i] = null;
-        }
-      }
-
-      for (i = 0; i < item.cells.length; i++) {
-        item.cells[i] = item.cells[i].split(/ *\| */);
-      }
-
-      this.tokens.push(item);
-
-      continue;
-    }
-
-    // lheading
-    if (cap = this.rules.lheading.exec(src)) {
-      src = src.substring(cap[0].length);
-      this.tokens.push({
-        type: 'heading',
-        depth: cap[2] === '=' ? 1 : 2,
-        text: cap[1]
-      });
-      continue;
-    }
-
-    // hr
-    if (cap = this.rules.hr.exec(src)) {
-      src = src.substring(cap[0].length);
-      this.tokens.push({
-        type: 'hr'
-      });
-      continue;
-    }
-
-    // blockquote
-    if (cap = this.rules.blockquote.exec(src)) {
-      src = src.substring(cap[0].length);
-
-      this.tokens.push({
-        type: 'blockquote_start'
-      });
-
-      cap = cap[0].replace(/^ *> ?/gm, '');
-
-      // Pass `top` to keep the current
-      // "toplevel" state. This is exactly
-      // how markdown.pl works.
-      this.token(cap, top, true);
-
-      this.tokens.push({
-        type: 'blockquote_end'
-      });
-
-      continue;
-    }
-
-    // list
-    if (cap = this.rules.list.exec(src)) {
-      src = src.substring(cap[0].length);
-      bull = cap[2];
-
-      this.tokens.push({
-        type: 'list_start',
-        ordered: bull.length > 1
-      });
-
-      // Get each top-level item.
-      cap = cap[0].match(this.rules.item);
-
-      next = false;
-      l = cap.length;
-      i = 0;
-
-      for (; i < l; i++) {
-        item = cap[i];
-
-        // Remove the list item's bullet
-        // so it is seen as the next token.
-        space = item.length;
-        item = item.replace(/^ *([*+-]|\d+\.) +/, '');
-
-        // Outdent whatever the
-        // list item contains. Hacky.
-        if (~item.indexOf('\n ')) {
-          space -= item.length;
-          item = !this.options.pedantic
-            ? item.replace(new RegExp('^ {1,' + space + '}', 'gm'), '')
-            : item.replace(/^ {1,4}/gm, '');
-        }
-
-        // Determine whether the next list item belongs here.
-        // Backpedal if it does not belong in this list.
-        if (this.options.smartLists && i !== l - 1) {
-          b = block.bullet.exec(cap[i + 1])[0];
-          if (bull !== b && !(bull.length > 1 && b.length > 1)) {
-            src = cap.slice(i + 1).join('\n') + src;
-            i = l - 1;
-          }
-        }
-
-        // Determine whether item is loose or not.
-        // Use: /(^|\n)(?! )[^\n]+\n\n(?!\s*$)/
-        // for discount behavior.
-        loose = next || /\n\n(?!\s*$)/.test(item);
-        if (i !== l - 1) {
-          next = item.charAt(item.length - 1) === '\n';
-          if (!loose) loose = next;
-        }
-
-        this.tokens.push({
-          type: loose
-            ? 'loose_item_start'
-            : 'list_item_start'
-        });
-
-        // Recurse.
-        this.token(item, false, bq);
-
-        this.tokens.push({
-          type: 'list_item_end'
-        });
-      }
-
-      this.tokens.push({
-        type: 'list_end'
-      });
-
-      continue;
-    }
-
-    // html
-    if (cap = this.rules.html.exec(src)) {
-      src = src.substring(cap[0].length);
-      this.tokens.push({
-        type: this.options.sanitize
-          ? 'paragraph'
-          : 'html',
-        pre: cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style',
-        text: cap[0]
-      });
-      continue;
-    }
-
-    // def
-    if ((!bq && top) && (cap = this.rules.def.exec(src))) {
-      src = src.substring(cap[0].length);
-      this.tokens.links[cap[1].toLowerCase()] = {
-        href: cap[2],
-        title: cap[3]
-      };
-      continue;
-    }
-
-    // table (gfm)
-    if (top && (cap = this.rules.table.exec(src))) {
-      src = src.substring(cap[0].length);
-
-      item = {
-        type: 'table',
-        header: cap[1].replace(/^ *| *\| *$/g, '').split(/ *\| */),
-        align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */),
-        cells: cap[3].replace(/(?: *\| *)?\n$/, '').split('\n')
-      };
-
-      for (i = 0; i < item.align.length; i++) {
-        if (/^ *-+: *$/.test(item.align[i])) {
-          item.align[i] = 'right';
-        } else if (/^ *:-+: *$/.test(item.align[i])) {
-          item.align[i] = 'center';
-        } else if (/^ *:-+ *$/.test(item.align[i])) {
-          item.align[i] = 'left';
-        } else {
-          item.align[i] = null;
-        }
-      }
-
-      for (i = 0; i < item.cells.length; i++) {
-        item.cells[i] = item.cells[i]
-          .replace(/^ *\| *| *\| *$/g, '')
-          .split(/ *\| */);
-      }
-
-      this.tokens.push(item);
-
-      continue;
-    }
-
-    // top-level paragraph
-    if (top && (cap = this.rules.paragraph.exec(src))) {
-      src = src.substring(cap[0].length);
-      this.tokens.push({
-        type: 'paragraph',
-        text: cap[1].charAt(cap[1].length - 1) === '\n'
-          ? cap[1].slice(0, -1)
-          : cap[1]
-      });
-      continue;
-    }
-
-    // text
-    if (cap = this.rules.text.exec(src)) {
-      // Top-level should never reach here.
-      src = src.substring(cap[0].length);
-      this.tokens.push({
-        type: 'text',
-        text: cap[0]
-      });
-      continue;
-    }
-
-    if (src) {
-      throw new
-        Error('Infinite loop on byte: ' + src.charCodeAt(0));
-    }
-  }
-
-  return this.tokens;
-};
-
-/**
- * Inline-Level Grammar
- */
-
-var inline = {
-  escape: /^\\([\\`*{}\[\]()#+\-.!_>])/,
-  autolink: /^<([^ >]+(@|:\/)[^ >]+)>/,
-  url: noop,
-  tag: /^<!--[\s\S]*?-->|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,
-  link: /^!?\[(inside)\]\(href\)/,
-  reflink: /^!?\[(inside)\]\s*\[([^\]]*)\]/,
-  nolink: /^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,
-  strong: /^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,
-  em: /^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,
-  code: /^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,
-  br: /^ {2,}\n(?!\s*$)/,
-  del: noop,
-  text: /^[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)/
-};
-
-inline._inside = /(?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*/;
-inline._href = /\s*<?([\s\S]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*/;
-
-inline.link = replace(inline.link)
-  ('inside', inline._inside)
-  ('href', inline._href)
-  ();
-
-inline.reflink = replace(inline.reflink)
-  ('inside', inline._inside)
-  ();
-
-/**
- * Normal Inline Grammar
- */
-
-inline.normal = merge({}, inline);
-
-/**
- * Pedantic Inline Grammar
- */
-
-inline.pedantic = merge({}, inline.normal, {
-  strong: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,
-  em: /^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/
-});
-
-/**
- * GFM Inline Grammar
- */
-
-inline.gfm = merge({}, inline.normal, {
-  escape: replace(inline.escape)('])', '~|])')(),
-  url: /^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,
-  del: /^~~(?=\S)([\s\S]*?\S)~~/,
-  text: replace(inline.text)
-    (']|', '~]|')
-    ('|', '|https?://|')
-    ()
-});
-
-/**
- * GFM + Line Breaks Inline Grammar
- */
-
-inline.breaks = merge({}, inline.gfm, {
-  br: replace(inline.br)('{2,}', '*')(),
-  text: replace(inline.gfm.text)('{2,}', '*')()
-});
-
-/**
- * Inline Lexer & Compiler
- */
-
-function InlineLexer(links, options) {
-  this.options = options || marked.defaults;
-  this.links = links;
-  this.rules = inline.normal;
-  this.renderer = this.options.renderer || new Renderer;
-  this.renderer.options = this.options;
-
-  if (!this.links) {
-    throw new
-      Error('Tokens array requires a `links` property.');
-  }
-
-  if (this.options.gfm) {
-    if (this.options.breaks) {
-      this.rules = inline.breaks;
-    } else {
-      this.rules = inline.gfm;
-    }
-  } else if (this.options.pedantic) {
-    this.rules = inline.pedantic;
-  }
-}
-
-/**
- * Expose Inline Rules
- */
-
-InlineLexer.rules = inline;
-
-/**
- * Static Lexing/Compiling Method
- */
-
-InlineLexer.output = function(src, links, options) {
-  var inline = new InlineLexer(links, options);
-  return inline.output(src);
-};
-
-/**
- * Lexing/Compiling
- */
-
-InlineLexer.prototype.output = function(src) {
-  var out = ''
-    , link
-    , text
-    , href
-    , cap;
-
-  while (src) {
-    // escape
-    if (cap = this.rules.escape.exec(src)) {
-      src = src.substring(cap[0].length);
-      out += cap[1];
-      continue;
-    }
-
-    // autolink
-    if (cap = this.rules.autolink.exec(src)) {
-      src = src.substring(cap[0].length);
-      if (cap[2] === '@') {
-        text = cap[1].charAt(6) === ':'
-          ? this.mangle(cap[1].substring(7))
-          : this.mangle(cap[1]);
-        href = this.mangle('mailto:') + text;
-      } else {
-        text = escape(cap[1]);
-        href = text;
-      }
-      out += this.renderer.link(href, null, text);
-      continue;
-    }
-
-    // url (gfm)
-    if (!this.inLink && (cap = this.rules.url.exec(src))) {
-      src = src.substring(cap[0].length);
-      text = escape(cap[1]);
-      href = text;
-      out += this.renderer.link(href, null, text);
-      continue;
-    }
-
-    // tag
-    if (cap = this.rules.tag.exec(src)) {
-      if (!this.inLink && /^<a /i.test(cap[0])) {
-        this.inLink = true;
-      } else if (this.inLink && /^<\/a>/i.test(cap[0])) {
-        this.inLink = false;
-      }
-      src = src.substring(cap[0].length);
-      out += this.options.sanitize
-        ? escape(cap[0])
-        : cap[0];
-      continue;
-    }
-
-    // link
-    if (cap = this.rules.link.exec(src)) {
-      src = src.substring(cap[0].length);
-      this.inLink = true;
-      out += this.outputLink(cap, {
-        href: cap[2],
-        title: cap[3]
-      });
-      this.inLink = false;
-      continue;
-    }
-
-    // reflink, nolink
-    if ((cap = this.rules.reflink.exec(src))
-        || (cap = this.rules.nolink.exec(src))) {
-      src = src.substring(cap[0].length);
-      link = (cap[2] || cap[1]).replace(/\s+/g, ' ');
-      link = this.links[link.toLowerCase()];
-      if (!link || !link.href) {
-        out += cap[0].charAt(0);
-        src = cap[0].substring(1) + src;
-        continue;
-      }
-      this.inLink = true;
-      out += this.outputLink(cap, link);
-      this.inLink = false;
-      continue;
-    }
-
-    // strong
-    if (cap = this.rules.strong.exec(src)) {
-      src = src.substring(cap[0].length);
-      out += this.renderer.strong(this.output(cap[2] || cap[1]));
-      continue;
-    }
-
-    // em
-    if (cap = this.rules.em.exec(src)) {
-      src = src.substring(cap[0].length);
-      out += this.renderer.em(this.output(cap[2] || cap[1]));
-      continue;
-    }
-
-    // code
-    if (cap = this.rules.code.exec(src)) {
-      src = src.substring(cap[0].length);
-      out += this.renderer.codespan(escape(cap[2], true));
-      continue;
-    }
-
-    // br
-    if (cap = this.rules.br.exec(src)) {
-      src = src.substring(cap[0].length);
-      out += this.renderer.br();
-      continue;
-    }
-
-    // del (gfm)
-    if (cap = this.rules.del.exec(src)) {
-      src = src.substring(cap[0].length);
-      out += this.renderer.del(this.output(cap[1]));
-      continue;
-    }
-
-    // text
-    if (cap = this.rules.text.exec(src)) {
-      src = src.substring(cap[0].length);
-      out += escape(this.smartypants(cap[0]));
-      continue;
-    }
-
-    if (src) {
-      throw new
-        Error('Infinite loop on byte: ' + src.charCodeAt(0));
-    }
-  }
-
-  return out;
-};
-
-/**
- * Compile Link
- */
-
-InlineLexer.prototype.outputLink = function(cap, link) {
-  var href = escape(link.href)
-    , title = link.title ? escape(link.title) : null;
-
-  return cap[0].charAt(0) !== '!'
-    ? this.renderer.link(href, title, this.output(cap[1]))
-    : this.renderer.image(href, title, escape(cap[1]));
-};
-
-/**
- * Smartypants Transformations
- */
-
-InlineLexer.prototype.smartypants = function(text) {
-  if (!this.options.smartypants) return text;
-  return text
-    // em-dashes
-    .replace(/--/g, '\u2014')
-    // opening singles
-    .replace(/(^|[-\u2014/(\[{"\s])'/g, '$1\u2018')
-    // closing singles & apostrophes
-    .replace(/'/g, '\u2019')
-    // opening doubles
-    .replace(/(^|[-\u2014/(\[{\u2018\s])"/g, '$1\u201c')
-    // closing doubles
-    .replace(/"/g, '\u201d')
-    // ellipses
-    .replace(/\.{3}/g, '\u2026');
-};
-
-/**
- * Mangle Links
- */
-
-InlineLexer.prototype.mangle = function(text) {
-  var out = ''
-    , l = text.length
-    , i = 0
-    , ch;
-
-  for (; i < l; i++) {
-    ch = text.charCodeAt(i);
-    if (Math.random() > 0.5) {
-      ch = 'x' + ch.toString(16);
-    }
-    out += '&#' + ch + ';';
-  }
-
-  return out;
-};
-
-/**
- * Renderer
- */
-
-function Renderer(options) {
-  this.options = options || {};
-}
-
-Renderer.prototype.code = function(code, lang, escaped) {
-  if (this.options.highlight) {
-    var out = this.options.highlight(code, lang);
-    if (out != null && out !== code) {
-      escaped = true;
-      code = out;
-    }
-  }
-
-  if (!lang) {
-    return '<pre><code>'
-      + (escaped ? code : escape(code, true))
-      + '\n</code></pre>';
-  }
-
-  return '<pre><code class="'
-    + this.options.langPrefix
-    + escape(lang, true)
-    + '">'
-    + (escaped ? code : escape(code, true))
-    + '\n</code></pre>\n';
-};
-
-Renderer.prototype.blockquote = function(quote) {
-  return '<blockquote>\n' + quote + '</blockquote>\n';
-};
-
-Renderer.prototype.html = function(html) {
-  return html;
-};
-
-Renderer.prototype.heading = function(text, level, raw) {
-  return '<h'
-    + level
-    + ' id="'
-    + this.options.headerPrefix
-    + raw.toLowerCase().replace(/[^\w]+/g, '-')
-    + '">'
-    + text
-    + '</h'
-    + level
-    + '>\n';
-};
-
-Renderer.prototype.hr = function() {
-  return this.options.xhtml ? '<hr/>\n' : '<hr>\n';
-};
-
-Renderer.prototype.list = function(body, ordered) {
-  var type = ordered ? 'ol' : 'ul';
-  return '<' + type + '>\n' + body + '</' + type + '>\n';
-};
-
-Renderer.prototype.listitem = function(text) {
-  return '<li>' + text + '</li>\n';
-};
-
-Renderer.prototype.paragraph = function(text) {
-  return '<p>' + text + '</p>\n';
-};
-
-Renderer.prototype.table = function(header, body) {
-  return '<table>\n'
-    + '<thead>\n'
-    + header
-    + '</thead>\n'
-    + '<tbody>\n'
-    + body
-    + '</tbody>\n'
-    + '</table>\n';
-};
-
-Renderer.prototype.tablerow = function(content) {
-  return '<tr>\n' + content + '</tr>\n';
-};
-
-Renderer.prototype.tablecell = function(content, flags) {
-  var type = flags.header ? 'th' : 'td';
-  var tag = flags.align
-    ? '<' + type + ' style="text-align:' + flags.align + '">'
-    : '<' + type + '>';
-  return tag + content + '</' + type + '>\n';
-};
-
-// span level renderer
-Renderer.prototype.strong = function(text) {
-  return '<strong>' + text + '</strong>';
-};
-
-Renderer.prototype.em = function(text) {
-  return '<em>' + text + '</em>';
-};
-
-Renderer.prototype.codespan = function(text) {
-  return '<code>' + text + '</code>';
-};
-
-Renderer.prototype.br = function() {
-  return this.options.xhtml ? '<br/>' : '<br>';
-};
-
-Renderer.prototype.del = function(text) {
-  return '<del>' + text + '</del>';
-};
-
-Renderer.prototype.link = function(href, title, text) {
-  if (this.options.sanitize) {
-    try {
-      var prot = decodeURIComponent(unescape(href))
-        .replace(/[^\w:]/g, '')
-        .toLowerCase();
-    } catch (e) {
-      return '';
-    }
-    if (prot.indexOf('javascript:') === 0) {
-      return '';
-    }
-  }
-  var out = '<a href="' + href + '"';
-  if (title) {
-    out += ' title="' + title + '"';
-  }
-  out += '>' + text + '</a>';
-  return out;
-};
-
-Renderer.prototype.image = function(href, title, text) {
-  var out = '<img src="' + href + '" alt="' + text + '"';
-  if (title) {
-    out += ' title="' + title + '"';
-  }
-  out += this.options.xhtml ? '/>' : '>';
-  return out;
-};
-
-/**
- * Parsing & Compiling
- */
-
-function Parser(options) {
-  this.tokens = [];
-  this.token = null;
-  this.options = options || marked.defaults;
-  this.options.renderer = this.options.renderer || new Renderer;
-  this.renderer = this.options.renderer;
-  this.renderer.options = this.options;
-}
-
-/**
- * Static Parse Method
- */
-
-Parser.parse = function(src, options, renderer) {
-  var parser = new Parser(options, renderer);
-  return parser.parse(src);
-};
-
-/**
- * Parse Loop
- */
-
-Parser.prototype.parse = function(src) {
-  this.inline = new InlineLexer(src.links, this.options, this.renderer);
-  this.tokens = src.reverse();
-
-  var out = '';
-  while (this.next()) {
-    out += this.tok();
-  }
-
-  return out;
-};
-
-/**
- * Next Token
- */
-
-Parser.prototype.next = function() {
-  return this.token = this.tokens.pop();
-};
-
-/**
- * Preview Next Token
- */
-
-Parser.prototype.peek = function() {
-  return this.tokens[this.tokens.length - 1] || 0;
-};
-
-/**
- * Parse Text Tokens
- */
-
-Parser.prototype.parseText = function() {
-  var body = this.token.text;
-
-  while (this.peek().type === 'text') {
-    body += '\n' + this.next().text;
-  }
-
-  return this.inline.output(body);
-};
-
-/**
- * Parse Current Token
- */
-
-Parser.prototype.tok = function() {
-  switch (this.token.type) {
-    case 'space': {
-      return '';
-    }
-    case 'hr': {
-      return this.renderer.hr();
-    }
-    case 'heading': {
-      return this.renderer.heading(
-        this.inline.output(this.token.text),
-        this.token.depth,
-        this.token.text);
-    }
-    case 'code': {
-      return this.renderer.code(this.token.text,
-        this.token.lang,
-        this.token.escaped);
-    }
-    case 'table': {
-      var header = ''
-        , body = ''
-        , i
-        , row
-        , cell
-        , flags
-        , j;
-
-      // header
-      cell = '';
-      for (i = 0; i < this.token.header.length; i++) {
-        flags = { header: true, align: this.token.align[i] };
-        cell += this.renderer.tablecell(
-          this.inline.output(this.token.header[i]),
-          { header: true, align: this.token.align[i] }
-        );
-      }
-      header += this.renderer.tablerow(cell);
-
-      for (i = 0; i < this.token.cells.length; i++) {
-        row = this.token.cells[i];
-
-        cell = '';
-        for (j = 0; j < row.length; j++) {
-          cell += this.renderer.tablecell(
-            this.inline.output(row[j]),
-            { header: false, align: this.token.align[j] }
-          );
-        }
-
-        body += this.renderer.tablerow(cell);
-      }
-      return this.renderer.table(header, body);
-    }
-    case 'blockquote_start': {
-      var body = '';
-
-      while (this.next().type !== 'blockquote_end') {
-        body += this.tok();
-      }
-
-      return this.renderer.blockquote(body);
-    }
-    case 'list_start': {
-      var body = ''
-        , ordered = this.token.ordered;
-
-      while (this.next().type !== 'list_end') {
-        body += this.tok();
-      }
-
-      return this.renderer.list(body, ordered);
-    }
-    case 'list_item_start': {
-      var body = '';
-
-      while (this.next().type !== 'list_item_end') {
-        body += this.token.type === 'text'
-          ? this.parseText()
-          : this.tok();
-      }
-
-      return this.renderer.listitem(body);
-    }
-    case 'loose_item_start': {
-      var body = '';
-
-      while (this.next().type !== 'list_item_end') {
-        body += this.tok();
-      }
-
-      return this.renderer.listitem(body);
-    }
-    case 'html': {
-      var html = !this.token.pre && !this.options.pedantic
-        ? this.inline.output(this.token.text)
-        : this.token.text;
-      return this.renderer.html(html);
-    }
-    case 'paragraph': {
-      return this.renderer.paragraph(this.inline.output(this.token.text));
-    }
-    case 'text': {
-      return this.renderer.paragraph(this.parseText());
-    }
-  }
-};
-
-/**
- * Helpers
- */
-
-function escape(html, encode) {
-  return html
-    .replace(!encode ? /&(?!#?\w+;)/g : /&/g, '&amp;')
-    .replace(/</g, '&lt;')
-    .replace(/>/g, '&gt;')
-    .replace(/"/g, '&quot;')
-    .replace(/'/g, '&#39;');
-}
-
-function unescape(html) {
-  return html.replace(/&([#\w]+);/g, function(_, n) {
-    n = n.toLowerCase();
-    if (n === 'colon') return ':';
-    if (n.charAt(0) === '#') {
-      return n.charAt(1) === 'x'
-        ? String.fromCharCode(parseInt(n.substring(2), 16))
-        : String.fromCharCode(+n.substring(1));
-    }
-    return '';
-  });
-}
-
-function replace(regex, opt) {
-  regex = regex.source;
-  opt = opt || '';
-  return function self(name, val) {
-    if (!name) return new RegExp(regex, opt);
-    val = val.source || val;
-    val = val.replace(/(^|[^\[])\^/g, '$1');
-    regex = regex.replace(name, val);
-    return self;
-  };
-}
-
-function noop() {}
-noop.exec = noop;
-
-function merge(obj) {
-  var i = 1
-    , target
-    , key;
-
-  for (; i < arguments.length; i++) {
-    target = arguments[i];
-    for (key in target) {
-      if (Object.prototype.hasOwnProperty.call(target, key)) {
-        obj[key] = target[key];
-      }
-    }
-  }
-
-  return obj;
-}
-
-
-/**
- * Marked
- */
-
-function marked(src, opt, callback) {
-  if (callback || typeof opt === 'function') {
-    if (!callback) {
-      callback = opt;
-      opt = null;
-    }
-
-    opt = merge({}, marked.defaults, opt || {});
-
-    var highlight = opt.highlight
-      , tokens
-      , pending
-      , i = 0;
-
-    try {
-      tokens = Lexer.lex(src, opt)
-    } catch (e) {
-      return callback(e);
-    }
-
-    pending = tokens.length;
-
-    var done = function(err) {
-      if (err) {
-        opt.highlight = highlight;
-        return callback(err);
-      }
-
-      var out;
-
-      try {
-        out = Parser.parse(tokens, opt);
-      } catch (e) {
-        err = e;
-      }
-
-      opt.highlight = highlight;
-
-      return err
-        ? callback(err)
-        : callback(null, out);
-    };
-
-    if (!highlight || highlight.length < 3) {
-      return done();
-    }
-
-    delete opt.highlight;
-
-    if (!pending) return done();
-
-    for (; i < tokens.length; i++) {
-      (function(token) {
-        if (token.type !== 'code') {
-          return --pending || done();
-        }
-        return highlight(token.text, token.lang, function(err, code) {
-          if (err) return done(err);
-          if (code == null || code === token.text) {
-            return --pending || done();
-          }
-          token.text = code;
-          token.escaped = true;
-          --pending || done();
-        });
-      })(tokens[i]);
-    }
-
-    return;
-  }
-  try {
-    if (opt) opt = merge({}, marked.defaults, opt);
-    return Parser.parse(Lexer.lex(src, opt), opt);
-  } catch (e) {
-    e.message += '\nPlease report this to https://github.com/chjj/marked.';
-    if ((opt || marked.defaults).silent) {
-      return '<p>An error occured:</p><pre>'
-        + escape(e.message + '', true)
-        + '</pre>';
-    }
-    throw e;
-  }
-}
-
-/**
- * Options
- */
-
-marked.options =
-marked.setOptions = function(opt) {
-  merge(marked.defaults, opt);
-  return marked;
-};
-
-marked.defaults = {
-  gfm: true,
-  tables: true,
-  breaks: false,
-  pedantic: false,
-  sanitize: false,
-  smartLists: false,
-  silent: false,
-  highlight: null,
-  langPrefix: 'lang-',
-  smartypants: false,
-  headerPrefix: '',
-  renderer: new Renderer,
-  xhtml: false
-};
-
-/**
- * Expose
- */
-
-marked.Parser = Parser;
-marked.parser = Parser.parse;
-
-marked.Renderer = Renderer;
-
-marked.Lexer = Lexer;
-marked.lexer = Lexer.lex;
-
-marked.InlineLexer = InlineLexer;
-marked.inlineLexer = InlineLexer.output;
-
-marked.parse = marked;
-
-if (typeof module !== 'undefined' && typeof exports === 'object') {
-  module.exports = marked;
-} else if (typeof define === 'function' && define.amd) {
-  define(function() { return marked; });
-} else {
-  this.marked = marked;
-}
-
-}).call(function() {
-  return this || (typeof window !== 'undefined' ? window : global);
-}());
\ No newline at end of file


[02/51] [abbrv] [partial] brooklyn-ui git commit: move subdir from incubator up a level as it is promoted to its own repo (first non-incubator commit!)

Posted by he...@apache.org.
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/js/view/change-name-invoke.js
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/js/view/change-name-invoke.js b/src/main/webapp/assets/js/view/change-name-invoke.js
new file mode 100644
index 0000000..30c2277
--- /dev/null
+++ b/src/main/webapp/assets/js/view/change-name-invoke.js
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+*/
+/**
+ * Render entity expungement as a modal
+ */
+define([
+    "underscore", "jquery", "backbone", "brooklyn-utils",
+    "text!tpl/apps/change-name-modal.html"
+], function(_, $, Backbone, Util, ChangeNameModalHtml) {
+    return Backbone.View.extend({
+        template: _.template(ChangeNameModalHtml),
+        initialize: function() {
+            this.title = "Change Name of "+this.options.entity.get('name');
+        },
+        render: function() {
+            this.$el.html(this.template({ name: this.options.entity.get('name') }));
+            return this;
+        },
+        onSubmit: function() {
+            var self = this;
+            var newName = this.$("#new-name").val();
+            var url = this.options.entity.get('links').rename + "?name=" + encodeURIComponent(newName);
+            var ajax = $.ajax({
+                type: "POST",
+                url: url,
+                contentType: "application/json",
+                success: function() {
+                    self.options.target.reload();
+                },
+                error: function(response) {
+                    self.showError(Util.extractError(response, "Error contacting server", url));
+                }
+            });
+            return ajax;
+        },
+        showError: function (message) {
+            this.$(".change-name-error-container").removeClass("hide");
+            this.$(".change-name-error-message").html(message);
+        }
+    });
+});

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/js/view/effector-invoke.js
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/js/view/effector-invoke.js b/src/main/webapp/assets/js/view/effector-invoke.js
new file mode 100644
index 0000000..7c9e0bd
--- /dev/null
+++ b/src/main/webapp/assets/js/view/effector-invoke.js
@@ -0,0 +1,171 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+*/
+/**
+ * Render an entity effector as a modal.
+ */
+define([
+    "underscore", "jquery", "backbone",
+    "model/location",
+    "text!tpl/apps/effector-modal.html",
+    "text!tpl/app-add-wizard/deploy-location-row.html", 
+    "text!tpl/app-add-wizard/deploy-location-option.html",
+    "text!tpl/apps/param.html",
+    "text!tpl/apps/param-list.html",
+    "bootstrap"
+], function (_, $, Backbone, Location, EffectorModalHtml, 
+        DeployLocationRowHtml, DeployLocationOptionHtml, ParamHtml, ParamListHtml) {
+
+    var EffectorInvokeView = Backbone.View.extend({
+        template:_.template(EffectorModalHtml),
+        locationRowTemplate:_.template(DeployLocationRowHtml),
+        locationOptionTemplate:_.template(DeployLocationOptionHtml),
+        effectorParam:_.template(ParamHtml),
+        effectorParamList:_.template(ParamListHtml),
+
+        events:{
+            "click .invoke-effector":"invokeEffector",
+            "shown": "onShow",
+            "hide": "onHide"
+        },
+
+        initialize:function () {
+            this.locations = this.options.locations /* for testing */
+              || new Location.Collection();
+        },
+
+        onShow: function() {
+            this.delegateEvents();
+            this.$el.fadeTo(500,1);
+        },
+
+        onHide: function() {
+            this.undelegateEvents();
+        },
+
+        render:function () {
+            var that = this, params = this.model.get("parameters")
+            this.$el.html(this.template({
+                name:this.model.get("name"),
+                entityName:this.options.entity.get("name"),
+                description:this.model.get("description")?this.model.get("description"):""
+            }))
+            // do we have parameters to render?
+            if (params.length !== 0) {
+                this.$(".modal-body").html(this.effectorParamList({}))
+                // select the body of the table we just rendered and append params
+                var $tbody = this.$("tbody")
+                _(params).each(function (param) {
+                    // TODO: this should be another view whose implementation is specific to
+                    // the type of the parameter (i.e. text, dates, checkboxes etc. can all
+                    // be handled separately).
+                    $tbody.append(that.effectorParam({
+                        name:param.name,
+                        type:param.type,
+                        description:param.description?param.description:"",
+                        defaultValue:param.defaultValue
+                    }))
+                })
+                var container = this.$("#selector-container")
+                if (container.length) {                    
+                    this.locations.fetch({async:false})
+                    container.empty()
+                    var chosenLocation = this.locations[0];
+                    container.append(that.locationRowTemplate({
+                        initialValue : chosenLocation,
+                        rowId : 0
+                    }))
+                    var $selectLocations = container.find('.select-location')
+                        .append(this.locationOptionTemplate({
+                                id: "",
+                                name: "None"
+                            }))
+                        .append("<option disabled>------</option>");
+                    this.locations.each(function(aLocation) {
+                        var $option = that.locationOptionTemplate({
+                            id:aLocation.id,
+                            url:aLocation.getLinkByName("self"),
+                            name:aLocation.getPrettyName()
+                        })
+                        $selectLocations.append($option)
+                    })
+                    $selectLocations.each(function(i) {
+                        var url = $($selectLocations[i]).parent().attr('initialValue');
+                        $($selectLocations[i]).val(url)
+                    })
+                }
+            }
+            this.$(".modal-body").find('*[rel="tooltip"]').tooltip()
+            return this
+        },
+
+        extractParamsFromTable:function () {
+            var parameters = {};
+
+            // iterate over the rows
+            // TODO: this should be generic alongside the rendering of parameters.
+            this.$(".effector-param").each(function (index) {
+                var key = $(this).find(".param-name").text();
+                var valElement = $(this).find(".param-value");
+                var value;
+                if (valElement.attr('id') == 'selector-container') {
+                    value = $(this).find(".param-value option:selected").attr("value")
+                } else if (valElement.is(":checkbox")) {
+                    value = ("checked" == valElement.attr("checked")) ? "true" : "false";
+                } else {
+                    value = valElement.val();
+                }
+                //treat empty field as null value
+                if (value !== '') {
+                    parameters[key] = value;
+                }
+            });
+            return parameters
+        },
+
+        invokeEffector:function () {
+            var that = this
+            var url = this.model.getLinkByName("self")
+            var parameters = this.extractParamsFromTable()
+            this.$el.fadeTo(500,0.5);
+            $.ajax({
+                type:"POST",
+                url:url+"?timeout=0",
+                data:JSON.stringify(parameters),
+                contentType:"application/json",
+                success:function (data) {
+                    that.$el.modal("hide")
+                    that.$el.fadeTo(500,1);
+                    if (that.options.openTask)
+                        that.options.tabView.openTab('activities/subtask/'+data.id);
+                },
+                error: function(data) {
+                    that.$el.fadeTo(100,1).delay(200).fadeTo(200,0.2).delay(200).fadeTo(200,1);
+                    // TODO render the error better than poor-man's flashing
+                    // (would just be connection error -- with timeout=0 we get a task even for invalid input)
+                    
+                    console.error("ERROR invoking effector")
+                    console.debug(data)
+                }})
+            // un-delegate events
+            this.undelegateEvents()
+        }
+
+    })
+    return EffectorInvokeView
+})

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/js/view/entity-activities.js
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/js/view/entity-activities.js b/src/main/webapp/assets/js/view/entity-activities.js
new file mode 100644
index 0000000..07dc948
--- /dev/null
+++ b/src/main/webapp/assets/js/view/entity-activities.js
@@ -0,0 +1,249 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+*/
+/**
+ * Displays the list of activities/tasks the entity performed.
+ */
+define([
+    "underscore", "jquery", "backbone", "brooklyn-utils", "view/viewutils",
+    "view/activity-details",
+    "text!tpl/apps/activities.html", "text!tpl/apps/activity-table.html", 
+    "text!tpl/apps/activity-row-details.html", "text!tpl/apps/activity-row-details-main.html",
+    "text!tpl/apps/activity-full-details.html", 
+    "bootstrap", "jquery-datatables", "datatables-extensions", "moment"
+], function (_, $, Backbone, Util, ViewUtils, ActivityDetailsView, 
+    ActivitiesHtml, ActivityTableHtml, ActivityRowDetailsHtml, ActivityRowDetailsMainHtml, ActivityFullDetailsHtml) {
+
+    var ActivitiesView = Backbone.View.extend({
+        template:_.template(ActivitiesHtml),
+        table:null,
+        refreshActive:true,
+        selectedId:null,
+        selectedRow:null,
+        events:{
+            "click #activities-root .activity-table tr":"rowClick",
+            'click #activities-root .refresh':'refreshNow',
+            'click #activities-root .toggleAutoRefresh':'toggleAutoRefresh',
+            'click #activities-root .showDrillDown':'showDrillDown',
+            'click #activities-root .toggleFullDetail':'toggleFullDetail'
+        },
+        initialize:function () {
+            _.bindAll(this)
+            this.$el.html(this.template({ }));
+            this.$('#activities-root').html(_.template(ActivityTableHtml))
+            var that = this,
+                $table = that.$('#activities-root .activity-table');
+            that.collection.url = that.model.getLinkByName("activities");
+            that.table = ViewUtils.myDataTable($table, {
+                "fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
+                    $(nRow).attr('id', aData[0])
+                    $(nRow).addClass('activity-row')
+                },
+                "aaSorting": [[ 2, "desc" ]],
+                "aoColumnDefs": [
+                                 {
+                                     "mRender": function ( data, type, row ) {
+                                         return Util.escape(data)
+                                     },
+                                     "aTargets": [ 1, 3 ]
+                                 },
+                                 {
+                                     "mRender": function ( data, type, row ) {
+                                         if ( type === 'display' ) {
+                                             data = moment(data).calendar();
+                                         }
+                                         return Util.escape(data)
+                                     },
+                                     "aTargets": [ 2 ]
+                                 },
+                                 { "bVisible": false,  "aTargets": [ 0 ] }
+                             ]            
+            });
+            
+            // TODO domain-specific filters
+            ViewUtils.addAutoRefreshButton(that.table);
+            ViewUtils.addRefreshButton(that.table);
+            
+            ViewUtils.fadeToIndicateInitialLoad($table);
+            that.collection.on("reset", that.renderOnLoad, that);
+            ViewUtils.fetchRepeatedlyWithDelay(this, this.collection, 
+                    { fetchOptions: { reset: true }, doitnow: true, 
+                    enablement: function() { return that.refreshActive }  });
+        },
+        refreshNow: function() {
+            this.collection.fetch({reset: true});
+        },
+        render:function () {
+            this.updateActivitiesNow();
+            var details = this.options.tabView ? this.options.tabView.options.preselectTabDetails : null;
+            if (details && details!=this.lastPreselectTabDetails) {
+                this.lastPreselectTabDetails = details;
+                // should be a path
+                this.queuedTasksToOpen = details.split("/");
+            }
+            this.tryOpenQueuedTasks();
+            return this;
+        },
+        tryOpenQueuedTasks: function() {
+            if (!this.queuedTasksToOpen || this.tryingOpenQueuedTasks) return;
+            this.openingQueuedTasks = true;
+            var $lastActivityPanel = null;
+            while (true) {
+                var task = this.queuedTasksToOpen.shift();
+                if (task == undefined) {
+                    this.openingQueuedTasks = false;                    
+                    return;
+                }
+                if (task == 'subtask') {
+                    var subtask = this.queuedTasksToOpen.shift();
+                    $lastActivityPanel = this.showDrillDownTask(subtask, $lastActivityPanel);
+                } else {
+                    log("unknown queued task for activities panel: "+task)
+                    // skip it, just continue
+                }
+            }
+        },
+        beforeClose:function () {
+            this.collection.off("reset", this.renderOnLoad);
+        },
+        renderOnLoad: function() {
+            this.loaded = true;
+            this.render();
+            ViewUtils.cancelFadeOnceLoaded(this.table);
+        },
+        toggleAutoRefresh:function () {
+            ViewUtils.toggleAutoRefresh(this);
+        },
+        enableAutoRefresh: function(isEnabled) {
+            this.refreshActive = isEnabled
+        },
+        refreshNow: function() {
+            this.collection.fetch();
+            this.table.fnAdjustColumnSizing();
+        },
+        updateActivitiesNow: function() {
+            var that = this;
+            if (this.table == null || this.collection.length==0 || this.viewIsClosed) {
+                // nothing to do
+            } else {
+                var topLevelTasks = []
+                for (taskI in this.collection.models) {
+                    var task = this.collection.models[taskI]
+                    var submitter = task.get("submittedByTask")
+                    if ((submitter==null) ||
+                        (submitter!=null && this.collection.get(submitter.metadata.id)==null)
+                    ) {                        
+                        topLevelTasks.push(task)
+                    }
+                }
+                ViewUtils.updateMyDataTable(that.table, topLevelTasks, function(task, index) {
+                    return [ task.get("id"),
+                             task.get("displayName"),
+                             task.get("submitTimeUtc"),
+                             task.get("currentStatus")
+                    ]; 
+                });
+                this.showDetailRow(true);
+            }
+            return this;
+        },
+        rowClick:function(evt) {
+            var row = $(evt.currentTarget).closest("tr");
+            var id = row.attr("id");
+            if (id==null)
+                // is the details row, ignore click here
+                return;
+            this.showDrillDownTask(id);
+            return;
+        },
+        showDrillDown: function(event) {
+            this.showDrillDownTask($(event.currentTarget).closest("td.row-expansion").attr("id"));
+        },
+        showDrillDownTask: function(taskId, optionalParent) {  
+//            log("showing initial drill down "+taskId)
+            var that = this;
+            
+            var activityDetailsPanel = new ActivityDetailsView({
+                taskId: taskId,
+                tabView: that,
+                collection: this.collection,
+                breadcrumbs: ''
+            })
+            activityDetailsPanel.addToView(optionalParent || this.$(".activity-table"));
+            return activityDetailsPanel.$el;
+        },
+        
+        showDetailRow: function(updateOnly) {
+            var id = this.selectedId,
+                that = this;
+            if (id==null) return;
+            var task = this.collection.get(id);
+            if (task==null) return;
+            if (!updateOnly) {
+                var html = _.template(ActivityRowDetailsHtml, { 
+                    task: task==null ? null : task.attributes,
+                    link: that.model.getLinkByName("activities")+"/"+id,
+                    updateOnly: updateOnly
+                })
+                $('tr#'+id).next().find('td.row-expansion').html(html)
+                $('tr#'+id).next().find('td.row-expansion').attr('id', id)
+            } else {
+                // just update
+                $('tr#'+id).next().find('.task-description').html(Util.escape(task.attributes.description))
+            }
+            
+            var html = _.template(ActivityRowDetailsMainHtml, { 
+                task: task==null ? null : task.attributes,
+                link: that.model.getLinkByName("activities")+"/"+id,
+                updateOnly: updateOnly 
+            })
+            $('tr#'+id).next().find('.expansion-main').html(html)
+            
+            
+            if (!updateOnly) {
+                $('tr#'+id).next().find('.row-expansion .opened-row-details').hide()
+                $('tr#'+id).next().find('.row-expansion .opened-row-details').slideDown(300)
+            }
+        },
+        toggleFullDetail: function(evt) {
+            var i = $('.toggleFullDetail');
+            var id = i.closest("td.row-expansion").attr('id')
+            i.toggleClass('active')
+            if (i.hasClass('active'))
+                this.showFullActivity(id)
+            else
+                this.hideFullActivity(id)
+        },
+        showFullActivity: function(id) {
+            id = this.selectedId
+            var $details = $("td.row-expansion#"+id+" .expansion-footer");
+            var task = this.collection.get(id);
+            var html = _.template(ActivityFullDetailsHtml, { task: task });
+            $details.html(html);
+            $details.slideDown(100);
+            _.defer(function() { ViewUtils.setHeightAutomatically($('textarea',$details), 30, 200) })
+        },
+        hideFullActivity: function(id) {
+            id = this.selectedId
+            var $details = $("td.row-expansion#"+id+" .expansion-footer");
+            $details.slideUp(100);
+        }
+    });
+
+    return ActivitiesView;
+});

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/js/view/entity-advanced.js
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/js/view/entity-advanced.js b/src/main/webapp/assets/js/view/entity-advanced.js
new file mode 100644
index 0000000..fe18430
--- /dev/null
+++ b/src/main/webapp/assets/js/view/entity-advanced.js
@@ -0,0 +1,177 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+*/
+/**
+ * Render entity advanced tab.
+ *
+ * @type {*}
+ */
+define(["underscore", "jquery", "backbone", "brooklyn", "brooklyn-utils", "view/viewutils",
+    "text!tpl/apps/advanced.html", "view/change-name-invoke", "view/add-child-invoke", "view/policy-new"
+], function(_, $, Backbone, Brooklyn, Util, ViewUtils,
+        AdvancedHtml, ChangeNameInvokeView, AddChildInvokeView, NewPolicyView) {
+    var EntityAdvancedView = Backbone.View.extend({
+        events: {
+            "click button#change-name": "showChangeNameModal",
+            "click button#add-child": "showAddChildModal",
+            "click button#add-new-policy": "showNewPolicyModal",
+            "click button#reset-problems": "confirmResetProblems",
+            "click button#expunge": "confirmExpunge",
+            "click button#unmanage": "confirmUnmanage",
+            "click #advanced-tab-error-closer": "closeAdvancedTabError"
+        },
+        template: _.template(AdvancedHtml),
+        initialize:function() {
+            _.bindAll(this);
+            this.$el.html(this.template());
+
+            this.model.on('change', this.modelChange, this);
+            this.modelChange();
+            
+            ViewUtils.getRepeatedlyWithDelay(this, this.model.get('links').locations, this.renderLocationData);
+            ViewUtils.get(this, this.model.get('links').tags, this.renderTags);
+            
+            ViewUtils.attachToggler(this.$el);
+        },
+        modelChange: function() {
+            this.$('#entity-name').html(Util.toDisplayString(this.model.get("name")));
+            ViewUtils.updateTextareaWithData($("#advanced-entity-json", this.$el), Util.toTextAreaString(this.model), true, false, 250, 600);
+        },
+        renderLocationData: function(data) {
+            ViewUtils.updateTextareaWithData($("#advanced-locations", this.$el), Util.toTextAreaString(data), true, false, 250, 600);
+        },
+        renderTags: function(data) {
+            var list = "";
+            for (tag in data)
+                list += "<div class='activity-tag-giftlabel'>"+Util.toDisplayString(data[tag])+"</div>";
+            if (!list) list = "No tags";
+            this.$('#advanced-entity-tags').html(list);
+        },
+        reload: function() {
+            this.model.fetch();
+        },
+        
+        showModal: function(modal) {
+            if (this.activeModal)
+                this.activeModal.close();
+            this.activeModal = modal;
+            Brooklyn.view.showModalWith(modal);
+        },
+        showChangeNameModal: function() {
+            this.showModal(new ChangeNameInvokeView({
+                entity: this.model,
+                target:this
+            }));
+        },
+        showAddChildModal: function() {
+            this.showModal(new AddChildInvokeView({
+                entity: this.model,
+                target:this
+            }));
+        },
+        showNewPolicyModal: function () {
+            this.showModal(new NewPolicyView({
+                entity: this.model,
+            }));
+        },
+        
+        confirmResetProblems: function () {
+            var entity = this.model.get("name");
+            var title = "Confirm the reset of problem indicators in " + entity;
+            var q = "<p>Are you sure you want to reset the problem indicators for this entity?</p>" +
+                "<p>If a problem has been fixed externally, but the fix is not being detected, this will clear problems. " +
+                "If the problem is not actually fixed, many feeds and enrichers will re-detect it, but note that some may not, " +
+                "and the entity may show as healthy when it is not." +
+                "</p>";
+            Brooklyn.view.requestConfirmation(q, title).done(this.doResetProblems);
+        },
+        doResetProblems: function() {
+            this.post(this.model.get('links').sensors+"/"+"service.notUp.indicators", {});
+            this.post(this.model.get('links').sensors+"/"+"service.problems", {});
+        },
+        post: function(url, data) {
+            var self = this;
+            
+            $.ajax({
+                type: "POST",
+                url: url,
+                data: JSON.stringify(data),
+                contentType: "application/json",
+                success: function() {
+                    self.reload();
+                },
+                error: function(response) {
+                    self.showAdvancedTabError(Util.extractError(response, "Error contacting server", url));
+                }
+            });
+        },
+        
+        confirmExpunge: function () {
+            var entity = this.model.get("name");
+            var title = "Confirm the expunging of " + entity;
+            var q = "<p>Are you certain you want to expunge this entity?</p>" +
+                "<p>When possible, Brooklyn will delete all of its resources.</p>" +
+                "<p><span class='label label-important'>Important</span> " +
+                "<b>This action is irreversible</b></p>";
+            this.unmanageAndOrExpunge(q, title, true);
+        },
+        confirmUnmanage: function () {
+            var entity = this.model.get("name");
+            var title = "Confirm the unmanagement of " + entity;
+            var q = "<p>Are you certain you want to unmanage this entity?</p>" +
+            "<p>Its resources will be left running.</p>" +
+            "<p><span class='label label-important'>Important</span> " +
+            "<b>This action is irreversible</b></p>";
+            this.unmanageAndOrExpunge(q, title, false);
+        },
+        unmanageAndOrExpunge: function (question, title, releaseResources) {
+            var self = this;
+            Brooklyn.view.requestConfirmation(question, title).done(function() {
+                return $.ajax({
+                    type: "POST",
+                    url: self.model.get("links").expunge + "?release=" + releaseResources + "&timeout=0",
+                    contentType: "application/json"
+                }).done(function() {
+                    self.trigger("entity.expunged");
+                }).fail(function() {
+                    // (would just be connection error -- with timeout=0 we get a task even for invalid input)
+                    self.showAdvancedTabError("Error connecting to Brooklyn server");
+                    
+                    log("ERROR unmanaging/expunging");
+                    log(data);
+                });
+            });
+        },
+
+        showAdvancedTabError: function(errorMessage) {
+            self.$("#advanced-tab-error-message").html(_.escape(errorMessage));
+            self.$("#advanced-tab-error-section").removeClass("hide");
+        },
+        closeAdvancedTabError: function() {
+            self.$("#advanced-tab-error-section").addClass("hide");
+        },
+        
+        beforeClose:function() {
+            if (this.activeModal)
+                this.activeModal.close();
+            this.options.tabView.configView.close();
+            this.model.off();
+        }
+    });
+    return EntityAdvancedView;
+});
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/js/view/entity-config.js
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/js/view/entity-config.js b/src/main/webapp/assets/js/view/entity-config.js
new file mode 100644
index 0000000..f517bcb
--- /dev/null
+++ b/src/main/webapp/assets/js/view/entity-config.js
@@ -0,0 +1,516 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+*/
+/**
+ * Render entity config tab.
+ *
+ * @type {*}
+ */
+define([
+    "underscore", "jquery", "backbone", "brooklyn-utils", "zeroclipboard", "view/viewutils", 
+    "model/config-summary", "text!tpl/apps/config.html", "text!tpl/apps/config-name.html",
+    "jquery-datatables", "datatables-extensions"
+], function (_, $, Backbone, Util, ZeroClipboard, ViewUtils, ConfigSummary, ConfigHtml, ConfigNameHtml) {
+
+    // TODO consider extracting all such usages to a shared ZeroClipboard wrapper?
+    ZeroClipboard.config({ moviePath: '//cdnjs.cloudflare.com/ajax/libs/zeroclipboard/1.3.1/ZeroClipboard.swf' });
+
+    var configHtml = _.template(ConfigHtml),
+        configNameHtml = _.template(ConfigNameHtml);
+
+    // TODO refactor to share code w entity-sensors.js
+    // in meantime, see notes there!
+    var EntityConfigView = Backbone.View.extend({
+        template: configHtml,
+        configMetadata:{},
+        refreshActive:true,
+        zeroClipboard: null,
+        
+        events:{
+            'click .refresh':'updateConfigNow',
+            'click .filterEmpty':'toggleFilterEmpty',
+            'click .toggleAutoRefresh':'toggleAutoRefresh',
+            'click #config-table div.secret-info':'toggleSecrecyVisibility',
+
+            'mouseup .valueOpen':'valueOpen',
+            'mouseover #config-table tbody tr':'noteFloatMenuActive',
+            'mouseout #config-table tbody tr':'noteFloatMenuSeemsInactive',
+            'mouseover .floatGroup':'noteFloatMenuActive',
+            'mouseout .floatGroup':'noteFloatMenuSeemsInactive',
+            'mouseover .clipboard-item':'noteFloatMenuActiveCI',
+            'mouseout .clipboard-item':'noteFloatMenuSeemsInactiveCI',
+            'mouseover .hasFloatLeft':'showFloatLeft',
+            'mouseover .hasFloatDown':'enterFloatDown',
+            'mouseout .hasFloatDown':'exitFloatDown',
+            'mouseup .light-popup-menu-item':'closeFloatMenuNow',
+        },
+        
+        initialize:function () {
+            _.bindAll(this);
+            this.$el.html(this.template());
+            
+            var that = this,
+                $table = this.$('#config-table');
+            that.table = ViewUtils.myDataTable($table, {
+                "fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
+                    $(nRow).attr('id', aData[0]);
+                    $('td',nRow).each(function(i,v){
+                        if (i==1) $(v).attr('class','config-value');
+                    });
+                    return nRow;
+                },
+                "aoColumnDefs": [
+                                 { // name (with tooltip)
+                                     "mRender": function ( data, type, row ) {
+                                         // name (column 1) should have tooltip title
+                                         var actions = that.getConfigActions(data.name);
+                                         // if data.description or .type is absent we get an error in html rendering (js)
+                                         // unless we set it explicitly (there is probably a nicer way to do this however?)
+                                         var context = _.extend(data, { 
+                                             description: data['description'], type: data['type']});
+                                         return configNameHtml(context);
+                                     },
+                                     "aTargets": [ 1 ]
+                                 },
+                                 { // value
+                                     "mRender": function ( data, type, row ) {
+                                         var escapedValue = Util.toDisplayString(data);
+                                         if (type!='display')
+                                             return escapedValue;
+                                         
+                                         var hasEscapedValue = (escapedValue!=null && (""+escapedValue).length > 0);
+                                             configName = row[0],
+                                             actions = that.getConfigActions(configName);
+                                         
+                                         // NB: the row might not yet exist
+                                         var $row = $('tr[id="'+configName+'"]');
+                                         
+                                         // datatables doesn't seem to expose any way to modify the html in place for a cell,
+                                         // so we rebuild
+                                         
+                                         var result = "<span class='value'>"+(hasEscapedValue ? escapedValue : '')+"</span>";
+                                         
+                                         var isSecret = Util.isSecret(configName);
+                                         if (isSecret) {
+                                            result += "<span class='secret-indicator'>(hidden)</span>";
+                                         }
+                                         
+                                         if (actions.open)
+                                             result = "<a href='"+actions.open+"'>" + result + "</a>";
+                                         if (escapedValue==null || escapedValue.length < 3)
+                                             // include whitespace so we can click on it, if it's really small
+                                             result += "&nbsp;&nbsp;&nbsp;&nbsp;";
+
+                                         var existing = $row.find('.dynamic-contents');
+                                         // for the json url, use the full url (relative to window.location.href)
+                                         var jsonUrl = actions.json ? new URI(actions.json).resolve(new URI(window.location.href)).toString() : null;
+                                         // prefer to update in place, so menus don't disappear, also more efficient
+                                         // (but if menu is changed, we do recreate it)
+                                         if (existing.length>0) {
+                                             if (that.checkFloatMenuUpToDate($row, actions.open, '.actions-open', 'open-target') &&
+                                                 that.checkFloatMenuUpToDate($row, escapedValue, '.actions-copy') &&
+                                                 that.checkFloatMenuUpToDate($row, actions.json, '.actions-json-open', 'open-target') &&
+                                                 that.checkFloatMenuUpToDate($row, jsonUrl, '.actions-json-copy', 'copy-value')) {
+//                                                 log("updating in place "+configName)
+                                                 existing.html(result);
+                                                 return $row.find('td.config-value').html();
+                                             }
+                                         }
+                                         
+                                         // build the menu - either because it is the first time, or the actions are stale
+//                                         log("creating "+configName);
+                                         
+                                         var downMenu = "";
+                                         if (actions.open)
+                                             downMenu += "<div class='light-popup-menu-item valueOpen actions-open' open-target='"+actions.open+"'>" +
+                                                    "Open</div>";
+                                         if (hasEscapedValue) downMenu +=
+                                             "<div class='light-popup-menu-item handy valueCopy actions-copy clipboard-item'>Copy Value</div>";
+                                         if (actions.json) downMenu +=
+                                             "<div class='light-popup-menu-item handy valueOpen actions-json-open' open-target='"+actions.json+"'>" +
+                                                 "Open REST Link</div>";
+                                         if (actions.json && hasEscapedValue) downMenu +=
+                                             "<div class='light-popup-menu-item handy valueCopy actions-json-copy clipboard-item' copy-value='"+
+                                                 jsonUrl+"'>Copy REST Link</div>";
+                                         if (downMenu=="") {
+//                                             log("no actions for "+configName);
+                                             downMenu += 
+                                                 "<div class='light-popup-menu-item'>(no actions)</div>";
+                                         }
+                                         downMenu = "<div class='floatDown'><div class='light-popup'><div class='light-popup-body'>"
+                                             + downMenu +
+                                             "</div></div></div>";
+                                         result = "<span class='hasFloatLeft dynamic-contents'>" + result +
+                                                "</span>" +
+                                                "<div class='floatLeft'><span class='icon-chevron-down hasFloatDown'></span>" +
+                                                downMenu +
+                                                "</div>";
+                                         result = "<div class='floatGroup"+
+                                            (isSecret ? " secret-info" : "")+
+                                            "'>" + result + "</div>";
+                                         // also see updateFloatMenus which wires up the JS for these classes
+                                         
+                                         return result;
+                                     },
+                                     "aTargets": [ 2 ]
+                                 },
+                                 // ID in column 0 is standard (assumed in ViewUtils)
+                                 { "bVisible": false,  "aTargets": [ 0 ] }
+                             ]            
+            });
+            
+            this.zeroClipboard = new ZeroClipboard();
+            this.zeroClipboard.on( "dataRequested" , function(client) {
+                try {
+                    // the zeroClipboard instance is a singleton so check our scope first
+                    if (!$(this).closest("#config-table").length) return;
+                    var text = $(this).attr('copy-value');
+                    if (!text) text = $(this).closest('.floatGroup').find('.value').text();
+                    
+//                    log("Copying config text '"+text+"' to clipboard");
+                    client.setText(text);
+
+                    // show the word "copied" for feedback;
+                    // NB this occurs on mousedown, due to how flash plugin works
+                    // (same style of feedback and interaction as github)
+                    // the other "clicks" are now triggered by *mouseup*
+                    var $widget = $(this);
+                    var oldHtml = $widget.html();
+                    $widget.html('<b>Copied!</b>');
+                    // use a timeout to restore because mouseouts can leave corner cases (see history)
+                    setTimeout(function() { $widget.html(oldHtml); }, 600);
+                } catch (e) {
+                    log("Zeroclipboard failure; falling back to prompt mechanism");
+                    log(e);
+                    Util.promptCopyToClipboard(text);
+                }
+            });
+            // these seem to arrive delayed sometimes, so we also work with the clipboard-item class events
+            this.zeroClipboard.on( "mouseover", function() { that.noteFloatMenuZeroClipboardItem(true, this); } );
+            this.zeroClipboard.on( "mouseout", function() { that.noteFloatMenuZeroClipboardItem(false, this); } );
+            this.zeroClipboard.on( "mouseup", function() { that.closeFloatMenuNow(); } );
+
+            ViewUtils.addFilterEmptyButton(this.table);
+            ViewUtils.addAutoRefreshButton(this.table);
+            ViewUtils.addRefreshButton(this.table);
+            this.loadConfigMetadata();
+            this.updateConfigPeriodically();
+            this.toggleFilterEmpty();
+            return this;
+        },
+
+        beforeClose: function () {
+            if (this.zeroClipboard) {
+                this.zeroClipboard.destroy();
+            }
+        },
+
+        floatMenuActive: false,
+        lastFloatMenuRowId: null,
+        lastFloatFocusInTextForEventUnmangling: null,
+        updateFloatMenus: function() {
+            $('#config-table *[rel="tooltip"]').tooltip();
+            this.zeroClipboard.clip( $('.valueCopy') );
+        },
+        showFloatLeft: function(event) {
+            this.noteFloatMenuFocusChange(true, event, "show-left");
+            this.showFloatLeftOf($(event.currentTarget));
+        },
+        showFloatLeftOf: function($hasFloatLeft) {
+            $hasFloatLeft.next('.floatLeft').show(); 
+        },
+        enterFloatDown: function(event) {
+            this.noteFloatMenuFocusChange(true, event, "show-down");
+//            log("entering float down");
+            var fdTarget = $(event.currentTarget);
+//            log( fdTarget );
+            this.floatDownFocus = fdTarget;
+            var that = this;
+            setTimeout(function() {
+                that.showFloatDownOf( fdTarget );
+            }, 200);
+        },
+        exitFloatDown: function(event) {
+//            log("exiting float down");
+            this.floatDownFocus = null;
+        },
+        showFloatDownOf: function($hasFloatDown) {
+            if ($hasFloatDown != this.floatDownFocus) {
+//                log("float down did not hover long enough");
+                return;
+            }
+            var down = $hasFloatDown.next('.floatDown');
+            down.show();
+            $('.light-popup', down).show(2000); 
+        },
+        noteFloatMenuActive: function(focus) { 
+            this.noteFloatMenuFocusChange(true, focus, "menu");
+            
+            // remove dangling zc events (these don't always get removed, apparent bug in zc event framework)
+            // this causes it to flash sometimes but that's better than leaving the old item highlighted
+            if (focus.toElement && $(focus.toElement).hasClass('clipboard-item')) {
+                // don't remove it
+            } else {
+                var zc = $(focus.target).closest('.floatGroup').find('div.zeroclipboard-is-hover');
+                zc.removeClass('zeroclipboard-is-hover');
+            }
+        },
+        noteFloatMenuSeemsInactive: function(focus) { this.noteFloatMenuFocusChange(false, focus, "menu"); },
+        noteFloatMenuActiveCI: function(focus) { this.noteFloatMenuFocusChange(true, focus, "menu-clip-item"); },
+        noteFloatMenuSeemsInactiveCI: function(focus) { this.noteFloatMenuFocusChange(false, focus, "menu-clip-item"); },
+        noteFloatMenuZeroClipboardItem: function(seemsActive,focus) { 
+            this.noteFloatMenuFocusChange(seemsActive, focus, "clipboard");
+            if (seemsActive) {
+                // make the table row highlighted (as the default hover event is lost)
+                // we remove it when the float group goes away
+                $(focus).closest('tr').addClass('zeroclipboard-is-hover');
+            } else {
+                // sometimes does not get removed by framework - though this doesn't seem to help
+                // as you can see by logging this before and after:
+//                log(""+$(focus).attr('class'))
+                // the problem is that the framework seems sometime to trigger this event before adding the class
+                // see in noteFloatMenuActive where we do a different check
+                $(focus).removeClass('zeroclipboard-is-hover');
+            }
+        },
+        noteFloatMenuFocusChange: function(seemsActive, focus, caller) {
+//            log(""+new Date().getTime()+" note active "+caller+" "+seemsActive);
+            var delayCheckFloat = true;
+            var focusRowId = null;
+            var focusElement = null;
+            if (focus) {
+                focusElement = focus.target ? focus.target : focus;
+                if (seemsActive) {
+                    this.lastFloatFocusInTextForEventUnmangling = $(focusElement).text();
+                    focusRowId = focus.target ? $(focus.target).closest('tr').attr('id') : $(focus).closest('tr').attr('id');
+                    if (this.floatMenuActive && focusRowId==this.lastFloatMenuRowId) {
+                        // lastFloatMenuRowId has not changed, when moving within a floatgroup
+                        // (but we still get mouseout events when the submenu changes)
+//                        log("redundant mousein from "+ focusRowId );
+                        return;
+                    }
+                } else {
+                    // on mouseout, skip events which are bogus
+                    // first, if the toElement is in the same floatGroup
+                    focusRowId = focus.toElement ? $(focus.toElement).closest('tr').attr('id') : null;
+                    if (focusRowId==this.lastFloatMenuRowId) {
+                        // lastFloatMenuRowId has not changed, when moving within a floatgroup
+                        // (but we still get mouseout events when the submenu changes)
+//                        log("skipping, internal mouseout from "+ focusRowId );
+                        return;
+                    }
+                    // check (a) it is the 'out' event corresponding to the most recent 'in'
+                    // (because there is a race where it can say  in1, in2, out1 rather than in1, out2, in2
+                    if ($(focusElement).text() != this.lastFloatFocusInTextForEventUnmangling) {
+//                        log("skipping, not most recent mouseout from "+ focusRowId );
+                        return;
+                    }
+                    if (focus.toElement) {
+                        if ($(focus.toElement).hasClass('global-zeroclipboard-container')) {
+//                            log("skipping out, as we are moving to clipboard container");
+                            return;
+                        }
+                        if (focus.toElement.name && focus.toElement.name=="global-zeroclipboard-flash-bridge") {
+//                            log("skipping out, as we are moving to clipboard movie");
+                            return;                            
+                        }
+                    }
+                } 
+            }           
+//            log( "moving to "+focusRowId );
+            if (seemsActive && focusRowId) {
+//                log("setting lastFloat when "+this.floatMenuActive + ", from "+this.lastFloatMenuRowId );
+                if (this.lastFloatMenuRowId != focusRowId) {
+                    if (this.lastFloatMenuRowId) {
+                        // the floating menu has changed, hide the old
+//                        log("hiding old menu on float-focus change");
+                        this.closeFloatMenuNow();
+                    }
+                }
+                // now show the new, if possible (might happen multiple times, but no matter
+                if (focusElement) {
+//                    log("ensuring row "+focusRowId+" is showing on change");
+                    this.showFloatLeftOf($(focusElement).closest('tr').find('.hasFloatLeft'));
+                    this.lastFloatMenuRowId = focusRowId;
+                } else {
+                    this.lastFloatMenuRowId = null;
+                }
+            }
+            this.floatMenuActive = seemsActive;
+            if (!seemsActive) {
+                this.scheduleCheckFloatMenuNeedsHiding(delayCheckFloat);
+            }
+        },
+        scheduleCheckFloatMenuNeedsHiding: function(delayCheckFloat) {
+            if (delayCheckFloat) {
+                this.checkTime = new Date().getTime()+299;
+                setTimeout(this.checkFloatMenuNeedsHiding, 300);
+            } else {
+                this.checkTime = new Date().getTime()-1;
+                this.checkFloatMenuNeedsHiding();
+            }
+        },
+        closeFloatMenuNow: function() {
+//            log("closing float menu due do direct call (eg click)");
+            this.checkTime = new Date().getTime()-1;
+            this.floatMenuActive = false;
+            this.checkFloatMenuNeedsHiding();
+        },
+        checkFloatMenuNeedsHiding: function() {
+//            log(""+new Date().getTime()+" checking float menu - "+this.floatMenuActive);
+            if (new Date().getTime() <= this.checkTime) {
+//                log("aborting check as another one scheduled");
+                return;
+            }
+            
+            // we use a flag to determine whether to hide the float menu
+            // because the embedded zero-clipboard flash objects cause floatGroup 
+            // to get a mouseout event when the "Copy" menu item is hovered
+            if (!this.floatMenuActive) {
+//                log("HIDING FLOAT MENU")
+                $('.floatLeft').hide(); 
+                $('.floatDown').hide();
+                $('.zeroclipboard-is-hover').removeClass('zeroclipboard-is-hover');
+                lastFloatMenuRowId = null;
+            } else {
+//                log("we're still in")
+            }
+        },
+        valueOpen: function(event) {
+            window.open($(event.target).attr('open-target'),'_blank');
+        },
+
+        render: function() {
+            return this;
+        },
+        checkFloatMenuUpToDate: function($row, actionValue, actionSelector, actionAttribute) {
+            if (typeof actionValue === 'undefined' || actionValue==null || actionValue=="") {
+                if ($row.find(actionSelector).length==0) return true;
+            } else {
+                if (actionAttribute) {
+                    if ($row.find(actionSelector).attr(actionAttribute)==actionValue) return true;
+                } else {
+                    if ($row.find(actionSelector).length>0) return true;
+                }
+            }
+            return false;
+        },
+        
+        /**
+         * Returns the actions loaded to view.configMetadata[name].actions
+         * for the given name, or an empty object.
+         */
+        getConfigActions: function(configName) {
+            var allMetadata = this.configMetadata || {};
+            var metadata = allMetadata[configName] || {};
+            return metadata.actions || {};
+        },
+
+        toggleFilterEmpty: function() {
+            ViewUtils.toggleFilterEmpty(this.$('#config-table'), 2);
+            return this;
+        },
+
+        toggleAutoRefresh: function() {
+            ViewUtils.toggleAutoRefresh(this);
+            return this;
+        },
+
+        enableAutoRefresh: function(isEnabled) {
+            this.refreshActive = isEnabled;
+            return this;
+        },
+        
+        toggleSecrecyVisibility: function(event) {
+            $(event.target).closest('.secret-info').toggleClass('secret-revealed');
+        },
+        
+        /**
+         * Loads current values for all config on an entity and updates config table.
+         */
+        isRefreshActive: function() { return this.refreshActive; },
+        updateConfigNow:function () {
+            var that = this;
+            ViewUtils.get(that, that.model.getConfigUpdateUrl(), that.updateWithData,
+                    { enablement: that.isRefreshActive });
+        },
+        updateConfigPeriodically:function () {
+            var that = this;
+            ViewUtils.getRepeatedlyWithDelay(that, that.model.getConfigUpdateUrl(), function(data) { that.updateWithData(data); },
+                    { enablement: that.isRefreshActive });
+        },
+        updateWithData: function (data) {
+            var that = this;
+            $table = that.$('#config-table');
+            var options = {};
+            
+            if (that.fullRedraw) {
+                options.refreshAllRows = true;
+                that.fullRedraw = false;
+            }
+            ViewUtils.updateMyDataTable($table, data, function(value, name) {
+                var metadata = that.configMetadata[name];
+                if (metadata==null) {                        
+                    // kick off reload metadata when this happens (new config for which no metadata known)
+                    // but only if we haven't loaded metadata for a while
+                    metadata = { 'name':name };
+                    that.configMetadata[name] = metadata; 
+                    that.loadConfigMetadataIfStale(name, 10000);
+                } 
+                return [name, metadata, value];
+            }, options);
+            
+            that.updateFloatMenus();
+        },
+
+        loadConfigMetadata: function() {
+            var url = this.model.getLinkByName('config'),
+                that = this;
+            that.lastConfigMetadataLoadTime = new Date().getTime();
+            $.get(url, function (data) {
+                _.each(data, function(config) {
+                    var actions = {};
+                    _.each(config.links, function(v, k) {
+                        if (k.slice(0, 7) == "action:") {
+                            actions[k.slice(7)] = v;
+                        }
+                    });
+                    that.configMetadata[config.name] = {
+                        name: config.name,
+                        description: config.description,
+                        actions: actions,
+                        type: config.type
+                    };
+                });
+                that.fullRedraw = true;
+                that.updateConfigNow();
+                that.table.find('*[rel="tooltip"]').tooltip();
+            });
+            return this;
+        },
+        
+        loadConfigMetadataIfStale: function(configName, recency) {
+            var that = this;
+            if (!that.lastConfigMetadataLoadTime || that.lastConfigMetadataLoadTime + recency < new Date().getTime()) {
+//                log("reloading metadata because new config "+configName+" identified")
+                that.loadConfigMetadata();
+            }
+        }
+    });
+    return EntityConfigView;
+});

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/js/view/entity-details.js
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/js/view/entity-details.js b/src/main/webapp/assets/js/view/entity-details.js
new file mode 100644
index 0000000..f54c572
--- /dev/null
+++ b/src/main/webapp/assets/js/view/entity-details.js
@@ -0,0 +1,180 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+*/
+/**
+ * Renders details information about an application (sensors, summary, effectors, etc.).
+ * 
+ * Options preselectTab (e.g. 'activities') and preselectTabDetails ('subtasks/1234') can be set
+ * before a render to cause the given tab / details to be opened.
+ * 
+ * @type {*}
+ */
+define([
+    "underscore", "jquery", "backbone", "./entity-summary", 
+    "./entity-sensors", "./entity-effectors", "./entity-policies",
+    "./entity-activities", "./entity-advanced", "model/task-summary", "text!tpl/apps/details.html"
+], function (_, $, Backbone, SummaryView, SensorsView, EffectorsView, PoliciesView, ActivitiesView, AdvancedView, TaskSummary, DetailsHtml) {
+
+    var EntityDetailsView = Backbone.View.extend({
+        template:_.template(DetailsHtml),
+        events:{
+            'click .entity-tabs a':'tabSelected'
+        },
+        initialize:function () {
+            var self = this;
+            var tasks = new TaskSummary.Collection;
+            
+            this.$el.html(this.template({}))
+            this.sensorsView = new SensorsView({
+                model:this.model,
+                tabView:this,
+            })
+            this.effectorsView = new EffectorsView({
+                model:this.model,
+                tabView:this,
+            })
+            this.policiesView = new PoliciesView({
+                model:this.model,
+                tabView:this,
+            })
+            this.activitiesView = new ActivitiesView({
+                model:this.model,
+                tabView:this,
+                collection:tasks
+            })
+            // summary comes after others because it uses the tasks
+            this.summaryView = new SummaryView({
+                model:this.model,
+                tabView:this,
+                application:this.options.application,
+                tasks:tasks,
+            })
+            this.advancedView = new AdvancedView({
+                model: this.model,
+                tabView:this,
+                application:this.options.application
+            });
+            // propagate to app tree view 
+            this.advancedView.on("entity.expunged", function() { self.trigger("entity.expunged"); })
+            
+            this.$("#summary").html(this.summaryView.render().el);
+            this.$("#sensors").html(this.sensorsView.render().el);
+            this.$("#effectors").html(this.effectorsView.render().el);
+            this.$("#policies").html(this.policiesView.render().el);
+            this.$("#activities").html(this.activitiesView.render().el);
+            this.$("#advanced").html(this.advancedView.render().el);
+        },
+        beforeClose:function () {
+            this.summaryView.close();
+            this.sensorsView.close();
+            this.effectorsView.close();
+            this.policiesView.close();
+            this.activitiesView.close();
+            this.advancedView.close();
+        },
+        getEntityHref: function() {
+            return $("#app-tree .entity_tree_node_wrapper.active a").attr("href");
+        },
+        render: function(optionalParent) {
+            this.summaryView.render()
+            this.sensorsView.render()
+            this.effectorsView.render()
+            this.policiesView.render()
+            this.activitiesView.render()
+            this.advancedView.render()
+            
+            if (optionalParent) {
+                optionalParent.html(this.el)
+            }
+            var entityHref = this.getEntityHref();
+            if (entityHref) {
+                $("a[data-toggle='tab']").each(function(i,a) {
+                    $(a).attr('href',entityHref+"/"+$(a).attr("data-target").slice(1));
+                });
+            } else {
+                log("could not find entity href for tab");
+            }
+            if (this.options.preselectTab) {
+                var tabLink = this.$('a[data-target="#'+this.options.preselectTab+'"]');
+                var showFn = function() { tabLink.tab('show'); };
+                if (optionalParent) showFn();
+                else _.defer(showFn);
+            }
+            return this;
+        },
+        tabSelected: function(event) {
+            // TODO: the bootstrap JS code still prevents shift-click from working
+            // have to add the following logic to bootstrap tab click handler also
+//            if (event.metaKey || event.shiftKey)
+//                // trying to open in a new tab, do not act on it here!
+//                return;
+            event.preventDefault();
+            
+            var tabName = $(event.currentTarget).attr("data-target").slice(1);
+            var route = this.getTab(tabName);
+            if (route) {
+                if (route[0]=='#') route = route.substring(1);
+                Backbone.history.navigate(route);
+            }
+            // caller will ensure tab is shown
+        },
+        getTab: function(tabName, entityId, entityHref) {
+            if (!entityHref) {
+                if (entityId) {
+                    entityHref = this.getEntityHref();
+                    if (!entityHref.endsWith(entityId)) {
+                        lastSlash = entityHref.lastIndexOf('/');
+                        if (lastSlash>=0) {
+                            entityHref = entityHref.substring(0, lastSlash+1) + '/' + entityId;
+                        } else {
+                            log("malformed entityHref when opening tab: "+entityHref)
+                            entityHref = this.getEntityHref();
+                        }
+                    }
+                } else {
+                    entityHref = this.getEntityHref();
+                }
+            }
+            if (entityHref && tabName)                
+                return entityHref+"/"+tabName;
+            return null;
+        },
+        /** for tabs to redirect to other tabs; entityId and entityHref are optional (can supply either, or null to use current entity); 
+         * tabPath is e.g. 'sensors' or 'activities/subtask/1234' */ 
+        openTab: function(tabPath, entityId, entityHref) {
+            var route = this.getTab(tabPath, entityId, entityHref);
+            if (!route) return;
+            if (route[0]=='#') route = route.substring(1);
+            Backbone.history.navigate(route);
+                
+            tabPaths = tabPath.split('/');
+            if (!tabPaths) return;
+            var tabName = tabPaths.shift();
+            if (!tabName)
+                // ignore leading /
+                tabName = tabPaths.shift();
+            if (!tabName) return;
+
+            this.options.preselectTab = tabName;
+            if (tabPaths)
+                this.options.preselectTabDetails = tabPaths.join('/');
+            this.render();
+        }
+    });
+    return EntityDetailsView;
+});
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/js/view/entity-effectors.js
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/js/view/entity-effectors.js b/src/main/webapp/assets/js/view/entity-effectors.js
new file mode 100644
index 0000000..974fbec
--- /dev/null
+++ b/src/main/webapp/assets/js/view/entity-effectors.js
@@ -0,0 +1,92 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+*/
+/**
+ * Render the effectors tab.You must supply the model and optionally the element
+ * on which the view binds itself.
+ *
+ * @type {*}
+ */
+define([
+    "underscore", "jquery", "backbone", "view/viewutils", "model/effector-summary",
+    "view/effector-invoke", "text!tpl/apps/effector.html", "text!tpl/apps/effector-row.html", "bootstrap"
+], function (_, $, Backbone, ViewUtils, EffectorSummary, EffectorInvokeView, EffectorHtml, EffectorRowHtml) {
+
+    var EntityEffectorsView = Backbone.View.extend({
+        template:_.template(EffectorHtml),
+        effectorRow:_.template(EffectorRowHtml),
+        events:{
+            "click .show-effector-modal":"showEffectorModal"
+        },
+        initialize:function () {
+            this.$el.html(this.template({}))
+            var that = this
+            this._effectors = new EffectorSummary.Collection()
+            // fetch the list of effectors and create a view for each one
+            this._effectors.url = this.model.getLinkByName("effectors")
+            that.loadedData = false;
+            ViewUtils.fadeToIndicateInitialLoad(this.$('#effectors-table'));
+            this.$(".has-no-effectors").hide();
+            
+            this._effectors.fetch({success:function () {
+                that.loadedData = true;
+                that.render()
+                ViewUtils.cancelFadeOnceLoaded(that.$('#effectors-table'));
+            }})
+            // attach a fetch simply to fade this tab when not available
+            // (the table is statically rendered)
+            ViewUtils.fetchRepeatedlyWithDelay(this, this._effectors, { period: 10*1000 })
+        },
+        render:function () {
+            if (this.viewIsClosed)
+                return;
+            var that = this
+            var $tableBody = this.$('#effectors-table tbody').empty()
+            if (this._effectors.length==0) {
+                if (that.loadedData)
+                    this.$(".has-no-effectors").show();
+            } else {                
+                this.$(".has-no-effectors").hide();
+                this._effectors.each(function (effector) {
+                    $tableBody.append(that.effectorRow({
+                        name:effector.get("name"),
+                        description:effector.get("description"),
+                        // cid is mapped to id (here) which is mapped to name (in Effector.Summary), 
+                        // so it is consistent across resets
+                        cid:effector.id
+                    }))
+                })
+            }
+            return this
+        },
+        showEffectorModal:function (eventName) {
+            // get the model that we need to show, create its view and show it
+            var cid = $(eventName.currentTarget).attr("id")
+            var effectorModel = this._effectors.get(cid);
+            var modal = new EffectorInvokeView({
+                el:"#effector-modal",
+                model:effectorModel,
+                entity:this.model,
+                tabView:this.options.tabView,
+                openTask:true
+            })
+            modal.render().$el.modal('show')
+        }
+    })
+    return EntityEffectorsView
+})
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/src/main/webapp/assets/js/view/entity-policies.js
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/js/view/entity-policies.js b/src/main/webapp/assets/js/view/entity-policies.js
new file mode 100644
index 0000000..74ba885
--- /dev/null
+++ b/src/main/webapp/assets/js/view/entity-policies.js
@@ -0,0 +1,244 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+*/
+/**
+ * Render the policies tab. You must supply the model and optionally the element
+ * on which the view binds itself.
+ */
+define([
+    "underscore", "jquery", "backbone", "brooklyn",
+    "model/policy-summary", "model/policy-config-summary",
+    "view/viewutils", "view/policy-config-invoke", "view/policy-new",
+    "text!tpl/apps/policy.html", "text!tpl/apps/policy-row.html", "text!tpl/apps/policy-config-row.html",
+    "jquery-datatables", "datatables-extensions"
+], function (_, $, Backbone, Brooklyn,
+        PolicySummary, PolicyConfigSummary,
+        ViewUtils, PolicyConfigInvokeView, NewPolicyView,
+        PolicyHtml, PolicyRowHtml, PolicyConfigRowHtml) {
+
+    var EntityPoliciesView = Backbone.View.extend({
+
+        template: _.template(PolicyHtml),
+        policyRow: _.template(PolicyRowHtml),
+
+        events:{
+            'click .refresh':'refreshPolicyConfigNow',
+            'click .filterEmpty':'toggleFilterEmpty',
+            "click #policies-table tr":"rowClick",
+            "click .policy-start":"callStart",
+            "click .policy-stop":"callStop",
+            "click .policy-destroy":"callDestroy",
+            "click .show-policy-config-modal":"showPolicyConfigModal",
+            "click .add-new-policy": "showNewPolicyModal"
+        },
+
+        initialize:function () {
+            _.bindAll(this)
+            this.$el.html(this.template({ }));
+            var that = this;
+            // fetch the list of policies and create a row for each one
+            that._policies = new PolicySummary.Collection();
+            that._policies.url = that.model.getLinkByName("policies");
+            
+            this.loadedData = false;
+            ViewUtils.fadeToIndicateInitialLoad(this.$('#policies-table'));
+            that.render();
+            this._policies.on("all", this.render, this)
+            ViewUtils.fetchRepeatedlyWithDelay(this, this._policies, {
+                doitnow: true,
+                success: function () {
+                    that.loadedData = true;
+                    ViewUtils.cancelFadeOnceLoaded(that.$('#policies-table'));
+                }});
+        },
+
+        render:function () {
+            if (this.viewIsClosed)
+                return;
+            var that = this,
+                $tbody = this.$('#policies-table tbody').empty();
+            if (that._policies.length==0) {
+                if (this.loadedData)
+                    this.$(".has-no-policies").show();
+                this.$("#policy-config").hide();
+                this.$("#policy-config-none-selected").hide();
+            } else {
+                this.$(".has-no-policies").hide();
+                that._policies.each(function (policy) {
+                    // TODO better to use datatables, and a json array, as we do elsewhere
+                    $tbody.append(that.policyRow({
+                        cid:policy.get("id"),
+                        name:policy.get("name"),
+                        state:policy.get("state"),
+                        summary:policy
+                    }));
+                    if (that.activePolicy) {
+                        that.$("#policies-table tr[id='"+that.activePolicy+"']").addClass("selected");
+                        that.showPolicyConfig(that.activePolicy);
+                        that.refreshPolicyConfig();
+                    } else {
+                        that.$("#policy-config").hide();
+                        that.$("#policy-config-none-selected").show();
+                    }
+                });
+            }
+            return that;
+        },
+
+        toggleFilterEmpty:function() {
+            ViewUtils.toggleFilterEmpty($('#policy-config-table'), 2);
+        },
+
+        refreshPolicyConfigNow:function () {
+            this.refreshPolicyConfig();  
+        },
+
+        rowClick:function(evt) {
+            evt.stopPropagation();
+            var row = $(evt.currentTarget).closest("tr"),
+                id = row.attr("id"),
+                policy = this._policies.get(id);
+            $("#policies-table tr").removeClass("selected");
+            if (this.activePolicy == id) {
+                // deselected
+                this.activePolicy = null;
+                this._config = null;
+                $("#policy-config-table").dataTable().fnDestroy();
+                $("#policy-config").slideUp(100);
+                $("#policy-config-none-selected").slideDown(100);
+            } else {
+                row.addClass("selected");
+                // fetch the list of policy config entries
+                this._config = new PolicyConfigSummary.Collection();
+                this._config.url = policy.getLinkByName("config");
+                ViewUtils.fadeToIndicateInitialLoad($('#policy-config-table'));
+                this.showPolicyConfig(id);
+                var that = this;
+                this._config.fetch().done(function () {
+                    that.showPolicyConfig(id);
+                    ViewUtils.cancelFadeOnceLoaded($('#policy-config-table'))
+                });
+            }
+        },
+
+        showPolicyConfig:function (activePolicyId) {
+            var that = this;
+            if (activePolicyId != null && that.activePolicy != activePolicyId) {
+                // TODO better to use a json array, as we do elsewhere
+                var $table = $('#policy-config-table'),
+                    $tbody = $table.find('tbody');
+                $table.dataTable().fnClearTable();
+                $("#policy-config-none-selected").slideUp(100);
+                if (that._config.length==0) {
+                    $(".has-no-policy-config").show();
+                } else {
+                    $(".has-no-policy-config").hide();
+                    that.activePolicy = activePolicyId;
+                    var policyConfigRow = _.template(PolicyConfigRowHtml);
+                    that._config.each(function (config) {
+                        $tbody.append(policyConfigRow({
+                            cid:config.cid,
+                            name:config.get("name"),
+                            description:config.get("description"),
+                            type:config.get("type"),
+                            reconfigurable:config.get("reconfigurable"),
+                            link:config.getLinkByName('self'),
+                            value: config.get("defaultValue")
+                        }));
+                        $tbody.find('*[rel="tooltip"]').tooltip();
+                    });
+                    that.currentStateUrl = that._policies.get(that.activePolicy).getLinkByName("config") + "/current-state";
+                    $("#policy-config").slideDown(100);
+                    $table.slideDown(100);
+                    ViewUtils.myDataTable($table, {
+                        "bAutoWidth": false,
+                        "aoColumns" : [
+                            { sWidth: '220px' },
+                            { sWidth: '240px' },
+                            { sWidth: '25px' }
+                        ]
+                    });
+                    $table.dataTable().fnAdjustColumnSizing();
+                }
+            }
+            that.refreshPolicyConfig();
+        },
+
+        refreshPolicyConfig:function() {
+            var that = this;
+            if (that.viewIsClosed || !that.currentStateUrl) return;
+            var $table = that.$('#policy-config-table').dataTable(),
+                $rows = that.$("tr.policy-config-row");
+            $.get(that.currentStateUrl, function (data) {
+                if (that.viewIsClosed) return;
+                // iterate over the sensors table and update each sensor
+                $rows.each(function (index, row) {
+                    var key = $(this).find(".policy-config-name").text();
+                    var v = data[key];
+                    if (v !== undefined) {
+                        $table.fnUpdate(_.escape(v), row, 1, false);
+                    }
+                });
+            });
+            $table.dataTable().fnStandingRedraw();
+        },
+
+        showPolicyConfigModal: function (evt) {
+            var cid = $(evt.currentTarget).attr("id");
+            var currentValue = $(evt.currentTarget)
+                .parent().parent()
+                .find(".policy-config-value")
+                .text();
+            Brooklyn.view.showModalWith(new PolicyConfigInvokeView({
+                model: this._config.get(cid),
+                policy: this.model,
+                currentValue: currentValue
+            }));
+        },
+
+        showNewPolicyModal: function () {
+            var self = this;
+            Brooklyn.view.showModalWith(new NewPolicyView({
+                entity: this.model,
+                onSave: function (policy) {
+                    console.log("New policy", policy);
+                    self._policies.add(policy);
+                }
+            }));
+        },
+
+        callStart:function(event) { this.doPost(event, "start"); },
+        callStop:function(event) { this.doPost(event, "stop"); },
+        callDestroy:function(event) { this.doPost(event, "destroy"); },
+        doPost:function(event, linkname) {
+            event.stopPropagation();
+            var that = this,
+                url = $(event.currentTarget).attr("link");
+            $.ajax({
+                type:"POST",
+                url:url,
+                success:function() {
+                    that._policies.fetch();
+                }
+            });
+        }
+
+    });
+
+    return EntityPoliciesView;
+});


[43/51] [abbrv] [partial] brooklyn-ui git commit: move subdir from incubator up a level as it is promoted to its own repo (first non-incubator commit!)

Posted by he...@apache.org.
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/js/libs/handlebars-1.0.rc.1.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/js/libs/handlebars-1.0.rc.1.js b/brooklyn-ui/src/main/webapp/assets/js/libs/handlebars-1.0.rc.1.js
deleted file mode 100644
index 6f54cd7..0000000
--- a/brooklyn-ui/src/main/webapp/assets/js/libs/handlebars-1.0.rc.1.js
+++ /dev/null
@@ -1,1928 +0,0 @@
-// NOTE FROM sjcorbett: There have been several new releases of handlebars.js, but 
-// Brooklyn's current version of swagger.js (md5sum 117c05807c33c73132a93edd715086d7)
-// will not work with anything greater than 1.0.rc.2.
-
-// Released under MIT license.  See https://github.com/wycats/handlebars.js .
-
-// ---- code below this line is unchanged by Brooklyn -----
-
-// lib/handlebars/base.js
-
-/*jshint eqnull:true*/
-this.Handlebars = {};
-
-(function(Handlebars) {
-
-Handlebars.VERSION = "1.0.rc.1";
-
-Handlebars.helpers  = {};
-Handlebars.partials = {};
-
-Handlebars.registerHelper = function(name, fn, inverse) {
-  if(inverse) { fn.not = inverse; }
-  this.helpers[name] = fn;
-};
-
-Handlebars.registerPartial = function(name, str) {
-  this.partials[name] = str;
-};
-
-Handlebars.registerHelper('helperMissing', function(arg) {
-  if(arguments.length === 2) {
-    return undefined;
-  } else {
-    throw new Error("Could not find property '" + arg + "'");
-  }
-});
-
-var toString = Object.prototype.toString, functionType = "[object Function]";
-
-Handlebars.registerHelper('blockHelperMissing', function(context, options) {
-  var inverse = options.inverse || function() {}, fn = options.fn;
-
-
-  var ret = "";
-  var type = toString.call(context);
-
-  if(type === functionType) { context = context.call(this); }
-
-  if(context === true) {
-    return fn(this);
-  } else if(context === false || context == null) {
-    return inverse(this);
-  } else if(type === "[object Array]") {
-    if(context.length > 0) {
-      return Handlebars.helpers.each(context, options);
-    } else {
-      return inverse(this);
-    }
-  } else {
-    return fn(context);
-  }
-});
-
-Handlebars.K = function() {};
-
-Handlebars.createFrame = Object.create || function(object) {
-  Handlebars.K.prototype = object;
-  var obj = new Handlebars.K();
-  Handlebars.K.prototype = null;
-  return obj;
-};
-
-Handlebars.registerHelper('each', function(context, options) {
-  var fn = options.fn, inverse = options.inverse;
-  var ret = "", data;
-
-  if (options.data) {
-    data = Handlebars.createFrame(options.data);
-  }
-
-  if(context && context.length > 0) {
-    for(var i=0, j=context.length; i<j; i++) {
-      if (data) { data.index = i; }
-      ret = ret + fn(context[i], { data: data });
-    }
-  } else {
-    ret = inverse(this);
-  }
-  return ret;
-});
-
-Handlebars.registerHelper('if', function(context, options) {
-  var type = toString.call(context);
-  if(type === functionType) { context = context.call(this); }
-
-  if(!context || Handlebars.Utils.isEmpty(context)) {
-    return options.inverse(this);
-  } else {
-    return options.fn(this);
-  }
-});
-
-Handlebars.registerHelper('unless', function(context, options) {
-  var fn = options.fn, inverse = options.inverse;
-  options.fn = inverse;
-  options.inverse = fn;
-
-  return Handlebars.helpers['if'].call(this, context, options);
-});
-
-Handlebars.registerHelper('with', function(context, options) {
-  return options.fn(context);
-});
-
-Handlebars.registerHelper('log', function(context) {
-  Handlebars.log(context);
-});
-
-}(this.Handlebars));
-;
-// lib/handlebars/compiler/parser.js
-/* Jison generated parser */
-var handlebars = (function(){
-var parser = {trace: function trace() { },
-yy: {},
-symbols_: {"error":2,"root":3,"program":4,"EOF":5,"statements":6,"simpleInverse":7,"statement":8,"openInverse":9,"closeBlock":10,"openBlock":11,"mustache":12,"partial":13,"CONTENT":14,"COMMENT":15,"OPEN_BLOCK":16,"inMustache":17,"CLOSE":18,"OPEN_INVERSE":19,"OPEN_ENDBLOCK":20,"path":21,"OPEN":22,"OPEN_UNESCAPED":23,"OPEN_PARTIAL":24,"params":25,"hash":26,"DATA":27,"param":28,"STRING":29,"INTEGER":30,"BOOLEAN":31,"hashSegments":32,"hashSegment":33,"ID":34,"EQUALS":35,"pathSegments":36,"SEP":37,"$accept":0,"$end":1},
-terminals_: {2:"error",5:"EOF",14:"CONTENT",15:"COMMENT",16:"OPEN_BLOCK",18:"CLOSE",19:"OPEN_INVERSE",20:"OPEN_ENDBLOCK",22:"OPEN",23:"OPEN_UNESCAPED",24:"OPEN_PARTIAL",27:"DATA",29:"STRING",30:"INTEGER",31:"BOOLEAN",34:"ID",35:"EQUALS",37:"SEP"},
-productions_: [0,[3,2],[4,3],[4,1],[4,0],[6,1],[6,2],[8,3],[8,3],[8,1],[8,1],[8,1],[8,1],[11,3],[9,3],[10,3],[12,3],[12,3],[13,3],[13,4],[7,2],[17,3],[17,2],[17,2],[17,1],[17,1],[25,2],[25,1],[28,1],[28,1],[28,1],[28,1],[28,1],[26,1],[32,2],[32,1],[33,3],[33,3],[33,3],[33,3],[33,3],[21,1],[36,3],[36,1]],
-performAction: function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$) {
-
-var $0 = $$.length - 1;
-switch (yystate) {
-case 1: return $$[$0-1]; 
-break;
-case 2: this.$ = new yy.ProgramNode($$[$0-2], $$[$0]); 
-break;
-case 3: this.$ = new yy.ProgramNode($$[$0]); 
-break;
-case 4: this.$ = new yy.ProgramNode([]); 
-break;
-case 5: this.$ = [$$[$0]]; 
-break;
-case 6: $$[$0-1].push($$[$0]); this.$ = $$[$0-1]; 
-break;
-case 7: this.$ = new yy.BlockNode($$[$0-2], $$[$0-1].inverse, $$[$0-1], $$[$0]); 
-break;
-case 8: this.$ = new yy.BlockNode($$[$0-2], $$[$0-1], $$[$0-1].inverse, $$[$0]); 
-break;
-case 9: this.$ = $$[$0]; 
-break;
-case 10: this.$ = $$[$0]; 
-break;
-case 11: this.$ = new yy.ContentNode($$[$0]); 
-break;
-case 12: this.$ = new yy.CommentNode($$[$0]); 
-break;
-case 13: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1]); 
-break;
-case 14: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1]); 
-break;
-case 15: this.$ = $$[$0-1]; 
-break;
-case 16: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1]); 
-break;
-case 17: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1], true); 
-break;
-case 18: this.$ = new yy.PartialNode($$[$0-1]); 
-break;
-case 19: this.$ = new yy.PartialNode($$[$0-2], $$[$0-1]); 
-break;
-case 20: 
-break;
-case 21: this.$ = [[$$[$0-2]].concat($$[$0-1]), $$[$0]]; 
-break;
-case 22: this.$ = [[$$[$0-1]].concat($$[$0]), null]; 
-break;
-case 23: this.$ = [[$$[$0-1]], $$[$0]]; 
-break;
-case 24: this.$ = [[$$[$0]], null]; 
-break;
-case 25: this.$ = [[new yy.DataNode($$[$0])], null]; 
-break;
-case 26: $$[$0-1].push($$[$0]); this.$ = $$[$0-1]; 
-break;
-case 27: this.$ = [$$[$0]]; 
-break;
-case 28: this.$ = $$[$0]; 
-break;
-case 29: this.$ = new yy.StringNode($$[$0]); 
-break;
-case 30: this.$ = new yy.IntegerNode($$[$0]); 
-break;
-case 31: this.$ = new yy.BooleanNode($$[$0]); 
-break;
-case 32: this.$ = new yy.DataNode($$[$0]); 
-break;
-case 33: this.$ = new yy.HashNode($$[$0]); 
-break;
-case 34: $$[$0-1].push($$[$0]); this.$ = $$[$0-1]; 
-break;
-case 35: this.$ = [$$[$0]]; 
-break;
-case 36: this.$ = [$$[$0-2], $$[$0]]; 
-break;
-case 37: this.$ = [$$[$0-2], new yy.StringNode($$[$0])]; 
-break;
-case 38: this.$ = [$$[$0-2], new yy.IntegerNode($$[$0])]; 
-break;
-case 39: this.$ = [$$[$0-2], new yy.BooleanNode($$[$0])]; 
-break;
-case 40: this.$ = [$$[$0-2], new yy.DataNode($$[$0])]; 
-break;
-case 41: this.$ = new yy.IdNode($$[$0]); 
-break;
-case 42: $$[$0-2].push($$[$0]); this.$ = $$[$0-2]; 
-break;
-case 43: this.$ = [$$[$0]]; 
-break;
-}
-},
-table: [{3:1,4:2,5:[2,4],6:3,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],22:[1,13],23:[1,14],24:[1,15]},{1:[3]},{5:[1,16]},{5:[2,3],7:17,8:18,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,19],20:[2,3],22:[1,13],23:[1,14],24:[1,15]},{5:[2,5],14:[2,5],15:[2,5],16:[2,5],19:[2,5],20:[2,5],22:[2,5],23:[2,5],24:[2,5]},{4:20,6:3,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,4],22:[1,13],23:[1,14],24:[1,15]},{4:21,6:3,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,4],22:[1,13],23:[1,14],24:[1,15]},{5:[2,9],14:[2,9],15:[2,9],16:[2,9],19:[2,9],20:[2,9],22:[2,9],23:[2,9],24:[2,9]},{5:[2,10],14:[2,10],15:[2,10],16:[2,10],19:[2,10],20:[2,10],22:[2,10],23:[2,10],24:[2,10]},{5:[2,11],14:[2,11],15:[2,11],16:[2,11],19:[2,11],20:[2,11],22:[2,11],23:[2,11],24:[2,11]},{5:[2,12],14:[2,12],15:[2,12],16:[2,12],19:[2,12],20:[2,12],22:[2,12],23:[2,12],24:[2,12]},{17:22,21:23,27:[1,24],34:[1,26],36:25},{17:27,21:23,27:[1,24],34:[1,26],36:25
 },{17:28,21:23,27:[1,24],34:[1,26],36:25},{17:29,21:23,27:[1,24],34:[1,26],36:25},{21:30,34:[1,26],36:25},{1:[2,1]},{6:31,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],22:[1,13],23:[1,14],24:[1,15]},{5:[2,6],14:[2,6],15:[2,6],16:[2,6],19:[2,6],20:[2,6],22:[2,6],23:[2,6],24:[2,6]},{17:22,18:[1,32],21:23,27:[1,24],34:[1,26],36:25},{10:33,20:[1,34]},{10:35,20:[1,34]},{18:[1,36]},{18:[2,24],21:41,25:37,26:38,27:[1,45],28:39,29:[1,42],30:[1,43],31:[1,44],32:40,33:46,34:[1,47],36:25},{18:[2,25]},{18:[2,41],27:[2,41],29:[2,41],30:[2,41],31:[2,41],34:[2,41],37:[1,48]},{18:[2,43],27:[2,43],29:[2,43],30:[2,43],31:[2,43],34:[2,43],37:[2,43]},{18:[1,49]},{18:[1,50]},{18:[1,51]},{18:[1,52],21:53,34:[1,26],36:25},{5:[2,2],8:18,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,2],22:[1,13],23:[1,14],24:[1,15]},{14:[2,20],15:[2,20],16:[2,20],19:[2,20],22:[2,20],23:[2,20],24:[2,20]},{5:[2,7],14:[2,7],15:[2,7],16:[2,7],19:[2,7],20:[2,7],22:[2,7],23:[2,7],24:[2,7]},{21:54
 ,34:[1,26],36:25},{5:[2,8],14:[2,8],15:[2,8],16:[2,8],19:[2,8],20:[2,8],22:[2,8],23:[2,8],24:[2,8]},{14:[2,14],15:[2,14],16:[2,14],19:[2,14],20:[2,14],22:[2,14],23:[2,14],24:[2,14]},{18:[2,22],21:41,26:55,27:[1,45],28:56,29:[1,42],30:[1,43],31:[1,44],32:40,33:46,34:[1,47],36:25},{18:[2,23]},{18:[2,27],27:[2,27],29:[2,27],30:[2,27],31:[2,27],34:[2,27]},{18:[2,33],33:57,34:[1,58]},{18:[2,28],27:[2,28],29:[2,28],30:[2,28],31:[2,28],34:[2,28]},{18:[2,29],27:[2,29],29:[2,29],30:[2,29],31:[2,29],34:[2,29]},{18:[2,30],27:[2,30],29:[2,30],30:[2,30],31:[2,30],34:[2,30]},{18:[2,31],27:[2,31],29:[2,31],30:[2,31],31:[2,31],34:[2,31]},{18:[2,32],27:[2,32],29:[2,32],30:[2,32],31:[2,32],34:[2,32]},{18:[2,35],34:[2,35]},{18:[2,43],27:[2,43],29:[2,43],30:[2,43],31:[2,43],34:[2,43],35:[1,59],37:[2,43]},{34:[1,60]},{14:[2,13],15:[2,13],16:[2,13],19:[2,13],20:[2,13],22:[2,13],23:[2,13],24:[2,13]},{5:[2,16],14:[2,16],15:[2,16],16:[2,16],19:[2,16],20:[2,16],22:[2,16],23:[2,16],24:[2,16]},{5:[2,17],14:[2,
 17],15:[2,17],16:[2,17],19:[2,17],20:[2,17],22:[2,17],23:[2,17],24:[2,17]},{5:[2,18],14:[2,18],15:[2,18],16:[2,18],19:[2,18],20:[2,18],22:[2,18],23:[2,18],24:[2,18]},{18:[1,61]},{18:[1,62]},{18:[2,21]},{18:[2,26],27:[2,26],29:[2,26],30:[2,26],31:[2,26],34:[2,26]},{18:[2,34],34:[2,34]},{35:[1,59]},{21:63,27:[1,67],29:[1,64],30:[1,65],31:[1,66],34:[1,26],36:25},{18:[2,42],27:[2,42],29:[2,42],30:[2,42],31:[2,42],34:[2,42],37:[2,42]},{5:[2,19],14:[2,19],15:[2,19],16:[2,19],19:[2,19],20:[2,19],22:[2,19],23:[2,19],24:[2,19]},{5:[2,15],14:[2,15],15:[2,15],16:[2,15],19:[2,15],20:[2,15],22:[2,15],23:[2,15],24:[2,15]},{18:[2,36],34:[2,36]},{18:[2,37],34:[2,37]},{18:[2,38],34:[2,38]},{18:[2,39],34:[2,39]},{18:[2,40],34:[2,40]}],
-defaultActions: {16:[2,1],24:[2,25],38:[2,23],55:[2,21]},
-parseError: function parseError(str, hash) {
-    throw new Error(str);
-},
-parse: function parse(input) {
-    var self = this, stack = [0], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
-    this.lexer.setInput(input);
-    this.lexer.yy = this.yy;
-    this.yy.lexer = this.lexer;
-    this.yy.parser = this;
-    if (typeof this.lexer.yylloc == "undefined")
-        this.lexer.yylloc = {};
-    var yyloc = this.lexer.yylloc;
-    lstack.push(yyloc);
-    var ranges = this.lexer.options && this.lexer.options.ranges;
-    if (typeof this.yy.parseError === "function")
-        this.parseError = this.yy.parseError;
-    function popStack(n) {
-        stack.length = stack.length - 2 * n;
-        vstack.length = vstack.length - n;
-        lstack.length = lstack.length - n;
-    }
-    function lex() {
-        var token;
-        token = self.lexer.lex() || 1;
-        if (typeof token !== "number") {
-            token = self.symbols_[token] || token;
-        }
-        return token;
-    }
-    var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;
-    while (true) {
-        state = stack[stack.length - 1];
-        if (this.defaultActions[state]) {
-            action = this.defaultActions[state];
-        } else {
-            if (symbol === null || typeof symbol == "undefined") {
-                symbol = lex();
-            }
-            action = table[state] && table[state][symbol];
-        }
-        if (typeof action === "undefined" || !action.length || !action[0]) {
-            var errStr = "";
-            if (!recovering) {
-                expected = [];
-                for (p in table[state])
-                    if (this.terminals_[p] && p > 2) {
-                        expected.push("'" + this.terminals_[p] + "'");
-                    }
-                if (this.lexer.showPosition) {
-                    errStr = "Parse error on line " + (yylineno + 1) + ":\n" + this.lexer.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
-                } else {
-                    errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == 1?"end of input":"'" + (this.terminals_[symbol] || symbol) + "'");
-                }
-                this.parseError(errStr, {text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected});
-            }
-        }
-        if (action[0] instanceof Array && action.length > 1) {
-            throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
-        }
-        switch (action[0]) {
-        case 1:
-            stack.push(symbol);
-            vstack.push(this.lexer.yytext);
-            lstack.push(this.lexer.yylloc);
-            stack.push(action[1]);
-            symbol = null;
-            if (!preErrorSymbol) {
-                yyleng = this.lexer.yyleng;
-                yytext = this.lexer.yytext;
-                yylineno = this.lexer.yylineno;
-                yyloc = this.lexer.yylloc;
-                if (recovering > 0)
-                    recovering--;
-            } else {
-                symbol = preErrorSymbol;
-                preErrorSymbol = null;
-            }
-            break;
-        case 2:
-            len = this.productions_[action[1]][1];
-            yyval.$ = vstack[vstack.length - len];
-            yyval._$ = {first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column};
-            if (ranges) {
-                yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]];
-            }
-            r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack);
-            if (typeof r !== "undefined") {
-                return r;
-            }
-            if (len) {
-                stack = stack.slice(0, -1 * len * 2);
-                vstack = vstack.slice(0, -1 * len);
-                lstack = lstack.slice(0, -1 * len);
-            }
-            stack.push(this.productions_[action[1]][0]);
-            vstack.push(yyval.$);
-            lstack.push(yyval._$);
-            newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
-            stack.push(newState);
-            break;
-        case 3:
-            return true;
-        }
-    }
-    return true;
-}
-};
-/* Jison generated lexer */
-var lexer = (function(){
-var lexer = ({EOF:1,
-parseError:function parseError(str, hash) {
-        if (this.yy.parser) {
-            this.yy.parser.parseError(str, hash);
-        } else {
-            throw new Error(str);
-        }
-    },
-setInput:function (input) {
-        this._input = input;
-        this._more = this._less = this.done = false;
-        this.yylineno = this.yyleng = 0;
-        this.yytext = this.matched = this.match = '';
-        this.conditionStack = ['INITIAL'];
-        this.yylloc = {first_line:1,first_column:0,last_line:1,last_column:0};
-        if (this.options.ranges) this.yylloc.range = [0,0];
-        this.offset = 0;
-        return this;
-    },
-input:function () {
-        var ch = this._input[0];
-        this.yytext += ch;
-        this.yyleng++;
-        this.offset++;
-        this.match += ch;
-        this.matched += ch;
-        var lines = ch.match(/(?:\r\n?|\n).*/g);
-        if (lines) {
-            this.yylineno++;
-            this.yylloc.last_line++;
-        } else {
-            this.yylloc.last_column++;
-        }
-        if (this.options.ranges) this.yylloc.range[1]++;
-
-        this._input = this._input.slice(1);
-        return ch;
-    },
-unput:function (ch) {
-        var len = ch.length;
-        var lines = ch.split(/(?:\r\n?|\n)/g);
-
-        this._input = ch + this._input;
-        this.yytext = this.yytext.substr(0, this.yytext.length-len-1);
-        //this.yyleng -= len;
-        this.offset -= len;
-        var oldLines = this.match.split(/(?:\r\n?|\n)/g);
-        this.match = this.match.substr(0, this.match.length-1);
-        this.matched = this.matched.substr(0, this.matched.length-1);
-
-        if (lines.length-1) this.yylineno -= lines.length-1;
-        var r = this.yylloc.range;
-
-        this.yylloc = {first_line: this.yylloc.first_line,
-          last_line: this.yylineno+1,
-          first_column: this.yylloc.first_column,
-          last_column: lines ?
-              (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length:
-              this.yylloc.first_column - len
-          };
-
-        if (this.options.ranges) {
-            this.yylloc.range = [r[0], r[0] + this.yyleng - len];
-        }
-        return this;
-    },
-more:function () {
-        this._more = true;
-        return this;
-    },
-less:function (n) {
-        this.unput(this.match.slice(n));
-    },
-pastInput:function () {
-        var past = this.matched.substr(0, this.matched.length - this.match.length);
-        return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, "");
-    },
-upcomingInput:function () {
-        var next = this.match;
-        if (next.length < 20) {
-            next += this._input.substr(0, 20-next.length);
-        }
-        return (next.substr(0,20)+(next.length > 20 ? '...':'')).replace(/\n/g, "");
-    },
-showPosition:function () {
-        var pre = this.pastInput();
-        var c = new Array(pre.length + 1).join("-");
-        return pre + this.upcomingInput() + "\n" + c+"^";
-    },
-next:function () {
-        if (this.done) {
-            return this.EOF;
-        }
-        if (!this._input) this.done = true;
-
-        var token,
-            match,
-            tempMatch,
-            index,
-            col,
-            lines;
-        if (!this._more) {
-            this.yytext = '';
-            this.match = '';
-        }
-        var rules = this._currentRules();
-        for (var i=0;i < rules.length; i++) {
-            tempMatch = this._input.match(this.rules[rules[i]]);
-            if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
-                match = tempMatch;
-                index = i;
-                if (!this.options.flex) break;
-            }
-        }
-        if (match) {
-            lines = match[0].match(/(?:\r\n?|\n).*/g);
-            if (lines) this.yylineno += lines.length;
-            this.yylloc = {first_line: this.yylloc.last_line,
-                           last_line: this.yylineno+1,
-                           first_column: this.yylloc.last_column,
-                           last_column: lines ? lines[lines.length-1].length-lines[lines.length-1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length};
-            this.yytext += match[0];
-            this.match += match[0];
-            this.matches = match;
-            this.yyleng = this.yytext.length;
-            if (this.options.ranges) {
-                this.yylloc.range = [this.offset, this.offset += this.yyleng];
-            }
-            this._more = false;
-            this._input = this._input.slice(match[0].length);
-            this.matched += match[0];
-            token = this.performAction.call(this, this.yy, this, rules[index],this.conditionStack[this.conditionStack.length-1]);
-            if (this.done && this._input) this.done = false;
-            if (token) return token;
-            else return;
-        }
-        if (this._input === "") {
-            return this.EOF;
-        } else {
-            return this.parseError('Lexical error on line '+(this.yylineno+1)+'. Unrecognized text.\n'+this.showPosition(),
-                    {text: "", token: null, line: this.yylineno});
-        }
-    },
-lex:function lex() {
-        var r = this.next();
-        if (typeof r !== 'undefined') {
-            return r;
-        } else {
-            return this.lex();
-        }
-    },
-begin:function begin(condition) {
-        this.conditionStack.push(condition);
-    },
-popState:function popState() {
-        return this.conditionStack.pop();
-    },
-_currentRules:function _currentRules() {
-        return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;
-    },
-topState:function () {
-        return this.conditionStack[this.conditionStack.length-2];
-    },
-pushState:function begin(condition) {
-        this.begin(condition);
-    }});
-lexer.options = {};
-lexer.performAction = function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {
-
-var YYSTATE=YY_START
-switch($avoiding_name_collisions) {
-case 0:
-                                   if(yy_.yytext.slice(-1) !== "\\") this.begin("mu");
-                                   if(yy_.yytext.slice(-1) === "\\") yy_.yytext = yy_.yytext.substr(0,yy_.yyleng-1), this.begin("emu");
-                                   if(yy_.yytext) return 14;
-                                 
-break;
-case 1: return 14; 
-break;
-case 2:
-                                   if(yy_.yytext.slice(-1) !== "\\") this.popState();
-                                   if(yy_.yytext.slice(-1) === "\\") yy_.yytext = yy_.yytext.substr(0,yy_.yyleng-1);
-                                   return 14;
-                                 
-break;
-case 3: return 24; 
-break;
-case 4: return 16; 
-break;
-case 5: return 20; 
-break;
-case 6: return 19; 
-break;
-case 7: return 19; 
-break;
-case 8: return 23; 
-break;
-case 9: return 23; 
-break;
-case 10: yy_.yytext = yy_.yytext.substr(3,yy_.yyleng-5); this.popState(); return 15; 
-break;
-case 11: return 22; 
-break;
-case 12: return 35; 
-break;
-case 13: return 34; 
-break;
-case 14: return 34; 
-break;
-case 15: return 37; 
-break;
-case 16: /*ignore whitespace*/ 
-break;
-case 17: this.popState(); return 18; 
-break;
-case 18: this.popState(); return 18; 
-break;
-case 19: yy_.yytext = yy_.yytext.substr(1,yy_.yyleng-2).replace(/\\"/g,'"'); return 29; 
-break;
-case 20: yy_.yytext = yy_.yytext.substr(1,yy_.yyleng-2).replace(/\\"/g,'"'); return 29; 
-break;
-case 21: yy_.yytext = yy_.yytext.substr(1); return 27; 
-break;
-case 22: return 31; 
-break;
-case 23: return 31; 
-break;
-case 24: return 30; 
-break;
-case 25: return 34; 
-break;
-case 26: yy_.yytext = yy_.yytext.substr(1, yy_.yyleng-2); return 34; 
-break;
-case 27: return 'INVALID'; 
-break;
-case 28: return 5; 
-break;
-}
-};
-lexer.rules = [/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|$)))/,/^(?:\{\{>)/,/^(?:\{\{#)/,/^(?:\{\{\/)/,/^(?:\{\{\^)/,/^(?:\{\{\s*else\b)/,/^(?:\{\{\{)/,/^(?:\{\{&)/,/^(?:\{\{![\s\S]*?\}\})/,/^(?:\{\{)/,/^(?:=)/,/^(?:\.(?=[} ]))/,/^(?:\.\.)/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}\}\})/,/^(?:\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@[a-zA-Z]+)/,/^(?:true(?=[}\s]))/,/^(?:false(?=[}\s]))/,/^(?:[0-9]+(?=[}\s]))/,/^(?:[a-zA-Z0-9_$-]+(?=[=}\s\/.]))/,/^(?:\[[^\]]*\])/,/^(?:.)/,/^(?:$)/];
-lexer.conditions = {"mu":{"rules":[3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28],"inclusive":false},"emu":{"rules":[2],"inclusive":false},"INITIAL":{"rules":[0,1,28],"inclusive":true}};
-return lexer;})()
-parser.lexer = lexer;
-function Parser () { this.yy = {}; }Parser.prototype = parser;parser.Parser = Parser;
-return new Parser;
-})();
-if (typeof require !== 'undefined' && typeof exports !== 'undefined') {
-exports.parser = handlebars;
-exports.Parser = handlebars.Parser;
-exports.parse = function () { return handlebars.parse.apply(handlebars, arguments); }
-exports.main = function commonjsMain(args) {
-    if (!args[1])
-        throw new Error('Usage: '+args[0]+' FILE');
-    var source, cwd;
-    if (typeof process !== 'undefined') {
-        source = require('fs').readFileSync(require('path').resolve(args[1]), "utf8");
-    } else {
-        source = require("file").path(require("file").cwd()).join(args[1]).read({charset: "utf-8"});
-    }
-    return exports.parser.parse(source);
-}
-if (typeof module !== 'undefined' && require.main === module) {
-  exports.main(typeof process !== 'undefined' ? process.argv.slice(1) : require("system").args);
-}
-};
-;
-// lib/handlebars/compiler/base.js
-Handlebars.Parser = handlebars;
-
-Handlebars.parse = function(string) {
-  Handlebars.Parser.yy = Handlebars.AST;
-  return Handlebars.Parser.parse(string);
-};
-
-Handlebars.print = function(ast) {
-  return new Handlebars.PrintVisitor().accept(ast);
-};
-
-Handlebars.logger = {
-  DEBUG: 0, INFO: 1, WARN: 2, ERROR: 3, level: 3,
-
-  // override in the host environment
-  log: function(level, str) {}
-};
-
-Handlebars.log = function(level, str) { Handlebars.logger.log(level, str); };
-;
-// lib/handlebars/compiler/ast.js
-(function() {
-
-  Handlebars.AST = {};
-
-  Handlebars.AST.ProgramNode = function(statements, inverse) {
-    this.type = "program";
-    this.statements = statements;
-    if(inverse) { this.inverse = new Handlebars.AST.ProgramNode(inverse); }
-  };
-
-  Handlebars.AST.MustacheNode = function(rawParams, hash, unescaped) {
-    this.type = "mustache";
-    this.escaped = !unescaped;
-    this.hash = hash;
-
-    var id = this.id = rawParams[0];
-    var params = this.params = rawParams.slice(1);
-
-    // a mustache is an eligible helper if:
-    // * its id is simple (a single part, not `this` or `..`)
-    var eligibleHelper = this.eligibleHelper = id.isSimple;
-
-    // a mustache is definitely a helper if:
-    // * it is an eligible helper, and
-    // * it has at least one parameter or hash segment
-    this.isHelper = eligibleHelper && (params.length || hash);
-
-    // if a mustache is an eligible helper but not a definite
-    // helper, it is ambiguous, and will be resolved in a later
-    // pass or at runtime.
-  };
-
-  Handlebars.AST.PartialNode = function(id, context) {
-    this.type    = "partial";
-
-    // TODO: disallow complex IDs
-
-    this.id      = id;
-    this.context = context;
-  };
-
-  var verifyMatch = function(open, close) {
-    if(open.original !== close.original) {
-      throw new Handlebars.Exception(open.original + " doesn't match " + close.original);
-    }
-  };
-
-  Handlebars.AST.BlockNode = function(mustache, program, inverse, close) {
-    verifyMatch(mustache.id, close);
-    this.type = "block";
-    this.mustache = mustache;
-    this.program  = program;
-    this.inverse  = inverse;
-
-    if (this.inverse && !this.program) {
-      this.isInverse = true;
-    }
-  };
-
-  Handlebars.AST.ContentNode = function(string) {
-    this.type = "content";
-    this.string = string;
-  };
-
-  Handlebars.AST.HashNode = function(pairs) {
-    this.type = "hash";
-    this.pairs = pairs;
-  };
-
-  Handlebars.AST.IdNode = function(parts) {
-    this.type = "ID";
-    this.original = parts.join(".");
-
-    var dig = [], depth = 0;
-
-    for(var i=0,l=parts.length; i<l; i++) {
-      var part = parts[i];
-
-      if(part === "..") { depth++; }
-      else if(part === "." || part === "this") { this.isScoped = true; }
-      else { dig.push(part); }
-    }
-
-    this.parts    = dig;
-    this.string   = dig.join('.');
-    this.depth    = depth;
-
-    // an ID is simple if it only has one part, and that part is not
-    // `..` or `this`.
-    this.isSimple = parts.length === 1 && !this.isScoped && depth === 0;
-  };
-
-  Handlebars.AST.DataNode = function(id) {
-    this.type = "DATA";
-    this.id = id;
-  };
-
-  Handlebars.AST.StringNode = function(string) {
-    this.type = "STRING";
-    this.string = string;
-  };
-
-  Handlebars.AST.IntegerNode = function(integer) {
-    this.type = "INTEGER";
-    this.integer = integer;
-  };
-
-  Handlebars.AST.BooleanNode = function(bool) {
-    this.type = "BOOLEAN";
-    this.bool = bool;
-  };
-
-  Handlebars.AST.CommentNode = function(comment) {
-    this.type = "comment";
-    this.comment = comment;
-  };
-
-})();;
-// lib/handlebars/utils.js
-Handlebars.Exception = function(message) {
-  var tmp = Error.prototype.constructor.apply(this, arguments);
-
-  for (var p in tmp) {
-    if (tmp.hasOwnProperty(p)) { this[p] = tmp[p]; }
-  }
-
-  this.message = tmp.message;
-};
-Handlebars.Exception.prototype = new Error();
-
-// Build out our basic SafeString type
-Handlebars.SafeString = function(string) {
-  this.string = string;
-};
-Handlebars.SafeString.prototype.toString = function() {
-  return this.string.toString();
-};
-
-(function() {
-  var escape = {
-    "&": "&amp;",
-    "<": "&lt;",
-    ">": "&gt;",
-    '"': "&quot;",
-    "'": "&#x27;",
-    "`": "&#x60;"
-  };
-
-  var badChars = /[&<>"'`]/g;
-  var possible = /[&<>"'`]/;
-
-  var escapeChar = function(chr) {
-    return escape[chr] || "&amp;";
-  };
-
-  Handlebars.Utils = {
-    escapeExpression: function(string) {
-      // don't escape SafeStrings, since they're already safe
-      if (string instanceof Handlebars.SafeString) {
-        return string.toString();
-      } else if (string == null || string === false) {
-        return "";
-      }
-
-      if(!possible.test(string)) { return string; }
-      return string.replace(badChars, escapeChar);
-    },
-
-    isEmpty: function(value) {
-      if (typeof value === "undefined") {
-        return true;
-      } else if (value === null) {
-        return true;
-      } else if (value === false) {
-        return true;
-      } else if(Object.prototype.toString.call(value) === "[object Array]" && value.length === 0) {
-        return true;
-      } else {
-        return false;
-      }
-    }
-  };
-})();;
-// lib/handlebars/compiler/compiler.js
-
-/*jshint eqnull:true*/
-Handlebars.Compiler = function() {};
-Handlebars.JavaScriptCompiler = function() {};
-
-(function(Compiler, JavaScriptCompiler) {
-  // the foundHelper register will disambiguate helper lookup from finding a
-  // function in a context. This is necessary for mustache compatibility, which
-  // requires that context functions in blocks are evaluated by blockHelperMissing,
-  // and then proceed as if the resulting value was provided to blockHelperMissing.
-
-  Compiler.prototype = {
-    compiler: Compiler,
-
-    disassemble: function() {
-      var opcodes = this.opcodes, opcode, out = [], params, param;
-
-      for (var i=0, l=opcodes.length; i<l; i++) {
-        opcode = opcodes[i];
-
-        if (opcode.opcode === 'DECLARE') {
-          out.push("DECLARE " + opcode.name + "=" + opcode.value);
-        } else {
-          params = [];
-          for (var j=0; j<opcode.args.length; j++) {
-            param = opcode.args[j];
-            if (typeof param === "string") {
-              param = "\"" + param.replace("\n", "\\n") + "\"";
-            }
-            params.push(param);
-          }
-          out.push(opcode.opcode + " " + params.join(" "));
-        }
-      }
-
-      return out.join("\n");
-    },
-
-    guid: 0,
-
-    compile: function(program, options) {
-      this.children = [];
-      this.depths = {list: []};
-      this.options = options;
-
-      // These changes will propagate to the other compiler components
-      var knownHelpers = this.options.knownHelpers;
-      this.options.knownHelpers = {
-        'helperMissing': true,
-        'blockHelperMissing': true,
-        'each': true,
-        'if': true,
-        'unless': true,
-        'with': true,
-        'log': true
-      };
-      if (knownHelpers) {
-        for (var name in knownHelpers) {
-          this.options.knownHelpers[name] = knownHelpers[name];
-        }
-      }
-
-      return this.program(program);
-    },
-
-    accept: function(node) {
-      return this[node.type](node);
-    },
-
-    program: function(program) {
-      var statements = program.statements, statement;
-      this.opcodes = [];
-
-      for(var i=0, l=statements.length; i<l; i++) {
-        statement = statements[i];
-        this[statement.type](statement);
-      }
-      this.isSimple = l === 1;
-
-      this.depths.list = this.depths.list.sort(function(a, b) {
-        return a - b;
-      });
-
-      return this;
-    },
-
-    compileProgram: function(program) {
-      var result = new this.compiler().compile(program, this.options);
-      var guid = this.guid++, depth;
-
-      this.usePartial = this.usePartial || result.usePartial;
-
-      this.children[guid] = result;
-
-      for(var i=0, l=result.depths.list.length; i<l; i++) {
-        depth = result.depths.list[i];
-
-        if(depth < 2) { continue; }
-        else { this.addDepth(depth - 1); }
-      }
-
-      return guid;
-    },
-
-    block: function(block) {
-      var mustache = block.mustache,
-          program = block.program,
-          inverse = block.inverse;
-
-      if (program) {
-        program = this.compileProgram(program);
-      }
-
-      if (inverse) {
-        inverse = this.compileProgram(inverse);
-      }
-
-      var type = this.classifyMustache(mustache);
-
-      if (type === "helper") {
-        this.helperMustache(mustache, program, inverse);
-      } else if (type === "simple") {
-        this.simpleMustache(mustache);
-
-        // now that the simple mustache is resolved, we need to
-        // evaluate it by executing `blockHelperMissing`
-        this.opcode('pushProgram', program);
-        this.opcode('pushProgram', inverse);
-        this.opcode('pushLiteral', '{}');
-        this.opcode('blockValue');
-      } else {
-        this.ambiguousMustache(mustache, program, inverse);
-
-        // now that the simple mustache is resolved, we need to
-        // evaluate it by executing `blockHelperMissing`
-        this.opcode('pushProgram', program);
-        this.opcode('pushProgram', inverse);
-        this.opcode('pushLiteral', '{}');
-        this.opcode('ambiguousBlockValue');
-      }
-
-      this.opcode('append');
-    },
-
-    hash: function(hash) {
-      var pairs = hash.pairs, pair, val;
-
-      this.opcode('push', '{}');
-
-      for(var i=0, l=pairs.length; i<l; i++) {
-        pair = pairs[i];
-        val  = pair[1];
-
-        this.accept(val);
-        this.opcode('assignToHash', pair[0]);
-      }
-    },
-
-    partial: function(partial) {
-      var id = partial.id;
-      this.usePartial = true;
-
-      if(partial.context) {
-        this.ID(partial.context);
-      } else {
-        this.opcode('push', 'depth0');
-      }
-
-      this.opcode('invokePartial', id.original);
-      this.opcode('append');
-    },
-
-    content: function(content) {
-      this.opcode('appendContent', content.string);
-    },
-
-    mustache: function(mustache) {
-      var options = this.options;
-      var type = this.classifyMustache(mustache);
-
-      if (type === "simple") {
-        this.simpleMustache(mustache);
-      } else if (type === "helper") {
-        this.helperMustache(mustache);
-      } else {
-        this.ambiguousMustache(mustache);
-      }
-
-      if(mustache.escaped && !options.noEscape) {
-        this.opcode('appendEscaped');
-      } else {
-        this.opcode('append');
-      }
-    },
-
-    ambiguousMustache: function(mustache, program, inverse) {
-      var id = mustache.id, name = id.parts[0];
-
-      this.opcode('getContext', id.depth);
-
-      this.opcode('pushProgram', program);
-      this.opcode('pushProgram', inverse);
-
-      this.opcode('invokeAmbiguous', name);
-    },
-
-    simpleMustache: function(mustache, program, inverse) {
-      var id = mustache.id;
-
-      if (id.type === 'DATA') {
-        this.DATA(id);
-      } else if (id.parts.length) {
-        this.ID(id);
-      } else {
-        // Simplified ID for `this`
-        this.addDepth(id.depth);
-        this.opcode('getContext', id.depth);
-        this.opcode('pushContext');
-      }
-
-      this.opcode('resolvePossibleLambda');
-    },
-
-    helperMustache: function(mustache, program, inverse) {
-      var params = this.setupFullMustacheParams(mustache, program, inverse),
-          name = mustache.id.parts[0];
-
-      if (this.options.knownHelpers[name]) {
-        this.opcode('invokeKnownHelper', params.length, name);
-      } else if (this.knownHelpersOnly) {
-        throw new Error("You specified knownHelpersOnly, but used the unknown helper " + name);
-      } else {
-        this.opcode('invokeHelper', params.length, name);
-      }
-    },
-
-    ID: function(id) {
-      this.addDepth(id.depth);
-      this.opcode('getContext', id.depth);
-
-      var name = id.parts[0];
-      if (!name) {
-        this.opcode('pushContext');
-      } else {
-        this.opcode('lookupOnContext', id.parts[0]);
-      }
-
-      for(var i=1, l=id.parts.length; i<l; i++) {
-        this.opcode('lookup', id.parts[i]);
-      }
-    },
-
-    DATA: function(data) {
-      this.options.data = true;
-      this.opcode('lookupData', data.id);
-    },
-
-    STRING: function(string) {
-      this.opcode('pushString', string.string);
-    },
-
-    INTEGER: function(integer) {
-      this.opcode('pushLiteral', integer.integer);
-    },
-
-    BOOLEAN: function(bool) {
-      this.opcode('pushLiteral', bool.bool);
-    },
-
-    comment: function() {},
-
-    // HELPERS
-    opcode: function(name) {
-      this.opcodes.push({ opcode: name, args: [].slice.call(arguments, 1) });
-    },
-
-    declare: function(name, value) {
-      this.opcodes.push({ opcode: 'DECLARE', name: name, value: value });
-    },
-
-    addDepth: function(depth) {
-      if(isNaN(depth)) { throw new Error("EWOT"); }
-      if(depth === 0) { return; }
-
-      if(!this.depths[depth]) {
-        this.depths[depth] = true;
-        this.depths.list.push(depth);
-      }
-    },
-
-    classifyMustache: function(mustache) {
-      var isHelper   = mustache.isHelper;
-      var isEligible = mustache.eligibleHelper;
-      var options    = this.options;
-
-      // if ambiguous, we can possibly resolve the ambiguity now
-      if (isEligible && !isHelper) {
-        var name = mustache.id.parts[0];
-
-        if (options.knownHelpers[name]) {
-          isHelper = true;
-        } else if (options.knownHelpersOnly) {
-          isEligible = false;
-        }
-      }
-
-      if (isHelper) { return "helper"; }
-      else if (isEligible) { return "ambiguous"; }
-      else { return "simple"; }
-    },
-
-    pushParams: function(params) {
-      var i = params.length, param;
-
-      while(i--) {
-        param = params[i];
-
-        if(this.options.stringParams) {
-          if(param.depth) {
-            this.addDepth(param.depth);
-          }
-
-          this.opcode('getContext', param.depth || 0);
-          this.opcode('pushStringParam', param.string);
-        } else {
-          this[param.type](param);
-        }
-      }
-    },
-
-    setupMustacheParams: function(mustache) {
-      var params = mustache.params;
-      this.pushParams(params);
-
-      if(mustache.hash) {
-        this.hash(mustache.hash);
-      } else {
-        this.opcode('pushLiteral', '{}');
-      }
-
-      return params;
-    },
-
-    // this will replace setupMustacheParams when we're done
-    setupFullMustacheParams: function(mustache, program, inverse) {
-      var params = mustache.params;
-      this.pushParams(params);
-
-      this.opcode('pushProgram', program);
-      this.opcode('pushProgram', inverse);
-
-      if(mustache.hash) {
-        this.hash(mustache.hash);
-      } else {
-        this.opcode('pushLiteral', '{}');
-      }
-
-      return params;
-    }
-  };
-
-  var Literal = function(value) {
-    this.value = value;
-  };
-
-  JavaScriptCompiler.prototype = {
-    // PUBLIC API: You can override these methods in a subclass to provide
-    // alternative compiled forms for name lookup and buffering semantics
-    nameLookup: function(parent, name, type) {
-      if (/^[0-9]+$/.test(name)) {
-        return parent + "[" + name + "]";
-      } else if (JavaScriptCompiler.isValidJavaScriptVariableName(name)) {
-        return parent + "." + name;
-      }
-      else {
-        return parent + "['" + name + "']";
-      }
-    },
-
-    appendToBuffer: function(string) {
-      if (this.environment.isSimple) {
-        return "return " + string + ";";
-      } else {
-        return "buffer += " + string + ";";
-      }
-    },
-
-    initializeBuffer: function() {
-      return this.quotedString("");
-    },
-
-    namespace: "Handlebars",
-    // END PUBLIC API
-
-    compile: function(environment, options, context, asObject) {
-      this.environment = environment;
-      this.options = options || {};
-
-      Handlebars.log(Handlebars.logger.DEBUG, this.environment.disassemble() + "\n\n");
-
-      this.name = this.environment.name;
-      this.isChild = !!context;
-      this.context = context || {
-        programs: [],
-        aliases: { }
-      };
-
-      this.preamble();
-
-      this.stackSlot = 0;
-      this.stackVars = [];
-      this.registers = { list: [] };
-      this.compileStack = [];
-
-      this.compileChildren(environment, options);
-
-      var opcodes = environment.opcodes, opcode;
-
-      this.i = 0;
-
-      for(l=opcodes.length; this.i<l; this.i++) {
-        opcode = opcodes[this.i];
-
-        if(opcode.opcode === 'DECLARE') {
-          this[opcode.name] = opcode.value;
-        } else {
-          this[opcode.opcode].apply(this, opcode.args);
-        }
-      }
-
-      return this.createFunctionContext(asObject);
-    },
-
-    nextOpcode: function() {
-      var opcodes = this.environment.opcodes, opcode = opcodes[this.i + 1];
-      return opcodes[this.i + 1];
-    },
-
-    eat: function(opcode) {
-      this.i = this.i + 1;
-    },
-
-    preamble: function() {
-      var out = [];
-
-      if (!this.isChild) {
-        var namespace = this.namespace;
-        var copies = "helpers = helpers || " + namespace + ".helpers;";
-        if (this.environment.usePartial) { copies = copies + " partials = partials || " + namespace + ".partials;"; }
-        if (this.options.data) { copies = copies + " data = data || {};"; }
-        out.push(copies);
-      } else {
-        out.push('');
-      }
-
-      if (!this.environment.isSimple) {
-        out.push(", buffer = " + this.initializeBuffer());
-      } else {
-        out.push("");
-      }
-
-      // track the last context pushed into place to allow skipping the
-      // getContext opcode when it would be a noop
-      this.lastContext = 0;
-      this.source = out;
-    },
-
-    createFunctionContext: function(asObject) {
-      var locals = this.stackVars.concat(this.registers.list);
-
-      if(locals.length > 0) {
-        this.source[1] = this.source[1] + ", " + locals.join(", ");
-      }
-
-      // Generate minimizer alias mappings
-      if (!this.isChild) {
-        var aliases = [];
-        for (var alias in this.context.aliases) {
-          this.source[1] = this.source[1] + ', ' + alias + '=' + this.context.aliases[alias];
-        }
-      }
-
-      if (this.source[1]) {
-        this.source[1] = "var " + this.source[1].substring(2) + ";";
-      }
-
-      // Merge children
-      if (!this.isChild) {
-        this.source[1] += '\n' + this.context.programs.join('\n') + '\n';
-      }
-
-      if (!this.environment.isSimple) {
-        this.source.push("return buffer;");
-      }
-
-      var params = this.isChild ? ["depth0", "data"] : ["Handlebars", "depth0", "helpers", "partials", "data"];
-
-      for(var i=0, l=this.environment.depths.list.length; i<l; i++) {
-        params.push("depth" + this.environment.depths.list[i]);
-      }
-
-      if (asObject) {
-        params.push(this.source.join("\n  "));
-
-        return Function.apply(this, params);
-      } else {
-        var functionSource = 'function ' + (this.name || '') + '(' + params.join(',') + ') {\n  ' + this.source.join("\n  ") + '}';
-        Handlebars.log(Handlebars.logger.DEBUG, functionSource + "\n\n");
-        return functionSource;
-      }
-    },
-
-    // [blockValue]
-    //
-    // On stack, before: hash, inverse, program, value
-    // On stack, after: return value of blockHelperMissing
-    //
-    // The purpose of this opcode is to take a block of the form
-    // `{{#foo}}...{{/foo}}`, resolve the value of `foo`, and
-    // replace it on the stack with the result of properly
-    // invoking blockHelperMissing.
-    blockValue: function() {
-      this.context.aliases.blockHelperMissing = 'helpers.blockHelperMissing';
-
-      var params = ["depth0"];
-      this.setupParams(0, params);
-
-      this.replaceStack(function(current) {
-        params.splice(1, 0, current);
-        return current + " = blockHelperMissing.call(" + params.join(", ") + ")";
-      });
-    },
-
-    // [ambiguousBlockValue]
-    //
-    // On stack, before: hash, inverse, program, value
-    // Compiler value, before: lastHelper=value of last found helper, if any
-    // On stack, after, if no lastHelper: same as [blockValue]
-    // On stack, after, if lastHelper: value
-    ambiguousBlockValue: function() {
-      this.context.aliases.blockHelperMissing = 'helpers.blockHelperMissing';
-
-      var params = ["depth0"];
-      this.setupParams(0, params);
-
-      var current = this.topStack();
-      params.splice(1, 0, current);
-
-      this.source.push("if (!" + this.lastHelper + ") { " + current + " = blockHelperMissing.call(" + params.join(", ") + "); }");
-    },
-
-    // [appendContent]
-    //
-    // On stack, before: ...
-    // On stack, after: ...
-    //
-    // Appends the string value of `content` to the current buffer
-    appendContent: function(content) {
-      this.source.push(this.appendToBuffer(this.quotedString(content)));
-    },
-
-    // [append]
-    //
-    // On stack, before: value, ...
-    // On stack, after: ...
-    //
-    // Coerces `value` to a String and appends it to the current buffer.
-    //
-    // If `value` is truthy, or 0, it is coerced into a string and appended
-    // Otherwise, the empty string is appended
-    append: function() {
-      var local = this.popStack();
-      this.source.push("if(" + local + " || " + local + " === 0) { " + this.appendToBuffer(local) + " }");
-      if (this.environment.isSimple) {
-        this.source.push("else { " + this.appendToBuffer("''") + " }");
-      }
-    },
-
-    // [appendEscaped]
-    //
-    // On stack, before: value, ...
-    // On stack, after: ...
-    //
-    // Escape `value` and append it to the buffer
-    appendEscaped: function() {
-      var opcode = this.nextOpcode(), extra = "";
-      this.context.aliases.escapeExpression = 'this.escapeExpression';
-
-      if(opcode && opcode.opcode === 'appendContent') {
-        extra = " + " + this.quotedString(opcode.args[0]);
-        this.eat(opcode);
-      }
-
-      this.source.push(this.appendToBuffer("escapeExpression(" + this.popStack() + ")" + extra));
-    },
-
-    // [getContext]
-    //
-    // On stack, before: ...
-    // On stack, after: ...
-    // Compiler value, after: lastContext=depth
-    //
-    // Set the value of the `lastContext` compiler value to the depth
-    getContext: function(depth) {
-      if(this.lastContext !== depth) {
-        this.lastContext = depth;
-      }
-    },
-
-    // [lookupOnContext]
-    //
-    // On stack, before: ...
-    // On stack, after: currentContext[name], ...
-    //
-    // Looks up the value of `name` on the current context and pushes
-    // it onto the stack.
-    lookupOnContext: function(name) {
-      this.pushStack(this.nameLookup('depth' + this.lastContext, name, 'context'));
-    },
-
-    // [pushContext]
-    //
-    // On stack, before: ...
-    // On stack, after: currentContext, ...
-    //
-    // Pushes the value of the current context onto the stack.
-    pushContext: function() {
-      this.pushStackLiteral('depth' + this.lastContext);
-    },
-
-    // [resolvePossibleLambda]
-    //
-    // On stack, before: value, ...
-    // On stack, after: resolved value, ...
-    //
-    // If the `value` is a lambda, replace it on the stack by
-    // the return value of the lambda
-    resolvePossibleLambda: function() {
-      this.context.aliases.functionType = '"function"';
-
-      this.replaceStack(function(current) {
-        return "typeof " + current + " === functionType ? " + current + "() : " + current;
-      });
-    },
-
-    // [lookup]
-    //
-    // On stack, before: value, ...
-    // On stack, after: value[name], ...
-    //
-    // Replace the value on the stack with the result of looking
-    // up `name` on `value`
-    lookup: function(name) {
-      this.replaceStack(function(current) {
-        return current + " == null || " + current + " === false ? " + current + " : " + this.nameLookup(current, name, 'context');
-      });
-    },
-
-    // [lookupData]
-    //
-    // On stack, before: ...
-    // On stack, after: data[id], ...
-    //
-    // Push the result of looking up `id` on the current data
-    lookupData: function(id) {
-      this.pushStack(this.nameLookup('data', id, 'data'));
-    },
-
-    // [pushStringParam]
-    //
-    // On stack, before: ...
-    // On stack, after: string, currentContext, ...
-    //
-    // This opcode is designed for use in string mode, which
-    // provides the string value of a parameter along with its
-    // depth rather than resolving it immediately.
-    pushStringParam: function(string) {
-      this.pushStackLiteral('depth' + this.lastContext);
-      this.pushString(string);
-    },
-
-    // [pushString]
-    //
-    // On stack, before: ...
-    // On stack, after: quotedString(string), ...
-    //
-    // Push a quoted version of `string` onto the stack
-    pushString: function(string) {
-      this.pushStackLiteral(this.quotedString(string));
-    },
-
-    // [push]
-    //
-    // On stack, before: ...
-    // On stack, after: expr, ...
-    //
-    // Push an expression onto the stack
-    push: function(expr) {
-      this.pushStack(expr);
-    },
-
-    // [pushLiteral]
-    //
-    // On stack, before: ...
-    // On stack, after: value, ...
-    //
-    // Pushes a value onto the stack. This operation prevents
-    // the compiler from creating a temporary variable to hold
-    // it.
-    pushLiteral: function(value) {
-      this.pushStackLiteral(value);
-    },
-
-    // [pushProgram]
-    //
-    // On stack, before: ...
-    // On stack, after: program(guid), ...
-    //
-    // Push a program expression onto the stack. This takes
-    // a compile-time guid and converts it into a runtime-accessible
-    // expression.
-    pushProgram: function(guid) {
-      if (guid != null) {
-        this.pushStackLiteral(this.programExpression(guid));
-      } else {
-        this.pushStackLiteral(null);
-      }
-    },
-
-    // [invokeHelper]
-    //
-    // On stack, before: hash, inverse, program, params..., ...
-    // On stack, after: result of helper invocation
-    //
-    // Pops off the helper's parameters, invokes the helper,
-    // and pushes the helper's return value onto the stack.
-    //
-    // If the helper is not found, `helperMissing` is called.
-    invokeHelper: function(paramSize, name) {
-      this.context.aliases.helperMissing = 'helpers.helperMissing';
-
-      var helper = this.lastHelper = this.setupHelper(paramSize, name);
-      this.register('foundHelper', helper.name);
-
-      this.pushStack("foundHelper ? foundHelper.call(" +
-        helper.callParams + ") " + ": helperMissing.call(" +
-        helper.helperMissingParams + ")");
-    },
-
-    // [invokeKnownHelper]
-    //
-    // On stack, before: hash, inverse, program, params..., ...
-    // On stack, after: result of helper invocation
-    //
-    // This operation is used when the helper is known to exist,
-    // so a `helperMissing` fallback is not required.
-    invokeKnownHelper: function(paramSize, name) {
-      var helper = this.setupHelper(paramSize, name);
-      this.pushStack(helper.name + ".call(" + helper.callParams + ")");
-    },
-
-    // [invokeAmbiguous]
-    //
-    // On stack, before: hash, inverse, program, params..., ...
-    // On stack, after: result of disambiguation
-    //
-    // This operation is used when an expression like `{{foo}}`
-    // is provided, but we don't know at compile-time whether it
-    // is a helper or a path.
-    //
-    // This operation emits more code than the other options,
-    // and can be avoided by passing the `knownHelpers` and
-    // `knownHelpersOnly` flags at compile-time.
-    invokeAmbiguous: function(name) {
-      this.context.aliases.functionType = '"function"';
-
-      this.pushStackLiteral('{}');
-      var helper = this.setupHelper(0, name);
-
-      var helperName = this.lastHelper = this.nameLookup('helpers', name, 'helper');
-      this.register('foundHelper', helperName);
-
-      var nonHelper = this.nameLookup('depth' + this.lastContext, name, 'context');
-      var nextStack = this.nextStack();
-
-      this.source.push('if (foundHelper) { ' + nextStack + ' = foundHelper.call(' + helper.callParams + '); }');
-      this.source.push('else { ' + nextStack + ' = ' + nonHelper + '; ' + nextStack + ' = typeof ' + nextStack + ' === functionType ? ' + nextStack + '() : ' + nextStack + '; }');
-    },
-
-    // [invokePartial]
-    //
-    // On stack, before: context, ...
-    // On stack after: result of partial invocation
-    //
-    // This operation pops off a context, invokes a partial with that context,
-    // and pushes the result of the invocation back.
-    invokePartial: function(name) {
-      var params = [this.nameLookup('partials', name, 'partial'), "'" + name + "'", this.popStack(), "helpers", "partials"];
-
-      if (this.options.data) {
-        params.push("data");
-      }
-
-      this.context.aliases.self = "this";
-      this.pushStack("self.invokePartial(" + params.join(", ") + ");");
-    },
-
-    // [assignToHash]
-    //
-    // On stack, before: value, hash, ...
-    // On stack, after: hash, ...
-    //
-    // Pops a value and hash off the stack, assigns `hash[key] = value`
-    // and pushes the hash back onto the stack.
-    assignToHash: function(key) {
-      var value = this.popStack();
-      var hash = this.topStack();
-
-      this.source.push(hash + "['" + key + "'] = " + value + ";");
-    },
-
-    // HELPERS
-
-    compiler: JavaScriptCompiler,
-
-    compileChildren: function(environment, options) {
-      var children = environment.children, child, compiler;
-
-      for(var i=0, l=children.length; i<l; i++) {
-        child = children[i];
-        compiler = new this.compiler();
-
-        this.context.programs.push('');     // Placeholder to prevent name conflicts for nested children
-        var index = this.context.programs.length;
-        child.index = index;
-        child.name = 'program' + index;
-        this.context.programs[index] = compiler.compile(child, options, this.context);
-      }
-    },
-
-    programExpression: function(guid) {
-      this.context.aliases.self = "this";
-
-      if(guid == null) {
-        return "self.noop";
-      }
-
-      var child = this.environment.children[guid],
-          depths = child.depths.list, depth;
-
-      var programParams = [child.index, child.name, "data"];
-
-      for(var i=0, l = depths.length; i<l; i++) {
-        depth = depths[i];
-
-        if(depth === 1) { programParams.push("depth0"); }
-        else { programParams.push("depth" + (depth - 1)); }
-      }
-
-      if(depths.length === 0) {
-        return "self.program(" + programParams.join(", ") + ")";
-      } else {
-        programParams.shift();
-        return "self.programWithDepth(" + programParams.join(", ") + ")";
-      }
-    },
-
-    register: function(name, val) {
-      this.useRegister(name);
-      this.source.push(name + " = " + val + ";");
-    },
-
-    useRegister: function(name) {
-      if(!this.registers[name]) {
-        this.registers[name] = true;
-        this.registers.list.push(name);
-      }
-    },
-
-    pushStackLiteral: function(item) {
-      this.compileStack.push(new Literal(item));
-      return item;
-    },
-
-    pushStack: function(item) {
-      this.source.push(this.incrStack() + " = " + item + ";");
-      this.compileStack.push("stack" + this.stackSlot);
-      return "stack" + this.stackSlot;
-    },
-
-    replaceStack: function(callback) {
-      var item = callback.call(this, this.topStack());
-
-      this.source.push(this.topStack() + " = " + item + ";");
-      return "stack" + this.stackSlot;
-    },
-
-    nextStack: function(skipCompileStack) {
-      var name = this.incrStack();
-      this.compileStack.push("stack" + this.stackSlot);
-      return name;
-    },
-
-    incrStack: function() {
-      this.stackSlot++;
-      if(this.stackSlot > this.stackVars.length) { this.stackVars.push("stack" + this.stackSlot); }
-      return "stack" + this.stackSlot;
-    },
-
-    popStack: function() {
-      var item = this.compileStack.pop();
-
-      if (item instanceof Literal) {
-        return item.value;
-      } else {
-        this.stackSlot--;
-        return item;
-      }
-    },
-
-    topStack: function() {
-      var item = this.compileStack[this.compileStack.length - 1];
-
-      if (item instanceof Literal) {
-        return item.value;
-      } else {
-        return item;
-      }
-    },
-
-    quotedString: function(str) {
-      return '"' + str
-        .replace(/\\/g, '\\\\')
-        .replace(/"/g, '\\"')
-        .replace(/\n/g, '\\n')
-        .replace(/\r/g, '\\r') + '"';
-    },
-
-    setupHelper: function(paramSize, name) {
-      var params = [];
-      this.setupParams(paramSize, params);
-      var foundHelper = this.nameLookup('helpers', name, 'helper');
-
-      return {
-        params: params,
-        name: foundHelper,
-        callParams: ["depth0"].concat(params).join(", "),
-        helperMissingParams: ["depth0", this.quotedString(name)].concat(params).join(", ")
-      };
-    },
-
-    // the params and contexts arguments are passed in arrays
-    // to fill in
-    setupParams: function(paramSize, params) {
-      var options = [], contexts = [], param, inverse, program;
-
-      options.push("hash:" + this.popStack());
-
-      inverse = this.popStack();
-      program = this.popStack();
-
-      // Avoid setting fn and inverse if neither are set. This allows
-      // helpers to do a check for `if (options.fn)`
-      if (program || inverse) {
-        if (!program) {
-          this.context.aliases.self = "this";
-          program = "self.noop";
-        }
-
-        if (!inverse) {
-         this.context.aliases.self = "this";
-          inverse = "self.noop";
-        }
-
-        options.push("inverse:" + inverse);
-        options.push("fn:" + program);
-      }
-
-      for(var i=0; i<paramSize; i++) {
-        param = this.popStack();
-        params.push(param);
-
-        if(this.options.stringParams) {
-          contexts.push(this.popStack());
-        }
-      }
-
-      if (this.options.stringParams) {
-        options.push("contexts:[" + contexts.join(",") + "]");
-      }
-
-      if(this.options.data) {
-        options.push("data:data");
-      }
-
-      params.push("{" + options.join(",") + "}");
-      return params.join(", ");
-    }
-  };
-
-  var reservedWords = (
-    "break else new var" +
-    " case finally return void" +
-    " catch for switch while" +
-    " continue function this with" +
-    " default if throw" +
-    " delete in try" +
-    " do instanceof typeof" +
-    " abstract enum int short" +
-    " boolean export interface static" +
-    " byte extends long super" +
-    " char final native synchronized" +
-    " class float package throws" +
-    " const goto private transient" +
-    " debugger implements protected volatile" +
-    " double import public let yield"
-  ).split(" ");
-
-  var compilerWords = JavaScriptCompiler.RESERVED_WORDS = {};
-
-  for(var i=0, l=reservedWords.length; i<l; i++) {
-    compilerWords[reservedWords[i]] = true;
-  }
-
-  JavaScriptCompiler.isValidJavaScriptVariableName = function(name) {
-    if(!JavaScriptCompiler.RESERVED_WORDS[name] && /^[a-zA-Z_$][0-9a-zA-Z_$]+$/.test(name)) {
-      return true;
-    }
-    return false;
-  };
-
-})(Handlebars.Compiler, Handlebars.JavaScriptCompiler);
-
-Handlebars.precompile = function(string, options) {
-  options = options || {};
-
-  var ast = Handlebars.parse(string);
-  var environment = new Handlebars.Compiler().compile(ast, options);
-  return new Handlebars.JavaScriptCompiler().compile(environment, options);
-};
-
-Handlebars.compile = function(string, options) {
-  options = options || {};
-
-  var compiled;
-  function compile() {
-    var ast = Handlebars.parse(string);
-    var environment = new Handlebars.Compiler().compile(ast, options);
-    var templateSpec = new Handlebars.JavaScriptCompiler().compile(environment, options, undefined, true);
-    return Handlebars.template(templateSpec);
-  }
-
-  // Template is only compiled on first use and cached after that point.
-  return function(context, options) {
-    if (!compiled) {
-      compiled = compile();
-    }
-    return compiled.call(this, context, options);
-  };
-};
-;
-// lib/handlebars/runtime.js
-Handlebars.VM = {
-  template: function(templateSpec) {
-    // Just add water
-    var container = {
-      escapeExpression: Handlebars.Utils.escapeExpression,
-      invokePartial: Handlebars.VM.invokePartial,
-      programs: [],
-      program: function(i, fn, data) {
-        var programWrapper = this.programs[i];
-        if(data) {
-          return Handlebars.VM.program(fn, data);
-        } else if(programWrapper) {
-          return programWrapper;
-        } else {
-          programWrapper = this.programs[i] = Handlebars.VM.program(fn);
-          return programWrapper;
-        }
-      },
-      programWithDepth: Handlebars.VM.programWithDepth,
-      noop: Handlebars.VM.noop
-    };
-
-    return function(context, options) {
-      options = options || {};
-      return templateSpec.call(container, Handlebars, context, options.helpers, options.partials, options.data);
-    };
-  },
-
-  programWithDepth: function(fn, data, $depth) {
-    var args = Array.prototype.slice.call(arguments, 2);
-
-    return function(context, options) {
-      options = options || {};
-
-      return fn.apply(this, [context, options.data || data].concat(args));
-    };
-  },
-  program: function(fn, data) {
-    return function(context, options) {
-      options = options || {};
-
-      return fn(context, options.data || data);
-    };
-  },
-  noop: function() { return ""; },
-  invokePartial: function(partial, name, context, helpers, partials, data) {
-    var options = { helpers: helpers, partials: partials, data: data };
-
-    if(partial === undefined) {
-      throw new Handlebars.Exception("The partial " + name + " could not be found");
-    } else if(partial instanceof Function) {
-      return partial(context, options);
-    } else if (!Handlebars.compile) {
-      throw new Handlebars.Exception("The partial " + name + " could not be compiled when running in runtime-only mode");
-    } else {
-      partials[name] = Handlebars.compile(partial, {data: data !== undefined});
-      return partials[name](context, options);
-    }
-  }
-};
-
-Handlebars.template = Handlebars.VM.template;
-;

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/18b073a9/brooklyn-ui/src/main/webapp/assets/js/libs/jquery.ba-bbq.min.js
----------------------------------------------------------------------
diff --git a/brooklyn-ui/src/main/webapp/assets/js/libs/jquery.ba-bbq.min.js b/brooklyn-ui/src/main/webapp/assets/js/libs/jquery.ba-bbq.min.js
deleted file mode 100644
index bcbf248..0000000
--- a/brooklyn-ui/src/main/webapp/assets/js/libs/jquery.ba-bbq.min.js
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * jQuery BBQ: Back Button & Query Library - v1.2.1 - 2/17/2010
- * http://benalman.com/projects/jquery-bbq-plugin/
- * 
- * Copyright (c) 2010 "Cowboy" Ben Alman
- * Dual licensed under the MIT and GPL licenses.
- * http://benalman.com/about/license/
- */
-(function($,p){var i,m=Array.prototype.slice,r=decodeURIComponent,a=$.param,c,l,v,b=$.bbq=$.bbq||{},q,u,j,e=$.event.special,d="hashchange",A="querystring",D="fragment",y="elemUrlAttr",g="location",k="href",t="src",x=/^.*\?|#.*$/g,w=/^.*\#/,h,C={};function E(F){return typeof F==="string"}function B(G){var F=m.call(arguments,1);return function(){return G.apply(this,F.concat(m.call(arguments)))}}function n(F){return F.replace(/^[^#]*#?(.*)$/,"$1")}function o(F){return F.replace(/(?:^[^?#]*\?([^#]*).*$)?.*/,"$1")}function f(H,M,F,I,G){var O,L,K,N,J;if(I!==i){K=F.match(H?/^([^#]*)\#?(.*)$/:/^([^#?]*)\??([^#]*)(#?.*)/);J=K[3]||"";if(G===2&&E(I)){L=I.replace(H?w:x,"")}else{N=l(K[2]);I=E(I)?l[H?D:A](I):I;L=G===2?I:G===1?$.extend({},I,N):$.extend({},N,I);L=a(L);if(H){L=L.replace(h,r)}}O=K[1]+(H?"#":L||!K[1]?"?":"")+L+J}else{O=M(F!==i?F:p[g][k])}return O}a[A]=B(f,0,o);a[D]=c=B(f,1,n);c.noEscape=function(G){G=G||"";var F=$.map(G.split(""),encodeURIComponent);h=new RegExp(F.join("|"),"g")};c.no
 Escape(",/");$.deparam=l=function(I,F){var H={},G={"true":!0,"false":!1,"null":null};$.each(I.replace(/\+/g," ").split("&"),function(L,Q){var K=Q.split("="),P=r(K[0]),J,O=H,M=0,R=P.split("]["),N=R.length-1;if(/\[/.test(R[0])&&/\]$/.test(R[N])){R[N]=R[N].replace(/\]$/,"");R=R.shift().split("[").concat(R);N=R.length-1}else{N=0}if(K.length===2){J=r(K[1]);if(F){J=J&&!isNaN(J)?+J:J==="undefined"?i:G[J]!==i?G[J]:J}if(N){for(;M<=N;M++){P=R[M]===""?O.length:R[M];O=O[P]=M<N?O[P]||(R[M+1]&&isNaN(R[M+1])?{}:[]):J}}else{if($.isArray(H[P])){H[P].push(J)}else{if(H[P]!==i){H[P]=[H[P],J]}else{H[P]=J}}}}else{if(P){H[P]=F?i:""}}});return H};function z(H,F,G){if(F===i||typeof F==="boolean"){G=F;F=a[H?D:A]()}else{F=E(F)?F.replace(H?w:x,""):F}return l(F,G)}l[A]=B(z,0);l[D]=v=B(z,1);$[y]||($[y]=function(F){return $.extend(C,F)})({a:k,base:k,iframe:t,img:t,input:t,form:"action",link:k,script:t});j=$[y];function s(I,G,H,F){if(!E(H)&&typeof H!=="object"){F=H;H=G;G=i}return this.each(function(){var L=$(this)
 ,J=G||j()[(this.nodeName||"").toLowerCase()]||"",K=J&&L.attr(J)||"";L.attr(J,a[I](K,H,F))})}$.fn[A]=B(s,A);$.fn[D]=B(s,D);b.pushState=q=function(I,F){if(E(I)&&/^#/.test(I)&&F===i){F=2}var H=I!==i,G=c(p[g][k],H?I:{},H?F:2);p[g][k]=G+(/#/.test(G)?"":"#")};b.getState=u=function(F,G){return F===i||typeof F==="boolean"?v(F):v(G)[F]};b.removeState=function(F){var G={};if(F!==i){G=u();$.each($.isArray(F)?F:arguments,function(I,H){delete G[H]})}q(G,2)};e[d]=$.extend(e[d],{add:function(F){var H;function G(J){var I=J[D]=c();J.getState=function(K,L){return K===i||typeof K==="boolean"?l(I,K):l(I,L)[K]};H.apply(this,arguments)}if($.isFunction(F)){H=F;return G}else{H=F.handler;F.handler=G}}})})(jQuery,this);
-/*
- * jQuery hashchange event - v1.2 - 2/11/2010
- * http://benalman.com/projects/jquery-hashchange-plugin/
- * 
- * Copyright (c) 2010 "Cowboy" Ben Alman
- * Dual licensed under the MIT and GPL licenses.
- * http://benalman.com/about/license/
- */
-(function($,i,b){var j,k=$.event.special,c="location",d="hashchange",l="href",f=$.browser,g=document.documentMode,h=f.msie&&(g===b||g<8),e="on"+d in i&&!h;function a(m){m=m||i[c][l];return m.replace(/^[^#]*#?(.*)$/,"$1")}$[d+"Delay"]=100;k[d]=$.extend(k[d],{setup:function(){if(e){return false}$(j.start)},teardown:function(){if(e){return false}$(j.stop)}});j=(function(){var m={},r,n,o,q;function p(){o=q=function(s){return s};if(h){n=$('<iframe src="javascript:0"/>').hide().insertAfter("body")[0].contentWindow;q=function(){return a(n.document[c][l])};o=function(u,s){if(u!==s){var t=n.document;t.open().close();t[c].hash="#"+u}};o(a())}}m.start=function(){if(r){return}var t=a();o||p();(function s(){var v=a(),u=q(t);if(v!==t){o(t=v,u);$(i).trigger(d)}else{if(u!==t){i[c][l]=i[c][l].replace(/#.*/,"")+"#"+u}}r=setTimeout(s,$[d+"Delay"])})()};m.stop=function(){if(!n){r&&clearTimeout(r);r=0}};return m})()})(jQuery,this);
\ No newline at end of file