Mes petits secrets
Messages : 111 Réputation : 0 Date d'inscription : 09/02/2016 Age : 32 Localisation : fdjskqf
| Les scripts JS Sam 2 Sep - 14:43 Les deux scripts ci-dessous : cocher toutes les pages Scripte pour copier coller un coder - Code:
-
function selectCode(e) { var s = $(e).closest("dl").find(".cont_code,code").get(0), range, selection; var a = s, z = s; while(a.nodeType == 1 && a.childNodes.length) a=a.firstChild; while(z.nodeType == 1 && z.childNodes.length) z=z.lastChild; if (!$(a).is('.fixff')) { var fix = $('<span class="fixff"/>').insertBefore(a); } else { a = a.nextSibling; } if (document.body.createTextRange) { range = document.body.createTextRange(); range.moveToElementText(s); range.select(); } else if (window.getSelection) { selection = window.getSelection(); range = document.createRange(); range.setStart(a, 0); range.setEnd(z, z.nodeValue ? z.nodeValue.length : 0); selection.removeAllRanges(); selection.addRange(range); } }; $(function(){$("dl.codebox:not(.spoiler,.hidecode) > dd.code, dl.codebox:not(.spoiler,.hidecode) > dd > code").closest("dl").find('dt').append('<span onClick="selectCode(this)" class="selectCode">clique fainéant</span>')}); Scripte compteur de mot - Code:
-
var wordcount_signaled= false; $(function(){ if(!$('#text_editor_textarea').length || !$.fn["sceditor"]) return; $(function(){ var e= $('#text_editor_textarea').sceditor('instance'); if(!e) return; var w= $('<div class="word-count"></div>').insertAfter('.sceditor-container'); var wc= function(){ var t= e.val().replace(/\[.*?\]/g,' ').replace(/<.*?>/g,' ').replace(/[\x00-\x40\x5b-\x60\x7b-\x7e]/g,' '); w.html('Caractères : '+(t.match(/\S/g)||[]).length+' Mots : '+(t.match(/\S{1,}/g)||[]).length); wordcount_signaled= false }; e.keyDown(function(){ if(wordcount_signaled) return; wordcount_signaled= true; setTimeout(function(){ wc() }, 2000) }); wc() }) }); |
Mes petits secrets
Messages : 111 Réputation : 0 Date d'inscription : 09/02/2016 Age : 32 Localisation : fdjskqf
| Re: Les scripts JS Sam 2 Sep - 14:50 Remplacer l'infobulle des icones profil (sur tout les sujets) cocher sujet - Code:
-
$(document).ready(function(){ $('.lienprofil a img[src$="http://nsa38.casimages.com/img/2017/03/05/170305043420250280.png"]').parent().attr('title','liens'); });
$(document).ready(function(){ $('.lienprofil a img[src$="http://nsa38.casimages.com/img/2017/03/05/170305043609872539.png"]').parent().attr('title','prez'); });
$(document).ready(function(){ $('.lienprofil a img[src$="http://nsa38.casimages.com/img/2017/03/05/170305043739593474.png"]').parent().attr('title','rp's'); });
$(document).ready(function(){ $('.lienprofil a img[src$="http://image.noelshack.com/fichiers/2017/25/2/1497957839-rp.png"]').parent().attr('title',bank''); });
|