aboutsummaryrefslogtreecommitdiff
path: root/mod/developers/views/default/js
diff options
context:
space:
mode:
authorcash <cash.costello@gmail.com>2011-07-02 11:36:53 -0400
committercash <cash.costello@gmail.com>2011-07-02 11:36:53 -0400
commitae5ad0a65508725871159ffb6a068fcb2084aad7 (patch)
tree60d01e69b849e96bff64f92189eb79956fe2fa32 /mod/developers/views/default/js
parentf5f3f205e97c2a3219897dd14de7d57659ce1181 (diff)
downloadelgg-ae5ad0a65508725871159ffb6a068fcb2084aad7.tar.gz
elgg-ae5ad0a65508725871159ffb6a068fcb2084aad7.tar.bz2
added the inspect tool to developers tool plugin
Diffstat (limited to 'mod/developers/views/default/js')
-rw-r--r--mod/developers/views/default/js/developers/developers.php43
1 files changed, 43 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..e6c249eb1
--- /dev/null
+++ b/mod/developers/views/default/js/developers/developers.php
@@ -0,0 +1,43 @@
+<?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({
+ 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