Fixes: U4-4455 Javascript error with single quotes in literals

This commit is contained in:
Shannon
2014-03-26 13:31:15 +11:00
parent 88aecdf672
commit 10b544abb9
6 changed files with 23 additions and 23 deletions

View File

@@ -31,10 +31,10 @@
masterPageDropDown: $("#<%= MasterTemplate.ClientID %>"),
treeSyncPath: '<%=TemplateTreeSyncPath%>',
text: {
templateErrorHeader: "<%= umbraco.ui.Text("speechBubbles", "templateErrorHeader") %>",
templateSavedHeader: "<%= umbraco.ui.Text("speechBubbles", "templateSavedHeader") %>",
templateErrorText: "<%= umbraco.ui.Text("speechBubbles", "templateErrorText") %>",
templateSavedText: "<%= umbraco.ui.Text("speechBubbles", "templateSavedText") %>"
templateErrorHeader: "<%= HttpUtility.JavaScriptStringEncode(umbraco.ui.Text("speechBubbles", "templateErrorHeader")) %>",
templateSavedHeader: "<%= HttpUtility.JavaScriptStringEncode(umbraco.ui.Text("speechBubbles", "templateSavedHeader")) %>",
templateErrorText: "<%= HttpUtility.JavaScriptStringEncode(umbraco.ui.Text("speechBubbles", "templateErrorText")) %>",
templateSavedText: "<%= HttpUtility.JavaScriptStringEncode(umbraco.ui.Text("speechBubbles", "templateSavedText")) %>"
}
});

View File

@@ -23,10 +23,10 @@
saveButton: $("#<%= ((Control)SaveButton).ClientID %>"),
editorSourceElement: $('#<%= editorSource.ClientID %>'),
text: {
fileErrorHeader: '<%= umbraco.ui.Text("speechBubbles", "fileErrorHeader") %>',
fileSavedHeader: '<%= umbraco.ui.Text("speechBubbles", "fileSavedHeader") %>',
fileErrorHeader: '<%= HttpUtility.JavaScriptStringEncode(umbraco.ui.Text("speechBubbles", "fileErrorHeader")) %>',
fileSavedHeader: '<%= HttpUtility.JavaScriptStringEncode(umbraco.ui.Text("speechBubbles", "fileSavedHeader")) %>',
fileSavedText: '',
fileErrorText: '<%= umbraco.ui.Text("speechBubbles", "fileErrorText") %>',
fileErrorText: '<%= HttpUtility.JavaScriptStringEncode(umbraco.ui.Text("speechBubbles", "fileErrorText")) %>',
}
});
editor.init();

View File

@@ -18,9 +18,9 @@
saveButton: $("#<%= ((Control)SaveButton).ClientID %>"),
editorSourceElement: $('#<%= editorSource.ClientID %>'),
text: {
cssErrorHeader: '<%= umbraco.ui.Text("speechBubbles", "cssErrorHeader") %>',
cssSavedHeader: '<%= umbraco.ui.Text("speechBubbles", "cssSavedHeader") %>',
cssSavedText: '<%= umbraco.ui.Text("speechBubbles", "cssSavedText") %>',
cssErrorHeader: '<%= HttpUtility.JavaScriptStringEncode(umbraco.ui.Text("speechBubbles", "cssErrorHeader")) %>',
cssSavedHeader: '<%= HttpUtility.JavaScriptStringEncode(umbraco.ui.Text("speechBubbles", "cssSavedHeader")) %>',
cssSavedText: '<%= HttpUtility.JavaScriptStringEncode(umbraco.ui.Text("speechBubbles", "cssSavedText")) %>',
cssErrorText: 'Please make sure that you have permissions set correctly',
}
});

View File

@@ -10,25 +10,25 @@
<table cellspacing="0" cellpadding="4" border="0">
<tr>
<th width="30%">
<%=umbraco.ui.Text("name", base.getUser())%>:
<%=umbraco.ui.Text("name", UmbracoUser)%>:
</th>
<td class="propertyContent">
<asp:TextBox ID="NameTxt" Width="350px" runat="server" /><br />
<small><%=umbraco.ui.Text("stylesheet", "nameHelp", base.getUser())%></small>
<small><%=umbraco.ui.Text("stylesheet", "nameHelp", UmbracoUser)%></small>
</td>
</tr>
<tr>
<th width="30%">
<%=umbraco.ui.Text("alias", base.getUser())%>:
<%=umbraco.ui.Text("alias", UmbracoUser)%>:
</th>
<td class="propertyContent">
<asp:TextBox ID="AliasTxt" Width="350px" runat="server" /><br />
<small><%=umbraco.ui.Text("stylesheet", "aliasHelp", base.getUser())%></small>
<small><%=umbraco.ui.Text("stylesheet", "aliasHelp", UmbracoUser)%></small>
</td>
</tr>
<tr>
<th width="30%">
<%=umbraco.ui.Text("styles", base.getUser())%>:
<%=umbraco.ui.Text("styles", UmbracoUser)%>:
</th>
<td class="propertyContent">
<asp:TextBox ID="Content" Style="width: 350px" TextMode="MultiLine" runat="server" />
@@ -38,7 +38,7 @@
</tr>
<tr>
<th width="30%">
<%=umbraco.ui.Text("preview", base.getUser())%>:
<%=umbraco.ui.Text("preview", UmbracoUser)%>:
</th>
<td class="propertyContent">
<div id="preview" style="padding: 10px; border: 1px solid #ccc; width: 330px;">

View File

@@ -46,7 +46,7 @@
submitSucces: function(t) {
if (t != 'true') {
top.UmbSpeechBubble.ShowMessage('error', this._opts.text.fileErrorHeader, this._opts.text.fileErrorText);
top.UmbSpeechBubble.ShowMessage('error', unescape(this._opts.text.fileErrorHeader), unescape(this._opts.text.fileErrorText));
}
var newFilePath = this._opts.nameTxtBox.val();
@@ -58,11 +58,11 @@
UmbClientMgr.contentFrame(newLocation);
//we need to do this after we navigate otherwise the navigation will wait unti lthe message timeout is done!
top.UmbSpeechBubble.ShowMessage('save', this._opts.text.fileSavedHeader, this._opts.text.fileSavedText);
top.UmbSpeechBubble.ShowMessage('save', unescape(this._opts.text.fileSavedHeader), unescape(this._opts.text.fileSavedText));
}
else {
top.UmbSpeechBubble.ShowMessage('save', this._opts.text.fileSavedHeader, this._opts.text.fileSavedText);
top.UmbSpeechBubble.ShowMessage('save', unescape(this._opts.text.fileSavedHeader), unescape(this._opts.text.fileSavedText));
UmbClientMgr.mainTree().setActiveTreeType('scripts');
//we need to pass in the newId parameter so it knows which node to resync after retreival from the server
UmbClientMgr.mainTree().syncTree("-1,init," + this._opts.originalFileName, true, null, newFilePath);
@@ -73,7 +73,7 @@
},
submitFailure: function(t) {
top.UmbSpeechBubble.ShowMessage('error', this._opts.text.fileErrorHeader, this._opts.text.fileErrorText);
top.UmbSpeechBubble.ShowMessage('error', unescape(this._opts.text.fileErrorHeader), unescape(this._opts.text.fileErrorText));
}
});
})(jQuery);

View File

@@ -46,10 +46,10 @@
submitSucces: function(t) {
if (t != 'true') {
top.UmbSpeechBubble.ShowMessage('error', this._opts.text.cssErrorHeader, this._opts.text.cssErrorText);
top.UmbSpeechBubble.ShowMessage('error', unescape(this._opts.text.cssErrorHeader), unescape(this._opts.text.cssErrorText));
}
else {
top.UmbSpeechBubble.ShowMessage('save', this._opts.text.cssSavedHeader, this._opts.text.cssSavedText);
top.UmbSpeechBubble.ShowMessage('save', unescape(this._opts.text.cssSavedHeader), unescape(this._opts.text.cssSavedText));
}
UmbClientMgr.mainTree().setActiveTreeType('stylesheets');
@@ -60,7 +60,7 @@
},
submitFailure: function(t) {
top.UmbSpeechBubble.ShowMessage('error', this._opts.text.cssErrorHeader, this._opts.text.cssErrorText);
top.UmbSpeechBubble.ShowMessage('error', unescape(this._opts.text.cssErrorHeader), unescape(this._opts.text.cssErrorText));
}
});
})(jQuery);