().Tree.Alias)
- .SyncTree("-1,init," + helper.Request("id"), false);
- }
+ .SyncTree("-1,init," + Request.GetItemAsString("id"), false);
- MenuIconI save = Panel1.Menu.NewIcon();
+ var save = Panel1.Menu.NewIcon();
save.ImageURL = SystemDirectories.Umbraco + "/images/editor/save.gif";
- save.OnClickCommand = "doSubmit()";
+
+ save.OnClickCommand = "Umbraco.Editors.EditStyleSheet.save('" + editorSource.ClientID + "', '" + NameTxt.ClientID + "', '" + NameTxt.Text + "', '" + Request.QueryString["id"] + "')";
+
save.AltText = "Save stylesheet";
save.ID = "save";
- Panel1.Text = ui.Text("stylesheet", "editstylesheet", base.getUser());
- pp_name.Text = ui.Text("name", base.getUser());
- pp_path.Text = ui.Text("path", base.getUser());
+ Panel1.Text = ui.Text("stylesheet", "editstylesheet", getUser());
+ pp_name.Text = ui.Text("name", getUser());
+ pp_path.Text = ui.Text("path", getUser());
stylesheet = new StyleSheet(int.Parse(Request.QueryString["id"]));
- string appPath = Request.ApplicationPath;
+ var appPath = Request.ApplicationPath;
if (appPath == "/")
appPath = "";
lttPath.Text = "" + appPath +
- IO.SystemDirectories.Css + "/" + stylesheet.Text + ".css";
+ SystemDirectories.Css + "/" + stylesheet.Text + ".css";
- if (!IsPostBack)
+ if (IsPostBack == false)
{
NameTxt.Text = stylesheet.Text;
editorSource.Text = stylesheet.Content;
@@ -68,26 +61,77 @@ namespace umbraco.cms.presentation.settings.stylesheet
ScriptManager.GetCurrent(Page).Services.Add(new ServiceReference("../webservices/legacyAjaxCalls.asmx"));
}
- #region Web Form Designer generated code
-
- protected override void OnInit(EventArgs e)
- {
- //
- // CODEGEN: This call is required by the ASP.NET Web Form Designer.
- //
-
- InitializeComponent();
- base.OnInit(e);
- }
+ ///
+ /// Panel1 control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::umbraco.uicontrols.UmbracoPanel Panel1;
///
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
+ /// Pane7 control.
///
- private void InitializeComponent()
- {
- }
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::umbraco.uicontrols.Pane Pane7;
+
+ ///
+ /// pp_name control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::umbraco.uicontrols.PropertyPanel pp_name;
+
+ ///
+ /// NameTxt control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.TextBox NameTxt;
+
+ ///
+ /// pp_path control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::umbraco.uicontrols.PropertyPanel pp_path;
+
+ ///
+ /// lttPath control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Literal lttPath;
+
+ ///
+ /// pp_source control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::umbraco.uicontrols.PropertyPanel pp_source;
+
+ ///
+ /// editorSource control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::umbraco.uicontrols.CodeArea editorSource;
- #endregion
}
}
\ No newline at end of file
diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/settings/stylesheet/editstylesheet.aspx.designer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/settings/stylesheet/editstylesheet.aspx.designer.cs
deleted file mode 100644
index be8d537c96..0000000000
--- a/src/Umbraco.Web/umbraco.presentation/umbraco/settings/stylesheet/editstylesheet.aspx.designer.cs
+++ /dev/null
@@ -1,87 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated by a tool.
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-namespace umbraco.cms.presentation.settings.stylesheet {
-
-
- public partial class editstylesheet {
-
- ///
- /// Panel1 control.
- ///
- ///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
- ///
- protected global::umbraco.uicontrols.UmbracoPanel Panel1;
-
- ///
- /// Pane7 control.
- ///
- ///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
- ///
- protected global::umbraco.uicontrols.Pane Pane7;
-
- ///
- /// pp_name control.
- ///
- ///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
- ///
- protected global::umbraco.uicontrols.PropertyPanel pp_name;
-
- ///
- /// NameTxt control.
- ///
- ///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
- ///
- protected global::System.Web.UI.WebControls.TextBox NameTxt;
-
- ///
- /// pp_path control.
- ///
- ///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
- ///
- protected global::umbraco.uicontrols.PropertyPanel pp_path;
-
- ///
- /// lttPath control.
- ///
- ///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
- ///
- protected global::System.Web.UI.WebControls.Literal lttPath;
-
- ///
- /// pp_source control.
- ///
- ///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
- ///
- protected global::umbraco.uicontrols.PropertyPanel pp_source;
-
- ///
- /// editorSource control.
- ///
- ///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
- ///
- protected global::umbraco.uicontrols.CodeArea editorSource;
- }
-}
diff --git a/src/umbraco.controls/CodeArea.cs b/src/umbraco.controls/CodeArea.cs
index e93022c0bd..b3dd048067 100644
--- a/src/umbraco.controls/CodeArea.cs
+++ b/src/umbraco.controls/CodeArea.cs
@@ -55,7 +55,7 @@ namespace umbraco.uicontrols
{
get
{
- return !UmbracoSettings.ScriptDisableEditor; // && HttpContext.Current.Request.Browser.Browser != "IE";
+ return UmbracoSettings.ScriptDisableEditor == false;
}
}
@@ -86,18 +86,6 @@ namespace umbraco.uicontrols
ClientDependencyLoader.Instance.RegisterDependency(2, "CodeMirror/js/lib/codemirror.css", "UmbracoClient", ClientDependencyType.Css);
ClientDependencyLoader.Instance.RegisterDependency(3, "CodeMirror/css/umbracoCustom.css", "UmbracoClient", ClientDependencyType.Css);
ClientDependencyLoader.Instance.RegisterDependency(4, "CodeArea/styles.css", "UmbracoClient", ClientDependencyType.Css);
-
-
-
- //if (AutoSuggest && HttpContext.Current.Request.Browser.Browser != "IE")
- //{
- // ClientDependencyLoader.Instance.RegisterDependency(3, "CodeMirror/js/lib/util/simple-hint-customized.js", "UmbracoClient", ClientDependencyType.Javascript);
-
- // ClientDependencyLoader.Instance.RegisterDependency(4, "CodeMirror/js/lib/util/" + CodeBase.ToString().ToLower() + "-hint.js", "UmbracoClient", ClientDependencyType.Javascript);
- // ClientDependencyLoader.Instance.RegisterDependency(5, "CodeMirror/js/lib/util/" + CodeBase.ToString().ToLower() + "-hints.js", "UmbracoClient", ClientDependencyType.Javascript);
-
- // ClientDependencyLoader.Instance.RegisterDependency(4, "CodeMirror/js/lib/util/simple-hint.css", "UmbracoClient", ClientDependencyType.Css);
- //}
}
}
@@ -107,16 +95,14 @@ namespace umbraco.uicontrols
CodeTextBox = new TextBox();
CodeTextBox.ID = "CodeTextBox";
- if (!CodeMirrorEnabled)
+ if (CodeMirrorEnabled == false)
{
CodeTextBox.Attributes.Add("class", "codepress");
CodeTextBox.Attributes.Add("wrap", "off");
}
CodeTextBox.TextMode = TextBoxMode.MultiLine;
-
- //this.CssClass = "codepress";
-
+
this.Controls.Add(CodeTextBox);
}
@@ -128,7 +114,7 @@ namespace umbraco.uicontrols
{
get
{
- if (!CodeMirrorEnabled)
+ if (CodeMirrorEnabled == false)
return CodeTextBox.ClientID;
else
return base.ClientID;
@@ -142,7 +128,7 @@ namespace umbraco.uicontrols
var jsEventCode = "";
- if (!CodeMirrorEnabled)
+ if (CodeMirrorEnabled == false)
{
CodeTextBox.RenderControl(writer);
jsEventCode = RenderBasicEditor();
@@ -176,7 +162,7 @@ namespace umbraco.uicontrols
var UmbEditor;
$(document).ready(function () {
//create the editor
- UmbEditor = new Umbraco.Controls.CodeEditor.UmbracoEditor(" + (!CodeMirrorEnabled).ToString().ToLower() + @", '" + this.ClientID + @"');
+ UmbEditor = new Umbraco.Controls.CodeEditor.UmbracoEditor(" + (CodeMirrorEnabled == false).ToString().ToLower() + @", '" + this.ClientID + @"');
var m_textEditor = jQuery('#" + this.ClientID + @"');
//with codemirror adding divs for line numbers, we need to target a different element
@@ -185,12 +171,7 @@ namespace umbraco.uicontrols
jQuery(window).resize(function(){ resizeTextArea(m_textEditor, " + OffSetX.ToString() + "," + OffSetY.ToString() + @"); });
jQuery(document).ready(function(){ resizeTextArea(m_textEditor, " + OffSetX.ToString() + "," + OffSetY.ToString() + @"); });
});";
- /*
- if (!UmbracoSettings.ScriptDisableEditor && HttpContext.Current.Request.Browser.Browser == "IE")
- {
- jsEventCode += "jQuery('" + ui.Text("codemirroriewarning").Replace("'", "\\'") + "
').insertAfter('#" + this.ClientID + "');";
- }*/
-
+
}
jsEventCode = string.Format(@"", jsEventCode);
@@ -213,18 +194,7 @@ namespace umbraco.uicontrols
var extraKeys = "";
var editorMimetype = "";
-// if (AutoSuggest && HttpContext.Current.Request.Browser.Browser != "IE")
-// {
-// extraKeys = @",
-// extraKeys: {
-// ""'@'"": function(cm) { CodeMirror.{lang}Hint(cm, '@'); },
-// ""'.'"": function(cm) { CodeMirror.{lang}Hint(cm, '.'); },
-// ""Ctrl-Space"": function(cm) { CodeMirror.{lang}Hint(cm, ''); }
-// }".Replace("{lang}", CodeBase.ToString().ToLower());
-// }
-
-
- if (!string.IsNullOrEmpty(EditorMimeType))
+ if (string.IsNullOrEmpty(EditorMimeType) == false)
editorMimetype = @",
mode: """ + EditorMimeType + "\"";
@@ -250,61 +220,6 @@ namespace umbraco.uicontrols
updateLineInfo(codeEditor);
";
-
- /*
- string[] parserFiles = new string[] { "tokenizejavascript.js", "parsejavascript.js" };
- string[] cssFile = new string[] { "jscolors.css", "umbracoCustom.css" };
-
- switch (CodeBase)
- {
- case EditorType.JavaScript:
-parserFiles = new string[] { "tokenizejavascript.js", "parsejavascript.js" };
- cssFile = new string[] { "jscolors.css", "umbracoCustom.css" };
- break;
- case EditorType.Css:
- parserFiles = new string[] { "parsecss.js" };
- cssFile = new string[] { "csscolors.css", "umbracoCustom.css" };
- break;
- case EditorType.Python:
- parserFiles = new string[] { "parsepython.js" };
- cssFile = new string[] { "pythoncolors.css", "umbracoCustom.css" };
- break;
- case EditorType.XML:
- parserFiles = new string[] { "parsexml.js" };
- cssFile = new string[] { "xmlcolors.css", "umbracoCustom.css" };
- break;
- case EditorType.HTML:
- parserFiles = new string[] { "parsexml.js", "parsecss.js", "tokenizejavascript.js", "parsejavascript.js", "parsehtmlmixed.js" };
- cssFile = new string[] { "xmlcolors.css", "jscolors.css", "csscolors.css", "umbracoCustom.css" };
- break;
- }
-
- var jsEventCode = @"
- var textarea = document.getElementById('" + CodeTextBox.ClientID + @"');
- var codeEditor = CodeMirror.fromTextArea(textarea, {
- width: ""100%"",
- height: ""100%"",
- tabMode: ""shift"",
- textWrapping: false,
- lineNumbers: true,
- parserfile: [" + string.Join(",",
- parserFiles
- .Select(x => string.Format(@"""{0}""", x))
- .ToArray()) + @"],
- stylesheet: [" + string.Join(",",
-
- cssFile
- .Select(x => string.Format(@"""{0}""", IOHelper.ResolveUrl(SystemDirectories.Umbraco_client) + @"/CodeMirror/css/" + x))
- .ToArray()) + @"],
- path: """ + IOHelper.ResolveUrl(SystemDirectories.Umbraco_client) + @"/CodeMirror/js/"",
- content: textarea.value,
- autoMatchParens: false,"
- + (string.IsNullOrEmpty(ClientSaveMethod) ? "" : @"saveFunction: " + ClientSaveMethod + ",") + @"
- onChange: function() {}});
-
- ";
- */
-
return jsEventCode;
}
}