protected override void OnLoad(EventArgs e) { CurrentPage.AddScriptLink(this.Page, "~/Blocks/CheckIn/Scripts/geo-min.js"); if (!Page.IsPostBack) { bool enableLocationSharing = bool.Parse(GetAttributeValue("EnableLocationSharing") ?? "false"); // Inject script used for geo location determiniation if (enableLocationSharing) { lbRetry.Visible = true; AddGeoLocationScript(); } else { pnlManualConfig.Visible = true; lbOk.Visible = true; AttemptKioskMatchByIpOrName(); } string script = string.Format(@" <script> $(document).ready(function (e) {{ if (localStorage) {{ if (localStorage.checkInKiosk) {{ $('[id$=""hfKiosk""]').val(localStorage.checkInKiosk); if (localStorage.checkInGroupTypes) {{ $('[id$=""hfGroupTypes""]').val(localStorage.checkInGroupTypes); }} {0}; }} }} }}); </script> ", this.Page.ClientScript.GetPostBackEventReference(lbRefresh, "")); phScript.Controls.Add(new LiteralControl(script)); ddlKiosk.Items.Clear(); ddlKiosk.DataSource = new DeviceService().Queryable().ToList(); ddlKiosk.DataBind(); ddlKiosk.Items.Insert(0, new ListItem(None.Text, None.IdValue)); if (CurrentKioskId.HasValue) { ListItem item = ddlKiosk.Items.FindByValue(CurrentKioskId.Value.ToString()); if (item != null) { item.Selected = true; BindGroupTypes(); } } } else { phScript.Controls.Clear(); } }
protected override void OnInit(EventArgs e) { base.OnInit(e); if (CurrentCheckInState == null) { NavigateToPreviousPage(); return; } CurrentPage.AddScriptLink(this.Page, "~/scripts/jquery.countdown.min.js"); RegisterScript(); }
protected void Page_Load(object sender, EventArgs e) { //Checks if RockPage IsPostBack (making the assumption that the PostBack is because the // 'Score Test' button was clicked. //Tell Javascript that the page is posted back or not. // See: http://stackoverflow.com/questions/59719/how-can-i-check-for-ispostback-in-javascript string script = IsPostBack ? "var isScored = true;" : "var isScored = false;"; Page.ClientScript.RegisterStartupScript(GetType(), "IsScored", script, true); //Add reference to my JS file CurrentPage.AddScriptLink(this.Page, "~/Blocks/Crm/DiscAssessment/scripts/disc.js"); //Yup, build question table buildQuestionTable(); DiscService.AssessmentResults savedScores = DiscService.LoadSavedAssessmentResults(CurrentPerson); if (savedScores.LastSaveDate > DateTime.MinValue) { //build last results table lblLastAssessmentDate.Text = savedScores.LastSaveDate.ToString("MM/dd/yyyy"); lblPrevABd.Text = savedScores.AdaptiveBehaviorD.ToString(); lblPrevABi.Text = savedScores.AdaptiveBehaviorI.ToString(); lblPrevABs.Text = savedScores.AdaptiveBehaviorS.ToString(); lblPrevABc.Text = savedScores.AdaptiveBehaviorC.ToString(); lblPrevNBd.Text = savedScores.NaturalBehaviorD.ToString(); lblPrevNBi.Text = savedScores.NaturalBehaviorI.ToString(); lblPrevNBs.Text = savedScores.NaturalBehaviorS.ToString(); lblPrevNBc.Text = savedScores.NaturalBehaviorC.ToString(); } if (IsPostBack) { btnSaveResults.Enabled = true; } else { btnSaveResults.Enabled = false; } }
protected override void OnInit(EventArgs e) { CurrentPage.AddScriptLink(Page, "~/Scripts/bootstrap-tabs.js"); int pageId = Convert.ToInt32(PageParameter("EditPage")); _page = Rock.Web.Cache.PageCache.Read(pageId); _zoneName = this.PageParameter("ZoneName"); lAllPages.Text = string.Format("All Pages Using '{0}' Layout", CurrentPage.Layout); // TODO: Managing layout block instances should probably be controlled by site security if (_page.IsAuthorized("Administrate", CurrentPerson)) { gLayoutBlocks.DataKeyNames = new string[] { "id" }; gLayoutBlocks.Actions.IsAddEnabled = true; gLayoutBlocks.Actions.AddClick += LayoutBlocks_Add; gLayoutBlocks.GridReorder += gLayoutBlocks_GridReorder; gLayoutBlocks.GridRebind += gLayoutBlocks_GridRebind; } if (_page.IsAuthorized("Administrate", CurrentPerson)) { gPageBlocks.DataKeyNames = new string[] { "id" }; gPageBlocks.Actions.IsAddEnabled = true; gPageBlocks.Actions.AddClick += gPageBlocks_GridAdd; gPageBlocks.GridReorder += gPageBlocks_GridReorder; gPageBlocks.GridRebind += gPageBlocks_GridRebind; } string script = string.Format(@" Sys.Application.add_load(function () {{ $('#modal-popup div.modal-header h3 small', window.parent.document).html('{0}'); $('#{1} a').click(function() {{ $('#{3}').val('Page'); }}); $('#{2} a').click(function() {{ $('#{3}').val('Layout'); }}); }}); ", _zoneName, liPage.ClientID, liLayout.ClientID, hfOption.ClientID); this.Page.ClientScript.RegisterStartupScript(this.GetType(), string.Format("zone-add-load-{0}", this.ClientID), script, true); base.OnInit(e); }
protected override void OnInit(EventArgs e) { base.OnInit(e); CurrentPage.AddScriptLink(this.Page, "~/Scripts/idle-timer.min.js"); }
/// <summary> /// Initialize stuff required for syntax highlighting. /// </summary> private void InitSyntaxHighlighting() { CurrentPage.AddCSSLink(Page, ResolveUrl("~/Blocks/Examples/prettify.css")); CurrentPage.AddScriptLink(Page, "//cdnjs.cloudflare.com/ajax/libs/prettify/r298/prettify.js"); }