Single Page Web App Generator (SPWAG)



Similar documents
WHITEPAPER. Skinning Guide. Let s chat Velaro info@velaro.com by Velaro

Website Login Integration

CIS 467/602-01: Data Visualization

The purpose of jquery is to make it much easier to use JavaScript on your website.

Web Design Basics. Cindy Royal, Ph.D. Associate Professor Texas State University

BT CONTENT SHOWCASE. JOOMLA EXTENSION User guide Version 2.1. Copyright 2013 Bowthemes Inc.

MASTERTAG DEVELOPER GUIDE

JavaScript By: A. Mousavi & P. Broomhead SERG, School of Engineering Design, Brunel University, UK

Garfield Public Schools Fine & Practical Arts Curriculum Web Design

Creating a Resume Webpage with

HTML5 and CSS3 Part 1: Using HTML and CSS to Create a Website Layout

HTML Tables. IT 3203 Introduction to Web Development

LaGuardia Community College Thomson Ave, Long Island City, New York Created by ISMD s Dept. Training Team. Overview

SAPScript. A Standard Text is a like our normal documents. In Standard Text, you can create standard documents like letters, articles etc

Short notes on webpage programming languages

We automatically generate the HTML for this as seen below. Provide the above components for the teaser.txt file.

Joomla! template Blendvision v 1.0 Customization Manual

CREATING A NEWSLETTER IN ADOBE DREAMWEAVER CS5 (step-by-step directions)

Interspire Website Publisher Developer Documentation. Template Customization Guide

Web Development 1 A4 Project Description Web Architecture

Google Sites: Creating, editing, and sharing a site

Advanced Web Development SCOPE OF WEB DEVELOPMENT INDUSTRY

Using Style Sheets for Consistency

Dashboard Skin Tutorial. For ETS2 HTML5 Mobile Dashboard v3.0.2

jquery Tutorial for Beginners: Nothing But the Goods

Website Development Komodo Editor and HTML Intro

Outline of CSS: Cascading Style Sheets

Using Adobe Dreamweaver CS4 (10.0)

Responsive Web Design Creative License

Slide.Show Quick Start Guide

Creating Web Pages with Microsoft FrontPage

PLAYER DEVELOPER GUIDE

PASTPERFECT-ONLINE DESIGN GUIDE

Government Girls Polytechnic, Bilaspur

How to Edit Your Website

Introduction to Web Design Curriculum Sample

Making Web Application using Tizen Web UI Framework. Koeun Choi

Using an external style sheet with Dreamweaver (CS6)

Fortis Theme. User Guide. v Magento theme by Infortis. Copyright 2012 Infortis

TASKSTREAM FAQs. 2. I have downloaded a lesson attachment, but I cannot open it. What is wrong?

WP Popup Magic User Guide

Joomla! 2.5.x Training Manual

Creative Guidelines for s

Nintex Forms 2013 Help

Working with forms in PHP

Campaign Guidelines and Best Practices

RADFORD UNIVERSITY. Radford.edu. Content Administrator s Guide

Basic tutorial for Dreamweaver CS5

Course Information Course Number: IWT 1229 Course Name: Web Development and Design Foundation

EUROPEAN COMPUTER DRIVING LICENCE / INTERNATIONAL COMPUTER DRIVING LICENCE WEB EDITING

Web Development I & II*

Tutorial JavaScript: Switching panels using a radio button

Visualization: Combo Chart - Google Chart Tools - Google Code

Introduction 3. Getting Familiar With Presence Builder Creating and Editing Websites 6

Skills for Employment Investment Project (SEIP)

Version 4.0. Unit 3: Web Design. Computer Science Equity Alliance, Exploring Computer Science Unit 3: Web Design 102

Website Builder Documentation

JQUERY - EFFECTS. Showing and Hiding elements. Syntax. Example

Web Development. Owen Sacco. ICS2205/ICS2230 Web Intelligence

Site Maintenance. Table of Contents

Mastering the JangoMail EditLive HTML Editor

Parallels Panel. User s Guide to Parallels Presence Builder Revision 1.0

How to Use Swiftpage for Microsoft Excel

BlueHornet Whitepaper

Further web design: HTML forms

Mobile Web Design with HTML5, CSS3, JavaScript and JQuery Mobile Training BSP-2256 Length: 5 days Price: $ 2,895.00

CONTENTM WEBSITE MANAGEMENT SYSTEM. Getting Started Guide

Fireworks 3 Animation and Rollovers

Visualizing a Neo4j Graph Database with KeyLines

Adobe Dreamweaver CC 14 Tutorial

JavaScript: Introduction to Scripting Pearson Education, Inc. All rights reserved.

Fast track to HTML & CSS 101 (Web Design)

Timeline for Microsoft Dynamics CRM

Web Design with CSS and CSS3. Dr. Jan Stelovsky

CMSC434 TUTORIAL #3 HTML CSS JavaScript Jquery Ajax + Google AppEngine Mobile WebApp HTML5

TEMPLATE MANUAL Table of Contents

First Bytes Programming Lab 2

Microsoft Expression Web Quickstart Guide

Citrix StoreFront. Customizing the Receiver for Web User Interface Citrix. All rights reserved.

Message from Marketing & Creative Services

JOOMLA 2.5 MANUAL WEBSITEDESIGN.CO.ZA

JTouch Mobile Extension for Joomla! User Guide

How to Use Swiftpage for Microsoft Outlook

Mura CMS. (Content Management System) Content Manager Guide

Sizmek Features. Wallpaper. Build Guide

KOMPOZER Web Design Software

Embedding a Data View dynamic report into an existing web-page

So we're set? Have your text-editor ready. Be sure you use NotePad, NOT Word or even WordPad. Great, let's get going.

Your First Web Page. It all starts with an idea. Create an Azure Web App

ADOBE DREAMWEAVER CS3 TUTORIAL

Going Beyond SAP ITS Mobile Apps to a Responsive Design Mobile Apps. JK (JayaKumar Pedapudi) Principal Consultant NTT DATA, Inc.

Modern Web Development:

Interactive Data Visualization for the Web Scott Murray

Transcription:

Single Page Web App Generator (SPWAG) Members Lauren Zou (ljz2112) Aftab Khan (ajk2194) Richard Chiou (rc2758) Yunhe (John) Wang (yw2439) Aditya Majumdar (am3713) Motivation In 2012, HTML5 and CSS3 took the web development community by storm, introducing new elements such as figures and articles as well as innovative features such as animation and transition that aim to introduce more structure to the standard web page and to decrease the amount of JavaScript needed to create fancy visual effects such as fade and slide. With the introduction of new standards came an influx of web applications technologies trying to solve various problems on thin clients that were previously solved by thick clients. Today, many web developers are familiar with object oriented CSS languages such as SASS and LESS as well as JavaScript frameworks such as Angular and Ember, not to mention HAML, which is a shorthand way of writing HTML. While these tools aim to improve the programming experience of HTML, CSS, and JavaScript individually, they do not address the integration of these three languages as a whole. Single Page Web App Generator (SPWAG) aims to combine HTML, CSS, and JavaScript into a single and simple language. In SPWAG, the developer does not need to worry about which aspects of his or her webapp needs to be coded in HTML, CSS, or JavaScript. The developer can sp more time focusing on the content of the website. SPWAG will handle cross browser compatibility, graceful degradation, and producing a visually attractive single page web application. Language Features The primary goal of SPWAG is to make writing a single page dynamic web application easier. SPWAG allows the user to program in a single language and output unified code across three languages (HTML, CSS, and JavaScript). SPWAG provides a simpler, more consistent, and concise syntax for creating animated graphical content which may be viewed via any standards compliant web browser. One of the main advantages of SPWAG is that it outputs into web languages, which makes it cross platform compatible; one can view a SPWAG application from any operating system, tablet, or mobile device. In order to standardize SPWAG output, we will make use of open source projects such as LESS (an object oriented way of writing CSS), jquery (JavaScript framework), and Prefix Free (to support cross browser compatibility for the CSS). Ideally, the LESS should be compiled to CSS before the output is produced. 1

Representative Programs The following are programs that we would ideally be able to create using SPWAG. We have also described a high level overview on how each program would be implemented. The native functions and syntax are explained later on in this proposal. Animated Slideshow SPWAG generates one page animated content, such as slideshows, quickly and efficiently. In this program, we would define a slidecomponent that would essentially be a box()component stylized to fit the width and height of the window. The slide would also support an on click()function which would use the hide()function to hide the current slide and use the show()function to show the next slide. Each slide would be able to be customized to contain anything such as images, text, and hyperlinks. Jeopardy Game A Jeopardy Game can be constructed using similar functionalities from the Animated Slideshow program. In this case, each question of the game would be a slidecomponent as defined in the Animated Slideshow. There would also be a slide that contains several question picker boxes (which would be custom components) that, when clicked, will show the slide with the question. This is an example of an interactive program that can be created using SPWAG. Image Gallery An image gallery application can be easily implemented in SPWAG. The visual format of the image gallery would resemble Google s Image Search, such that there would be several thumbnail images that can be clicked on to produce a larger version of the image. A thumbnailcomponent would be a custom image() component that has an on click()function which will change the width()and height()attributes of the image. Conventions Here are some conventions for how a SPWAG program would be ideally written. These conventions do not necessarily have to be followed, but are preferred for a cleaner code presentation. SPWAG does not use camelcase for naming variables. Rather, custom names should be separated by a hyphen and should be entirely lower case (e.g. box bold ). Although SPWAG does not require a specific number of spaces per tab, it is convention to only use two spaces to represent a tab. Soft tabs are also preferred over hard tabs. In any case, the compiler for SPWAG will determine what constitutes a single indentation/tab through a preprocessor that analyzes the white space (similar to the preprocessor for Haskell). 2

Syntax Overview SPWAG s basic unit of execution is a function. Functions can represent actions to be performed (e.g. on click(), web page components (which are analogous to HTML elements), and attributes (which are analogous to but not limited to CSS styles that can be applied to the components). Components and attributes are mutually exclusive special subtypes of functions. Functions are declared and defined using the keyword definealong with any additional keywords as described in the following table. Note that all function definitions with the keyword. Defining Functions definecomppage() definecompmy comp()isaspwag comp() defineattrmy attr() definemy funct() defines the special component page, which is analogous to the main method in Java; this component is the main executable component defines a custom component; the spwag compmust be either a custom component already defined somewhere in the code or a native SPWAG component such as box()or image() defines a custom attribute defines a custom function Rules for Functions, Components, and Attributes Similar to the structure of elements in HTML, all custom components must ext a custom component that is either another custom component or a native SPWAG component. To ext another component, the keyword isais used. When a custom component exts another component, it automatically inherits the properties of the other component. The custom component can override and app to the properties of the other component with its own properties. It is illegal to create a custom component with the same name as a native component or another component defined in the same code. For example, a custom component cannot be called box()since box()already exists as a native component. page()is a special component which must be included in every SPWAG program. The page() component serves as an entry point for the program; one may think of this component as analogous to Java s main method. This is the only component that is created using definecompbut does not require an isakeyword to ext to another component. page()also cannot be called from another function. 3

All functions are called from this component during the program execution. A custom attribute is a collection of other attributes. Custom attributes are used to implement reusable modular styling. However, custom attributes may not contain non attribute functions. The body of functions can generally include any other functions as well as other statements. Effects are listed below, where each column represents the entity that is calling the entity in each row. Calling Functions Caller Regular Function Component Attribute Regular Function Executes the function Executes the function Illegal Component Binds the component to the nearest outer component Binds the component to this component Illegal Attribute Binds the attribute to the nearest outer attribute or component Binds the attribute to this component Binds the attribute to this attribute Statements Performs the statement Performs the statement Performs the statement Data Types The two main data types in SPWAG are integers and strings. Following JavaScript s syntax, data types are not explicitly declared in SPWAG. In a traditional language such as Java, we have to explicitly state which type a variable is (e.g. intinteger, Stringstr). In SPWAG, it is not necessary to explicitly declare a data type (e.g. varinteger, varstr); instead, the data type can be inferred from the declared variable value, which allows us to have fewer reserved keywords. Since the computer screen is split up by discrete, countable pixels, it is not essential to introduce floating point numbers into SPWAG. Integers can fall under several different integer types: regular integer, pixel, and percentage. A regular integer does not require a suffix, but a pixel integer should always be followed by a px (e.g. 300px) and a percentage integer should always be followed by a % (e.g. 100%). Thus, the integer type is implicitly declared. Strings are identifiable as they are enclosed in double quotes. Strings are very multi functional in SPWAG. Strings can be used to define colors (e.g. color( #F56991 ), messages (e.g. text( Hello world! ), and unique ids for components (e.g. box( my box ). Booleans are handled in a similar way as booleans are handled in C. False is equal to the regular integer 0, and everything else represents true. 4

Variables SPWAG allows for variables, which are permitted to refer to strings or integers but not functions. Variables are declared via the varkeyword. Keywords if<condition> else while<condition> varmy var if else conditional while loop to define a variable Native Functions random(integer) takes in an integer and returns a random integer between 0 and integer given in the parameter where the integer given in the parameter is non inclusive e.g. random(6)produces a random integer between 0 and 5 on click(function) on hover(function) link to(string) hide(component) show(component) handles on click events handles on hover/mouseover events links to a hyperlink specified in the parameter hides the element given in the parameter makes the element given in the parameter visible if it was previously hidden Native Components page() box(string) text(string,string) main function, root component a box, analogous to an HTML <div>; the parameter is the unique id of the element a floating text element, analogous to an HTML <span>; the first parameter is the unique id of the element and the second parameter is the message within the text element 5

image(string,string) field() an image, analogous to an HTML <img>; the first parameter is the unique id of the element and the second parameter is the url of the image a text input field, analogous to an HTML <input> Native Attributes color(string) width(string) height(pixel) font(string) font size(pixel) font decoration(string) margin(pixel) padding(pixel) animation(string) defines the color of the element (accepts RGB, HSL, hex) defines the width of the element defines the height of the element defines font family if applicable defines font size if applicable (accepts the font size as a pixel) defines font attribute (accepts bold, italic, underline values) defines the amount of outer spacing around the component defines the amount of spacing inside the boundaries of the component defines the transition for the component when it is hidden or shown (accepts slide <direction> which will slide either up, down, left, or right or fade which will fade in/out the element) Operators < less than operator; can only compare variables of the same type > greater than operator; can only compare variables of the same type = assignment operator == equal to!= not equal to + string concatenation, integer addition; addition for integers, pixels, and percents may only occur with two variables of the same data type; a string can be concatenated to any data type and the result will be a string subtraction; only works for integers, pixels, and percents; subtraction for integers, pixels, and percents may only occur with two variables of the same data type * multiplication; only works for integers, pixels, and percents; multiplication for integers, pixels, 6

and percents may only occur with two variables of the same data type / division; only works for integers, pixels, and percents; division for integers, pixels, and percents may only occur with two variables of the same data type or & and Comments #Thisisasinglelinecomment. ##Thisisamulti linedcomment. Wecanusethistocommentoutcode, writeapoemorastoryorsomedocumentation.## Examples Creating a Blank Page with a Pink Background SPWAG definecomppage() color( pink ) OUTPUT <html> <head> <styletype="text/css"> body{ background:pink; } </style> </head> <body> <script> </script> </body> </html> Generate a Number of Colored Circles SPWAG #Globalvariables varnumber of circles=4; varcircle radius=300px; #Mainmethod definecomppage() vari=0#=>localvariable whilei<number of circles OUTPUT <html> <head> <styletype="text/css">.circle{ border radius:100%; width:50px; height:50px; } 7

varr=random(256) varg=random(256) varb=random(256) varrgb= rgb( +r+, +g+, +b+ ) circle(rgb) i=i+1 #Generatescircles definecompcircle(color)isabox(color) color(color) border radius(100%) width(circle radius) height(circle radius) </style> </head> <body> <divclass="circle" style="background: rgb(204,185,64)"></div> <divclass="circle" style="background: rgb(87,182,158)"></div> <divclass="circle" style="background: rgb(171,72,112)"></div> <divclass="circle" style="background:rgb(25,34,123)"></div> <script> </script> </body> </html> Generate a Button that Shows a Text Box SPWAG #Mainmethod definecomppage() tbox( textbox, Helloworld! ) hide( textbox ) button( button, textbox ) #Buttoncomponent definecompbutton(id,tbox)isabox(id) text( Button ) on click(show color(tbox)) #Textboxcomponent definecomptbox(id,msg)isabox(id) text(msg) #maketextboldanditalicized bitext() #Bold,italicizedtext defineattrbitext() font decoration( bold ) font decoration( italic ) #Showsacomponentandcoloritpink defineshow color(component) OUTPUT <html> <head> <styletype="text/css">.tboxspan{ font weight:bold; font style:italic; } </style> </head> <body> <divid="textbox"class="tbox"> <span>helloworld!</span> </div> <divid="button"class="button"> <span>button</span> </div> <script> $('#textbox').hide(); $('#button').click(function(){ $('#textbox').css('background', 'pink'); $('#textbox').show(); }); </script> </body> </html> 8

component color( pink ) show(component) 9