[FOORUM] Select Content button
Lehekülg 1, lehekülgi kokku 1 • Share
- flammable
- Liitus : 17/08/2014
Postitusi : 1600
Lõpp tulemus:
♦ Tee uus javascript,
Administration Panel → Modules Tab → Javascript codes management → Create a new javascript
♦♦ Vali "all pages"
♦♦ Salvesta ning mine CSS stylesheet,
Administration Panel > Display > Colors > CSS stylesheet
Javascript ilusti loodud!
♦ Tee uus javascript,
Administration Panel → Modules Tab → Javascript codes management → Create a new javascript
♦♦ Vali "all pages"
- Kood:
function selectCode(a){a=$(a).closest("dl").find(".cont_code,code")[0];if(window.getSelection){var c=window.getSelection();if(c.setBaseAndExtent)c.setBaseAndExtent(a,0,a,a.innerText.length-1);else{window.opera&&a.innerHTML.substring(a.innerHTML.length-4)=="<BR>"&&(a.innerHTML+=" ");var b=document.createRange();b.setStart(a.firstChild, 0);b.setEnd(a, a.childNodes.length);c.removeAllRanges();c.addRange(b)}}else document.getSelection?(c=document.getSelection(),b=document.createRange(),b.selectNodeContents(a),c.removeAllRanges(),c.addRange(b)):document.selection&&(b=document.body.createTextRange(),b.moveToElementText(a),b.select())};
$(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">Select content</span>')});
♦♦ Salvesta ning mine CSS stylesheet,
Administration Panel > Display > Colors > CSS stylesheet
- Kood:
.selectCode { float:right; text-transform: uppercase; cursor:pointer; }
div.cont_code { clear: right; }
Javascript ilusti loodud!
Soovid vestluses osaleda?
Selleks logi sisse või tee endale kasutaja.
Lehekülg 1, lehekülgi kokku 1
Permissions in this forum:
Sa ei saa vastata siinsetele teemadele