mirror of
				https://github.com/ether/etherpad-lite.git
				synced 2025-11-04 02:01:30 +01:00 
			
		
		
		
	moving noop and identity helper functions to ace2_common
This commit is contained in:
		
							parent
							
								
									77dbe4646e
								
							
						
					
					
						commit
						a66e01a08f
					
				@ -141,6 +141,9 @@ function htmlPrettyEscape(str)
 | 
			
		||||
  return Security.escapeHTML(str).replace(/\r?\n/g, '\\n');
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var noop = function(){};
 | 
			
		||||
var identity = function(x){return x};
 | 
			
		||||
 | 
			
		||||
exports.isNodeText = isNodeText;
 | 
			
		||||
exports.object = object;
 | 
			
		||||
exports.extend = extend;
 | 
			
		||||
@ -155,3 +158,5 @@ exports.binarySearch = binarySearch;
 | 
			
		||||
exports.binarySearchInfinite = binarySearchInfinite;
 | 
			
		||||
exports.htmlPrettyEscape = htmlPrettyEscape;
 | 
			
		||||
exports.map = map;
 | 
			
		||||
exports.noop = noop;
 | 
			
		||||
exports.identity = identity;
 | 
			
		||||
 | 
			
		||||
@ -21,6 +21,7 @@
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
var Ace2Common = require('/ace2_common');
 | 
			
		||||
 | 
			
		||||
// Extract useful method defined in the other module.
 | 
			
		||||
var isNodeText = Ace2Common.isNodeText;
 | 
			
		||||
var object = Ace2Common.object;
 | 
			
		||||
@ -35,6 +36,7 @@ var setAssoc = Ace2Common.setAssoc;
 | 
			
		||||
var binarySearchInfinite = Ace2Common.binarySearchInfinite;
 | 
			
		||||
var htmlPrettyEscape = Ace2Common.htmlPrettyEscape;
 | 
			
		||||
var map = Ace2Common.map;
 | 
			
		||||
var noop = Ace2Common.noop;
 | 
			
		||||
 | 
			
		||||
var makeChangesetTracker = require('/changesettracker').makeChangesetTracker;
 | 
			
		||||
var colorutils = require('/colorutils').colorutils;
 | 
			
		||||
@ -145,14 +147,6 @@ var makeVirtualLineView = require('/virtual_lines').makeVirtualLineView;
 | 
			
		||||
    };
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  function noop()
 | 
			
		||||
  {}
 | 
			
		||||
 | 
			
		||||
  function identity(x)
 | 
			
		||||
  {
 | 
			
		||||
    return x;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  // "dmesg" is for displaying messages in the in-page output pane
 | 
			
		||||
  // visible when "?djs=1" is appended to the pad URL.  It generally
 | 
			
		||||
  // remains a no-op unless djs is enabled, but we make a habit of
 | 
			
		||||
 | 
			
		||||
@ -27,16 +27,13 @@
 | 
			
		||||
// requires: undefined
 | 
			
		||||
 | 
			
		||||
var Security = require('/security');
 | 
			
		||||
var Ace2Common = require('/ace2_common');
 | 
			
		||||
var plugins = require('/plugins').plugins;
 | 
			
		||||
var map = require('/ace2_common').map;
 | 
			
		||||
var map = Ace2Common.map;
 | 
			
		||||
var noop = Ace2Common.noop;
 | 
			
		||||
var identity = Ace2Common.identity;
 | 
			
		||||
 | 
			
		||||
var domline = {};
 | 
			
		||||
domline.noop = function()
 | 
			
		||||
{};
 | 
			
		||||
domline.identity = function(x)
 | 
			
		||||
{
 | 
			
		||||
  return x;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
domline.addToLineClass = function(lineClass, cls)
 | 
			
		||||
{
 | 
			
		||||
@ -60,11 +57,11 @@ domline.createDomLine = function(nonEmpty, doesWrap, optBrowser, optDocument)
 | 
			
		||||
{
 | 
			
		||||
  var result = {
 | 
			
		||||
    node: null,
 | 
			
		||||
    appendSpan: domline.noop,
 | 
			
		||||
    prepareForAdd: domline.noop,
 | 
			
		||||
    notifyAdded: domline.noop,
 | 
			
		||||
    clearSpans: domline.noop,
 | 
			
		||||
    finishUpdate: domline.noop,
 | 
			
		||||
    appendSpan: noop,
 | 
			
		||||
    prepareForAdd: noop,
 | 
			
		||||
    notifyAdded: noop,
 | 
			
		||||
    clearSpans: noop,
 | 
			
		||||
    finishUpdate: noop,
 | 
			
		||||
    lineMarker: 0
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
@ -91,7 +88,7 @@ domline.createDomLine = function(nonEmpty, doesWrap, optBrowser, optDocument)
 | 
			
		||||
  {
 | 
			
		||||
    return domline.processSpaces(s, doesWrap);
 | 
			
		||||
  }
 | 
			
		||||
  var identity = domline.identity;
 | 
			
		||||
 | 
			
		||||
  var perTextNodeProcess = (doesWrap ? identity : processSpaces);
 | 
			
		||||
  var perHtmlLineProcess = (doesWrap ? processSpaces : identity);
 | 
			
		||||
  var lineClass = 'ace-line';
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user