Add image files (or other resources) to project - google-apps-script

I am building an application with a Google App Script project that will be entirely housed within Google Sheets. I am using different tabs of a sheet for data storage and building HTML-based dialogs and sidebars to navigate the application. I am not going to deploy this as a library or web app, and I am not planning on utilizing any other web server of my own creation.
It is going well so far, but at this point I would like to added embedded resources, e.g. images that can be used as backgrounds of web pages. I can add .gs files and .html files fine to cover server-side coding, client-side coding, and styles, but I do not know of a way to add other files to the project. If this were a conventional web-based development process, I imagine I'd have something like an "img" folder at the root of my server entry point -- that's the functionality I am looking for in a GAS project.
Is it possible to add embedded resource files to a GAS project? Alternately, is there some way I can encode binary resources in an HTML file and then decode as needed to appear as usable content? I can certainly build adequate data-entry forms without additional resources, but things are going to look pretty spartan.
I did find a previous question that mentioned workarounds like placing resources in Google Drive alongside the Google Sheet w/ script, but that was from 4 years ago. Was wondering if there was a better/preferred methodology now that I am simply missing. That other question can be viewed here:
Elegant way to store resources...

Partial answer
If this were a conventional web-based development process, I imagine I'd have something like an "img" folder at the root of my server entry point -- that's the functionality I am looking for in a GAS project.
Google Apps Script doesn't have a root folder. Non-code resources should be hosted somewhere else.
See also
http://www.google.com/script/start

Related

How to organize Web Development using Git

Web Developers!
How do you go about organizing your Github projects for your front-end and back-end?
For example, I have a python script that generates a JSON file that the front end JavaScript consumes to generate data on the pages.
Would you create one repository with two directories labeled front-end and back-end?
Or would you make two different repositories?
I'm interested in what developers do in the wild. Because up until now I found myself having a complete clone of my website in a directory on my desktop PC, and just pushing individual files via SFTP from there.
I'm getting to the point where I have enough *.old files that I want to implement version control so I can view much older states of code with Metadata like date and user that edited it.
The answer is yes. Make two different github projects.
Just Like Michael W has stated, "[...] this is highly opinionated". What I find to be the most common approach is to implement a single github project when still in development and especially when you're developing on your own. This is useful because you don't have to switch up between repositories and/or branches, which saves time.
Another common approach is to split them up. However this approach is only possible when both projects can run independent from one and other. In your case it's important to split the project logically. If the python project only generates JSON files and places them on a server location, then I would place that into it's own github project, because the main purpose is to generate files, so the python application can run on a server seperate from the frontend. If the webapp only consumes the JSON files through maybe a rest call or through a connection to a FTP, then also that can be placed within it's own project.

Updating my website/ web hosting?

I'm new to web design and website deployment. I had some general questions that I tried to research but failed. I know how to use Html/CSS/Javascript and I managed to design my own website and upload it and host it using Amazon s3 / Route 53. It's a website built from scratch with HTML, CSS.
The thing that I have failed to understand is managing the website after deployment. Do I simply add HTML pages to my amazon bucket whenever I want to update? is this the way to do it? I came across jekyll in my research and from what I understood, it's a static website generator. But does it help with organizing the website and facilitating adding more content after deployment?
in other words, how do developers go about managing their websites generally after deployment?
I don't know about the Amazon s3 or jekyll etc. How I manage my sites is I use a hosting provider that provides Plesk. With Plesk I manage all my files for my sites in the file manager and I can even edit the code in the online code editor provided. It also has built in apps like Joomla and Wordpress.
I can set up email addresses for each site and also subdomains. Security etc.
When I want to update or edit my site I will either do it in the online code editor if it is something small like changing a color or just a few lines of code. Otherwise for bigger edits I will do it all on my desktop using notepad and then upload all the new files and replace the existing ones.
Each domain has it's own folder in the directory so it is easy to maintain and things don't get messy.
I hope this helps. You said you want to know how developers manage their sites. Although I am not a professional developer, I do have a few sites and that is how I manage them.
It only costs £40 per year too so is quite cheap.
Do I simply add HTML pages to my amazon bucket whenever I want to update? is this the way to do it?
Yes. The simplest way is to make changes to your files in your local workspace and then upload/overwrite the changed files to the S3 storage.
But does [jekyll] help with organizing the website and facilitating adding more content after deployment?
Yes! Jekyll is a great way to organise and generate your static site and I highly recommend it if you are planning to continue creating and deploying content to your site.
Start here, but note that it's a little more difficult if you're on Windows OS.
https://jekyllrb.com/docs/installation/#requirements

Using html pages to navigate documents on shared drive

I do not have any experience with web development, so I'd really appreciate an advice on the following issue:
a team of about 10 users currently has lost of documentation (mainly MS Office files and PDFs) on a shared drive, organized into folders. They want to keep it there, but at the same time want to have some very simple system that would allow them to navigate documentation in a more efficient manner. They cannot install any s/w on that computer.
Would a few simple html files on the same shared drive, with some links to each other and links to relevant documents in each work?
The issue is that, as I mentioned I do not have any experience, so I do not know what possible problems may appear if we just create these pages, put them on that shared drive and share link to the main page with everyone in the office. So, comments/suggestions will be greatly appreciated
If you want to develop navigation kind of stuff,either you have to implement any server side coding in your application or any jquery plugins.
http://www.sitepoint.com/10-jquery-file-manager-plugins/
visit the above site.It is offering a set of jquery plugins and most of them are free.This will help you to achieve your functionality.

Is there a way to export PSDs using AS3

Plead/Preparing for standard SO backlash
This is a generic question I apologize as I'm not an SO "noob" and I realize this doesn't fit the format exactly, if you can suggest a better place for this query I'm all ears. If you choose to down vote or close please suggest an alternative.
Question
Is anyone aware of projects that already generate a PSD file from within AS3?
Background (everything below here you may not care about if you just want to answer a question, but if interested I could use a hand)
I've found an AS3 PSD parser here.
For some basic tests this has worked fine (after some tweaking to avoid errors). However, now the task is to reverse this process to write a PSD file.
Current plan (and overall goal)
I also found a file format specification document.
My plan at this point is to just start from the top and work my way through the document building each of the parts of the file (and helper value objects) as I go along. Since this will be a very time consuming process, I'm wondering if there's any other previous work I could build off of.
Ultimately my goal is to integrate this code into a mobile drawing project I've been working on for some time. Since it's a mobile project I have to deal with the possibility that the OS kills my app to reclaim memory, in that case I need to be able to save/load the existing state of the app (currently has layers of BitmapData similar to photoshop, plus would be cool to be able to open PSD files and open my files from the device in photoshop with layers preserved).
Links to live version and code
The app can be downloaded here (is free will remain free, no ads, app is funded by love and the desire to create something cool everyone can have/use):
Google Play
Amazon App Store
Still working on an iOS release (process is more involved than the other two stores)
The code can be found here on github (Flash Builder project files in the FlashBuilderProject/FingerPainting folder).
Legal
Essentially the code contained in that repository is all MIT or Apache Licensed (will be going back to double each of the authors sites to get the original licenses to copy in now, just in case). I'm not a lawyer, but I believe I legitimately obtained everything in the project currently and am simply obligated to include the licenses and make my extensions of the source code available in some cases. (fonts came from google web fonts and downloaded Roboto from Google directly http://developer.android.com/design/style/typography.html). Any code in the com.shaunhusain package I wrote and you can assume is GPL for now. If anyone more legally savvy wants to tell me I'm breaking the law, and how, I would appreciate it.
The portions included and used from other sites include
Actuate MIT License
PNGEncoder2 License included in source from Adobe permits usage.
ShareANE I don't have a license for this one (he didn't include one) the author is chinese, as such I'm having some difficulty figuring out how to contact him, but am assuming I'm safe to use his code.
A couple of pieces of code are in the repository but currently not used including a GIF parser/encoder from bytearray.org and a ColorMatrix class from Grant Skinner.
Update
After trying this for a while I ended up deciding to just use the ORA format since it is open and far far simpler and works fine with GIMP and Krita (open source editors).
I'm not sure about the intended use, but if you are compiling the file in Flash, you might be able to use JSFL to export the fla to a PSD. Then tie the JSFL functionality to a button in a SWF that you load as a panel in the IDE. JSFL is pretty powerful, however it only works within the IDE/locally.

How best to make a web app with multiple pages?

I'm trying to make a multiplatform offline webapp using PhoneGap. I know my html and css, but I'm not altogether familiar with the full capabilities of JavaScript, and I've never made a webapp before, let alone tried to use phonegap to empower it.
Right now, I have the main index.html that phonegap sets up for you, but now I'm uncertain as to how to proceed. If I want a button to take the user to another page from the main page, should I make a second html file and literally link between them, or is this a lot more complex than that?
Also (get ready for a possibly epically stupid question from a total beginner):
Do web apps have to be online? I'm really not clear on whether they function like normal websites in which they need to be hosted on a server, or if they can be packaged up and downloaded just like normal native apps. Please help!
Thanks.
Oh, and btw, I'm working in Xcode with the phonegap addon thing....I'm trying to get it running on the iphone before I move on to android.
Although the other answer helped me at the time, I thought I would add a more complete answer now, five years later, to my own first StackOverflow question.
To start with, a "web app" is the same as a "website" in a technical sense, and yes, they have to be hosted on a server in order to be accessed through the browser...just like every website. The only distinction is that a web app is generally a more dynamic and complex sort of website, involving JavaScript and AJAX. It would be misleading to call a simple website like this one a "web app," whereas Facebook is definitely a web app. Basically all web apps are websites, but not all websites are quite exactly web apps.
However, it only has to be "online" if you want it to be accessible anywhere from a browser via http. If you're making a Cordova app like I was at the time, that's not relevant. If you only want to run an application locally, you can do so with a local server like Python's SimpleHTTPServer or the one webpack provides, or any other alternative, including a server you write yourself from scratch.
As for the primary question about having multiple pages, yes anchor elements like my link are the standard way of connecting pages. To link among your own pages, you would have multiple .html files, and you would create a link with an href like href="myOtherPage.html", where that file is contained in the same directory as the file for the page linking to it. Alternatively you could set up a single-page-app where JavaScript loads new page content without the use of anchor elements-- in that case multiple .html files are not needed. Frameworks like Angular and React are helpful for accomplishing that, but it's by no means necessary.
In a typical web app, most of the time you would just need to create a link as you would if you were creating a link on a website. Also, Web apps can be developed via a local environment (research Mamp/ or Wamp) depending on the dependencies in which your app require.