🎨 Réduit le code du bookmarklet

Cas 1 de #1
This commit is contained in:
Clement Desmidt 2017-01-16 21:56:59 +01:00
parent 8dbfd1a199
commit 5fbea9c913
1 changed files with 1 additions and 1 deletions

View File

@ -73,7 +73,7 @@ if (isset($_GET['v'])) {
if ($_POST['html'] == 'on') { // bookmarklet pour l'envoi en HTML
$include = '<a href="javascript:void((function(){if(typeof(jQuery)!=\'function\'){var%20n=document.createElement(\'script\');n.setAttribute(\'src\',\'//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js\');document.getElementsByTagName(\'head\')[0].appendChild(n);}function%20v(){if(typeof(jQuery)==\'function\'){clearInterval(i);c();}}var%20i=window.setInterval(v,100);function%20c(){q=\'\';function%20gx(el){el=el.get(0);xp=\'\';for(;el&&el.nodeType==1;el=el.parentNode){id=jQuery(el.parentNode).children(el.tagName).index(el)+1;id>1?(id=\'[\'+id+\']\'):(id=\'\');xp=\'/\'+el.tagName.toLowerCase()+id+xp;}return%20xp;}jQuery(\'*\').bind(\'mouseenter\',function(){jQuery(\'*\').removeClass(\'shikihover\');jQuery(\'*\').css(\'border\',\'\');jQuery(this).css(\'border\',\'3px%20solid%20yellow\');jQuery(this).addClass(\'shikihover\');});jQuery(\'.shikihover\').live(\'click\',function(){jQuery(\'*\').unbind(\'mouseenter\').removeClass(\'shikihover\');jQuery(this).css(\'border\',\'\');var%20q=\'&q=\'+gx(jQuery(this)),d=document,t=d.title,f=\'//' . $_SERVER['HTTP_HOST'] . substr($_SERVER[PHP_SELF], 0, -9) . '\',m=\'' . $_POST['email'] . '\',l=d.location,e=encodeURIComponent,p=\'?v=1&u=\'+e(l.href)+\'&t=\'+e(t)+\'&m=\'+e(m),u=f+p+q;newScript=d.createElement(\'script\');newScript.type=\'text/javascript\';newScript.src=u;d.body.appendChild(newScript);});}})())">Bookmark by email</a>';
} else { // bookmarklet pour l'envoi normal
$include = "<a href='javascript:var%20d=document,w=window,e=w.getSelection,k=d.getSelection,x=d.selection,t=d.title,f=\"//" . $_SERVER['HTTP_HOST'] . substr($_SERVER[PHP_SELF], 0, -9) . "\",m=\"" . $_POST['email'] . "\",l=d.location,e=encodeURIComponent,p=\"?v=1&u=\"+e(l.href)%20+\"&t=\"+e(t)%20+\"&m=\"+e(m),u=f+p;var%20newScript%20=%20document.createElement(\"script\");newScript.type=\"text/javascript\";newScript.src=u;document.body.appendChild(newScript);void(0)'>Bookmark by email</a>";
$include = "<a href='javascript:var%20d=document,t=d.title,f=\"//" . $_SERVER['HTTP_HOST'] . substr($_SERVER[PHP_SELF], 0, -9) . "\",m=\"" . $_POST['email'] . "\",l=d.location,e=encodeURIComponent,p=\"?v=1&u=\"+e(l.href)+\"&t=\"+e(t)+\"&m=\"+e(m),u=f+p;var%20ns=document.createElement(\"script\");ns.type=\"text/javascript\";ns.src=u;document.body.appendChild(ns);void(0)'>Bookmark by email</a>";
}
//ADDING STATS