Rebase on 1.9.x since this is a bug fix

Fixing #4963
This commit is contained in:
Skrypt
2015-05-21 16:23:27 -04:00
parent 3e55c1649e
commit 754114c8e6
5 changed files with 34 additions and 38 deletions

View File

@@ -42,7 +42,7 @@
// display a message on leave if changes have been made
window.onbeforeunload = function (e) {
return leaveConfirmation;
return $("<div/>").html(leaveConfirmation).text();
};
// cancel leaving message on save

View File

@@ -134,12 +134,12 @@
@using (Script.Foot()) {
<script type="text/javascript">
//<![CDATA[
var leaveConfirmation = '@T("Some items where not saved.")';
//<![CDATA[
var leaveConfirmation = '@HttpUtility.JavaScriptStringEncode(T("Some items where not saved.").Text)';
$('#menuId').change(function () {
$(this).parents('form').submit();
});
//]]>
//]]>
</script>
}

View File

@@ -43,7 +43,7 @@
var force = actionLink.data("feature-force");
var dependants = actionLink.data("feature-dependants");
if (!dependants || /^\s*$/.test(dependants) || confirm(confirmDisableMessage + "\n\n" + dependants)) {
if (!dependants || /^\s*$/.test(dependants) || confirm($("<div/>").html(confirmDisableMessage + "\n\n" + dependants).text())) {
$("[name='submit.BulkExecute']").val("yes");
$("[name='featureIds']").val(featureId);

View File

@@ -1,4 +1 @@
$(function(){var n=function(){var n=$(".bulk-actions-wrapper").addClass("visible"),t=$(".switch-for-switchable");t.prepend(n);$("#search-box").focus().keyup(function(){var n=$(this).val(),t;if(n==""){$("li.category").show();$("li.feature:hidden").show();return}$("li.feature").each(function(){var t=$(this),i=t.find("h3:first").text();i.toLowerCase().indexOf(n.toLowerCase())>=0?t.show():t.hide()});$("li.category:hidden").show();t=$("li.category:not(:has(li.feature:visible))").hide()})},t=function(){$("li.feature h3").on("change","input[type='checkbox']",function(){var n=$(this).is(":checked"),t=$(this).parents("li.feature:first");t.toggleClass("selected",n)})},i=function(){$("li.feature .actions").on("click","a[data-feature-action]",function(n){var t=$(this),r=t.data("feature-id"),u=t.data("feature-action"),f=t.data("feature-force"),i=t.data("feature-dependants");(!i||/^\s*$/.test(i)||confirm(confirmDisableMessage+"\n\n"+i))&&($("[name='submit.BulkExecute']").val("yes"),$("[name='featureIds']").val(r),$("[name='bulkAction']").val(u),$("[name='force']").val(f),t.parents("form:first").submit());n.preventDefault()})};n();t();i()});
/*
//# sourceMappingURL=features.admin.min.js.map
*/
$(function(){var n=function(){var n=$(".bulk-actions-wrapper").addClass("visible"),t=$(".switch-for-switchable");t.prepend(n);$("#search-box").keyup(function(){var n=$(this).val(),t;if(n==""){$("li.category").show();$("li.feature:hidden").show();return}$("li.feature").each(function(){var t=$(this),i=t.find("h3:first").text();i.toLowerCase().indexOf(n.toLowerCase())>=0?t.show():t.hide()});$("li.category:hidden").show();t=$("li.category:not(:has(li.feature:visible))").hide()})},t=function(){$("li.feature h3").on("change","input[type='checkbox']",function(){var n=$(this).is(":checked"),t=$(this).parents("li.feature:first");t.toggleClass("selected",n)})},i=function(){$("li.feature .actions").on("click","a[data-feature-action]",function(n){var t=$(this),r=t.data("feature-id"),u=t.data("feature-action"),f=t.data("feature-force"),i=t.data("feature-dependants");(!i||/^\s*$/.test(i)||confirm($("<div/>").html(confirmDisableMessage+"\n\n"+i).text()))&&($("[name='submit.BulkExecute']").val("yes"),$("[name='featureIds']").val(r),$("[name='bulkAction']").val(u),$("[name='force']").val(f),t.parents("form:first").submit());n.preventDefault()})};n();t();i()});

View File

@@ -16,29 +16,29 @@
@if (Model.Features.Any()) {
using (Html.BeginFormAntiForgeryPost()) {
@Html.Hidden("submit.BulkExecute")
@Html.Hidden("force", true)
@Html.Hidden("featureIds")
<div class="bulk-actions-wrapper">
<fieldset class="bulk-actions">
<label for="search-box">@T("Filter:")</label>
<input id="search-box" class="text" type="text" autofocus="autofocus" />
</fieldset>
<fieldset class="bulk-actions">
<label for="publishActions">@T("Actions:")</label>
<select id="publishActions" name="bulkAction">
@Html.SelectOption(Model.BulkAction, FeaturesBulkAction.None, T("Choose action...").ToString())
@Html.SelectOption(Model.BulkAction, FeaturesBulkAction.Enable, T("Enable").ToString())
@Html.SelectOption(Model.BulkAction, FeaturesBulkAction.Disable, T("Disable").ToString())
@Html.SelectOption(Model.BulkAction, FeaturesBulkAction.Update, T("Update").ToString())
@Html.SelectOption(Model.BulkAction, FeaturesBulkAction.Toggle, T("Toggle").ToString())
</select>
<button type="submit" name="submit.BulkExecute" value="yes">@T("Execute")</button>
</fieldset>
</div>
@Html.Hidden("submit.BulkExecute")
@Html.Hidden("force", true)
@Html.Hidden("featureIds")
<div class="bulk-actions-wrapper">
<fieldset class="bulk-actions">
<label for="search-box">@T("Filter:")</label>
<input id="search-box" class="text" type="text" autofocus="autofocus" />
</fieldset>
<fieldset class="bulk-actions">
<label for="publishActions">@T("Actions:")</label>
<select id="publishActions" name="bulkAction">
@Html.SelectOption(Model.BulkAction, FeaturesBulkAction.None, T("Choose action...").ToString())
@Html.SelectOption(Model.BulkAction, FeaturesBulkAction.Enable, T("Enable").ToString())
@Html.SelectOption(Model.BulkAction, FeaturesBulkAction.Disable, T("Disable").ToString())
@Html.SelectOption(Model.BulkAction, FeaturesBulkAction.Update, T("Update").ToString())
@Html.SelectOption(Model.BulkAction, FeaturesBulkAction.Toggle, T("Toggle").ToString())
</select>
<button type="submit" name="submit.BulkExecute" value="yes">@T("Execute")</button>
</fieldset>
</div>
<ul class="features summary-view switchable">
@{
<ul class="features summary-view switchable">
@{
var featureGroups = Model.Features.OrderBy(f => f.Descriptor.Category, new DoghouseComparer("Core")).GroupBy(f => f.Descriptor.Category).ToList();
foreach (var featureGroup in featureGroups) {
if (!featureGroup.Any(x => Model.IsAllowed(x.Descriptor.Extension))) {
@@ -98,8 +98,7 @@
<input type="checkbox" name="featureIds" value="@feature.Descriptor.Id" />
@featureName
</label>
}
else {
} else {
@featureName
}
</h3>
@@ -138,14 +137,14 @@
}
</ul>
</li>}
}
</ul>}
}
</ul>}
using (Script.Foot()) {
<script type="text/javascript">
//<![CDATA[
var confirmDisableMessage = '@T("Disabling this feature will also disable the following dependent features. Are you sure you want to continue?")';
//]]>
//<![CDATA[
var confirmDisableMessage = '@HttpUtility.JavaScriptStringEncode(T("Disabling this feature will also disable the following dependent features. Are you sure you want to continue?").Text)';
//]]>
</script>
}
}