Jump to content


Photo

UI HTML Panel Tricks and Tips


  • Please log in to reply
15 replies to this topic

#1 JohnB

JohnB

    Advanced Member

  • UBot Users
  • PipPipPip
  • 3350 posts
  • LocationNJ
  • OS:Windows 7
  • Total Memory:8Gb
  • Framework:v3.5 & v4.0
  • License:Dev

Posted 17 January 2012 - 10:57 AM

Hello everyone.

For those of you that own a dev license and make good use of the ui html panel, I have some useful information for you.

have you ever created a bot that was loaded with ui elements? Maybe to the point that space became an issue? Here is a time and space saving tip for you.

Instead of using labels to explain the purpose of of an input box, why not place the instructions inside the box? You can do this with a simple addition to the attribute area of the input box. The best part is it will be coded to clear when you click on it to insert the desired data. The code is simple and uses just a small line of javascript. Here is an example:


<input variable="#un" fillwith="value" type="text" id="username" value="Insert Username Here" size="30" onfocus="this.value='';return false;">

Now here is a little known feature:

If you have the default form fields filled out in the options section, and have used those variable names in you script, they will pre-load in the ui html panel ui elements.

John

#2 Kreatus (Ubot Ninja)

Kreatus (Ubot Ninja)

    Custombotsolutions.com

  • UBot Users
  • PipPipPip
  • 1826 posts
  • OS:Windows 7
  • Total Memory:More Than 9Gb
  • Framework:v3.5 & v4.0
  • License:Dev

Posted 17 January 2012 - 11:09 AM

Nice one John. This is helpful to reduce the size of our UI's.. Keep the tips coming. :)

#3 JohnB

JohnB

    Advanced Member

  • UBot Users
  • PipPipPip
  • 3350 posts
  • LocationNJ
  • OS:Windows 7
  • Total Memory:8Gb
  • Framework:v3.5 & v4.0
  • License:Dev

Posted 17 January 2012 - 01:11 PM

Thanks Kreatus. I will probably post some more, but you guys can actually do what I am doing...going through the entire library of free snippets. There is a TON of really cool stuff there:

http://javascriptsou...sting/?select=A

I started in A and am currently in T...there is too much to post, but there is definitely something for everyone...

A little tip:

If the code requires a .js file, you can host it remotely and it will still function in the ui html panel. Just make sure you change the path.


John

#4 sales

sales

    Member

  • UBot Users
  • PipPip
  • 18 posts

Posted 22 January 2012 - 04:48 PM

Thanks JohnB!

I have learned more from you on this forum and your videos on http://learnubot.com than anywhere else.

sales

#5 JohnB

JohnB

    Advanced Member

  • UBot Users
  • PipPipPip
  • 3350 posts
  • LocationNJ
  • OS:Windows 7
  • Total Memory:8Gb
  • Framework:v3.5 & v4.0
  • License:Dev

Posted 22 January 2012 - 04:58 PM

Thanks JohnB!

I have learned more from you on this forum and your videos on http://learnubot.com than anywhere else.

sales


Thank you sales! Posted Image

John




#6 UBotDev.com

UBotDev.com

    Advanced Member

  • UBot Users
  • PipPipPip
  • 318 posts
  • OS:Windows 7
  • Total Memory:More Than 9Gb
  • Framework:v4.0
  • License:Dev

Posted 22 January 2012 - 09:05 PM

Hey John, nice idea, but I have noticed that this stops working as soon as you use variable in code. I just added code
set(#tmp, #un, "Global")
bellow "UI HTML Node", and it stopped working...

Any idea how to solve this? I talked with Eddie about related problem, but it looks like there is no solution - ubot will always clear that value on load.

CLICK UBotDev.com to get FREE UBot Plugins!


#7 JohnB

JohnB

    Advanced Member

  • UBot Users
  • PipPipPip
  • 3350 posts
  • LocationNJ
  • OS:Windows 7
  • Total Memory:8Gb
  • Framework:v3.5 & v4.0
  • License:Dev

Posted 22 January 2012 - 09:52 PM

I'm not sure what you mean...it seems to work fine for me...

http://screencast.com/t/tLejx1iKA


John

#8 AutoIM

AutoIM

    Advanced Member

  • UBot Users
  • PipPipPip
  • 214 posts
  • LocationLake District, UK
  • OS:Windows Vista
  • Total Memory:1Gb
  • Framework:v3.5 & v4.0
  • License:Dev

Posted 23 January 2012 - 02:36 AM

Instead of using labels to explain the purpose of of an input box, why not place the instructions inside the box? You can do this with a simple addition to the attribute area of the input box. The best part is it will be coded to clear when you click on it to insert the desired data. The code is simple and uses just a small line of javascript. Here is an example:


<input variable="#un" fillwith="value" type="text" id="username" value="Insert Username Here" size="30" onfocus="this.value='';return false;">

Now here is a little known feature:

If you have the default form fields filled out in the options section, and have used those variable names in you script, they will pre-load in the ui html panel ui elements.

John


Hi John

Thanks for the tip, it's very useful. I'll start to work through the A to Z examples too.

I guess some of them can be combined with the css things I was working with here: http://ubotstudio.co...rowser-version/ too, so combining them could be very powerful.

+1 from me,

Phil

#9 UBotDev.com

UBotDev.com

    Advanced Member

  • UBot Users
  • PipPipPip
  • 318 posts
  • OS:Windows 7
  • Total Memory:More Than 9Gb
  • Framework:v4.0
  • License:Dev

Posted 23 January 2012 - 07:52 AM

I'm not sure what you mean...it seems to work fine for me...

http://screencast.com/t/tLejx1iKA


John


Hey,

The problem is that value of inuput box "Inser Username Here" disappears, when you add that second line of code. See video: http://screencast.com/t/tIDznFvp

The same thing happens if I save, close and re-open the bot. Input box will have value "Insert Username Here" just for few mili seconds, that it will get cleared by ubot.

CLICK UBotDev.com to get FREE UBot Plugins!


#10 JohnB

JohnB

    Advanced Member

  • UBot Users
  • PipPipPip
  • 3350 posts
  • LocationNJ
  • OS:Windows 7
  • Total Memory:8Gb
  • Framework:v3.5 & v4.0
  • License:Dev

Posted 23 January 2012 - 08:54 AM

I am not seeing that:

http://screencast.com/t/Hjwrwi3R

Try clicking on new in the file menu, and you probably won't see that

John

#11 UBotDev.com

UBotDev.com

    Advanced Member

  • UBot Users
  • PipPipPip
  • 318 posts
  • OS:Windows 7
  • Total Memory:More Than 9Gb
  • Framework:v4.0
  • License:Dev

Posted 23 January 2012 - 09:08 AM

I am not seeing that:

http://screencast.com/t/Hjwrwi3R

Try clicking on new in the file menu, and you probably won't see that

John


Strange, it doesnt work for me this way. :/ What happens if you save, close and reopen that bot with 2 nodes? Will it still show that value (Insert Username Here)? Here is a new video, demonstrating the issue: http://screencast.com/t/04CYSqbSFDR

CLICK UBotDev.com to get FREE UBot Plugins!


#12 Kreatus (Ubot Ninja)

Kreatus (Ubot Ninja)

    Custombotsolutions.com

  • UBot Users
  • PipPipPip
  • 1826 posts
  • OS:Windows 7
  • Total Memory:More Than 9Gb
  • Framework:v3.5 & v4.0
  • License:Dev

Posted 07 February 2012 - 12:36 PM

Here's a little trick to have tooltips on your UI's even if you only have standard license.

ui text box("<span title=\"Enter your username\">Username:", #test username)
ui text box("</span><span title=\"Enter your password\">Password:", #dsada2)

Just make sure you put the <span> ending tag to the next UI.

#13 JohnB

JohnB

    Advanced Member

  • UBot Users
  • PipPipPip
  • 3350 posts
  • LocationNJ
  • OS:Windows 7
  • Total Memory:8Gb
  • Framework:v3.5 & v4.0
  • License:Dev

Posted 07 February 2012 - 12:53 PM

Here's a little trick to have tooltips on your UI's even if you only have standard license.

ui text box("<span title=\"Enter your username\">Username:", #test username)
ui text box("</span><span title=\"Enter your password\">Password:", #dsada2)

Just make sure you put the <span> ending tag to the next UI.


Nice share! +1

John




#14 Kreatus (Ubot Ninja)

Kreatus (Ubot Ninja)

    Custombotsolutions.com

  • UBot Users
  • PipPipPip
  • 1826 posts
  • OS:Windows 7
  • Total Memory:More Than 9Gb
  • Framework:v3.5 & v4.0
  • License:Dev

Posted 29 February 2012 - 11:51 AM

<input variable="#un" fillwith="value" type="text" id="username" value="Insert Username Here" size="30" onfocus="this.value='';return false;">


Hi John, From your example code when you click on a textbox and focus on other textbox or element the initial value of that textbox will disappear. Do you know how to do something like the textboxes on this page https://www.facebook...ages/create.php that when you click on a textbox and didnt type anything there then move to another textbox the initial value will appear again.

Thanks

#15 JohnB

JohnB

    Advanced Member

  • UBot Users
  • PipPipPip
  • 3350 posts
  • LocationNJ
  • OS:Windows 7
  • Total Memory:8Gb
  • Framework:v3.5 & v4.0
  • License:Dev

Posted 29 February 2012 - 12:20 PM

I'm not sure, but I will investigate it. It certainly would make it much cooler if it's possible.


John

#16 Kreatus (Ubot Ninja)

Kreatus (Ubot Ninja)

    Custombotsolutions.com

  • UBot Users
  • PipPipPip
  • 1826 posts
  • OS:Windows 7
  • Total Memory:More Than 9Gb
  • Framework:v3.5 & v4.0
  • License:Dev

Posted 09 July 2012 - 08:58 PM

I'm not sure, but I will investigate it. It certainly would make it much cooler if it's possible.


John


Found it john. Just enter a placeholder tag.
Here's a sample below:
<input variable="#textbox" fillwith="value" type="text" name="textfield" placeholder="Enter Username" >
<br>
<input variable="#textbox" fillwith="value" type="text" name="textfield2" placeholder="Enter Password" >





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users