Latest topics
» [HELP] About Profile Cover Code
by MaHwOs Yesterday at 18:54

» bloquer un membre
by berlingo Fri 17 Nov 2017, 18:19

» IconSkouliki Graphics
by skouliki Fri 17 Nov 2017, 03:54

» [IN PROGRESS] Can this code work on pun version
by skouliki Thu 16 Nov 2017, 03:50

» Auto-suggest @mentions as You Type
by skouliki Wed 15 Nov 2017, 14:56

» [TUTORIAL] [ALL VERSIONS] Warning before posting
by demon99 Wed 15 Nov 2017, 08:12

» About Add Reply & New Topic button (popup form)
by omarpop23 Mon 13 Nov 2017, 20:31

» Hello everyone this is Adam from France
by Adam Mon 13 Nov 2017, 13:32

» Add a login popup for the toolbar
by Ape Sun 12 Nov 2017, 18:41

» Post a message automatically when locking a topic
by ThunderTB Sun 12 Nov 2017, 13:51

» Control pannel issue
by Ange Tuteur Sun 12 Nov 2017, 09:49

» BUG... forum members birthday's
by Ape Sat 11 Nov 2017, 11:44

» Display a Preview of Groups on Hover
by ThunderTB Fri 10 Nov 2017, 21:56

» Search box only visible on hover
by Ange Tuteur Mon 06 Nov 2017, 09:57

» [GAME] Animal Game
by SLGray Sun 05 Nov 2017, 15:04

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

None

[ View the whole list ]


Most users ever online was 172 on Fri 19 Feb 2016, 05:17

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

View previous topic View next topic Go down

avatar
Milouze14

Title :
Gender : Male
Age : 51
Posts : 76
Points : 508
Reputation : 22
Location : French Vendée
Language : French
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : Forumactif Edge
Awards :
View all awards
View user profile http://www.milouze14.com/

PostMilouze14 on 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


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

a++


Last edited by Milouze14 on Wed 10 May 2017, 10:30; edited 1 time in total
avatar
Ange Tuteur
Administrator
Title :
Coffee Addict
Gender : Male
Age : 22
Posts : 4712
Points : 9586
Reputation : 2341
Location : Macungie, PA
Language : EN10, FR5
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
Awards :
View all awards
View user profile https://github.com/SethClydesdale https://twitter.com/sethc1995

PostAnge Tuteur on 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
avatar
Milouze14

Title :
Gender : Male
Age : 51
Posts : 76
Points : 508
Reputation : 22
Location : French Vendée
Language : French
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : Forumactif Edge
Awards :
View all awards
View user profile http://www.milouze14.com/

PostMilouze14 on 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++
avatar
Ange Tuteur
Administrator
Title :
Coffee Addict
Gender : Male
Age : 22
Posts : 4712
Points : 9586
Reputation : 2341
Location : Macungie, PA
Language : EN10, FR5
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
Awards :
View all awards
View user profile https://github.com/SethClydesdale https://twitter.com/sethc1995

PostAnge Tuteur on 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
avatar
Milouze14

Title :
Gender : Male
Age : 51
Posts : 76
Points : 508
Reputation : 22
Location : French Vendée
Language : French
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : Forumactif Edge
Awards :
View all awards
View user profile http://www.milouze14.com/

PostMilouze14 on Wed 10 May 2017, 12:04

No, it was me who precipitated things my friend

Sorry @Ange Tuteur ,i would not start again, promised

a++
avatar
Ange Tuteur
Administrator
Title :
Coffee Addict
Gender : Male
Age : 22
Posts : 4712
Points : 9586
Reputation : 2341
Location : Macungie, PA
Language : EN10, FR5
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
Awards :
View all awards
View user profile https://github.com/SethClydesdale https://twitter.com/sethc1995

PostAnge Tuteur on Wed 10 May 2017, 12:06

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

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