Εργαστήριο 9. Styling with Javascript

Σχετικά έγγραφα
Finite Field Problems: Solutions

Οδηγίες Αγοράς Ηλεκτρονικού Βιβλίου Instructions for Buying an ebook

Εγκατάσταση λογισμικού και αναβάθμιση συσκευής Device software installation and software upgrade

Instruction Execution Times

2 Composition. Invertible Mappings

derivation of the Laplacian from rectangular to spherical coordinates

ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 6/5/2006

ΠΑΝΕΠΙΣΤΗΜΙΟ ΚΥΠΡΟΥ - ΤΜΗΜΑ ΠΛΗΡΟΦΟΡΙΚΗΣ ΕΠΛ 133: ΑΝΤΙΚΕΙΜΕΝΟΣΤΡΕΦΗΣ ΠΡΟΓΡΑΜΜΑΤΙΣΜΟΣ ΕΡΓΑΣΤΗΡΙΟ 3 Javadoc Tutorial

Homework 3 Solutions

How to register an account with the Hellenic Community of Sheffield.

3.4 SUM AND DIFFERENCE FORMULAS. NOTE: cos(α+β) cos α + cos β cos(α-β) cos α -cos β

VBA ΣΤΟ WORD. 1. Συχνά, όταν ήθελα να δώσω ένα φυλλάδιο εργασίας με ασκήσεις στους μαθητές έκανα το εξής: Version ΗΜΙΤΕΛΗΣ!!!!

Advanced Subsidiary Unit 1: Understanding and Written Response

Section 9.2 Polar Equations and Graphs

Dynamic types, Lambda calculus machines Section and Practice Problems Apr 21 22, 2016

b. Use the parametrization from (a) to compute the area of S a as S a ds. Be sure to substitute for ds!

Section 8.3 Trigonometric Equations

Other Test Constructions: Likelihood Ratio & Bayes Tests

Statistical Inference I Locally most powerful tests

Section 7.6 Double and Half Angle Formulas

C.S. 430 Assignment 6, Sample Solutions

Numerical Analysis FMN011

ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 19/5/2007

The challenges of non-stable predicates

Chapter 2 * * * * * * * Introduction to Verbs * * * * * * *

The Simply Typed Lambda Calculus

SCHOOL OF MATHEMATICAL SCIENCES G11LMA Linear Mathematics Examination Solutions

Υλοποίηση Δικτυακών Υποδομών και Υπηρεσιών: OSPF Cost

CHAPTER 25 SOLVING EQUATIONS BY ITERATIVE METHODS

SOAP API. Table of Contents

department listing department name αχχουντσ ϕανε βαλικτ δδσϕηασδδη σδηφγ ασκϕηλκ τεχηνιχαλ αλαν ϕουν διξ τεχηνιχαλ ϕοην µαριανι

Δημιουργία Λογαριασμού Διαχείρισης Business Telephony Create a Management Account for Business Telephony

Εργαστήριο Ανάπτυξης Εφαρμογών Βάσεων Δεδομένων. Εξάμηνο 7 ο

EE512: Error Control Coding

Econ 2110: Fall 2008 Suggested Solutions to Problem Set 8 questions or comments to Dan Fetter 1

Πρόβλημα 1: Αναζήτηση Ελάχιστης/Μέγιστης Τιμής

14 Lesson 2: The Omega Verb - Present Tense

Modbus basic setup notes for IO-Link AL1xxx Master Block

DESIGN OF MACHINERY SOLUTION MANUAL h in h 4 0.

Galatia SIL Keyboard Information

Ρύθμιση σε whitelist

CYTA Cloud Server Set Up Instructions

ST5224: Advanced Statistical Theory II

ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 24/3/2007

SPEEDO AQUABEAT. Specially Designed for Aquatic Athletes and Active People

Areas and Lengths in Polar Coordinates

CHAPTER 12: PERIMETER, AREA, CIRCUMFERENCE, AND 12.1 INTRODUCTION TO GEOMETRIC 12.2 PERIMETER: SQUARES, RECTANGLES,

Exercises 10. Find a fundamental matrix of the given system of equations. Also find the fundamental matrix Φ(t) satisfying Φ(0) = I. 1.

Concrete Mathematics Exercises from 30 September 2016

ΚΥΠΡΙΑΚΟΣ ΣΥΝΔΕΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY 21 ος ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ Δεύτερος Γύρος - 30 Μαρτίου 2011

Phys460.nb Solution for the t-dependent Schrodinger s equation How did we find the solution? (not required)

Κατανεμημένα Συστήματα. Javascript LCR example

Block Ciphers Modes. Ramki Thurimella

EU-Profiler: User Profiles in the 2009 European Elections

6.1. Dirac Equation. Hamiltonian. Dirac Eq.

Ordinal Arithmetic: Addition, Multiplication, Exponentiation and Limit

LESSON 14 (ΜΑΘΗΜΑ ΔΕΚΑΤΕΣΣΕΡΑ) REF : 202/057/34-ADV. 18 February 2014

Right Rear Door. Let's now finish the door hinge saga with the right rear door

Strain gauge and rosettes

FINAL TEST B TERM-JUNIOR B STARTING STEPS IN GRAMMAR UNITS 8-17

Mean bond enthalpy Standard enthalpy of formation Bond N H N N N N H O O O

ANSWERSHEET (TOPIC = DIFFERENTIAL CALCULUS) COLLECTION #2. h 0 h h 0 h h 0 ( ) g k = g 0 + g 1 + g g 2009 =?

Συστήματα Διαχείρισης Βάσεων Δεδομένων

Χρειάζεται να φέρω μαζί μου τα πρωτότυπα έγγραφα ή τα αντίγραφα; Asking if you need to provide the original documents or copies Ποια είναι τα κριτήρια

Areas and Lengths in Polar Coordinates

Special edition of the Technical Chamber of Greece on Video Conference Services on the Internet, 2000 NUTWBCAM

On a four-dimensional hyperbolic manifold with finite volume

PortSip Softphone. Ελληνικά Ι English 1/20

Μορφοποίηση υπό όρους : Μορφή > Μορφοποίηση υπό όρους/γραμμές δεδομένων/μορφοποίηση μόο των κελιών που περιέχουν/

Example Sheet 3 Solutions

Exercises to Statistics of Material Fatigue No. 5

Practice Exam 2. Conceptual Questions. 1. State a Basic identity and then verify it. (a) Identity: Solution: One identity is csc(θ) = 1

4.6 Autoregressive Moving Average Model ARMA(1,1)

FSM Toolkit Exercises

7 Present PERFECT Simple. 8 Present PERFECT Continuous. 9 Past PERFECT Simple. 10 Past PERFECT Continuous. 11 Future PERFECT Simple

ΕΛΛΗΝΙΚΗ ΔΗΜΟΚΡΑΤΙΑ ΠΑΝΕΠΙΣΤΗΜΙΟ ΚΡΗΤΗΣ. Ψηφιακή Οικονομία. Διάλεξη 7η: Consumer Behavior Mαρίνα Μπιτσάκη Τμήμα Επιστήμης Υπολογιστών

Εργαστήριο Ανάπτυξης Εφαρμογών Βάσεων Δεδομένων. Εξάμηνο 7 ο

the total number of electrons passing through the lamp.

Physical DB Design. B-Trees Index files can become quite large for large main files Indices on index files are possible.

Volume of a Cuboid. Volume = length x breadth x height. V = l x b x h. The formula for the volume of a cuboid is

Example of the Baum-Welch Algorithm

9.09. # 1. Area inside the oval limaçon r = cos θ. To graph, start with θ = 0 so r = 6. Compute dr

PARTIAL NOTES for 6.1 Trigonometric Identities

( )( ) ( ) ( )( ) ( )( ) β = Chapter 5 Exercise Problems EX α So 49 β 199 EX EX EX5.4 EX5.5. (a)

Section 1: Listening and responding. Presenter: Niki Farfara MGTAV VCE Seminar 7 August 2016

HOMEWORK 4 = G. In order to plot the stress versus the stretch we define a normalized stretch:

Paper Reference. Paper Reference(s) 1776/04 Edexcel GCSE Modern Greek Paper 4 Writing. Thursday 21 May 2009 Afternoon Time: 1 hour 15 minutes

Fourier Series. MATH 211, Calculus II. J. Robert Buchanan. Spring Department of Mathematics

Στο εστιατόριο «ToDokimasesPrinToBgaleisStonKosmo?» έξω από τους δακτυλίους του Κρόνου, οι παραγγελίες γίνονται ηλεκτρονικά.

ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 11/3/2006

[1] P Q. Fig. 3.1

Μεταπτυχιακή εργασία : Μελέτη της εξέλιξης του προσφυγικού οικισμού της Νέας Φιλαδέλφειας με χρήση μεθόδων Γεωπληροφορικής.

Solutions to Exercise Sheet 5

( ) 2 and compare to M.

Main source: "Discrete-time systems and computer control" by Α. ΣΚΟΔΡΑΣ ΨΗΦΙΑΚΟΣ ΕΛΕΓΧΟΣ ΔΙΑΛΕΞΗ 4 ΔΙΑΦΑΝΕΙΑ 1

Partial Trace and Partial Transpose

Business English. Ενότητα # 9: Financial Planning. Ευαγγελία Κουτσογιάννη Τμήμα Διοίκησης Επιχειρήσεων

Code Breaker. TEACHER s NOTES

k A = [k, k]( )[a 1, a 2 ] = [ka 1,ka 2 ] 4For the division of two intervals of confidence in R +

Transcript:

Εργαστήριο 9 Styling with Javascript

Pimp my Text with Javascript Today you'll write a page where the user can type text into a box, and by clicking on UI controls, the user can "pimp out" the text by giving it funny styling. I have everything setup for you here: http://codepen.io/dpasch01/pen/abvwoo You will write the JavaScript code that will manipulate the text.

Exercise 1: Create UI Elements [1/2] The first task is to expand the HTML by adding UI controls. Add HTML code for the following: A field for users to enter large (multi-line) amounts of text. It should be 4 rows by 30 columns in size. Wrap it in a bordered field set box with the label "Text". Add a second bordered field set box labeled "Pimp It" that contains the following controls: A button labeled: Bigger Pimpin'! A checkbox labeled "Bling" NOTE: Controls are sometimes used in forms; but you must not use the form tag on your page.

Exercise 1: Create UI Elements [2/2]

Exercise 2: JavaScript alert Now you'll write a bit of JavaScript testing code that pops up an alert box. This is just a test to make sure that your browser is running your JavaScript file, before we move on to tougher exercises. Put the following line of code : alert("hello, world!"); Refresh your page in the browser. Do you see the alert message? If so, move on. If not, double-check your script tag syntax or ask a TA for help.

Exercise 3: Hello World Button Now let's set up a very basic JS event handler. Modify your JS code and HTML so that the "Hello, world!" alert message won't pop up until the user clicks the "Bigger Pimpin" button. Modify your JS to wrap the alert into a function. Add an onclick handler attribute to the "Bigger Pimpin'" button that calls your new function. Refresh your page in the browser. Click the button. Do you see the alert? If so, move on. If not, double-check your onclick tag syntax and function, or ask a TA for help.

Exercise 4: Bigger Pimpin' Button [1/2] Modify your JS code so that when the user clicks "Bigger Pimpin'!", the text in the text area will get larger. Make sure your text area has an id attribute so your JS code can talk to it. Modify your JS function so that it now changes the text area's font size to 24pt. Hint: The syntax for accessing an element by ID and changing a style is: $("elementid").style.propertyname = "value"; Use proper units, such as "4em", and proper capitalization, such as backgroundcolor.

Exercise 4: Bigger Pimpin' Button [2/2]

Exercise 5: Bling Checkbox [1/2] Add an event handler so that when the user checks "Bling", the text area will receive some styles. Add an onchange on the checkbox that calls a function that pops up an alert. Modify your new function to set the text area's font weight to bold. You can see if a checkbox is checked by examining its checked property. (Give it an id.) When the box is unchecked, the font weight should go back to normal. Once the bold part works, add the following styles to the text when the box is checked: change its color to green underline the text (this is the CSS text-decoration property) make the text blink (this is also the CSS text-decoration property)

Exercise 5: Bling Checkbox [2/2]

Exercise 6: Snoopify [1/2] Add a new button to the HTML with the text "Snoopify" that, when clicked, uppercases the text in the text area. Use the value property of the text area. Modify your button so that it also adds a suffix of "-izzle" to the last word of each sentence. Let's consider a sentence to be a string of text that ends with a period character, ".". Use the String/array methods split and join. For example, to replace spaces with underscores: var str = "How are you?" var parts = str.split(" "); // ["How", "are", "you?"] str = parts.join("_"); // "How_are_you?"

Exercise 6: Snoopify [2/2]

Exercise 7: Font Timer Make it so that when the "Bigger Pimpin'!" button is clicked, rather than setting the font size to 24pt, you'll make it 2pt larger than its current size. The first time the button is clicked, the text area's.style.fontsize property won't have a value, so just use a default of 12pt. For future clicks, read the font size such as "12pt" and change it to a larger one like "14pt". You may want to use the parseint function to help you solve this. Once that works, make it use a timer. Now a single click should continually increase the font size by +2pt every 500 ms. Use the setinterval function. The timer should call the function you just wrote.