- Posts: 256
- Thank you received: 37
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
insert javascript code in admin page
- first
- Topic Author
- Offline
- Elite Member
Less
More
7 years 9 months ago - 7 years 9 months ago #137606
by first
Survey Designer and Programmer
insert javascript code in admin page was created by first
Hi , I am insert some javascript code the source code of admin page. Please let me know which file I can place this code in or any other way to do this.
Admin page:
Admin page:
Survey Designer and Programmer
Last edit: 7 years 9 months ago by first.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10635
- Thank you received: 3699
7 years 9 months ago #137608
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic insert javascript code in admin page
LS version?
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- first
- Topic Author
- Offline
- Elite Member
Less
More
- Posts: 256
- Thank you received: 37
7 years 9 months ago #137651
by first
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13935
- Thank you received: 2551
7 years 9 months ago #137658
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic insert javascript code in admin page
In 2.06 : you need to use afterPluginLoad
See framagit.org/SondagePro-LimeSurvey-plugi...eUpdateAdmin.php#L34
In 2.50 or LimeSurvey-SondagesPro
It's better to use manual.limesurvey.org/BeforeControllerAction (because it happen only for web, and it's more easy to fn the admin controller).
Denis
See framagit.org/SondagePro-LimeSurvey-plugi...eUpdateAdmin.php#L34
In 2.50 or LimeSurvey-SondagesPro
It's better to use manual.limesurvey.org/BeforeControllerAction (because it happen only for web, and it's more easy to fn the admin controller).
Denis
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10635
- Thank you received: 3699
7 years 9 months ago - 7 years 9 months ago #137666
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic insert javascript code in admin page
In 2.50, you can do it in your own admin template without the need for a plugin.
1) Copy one of the templates from /styles to /upload/admintheme/ and rename it (let's say "yourTheme").
2) Add a custom.js file to /upload/admintheme/yourTheme/scripts/
3) Modify /upload/admintheme/yourTheme/config.xml as follows:
- Change the name, description and any other <metadatas> you see fit
- Modify the <js> files to include your new custom.js
4) Switch Global settings --> General --> Administration template to "yourTheme"
1) Copy one of the templates from /styles to /upload/admintheme/ and rename it (let's say "yourTheme").
2) Add a custom.js file to /upload/admintheme/yourTheme/scripts/
3) Modify /upload/admintheme/yourTheme/config.xml as follows:
- Change the name, description and any other <metadatas> you see fit
- Modify the <js> files to include your new custom.js
Code:
<js> <filename>notify.js</filename> <filename>save.js</filename> <filename>panelclickable.js</filename> <filename>panelsanimation.js</filename> <filename>sidemenu.js</filename> <filename>bootstrap-switch.min.js</filename> <filename>jquery.jcarousel.min.js</filename> <filename>jcarousel.responsive.js</filename> <filename>custom.js</filename> </js>
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 7 years 9 months ago by tpartner.
The following user(s) said Thank You: DenisChenu
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13935
- Thank you received: 2551
7 years 9 months ago #137671
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic insert javascript code in admin page
Thanks Tony, didn't know that
Did you start a own admin template ?
Denis
Did you start a own admin template ?
Denis
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10635
- Thank you received: 3699
7 years 9 months ago #137681
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic insert javascript code in admin page
Yes, I use my own admin template in all versions of LS to do things like hide elements that I don't use very often, resize textareas, etc.
The ability to insert JavaScript is a huge plus.
The ability to insert JavaScript is a huge plus.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13935
- Thank you received: 2551
7 years 9 months ago #137685
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic insert javascript code in admin page
I like to do it in an external plugin for some fix : then no need to update when core template have fix
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10635
- Thank you received: 3699
7 years 9 months ago - 7 years 9 months ago #137765
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic insert javascript code in admin page
Playing around with
Denis' suggestion for LS 2.06
(mostly cutting and pasting ), I have come up with this small plugin that inserts a custom JavaScript file in the admin interface.
Ta-da! Now you have a custom JS file to play with.
Plugin File:
- Create your own admin template - in /styles/, copy and rename one of the core admin templates
- In Global settings --> General, activate that template
- Add a custom JavaScript file to your new template directory
- Extract the attached "insertAdminJS" plugin folder in your /plugins directory
- In Plugin manager, activate the "Insert Custom Admin JS File" plugin
- If you have named your custom JS file something other than "custom.js", go to the plugin settings and enter the filename
Ta-da! Now you have a custom JS file to play with.
Plugin File:
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Attachments:
Last edit: 7 years 9 months ago by tpartner.
The following user(s) said Thank You: DenisChenu, Ben_V
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13935
- Thank you received: 2551
7 years 9 months ago - 7 years 9 months ago #137770
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic insert javascript code in admin page
Quick updated version for 2.50 :
framagit.org/Shnoulle/insertAdminJS/comm...2a6925043690531385ae
Less issue with command.
Seems strange but i need to add "/" for the url : a difference betwwen 2.06 and 2.50.
Next step : a js file + css file editor and save it in plugiun directory, register with assets
Less issue with command.
Seems strange but i need to add "/" for the url : a difference betwwen 2.06 and 2.50.
Next step : a js file + css file editor and save it in plugiun directory, register with assets
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Last edit: 7 years 9 months ago by DenisChenu. Reason: Next step
The topic has been locked.