undo button for skins and themes

v1.18.x
psychobunny 10 years ago
parent 9af6a122ff
commit 1e2fb5cd4c

@ -40,7 +40,7 @@ define('admin/appearance/themes', function() {
}); });
$('#revert_theme').on('click', function() { $('#revert_theme').on('click', function() {
bootbox.confirm('Are you sure you wish to remove the custom theme and restore the NodeBB default theme?', function(confirm) { bootbox.confirm('Are you sure you wish to restore the default NodeBB theme?', function(confirm) {
if (confirm) { if (confirm) {
socket.emit('admin.themes.set', { socket.emit('admin.themes.set', {
type: 'local', type: 'local',

@ -2,15 +2,11 @@
<div class="directory row" id="bootstrap_themes"> <div class="directory row" id="bootstrap_themes">
<i class="fa fa-refresh fa-spin"></i> Loading Themes <i class="fa fa-refresh fa-spin"></i> Loading Themes
</div> </div>
</div>
<div class="col-lg-3 acp-sidebar"> <div data-type="bootswatch" data-theme="" data-css="">
<div class="panel panel-default"> <button data-action="use" class="floating-button mdl-button mdl-js-button mdl-button--fab mdl-js-ripple-effect mdl-button--colored">
<div class="panel-heading">Revert to Default</div> <i class="material-icons">undo</i>
<div class="panel-body"> </button>
<p>This will remove any custom Bootswatch skin applied to your NodeBB, and restore the base theme.</p>
<button class="btn btn-warning btn-md" id="revert_theme">Revert to Default</button>
</div>
</div> </div>
</div> </div>

@ -2,4 +2,8 @@
<div class="directory row" id="installed_themes"> <div class="directory row" id="installed_themes">
<i class="fa fa-refresh fa-spin"></i> Checking for installed themes... <i class="fa fa-refresh fa-spin"></i> Checking for installed themes...
</div> </div>
</div> </div>
<button id="revert_theme" class="floating-button mdl-button mdl-js-button mdl-button--fab mdl-js-ripple-effect mdl-button--colored">
<i class="material-icons">undo</i>
</button>

@ -22,14 +22,4 @@
</div> </div>
</div> </div>
</div> </div>
<!-- END themes --> <!-- END themes -->
<!-- IF showRevert -->
<li data-type="bootswatch" data-theme="" data-css="">
<div class="pull-right">
<button class="btn btn-primary pull-right" data-action="use">Revert</button>
</div>
<h4>No Skin</h4>
<p>Remove applied skin and revert back to the base colours</p>
</li>
<!-- ENDIF showRevert -->
Loading…
Cancel
Save