tweakStores/js/backend.js

30 lines
890 B
JavaScript
Raw Permalink Normal View History

2021-11-04 10:17:26 +00:00
/*global $, dotclear */
'use strict';
2023-04-29 13:38:22 +00:00
Object.assign(dotclear.msg, dotclear.getData('tweakstore_copied'));
2023-01-06 08:31:44 +00:00
2023-04-29 13:38:22 +00:00
$(() => {
$('#tweakstore_form #tweakstore_submit').hide();
$('#tweakstore_form #tweakstore_id').on('change', function () {
if (this.value != '0'){this.form.submit();}
});
dotclear.condSubmit('#tweakstore_form #tweakstore_id', '#tweakstore_form #tweakstore_submit');
$("#tweakstore_copy").click(function() {
var style = $("#tweakstore_gen").attr('style');
$("#tweakstore_gen").attr('style', '').attr("contenteditable", true)
2021-11-04 10:17:26 +00:00
.select()
.on("focus", function() {
document.execCommand('selectAll', false, null)
})
.focus()
document.execCommand("Copy");
2023-04-29 13:38:22 +00:00
$("#tweakstore_gen").removeAttr("contenteditable").attr('style', style);
$("#tweakstore_copy").focus();
2023-01-06 08:31:44 +00:00
alert(dotclear.msg.alert);
return false;
});
2021-11-04 10:17:26 +00:00
});