Skip to content

Commit

Permalink
Add XUL toolbarspacer and toolbarspring elements.
Browse files Browse the repository at this point in the history
Closes issue clientside#94.
  • Loading branch information
h6w committed Oct 13, 2011
1 parent 4f1ee51 commit c6f15ac
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 2 deletions.
4 changes: 3 additions & 1 deletion ample/languages/xul/.files
Expand Up @@ -79,6 +79,8 @@ elements/tabpanels.js
elements/toolbar.js
elements/toolbarbutton.js
elements/toolbarseparator.js
elements/toolbarspacer.js
elements/toolbarspring.js
elements/toolbargrippy.js
elements/toolbox.js
# listbox
Expand Down Expand Up @@ -116,4 +118,4 @@ elements/datepicker-pane.js
elements/colorpicker-pane.js
elements/tooltip-pane.js
# custom
elements/sidebar.js
elements/sidebar.js
28 changes: 28 additions & 0 deletions ample/languages/xul/elements/toolbarspacer.js
@@ -0,0 +1,28 @@
/*
* Ample SDK - JavaScript GUI Framework
*
* Copyright (c) 2009 Sergey Ilinsky
* Dual licensed under the MIT and GPL licenses.
* See: http://www.amplesdk.com/about/licensing/
*
*/

var cXULElement_toolbarspacer = function(){};
cXULElement_toolbarspacer.prototype = new cXULElement("toolbarspacer");

// Class Events Handlers
cXULElement_toolbarspacer.handlers = {
"DOMAttrModified": function(oEvent) {
if (oEvent.target == this) {
this.$mapAttribute(oEvent.attrName, oEvent.newValue);
}
}
};

// Element Render: open
cXULElement_toolbarspacer.prototype.$getTagOpen = function() {
return '<div class="xul-toolbarspacer' + (this.attributes["class"] ? " " + this.attributes["class"] : "") + '"><br /></div>';
};

// Register Element
ample.extend(cXULElement_toolbarspacer);
32 changes: 32 additions & 0 deletions ample/languages/xul/elements/toolbarspring.js
@@ -0,0 +1,32 @@
/*
* Ample SDK - JavaScript GUI Framework
*
* Copyright (c) 2009 Sergey Ilinsky
* Dual licensed under the MIT and GPL licenses.
* See: http://www.amplesdk.com/about/licensing/
*
*/

var cXULElement_toolbarspring = function(){};
cXULElement_toolbarspring.prototype = new cXULElement("toolbarspring");

// Attributes Defaults
cXULElement_toolbarspring.attributes = {};
cXULElement_toolbarspring.attributes.flex = "1";

// Class Events Handlers
cXULElement_toolbarspring.handlers = {
"DOMAttrModified": function(oEvent) {
if (oEvent.target == this) {
this.$mapAttribute(oEvent.attrName, oEvent.newValue);
}
}
};

// Element Render: open
cXULElement_toolbarspring.prototype.$getTagOpen = function() {
return '<div class="xul-toolbarspring' + (this.attributes["class"] ? " " + this.attributes["class"] : "") + '"><br /></div>';
};

// Register Element
ample.extend(cXULElement_toolbarspring);
8 changes: 7 additions & 1 deletion ample/languages/xul/themes/default/toolbox.css
Expand Up @@ -19,6 +19,12 @@ xul|toolbarseparator {
background: url(media/toolbarseparator.gif) repeat-y;
}

xul|toolbarspacer {
}

xul|toolbarspring {
}

xul|toolbargrippy {
width: 3px;
margin: 3px;
Expand Down Expand Up @@ -109,4 +115,4 @@ xul|toolbarbutton:disabled xul|toolbarbutton-top,
xul|toolbarbutton:disabled xul|toolbarbutton-left,
xul|toolbarbutton:disabled xul|toolbarbutton-bottom {
background: none;
}
}

0 comments on commit c6f15ac

Please sign in to comment.