Jump to content
UBot Underground

[BUY] UI HTML Transfer Between Listbox contents and save


Recommended Posts

Hi,

 

I'm looking to buy a ui html listbox implementation where I can dynamically load one listbox and be able to copy any selected contents to a second listbox.

 

I also want to be able to delete any selected entries on the second listbox and also want to save whatever entries exist on the second listbox.

 

It's probably easier to understand if you see this example:

 

Javascript Listbox Implementation

 

I will need full source code for this.

 

Please PM me with your questions and bids.

 

Thanks

 

-samcro

Link to post
Share on other sites

Its not great but it works:

on load("Bot Loaded") {
    add list to list(%Options_List_One, $list from text("Item 1,Item 2,Item 3,Item 4,Item 5", ","), "Delete", "Global")
    set(#Options_One, "<option>{$replace(%Options_List_One, $new line, "</option><option>")}</option>", "Global")
}
ui html panel("<!DOCTYPE html>
<html lang=\"en\">
  <head>
    <meta charset=\"utf-8\">
    <meta name=\"generator\" content=\"CoffeeCup HTML Editor (www.coffeecup.com)\">
    <meta name=\"dcterms.created\" content=\"Sun, 29 Sep 2013 14:24:47 GMT\">
    <meta name=\"description\" content=\"\">
    <meta name=\"keywords\" content=\"\">
    <title></title>
    
    <!--[if IE]>
    <script src=\"http://html5shim.googlecode.com/svn/trunk/html5.js\"></script>
    <![endif]-->
	<style>
	select \{width:300px; \}
	</style>
  </head>
  <body>
<select size=\"10\" variable=\"#Sel_Option_One\" onclick=\"ubot.runScript(\'Move_Option()\')\">
<optgroup fillwith=\"innerhtml\" label=\"Click to Add\" variable=\"#Options_One\"></optgroup>
</select>

<select size=\"10\" variable=\"#Sel_Option_Two\" onclick=\"ubot.runScript(\'Delete_Option()\')\">
<optgroup fillwith=\"innerhtml\" label=\"Click to Remove\" variable=\"#Options_Two\"></optgroup>
</select>


  </body>
</html>", 200)
define $Remove Empty Lines(#Text_To_Remove_Empty_Lines) {
    set(#Text_To_Remove_Empty_Lines, #Text_To_Remove_Empty_Lines, "Local")
    add list to list(%Temp_List, $list from text(#Text_To_Remove_Empty_Lines, $new line), "Delete", "Local")
    set(#Pos, 0, "Local")
    loop($list total(%Temp_List)) {
        if($comparison($list item(%Temp_List, #Pos), "=", "")) {
            then {
                remove from list(%Temp_List, #Pos)
            }
            else {
                increment(#Pos)
            }
        }
    }
    return(%Temp_List)
}
define Move_Option {
    set(#Loaded_Option, #Sel_Option_One, "Global")
    add item to list(%Options_List_Two, #Loaded_Option, "Delete", "Global")
    set(#Options_Two, "<option>{$replace($Remove Empty Lines(%Options_List_Two), $new line, "</option><option>")}</option>", "Global")
}
define Delete_Option {
    set(#Loaded_Option, #Sel_Option_Two, "Global")
    set(#Pos, 0, "Global")
    loop($list total(%Options_List_Two)) {
        if($either($comparison($list item(%Options_List_Two, #Pos), "=", #Loaded_Option), $comparison($list item(%Options_List_Two, #Pos), "=", $nothing))) {
            then {
                remove from list(%Options_List_Two, #Pos)
            }
            else {
                increment(#Pos)
            }
        }
    }
    set(#Options_Two, "<option>{$replace(%Options_List_Two, $new line, "</option><option>")}</option>", "Global")
}

Carl  :)

  • Like 1
Link to post
Share on other sites
  • 1 month later...

Here is a better solution...

ui html panel("<!DOCTYPE html>
<html lang=\"en\">
  <head>
    <meta charset=\"utf-8\">
    <meta name=\"generator\" content=\"CoffeeCup HTML Editor (www.coffeecup.com)\">
    <meta name=\"dcterms.created\" content=\"Sun, 29 Sep 2013 14:24:47 GMT\">
    <meta name=\"description\" content=\"\">
    <meta name=\"keywords\" content=\"\">
    <title></title>
    
    <!--[if IE]>
    <script src=\"http://html5shim.googlecode.com/svn/trunk/html5.js\"></script>
    <![endif]-->
	<style>
	select \{width:300px; \}
	</style>
  </head>
  <body>
  <table>
  <tr>
  <td>
<select size=\"10\" variable=\"#Sel_Option_One\" list=\"#Options_One\" list-fillwith=\"options\" >
</select>
</td>
<td>
<input type=\"button\" value=\"Load Items (Example)\" onclick=\"ubot.runScript(\'Load Items()\')\" />
<br>
<input type=\"button\" value=\"Add >>>\" onclick=\"ubot.runScript(\'Move_Option()\')\" />
<br>
<input type=\"button\" value=\"Remove\" onclick=\"ubot.runScript(\'Delete_Option()\')\" />
</td>
<td>
<select size=\"10\" variable=\"#Sel_Option_Two\" list=\"#Options_Two\" list-fillwith=\"options\" >
</select>
</td>
</tr>
</table>

  </body>
</html>", 200)
define Load Items {
    comment("Set the list options (comma delimeted)")
    set(#Options_One, "Example 1,Example 2,Example 3,Example 4,Example 5", "Global")
}
define Move_Option {
    if($contains(#Options_Two, #Sel_Option_One)) {
        then {
            alert("Option already in list!")
        }
        else if($comparison(#Options_Two, "=", "")) {
            set(#Options_Two, #Sel_Option_One, "Global")
        }
        else {
            set(#Options_Two, "{#Options_Two},{#Sel_Option_One}", "Global")
        }
    }
}
define Delete_Option {
    if($contains(#Options_Two, ",")) {
        then {
            set(#Options_Two, $replace(#Options_Two, ",{#Sel_Option_Two}", ""), "Global")
        }
        else {
            set(#Options_Two, $replace(#Options_Two, #Sel_Option_Two, ""), "Global")
        }
    }
}

Carl  :)

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...