protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            JavaScript.RequestRegistration("Select2");
            var select2Library = JavaScriptLibraryHelper.GetHighestVersionLibrary("Select2");

            if (select2Library != null)
            {
                JavaScriptLibraryHelper.RegisterStyleSheet(select2Library, Page, "css/select2.min.css");
            }

            var termSelector = new TermSelector();

            termSelector.InitTerms(selTerms);

            pickerImage.FileFilter = Globals.glbImageFileTypes;
            pickerImage.FolderPath = GetImagesFolderPath();

            // setup weight sliders
            sliderThematicWeight.Attributes.Add("data-max", NewsConfig.Instance.NewsEntry.MaxWeight.ToString());
            sliderStructuralWeight.Attributes.Add("data-max", NewsConfig.Instance.NewsEntry.MaxWeight.ToString());
            sliderThematicWeight.Text   = NewsConfig.Instance.NewsEntry.DefaultThematicWeight.ToString();
            sliderStructuralWeight.Text = NewsConfig.Instance.NewsEntry.DefaultStructuralWeight.ToString();

            txtAgentModuleId.ReadOnly = !IsAdmin();

            // localize column headers in the gridview
            gridModules.LocalizeColumnHeaders(LocalResourceFile);
        }
Beispiel #2
0
        public static void RegisterSelect2(Page page)
        {
            JavaScript.RequestRegistration("Select2");

            var select2Library = JavaScriptLibraryHelper.GetHighestVersionLibrary("Select2");

            if (select2Library != null)
            {
                JavaScriptLibraryHelper.RegisterStyleSheet(select2Library, page, "css/select2.min.css");
            }
        }