aboutsummaryrefslogtreecommitdiff
path: root/mod/developers/views/default/js/developers
diff options
context:
space:
mode:
Diffstat (limited to 'mod/developers/views/default/js/developers')
-rw-r--r--mod/developers/views/default/js/developers/developers.php44
1 files changed, 44 insertions, 0 deletions
diff --git a/mod/developers/views/default/js/developers/developers.php b/mod/developers/views/default/js/developers/developers.php
new file mode 100644
index 000000000..6e82295aa
--- /dev/null
+++ b/mod/developers/views/default/js/developers/developers.php
@@ -0,0 +1,44 @@
+<?php
+/**
+ * Elgg developers tool JavaScript
+ */
+?>
+
+elgg.provide('elgg.dev');
+
+elgg.dev.init = function() {
+ $('.developers-form-inspect').live('submit', elgg.dev.inspectSubmit);
+};
+
+/**
+ * Submit the inspect form through Ajax
+ *
+ * Requires the jQuery Form Plugin.
+ *
+ * @param {Object} event
+ */
+elgg.dev.inspectSubmit = function(event) {
+
+ $("#developers-inspect-results").hide();
+ $("#developers-ajax-loader").show();
+
+ $(this).ajaxSubmit({
+ dataType : 'json',
+ success : function(response) {
+ if (response) {
+ $("#developers-inspect-results").html(response.output);
+ $("#developers-inspect-results").jstree({
+ "plugins" : [ "themes", "html_data" ],
+ "themes" : {"icons" : false}
+ }).bind("loaded.jstree", function() {
+ $("#developers-inspect-results").fadeIn();
+ $("#developers-ajax-loader").hide();
+ });
+ }
+ }
+ });
+
+ event.preventDefault();
+};
+
+elgg.register_hook_handler('init', 'system', elgg.dev.init); \ No newline at end of file