goncalossilva-showoff 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. data/LICENSE +20 -0
  2. data/README.rdoc +473 -0
  3. data/Rakefile +7 -0
  4. data/bin/showoff +136 -0
  5. data/lib/princely.rb +84 -0
  6. data/lib/showoff.rb +418 -0
  7. data/lib/showoff_utils.rb +361 -0
  8. data/public/css/fg.menu.css +114 -0
  9. data/public/css/onepage.css +60 -0
  10. data/public/css/pdf.css +12 -0
  11. data/public/css/reset.css +53 -0
  12. data/public/css/sh_style.css +66 -0
  13. data/public/css/showoff.css +350 -0
  14. data/public/css/spinner_bar.gif +0 -0
  15. data/public/css/theme/images/ui-bg_diagonals-small_100_f0efea_40x40.png +0 -0
  16. data/public/css/theme/images/ui-bg_flat_35_f0f0f0_40x100.png +0 -0
  17. data/public/css/theme/images/ui-bg_glass_55_fcf0ba_1x400.png +0 -0
  18. data/public/css/theme/images/ui-bg_glow-ball_25_2e2e28_600x600.png +0 -0
  19. data/public/css/theme/images/ui-bg_highlight-soft_100_f0efea_1x100.png +0 -0
  20. data/public/css/theme/images/ui-bg_highlight-soft_25_327E04_1x100.png +0 -0
  21. data/public/css/theme/images/ui-bg_highlight-soft_25_5A9D1A_1x100.png +0 -0
  22. data/public/css/theme/images/ui-bg_highlight-soft_95_ffedad_1x100.png +0 -0
  23. data/public/css/theme/images/ui-bg_inset-soft_22_3b3b35_1x100.png +0 -0
  24. data/public/css/theme/images/ui-icons_808080_256x240.png +0 -0
  25. data/public/css/theme/images/ui-icons_8DC262_256x240.png +0 -0
  26. data/public/css/theme/images/ui-icons_cd0a0a_256x240.png +0 -0
  27. data/public/css/theme/images/ui-icons_e7e6e4_256x240.png +0 -0
  28. data/public/css/theme/images/ui-icons_eeeeee_256x240.png +0 -0
  29. data/public/css/theme/images/ui-icons_ffffff_256x240.png +0 -0
  30. data/public/css/theme/ui.accordion.css +9 -0
  31. data/public/css/theme/ui.all.css +2 -0
  32. data/public/css/theme/ui.base.css +9 -0
  33. data/public/css/theme/ui.core.css +37 -0
  34. data/public/css/theme/ui.datepicker.css +62 -0
  35. data/public/css/theme/ui.dialog.css +13 -0
  36. data/public/css/theme/ui.progressbar.css +4 -0
  37. data/public/css/theme/ui.resizable.css +13 -0
  38. data/public/css/theme/ui.slider.css +17 -0
  39. data/public/css/theme/ui.tabs.css +9 -0
  40. data/public/css/theme/ui.theme.css +245 -0
  41. data/public/favicon.ico +0 -0
  42. data/public/js/core.js +79 -0
  43. data/public/js/fg.menu.js +645 -0
  44. data/public/js/jTypeWriter.js +26 -0
  45. data/public/js/jquery-1.4.2.min.js +154 -0
  46. data/public/js/jquery-print.js +109 -0
  47. data/public/js/jquery.batchImageLoad.js +56 -0
  48. data/public/js/jquery.cookie.js +96 -0
  49. data/public/js/jquery.cycle.all.js +1284 -0
  50. data/public/js/jquery.doubletap-0.1.js +105 -0
  51. data/public/js/jquery.uuid.js +24 -0
  52. data/public/js/jquery.ws-0.3pre.js +201 -0
  53. data/public/js/onepage.js +5 -0
  54. data/public/js/sh_lang/sh_bison.min.js +1 -0
  55. data/public/js/sh_lang/sh_c.min.js +1 -0
  56. data/public/js/sh_lang/sh_caml.min.js +1 -0
  57. data/public/js/sh_lang/sh_changelog.min.js +1 -0
  58. data/public/js/sh_lang/sh_cpp.min.js +1 -0
  59. data/public/js/sh_lang/sh_csharp.min.js +1 -0
  60. data/public/js/sh_lang/sh_css.min.js +1 -0
  61. data/public/js/sh_lang/sh_cucumber.min.js +2 -0
  62. data/public/js/sh_lang/sh_desktop.min.js +1 -0
  63. data/public/js/sh_lang/sh_diff.min.js +1 -0
  64. data/public/js/sh_lang/sh_flex.min.js +1 -0
  65. data/public/js/sh_lang/sh_glsl.min.js +1 -0
  66. data/public/js/sh_lang/sh_haxe.min.js +1 -0
  67. data/public/js/sh_lang/sh_html.min.js +1 -0
  68. data/public/js/sh_lang/sh_java.min.js +1 -0
  69. data/public/js/sh_lang/sh_javascript.min.js +1 -0
  70. data/public/js/sh_lang/sh_javascript_dom.min.js +1 -0
  71. data/public/js/sh_lang/sh_latex.min.js +1 -0
  72. data/public/js/sh_lang/sh_ldap.min.js +1 -0
  73. data/public/js/sh_lang/sh_log.min.js +1 -0
  74. data/public/js/sh_lang/sh_lsm.min.js +1 -0
  75. data/public/js/sh_lang/sh_m4.min.js +1 -0
  76. data/public/js/sh_lang/sh_makefile.min.js +1 -0
  77. data/public/js/sh_lang/sh_oracle.min.js +1 -0
  78. data/public/js/sh_lang/sh_pascal.min.js +1 -0
  79. data/public/js/sh_lang/sh_perl.min.js +1 -0
  80. data/public/js/sh_lang/sh_php.min.js +1 -0
  81. data/public/js/sh_lang/sh_prolog.min.js +1 -0
  82. data/public/js/sh_lang/sh_properties.min.js +1 -0
  83. data/public/js/sh_lang/sh_python.min.js +1 -0
  84. data/public/js/sh_lang/sh_ruby.min.js +1 -0
  85. data/public/js/sh_lang/sh_scala.min.js +1 -0
  86. data/public/js/sh_lang/sh_sh.min.js +1 -0
  87. data/public/js/sh_lang/sh_slang.min.js +1 -0
  88. data/public/js/sh_lang/sh_sml.min.js +1 -0
  89. data/public/js/sh_lang/sh_spec.min.js +1 -0
  90. data/public/js/sh_lang/sh_sql.min.js +1 -0
  91. data/public/js/sh_lang/sh_tcl.min.js +1 -0
  92. data/public/js/sh_lang/sh_xml.min.js +1 -0
  93. data/public/js/sh_lang/sh_xorg.min.js +1 -0
  94. data/public/js/sh_main.min.js +4 -0
  95. data/public/js/showoff.js +629 -0
  96. data/public/js/showoffcore.js +13 -0
  97. data/views/index.erb +81 -0
  98. data/views/onepage.erb +35 -0
  99. metadata +217 -0
@@ -0,0 +1 @@
1
+ if(!this.sh_languages){this.sh_languages={}}sh_languages.sh=[[[/\b(?:import)\b/g,"sh_preproc",-1],[/\b[+-]?(?:(?:0x[A-Fa-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/g,"sh_number",-1],[/\\"|\\'/g,"sh_normal",-1],[/"/g,"sh_string",1],[/'/g,"sh_string",2],[/function[ \t]+(?:[A-Za-z]|_)[A-Za-z0-9_]*[ \t]*(?:\(\))?|(?:[A-Za-z]|_)[A-Za-z0-9_]*[ \t]*\(\)/g,"sh_function",-1],[/(?:[A-Za-z]*[-\/]+[A-Za-z]+)+/g,"sh_normal",-1],[/\b(?:alias|bg|bind|break|builtin|caller|case|command|compgen|complete|continue|declare|dirs|disown|do|done|elif|else|enable|esac|eval|exec|exit|export|false|fc|fg|fi|for|getopts|hash|help|history|if|in|jobs|let|local|logout|popd|printf|pushd|read|readonly|return|select|set|shift|shopt|source|suspend|test|then|times|trap|true|type|typeset|umask|unalias|unset|until|wait|while)\b/g,"sh_keyword",-1],[/(?:[A-Za-z]|_)[A-Za-z0-9_]*(?==)|\$\{(?:[^ \t]+)\}|\$\((?:[^ \t]+)\)|\$(?:[A-Za-z]|_)[A-Za-z0-9_]*|\$(?:[^ \t]{1})/g,"sh_variable",-1],[/~|!|%|\^|\*|\(|\)|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\||%%|(?:##){2}(?!#)/g,"sh_symbol",-1],[/#/g,"sh_comment",3]],[[/"/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]],[[/'/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]],[[/$/g,null,-2]]];
@@ -0,0 +1 @@
1
+ if(!this.sh_languages){this.sh_languages={}}sh_languages.slang=[[[/#/g,"sh_comment",1],[/\b(?:ERROR_BLOCK|EXECUTE_ERROR_BLOCK|EXIT_BLOCK|NULL|__tmp|_for|and|break|case|catch|chs|continue|define|do|else|else|exch|finally|for|foreach|forever|if|ifnot|loop|mod|mul2|not|or|orelse|pop|private|public|return|shl|shr|sign|sqr|static|struct|switch|then|throw|try|typedef|using|variable|while|xor)\b/g,"sh_keyword",-1],[/%/g,"sh_comment",1],[/"/g,"sh_string",2],[/'/g,"sh_string",3],[/\b[+-]?(?:(?:0x[A-Fa-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/g,"sh_number",-1],[/~|!|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|&|<|>|\|/g,"sh_symbol",-1],[/\b(?:require)\b/g,"sh_preproc",-1],[/(?:[A-Za-z]|_)[A-Za-z0-9_]*(?=[ \t]*\()/g,"sh_function",-1]],[[/$/g,null,-2]],[[/$/g,null,-2],[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/$/g,null,-2],[/\\(?:\\|')/g,null,-1],[/'/g,"sh_string",-2]]];
@@ -0,0 +1 @@
1
+ if(!this.sh_languages){this.sh_languages={}}sh_languages.sml=[[[/\b(?:external|open|include|[A-Z][\w']*(?=\.))\b/g,"sh_preproc",-1],[/\b[+-]?(?:(?:0x[A-Fa-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/g,"sh_number",-1],[/"/g,"sh_string",1],[/\(\*/g,"sh_comment",2],[/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\|/g,"sh_symbol",-1],[/\{|\}/g,"sh_cbracket",-1],[/\b(?:abstraction|abstype|and|andalso|as|before|case|datatype|do|else|end|eqtype|exception|fn|fun|functor|handle|if|in|include|infix|infixr|let|local|nonfix|o|of|op|open|orelse|overload|raise|rec|sharing|sig|signature|struct|structure|then|type|val|where|while|with|withtype)\b/g,"sh_keyword",-1],[/\b(?:int|byte|boolean|char|long|float|double|short|void)\b/g,"sh_type",-1]],[[/$/g,null,-2],[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/\*\)/g,"sh_comment",-2],[/\(\*/g,"sh_comment",2]]];
@@ -0,0 +1 @@
1
+ if(!this.sh_languages){this.sh_languages={}}sh_languages.spec=[[[/#/g,"sh_comment",1],[/^[A-Za-z0-9_-]+:/g,"sh_keyword",-1],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/\b[+-]?(?:(?:0x[A-Fa-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/g,"sh_number",-1],[/\$[A-Za-z0-9_]+/g,"sh_variable",-1],[/%(?:\{?)[A-Za-z0-9_]+(?:\}?)/g,"sh_preproc",-1]],[[/$/g,null,-2]]];
@@ -0,0 +1 @@
1
+ if(!this.sh_languages){this.sh_languages={}}sh_languages.sql=[[[/\b(?:VARCHAR|TINYINT|TEXT|DATE|SMALLINT|MEDIUMINT|INT|BIGINT|FLOAT|DOUBLE|DECIMAL|DATETIME|TIMESTAMP|TIME|YEAR|UNSIGNED|CHAR|TINYBLOB|TINYTEXT|BLOB|MEDIUMBLOB|MEDIUMTEXT|LONGBLOB|LONGTEXT|ENUM|BOOL|BINARY|VARBINARY)\b/gi,"sh_type",-1],[/\b(?:ALL|ASC|AS|ALTER|AND|ADD|AUTO_INCREMENT|BETWEEN|BINARY|BOTH|BY|BOOLEAN|CHANGE|CHECK|COLUMNS|COLUMN|CROSS|CREATE|DATABASES|DATABASE|DATA|DELAYED|DESCRIBE|DESC|DISTINCT|DELETE|DROP|DEFAULT|ENCLOSED|ESCAPED|EXISTS|EXPLAIN|FIELDS|FIELD|FLUSH|FOR|FOREIGN|FUNCTION|FROM|GROUP|GRANT|HAVING|IGNORE|INDEX|INFILE|INSERT|INNER|INTO|IDENTIFIED|IN|IS|IF|JOIN|KEYS|KILL|KEY|LEADING|LIKE|LIMIT|LINES|LOAD|LOCAL|LOCK|LOW_PRIORITY|LEFT|LANGUAGE|MODIFY|NATURAL|NOT|NULL|NEXTVAL|OPTIMIZE|OPTION|OPTIONALLY|ORDER|OUTFILE|OR|OUTER|ON|PROCEDURE|PROCEDURAL|PRIMARY|READ|REFERENCES|REGEXP|RENAME|REPLACE|RETURN|REVOKE|RLIKE|RIGHT|SHOW|SONAME|STATUS|STRAIGHT_JOIN|SELECT|SETVAL|SET|TABLES|TERMINATED|TO|TRAILING|TRUNCATE|TABLE|TEMPORARY|TRIGGER|TRUSTED|UNIQUE|UNLOCK|USE|USING|UPDATE|VALUES|VARIABLES|VIEW|WITH|WRITE|WHERE|ZEROFILL|TYPE|XOR)\b/gi,"sh_keyword",-1],[/"/g,"sh_string",1],[/'/g,"sh_string",2],[/`/g,"sh_string",3],[/#/g,"sh_comment",4],[/\/\/\//g,"sh_comment",5],[/\/\//g,"sh_comment",4],[/\/\*\*/g,"sh_comment",11],[/\/\*/g,"sh_comment",12],[/--/g,"sh_comment",4],[/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\|/g,"sh_symbol",-1],[/\b[+-]?(?:(?:0x[A-Fa-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/g,"sh_number",-1]],[[/"/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]],[[/'/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]],[[/`/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]],[[/$/g,null,-2]],[[/$/g,null,-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",6,1],[/<!DOCTYPE/g,"sh_preproc",8,1],[/<!--/g,"sh_comment",9],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",10,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",10,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\?>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",7]],[[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",7]],[[/-->/g,"sh_comment",-2],[/<!--/g,"sh_comment",9]],[[/(?:\/)?>/g,"sh_keyword",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",7]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",6,1],[/<!DOCTYPE/g,"sh_preproc",8,1],[/<!--/g,"sh_comment",9],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",10,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",10,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]]];
@@ -0,0 +1 @@
1
+ if(!this.sh_languages){this.sh_languages={}}sh_languages.tcl=[[[/#/g,"sh_comment",1],[/\b[+-]?(?:(?:0x[A-Fa-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/g,"sh_number",-1],[/"/g,"sh_string",2],[/'/g,"sh_string",3],[/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\|/g,"sh_symbol",-1],[/\{|\}/g,"sh_cbracket",-1],[/\b(?:proc|global|upvar|if|then|else|elseif|for|foreach|break|continue|while|set|eval|case|in|switch|default|exit|error|proc|return|uplevel|loop|for_array_keys|for_recursive_glob|for_file|unwind_protect|expr|catch|namespace|rename|variable|method|itcl_class|public|protected|append|binary|format|re_syntax|regexp|regsub|scan|string|subst|concat|join|lappend|lindex|list|llength|lrange|lreplace|lsearch|lset|lsort|split|expr|incr|close|eof|fblocked|fconfigure|fcopy|file|fileevent|flush|gets|open|puts|read|seek|socket|tell|load|loadTk|package|pgk::create|pgk_mkIndex|source|bgerror|history|info|interp|memory|unknown|enconding|http|msgcat|cd|clock|exec|exit|glob|pid|pwd|time|dde|registry|resource)\b/g,"sh_keyword",-1],[/\$[A-Za-z0-9_]+/g,"sh_variable",-1]],[[/$/g,null,-2]],[[/"/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]],[[/'/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]]];
@@ -0,0 +1 @@
1
+ if(!this.sh_languages){this.sh_languages={}}sh_languages.xml=[[[/<\?xml/g,"sh_preproc",1,1],[/<!DOCTYPE/g,"sh_preproc",3,1],[/<!--/g,"sh_comment",4],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",5,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1]],[[/\?>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",2]],[[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",2]],[[/-->/g,"sh_comment",-2],[/<!--/g,"sh_comment",4]],[[/(?:\/)?>/g,"sh_keyword",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",2]]];
@@ -0,0 +1 @@
1
+ if(!this.sh_languages){this.sh_languages={}}sh_languages.xorg=[[[/#/g,"sh_comment",1],[/\b[+-]?(?:(?:0x[A-Fa-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/g,"sh_number",-1],[/"/g,"sh_string",2],[/'/g,"sh_string",3],[/\b(?:End)?(?:Sub)*Section\b/g,"sh_keyword",-1],[/[A-Za-z0-9_]+/g,"sh_type",-1]],[[/$/g,null,-2]],[[/"/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]],[[/'/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]]];
@@ -0,0 +1,4 @@
1
+ /* Copyright (C) 2007, 2008 gnombat@users.sourceforge.net */
2
+ /* License: http://shjs.sourceforge.net/doc/gplv3.html */
3
+
4
+ if(!this.sh_languages){this.sh_languages={}}var sh_requests={};function sh_isEmailAddress(a){if(/^mailto:/.test(a)){return false}return a.indexOf("@")!==-1}function sh_setHref(b,c,d){var a=d.substring(b[c-2].pos,b[c-1].pos);if(a.length>=2&&a.charAt(0)==="<"&&a.charAt(a.length-1)===">"){a=a.substr(1,a.length-2)}if(sh_isEmailAddress(a)){a="mailto:"+a}b[c-2].node.href=a}function sh_konquerorExec(b){var a=[""];a.index=b.length;a.input=b;return a}function sh_highlightString(B,o){if(/Konqueror/.test(navigator.userAgent)){if(!o.konquered){for(var F=0;F<o.length;F++){for(var H=0;H<o[F].length;H++){var G=o[F][H][0];if(G.source==="$"){G.exec=sh_konquerorExec}}}o.konquered=true}}var N=document.createElement("a");var q=document.createElement("span");var A=[];var j=0;var n=[];var C=0;var k=null;var x=function(i,a){var p=i.length;if(p===0){return}if(!a){var Q=n.length;if(Q!==0){var r=n[Q-1];if(!r[3]){a=r[1]}}}if(k!==a){if(k){A[j++]={pos:C};if(k==="sh_url"){sh_setHref(A,j,B)}}if(a){var P;if(a==="sh_url"){P=N.cloneNode(false)}else{P=q.cloneNode(false)}P.className=a;A[j++]={node:P,pos:C}}}C+=p;k=a};var t=/\r\n|\r|\n/g;t.lastIndex=0;var d=B.length;while(C<d){var v=C;var l;var w;var h=t.exec(B);if(h===null){l=d;w=d}else{l=h.index;w=t.lastIndex}var g=B.substring(v,l);var M=[];for(;;){var I=C-v;var D;var y=n.length;if(y===0){D=0}else{D=n[y-1][2]}var O=o[D];var z=O.length;var m=M[D];if(!m){m=M[D]=[]}var E=null;var u=-1;for(var K=0;K<z;K++){var f;if(K<m.length&&(m[K]===null||I<=m[K].index)){f=m[K]}else{var c=O[K][0];c.lastIndex=I;f=c.exec(g);m[K]=f}if(f!==null&&(E===null||f.index<E.index)){E=f;u=K;if(f.index===I){break}}}if(E===null){x(g.substring(I),null);break}else{if(E.index>I){x(g.substring(I,E.index),null)}var e=O[u];var J=e[1];var b;if(J instanceof Array){for(var L=0;L<J.length;L++){b=E[L+1];x(b,J[L])}}else{b=E[0];x(b,J)}switch(e[2]){case -1:break;case -2:n.pop();break;case -3:n.length=0;break;default:n.push(e);break}}}if(k){A[j++]={pos:C};if(k==="sh_url"){sh_setHref(A,j,B)}k=null}C=w}return A}function sh_getClasses(d){var a=[];var b=d.className;if(b&&b.length>0){var e=b.split(" ");for(var c=0;c<e.length;c++){if(e[c].length>0){a.push(e[c])}}}return a}function sh_addClass(c,a){var d=sh_getClasses(c);for(var b=0;b<d.length;b++){if(a.toLowerCase()===d[b].toLowerCase()){return}}d.push(a);c.className=d.join(" ")}function sh_extractTagsFromNodeList(c,a){var f=c.length;for(var d=0;d<f;d++){var e=c.item(d);switch(e.nodeType){case 1:if(e.nodeName.toLowerCase()==="br"){var b;if(/MSIE/.test(navigator.userAgent)){b="\r"}else{b="\n"}a.text.push(b);a.pos++}else{a.tags.push({node:e.cloneNode(false),pos:a.pos});sh_extractTagsFromNodeList(e.childNodes,a);a.tags.push({pos:a.pos})}break;case 3:case 4:a.text.push(e.data);a.pos+=e.length;break}}}function sh_extractTags(c,b){var a={};a.text=[];a.tags=b;a.pos=0;sh_extractTagsFromNodeList(c.childNodes,a);return a.text.join("")}function sh_mergeTags(d,f){var a=d.length;if(a===0){return f}var c=f.length;if(c===0){return d}var i=[];var e=0;var b=0;while(e<a&&b<c){var h=d[e];var g=f[b];if(h.pos<=g.pos){i.push(h);e++}else{i.push(g);if(f[b+1].pos<=h.pos){b++;i.push(f[b]);b++}else{i.push({pos:h.pos});f[b]={node:g.node.cloneNode(false),pos:h.pos}}}}while(e<a){i.push(d[e]);e++}while(b<c){i.push(f[b]);b++}return i}function sh_insertTags(k,h){var g=document;var l=document.createDocumentFragment();var e=0;var d=k.length;var b=0;var j=h.length;var c=l;while(b<j||e<d){var i;var a;if(e<d){i=k[e];a=i.pos}else{a=j}if(a<=b){if(i.node){var f=i.node;c.appendChild(f);c=f}else{c=c.parentNode}e++}else{c.appendChild(g.createTextNode(h.substring(b,a)));b=a}}return l}function sh_highlightElement(d,g){sh_addClass(d,"sh_sourceCode");var c=[];var e=sh_extractTags(d,c);var f=sh_highlightString(e,g);var b=sh_mergeTags(c,f);var a=sh_insertTags(b,e);while(d.hasChildNodes()){d.removeChild(d.firstChild)}d.appendChild(a)}function sh_getXMLHttpRequest(){if(window.ActiveXObject){return new ActiveXObject("Msxml2.XMLHTTP")}else{if(window.XMLHttpRequest){return new XMLHttpRequest()}}throw"No XMLHttpRequest implementation available"}function sh_load(language,element,prefix,suffix){if(language in sh_requests){sh_requests[language].push(element);return}sh_requests[language]=[element];var request=sh_getXMLHttpRequest();var url=prefix+"sh_"+language+suffix;request.open("GET",url,true);request.onreadystatechange=function(){if(request.readyState===4){try{if(!request.status||request.status===200){eval(request.responseText);var elements=sh_requests[language];for(var i=0;i<elements.length;i++){sh_highlightElement(elements[i],sh_languages[language])}}else{throw"HTTP error: status "+request.status}}finally{request=null}}};request.send(null)}function sh_highlightDocument(g,k){var b=document.getElementsByTagName("pre");for(var e=0;e<b.length;e++){var f=b.item(e);var a=sh_getClasses(f);for(var c=0;c<a.length;c++){var h=a[c].toLowerCase();if(h==="sh_sourcecode"){continue}if(h.substr(0,3)==="sh_"){var d=h.substring(3);if(d in sh_languages){sh_highlightElement(f,sh_languages[d])}else{if(typeof(g)==="string"&&typeof(k)==="string"){sh_load(d,f,g,k)}else{throw'Found <pre> element with class="'+h+'", but no such language exists'}}break}}}};
@@ -0,0 +1,629 @@
1
+ /* ShowOff JS Logic */
2
+
3
+ var ShowOff = {};
4
+
5
+ var preso_started = false
6
+ var slidenum = 0
7
+ var slideTotal = 0
8
+ var slides
9
+ var currentSlide
10
+ var totalslides = 0
11
+ var slidesLoaded = false
12
+ var incrSteps = 0
13
+ var incrElem
14
+ var incrCurr = 0
15
+ var incrCode = false
16
+ var debugMode = false
17
+ var gotoSlidenum = 0
18
+ var shiftKeyActive = false
19
+
20
+ var loadSlidesBool
21
+ var loadSlidesPrefix
22
+
23
+ function setupPreso(load_slides, prefix) {
24
+ if (preso_started)
25
+ {
26
+ alert("already started")
27
+ return
28
+ }
29
+ preso_started = true
30
+
31
+ loadSlidesBool = load_slides
32
+ loadSlidesPrefix = prefix
33
+ loadSlides(loadSlidesBool, loadSlidesPrefix)
34
+
35
+ doDebugStuff()
36
+
37
+ // bind event handlers
38
+ document.onkeydown = keyDown
39
+ document.onkeyup = keyUp
40
+ /* window.onresize = resized; */
41
+ /* window.onscroll = scrolled; */
42
+ /* window.onunload = unloaded; */
43
+ }
44
+
45
+ function loadSlides(load_slides, prefix) {
46
+ //load slides offscreen, wait for images and then initialize
47
+ if (load_slides) {
48
+ $("#slides").load("slides", false, function(){
49
+ $("#slides img").batchImageLoad({
50
+ loadingCompleteCallback: initializePresentation(prefix)
51
+ })
52
+ })
53
+ } else {
54
+ $("#slides img").batchImageLoad({
55
+ loadingCompleteCallback: initializePresentation(prefix)
56
+ })
57
+ }
58
+ }
59
+
60
+ function initializePresentation(prefix) {
61
+ // unhide for height to work in static mode
62
+ $("#slides").show();
63
+
64
+ //center slides offscreen
65
+ centerSlides($('#slides > .slide'))
66
+
67
+ //copy into presentation area
68
+ $("#preso").empty()
69
+ $('#slides > .slide').appendTo($("#preso"))
70
+
71
+ //populate vars
72
+ slides = $('#preso > .slide')
73
+ slideTotal = slides.size()
74
+
75
+ //setup manual jquery cycle
76
+ $('#preso').cycle({
77
+ timeout: 0
78
+ })
79
+
80
+ setupMenu()
81
+ if (slidesLoaded) {
82
+ showSlide()
83
+ } else {
84
+ showFirstSlide();
85
+ slidesLoaded = true
86
+ }
87
+ setupSlideParamsCheck();
88
+ sh_highlightDocument(prefix+'/js/sh_lang/', '.min.js')
89
+ $(".preso").trigger("showoff:loaded");
90
+ }
91
+
92
+ function centerSlides(slides) {
93
+ slides.each(function(s, slide) {
94
+ centerSlide(slide)
95
+ })
96
+ }
97
+
98
+ function centerSlide(slide) {
99
+ var slide_content = $(slide).children(".content").first()
100
+ var height = slide_content.height()
101
+ var mar_top = (0.5 * parseFloat($(slide).height())) - (0.5 * parseFloat(height))
102
+ if (mar_top < 0) {
103
+ mar_top = 0
104
+ }
105
+ slide_content.css('margin-top', mar_top)
106
+ }
107
+
108
+ function setupMenu() {
109
+ $('#navmenu').hide();
110
+
111
+ var currSlide = 0
112
+ var menu = new ListMenu()
113
+
114
+ slides.each(function(s, elem) {
115
+ content = $(elem).children(".content")
116
+ shortTxt = $(content).text().substr(0, 20)
117
+ path = $(content).attr('ref').split('/')
118
+ currSlide += 1
119
+ menu.addItem(path, shortTxt, currSlide)
120
+ })
121
+
122
+ $('#navigation').html(menu.getList())
123
+ $('#navmenu').menu({
124
+ content: $('#navigation').html(),
125
+ flyOut: true
126
+ });
127
+ }
128
+
129
+ function checkSlideParameter() {
130
+ if (slideParam = currentSlideFromParams()) {
131
+ slidenum = slideParam;
132
+ }
133
+ }
134
+
135
+ function currentSlideFromParams() {
136
+ var result;
137
+ if (result = window.location.hash.match(/#([0-9]+)/)) {
138
+ return result[result.length - 1] - 1;
139
+ }
140
+ }
141
+
142
+ function setupSlideParamsCheck() {
143
+ var check = function() {
144
+ var currentSlide = currentSlideFromParams();
145
+ if (slidenum != currentSlide) {
146
+ slidenum = currentSlide;
147
+ showSlide();
148
+ }
149
+ setTimeout(check, 100);
150
+ }
151
+ setTimeout(check, 100);
152
+ }
153
+
154
+ function gotoSlide(slideNum) {
155
+ slidenum = parseInt(slideNum)
156
+ if (!isNaN(slidenum)) {
157
+ showSlide()
158
+ }
159
+ }
160
+
161
+ function showFirstSlide() {
162
+ slidenum = 0
163
+ checkSlideParameter();
164
+ showSlide()
165
+ }
166
+
167
+ function showSlide(back_step) {
168
+
169
+ if(slidenum < 0) {
170
+ slidenum = 0
171
+ return
172
+ }
173
+
174
+ if(slidenum > (slideTotal - 1)) {
175
+ slidenum = slideTotal - 1
176
+ return
177
+ }
178
+
179
+ currentSlide = slides.eq(slidenum)
180
+
181
+ var transition = currentSlide.attr('data-transition')
182
+ var fullPage = currentSlide.find(".content").is('.full-page');
183
+
184
+ if (back_step || fullPage) {
185
+ transition = 'none'
186
+ }
187
+
188
+ $('#preso').cycle(slidenum, transition)
189
+
190
+ if (fullPage) {
191
+ $('#preso').css({'width' : '100%', 'overflow' : 'visible'});
192
+ currentSlide.css({'width' : '100%', 'text-align' : 'center', 'overflow' : 'visible'});
193
+ }
194
+
195
+ percent = getSlidePercent()
196
+ $("#slideInfo").text((slidenum + 1) + '/' + slideTotal + ' - ' + percent + '%')
197
+
198
+ if(!back_step) {
199
+ // determine if there are incremental bullets to show
200
+ // unless we are moving backward
201
+ determineIncremental()
202
+ } else {
203
+ incrCurr = 0
204
+ incrSteps = 0
205
+ }
206
+ location.hash = slidenum + 1;
207
+ $('body').addSwipeEvents().
208
+ bind('tap', swipeLeft). // next
209
+ bind('swipeleft', swipeLeft). // next
210
+ bind('swiperight', swipeRight); // prev
211
+
212
+ removeResults();
213
+
214
+ $(currentSlide).find(".content").trigger("showoff:show");
215
+
216
+ return getCurrentNotes()
217
+ }
218
+
219
+ function getSlideProgress()
220
+ {
221
+ return (slidenum + 1) + '/' + slideTotal
222
+ }
223
+
224
+ function getCurrentNotes()
225
+ {
226
+ var notes = currentSlide.find("p.notes").text()
227
+ $('#notesInfo').text(notes)
228
+ return notes
229
+ }
230
+
231
+ function getSlidePercent()
232
+ {
233
+ return Math.ceil(((slidenum + 1) / slideTotal) * 100)
234
+ }
235
+
236
+ function determineIncremental()
237
+ {
238
+ incrCurr = 0
239
+ incrCode = false
240
+ incrElem = currentSlide.find(".incremental > ul > li")
241
+ incrSteps = incrElem.size()
242
+ if(incrSteps == 0) {
243
+ // also look for commandline
244
+ incrElem = currentSlide.find(".incremental > pre > code > code")
245
+ incrSteps = incrElem.size()
246
+ incrCode = true
247
+ }
248
+ incrElem.each(function(s, elem) {
249
+ $(elem).hide()
250
+ })
251
+ }
252
+
253
+ function prevStep()
254
+ {
255
+
256
+ var event = jQuery.Event("showoff:prev");
257
+ $(currentSlide).find(".content").trigger(event);
258
+ if (event.isDefaultPrevented()) {
259
+ return;
260
+ }
261
+
262
+ slidenum--
263
+ return showSlide(true) // We show the slide fully loaded
264
+ }
265
+
266
+ function nextStep()
267
+ {
268
+ var event = jQuery.Event("showoff:next");
269
+ $(currentSlide).find(".content").trigger(event);
270
+ if (event.isDefaultPrevented()) {
271
+ return;
272
+ }
273
+
274
+ if (incrCurr >= incrSteps) {
275
+ slidenum++
276
+ return showSlide()
277
+ } else {
278
+ elem = incrElem.eq(incrCurr)
279
+ if (incrCode && elem.hasClass('command')) {
280
+ incrElem.eq(incrCurr).show().jTypeWriter({duration:1.0})
281
+ } else {
282
+ incrElem.eq(incrCurr).show()
283
+ }
284
+ incrCurr++
285
+ }
286
+ }
287
+
288
+ function doDebugStuff()
289
+ {
290
+ if (debugMode) {
291
+ $('#debugInfo').show()
292
+ debug('debug mode on')
293
+ } else {
294
+ $('#debugInfo').hide()
295
+ }
296
+ }
297
+
298
+ var notesMode = false
299
+ function toggleNotes()
300
+ {
301
+ notesMode = !notesMode
302
+ if (notesMode) {
303
+ $('#notesInfo').show()
304
+ debug('notes mode on')
305
+ } else {
306
+ $('#notesInfo').hide()
307
+ }
308
+ }
309
+
310
+ function debug(data)
311
+ {
312
+ $('#debugInfo').text(data)
313
+ }
314
+
315
+ // See e.g. http://www.quirksmode.org/js/keys.html for keycodes
316
+ function keyDown(event)
317
+ {
318
+ var key = event.keyCode;
319
+
320
+ if (event.ctrlKey || event.altKey || event.metaKey)
321
+ return true;
322
+
323
+ debug('keyDown: ' + key)
324
+
325
+ if (key >= 48 && key <= 57) // 0 - 9
326
+ {
327
+ gotoSlidenum = gotoSlidenum * 10 + (key - 48);
328
+ return true;
329
+ }
330
+
331
+ if (key == 13){
332
+ if (gotoSlidenum > 0) {
333
+ debug('go to ' + gotoSlidenum);
334
+ slidenum = gotoSlidenum - 1;
335
+ showSlide(true);
336
+ gotoSlidenum = 0;
337
+ } else {
338
+ debug('executeCode');
339
+ var $jsCode = $('.execute .sh_javascript code:visible')
340
+ if ($jsCode.length > 0) {
341
+ executeCode.call($jsCode);
342
+ }
343
+ var $rubyCode = $('.execute .sh_ruby code:visible')
344
+ if ($rubyCode.length > 0) {
345
+ executeRuby.call($rubyCode);
346
+ }
347
+ }
348
+
349
+ }
350
+
351
+
352
+ if (key == 16) // shift key
353
+ {
354
+ shiftKeyActive = true;
355
+ }
356
+ if (key == 32) // space bar
357
+ {
358
+ if (shiftKeyActive) { prevStep() }
359
+ else { nextStep() }
360
+ }
361
+ else if (key == 68) // 'd' for debug
362
+ {
363
+ debugMode = !debugMode
364
+ doDebugStuff()
365
+ }
366
+ else if (key == 37 || key == 33 || key == 38) // Left arrow, page up, or up arrow
367
+ {
368
+ prevStep()
369
+ }
370
+ else if (key == 39 || key == 34 || key == 40) // Right arrow, page down, or down arrow
371
+ {
372
+ nextStep()
373
+ }
374
+ else if (key == 82) // R for reload
375
+ {
376
+ if (confirm('really reload slides?')) {
377
+ loadSlides(loadSlidesBool, loadSlidesPrefix)
378
+ showSlide()
379
+ }
380
+ }
381
+ else if (key == 84 || key == 67) // T or C for table of contents
382
+ {
383
+ $('#navmenu').toggle().trigger('click')
384
+ }
385
+ else if (key == 90) // z for help
386
+ {
387
+ $('#help').toggle()
388
+ }
389
+ else if (key == 66 || key == 70) // f for footer (also "b" which is what kensington remote "stop" button sends
390
+ {
391
+ toggleFooter()
392
+ }
393
+ else if (key == 78) // 'n' for notes
394
+ {
395
+ toggleNotes()
396
+ }
397
+ else if (key == 27) // esc
398
+ {
399
+ removeResults();
400
+ }
401
+ else if (key == 80) // 'p' for preshow
402
+ {
403
+ runPreShow();
404
+ }
405
+ return true
406
+ }
407
+
408
+ function toggleFooter()
409
+ {
410
+ $('#footer').toggle()
411
+ }
412
+
413
+ function keyUp(event) {
414
+ var key = event.keyCode;
415
+ debug('keyUp: ' + key);
416
+ if (key == 16) // shift key
417
+ {
418
+ shiftKeyActive = false;
419
+ }
420
+ }
421
+
422
+
423
+ var lastSwipeLeft = (+new Date());
424
+ var lastSwipeRight = (+new Date());
425
+ function swipeLeft() {
426
+ var time = (+new Date());
427
+ if((time - lastSwipeLeft) > 100) {
428
+ lastSwipeLeft = time;
429
+ nextStep();
430
+ }
431
+ }
432
+
433
+ function swipeRight() {
434
+ var time = (+new Date());
435
+ if((time - lastSwipeRight) > 100) {
436
+ lastSwipeRight = time;
437
+ prevStep();
438
+ }
439
+ }
440
+
441
+ function ListMenu(s)
442
+ {
443
+ this.slide = s
444
+ this.typeName = 'ListMenu'
445
+ this.itemLength = 0;
446
+ this.items = new Array();
447
+ this.addItem = function (key, text, slide) {
448
+ if (key.length > 1) {
449
+ thisKey = key.shift()
450
+ if (!this.items[thisKey]) {
451
+ this.items[thisKey] = new ListMenu(slide)
452
+ }
453
+ this.items[thisKey].addItem(key, text, slide)
454
+ } else {
455
+ thisKey = key.shift()
456
+ this.items[thisKey] = new ListMenuItem(text, slide)
457
+ }
458
+ }
459
+ this.getList = function() {
460
+ var newMenu = $("<ul>")
461
+ for(var i in this.items) {
462
+ var item = this.items[i]
463
+ var domItem = $("<li>")
464
+ if (item.typeName == 'ListMenu') {
465
+ choice = $("<a rel=\"" + (item.slide - 1) + "\" href=\"#\">" + i + "</a>")
466
+ domItem.append(choice)
467
+ domItem.append(item.getList())
468
+ }
469
+ if (item.typeName == 'ListMenuItem') {
470
+ choice = $("<a rel=\"" + (item.slide - 1) + "\" href=\"#\">" + item.slide + '. ' + item.textName + "</a>")
471
+ domItem.append(choice)
472
+ }
473
+ newMenu.append(domItem)
474
+ }
475
+ return newMenu
476
+ }
477
+ }
478
+
479
+ function ListMenuItem(t, s)
480
+ {
481
+ this.typeName = "ListMenuItem"
482
+ this.slide = s
483
+ this.textName = t
484
+ }
485
+
486
+ var removeResults = function() {
487
+ $('.results').remove();
488
+ };
489
+
490
+ var print = function(text) {
491
+ removeResults();
492
+ var _results = $('<div>').addClass('results').html($.print(text, {max_string:500}));
493
+ $('body').append(_results);
494
+ _results.click(removeResults);
495
+ };
496
+
497
+ function executeCode () {
498
+ result = null;
499
+ var codeDiv = $(this);
500
+ codeDiv.addClass("executing");
501
+ eval(codeDiv.text());
502
+ setTimeout(function() { codeDiv.removeClass("executing");}, 250 );
503
+ if (result != null) print(result);
504
+ }
505
+ $('.execute .sh_javascript code').live("click", executeCode);
506
+
507
+ function executeRuby () {
508
+ var codeDiv = $(this);
509
+ codeDiv.addClass("executing");
510
+ $.get('/eval_ruby', {code: codeDiv.text()}, function(result) {
511
+ if (result != null) print(result);
512
+ codeDiv.removeClass("executing");
513
+ });
514
+ }
515
+ $('.execute .sh_ruby code').live("click", executeRuby);
516
+
517
+
518
+ /********************
519
+ PreShow Code
520
+ ********************/
521
+
522
+ var preshow_seconds = 0;
523
+ var preshow_secondsLeft = 0;
524
+ var preshow_secondsPer = 8;
525
+ var preshow_running = false;
526
+ var preshow_timerRunning = false;
527
+ var preshow_current = 0;
528
+ var preshow_images;
529
+ var preshow_imagesTotal = 0;
530
+ var preshow_des;
531
+
532
+ function runPreShow() {
533
+ if(preshow_running) {
534
+ stopPreShow()
535
+ } else {
536
+ var minutes = prompt("Minutes from now to start")
537
+ preshow_secondsLeft = parseFloat(minutes) * 60
538
+ toggleFooter()
539
+ $.getJSON("preshow_files", false, function(data) {
540
+ $('#preso').after("<div id='preshow'></div><div id='tips'></div><div id='preshow_timer'></div>")
541
+ $.each(data, function(i, n) {
542
+ if(n == "preshow.json") {
543
+ // has a descriptions file
544
+ $.getJSON("/file/_preshow/preshow.json", false, function(data) {
545
+ preshow_des = data
546
+ })
547
+ } else {
548
+ $('#preshow').append('<img ref="' + n + '" src="/file/_preshow/' + n + '"/>')
549
+ }
550
+ })
551
+ startPreShow()
552
+ })
553
+ }
554
+ }
555
+
556
+ function startPreShow() {
557
+ if (!preshow_running) {
558
+ preshow_running = true
559
+ preshow_seconds = 0
560
+ preshow_images = $('#preshow > img')
561
+ preshow_imagesTotal = preshow_images.size()
562
+ nextPreShowImage()
563
+
564
+ if(!preshow_timerRunning) {
565
+ setInterval(function() {
566
+ preshow_timerRunning = true
567
+ if (!preshow_running) { return }
568
+ preshow_seconds++
569
+ preshow_secondsLeft--
570
+ if (preshow_secondsLeft < 0) {
571
+ stopPreShow()
572
+ }
573
+ if (preshow_seconds == preshow_secondsPer) {
574
+ preshow_seconds = 0
575
+ nextPreShowImage()
576
+ }
577
+ addPreShowTips()
578
+ }, 1000)
579
+ }
580
+ }
581
+ }
582
+
583
+ function addPreShowTips() {
584
+ time = secondsToTime(preshow_secondsLeft)
585
+ $('#preshow_timer').text(time + ' to go-time')
586
+ var des = preshow_des[tmpImg.attr("ref")]
587
+ if(des) {
588
+ $('#tips').show()
589
+ $('#tips').text(des)
590
+ } else {
591
+ $('#tips').hide()
592
+ }
593
+ }
594
+
595
+ function secondsToTime(sec) {
596
+ min = Math.floor(sec / 60)
597
+ sec = sec - (min * 60)
598
+ if(sec < 10) {
599
+ sec = "0" + sec
600
+ }
601
+ return min + ":" + sec
602
+ }
603
+
604
+ function stopPreShow() {
605
+ preshow_running = false
606
+
607
+ $('#preshow').remove()
608
+ $('#tips').remove()
609
+ $('#preshow_timer').remove()
610
+
611
+ toggleFooter()
612
+ loadSlides(loadSlidesBool, loadSlidesPrefix);
613
+ }
614
+
615
+ function nextPreShowImage() {
616
+ preshow_current += 1
617
+ if((preshow_current + 1) > preshow_imagesTotal) {
618
+ preshow_current = 0
619
+ }
620
+
621
+ $("#preso").empty()
622
+ tmpImg = preshow_images.eq(preshow_current).clone()
623
+ $(tmpImg).attr('width', '1020')
624
+ $("#preso").html(tmpImg)
625
+ }
626
+
627
+ /********************
628
+ End PreShow Code
629
+ ********************/