diff --git a/customize.dist/src/less2/include/creation.less b/customize.dist/src/less2/include/creation.less index 58d5a53ba..2ca8cc402 100644 --- a/customize.dist/src/less2/include/creation.less +++ b/customize.dist/src/less2/include/creation.less @@ -75,7 +75,7 @@ } } - .cp-creation-create { + .cp-creation-create, .cp-creation-settings { button { .tools_unselectable(); padding: 15px; @@ -84,6 +84,7 @@ margin: 3px 10px; border: none; cursor: pointer; + outline: none; &:hover { background: darken(@colortheme_loading-bg, 5%); } @@ -159,6 +160,9 @@ color: lighten(#0275d8, 10%); } } + &> span.fa { + margin-left: 15px; + } } .cp-creation-deleted { background: #111; diff --git a/customize.dist/translations/messages.fr.js b/customize.dist/translations/messages.fr.js index 1a22c70ab..edf3362d4 100644 --- a/customize.dist/translations/messages.fr.js +++ b/customize.dist/translations/messages.fr.js @@ -857,6 +857,7 @@ define(function () { out.creation_createFromTemplate = "Depuis un modèle"; out.creation_createFromScratch = "Nouveau pad vide"; out.creation_settings = "Préférences des nouveaux pads"; + out.creation_saveSettings = "Sauver les préférences"; // Properties about creation data out.creation_owners = "Propriétaires"; out.creation_ownedByOther = "Possédé par un autre utilisateur"; diff --git a/customize.dist/translations/messages.js b/customize.dist/translations/messages.js index da9cad5e7..0dabbefe7 100644 --- a/customize.dist/translations/messages.js +++ b/customize.dist/translations/messages.js @@ -895,6 +895,7 @@ define(function () { out.creation_createFromTemplate = "From template"; out.creation_createFromScratch = "From scratch"; out.creation_settings = "New Pad settings"; + out.creation_saveSettings = "Save settings"; // Properties about creation data out.creation_owners = "Owners"; out.creation_ownedByOther = "Owned by another user"; diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index 5c0d3a2c0..9a5a1bc42 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -1839,8 +1839,7 @@ define([ UIElements.setExpirationValue(cfg.expire, $creation); // Create the pad - var create = function (template) { - $creationContainer.remove(); + var getFormValues = function (template) { // Type of pad var ownedVal = parseInt($('input[name="cp-creation-owned"]:checked').val()); // Life time @@ -1856,11 +1855,16 @@ define([ expireVal = ($('#cp-creation-expire-val').val() || 0) * unit; } - common.createPad({ + return { owned: ownedVal, expire: expireVal, template: template - }, function () { + }; + }; + var create = function (template) { + $creationContainer.remove(); + + common.createPad(getFormValues(template), function () { cb(); }); }; @@ -1905,10 +1909,39 @@ define([ // Settings button var origin = common.getMetadataMgr().getPrivateData().origin; - $(h('div.cp-creation-settings', h('a', { - href: origin + '/settings/#creation', - target: '_blank' - }, Messages.creation_settings))).appendTo($creation); + var $ok = $('', {'class': 'fa fa-check', title: Messages.saved}).hide(); + var $spinner = $('', {'class': 'fa fa-spinner fa-pulse'}).hide(); + var okTo; + var $saveButton = $('