'Copy Code' Javascript not working.

Go down

Solved 'Copy Code' Javascript not working.

Post by ivyleaf on May 1st 2018, 8:42 am

Technical Details


Forum version : #phpBB2
Position : Founder
Concerned browser(s) : Google Chrome
Screenshot of problem : https://images2.imgbox.com/f3/c2/ekFMrqBH_o.gif
Who the problem concerns : All members
When the problem appeared : The script has never worked before - it's always acted this way.
Forum link : http://bioluminessence.forumotion.com/

Description of problem

Hello, this is my first time submitting one of these, so apologies if I've done anything wrong.

I've been working on a forum, and grabbed a few Javascripts to make it easier to use. However, several of them did not work, this code being one of them. When I click on the Copy Code button, it doesn't do anything. I know next to nothing about Javascript, so I would appreciate if someone more experienced could give me some insight!

I have made little to no changes to the templates, and several other scripts I've tried have not worked either (this and this), perhaps the issues could be related?

Thanks in advance!


Last edited by ivyleaf on May 4th 2018, 1:50 am; edited 2 times in total
avatar
ivyleaf
New Member

Posts : 19
Reputation : 1
Language : English, Mandarin
Location : Taiwan

http://bioluminessence.forumotion.com/

Back to top Go down

Solved Re: 'Copy Code' Javascript not working.

Post by SLGray on May 1st 2018, 8:49 am

Do you have JavaScript Management turned on?



When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
avatar
SLGray
Administrator
Administrator

Male Posts : 44556
Reputation : 3158
Language : English
Location : United States

http://fmthemesdesignteam.forumotion.com/

Back to top Go down

Solved Re: 'Copy Code' Javascript not working.

Post by ivyleaf on May 1st 2018, 9:10 am

If you are referring to this, then yes, I do have it turned on. I have gotten one Javascript to work before, just not anything else.
avatar
ivyleaf
New Member

Posts : 19
Reputation : 1
Language : English, Mandarin
Location : Taiwan

http://bioluminessence.forumotion.com/

Back to top Go down

Solved Re: 'Copy Code' Javascript not working.

Post by SLGray on May 1st 2018, 9:12 am

Did you set this one to all pages?



When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
avatar
SLGray
Administrator
Administrator

Male Posts : 44556
Reputation : 3158
Language : English
Location : United States

http://fmthemesdesignteam.forumotion.com/

Back to top Go down

Solved Re: 'Copy Code' Javascript not working.

Post by ivyleaf on May 1st 2018, 9:13 am

Yes, I have.
avatar
ivyleaf
New Member

Posts : 19
Reputation : 1
Language : English, Mandarin
Location : Taiwan

http://bioluminessence.forumotion.com/

Back to top Go down

Solved Re: 'Copy Code' Javascript not working.

Post by SLGray on May 1st 2018, 9:22 am

Did you say that you have modified your templates?



When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
avatar
SLGray
Administrator
Administrator

Male Posts : 44556
Reputation : 3158
Language : English
Location : United States

http://fmthemesdesignteam.forumotion.com/

Back to top Go down

Solved Re: 'Copy Code' Javascript not working.

Post by ivyleaf on May 1st 2018, 9:25 am

Yes, only according to this post when the Javascript did not work. It did not appear to have any effect.

Edit; never mind, it appears that I had misread the post. This change was made to the Javascript and has since then been changed back. Otherwise I don't think I've made any changes to templates.
avatar
ivyleaf
New Member

Posts : 19
Reputation : 1
Language : English, Mandarin
Location : Taiwan

http://bioluminessence.forumotion.com/

Back to top Go down

Solved Re: 'Copy Code' Javascript not working.

Post by APE on May 1st 2018, 8:20 pm

@ivyleaf Is this now solved ?

If yes please press the mark solved button that can be found at the top of this thread.

APE.



avatar
APE
Administrator
Administrator

Male Posts : 13391
Reputation : 1421
Language : fluent in dork / mumbojumbo & English haha

http://chatworld.forumotion.co.uk/

Back to top Go down

Solved Re: 'Copy Code' Javascript not working.

Post by ivyleaf on May 2nd 2018, 1:39 am

No, it has not been solved yet.
avatar
ivyleaf
New Member

Posts : 19
Reputation : 1
Language : English, Mandarin
Location : Taiwan

http://bioluminessence.forumotion.com/

Back to top Go down

Solved Re: 'Copy Code' Javascript not working.

Post by brandon_g on May 2nd 2018, 3:12 am

Do you have any other codes installed on your forum?


Remember to mark your topic when a solution is found.
avatar
brandon_g
Manager
Manager

Male Posts : 7719
Reputation : 703
Language : English
Location : USA

http://broadcastingduo.forumotion.com/

Back to top Go down

Solved Re: 'Copy Code' Javascript not working.

Post by ivyleaf on May 2nd 2018, 4:45 am

In Javascript, I have codes for Immediate Redirection (after a message or post), Word Counter, Copy Code, Topic Preview, and Personalized Color Palette, all of which are from this forum except for perhaps the Copy Code. I didn't make any changes to the original Javascript. I don't think CSS should affect this, and I haven't really done much there at all, but the code's in the spoiler. I haven't made any other changes elsewhere with code.

Spoiler:
Code:
/*-----HIDDEN THINGS-------*/
a.mainmenu[href="/calendar"] {
display: none;
}

a.mainmenu[href="/gallery"] {
display: none;
}

a.mainmenu[href="/groups"] {
display: none;
}

a.mainmenu[href="/portal"] {
display: none;
}

a.mainmenu[href="/private messages"] {
background: url("http://i45.servimg.com/u/f45/15/95/60/34/glitte10.gif");
}

#fa_share, #fa_search {
visibility:hidden!important;
}

/*------USERNAME EFFECTS------*/
a[href="/g1-administrators"] {
text-decoration: none !important; 
text-shadow: 0 0 0.3em #D4F7F7, 0 0 0.3em #D4F7F7, 0 0 0.3em #D4F7F7;
}

a[href="/u1"] {
text-decoration: none !important; 
text-shadow: 0 0 0.3em #D4F7F7, 0 0 0.3em #D4F7F7, 0 0 0.3em #D4F7F7;
}

/*-------TOOLBAR-------*/
#fa_toolbar {
    background-color: transparent !important;  /* Make the main toolbar bg transparent */
}

#fa_right {
    padding-left: 10px;  /* Left padding */
    padding-right: 10px;  /* Right padding */
    position: relative;  /* Position of the toolbar */
    right: 20px;  /* Décale la toolbar de la droite */
}
 
#fa_left {
    position: relative;  /* Position of the toolbar */
    left: 20px;  /* Spacing to the left of the toolbar */
    margin-top: -1px;  /* Small -1px correction : may depend on your forum (can be changed) */
    padding-left: 10px;  /* Left padding */
    padding-right: 10px;  /* Right padding */
}

/* Color palette icons */
.color-option {
  display: inline-block !important;
  width: 15px !important;  /* width of the icon */
  height: 15px !important;  /* height of the icon */
  border: 2px solid #fff !important;  /* white border around the icon */
  margin: 3px !important;  /* space between each icon */
  box-shadow: 0 0 2px #778899;  /* shadow */
  cursor: pointer !important;
}
 
.color-option span{
  display: block !important;
  width: 15px !important;  /* width of the icon */
  height: 15px !important;  /* height of the icon */
}
 
.color-option, .color-option span {
  border-radius: 2px;  /* roundness */ 
}
 
/* Whole palette - the width influences how many icons appear */
.sceditor-dropdown.sceditor-color-picker {
  width: 200px !important;  /* width of the palette */
  height: 100px !important;  /* height of the palette */
  padding: 5px !important;
  border-radius: 5px !important;
}

Edit; Never mind, the 'Copy Code' function seems to be working on all the forums necessary when I tried it on other sections of the forum. Will be marking as solved, though I still don't understand why it only works in some forums.
avatar
ivyleaf
New Member

Posts : 19
Reputation : 1
Language : English, Mandarin
Location : Taiwan

http://bioluminessence.forumotion.com/

Back to top Go down

Solved Re: 'Copy Code' Javascript not working.

Post by SLGray on May 2nd 2018, 8:32 am

Wait a minute!  Is the issue happening in the Your First Subject topic?  I see that it looks like a quote, not a code box.



When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
avatar
SLGray
Administrator
Administrator

Male Posts : 44556
Reputation : 3158
Language : English
Location : United States

http://fmthemesdesignteam.forumotion.com/

Back to top Go down

Solved Re: 'Copy Code' Javascript not working.

Post by ivyleaf on May 2nd 2018, 10:21 am

Oh, you're right! Huh, can't believe I didn't notice that sooner, thanks for letting me know;;

Do you know why the Copy Code text appears there, though, and if there's any way to get rid of it?
avatar
ivyleaf
New Member

Posts : 19
Reputation : 1
Language : English, Mandarin
Location : Taiwan

http://bioluminessence.forumotion.com/

Back to top Go down

Solved Re: 'Copy Code' Javascript not working.

Post by SarkZKalie on May 2nd 2018, 11:21 am

Could you please provide a test account so i / we can login it and find out your problem?

P/S : Too lazy to be a member Twisted Evil


avatar
SarkZKalie
Support Moderator
Support Moderator

Male Posts : 968
Reputation : 159
Language : English

http://rotavn.forumotion.com

Back to top Go down

Solved Re: 'Copy Code' Javascript not working.

Post by ivyleaf on May 2nd 2018, 1:21 pm

One has been made - login information is located in the Announcement test thread.
avatar
ivyleaf
New Member

Posts : 19
Reputation : 1
Language : English, Mandarin
Location : Taiwan

http://bioluminessence.forumotion.com/

Back to top Go down

Solved Re: 'Copy Code' Javascript not working.

Post by Luffy on May 2nd 2018, 2:28 pm

Hello @ivyleaf,

It seems that your quotes have the class
Code:
codebox
which is why the Copy Code appears there. Have you changed the blockquote appearance?
avatar
Luffy
Manager
Manager

Male Posts : 5778
Reputation : 647
Language : Greek, English
Location : Cyprus, Greece

https://www.crossroadz.net

Back to top Go down

Solved Re: 'Copy Code' Javascript not working.

Post by ivyleaf on May 2nd 2018, 5:23 pm

No, I have not. What should I change and where?
avatar
ivyleaf
New Member

Posts : 19
Reputation : 1
Language : English, Mandarin
Location : Taiwan

http://bioluminessence.forumotion.com/

Back to top Go down

Solved Re: 'Copy Code' Javascript not working.

Post by SLGray on May 2nd 2018, 7:05 pm

You did say that you have modified some templates.  Which ones did you modify?



When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
avatar
SLGray
Administrator
Administrator

Male Posts : 44556
Reputation : 3158
Language : English
Location : United States

http://fmthemesdesignteam.forumotion.com/

Back to top Go down

Solved Re: 'Copy Code' Javascript not working.

Post by SarkZKalie on May 2nd 2018, 8:59 pm

It worked fine for me. So i can say something that :
- Any script put 'in the all page' will be merged into an only one js file, problem could be start from here. I mean a conflict between other js.
Code:
http://bioluminessence.forumotion.com/t3-announcement-test#4
However the 'preview topic' didn't work and I would like to suggest you to change your current viewtopic_body template by this one
- First of all, search and locate this line in your current template
Code:
<tr class="post post--
- Replace by
Code:
<tr id="previewr" class="post post--
- Next step, search and locate this line in your current preview post javascript
Code:
.attr('href')+' .post:eq(0)');
- Replace by
Code:
.attr('href')+' #previewr:eq(0)');

LIVE DEMO

Put the script 'in the sub-forums' do work in blog mode.

P/S: Sorry for my bad English


Last edited by SarkZKalie on May 3rd 2018, 8:13 am; edited 1 time in total (Reason for editing : Wrong text)
avatar
SarkZKalie
Support Moderator
Support Moderator

Male Posts : 968
Reputation : 159
Language : English

http://rotavn.forumotion.com

Back to top Go down

Solved Re: 'Copy Code' Javascript not working.

Post by Luffy on May 2nd 2018, 10:54 pm

@SarkZKalie the problem is that the tutorial makes the "Copy Code" appear on Quotes as well. It was working fine to the Codeboxes. Wink
avatar
Luffy
Manager
Manager

Male Posts : 5778
Reputation : 647
Language : Greek, English
Location : Cyprus, Greece

https://www.crossroadz.net

Back to top Go down

Solved Re: 'Copy Code' Javascript not working.

Post by ivyleaf on May 3rd 2018, 1:45 am

1) I'd been mistaken and edited to say so. No templates have been modified to my memory, besides what SarkZKalie advised me to do just now.
2) Thanks so much for your help, it works great now! And yes, the issue Luffy mentioned is what I'm trying to figure out right now.
avatar
ivyleaf
New Member

Posts : 19
Reputation : 1
Language : English, Mandarin
Location : Taiwan

http://bioluminessence.forumotion.com/

Back to top Go down

Solved Re: 'Copy Code' Javascript not working.

Post by SarkZKalie on May 3rd 2018, 8:21 am

Ah, I didn't see the 'quote content' Very Happy but I got the same issue when installing that copy code to my test site.

@ivyleaf have you tried to set its placement this tutorial to 'in the topics' only? Remember, turn off or remove previous copy code before installing a new one.


avatar
SarkZKalie
Support Moderator
Support Moderator

Male Posts : 968
Reputation : 159
Language : English

http://rotavn.forumotion.com

Back to top Go down

Solved Re: 'Copy Code' Javascript not working.

Post by ivyleaf on May 4th 2018, 1:49 am

Oh, that actually works perfectly, thanks! I think that's all my problems actually solved now, heh.
avatar
ivyleaf
New Member

Posts : 19
Reputation : 1
Language : English, Mandarin
Location : Taiwan

http://bioluminessence.forumotion.com/

Back to top Go down

Solved Re: 'Copy Code' Javascript not working.

Post by SarkZKalie on May 4th 2018, 9:52 am

You're welcome, friend


avatar
SarkZKalie
Support Moderator
Support Moderator

Male Posts : 968
Reputation : 159
Language : English

http://rotavn.forumotion.com

Back to top Go down

Solved Re: 'Copy Code' Javascript not working.

Post by SLGray on May 4th 2018, 12:18 pm

Problem solved & topic archived.
Please read our forum rules:  ESF General Rules



When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
avatar
SLGray
Administrator
Administrator

Male Posts : 44556
Reputation : 3158
Language : English
Location : United States

http://fmthemesdesignteam.forumotion.com/

Back to top Go down

Back to top


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