Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=1285)
Select All & Copy 'Code' to Clipboard BETA
By [n3rve] (http://www.simplemachines.org/community/index.php?action=profile;u=139801)
IntroductionWhen the "[ code ] [ /code ]" tag is used on your forum, The Code is seperated in a box like a quote as illustrated below;
This is an Example; [n3rve] thinks Metallica is SMF himself
This plugin will alter output of the 'code' tag to include js to "select all" and "Copy to clipboard".
'Flash' needs to be enabled on the clients browser (as the copying is done by a flash file called _clipboard.swf)
It's enabled by default in most browsers.
This plugin has been tested on the following Browsers:
o Internet Explorer 6 / 7
o Internet Explorer 8 BETA
o Mozilla Firefox 3.0 BETA 2
o Opera
Please, Test and let me know which browsers are supported and which are not, I'll reference you (http://www.simplemachines.org/community/index.php?action=profile;u=0) in this readme.
Compatabilityo 1.1.4
o 1.1.5
o 2.0 Beta 3 Public
o 2.0 Beta 3.1 Public
Featureso Adds "Select Code" Link to each coded section
o Adds "Copy To Clipboard" Link to each coded section
Currently, There are no administration settings with this mod. (maybe in an updated version :) ). To disable/remove it, you must uninstall the modification.
Should you experience problems installing/ uninstalling a mod?
Use the SMF Package Parser (http://modparser.oxynerve.net)
Installation Installation affects source files and a javascript file which is called from the default theme for virtually all themes, therefore theme modificatoions aren't required.
Languageso English/English-utf8
o English_British/English_British-utf8
o Turkish/Turkish-utf8 (Translated by 'Kapadokyali' & 'BadBoy')
o Spanish/Spanish-utf8 (Translated by 'EgAr')
o Spanish_es/Spanish_es-utf8 (Trasnlated by 'EgAr')
o Greek/Greek-utf8 (Translated by 'MinasC')
I welcome translations for other languages SMF Supports.
Please translate the following and post them in the comment topic linked above.
$txt['codeselectall'] = 'Select All';
$txt['codecopytoclipboard'] = 'Copy To Clipboard';
$txt['codedivider'] = '|';
Bug ReportsThey shouldn't be any major bugs, but just in case, Please use the modification's thread for bug reports pertaining this modification.
Thanks for Testing this BETA Release, The Non-BETA will be released a few days after I have used this on my production site and no bugs have been reported here.
-[n3rve]
©2007 - 2008
German:
$txt['codeselectall'] = 'Markieren';
$txt['codecopytoclipboard'] = 'In die Zwischenablage kopieren';
$txt['codedivider'] = '|';
Can you put Select All|Copy to Clipboard on the right side?
Russian
$txt['codeselectall'] = 'Выделить всё';
$txt['codecopytoclipboard'] = 'Копировать в буфер обмена';
$txt['codedivider'] = '|';
This is a great feature. Glad to see it offered as I will be using this
But... I'd like to extent it's use to something else besides the code field.
I have an area in Ultimate Profiles called My URL. Basically it's a box in the users profile that shows the user his or her personal Pretty URL.
I would like to extend the functionallity of this mod to also work on that < td>
Is it as easy as making that < td> use the same CSS as the code box?
OK, I installed it.
It shows "Select All | Copy To Clipboard" like it should.
It does copy to Clipboard as it should.
...but heres where it gets weird. If I try to paste to the adress bar in IE7, it pastes nothing.
It will paste to a reply text field, or to Notepad, but not to the address bar ???
Also, Is there a way to mix the select and copy to clipboard features into one button?
is this the same mod that is being used here on this site (as seen below)
/|\
|
|
/|\
/|\
This Button
Thanks for the translations 3axapbl4 and Flocke.
∑£ℓ¢†®¡¢ §ợų¡đ,
Sorry I can't help you with that. You should post at the SMF Coding Discussion Board as it's not related to the mod.
Quote
...but heres where it gets weird. If I try to paste to the adress bar in IE7, it pastes nothing.
It will paste to a reply text field, or to Notepad, but not to the address bar.
This could be a client browser issue, it works fine on firefox.
-[n3rve]
I was figuring it was browser related. The auto copy thing seems to not be cross browser friendly at all. Not this mod, im talking in general with any code that does this.
Spanish:
$txt['codeselectall'] = 'Seleccionar';
$txt['codecopytoclipboard'] = 'Copiar al Portapapeles';
$txt['codedivider'] = '|';
Quote from: NicKCramleT on July 26, 2008, 02:42:09 PM
Spanish:
$txt['codeselectall'] = 'Seleccionar';
$txt['codecopytoclipboard'] = 'Copiar al Portapapeles';
$txt['codedivider'] = '|';
Thanks NicKCramleT :)
-[n3rve]
the text appears up over the coded text but it doesnt work... it neither selects neither copies them...any solutions ?
Quote from: F.L.A.M.E.R on August 22, 2008, 11:17:03 AM
the text appears up over the coded text but it doesnt work... it neither selects neither copies them...any solutions ?
which browser do u use?
firefox..
version?
3.0.1
Quote from: F.L.A.M.E.R on August 22, 2008, 11:17:03 AM
the text appears up over the coded text but it doesnt work... it neither selects neither copies them...any solutions ?
Same here. It shows the "select all" and "Copy to clipboard" above the code section box But it doesnt highlight or copy to clip at all.
Any solutions yet ??
I tried IE7 and FF 2.5 or the latest version what ever it is. Not FF3 though. I am also using 1.1.5 fresh
great mod and i could really use it. Any help would be appreciated alot. Thanks.
What if you have modified this line already to hide the code tag from guests
from this thread - http://www.simplemachines.org/community/index.php?topic=251621
'content' => '<div class="codeheader">' . $txt['smf238'] . ':</div><div class="code">' . ($context['browser']['is_gecko'] ? '<pre style="margin-top: 0; display: inline;">$1</pre>' : '$1') . '</div>',
to this
'content' => '<div class="codeheader">' . $txt['smf238'] . ':</div>' . ($user_info['is_guest'] ? 'Codes are only visible to the guests. <a href="' . $scripturl . '?action=register">Register</a> or <a href="' . $scripturl . '?action=login">Login</a><div style="visibility:hidden">' : '<div class="code">') . ($context['browser']['is_gecko'] ? '<pre style="margin-top: 0; display: inline;">$1</pre>' : '$1') . '</div>',
Pls Help.
Hi!
I've installed this mod but it don't work with pretty urls!
To fix open /forum/Themes/default/script.js
Search: document.getElementById('clipboard').innerHTML = '<embed src="_clipboard.swf" FlashVars="clipboard='+encodeURIComponent(output)+'" width="0" height="0" type="application/x-shockwave-flash"></embed>';
Replace: document.getElementById('clipboard').innerHTML = '<embed src="http://www.yoursiteurl.xx/forum/_clipboard.swf" FlashVars="clipboard='+encodeURIComponent(output)+'" width="0" height="0" type="application/x-shockwave-flash"></embed>';
PS: for noscript browser is best to edit like this:
$data = \'<div class="codeheader">\' . $txt[\'smf238\'] . \': \'
.\'<script type="text/javascript">/*//<![CDATA[ */document.write("<a href=\"javascript:void(0)\" title=\"\'.$txt[\'codeselectall\'].\'\" onclick=\"javascript:selectall(\\\'code_a\'.$codecounter.\'\\\');return false;\">\'.$txt[\'codeselectall\'].\'</a>\'
.\' \'.$txt[\'codedivider\'].\' <a href=\"javascript:void(0)\" title=\"\'.$txt[\'codecopytoclipboard\'].\'\" onclick=\"javascript:copy(\\\'code_a\'.$codecounter.\'\\\');return false;\">\'.$txt[\'codecopytoclipboard\'].\'</a>"); /*//]]>*/</script>\'
.\'<noscript><u>\'.$txt[\'codeselectall\'].\'</u> \'.$txt[\'codedivider\'].\' <u>\'.$txt[\'codecopytoclipboard\'].\'</u> \'.$txt[\'codejavarequired\'].\'</noscript>\'
.\'</div><div class="code" id="code_a\'.$codecounter.\'">\' . ($context[\'browser\'][\'is_gecko\'] ? \'<pre style="margin-top: 0; display: inline;">\'.$data.\'</pre>\' : $data) . \'</div>\';
// end of select all and copy to clipboard mod
Now insert in ModSettings.english.php this line:
$txt['codejavarequired'] = '- (Enable Javascript to use these functions)';
U can test result here: http://darkwolf.altervista.org/forum/modemrouter/g604t-e-reboot/msg1549/#msg1549
;)
not work in opera 9.62 (smf 1.1.7) =(
Portuguese (BR)
$txt['codeselectall'] = 'Selecionar Tudo';
$txt['codecopytoclipboard'] = 'Copiar para a Área de Transferência';
$txt['codedivider'] = '|';
Uhhh... God MOD but not work in SMF 1.1.8, any suggestions? can updated? to SMF 1.1.8 please?, Thanks...
Regards 8).-
Any idea if thiis will reach an official release? Would be so usefull to have on my site.
Please someone, code, code, code :P
Try this:
set for install on 1.1.8
BE SURE TO MAKE BACK UPS FIRST !!!!
i edited a couple thing for install. Should work but havent tried it yet. I will also try it tomorrow and let you know if anybody hasnt already. But should be ok and install fine.
might have a little bit more editing to do.
See attached
Not sure why the mod creator hasnt fixed this one yet. It is a much needed mod.
scratch that above. Got it to install and select all. But not copy to clip board. Got a little bit of some more editing to do.
will work for at least that part for now. You can also edit it and take out the text for the 'copy to clipboard" part and just use to select all (highlight)
when update please dont forget portugues linguage
<file name="$languagedir/Modifications.portuguese_pt.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
$txt['codeselectall'] = 'Selecionar Tudo';
$txt['codecopytoclipboard'] = 'Copiar para a Área de Transferência';
$txt['codedivider'] = '|';
]]></add>
</operation>
</file>
<file name="$languagedir/Modifications.portuguese_pt-utf8.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
$txt['codeselectall'] = 'Selecionar Tudo';
$txt['codecopytoclipboard'] = 'Copiar para a Área de Transferência';
$txt['codedivider'] = '|';
]]></add>
</operation>
</file>
<file name="$languagedir/Modifications.portuguese_brazilian.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
$txt['codeselectall'] = 'Selecionar Tudo';
$txt['codecopytoclipboard'] = 'Copiar para a Área de Transferência';
$txt['codedivider'] = '|';
]]></add>
</operation>
</file>
<file name="$languagedir/Modifications.portuguese_brazilian-utf8.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
$txt['codeselectall'] = 'Selecionar Tudo';
$txt['codecopytoclipboard'] = 'Copiar para a Área de Transferência';
$txt['codedivider'] = '|';
]]></add>
</operation>
</file
Mmm... hey [n3rve] update the MOD complete, is the better for all users... is so good MOD but may be need UpDate to last version's of SMF, thanks...
Regards 8).-
Updated :)
-[n3rve]
Wowww... THANKS!!! :D [n3rve] I repeat... Excelent MOD, Congratulations ;) Thanks... fully working now
Regards [n3rve] 8).-
that link
http://modparser.oxynerve.net/
she not work
Yeah, my domain name expired and I haven't renewed it so I currently access that site using the IP address.
We now have a Package Parser on the page of every mod, select your SMF version and click "Parse".
-[n3rve]
Thanks for this great Mod. I tested on my SMF 1.1.9 with FireFox 3.0.10, it can't work. My SMF is using a custom theme instead of the default theme.
Below is Chinese language translation made by me:
<file name="$languagedir/Modifications.chinese-simplified-utf8.php">
<operation>
<search position="end" />
<add><![CDATA[
$txt['codeselectall'] = '全选';
$txt['codecopytoclipboard'] = '复制到剪切板';
$txt['codedivider'] = '|';
]]></add>
</operation>
</file>
<file name="$languagedir/Modifications.chinese-traditional-utf8.php">
<operation>
<search position="end" />
<add><![CDATA[
$txt['codeselectall'] = '全選';
$txt['codecopytoclipboard'] = '復制到剪切板';
$txt['codedivider'] = '|';
]]></add>
</operation>
</file>
An awesome mod, many thanks [n3rve]. after some issues installing on SMF 1.1.10, is is now installed and works ok with IE. IE however is rubbish and most of my users are using Fx 3.5.3. The shame of it all is this mod is not selecting the code or copying to clipboard when used in Fx 3.5.3. is there any fix for this.
Thanks in advance
SCM
Any update for 1.1.11 + as the package is saying it is corrupted and will not apply. ??
How about getting this to work with 2.0.4? I've tried making install in compability mode, but get errors regarding subs.