@ -1,8 +1,9 @@
/ * V e r i t e
* Verite JS Master
* Version : 0.1
* Date : December 12 , 2011
* Copyright 2011 Verite
* Version : 0.5
* Date : April 5 , 2012
* Copyright 2012 Verite unless part of Verite Timeline ,
* if part of Timeline then it inherits Timeline ' s license .
* Designed and built by Zach Wise digitalartwork . net
* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - * /
@ -11,131 +12,87 @@
=== === === === === === === === === === === === === === === === == * /
/ * S i m p l e J a v a S c r i p t I n h e r i t a n c e
* By John Resig http : //ejohn.org/
* MIT Licensed .
=== === === === === === === === === === === === === === === === == * /
( function ( ) {
var initializing = false ,
fnTest = /xyz/ . test ( function ( ) {
xyz ;
} ) ? /\b_super\b/ : /.*/ ;
// The base Class implementation (does nothing)
this . Class = function ( ) { } ;
// Create a new Class that inherits from this class
Class . extend = function ( prop ) {
var _super = this . prototype ;
// Instantiate a base class (but only create the instance,
// don't run the init constructor)
initializing = true ;
var prototype = new this ( ) ;
initializing = false ;
// Copy the properties over onto the new prototype
for ( var name in prop ) {
// Check if we're overwriting an existing function
prototype [ name ] = typeof prop [ name ] == "function" &&
typeof _super [ name ] == "function" && fnTest . test ( prop [ name ] ) ?
( function ( name , fn ) {
return function ( ) {
var tmp = this . _super ;
// Add a new ._super() method that is the same method
// but on the super-class
this . _super = _super [ name ] ;
// The method only need to be bound temporarily, so we
// remove it when we're done executing
var ret = fn . apply ( this , arguments ) ;
this . _super = tmp ;
return ret ;
} ;
} ) ( name , prop [ name ] ) :
prop [ name ] ;
}
( function ( ) {
var initializing = false , fnTest = /xyz/ . test ( function ( ) { xyz ; } ) ? /\b_super\b/ : /.*/ ;
// The base Class implementation (does nothing)
this . Class = function ( ) { } ;
// Create a new Class that inherits from this class
Class . extend = function ( prop ) {
var _super = this . prototype ;
// Instantiate a base class (but only create the instance,
// don't run the init constructor)
initializing = true ;
var prototype = new this ( ) ;
initializing = false ;
// Copy the properties over onto the new prototype
for ( var name in prop ) {
// Check if we're overwriting an existing function
prototype [ name ] = typeof prop [ name ] == "function" &&
typeof _super [ name ] == "function" && fnTest . test ( prop [ name ] ) ?
( function ( name , fn ) {
return function ( ) {
var tmp = this . _super ;
// Add a new ._super() method that is the same method
// but on the super-class
this . _super = _super [ name ] ;
// The method only need to be bound temporarily, so we
// remove it when we're done executing
var ret = fn . apply ( this , arguments ) ;
this . _super = tmp ;
return ret ;
} ;
} ) ( name , prop [ name ] ) :
prop [ name ] ;
}
// The dummy class constructor
function Class ( ) {
// All construction is actually done in the init method
if ( ! initializing && this . init )
this . init . apply ( this , arguments ) ;
}
// Populate our constructed prototype object
Class . prototype = prototype ;
// Enforce the constructor to be what we expect
Class . prototype . constructor = Class ;
// And make this class extendable
Class . extend = arguments . callee ;
return Class ;
} ;
} ) ( ) ;
/ * C L A S S E X T E N D E X A M P L E
=== === === === === === === === === === === === === === === === == * /
/ *
var Person = Class . extend ( {
init : function ( isDancing ) {
this . dancing = isDancing ;
} ,
dance : function ( ) {
return this . dancing ;
}
} ) ;
var Ninja = Person . extend ( {
init : function ( ) {
this . _super ( false ) ;
} ,
dance : function ( ) {
// Call the inherited version of dance()
return this . _super ( ) ;
} ,
swingSword : function ( ) {
return true ;
}
} ) ;
var p = new Person ( true ) ;
p . dance ( ) ; // => true
// The dummy class constructor
function Class ( ) {
// All construction is actually done in the init method
if ( ! initializing && this . init )
this . init . apply ( this , arguments ) ;
}
var n = new Ninja ( ) ;
n . dance ( ) ; // => false
n . swingSword ( ) ; // => true
// Populate our constructed prototype object
Class . prototype = prototype ;
// Should all be true
p instanceof Person && p instanceof Class &&
n instanceof Ninja && n instanceof Person && n instanceof Class
* /
// Enforce the constructor to be what we expect
Class . prototype . constructor = Class ;
// And make this class extendable
Class . extend = arguments . callee ;
return Class ;
} ;
} ) ( ) ;
/ * A c c e s s t o t h e G l o b a l O b j e c t
* access the global object without hard - coding the identifier window
=== === === === === === === === === === === === === === === === == * /
var global = ( function ( ) {
return this || ( 1 , eval ) ( 'this' ) ;
} ( ) ) ;
/ * V M M
=== === === === === === === === === === === === === === === === == * /
if ( typeof VMM == 'undefined' ) {
/ * M a i n S c o p e C o n t a i n e r
=== === === === === === === === === === === === === === === === == * /
//var VMM = {};
var VMM = Class . extend ( {
} ) ;
var VMM = Class . extend ( { } ) ;
/ * M a s t e r C o n f i g
=== === === === === === === === === === === === === === === === == * /
@ -239,7 +196,6 @@ if (typeof VMM == 'undefined') {
} ;
/ * L I B R A R Y A B S T R A C T I O N
=== === === === === === === === === === === === === === === === == * /
@ -344,7 +300,30 @@ if (typeof VMM == 'undefined') {
// VMM.getJSON(url, the_function);
VMM . getJSON = function ( url , the _function ) {
if ( typeof ( jQuery ) != 'undefined' ) {
$ . getJSON ( url , the _function ) ;
/ * C H E C K F O R I E A N D U S E U s e M i c r o s o f t X D R
=== === === === === === === === === === === === === === === === == * /
if ( VMM . Browser . browser == "Explorer" && parseInt ( VMM . Browser . version , 10 ) >= 8 && window . XDomainRequest ) {
trace ( "it's ie" ) ;
var ie _url = url ;
if ( ie _url . match ( '^http://' ) ) {
//ie_url = ie_url.replace("http://","//");
$ . getJSON ( url , the _function ) ;
} else if ( ie _url . match ( '^https://' ) ) {
ie _url = ie _url . replace ( "https://" , "http://" ) ;
var xdr = new XDomainRequest ( ) ;
xdr . open ( "get" , ie _url ) ;
xdr . onload = function ( ) {
var ie _json = VMM . parseJSON ( xdr . responseText ) ;
return the _function ( ie _json ) ;
}
xdr . send ( ) ;
}
} else {
$ . getJSON ( url , the _function ) ;
}
}
}
// VMM.parseJSON(the_json);
@ -1259,6 +1238,8 @@ if (typeof VMM == 'undefined') {
} else if ( m . type == "youtube" ) {
mediaElem = "<div class='thumbnail youtube'></div>" ;
return mediaElem ;
} else if ( m . type == "googledoc" ) {
mediaElem = "" ;
} else if ( m . type == "vimeo" ) {
mediaElem = "<div class='thumbnail vimeo'></div>" ;
return mediaElem ;
@ -1278,7 +1259,9 @@ if (typeof VMM == 'undefined') {
mediaElem = "" ;
return mediaElem ;
} else if ( m . type == "website" ) {
mediaElem = "<div class='thumbnail website'></div>" ;
//mediaElem = "<div class='thumbnail website'></div>";
mediaElem = "<div class='thumbnail'><img src='http://api.snapito.com/free/sc?url=" + m . id + "' width='" + _w + "px' height='" + _h + "px'></div>" ;
return mediaElem ;
} else {
mediaElem = "<div class='thumbnail'></div>" ;
@ -1331,6 +1314,14 @@ if (typeof VMM == 'undefined') {
var flickr _id = "flickr_" + m . id ;
mediaElem = "<img id='" + flickr _id + "_large" + "'>" ;
VMM . ExternalAPI . flickr . getPhoto ( m . id , "#" + flickr _id ) ;
} else if ( m . type == "googledoc" ) {
if ( m . id . match ( /docs.google.com/i ) ) {
mediaElem = "<iframe class='media-frame doc' frameborder='0' width='100%' height='100%' src='" + m . id + "&embedded=true'></iframe>" ;
} else {
mediaElem = "<iframe class='media-frame doc' frameborder='0' width='100%' height='100%' src='http://docs.google.com/viewer?url=" + m . id + "&embedded=true'></iframe>" ;
}
} else if ( m . type == "youtube" ) {
mediaElem = "<div class='media-frame video youtube' id='youtube_" + m . id + "'>Loading YouTube video...</div>" ;
VMM . ExternalAPI . youtube . init ( m . id ) ;
@ -1355,7 +1346,8 @@ if (typeof VMM == 'undefined') {
trace ( "NO KNOWN MEDIA TYPE FOUND TRYING TO JUST PLACE THE HTML" ) ;
mediaElem = VMM . Util . properQuotes ( m . id ) ;
} else if ( m . type == "website" ) {
mediaElem = "<iframe class='media-frame' frameborder='0' width='100%' height='100%' scrolling='yes' marginheight='0' marginwidth='0' src='" + m . id + "'></iframe>"
//mediaElem = "<iframe class='media-frame' frameborder='0' width='100%' height='100%' scrolling='yes' marginheight='0' marginwidth='0' src='" + m.id + "'></iframe>";
mediaElem = "<a href='" + m . id + "' target='_blank'>" + "<img src='http://api.snapito.com/free/lc?url=" + m . id + "'></a>" ;
} else {
trace ( "NO KNOWN MEDIA TYPE FOUND" ) ;
trace ( m . type ) ;
@ -1431,7 +1423,7 @@ if (typeof VMM == 'undefined') {
//maps.google.com
media . type = "google-map" ;
media . id = d . split ( /src=['|"][^'|"]*?['|"]/gi ) ;
trace ( "google map " + media . id ) ;
//trace("google map " + media.id);
success = true ;
} else if ( d . match ( "flickr.com/photos" ) ) {
media . type = "flickr" ;
@ -1439,12 +1431,17 @@ if (typeof VMM == 'undefined') {
media . id = d . split ( "photos\/" ) [ 1 ] . split ( "/" ) [ 1 ] ;
//media.id = media.id.split("/")[1];
trace ( "FLICKR " + media . id ) ;
//trace("FLICKR " + media.id);
success = true ;
} else if ( d . match ( /jpg|jpeg|png|gif/i ) ) {
media . type = "image" ;
media . id = d ;
success = true ;
} else if ( d . match ( /docs.google.com|.DOC|.DOCX|.XLS|.XLSX|.PPT|.PPTX|.PDF|.PAGES|.AI|.PSD|.TIFF|.DXF|.SVG|.EPS|.PS|.TTF|.XPS|.ZIP|.RAR/i ) ) {
media . type = "googledoc" ;
media . id = d ;
success = true ;
} else if ( d . indexOf ( 'http://' ) == 0 ) {
media . type = "website" ;
media . id = d ;
@ -1467,6 +1464,7 @@ if (typeof VMM == 'undefined') {
VMM . Keys = {
flickr : "6d6f59d8d30d79f4f402a7644d5073e3" ,
google : "AIzaSyDUHXB8hefYssfwGpySnQmzTqL9n0qZ3T4"
}
VMM . ExternalAPI = {
@ -1475,13 +1473,13 @@ if (typeof VMM == 'undefined') {
tweetArray : [ ] ,
// VMM.ExternalAPI.twitter.getHTML(id);
getHTML : function ( id ) {
var the _url = "https://api.twitter.com/1/statuses/oembed.json?id=" + id + "&callback=?" ;
VMM . getJSON ( the _url , function ( d ) {
VMM . ExternalAPI . twitter . onJSONLoaded ( d , id ) ;
} ) ;
//var the_url = document.location.protocol + "//api.twitter.com/1/statuses/oembed.json?id=" + id+ "&callback=?";
var the _url = "http://api.twitter.com/1/statuses/oembed.json?id=" + id + "&callback=?" ;
VMM . getJSON ( the _url , VMM . ExternalAPI . twitter . onJSONLoaded ) ;
} ,
onJSONLoaded : function ( d , id ) {
onJSONLoaded : function ( d ) {
trace ( "TWITTER JSON LOADED" ) ;
var id = d . id ;
VMM . attachElement ( "#" + id , VMM . ExternalAPI . twitter . linkify ( d . html ) ) ;
} ,
//somestring = VMM.ExternalAPI.twitter.linkify(d);
@ -1531,7 +1529,7 @@ if (typeof VMM == 'undefined') {
/ * F E T C H T H E D A T A
=== === === === === === === === === === === === === === === === == * /
var the _url = "https ://api.twitter.com/1/statuses/show.json?id=" + twitter _id + "&include_entities=true&callback=?" ;
var the _url = "http://api.twitter.com/1/statuses/show.json?id=" + twitter _id + "&include_entities=true&callback=?" ;
VMM . getJSON ( the _url , function ( d ) {
var tweet = { }
@ -1602,43 +1600,32 @@ if (typeof VMM == 'undefined') {
// VMM.ExternalAPI.twitter.prettyHTML(id);
prettyHTML : function ( id ) {
// https://api.twitter.com/1/statuses/show.json?id=164165553810976768&include_entities=true
var the _url = "https://api.twitter.com/1/statuses/show.json?id=" + id + "&include_entities=true&callback=?" ;
VMM . getJSON ( the _url , function ( d ) {
VMM . ExternalAPI . twitter . formatJSON ( d , id ) ;
} ) ;
// https://api.twitter.com/1/statuses/show.json?id=164165553810976768&include_entities=true&callback=?
var the _url = "http://api.twitter.com/1/statuses/show.json?id=" + id + "&include_entities=true&callback=?" ;
VMM . getJSON ( the _url , VMM . ExternalAPI . twitter . formatJSON ) ;
} ,
formatJSON : function ( d , id ) {
formatJSON : function ( d ) {
trace ( "TWITTER JSON LOADED F" ) ;
var id = d . id _str ;
var twit = "<blockquote><p>" ;
var td = VMM . Util . linkify ( d . text ) ;
td = td . replace ( /(@([\w]+))/g , "<a href='http://twitter.com/$2'>$1</a>" ) ;
td = td . replace ( /(#([\w]+))/g , "<a href='http://twitter.com/#search?q=%23$2'>$1</a>" ) ;
//twit += VMM.Util.linkify(d.text);
twit += td ;
twit += "</p></blockquote>" ;
//twit += "— " + d.user.name + " (<a href='https://twitter.com/" + d.user.screen_name + "'>@" + d.user.screen_name + "</a>) <a href='https://twitter.com/" + d.user.screen_name + "/status/" + d.id + "'>" + d.created_at + " </a>";
//twit += "<a href='" + + "'>" + VMM.ExternalAPI.twitter.prettyParseTwitterDate(d.created_at);
//twit += "<span class='created-at'><a href='https://twitter.com/" + d.user.screen_name + "/status/" + d.id + "'>" + VMM.ExternalAPI.twitter.prettyParseTwitterDate(d.created_at) + " </a></span>";
//twit += "<span class='created-at'><a href='https://twitter.com/" + d.user.screen_name + "/status/" + d.id + "'>" + "Tweet Details" + " </a></span>";
twit += " <a href='https://twitter.com/" + d . user . screen _name + "/status/" + d . id + "' alt='link to original tweet' title='link to original tweet'>" + "<span class='created-at'></span>" + " </a>" ;
twit += "<div class='vcard author'>"
twit += "<div class='vcard author'>" ;
twit += "<a class='screen-name url' href='https://twitter.com/" + d . user . screen _name + "' data-screen-name='" + d . user . screen _name + "'>" ;
twit += "<span class='avatar'><img src=' " + d . user . profile _image _url + "' alt=''></span>" ;
twit += "<span class='fn'>" + d . user . name + "</span>" ;
twit += "<span class='nickname'>@" + d . user . screen _name + "</span>" ;
twit += "</a>"
twit += "</div>"
twit += "</a>" ;
twit += "</div>" ;
/ *
< blockquote class = "twitter-tweet" >
< p > Tom Brokaw asks < a href = "https://twitter.com/search/%2523Romney" > # Romney < /a> to remove from ads 1997 NBC report on <a href="https:/ / twitter . com / search / % 2523 Gingrich ">#Gingrich</a> legal troubles. Romney unmoved. <a href=" http : //t.co/re7vtLNt" title="http://thecaucus.blogs.nytimes.com/2012/01/28/nbc-news-asks-romney-campaign-to-remove-ad/?hp">thecaucus.blogs.nytimes.com/2012/01/28/nbc…</a></p>
— Jim Roberts ( < a href = "http://twitter.com/nytjim" > @ nytjim < /a>) <a href="https:/ / twitter . com / nytjim / status / 163461388193366016 " data-datetime=" 2012 - 01 - 29 T03 : 20 : 06 + 00 : 00 " > January 29 , 2012 < / a >
< / b l o c k q u o t e >
* /
VMM . attachElement ( "#" + id , twit ) ;
//VMM.attachElement("#"+id, VMM.ExternalAPI.twitter.linkify(twit) );
}
} ,
@ -1650,32 +1637,38 @@ if (typeof VMM == 'undefined') {
flickr : {
getPhoto : function ( mid , id ) {
// http://soundcloud.com/oembed?iframe=true&url=http://soundcloud.com/erasedtapes/olafur-arnalds-poland
var the _url = "http://api.flickr.com/services/rest/?method=flickr.photos.getSizes&api_key=" + VMM . Keys . flickr + "&photo_id=" + mid + "&format=json&nojsoncallback=1" ;
VMM . getJSON ( the _url , function ( d ) {
var flickr _large _id = id + "_large" ;
var flickr _thumb _id = id + "_thumb" ;
var flickr _img _large = d . sizes . size [ d . sizes . size . length - 1 ] . source ;
var flickr _img _thumb = d . sizes . size [ 0 ] . source ;
VMM . Element . attr ( flickr _large _id , "src" , flickr _img _large ) ;
VMM . Element . attr ( flickr _thumb _id , "src" , flickr _img _thumb ) ;
} ) ;
// http://api.flickr.com/services/rest/?method=flickr.photos.getSizes&api_key=6d6f59d8d30d79f4f402a7644d5073e3&photo_id=6115056146&format=json&nojsoncallback=1
var the _url = "http://api.flickr.com/services/rest/?method=flickr.photos.getSizes&api_key=" + VMM . Keys . flickr + "&photo_id=" + mid + "&format=json&jsoncallback=?" ;
VMM . getJSON ( the _url , VMM . ExternalAPI . flickr . setPhoto ) ;
} ,
//VMM.ExternalAPI.flickr.setPhoto(d);
setPhoto : function ( d ) {
var flickr _id = d . sizes . size [ 0 ] . url . split ( "photos\/" ) [ 1 ] . split ( "/" ) [ 1 ] ;
var id = "flickr_" + flickr _id ;
var flickr _large _id = id + "_large" ;
var flickr _thumb _id = id + "_thumb" ;
var flickr _img _large = d . sizes . size [ d . sizes . size . length - 1 ] . source ;
var flickr _img _thumb = d . sizes . size [ 0 ] . source ;
VMM . Element . attr ( "#" + flickr _large _id , "src" , flickr _img _large ) ;
VMM . Element . attr ( "#" + flickr _thumb _id , "src" , flickr _img _thumb ) ;
}
} ,
soundcloud : {
// VMM.ExternalAPI.soundcloud.getSound(url, id)
/ *
REFORMAT TO USE API FOR CUSTOM PLAYERS
* /
getSound : function ( url , id ) {
// http://soundcloud.com/oembed?iframe=true&url=http://soundcloud.com/erasedtapes/olafur-arnalds-poland
var the _url = "http://soundcloud.com/oembed?iframe=true&url=" + url + "" ;
var the _url = "http://soundcloud.com/oembed?url=" + url + "&format=js&callback=? " ;
VMM . getJSON ( the _url , function ( d ) {
VMM . attachElement ( "#" + id , d . html ) ;
} ) ;
} ,
} ,
// VMM.ExternalAPI.youtube.init(id);
@ -1691,11 +1684,10 @@ if (typeof VMM == 'undefined') {
if ( VMM . master _config . youtube . api _loaded ) {
} else {
var tag = document . createElement ( 'script' ) ;
tag . src = "http://www.youtube.com/player_api" ;
var firstScriptTag = document . getElementsByTagName ( 'script' ) [ 0 ] ;
firstScriptTag . parentNode . insertBefore ( tag , firstScriptTag ) ;
VMM . master _config . youtube . api _loaded = true ;
VMM . LoadLib . js ( 'http://www.youtube.com/player_api' , function ( ) {
trace ( "YouTube API Library Loaded" ) ;
} ) ;
}
}
@ -2036,21 +2028,6 @@ if( typeof( jQuery ) != 'undefined' ){
/ * C L O N E O B J E C T S
=== === === === === === === === === === === === === === === === == * /
/ *
Object . prototype . clone = function ( ) {
var newObj = ( this instanceof Array ) ? [ ] : { } ;
for ( i in this ) {
if ( i == 'clone' ) continue ;
if ( this [ i ] && typeof this [ i ] == "object" ) {
newObj [ i ] = this [ i ] . clone ( ) ;
} else newObj [ i ] = this [ i ]
} return newObj ;
} ;
* /
/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Begin VMM . Core . js
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /
@ -2466,7 +2443,9 @@ if(typeof VMM != 'undefined' && typeof VMM.Slider == 'undefined') {
var _media ;
bw = VMM . createElement ( "div" , d [ i ] . content , "content" ) ;
_slide = VMM . appendAndGetElement ( $slides _items , "<div>" , "slider-item" , bw ) ;
slides . push ( _slide ) ;
}
@ -3199,10 +3178,265 @@ if(typeof VMM != 'undefined' && typeof VMM.Util == 'undefined') {
} ) . init ( ) ;
}
/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Begin VMM . LoadLib . js
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /
/ *
LoadLib
Based on LazyLoad by Ryan Grove
https : //github.com/rgrove/lazyload/
Copyright ( c ) 2011 Ryan Grove < ryan @ wonko . com >
All rights reserved .
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 .
=== === === === === === === === === === === === === === === === == * /
if ( typeof VMM != 'undefined' && typeof VMM . LoadLib == 'undefined' ) {
//VMM.LoadLib.js('http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js', onJQueryLoaded);
//VMM.LoadLib.css('http://someurl.css', onCSSLoaded);
VMM . LoadLib = ( function ( doc ) {
var env ,
head ,
pending = { } ,
pollCount = 0 ,
queue = { css : [ ] , js : [ ] } ,
styleSheets = doc . styleSheets ;
var loaded _Array = [ ] ;
function isLoaded ( url ) {
for ( var i = 0 ; i < loaded _Array . length ; i ++ ) {
var has _been _loaded = false ;
if ( loaded _Array [ i ] == url ) {
has _been _loaded = true ;
}
if ( ! has _been _loaded ) {
loaded _Array . push ( url ) ;
}
return has _been _loaded ;
}
}
function createNode ( name , attrs ) {
var node = doc . createElement ( name ) , attr ;
for ( attr in attrs ) {
if ( attrs . hasOwnProperty ( attr ) ) {
node . setAttribute ( attr , attrs [ attr ] ) ;
}
}
return node ;
}
function finish ( type ) {
var p = pending [ type ] ,
callback ,
urls ;
if ( p ) {
callback = p . callback ;
urls = p . urls ;
urls . shift ( ) ;
pollCount = 0 ;
if ( ! urls . length ) {
callback && callback . call ( p . context , p . obj ) ;
pending [ type ] = null ;
queue [ type ] . length && load ( type ) ;
}
}
}
function getEnv ( ) {
var ua = navigator . userAgent ;
env = {
async : doc . createElement ( 'script' ) . async === true
} ;
( env . webkit = /AppleWebKit\// . test ( ua ) )
|| ( env . ie = /MSIE/ . test ( ua ) )
|| ( env . opera = /Opera/ . test ( ua ) )
|| ( env . gecko = /Gecko\// . test ( ua ) )
|| ( env . unknown = true ) ;
}
function load ( type , urls , callback , obj , context ) {
var _finish = function ( ) { finish ( type ) ; } ,
isCSS = type === 'css' ,
nodes = [ ] ,
i , len , node , p , pendingUrls , url ;
env || getEnv ( ) ;
if ( urls ) {
urls = typeof urls === 'string' ? [ urls ] : urls . concat ( ) ;
if ( isCSS || env . async || env . gecko || env . opera ) {
queue [ type ] . push ( {
urls : urls ,
callback : callback ,
obj : obj ,
context : context
} ) ;
} else {
for ( i = 0 , len = urls . length ; i < len ; ++ i ) {
queue [ type ] . push ( {
urls : [ urls [ i ] ] ,
callback : i === len - 1 ? callback : null ,
obj : obj ,
context : context
} ) ;
}
}
}
if ( pending [ type ] || ! ( p = pending [ type ] = queue [ type ] . shift ( ) ) ) {
return ;
}
head || ( head = doc . head || doc . getElementsByTagName ( 'head' ) [ 0 ] ) ;
pendingUrls = p . urls ;
for ( i = 0 , len = pendingUrls . length ; i < len ; ++ i ) {
url = pendingUrls [ i ] ;
if ( isCSS ) {
node = env . gecko ? createNode ( 'style' ) : createNode ( 'link' , {
href : url ,
rel : 'stylesheet'
} ) ;
} else {
node = createNode ( 'script' , { src : url } ) ;
node . async = false ;
}
node . className = 'lazyload' ;
node . setAttribute ( 'charset' , 'utf-8' ) ;
if ( env . ie && ! isCSS ) {
node . onreadystatechange = function ( ) {
if ( /loaded|complete/ . test ( node . readyState ) ) {
node . onreadystatechange = null ;
_finish ( ) ;
}
} ;
} else if ( isCSS && ( env . gecko || env . webkit ) ) {
if ( env . webkit ) {
p . urls [ i ] = node . href ;
pollWebKit ( ) ;
} else {
node . innerHTML = '@import "' + url + '";' ;
pollGecko ( node ) ;
}
} else {
node . onload = node . onerror = _finish ;
}
nodes . push ( node ) ;
}
for ( i = 0 , len = nodes . length ; i < len ; ++ i ) {
head . appendChild ( nodes [ i ] ) ;
}
}
function pollGecko ( node ) {
var hasRules ;
try {
hasRules = ! ! node . sheet . cssRules ;
} catch ( ex ) {
pollCount += 1 ;
if ( pollCount < 200 ) {
setTimeout ( function ( ) { pollGecko ( node ) ; } , 50 ) ;
} else {
hasRules && finish ( 'css' ) ;
}
return ;
}
finish ( 'css' ) ;
}
function pollWebKit ( ) {
var css = pending . css , i ;
if ( css ) {
i = styleSheets . length ;
while ( -- i >= 0 ) {
if ( styleSheets [ i ] . href === css . urls [ 0 ] ) {
finish ( 'css' ) ;
break ;
}
}
pollCount += 1 ;
if ( css ) {
if ( pollCount < 200 ) {
setTimeout ( pollWebKit , 50 ) ;
} else {
finish ( 'css' ) ;
}
}
}
}
return {
css : function ( urls , callback , obj , context ) {
if ( isLoaded ( urls ) ) {
return callback ;
} else {
load ( 'css' , urls , callback , obj , context ) ;
}
} ,
js : function ( urls , callback , obj , context ) {
if ( isLoaded ( urls ) ) {
return callback ;
} else {
load ( 'js' , urls , callback , obj , context ) ;
}
}
} ;
} ) ( this . document ) ;
}
/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Begin bootstrap - tooltip . js
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /
@ -3522,6 +3756,7 @@ if(typeof VMM != 'undefined' && typeof VMM.Util == 'undefined') {
// @codekit-prepend "VMM.js";
// @codekit-prepend "VMM.Core.js";
// @codekit-prepend "VMM.Util.js";
// @codekit-prepend "VMM.LoadLib.js";
// @codekit-prepend "bootstrap-tooltip.js";
/ * T i m e l i n e C l a s s c o n t a i n e d i n V M M ( v e r i t e ) n a m e s p a c e
@ -3834,6 +4069,9 @@ if(typeof VMM != 'undefined' && typeof VMM.Timeline == 'undefined') {
//c._media = VMM.createElement("div", c._media, "media-wrapper");
slide = VMM . createElement ( "div" , c . _text + c . _media , _layout _class ) ;
//trace(slide);
}
@ -5457,7 +5695,8 @@ if(typeof VMM != 'undefined' && typeof VMM.Timeline == 'undefined') {
getData : function ( raw _data ) {
var _key = VMM . Util . getUrlVars ( raw _data ) [ "key" ] ;
var _url = "https://spreadsheets.google.com/feeds/list/" + _key + "/od6/public/values?alt=json" ;
VMM . getJSON ( _url , VMM . Timeline . DataObj . model _GoogleSpreadsheet . buildData ) ;
/ *
if ( VMM . Browser . browser == "Explorer" && parseInt ( VMM . Browser . version , 10 ) >= 8 && window . XDomainRequest ) {
// Use Microsoft XDR
// going to move this to VMM.getJSON
@ -5477,11 +5716,11 @@ if(typeof VMM != 'undefined' && typeof VMM.Timeline == 'undefined') {
trace ( "not ie" ) ;
VMM . getJSON ( _url , VMM . Timeline . DataObj . model _GoogleSpreadsheet . buildData ) ;
}
* /
} ,
buildData : function ( d ) {
var _data _obj = VMM . Timeline . DataObj . data _template _obj ;
for ( var i = 0 ; i < d . feed . entry . length ; i ++ ) {