Beispiel #1
0
		/// <summary>
		/// Writes out the calling script for the jQuery Tabs plugin, adding options that have been
		/// a defined.
		/// </summary>
		/// <param name="tabDepth">
		/// How far to indent the tabs in the script code.
		/// </param>
		/// <returns>
		/// Returns rendered initialisation script
		/// </returns>
		public string GetControlScript(int tabDepth) {
			jStringBuilder sb = new jStringBuilder(this.Rendering.PrettyRender, this.Rendering.TabDepth);
			
			Core.ScriptOptions options = new Core.ScriptOptions();
			this.Options.DiscoverOptions(options);
			options.Render(sb);
			
			return sb.ToString();
		}
Beispiel #2
0
		/// <summary>
		/// Writes out the calling script for the jQuery Tabs plugin, adding options that have been
		/// a defined.
		/// </summary>
		/// <param name="tabDepth">
		/// How far to indent the tabs in the script code.
		/// </param>
		/// <returns>
		/// Returns rendered initialisation script
		/// </returns>
		public string GetControlScript(int tabDepth) {
			jStringBuilder sb = new jStringBuilder(this.Rendering.PrettyRender, this.Rendering.TabDepth);
			
			//sb.IncIndent();
			//sb.AppendTabsFormatIf("$.cookie(", this.ID);
			Core.ScriptOptions options = new Core.ScriptOptions();
			this.Options.DiscoverOptions(options);
			options.Render(sb);
			//sb.Append(");");
			//sb.DecIndent();
			
			return sb.ToString();
		}
Beispiel #3
0
		} // Render


		/// <summary>
		/// Writes out the calling script for the jQuery Tabs plugin, adding options that have been
		/// a defined.
		/// </summary>
		/// <param name="tabDepth">
		/// How far to indent the script code setting.
		/// </param>
		/// <returns>
		/// Returns rendered initialisation script
		/// </returns>
		protected internal string GetControlScript(int tabDepth) {
			jStringBuilder sb = new jStringBuilder(this.Rendering.PrettyRender, this.Rendering.TabDepth);
			
			sb.IncIndent();
			sb.AppendTabsFormatIf("$(\"#{0}\").autocomplete(", this.ID);
			Core.ScriptOptions options = new Core.ScriptOptions();
			this.Options.DiscoverOptions(options);
			this.Events.DiscoverOptions(options);
			options.Render(sb);
			sb.Append(");");
			sb.DecIndent();
			
			return sb.ToString();
		}
Beispiel #4
0
		/// <summary>
		/// Renders the JavaScript required to set the options with 
		/// the settings that are configured for this widget.
		/// </summary>
		/// <returns>
		/// Returns the JavaScript to initialise the jQuery UI widget, given the configured options.
		/// </returns>
		public override string ToString() {
			Core.ScriptOptions scripting = new Core.ScriptOptions();
			this.DiscoverOptions(scripting);

			jStringBuilder sb = new jStringBuilder(false/*includeWhitespace*/, 0/*tabDepth*/);
			scripting.Render(sb);

			return sb.ToString();
		}
Beispiel #5
0
		/// <summary>
		/// Writes out the calling script for the jQuery Tabs plugin, adding options that have been
		/// a defined.
		/// </summary>
		/// <param name="tabDepth">
		/// How far to indent the script code setting.
		/// </param>
		/// <returns>
		/// Returns rendered initialisation script
		/// </returns>
		protected internal string GetControlScript(int tabDepth) {
			jStringBuilder sb = new jStringBuilder(this.Rendering.PrettyRender, this.Rendering.TabDepth);
			string selector = "";
	
			if (IsGlobal())
				selector = Options.DEFAULT_TARGET;
			else 
				selector = string.Format("\"#{0}\"", this.ID);
			
			sb.IncIndent();
			sb.AppendTabsFormatIf("$({0}).tooltip(", selector);
			Core.ScriptOptions options = new Core.ScriptOptions();
			this.Options.DiscoverOptions(options);
			this.Events.DiscoverOptions(options);
			options.Render(sb);
			sb.Append(");");
			sb.DecIndent();
			
			return sb.ToString();
		}
Beispiel #6
0
		/// <summary>
		/// Writes out the calling script for the jQuery Tabs plugin, adding options that have been
		/// a defined.
		/// </summary>
		/// <param name="tabDepth">
		/// How far to indent the script code setting.
		/// </param>
		/// <returns>
		/// Returns rendered initialisation script
		/// </returns>
		protected internal string GetControlScript(int tabDepth) {
			jStringBuilder sb = new jStringBuilder(this.Rendering.PrettyRender, this.Rendering.TabDepth);
			
			sb.IncIndent();
			sb.AppendTabsFormatIf("$(\"#{0}\").button(", this.ID);
			Core.ScriptOptions options = new Core.ScriptOptions();
			this.Options.DiscoverOptions(options);
			this.Events.DiscoverOptions(options);
			options.Render(sb);
			sb.Append(");");
			if (!string.IsNullOrEmpty(this.Events.ClickEvent)) {
				// as ClickEvent isn't a "real" jQuery UI button event, it has to be wired up separately
				sb.AppendLineIf();
				sb.AppendTabsFormatLineIf("$(\"#{0}\").click(function() {{", this.ID);
				sb.Append(this.Events.ClickEvent);
				sb.AppendLineIf();
				sb.AppendTabsLineIf("});");
			}
			sb.DecIndent();
						
			return sb.ToString();
		}