Problem with web addresses

I'm tryng to make an avescripter desklet that checks a gmail account for new messages. So i use

;https://mail.google.com/mail/feed/atom?username=%Username%&password=%Password%" save="yes" onupdate=""/>

but it doesn´t seem to work. I think it has to do with the "&", because if i adapt the desklet with this:

;http://www.aqua-soft.org/board/%Username%.%Password%?type=RSS2" save="yes" onupdate=""/>

setting %Username%=external, %Password%=php, everything is OK.

Am i right? Or it has to do with sth else?

#424253

hmmm No idea on how the XML specs define it. For a quick workaround, do:

function init()

{

var val = "https://mail.google.com/mail/feed/atom?username=" + desklet.params("Username").value + "&password=" + desklet.params("Password").value;

desklet.params("SiteAddress").default = val;

desklet.params("SiteAddress").value = val;



}

And add init(); in the XML.

#424261

Thanks!!

But where in the xml do i have to add the init(); stuff?

#424290

	<desklet>

<bindthis>false</bindthis>

<alpha>255</alpha>

<resources></resources>

<ctrlresources>Controls</ctrlresources>

<language>JScript</language>

<keypressanim>100</keypressanim>

<include>parsers/yellowpages.js</include>

<script>yp.js</script>

<oncreate>onInitDesklet()</oncreate> // this is the magic line

<onmouseenter>onDeskletEnter()</onmouseenter>

<onmouseexit>onDeskletExit()</onmouseexit>

</desklet>

init();

#424298

Great! Thank you very much! I'll try it when i return to my PC in a couple of days :(

#424318

the & in the parameter shouldn't make any difference to scripter. Where are you using the parameter? XML Source?

I want to double check if there is a bug

#424457

I'll post the code tomorrow, when i get home. But yes, I reckon i use it as the xml source.

#424463

Here is the code, it's kind of a mess 'cos it's really the first time tie i fiddle with this stuff:

Gmail.XML:

<root>
<skininfo>
<name>Gmail</name>
<author>Gabriel Guernik</author>
<notes>Check your Gmail account</notes>
<version>100</version>
<reqversion>100</reqversion>
<icon>icon</icon>
</skininfo>
<skindata>
<desklet>
<alpha>255</alpha>
<resources></resources>
<ctrlresources></ctrlresources>
<language>JScript</language>
<keypressanim>100</keypressanim>
<script>main.js</script>
<!--<onmousescroll>UpdateScrollPosition();</onmousescroll>-->
<oncreate>CreateSetup()</oncreate>
</desklet>
<sides>
<side id="0" width="128" height="128" closex="10" closey="10"/>
<side id="1" width="266" height="225" closex="10" closey="10"/>
</sides>
<xmls>
<xml src="../../unavailable.html" interval="2" usewintmp="yes" ongetdata="UpdateMails();"/>
</xmls>
<timers>
</timers>
<parameters>
<param name="SiteAddress" default="https://mail.google.com/mail/feed/atom?username=%Username%&password=%Password%" save="yes" onupdate=""/>
<param name="RefreshDelay" default="2" save="yes" onupdate=""/>
<param name="Username" default="" save="yes" onupdate=""/>
<param name="Password" default="" save="yes" onupdate=""/>
<param name="Mails" default="0" save="no" onupdate=""/>
</parameters>
<layers side="0">
<layer name="FrontBG" x="0" y="0" width="128" height="128" src="../../unavailable.html" fontalign="LT"/>
<layer name="Gotolink" x="0" y="0" width="128" height="100" src="../../unavailable.html" mousecursor="IDC_HAND" onclick="GoToLink()"/>
<layer name="FrontFlip" x="110" y="93" width="13" height="13" src="../../unavailable.html" onclick="!FLIP:1" onmouseenter="!EFFECT:SHOW,SELF,255,10,10" onmouseexit="!EFFECT:HIDE,SELF,0" mousecursor="crDefault" alpha="0" fontalign="LT" fullhittest="yes"/>
<layer name="NewMail" x="72" y="0" width="41" height="41" src="../../unavailable.html" visible="yes" fontalign="LT" />
<layer name="NroMails" x="72" y="-2" width="41" height="41" mousecursor="crDefault" fontname="Dungeon" fontsize="27" fontcolor="clWhite" fontstyle="" fontalign="CM" />
<!-- <layer name="Nro" x="22" y="22" width="100" height="41" src="../../unavailable.html" mousecursor="crDefault" fontname="Dungeon" fontsize="27" fontcolor="clWhite" fontstyle="" fontalign="CM" /> -->
</layers>
<layers side="1">
<layer name="BackBG" x="0" y="0" width="266" height="225" src="../../unavailable.html" mousecursor="crDefault" fontstyle="" fontalign="LT" fontaa="No"/>
<layer name="BackFlip" x="187" y="170" width="55" height="25" src="../../unavailable.html" dsrc="../../unavailable.html" onclick="ApplySettings();" mousecursor="crDefault" fontstyle="" fontalign="LT" fontaa="No" fullhittest="yes"/>
<layer name="Msg1" x="25" y="19" width="230" height="20" src="../../unavailable.html" fontname="Lucida Sans Unicode" fontsize="12" fontcolor="clWhite" fontalign="M"/>
<layer name="Box1" x="25" y="42" width="220" height="20" src="../../unavailable.html" fontalign="LT"/>
<layer name="Msg3" x="25" y="65" width="230" height="20" src="../../unavailable.html" fontname="Lucida Sans Unicode" fontsize="12" fontcolor="clWhite" fontalign="M"/>
<layer name="Box3" x="25" y="88" width="220" height="20" src="../../unavailable.html" fontalign="LT"/>
<layer name="Msg2" x="25" y="130" width="230" height="20" src="../../unavailable.html" fontsize="14" fontcolor="clWhite" fontalign="LT"/>
<layer name="Box2" x="190" y="128" width="50" height="20" src="../../unavailable.html" fontalign="LT"/>
</layers>
<controls side="0">
</controls>
<controls side="1">
<control name="Username" type="EDITBOX" x="27" y="43" width="210" height="23" fontname="Lucida Sans Unicode" fontsize="9" fontbg="clHighlight" fontalign="LT" value="%Username%" />
<control name="Password" type="EDITBOX" x="27" y="89" width="210" height="23" fontname="Lucida Sans Unicode" fontsize="9" fontbg="clHighlight" fontalign="LT" value="%Password%" />
<control name="RefreshDelay" type="EDITBOX" x="192" y="128" width="47" height="23" fontname="Lucida Sans Unicode" fontsize="9" fontbg="clHighlight" fontalign="LT" value="%RefreshDelay%" />
</controls>
<menus>
<menu showdefault="yes">
<menuitem name="-" type="S" />
<menuitem name="Refresh" onclick="this.Redraw();" />
<menuitem name="Update Data" onclick="this.ForceXDataFetch()" />
</menu>
</menus>
</skindata>
</root>

main.js:

// main.js

//Apply the settings
function ApplySettings(){
var UserParam = this.parameters('Username');
var UserVal = this.controls('Username');
var PassParam = this.parameters('Password');
var PassVal = this.controls('Password');
var RefreshParam = this.parameters('RefreshDelay');
var RefreshVal = this.controls('RefreshDelay');
RefreshParam.Value = parseInt(RefreshVal.Value);
if ((UserParam.Value != UserVal.Value) || (PassParam.Value != PassVal.Value))
{
UserParam.Value = UserVal.Value;
PassParam.Value = PassVal.Value;
//this.parameters('SiteAddress').Reset();
//this.xmls(0).Reset();
//ActAddress();
this.ForceXDataFetch();
GetMails();
}
this.FlipTo(0);
this.ReDraw(true);
}

//Go to the link
function GoToLink(){
var User = this.parameters('Username').Value;
var Pass = this.parameters('Password').Value;
var link = "https://www.google.com/accounts/ServiceLoginAuth?ltmpl=plnch<mplcache=2&continue=http%3A%2F%2Fmail.google.com%2Fmail%2F%3F&service=mail&rm=false<mpl=plnch&Email="+User+"&Passwd="+Pass+"&PersistentCookie=yes&rmShown=1&null=Sign+in";
if (link != '')
this.IO.ShellExecutes(link);
}

function GetMails(){
var Qmails = this.ConvertToValue('!XMLTXT:[//fullcount]');
var Nro = this.Layers('NroMails');
Nro.text = Qmails;
this.ReDraw();
}

function CreateSetup(){
//var val = "https://mail.google.com/mail/feed/atom?username=" + desklet.params("Username").value + "&password=" + desklet.params("Password").value;
//desklet.params("SiteAddress").default = val;
//desklet.params("SiteAddress").value = val;
GetMails();
}

function UpdateMails(){
GetMails();
this.ReDraw();
}

function ActAddress(){
var User = this.parameters('Username').Value;
var Pass = this.parameters('Password').Value;
var Site = this.parameters('SiteAddress');
Site.Value = this.ConvertToValue("https://mail.google.com/mail/feed/atom?username="+User+"&password="+Pass);
}

#424698

I'm really sorry for bumping, but do you have any idea what is wrong with this? what's the problem with this parameter? I'm stuck at this, and i would really like to finish his desklet and of course release it.

Thanks!!

#425983

Hi,

Sorry, I should have replied earlier.

I'll be looking at this at the end of the week. Sorry can't look at it earlier, got overloaded stuff at work. But I will look at it for sure.

#426134

No problem!! Thanks very much!!

#426145

You should be using this for your site address.

https://%Username%:%Password%@mail.google.com/mail/feed/atom

#426601

Now it's working OK!! thanks a lot! Do you hava any idea why the other way didn't work?

I mean, this format

https://mail.google.com/mail/feed/atom?user...word=%Password%

does work in a browser.

I have another question. I have to enter the password ina textfield in this desklet. Is there a way to make the password to show like ******** in this textfield?

EDITED: and sth else: about rotating a layer at runtime... is sth like this what i have to do?

CreateSetup()

.......

function CreateSetup(){

desklet.layer.item('NameOfLayer').rotation = 100;

}

_____________________________________________

EDITED 2: i've solved the above using:

desklet.Layers('NameOfLayer').rotation = 100;

The other notation does not work. Is that OK?

_____________________________________________

Thanks a lot again!

Gabriel

#426625

I don't know why it worked for your browser, I tried in firefox and IE and it didn't work for me. Maybe you had "Saved" cookies?

Ya.. you didn't put layers you only put layer. layers.item should work too.

And for password, set your control to password=yes in your xml

That should work, if it doesn't let me know and email me your desklets so I can debug.

Thanks

#426684