XWidgetSoft Forum

XWidget & XLaunchpad , Desktop customization
It is currently May 10th, 2025, 11:41 am

All times are UTC - 8 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: August 3rd, 2013, 4:22 pm 
Offline
User avatar

Joined: July 29th, 2013, 9:13 am
Posts: 609
Is it possible to include any other file containing javascript code?

include("vitality.js");
include("volume.js");
include("functions.js");


Last edited by yereverluvinuncleber on August 8th, 2013, 8:00 am, edited 2 times in total.

Top
 Profile  
 
PostPosted: August 6th, 2013, 6:33 am 
Offline
User avatar

Joined: July 29th, 2013, 9:13 am
Posts: 609
It would be nice to get an answer to this one, so I am assuming this function does not exist and that I need to pull all the code into one file, script.js.

If this is the case then I'd make it a feature request to 'include' this functionality. Each included script file would appear in a tab in the editor window.


Top
 Profile  
 
PostPosted: September 22nd, 2013, 11:04 pm 
Offline
User avatar

Joined: March 8th, 2013, 10:27 pm
Posts: 353
Possible but not as straightforward as you describe here. include() is not supported in MS Script Host. See MSDN for more details about that.
However, it may be possible by adding the references to the script file in the widget xul (main.xul) file. The XUL file format allows that. Simply open up the file in a text editor and add your script file(s).
Code:
<script src="somefile.js"/>


However, I've never tested this and this feature depends on the XWidget XUL parser. Hope it helps! :)

_________________
Life is a myriad game... Just play it!


Top
 Profile  
 
PostPosted: September 23rd, 2013, 4:10 am 
Offline
User avatar

Joined: May 12th, 2012, 8:32 pm
Posts: 594
yereverluvinuncleber wrote:
It would be nice to get an answer to this one, so I am assuming this function does not exist and that I need to pull all the code into one file, script.js.

If this is the case then I'd make it a feature request to 'include' this functionality. Each included script file would appear in a tab in the editor window.



Hi, you can check this TODOList widget, it's script add two js files: http://www.xwidget.com/xwidget/widgets/ ... 2/421.html
put this code at first line of script:
Code:
eval(readFile(WidgetPath + "other_script.js"));

_________________
XWidget Software Developer
[XWidget for Android] [Lastest version of XWidget] [Lastest patch of XWidget]
[XDesktop for Android/Windows]


Top
 Profile  
 
PostPosted: September 23rd, 2013, 11:48 am 
Offline
User avatar

Joined: July 29th, 2013, 9:13 am
Posts: 609
Thanks ever so - it will really simplify some of my code to allow .js inclusion - will give it a try and let you know how I get on.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: Bing [Bot] and 48 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Powered by phpBB® Forum Software © phpBB Group