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

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")

Related

JSON Error: Files or directories outside directory

I tried to submit an Edge extension. It is a simple extension that had three files: the manifest.json, background.js, and an icon.
When I sideload it in Edge, it works. When I tried to publish it, I got an error that says, Files or directories outside directory.
I have looked everywhere for documentation on what the folder directory should look like. Can someone point me to an example directory? Should there be more folders?
The solution was to create a zip file in another way. I found an online site, but if this was something important, I would find another computer.
Anyway, it seems that Big Sur adds something extra that MS doesn't like. Strange Google accepts it.

Firefox Addon SDK Error - Module `project/tests/myjs` is not found at resource

As I progressed with my Firefox Addon development, I wanted to restructure into logical folder structures. And for the need, I thought of keeping some .js files under a directory called "tests", the moment I try to load by adding require('tests/myjs.js'), I am thrown with an error as below:
Message: Module myproject/tests/myjs is not found at resource://jid1-sdfe4541dfsafssdfewf45fa-at-jetpack/myproject/tests/myjs.js
Tried numerous attempts as I did not notice any difference than what was mentioned in official document - it always ended in failure and no much results online. It always worked when placed next to main.js on the same directory, but failed when in the sub directory.
Not sure if it is a bug or designed that way, but undocumented. The solution was to rename the folder. As a brute force way, just renamed the "tests" folder to something else, it worked. Worked with various folder names, but did not work with the folder name "tests".
If anyone knows why, would be better to share. Otherwise, I have my solution anyway.

OpenLayers that is not minified?

I'm trying to find an OpenLayers3.js file that is not minifed, it is a pain debugging stuff that is minified, can anyone help me find it?
Im using this address now: http://openlayers.org/en/v3.0.0/build/ol.js
By the way, it is a special thingy at the top. See the website: http://ol3.js.org/ ? Made me laugh.
Help?
If you need the unminified ol, you can use the one from ol:
http://openlayers.org/en/v3.0.0/build/ol-debug.js
It's a file of 3.5M so don't use this in production ;)
Have you tried the Download link on the main page?
https://github.com/openlayers/ol3/releases/download/v3.0.0/v3.0.0.zip
If you want a hosted version, upload one here:
https://cdnjs.com
Yes, http://openlayers.org/en/v3.0.0/examples/loader.js will load all the raw files -- basically by writing out a bunch of script tags. As #lexicore has already said, you can get the source from github, though this involves setting up nodejs locally to run (which actually isn't that painful, but more so than just debugging from a hosted source). Take a look at package.json to get a feel for how much has gone into OpenLayers 3.
If you go to the OpenLayers 3 examples, for example animation, change production to development in the drop down, and then do view source, you will get the link above. You can also see all the raw js files in the Javascript console.
EDIT: I put some instructions, following the official OL dev page, on how to build/run locally, which will also get you the unminified OL source code

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!

Absolute paths in PhoneGap

My situation is the following:
I have an index.html and some JavaScript that loads HTML snippets from the server. Inside these snippets, I have some URLs to images like
/some/folder/picture.jpg
Of course these do not work in PhoneGap. Weinre tells me that PhoneGap is trying to load the picture from
file:///some/folder/picture.jpg
Any ideas how to solve this? I was thinking about something like a base href, or some configuration in PhoneGap where one could specify a root path, but I did not find anything like that ...
Thanks,
Michael
I had the same problem especially when you have a lot of views (pages) and want to load one from a menu, yet you are at an unknown location.
The simple work around is to use the window.location object.
window.location.href.split('www')[0] + 'www'
This gives you the absolute URL to your 'base'. The www is the folder which is relevant for IOS and Android, so this also makes your app compatible in multiple platforms.
From this you can use a regular expression which passes the entire doc like jquery mobile does with data-* attributes to describe their elements. You simply replace the regular expression with the path returned. You'll want to do this during initialisation otherwise it will create a massive bottle neck.
Hope this helps and is along the lines of what you're looking for.
Cheers,
Sententia
You can't do that with a <base> because / is always host-relative — it can't be redefined to be in a subdirectory. You have two options:
rewrite your HTML to use fully relative paths like ../../some/folder/picture.jpg (or have something do the rewrite for you as a build step), or
alter the "browser" (PhoneGap's wrapper) so that it loads URLs differently.
I'm not familiar with PhoneGap so I can't comment on automatic options, but I personally would start using relative URLs.

Resources