Changeset 204

Show
Ignore:
Timestamp:
09/18/06 16:02:41 (2 years ago)
Author:
matt
Message:

Upgrade to s5 v1.2a1

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/demo/spod5/ui/default/framing.css

    r172 r204  
    1111.slide {top: 0; width: 92%; padding: 3.5em 4% 4%; z-index: 2;  list-style: none;} 
    1212div#controls {left: 50%; bottom: 0; width: 50%; z-index: 100;} 
    13 div#controls form {position: absolute; bottom: 0; right: 0; width: 100%; 
    14   margin: 0;} 
     13div#controls form {text-align: right; width: 100%; margin: 0;} 
    1514#currentSlide {position: absolute; width: 10%; left: 45%; bottom: 1em; z-index: 10;} 
    1615html>body #currentSlide {position: fixed;} 
  • trunk/demo/spod5/ui/default/pretty.css

    r178 r204  
    11/* Following are the presentation styles -- edit away! */ 
    22 
    3 body {background: #FFF url(axon_logo_500_fade.gif) -160px 0 no-repeat; color: #000; font-size: 2em;} 
     3body {background: #FFF url(bodybg.gif) -16px 0 no-repeat; color: #000; font-size: 2.25em;} 
    44:link, :visited {text-decoration: none; color: #00C;} 
    55#controls :active {color: #88A !important;} 
     
    3030.slide img.leader {display: block; margin: 0 auto;} 
    3131 
    32 div#header, div#footer {background: #eee; color: #005
     32div#header, div#footer {background: #005; color: #AAB
    3333  font-family: Verdana, Helvetica, sans-serif;} 
    34 div#header {background: #eee url(axon_logo_500_fade.gif) -167px -7px no-repeat; 
    35   line-height: 1px; border: 2px solid black; margin: 5px; width: 90%;
     34div#header {background: #005 url(bodybg.gif) -16px 0 no-repeat; 
     35  line-height: 1px;
    3636div#footer {font-size: 0.5em; font-weight: bold; padding: 1em 0;} 
    3737#footer h1, #footer h2 {display: block; padding: 0 1em;} 
     
    4242  margin: 0; padding: 0.3em 0 0 50px; white-space: nowrap; 
    4343  font: bold 150%/1em Helvetica, sans-serif; text-transform: capitalize; 
    44   color: #005; background: transparent;} 
     44  color: #DDE; background: #005;} 
    4545.slide h3 {font-size: 130%;} 
    4646h1 abbr {font-variant: small-caps;} 
    4747 
    48 div#controls {position: absolute; left: 50%; bottom: 0; 
    49   width: 50%; 
     48div#controls {position: absolute; left: 60%; bottom: 0; 
     49  width: 40%; 
    5050  text-align: right; font: bold 0.9em Verdana, Helvetica, sans-serif;} 
    51 html>body div#controls {position: fixed; padding: 0 0 1em 0; 
    52   top: auto;} 
    53 div#controls form {position: absolute; bottom: 0; right: 0; width: 100%; 
    54   margin: 0; padding: 0;} 
     51html>body div#controls {position: fixed; padding: 0; top: auto;} 
    5552#controls #navLinks a {padding: 0; margin: 0 0.5em;  
    56   background: #eee; border: none; color: #227;  
     53  background: #005; border: none; color: #779;  
    5754  cursor: pointer;} 
    58 #controls #navList {height: 1em;} 
    59 #controls #navList #jumplist {position: absolute; bottom: 0; right: 0; background: #DDD; color: #227;} 
     55#controls #navList #jumplist {background: #DDD; color: #227;} 
    6056 
    6157#currentSlide {text-align: center; font-size: 0.5em; color: #449;} 
  • trunk/demo/spod5/ui/default/s5-core.css

    r172 r204  
    44html>body div#header, html>body div#footer,  
    55  html>body div#controls, html>body .slide {position: fixed;} 
    6 .handout {display: none;} 
     6.handout, .notes {display: none;} 
    77.layout {display: block;} 
    88.slide, .hideme, .incremental {visibility: hidden;} 
  • trunk/demo/spod5/ui/default/slides.js

    r172 r204  
    1 // S5 v1.1 slides.js -- released into the Public Domain 
     1// S5 v1.2a1 slides.js -- released into the Public Domain 
    22// 
    33// Please see http://www.meyerweb.com/eric/tools/s5/credits.html for information  
     
    1414var controlVis = 'visible'; 
    1515 
    16 var isIE = navigator.appName == 'Microsoft Internet Explorer' ? 1 : 0; 
     16var s5NotesWindow; 
     17var s5NotesWindowLoaded = false; 
     18var previousSlide = 0; 
     19var presentationStart = new Date(); 
     20var slideStart = new Date(); 
     21 
     22var countdown = { 
     23        timer: 0, 
     24        state: 'pause', 
     25        start: new Date(), 
     26        end: 0, 
     27        remaining: 0 
     28}; 
     29 
     30 
     31var isIE = navigator.appName == 'Microsoft Internet Explorer' && navigator.userAgent.indexOf('Opera') < 1 ? 1 : 0; 
    1732var isOp = navigator.userAgent.indexOf('Opera') > -1 ? 1 : 0; 
    1833var isGe = navigator.userAgent.indexOf('Gecko') > -1 && navigator.userAgent.indexOf('Safari') < 1 ? 1 : 0; 
     
    2944 
    3045function removeClass(object,className) { 
    31         if (!object) return; 
     46        if (!object || !hasClass(object,className)) return; 
    3247        object.className = object.className.replace(new RegExp('(^|\\s)'+className+'(\\s|$)'), RegExp.$1+RegExp.$2); 
    3348} 
     
    8297                var did = 'slide' + n.toString(); 
    8398                obj.setAttribute('id',did); 
    84                 if (isOp) continue; 
     99 
     100//              if (isOp) continue;   // Opera fix (hallvord) 
    85101 
    86102                var otext = ''; 
     
    107123                cs = document.currentSlide; 
    108124        } 
    109         cs.innerHTML = '<span id="csHere">' + snum + '<\/span> ' +  
     125        cs.innerHTML = '<a id="plink" href="">' +  
     126                '<span id="csHere">' + snum + '<\/span> ' +  
    110127                '<span id="csSep">\/<\/span> ' +  
    111                 '<span id="csTotal">' + (smax-1) + '<\/span>'; 
     128                '<span id="csTotal">' + (smax-1) + '<\/span>' + 
     129                '<\/a>' 
     130                ; 
    112131        if (snum == 0) { 
    113132                cs.style.visibility = 'hidden'; 
     
    152171        if (incrementals[snum].length > 0 && incpos > 0) 
    153172                addClass(incrementals[snum][incpos - 1], 'current'); 
    154         ce.style.visibility = 'hidden'; 
    155         ne.style.visibility = 'visible'; 
     173        if (isOp) { //hallvord 
     174                location.hash = nid; 
     175        } else { 
     176                ce.style.visibility = 'hidden';  
     177                ne.style.visibility = 'visible'; 
     178        } // /hallvord 
    156179        jl.selectedIndex = snum; 
    157180        currentSlide(); 
     181        loadNote(); 
     182        permaLink(); 
    158183        number = 0; 
    159184} 
     
    271296                                showHide('k'); 
    272297                                break; 
     298                        case 78: // n 
     299                                createNotesWindow(); 
     300                                break; 
    273301                } 
    274302                if (key.which < 48 || key.which > 57) { 
     
    290318                e = window.event; 
    291319        } else target = e.target; 
    292         if (target.getAttribute('href') != null || hasValue(target.rel, 'external') || isParentOrSelf(target, 'controls') || isParentOrSelf(target,'embed') || isParentOrSelf(target,'object')) return true; 
     320        if (target.href != null || hasValue(target.rel, 'external') || isParentOrSelf(target, 'controls') || isParentOrSelf(target,'embed') || isParentOrSelf(target,'object')) return true; 
    293321        if (!e.which || e.which == 1) { 
    294322                if (!incrementals[snum] || incpos >= incrementals[snum].length) { 
     
    372400} 
    373401 
     402function permaLink() { 
     403        document.getElementById('plink').href = window.location.pathname + '#slide' + snum; 
     404} 
     405 
    374406function createControls() { 
    375407        var controlsDiv = document.getElementById("controls"); 
     
    384416        controlsDiv.innerHTML = '<form action="#" id="controlForm"' + hideDiv + '>' + 
    385417        '<div id="navLinks">' + 
     418        '<a accesskey="n" id="show-notes" href="javascript:createNotesWindow();" title="Show Notes">&equiv;<\/a>' + 
    386419        '<a accesskey="t" id="toggle" href="javascript:toggle();">&#216;<\/a>' + 
    387420        '<a accesskey="z" id="prev" href="javascript:go(-1);">&laquo;<\/a>' + 
     
    399432function fontScale() {  // causes layout problems in FireFox that get fixed if browser's Reload is used; same may be true of other Gecko-based browsers 
    400433        if (!s5mode) return false; 
    401         var vScale = 22;  // both yield 32 (after rounding) at 1024x768 
    402         var hScale = 32;  // perhaps should auto-calculate based on theme's declared value? 
     434        var vScale = 48;  // both yield 16 (the usual browser default) at 1024x768 
     435        var hScale = 64;  // perhaps should auto-calculate based on theme's declared value? 
    403436        if (window.innerHeight) { 
    404437                var vSize = window.innerHeight; 
     
    425458function fontSize(value) { 
    426459        if (!(s5ss = document.getElementById('s5ss'))) { 
    427                 if (!isIE) { 
     460                if (!document.createStyleSheet) { 
    428461                        document.getElementsByTagName('head')[0].appendChild(s5ss = document.createElement('style')); 
    429462                        s5ss.setAttribute('media','screen, projection'); 
     
    434467                } 
    435468        } 
    436         if (!isIE) { 
     469        if (!(document.s5ss && document.s5ss.addRule)) { 
    437470                while (s5ss.lastChild) s5ss.removeChild(s5ss.lastChild); 
    438                 s5ss.appendChild(document.createTextNode('body {font-size: ' + value + ' !important;}')); 
    439         } else { 
    440                 document.s5ss.addRule('body','font-size: ' + value + ' !important;'); 
     471                s5ss.appendChild(document.createTextNode('html {font-size: ' + value + ' !important;}')); 
     472        } else { 
     473                document.s5ss.addRule('html','font-size: ' + value + ' !important;'); 
    441474        } 
    442475} 
     
    529562} 
    530563 
     564function noteLabel() { // Gives notes id's to match parent slides 
     565        var notes = GetElementsWithClassName('div','notes'); 
     566        for (var i = 0; i < notes.length; i++) { 
     567                var note = notes[i]; 
     568                var id = 'note' + note.parentNode.id.substring(5); 
     569                note.setAttribute('id',id); 
     570        } 
     571        resetElapsedSlide(); 
     572        resetRemainingTime(); 
     573        window.setInterval('updateElaspedTime()', 1000); 
     574} 
     575 
     576function createNotesWindow() { // creates a window for our notes 
     577        if (!s5NotesWindow || s5NotesWindow.closed) { // Create the window if it doesn't exist 
     578                s5NotesWindowLoaded = false; 
     579                // Note: Safari has a tendency to ignore window options preferring to default to the settings of the parent window, grr. 
     580                s5NotesWindow = window.open('ui/s5-notes.html', 's5NotesWindow', 'top=0,left=0'); 
     581        } 
     582        if (s5NotesWindowLoaded) { // Load the current note if the Note HTML has loaded 
     583                loadNote(); 
     584        } else { // Keep trying... 
     585                window.setTimeout('createNotesWindow()', 50); 
     586        } 
     587} 
     588 
     589function loadNote() { 
     590// Loads a note into the note window 
     591        var notes = nextNotes = '<em class="disclaimer">There are no notes for this slide.</em>'; 
     592        if (document.getElementById('note' + snum)) { 
     593                notes = document.getElementById('note' + snum).innerHTML; 
     594        } 
     595        if (document.getElementById('note' + (snum + 1))) { 
     596                nextNotes = document.getElementById('note' + (snum + 1)).innerHTML; 
     597        } 
     598         
     599        var jl = document.getElementById('jumplist'); 
     600        var slideTitle = jl.options[jl.selectedIndex].text.replace(/^\d+\s+:\s+/, '') + ((jl.selectedIndex) ? ' (' + jl.selectedIndex + '/' + (smax - 1) + ')' : ''); 
     601        if (jl.selectedIndex < smax - 1) { 
     602                var nextTitle = jl.options[jl.selectedIndex + 1].text.replace(/^\d+\s+:\s+/, '') + ((jl.selectedIndex + 1) ? ' (' + (jl.selectedIndex + 1) + '/' + (smax - 1) + ')' : ''); 
     603        } else { 
     604                var nextTitle = '[end of slide show]'; 
     605        } 
     606         
     607        if (s5NotesWindow && !s5NotesWindow.closed && s5NotesWindow.document) { 
     608                s5NotesWindow.document.getElementById('slide').innerHTML = slideTitle; 
     609                s5NotesWindow.document.getElementById('notes').innerHTML = notes; 
     610                s5NotesWindow.document.getElementById('next').innerHTML = nextTitle; 
     611                s5NotesWindow.document.getElementById('nextnotes').innerHTML = nextNotes; 
     612        } 
     613        resetElapsedSlide(); 
     614} 
     615 
     616function resetElapsedTime() { 
     617        presentationStart = new Date(); 
     618        slideStart = new Date(); 
     619        updateElaspedTime(); 
     620} 
     621 
     622function resetElapsedSlide() { 
     623        if (snum != previousSlide) { 
     624                slideStart = new Date(); 
     625                previousSlide = snum; 
     626                updateElaspedTime(); 
     627        } 
     628} 
     629 
     630function updateElaspedTime() { 
     631        if (!s5NotesWindowLoaded || !s5NotesWindow || s5NotesWindow.closed) return; 
     632        var now = new Date(); 
     633        var ep = s5NotesWindow.document.getElementById('elapsed-presentation'); 
     634        var es = s5NotesWindow.document.getElementById('elapsed-slide'); 
     635        ep.innerHTML = formatTime(now.valueOf() - presentationStart.valueOf()); 
     636        es.innerHTML = formatTime(now.valueOf() - slideStart.valueOf()); 
     637} 
     638 
     639function resetRemainingTime() { 
     640        if (!s5NotesWindowLoaded || !s5NotesWindow || s5NotesWindow.closed) return; 
     641        var startField = s5NotesWindow.document.getElementById('startFrom'); 
     642        startFrom = readTime(startField.value); 
     643        countdown.remaining = startFrom * 60000;  // convert to msecs 
     644        countdown.start = new Date().valueOf(); 
     645        countdown.end = countdown.start + countdown.remaining; 
     646        var tl = s5NotesWindow.document.getElementById('timeLeft'); 
     647        var timeLeft = formatTime(countdown.remaining); 
     648        tl.innerHTML = timeLeft; 
     649} 
     650 
     651function updateRemainingTime() { 
     652        if (!s5NotesWindowLoaded || !s5NotesWindow || s5NotesWindow.closed) return; 
     653        var tl = s5NotesWindow.document.getElementById('timeLeft'); 
     654        var now = new Date(); 
     655        if (countdown.state == 'run') { 
     656                countdown.remaining = countdown.end - now; 
     657        } 
     658        tl.style.color = ''; 
     659        tl.style.backgroundColor = ''; 
     660        if (countdown.remaining >= 0) { 
     661                var timeLeft = formatTime(countdown.remaining); 
     662                removeClass(tl,'overtime'); 
     663                if (countdown.remaining < 300000) { 
     664                        tl.style.color = 'rgb(' + (255-Math.round(countdown.remaining/2000)) + ',0,0)'; 
     665                        tl.style.backgroundColor = 'rgb(255,255,' + (Math.round(countdown.remaining/2000)) + ')'; 
     666                } 
     667        } else { 
     668                var timeLeft = '-' + formatTime(-countdown.remaining); 
     669                addClass(tl,'overtime'); 
     670        } 
     671        tl.innerHTML = timeLeft; 
     672} 
     673 
     674function toggleRemainingTime() { 
     675        if (countdown.state == 'pause') countdown.state = 'run'; else countdown.state = 'pause'; 
     676        if (countdown.state == 'pause') { 
     677                window.clearInterval(countdown.timer); 
     678        } 
     679        if (countdown.state == 'run') { 
     680                countdown.start = new Date().valueOf(); 
     681                countdown.end = countdown.start + countdown.remaining; 
     682                countdown.timer = window.setInterval('updateRemainingTime()', 1000); 
     683        } 
     684} 
     685 
     686function alterRemainingTime(amt) { 
     687        var change = amt * 60000;  // convert to msecs 
     688        countdown.end += change; 
     689        countdown.remaining += change; 
     690        updateRemainingTime(); 
     691} 
     692 
     693function formatTime(msecs)  { 
     694        var time = new Date(msecs); 
     695         
     696        var hrs = time.getUTCHours() + ((time.getUTCDate() -1) * 24); // I doubt anyone will spend more than 24 hours on a presentation or single slide but just in case... 
     697        hrs = (hrs < 10) ? '0'+hrs : hrs; 
     698        if (hrs == 'NaN' || isNaN(hrs)) hrs = '--'; 
     699         
     700        var min = time.getUTCMinutes(); 
     701        min = (min < 10) ? '0'+min : min; 
     702        if (min == 'NaN' || isNaN(min)) min = '--'; 
     703         
     704        var sec = time.getUTCSeconds(); 
     705        sec = (sec < 10) ? '0'+sec : sec; 
     706        if (sec == 'NaN' || isNaN(sec)) sec = '--'; 
     707 
     708        return hrs + ':' + min + ':' + sec; 
     709} 
     710 
     711function readTime(val) { 
     712        var sregex = /:/; 
     713        var matches = sregex.exec(val); 
     714        if (matches == null) { 
     715                return val; 
     716        } else { 
     717                var times = val.split(':'); 
     718                var hours = parseInt(times[0]); 
     719                var mins = parseInt(times[1]); 
     720                var total = (hours * 60) + mins; 
     721                return total; 
     722        } 
     723} 
     724 
     725function windowChange() { 
     726        fontScale(); 
     727} 
     728 
    531729function startup() { 
    532730        defaultCheck(); 
    533         if (!isOp) createControls(); 
     731        createControls();  // hallvord 
    534732        slideLabel(); 
     733        noteLabel(); // [SI:060104] must follow slideLabel() 
     734        loadNote(); 
    535735        fixLinks(); 
    536736        externalLinks(); 
    537737        fontScale(); 
    538         if (!isOp) { 
    539                 notOperaFix(); 
    540                 incrementals = createIncrementals(); 
    541                 slideJump(); 
    542                 if (defaultView == 'outline') { 
    543                         toggle(); 
    544                 } 
    545                 document.onkeyup = keys; 
    546                 document.onkeypress = trap; 
    547                 document.onclick = clicker; 
    548         } 
     738        if (!isOp) notOperaFix(); 
     739        incrementals = createIncrementals(); 
     740        slideJump(); 
     741        if (defaultView == 'outline') { 
     742                toggle(); 
     743        } 
     744        document.onkeyup = keys; 
     745        document.onkeypress = trap; 
     746        document.onclick = clicker; 
    549747} 
    550748 
    551749window.onload = startup; 
    552 window.onresize = function(){setTimeout('fontScale()', 50);} 
     750window.onresize = function(){setTimeout('windowChange()',5);}