mirror of
https://github.com/claudehohl/Stikked.git
synced 2025-04-26 04:51:08 -05:00
create encrypted button
This commit is contained in:
parent
e4c0b178a9
commit
3ea8800db8
@ -242,7 +242,6 @@ h4 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.form_wrapper button {
|
.form_wrapper button {
|
||||||
clear: both;
|
|
||||||
float: left;
|
float: left;
|
||||||
margin-left: 150px;
|
margin-left: 150px;
|
||||||
width: 125px;
|
width: 125px;
|
||||||
@ -260,6 +259,10 @@ h4 {
|
|||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#create_encrypted {
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
.form_wrapper .dangerbutton:hover {
|
.form_wrapper .dangerbutton:hover {
|
||||||
background: #f00;
|
background: #f00;
|
||||||
}
|
}
|
||||||
|
@ -108,12 +108,14 @@ ST.highlight_lines = function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ST.crypto = function() {
|
ST.crypto = function() {
|
||||||
$('button[name=submit]').on('mouseenter', function() {
|
$('button[name=submit]').after('<button id="create_encrypted">Create encrypted</button>');
|
||||||
|
$('#create_encrypted').on('click', function() {
|
||||||
var $code = $('#code');
|
var $code = $('#code');
|
||||||
var key = ST.crypto_generate_key();
|
var key = ST.crypto_generate_key();
|
||||||
var encrypted = CryptoJS.AES.encrypt($code.val(), key) + '';
|
var encrypted = CryptoJS.AES.encrypt($code.val(), key) + '';
|
||||||
encrypted = encrypted.replace(/(.{100})/g, "$1\n");
|
encrypted = encrypted.replace(/(.{100})/g, "$1\n");
|
||||||
$code.val(encrypted + '\n\n' + '#' + key);
|
$code.val(encrypted + '\n\n' + '#' + key);
|
||||||
|
return false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user