updates for loader

This commit is contained in:
rolux 2011-04-23 14:33:41 +02:00
parent 7430ef1023
commit cda03f71e9
2 changed files with 233 additions and 192 deletions

View file

@ -7,140 +7,136 @@ Ox.UI(function() {
console.log('running Ox.UI()') console.log('running Ox.UI()')
//console.log('Ox =', Ox) //console.log('Ox =', Ox)
Ox.UI.ready(function() { Ox.theme('modern');
Ox.theme('modern'); //Ox.print('$$$$', Ox.Calendar)
//Ox.print('$$$$', Ox.Calendar) new Ox.Calendar({
date: new Date(0),
new Ox.Calendar({ dates: [
date: new Date(0), {name: 'Genghis Khan', start: new Date('1162'), stop: new Date('1228'), type: 'Person'},
dates: [ {name: 'Marco Polo', start: new Date('1254'), stop: new Date('1324-01-09'), type: 'Person'},
{name: 'Genghis Khan', start: new Date('1162'), stop: new Date('1228'), type: 'Person'}, {name: 'Columbus', start: new Date('1451-08-22'), stop: new Date('1506-05-21'), type: 'Person'},
{name: 'Marco Polo', start: new Date('1254'), stop: new Date('1324-01-09'), type: 'Person'}, {name: 'Da Vinci', start: new Date('1452-04-15'), stop: new Date('1519-05-03'), type: 'Person'},
{name: 'Columbus', start: new Date('1451-08-22'), stop: new Date('1506-05-21'), type: 'Person'}, {name: 'Michelangelo', start: new Date('1475-03-06'), stop: new Date('1564-02-19'), type: 'Person'},
{name: 'Da Vinci', start: new Date('1452-04-15'), stop: new Date('1519-05-03'), type: 'Person'}, {name: 'Bruegel', start: new Date('1525'), stop: new Date('1569-09-10'), type: 'Person'},
{name: 'Michelangelo', start: new Date('1475-03-06'), stop: new Date('1564-02-19'), type: 'Person'}, {name: 'Galilei', start: new Date('1564-02-15'), stop: new Date('1642-01-09'), type: 'Person'},
{name: 'Bruegel', start: new Date('1525'), stop: new Date('1569-09-10'), type: 'Person'}, {name: 'Shakespeare', start: new Date('1564-04-26'), stop: new Date('1616-04-24'), type: 'Person'},
{name: 'Galilei', start: new Date('1564-02-15'), stop: new Date('1642-01-09'), type: 'Person'}, {name: 'Descartes', start: new Date('1596-03-31'), stop: new Date('1650-02-12'), type: 'Person'},
{name: 'Shakespeare', start: new Date('1564-04-26'), stop: new Date('1616-04-24'), type: 'Person'}, {name: 'Velazquez', start: new Date('1599-06-06'), stop: new Date('1660-08-07'), type: 'Person'},
{name: 'Descartes', start: new Date('1596-03-31'), stop: new Date('1650-02-12'), type: 'Person'}, {name: 'Vermeer', start: new Date('1632-10-31'), stop: new Date('1675-12-16'), type: 'Person'},
{name: 'Velazquez', start: new Date('1599-06-06'), stop: new Date('1660-08-07'), type: 'Person'}, {name: 'Spinoza', start: new Date('1632-11-24'), stop: new Date('1677-02-22'), type: 'Person'},
{name: 'Vermeer', start: new Date('1632-10-31'), stop: new Date('1675-12-16'), type: 'Person'}, {name: 'Louix XIV', start: new Date('1638-09-05'), stop: new Date('1715-09-02'), type: 'Person'},
{name: 'Spinoza', start: new Date('1632-11-24'), stop: new Date('1677-02-22'), type: 'Person'}, {name: 'Newton', start: new Date('1643-01-04'), stop: new Date('1727-04-01'), type: 'Person'},
{name: 'Louix XIV', start: new Date('1638-09-05'), stop: new Date('1715-09-02'), type: 'Person'}, {name: 'Leibniz', start: new Date('1646-07-01'), stop: new Date('1716-11-15'), type: 'Person'},
{name: 'Newton', start: new Date('1643-01-04'), stop: new Date('1727-04-01'), type: 'Person'}, {name: 'Kant', start: new Date('1724-04-22'), stop: new Date('1804-02-13'), type: 'Person'},
{name: 'Leibniz', start: new Date('1646-07-01'), stop: new Date('1716-11-15'), type: 'Person'}, {name: 'Napoleon', start: new Date('1769-08-15'), stop: new Date('1821-05-06'), type: 'Person'},
{name: 'Kant', start: new Date('1724-04-22'), stop: new Date('1804-02-13'), type: 'Person'}, {name: 'Hegel', start: new Date('1770-08-27'), stop: new Date('1831-11-15'), type: 'Person'},
{name: 'Napoleon', start: new Date('1769-08-15'), stop: new Date('1821-05-06'), type: 'Person'}, {name: 'Darwin', start: new Date('1809-02-12'), stop: new Date('1882-04-20'), type: 'Person'},
{name: 'Hegel', start: new Date('1770-08-27'), stop: new Date('1831-11-15'), type: 'Person'}, {name: 'Marx', start: new Date('1818-05-05'), stop: new Date('1883-03-15'), type: 'Person'},
{name: 'Darwin', start: new Date('1809-02-12'), stop: new Date('1882-04-20'), type: 'Person'}, /*
{name: 'Marx', start: new Date('1818-05-05'), stop: new Date('1883-03-15'), type: 'Person'}, {name: 'Gandhi', start: new Date('1869-10-02'), stop: new Date('1948-01-31'), type: 'Person'},
/* {name: 'Lenin', start: new Date('1870-04-22'), stop: new Date('1924-01-22'), type: 'Person'},
{name: 'Gandhi', start: new Date('1869-10-02'), stop: new Date('1948-01-31'), type: 'Person'}, {name: 'Stalin', start: new Date('1878-12-18'), stop: new Date('1953-03-06'), type: 'Person'},
{name: 'Lenin', start: new Date('1870-04-22'), stop: new Date('1924-01-22'), type: 'Person'}, {name: 'Einstein', start: new Date('1879-03-14'), stop: new Date('1955-04-19'), type: 'Person'},
{name: 'Stalin', start: new Date('1878-12-18'), stop: new Date('1953-03-06'), type: 'Person'}, {name: 'Picasso', start: new Date('1881-10-25'), stop: new Date('1973-04-09'), type: 'Person'},
{name: 'Einstein', start: new Date('1879-03-14'), stop: new Date('1955-04-19'), type: 'Person'}, {name: 'Roosevelt', start: new Date('1882-01-30'), stop: new Date('1945-04-13'), type: 'Person'},
{name: 'Picasso', start: new Date('1881-10-25'), stop: new Date('1973-04-09'), type: 'Person'}, {name: 'Hitler', start: new Date('1889-04-20'), stop: new Date('1945-05-01'), type: 'Person'},
{name: 'Roosevelt', start: new Date('1882-01-30'), stop: new Date('1945-04-13'), type: 'Person'}, {name: 'Hitchcock', start: new Date('1899-08-13'), stop: new Date('1980-04-30'), type: 'Person'},
{name: 'Hitler', start: new Date('1889-04-20'), stop: new Date('1945-05-01'), type: 'Person'}, {name: 'Turing', start: new Date('1912-06-23'), stop: new Date('1954-06-08'), type: 'Person'},
{name: 'Hitchcock', start: new Date('1899-08-13'), stop: new Date('1980-04-30'), type: 'Person'}, {name: 'Kennedy', start: new Date('1917-05-29'), stop: new Date('1963-11-23'), type: 'Person'},
{name: 'Turing', start: new Date('1912-06-23'), stop: new Date('1954-06-08'), type: 'Person'}, {name: 'Deleuze', start: new Date('1925-01-18'), stop: new Date('1995-11-05'), type: 'Person'},
{name: 'Kennedy', start: new Date('1917-05-29'), stop: new Date('1963-11-23'), type: 'Person'}, {name: 'Warhol', start: new Date('1928-08-06'), stop: new Date('1987-02-23'), type: 'Person'},
{name: 'Deleuze', start: new Date('1925-01-18'), stop: new Date('1995-11-05'), type: 'Person'}, {name: 'Debord', start: new Date('1931-12-28'), stop: new Date('1994-12-01'), type: 'Person'},
{name: 'Warhol', start: new Date('1928-08-06'), stop: new Date('1987-02-23'), type: 'Person'}, */
{name: 'Debord', start: new Date('1931-12-28'), stop: new Date('1994-12-01'), type: 'Person'}, {name: 'Test', start: new Date('1970-01-01'), stop: new Date('1970-01-02')},
*/ {name: 'Battle of Hastings', start: new Date('1066-10-14'), stop: new Date('1066-10-15')},
{name: 'Test', start: new Date('1970-01-01'), stop: new Date('1970-01-02')}, {name: 'Renaissance', start: new Date('1300'), stop: new Date('1700')},
{name: 'Battle of Hastings', start: new Date('1066-10-14'), stop: new Date('1066-10-15')}, {name: 'Spanish Inquisition', start: new Date('1480-09-27'), stop: new Date('1820-03-10')},
{name: 'Renaissance', start: new Date('1300'), stop: new Date('1700')}, {name: 'Discovery of America', start: new Date('1492'), stop: new Date('1493')},
{name: 'Spanish Inquisition', start: new Date('1480-09-27'), stop: new Date('1820-03-10')}, {name: 'East India Company', start: new Date('1600'), stop: new Date('1874')},
{name: 'Discovery of America', start: new Date('1492'), stop: new Date('1493')}, {name: 'Thirty Years\' War', start: new Date('1618'), stop: new Date('1649')},
{name: 'East India Company', start: new Date('1600'), stop: new Date('1874')}, {name: 'Declaration of Independence', start: new Date('1776-07-04'), stop: new Date('1776-07-05')},
{name: 'Thirty Years\' War', start: new Date('1618'), stop: new Date('1649')}, {name: 'French Revolution', start: new Date('1789'), stop: new Date('1800')},
{name: 'Declaration of Independence', start: new Date('1776-07-04'), stop: new Date('1776-07-05')}, {name: 'Storming of the Bastille', start: new Date('1789-07-14'), stop: new Date('1789-07-15')},
{name: 'French Revolution', start: new Date('1789'), stop: new Date('1800')}, {name: 'Napoleonic Era', start: new Date('1799-11-09'), stop: new Date('1815-06-29')},
{name: 'Storming of the Bastille', start: new Date('1789-07-14'), stop: new Date('1789-07-15')}, {name: 'The Year Without a Summer', start: new Date('1816'), stop: new Date('1817')},
{name: 'Napoleonic Era', start: new Date('1799-11-09'), stop: new Date('1815-06-29')}, {name: 'Queen Victoria', start: new Date('1837-06-20'), stop: new Date('1901-01-23')},
{name: 'The Year Without a Summer', start: new Date('1816'), stop: new Date('1817')}, {name: 'Crimean War', start: new Date('1853-10'), stop: new Date('1856-03')},
{name: 'Queen Victoria', start: new Date('1837-06-20'), stop: new Date('1901-01-23')}, {name: 'American Civil War', start: new Date('1861-04-12'), stop: new Date('1865-04-10')},
{name: 'Crimean War', start: new Date('1853-10'), stop: new Date('1856-03')}, {name: 'Franco-Prussian War', start: new Date('1870-07-19'), stop: new Date('1871-05-11')},
{name: 'American Civil War', start: new Date('1861-04-12'), stop: new Date('1865-04-10')}, {name: 'Paris Commune', start: new Date('1871-03-18'), stop: new Date('1871-05-29')},
{name: 'Franco-Prussian War', start: new Date('1870-07-19'), stop: new Date('1871-05-11')}, {name: 'Congo Free State', start: new Date('1885-07-11'), stop: new Date('1908-11-16')},
{name: 'Paris Commune', start: new Date('1871-03-18'), stop: new Date('1871-05-29')}, {name: '20th century', start: new Date('1900'), stop: new Date('2000')},
{name: 'Congo Free State', start: new Date('1885-07-11'), stop: new Date('1908-11-16')}, {name: 'Titanic', start: new Date('1912-04-15'), stop: new Date('1912-04-16')},
{name: '20th century', start: new Date('1900'), stop: new Date('2000')}, {name: 'World War One', start: new Date('1914-07-28'), stop: new Date('1918-11-12')},
{name: 'Titanic', start: new Date('1912-04-15'), stop: new Date('1912-04-16')}, {name: 'Battle of Verdun', start: new Date('1916-02-21'), stop: new Date('1916-12-19')},
{name: 'World War One', start: new Date('1914-07-28'), stop: new Date('1918-11-12')}, {name: 'Russian Revolution', start: new Date('1917'), stop: new Date('1918')},
{name: 'Battle of Verdun', start: new Date('1916-02-21'), stop: new Date('1916-12-19')}, {name: 'October Revolution', start: new Date('1917-11-07'), stop: new Date('1917-11-09')},
{name: 'Russian Revolution', start: new Date('1917'), stop: new Date('1918')}, {name: 'Spanish Flu', start: new Date('1918'), stop: new Date('1919')},
{name: 'October Revolution', start: new Date('1917-11-07'), stop: new Date('1917-11-09')}, {name: 'Weimar Republic', start: new Date('1918-11-09'), stop: new Date('1933-01-30')},
{name: 'Spanish Flu', start: new Date('1918'), stop: new Date('1919')}, {name: 'Treaty of Versailles', start: new Date('1919-06-28'), stop: new Date('1919-06-29')},
{name: 'Weimar Republic', start: new Date('1918-11-09'), stop: new Date('1933-01-30')}, {name: '1920s', start: new Date('1920'), stop: new Date('1930')},
{name: 'Treaty of Versailles', start: new Date('1919-06-28'), stop: new Date('1919-06-29')}, {name: 'Soviet Union', start: new Date('1922-12-30'), stop: new Date('1991-12-27')},
{name: '1920s', start: new Date('1920'), stop: new Date('1930')}, {name: 'The Third Reich', start: new Date('1933-01-30'), stop: new Date('1945-05-09')},
{name: 'Soviet Union', start: new Date('1922-12-30'), stop: new Date('1991-12-27')}, {name: 'Spanish Civil War', start: new Date('1936-07-17'), stop: new Date('1939-04-02')},
{name: 'The Third Reich', start: new Date('1933-01-30'), stop: new Date('1945-05-09')}, {name: '1936 Summer Olympics', start: new Date('1936-08-01'), stop: new Date('1936-08-17')},
{name: 'Spanish Civil War', start: new Date('1936-07-17'), stop: new Date('1939-04-02')}, {name: 'Hindenburg', start: new Date('1937-05-06'), stop: new Date('1937-05-07')},
{name: '1936 Summer Olympics', start: new Date('1936-08-01'), stop: new Date('1936-08-17')}, {name: 'World War Two', start: new Date('1939-09-01'), stop: new Date('1945-09-03')},
{name: 'Hindenburg', start: new Date('1937-05-06'), stop: new Date('1937-05-07')}, {name: 'Pearl Harbour', start: new Date('1941-12-07'), stop: new Date('1941-12-08')},
{name: 'World War Two', start: new Date('1939-09-01'), stop: new Date('1945-09-03')}, {name: 'Wannsee Conference', start: new Date('1942-01-20'), stop: new Date('1942-01-21')},
{name: 'Pearl Harbour', start: new Date('1941-12-07'), stop: new Date('1941-12-08')}, {name: 'Battle of Stalingrad', start: new Date('1942-08-23'), stop: new Date('1943-02-03')},
{name: 'Wannsee Conference', start: new Date('1942-01-20'), stop: new Date('1942-01-21')}, {name: 'D-Day', start: new Date('1944-06-06'), stop: new Date('1944-06-07')},
{name: 'Battle of Stalingrad', start: new Date('1942-08-23'), stop: new Date('1943-02-03')}, {name: 'Liberation of Auschwitz', start: new Date('1945-01-27'), stop: new Date('1945-01-28')},
{name: 'D-Day', start: new Date('1944-06-06'), stop: new Date('1944-06-07')}, {name: 'Hiroshima', start: new Date('1945-08-06'), stop: new Date('1945-08-07')},
{name: 'Liberation of Auschwitz', start: new Date('1945-01-27'), stop: new Date('1945-01-28')}, {name: 'Nagasaki', start: new Date('1945-08-09'), stop: new Date('1945-08-10')},
{name: 'Hiroshima', start: new Date('1945-08-06'), stop: new Date('1945-08-07')}, {name: 'Nuremburg Trials', start: new Date('1945-11-20'), stop: new Date('1946-10-02')},
{name: 'Nagasaki', start: new Date('1945-08-09'), stop: new Date('1945-08-10')}, {name: 'Fourth Republic', start: new Date('1946-10-14'), stop: new Date('1958-10-05')},
{name: 'Nuremburg Trials', start: new Date('1945-11-20'), stop: new Date('1946-10-02')}, {name: 'West Germany', start: new Date('1949-05-23'), stop: new Date('1990-10-03')},
{name: 'Fourth Republic', start: new Date('1946-10-14'), stop: new Date('1958-10-05')}, {name: 'Korean War', start: new Date('1950-06-25'), stop: new Date('1953-07-28')},
{name: 'West Germany', start: new Date('1949-05-23'), stop: new Date('1990-10-03')}, {name: 'Cuban Revolution', start: new Date('1953-07-26'), stop: new Date('1959-01-02')},
{name: 'Korean War', start: new Date('1950-06-25'), stop: new Date('1953-07-28')}, {name: 'Algerian War', start: new Date('1954-11-01'), stop: new Date('1962-03-20')},
{name: 'Cuban Revolution', start: new Date('1953-07-26'), stop: new Date('1959-01-02')}, {name: 'Vietnam War', start: new Date('1955-11-01'), stop: new Date('1975-05-01')},
{name: 'Algerian War', start: new Date('1954-11-01'), stop: new Date('1962-03-20')}, {name: '1960s', start: new Date('1960-01-01'), stop: new Date('1970-01-01')},
{name: 'Vietnam War', start: new Date('1955-11-01'), stop: new Date('1975-05-01')}, {name: 'Eichmann Trial', start: new Date('1961-04-11'), stop: new Date('1961-08-15')},
{name: '1960s', start: new Date('1960-01-01'), stop: new Date('1970-01-01')}, {name: 'Bay of Pigs', start: new Date('1961-04-17'), stop: new Date('1961-04-20')},
{name: 'Eichmann Trial', start: new Date('1961-04-11'), stop: new Date('1961-08-15')}, {name: 'Berlin Wall', start: new Date('1961-08-13'), stop: new Date('1989-11-09')},
{name: 'Bay of Pigs', start: new Date('1961-04-17'), stop: new Date('1961-04-20')}, {name: 'Cuban Missile Crisis', start: new Date('1962-10'), stop: new Date('1962-12')},
{name: 'Berlin Wall', start: new Date('1961-08-13'), stop: new Date('1989-11-09')}, {name: 'Assassination of John F. Kennedy', start: new Date('1963-11-22'), stop: new Date('1963-11-23')},
{name: 'Cuban Missile Crisis', start: new Date('1962-10'), stop: new Date('1962-12')}, {name: 'Sgt. Pepper', start: new Date('1967-06-01'), stop: new Date('1967-06-02')},
{name: 'Assassination of John F. Kennedy', start: new Date('1963-11-22'), stop: new Date('1963-11-23')}, {name: 'Assassination of Benno Ohnesorg', start: new Date('1967-06-02'), stop: new Date('1967-06-03')},
{name: 'Sgt. Pepper', start: new Date('1967-06-01'), stop: new Date('1967-06-02')}, {name: 'Six-Day War', start: new Date('1967-06-05'), stop: new Date('1967-06-11')},
{name: 'Assassination of Benno Ohnesorg', start: new Date('1967-06-02'), stop: new Date('1967-06-03')}, {name: '1968', start: new Date('1968-01-01'), stop: new Date('1969-01-01')},
{name: 'Six-Day War', start: new Date('1967-06-05'), stop: new Date('1967-06-11')}, {name: 'My Lai', start: new Date('1968-03-16'), stop: new Date('1968-03-17')},
{name: '1968', start: new Date('1968-01-01'), stop: new Date('1969-01-01')}, {name: 'Assassination of Martin Luther King', start: new Date('1968-04-04'), stop: new Date('1968-04-05')},
{name: 'My Lai', start: new Date('1968-03-16'), stop: new Date('1968-03-17')}, {name: 'Assassination of Rudi Dutschke', start: new Date('1968-04-11'), stop: new Date('1968-04-12')},
{name: 'Assassination of Martin Luther King', start: new Date('1968-04-04'), stop: new Date('1968-04-05')}, {name: 'May 1968', start: new Date('1968-05-01'), stop: new Date('1968-06-01')},
{name: 'Assassination of Rudi Dutschke', start: new Date('1968-04-11'), stop: new Date('1968-04-12')}, {name: '1968 Cannes Film Festival', start: new Date('1968-05-10'), stop: new Date('1968-05-20')},
{name: 'May 1968', start: new Date('1968-05-01'), stop: new Date('1968-06-01')}, {name: 'Valerie Solanas', start: new Date('1968-06-03'), stop: new Date('1968-06-04')},
{name: '1968 Cannes Film Festival', start: new Date('1968-05-10'), stop: new Date('1968-05-20')}, {name: 'Assassination of Robert F. Kennedy', start: new Date('1968-06-05'), stop: new Date('1968-06-06')},
{name: 'Valerie Solanas', start: new Date('1968-06-03'), stop: new Date('1968-06-04')}, {name: '1968 Summer Olympics', start: new Date('1968-10-12'), stop: new Date('1968-10-28')},
{name: 'Assassination of Robert F. Kennedy', start: new Date('1968-06-05'), stop: new Date('1968-06-06')}, {name: 'Apollo 11', start: new Date('1969-07-16'), stop: new Date('1969-07-25')},
{name: '1968 Summer Olympics', start: new Date('1968-10-12'), stop: new Date('1968-10-28')}, {name: 'Moon Landing', start: new Date('1969-07-20'), stop: new Date('1969-07-21')},
{name: 'Apollo 11', start: new Date('1969-07-16'), stop: new Date('1969-07-25')}, {name: 'The Epoch', start: new Date('1970-01-01 00:00:00'), stop: new Date('1970-01-01 00:00:01')},
{name: 'Moon Landing', start: new Date('1969-07-20'), stop: new Date('1969-07-21')}, {name: '1970s', start: new Date('1970-01-01'), stop: new Date('1980-01-01')},
{name: 'The Epoch', start: new Date('1970-01-01 00:00:00'), stop: new Date('1970-01-01 00:00:01')}, {name: '1972 Summer Olympics', start: new Date('1972-08-26'), stop: new Date('1972-09-11')},
{name: '1970s', start: new Date('1970-01-01'), stop: new Date('1980-01-01')}, {name: 'Apollo 17', start: new Date('1972-12-07'), stop: new Date('1972-12-20')},
{name: '1972 Summer Olympics', start: new Date('1972-08-26'), stop: new Date('1972-09-11')}, {name: 'World Trade Center', start: new Date('1973-04-04'), stop: new Date('2001-09-11')},
{name: 'Apollo 17', start: new Date('1972-12-07'), stop: new Date('1972-12-20')}, {name: '1980s', start: new Date('1980-01-01'), stop: new Date('1990-01-01')},
{name: 'World Trade Center', start: new Date('1973-04-04'), stop: new Date('2001-09-11')}, {name: 'Iran-Iraq War', start: new Date('1980-09-22'), stop: new Date('1988-08-21')},
{name: '1980s', start: new Date('1980-01-01'), stop: new Date('1990-01-01')}, {name: 'Tschernobyl', start: new Date('1986-04-26'), stop: new Date('1986-04-27')},
{name: 'Iran-Iraq War', start: new Date('1980-09-22'), stop: new Date('1988-08-21')}, {name: 'Fall of the Berlin Wall', start: new Date('1989-11-09'), stop: new Date('1989-11-10')},
{name: 'Tschernobyl', start: new Date('1986-04-26'), stop: new Date('1986-04-27')}, {name: 'Gulf War', start: new Date('1990-08-02'), stop: new Date('1991-03-01')},
{name: 'Fall of the Berlin Wall', start: new Date('1989-11-09'), stop: new Date('1989-11-10')}, {name: 'Clinton Presidency', start: new Date('1993-01-20'), stop: new Date('2001-01-20')},
{name: 'Gulf War', start: new Date('1990-08-02'), stop: new Date('1991-03-01')}, {name: 'German Reunification', start: new Date('1990-10-03'), stop: new Date('1990-10-04')},
{name: 'Clinton Presidency', start: new Date('1993-01-20'), stop: new Date('2001-01-20')}, {name: 'The Battle of Seattle', start: new Date('1999-11-30'), stop: new Date('1999-12-01')},
{name: 'German Reunification', start: new Date('1990-10-03'), stop: new Date('1990-10-04')}, {name: 'George W. Bush', start: new Date('2001-01-20'), stop: new Date('2009-01-20')},
{name: 'The Battle of Seattle', start: new Date('1999-11-30'), stop: new Date('1999-12-01')}, {name: 'Carlo Giuliani', start: new Date('2001-07-20'), stop: new Date('2001-07-21')},
{name: 'George W. Bush', start: new Date('2001-01-20'), stop: new Date('2009-01-20')}, {name: '9-11', start: new Date('2001-09-11'), stop: new Date('2001-09-12')},
{name: 'Carlo Giuliani', start: new Date('2001-07-20'), stop: new Date('2001-07-21')}, {name: 'Fukushima', start: new Date('2011-03-11'), stop: new Date('2011-03-12')}
{name: '9-11', start: new Date('2001-09-11'), stop: new Date('2001-09-12')}, ],
{name: 'Fukushima', start: new Date('2011-03-11'), stop: new Date('2011-03-12')} height: window.innerHeight,
], width: window.innerWidth
height: window.innerHeight, }).appendTo(Ox.UI.$body);
width: window.innerWidth
}).appendTo(Ox.UI.$body);
});
}); });

View file

@ -6,7 +6,7 @@ OxUI Loader
Provides function Ox.UI([options], callback) that fires when Provides function Ox.UI([options], callback) that fires when
OxUI.css, Ox.js und jquery.js have loaded OxUI.css, Ox.js und jquery.js have loaded
all images have loaded all images have loaded
the DOM is ready the document is ready
*/ */
(function() { (function() {
@ -15,19 +15,18 @@ Provides function Ox.UI([options], callback) that fires when
path = Array.prototype.slice.apply( path = Array.prototype.slice.apply(
document.getElementsByTagName('script') document.getElementsByTagName('script')
).filter(function(element) { ).filter(function(element) {
return /OxUI\.js$/(element.src); return /OxUI\.js$/.test(element.src);
})[0].src.replace('js/OxUI.js', ''), })[0].src.replace('js/OxUI.js', ''),
head = document.getElementsByTagName('head')[0], head = document.getElementsByTagName('head')[0],
oxUICallback = function() {}, oxUICallback = function() {},
oxUIFunction = function(options, callback) { oxUIDefaults = {
var defaults = { // 'classic', 'modern', 'console' or 'none'
// 'classic', 'modern', 'verbose' or anything falsy display: 'classic'
display: 'classic' },
}; oxUIFunction = function(options, callback) {
oxUICallback = arguments.length == 2 ? callback : options; oxUICallback = arguments.length == 2 ? callback : options;
oxUIOptions = arguments.length == 2 && options ? options : {}; oxUIOptions = arguments.length == 2 && options ? options : oxUIDefaults;
}, },
oxUIOptions = {},
documentReady = false, documentReady = false,
documentReadyCallbacks = []; documentReadyCallbacks = [];
@ -78,7 +77,7 @@ Provides function Ox.UI([options], callback) that fires when
}); });
function isFileType(src, type) { function isFileType(src, type) {
return new RegExp('\.' + type + '$')(src); return new RegExp('\.' + type + '$').test(src);
} }
function isIncluded(src) { function isIncluded(src) {
@ -95,8 +94,9 @@ Provides function Ox.UI([options], callback) that fires when
function waitForDocument() { function waitForDocument() {
document.addEventListener('DOMContentLoaded', onload, false); document.addEventListener('DOMContentLoaded', onload, false);
function onload() { function onload() {
console.log('DOMContentLoaded') console.log('document ready')
document.removeEventListener('DOMContentLoaded', onload, false); document.removeEventListener('DOMContentLoaded', onload, false);
documentReady = true;
bootOxUI(); bootOxUI();
} }
} }
@ -111,7 +111,18 @@ Provides function Ox.UI([options], callback) that fires when
function bootOxUI() { function bootOxUI() {
var body = element('body'), // runs when the document is ready
var body, css, div,
options = oxUIOptions || oxUIDefaults,
userAgents = [
{name: 'Chrome', url: 'http://www.google.com/chrome/'},
{name: 'Firefox', url: 'http://www.mozilla.org/firefox/'},
{name: 'Safari', url: 'http://www.apple.com/safari/'}
];
if (options.display != 'none') {
body = element('body');
css = { css = {
position: 'absolute', position: 'absolute',
left: 0, left: 0,
@ -121,7 +132,7 @@ Provides function Ox.UI([options], callback) that fires when
margin: 'auto', margin: 'auto',
MozUserSelect: 'none', MozUserSelect: 'none',
WebkitUserSelect: 'none' WebkitUserSelect: 'none'
}, };
div = element('<div>') div = element('<div>')
.css({ .css({
position: 'absolute', position: 'absolute',
@ -129,16 +140,17 @@ Provides function Ox.UI([options], callback) that fires when
top: 0, top: 0,
right: 0, right: 0,
bottom: 0, bottom: 0,
background: 'rgb(240, 240, 240)', background: 'rgb(' + (
options.display == 'classic' ? '240, 240, 240' : '16, 16, 16')
+ ')',
color: 'rgb(240, 240, 240)',
opacity: 1, opacity: 1,
zIndex: 1000 zIndex: 1000
}) })
.appendTo(body), .appendTo(body);
userAgents = [ }
{name: 'Chrome', url: 'http://www.google.com/chrome/'},
{name: 'Firefox', url: 'http://www.mozilla.org/firefox/'}, console.log('userAgent', getUserAgent())
{name: 'Safari', url: 'http://www.apple.com/safari/'}
];
getUserAgent() ? start() : stop(); getUserAgent() ? start() : stop();
@ -152,7 +164,6 @@ Provides function Ox.UI([options], callback) that fires when
return userAgent; return userAgent;
} }
function element(str) { function element(str) {
// Generic HTML Element Object (mimics jQuery) // Generic HTML Element Object (mimics jQuery)
return { return {
@ -195,12 +206,13 @@ Provides function Ox.UI([options], callback) that fires when
} }
function start() { function start() {
console.log('start')
var image = new Image(), var image = new Image(),
src = path + 'svg/ox.ui.classic/symbolLoading.svg'; src = path + 'svg/ox.ui.classic/symbolLoading.svg';
image.onload = function() { image.onload = function() {
element('<img>') element('<img>')
.attr({ .attr({
src: src src: src,
}) })
.css(css) .css(css)
.css({ .css({
@ -216,24 +228,44 @@ Provides function Ox.UI([options], callback) that fires when
} }
function stop() { function stop() {
var counter = 0; console.log('stop')
userAgents.forEach(function(userAgent) { var counter = 0,
var image = new Image(); message = 'Browser not supported, use ' + userAgents.map(function(userAgent, i) {
userAgent.src = path + 'png/ox.ui/browser' + userAgent.name + '128.png'; return userAgent.name + (
image.onload = function() { i == userAgent.length - 1 ? '.' :
++counter == userAgents.length && loaded(); i == userAgent.length - 2 ? ' or' : ','
);
}).join(' ');
if (options.display == 'none') {
throw new Error(message);
} else {
div.addClass('error');
if (options.display == 'console') {
element('<div>').html(message).appendTo(body);
} else {
userAgents.forEach(function(userAgent) {
var image = new Image();
userAgent.src = path + 'png/ox.ui/browser' + userAgent.name + '128.png';
image.onload = function() {
++counter == userAgents.length && showImages();
}
image.src = userAgent.src;
});
} }
image.src = userAgent.src; }
}); function showImages() {
function loaded() {
var box = element('<div>') var box = element('<div>')
.css(css) .css(css)
.css({
width: (userAgents.length * 72) + 'px',
height: '72px'
})
.appendTo(div); .appendTo(div);
userAgents.forEach(function(userAgent, i) { userAgents.forEach(function(userAgent, i) {
var link = element('<a>') var link = element('<a>')
.attr({ .attr({
href: userAgents[name], href: userAgent.url,
title: name title: userAgent.name
}) })
.css({ .css({
position: 'absolute', position: 'absolute',
@ -243,6 +275,9 @@ Provides function Ox.UI([options], callback) that fires when
}) })
.appendTo(box); .appendTo(box);
element('<img>') element('<img>')
.attr({
src: userAgent.src
})
.css(css) .css(css)
.css({ .css({
width: '64px', width: '64px',
@ -262,19 +297,15 @@ Provides function Ox.UI([options], callback) that fires when
function loadOxUI() { function loadOxUI() {
Ox.UI = {}; // runs when css and js files have loaded
Ox.UI.ready = function(callback) {
if (!documentReady) { documentReady && initDocument();
documentReadyCallbacks.push(callback);
} else {
callback();
}
};
$.getJSON(path + 'json/OxUI.json', function(data) { $.getJSON(path + 'json/OxUI.json', function(data) {
var $head = $('head'), var $head = $('head'),
promises = [waitForDocument()]; promises = documentReady ? [] : [waitForDocument()];
// fixme: find a better way to not wait for flags // fixme: find a better way to not wait for flags
data = data.filter(function(image) { data = data.filter(function(image) {
return !Ox.startsWith(image, 'svg/ox.map/'); return !Ox.startsWith(image, 'svg/ox.map/');
@ -284,14 +315,17 @@ Provides function Ox.UI([options], callback) that fires when
}); });
$.when.apply(null, promises) $.when.apply(null, promises)
.then(function() { .then(function() {
var $div = Ox.UI.$body.find('div'); var $div, error = $('.error').length;
Ox.UI.$body.find('img').remove(); if (!error) {
$div.animate({ $div = $('div');
opacity: 0 $('img').remove();
}, 1000, function() { $div.animate({
$div.remove(); opacity: 0
}); }, 1000, function() {
oxUICallback(); $div.remove();
});
oxUICallback();
}
}) })
.fail(function() { .fail(function() {
throw new Error('File not found.'); throw new Error('File not found.');
@ -316,14 +350,8 @@ Provides function Ox.UI([options], callback) that fires when
function waitForDocument() { function waitForDocument() {
var dfd = new $.Deferred(); var dfd = new $.Deferred();
$(function() { $(function() {
Ox.UI.$body = $('body');
Ox.UI.$document = $(document);
Ox.UI.$head = $('head');
Ox.UI.$window = $(window);
documentReady = true; documentReady = true;
documentReadyCallbacks.forEach(function(callback) { initDocument()
callback();
});
dfd.resolve(); dfd.resolve();
}); });
return dfd.promise(); return dfd.promise();
@ -331,6 +359,23 @@ Provides function Ox.UI([options], callback) that fires when
}); });
function initDocument() {
Ox.UI.$body = $('body');
Ox.UI.$document = $(document);
Ox.UI.$head = $('head');
Ox.UI.$window = $(window);
documentReadyCallbacks.forEach(function(callback) {
callback();
});
}
Ox.UI.ready = function(callback) {
if (!documentReady) {
documentReadyCallbacks.push(callback);
} else {
callback();
}
};
Ox.UI.elements = {}; Ox.UI.elements = {};
Ox.UI.DEFAULT_THEME = 'classic'; Ox.UI.DEFAULT_THEME = 'classic';