blind attempt to try

pull/2480/head
John McLear 2015-01-21 02:55:03 +00:00
parent 73d6030762
commit eacf1118f8
3 changed files with 12 additions and 15 deletions

View File

@ -34,8 +34,9 @@ var isNodeText = Ace2Common.isNodeText,
binarySearchInfinite = Ace2Common.binarySearchInfinite, binarySearchInfinite = Ace2Common.binarySearchInfinite,
htmlPrettyEscape = Ace2Common.htmlPrettyEscape, htmlPrettyEscape = Ace2Common.htmlPrettyEscape,
noop = Ace2Common.noop; noop = Ace2Common.noop;
var hooks = require('./pluginfw/hooks');
var browser = require('./browser').browser; var hooks = require('./pluginfw/hooks');
var browser = require('./browser').browser;
function Ace2Inner(){ function Ace2Inner(){
@ -944,7 +945,7 @@ function Ace2Inner(){
showslinenumbers : function(value){ showslinenumbers : function(value){
hasLineNumbers = !! value; hasLineNumbers = !! value;
// disable line numbers on mobile devices // disable line numbers on mobile devices
if (browser.mobile) hasLineNumbers = false; // if (browser.mobile) hasLineNumbers = false;
setClassPresence(sideDiv, "sidedivhidden", !hasLineNumbers); setClassPresence(sideDiv, "sidedivhidden", !hasLineNumbers);
fixView(); fixView();
}, },
@ -1605,7 +1606,7 @@ function Ace2Inner(){
if (linesWrapped > 0) if (linesWrapped > 0)
{ {
if(!browser.ie){ if(!browser.msie){
// chrome decides in it's infinite wisdom that its okay to put the browsers visisble window in the middle of the span // chrome decides in it's infinite wisdom that its okay to put the browsers visisble window in the middle of the span
// an outcome of this is that the first chars of the string are no longer visible to the user.. Yay chrome.. // an outcome of this is that the first chars of the string are no longer visible to the user.. Yay chrome..
// Move the browsers visible area to the left hand side of the span // Move the browsers visible area to the left hand side of the span
@ -2964,6 +2965,7 @@ function Ace2Inner(){
} }
else else
{ {
// cake
return domline.createDomLine(nonEmpty, doesWrap, browser, doc); return domline.createDomLine(nonEmpty, doesWrap, browser, doc);
} }
} }
@ -3583,7 +3585,7 @@ function Ace2Inner(){
// On Mac and Linux, move right moves to end of word and move left moves to start; // On Mac and Linux, move right moves to end of word and move left moves to start;
// on Windows, always move to start of word. // on Windows, always move to start of word.
// On Windows, Firefox and IE disagree on whether to stop for punctuation (FF says no). // On Windows, Firefox and IE disagree on whether to stop for punctuation (FF says no).
if (browser.windows && forwardNotBack) if (browser.msie && forwardNotBack)
{ {
while ((!isDone()) && isWordChar(nextChar())) while ((!isDone()) && isWordChar(nextChar()))
{ {
@ -4264,12 +4266,6 @@ function Ace2Inner(){
end.collapse(false); end.collapse(false);
selection.startPoint = pointFromCollapsedRange(start); selection.startPoint = pointFromCollapsedRange(start);
selection.endPoint = pointFromCollapsedRange(end); selection.endPoint = pointFromCollapsedRange(end);
/*if ((!selection.startPoint.node.isText) && (!selection.endPoint.node.isText)) {
console.log(selection.startPoint.node.uniqueId()+","+
selection.startPoint.index+" / "+
selection.endPoint.node.uniqueId()+","+
selection.endPoint.index);
}*/
} }
return selection; return selection;
} }
@ -4867,7 +4863,7 @@ function Ace2Inner(){
}) })
// CompositionEvent is not implemented below IE version 8 // CompositionEvent is not implemented below IE version 8
if ( !(browser.msie && browser.version < 9) && document.documentElement) if ( !(browser.msie && browser.version <= 9) && document.documentElement)
{ {
$(document.documentElement).on("compositionstart", handleCompositionEvent); $(document.documentElement).on("compositionstart", handleCompositionEvent);
$(document.documentElement).on("compositionend", handleCompositionEvent); $(document.documentElement).on("compositionend", handleCompositionEvent);

View File

@ -37,7 +37,8 @@ function sanitizeUnicode(s)
function makeContentCollector(collectStyles, browser, apool, domInterface, className2Author) function makeContentCollector(collectStyles, browser, apool, domInterface, className2Author)
{ {
browser = browser || {}; // browser = browser || {};
// I don't like the above.
var dom = domInterface || { var dom = domInterface || {
isNodeText: function(n) isNodeText: function(n)

View File

@ -65,7 +65,7 @@ domline.createDomLine = function(nonEmpty, doesWrap, optBrowser, optDocument)
lineMarker: 0 lineMarker: 0
}; };
var browser = (optBrowser || {}); // var browser = (optBrowser || {});
var document = optDocument; var document = optDocument;
if (document) if (document)
@ -225,7 +225,7 @@ domline.createDomLine = function(nonEmpty, doesWrap, optBrowser, optDocument)
{ {
newHTML += '&nbsp;'; newHTML += '&nbsp;';
} }
else if (!browser.msie) else if (!optBrowser.msie)
{ {
newHTML += '<br/>'; newHTML += '<br/>';
} }