public void IncludeExternalLinkFiles(ComponentController paComponentController) { CSSStyleManager lcCSSStyleManager; JavaScriptManager lcJavaScriptmanager; lcCSSStyleManager = new CSSStyleManager(paComponentController); lcJavaScriptmanager = new JavaScriptManager(paComponentController); lcCSSStyleManager.IncludeExternalStyleSheet(ResourceManager.GetInstance().GetWidgetStyleSheetUrl(ResourceManager.WidgetCategory.System, ctWidControlImageUploaderStyle)); lcJavaScriptmanager.IncludeExternalJavaScript(ResourceManager.GetInstance().GetWidgetScriptUrl(ResourceManager.WidgetCategory.System, ctWidControlImageUploaderScript)); }
private void IncludeExternalLinkFiles(ComponentController paComponentController) { CSSStyleManager lcCSSStyleManager; JavaScriptManager lcJavaScriptmanager; lcCSSStyleManager = new CSSStyleManager(paComponentController); lcJavaScriptmanager = new JavaScriptManager(paComponentController); lcCSSStyleManager.IncludeExternalStyleSheet(ResourceManager.GetInstance().GetToolBarStyleSheetUrl(ctToolBarStyle)); lcJavaScriptmanager.IncludeExternalJavaScript(ResourceManager.GetInstance().GetToolBarScriptUrl(ctToolBarScript)); }
private void IncludeExternalLinkFiles(ComponentController paComponentController) { CSSStyleManager lcCSSStyleManager; JavaScriptManager lcJavaScriptmanager; lcCSSStyleManager = new CSSStyleManager(paComponentController); lcJavaScriptmanager = new JavaScriptManager(paComponentController); lcCSSStyleManager.IncludeExternalStyleSheet(ResourceManager.GetInstance().GetWidgetStyleSheetUrl(ResourceManager.WidgetCategory.GShop_POS, ctWidControlPOSUserListStyle)); lcJavaScriptmanager.IncludeExternalJavaScript(ResourceManager.GetInstance().GetWidgetScriptUrl(ResourceManager.WidgetCategory.GShop_POS, ctWidControlPOSUserListScript)); }
private void IncludeExternalLinkFiles(ComponentController paComponentController) { CSSStyleManager lcCSSStyleManager; JavaScriptManager lcJavaScriptmanager; lcCSSStyleManager = new CSSStyleManager(paComponentController); lcJavaScriptmanager = new JavaScriptManager(paComponentController); lcCSSStyleManager.IncludeExternalStyleSheet(ResourceManager.GetInstance().GetWidgetStyleSheetUrl(ResourceManager.WidgetCategory.System, ctSubControlSelectionPanelStyle)); lcJavaScriptmanager.IncludeExternalJavaScript(ResourceManager.GetInstance().GetWidgetScriptUrl(ResourceManager.WidgetCategory.System, ctSubControlSelectionPanelScript)); }
private void Awake() { if (instance != null) { GameObject.Destroy(this.gameObject); } else { instance = this; DontDestroyOnLoad(this); } }
private void IncludeExternalLinkFiles(ComponentController paComponentController) { CSSStyleManager lcCSSStyleManager; JavaScriptManager lcJavaScriptmanager; lcCSSStyleManager = new CSSStyleManager(paComponentController); lcJavaScriptmanager = new JavaScriptManager(paComponentController); lcJavaScriptmanager.IncludeExternalJavaScript(ResourceManager.GetInstance().GetFoundationScriptUrl(ctGoogleMapInterfaceScript)); lcCSSStyleManager.IncludeExternalStyleSheet(ResourceManager.GetInstance().GetWidgetStyleSheetUrl(ResourceManager.WidgetCategory.GShop_General, ctWidControlFEBasicStoreLocationStyle)); lcJavaScriptmanager.IncludeExternalJavaScript(ResourceManager.GetInstance().GetWidgetScriptUrl(ResourceManager.WidgetCategory.GShop_General, ctWidControlFEBasicStoreLocationScript)); }
private void IncludeExternalLinkFiles(ComponentController paComponentController) { CSSStyleManager lcCSSStyleManager; JavaScriptManager lcJavaScriptmanager; lcCSSStyleManager = new CSSStyleManager(paComponentController); lcJavaScriptmanager = new JavaScriptManager(paComponentController); // lcCSSStyleManager.IncludeExternalStyleSheet(ResourceManager.GetInstance().GetWidgetStyleSheetUrl(ResourceManager.WidgetCategory.GShop_POS, ctWidControlPOSUnitListStyle)); lcJavaScriptmanager.IncludeExternalJavaScript(ResourceManager.GetInstance().GetWidgetScriptUrl(ResourceManager.WidgetCategory.System, ctTestCompositeScriptScript)); //lcJavaScriptmanager.IncludeExternalJavaScript(ResourceManager.GetInstance().GetFoundationScriptUrl(ctEPOSScript)); //lcJavaScriptmanager.IncludeExternalJavaScript(ResourceManager.GetInstance().GetFoundationScriptUrl(ctEPOSInterfaceScript)); }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); InitCategorys(CurrentCategory); IncludeJavaScript(); JavaScriptManager.Include("/Admin/Ajax/jquery/jquery.cookie.js", "/Admin/Ajax/jquery/jquery.treeview.min.js"); //HtmlGenericControl ctr = new HtmlGenericControl("link"); //ctr.Attributes["href"] = "/Admin/Ajax/jquery/css/jquery.treeview.css"; //ctr.Attributes["type"] = "text/css"; //ctr.Attributes["rel"] = "Stylesheet"; //Page.Header.Controls.Add(ctr); BindTree(); }
public static void addValidationScriptsToPage(Page page) { // no need to do if this is an ajax request... if (!OSPage.IsAjaxRequest) { JavaScriptManager scriptManager = new JavaScriptManager(); generateParentEditRecordScripts(scriptManager, page); string validationEditRecordScript = scriptManager.parentEditRecordValidatorsScript; if (validationEditRecordScript != "") { page.ClientScript.RegisterStartupScript(page.GetType(), "ValidatorsScript", validationEditRecordScript); } } }
protected override void Render(HtmlTextWriter writer) { RenderBeginTag(writer); RenderContents(writer); RenderEndTag(writer); writer.WriteBeginTag("span"); writer.WriteAttribute("style", "display: none;"); writer.WriteAttribute("class", "ValidationMessage"); writer.WriteAttribute("id", "ValidationMessage_" + ClientID); writer.Write(">"); writer.WriteEndTag("span"); if (!_valid) { writer.Write(JavaScriptManager.GetInvalidInputJS(ClientID, _validationMessage)); } }
/// <summary> /// JS文件注册;可以引用多个文件,如: /// IncludeJavaScript("jquery.bgiframe.js", "jquery.dimensions.js", /// "jquery.jdMenu.js", "SlideMenuReady.js"); /// </summary> /// <param name="files"></param> public void IncludeJavaScript(params string[] files) { List <string> paths = new List <string>(); foreach (string file in files) { if (file.StartsWith("/")) { paths.Add(file); } else { paths.Add(TemplateSourceDirectory + "/js/" + file); } } JavaScriptManager.Include(paths.ToArray()); }
private void IncludeExternalLinkFiles(ComponentController paComponentController) { CSSStyleManager lcCSSStyleManager; JavaScriptManager lcJavaScriptmanager; lcCSSStyleManager = new CSSStyleManager(paComponentController); lcJavaScriptmanager = new JavaScriptManager(paComponentController); lcJavaScriptmanager.IncludeExternalJavaScript(ResourceManager.GetInstance().GetFoundationScriptUrl(ctCanvasScript)); lcCSSStyleManager.IncludeExternalStyleSheet(ResourceManager.GetInstance().GetWidgetStyleSheetUrl(ResourceManager.WidgetCategory.GShop_POS, ctSubControlPOSReceiptOutputStyle)); lcJavaScriptmanager.IncludeExternalJavaScript(ResourceManager.GetInstance().GetWidgetScriptUrl(ResourceManager.WidgetCategory.GShop_POS, ctSubControlPOSReceiptOutputScript)); // lcJavaScriptmanager.IncludeExternalJavaScript(ResourceManager.GetInstance().GetFoundationScriptUrl(ctPrinterManagerScript)); IncludePrinterControllerScriptList(paComponentController, lcJavaScriptmanager); IncludeDeviceScriptList(paComponentController, lcJavaScriptmanager); }
private void IncludeExternalLinkFiles(ComponentController paComponentController) { CSSStyleManager lcCSSStyleManager; JavaScriptManager lcJavaScriptmanager; lcCSSStyleManager = new CSSStyleManager(paComponentController); lcJavaScriptmanager = new JavaScriptManager(paComponentController); lcCSSStyleManager.IncludeExternalStyleSheet(ResourceManager.GetInstance().GetFoundationStyleSheetUrl(ctJQueryUIStyle)); lcCSSStyleManager.IncludeExternalStyleSheet(ResourceManager.GetInstance().GetFoundationStyleSheetUrl(ctSumoSelectStyle)); lcJavaScriptmanager.IncludeExternalJavaScript(ResourceManager.GetInstance().GetFoundationScriptUrl(ctJQueryUIScript)); lcJavaScriptmanager.IncludeExternalJavaScript(ResourceManager.GetInstance().GetFoundationScriptUrl(ctSumoSelectScript)); lcJavaScriptmanager.IncludeExternalJavaScript(ResourceManager.GetInstance().GetFoundationScriptUrl(ctJQueryUIFunctionScript)); lcCSSStyleManager.IncludeExternalStyleSheet(ResourceManager.GetInstance().GetWidgetStyleSheetUrl(ResourceManager.WidgetCategory.System, ctWidControlCreateUserStyle)); lcJavaScriptmanager.IncludeExternalJavaScript(ResourceManager.GetInstance().GetWidgetScriptUrl(ResourceManager.WidgetCategory.System, ctWidControlCreateUserScript)); }
/// <summary> /// JS文件注册;可以引用多个文件,如: /// IncludeJavaScript("jquery.bgiframe.js", "jquery.dimensions.js", /// "jquery.jdMenu.js", "SlideMenuReady.js"); /// </summary> /// <param name="files"></param> public void IncludeJavaScript(params string[] files) { List <string> paths = new List <string>(); if (String.IsNullOrEmpty(Request["state"])) { paths.Add("/Scripts/jquery/jquery-1.4.2.js"); } foreach (string file in files) { if (file.StartsWith("/")) { paths.Add(file); } else { paths.Add(this.TemplateSourceDirectory + "/js/" + file); } } JavaScriptManager.Include(paths.ToArray()); }
protected override void Render(HtmlTextWriter writer) { RenderBeginTag(writer); if (this.TextMode == TextBoxMode.MultiLine) { HttpUtility.HtmlEncode(this.Text, writer); } base.RenderEndTag(writer); writer.WriteBeginTag("span"); writer.WriteAttribute("style", "display: none;"); writer.WriteAttribute("class", "ValidationMessage"); writer.WriteAttribute("id", "ValidationMessage_" + ClientID); writer.Write(">"); writer.WriteEndTag("span"); if (!_valid) { writer.Write(JavaScriptManager.GetInvalidInputJS(ClientID, _validationMessage)); } }
/// <summary> /// 包含样式 /// </summary> /// <param name="includeJquery">是否包含Jquery</param> /// <param name="files"></param> protected void IncludeJavaScript(bool includeJquery, params string[] files) { List <string> paths = new List <string>(); if (includeJquery) { paths.Add("/Scripts/jquery/jquery-1.4.2.js"); } foreach (string file in files) { string f = file.Trim(); if (f.StartsWith("/")) { paths.Add(file); } else { paths.Add(this.TemplateSourceDirectory + "/js/" + f); } } JavaScriptManager.Include(paths.ToArray()); }
//public override bool SupportsDisabledAttribute { get { return true; } } protected override void AddAttributesToRender(HtmlTextWriter writer) { string onClickText = Attributes["onclick"]; if (onClickText != null) { Attributes.Remove("onclick"); } onClickText = JavaScriptManager.GetControlWithConfirmMessageOnClickCode(ClientID, onClickText, _confirmMessage); // TODO JMR #585790 uncommend SupportsDisabledAttribute override and delete this block when targetting .net 4.0+ if (!Enabled) // Not setting the Enabled to false like other widgets because we need it to prevent base.AddAttributesToRender from rendering the href { writer.AddAttribute(HtmlTextWriterAttribute.Disabled, ((OSPage)Page).QuirksMode ? null : "disabled"); } if (onClickText.Length > 0) { writer.AddAttribute(HtmlTextWriterAttribute.Onclick, onClickText); } base.AddAttributesToRender(writer); }
private void IncludeDeviceScriptList(ComponentController paComponentController, JavaScriptManager paJavaScriptManager) { String[] lcScriptList; lcScriptList = PrinterController.GetInstance().GetDeviceScriptList(clPrimaryPrinterName); if (lcScriptList != null) { for (int lcCount = 0; lcCount < lcScriptList.Length; lcCount++) { if (!String.IsNullOrEmpty(lcScriptList[lcCount])) { paJavaScriptManager.IncludeExternalJavaScript(ResourceManager.GetInstance().GetFoundationScriptUrl(lcScriptList[lcCount])); } } } }
// Ajax NotifyWidget public static void NotifyWidget_Deprecated(HeContext heContext, string widgetId, string message) { // queue javascript in the current page heContext.QueueJavascript(JavaScriptManager.osAjaxNotifyWidget(widgetId, message)); }
/// <summary> /// Adds an ajax event attribute to a given attribute list /// </summary> /// <param name="eventType">Type of event to add</param> /// <param name="clientId">ClientId of the widget</param> /// <param name="uniqueId">UniqueId of the widget</param> /// <param name="viewStateBuckets">Viewstate buckets to pass in the call</param> /// <param name="events">List of events</param> /// <param name="attributes">Attribute list of the widget</param> public static void AddAjaxEventAttribute(Control control, AjaxEventType eventType, string clientId, string uniqueId, string viewStateBuckets, System.Web.UI.AttributeCollection attributes) { Hashtable events = ((IAjaxHandler)control).GetRegisteredAjaxEvents(); if ((events != null && events.Contains(eventType))) { string eventName = ""; if (eventType == AjaxEventType.onAjaxClick) { eventName = "Click"; } else if (eventType == AjaxEventType.onAjaxChange) { eventName = "Change"; } string osAjaxCallScript; string osAjaxCallScriptDelayed; if (eventType == AjaxEventType.onAjaxChange) { if (control is TextBox) { // delayed on change... osAjaxCallScriptDelayed = JavaScriptManager.osAjaxCallScript(clientId, uniqueId, viewStateBuckets, eventName, true); SetJsHandlerAttribute("onoschange", osAjaxCallScriptDelayed, attributes); // on change (lost focus) sets the value immediately osAjaxCallScript = JavaScriptManager.osAjaxCallScript(clientId, uniqueId, viewStateBuckets, eventName, false); SetJsHandlerAttribute("onchange", osAjaxCallScript, attributes); } else { string jsHandlerAttributeName; if (control is CheckBox || control is RadioButton) { jsHandlerAttributeName = "onclick"; } else { jsHandlerAttributeName = "onchange"; } osAjaxCallScript = JavaScriptManager.osAjaxCallScript(clientId, uniqueId, viewStateBuckets, eventName); SetJsHandlerAttribute(jsHandlerAttributeName, osAjaxCallScript, attributes); if (control is DropDownList) { // force onchange for dropdowns after any key is pressed SetJsHandlerAttribute("onkeyup", "this.onchange();", attributes); } } } else if (eventType == AjaxEventType.onAjaxClick) { // get the code for the immediate call osAjaxCallScript = JavaScriptManager.osAjaxCallScript(clientId, uniqueId, viewStateBuckets, eventName) + " return false;"; SetJsHandlerAttribute("onclick", osAjaxCallScript, attributes); } } }
/// <summary> /// This is exactly the same as in System.Web.UI.WebControls.LinkButton, only the javascript /// of the href attribute is diferent. /// This change was done to support FireFox (#37171) /// </summary> /// <param name="writer"></param> protected override void AddAttributesToRender(HtmlTextWriter writer) { using (var w = new HtmlTextWriterWithAttributeFilter(writer)) { if (Page != null) { Page.VerifyRenderingInServerForm(this); } if (ID != null) { w.AddAttribute(HtmlTextWriterAttribute.Id, ClientID); } if (AccessKey.Length > 0) { w.AddAttribute(HtmlTextWriterAttribute.Accesskey, AccessKey); } if (!Enabled) { w.AddAttribute(HtmlTextWriterAttribute.Disabled, ((OSPage)Page).QuirksMode ? null : "disabled"); } if (TabIndex != 0) { w.AddAttribute(HtmlTextWriterAttribute.Tabindex, TabIndex.ToString()); } if (ToolTip.Length > 0) { w.AddAttribute(HtmlTextWriterAttribute.Title, ToolTip); } if (ControlStyleCreated) { ControlStyle.AddAttributesToRender(w, this); } bool isAjax = (events != null) && events.Contains(AjaxEventType.onAjaxClick); string onClickText = JavaScriptManager.GetButtonOnClickCode(ClientID, UniqueID, ViewStateAttributes.InlineAttributes["onclick"], _confirmMessage, isAjax, CausesValidation); if (onClickText.Length > 0) { ViewStateAttributes.InlineAttributes["onclick"] = onClickText; } // remove the onclick javascript handler if the control is disabled if (!Enabled) { ViewStateAttributes.InlineAttributes.Remove("onclick"); } foreach (string attr in Attributes.Keys) { w.AddAttribute(attr, Attributes[attr]); } ViewStateAttributes.InlineAttributes.AddAttributes(w); // "#" if (Enabled && (Page != null)) { string htmlTextAttribute = JavaScriptManager.GetLinkHRefCode(ClientID, isAjax, CausesValidation, Page.ClientScript.GetPostBackEventReference(this, ""), Page.ClientScript.GetPostBackClientHyperlink(this, "")); w.AddAttribute(HtmlTextWriterAttribute.Href, htmlTextAttribute); } } }
public void HelpClick() { #if !UNITY_EDITOR JavaScriptManager.openWindowURL("https://gba-usa.project-release.info/contact-us/"); #endif }
public void OpenView() { JavaScriptManager.openView(); }
//Screenshot maintenance public void PrintView() { JavaScriptManager.printView(); }