Is phonegap index.js file really necessary in a web application? - phonegap-build

Please am new to programming and am trying to build my first mobile app. the question is do i need the phonegap index.js file, cant i just write my code without it like normal jQuery code in a website? I don't really understand how to put the code in the index.js file.The code is very basic, nothing complicated. Thank you

#ifeoluwa king,
only two files are needed to produce for Phonegap Build or Phonegap CLI. The two files are:
index.html
config.xml
The third file required file, which must be include in the index.html, is phonegap.js. With Phonegap Build, the system automatically provides the file. With Phonegap CLI, I have no experience with this, but according to this blog post it has been added to your bundle. In addition, you NEED TO SWITCH THE NAME to cordova.js - Again, read the blog post for details.
Appended 2015/09/02
On the original question, index.js is NOT needed. The file is created as a default; other possible names include, default.js and app.js.

Related

how to edit laravel horizon view

I just install laravel-horizon and already tested using it and everything is okay , however I don't know how to edit laravel horizon view ,
Above is the overview of my laravel-horizon , anyone can help me how to edit this ?
because it seems that laravel using vue js for this and i'm not really familiar
You can find the files that are used to build the frontend vue app in the /vendor/laravel/horizon/resources folder.
The page templates are part of the vue components (.vue files) that are found within the assets/js/pages folder. The css is built from sass files found in assets/sass.
You may be able to make superficial changes to the above files without any vue knowledge, however doing some reading up on how vue components are structured and other vue basics will definitely help.
After you make changes you will need to build the app.
There are build scripts included in the horizon package (check the package.json file).
These scripts will update the files that are included in public/vendor/horizon with the built files.
It would be up to you how you choose to track the changes you make, but I would avoid editing the files within /vendor/laravel/horizon directly, but rather fork it and import it in as your own package, or edit and build the frontend files separately to include within your project.

Minifying a scss.liquid file

Shahzaib here, coming to you for a bit of help !
I'm still new in the Shopify and liquid stuff but i'm getting there.
I'm cutrently trying to minify a scss.liquid file on Shopify, usually when I try to do that with a css file, I use an online minifier, exept that, apprently the scss.liquid format is not properly handled. Every time I try to minify it, my site crash ?
Do you guys have something to recommand regarding minifying a scss.liquid file ?
thanks in advance,
regards, Shahzaib.
I recommend setting up a gulp task to do this. This will help simplify your SCSS files into individual files for whatever they style. Also, you won't be edited your theme's default theme.scss.liquid file, so it is easier to overwrite default styles, and you know exactly which styling is yours vs the theme's.
To setup a gulp task, you will need to install node.js and gulp. I recommend using npm for this. Here is a good introduction tutorial to this which you'll need to adapt a bit to work with your Shopify file structure. For example, I recommend adding a src directory for your custom .scss files, and compiling them into one single file in the assets directory, instead of working directly in the theme.scss.liquid file.
https://css-tricks.com/gulp-for-beginners/
Once you have completed those instructions, make sure to add node_modules to your .gitignore file before committing.
Next, setup your project to use themekit. https://shopify.github.io/themekit/ , and have your gulp task run on save of the file. This will compiling your src files into a single file in the assets directory which will then be uploaded to your store by themekit.
Hope this helps!
I'd second than10's answer, and add that if minification of static assets is going to be part of your theme development workflow, use gulp.js running locally with something like gulp-shopify-upload watching your changes and pushing them up to your store:
https://www.npmjs.com/package/gulp-shopify-upload
See basic usage in particular.

TVML files in xcode?

I am building a TVOS app in Xcode. I know it is recommended to have following file structure:
client/ (this folder is outside my project folder)
client/templates (tvml files)
client/js (javascript files)
But client/ is not part of my tvosapp.xcodeproj, therefore in XCode, I cannot see the tVML files.
Questions:
How do I include the /templates /js folders in my project to be submitted in XCode?
If I have 2 projects, how can I separate the /templates /js folder for each project if I share the same /client folder?
Check out this https://github.com/toshi0383/TVMLKitchen its something I came across a couple days ago and it works great. It requires a bit of restructure to your current TVOS app as it hijacks the Navigation and focus engine (pretty sure at least). I branched what I was working on and used this and my life is so much easier. No server, all parsed on the client. Extremely fast and a lot of flexibility.
You need not have the exact same specified structure of client from the sample code, to me, as a front-end developer it looks bloated.
Have a look at this sample code that I ported from the original sample code which is using a better structured client setup. Though it uses atvjs framework, you'll get a sense of how to better structure your client application.

Conditionally include separate manifest files with asset-pipeline on Laravel 4

I have installed CodeSleeve asset-pipeline to manage and minify assets for my project. As I understood, all the scripts and stylesheets are controlled from manifest files located at: app/assets/stylesheets/application.css and app/assets/javascripts/application.js
That is all great, but what if I want to load different assets for different page? For example admin side of the application.
This situation is also mentioned in asset-pipeline documentation and recommended to use separate manifest files.
For example, if your application is silo'ed into admin section and user section then it probably makes sense to have a separate manifest file for each section.
Sounds great, but question remains. How?
Here is a similar question about asset-pipeline on Rails 3.1 and a somewhat complicated solution for such a obvious need, as is the need to include different assets in different sections of the application.
I still tried to make sense of that solution, but this is about Rails, so I still have no idea where are the manfiest files added in Laravel version?
I must admit I first went much longer and complex path, hacking the config array with Laravel Event listener. Got it working though until I turned on production environment, which broke my admin section styles. Now after all the hair-pulling came back to asset-pipeline documentation and found the very simple solution which had been right in front of my eyes the whole time: All you have to do is add parameter to include tag, like this:
<?= javascript_include_tag('admin/application') ?>
This will point to folder assets/admin and look for application.js from that folder. Resulting html markup will be:
<script src="assets/admin/application.js" data-foo="bar"></script>
Same thing with stylesheets.

Including template files in Go executable

I want to parse a folder of template HTML files and cache (or buffer) them on build for later use in a web project. Basically I am trying to make it so when I build my project I dont need to take the HTML files with me when I upload the executable file.
I think maybe you are talking about embedding the html files in your binary?
If so the best way to do this that I've seen so far has been camlistores fileembed: https://code.google.com/p/camlistore/source/browse/pkg/fileembed/fileembed.go
See here for directions on use: https://groups.google.com/d/msg/golang-nuts/LQMv7Zsmsi0/8Aax1XSekjAJ
That thread has addtional info on other packages for this as well.

Resources