Using a cache manifest in a PhoneGap app - ios

I have a typical phone gap application with an index.html and assorted other .js and .css files in the /www folder.
Now, how should I go about updating these javascript/css files? (Other than pushing a new app). I thought I might use a cache manifest, but that requires them to be on the same domain so I don't think that will work...
The only thing I can come up with is source online copies of the scripts after the local ones, overriding all the function definitions in the local file, but that seems really lame.
<script src="script.js"></script>
<script src="http://online.com/script.js></script>

put your code won googlecode.com , update your javascripts there , link your app add the external host in your phonegap.plist to match *.googlecode.com and alter your code in there, it will automatically update the app with the new one

Related

having external files in an electron application

I have an electron app, and when I make it, it packages and compiles everything.
Sounds like it works perfectly right?
Well, problem is I want one of the folders to not be compiled, but still be accessible by my static files, so the users can add or remove content from the folders.
I've tried making it in a seperate folder, but then it can't find the files even when it's placed in the correct relative path.
Overall, I want my app to exist next to a folder and my <script src="./folder/script.js"></script> to actually be able to access it.
I'm new to basically anything node or electron so i'm probably making some dumb mistake.
Thanks in advance.
Having your user touching files close to your Electron application may be fraught with danger. If they accidently overwrite an important file or accidently delete an important file then your application may stop working and require the user to perform a re-install.
Instead, have any default files the user may need to "touch" packaged up with your application and then upon your applications first run, copy these files (and any necessary folder structure) over to the users home, desktop, documents, downloads or even userData directory.
That way, your application will always know where to find them and the directory is a directory your user will already be comfortable adding files to and removing files from.
You can always let the use choose where these files are stored as a settings option which persists in an application setting file, using something similar to path.join(app.getPath('userData'), 'settings.json');
See Electron's app.getPath(name) for more information.

Expire updated CSS and JS files

We have a site (MVC4 on Azure) on which we change our JS an CSS files occasionally. The updates are not scheduled and some times - quite often. I don't want to go into IIS and change settings or work with header files that have countless references to files and dates.
Currently, we are changing the file names but you can imagine how much work it requires.
Some time ago I read that we can expire these files on demand by keeping the file names of the files that change often in one file and whenever anything on that file changes, the browser is forced to reload those files.
Is this something I should do and how?
You can simply add version numbers to files that changed. You can read the actual version with php, and append it to the modified filenames automatically.
Version sample code:
<link rel="stylesheet" type="text/css" href="style.css?v=12345678" />
This forces the browser to download the files again.

Classic ASP: URL issues when duplicating an application

I have an old Classic ASP application that I want to duplicate in parallel - that is, I want to configure another copy (talking to a different database) alongside the original.
So where I have //MyServer/MyApp1/, I will also soon have //MyServer/MyApp2/... so far so good.
Except that many URLs in the app are absolute (for example JS and CSS files), e.g. <script type="text/javascript" src="/MyApp1/menu.js"></script>.
I could search for references to /MyApp1/ and replace it with /MyApp2/, but it's an annoying task that I will have to repeat as I update the core application, and in the event of wanting other copies creating - a likelihood albeit temporary.
I could change these URLs to parent paths, but this means I need to refer to each resource differently, depending on where in the application folder structure I am. Again, it would work, but I don't like using parent paths for a number of reasons.
Given that there is no tilde (~) feature in Classic ASP (to refer to the application root), are there any alternatives that I can consider?
#CJM: I usually have a db.asp which contains the functions and subs that handle opening/closing database connections as the primary include on practically all of my pages. In this db.asp I would then define a appurl or absurl path which could, in your case, have /MyApp1, and then you can use <script type="text/javascript" src="<%=appurl %>/menu.js"></script> in your scripts.
The first time you do it, it'll be a bit of a search/replace mission, but once it's done, subsequent "duplicate" projects will just need that one variable updated.
In Classic ASP, You can use Server.MapPath("/") to get the root directory, or Server.MapPath(".") to get the current directory.

why have most of the files in a dreamweaver site been put into a directory called 'upload'?

I cleaned up someone's style sheet for a Dreamweaver site, by editing the css directly, and now the secretary is having trouble using her old template.
Most of the files in her site reside in subdirectories of the 'upload' directory. For example, I would have expected to see the stylesheet in
../assets/css/ etc.
but in fact I'm finding it in
../upload/assets/css/ etc.
In addition to assets, I am also finding Templates and images as subdirectories of 'upload'.
Do you know why this 'upload' directory was used?
I am considering two possible approaches.
(1) Make sure everything needed is in ../upload/ and remove the subdirectories that are directly in the root directory
(2) Edit the template to remove all references to ../upload/
Note that (2) appeals to me because the file structure will be simpler; but I wonder if the client has some sort of extension in her Dreamweaver that causes everything she ftp's to be put into the 'upload' directory.
Note that so far I have copied my cleaned up css file over to ../upload/assets/ as a short-term solution. But they want to be able to make changes to their template, and add new pages, on their own in future.
Thanks.
The likely problem is how she has her FTP remote settings specified. It appears that it now points to the upload folder rather than the web root. Or, it could be that her FTP user account is tied to the upload folder rather than the web root.

Symfony admin generator generated module has no style

I am using Symfony 1.31 for a brand new project. I have just created a module in the backend app, using the admin generator. To my suprise, it seems no theme ((At all) has been applied to the pages. As I mentioned before, this si abrand new project - I have not even modified the /app/backend/layout.php file yet.
I rember having a similar problem before - I dont remmber how I solved it (I think I had to run a task or copy some files over to the /web folder before the styles/images etc came into efect. Can anyone refresh my memory?
You might need to run the plugin:publish-assets command:
php symfony plugin:publish-assets
This will create symlinks to your plugins' web/ directory inside your project's web/, thus enabling access to sfDoctrinePlugin's (or propel depending what ORM you use) admin-gen styles.
Check your apache configuration and files permissions, and especially the alias to the /sf/ subdirectory. It seems that the .css file corresponding to sf_admin pages are not accessible. You can fix it by adding an Alias to your virtualhost configuration, or allowing symlinks.
(By the way, hint: check your html source, find out the .css url, and try to access it directly with your browser)

Resources