skin_styles.css and PNG images are not found in smart gwt - smartgwt

I specify the theme as:
my smartgwt-skins has css and images under com\smartclient\theme\enterpriseblue\public\sc\skins\EnterpriseBlue
But when I execute the code in brower, it complaints that skin_styles.css and PNG images are not found. What goes wrong?

I solved the issue by turn on the GWT debug level to "ALL" in Eclipse, then I saw the path name's capitalization is wrong. Then I renamed the module with lower cases. It works now.

Related

Active Storage: filenames with special characters

In my application, users can change the background image of a banner. They upload the file using Simple Form and Active Storage. It's working correctly but we had a user trying to upload a file name banner-website.png (2).png. The file is uploaded and saved but doesn't appear as a background image. I guess this happens because of special characters in the filename.
What is recommended to avoid such situations? Do we need to sanitize file names?
Several things to check:
Check the console and tried to view the CSS and see if the full link
is being populated? Try checking the CSS code and copy the link to
an address bar to see if the image loads from that direction.
Check the users png file to make sure its not corrupt. PNG headers that are corrupt can cause issues displaying in a website.
Check to see if your sanitizing plugin is causing an issue with that file. I have never used that one so regarding that I cannot say.
I tried uploading a file with a same name into my Rails 6 testbench (vanilla with active storage and stimulus js) and it works fine. It could be a conflicting CSS code too.
Just my 2 cents.
I've found the solution here: Rails Active Storage - Background Image invalid property?
Adding a single quote around the URL solved it.

Blink.jl load(loadjs!/loadcss!/importhtml!) functions not working correctly

I hope someone here has used the Blink.jl package for building Julia and Electron apps.
I am having problems setting up and using it, though. The issue is with all of the functions in the api provided: load/loadcss/loadjs/importhtml. They do not seem to work, or I might be doing something wrong.
For example:
loadcss!(w, "styles.css")
does not apply any of the styles in the styles files in the directory.
importhtml!(w, 'index.html')
does not display the html page stored in the local directory. The app shows a blank screen.
I might be doing something wrong as i could not find documentation on how to use the package
I think I found out why, the methods take the full path and not the relative paths, even if files are inside the same folder. So, something like this works:
loadcss!(w, "D:\project\styles.css")
but this won't work:
loadcss!(w, "styles.css")

Appcelerator App Designer assets path issue and RGBA

I have an issue with Appcelerator App Designer.
I have an image path in assets like app/assets/iphone/images/MainBG.png
In xml i need to use path like /images/MainBG.png
But App Designer set path like /iphone/images/MainBG.png that does not work when i run my app... Yes, i can change this path, but after that i cant see image in App Designer view.
And second question:
App Designer cant use alpha... Yes, i can manualy set BGcolor like rgba(150,0,0,0.5) but in App Designer view i cant see result.
Can any one help me?
Sorry for my English))
Though I have not used App Designer, but following might help you:
put all your image files in app/assets/images folder
now set path in XML like image='/images/MainBG.png'
Set background color manually, you can use following combos:
you can use backgroundColor:"#fff"
also you can use backgroundColor:"#ffffff"
this one also works backgroundColor:"white"
this one works for alpha - backgroundColor:"#abcd", in this syntax, alpha will be 'aa' & r/g/b will be bb/cc/dd.
so this one will also work for alpha - backgroundColor:"#aabbccdd", 2 digits for each alpha/red/green/blue

SproutCore IPAD

I am working on a SproutCore project. I am trying to get the site as is on the IPAD, but the CSS background images, onClick and redirect is not working on the IPAD.
Let me know any solution on this.
When developing on the iPad, I have found the following to be useful in my Buildfile:
mode :debug do
config :all, :combine_javascript => true
end
Most iOS devices tend to have difficulty loading a large number of Javascript files, and this will concatenate them all into one. This may or may not resolve your issues, but many issues manifest if you leave them as separate files.
Also, do you have any errors in the debugger that you could share? It might help us track down the issue.
For broken images/CSS after building, it's often a relative path issue.
You might want to check your CSS / image paths in your compiled CSS & index.html files.
After building the project, look inside your output directory and try the following:
Open index.html file in your browser, and see which CSS/image files are not loading correctly.
Find your index.html file and replace instances of "/static" with "static"
Find stylesheet-packed.css & stylesheet#2x-packed.css and replace instances of "/static" with "../../../static" (or whatever fixes the path in your case)
I have build.sh script to automate this and it works for me. Let me know if you want it.. Good luck!

How to add favicon in rails 3.2

I know new rails apps come with an empty favicon.ico file. I want to know how I go about adding a favicon. I know you can use the favicon_link_tag helper, but I am not sure how to populate the favicon.ico file. Do you use favicon generators? If so, which one is best?
I also want to be able to cache it, does rails do that automatically as well?
Thanks
Simply add this to the <head></head> section of your layouts:
<%= favicon_link_tag 'favicon.ico' %>
Place the favicon.ico image in /app/assets/images/ if you are using the asset pipeline, and in /public/images/ if you are not.
Also, there is a bug if using Ruby 2.0 with Rails 3.0.20 (and maybe also 3.0.x), that will throws an exception when trying to render favicon.ico.
The fix is to place the following code into application_controller.rb:
config.relative_url_root = ""
generate your favicon for example here: http://www.favicon.cc/
and put in to public/ directory
UPDATE
Favicon in public folder is not precompiled and it may be cached for a long time.
It looks like it is better to use favicon_link_tag to avoid favicon updating problems. I do not know browsers needed favicon in root. According to favicon wiki all modern browsers maintains
<link rel="shortcut icon" href="favicon path" /> (favicon_link_tag)
While all these answers are saying to create a 16x16 icon, the reality is you should be creating both a 16x16 and 32x32, in order to support retina displays. None of the online generators did a very good job with this.
On Mac, there is a great $5 app called Icon Slate, which allows you to easily create both formats in a single ICO file.
On Windows, I've used Axialis IconWorkshop with great success, but it's a much heavier-duty tool, and is significantly more expensive at about €50.
Both will create an ico file with both 16x16 and 32x32 images within it.
If you're using the asset pipeline, use the app/assets/images folder rather than /public. The number of fringe browsers that ignore the link tag is rapidly approaching zero, so jumping through hoops to accommodate them isn't worth it.
As mentioned in other answers, use this in the head to display it:
<%= favicon_link_tag 'favicon.ico' %>
I highly recommend this option. It was easy to use and free
http://converticon.com
write in application.html.haml:
= favicon_link_tag '/images/favicon.ico'
place file favicon.ico in dir:
project/public/images
You pretty much need a 16x16 pixel image file called favicon.ico and it must be available publically in the root of your site.
You can always use a major image editor to convert your logo or other image to the .ico format. There are free options like Gimp that can make such great icons based on existing image better than online icon generators.
I tried the links above and the services were not very simple to use. I find this link on another site and it copied over my .png file flawlessly and was very simple to use. I thought I would share this link too, as I think it is a better service.
http://www.chami.com/html-kit/services/favicon/
Haven't done it for years, but Gimp is capable of saving .ico files with multiple images having different sizes.
You just need to export to .ico format with some visible layers.
To generate a favicon for all platforms (not only for desktop browsers), you can use RealFaviconGenerator and the rails_real_favicon gem:
Go to RealFaviconGenerator and submit your picture. You can craft your icon, platform per platform: iOS, Android, etc.
Once your icon is ready, click the "Rails" tab to get the steps to install your favicon in your Rails project. Basically, you will be asked to:
Add the rails_real_favicon gem to you Gemfile
Create a new file named favicon.json. This file describes the icons you've just designed.
Run rails generate favicon to actually create the icons and HTML code.
Add render 'favicon' in your layouts to insert the HTML code in your pages.
The advantage of this solution is that it injects the favicon files (favicon.ico, apple-touch-icon.png, but also browserconfig.xml and manifest.json) in the asset pipeline.
Full disclosure: I'm the author of RealFaviconGenerator.
The solution I found that worked for me was to do the following:
Go to http://realfavicongenerator.net/favicon_checker and confirm you have a good favicon. If you don't, then use their tool to create one (plus many other useful and related icons). Note: this requires that you have a good icon (e.g. PNG) to use as a basis for the favicon.
Take advantage of http://realfavicongenerator.net suggestion to use ?v=version option to help defeat the browser caching issue. This helped me.
Copy the favicon.ico to public and app/assets/images. You'll only need one but if you don't know which one, copying to both places doesn't hurt...or you can experiment to see which one works - take advantage of the ?v=version to perform your test.
Add the following line in the <head></head> section of your layouts in app/views/layouts files (e.g. application.html.erb):
<%= favicon_link_tag 'favicon.ico' %>
Hopefully that provides a simple recipe. I'm sure if I missed anything, someone can and will improve on this answer.
I had a problem when I put file into /public/favicon.ico, I am using AWS EBS.
I could fix the mistake.
The better solution for me was put the file into /app/assets/images/favicon.ico and to use = favicon_link_tag 'favicon.ico'
In rails 6, simply place it inside the public folder and reload the page.

Resources