Fixes 28155, XSLT visualizer should use all code if none is selected instead of showing annoying alert

[TFS Changeset #73320]
This commit is contained in:
hartvig
2010-07-19 09:54:43 +00:00
parent 72a9c49c90
commit 2ac9741463
2 changed files with 28 additions and 27 deletions

View File

@@ -4,7 +4,6 @@
<%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %>
<%@ Register TagPrefix="umb" Namespace="ClientDependency.Core.Controls" Assembly="ClientDependency.Core" %>
<asp:Content ContentPlaceHolderID="head" runat="server" ID="cp2">
<style type="text/css">
#errorDiv
@@ -20,24 +19,23 @@
width: 200px !important;
}
</style>
<script type="text/javascript">
var xsltSnippet = "";
function closeErrorDiv() {
jQuery('#errorDiv').hide();
}
function doSubmit() {
closeErrorDiv();
var codeVal = jQuery('#<%= editorSource.ClientID %>').val();
//if CodeMirror is not defined, then the code editor is disabled.
if (typeof(CodeMirror) != "undefined") {
codeVal = codeEditor.getCode();
}
//if CodeMirror is not defined, then the code editor is disabled.
if (typeof (CodeMirror) != "undefined") {
codeVal = codeEditor.getCode();
}
umbraco.presentation.webservices.codeEditorSave.SaveXslt(jQuery('#<%= xsltFileName.ClientID %>').val(), '<%= xsltFileName.Text %>', codeVal, document.getElementById('<%= SkipTesting.ClientID %>').checked, submitSucces, submitFailure);
}
@@ -56,27 +54,30 @@
}
function xsltVisualize() {
xsltSnippet = UmbEditor.IsSimpleEditor
? jQuery("#<%= editorSource.ClientID %>").getSelection().text
xsltSnippet = UmbEditor.IsSimpleEditor
? jQuery("#<%= editorSource.ClientID %>").getSelection().text
: UmbEditor._editor.selection();
if (xsltSnippet == '') {
alert('Please select the xslt to visualize');
}
else {
UmbClientMgr.openModalWindow('<%= umbraco.IO.IOHelper.ResolveUrl(umbraco.IO.SystemDirectories.Umbraco) %>/developer/xslt/xsltVisualize.aspx', 'Visualize XSLT', true, 550, 650);
xsltSnippet = UmbEditor.IsSimpleEditor
? jQuery("#<%= editorSource.ClientID %>").val()
: UmbEditor._editor.getCode();
// alert('Please select the xslt to visualize');
}
UmbClientMgr.openModalWindow('<%= umbraco.IO.IOHelper.ResolveUrl(umbraco.IO.SystemDirectories.Umbraco) %>/developer/xslt/xsltVisualize.aspx', 'Visualize XSLT', true, 550, 650);
}
</script>
<umb:JsInclude ID="JsInclude1" runat="server" FilePath="Application/jQuery/jquery-fieldselection.js" PathNameAlias="UmbracoClient" />
<umb:JsInclude ID="JsInclude1" runat="server" FilePath="Application/jQuery/jquery-fieldselection.js"
PathNameAlias="UmbracoClient" />
</asp:Content>
<asp:Content ContentPlaceHolderID="body" runat="server" ID="cp1">
<cc1:UmbracoPanel ID="UmbracoPanel1" runat="server" Text="Edit xsl" hasMenu="true" Height="300" Width="600">
<cc1:UmbracoPanel ID="UmbracoPanel1" runat="server" Text="Edit xsl" hasMenu="true"
Height="300" Width="600">
<cc1:Pane ID="Pane1" runat="server" Style="margin-bottom: 10px;">
<cc1:PropertyPanel ID="pp_filename" runat="server" Text="Filename">
<asp:TextBox ID="xsltFileName" runat="server" Width="300" CssClass="guiInputText"></asp:TextBox>
@@ -85,10 +86,11 @@
<asp:CheckBox ID="SkipTesting" runat="server"></asp:CheckBox>
</cc1:PropertyPanel>
<cc1:PropertyPanel ID="pp_errorMsg" runat="server">
<div id="errorDiv" style="display: none;" class="error">test</div>
<div id="errorDiv" style="display: none;" class="error">
test</div>
</cc1:PropertyPanel>
<cc1:CodeArea ID="editorSource" CodeBase="XML" ClientSaveMethod="doSubmit" runat="server" AutoResize="true" OffSetX="47" OffSetY="55" />
<cc1:CodeArea ID="editorSource" CodeBase="XML" ClientSaveMethod="doSubmit" runat="server"
AutoResize="true" OffSetX="47" OffSetY="55" />
</cc1:Pane>
</cc1:UmbracoPanel>
</asp:Content>

View File

@@ -1,10 +1,9 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.4927
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------