diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj
index 7e2813fc1b..40645d6c76 100644
--- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj
+++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj
@@ -551,6 +551,7 @@
+
diff --git a/src/Umbraco.Web.UI/umbraco/dialogs/umbracoField.aspx b/src/Umbraco.Web.UI/umbraco/dialogs/umbracoField.aspx
index 8b4ee42f0d..596d8df017 100644
--- a/src/Umbraco.Web.UI/umbraco/dialogs/umbracoField.aspx
+++ b/src/Umbraco.Web.UI/umbraco/dialogs/umbracoField.aspx
@@ -8,143 +8,47 @@
html, body
{
margin-top: 0px !important;
- padding-top: 0px !important;
-
-
-
+
+
+
-
+
+
-
+
-
+
<%=umbraco.ui.Text("templateEditor", "usedIfEmpty")%>
@@ -154,48 +58,48 @@
<%=umbraco.ui.Text("templateEditor", "usedIfAllEmpty")%>
-
+
<%=umbraco.ui.Text("yes")%>
-
+
<%=umbraco.ui.Text("templateEditor", "insertedBefore")%>
-
+
<%=umbraco.ui.Text("templateEditor", "insertedAfter")%>
-
+
<%=umbraco.ui.Text("templateEditor", "dateOnly")%>
-
+
<%=umbraco.ui.Text("templateEditor", "withTime")%>
:
-
+
Format the value as a date, or a date with time, accoring
to the active culture.
-
+
<%=umbraco.ui.Text("templateEditor", "none")%>
-
+
<%=umbraco.ui.Text("templateEditor", "lowercase")%>
-
+
<%=umbraco.ui.Text("templateEditor", "uppercase")%>
-
+
<%=umbraco.ui.Text("none")%>
-
+
<%=umbraco.ui.Text("templateEditor","urlEncode")%>
-
+
<%=umbraco.ui.Text("templateEditor", "htmlEncode")%>
@@ -203,7 +107,7 @@
-
+
<%=umbraco.ui.Text("yes")%>
@@ -211,7 +115,7 @@
-
+
<%=umbraco.ui.Text("yes")%>
@@ -220,7 +124,7 @@
- " onclick="doSubmit()">
- or
+ " />
+ or
<%=umbraco.ui.Text("general", "cancel", this.getUser())%>
diff --git a/src/Umbraco.Web.UI/umbraco/masterpages/umbracoDialog.Master b/src/Umbraco.Web.UI/umbraco/masterpages/umbracoDialog.Master
index 9ef237a548..34f9cf5282 100644
--- a/src/Umbraco.Web.UI/umbraco/masterpages/umbracoDialog.Master
+++ b/src/Umbraco.Web.UI/umbraco/masterpages/umbracoDialog.Master
@@ -14,8 +14,9 @@
-
-
+
+
+
diff --git a/src/Umbraco.Web.UI/umbraco_client/Dialogs/UmbracoField.js b/src/Umbraco.Web.UI/umbraco_client/Dialogs/UmbracoField.js
new file mode 100644
index 0000000000..5b5e64d6c0
--- /dev/null
+++ b/src/Umbraco.Web.UI/umbraco_client/Dialogs/UmbracoField.js
@@ -0,0 +1,145 @@
+Umbraco.Sys.registerNamespace("Umbraco.Dialogs");
+
+(function($) {
+
+
+ Umbraco.Dialogs.UmbracoField = base2.Base.extend({
+ //private methods/variables
+ _opts: null,
+
+ // Constructor
+ constructor: function (opts) {
+ // Merge options with default
+ this._opts = $.extend({
+ // Default options go here
+ }, opts);
+ },
+
+ //public methods/variables
+
+ init: function () {
+ var self = this;
+ //bind to the submit handler of the button
+ this._opts.submitButton.click(function () {
+ self.doSubmit();
+ });
+ this._opts.cancelButton.click(function () {
+ UmbClientMgr.closeModalWindow();
+ });
+ },
+
+ doSubmit: function() {
+ //find out if this is an MVC View.
+ var url = window.location.href;
+ var isMvcView = url.indexOf('mvcView=') != -1;
+ var tagString = "";
+
+ //get the form
+ var fieldForm = this._opts.form;
+
+ //formfields
+ var field = fieldForm.field.value;
+ var useIfEmpty = fieldForm.useIfEmpty.value;
+ var alternativeText = fieldForm.alternativeText.value;
+ var insertTextBefore = fieldForm.insertTextBefore.value;
+ var insertTextAfter = fieldForm.insertTextAfter.value;
+
+ if(isMvcView) {
+ tagString = "@Umbraco.Field(\"" + field + "\"";
+
+ if (useIfEmpty != '')
+ tagString += ", altFieldAlias: \"" + useIfEmpty + "\"";
+
+ if (alternativeText != '')
+ tagString += ", altText: \"" + alternativeText + "\"";
+
+ if (fieldForm.recursive.checked)
+ tagString += ", recursive: true";
+
+ if (insertTextBefore != '')
+ tagString += ", insertBefore: \"" + insertTextBefore.replace(/\"/gi, """).replace(/\/gi, ">") + "\"";
+
+ if (insertTextAfter != "")
+ tagString += ", insertAfter: \"" + insertTextAfter.replace(/\"/gi, """).replace(/\/gi, ">") + "\"";
+
+ if (fieldForm.formatAsDate[1].checked)
+ tagString += ", formatAsDateWithTime: true, formatAsDateWithTimeSeparator: \"" + fieldForm.formatAsDateWithTimeSeparator.value + "\"";
+ else if (fieldForm.formatAsDate[0].checked)
+ tagString += ", formatAsDate: true";
+
+ if (fieldForm.toCase[1].checked)
+ tagString += ", casing: RenderFieldCaseType.Lower";
+ else if(fieldForm.toCase[2].checked)
+ tagString += ", casing: RenderFieldCaseType.Upper";
+
+ if (fieldForm.urlEncode[1].checked)
+ tagString += ", encoding: RenderFieldEncodingType.Url";
+ else if (fieldForm.urlEncode[2].checked)
+ tagString += ", encoding: RenderFieldEncodingType.Html";
+
+ if (fieldForm.convertLineBreaks.checked)
+ tagString += ", convertLineBreaks: true";
+
+ if (fieldForm.stripParagraph.checked)
+ tagString += ", removeParagraphTags: true";
+
+ tagString += ")";
+
+ }
+ else
+ {
+
+ tagString = '<' + this._opts.tagName;
+
+ if (field != '')
+ tagString += ' field="' + field + '"';
+
+ if (useIfEmpty != '')
+ tagString += ' useIfEmpty="' + useIfEmpty + '"';
+
+ if (alternativeText != '')
+ tagString += ' textIfEmpty="' + alternativeText + '"';
+
+ if (insertTextBefore != '')
+ tagString += ' insertTextBefore="' + insertTextBefore.replace(/\"/gi, """).replace(/\/gi, ">") + '"';
+
+ if (insertTextAfter != '')
+ tagString += ' insertTextAfter="' + insertTextAfter.replace(/\"/gi, """).replace(/\/gi, ">") + '"';
+
+ if (fieldForm.formatAsDate[1].checked)
+ tagString += ' formatAsDateWithTime="true" formatAsDateWithTimeSeparator="' + fieldForm.formatAsDateWithTimeSeparator.value + '"';
+ else if (fieldForm.formatAsDate[0].checked)
+ tagString += ' formatAsDate="true"';
+
+ if (fieldForm.toCase[1].checked)
+ tagString += ' case="' + fieldForm.toCase[1].value + '"';
+ else if (fieldForm.toCase[2].checked)
+ tagString += ' case="' + fieldForm.toCase[2].value + '"';
+
+ if (fieldForm.recursive.checked)
+ tagString += ' recursive="true"';
+
+ if (fieldForm.urlEncode[1].checked)
+ tagString += ' urlEncode="true"';
+ else if (fieldForm.urlEncode[2].checked)
+ tagString += ' htmlEncode="true"';
+
+ if (fieldForm.stripParagraph.checked)
+ tagString += ' stripParagraph="true"';
+
+ if (fieldForm.convertLineBreaks.checked)
+ tagString += ' convertLineBreaks="true"';
+
+ tagString += " runat=\"server\" />";
+ }
+
+
+ UmbClientMgr.contentFrame().focus();
+ UmbClientMgr.contentFrame().UmbEditor.Insert(tagString, '', this._opts.objectId);
+ UmbClientMgr.closeModalWindow();
+ }
+ });
+
+
+
+})(jQuery);
\ No newline at end of file
diff --git a/src/Umbraco.Web/PublishedContentExtensions.cs b/src/Umbraco.Web/PublishedContentExtensions.cs
index 4d87f13c55..268ea79df7 100644
--- a/src/Umbraco.Web/PublishedContentExtensions.cs
+++ b/src/Umbraco.Web/PublishedContentExtensions.cs
@@ -408,7 +408,7 @@ namespace Umbraco.Web
{
return content.Ancestors(n => true);
}
- private static IEnumerable Ancestors(this IPublishedContent content, Func func)
+ internal static IEnumerable Ancestors(this IPublishedContent content, Func func)
{
var ancestorList = new List();
var node = content;
@@ -450,7 +450,7 @@ namespace Umbraco.Web
{
return content.AncestorOrSelf(node => node.DocumentTypeAlias == nodeTypeAlias);
}
- private static IPublishedContent AncestorOrSelf(this IPublishedContent content, Func func)
+ internal static IPublishedContent AncestorOrSelf(this IPublishedContent content, Func func)
{
var node = content;
while (node != null)
@@ -510,7 +510,7 @@ namespace Umbraco.Web
{
return content.AncestorsOrSelf(n => n.DocumentTypeAlias == nodeTypeAlias);
}
- private static IEnumerable AncestorsOrSelf(this IPublishedContent content, int level)
+ internal static IEnumerable AncestorsOrSelf(this IPublishedContent content, int level)
{
return content.AncestorsOrSelf(n => n.Level <= level);
}
@@ -546,7 +546,7 @@ namespace Umbraco.Web
{
return content.DescendantsOrSelf(p => true);
}
- private static IEnumerable DescendantsOrSelf(this IPublishedContent content, Func func)
+ internal static IEnumerable DescendantsOrSelf(this IPublishedContent content, Func func)
{
if (content != null)
{
diff --git a/src/Umbraco.Web/UI/Controls/FolderBrowser.cs b/src/Umbraco.Web/UI/Controls/FolderBrowser.cs
index f259cc9c7a..b8569730b2 100644
--- a/src/Umbraco.Web/UI/Controls/FolderBrowser.cs
+++ b/src/Umbraco.Web/UI/Controls/FolderBrowser.cs
@@ -12,7 +12,7 @@ namespace Umbraco.Web.UI.Controls
[ClientDependency(ClientDependencyType.Css, "ContextMenu/Css/jquery.contextMenu.css", "UmbracoClient")]
[ClientDependency(ClientDependencyType.Css, "FolderBrowser/Css/folderbrowser.css", "UmbracoClient")]
[ClientDependency(ClientDependencyType.Javascript, "ui/jquery.js", "UmbracoClient", Priority = 1)]
- [ClientDependency(ClientDependencyType.Javascript, "ui/base2.js", "UmbracoClient", Priority = 2)]
+ [ClientDependency(ClientDependencyType.Javascript, "ui/base2.js", "UmbracoClient", Priority = 1)]
[ClientDependency(ClientDependencyType.Javascript, "ui/knockout.js", "UmbracoClient", Priority = 3)]
[ClientDependency(ClientDependencyType.Javascript, "ui/knockout.mapping.js", "UmbracoClient", Priority = 4)]
[ClientDependency(ClientDependencyType.Javascript, "ContextMenu/Js/jquery.contextMenu.js", "UmbracoClient", Priority = 5)]
diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj
index 1465cdcb82..15b1d28d07 100644
--- a/src/Umbraco.Web/Umbraco.Web.csproj
+++ b/src/Umbraco.Web/Umbraco.Web.csproj
@@ -1997,7 +1997,9 @@
-
+
+ ASPXCodeBehind
+
diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/umbracoField.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/umbracoField.aspx.cs
index bc27717638..671891701e 100644
--- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/umbracoField.aspx.cs
+++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/umbracoField.aspx.cs
@@ -126,6 +126,15 @@ namespace umbraco.dialogs
///
protected global::ClientDependency.Core.Controls.JsInclude JsInclude1;
+ ///
+ /// JsInclude2 control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::ClientDependency.Core.Controls.JsInclude JsInclude2;
+
///
/// tagName control.
///
diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/masterpages/umbracoDialog.Master b/src/Umbraco.Web/umbraco.presentation/umbraco/masterpages/umbracoDialog.Master
index 9ef237a548..0f25007b0a 100644
--- a/src/Umbraco.Web/umbraco.presentation/umbraco/masterpages/umbracoDialog.Master
+++ b/src/Umbraco.Web/umbraco.presentation/umbraco/masterpages/umbracoDialog.Master
@@ -14,8 +14,9 @@
-
-
+
+
+
diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/masterpages/umbracoDialog.Master.designer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/masterpages/umbracoDialog.Master.designer.cs
index 0ba245e476..36d14cbf9f 100644
--- a/src/Umbraco.Web/umbraco.presentation/umbraco/masterpages/umbracoDialog.Master.designer.cs
+++ b/src/Umbraco.Web/umbraco.presentation/umbraco/masterpages/umbracoDialog.Master.designer.cs
@@ -57,6 +57,15 @@ namespace umbraco.presentation.masterpages {
///
protected global::ClientDependency.Core.Controls.JsInclude JsInclude3;
+ ///
+ /// JsInclude6 control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::ClientDependency.Core.Controls.JsInclude JsInclude6;
+
///
/// JsInclude4 control.
///
@@ -100,7 +109,7 @@ namespace umbraco.presentation.masterpages {
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
///
- protected global::System.Web.UI.ScriptManager ScriptManager1;
+ protected global::System.Web.UI.WebControls.ScriptManager ScriptManager1;
///
/// body control.