How to change the default index.html file in titanium mobile web? - titanium

I would like to know how to change the default index.html file. I have created a classic project (for mobile web). In that I have created a .css file which includes my custom styles. Now I would like to include this file in index.html, so that those styles will apply on my application. But haven't seen the index.html file. After build, I am able to see this file in build folder. May I know how to update the index.html file?
Thanks in Advance,
Swathi.

Appcelerator uses XML for views, TSS for styling, and JS for controllers. Then Titanium compiles your source code into the native API (HTML for mobile web). Because you can also compile for iOS, Android, and Windows, your output is converted appropriately to your build directory. When you create a new Alloy project, you will find the default index.xml, index.tss, and index.js in the app views, styles, and controllers directories respectively. So to control index.html, edit these 3 index.* files.

Related

Shopify Use Subdirectory in Asset Folder

Instead of putting all files in a place in the asset folder, I want to use CSS files in CSS folder, JS files in js folder and images in images folder. Then Include them in the asset folder, so that I can maintain the files easily.
I know Shopify doesn't support any sub-directories within the asset folder. But is there any trick to do that?
According to a Shopify employee. This is currently not possible and the reason is due to a limitation of the CDN they use. See that post here.
Regardless, it's not good practice to have source files in the assets folder. Look into the Shopify Slate tool. It's a theme scaffold and command line interface that helps keep your project structure organized.
You can organize your assets (both CSS and JavaScript) as source files with directory structures in a manner similar to this:
styles/
global/
modules/
settings
tools/
vendor/
The command line tool takes care of compiling all the source files into one CSS/JS file! As a consequence, you don't need to worry about including the respective files with <link> or <script> tags because it's all taken care of already!
Unfortunately, this is not something currently supported by Shopify (As of 14/Sept/2017)
I tried making sub-folders both at the root of my dev theme and in the asset folder of my dev theme in a few different ways, including through Shopify's ThemeKit editor, but Shopify did not let me create the folder.
Attempting to create sub-folders in the normal theme editor in the store (by naming an asset subfolder/filename) generates the error message: Theme files may not be stored in subfolders
Shopify's normal theme editor groups files by types so that they appear close together, and apparently that's as much as Shopify is giving us right now.

Is anyway to dynamic add static image resource at react-native app

I have a project using react-native. When ready to upgrade the js bundle file, I come across a problem: In this upgrading, I need add some image resouce, so I have to copy the dest file to the src/main/res/ folder and regenerate the project. It's seem not so 'dynamically'.The second way is encoding the image resource using base64; it's work but ugly,especially there are lots of images. Certainly I could use network Images as react-native document describes, but it's 'expensively'. So is another way that loading new static images and needn't regenerate the project?
<Image source={require('./intro.png')} />
You can require images just like you require js files.
In the above example intro.png would be in the same folder as the js file.
Hope that helps

Combine all my custom JS into one single file with dojo build

I'm having a hard time trying to set up dojo build in my project.
Basically, I have my js folder with all my custom widgets and components. I simply want to combine all javascript files form js folder into one single file.
dojo sources are located outside this folder. The structure looks similar to this:
/public
/prod
/dojo-1.9
/dijit
/dojo
/dojox
/js
myScript1.js
myScript2.js
Do you have any idea on how should I configure the package.json and profile.js? The documentation doesn't seem to help since all I am getting is an output folder with the same contents as the js folder (no javascript is merged).
You can start by reading this article:
https://dojotoolkit.org/reference-guide/1.10/build/simpleExample.html
It provides a simplified overview of dojo build system.
Additional there is dojo boilerplate with a sample of folder structure and profile.js configuration for quick start here:
https://github.com/csnover/dojo-boilerplate
I definitely suggest you to use the boilerplate as start for your project as it simplify a lot initial configurations.

how to set directories js for javascript files, ui for interfaces and css directory for style in web.xml

I want to set web.xml for my first project. For managing project easily i want to arrange files in folders according to their extension in Web Content folder.
Anything wrong with just putting them in exactly those folders?
someapp/js/myscript.js
someapp/css/mystyles.css

Including more than one js file in cache.manifest?

I am working with sencha touch 2 in MVC format. I have created a cache.manifest file to bring my app offline.
CACHE MANIFEST
index.html
app.js
guide.css
app/model/Contact.js
app/model/Injury.js
app/view/IncidentForm.js
app/view/Home.js
app/view/DivisionSelect.js
app/view/InjuryResponse.js
app/view/EmergencyContact.js
app/controller/Core.js
i/amcor-app-bg#2.png
i/amcor-bg-logo#2.png
i/amcor-logo.png
i/amcor-tb-logo2x.png
i/arrow_right.png
i/ec-icon#2.png
i/home_icon.png
i/in-icon#2.png
i/ir-icon2x.png
i/ir-icon#2.png
i/ir-toolbar-bg2x.png
st2/builds/sencha-touch-all-compat.js
st2/resources/css/sencha-touch.css
NETWORK:
*
My issue is that the cache.manifest file does not seem to recognize any of my js files except for app.js. When I am working online it seems to cache properly but when I go offline the cache only returns index.html, app.js, and the sencha files. Can the cache.manifest file only have one .js file?
You should really try to use the tools SDK then you don't have to worry at all.
The Microloader helps keep things up to date.
Its a bit light on its error checking output and you must conform to the MVC app layout created by the SDK tools but once its running "it just works".
If the "compile" hangs its probably a missing ref.