/[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 7 by dpavlin, Sat Jun 10 08:44:15 2006 UTC revision 11 by dpavlin, Sat Jun 10 15:20:43 2006 UTC
# Line 1008  var Presentation = { Line 1008  var Presentation = {
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;
# Line 1060  var Presentation = { Line 1060  var Presentation = {
1060          },          },
1061    
1062          insert : function(aType) {          insert : function(aType) {
                 var scrollTop = this.textbox.scrollTop;  
 //              alert(this.textbox.scrollTop);  
1063                  switch (aType)                  switch (aType)
1064                  {                  {
1065                          case 'page':                          case 'page':
# Line 1096  var Presentation = { Line 1094  var Presentation = {
1094                          default:                          default:
1095                                  return;                                  return;
1096                  }                  }
                 this.textbox.scrollTop = scrollTop;  
1097                  this.onEdit();                  this.onEdit();
1098          },          },
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 - sel_len)
1111                    ].join('');
1112                    aNode.selectionStart = pos + (aPosOffset || 0);
1113                    aNode.selectionEnd = aNode.selectionStart + sel_len;
1114          },          },
1115    
1116    

Legend:
Removed from v.7  
changed lines
  Added in v.11

  ViewVC Help
Powered by ViewVC 1.1.26