Latest topics
» IconSkouliki
by skouliki Sun 17 Sep 2017, 11:05

» Awards
by Mr_Grande Sun 17 Sep 2017, 08:52

» Modify Category Tabs lead to a desired position and auto scroll click
by djblah Fri 15 Sep 2017, 14:56

» Display a preview of the user profile on hover
by Eiki Thu 14 Sep 2017, 02:38

» [GAME] Count to 30 - Ange Edition
by SLGray Mon 11 Sep 2017, 14:23

» Rank CSS
by Mr_Grande Fri 08 Sep 2017, 09:24

» make the topic a color
by Ultimas Wed 06 Sep 2017, 19:44

» Chit Chat Thread
by Valoish Sun 03 Sep 2017, 23:20

» The like/thumbs up or down feature
by Dr.kran Sun 03 Sep 2017, 19:21

» My text boxes are glitched, can you help with this type of problem?
by Wolfuryo Sun 03 Sep 2017, 17:08

» User - Made Creations
by SLGray Sun 03 Sep 2017, 16:25

» FM Themes
by SLGray Sun 03 Sep 2017, 16:24

» i need to add css improvement
by Wolfuryo Sat 02 Sep 2017, 12:12

» How do I add hover examine feature?
by Dr.kran Wed 30 Aug 2017, 16:43

» [GAME] World Snake
by SLGray Wed 30 Aug 2017, 14:46

Recent Tutorials
Top posting users this month
Who is online?
In total there are 5 users online :: 0 Registered, 0 Hidden and 5 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 : 447
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 : 21
Posts : 4684
Points : 9727
Reputation : 2331
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 : 447
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 : 21
Posts : 4684
Points : 9727
Reputation : 2331
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 : 447
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 : 21
Posts : 4684
Points : 9727
Reputation : 2331
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