Permalink
Browse files

Add XUL toolbarspacer and toolbarspring elements.

Closes issue #94.
  • Loading branch information...
1 parent 4f1ee51 commit c6f15ac444dcd532ecd74a7c5aa465b439e38b19 @h6w committed Oct 13, 2011
@@ -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
@@ -116,4 +118,4 @@ elements/datepicker-pane.js
elements/colorpicker-pane.js
elements/tooltip-pane.js
# custom
-elements/sidebar.js
+elements/sidebar.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);
@@ -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);
@@ -19,6 +19,12 @@ xul|toolbarseparator {
background: url(media/toolbarseparator.gif) repeat-y;
}
+xul|toolbarspacer {
+}
+
+xul|toolbarspring {
+}
+
xul|toolbargrippy {
width: 3px;
margin: 3px;
@@ -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.