mirror of
https://github.com/letscontrolit/ESPEasy.git
synced 2026-09-12 01:24:04 +00:00
[Build] Reduce size of included Github clipboard script
This commit is contained in:
@@ -98,8 +98,13 @@ static const char githublogo[] PROGMEM = {
|
||||
"</button>"
|
||||
};
|
||||
|
||||
static const char DATA_GITHUB_CLIPBOARD_JS[] PROGMEM = {0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x73,0x65,0x74,0x47,0x69,0x74,0x68,0x75,0x62,0x43,0x6c,0x69,0x70,0x62,0x6f,0x61,0x72,0x64,0x28,0x29,0x7b,0x76,0x61,0x72,0x20,0x65,0x3d,0x22,0x45,0x53,0x50,0x20,0x45,0x61,0x73,0x79,0x20,0x7c,0x20,0x49,0x6e,0x66,0x6f,0x72,0x6d,0x61,0x74,0x69,0x6f,0x6e,0x20,0x7c,0x5c,0x6e,0x20,0x2d,0x2d,0x2d,0x2d,0x2d,0x7c,0x2d,0x2d,0x2d,0x2d,0x2d,0x7c,0x5c,0x6e,0x22,0x3b,0x6d,0x61,0x78,0x5f,0x6c,0x6f,0x6f,0x70,0x3d,0x31,0x30,0x30,0x3b,0x66,0x6f,0x72,0x28,0x76,0x61,0x72,0x20,0x6f,0x3d,0x31,0x3b,0x6f,0x3c,0x6d,0x61,0x78,0x5f,0x6c,0x6f,0x6f,0x70,0x3b,0x6f,0x2b,0x2b,0x29,0x7b,0x76,0x61,0x72,0x20,0x6e,0x3d,0x22,0x63,0x6f,0x70,0x79,0x54,0x65,0x78,0x74,0x5f,0x22,0x2b,0x6f,0x2c,0x74,0x3d,0x64,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x2e,0x67,0x65,0x74,0x45,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x42,0x79,0x49,0x64,0x28,0x6e,0x29,0x3b,0x69,0x66,0x28,0x6e,0x75,0x6c,0x6c,0x3d,0x3d,0x74,0x29,0x6f,0x3d,0x6d,0x61,0x78,0x5f,0x6c,0x6f,0x6f,0x70,0x2b,0x31,0x3b,0x65,0x6c,0x73,0x65,0x7b,0x76,0x61,0x72,0x20,0x61,0x3d,0x22,0x7c,0x22,0x3b,0x6f,0x25,0x32,0x3d,0x3d,0x30,0x26,0x26,0x28,0x61,0x2b,0x3d,0x22,0x5c,0x6e,0x22,0x29,0x2c,0x65,0x2b,0x3d,0x74,0x2e,0x69,0x6e,0x6e,0x65,0x72,0x48,0x54,0x4d,0x4c,0x2e,0x72,0x65,0x70,0x6c,0x61,0x63,0x65,0x28,0x2f,0x3c,0x5b,0x42,0x62,0x5d,0x5b,0x52,0x72,0x5d,0x5c,0x73,0x2a,0x5c,0x2f,0x3f,0x3e,0x2f,0x67,0x69,0x6d,0x2c,0x22,0x5c,0x6e,0x22,0x29,0x2b,0x61,0x7d,0x7d,0x65,0x3d,0x28,0x65,0x3d,0x65,0x2e,0x72,0x65,0x70,0x6c,0x61,0x63,0x65,0x28,0x2f,0x3c,0x5c,0x2f,0x5b,0x44,0x64,0x5d,0x5b,0x49,0x69,0x5d,0x5b,0x56,0x76,0x5d,0x5c,0x73,0x2a,0x5c,0x2f,0x3f,0x3e,0x2f,0x67,0x69,0x6d,0x2c,0x22,0x5c,0x6e,0x22,0x29,0x29,0x2e,0x72,0x65,0x70,0x6c,0x61,0x63,0x65,0x28,0x2f,0x3c,0x5b,0x5e,0x3e,0x5d,0x2a,0x3e,0x2f,0x67,0x69,0x6d,0x2c,0x22,0x22,0x29,0x3b,0x76,0x61,0x72,0x20,0x6c,0x3d,0x64,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x2e,0x63,0x72,0x65,0x61,0x74,0x65,0x45,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x28,0x22,0x74,0x65,0x78,0x74,0x61,0x72,0x65,0x61,0x22,0x29,0x3b,0x6c,0x2e,0x73,0x74,0x79,0x6c,0x65,0x3d,0x22,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3a,0x20,0x61,0x62,0x73,0x6f,0x6c,0x75,0x74,0x65,0x3b,0x6c,0x65,0x66,0x74,0x3a,0x20,0x2d,0x31,0x30,0x30,0x30,0x70,0x78,0x3b,0x20,0x74,0x6f,0x70,0x3a,0x20,0x2d,0x31,0x30,0x30,0x30,0x70,0x78,0x22,0x2c,0x6c,0x2e,0x69,0x6e,0x6e,0x65,0x72,0x48,0x54,0x4d,0x4c,0x3d,0x65,0x2c,0x64,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x2e,0x62,0x6f,0x64,0x79,0x2e,0x61,0x70,0x70,0x65,0x6e,0x64,0x43,0x68,0x69,0x6c,0x64,0x28,0x6c,0x29,0x2c,0x6c,0x2e,0x73,0x65,0x6c,0x65,0x63,0x74,0x28,0x29,0x2c,0x64,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x2e,0x65,0x78,0x65,0x63,0x43,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x28,0x22,0x63,0x6f,0x70,0x79,0x22,0x29,0x2c,0x64,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x2e,0x62,0x6f,0x64,0x79,0x2e,0x72,0x65,0x6d,0x6f,0x76,0x65,0x43,0x68,0x69,0x6c,0x64,0x28,0x6c,0x29,0x2c,0x61,0x6c,0x65,0x72,0x74,0x28,0x27,0x43,0x6f,0x70,0x69,0x65,0x64,0x3a,0x20,0x22,0x27,0x2b,0x65,0x2b,0x27,0x22,0x20,0x74,0x6f,0x20,0x63,0x6c,0x69,0x70,0x62,0x6f,0x61,0x72,0x64,0x21,0x27,0x29,0x7d, 0};
|
||||
|
||||
static const char DATA_GITHUB_CLIPBOARD_JS[] PROGMEM = {
|
||||
"function setGithubClipboard(){for(var e='ESP Easy | Information |\\n -----|-----|\\n',n=1;n<100;n++)"
|
||||
"{var o='copyText_'+n,t=document.getElementById(o);if(t){var a='|';n%2==0&&(a+='\\n'),e+=t.innerHTML.replace(/<[Bb][Rr]\\s*\\/?>/gim,'\\n')+a}else n=101}"
|
||||
"e=(e=e.replace(/<\\/[Dd][Ii][Vv]\\s*\\/?>/gim,'\\n')).replace(/<[^>]*>/gim,'');"
|
||||
"var i=document.createElement('textarea');i.style='position: absolute;left: -1000px; top: -1000px',i.innerHTML=e,document.body.appendChild(i),i.select(),document.execCommand('copy'),"
|
||||
"document.body.removeChild(i),alert('Copied: ''+e+'' to clipboard!')}"
|
||||
};
|
||||
#endif
|
||||
|
||||
#if defined(WEBSERVER_CSS) && !defined(WEBSERVER_EMBED_CUSTOM_CSS)
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
function setGithubClipboard() {
|
||||
var clipboard = 'ESP Easy | Information |\n -----|-----|\n';
|
||||
max_loop = 100;
|
||||
const max_loop = 100;
|
||||
for (var i = 1; i < max_loop; i++) {
|
||||
var cur_id = 'copyText_' + i;
|
||||
var test = document.getElementById(cur_id);
|
||||
if (test == null) {
|
||||
if (!test) {
|
||||
i = max_loop + 1;
|
||||
} else {
|
||||
var separatorSymbol = '|';
|
||||
|
||||
Reference in New Issue
Block a user