summaryrefslogtreecommitdiff
path: root/modules/developer/js/developer.js
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-03-13 22:15:16 +0000
committerTim Almdal <tnalmdal@shaw.ca>2009-03-13 22:15:16 +0000
commit74768e4cea35051b346eb8009e016f71cd02d0bf (patch)
treec3cce77d4ffa1bce1553e2edac012e61024a5622 /modules/developer/js/developer.js
parent70390e83f867716d4bc919c4937b649ce7a3fdfb (diff)
The first incarnation of the developer tools. This allows the user to
enter a module name, a description and pick the call backs and or events they want to support and generate the basic module skeleton with one click. @todo: clone a module, clone a theme, generate skeleton controller, view,
Diffstat (limited to 'modules/developer/js/developer.js')
-rw-r--r--modules/developer/js/developer.js40
1 files changed, 40 insertions, 0 deletions
diff --git a/modules/developer/js/developer.js b/modules/developer/js/developer.js
new file mode 100644
index 00000000..88b0626a
--- /dev/null
+++ b/modules/developer/js/developer.js
@@ -0,0 +1,40 @@
+$("#gDeveloperTools").ready(function() {
+ $("#gDeveloperTools").tabs();
+});
+
+var module_success = function(data) {
+ //alert(data);
+ $("#gGenerateModule").after('<div id="moduleProgress" style="margin-left: 5em;"></div>');
+ $("#moduleProgress").progressbar();
+
+ var task = data.task;
+ var url = data.url;
+ var done = false;
+ while (!done) {
+ $.ajax({async: false,
+ success: function(data, textStatus) {
+ $("#moduleProgress").progressbar("value", data.task.percent_complete);
+ done = data.task.done;
+ },
+ dataType: "json",
+ type: "POST",
+ url: url
+ });
+ }
+ document.location.reload();
+};
+
+function ajaxify_developer_form(selector, success) {
+ $(selector).ajaxForm({
+ dataType: "json",
+ success: function(data) {
+ if (data.form && data.reseult != "started") {
+ $(selector).replaceWith(data.form);
+ ajaxify_developer_form(selector, success);
+ }
+ if (data.result == "started") {
+ success(data);
+ }
+ }
+ });
+}