FM Design
Would you like to react to this message? Create an account in a few clicks or log in to continue.

IMPORTANT

FM Design is in read-only mode, please click here for more information.

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

Recent Tutorials
Top posting users this month

Who is online?
In total there are 23 users online :: 0 Registered, 0 Hidden and 23 Guests :: 1 Bot

None

[ View the whole list ]


Most users ever online was 515 on Tue 14 Sep 2021, 15:24

Copy code button last update and the automatic selection !!!!

View previous topic View next topic Go down

Milouze14
Milouze14

Gender : Male
Age : 58
Posts : 79
Points : 2832
Reputation : 23
Location : French Vendée
Language : French
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : Forumactif Edge
https://www.milouze14.com/

PostMilouze14 Tue 09 May 2017, 23:18

Hello @Ange Tuteur cheers ,

After the last update of this plugin the automatic selection of the text is no longer done

Before update
Update - Copy code button  last update and the automatic selection !!!! Avant_10

After update:
Update - Copy code button  last update and the automatic selection !!!! Last_u10

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 cheers .

a++


Last edited by Milouze14 on Wed 10 May 2017, 10:30; edited 1 time in total
Ange Tuteur
Ange Tuteur
Administrator
Gender : Male
Posts : 4741
Points : 12013
Reputation : 2375
Location : Pennsylvania
Language : EN, JA, FR
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
https://sethclydesdale.github.io/ https://twitter.com/sethc1995

PostAnge Tuteur Wed 10 May 2017, 10:16

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)
Code:
e.clearSelection();
Save and the selection should appear once again. Wink
Milouze14
Milouze14

Gender : Male
Age : 58
Posts : 79
Points : 2832
Reputation : 23
Location : French Vendée
Language : French
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : Forumactif Edge
https://www.milouze14.com/

PostMilouze14 Wed 10 May 2017, 10:30

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++
Ange Tuteur
Ange Tuteur
Administrator
Gender : Male
Posts : 4741
Points : 12013
Reputation : 2375
Location : Pennsylvania
Language : EN, JA, FR
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
https://sethclydesdale.github.io/ https://twitter.com/sethc1995

PostAnge Tuteur Wed 10 May 2017, 12:00

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. Toothless

You're welcome. Smile
Milouze14
Milouze14

Gender : Male
Age : 58
Posts : 79
Points : 2832
Reputation : 23
Location : French Vendée
Language : French
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : Forumactif Edge
https://www.milouze14.com/

PostMilouze14 Wed 10 May 2017, 12:04

No, it was me who precipitated things my friend Update - Copy code button  last update and the automatic selection !!!! 1f60b

Sorry @Ange Tuteur ,i would not start again, promised Update - Copy code button  last update and the automatic selection !!!! 1f606

a++
Ange Tuteur
Ange Tuteur
Administrator
Gender : Male
Posts : 4741
Points : 12013
Reputation : 2375
Location : Pennsylvania
Language : EN, JA, FR
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
https://sethclydesdale.github.io/ https://twitter.com/sethc1995

PostAnge Tuteur Wed 10 May 2017, 12:06

It's no problem, after all there's no harm in asking if you have concerns ! Wink
Sponsored content

PostSponsored content

View previous topic View next topic Back to top

Create an account or log in to leave a reply

You need to be a member in order to leave a reply.

Create an account

Join our community by creating a new account. It's easy!


Create a new account

Log in

Already have an account? No problem, log in here.


Log in

 
Permissions in this forum:
You cannot reply to topics in this forum