Changeset 204
- Timestamp:
- 09/18/06 16:02:41 (2 years ago)
- Files:
-
- trunk/demo/spod5/ui/bg-shade.png (added)
- trunk/demo/spod5/ui/default/framing.css (modified) (1 diff)
- trunk/demo/spod5/ui/default/notes.css (added)
- trunk/demo/spod5/ui/default/pretty.css (modified) (3 diffs)
- trunk/demo/spod5/ui/default/s5-core.css (modified) (1 diff)
- trunk/demo/spod5/ui/default/slides.js (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/demo/spod5/ui/default/framing.css
r172 r204 11 11 .slide {top: 0; width: 92%; padding: 3.5em 4% 4%; z-index: 2; list-style: none;} 12 12 div#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;} 13 div#controls form {text-align: right; width: 100%; margin: 0;} 15 14 #currentSlide {position: absolute; width: 10%; left: 45%; bottom: 1em; z-index: 10;} 16 15 html>body #currentSlide {position: fixed;} trunk/demo/spod5/ui/default/pretty.css
r178 r204 1 1 /* Following are the presentation styles -- edit away! */ 2 2 3 body {background: #FFF url( axon_logo_500_fade.gif) -160px 0 no-repeat; color: #000; font-size: 2em;}3 body {background: #FFF url(bodybg.gif) -16px 0 no-repeat; color: #000; font-size: 2.25em;} 4 4 :link, :visited {text-decoration: none; color: #00C;} 5 5 #controls :active {color: #88A !important;} … … 30 30 .slide img.leader {display: block; margin: 0 auto;} 31 31 32 div#header, div#footer {background: # eee; color: #005;32 div#header, div#footer {background: #005; color: #AAB; 33 33 font-family: Verdana, Helvetica, sans-serif;} 34 div#header {background: # eee url(axon_logo_500_fade.gif) -167px -7pxno-repeat;35 line-height: 1px; border: 2px solid black; margin: 5px; width: 90%;}34 div#header {background: #005 url(bodybg.gif) -16px 0 no-repeat; 35 line-height: 1px;} 36 36 div#footer {font-size: 0.5em; font-weight: bold; padding: 1em 0;} 37 37 #footer h1, #footer h2 {display: block; padding: 0 1em;} … … 42 42 margin: 0; padding: 0.3em 0 0 50px; white-space: nowrap; 43 43 font: bold 150%/1em Helvetica, sans-serif; text-transform: capitalize; 44 color: # 005; background: transparent;}44 color: #DDE; background: #005;} 45 45 .slide h3 {font-size: 130%;} 46 46 h1 abbr {font-variant: small-caps;} 47 47 48 div#controls {position: absolute; left: 50%; bottom: 0;49 width: 50%;48 div#controls {position: absolute; left: 60%; bottom: 0; 49 width: 40%; 50 50 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;} 51 html>body div#controls {position: fixed; padding: 0; top: auto;} 55 52 #controls #navLinks a {padding: 0; margin: 0 0.5em; 56 background: # eee; border: none; color: #227;53 background: #005; border: none; color: #779; 57 54 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;} 60 56 61 57 #currentSlide {text-align: center; font-size: 0.5em; color: #449;} trunk/demo/spod5/ui/default/s5-core.css
r172 r204 4 4 html>body div#header, html>body div#footer, 5 5 html>body div#controls, html>body .slide {position: fixed;} 6 .handout {display: none;}6 .handout, .notes {display: none;} 7 7 .layout {display: block;} 8 8 .slide, .hideme, .incremental {visibility: hidden;} trunk/demo/spod5/ui/default/slides.js
r172 r204 1 // S5 v1. 1 slides.js -- released into the Public Domain1 // S5 v1.2a1 slides.js -- released into the Public Domain 2 2 // 3 3 // Please see http://www.meyerweb.com/eric/tools/s5/credits.html for information … … 14 14 var controlVis = 'visible'; 15 15 16 var isIE = navigator.appName == 'Microsoft Internet Explorer' ? 1 : 0; 16 var s5NotesWindow; 17 var s5NotesWindowLoaded = false; 18 var previousSlide = 0; 19 var presentationStart = new Date(); 20 var slideStart = new Date(); 21 22 var countdown = { 23 timer: 0, 24 state: 'pause', 25 start: new Date(), 26 end: 0, 27 remaining: 0 28 }; 29 30 31 var isIE = navigator.appName == 'Microsoft Internet Explorer' && navigator.userAgent.indexOf('Opera') < 1 ? 1 : 0; 17 32 var isOp = navigator.userAgent.indexOf('Opera') > -1 ? 1 : 0; 18 33 var isGe = navigator.userAgent.indexOf('Gecko') > -1 && navigator.userAgent.indexOf('Safari') < 1 ? 1 : 0; … … 29 44 30 45 function removeClass(object,className) { 31 if (!object ) return;46 if (!object || !hasClass(object,className)) return; 32 47 object.className = object.className.replace(new RegExp('(^|\\s)'+className+'(\\s|$)'), RegExp.$1+RegExp.$2); 33 48 } … … 82 97 var did = 'slide' + n.toString(); 83 98 obj.setAttribute('id',did); 84 if (isOp) continue; 99 100 // if (isOp) continue; // Opera fix (hallvord) 85 101 86 102 var otext = ''; … … 107 123 cs = document.currentSlide; 108 124 } 109 cs.innerHTML = '<span id="csHere">' + snum + '<\/span> ' + 125 cs.innerHTML = '<a id="plink" href="">' + 126 '<span id="csHere">' + snum + '<\/span> ' + 110 127 '<span id="csSep">\/<\/span> ' + 111 '<span id="csTotal">' + (smax-1) + '<\/span>'; 128 '<span id="csTotal">' + (smax-1) + '<\/span>' + 129 '<\/a>' 130 ; 112 131 if (snum == 0) { 113 132 cs.style.visibility = 'hidden'; … … 152 171 if (incrementals[snum].length > 0 && incpos > 0) 153 172 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 156 179 jl.selectedIndex = snum; 157 180 currentSlide(); 181 loadNote(); 182 permaLink(); 158 183 number = 0; 159 184 } … … 271 296 showHide('k'); 272 297 break; 298 case 78: // n 299 createNotesWindow(); 300 break; 273 301 } 274 302 if (key.which < 48 || key.which > 57) { … … 290 318 e = window.event; 291 319 } 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; 293 321 if (!e.which || e.which == 1) { 294 322 if (!incrementals[snum] || incpos >= incrementals[snum].length) { … … 372 400 } 373 401 402 function permaLink() { 403 document.getElementById('plink').href = window.location.pathname + '#slide' + snum; 404 } 405 374 406 function createControls() { 375 407 var controlsDiv = document.getElementById("controls"); … … 384 416 controlsDiv.innerHTML = '<form action="#" id="controlForm"' + hideDiv + '>' + 385 417 '<div id="navLinks">' + 418 '<a accesskey="n" id="show-notes" href="javascript:createNotesWindow();" title="Show Notes">≡<\/a>' + 386 419 '<a accesskey="t" id="toggle" href="javascript:toggle();">Ø<\/a>' + 387 420 '<a accesskey="z" id="prev" href="javascript:go(-1);">«<\/a>' + … … 399 432 function fontScale() { // causes layout problems in FireFox that get fixed if browser's Reload is used; same may be true of other Gecko-based browsers 400 433 if (!s5mode) return false; 401 var vScale = 22; // both yield 32 (after rounding) at 1024x768402 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? 403 436 if (window.innerHeight) { 404 437 var vSize = window.innerHeight; … … 425 458 function fontSize(value) { 426 459 if (!(s5ss = document.getElementById('s5ss'))) { 427 if (! isIE) {460 if (!document.createStyleSheet) { 428 461 document.getElementsByTagName('head')[0].appendChild(s5ss = document.createElement('style')); 429 462 s5ss.setAttribute('media','screen, projection'); … … 434 467 } 435 468 } 436 if (! isIE) {469 if (!(document.s5ss && document.s5ss.addRule)) { 437 470 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;'); 441 474 } 442 475 } … … 529 562 } 530 563 564 function 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 576 function 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 589 function 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 616 function resetElapsedTime() { 617 presentationStart = new Date(); 618 slideStart = new Date(); 619 updateElaspedTime(); 620 } 621 622 function resetElapsedSlide() { 623 if (snum != previousSlide) { 624 slideStart = new Date(); 625 previousSlide = snum; 626 updateElaspedTime(); 627 } 628 } 629 630 function 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 639 function 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 651 function 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 674 function 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 686 function alterRemainingTime(amt) { 687 var change = amt * 60000; // convert to msecs 688 countdown.end += change; 689 countdown.remaining += change; 690 updateRemainingTime(); 691 } 692 693 function 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 711 function 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 725 function windowChange() { 726 fontScale(); 727 } 728 531 729 function startup() { 532 730 defaultCheck(); 533 if (!isOp) createControls();731 createControls(); // hallvord 534 732 slideLabel(); 733 noteLabel(); // [SI:060104] must follow slideLabel() 734 loadNote(); 535 735 fixLinks(); 536 736 externalLinks(); 537 737 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; 549 747 } 550 748 551 749 window.onload = startup; 552 window.onresize = function(){setTimeout(' fontScale()', 50);}750 window.onresize = function(){setTimeout('windowChange()',5);}
