Esempio n. 1
0
    protected void cmdTestSlice_Click(object sender, EventArgs e)
    {
        string result = string.Empty;
        Tracer tracer = new Tracer();

        JQuery jQuery1 = new JQuery("'li'");
        JQuery jQuery2 = new JQuery("'li'");

        result += "测试方法 JQuery.Slice(string)<br />";

        tracer.Execute(jQuery1, null, "Slice", FunctionType.Method, new Type[] { typeof(string) }, null, null, null,
                       new object[][] {
            new object[] { "2" }
        },
                       false
                       );

        result += "jQuery1.Code = " + jQuery1.AddClass("'big'").Code + "<br />";

        result += "测试方法 JQuery.Slice(string, string)<br />";

        tracer.Execute(jQuery2, null, "Slice", FunctionType.Method, new Type[] { typeof(string), typeof(string) }, null, null, null,
                       new object[][] {
            new object[] { "2", "4" }
        },
                       false
                       );

        result += "jQuery2.Code = " + jQuery2.AddClass("'happy'").Code + "<br />";

        this.lblResult.Text = result;

        jQuery1.Build(this, option: ScriptBuildOption.Startup);
        jQuery2.Build(this, option: ScriptBuildOption.Startup);
    }
Esempio n. 2
0
    protected void cmdTestVal_Click(object sender, EventArgs e)
    {
        string result = string.Empty;
        Tracer tracer = new Tracer();

        JQuery jQuery1 = new JQuery("'#myTextBox1'");
        JQuery jQuery2 = new JQuery(jQuery1);

        result += "测试方法 JQuery.Val()<br />";

        tracer.Execute(jQuery1, null, "Val", FunctionType.Method, new Type[] { }, null, null, null,
                       new object[][] {
            new object[] { }
        },
                       false
                       );

        result += "jQuery1.Code = " + jQuery1.Code + "<br />";

        result += "测试方法 JQuery.Val(string)<br />";

        tracer.Execute(jQuery2, null, "Val", FunctionType.Method, new Type[] { typeof(string) }, null, null, null,
                       new object[][] {
            new object[] { "'jack'" }
        },
                       false
                       );

        result += "jQuery2.Code = " + jQuery2.Code + "<br />";

        ScriptHelper scriptHelper = new ScriptHelper();

        scriptHelper.Alert("'myTextBox1.value = ' + " + jQuery1.Code);

        result += "scriptHelper.Code = " + scriptHelper.Code + "<br />";

        this.lblResult.Text = result;

        scriptHelper.Build(this, option: ScriptBuildOption.Startup);
        jQuery2.Build(this, option: ScriptBuildOption.Startup);
    }
Esempio n. 3
0
    protected void cmdTestNot_Click(object sender, EventArgs e)
    {
        string result = string.Empty;
        Tracer tracer = new Tracer();

        JQuery jQuery = new JQuery("'li'");

        result += "测试方法 JQuery.Not(string)<br />";

        tracer.Execute(jQuery, null, "Not", FunctionType.Method, new Type[] { typeof(string) }, null, null, null,
                       new object[][] {
            new object[] { "':eq(0)'" }
        },
                       false
                       );

        result += "jQuery.Code = " + jQuery.AddClass("'big'").Code + "<br />";

        this.lblResult.Text = result;

        jQuery.Build(this, option: ScriptBuildOption.Startup);
    }
Esempio n. 4
0
    protected void cmdTestMap_Click(object sender, EventArgs e)
    {
        string result = string.Empty;
        Tracer tracer = new Tracer();

        JQuery jQuery = new JQuery("'li'");

        result += "测试方法 JQuery.Map(string)<br />";

        tracer.Execute(jQuery, null, "Map", FunctionType.Method, new Type[] { typeof(string) }, null, null, null,
                       new object[][] {
            new object[] { "function(i, o){return alert($(this).text());}" }
        },
                       false
                       );

        result += "jQuery.Code = " + jQuery.Code + "<br />";

        this.lblResult.Text = result;

        jQuery.Build(this, option: ScriptBuildOption.Startup);
    }
Esempio n. 5
0
    protected void cmdTestRemoveAttr_Click(object sender, EventArgs e)
    {
        string result = string.Empty;
        Tracer tracer = new Tracer();

        JQuery jQuery = new JQuery("'#myTable2'");

        result += "测试方法 JQuery.RemoveAttr(string)<br />";

        tracer.Execute(jQuery, null, "RemoveAttr", FunctionType.Method, new Type[] { typeof(string) }, null, null, null,
                       new object[][] {
            new object[] { "'class'" }
        },
                       false
                       );

        result += "jQuery.Code = " + jQuery.Code + "<br />";

        this.lblResult.Text = result;

        jQuery.Build(this, option: ScriptBuildOption.Startup);
    }
Esempio n. 6
0
    protected void cmdTestAddClass_Click(object sender, EventArgs e)
    {
        string result = string.Empty;
        Tracer tracer = new Tracer();

        JQuery jQuery = new JQuery("'table'");

        result += "测试方法 JQuery.AddClass(string)<br />";

        tracer.Execute(jQuery, null, "AddClass", FunctionType.Method, new Type[] { typeof(string) }, null, null, null,
                       new object[][] {
            new object[] { "'box'" },
            new object[] { "function(i, c){ return 'happy'; }" }
        },
                       false
                       );

        result += "jQuery.Code = " + jQuery.Code + "<br />";

        this.lblResult.Text = result;

        jQuery.Build(this, option: ScriptBuildOption.Startup);
    }
Esempio n. 7
0
    protected void cmdTestAttr_Click(object sender, EventArgs e)
    {
        string result = string.Empty;
        Tracer tracer = new Tracer();

        JQuery jQuery1 = new JQuery("'#myTable1'");
        JQuery jQuery2 = new JQuery("'#myTable2'");

        result += "测试方法 JQuery.Attr(string)<br />";

        tracer.Execute(jQuery1, null, "Attr", FunctionType.Method, new Type[] { typeof(string) }, null, null, null,
                       new object[][] {
            new object[] { "{ border: '1' }" },
            new object[] { "'style'" }
        },
                       false
                       );

        result += "jQuery1.Code = " + jQuery1.Code + "<br />";

        result += "测试方法 JQuery.Attr(string, string)<br />";

        tracer.Execute(jQuery2, null, "Attr", FunctionType.Method, new Type[] { typeof(string), typeof(string) }, null, null, null,
                       new object[][] {
            new object[] { "'border'", "'1'" },
            new object[] { "'style'", "function(i, a){ return 'width: 700px'; }" }
        },
                       false
                       );

        result += "jQuery2.Code = " + jQuery2.Code + "<br />";

        this.lblResult.Text = result;

        jQuery1.Build(this, option: ScriptBuildOption.Startup);
        jQuery2.Build(this, option: ScriptBuildOption.Startup);
    }
Esempio n. 8
0
	protected void cmdTestSlice_Click ( object sender, EventArgs e )
	{
		string result = string.Empty;
		Tracer tracer = new Tracer ();

		JQuery jQuery1 = new JQuery ( "'li'" );
		JQuery jQuery2 = new JQuery ( "'li'" );

		result += "测试方法 JQuery.Slice(string)<br />";

		tracer.Execute ( jQuery1, null, "Slice", FunctionType.Method, new Type[] { typeof ( string ) }, null, null, null,
			new object[][] {
				new object[] { "2" }
			},
			false
			);

		result += "jQuery1.Code = " + jQuery1.AddClass ( "'big'" ).Code + "<br />";

		result += "测试方法 JQuery.Slice(string, string)<br />";

		tracer.Execute ( jQuery2, null, "Slice", FunctionType.Method, new Type[] { typeof ( string ), typeof ( string ) }, null, null, null,
			new object[][] {
				new object[] { "2", "4" }
			},
			false
			);

		result += "jQuery2.Code = " + jQuery2.AddClass ( "'happy'" ).Code + "<br />";

		this.lblResult.Text = result;

		jQuery1.Build ( this, option: ScriptBuildOption.Startup );
		jQuery2.Build ( this, option: ScriptBuildOption.Startup );
	}
Esempio n. 9
0
	protected void cmdTestNot_Click ( object sender, EventArgs e )
	{
		string result = string.Empty;
		Tracer tracer = new Tracer ();

		JQuery jQuery = new JQuery ( "'li'" );

		result += "测试方法 JQuery.Not(string)<br />";

		tracer.Execute ( jQuery, null, "Not", FunctionType.Method, new Type[] { typeof ( string ) }, null, null, null,
			new object[][] {
				new object[] { "':eq(0)'" }
			},
			false
			);

		result += "jQuery.Code = " + jQuery.AddClass ( "'big'" ).Code + "<br />";

		this.lblResult.Text = result;

		jQuery.Build ( this, option: ScriptBuildOption.Startup );
	}
Esempio n. 10
0
	protected void cmdTestMap_Click ( object sender, EventArgs e )
	{
		string result = string.Empty;
		Tracer tracer = new Tracer ();

		JQuery jQuery = new JQuery ( "'li'" );

		result += "测试方法 JQuery.Map(string)<br />";

		tracer.Execute ( jQuery, null, "Map", FunctionType.Method, new Type[] { typeof ( string ) }, null, null, null,
			new object[][] {
				new object[] { "function(i, o){return alert($(this).text());}" }
			},
			false
			);

		result += "jQuery.Code = " + jQuery.Code + "<br />";

		this.lblResult.Text = result;

		jQuery.Build ( this, option: ScriptBuildOption.Startup );
	}
Esempio n. 11
0
	protected void cmdTestVal_Click ( object sender, EventArgs e )
	{
		string result = string.Empty;
		Tracer tracer = new Tracer ();

		JQuery jQuery1 = new JQuery ( "'#myTextBox1'" );
		JQuery jQuery2 = new JQuery ( jQuery1 );

		result += "测试方法 JQuery.Val()<br />";

		tracer.Execute ( jQuery1, null, "Val", FunctionType.Method, new Type[] { }, null, null, null,
			new object[][] {
				new object[] { }
			},
			false
			);

		result += "jQuery1.Code = " + jQuery1.Code + "<br />";

		result += "测试方法 JQuery.Val(string)<br />";

		tracer.Execute ( jQuery2, null, "Val", FunctionType.Method, new Type[] { typeof ( string ) }, null, null, null,
			new object[][] {
				new object[] { "'jack'" }
			},
			false
			);

		result += "jQuery2.Code = " + jQuery2.Code + "<br />";

		ScriptHelper scriptHelper = new ScriptHelper ();
		scriptHelper.Alert ( "'myTextBox1.value = ' + " + jQuery1.Code );

		result += "scriptHelper.Code = " + scriptHelper.Code + "<br />";

		this.lblResult.Text = result;

		scriptHelper.Build ( this, option: ScriptBuildOption.Startup );
		jQuery2.Build ( this, option: ScriptBuildOption.Startup );
	}
Esempio n. 12
0
	protected void cmdTestRemoveAttr_Click ( object sender, EventArgs e )
	{
		string result = string.Empty;
		Tracer tracer = new Tracer ();

		JQuery jQuery = new JQuery ( "'#myTable2'" );

		result += "测试方法 JQuery.RemoveAttr(string)<br />";

		tracer.Execute ( jQuery, null, "RemoveAttr", FunctionType.Method, new Type[] { typeof ( string ) }, null, null, null,
			new object[][] {
				new object[] { "'class'" }
			},
			false
			);

		result += "jQuery.Code = " + jQuery.Code + "<br />";

		this.lblResult.Text = result;

		jQuery.Build ( this, option: ScriptBuildOption.Startup );
	}
Esempio n. 13
0
	protected void cmdTestAttr_Click ( object sender, EventArgs e )
	{
		string result = string.Empty;
		Tracer tracer = new Tracer ();

		JQuery jQuery1 = new JQuery ( "'#myTable1'" );
		JQuery jQuery2 = new JQuery ( "'#myTable2'" );

		result += "测试方法 JQuery.Attr(string)<br />";

		tracer.Execute ( jQuery1, null, "Attr", FunctionType.Method, new Type[] { typeof ( string ) }, null, null, null,
			new object[][] {
				new object[] { "{ border: '1' }" },
				new object[] { "'style'" }
			},
			false
			);

		result += "jQuery1.Code = " + jQuery1.Code + "<br />";

		result += "测试方法 JQuery.Attr(string, string)<br />";

		tracer.Execute ( jQuery2, null, "Attr", FunctionType.Method, new Type[] { typeof ( string ), typeof ( string ) }, null, null, null,
			new object[][] {
				new object[] { "'border'", "'1'" },
				new object[] { "'style'", "function(i, a){ return 'width: 700px'; }" }
			},
			false
			);

		result += "jQuery2.Code = " + jQuery2.Code + "<br />";

		this.lblResult.Text = result;

		jQuery1.Build ( this, option: ScriptBuildOption.Startup );
		jQuery2.Build ( this, option: ScriptBuildOption.Startup );
	}
Esempio n. 14
0
	protected void cmdTestAddClass_Click ( object sender, EventArgs e )
	{
		string result = string.Empty;
		Tracer tracer = new Tracer ();

		JQuery jQuery = new JQuery ("'table'");

		result += "测试方法 JQuery.AddClass(string)<br />";

		tracer.Execute ( jQuery, null, "AddClass", FunctionType.Method, new Type[] { typeof ( string ) }, null, null, null,
			new object[][] {
				new object[] { "'box'" },
				new object[] { "function(i, c){ return 'happy'; }" }
			},
			false
			);

		result += "jQuery.Code = " + jQuery.Code + "<br />";

		this.lblResult.Text = result;

		jQuery.Build ( this, option: ScriptBuildOption.Startup );
	}