| author | Maciej Bendkowski | 2012-08-10 06:42:26 (EDT) |
|---|---|---|
| committer | Szymon Brandys | 2012-08-28 09:33:33 (EDT) |
| commit | da2374535e14be0d2fed092da986431730a4e3e1 (patch) (side-by-side diff) | |
| tree | 3c9b784c44a01b574844fa5394f68759e6e3edeb | |
| parent | 7b384d7c42b17b4ad5c45bdbb13256db19eaa182 (diff) | |
| download | org.eclipse.orion.client-da2374535e14be0d2fed092da986431730a4e3e1.zip org.eclipse.orion.client-da2374535e14be0d2fed092da986431730a4e3e1.tar.gz org.eclipse.orion.client-da2374535e14be0d2fed092da986431730a4e3e1.tar.bz2 | |
Bug 386943 - Some suggestions for git-repository page and dynamic content loading
| -rw-r--r-- | bundles/org.eclipse.orion.client.core/web/orion/dynamicContent.js | 61 |
1 files changed, 58 insertions, 3 deletions
diff --git a/bundles/org.eclipse.orion.client.core/web/orion/dynamicContent.js b/bundles/org.eclipse.orion.client.core/web/orion/dynamicContent.js index 5a0506c..ecab73c 100644 --- a/bundles/org.eclipse.orion.client.core/web/orion/dynamicContent.js +++ b/bundles/org.eclipse.orion.client.core/web/orion/dynamicContent.js @@ -11,7 +11,7 @@ define(['dojo', 'dijit'], function(dojo, dijit){
/**
- * Default progress indicator in form of a simple spinner.
+ * Progress indicator in form of a simple spinner.
*
* @param id [required] unique identifier, e.g. the row number in which the spinner is created
* @param anchor [required] father DOM node for the created spinner
@@ -63,6 +63,60 @@ // add constructor
ProgressSpinner.prototype.constructor = ProgressSpinner;
+ /**
+ * Default progress indicator in form of three dots.
+ *
+ * @param id [required] unique identifier, e.g. the row number in which the spinner is created
+ * @param anchor [required] father DOM node for the created spinner
+ *
+ * @returns ProgressDots object
+ */
+ function ProgressDots(id, anchor){
+ if(id === undefined){ throw new Error("Missing reqired argument: id"); }
+ if(anchor === undefined){ throw new Error("Missing reqired argument: anchor"); }
+
+ this._id = id;
+ this._anchor = anchor;
+
+ // we add a prefix for the id label
+ this._prefix = "progressDots:";
+ }
+
+ ProgressDots.prototype = {
+
+ /**
+ * [interface] starts the progress indicator
+ */
+ start: function(){
+ dojo.create("span", {"id":this._prefix+this._id, "style":"text-decoration:blink;", innerHTML:" ..."}, this._anchor);
+ },
+
+ /**
+ * [interface] stops the progress indicator
+ */
+ stop: function(){
+ dojo.destroy(dojo.byId(this._prefix+this._id));
+ },
+
+ /**
+ * [interface] renders the progress indicator after an population error
+ */
+ error: function(err){
+ var indicator = dojo.byId(this._prefix+this._id);
+ dojo.destroy(indicator);
+
+ dojo.create("img", {"src":"/images/problem.gif"}, this._anchor);
+
+ new dijit.Tooltip({
+ connectId: [this._prefix+this._id],
+ label: err
+ });
+ }
+ };
+
+ // add constructor
+ ProgressDots.prototype.constructor = ProgressDots;
+
/**
* Dynamic content model which handles the population logic
*
@@ -110,7 +164,7 @@ DynamicContentRenderer.prototype = {
// default progress indicator
- progressIndicator : ProgressSpinner,
+ progressIndicator : ProgressDots,
// default setup properties
setupProperties : {
@@ -221,6 +275,7 @@ DynamicContentModel : DynamicContentModel,
DynamicContentExplorer : DynamicContentExplorer,
DynamicContentRenderer : DynamicContentRenderer,
- ProgressSpinner : ProgressSpinner
+ ProgressSpinner : ProgressSpinner,
+ ProgressDots : ProgressDots
};
});
\ No newline at end of file |

