Aqua-Soft Forums: Problem with web addresses - Aqua-Soft Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Problem with web addresses Rate Topic: -----

#1 User is offline   gagabriel Icon

  • Group: Member
  • Posts: 56
  • Joined: 14-June 06

Posted 14 October 2006 - 06:26 AM

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


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



setting %Username%=external, %Password%=php, everything is OK.
Am i right? Or it has to do with sth else?
0

#2 User is offline   AndreasV Icon

  • Group: Developers
  • Posts: 2,137
  • Joined: 22-November 03

Posted 14 October 2006 - 08:19 AM

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.
0

#3 User is offline   gagabriel Icon

  • Group: Member
  • Posts: 56
  • Joined: 14-June 06

Posted 14 October 2006 - 01:38 PM

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

#4 User is offline   AndreasV Icon

  • Group: Developers
  • Posts: 2,137
  • Joined: 22-November 03

Posted 14 October 2006 - 03:11 PM

	<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();
0

#5 User is offline   gagabriel Icon

  • Group: Member
  • Posts: 56
  • Joined: 14-June 06

Posted 14 October 2006 - 05:23 PM

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

#6 User is offline   pcm Icon

  • Group: Member
  • Posts: 617
  • Joined: 02-May 05

Posted 15 October 2006 - 01:41 PM

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
0

#7 User is offline   gagabriel Icon

  • Group: Member
  • Posts: 56
  • Joined: 14-June 06

Posted 15 October 2006 - 02:18 PM

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

#8 User is offline   gagabriel Icon

  • Group: Member
  • Posts: 56
  • Joined: 14-June 06

Posted 17 October 2006 - 12:21 AM

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="%SiteAddress%" 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="Gmail_stamp.png" fontalign="LT"/>
	  <layer name="Gotolink" x="0" y="0" width="128" height="100" src="!HITSPOT"  mousecursor="IDC_HAND" onclick="GoToLink()"/>
	  <layer name="FrontFlip" x="110" y="93" width="13" height="13" src="flipit.png" 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="Mark1.png" 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="!XMLTXT:[//fullcount]" 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="backside.png" mousecursor="crDefault" fontstyle="" fontalign="LT" fontaa="No"/>
	  <layer name="BackFlip" x="187" y="170" width="55" height="25" src="done.png" dsrc="done_pressed.png" onclick="ApplySettings();" mousecursor="crDefault" fontstyle="" fontalign="LT" fontaa="No" fullhittest="yes"/>
	  <layer name="Msg1" x="25" y="19" width="230" height="20" src="!TXT:Username:" fontname="Lucida Sans Unicode" fontsize="12" fontcolor="clWhite" fontalign="M"/>
	  <layer name="Box1" x="25" y="42" width="220" height="20" src="box.png" fontalign="LT"/>
	  <layer name="Msg3" x="25" y="65" width="230" height="20" src="!TXT:Password:" fontname="Lucida Sans Unicode" fontsize="12" fontcolor="clWhite" fontalign="M"/>
	  <layer name="Box3" x="25" y="88" width="220" height="20" src="box.png" fontalign="LT"/>
	  <layer name="Msg2" x="25" y="130" width="230" height="20" src="!TXT:Refresh delay in mins.:" fontsize="14" fontcolor="clWhite" fontalign="LT"/>
	  <layer name="Box2" x="190" y="128" width="50" height="20" src="box.png" 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);
}

0

#9 User is offline   gagabriel Icon

  • Group: Member
  • Posts: 56
  • Joined: 14-June 06

Posted 24 October 2006 - 01:58 PM

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!!
0

#10 User is offline   pcm Icon

  • Group: Member
  • Posts: 617
  • Joined: 02-May 05

Posted 25 October 2006 - 12:45 PM

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.
0

#11 User is offline   gagabriel Icon

  • Group: Member
  • Posts: 56
  • Joined: 14-June 06

Posted 25 October 2006 - 02:07 PM

No problem!! Thanks very much!!
0

#12 User is offline   pcm Icon

  • Group: Member
  • Posts: 617
  • Joined: 02-May 05

Posted 28 October 2006 - 10:00 PM

You should be using this for your site address.

https://%Username%:%.../mail/feed/atom
0

#13 User is offline   gagabriel Icon

  • Group: Member
  • Posts: 56
  • Joined: 14-June 06

Posted 29 October 2006 - 01:32 AM

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
0

#14 User is offline   pcm Icon

  • Group: Member
  • Posts: 617
  • Joined: 02-May 05

Posted 29 October 2006 - 01:33 PM

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
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic