IMPORTANT

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

Latest topics
» Forumactif Edge - Releases
by Ange Tuteur Tue 03 Apr 2018, 11:43

» 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

» Numbering of messages in the topic
by SLGray Mon 04 Dec 2017, 22:40

Recent Tutorials
Top posting users this month
Who is online?
In total there are 7 users online :: 0 Registered, 0 Hidden and 7 Guests :: 2 Bots

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

Gender : Male
Age : 52
Posts : 79
Points : 665
Reputation : 23
Location : French Vendée
Language : French
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : Forumactif Edge
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
Gender : Male
Age : 22
Posts : 4726
Points : 9776
Reputation : 2362
Location : Macungie, PA
Language : EN10, FR5
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
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

--------

Ange Tuteur
Tips and TricksContact Me

avatar
Milouze14

Gender : Male
Age : 52
Posts : 79
Points : 665
Reputation : 23
Location : French Vendée
Language : French
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : Forumactif Edge
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
Gender : Male
Age : 22
Posts : 4726
Points : 9776
Reputation : 2362
Location : Macungie, PA
Language : EN10, FR5
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
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

--------

Ange Tuteur
Tips and TricksContact Me

avatar
Milouze14

Gender : Male
Age : 52
Posts : 79
Points : 665
Reputation : 23
Location : French Vendée
Language : French
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : Forumactif Edge
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
Gender : Male
Age : 22
Posts : 4726
Points : 9776
Reputation : 2362
Location : Macungie, PA
Language : EN10, FR5
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
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

--------

Ange Tuteur
Tips and TricksContact Me

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