Latest topics
» Forumactif Edge - Releases
by Ange Tuteur Tue 03 Sep 2019, 11:49
» GIFActif - Giphy Button for the Editor
by Ange Tuteur Wed 08 May 2019, 17:21
» Forum Closure
by Ange Tuteur Mon 01 Jan 2018, 01:28
» Chit Chat Thread
by Valoish Sun 31 Dec 2017, 19:15
» Font/Text background color.
by Valoish Sun 31 Dec 2017, 19:11
» Forumactif Messenger - Instant Message Application for Forumotion
by Wolfuryo Sun 31 Dec 2017, 18:24
» [GAME] Count to One Million!
by brandon_g Fri 29 Dec 2017, 18:58
» Post Cards
by manikbiradar Wed 20 Dec 2017, 07:50
» [GAME] Countdown from 200,000
by Valoish Wed 13 Dec 2017, 23:22
» GeekPolice Tech Support Forums - GeekPolice.net
by Dr Jay Mon 11 Dec 2017, 19:12
» Asking about some plugin for Forumotion
by Dr Jay Mon 11 Dec 2017, 19:10
» [GAME] What are you thinking right now?
by Van-Helsing Sat 09 Dec 2017, 14:51
» Widget : Similar topics
by ranbac Wed 06 Dec 2017, 18:11
» Change the Background of the Forum and put an image and how to make prefixs?
by Clement Wed 06 Dec 2017, 15:19
» Hello from Western Australia
by SarkZKalie Wed 06 Dec 2017, 05:34
by Ange Tuteur Tue 03 Sep 2019, 11:49
» GIFActif - Giphy Button for the Editor
by Ange Tuteur Wed 08 May 2019, 17:21
» Forum Closure
by Ange Tuteur Mon 01 Jan 2018, 01:28
» Chit Chat Thread
by Valoish Sun 31 Dec 2017, 19:15
» Font/Text background color.
by Valoish Sun 31 Dec 2017, 19:11
» Forumactif Messenger - Instant Message Application for Forumotion
by Wolfuryo Sun 31 Dec 2017, 18:24
» [GAME] Count to One Million!
by brandon_g Fri 29 Dec 2017, 18:58
» Post Cards
by manikbiradar Wed 20 Dec 2017, 07:50
» [GAME] Countdown from 200,000
by Valoish Wed 13 Dec 2017, 23:22
» GeekPolice Tech Support Forums - GeekPolice.net
by Dr Jay Mon 11 Dec 2017, 19:12
» Asking about some plugin for Forumotion
by Dr Jay Mon 11 Dec 2017, 19:10
» [GAME] What are you thinking right now?
by Van-Helsing Sat 09 Dec 2017, 14:51
» Widget : Similar topics
by ranbac Wed 06 Dec 2017, 18:11
» Change the Background of the Forum and put an image and how to make prefixs?
by Clement Wed 06 Dec 2017, 15:19
» Hello from Western Australia
by SarkZKalie Wed 06 Dec 2017, 05:34
Recent Tutorials
Top posting users this month
Top Achievers
Who is online?
In total there are 47 users online :: 0 Registered, 0 Hidden and 47 Guests :: 2 Bots
None
Most users ever online was 515 on Tue 14 Sep 2021, 15:24
None
Most users ever online was 515 on Tue 14 Sep 2021, 15:24
Copy code button last update and the automatic selection !!!!
Page 1 of 1 • Share
Hello @Ange Tuteur ,
After the last update of this plugin the automatic selection of the text is no longer done
Before update
After update:
The functional script of the previous version
Thank my friend .
a++
After the last update of this plugin the automatic selection of the text is no longer done
Before update
After update:
The functional script of the previous version
- Code:
/* -- 12. copy code button -- */
$.getScript('https://cdn.jsdelivr.net/clipboard.js/1.5.16/clipboard.min.js', function() {
window.fae_copyCode = {
copy : 'Copier le code',
copied : 'Copié !'
};
$(function() {
var a = $('.codebox dt').not('.spoiler > dt, .hidecode > dt'),
i = 0,
j = a.length;
if (a[0]) {
$('head').append('<style type="text/css">.fae_copy-code{float:right;cursor:pointer}.fae_copy-code:before{content:"\\f0ea";font-size:13px;font-family:FontAwesome;text-align:center;color:#69C;background:#FFF;border-radius:100%;display:inline-block;width:19px;height:19px;line-height:19px;margin:-1px 3px 0 3px}.codebox .fae_copy-code:hover:before{color:#EB5}.codebox .fae_copy-code.fae_copied:before{content:"\\f00c";font-weight:700;color:#8B5}</style>');
for (; i < j; i++) {
a[i].insertAdjacentHTML('beforeend', '<span class="fae_copy-code">' + fae_copyCode.copy + '</span>');
}
new Clipboard('.fae_copy-code',{
target : function (copy) {
if (copy.innerHTML != fae_copyCode.copied) {
return $(copy).closest('.codebox').find('code')[0];
}
},
text : function (copy) {
if (copy.innerHTML != fae_copyCode.copied) {
copy.innerHTML = fae_copyCode.copied;
copy.className += ' fae_copied';
window.setTimeout(function() {
copy.innerHTML = fae_copyCode.copy;
copy.className = copy.className.replace('fae_copied', '');
}, 1000);
}
}
});
}
});
});
Thank my friend .
a++
Last edited by Milouze14 on Wed 10 May 2017, 10:30; edited 1 time in total
Hi @Milouze14,
The Copy Code button was updated to use the success event handler. When performing this update I also decided to clear the selection after the contents were copied, because leaving the selection wasn't necessary since the contents are automatically copied upon clicking the button. The only time the selection will appear is when clipboard.js fails to copy the contents to the user's clipboard. It may seem different after the update, but I can assure you that the copy code button still functions the same as before, with the only difference being the selection is now cleared.
If you like, you can always remove the line of code that clears the selection.
Go to Admin Panel > Modules > JS Codes management > ALL.JS
Find and remove : (line 965)
The Copy Code button was updated to use the success event handler. When performing this update I also decided to clear the selection after the contents were copied, because leaving the selection wasn't necessary since the contents are automatically copied upon clicking the button. The only time the selection will appear is when clipboard.js fails to copy the contents to the user's clipboard. It may seem different after the update, but I can assure you that the copy code button still functions the same as before, with the only difference being the selection is now cleared.
If you like, you can always remove the line of code that clears the selection.
Go to Admin Panel > Modules > JS Codes management > ALL.JS
Find and remove : (line 965)
- Code:
e.clearSelection();
Hello @Ange Tuteur ,
Ok, i understand better this feature added, only my members are very used to highlighting code. Thank you very much my friend.
a++
Ok, i understand better this feature added, only my members are very used to highlighting code. Thank you very much my friend.
a++
Haha I can understand ; I'd think it was a bug as well if it stopped highlighting the code out of the blue. Partly it's my mistake, because I should've used the success handler to begin with.
You're welcome.
You're welcome.
No, it was me who precipitated things my friend
Sorry @Ange Tuteur ,i would not start again, promised
a++
Sorry @Ange Tuteur ,i would not start again, promised
a++
- Sponsored content
Similar topics
Create an account or log in to leave a reply
You need to be a member in order to leave a reply.
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum