Josh 37 Posted March 31, 2013 Report Share Posted March 31, 2013 Has anyone figured out a way to call a local css file or image to use in the ui html panel. These would be file that would be in the application folder. I know this can be done with images by converting to base64, but I'm wanting to do this by files in the application folder instead. Quote Link to post Share on other sites
AutomationNinja 194 Posted March 31, 2013 Report Share Posted March 31, 2013 I haven't actually done it, but wouldn't you just call the .css file in the app folder? Quote Link to post Share on other sites
Josh 37 Posted April 1, 2013 Author Report Share Posted April 1, 2013 I haven't figured out a way to do it. I have tried normal html to call the file directly on local machine using file: but it doesn't work. Quote Link to post Share on other sites
Twitter Dominator 125 Posted April 1, 2013 Report Share Posted April 1, 2013 css can be done but images no not yet Quote Link to post Share on other sites
AutomationNinja 194 Posted April 1, 2013 Report Share Posted April 1, 2013 You can't call images from the application folder either? So if css can be done then HOW Mr. TD? Quote Link to post Share on other sites
Twitter Dominator 125 Posted April 1, 2013 Report Share Posted April 1, 2013 I posted this in the elite group you may have seen it already but here it is again in case you missed it ui html panel("<style>{$read file("D:\\ubot stuff\\forms css3\\new css3 stuff\\css\\style.css")}</style>", 500) 1 Quote Link to post Share on other sites
AutomationNinja 194 Posted April 1, 2013 Report Share Posted April 1, 2013 Totally missed it. Thanks. Quote Link to post Share on other sites
beatngu 65 Posted April 1, 2013 Report Share Posted April 1, 2013 Great solution willy,i did not know it was possible to store local Quote Link to post Share on other sites
Josh 37 Posted April 1, 2013 Author Report Share Posted April 1, 2013 Thanks guys I will take a look at these today! Quote Link to post Share on other sites
darryl561 177 Posted April 4, 2013 Report Share Posted April 4, 2013 You can host your files inside your bot. This includes javascript, jquery, css, and images. Great to know this. Thanks willywonka. Quote Link to post Share on other sites
dankass 52 Posted May 2, 2013 Report Share Posted May 2, 2013 Thanks! This solves a few issues for me... Quote Link to post Share on other sites
dankass 52 Posted May 7, 2013 Report Share Posted May 7, 2013 You can host your files inside your bot. This includes javascript, jquery, css, and images. For the images you need to encode them to base64 with this website http://www.base64-image.de/ You need to set everything as a variable and place it on the on load command. I tried to paste the code here but the forum wouldn't let me so I had to place everything on a text file. You can download it here: http://www.ubotstudio.com/forum/public/style_images/master/attachicon.gifexample code.txt Here is the ubot file: http://www.ubotstudio.com/forum/public/style_images/master/attachicon.gifdemo ui.ubot This no longer seems to work for me in the html ui panel... Whats wierd is, it does work if I take the base64 code and put it in the html itself instead of reading in from a variable. Anybody else having this problem? EDIT: I figured out a workaround for this... if I put the entire html for the image including the img src="" into the variable it works... like so set(#encoded image, "<img src=\"data:image/png;base64,blablahblahcode" style=\"width:14px;position:relative;\">", "Global") and then of course removing the img src code from the html ui panel and just drop the variable there instead. I'm guessing maybe there is some kind of trailing space or something else messing up the base64 encoding, so wrapping it up like this would stick whatever trailing data is in there at the end of the html and not screw up the display. Hope that makes sense... Quote Link to post Share on other sites
darryl561 177 Posted May 8, 2013 Report Share Posted May 8, 2013 This no longer seems to work for me in the html ui panel... Whats wierd is, it does work if I take the base64 code and put it in the html itself instead of reading in from a variable. Anybody else having this problem? Thats strange, using the code exactly as in willywonka's example works perfectly for me. Quote Link to post Share on other sites
dankass 52 Posted May 8, 2013 Report Share Posted May 8, 2013 Thats strange, using the code exactly as in willywonka's example works perfectly for me. That is strange... To make it stranger I CAN use it as a variable in a load html window the same way he did, but I cant get it to work in the html ui without changing this. Its fine really cuz adding that extra tidbit is no big deal to make it work. Are you running 4.2.16? Only thing I can think of is we have different versions, or one of my plugins that you dont have is modifying something somehow... even tho I am not using any plugins in this code, I dunno... I got it workin anyway:) Quote Link to post Share on other sites
iDollarsteam 13 Posted May 25, 2013 Report Share Posted May 25, 2013 there is a free plugin on this forum that make the conversion for you "on the fly" so you can have the image in the install package and install it in the Application folder. It will take it from there every time you open the bot no need to convert it on that site or use third party tools, ubot can convert it using that plugin http://www.ubotstudio.com/forum/index.php?/topic/13237-free-file-management-plugin-multiple-commands-and-functions/?hl=file%20management%20plugin Quote Link to post Share on other sites
dankass 52 Posted May 26, 2013 Report Share Posted May 26, 2013 It looks like the image trick its no longer working with the latest update. I've been playing with this today and haven't been able to make it work as I did it on the example above. I had to put the whole code on the html so it could work which really sucks. Yea, it still works, try it like I posted above and include the whole <img src=""> part in the variable. I suspect there is some sort of end of line, or a space or something being appended after a variable now or something that is screwing up the base64 encoding. By including the html part, any EOL or space or whatever will now get addded to the end of the html code instead of the base64 code so it doesn't screw up the encoding part. Quote Link to post Share on other sites
newcoder 5 Posted June 17, 2013 Report Share Posted June 17, 2013 I posted this in the elite group you may have seen it already but here it is again in case you missed it ui html panel("<style>{$read file("D:\\ubot stuff\\forms css3\\new css3 stuff\\css\\style.css")}</style>", 500) what is elite group can i be part of the group too .. Quote Link to post Share on other sites
LoWrIdErTJ - BotGuru 904 Posted June 17, 2013 Report Share Posted June 17, 2013 newcoder add me emw-dgn on skypeill get you in the group. Quote Link to post Share on other sites
newcoder 5 Posted June 20, 2013 Report Share Posted June 20, 2013 newcoder add me emw-dgn on skypeill get you in the group.Thanks botguru... I just added you Quote Link to post Share on other sites
Security 17 Posted July 14, 2013 Report Share Posted July 14, 2013 You can host your files inside your bot. This includes javascript, jquery, css, and images. For the images you need to encode them to base64 with this website http://www.base64-image.de/ You need to set everything as a variable and place it on the on load command. I tried to paste the code here but the forum wouldn't let me so I had to place everything on a text file. You can download it here: http://www.ubotstudio.com/forum/public/style_images/master/attachicon.gifexample code.txt Here is the ubot file: http://www.ubotstudio.com/forum/public/style_images/master/attachicon.gifdemo ui.ubotThanks a lot for this. Quote Link to post Share on other sites
webpro 31 Posted October 17, 2013 Report Share Posted October 17, 2013 I'm trying to learn how to work with Base64 images Here's what i've done so far:1) Created a .png logo for the bot2) Uploaded it to base64-image.de and grab the long string of characters3) Created this UB code below on load("Bot Loaded") { set(#botlogo, "iVBORwblahblabhblahetc-BASE64-CODE-INSERTED-IN-HERE", "Global") } and then i'm lost. I got my UI HTML PANEL working and looking cool. It just misses some images and i don't know how to add some besides hotlinking to them which i don't want to do. Thanks Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.