718 |
var image_total_height = 0; |
var image_total_height = 0; |
719 |
var image_src; |
var image_src; |
720 |
|
|
721 |
var labelId = 0; |
var labelId = 0; |
722 |
var lineRegExp = this.makePhraseRegExp('^([^%O]+)?(%O%Oem:((.+?)(:em)?%C%C)?|%O%Opre:((.+?)(:pre)?%C%C)?|%O%O\#[^:]+:((.+?)%C%C)?|%O%Oima?ge? +src="([^"]+)" +width="([0-9]+)" +height="([0-9]+)"[^%C]*%C%C|%O%O(([^\|]+)?\\||)([^%C]+)%C%C|%O([^%C]+)%C)(.+)?', 'i'); |
var lineRegExp = this.makePhraseRegExp('^([^%O]+)?(%O%Oem:((.+?)(:em)?%C%C)?|%O%Opre:((.+?)(:pre)?%C%C)?|%O%O\#[^:]+:((.+?)%C%C)?|%O%Oima?ge? +src="([^"]+)" +width="([0-9]+)" +height="([0-9]+)"[^%C]*%C%C|%O%O(([^\|]+)?\\||)([^%C]+)%C%C|%O([^%C]+)%C)(.+)?', 'i'); |
723 |
|
|
724 |
var emRegExp = this.makePhraseRegExp('^([^%O]+)?%O%Oem:(.+?)()?%C%C', 'i'); |
var emRegExp = this.makePhraseRegExp('^([^%O]+)?%O%Oem:(.+?)(:em)?%C%C', 'i'); |
725 |
var emStartRegExp = this.makePhraseRegExp('^([^%O]+)?%O%Oem:(.*)', 'i'); |
var emStartRegExp = this.makePhraseRegExp('^([^%O]+)?%O%Oem:(.*)', 'i'); |
726 |
var emEndRegExp = this.makePhraseRegExp('^(.*?)((:em)?%C%C)', 'i'); |
var emEndRegExp = this.makePhraseRegExp('^(.*?)((:em)?%C%C)', 'i'); |
727 |
|
|
737 |
|
|
738 |
var linksRegExp = this.makePhraseRegExp('^([^%O]+)?%O%O(([^|]+)?\\||)([^%C]+)%C%C', ''); |
var linksRegExp = this.makePhraseRegExp('^([^%O]+)?%O%O(([^|]+)?\\||)([^%C]+)%C%C', ''); |
739 |
|
|
740 |
|
var wikiRegExp = this.makePhraseRegExp('^([^%O]+)?%O([0-9]*)([#!])?([:\/\*_-])([^%C]+)[:\/\*_-]%C', ''); |
741 |
|
|
742 |
var montaRegExp = this.makePhraseRegExp('^([^%O]+)?%O([^%C]+)%C', ''); |
var montaRegExp = this.makePhraseRegExp('^([^%O]+)?%O([^%C]+)%C', ''); |
743 |
|
|
744 |
var inBlock = false, |
var inBlock = false, |
883 |
this.clickableNodes.push(fragment.lastChild.lastChild); |
this.clickableNodes.push(fragment.lastChild.lastChild); |
884 |
} |
} |
885 |
|
|
886 |
|
// modify font size and wiki-style |
887 |
|
else if (wikiRegExp.test(line)) { |
888 |
|
fragment.lastChild.appendChild(document.createElement('description')); |
889 |
|
fragment.lastChild.lastChild.setAttribute('value', RegExp.$5); |
890 |
|
var style = 'font-size:'+ ( RegExp.$2 || 100 ) +'%'; |
891 |
|
if (RegExp.$4 == '*') { |
892 |
|
style += '; font-weight: bold;'; |
893 |
|
} else if (RegExp.$4 == '/') { |
894 |
|
style += '; font-style: italic;'; |
895 |
|
} else if (RegExp.$4 == '_') { |
896 |
|
style += '; text-decoration: underline;'; |
897 |
|
} else if (RegExp.$4 == '-') { |
898 |
|
style += '; text-decoration: line-through;'; |
899 |
|
} |
900 |
|
fragment.lastChild.lastChild.setAttribute('style', style); |
901 |
|
if (RegExp.$3 == '!') fragment.lastChild.lastChild.setAttribute('class', 'em-text'); |
902 |
|
else if (RegExp.$3 == '#') fragment.lastChild.lastChild.setAttribute('class', 'preformatted-text'); |
903 |
|
} |
904 |
|
|
905 |
// Monta |
// Monta |
906 |
else if (montaRegExp.test(line)) { |
else if (montaRegExp.test(line)) { |
907 |
fragment.lastChild.appendChild(document.createElement('stack')); |
fragment.lastChild.appendChild(document.createElement('stack')); |
1008 |
if (this.dataPath != file) { |
if (this.dataPath != file) { |
1009 |
var path = this.dataPath; |
var path = this.dataPath; |
1010 |
var request = new XMLHttpRequest(); |
var request = new XMLHttpRequest(); |
1011 |
request.open('GET', path); |
request.open('GET', path + '?rand=' + Math.random() ); |
1012 |
request.onload = function() { |
request.onload = function() { |
1013 |
Presentation.textbox.value = request.responseText; |
Presentation.textbox.value = request.responseText; |
1014 |
Presentation.data = Presentation.textbox.value; |
Presentation.data = Presentation.textbox.value; |
1099 |
insertTextFor : function(aString, aNode, aPosOffset) |
insertTextFor : function(aString, aNode, aPosOffset) |
1100 |
{ |
{ |
1101 |
var pos = aNode.selectionStart; |
var pos = aNode.selectionStart; |
1102 |
|
var sel_len = aNode.selectionEnd - aNode.selectionStart; |
1103 |
var value = aNode.value; |
var value = aNode.value; |
1104 |
aNode.value = [value.substring(0, pos), aString, value.substring(pos, value.length)].join(''); |
if (! aPosOffset) aPosOffset = 0; |
1105 |
aNode.selectionEnd = aNode.selectionStart = pos + (aPosOffset || 0); |
aNode.value = [ |
1106 |
|
value.substring(0, pos), |
1107 |
|
aString.substring(0,aPosOffset), |
1108 |
|
value.substring(pos, pos + sel_len), |
1109 |
|
aString.substring(aPosOffset, aString.length), |
1110 |
|
value.substring(pos + sel_len, value.length) |
1111 |
|
].join(''); |
1112 |
|
aNode.selectionStart = pos + (aPosOffset || 0); |
1113 |
|
aNode.selectionEnd = aNode.selectionStart + sel_len; |
1114 |
}, |
}, |
1115 |
|
|
1116 |
|
|
1742 |
{ |
{ |
1743 |
var now = (new Date()).getTime(); |
var now = (new Date()).getTime(); |
1744 |
if (aStart === void(0) || aEnd === void(0)) { |
if (aStart === void(0) || aEnd === void(0)) { |
1745 |
var rest = prompt('Remaining Time (minits)'); |
var rest = prompt('Remaining Time (minits)'); |
1746 |
if (rest == '') { |
if (rest == '') { |
1747 |
this.resetTimer(); |
this.resetTimer(); |
1748 |
return; |
return; |
1749 |
} |
} |
1750 |
else { |
else { |
1751 |
rest = Number(rest); |
rest = Number(rest); |
1752 |
if (!rest || isNaN(rest)) return; |
if (!rest || isNaN(rest)) return; |
1753 |
} |
} |
1754 |
|
|
1755 |
rest = Math.abs(rest); |
rest = Math.abs(rest); |