/[takahashi]/takahashi.xul
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /takahashi.xul

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2 by dpavlin, Fri Jun 9 21:25:32 2006 UTC revision 6 by dpavlin, Sat Jun 10 08:35:37 2006 UTC
# Line 721  var Presentation = { Line 721  var Presentation = {
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    
# Line 737  var Presentation = { Line 737  var Presentation = {
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,
# Line 881  var Presentation = { Line 883  var Presentation = {
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                                            }
898                                            fragment.lastChild.lastChild.setAttribute('style', style);
899                                            if (RegExp.$3 == '!') fragment.lastChild.lastChild.setAttribute('class', 'em-text');
900                                            else if (RegExp.$3 == '#') fragment.lastChild.lastChild.setAttribute('class', 'preformatted-text');
901                                    }
902    
903                                  // Monta                                  // Monta
904                                  else if (montaRegExp.test(line)) {                                  else if (montaRegExp.test(line)) {
905                                          fragment.lastChild.appendChild(document.createElement('stack'));                                          fragment.lastChild.appendChild(document.createElement('stack'));
# Line 1039  var Presentation = { Line 1058  var Presentation = {
1058          },          },
1059    
1060          insert : function(aType) {          insert : function(aType) {
1061                    var scrollTop = this.textbox.scrollTop;
1062    //              alert(this.textbox.scrollTop);
1063                  switch (aType)                  switch (aType)
1064                  {                  {
1065                          case 'page':                          case 'page':
# Line 1073  var Presentation = { Line 1094  var Presentation = {
1094                          default:                          default:
1095                                  return;                                  return;
1096                  }                  }
1097                    this.textbox.scrollTop = scrollTop;
1098                  this.onEdit();                  this.onEdit();
1099          },          },
1100          insertTextFor : function(aString, aNode, aPosOffset)          insertTextFor : function(aString, aNode, aPosOffset)

Legend:
Removed from v.2  
changed lines
  Added in v.6

  ViewVC Help
Powered by ViewVC 1.1.26