0

Include javascript files (like themes)

asked 2007-08-20 15:31:16 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4474201

By: dastultz

Hi, how can I add my own JavaScript files to all pages. I'm looking for the equivalent to <desktop-config>
<theme-uri>mytheme.css</theme-uri>
</desktop-config>
for JavaScript.

Thanks.

-Daryl

delete flag offensive retag edit

8 Replies

Sort by ยป oldest newest

answered 2007-08-21 01:31:38 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4475517

By: waterbottle

Hi,
ZK hasn't supported this feature, please post to feature request.
by the way, you can modify the desktop.dsp and add your javascript declaration, it's a template for every desktop.

/Dennis.


link publish delete flag offensive edit

answered 2007-08-21 06:19:52 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4475721

By: jumperchen

Hi Dary,

You can specify the <javascript> in the lang-addon.xml and it will be used in this application.

/Jumper

link publish delete flag offensive edit

answered 2007-08-21 15:54:56 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4476615

By: dastultz

Ok, I'm not sure whom to believe... :-)

Jumper, could you give an example? I tried putting the line in these 2 forms at the top of my lang-addin.xml but it doesn't work:

<javascript>myfile.js</javascript> (throws EL exception)

<javascript name="myfile.js" /> (no error, but not in HTML)

Thanks.

link publish delete flag offensive edit

answered 2007-08-21 16:19:12 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4476662

By: dastultz

Got it:

This works:
<?xml version="1.0" encoding="UTF-8"?>
<language-addon>
<javascript src="myfile.js" />
...


link publish delete flag offensive edit

answered 2007-08-22 00:52:14 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4477577

By: waterbottle

Hi, Daryl.
Jumper's reply is the right solution. :) modify desktop.dsp is not usual case.. please forget what I said..

/Dennis



link publish delete flag offensive edit

answered 2007-08-22 01:25:48 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4477606

By: jumperchen

Hi,
Here is my example,

lang-addon.xml
<language-addon>
<!-- The name of this addon. It must be unique -->
<addon-name>zkdemo</addon-name>

<!-- Which language this addon will be added to -->
<language-name>xul/html</language-name>
<javascript src="/js/test.js" charset="UTF-8"/> </language-addon>

The test.js is put under WebContent/js/ directory.

And then you will see it in the html source as below.

<script type="text/javascript" src="/zkdemo-all/js/test.js" charset="UTF-8"> </script>

Regards,
Jumper

link publish delete flag offensive edit

answered 2013-03-07 07:26:53 +0800

safina144 gravatar image safina144
6

zk support but need to modify zk.xml, then it will be work <language-config> <addon-uri>/WEB-INF/lang-addon.xml</addon-uri> </language-config>

link publish delete flag offensive edit

answered 2013-03-07 07:27:13 +0800

this post is marked as community wiki

This post is a wiki. Anyone with karma >100 is welcome to improve it.

updated 2013-03-07 07:27:13 +0800

safina144 gravatar image safina144
6

zk support but need to modify zk.xml, then it will be work <language-config> <addon-uri>/WEB-INF/lang-addon.xml</addon-uri> </language-config>

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2007-08-20 15:31:16 +0800

Seen: 749 times

Last updated: Mar 07 '13

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More