X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=manifold%2Fjs%2Fmanifold-core-leftovers.js;fp=manifold%2Fjs%2Fmanifold-core.js;h=b6450017d5c5b0bfb03637aa7678cfb029fd5343;hb=ee1403fe15f21c08fcd97f770f64ef44122e2c23;hp=ae9067f512f1544fe6f1b3bc7c9b7f9fdc967266;hpb=0c6de66411d990fcd28278ec396456203acef805;p=unfold.git diff --git a/manifold/js/manifold-core.js b/manifold/js/manifold-core-leftovers.js similarity index 55% rename from manifold/js/manifold-core.js rename to manifold/js/manifold-core-leftovers.js index ae9067f5..b6450017 100644 --- a/manifold/js/manifold-core.js +++ b/manifold/js/manifold-core-leftovers.js @@ -31,15 +31,6 @@ jQuery(document).ready(function() { }); */ -function get_value(value) { - //if(typeof(jQuery(value).attr('value'))!="undefined"){ - if (/.*<\/span>/i.test(value)) { - return jQuery(value).attr('value'); - } else { - return value; - } -} - /* From: http://stackoverflow.com/questions/122102/what-is-the-most-efficient-way-to-clone-a-javascript-object I want to note that the .clone() method in jQuery only clones DOM elements. In order to clone JavaScript objects, you would do: @@ -56,58 +47,6 @@ function clone_object(obj) { return jQuery.extend(true, {}, obj); } -/* https://gist.github.com/661855 */ -(function(jQuery) { - - var o = jQuery({}); - - jQuery.subscribe = function( types, selector, data, fn) { - /* borrowed from jQuery */ - if ( data == null && fn == null ) { - // ( types, fn ) - fn = selector; - data = selector = undefined; - } else if ( fn == null ) { - if ( typeof selector === "string" ) { - // ( types, selector, fn ) - fn = data; - data = undefined; - } else { - // ( types, data, fn ) - fn = data; - data = selector; - selector = undefined; - } - } - /* */ - - /* We use an indirection function that will clone the object passed in - * parameter to the subscribe callback - * - * FIXME currently we only clone query objects which are the only ones - * supported and editable, we might have the same issue with results but - * the page load time will be severely affected... - */ - o.on.apply(o, [types, selector, data, function() { - for(i = 1; i < arguments.length; i++) { - if ( arguments[i].constructor.name == 'Query' ) - arguments[i] = arguments[i].clone(); - } - fn.apply(o, arguments); - }]); - }; - - jQuery.unsubscribe = function() { - o.off.apply(o, arguments); - }; - - jQuery.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(".");