public void Setup()
 {
     _proxyGenerator = CreateProxyGenerator();
     _engine         = new ScriptEngine();
     _engine.Execute("var jQuery = {};");
     _engine.Execute(_proxyGenerator.GenerateProxyScript());
 }
Example #2
0
        private string GetProxyJs(HttpContext context)
        {
            lock (_syncRoot)
            {
                if (_proxyJs == null)
                {
                    _proxyJs = _generator.GenerateProxyScript();
                }
            }

            return(_proxyJs);
        }
		public void Setup()
		{
			_proxyGenerator = CreateProxyGenerator();
			_engine			= new ScriptEngine();
			//create fake implementations of $.isFunction and $.extend
			_engine.Execute(@"var jQuery = { 
				isFunction: function() {}, 
				extend: function() {
					for(var i=1; i<arguments.length; i++)
						for(var key in arguments[i])
							if(arguments[i].hasOwnProperty(key))
								arguments[0][key] = arguments[i][key];
					return arguments[0]; 
				}
			};");
			_engine.Execute(_proxyGenerator.GenerateProxyScript());
		}
Example #4
0
        public void Setup()
        {
            _proxyGenerator = CreateProxyGenerator();
            _engine         = new ScriptEngine();
            //create fake implementations of $.isFunction and $.extend
            _engine.Execute(@"var jQuery = { 
				isFunction: function() {}, 
				extend: function() {
					for(var i=1; i<arguments.length; i++)
						for(var key in arguments[i])
							if(arguments[i].hasOwnProperty(key))
								arguments[0][key] = arguments[i][key];
					return arguments[0]; 
				}
			};"            );
            _engine.Execute(_proxyGenerator.GenerateProxyScript());
        }
Example #5
0
        private string GetProxyJs(HttpContext context)
        {
            if (_proxyJs == null)
            {
                lock (_syncRoot)
                    if (_proxyJs == null)
                    {
                        var script = _generator.GenerateProxyScript();

                        if (!context.IsDebuggingEnabled)
                        {
                            var minifier = new Microsoft.Ajax.Utilities.Minifier();
                            script = minifier.MinifyJavaScript(script);
                        }

                        _proxyJs = script;
                    }
            }

            return(_proxyJs);
        }
 public void Setup()
 {
     _proxyGenerator = CreateProxyGenerator();
     _engine			= new ScriptEngine();
     _engine.Execute("var jQuery = {};");
     _engine.Execute(_proxyGenerator.GenerateProxyScript());
 }