Welcome, Guest
Please Login or Register.    Lost Password?

Create URL Button to open a webpage?
(1 viewing) (1) Guest
Go to bottomPage: 12
TOPIC: Create URL Button to open a webpage?
#19642
Create URL Button to open a webpage? 1 Year, 2 Months ago  
Hi

I am no programmer but I have successfully managed to make adjustments to skins by trial and error and by looking at examples. I am however totally stumped on one requirement and I have been unable to find anything via my search engine.

I have a Rainlendar2 weather skin that shows weather for several days on my desktop. Sometimes I would like to access the website it gets its information from for more complete details which is not a function of this skin.

What I wish to do is add a button to the skin (worked out how to do that) which calls a specific URL and opens that link in my default browser.

Unfortunately I have no idea if this requirement is even possible and if so what the syntax needs to be

Please can anybody give me an example URL Button syntax if such an action IS possible

Many thanks
Muttley
Fresh Boarder
Posts: 15
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#19645
Re: Create URL Button to open a webpage? 1 Year, 2 Months ago  
If you have read how buttons work (from Lua script files), then, the function you're looking for is Rainlendar_Execute(url)
Jorge_Luis
Platinum Boarder
Posts: 795
graphgraph
User Online Now Click here to see the profile of this user
Gender: Male My Rainlendar Skins Location: Argentina Birthday: 03/15
The administrator has disabled public write access.
 
#19648
Re:Create URL Button to open a webpage? 1 Year, 2 Months ago  
If you use the official weather skin, you can directly click the city name, where is include a hyperlinks.
But, I remember you seems use Statica-Color skin, and I found the Statica-Color's author was seems disable this function. So, you can try to :

a) Found "weather.lua" file and open it with text-editor.

b) Found (or the similar)
-- if (link) then
-- Create a link from the title
-- title = "[" .. link .. "][" .. title .. "]]"
-- end

modify as
if (link) then
-- Create a link from the title
title = "[" .. link .. "][" .. title .. "]]"
end

c) Saved it, then refresh Rainlendar2.
anoob
Platinum Boarder
Posts: 500
graphgraph
User Offline Click here to see the profile of this user
Gender: Male Location: TaiChung, Taiwan, R.O.C. Birthday: 02/12
The administrator has disabled public write access.
I couldn't speak English! This skin released to Customize.org(Do you want it? Click Picture) Please contact me if interested: jhg5702@gmail.com
 
#19652
Re:Create URL Button to open a webpage? 1 Year, 2 Months ago  
Hi anoob & Jorge_Luis

Thanks for your help and replies. Unfortunately my programming knowledge and lack of understanding resulted in a failure on my part.

Anoob. I found the syntax (very similar but not identical) in my New_Statica weather.lua and I (literally only removed "--" where you indicated. I was however unsure if I was supposed to onlt do that or needed to enter the url where it said link etc. etc.

Unfortunately the weather widget failed to open after this. I went back into the lua and re-entered the "--" but even restoring them did not allow the weather widget to open. This confused me BUT as the weather.lua is one continuous line with tabs within it (I think) I assume I changed it somehow without realizing.

-----
Jorge_Luis, Sorry I was not specific. My understanding of button syntax was ONLY within .XML files and limited to trail & error & cut & paste.

I did not understand the extent of coding needed to implement your suggestion within the lua (but I tried and failed) AND as I have said above ANYTHING changed /added to weather.lua stops the weather widget opening


What I tried to achieve was to create a new button in weather.xml (based on the code from the dual calendar (as the star symbol seemed OK)with minor changes :
<button id="Todo List.button.add" element="bitmap.button.todo" origin="TOP-RIGHT" x="-11" y="23" action="local.msn.com/worldweather.aspx?&eid=16619" tooltip="More Weather details />

but the weather widget would not open. So I currently have:

<button id="Todo List.button.add" element="bitmap.button.todo" origin="TOP-RIGHT" x="-11" y="23" action= "" tooltip=" More Weather details " />

which allows it to open but the button of course does nothing


If it is possible to call a url from the button syntax within weather.xml then that is what I wish for and feel the easiest for me to understand and apply.

The url I wish the button to execute is NOT the same as the Weather widgets url which is
weather.msn.com/RSS.aspx?wealocations=wc:THXX0008&weadegreetype=C



------
May I ask what language the LUA and XML files are coded in. I ask because if I standard syntax is used I can try to web search and increase my minimal understanding a little (unless Rainlendar uses its own unique syntax.


Thank you both for your kind assistance
Muttley
Fresh Boarder
Posts: 15
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#19653
Re:Create URL Button to open a webpage? 1 Year, 2 Months ago  
The button will do nothing because Rainlendar can't understand an url as an action. Here you can add the Rainlendar_Execute funcion to launch the url. Also, in XML the ampersand (&) need to be "escaped" (as it is called). That means that you need to replace & to &amp;

Try this in your button code:
Code:

action="Rainlendar_Execute(http://local.msn.com/worldweather.aspx?&amp;eid=16619)"


About the programming language, the file's extensions are in fact the name of the languages: Lua (www.lua.org/about.html) and XML (eXtensible Markup Language - www.w3schools.com/xml/).
Jorge_Luis
Platinum Boarder
Posts: 795
graphgraph
User Online Now Click here to see the profile of this user
Gender: Male My Rainlendar Skins Location: Argentina Birthday: 03/15
Last Edit: 2013/07/18 10:11 By Jorge_Luis.
The administrator has disabled public write access.
 
#19656
Re:Create URL Button to open a webpage? 1 Year, 2 Months ago  
Hi Jorge_Luis,

BIG THANKS!!! ever so much. Works perfectly

Wonderfully, your explanation that "&" needed escaping with &AMP; made it that your post "killed two birds with one stone" so to speak as I had succumbed to a Text heading in another skin of "Tasks and Events" because I could not get it to accept the "&". NOW I know why! .
I guessed there was a solution but could not work it out (I did try double ampersand as I know that works in some apps - but not in xml). I now have my desired heading of "Tasks & Events"

Lua and XML are the languages. - Sheepish smile on my part

I appreciate the links which I intend to look after this reply. I am sure they will be very helpful as I like to dabble with(especially the colours sizing, layout,fonts) a couple of my skins.

I dabble because of desired operation to suit my needs AND coz I love finding out how some of the skins syntax work and I get almost as much satisfaction working on what I want as I do with the final result.
I of course appreciate people like you would do what I wanted simpler, and in minutes, whilst I have HOURS of FUN and sometimes frustration

Thanks again for your time and assistance
Best wishes
Muttley
Fresh Boarder
Posts: 15
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
Go to topPage: 12
get the latest posts directly to your desktop