public override void HandleRequest(string jsonString, AjaxBase ajax)
        {
            PreInstallCheckResponse response = new PreInstallCheckResponse();
            response.installed = Config.IsInstalled;

            // assuming all these are good in asp.net version
            response.mySql = response.gd = response.zip = response.rar = response.pdfinfo = response.pdfdraw = true;

            ajax.ReturnJson(response);
        }
Example #2
0
        private void OnPreInstallCheckRequestFinished(PreInstallCheckResponse response)
        {
            if (response.installed)
            {
                // switch to install finish module
                return;
            }

            jQuery.Select("#install-preinstall-check").Hide();
            jQuery.Select("#install-form").Show();

            jQuery.Select("#install-mysql-check").Hide();
            jQuery.Select("#install-mysql-loading").Hide();

            jQuery.Select("#install-sevenzip-check").Hide();
            jQuery.Select("#install-sevenzip-loading").Hide();

            jQuery.Select("#install-admin-username-check").Hide();
            jQuery.Select("#install-admin-password-check").Hide();
            jQuery.Select("#install-admin-password2-check").Hide();

            if (Environment.ServerType == ServerType.AspNet)
            {
                CanEnableZip = CanEnableRar = false;
                CanEnablePdf = AllRequiredComponentLoaded = true;

                // other components text input
                jQuery.Select("#install-sevenzip-dll").Change(OtherComponentInputChanged);
            }
            else
            {
                jQuery.Select("#install-sevenzip").Hide();

                CanEnableZip = response.zip;
                CanEnableRar = response.rar;
                CanEnablePdf = response.pdfinfo && response.pdfdraw;
                AllRequiredComponentLoaded = response.mySql && response.gd;

                if (!response.mySql)
                {
                    Template.Get("install", "install-mysql-error").AppendTo(jQuery.Select("#mysql-error-area"));
                }

                if (!response.gd)
                {
                    Template.Get("install", "install-gd-error").AppendTo(jQuery.Select("#gd-error-area"));
                }

                if (!response.zip)
                {
                    Template.Get("install", "install-zip-error").AppendTo(jQuery.Select("#zip-error-area"));
                }

                if (!response.rar)
                {
                    Template.Get("install", "install-rar-error").AppendTo(jQuery.Select("#rar-error-area"));
                }

                if (!response.pdfinfo)
                {
                    Template.Get("install", "install-pdfinfo-error").AppendTo(jQuery.Select("#pdfinfo-error-area"));
                }

                if (!response.pdfdraw)
                {
                    Template.Get("install", "install-pdfdraw-error").AppendTo(jQuery.Select("#mudraw-error-area"));
                }
            }

            // MySql text inputs and button
            jQuery.Select("#install-mysql-check-setting").Click(MySqlCheckSettingClicked);

            jQuery.Select("#install-mysql-server").Change(MySqlCheckSettingChanged);
            jQuery.Select("#install-mysql-port").Change(MySqlCheckSettingChanged);
            jQuery.Select("#install-mysql-username").Change(MySqlCheckSettingChanged);
            jQuery.Select("#install-mysql-password").Change(MySqlCheckSettingChanged);
            jQuery.Select("#install-mysql-database").Change(MySqlCheckSettingChanged);

            // Admin Section
            jQuery.Select("#install-admin-username").Change(AdminUserChanged);
            jQuery.Select("#install-admin-password").Change(AdminPasswordChanged);
            jQuery.Select("#install-admin-password2").Change(AdminConfirmPasswordChanged);

            // Submit button
            jQuery.Select("#install-submit-btn").Click(SubmitButtonClicked);
        }