All files export their public interface if exports is available.

This commit is contained in:
Chad Weider 2012-01-15 17:23:48 -08:00
parent 003c2a59aa
commit 2b5d7a0048
35 changed files with 165 additions and 4 deletions

View file

@ -370,3 +370,7 @@ function Ace2Editor()
return editor;
}
if (typeof exports !== 'undefined') {
exports.Ace2Editor = Ace2Editor;
}

View file

@ -147,7 +147,19 @@ function htmlPrettyEscape(str)
}).replace(/\r?\n/g, '\\n');
}
if (typeof exports !== "undefined")
{
exports.map = map;
if (typeof exports !== 'undefined') {
exports.isNodeText = isNodeText;
exports.object = object;
exports.extend = extend;
exports.forEach = forEach;
exports.map = map;
exports.filter = filter;
exports.isArray = isArray;
exports.browser = browser;
exports.getAssoc = getAssoc;
exports.setAssoc = setAssoc;
exports.binarySearch = binarySearch;
exports.binarySearchInfinite = binarySearchInfinite;
exports.htmlPrettyEscape = htmlPrettyEscape;
exports.map = map;
}

View file

@ -5858,3 +5858,7 @@ function OUTER(gscope)
};
OUTER(this);
if (typeof exports !== 'undefined') {
exports.OUTER = OUTER; // This is probably unimportant.
}

View file

@ -758,3 +758,7 @@ function loadBroadcastJS()
receiveAuthorData(clientVars.historicalAuthorData);
}
if (typeof exports !== 'undefined') {
exports.loadBroadcastJS = loadBroadcastJS;
}

View file

@ -125,3 +125,7 @@ function loadBroadcastRevisionsJS()
};
}
}
if (typeof exports !== 'undefined') {
exports.loadBroadcastRevisionsJS = loadBroadcastRevisionsJS;
}

View file

@ -496,3 +496,7 @@ function loadBroadcastSliderJS()
$("#viewlatest").html(loc == BroadcastSlider.getSliderLength() ? "Viewing latest content" : "View latest content");
})
}
if (typeof exports !== 'undefined') {
exports.loadBroadcastSliderJS = loadBroadcastSliderJS;
}

View file

@ -207,3 +207,7 @@ function makeChangesetTracker(scheduler, apool, aceCallbacksProvider)
};
}
if (typeof exports !== 'undefined') {
exports.makeChangesetTracker = makeChangesetTracker;
}

View file

@ -172,3 +172,7 @@ var chat = (function()
return self;
}());
if (typeof exports !== 'undefined') {
exports.chat = chat;
}

View file

@ -722,3 +722,8 @@ function selectElementContents(elem)
}
}
}
if (typeof exports !== 'undefined') {
exports.getCollabClient = getCollabClient;
exports.selectElementContents = selectElementContents;
}

View file

@ -119,3 +119,7 @@ colorutils.blend = function(c1, c2, t)
{
return [colorutils.scale(t, c1[0], c2[0]), colorutils.scale(t, c1[1], c2[1]), colorutils.scale(t, c1[2], c2[2])];
}
if (typeof exports !== 'undefined') {
exports.colorutils = colorutils;
}

View file

@ -692,3 +692,8 @@ function makeContentCollector(collectStyles, browser, apool, domInterface, class
return cc;
}
if (typeof exports !== 'undefined') {
exports.sanitizeUnicode = sanitizeUnicode;
exports.makeContentCollector = makeContentCollector;
}

View file

@ -118,3 +118,7 @@ function makeCSSManager(emptyStylesheetTitle, top)
}
};
}
if (typeof exports !== 'undefined') {
exports.makeCSSManager = makeCSSManager;
}

View file

@ -114,3 +114,7 @@ function makeCSSManager(emptyStylesheetTitle)
}
};
}
if (typeof exports !== 'undefined') {
exports.makeCSSManager = makeCSSManager;
}

View file

@ -310,3 +310,7 @@ domline.processSpaces = function(s, doesWrap)
}
return parts.join('');
};
if (typeof exports !== 'undefined') {
exports.domline = domline;
}

View file

@ -309,3 +309,7 @@ domline.processSpaces = function(s, doesWrap)
}
return parts.join('');
};
if (typeof exports !== 'undefined') {
exports.domline = domline;
}

View file

@ -193,3 +193,7 @@ function makeResizableHPane(left, sep, right, minLeft, minRight, sepWidth, sepOf
}
});
}
if (typeof exports !== 'undefined') {
exports.makeDraggable = makeDraggable;
}

View file

@ -2508,3 +2508,8 @@ Changeset.followAttributes = function(att1, att2, pool)
}
return buf.toString();
};
if (typeof exports !== 'undefined') {
exports.Changeset = Changeset;
exports.AttribPool = AttribPool;
}

View file

@ -2269,3 +2269,8 @@ Changeset.inverse = function(cs, lines, alines, pool)
return Changeset.checkRep(builder.toString());
};
if (typeof exports !== 'undefined') {
exports.Changeset = Changeset;
exports.AttribPool = AttribPool;
}

View file

@ -352,3 +352,7 @@ linestylefilter.populateDomLine = function(textLine, aline, apool, domLineObj)
func = linestylefilter.getLineStyleFilter(text.length, aline, func, apool);
func(text, '');
};
if (typeof exports !== 'undefined') {
exports.linestylefilter = linestylefilter;
}

View file

@ -350,3 +350,7 @@ linestylefilter.populateDomLine = function(textLine, aline, apool, domLineObj)
func = linestylefilter.getLineStyleFilter(text.length, aline, func, apool);
func(text, '');
};
if (typeof exports !== 'undefined') {
exports.linestylefilter = linestylefilter;
}

View file

@ -953,3 +953,16 @@ var alertBar = (function()
};
return self;
}());
if (typeof exports !== 'undefined') {
exports.settings = settings;
exports.createCookie = createCookie;
exports.readCookie = readCookie;
exports.randomString = randomString;
exports.getParams = getParams;
exports.getUrlVars = getUrlVars;
exports.savePassword = savePassword;
exports.handshake = handshake;
exports.pad = pad;
exports.alertBar = alertBar;
}

View file

@ -85,3 +85,7 @@ var padconnectionstatus = (function()
};
return self;
}());
if (typeof exports !== 'undefined') {
exports.padconnectionstatus = padconnectionstatus;
}

View file

@ -126,3 +126,7 @@ var padcookie = (function()
};
return self;
}());
if (typeof exports !== 'undefined') {
exports.padcookie = padcookie;
}

View file

@ -456,3 +456,7 @@ var paddocbar = (function()
};
return self;
}());
if (typeof exports !== 'undefined') {
exports.paddocbar = paddocbar;
}

View file

@ -230,3 +230,7 @@ var padeditbar = (function()
};
return self;
}());
if (typeof exports !== 'undefined') {
exports.padeditbar = padeditbar;
}

View file

@ -150,3 +150,7 @@ var padeditor = (function()
};
return self;
}());
if (typeof exports !== 'undefined') {
exports.padeditor = padeditor;
}

View file

@ -325,3 +325,7 @@ var padimpexp = (function()
};
return self;
}());
if (typeof exports !== 'undefined') {
exports.padimpexp = padimpexp;
}

View file

@ -364,3 +364,7 @@ var padmodals = (function()
};
return self;
}());
if (typeof exports !== 'undefined') {
exports.padmodals = padmodals;
}

View file

@ -518,3 +518,7 @@ var padsavedrevs = (function()
};
return self;
}());
if (typeof exports !== 'undefined') {
exports.padsavedrevs = padsavedrevs;
}

View file

@ -805,3 +805,7 @@ function showColorPicker()
$($("#colorpickerswatches li")[myUserInfo.colorId]).addClass("picked"); //seems weird
}
}
if (typeof exports !== 'undefined') {
exports.paduserlist = paduserlist;
}

View file

@ -486,3 +486,7 @@ window.onerror = function test (msg, url, linenumber)
return false;
};
if (typeof exports !== 'undefined') {
exports.padutils = padutils;
}

View file

@ -31,3 +31,7 @@ plugins = {
}).join(sep || "");
}
};
if (typeof exports !== 'undefined') {
exports.plugins = plugins;
}

View file

@ -488,3 +488,7 @@ that is a string.
}
return self;
}
if (typeof exports !== 'undefined') {
exports.newSkipList = newSkipList;
}

View file

@ -21,7 +21,7 @@
*/
undoModule = (function()
var undoModule = (function()
{
var stack = (function()
{
@ -329,3 +329,7 @@ undoModule = (function()
apool: null
}; // apool is filled in by caller
})();
if (typeof exports !== 'undefined') {
exports.undoModule = undoModule;
}

View file

@ -384,3 +384,7 @@ function makeVirtualLineView(lineNode)
}
}
if (typeof exports !== 'undefined') {
exports.makeVirtualLineView = makeVirtualLineView;
}