Removes UmbracoField JS & its .aspx dialog - this got rewritten in a nicer UI for template editor

This commit is contained in:
Warren
2018-08-01 14:39:42 +01:00
parent dcfe0c8bda
commit fb4dfb62f6
3 changed files with 0 additions and 288 deletions

View File

@@ -355,7 +355,6 @@
<Content Include="Umbraco_client\Dialogs\SortDialog.js" />
<Content Include="Umbraco_Client\Dialogs\AssignDomain2.js" />
<Content Include="Umbraco_Client\Dialogs\AssignDomain2.css" />
<Content Include="Umbraco_Client\Dialogs\UmbracoField.js" />
<Content Include="Umbraco_Client\PunyCode\punycode.min.js" />
<Content Include="Umbraco_Client\Tablesorting\img\asc.gif" />
<Content Include="Umbraco_Client\Tablesorting\img\desc.gif" />
@@ -399,7 +398,6 @@
<Content Include="Umbraco\Dialogs\rollBack.aspx" />
<Content Include="Umbraco\Dialogs\sendToTranslation.aspx" />
<Content Include="Umbraco\Dialogs\treePicker.aspx" />
<Content Include="Umbraco\Dialogs\umbracoField.aspx" />
<Content Include="Umbraco\Dialogs\viewAuditTrail.aspx" />
<Content Include="Umbraco\Config\Create\UI.xml" />
<Content Include="Umbraco\Config\Lang\en.xml">

View File

@@ -1,141 +0,0 @@
<%@ Page Language="c#" MasterPageFile="../masterpages/umbracoDialog.Master" CodeBehind="umbracoField.aspx.cs"
AutoEventWireup="True" Inherits="umbraco.dialogs.umbracoField" %>
<%@ Import Namespace="Umbraco.Web" %>
<%@ Register TagPrefix="umb" Namespace="ClientDependency.Core.Controls" Assembly="ClientDependency.Core" %>
<%@ Register TagPrefix="cc1" Namespace="Umbraco.Web._Legacy.Controls" Assembly="Umbraco.Web" %>
<asp:Content ContentPlaceHolderID="head" runat="server">
<script type="text/javascript">
(function($) {
$(document).ready(function() {
var umbracoField = new Umbraco.Dialogs.UmbracoField({
cancelButton: $("#cancelButton"),
submitButton: $("#submitButton"),
form: document.forms[0],
tagName: document.forms[0].<%= tagName.ClientID %>.value,
objectId: '<%=Request.CleanForXss("objectId")%>'
});
umbracoField.init();
});
})(jQuery);
var functionsFrame = this;
var tabFrame = this;
var isDialog = true;
var submitOnEnter = true;
</script>
</asp:Content>
<asp:Content ContentPlaceHolderID="body" runat="server">
<umb:JsInclude ID="JsInclude1" runat="server" FilePath="js/umbracoCheckKeys.js" PathNameAlias="UmbracoRoot" />
<umb:JsInclude ID="JsInclude2" runat="server" FilePath="Dialogs/UmbracoField.js" PathNameAlias="UmbracoClient" />
<div class="umb-panel umb-modal">
<div class="umb-panel-body no-header with-footer">
<input type="hidden" name="tagName" runat="server" id="tagName" value="?UMBRACO_GETITEM" />
<cc1:Pane ID="pane_form" runat="server" Title="Choose value">
<cc1:PropertyPanel ID="pp_insertField" runat="server">
<cc1:FieldDropDownList ID="fieldPicker" Width="170px" Rows="1" runat="server"></cc1:FieldDropDownList>
<input type="text" size="25" name="field" class="guiInputTextTiny"/>
</cc1:PropertyPanel>
<cc1:PropertyPanel ID="pp_insertAltField" runat="server">
<cc1:FieldDropDownList ID="altFieldPicker" Width="170px" Rows="1" runat="server"></cc1:FieldDropDownList>
<input type="text" size="25" name="useIfEmpty" class="guiInputTextTiny"/><br />
<span class="guiDialogTiny">
<%=Services.TextService.Localize("templateEditor/usedIfEmpty")%></span>
</cc1:PropertyPanel>
<cc1:PropertyPanel ID="pp_insertAltText" runat="server">
<textarea rows="1" style="width: 310px;" name="alternativeText" class="guiInputTextTiny"></textarea><br />
<span class="guiDialogTiny">
<%=Services.TextService.Localize("templateEditor/usedIfAllEmpty")%></span>
</cc1:PropertyPanel>
<cc1:PropertyPanel ID="pp_recursive" runat="server">
<input type="checkbox" name="recursive" value="true"/> <%=Services.TextService.Localize("templateEditor/recursive")%>
</cc1:PropertyPanel>
</cc1:Pane>
<cc1:Pane runat="server" Title="Format and encoding">
<cc1:PropertyPanel ID="pp_FormatAsDate" runat="server">
<input type="radio" name="formatAsDate" value="formatAsDate"/>
<%=Services.TextService.Localize("templateEditor/dateOnly")%>
&nbsp; &nbsp;
<input type="radio" name="formatAsDate" value="formatAsDateWithTime"/>
<%=Services.TextService.Localize("templateEditor/withTime")%>
<input type="text" size="6" name="formatAsDateWithTimeSeparator" style="width: 35px" class="guiInputTextTiny"/>
<br />
<span class="guiDialogTiny">Format the value as a date, or a date with time, accoring to the active culture.</span>
</cc1:PropertyPanel>
<cc1:PropertyPanel ID="pp_casing" runat="server">
<input type="radio" name="toCase" value=""/>
<%=Services.TextService.Localize("templateEditor/none")%>
<input type="radio" name="toCase" value="lower"/>
<%=Services.TextService.Localize("templateEditor/lowercase")%>
<input type="radio" name="toCase" value="upper"/>
<%=Services.TextService.Localize("templateEditor/uppercase")%>
</cc1:PropertyPanel>
<cc1:PropertyPanel ID="pp_encode" runat="server">
<input type="radio" name="urlEncode" value=""/>
<%=Services.TextService.Localize("none")%>
<input type="radio" name="urlEncode" value="url"/>
<%=Services.TextService.Localize("templateEditor/urlEncode")%>
<input type="radio" name="urlEncode" value="html"/>
<%=Services.TextService.Localize("templateEditor/htmlEncode")%>
<br />
<span class="guiDialogTiny">
<%=Services.TextService.Localize("templateEditor/urlEncodeHelp")%>
</span>
</cc1:PropertyPanel>
</cc1:Pane>
<cc1:Pane runat="server" Title="Modify output">
<cc1:PropertyPanel ID="pp_insertBefore" runat="server">
<input type="text" size="40" name="insertTextBefore" class="guiInputTextTiny"/><br />
<span class="guiDialogTiny">
<%=Services.TextService.Localize("templateEditor/insertedBefore")%>
</span>
</cc1:PropertyPanel>
<cc1:PropertyPanel ID="pp_insertAfter" runat="server">
<input type="text" size="40" name="insertTextAfter" class="guiInputTextTiny"/><br />
<span class="guiDialogTiny">
<%=Services.TextService.Localize("templateEditor/insertedAfter")%>
</span>
</cc1:PropertyPanel>
<cc1:PropertyPanel ID="pp_convertLineBreaks" runat="server">
<input type="checkbox" name="convertLineBreaks" value="true"/> <%=Services.TextService.Localize("templateEditor/convertLineBreaks")%>
<br />
<span class="guiDialogTiny">
<%=Services.TextService.Localize("templateEditor/convertLineBreaksHelp")%>
</span>
</cc1:PropertyPanel>
<cc1:PropertyPanel ID="pp_removePTags" runat="server">
<input type="checkbox" name="stripParagraph" value="true"/> <%=Services.TextService.Localize("templateEditor/removeParagraph")%>
<br />
<span class="guiDialogTiny"><%=Services.TextService.Localize("templateEditor/removeParagraphHelp")%>
</span>
</cc1:PropertyPanel>
</cc1:Pane>
</div>
<div class="umb-panel-footer">
<div class="btn-toolbar umb-btn-toolbar">
<a id="cancelButton" href="#" class="btn btn-link">
<%=Services.TextService.Localize("general/cancel")%></a>
<input id="submitButton" type="button" name="gem" class="btn btn-primary" value="<%=Services.TextService.Localize("insert")%>" />
</div>
</div>
</div>
</asp:Content>

View File

@@ -1,145 +0,0 @@
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, "&quot;").replace(/\</gi, "&lt;").replace(/\>/gi, "&gt;") + "\"";
if (insertTextAfter != "")
tagString += ", insertAfter: \"" + insertTextAfter.replace(/\"/gi, "&quot;").replace(/\</gi, "&lt;").replace(/\>/gi, "&gt;") + "\"";
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, "&quot;").replace(/\</gi, "&lt;").replace(/\>/gi, "&gt;") + '"';
if (insertTextAfter != '')
tagString += ' insertTextAfter="' + insertTextAfter.replace(/\"/gi, "&quot;").replace(/\</gi, "&lt;").replace(/\>/gi, "&gt;") + '"';
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);