SlideShare a Scribd company logo
1 of 70
Twanda.Malcolm12-6-16/back.jpg
Twanda.Malcolm12-6-16/barchart.js
/*
New Perspectives on HTML, CSS, and JavaScript
Tutorial 12
Case Problem 2
Author: Twanda.malcolm
Date: 12-06-2016
Filename: barchart.js
Function List:
totalVotes(votes)
Returns the length of the items in the votes array
calcPercent(item, sum)
Returns the ratio item/sum expressed as a percent rounded
to
the nearest integer
createBar(partyType, percent)
Displays a horizontal bar chart with different bars for
different
party types, using the value of the percent parameter to
determine
the length of the bar
showResults(race, name, party, votes)
Shows the race results for each name and party with bar
charts created
based on the votes array
*/
Twanda.Malcolm12-6-16/election.htmElection Home
PagePresidentSenate RacesCongressional RacesState
SenateState HouseLocal
RacesJudicialReferendumsCongressional Races
Twanda.Malcolm12-6-16/logo.jpg
Twanda.Malcolm12-6-16/modernizr-1.5.js
/*!
* Modernizr JavaScript library 1.5
* http://www.modernizr.com/
*
* Copyright (c) 2009-2010 Faruk Ates - http://farukat.es/
* Dual-licensed under the BSD and MIT licenses.
* http://www.modernizr.com/license/
*
* Featuring major contributions by
* Paul Irish - http://paulirish.com
*/
/*
* LicenseModernizr is available under the MIT and BSD
licenses:
* MIT License
* Copyright (c) 2009–2010 Faruk Ate?
* Permission is hereby granted, free of charge, to any person
obtaining a copy
* of this software and associated documentation files (the
"Software"), to deal
* in the Software without restriction, including without
limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell
* copies of the Software, and to permit persons to whom the
Software is
* furnished to do so, subject to the following conditions:
* The above copyright notice and this permission notice shall
be included in
* all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT
WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
* BSD License
* Copyright (c) 2010, Faruk Ate?
* All rights reserved.
* Redistribution and use in source and binary forms, with or
without
* modification, are permitted provided that the following
conditions are met:
* * Redistributions of source code must retain the above
copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
copyright
* notice, this list of conditions and the following disclaimer in
the
* documentation and/or other materials provided with the
distribution.
* * Neither the name of the Organization nor the
* names of its contributors may be used to endorse or promote
products
* derived from this software without specific prior written
permission.
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL COPYRIGHT
HOLDER BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
OF SUCH DAMAGE.
*/
/*
* Modernizr is a script that will detect native CSS3 and
HTML5 features
* available in the current UA and provide an object containing
all
* features with a true/false value, depending on whether the
UA has
* native support for it or not.
*
* In addition to that, Modernizr will add classes to the <html>
* element of the page, one for each cutting-edge feature. If the
UA
* supports it, a class like "cssgradients" will be added. If not,
* the class name will be "no-cssgradients". This allows for
simple
* if-conditionals in CSS styling, making it easily to have fine
* control over the look and feel of your website.
*
* @author Faruk Ates
* @copyright (c) 2009-2010 Faruk Ates.
*
* @contributor Paul Irish
* @contributor Ben Alman
*/
window.Modernizr = (function(window,doc,undefined){
var version = '1.5',
ret = {},
/**
* enableHTML5 is a private property for advanced use only.
If enabled,
* it will make Modernizr.init() run through a brief while()
loop in
* which it will create all HTML5 elements in the DOM to
allow for
* styling them in Internet Explorer, which does not
recognize any
* non-HTML4 elements unless created in the DOM this way.
*
* enableHTML5 is ON by default.
*/
enableHTML5 = true,
/**
* fontfaceCheckDelay is the ms delay before the @font-face
test is
* checked a second time. This is neccessary because both
Gecko and
* WebKit do not load data: URI font data synchronously.
* https://bugzilla.mozilla.org/show_bug.cgi?id=512566
* The check will be done again at fontfaceCheckDelay*2 and
then
* a fourth time at window's load event.
* If you need to query for @font-face support, send a
callback to:
* Modernizr._fontfaceready(fn);
* The callback is passed the boolean value of
Modernizr.fontface
*/
fontfaceCheckDelay = 75,
docElement = doc.documentElement,
/**
* Create our "modernizr" element that we do most feature
tests on.
*/
mod = 'modernizr',
m = doc.createElement( mod ),
m_style = m.style,
/**
* Create the input element for various Web Forms feature
tests.
*/
f = doc.createElement( 'input' ),
// Reused strings, stored here to allow better minification
canvas = 'canvas',
canvastext = 'canvastext',
rgba = 'rgba',
hsla = 'hsla',
multiplebgs = 'multiplebgs',
backgroundsize = 'backgroundsize',
borderimage = 'borderimage',
borderradius = 'borderradius',
boxshadow = 'boxshadow',
opacity = 'opacity',
cssanimations = 'cssanimations',
csscolumns = 'csscolumns',
cssgradients = 'cssgradients',
cssreflections = 'cssreflections',
csstransforms = 'csstransforms',
csstransforms3d = 'csstransforms3d',
csstransitions = 'csstransitions',
fontface = 'fontface',
geolocation = 'geolocation',
video = 'video',
audio = 'audio',
input = 'input',
inputtypes = input + 'types',
// inputtypes is an object of its own containing individual
tests for
// various new input types, such as search, range, datetime,
etc.
svg = 'svg',
smil = 'smil',
svgclippaths = svg+'clippaths',
background = 'background',
backgroundColor = background + 'Color',
canPlayType = 'canPlayType',
// FF gets really angry if you name local variables as these,
but camelCased.
localstorage = 'localStorage',
sessionstorage = 'sessionStorage',
applicationcache = 'applicationCache',
webWorkers = 'webworkers',
hashchange = 'hashchange',
crosswindowmessaging = 'crosswindowmessaging',
historymanagement = 'historymanagement',
draganddrop = 'draganddrop',
websqldatabase = 'websqldatabase',
indexedDB = 'indexedDB',
websockets = 'websockets',
smile = ':)',
// IE7 gets mad if you name a local variable `toString`
tostring = Object.prototype.toString,
// list of property values to set for css tests. see ticket #21
prefixes = ' -o- -moz- -ms- -webkit- -khtml- '.split(' '),
tests = {},
inputs = {},
attrs = {},
classes = [],
/**
* isEventSupported determines if a given element supports
the given event
* function from
http://yura.thinkweb2.com/isEventSupported/
*/
isEventSupported = (function(){
var TAGNAMES = {
'select':'input','change':'input',
'submit':'form','reset':'form',
'error':'img','load':'img','abort':'img'
},
cache = { };
function isEventSupported(eventName, element) {
var canCache = (arguments.length == 1);
// only return cached result when no element is given
if (canCache && cache[eventName]) {
return cache[eventName];
}
element = element ||
document.createElement(TAGNAMES[eventName] || 'div');
eventName = 'on' + eventName;
// When using `setAttribute`, IE skips "unload", WebKit
skips "unload" and "resize"
// `in` "catches" those
var isSupported = (eventName in element);
if (!isSupported && element.setAttribute) {
element.setAttribute(eventName, 'return;');
isSupported = typeof element[eventName] ==
'function';
}
element = null;
return canCache ? (cache[eventName] = isSupported) :
isSupported;
}
return isEventSupported;
})();
var _hasOwnProperty = ({}).hasOwnProperty,
hasOwnProperty;
if (typeof _hasOwnProperty !== 'undefined' && typeof
_hasOwnProperty.call !== 'undefined') {
hasOwnProperty = function (object, property) {
return _hasOwnProperty.call(object, property);
};
}
else {
hasOwnProperty = function (object, property) { /* yes, this
can give false positives/negatives, but most of the time we don't
care about those */
return ((property in object) && typeof
object.constructor.prototype[property] === 'undefined');
};
}
/**
* set_css applies given styles to the Modernizr DOM node.
*/
function set_css( str ) {
m_style.cssText = str;
}
/**
* set_css_all extrapolates all vendor-specific css strings.
*/
function set_css_all( str1, str2 ) {
return set_css(prefixes.join(str1 + ';') + ( str2 || '' ));
}
/**
* contains returns a boolean for if substr is found within str.
*/
function contains( str, substr ) {
return (''+str).indexOf( substr ) !== -1;
}
/**
* test_props is a generic CSS / DOM property test; if a
browser supports
* a certain property, it won't return undefined for it.
* A supported CSS property returns empty string when its
not yet set.
*/
function test_props( props, callback ) {
for ( var i in props ) {
if ( m_style[ props[i] ] !== undefined && ( !callback ||
callback( props[i], m ) ) ) {
return true;
}
}
}
/**
* test_props_all tests a list of DOM properties we want to
check against.
* We specify literally ALL possible (known and/or likely)
properties on
* the element including the non-vendor prefixed one, for
forward-
* compatibility.
*/
function test_props_all( prop, callback ) {
var uc_prop = prop.charAt(0).toUpperCase() +
prop.substr(1),
// following spec is to expose vendor-specific style
properties as:
// elem.style.WebkitBorderRadius
// and the following would be incorrect:
// elem.style.webkitBorderRadius
// Webkit and Mozilla are nice enough to ghost their
properties in the lowercase
// version but Opera does not.
// see more here:
http://github.com/Modernizr/Modernizr/issues/issue/21
props = [
prop,
'Webkit' + uc_prop,
'Moz' + uc_prop,
'O' + uc_prop,
'ms' + uc_prop,
'Khtml' + uc_prop
];
return !!test_props( props, callback );
}
/**
* Tests
*/
tests[canvas] = function() {
return !!doc.createElement( canvas ).getContext;
};
tests[canvastext] = function() {
return !!(tests[canvas]() && typeof doc.createElement(
canvas ).getContext('2d').fillText == 'function');
};
/**
* The Modernizr.touch test only indicates if the browser
supports
* touch events, which does not necessarily reflect a
touchscreen
* device, as evidenced by tablets running Windows 7 or,
alas,
* the Palm Pre / WebOS (touch) phones.
* Additionally, chrome used to lie about its support on this,
but that
* has since been recitifed: http://crbug.com/36415
* Because there is no way to reliably detect Chrome's false
positive
* without UA sniffing we have removed this test from
Modernizr. We
* hope to add it in after Chrome 5 has been sunsetted.
* See also
http://github.com/Modernizr/Modernizr/issues#issue/84
tests[touch] = function() {
return !!('ontouchstart' in window);
};
*/
/**
* geolocation tests for the new Geolocation API
specification.
* This test is a standards compliant-only test; for more
complete
* testing, including a Google Gears fallback, please see:
* http://code.google.com/p/geo-location-javascript/
* or view a fallback solution using google's geo API:
* http://gist.github.com/366184
*/
tests[geolocation] = function() {
return !!navigator.geolocation;
};
tests[crosswindowmessaging] = function() {
return !!window.postMessage;
};
tests[websqldatabase] = function() {
var result = !!window.openDatabase;
if (result){
try {
result = !!openDatabase("testdb", "1.0", "html5 test db",
200000);
} catch(err) {
result = false;
}
}
return result;
};
tests[indexedDB] = function(){
return !!window[indexedDB];
};
// documentMode logic from YUI to filter out IE8 Compat
Mode
// which false positives.
tests[hashchange] = function() {
return isEventSupported(hashchange, window) && (
document.documentMode === undefined ||
document.documentMode > 7 );
};
tests[historymanagement] = function() {
return !!(window.history && history.pushState);
};
tests[draganddrop] = function() {
return isEventSupported('drag')
&& isEventSupported('dragstart')
&& isEventSupported('dragenter')
&& isEventSupported('dragover')
&& isEventSupported('dragleave')
&& isEventSupported('dragend')
&& isEventSupported('drop');
};
tests[websockets] = function(){
return ('WebSocket' in window);
};
// http://css-tricks.com/rgba-browser-support/
tests[rgba] = function() {
// Set an rgba() color and check the returned value
set_css( background + '-color:rgba(150,255,150,.5)' );
return contains( m_style[backgroundColor], rgba );
};
tests[hsla] = function() {
// Same as rgba(), in fact, browsers re-map hsla() to rgba()
internally
set_css( background + '-color:hsla(120,40%,100%,.5)' );
return contains( m_style[backgroundColor], rgba );
};
tests[multiplebgs] = function() {
// Setting multiple images AND a color on the background
shorthand property
// and then querying the style.background property value
for the number of
// occurrences of "url(" is a reliable method for detecting
ACTUAL support for this!
set_css( background + ':url(//:),url(//:),red url(//:)' );
// If the UA supports multiple backgrounds, there should
be three occurrences
// of the string "url(" in the return value for
elem_style.background
return new
RegExp("(urls*(.*?){3}").test(m_style[background]);
};
// In testing support for a given CSS property, it's legit to
test:
// elem.style[styleName] !== undefined
// If the property is supported it will return an empty string,
// if unsupported it will return undefined.
// We'll take advantage of this quick test and skip setting a
style
// on our modernizr element, but instead just testing
undefined vs
// empty string.
// The legacy set_css_all calls will remain in the source
// (however, commented) in for clarity, yet functionally they
are
// no longer needed.
tests[backgroundsize] = function() {
return test_props_all( background + 'Size' );
};
tests[borderimage] = function() {
// set_css_all( 'border-image:url(m.png) 1 1 stretch' );
return test_props_all( 'borderImage' );
};
// super comprehensive table about all the unique
implementations of
// border-radius: http://muddledramblings.com/table-of-css3-
border-radius-compliance
tests[borderradius] = function() {
// set_css_all( 'border-radius:10px' );
return test_props_all( 'borderRadius', '', function( prop ) {
return contains( prop, 'orderRadius' );
});
};
tests[boxshadow] = function() {
// set_css_all( 'box-shadow:#000 1px 1px 3px' );
return test_props_all( 'boxShadow' );
};
tests[opacity] = function() {
// Browsers that actually have CSS Opacity implemented
have done so
// according to spec, which means their return values are
within the
// range of [0.0,1.0] - including the leading zero.
set_css_all( 'opacity:.5' );
return contains( m_style[opacity], '0.5' );
};
tests[cssanimations] = function() {
// set_css_all( 'animation:"animate" 2s ease 2',
'position:relative' );
return test_props_all( 'animationName' );
};
tests[csscolumns] = function() {
// set_css_all( 'column-count:3' );
return test_props_all( 'columnCount' );
};
tests[cssgradients] = function() {
/**
* For CSS Gradients syntax, please see:
* http://webkit.org/blog/175/introducing-css-gradients/
* https://developer.mozilla.org/en/CSS/-moz-linear-
gradient
* https://developer.mozilla.org/en/CSS/-moz-radial-
gradient
* http://dev.w3.org/csswg/css3-images/#gradients-
*/
var str1 = background + '-image:',
str2 = 'gradient(linear,left top,right
bottom,from(#9f9),to(white));',
str3 = 'linear-gradient(left top,#9f9, white);';
set_css(
(str1 + prefixes.join(str2 + str1) + prefixes.join(str3 +
str1)).slice(0,-str1.length)
);
return contains( m_style.backgroundImage, 'gradient' );
};
tests[cssreflections] = function() {
// set_css_all( 'box-reflect:right 1px' );
return test_props_all( 'boxReflect' );
};
tests[csstransforms] = function() {
// set_css_all( 'transform:rotate(3deg)' );
return !!test_props([ 'transformProperty',
'WebkitTransform', 'MozTransform', 'OTransform',
'msTransform' ]);
};
tests[csstransforms3d] = function() {
// set_css_all( 'perspective:500' );
var ret = !!test_props([ 'perspectiveProperty',
'WebkitPerspective', 'MozPerspective', 'OPerspective',
'msPerspective' ]);
// webkit has 3d transforms disabled for chrome, though
// it works fine in safari on leopard and snow leopard
// as a result, it 'recognizes' the syntax and throws a false
positive
// thus we must do a more thorough check:
if (ret){
var st = document.createElement('style'),
div = doc.createElement('div');
// webkit allows this media query to succeed only if the
feature is enabled.
// "@media (transform-3d),(-o-transform-3d),(-moz-
transform-3d),(-ms-transform-3d),(-webkit-transform-
3d),(modernizr){#modernizr{height:3px}}"
st.textContent = '@media ('+prefixes.join('transform-
3d),(')+'modernizr){#modernizr{height:3px}}';
doc.getElementsByTagName('head')[0].appendChild(st);
div.id = 'modernizr';
docElement.appendChild(div);
ret = div.offsetHeight === 3;
st.parentNode.removeChild(st);
div.parentNode.removeChild(div);
}
return ret;
};
tests[csstransitions] = function() {
// set_css_all( 'transition:all .5s linear' );
return test_props_all( 'transitionProperty' );
};
// @font-face detection routine created by Paul Irish -
paulirish.com
// Merged into Modernizr with approval. Read more about
Paul's work here:
// http://paulirish.com/2009/font-face-feature-detection/
tests[fontface] = function(){
var fontret;
if
(/*@[email protected](@_jscript_version>=5)[email protected]
@*/0) fontret = true;
else {
// Create variables for dedicated @font-face test
var st = doc.createElement('style'),
spn = doc.createElement('span'),
size, isFakeBody = false, body = doc.body,
callback, isCallbackCalled;
// The following is a font-face + glyph definition for the .
character:
st.textContent = "@font-face{font-
family:testfont;src:url('data:font/ttf;base64,AAEAAAAMAIAA
AwBAT1MvMliohmwAAADMAAAAVmNtYXCp5qrBAAABJA
AAANhjdnQgACICiAAAAfwAAAAEZ2FzcP//AAMAAAIAAA
AACGdseWYv5OZoAAACCAAAANxoZWFk69bnvwAAAuQA
AAA2aGhlYQUJAt8AAAMcAAAAJGhtdHgGDgC4AAADQAA
AABRsb2NhAIQAwgAAA1QAAAAMbWF4cABVANgAAANg
AAAAIG5hbWUgXduAAAADgAAABPVwb3N03NkzmgAACH
gAAAA4AAECBAEsAAUAAAKZAswAAACPApkCzAAAAesA
MwEJAAACAAMDAAAAAAAAgAACbwAAAAoAAAAAAAA
AAFBmRWQAAAAgqS8DM/8zAFwDMwDNAAAABQAAAAA
AAAAAAAMAAAADAAAAHAABAAAAAABGAAMAAQAA
AK4ABAAqAAAABgAEAAEAAgAuqQD//wAAAC6pAP///9ZX
AwAAAAAAAAACAAAABgBoAAAAAAAvAAEAAAAAAAA
AAAAAAAAAAAABAAIAAAAAAAAAAgAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB
AAEACoAAAAGAAQAAQACAC6pAP//AAAALqkA////1lcDA
AAAAAAAAAIAAAAiAogAAAAB//8AAgACACIAAAEyAqoA
AwAHAC6xAQAvPLIHBADtMrEGBdw8sgMCAO0yALEDAC8
8sgUEAO0ysgcGAfw8sgECAO0yMxEhESczESMiARDuzMwCq
v1WIgJmAAACAFUAAAIRAc0ADwAfAAATFRQWOwEyNj0
BNCYrASIGARQGKwEiJj0BNDY7ATIWFX8aIvAiGhoi8CIaA
ZIoN/43KCg3/jcoAWD0JB4eJPQkHh7++EY2NkbVRjY2RgAA
AAABAEH/+QCdAEEACQAANjQ2MzIWFAYjIkEeEA8fHw8Q
DxwWFhwWAAAAAQAAAAIAAIuYbWpfDzz1AAsEAAAAA
ADFn9IuAAAAAMWf0i797/8zA4gDMwAAAAgAAgAAAAAA
AAABAAADM/8zAFwDx/3v/98DiAABAAAAAAAAAAAAAA
AAAAAABQF2ACIAAAAAAVUAAAJmAFUA3QBBAAAAKg
AqACoAWgBuAAEAAAAFAFAABwBUAAQAAgAAAAEAAQ
AAAEAALgADAAMAAAAQAMYAAQAAAAAAAACLAAAA
AQAAAAAAAQAhAIsAAQAAAAAAAgAFAKwAAQAAAAA
AAwBDALEAAQAAAAAABAAnAPQAAQAAAAAABQAKAR
sAAQAAAAAABgAmASUAAQAAAAAADgAaAUsAAwABBA
kAAAEWAWUAAwABBAkAAQBCAnsAAwABBAkAAgAKAr
0AAwABBAkAAwCGAscAAwABBAkABABOA00AAwABBAk
ABQAUA5sAAwABBAkABgBMA68AAwABBAkADgA0A/tDb
3B5cmlnaHQgMjAwOSBieSBEYW5pZWwgSm9obnNvbi4gIFJl
bGVhc2VkIHVuZGVyIHRoZSB0ZXJtcyBvZiB0aGUgT3BlbiBG
b250IExpY2Vuc2UuIEtheWFoIExpIGdseXBocyBhcmUgcmVsZ
WFzZWQgdW5kZXIgdGhlIEdQTCB2ZXJzaW9uIDMuYmFlYzJ
hOTJiZmZlNTAzMiAtIHN1YnNldCBvZiBKdXJhTGlnaHRiYW
VjMmE5MmJmZmU1MDMyIC0gc3Vic2V0IG9mIEZvbnRGb3Jn
ZSAyLjAgOiBKdXJhIExpZ2h0IDogMjMtMS0yMDA5YmFlYzJ
hOTJiZmZlNTAzMiAtIHN1YnNldCBvZiBKdXJhIExpZ2h0Vm
Vyc2lvbiAyIGJhZWMyYTkyYmZmZTUwMzIgLSBzdWJzZXQg
b2YgSnVyYUxpZ2h0aHR0cDovL3NjcmlwdHMuc2lsLm9yZy9P
RkwAQwBvAHAAeQByAGkAZwBoAHQAIAAyADAAMAA5A
CAAYgB5ACAARABhAG4AaQBlAGwAIABKAG8AaABuAH
MAbwBuAC4AIAAgAFIAZQBsAGUAYQBzAGUAZAAgAHU
AbgBkAGUAcgAgAHQAaABlACAAdABlAHIAbQBzACAAbw
BmACAAdABoAGUAIABPAHAAZQBuACAARgBvAG4AdAA
gAEwAaQBjAGUAbgBzAGUALgAgAEsAYQB5AGEAaAAgAE
wAaQAgAGcAbAB5AHAAaABzACAAYQByAGUAIAByAGU
AbABlAGEAcwBlAGQAIAB1AG4AZABlAHIAIAB0AGgAZQ
AgAEcAUABMACAAdgBlAHIAcwBpAG8AbgAgADMALgBiA
GEAZQBjADIAYQA5ADIAYgBmAGYAZQA1ADAAMwAyAC
AALQAgAHMAdQBiAHMAZQB0ACAAbwBmACAASgB1AHI
AYQBMAGkAZwBoAHQAYgBhAGUAYwAyAGEAOQAyAGI
AZgBmAGUANQAwADMAMgAgAC0AIABzAHUAYgBzAGU
AdAAgAG8AZgAgAEYAbwBuAHQARgBvAHIAZwBlACAAM
gAuADAAIAA6ACAASgB1AHIAYQAgAEwAaQBnAGgAdAA
gADoAIAAyADMALQAxAC0AMgAwADAAOQBiAGEAZQBj
ADIAYQA5ADIAYgBmAGYAZQA1ADAAMwAyACAALQAg
AHMAdQBiAHMAZQB0ACAAbwBmACAASgB1AHIAYQAgA
EwAaQBnAGgAdABWAGUAcgBzAGkAbwBuACAAMgAgAGI
AYQBlAGMAMgBhADkAMgBiAGYAZgBlADUAMAAzADIAI
AAtACAAcwB1AGIAcwBlAHQAIABvAGYAIABKAHUAcgBh
AEwAaQBnAGgAdABoAHQAdABwADoALwAvAHMAYwByA
GkAcAB0AHMALgBzAGkAbAAuAG8AcgBnAC8ATwBGAEw
AAAAAAgAAAAAAAP+BADMAAAAAAAAAAAAAAAAAA
AAAAAAAAAAFAAAAAQACAQIAEQt6ZXJva2F5YWhsaQ==
')}";
doc.getElementsByTagName('head')[0].appendChild(st);
// we don't use `serif` and we don't use `monospace`
//
http://github.com/Modernizr/Modernizr/issues/closed#issue/39
//
http://neugierig.org/software/chromium/notes/2009/09/monospa
ce-fonts-workaround.html
spn.setAttribute('style','font:99px
_,arial,helvetica;position:absolute;visibility:hidden');
if (!body){
body =
docElement.appendChild(doc.createElement(fontface));
isFakeBody = true;
}
// the data-uri'd font only has the . glyph; which is 3
pixels wide.
spn.innerHTML = '........';
spn.id = 'fonttest';
body.appendChild(spn);
size = spn.offsetWidth*spn.offsetHeight;
spn.style.font = '99px testfont,_,arial,helvetica';
// needed for the CSSFontFaceRule false positives (ff3,
chrome, op9)
fontret = size !== spn.offsetWidth*spn.offsetHeight;
function delayedCheck(){
if (!body.parentNode) return;
fontret = ret[fontface] = size !==
spn.offsetWidth*spn.offsetHeight;
docElement.className =
docElement.className.replace(/(no-)?fontfaceb/,'') + (fontret ?
' ' : ' no-') + fontface;
}
setTimeout(delayedCheck,fontfaceCheckDelay);
setTimeout(delayedCheck,fontfaceCheckDelay*2);
addEventListener('load',function(){
delayedCheck();
(isCallbackCalled = true) && callback &&
callback(fontret);
setTimeout(function(){
if (!isFakeBody) body = spn;
body.parentNode.removeChild(body);
st.parentNode.removeChild(st);
}, 50);
},false);
}
// allow for a callback
ret._fontfaceready = function(fn){
(isCallbackCalled || fontret) ? fn(fontret) : (callback =
fn);
}
return fontret || size !== spn.offsetWidth;
};
// These tests evaluate support of the video/audio elements,
as well as
// testing what types of content they support.
//
// we're using the Boolean constructor here, so that we can
extend the value
// e.g. Modernizr.video // true
// Modernizr.video.ogg // 'probably'
//
// codec values from :
http://github.com/NielsLeenheer/html5test/blob/9106a8/index.ht
ml#L845
// thx to NielsLeenheer and zcorpan
tests[video] = function() {
var elem = doc.createElement(video),
bool = !!elem[canPlayType];
if (bool){
bool = new Boolean(bool);
bool.ogg = elem[canPlayType]('video/ogg;
codecs="theora"');
bool.h264 = elem[canPlayType]('video/mp4;
codecs="avc1.42E01E"');
bool.webm = elem[canPlayType]('video/webm;
codecs="vp8, vorbis"');
}
return bool;
};
tests[audio] = function() {
var elem = doc.createElement(audio),
bool = !!elem[canPlayType];
if (bool){
bool = new Boolean(bool);
bool.ogg = elem[canPlayType]('audio/ogg;
codecs="vorbis"');
bool.mp3 = elem[canPlayType]('audio/mpeg;');
// mimetypes accepted:
//
https://developer.mozilla.org/En/Media_formats_supported_by_
the_audio_and_video_elements
// http://bit.ly/iphoneoscodecs
bool.wav = elem[canPlayType]('audio/wav;
codecs="1"');
bool.m4a = elem[canPlayType]('audio/x-m4a;') ||
elem[canPlayType]('audio/aac;');
}
return bool;
};
// both localStorage and sessionStorage are
// tested in this method because otherwise Firefox will
// throw an error:
https://bugzilla.mozilla.org/show_bug.cgi?id=365772
// if cookies are disabled
// FWIW miller device resolves to [object Storage] in all
supporting browsers
// except for IE who does [object Object]
// IE8 Compat mode supports these features completely:
// http://www.quirksmode.org/dom/html5.html
tests[localstorage] = function() {
return ('localStorage' in window) &&
window[localstorage] !== null;
};
tests[sessionstorage] = function() {
// try/catch required for pissy FF behavior
try {
return ('sessionStorage' in window) &&
window[sessionstorage] !== null;
} catch(e){
return false;
}
};
tests[webWorkers] = function () {
return !!window.Worker;
};
tests[applicationcache] = function() {
var cache = window[applicationcache];
return !!(cache && (typeof cache.status != 'undefined')
&& (typeof cache.update == 'function') && (typeof
cache.swapCache == 'function'));
};
// thanks to Erik Dahlstrom
tests[svg] = function(){
return !!doc.createElementNS && !!doc.createElementNS(
"http://www.w3.org/2000/svg", "svg").createSVGRect;
};
// thanks to F1lt3r and lucideer
// http://github.com/Modernizr/Modernizr/issues#issue/35
tests[smil] = function(){
return !!doc.createElementNS &&
/SVG/.test(tostring.call(doc.createElementNS('http://www.w3.or
g/2000/svg','animate')));
};
tests[svgclippaths] = function(){
// returns a false positive in saf 3.2?
return !!doc.createElementNS &&
/SVG/.test(tostring.call(doc.createElementNS('http://www.w3.or
g/2000/svg','clipPath')));
};
// input features and input types go directly onto the ret
object, bypassing the tests loop.
// hold this guy to execute in a moment.
function webforms(){
// Run through HTML5's new input attributes to see if the
UA understands any.
// We're using f which is the <input> element created early
on
// Mike Taylr has created a comprehensive resource for
testing these attributes
// when applied to all input types:
// http://miketaylr.com/code/input-type-attr.html
// spec: http://www.whatwg.org/specs/web-apps/current-
work/multipage/the-input-element.html#input-type-attr-
summary
ret[input] = (function(props) {
for (var i = 0,len=props.length;i<len;i++) {
attrs[ props[i] ] = !!(props[i] in f);
}
return attrs;
})('autocomplete autofocus list placeholder max min
multiple pattern required step'.split(' '));
// Run through HTML5's new input types to see if the UA
understands any.
// This is put behind the tests runloop because it doesn't
return a
// true/false like all the other tests; instead, it returns an
object
// containing each input type with its corresponding
true/false value
// Big thx to @miketaylr for the html5 forms expertise.
http://miketaylr.com/
ret[inputtypes] = (function(props) {
for (var i = 0,bool,len=props.length;i<len;i++) {
f.setAttribute('type', props[i]);
bool = f.type !== 'text';
// chrome likes to falsely purport support, so we feed
it a textual value
// if that doesnt succeed then we know there's a
custom UI
if (bool){
f.value = smile;
/* Safari 4 is allowing the smiley as a value, and
incorrecty failing..
the test fixes for webkit only, but breaks Opera..
if (/range/.test(f.type)){
bool =
test_props_all('appearance',function(prop,m){ return
m_style[prop] !== 'textfield' })
}
*/
if (/tel|search/.test(f.type)){
// spec doesnt define any special parsing or
detectable UI
// behaviors so we pass these through as true
} else if (/url|email/.test(f.type)) {
// real url and email support comes with prebaked
validation.
bool = f.checkValidity && f.checkValidity() ===
false;
} else {
bool = f.value != smile;
}
}
inputs[ props[i] ] = !!bool;
}
return inputs;
})('search tel url email datetime date month week time
datetime-local number range color'.split(' '));
}
// end of test definitions
// Run through all tests and detect their support in the current
UA.
// todo: hypothetically we could be doing an array of tests
and use a basic loop here.
for ( var feature in tests ) {
if ( hasOwnProperty( tests, feature ) ) {
// run the test, throw the return value into the
Modernizr,
// then based on that boolean, define an appropriate
className
// and push it into an array of classes we'll join later.
classes.push( ( ( ret[ feature.toLowerCase() ] = tests[
feature ]() ) ? '' : 'no-' ) + feature.toLowerCase() );
}
}
// input tests need to run.
if (!ret[input]) webforms();
/**
* Addtest allows the user to define their own feature tests
* the result will be added onto the Modernizr object,
* as well as an appropriate className set on the html
element
*
* @param feature - String naming the feature
* @param test - Function returning true if feature is
supported, false if not
*/
ret.addTest = function (feature, test) {
feature = feature.toLowerCase();
if (ret[ feature ]) {
return; // quit if you're trying to overwrite an existing test
}
test = !!(test());
docElement.className += ' ' + (test ? '' : 'no-') + feature;
ret[ feature ] = test;
return ret; // allow chaining.
};
/**
* Reset m.style.cssText to nothing to reduce memory
footprint.
*/
set_css( '' );
m = f = null;
// Enable HTML 5 elements for styling in IE.
// fyi: jscript version does not reflect trident version
// therefore ie9 in ie7 mode will still have a jScript v.9
if ( enableHTML5 && (function(){ var elem =
doc.createElement("div");
elem.innerHTML = "<elem></elem>";
return elem.childNodes.length !== 1;
})()) {
// iepp v1.5.1 MIT @jon_neal
http://code.google.com/p/ie-print-protector/
(function(p,e){function
q(a,b){if(g[a])g[a].styleSheet.cssText+=b;else{var
c=r[l],d=e[j]("style");d.media=a;c.insertBefore(d,c[l]);g[a]=d;q(
a,b)}}function s(a,b){for(var c=new
RegExp("b("+m+")b(?!.*[;}])","gi"),d=function(k){return".ie
pp_"+k},h=-
1;++h<a.length;){b=a[h].media||b;s(a[h].imports,b);q(b,a[h].css
Text.replace(c,d))}}function t(){for(var
a,b=e.getElementsByTagName("*"),c,d,h=new
RegExp("^"+m+"$","i"),k=-
1;++k<b.length;)if((a=b[k])&&(d=a.nodeName.match(h))){c=ne
w
RegExp("^s*<"+d+"(.*)/"+d+">s*$","i");i.innerHTML=a.o
uterHTML.replace(/r|n/g,"
").replace(c,a.currentStyle.display=="block"?"<div$1/div>":"<s
pan$1/span>");c=i.childNodes[0];c.className+="
iepp_"+d;c=f[f.length]=[a,c];a.parentNode.replaceChild(c[1],c[
0])}s(e.styleSheets,"all")}function u(){for(var a=-
1,b;++a<f.length;)f[a][1].parentNode.replaceChild(f[a][0],f[a][1
]);for(b in g)r[l].removeChild(g[b]);g={};f=[]}for(var
r=e.documentElement,i=e.createDocumentFragment(),g={},m="
abbr|article|aside|audio|canvas|command|datalist|details|figure|fi
gcaption|footer|header|hgroup|keygen|mark|meter|nav|output|pro
gress|section|source|summary|time|video",n=m.split("|"),f=[],o=
-
1,l="firstChild",j="createElement";++o<n.length;){e[j](n[o]);i[j
](n[o])}i=i.appendChild(e[j]("div"));p.attachEvent("onbeforepri
nt",t);p.attachEvent("onafterprint",u)})(this,doc);
}
// Assign private properties to the return object with prefix
ret._enableHTML5 = enableHTML5;
ret._version = version;
// Remove "no-js" class from <html> element, if it exists:
docElement.className=docElement.className.replace(/bno-
jsb/,'') + ' js';
// Add the new classes to the <html> element.
docElement.className += ' ' + classes.join( ' ' );
return ret;
})(this,this.document);
Twanda.Malcolm12-6-16/results.css
/*
New Perspectives on HTML, CSS, and JavaScript
Tutorial 12
Case Problem 2
Filename: results.css
This file contains styles used in the election.htm file
*/
/* Default Styles */
* {
list-style: none;
margin: 0px;
padding: 0px;
}
header, figure, footer, article, nav, section {
display: block;
}
body {
background: white url(back.jpg) top left repeat-y;
font-family: Verdana, Geneva, sans-serif;
}
nav {
float: left;
width: 200px;
}
nav ul {
margin-left: 15px;
}
nav ul li {
line-height: 35px;
height: 35px;
margin: 5px 0px;
}
nav ul li a {
color: black;
font-size: 0.9em;
text-decoration: none;
}
nav ul li a:hover {
text-decoration: underline;
}
article {
float: left;
margin: 20px 0px 0px 20px;
}
article h1 {
font-size: 22px;
letter-spacing: 5px;
margin: 0px;
}
article h2 {
font-size: 14px;
margin-top: 12px;
margin-bottom: 0px;
}
article table {
font-size: 10px;
margin-top: 0px;
border-collapse: collapse;
}
article th {
width: 170px;
text-align: left;
border-bottom: 1px solid black;
}
article td {
margin: 0px;
}
article .num {
text-align: right;
width: 50px;
padding-right: 5px;
}
article .dem {
background-color: rgb(174,224,250);
width: 2px;
}
article .rep {
background-color: red;
width: 2px;
}
article .ind {
background-color: rgb(255,192,255);
width: 2px;
}
article .green {
background-color: rgb(128,255,128);
width: 2px;
}
article .lib {
background-color: cyan;
width: 2px;
}
Twanda.Malcolm12-6-16/votes.js
/*
New Perspectives on HTML, CSS, and JavaScript
Tutorial 12
Case Problem 2
Filename: votes.js
Variable List:
races: The name of the five races
name1 - name5: The name of the candidate for races 1
through 5
party1 - party5: The party affliations of the candidates
votes1 - votes5: The number of votes the candidate has
received
*/
var race = new Array();
var name1 = new Array();
var name2 = new Array();
var name3 = new Array();
var name4 = new Array();
var name5 = new Array();
var party1 = new Array();
var party2 = new Array();
var party3 = new Array();
var party4 = new Array();
var party5 = new Array();
var votes1 = new Array();
var votes2 = new Array();
var votes3 = new Array();
var votes4 = new Array();
var votes5 = new Array();
race[0]="1st Congressional District";
race[1]="2nd Congressional District";
race[2]="3rd Congressional District";
race[3]="4th Congressional District";
race[4]="5th Congressional District";
name1[0]="Sarah Carlson";
party1[0]="D";
votes1[0]=45125;
name1[1]="Pete deJesus";
party1[1]="R";
votes1[1]=44498;
name1[2]="Alan Tompkins";
party1[2]="I";
votes1[2]=5143;
name2[0]="Gary Griffin";
party2[0]="D";
votes2[0]=69505;
name2[1]="Frank Brown";
party2[1]="R";
votes2[1]=78133;
name2[2]="Roland Washington";
party2[2]="G";
votes2[2]=8109;
name2[3]="Karen Reese";
party2[3]="L";
votes2[3]=13004;
name3[0]="Anne Sanchez";
party3[0]="D";
votes3[0]=65203;
name3[1]="Cynthia Thomas";
party3[1]="R";
votes3[1]=51289;
name4[0]="Jerry Wilkes";
party4[0]="D";
votes4[0]=49201;
name4[1]="Barry Mitchell";
party4[1]="R";
votes4[1]=58414;
name4[2]="Paula Welton";
party4[2]="I";
votes4[2]=3901;
name5[0]="Pete Grimbold";
party5[0]="D";
votes5[0]=42105;
name5[1]="Carol Ives";
party5[1]="R";
votes5[1]=43349;
name5[2]="Michael Dorn";
party5[2]="G";
votes5[2]=1401;

More Related Content

Similar to Twanda.Malcolm12-6-16back.jpgTwanda.Malcolm12-6-16barchart.docx

BlackBerry DevCon 2011 - PhoneGap and WebWorks
BlackBerry DevCon 2011 - PhoneGap and WebWorksBlackBerry DevCon 2011 - PhoneGap and WebWorks
BlackBerry DevCon 2011 - PhoneGap and WebWorks
mwbrooks
 
HTML5 APIs - native multimedia support and beyond - University of Leeds 05.05...
HTML5 APIs - native multimedia support and beyond - University of Leeds 05.05...HTML5 APIs - native multimedia support and beyond - University of Leeds 05.05...
HTML5 APIs - native multimedia support and beyond - University of Leeds 05.05...
Patrick Lauke
 
Rails 3 overview
Rails 3 overviewRails 3 overview
Rails 3 overview
Yehuda Katz
 

Similar to Twanda.Malcolm12-6-16back.jpgTwanda.Malcolm12-6-16barchart.docx (20)

Kicking off with Zend Expressive and Doctrine ORM (PHP Srbija 2017)
Kicking off with Zend Expressive and Doctrine ORM (PHP Srbija 2017)Kicking off with Zend Expressive and Doctrine ORM (PHP Srbija 2017)
Kicking off with Zend Expressive and Doctrine ORM (PHP Srbija 2017)
 
J query b_dotnet_ug_meet_12_may_2012
J query b_dotnet_ug_meet_12_may_2012J query b_dotnet_ug_meet_12_may_2012
J query b_dotnet_ug_meet_12_may_2012
 
Kicking off with Zend Expressive and Doctrine ORM (Sunshine PHP 2017)
Kicking off with Zend Expressive and Doctrine ORM (Sunshine PHP 2017)Kicking off with Zend Expressive and Doctrine ORM (Sunshine PHP 2017)
Kicking off with Zend Expressive and Doctrine ORM (Sunshine PHP 2017)
 
Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)
Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)
Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)
 
BlackBerry DevCon 2011 - PhoneGap and WebWorks
BlackBerry DevCon 2011 - PhoneGap and WebWorksBlackBerry DevCon 2011 - PhoneGap and WebWorks
BlackBerry DevCon 2011 - PhoneGap and WebWorks
 
Angular 2 introduction
Angular 2 introductionAngular 2 introduction
Angular 2 introduction
 
GDI Seattle - Intro to JavaScript Class 4
GDI Seattle - Intro to JavaScript Class 4GDI Seattle - Intro to JavaScript Class 4
GDI Seattle - Intro to JavaScript Class 4
 
Knockoutjs databinding
Knockoutjs databindingKnockoutjs databinding
Knockoutjs databinding
 
A mobile web app for Android in 75 minutes
A mobile web app for Android in 75 minutesA mobile web app for Android in 75 minutes
A mobile web app for Android in 75 minutes
 
Extend sdk
Extend sdkExtend sdk
Extend sdk
 
Adaptive Layouts - standards>next London 28.05.2011
Adaptive Layouts - standards>next London 28.05.2011Adaptive Layouts - standards>next London 28.05.2011
Adaptive Layouts - standards>next London 28.05.2011
 
Intoduction on Playframework
Intoduction on PlayframeworkIntoduction on Playframework
Intoduction on Playframework
 
Laravel 8 export data as excel file with example
Laravel 8 export data as excel file with exampleLaravel 8 export data as excel file with example
Laravel 8 export data as excel file with example
 
HTML5 APIs - native multimedia support and beyond - University of Leeds 05.05...
HTML5 APIs - native multimedia support and beyond - University of Leeds 05.05...HTML5 APIs - native multimedia support and beyond - University of Leeds 05.05...
HTML5 APIs - native multimedia support and beyond - University of Leeds 05.05...
 
Pushing the Web: Interesting things to Know
Pushing the Web: Interesting things to KnowPushing the Web: Interesting things to Know
Pushing the Web: Interesting things to Know
 
68837.ppt
68837.ppt68837.ppt
68837.ppt
 
Rails 3 overview
Rails 3 overviewRails 3 overview
Rails 3 overview
 
Introduction to Html5
Introduction to Html5Introduction to Html5
Introduction to Html5
 
GHC
GHCGHC
GHC
 
Nodejs.meetup
Nodejs.meetupNodejs.meetup
Nodejs.meetup
 

More from marilucorr

Cover LetterOne aspect of strategic planning is to develop a str.docx
Cover LetterOne aspect of strategic planning is to develop a str.docxCover LetterOne aspect of strategic planning is to develop a str.docx
Cover LetterOne aspect of strategic planning is to develop a str.docx
marilucorr
 
Cover Letter, Resume, and Portfolio Toussaint Casimir.docx
Cover Letter, Resume, and Portfolio Toussaint Casimir.docxCover Letter, Resume, and Portfolio Toussaint Casimir.docx
Cover Letter, Resume, and Portfolio Toussaint Casimir.docx
marilucorr
 
Cover Executive Summary (mention organization, key ‘out-take.docx
Cover Executive Summary (mention organization, key ‘out-take.docxCover Executive Summary (mention organization, key ‘out-take.docx
Cover Executive Summary (mention organization, key ‘out-take.docx
marilucorr
 
Course Competencies Learning ObjectivesCourse Learning Objectiv.docx
Course Competencies Learning ObjectivesCourse Learning Objectiv.docxCourse Competencies Learning ObjectivesCourse Learning Objectiv.docx
Course Competencies Learning ObjectivesCourse Learning Objectiv.docx
marilucorr
 
CourseOverview-MarketingChannelConceptsLecture1.docx
CourseOverview-MarketingChannelConceptsLecture1.docxCourseOverview-MarketingChannelConceptsLecture1.docx
CourseOverview-MarketingChannelConceptsLecture1.docx
marilucorr
 
course-text-booksKeri E. Pearlson_ Carol S. Saunders - Managing.docx
course-text-booksKeri E. Pearlson_ Carol S. Saunders - Managing.docxcourse-text-booksKeri E. Pearlson_ Carol S. Saunders - Managing.docx
course-text-booksKeri E. Pearlson_ Carol S. Saunders - Managing.docx
marilucorr
 
Course Themes Guide The English 112 course will focus o.docx
Course Themes Guide  The English 112 course will focus o.docxCourse Themes Guide  The English 112 course will focus o.docx
Course Themes Guide The English 112 course will focus o.docx
marilucorr
 
Course SyllabusPrerequisitesThere are no prerequisites for PHI20.docx
Course SyllabusPrerequisitesThere are no prerequisites for PHI20.docxCourse SyllabusPrerequisitesThere are no prerequisites for PHI20.docx
Course SyllabusPrerequisitesThere are no prerequisites for PHI20.docx
marilucorr
 
COURSE SYLLABUSData Analysis and Reporting Spring 2019.docx
COURSE SYLLABUSData Analysis and Reporting Spring 2019.docxCOURSE SYLLABUSData Analysis and Reporting Spring 2019.docx
COURSE SYLLABUSData Analysis and Reporting Spring 2019.docx
marilucorr
 
COURSE SYLLABUS ADDENDUM INTEGRATED CASE ANALYSIS CRITERIA.docx
COURSE SYLLABUS ADDENDUM INTEGRATED CASE ANALYSIS CRITERIA.docxCOURSE SYLLABUS ADDENDUM INTEGRATED CASE ANALYSIS CRITERIA.docx
COURSE SYLLABUS ADDENDUM INTEGRATED CASE ANALYSIS CRITERIA.docx
marilucorr
 
Course SuccessHabits Matter1. Professors are influenced by you.docx
Course SuccessHabits Matter1. Professors are influenced by you.docxCourse SuccessHabits Matter1. Professors are influenced by you.docx
Course SuccessHabits Matter1. Professors are influenced by you.docx
marilucorr
 
COURSE RTM 300 (Recreation and Community Development (V. Ward)).docx
COURSE RTM 300 (Recreation and Community Development (V. Ward)).docxCOURSE RTM 300 (Recreation and Community Development (V. Ward)).docx
COURSE RTM 300 (Recreation and Community Development (V. Ward)).docx
marilucorr
 
Course Retail ManagementPart1DraftPart2Fin.docx
Course Retail ManagementPart1DraftPart2Fin.docxCourse Retail ManagementPart1DraftPart2Fin.docx
Course Retail ManagementPart1DraftPart2Fin.docx
marilucorr
 

More from marilucorr (20)

Cover LetterOne aspect of strategic planning is to develop a str.docx
Cover LetterOne aspect of strategic planning is to develop a str.docxCover LetterOne aspect of strategic planning is to develop a str.docx
Cover LetterOne aspect of strategic planning is to develop a str.docx
 
Cover Letter, Resume, and Portfolio Toussaint Casimir.docx
Cover Letter, Resume, and Portfolio Toussaint Casimir.docxCover Letter, Resume, and Portfolio Toussaint Casimir.docx
Cover Letter, Resume, and Portfolio Toussaint Casimir.docx
 
Cover Executive Summary (mention organization, key ‘out-take.docx
Cover Executive Summary (mention organization, key ‘out-take.docxCover Executive Summary (mention organization, key ‘out-take.docx
Cover Executive Summary (mention organization, key ‘out-take.docx
 
couse name Enterprise risk management  From your research, dis.docx
couse name  Enterprise risk management  From your research, dis.docxcouse name  Enterprise risk management  From your research, dis.docx
couse name Enterprise risk management  From your research, dis.docx
 
Courts have reasoned that hospitals have a duty to reserve their b.docx
Courts have reasoned that hospitals have a duty to reserve their b.docxCourts have reasoned that hospitals have a duty to reserve their b.docx
Courts have reasoned that hospitals have a duty to reserve their b.docx
 
Court Operations and Sentencing GuidelinesPeriodically, se.docx
Court Operations and Sentencing GuidelinesPeriodically, se.docxCourt Operations and Sentencing GuidelinesPeriodically, se.docx
Court Operations and Sentencing GuidelinesPeriodically, se.docx
 
Course Competencies Learning ObjectivesCourse Learning Objectiv.docx
Course Competencies Learning ObjectivesCourse Learning Objectiv.docxCourse Competencies Learning ObjectivesCourse Learning Objectiv.docx
Course Competencies Learning ObjectivesCourse Learning Objectiv.docx
 
Coursework 2 – Presentation Report The aim of this 1000-word r.docx
Coursework 2 – Presentation Report  The aim of this 1000-word r.docxCoursework 2 – Presentation Report  The aim of this 1000-word r.docx
Coursework 2 – Presentation Report The aim of this 1000-word r.docx
 
CourseOverview-MarketingChannelConceptsLecture1.docx
CourseOverview-MarketingChannelConceptsLecture1.docxCourseOverview-MarketingChannelConceptsLecture1.docx
CourseOverview-MarketingChannelConceptsLecture1.docx
 
course-text-booksKeri E. Pearlson_ Carol S. Saunders - Managing.docx
course-text-booksKeri E. Pearlson_ Carol S. Saunders - Managing.docxcourse-text-booksKeri E. Pearlson_ Carol S. Saunders - Managing.docx
course-text-booksKeri E. Pearlson_ Carol S. Saunders - Managing.docx
 
COURSE  InfoTech in a Global Economy Do you feel that countri.docx
COURSE  InfoTech in a Global Economy Do you feel that countri.docxCOURSE  InfoTech in a Global Economy Do you feel that countri.docx
COURSE  InfoTech in a Global Economy Do you feel that countri.docx
 
Course Themes Guide The English 112 course will focus o.docx
Course Themes Guide  The English 112 course will focus o.docxCourse Themes Guide  The English 112 course will focus o.docx
Course Themes Guide The English 112 course will focus o.docx
 
Course SyllabusPrerequisitesThere are no prerequisites for PHI20.docx
Course SyllabusPrerequisitesThere are no prerequisites for PHI20.docxCourse SyllabusPrerequisitesThere are no prerequisites for PHI20.docx
Course SyllabusPrerequisitesThere are no prerequisites for PHI20.docx
 
COURSE SYLLABUSData Analysis and Reporting Spring 2019.docx
COURSE SYLLABUSData Analysis and Reporting Spring 2019.docxCOURSE SYLLABUSData Analysis and Reporting Spring 2019.docx
COURSE SYLLABUSData Analysis and Reporting Spring 2019.docx
 
COURSE SYLLABUS ADDENDUM INTEGRATED CASE ANALYSIS CRITERIA.docx
COURSE SYLLABUS ADDENDUM INTEGRATED CASE ANALYSIS CRITERIA.docxCOURSE SYLLABUS ADDENDUM INTEGRATED CASE ANALYSIS CRITERIA.docx
COURSE SYLLABUS ADDENDUM INTEGRATED CASE ANALYSIS CRITERIA.docx
 
Course SuccessHabits Matter1. Professors are influenced by you.docx
Course SuccessHabits Matter1. Professors are influenced by you.docxCourse SuccessHabits Matter1. Professors are influenced by you.docx
Course SuccessHabits Matter1. Professors are influenced by you.docx
 
Course ScenarioYou have been hired as the Human Resources Di.docx
Course ScenarioYou have been hired as the Human Resources Di.docxCourse ScenarioYou have been hired as the Human Resources Di.docx
Course ScenarioYou have been hired as the Human Resources Di.docx
 
Course ScenarioPresently, your multinational organization us.docx
Course ScenarioPresently, your multinational organization us.docxCourse ScenarioPresently, your multinational organization us.docx
Course ScenarioPresently, your multinational organization us.docx
 
COURSE RTM 300 (Recreation and Community Development (V. Ward)).docx
COURSE RTM 300 (Recreation and Community Development (V. Ward)).docxCOURSE RTM 300 (Recreation and Community Development (V. Ward)).docx
COURSE RTM 300 (Recreation and Community Development (V. Ward)).docx
 
Course Retail ManagementPart1DraftPart2Fin.docx
Course Retail ManagementPart1DraftPart2Fin.docxCourse Retail ManagementPart1DraftPart2Fin.docx
Course Retail ManagementPart1DraftPart2Fin.docx
 

Recently uploaded

Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
MateoGardella
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
MateoGardella
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
heathfieldcps1
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
SanaAli374401
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 

Recently uploaded (20)

Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 

Twanda.Malcolm12-6-16back.jpgTwanda.Malcolm12-6-16barchart.docx

  • 1. Twanda.Malcolm12-6-16/back.jpg Twanda.Malcolm12-6-16/barchart.js /* New Perspectives on HTML, CSS, and JavaScript Tutorial 12 Case Problem 2 Author: Twanda.malcolm Date: 12-06-2016 Filename: barchart.js Function List: totalVotes(votes) Returns the length of the items in the votes array
  • 2. calcPercent(item, sum) Returns the ratio item/sum expressed as a percent rounded to the nearest integer createBar(partyType, percent) Displays a horizontal bar chart with different bars for different party types, using the value of the percent parameter to determine the length of the bar showResults(race, name, party, votes) Shows the race results for each name and party with bar charts created based on the votes array */
  • 3. Twanda.Malcolm12-6-16/election.htmElection Home PagePresidentSenate RacesCongressional RacesState SenateState HouseLocal RacesJudicialReferendumsCongressional Races Twanda.Malcolm12-6-16/logo.jpg Twanda.Malcolm12-6-16/modernizr-1.5.js /*! * Modernizr JavaScript library 1.5 * http://www.modernizr.com/ * * Copyright (c) 2009-2010 Faruk Ates - http://farukat.es/ * Dual-licensed under the BSD and MIT licenses. * http://www.modernizr.com/license/ * * Featuring major contributions by * Paul Irish - http://paulirish.com */ /* * LicenseModernizr is available under the MIT and BSD licenses:
  • 4. * MIT License * Copyright (c) 2009–2010 Faruk Ate? * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  • 5. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * BSD License * Copyright (c) 2010, Faruk Ate? * All rights reserved. * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright
  • 6. * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of the Organization nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  • 7. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* * Modernizr is a script that will detect native CSS3 and HTML5 features * available in the current UA and provide an object containing all * features with a true/false value, depending on whether the UA has * native support for it or not. * * In addition to that, Modernizr will add classes to the <html>
  • 8. * element of the page, one for each cutting-edge feature. If the UA * supports it, a class like "cssgradients" will be added. If not, * the class name will be "no-cssgradients". This allows for simple * if-conditionals in CSS styling, making it easily to have fine * control over the look and feel of your website. * * @author Faruk Ates * @copyright (c) 2009-2010 Faruk Ates. * * @contributor Paul Irish * @contributor Ben Alman */ window.Modernizr = (function(window,doc,undefined){ var version = '1.5',
  • 9. ret = {}, /** * enableHTML5 is a private property for advanced use only. If enabled, * it will make Modernizr.init() run through a brief while() loop in * which it will create all HTML5 elements in the DOM to allow for * styling them in Internet Explorer, which does not recognize any * non-HTML4 elements unless created in the DOM this way. * * enableHTML5 is ON by default. */ enableHTML5 = true, /** * fontfaceCheckDelay is the ms delay before the @font-face test is
  • 10. * checked a second time. This is neccessary because both Gecko and * WebKit do not load data: URI font data synchronously. * https://bugzilla.mozilla.org/show_bug.cgi?id=512566 * The check will be done again at fontfaceCheckDelay*2 and then * a fourth time at window's load event. * If you need to query for @font-face support, send a callback to: * Modernizr._fontfaceready(fn); * The callback is passed the boolean value of Modernizr.fontface */ fontfaceCheckDelay = 75, docElement = doc.documentElement, /** * Create our "modernizr" element that we do most feature
  • 11. tests on. */ mod = 'modernizr', m = doc.createElement( mod ), m_style = m.style, /** * Create the input element for various Web Forms feature tests. */ f = doc.createElement( 'input' ), // Reused strings, stored here to allow better minification canvas = 'canvas', canvastext = 'canvastext', rgba = 'rgba', hsla = 'hsla', multiplebgs = 'multiplebgs',
  • 12. backgroundsize = 'backgroundsize', borderimage = 'borderimage', borderradius = 'borderradius', boxshadow = 'boxshadow', opacity = 'opacity', cssanimations = 'cssanimations', csscolumns = 'csscolumns', cssgradients = 'cssgradients', cssreflections = 'cssreflections', csstransforms = 'csstransforms', csstransforms3d = 'csstransforms3d', csstransitions = 'csstransitions', fontface = 'fontface', geolocation = 'geolocation', video = 'video', audio = 'audio', input = 'input', inputtypes = input + 'types',
  • 13. // inputtypes is an object of its own containing individual tests for // various new input types, such as search, range, datetime, etc. svg = 'svg', smil = 'smil', svgclippaths = svg+'clippaths', background = 'background', backgroundColor = background + 'Color', canPlayType = 'canPlayType', // FF gets really angry if you name local variables as these, but camelCased. localstorage = 'localStorage', sessionstorage = 'sessionStorage', applicationcache = 'applicationCache',
  • 14. webWorkers = 'webworkers', hashchange = 'hashchange', crosswindowmessaging = 'crosswindowmessaging', historymanagement = 'historymanagement', draganddrop = 'draganddrop', websqldatabase = 'websqldatabase', indexedDB = 'indexedDB', websockets = 'websockets', smile = ':)', // IE7 gets mad if you name a local variable `toString` tostring = Object.prototype.toString, // list of property values to set for css tests. see ticket #21 prefixes = ' -o- -moz- -ms- -webkit- -khtml- '.split(' '), tests = {}, inputs = {},
  • 15. attrs = {}, classes = [], /** * isEventSupported determines if a given element supports the given event * function from http://yura.thinkweb2.com/isEventSupported/ */ isEventSupported = (function(){ var TAGNAMES = { 'select':'input','change':'input', 'submit':'form','reset':'form', 'error':'img','load':'img','abort':'img' }, cache = { };
  • 16. function isEventSupported(eventName, element) { var canCache = (arguments.length == 1); // only return cached result when no element is given if (canCache && cache[eventName]) { return cache[eventName]; } element = element || document.createElement(TAGNAMES[eventName] || 'div'); eventName = 'on' + eventName; // When using `setAttribute`, IE skips "unload", WebKit skips "unload" and "resize" // `in` "catches" those var isSupported = (eventName in element); if (!isSupported && element.setAttribute) { element.setAttribute(eventName, 'return;');
  • 17. isSupported = typeof element[eventName] == 'function'; } element = null; return canCache ? (cache[eventName] = isSupported) : isSupported; } return isEventSupported; })(); var _hasOwnProperty = ({}).hasOwnProperty, hasOwnProperty; if (typeof _hasOwnProperty !== 'undefined' && typeof _hasOwnProperty.call !== 'undefined') { hasOwnProperty = function (object, property) { return _hasOwnProperty.call(object, property); };
  • 18. } else { hasOwnProperty = function (object, property) { /* yes, this can give false positives/negatives, but most of the time we don't care about those */ return ((property in object) && typeof object.constructor.prototype[property] === 'undefined'); }; } /** * set_css applies given styles to the Modernizr DOM node. */ function set_css( str ) { m_style.cssText = str; } /** * set_css_all extrapolates all vendor-specific css strings. */
  • 19. function set_css_all( str1, str2 ) { return set_css(prefixes.join(str1 + ';') + ( str2 || '' )); } /** * contains returns a boolean for if substr is found within str. */ function contains( str, substr ) { return (''+str).indexOf( substr ) !== -1; } /** * test_props is a generic CSS / DOM property test; if a browser supports * a certain property, it won't return undefined for it. * A supported CSS property returns empty string when its not yet set. */ function test_props( props, callback ) {
  • 20. for ( var i in props ) { if ( m_style[ props[i] ] !== undefined && ( !callback || callback( props[i], m ) ) ) { return true; } } } /** * test_props_all tests a list of DOM properties we want to check against. * We specify literally ALL possible (known and/or likely) properties on * the element including the non-vendor prefixed one, for forward- * compatibility. */ function test_props_all( prop, callback ) { var uc_prop = prop.charAt(0).toUpperCase() + prop.substr(1),
  • 21. // following spec is to expose vendor-specific style properties as: // elem.style.WebkitBorderRadius // and the following would be incorrect: // elem.style.webkitBorderRadius // Webkit and Mozilla are nice enough to ghost their properties in the lowercase // version but Opera does not. // see more here: http://github.com/Modernizr/Modernizr/issues/issue/21 props = [ prop, 'Webkit' + uc_prop, 'Moz' + uc_prop, 'O' + uc_prop, 'ms' + uc_prop, 'Khtml' + uc_prop ];
  • 22. return !!test_props( props, callback ); } /** * Tests */ tests[canvas] = function() { return !!doc.createElement( canvas ).getContext; }; tests[canvastext] = function() { return !!(tests[canvas]() && typeof doc.createElement( canvas ).getContext('2d').fillText == 'function'); };
  • 23. /** * The Modernizr.touch test only indicates if the browser supports * touch events, which does not necessarily reflect a touchscreen * device, as evidenced by tablets running Windows 7 or, alas, * the Palm Pre / WebOS (touch) phones. * Additionally, chrome used to lie about its support on this, but that * has since been recitifed: http://crbug.com/36415 * Because there is no way to reliably detect Chrome's false positive * without UA sniffing we have removed this test from Modernizr. We * hope to add it in after Chrome 5 has been sunsetted. * See also http://github.com/Modernizr/Modernizr/issues#issue/84 tests[touch] = function() { return !!('ontouchstart' in window);
  • 24. }; */ /** * geolocation tests for the new Geolocation API specification. * This test is a standards compliant-only test; for more complete * testing, including a Google Gears fallback, please see: * http://code.google.com/p/geo-location-javascript/ * or view a fallback solution using google's geo API: * http://gist.github.com/366184 */ tests[geolocation] = function() { return !!navigator.geolocation; }; tests[crosswindowmessaging] = function() {
  • 25. return !!window.postMessage; }; tests[websqldatabase] = function() { var result = !!window.openDatabase; if (result){ try { result = !!openDatabase("testdb", "1.0", "html5 test db", 200000); } catch(err) { result = false; } } return result; }; tests[indexedDB] = function(){ return !!window[indexedDB];
  • 26. }; // documentMode logic from YUI to filter out IE8 Compat Mode // which false positives. tests[hashchange] = function() { return isEventSupported(hashchange, window) && ( document.documentMode === undefined || document.documentMode > 7 ); }; tests[historymanagement] = function() { return !!(window.history && history.pushState); }; tests[draganddrop] = function() { return isEventSupported('drag') && isEventSupported('dragstart') && isEventSupported('dragenter') && isEventSupported('dragover')
  • 27. && isEventSupported('dragleave') && isEventSupported('dragend') && isEventSupported('drop'); }; tests[websockets] = function(){ return ('WebSocket' in window); }; // http://css-tricks.com/rgba-browser-support/ tests[rgba] = function() { // Set an rgba() color and check the returned value set_css( background + '-color:rgba(150,255,150,.5)' ); return contains( m_style[backgroundColor], rgba );
  • 28. }; tests[hsla] = function() { // Same as rgba(), in fact, browsers re-map hsla() to rgba() internally set_css( background + '-color:hsla(120,40%,100%,.5)' ); return contains( m_style[backgroundColor], rgba ); }; tests[multiplebgs] = function() { // Setting multiple images AND a color on the background shorthand property // and then querying the style.background property value for the number of // occurrences of "url(" is a reliable method for detecting ACTUAL support for this! set_css( background + ':url(//:),url(//:),red url(//:)' );
  • 29. // If the UA supports multiple backgrounds, there should be three occurrences // of the string "url(" in the return value for elem_style.background return new RegExp("(urls*(.*?){3}").test(m_style[background]); }; // In testing support for a given CSS property, it's legit to test: // elem.style[styleName] !== undefined // If the property is supported it will return an empty string, // if unsupported it will return undefined. // We'll take advantage of this quick test and skip setting a style // on our modernizr element, but instead just testing undefined vs // empty string.
  • 30. // The legacy set_css_all calls will remain in the source // (however, commented) in for clarity, yet functionally they are // no longer needed. tests[backgroundsize] = function() { return test_props_all( background + 'Size' ); }; tests[borderimage] = function() { // set_css_all( 'border-image:url(m.png) 1 1 stretch' ); return test_props_all( 'borderImage' ); }; // super comprehensive table about all the unique implementations of // border-radius: http://muddledramblings.com/table-of-css3-
  • 31. border-radius-compliance tests[borderradius] = function() { // set_css_all( 'border-radius:10px' ); return test_props_all( 'borderRadius', '', function( prop ) { return contains( prop, 'orderRadius' ); }); }; tests[boxshadow] = function() { // set_css_all( 'box-shadow:#000 1px 1px 3px' ); return test_props_all( 'boxShadow' ); }; tests[opacity] = function() { // Browsers that actually have CSS Opacity implemented have done so
  • 32. // according to spec, which means their return values are within the // range of [0.0,1.0] - including the leading zero. set_css_all( 'opacity:.5' ); return contains( m_style[opacity], '0.5' ); }; tests[cssanimations] = function() { // set_css_all( 'animation:"animate" 2s ease 2', 'position:relative' ); return test_props_all( 'animationName' ); }; tests[csscolumns] = function() { // set_css_all( 'column-count:3' );
  • 33. return test_props_all( 'columnCount' ); }; tests[cssgradients] = function() { /** * For CSS Gradients syntax, please see: * http://webkit.org/blog/175/introducing-css-gradients/ * https://developer.mozilla.org/en/CSS/-moz-linear- gradient * https://developer.mozilla.org/en/CSS/-moz-radial- gradient * http://dev.w3.org/csswg/css3-images/#gradients- */ var str1 = background + '-image:', str2 = 'gradient(linear,left top,right bottom,from(#9f9),to(white));', str3 = 'linear-gradient(left top,#9f9, white);';
  • 34. set_css( (str1 + prefixes.join(str2 + str1) + prefixes.join(str3 + str1)).slice(0,-str1.length) ); return contains( m_style.backgroundImage, 'gradient' ); }; tests[cssreflections] = function() { // set_css_all( 'box-reflect:right 1px' ); return test_props_all( 'boxReflect' ); }; tests[csstransforms] = function() { // set_css_all( 'transform:rotate(3deg)' ); return !!test_props([ 'transformProperty',
  • 35. 'WebkitTransform', 'MozTransform', 'OTransform', 'msTransform' ]); }; tests[csstransforms3d] = function() { // set_css_all( 'perspective:500' ); var ret = !!test_props([ 'perspectiveProperty', 'WebkitPerspective', 'MozPerspective', 'OPerspective', 'msPerspective' ]); // webkit has 3d transforms disabled for chrome, though // it works fine in safari on leopard and snow leopard // as a result, it 'recognizes' the syntax and throws a false positive // thus we must do a more thorough check: if (ret){ var st = document.createElement('style'), div = doc.createElement('div');
  • 36. // webkit allows this media query to succeed only if the feature is enabled. // "@media (transform-3d),(-o-transform-3d),(-moz- transform-3d),(-ms-transform-3d),(-webkit-transform- 3d),(modernizr){#modernizr{height:3px}}" st.textContent = '@media ('+prefixes.join('transform- 3d),(')+'modernizr){#modernizr{height:3px}}'; doc.getElementsByTagName('head')[0].appendChild(st); div.id = 'modernizr'; docElement.appendChild(div); ret = div.offsetHeight === 3; st.parentNode.removeChild(st); div.parentNode.removeChild(div); } return ret; };
  • 37. tests[csstransitions] = function() { // set_css_all( 'transition:all .5s linear' ); return test_props_all( 'transitionProperty' ); }; // @font-face detection routine created by Paul Irish - paulirish.com // Merged into Modernizr with approval. Read more about Paul's work here: // http://paulirish.com/2009/font-face-feature-detection/ tests[fontface] = function(){ var fontret; if (/*@[email protected](@_jscript_version>=5)[email protected] @*/0) fontret = true; else {
  • 38. // Create variables for dedicated @font-face test var st = doc.createElement('style'), spn = doc.createElement('span'), size, isFakeBody = false, body = doc.body, callback, isCallbackCalled; // The following is a font-face + glyph definition for the . character: st.textContent = "@font-face{font- family:testfont;src:url('data:font/ttf;base64,AAEAAAAMAIAA AwBAT1MvMliohmwAAADMAAAAVmNtYXCp5qrBAAABJA AAANhjdnQgACICiAAAAfwAAAAEZ2FzcP//AAMAAAIAAA AACGdseWYv5OZoAAACCAAAANxoZWFk69bnvwAAAuQA AAA2aGhlYQUJAt8AAAMcAAAAJGhtdHgGDgC4AAADQAA AABRsb2NhAIQAwgAAA1QAAAAMbWF4cABVANgAAANg AAAAIG5hbWUgXduAAAADgAAABPVwb3N03NkzmgAACH gAAAA4AAECBAEsAAUAAAKZAswAAACPApkCzAAAAesA MwEJAAACAAMDAAAAAAAAgAACbwAAAAoAAAAAAAA AAFBmRWQAAAAgqS8DM/8zAFwDMwDNAAAABQAAAAA AAAAAAAMAAAADAAAAHAABAAAAAABGAAMAAQAA AK4ABAAqAAAABgAEAAEAAgAuqQD//wAAAC6pAP///9ZX AwAAAAAAAAACAAAABgBoAAAAAAAvAAEAAAAAAAA AAAAAAAAAAAABAAIAAAAAAAAAAgAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB AAEACoAAAAGAAQAAQACAC6pAP//AAAALqkA////1lcDA AAAAAAAAAIAAAAiAogAAAAB//8AAgACACIAAAEyAqoA
  • 39. AwAHAC6xAQAvPLIHBADtMrEGBdw8sgMCAO0yALEDAC8 8sgUEAO0ysgcGAfw8sgECAO0yMxEhESczESMiARDuzMwCq v1WIgJmAAACAFUAAAIRAc0ADwAfAAATFRQWOwEyNj0 BNCYrASIGARQGKwEiJj0BNDY7ATIWFX8aIvAiGhoi8CIaA ZIoN/43KCg3/jcoAWD0JB4eJPQkHh7++EY2NkbVRjY2RgAA AAABAEH/+QCdAEEACQAANjQ2MzIWFAYjIkEeEA8fHw8Q DxwWFhwWAAAAAQAAAAIAAIuYbWpfDzz1AAsEAAAAA ADFn9IuAAAAAMWf0i797/8zA4gDMwAAAAgAAgAAAAAA AAABAAADM/8zAFwDx/3v/98DiAABAAAAAAAAAAAAAA AAAAAABQF2ACIAAAAAAVUAAAJmAFUA3QBBAAAAKg AqACoAWgBuAAEAAAAFAFAABwBUAAQAAgAAAAEAAQ AAAEAALgADAAMAAAAQAMYAAQAAAAAAAACLAAAA AQAAAAAAAQAhAIsAAQAAAAAAAgAFAKwAAQAAAAA AAwBDALEAAQAAAAAABAAnAPQAAQAAAAAABQAKAR sAAQAAAAAABgAmASUAAQAAAAAADgAaAUsAAwABBA kAAAEWAWUAAwABBAkAAQBCAnsAAwABBAkAAgAKAr 0AAwABBAkAAwCGAscAAwABBAkABABOA00AAwABBAk ABQAUA5sAAwABBAkABgBMA68AAwABBAkADgA0A/tDb 3B5cmlnaHQgMjAwOSBieSBEYW5pZWwgSm9obnNvbi4gIFJl bGVhc2VkIHVuZGVyIHRoZSB0ZXJtcyBvZiB0aGUgT3BlbiBG b250IExpY2Vuc2UuIEtheWFoIExpIGdseXBocyBhcmUgcmVsZ WFzZWQgdW5kZXIgdGhlIEdQTCB2ZXJzaW9uIDMuYmFlYzJ hOTJiZmZlNTAzMiAtIHN1YnNldCBvZiBKdXJhTGlnaHRiYW VjMmE5MmJmZmU1MDMyIC0gc3Vic2V0IG9mIEZvbnRGb3Jn ZSAyLjAgOiBKdXJhIExpZ2h0IDogMjMtMS0yMDA5YmFlYzJ hOTJiZmZlNTAzMiAtIHN1YnNldCBvZiBKdXJhIExpZ2h0Vm Vyc2lvbiAyIGJhZWMyYTkyYmZmZTUwMzIgLSBzdWJzZXQg b2YgSnVyYUxpZ2h0aHR0cDovL3NjcmlwdHMuc2lsLm9yZy9P RkwAQwBvAHAAeQByAGkAZwBoAHQAIAAyADAAMAA5A CAAYgB5ACAARABhAG4AaQBlAGwAIABKAG8AaABuAH MAbwBuAC4AIAAgAFIAZQBsAGUAYQBzAGUAZAAgAHU AbgBkAGUAcgAgAHQAaABlACAAdABlAHIAbQBzACAAbw BmACAAdABoAGUAIABPAHAAZQBuACAARgBvAG4AdAA gAEwAaQBjAGUAbgBzAGUALgAgAEsAYQB5AGEAaAAgAE wAaQAgAGcAbAB5AHAAaABzACAAYQByAGUAIAByAGU AbABlAGEAcwBlAGQAIAB1AG4AZABlAHIAIAB0AGgAZQ
  • 40. AgAEcAUABMACAAdgBlAHIAcwBpAG8AbgAgADMALgBiA GEAZQBjADIAYQA5ADIAYgBmAGYAZQA1ADAAMwAyAC AALQAgAHMAdQBiAHMAZQB0ACAAbwBmACAASgB1AHI AYQBMAGkAZwBoAHQAYgBhAGUAYwAyAGEAOQAyAGI AZgBmAGUANQAwADMAMgAgAC0AIABzAHUAYgBzAGU AdAAgAG8AZgAgAEYAbwBuAHQARgBvAHIAZwBlACAAM gAuADAAIAA6ACAASgB1AHIAYQAgAEwAaQBnAGgAdAA gADoAIAAyADMALQAxAC0AMgAwADAAOQBiAGEAZQBj ADIAYQA5ADIAYgBmAGYAZQA1ADAAMwAyACAALQAg AHMAdQBiAHMAZQB0ACAAbwBmACAASgB1AHIAYQAgA EwAaQBnAGgAdABWAGUAcgBzAGkAbwBuACAAMgAgAGI AYQBlAGMAMgBhADkAMgBiAGYAZgBlADUAMAAzADIAI AAtACAAcwB1AGIAcwBlAHQAIABvAGYAIABKAHUAcgBh AEwAaQBnAGgAdABoAHQAdABwADoALwAvAHMAYwByA GkAcAB0AHMALgBzAGkAbAAuAG8AcgBnAC8ATwBGAEw AAAAAAgAAAAAAAP+BADMAAAAAAAAAAAAAAAAAA AAAAAAAAAAFAAAAAQACAQIAEQt6ZXJva2F5YWhsaQ== ')}"; doc.getElementsByTagName('head')[0].appendChild(st); // we don't use `serif` and we don't use `monospace` // http://github.com/Modernizr/Modernizr/issues/closed#issue/39 // http://neugierig.org/software/chromium/notes/2009/09/monospa ce-fonts-workaround.html spn.setAttribute('style','font:99px _,arial,helvetica;position:absolute;visibility:hidden');
  • 41. if (!body){ body = docElement.appendChild(doc.createElement(fontface)); isFakeBody = true; } // the data-uri'd font only has the . glyph; which is 3 pixels wide. spn.innerHTML = '........'; spn.id = 'fonttest'; body.appendChild(spn); size = spn.offsetWidth*spn.offsetHeight; spn.style.font = '99px testfont,_,arial,helvetica'; // needed for the CSSFontFaceRule false positives (ff3, chrome, op9) fontret = size !== spn.offsetWidth*spn.offsetHeight;
  • 42. function delayedCheck(){ if (!body.parentNode) return; fontret = ret[fontface] = size !== spn.offsetWidth*spn.offsetHeight; docElement.className = docElement.className.replace(/(no-)?fontfaceb/,'') + (fontret ? ' ' : ' no-') + fontface; } setTimeout(delayedCheck,fontfaceCheckDelay); setTimeout(delayedCheck,fontfaceCheckDelay*2); addEventListener('load',function(){ delayedCheck(); (isCallbackCalled = true) && callback && callback(fontret); setTimeout(function(){ if (!isFakeBody) body = spn; body.parentNode.removeChild(body); st.parentNode.removeChild(st); }, 50);
  • 43. },false); } // allow for a callback ret._fontfaceready = function(fn){ (isCallbackCalled || fontret) ? fn(fontret) : (callback = fn); } return fontret || size !== spn.offsetWidth; }; // These tests evaluate support of the video/audio elements, as well as // testing what types of content they support. // // we're using the Boolean constructor here, so that we can extend the value
  • 44. // e.g. Modernizr.video // true // Modernizr.video.ogg // 'probably' // // codec values from : http://github.com/NielsLeenheer/html5test/blob/9106a8/index.ht ml#L845 // thx to NielsLeenheer and zcorpan tests[video] = function() { var elem = doc.createElement(video), bool = !!elem[canPlayType]; if (bool){ bool = new Boolean(bool); bool.ogg = elem[canPlayType]('video/ogg; codecs="theora"'); bool.h264 = elem[canPlayType]('video/mp4; codecs="avc1.42E01E"'); bool.webm = elem[canPlayType]('video/webm; codecs="vp8, vorbis"');
  • 45. } return bool; }; tests[audio] = function() { var elem = doc.createElement(audio), bool = !!elem[canPlayType]; if (bool){ bool = new Boolean(bool); bool.ogg = elem[canPlayType]('audio/ogg; codecs="vorbis"'); bool.mp3 = elem[canPlayType]('audio/mpeg;'); // mimetypes accepted: // https://developer.mozilla.org/En/Media_formats_supported_by_ the_audio_and_video_elements // http://bit.ly/iphoneoscodecs bool.wav = elem[canPlayType]('audio/wav;
  • 46. codecs="1"'); bool.m4a = elem[canPlayType]('audio/x-m4a;') || elem[canPlayType]('audio/aac;'); } return bool; }; // both localStorage and sessionStorage are // tested in this method because otherwise Firefox will // throw an error: https://bugzilla.mozilla.org/show_bug.cgi?id=365772 // if cookies are disabled // FWIW miller device resolves to [object Storage] in all supporting browsers // except for IE who does [object Object] // IE8 Compat mode supports these features completely: // http://www.quirksmode.org/dom/html5.html
  • 47. tests[localstorage] = function() { return ('localStorage' in window) && window[localstorage] !== null; }; tests[sessionstorage] = function() { // try/catch required for pissy FF behavior try { return ('sessionStorage' in window) && window[sessionstorage] !== null; } catch(e){ return false; } }; tests[webWorkers] = function () { return !!window.Worker;
  • 48. }; tests[applicationcache] = function() { var cache = window[applicationcache]; return !!(cache && (typeof cache.status != 'undefined') && (typeof cache.update == 'function') && (typeof cache.swapCache == 'function')); }; // thanks to Erik Dahlstrom tests[svg] = function(){ return !!doc.createElementNS && !!doc.createElementNS( "http://www.w3.org/2000/svg", "svg").createSVGRect; }; // thanks to F1lt3r and lucideer // http://github.com/Modernizr/Modernizr/issues#issue/35
  • 49. tests[smil] = function(){ return !!doc.createElementNS && /SVG/.test(tostring.call(doc.createElementNS('http://www.w3.or g/2000/svg','animate'))); }; tests[svgclippaths] = function(){ // returns a false positive in saf 3.2? return !!doc.createElementNS && /SVG/.test(tostring.call(doc.createElementNS('http://www.w3.or g/2000/svg','clipPath'))); }; // input features and input types go directly onto the ret object, bypassing the tests loop. // hold this guy to execute in a moment. function webforms(){ // Run through HTML5's new input attributes to see if the UA understands any.
  • 50. // We're using f which is the <input> element created early on // Mike Taylr has created a comprehensive resource for testing these attributes // when applied to all input types: // http://miketaylr.com/code/input-type-attr.html // spec: http://www.whatwg.org/specs/web-apps/current- work/multipage/the-input-element.html#input-type-attr- summary ret[input] = (function(props) { for (var i = 0,len=props.length;i<len;i++) { attrs[ props[i] ] = !!(props[i] in f); } return attrs; })('autocomplete autofocus list placeholder max min multiple pattern required step'.split(' ')); // Run through HTML5's new input types to see if the UA understands any. // This is put behind the tests runloop because it doesn't return a // true/false like all the other tests; instead, it returns an
  • 51. object // containing each input type with its corresponding true/false value // Big thx to @miketaylr for the html5 forms expertise. http://miketaylr.com/ ret[inputtypes] = (function(props) { for (var i = 0,bool,len=props.length;i<len;i++) { f.setAttribute('type', props[i]); bool = f.type !== 'text'; // chrome likes to falsely purport support, so we feed it a textual value // if that doesnt succeed then we know there's a custom UI if (bool){ f.value = smile; /* Safari 4 is allowing the smiley as a value, and incorrecty failing..
  • 52. the test fixes for webkit only, but breaks Opera.. if (/range/.test(f.type)){ bool = test_props_all('appearance',function(prop,m){ return m_style[prop] !== 'textfield' }) } */ if (/tel|search/.test(f.type)){ // spec doesnt define any special parsing or detectable UI // behaviors so we pass these through as true } else if (/url|email/.test(f.type)) { // real url and email support comes with prebaked validation. bool = f.checkValidity && f.checkValidity() === false; } else {
  • 53. bool = f.value != smile; } } inputs[ props[i] ] = !!bool; } return inputs; })('search tel url email datetime date month week time datetime-local number range color'.split(' ')); } // end of test definitions // Run through all tests and detect their support in the current UA.
  • 54. // todo: hypothetically we could be doing an array of tests and use a basic loop here. for ( var feature in tests ) { if ( hasOwnProperty( tests, feature ) ) { // run the test, throw the return value into the Modernizr, // then based on that boolean, define an appropriate className // and push it into an array of classes we'll join later. classes.push( ( ( ret[ feature.toLowerCase() ] = tests[ feature ]() ) ? '' : 'no-' ) + feature.toLowerCase() ); } } // input tests need to run. if (!ret[input]) webforms();
  • 55. /** * Addtest allows the user to define their own feature tests * the result will be added onto the Modernizr object, * as well as an appropriate className set on the html element * * @param feature - String naming the feature * @param test - Function returning true if feature is supported, false if not */ ret.addTest = function (feature, test) { feature = feature.toLowerCase(); if (ret[ feature ]) { return; // quit if you're trying to overwrite an existing test } test = !!(test());
  • 56. docElement.className += ' ' + (test ? '' : 'no-') + feature; ret[ feature ] = test; return ret; // allow chaining. }; /** * Reset m.style.cssText to nothing to reduce memory footprint. */ set_css( '' ); m = f = null; // Enable HTML 5 elements for styling in IE. // fyi: jscript version does not reflect trident version // therefore ie9 in ie7 mode will still have a jScript v.9 if ( enableHTML5 && (function(){ var elem = doc.createElement("div"); elem.innerHTML = "<elem></elem>"; return elem.childNodes.length !== 1; })()) {
  • 57. // iepp v1.5.1 MIT @jon_neal http://code.google.com/p/ie-print-protector/ (function(p,e){function q(a,b){if(g[a])g[a].styleSheet.cssText+=b;else{var c=r[l],d=e[j]("style");d.media=a;c.insertBefore(d,c[l]);g[a]=d;q( a,b)}}function s(a,b){for(var c=new RegExp("b("+m+")b(?!.*[;}])","gi"),d=function(k){return".ie pp_"+k},h=- 1;++h<a.length;){b=a[h].media||b;s(a[h].imports,b);q(b,a[h].css Text.replace(c,d))}}function t(){for(var a,b=e.getElementsByTagName("*"),c,d,h=new RegExp("^"+m+"$","i"),k=- 1;++k<b.length;)if((a=b[k])&&(d=a.nodeName.match(h))){c=ne w RegExp("^s*<"+d+"(.*)/"+d+">s*$","i");i.innerHTML=a.o uterHTML.replace(/r|n/g," ").replace(c,a.currentStyle.display=="block"?"<div$1/div>":"<s pan$1/span>");c=i.childNodes[0];c.className+=" iepp_"+d;c=f[f.length]=[a,c];a.parentNode.replaceChild(c[1],c[ 0])}s(e.styleSheets,"all")}function u(){for(var a=- 1,b;++a<f.length;)f[a][1].parentNode.replaceChild(f[a][0],f[a][1 ]);for(b in g)r[l].removeChild(g[b]);g={};f=[]}for(var r=e.documentElement,i=e.createDocumentFragment(),g={},m=" abbr|article|aside|audio|canvas|command|datalist|details|figure|fi gcaption|footer|header|hgroup|keygen|mark|meter|nav|output|pro gress|section|source|summary|time|video",n=m.split("|"),f=[],o= - 1,l="firstChild",j="createElement";++o<n.length;){e[j](n[o]);i[j ](n[o])}i=i.appendChild(e[j]("div"));p.attachEvent("onbeforepri nt",t);p.attachEvent("onafterprint",u)})(this,doc); }
  • 58. // Assign private properties to the return object with prefix ret._enableHTML5 = enableHTML5; ret._version = version; // Remove "no-js" class from <html> element, if it exists: docElement.className=docElement.className.replace(/bno- jsb/,'') + ' js'; // Add the new classes to the <html> element. docElement.className += ' ' + classes.join( ' ' ); return ret; })(this,this.document); Twanda.Malcolm12-6-16/results.css /* New Perspectives on HTML, CSS, and JavaScript
  • 59. Tutorial 12 Case Problem 2 Filename: results.css This file contains styles used in the election.htm file */ /* Default Styles */ * { list-style: none; margin: 0px; padding: 0px; } header, figure, footer, article, nav, section {
  • 60. display: block; } body { background: white url(back.jpg) top left repeat-y; font-family: Verdana, Geneva, sans-serif; } nav { float: left; width: 200px; } nav ul { margin-left: 15px; } nav ul li {
  • 61. line-height: 35px; height: 35px; margin: 5px 0px; } nav ul li a { color: black; font-size: 0.9em; text-decoration: none; } nav ul li a:hover { text-decoration: underline; } article { float: left; margin: 20px 0px 0px 20px;
  • 62. } article h1 { font-size: 22px; letter-spacing: 5px; margin: 0px; } article h2 { font-size: 14px; margin-top: 12px; margin-bottom: 0px; } article table { font-size: 10px;
  • 63. margin-top: 0px; border-collapse: collapse; } article th { width: 170px; text-align: left; border-bottom: 1px solid black; } article td { margin: 0px; } article .num { text-align: right; width: 50px; padding-right: 5px;
  • 64. } article .dem { background-color: rgb(174,224,250); width: 2px; } article .rep { background-color: red; width: 2px; } article .ind { background-color: rgb(255,192,255); width: 2px; } article .green {
  • 65. background-color: rgb(128,255,128); width: 2px; } article .lib { background-color: cyan; width: 2px; } Twanda.Malcolm12-6-16/votes.js /* New Perspectives on HTML, CSS, and JavaScript Tutorial 12 Case Problem 2 Filename: votes.js Variable List:
  • 66. races: The name of the five races name1 - name5: The name of the candidate for races 1 through 5 party1 - party5: The party affliations of the candidates votes1 - votes5: The number of votes the candidate has received */ var race = new Array(); var name1 = new Array(); var name2 = new Array(); var name3 = new Array(); var name4 = new Array(); var name5 = new Array(); var party1 = new Array(); var party2 = new Array();
  • 67. var party3 = new Array(); var party4 = new Array(); var party5 = new Array(); var votes1 = new Array(); var votes2 = new Array(); var votes3 = new Array(); var votes4 = new Array(); var votes5 = new Array(); race[0]="1st Congressional District"; race[1]="2nd Congressional District"; race[2]="3rd Congressional District"; race[3]="4th Congressional District"; race[4]="5th Congressional District"; name1[0]="Sarah Carlson";
  • 68. party1[0]="D"; votes1[0]=45125; name1[1]="Pete deJesus"; party1[1]="R"; votes1[1]=44498; name1[2]="Alan Tompkins"; party1[2]="I"; votes1[2]=5143; name2[0]="Gary Griffin"; party2[0]="D"; votes2[0]=69505; name2[1]="Frank Brown"; party2[1]="R"; votes2[1]=78133; name2[2]="Roland Washington"; party2[2]="G"; votes2[2]=8109;
  • 69. name2[3]="Karen Reese"; party2[3]="L"; votes2[3]=13004; name3[0]="Anne Sanchez"; party3[0]="D"; votes3[0]=65203; name3[1]="Cynthia Thomas"; party3[1]="R"; votes3[1]=51289; name4[0]="Jerry Wilkes"; party4[0]="D"; votes4[0]=49201; name4[1]="Barry Mitchell"; party4[1]="R"; votes4[1]=58414; name4[2]="Paula Welton";