Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- : encodeURIComponent(k) + "=" + encodeURIComponent(v)
- ? serialize(v, k)
- k = prefix ? prefix + "[" + p + "]" : p,
- params = [];
- rendered_callback.call(obj.across, ejs, data, obj.html);
- typeof v == "object"
- v = obj[p];
- $('#' + answer.result).html(element);
- $('body').append(element);
- (
- );
- answer = _answer;
- callback.apply(this, params);
- escape.cascade[k].apply(this);
- i = 0;
- if (params == undefined)
- if (typeof(rendered_callback) != 'undefined')
- params.unshift(data);
- phoxy.ApiAnswer(json);
- phoxy.Fancy(obj, args[1], args[2], args[3]);
- str.push
- var
- AfterBefore();
- answer.data);
- answer.hash = "";
- callback(answer.data);
- callback(data);
- callback_or_true_for_return(data);
- callback_or_true_for_return(storage[url]);
- data = {};
- data = {};
- DataLoadedCallback(json.data);
- difference.call(phoxy, target, obj.html, arguments);
- else
- for(var p in obj)
- if (_answer !== undefined)
- if (answer.result === undefined)
- if (callback_condition())
- if (typeof(json.error) != 'undefined')
- obj.on_complete = function()
- phoxy.AJAX(rpc, function(obj)
- phoxy.ApiRequest(phoxy.hash);
- phoxy.DDefer(callback, call_delay);
- phoxy.DDefer.call(Div(), callback, call_delay);
- phoxy.Fancy(design, data, args[2], args[3]);
- phoxy.Fancy(design, data, callback, args[3]);
- phoxy.Load();
- phoxy.Reset(answer.reset);
- phoxy.ScriptsLoaded(answer, callback);
- render_id = answer.replace;
- render_id,
- require(answer.script, Before);
- return callback(undefined, undefined, undefined);
- return func();
- return str.join("&");
- return;
- return;
- return; // data will be returned async
- return; // Will be rendered later (async design determine)
- throw "Failed phoxy.Fancy object recognize";
- url,
- var rpc = args[0];
- var str = [];
- WaitAndCallCountDown(i - 1);
- window[answer.before](answer, AfterBefore);
- window[answer.routeline](answer);
- {
- {
- {
- {
- }
- });
- });
- };
- $("#" + result).replaceWith(html);
- $(target).html(html);
- $(target).replaceWith(html);
- $.getJSON(phoxy.Config()['api_dir'] + "/" + url, function(data)
- // Maybe its wrong. Maybe i should ignore other params
- // Those ignored since it phoxy.DeferRender. Place to render already choosed
- // Those removed because we dont need to render anything
- alert(answer.error);
- baseUrl: phoxy.Config()['js_dir']
- Before();
- callback = function (){};
- callback();
- callback.call(that.across);
- callback.call(this);
- callback.call(this); // Local fancy context
- check_delay = 500; // check every 500ms
- check_delay = check_every;
- check_timeout = 60, // 1 minute for render to complete
- check_timeout = timeout;
- data = args[1];
- data = data_load_functor(DataLoadedCallback);
- data = {};
- delete obj.design;
- delete obj.replace;
- delete obj.result;
- design += ".ejs";
- design = args[0];
- design = design(data, DetermineAsync);
- ejs = new EJS({'url' : design});
- else
- else
- escape.on_complete();
- function AfterBefore(_answer)
- function DetermineAsync(design)
- hash = t;
- hash = t;
- html = html.html;
- html = obj.html;
- if (!callback_condition())
- if (!phoxy.loaded)
- if (answer.before !== undefined)
- if (answer.hash === null)
- if (answer.replace === undefined)
- if (answer.reset !== undefined)
- if (answer.routeline !== undefined)
- if (callback)
- if (i <= 0)
- if (phoxy.ChangeHash(location.hash))
- if (typeof (escape.cascade[k]) == 'function')
- if (typeof callback == 'function')
- if (typeof(args[0]) != 'object')
- if (typeof(args[0]) == 'string')
- if (typeof(args[0]) == 'undefined')
- if (typeof(callback_or_true_for_return) == 'function')
- if (typeof(callback_or_true_for_return) == 'function')
- if (typeof(data) != 'object')
- if (typeof(data) == 'undefined')
- if (typeof(data) == 'undefined')
- if (typeof(design) != 'string')
- location = host;
- location.reload();
- location.reload(parts[0]);
- phoxy.AJAX(rpc_url, function(json)
- phoxy.ApiAnswer(obj, function()
- phoxy.ChangeHash("#" + parts[1]);
- phoxy.ChangeHash('');
- phoxy.ChangeHash(url);
- phoxy.Defer(function()
- phoxy.Disappeared('#' + id, ScriptsFiresUp);
- phoxy.Fancy(args[0], data, args[2], args[3]);
- phoxy.Fancy(ejs, data, function(obj, ejs, data)
- phoxy.Render(
- phoxy.Reset(answer.reset);
- phoxy.WaitFor(IsDivAppeared, function()
- phoxy.WaitFor(IsDivDisappeared, function()
- phoxy[func] = phoxy[system_name][func];
- ret += dictonary.charAt(Math.floor(Math.random() * dictonary.length));
- return $(el).wrapAll('<div></div>').parent().html();
- return $(jquery_selector);
- return $(jquery_selector)[0] == undefined;
- return callback(html, design, data);
- return Div()[0] != undefined;
- return func();
- return phoxy.ApiRequest(url, undefined);
- return phoxy.ApiRequest(url, undefined, arguments[1]);
- return ScriptsFiresUp();
- return storage[url];
- return true;
- return;
- return;
- return;
- storage = {};
- storage[url] = data;
- tag = '<defer_render>';
- tag = '<div>';
- this.ChangeHash(answer.hash);
- throw "Failed phoxy.Fancy data receive";
- throw "Phoxy method mapping failed on '" + func + '. Already exsists.';
- url += '?' + serialize(obj_optional);
- var data = obj.data;
- var data_load_functor = args[1];
- var design = obj.design;
- var obj = args[0];
- var rpc_url = args[1];
- var serialize = function(obj, prefix)
- {
- {
- {
- {
- {
- {
- {
- {
- {
- {
- }
- }
- }
- }
- });
- });
- }, check_delay);
- }, timeout)
- }, timeout);
- }, true);
- *
- *
- *
- *
- *
- * * or could be returned asynchronously with callback, as soon as it will be ready.
- * * (result/replace keywords ignoring)
- * * Data could be returned directly (object only)
- * * First parameter is EJS string, same as in 'design' keyword
- * * First paremeter if method which determine design in runtime
- * * Generating data through function
- * * Just same as [b0] for data preparing do.
- * * NOTICE: All keywoards ARE interprenting
- * * NOTICE: Every keywoards except data ARE ignored.
- * * Only invoking callback with prepared data
- * * Requesting data with RPC
- * * Serving with constructed object. Ready to render!
- * * Then it full RPC call, with fixed render place
- * * Then params already constructed with object
- * * Used when design determining dynamically
- * [a0] phoxy.Fancy(string, undefined, anytype)
- * [a1] phoxy.Fancy(object, undefined, anytype)
- * [b0] phoxy.Fancy(anytype, function, anytype)
- * [b1] phoxy.Fancy(anytype, string, anytype)
- * [b2] phoxy.Fancy(anytype, object, anytype)
- * [c0] phoxy.Fancy(undefined, NOT undefined, anytype)
- * [c1] phoxy.Fancy(string, NOT undefined, anytype)
- * [c2] phoxy.Fancy(function, NOT undefined, anytype)
- */
- */
- */
- $(function()
- $(window).bind('hashchange', PhoxyHashChangeCallback);
- $.get(url, AddToLocalStorage);
- ({
- /*
- /* Data preparing
- /* Rendering
- //else
- //if (!phoxy.ForwardDownload(design))
- args.push(function(target, html)
- args.push(function(target, html)
- callback(html, design, data);
- console.log("phoxy.AJAX", arguments);
- console.log("phoxy.DeferRender", arguments);
- console.log("phoxy.Fancy", arguments);
- console.log("phoxy.FireUp", [escape.name, escape]);
- console.log("phoxy.Render", arguments);
- console.log("You can't invoke this.Defer... methods after rendering finished.\
- console.log("You can't invoke this.Defer... methods after rendering finished.\
- console.log("You can't invoke this.Defer... methods after rendering finished.\
- debugger; // already finished
- debugger; // already finished
- debugger; // already finished
- delete phoxy.Load; // Cause this is only one time execution
- delete phoxy.UpdateRequireConfig;
- else
- else
- else
- else
- else
- else if (typeof(args[0]) == 'function')
- else if (typeof(args[1]) != 'object')
- else if (typeof(args[1]) == 'string')
- escape.fired_up = true;
- for (var i = 0; i < 10; i++)
- for (var k in escape.cascade)
- func();
- function AddToLocalStorage(data)
- function Before()
- function DataLoadedCallback(data)
- function Div()
- function GetElementCode( el )
- function IsDivAppeared()
- function IsDivDisappeared()
- function PhoxyHashChangeCallback()
- function ScriptsFiresUp()
- function WaitAndCallCountDown( i )
- function()
- html = phoxy.Render(ejs_location, undefined, data, true);
- if (!raw_output)
- if (answer.design === undefined)
- if (answer.error)
- if (answer.hash !== undefined)
- if (answer.reset !== undefined)
- if (answer.script)
- if (arguments.length == 1)
- if (arguments.length == 2 && typeof arguments[1] == 'function')
- if (callback_condition())
- if (callback_or_true_for_return === true)
- if (check_every != undefined)
- if (data === undefined)
- if (design.indexOf(".ejs") == -1)
- if (host.length)
- if (is_phoxy_internal_call)
- if (obj_optional != undefined)
- if (parts[1] == undefined)
- if (result != undefined && result != '')
- if (storage[url] != undefined)
- if (t !== undefined)
- if (t !== undefined)
- if (tag == undefined)
- if (tag == undefined)
- if (timeout != undefined)
- if (typeof callback == 'function')
- if (typeof callback == 'function')
- if (typeof phoxy[func] != 'undefined')
- if (typeof(args[0]) == 'string')
- if (typeof(args[0]) == 'undefined')
- if (typeof(args[1]) == 'function')
- if (typeof(args[1]) == 'undefined')
- if (typeof(callback) == 'undefined')
- if (typeof(escape.on_complete) == 'function')
- if (typeof(storage) === "undefined")
- if (url == true)
- location.hash = hash;
- phoxy.__REFACTOR_RenderPrototype.apply(this, args);
- phoxy.__REFACTOR_RenderPrototype.apply(this, args);
- phoxy.AJAX(url, phoxy.ApiAnswer, [callback]);
- phoxy.ApiRequest($(this).attr("phoxy"));
- phoxy.ApiRequest(hash);
- phoxy.ApiRequest(url, function(data)
- phoxy.Appeared(target, function()
- phoxy.Defer(function()
- phoxy.Defer(function()
- phoxy.Defer.call(this, callback);
- phoxy.ForwardDownload(url + ".ejs", function()
- phoxy.hash = hash;
- phoxy.RenderCalls--;
- phoxy.RenderReplace('#' + id, ejs, data, rendered_callback);
- requirejs.config
- return canvas.html;
- return false;
- return obj;
- return result;
- return ret;
- return ret;
- return this.config;
- return { id: id, obj: obj, html: div };
- return;
- setTimeout(func, time);
- t = hash.split(location.origin)[1];
- that.cascade = [];
- that.CheckIsCompleted.call(that.across);
- that.CheckIsCompleted.call(that.across);
- this);
- this.hash = hash;
- this.loaded = true;
- time = 0;
- var
- var args = arguments;
- var args = Array.prototype.slice.call(arguments);
- var args = Array.prototype.slice.call(arguments);
- var callback = args[2];
- var canvas = phoxy.PrepareCanvas('<render>');
- var canvas = phoxy.PrepareCanvas(tag);
- var dictonary = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
- var div = GetElementCode(obj);
- var ejs;
- var ejs_location = phoxy.Config()['ejs_dir'] + "/" + design;
- var element = canvas.obj;
- var func = function()
- var hash = location.hash.substring(1);
- var host = parts[0];
- var html = obj = ejs.render(data, is_phoxy_internal_call);
- var html;
- var html;
- var id = phoxy.GenerateUniqueID();
- var id = canvas.id;
- var id = canvas.id;
- var obj = $(tag).attr('id', id);
- var parts = url.split('#');
- var render_id = id;
- var ret = "";
- var ret = phoxy.hash != hash;
- var t = hash.split('#')[1];
- var t;
- var url = phoxy.Config()['ejs_dir'] + "/" + answer.design;
- WaitAndCallCountDown(check_timeout * 1000 / check_delay);
- {
- {
- {
- {
- {
- {
- {
- {
- {
- {
- {
- {
- {
- {
- {
- {
- {
- {
- {
- {
- {
- {
- {
- {
- {
- {
- {
- {
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- });
- });
- });
- });
- });
- });
- });
- });
- },
- }, undefined, -1);
- "//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js",
- "//ajax.googleapis.com/ajax/libs/jqueryui/1.10.2/jquery-ui.min.js",
- "libs/EJS/ejs.js"
- "libs/jquery.form"
- "libs/text", // part of require js
- $('script[phoxy]').each(function()
- // but Canvas.on_completed not prepared
- // If you losed context from this, and access it with __context
- // In case of recursive rendering, forbid later using
- // Invoke client code
- // no one DeferRender was invoked
- // So render plan is plain, and we attach CheckIsCompleted in this.Defer queue
- // Then probably its too late to use this methods:
- Config : function()
- delete phoxy[system_name];
- delete this.across.Defer;
- delete this.across.DeferCascade;
- delete this.across.DeferRender;
- else
- for (var func in phoxy[system_name])
- function CBHook()
- function CBHook()
- if (--escape.recursive == 0)
- if (result.not('defer_render,render,.phoxy_ignore').size())
- if (that.fired_up)
- if (that.fired_up)
- if (that.fired_up)
- if (this.recursive)
- if (time == -1)
- if (time == undefined)
- if (typeof that.cascade == 'undefined')
- origin_RenderCompleted.apply(this);
- phoxy.config = data;
- phoxy.Defer.call(this, function()
- phoxy.DependenciesLoaded();
- phoxy.RenderCalls++;
- phoxy.RenderCalls++;
- requirejs.config({baseUrl: phoxy.Config()['js_dir']});
- Reset : function (url)
- result = $(result);
- return OriginDefer.call(this, CBHook, time);
- return phoxy.DeferRender(ejs, data, CBHook, tag);
- return result.nextAll().not('defer_render,render,.phoxy_ignore').first();
- that.cascade.push(callback);
- that.recursive++;
- that.recursive++;
- this.across.Defer(this.CheckIsCompleted);
- this.recursive++;
- var escape = this.escape();
- var func = $.proxy(
- var system_name = systems[k];
- var that = this.escape();
- var that = this.escape();
- var that = this.escape();
- waitSeconds: 60
- {
- {
- {
- {
- {
- {
- {
- {
- {
- {
- {
- {
- {
- {
- {
- {
- {
- {
- {
- {
- {
- {
- {
- {
- {
- {
- {
- {
- {
- {
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- });
- }, time);
- $.getJSON("api/phoxy", function(data)
- ([
- ,
- ,
- ,
- ,
- ,
- ,
- ,
- ,
- ,
- ,
- ,
- ,
- ,
- ,
- ,
- ,
- ,
- ,
- ,
- ,
- [
- ]);
- ],
- __REFACTOR_RenderPrototype : function (target, ejs, data, rendered_callback, difference)
- AJAX : function( url, callback, params )
- ApiAnswer : function( answer, callback )
- ApiRequest : function( url, obj_optional, callback )
- Appeared : function(jquery_selector, callback, timeout, call_delay)
- ChangeHash : function (hash)
- config : false,
- DDefer : function(callback, time)
- Defer : function(callback, time)
- DeferRender : function (ejs, data, rendered_callback, tag)
- delete phoxy.Compile; // Only one-time execution
- delete phoxy.DependenciesLoaded; // allow single time execution
- delete phoxy.OverloadEJSCanvas; // Only one-time execution is allowed
- Disappeared : function(jquery_selector, callback, timeout, call_delay)
- EJS.Canvas.across.prototype.Defer = function(callback, time)
- EJS.Canvas.across.prototype.DeferCascade = function(callback)
- EJS.Canvas.across.prototype.DeferRender = function(ejs, data, callback, tag)
- EJS.Canvas.prototype.CheckIsCompleted = function()
- EJS.Canvas.prototype.hook_first = function(result)
- EJS.Canvas.prototype.recursive = 0;
- EJS.Canvas.prototype.RenderCompleted = function()
- Fancy : function(design, data, callback, raw_output)
- for (var k in systems)
- ForwardDownload : function( url, callback_or_true_for_return )
- function()
- GenerateUniqueID : function() // Deprecated, use $.uniqueId();
- hash : false,
- Load : function( )
- loaded : false,
- MenuCall : function( url, callback )
- phoxy.Compile();
- phoxy.OverloadEJSCanvas();
- phoxy.RenderCalls = 0;
- PrepareCanvas : function(tag)
- Render : function (design, result, data, is_phoxy_internal_call)
- RenderInto : function (target, ejs, data, rendered_callback)
- RenderReplace : function (target, ejs, data, rendered_callback)
- require
- ScriptsLoaded : function( answer, callback )
- UpdateRequireConfig : function()
- var origin_RenderCompleted = EJS.Canvas.prototype.RenderCompleted;
- var OriginDefer = EJS.Canvas.across.prototype.Defer;
- var systems = ['_TimeSubsystem', '_RenderSubsystem', '_ApiSubsystem', '_InternalCode'];
- WaitFor : function(callback_condition, callback, timeout, check_every)
- {
- {
- {
- {
- {
- {
- {
- {
- {
- {
- {
- }
- }
- }
- }
- }
- }
- }
- }
- }
- });
- };
- * Load dependencies
- * Overloading EJS method: this.DeferCascade, this.DeferRender etc.
- ***/
- ***/
- (
- );
- /***
- /***
- // ejs = new EJS({'text' : phoxy.ForwardDownload(design), 'name' : design});
- // [a0] ////////
- // [a1] ////////
- // [b0] ////////
- // [b1] ////////
- // [b2] ////////
- // [c0] ////////
- // [c1] ////////
- // [c2] ////////
- Because parent cascade callback already executed, and probably you didn't expect new elements on your context.\
- Because parent cascade callback already executed, and probably you didn't expect new elements on your context.\
- Because parent cascade callback already executed, and probably you didn't expect new elements on your context.\
- Check if you call this.Defer... on DOM(jquery) events? Thats too late. (It mean DOM event exsist -> Render completed).\
- Check if you call this.Defer... on DOM(jquery) events? Thats too late. (It mean DOM event exsist -> Render completed).\
- Check if you call this.Defer... on DOM(jquery) events? Thats too late. (It mean DOM event exsist -> Render completed).\
- In that case use phoxy.Defer methods directly. They context-dependence free.");
- In that case use phoxy.Defer methods directly. They context-dependence free.");
- In that case use phoxy.Defer methods directly. They context-dependence free.");
- phoxy._ApiSubsystem =
- phoxy._InternalCode =
- phoxy._RenderSubsystem =
- phoxy._TimeSubsystem =
- phoxy.Compile = function()
- phoxy.DependenciesLoaded = function()
- phoxy.OverloadEJSCanvas = function()
- require
- requirejs.config({
- var phoxy =
- {
- {
- {
- {
- {
- {
- {
- {
- }
- }
- }
- }
- });
- };
- };
- };
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement