first stab at querycode - works but one needs to select the lang for now
[unfold.git] / engine / static / js / manifold-pubsub.js
index ae9067f..54dba52 100644 (file)
@@ -1,7 +1,3 @@
-/*
- * This file is included in tophat_render.php
- */
-
 /* getting random error messages with this... -- jordan
    wait until query code is fixed
 jQuery(document).ready(function() {
@@ -57,11 +53,11 @@ function clone_object(obj) {
 }
 
 /* https://gist.github.com/661855 */
-(function(jQuery) {
+(function($) {
 
-  var o = jQuery({});
+  var o = $({});
 
-  jQuery.subscribe = function( types, selector, data, fn) {
+  $.subscribe = function( types, selector, data, fn) {
     /* borrowed from jQuery */
     if ( data == null && fn == null ) {
         // ( types, fn )
@@ -97,23 +93,23 @@ function clone_object(obj) {
     }]);
   };
 
-  jQuery.unsubscribe = function() {
+  $.unsubscribe = function() {
     o.off.apply(o, arguments);
   };
 
-  jQuery.publish = function() {
+  $.publish = function() {
     o.trigger.apply(o, arguments);
   };
 
 }(jQuery));
 
 
-function executeFunctionByName(functionName, context /*, args */) {
-  var args = Array.prototype.slice.call(arguments).splice(2);
-  var namespaces = functionName.split(".");
-  var func = namespaces.pop();
-  for(var i = 0; i < namespaces.length; i++) {
-    context = context[namespaces[i]];
-  }
-  return context[func].apply(this, args);
-}
+//function executeFunctionByName(functionName, context /*, args */) {
+//  var args = Array.prototype.slice.call(arguments).splice(2);
+//  var namespaces = functionName.split(".");
+//  var func = namespaces.pop();
+//  for(var i = 0; i < namespaces.length; i++) {
+//    context = context[namespaces[i]];
+//  }
+//  return context[func].apply(this, args);
+//}