Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 6 commits
  • 8 files changed
  • 0 comments
  • 1 contributor
5 src/plugin/system/files/css/style.css
@@ -325,6 +325,11 @@ div.description {
325 325 padding-bottom: 6px;
326 326 margin-left: 0;
327 327 }
  328 +.doc .linkList dd {
  329 + display: list-item;
  330 + margin: 0;
  331 + list-style: circle inside;
  332 +}
328 333 .doc .light,
329 334 .doc td.attributes,
330 335 .doc .light a:link,
4 src/plugin/system/files/js/RapidContext_Widget.js
@@ -279,8 +279,12 @@ RapidContext.Widget.prototype.setAttrs = function (attrs) {
279 279 this._setHidden(value);
280 280 } else if (value != null) {
281 281 MochiKit.DOM.setNodeAttribute(this, name, value);
  282 + if (typeof(value) != "object") {
  283 + this[name] = value;
  284 + }
282 285 } else {
283 286 this.removeAttribute(name);
  287 + delete this[name];
284 288 }
285 289 }
286 290 };
15 src/plugin/system/files/js/RapidContext_Widget_Icon.js
@@ -68,13 +68,12 @@ RapidContext.Widget.Classes.Icon = RapidContext.Widget.Icon;
68 68 * @param {String} [attrs.tooltip] the icon tooltip text
69 69 */
70 70 RapidContext.Widget.Icon.prototype.setAttrs = function (attrs) {
71   - attrs = MochiKit.Base.update({}, attrs);
72   - if (attrs.ref || attrs.url) {
73   - MochiKit.Base.setdefault(attrs,
74   - RapidContext.Widget.Icon[attrs.ref] || {},
75   - RapidContext.Widget.Icon.DEFAULT);
  71 + var locals = MochiKit.Base.update({}, attrs);
  72 + if (attrs.ref) {
  73 + var ref = RapidContext.Widget.Icon[attrs.ref] || {};
  74 + var def = RapidContext.Widget.Icon.DEFAULT;
  75 + MochiKit.Base.setdefault(locals, ref, def);
76 76 }
77   - var locals = RapidContext.Util.mask(attrs, ["ref", "url", "position", "width", "height", "tooltip"]);
78 77 var styles = {};
79 78 if (locals.url) {
80 79 styles.backgroundImage = 'url("' + locals.url + '")';
@@ -85,11 +84,11 @@ RapidContext.Widget.Icon.prototype.setAttrs = function (attrs) {
85 84 if (locals.width) {
86 85 styles.width = locals.width + "px";
87 86 }
88   - if (locals.height != null) {
  87 + if (locals.height) {
89 88 styles.height = locals.height + "px";
90 89 }
91 90 this.setStyle(styles);
92   - if (typeof(locals.tooltip) != "undefined") {
  91 + if (locals.tooltip && !attrs.title) {
93 92 attrs.title = locals.tooltip;
94 93 }
95 94 this.__setAttrs(attrs);
20 src/plugin/system/files/js/RapidContext_Widget_ProgressBar.js
@@ -91,8 +91,8 @@ RapidContext.Widget.ProgressBar.prototype.setAttrs = function (attrs) {
91 91 if (typeof(attrs.min) != "undefined" || typeof(attrs.max) != "undefined") {
92 92 this.min = attrs.min = Math.max(parseInt(attrs.min) || this.min || 0, 0);
93 93 this.max = attrs.max = Math.max(parseInt(attrs.max) || this.max || 100, this.min);
94   - this.value = null;
95   - this.ratio = 0.0;
  94 + attrs.value = attrs.value || null;
  95 + attrs.ratio = attrs.ratio || 0.0;
96 96 this.startTime = nowTime;
97 97 this.updateTime = nowTime;
98 98 this.timeRemaining = null;
@@ -100,8 +100,9 @@ RapidContext.Widget.ProgressBar.prototype.setAttrs = function (attrs) {
100 100 if (typeof(attrs.value) != "undefined") {
101 101 var value = Math.min(Math.max(parseFloat(attrs.value), this.min), this.max);
102 102 if (!isNaN(value)) {
103   - this.value = attrs.value = value;
104   - this.ratio = (this.value - this.min) / (this.max - this.min);
  103 + attrs.value = value;
  104 + var ratio = (value - this.min) / (this.max - this.min);
  105 + attrs.ratio = attrs.ratio || ratio;
105 106 } else {
106 107 delete attrs.value;
107 108 }
@@ -109,22 +110,19 @@ RapidContext.Widget.ProgressBar.prototype.setAttrs = function (attrs) {
109 110 if (typeof(attrs.ratio) != "undefined") {
110 111 var ratio = Math.min(Math.max(parseFloat(attrs.ratio), 0.0), 1.0);
111 112 if (!isNaN(ratio)) {
112   - this.ratio = attrs.ratio = ratio;
  113 + attrs.ratio = ratio;
113 114 } else {
114 115 delete attrs.ratio;
115 116 }
116 117 }
117   - if (typeof(attrs.text) != "undefined") {
118   - this.text = attrs.text;
119   - }
120 118 if (typeof(attrs.noratio) != "undefined") {
121   - this.noratio = MochiKit.Base.bool(attrs.noratio);
  119 + attrs.noratio = MochiKit.Base.bool(attrs.noratio) || null;
122 120 }
123 121 if (typeof(attrs.novalue) != "undefined") {
124   - this.novalue = MochiKit.Base.bool(attrs.novalue);
  122 + attrs.novalue = MochiKit.Base.bool(attrs.novalue) || null;
125 123 }
126 124 if (typeof(attrs.notime) != "undefined") {
127   - this.notime = MochiKit.Base.bool(attrs.notime);
  125 + attrs.notime = MochiKit.Base.bool(attrs.notime) || null;
128 126 this.timeRemaining = null;
129 127 }
130 128 this.__setAttrs(attrs);
50 src/plugin/system/files/js/RapidContext_Widget_Tree.js
@@ -30,6 +30,20 @@ RapidContext.Widget = RapidContext.Widget || { Classes: {}};
30 30 * @class The tree widget class. Used to provide a dynamic tree with expandable
31 31 * tree nodes, using a number of `<div>` HTML elements.
32 32 * @extends RapidContext.Widget
  33 + *
  34 + * @example {JavaScript}
  35 + * var tree = RapidContext.Widget.Tree({ style: { width: "200px", height: "400px" } });
  36 + * var root = RapidContext.Widget.TreeNode({ folder: true, name: "Root" });
  37 + * var child = RapidContext.Widget.TreeNode({ name: "Child" });
  38 + * root.addAll(child);
  39 + * tree.addAll(root);
  40 + *
  41 + * @example {User Interface XML}
  42 + * <Tree style="width: 200px; height: 400px;">
  43 + * <TreeNode name="Root">
  44 + * <TreeNode name="Child" />
  45 + * </TreeNode>
  46 + * </Tree>
33 47 */
34 48 RapidContext.Widget.Tree = function (attrs/*, ...*/) {
35 49 var o = MochiKit.DOM.DIV(attrs);
@@ -75,12 +89,18 @@ RapidContext.Widget.Tree.prototype.addChildNode = function (child) {
75 89 };
76 90
77 91 /**
78   - * Removes all tree nodes that are marked as unmodified. When adding
79   - * or updating nodes, they (and their parent nodes) are automatically
80   - * marked as modified. This function makes tree pruning possible, by
81   - * initially marking all tree nodes as unmodified (clearing any
82   - * previous modified flag), touching all nodes to be kept, and
83   - * finally calling this method to remove the remaining nodes.
  92 + * Removes all marked tree nodes. When adding or updating tree nodes, any
  93 + * node modified is automatically unmarked (e.g. by calling `setAttrs` on the
  94 + * tree nodes or `addPath` on the tree). This makes it easy to prune a tree
  95 + * after an update, by initially marking all tree nodes with `markAll()`,
  96 + * inserting or touching all nodes to keep, and finally calling this method to
  97 + * remove the remaining nodes.
  98 + *
  99 + * @example
  100 + * tree.markAll();
  101 + * tree.addPath(["Root", "Child"]);
  102 + * ...
  103 + * tree.removeAllMarked();
84 104 */
85 105 RapidContext.Widget.Tree.prototype.removeAllMarked = function () {
86 106 var children = this.getChildNodes();
@@ -94,12 +114,18 @@ RapidContext.Widget.Tree.prototype.removeAllMarked = function () {
94 114 };
95 115
96 116 /**
97   - * Marks all tree nodes as unmodified. When adding or updating nodes,
98   - * they (and their parent nodes) are automatically marked as
99   - * modified. This function makes tree pruning possible, by initially
100   - * marking all tree nodes (clearing any previous modified flag),
101   - * touching all nodes to be kept, and finally calling the
102   - * `removeAllMarked()` method to remove the remaining nodes.
  117 + * Marks this tree node and all child nodes recursively. When adding or
  118 + * updating tree nodes, any node modified is automatically unmarked (e.g. by
  119 + * calling `setAttrs` on the tree nodes or `addPath` on the tree). This makes
  120 + * it easy to prune a tree after an update, by initially marking all tree
  121 + * nodes, inserting or touching all nodes to keep, and finally calling
  122 + * `removeAllMarked()` to remove the remaining nodes.
  123 + *
  124 + * @example
  125 + * tree.markAll();
  126 + * tree.addPath(["Root", "Child"]);
  127 + * ...
  128 + * tree.removeAllMarked();
103 129 */
104 130 RapidContext.Widget.Tree.prototype.markAll = function () {
105 131 var children = this.getChildNodes();
51 src/plugin/system/files/js/RapidContext_Widget_TreeNode.js
@@ -24,7 +24,8 @@ RapidContext.Widget = RapidContext.Widget || { Classes: {}};
24 24 * @constructor
25 25 * @param {Object} attrs the widget and node attributes
26 26 * @param {String} attrs.name the tree node name
27   - * @param {Boolean} [attrs.folder] the folder flag, defaults to false
  27 + * @param {Boolean} [attrs.folder] the folder flag, defaults to false if no
  28 + * child nodes are provided in constructor call
28 29 * @param {String} [attrs.icon] the icon reference to use, defaults
29 30 * to "FOLDER" for folders and "DOCUMENT" otherwise
30 31 * @param {String} [attrs.tooltip] the tooltip text when hovering
@@ -37,6 +38,16 @@ RapidContext.Widget = RapidContext.Widget || { Classes: {}};
37 38 * normally not be listened for on individual tree nodes, but rather on
38 39 * the tree as a whole.
39 40 * @extends RapidContext.Widget
  41 + *
  42 + * @example {JavaScript}
  43 + * var parent = RapidContext.Widget.TreeNode({ folder: true, name: "Parent" });
  44 + * var child = RapidContext.Widget.TreeNode({ name: "Child" });
  45 + * parent.addAll(child);
  46 + *
  47 + * @example {User Interface XML}
  48 + * <TreeNode name="Parent">
  49 + * <TreeNode name="Child" />
  50 + * </TreeNode>
40 51 */
41 52 RapidContext.Widget.TreeNode = function (attrs/*, ...*/) {
42 53 var icon = RapidContext.Widget.Icon({ ref: "BLANK" });
@@ -78,6 +89,10 @@ RapidContext.Widget.TreeNode.prototype._container = function (create) {
78 89 this.appendChild(container);
79 90 var imgNode = this.firstChild.firstChild;
80 91 imgNode.setAttrs({ ref: "PLUS" });
  92 + var iconNode = imgNode.nextSibling;
  93 + if (!RapidContext.Widget.isWidget(iconNode, "Icon") && iconNode.ref == "DOCUMENT") {
  94 + iconNode.setAttrs({ ref: "FOLDER" });
  95 + }
81 96 return container;
82 97 } else {
83 98 return null;
@@ -181,12 +196,18 @@ RapidContext.Widget.TreeNode.prototype.removeChildNode = function (child) {
181 196 };
182 197
183 198 /**
184   - * Removes all tree nodes that are marked as unmodified. When adding
185   - * or updating nodes, they (and their parent nodes) are automatically
186   - * marked as modified. This function makes tree pruning possible, by
187   - * initially marking all tree nodes as unmodified (clearing any
188   - * previous modified flag), touching all nodes to be kept, and
  199 + * Removes all marked tree nodes. When adding or updating tree nodes, any
  200 + * node modified is automatically unmarked (e.g. by calling `setAttrs`). This
  201 + * makes it easy to prune a tree after an update, by initially marking all
  202 + * tree nodes with `markAll()`, inserting or touching all nodes to keep, and
189 203 * finally calling this method to remove the remaining nodes.
  204 + *
  205 + * @example
  206 + * parent.markAll();
  207 + * parent.setAttrs();
  208 + * child.setAttrs();
  209 + * ...
  210 + * parent.removeAllMarked();
190 211 */
191 212 RapidContext.Widget.TreeNode.prototype.removeAllMarked = function () {
192 213 var children = this.getChildNodes();
@@ -200,12 +221,18 @@ RapidContext.Widget.TreeNode.prototype.removeAllMarked = function () {
200 221 };
201 222
202 223 /**
203   - * Marks all tree nodes as unmodified. When adding or updating nodes,
204   - * they (and their parent nodes) are automatically marked as
205   - * modified. This function makes tree pruning possible, by initially
206   - * marking all tree nodes (clearing any previous modified flag),
207   - * touching all nodes to be kept, and finally calling the
208   - * `removeAllMarked()` method to remove the remaining nodes.
  224 + * Marks this tree node and all child nodes recursively. When adding or
  225 + * updating tree nodes, any node modified is automatically unmarked (e.g. by
  226 + * calling `setAttrs`). This makes it easy to prune a tree after an update, by
  227 + * initially marking all tree nodes, inserting or touching all nodes to keep,
  228 + * and finally calling `removeAllMarked()` to remove the remaining nodes.
  229 + *
  230 + * @example
  231 + * parent.markAll();
  232 + * parent.setAttrs();
  233 + * child.setAttrs();
  234 + * ...
  235 + * parent.removeAllMarked();
209 236 */
210 237 RapidContext.Widget.TreeNode.prototype.markAll = function () {
211 238 this.marked = true;
34 src/plugin/system/files/js/RapidContext_Widget_Wizard.js
@@ -35,8 +35,8 @@ RapidContext.Widget = RapidContext.Widget || { Classes: {}};
35 35 * @extends RapidContext.Widget
36 36 *
37 37 * @example {User Interface XML}
38   - * <Dialog id="exDialog" title="Example Dialog" w="80%" h="50%">
39   - * <Wizard id="exWizard" style="width: 100%; height: 100%;">
  38 + * <Dialog id="exampleDialog" title="Example Dialog" w="80%" h="50%">
  39 + * <Wizard id="exampleWizard" style="width: 100%; height: 100%;">
40 40 * <Pane pageTitle="The first step">
41 41 * ...
42 42 * </Pane>
@@ -114,7 +114,8 @@ RapidContext.Widget.Wizard.prototype.getChildNodes = function () {
114 114
115 115 /**
116 116 * Adds a single child page widget to this widget. The child widget should be a
117   - * `RapidContext.Widget.Pane` widget, or it will be added to a new one.
  117 + * `RapidContext.Widget.Pane` widget, or a new one will be created where it
  118 + * will be added.
118 119 *
119 120 * @param {Widget} child the page widget to add
120 121 */
@@ -206,9 +207,14 @@ RapidContext.Widget.Wizard.prototype.activePageIndex = function () {
206 207 };
207 208
208 209 /**
209   - * Activates a new page.
  210 + * Activates a new page and sends the `onchange` signal. If the page is moved
  211 + * forward, the old page must pass a form validation check, or nothing will
  212 + * happen.
210 213 *
211 214 * @param {Number/Widget} indexOrPage the page index or page DOM node
  215 + *
  216 + * @see #next
  217 + * @see #previous
212 218 */
213 219 RapidContext.Widget.Wizard.prototype.activatePage = function (indexOrPage) {
214 220 if (typeof(indexOrPage) == "number") {
@@ -250,8 +256,11 @@ RapidContext.Widget.Wizard.prototype.activatePage = function (indexOrPage) {
250 256 };
251 257
252 258 /**
253   - * Cancels the active page operation. This method will also reset
254   - * the page status of the currently active page to `ANY`.
  259 + * Cancels the active page operation. This method will also reset the page
  260 + * status of the currently active page to `ANY`. This method is triggered when
  261 + * the user presses the "Cancel" button.
  262 + *
  263 + * @see RapidContext.Widget.Pane.ANY
255 264 */
256 265 RapidContext.Widget.Wizard.prototype.cancel = function () {
257 266 var page = this.activePage();
@@ -260,7 +269,9 @@ RapidContext.Widget.Wizard.prototype.cancel = function () {
260 269 };
261 270
262 271 /**
263   - * Moves the wizard backward to the previous page.
  272 + * Moves the wizard backward to the previous page and sends the `onchange`
  273 + * signal. This method is triggered when the user presses the "Previous"
  274 + * button.
264 275 */
265 276 RapidContext.Widget.Wizard.prototype.previous = function () {
266 277 if (this._selectedIndex > 0) {
@@ -269,8 +280,9 @@ RapidContext.Widget.Wizard.prototype.previous = function () {
269 280 };
270 281
271 282 /**
272   - * Moves the wizard forward to the next page. The page will not be
273   - * changed if the active page fails a validation check.
  283 + * Moves the wizard forward to the next page and sends the `onchange` signal.
  284 + * The page will not be changed if the active page fails a validation check.
  285 + * This method is triggered when the user presses the "Next" button.
274 286 */
275 287 RapidContext.Widget.Wizard.prototype.next = function () {
276 288 if (this._selectedIndex < this.getChildNodes().length - 1) {
@@ -279,8 +291,8 @@ RapidContext.Widget.Wizard.prototype.next = function () {
279 291 };
280 292
281 293 /**
282   - * Sends the wizard `onclose` signal when the user presses the finish
283   - * button.
  294 + * Sends the wizard `onclose` signal. This method is triggered when the user
  295 + * presses the "Finish" button.
284 296 */
285 297 RapidContext.Widget.Wizard.prototype.done = function () {
286 298 var page = this.activePage();
8 tools/jsdoc-toolkit/templates/rapidcontext/class.tmpl
@@ -338,7 +338,7 @@
338 338 </dl>
339 339 </if>
340 340 <if test="data.see.length">
341   - <dl class="detailList">
  341 + <dl class="detailList linkList">
342 342 <dt class="heading">See:</dt>
343 343 <for each="item" in="data.see">
344 344 <dd>{+ new Link().toSymbol(item) +}</dd>
@@ -396,7 +396,7 @@
396 396 </dl>
397 397 </if>
398 398 <if test="member.see.length">
399   - <dl class="detailList">
  399 + <dl class="detailList linkList">
400 400 <dt class="heading">See:</dt>
401 401 <for each="item" in="member.see">
402 402 <dd>{+ new Link().toSymbol(item) +}</dd>
@@ -502,7 +502,7 @@
502 502 </dl>
503 503 </if>
504 504 <if test="member.see.length">
505   - <dl class="detailList">
  505 + <dl class="detailList linkList">
506 506 <dt class="heading">See:</dt>
507 507 <for each="item" in="member.see">
508 508 <dd>{+ new Link().toSymbol(item) +}</dd>
@@ -600,7 +600,7 @@
600 600 </dl>
601 601 </if>
602 602 <if test="member.see.length">
603   - <dl class="detailList">
  603 + <dl class="detailList linkList">
604 604 <dt class="heading">See:</dt>
605 605 <for each="item" in="member.see">
606 606 <dd>{+ new Link().toSymbol(item) +}</dd>

No commit comments for this range

Something went wrong with that request. Please try again.