private static void reinit() { Gadget.OnSettingsClosing = SettingsClosing; dropDownProjects = Document.GetElementById("projects"); dropDownProjects.Disabled = true; txtUrl = (TextElement)Document.GetElementById("url"); txtUrl.AttachEvent("onchange", txtUrlTextChanged); txtLogin = (TextElement)Document.GetElementById("login"); txtPassword = (TextElement)Document.GetElementById("password"); txtPollingInterval = (TextElement)Document.GetElementById("pollingInterval"); buttonTestConnection = (InputElement)Document.GetElementById("testConnection"); buttonTestConnection.AttachEvent("onclick", buttonTestConnectionClick); buttonGetProjects = (InputElement)Document.GetElementById("retrieveProjects"); buttonGetProjects.AttachEvent("onclick", buttonGetProjectsClick); chkHideResolved = (CheckBoxElement)Document.GetElementById("hideresolved"); labelInfo = Document.GetElementById("info"); txtUrl.Value = Gadget.Settings.ReadString(SETTING_URL); txtLogin.Value = Gadget.Settings.ReadString(SETTING_LOGIN); txtPassword.Value = Gadget.Settings.ReadString(SETTING_PASSWORD); string interval = Gadget.Settings.ReadString(SETTING_POLLING_INTERVAL); txtPollingInterval.Value = string.IsNullOrEmpty(interval) ? "5" : interval; string val = Gadget.Settings.ReadString(SETTING_FILTERVALUE); if (!string.IsNullOrEmpty(val)) { optionreader.setselectedval(FILTERS_SELECT, val); } val = Gadget.Settings.ReadString(SETTING_HIDE_RESOLVED); chkHideResolved.Checked = !string.IsNullOrEmpty(val) && val.CompareTo("1") == 0; string projectKey = Gadget.Settings.ReadString(SETTING_PROJECTKEY); string projectName = Gadget.Settings.ReadString(SETTING_PROJECTNAME); if (!(string.IsNullOrEmpty(projectKey) || string.IsNullOrEmpty(projectName))) { optionreader.clearoptions(PROJECTS_SELECT); optionreader.addoption(PROJECTS_SELECT, projectKey, projectName); haveProject = true; } updateButtonStates(); }
private GadgetScriptlet() { Gadget.OnDock = OnDock; Gadget.OnUndock = OnUndock; Gadget.Flyout.File = "Flyout.htm"; Gadget.Flyout.OnShow = OnFlyoutShow; Gadget.Flyout.OnHide = OnFlyoutHide; Gadget.SettingsUI = "Settings.htm"; Gadget.OnSettingsClosed = SettingsClosed; UpdateDockedState(); pollNowButton = (InputElement)Document.GetElementById("pollNowButton"); pollNowButton.AttachEvent("onclick", pollNowButtonClick); labelInfo = Document.GetElementById("info"); jiraResponse = Document.GetElementById("jiraResponse"); reloadSettingsAndPollNow(); setCurrentFilterLabel(); }
private FlyoutScriptlet() { buttonClose = (InputElement)(Document.GetElementById("buttonClose")); buttonClose.AttachEvent("onclick", buttonCloseClick); }