From 2b5d7a0048c1b5718b9870eed059f77a9c513136 Mon Sep 17 00:00:00 2001 From: Chad Weider Date: Sun, 15 Jan 2012 17:23:48 -0800 Subject: [PATCH] All files export their public interface if `exports` is available. --- static/js/ace.js | 4 ++++ static/js/ace2_common.js | 18 +++++++++++++++--- static/js/ace2_inner.js | 4 ++++ static/js/broadcast.js | 4 ++++ static/js/broadcast_revisions.js | 4 ++++ static/js/broadcast_slider.js | 4 ++++ static/js/changesettracker.js | 4 ++++ static/js/chat.js | 4 ++++ static/js/collab_client.js | 5 +++++ static/js/colorutils.js | 4 ++++ static/js/contentcollector.js | 5 +++++ static/js/cssmanager.js | 4 ++++ static/js/cssmanager_client.js | 4 ++++ static/js/domline.js | 4 ++++ static/js/domline_client.js | 4 ++++ static/js/draggable.js | 4 ++++ static/js/easysync2.js | 5 +++++ static/js/easysync2_client.js | 5 +++++ static/js/linestylefilter.js | 4 ++++ static/js/linestylefilter_client.js | 4 ++++ static/js/pad2.js | 13 +++++++++++++ static/js/pad_connectionstatus.js | 4 ++++ static/js/pad_cookie.js | 4 ++++ static/js/pad_docbar.js | 4 ++++ static/js/pad_editbar.js | 4 ++++ static/js/pad_editor.js | 4 ++++ static/js/pad_impexp.js | 4 ++++ static/js/pad_modals.js | 4 ++++ static/js/pad_savedrevs.js | 4 ++++ static/js/pad_userlist.js | 4 ++++ static/js/pad_utils.js | 4 ++++ static/js/plugins.js | 4 ++++ static/js/skiplist.js | 4 ++++ static/js/undomodule.js | 6 +++++- static/js/virtual_lines.js | 4 ++++ 35 files changed, 165 insertions(+), 4 deletions(-) diff --git a/static/js/ace.js b/static/js/ace.js index ffe00b07..3f52d315 100644 --- a/static/js/ace.js +++ b/static/js/ace.js @@ -370,3 +370,7 @@ function Ace2Editor() return editor; } + +if (typeof exports !== 'undefined') { +exports.Ace2Editor = Ace2Editor; +} diff --git a/static/js/ace2_common.js b/static/js/ace2_common.js index 1414f855..0918189c 100644 --- a/static/js/ace2_common.js +++ b/static/js/ace2_common.js @@ -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; } diff --git a/static/js/ace2_inner.js b/static/js/ace2_inner.js index ec0d5dc4..ea6d7cbe 100644 --- a/static/js/ace2_inner.js +++ b/static/js/ace2_inner.js @@ -5858,3 +5858,7 @@ function OUTER(gscope) }; OUTER(this); + +if (typeof exports !== 'undefined') { +exports.OUTER = OUTER; // This is probably unimportant. +} diff --git a/static/js/broadcast.js b/static/js/broadcast.js index 865574ab..edfeef9c 100644 --- a/static/js/broadcast.js +++ b/static/js/broadcast.js @@ -758,3 +758,7 @@ function loadBroadcastJS() receiveAuthorData(clientVars.historicalAuthorData); } + +if (typeof exports !== 'undefined') { +exports.loadBroadcastJS = loadBroadcastJS; +} diff --git a/static/js/broadcast_revisions.js b/static/js/broadcast_revisions.js index 33a2f9df..f60e58bb 100644 --- a/static/js/broadcast_revisions.js +++ b/static/js/broadcast_revisions.js @@ -125,3 +125,7 @@ function loadBroadcastRevisionsJS() }; } } + +if (typeof exports !== 'undefined') { +exports.loadBroadcastRevisionsJS = loadBroadcastRevisionsJS; +} diff --git a/static/js/broadcast_slider.js b/static/js/broadcast_slider.js index af5a5041..1d9f4928 100644 --- a/static/js/broadcast_slider.js +++ b/static/js/broadcast_slider.js @@ -496,3 +496,7 @@ function loadBroadcastSliderJS() $("#viewlatest").html(loc == BroadcastSlider.getSliderLength() ? "Viewing latest content" : "View latest content"); }) } + +if (typeof exports !== 'undefined') { +exports.loadBroadcastSliderJS = loadBroadcastSliderJS; +} diff --git a/static/js/changesettracker.js b/static/js/changesettracker.js index cc7f6462..60c73d3d 100644 --- a/static/js/changesettracker.js +++ b/static/js/changesettracker.js @@ -207,3 +207,7 @@ function makeChangesetTracker(scheduler, apool, aceCallbacksProvider) }; } + +if (typeof exports !== 'undefined') { +exports.makeChangesetTracker = makeChangesetTracker; +} diff --git a/static/js/chat.js b/static/js/chat.js index 71cd0c69..1636ab69 100644 --- a/static/js/chat.js +++ b/static/js/chat.js @@ -172,3 +172,7 @@ var chat = (function() return self; }()); + +if (typeof exports !== 'undefined') { +exports.chat = chat; +} diff --git a/static/js/collab_client.js b/static/js/collab_client.js index bb2351fc..3a40fba1 100644 --- a/static/js/collab_client.js +++ b/static/js/collab_client.js @@ -722,3 +722,8 @@ function selectElementContents(elem) } } } + +if (typeof exports !== 'undefined') { +exports.getCollabClient = getCollabClient; +exports.selectElementContents = selectElementContents; +} diff --git a/static/js/colorutils.js b/static/js/colorutils.js index 92d8da71..1fc452b6 100644 --- a/static/js/colorutils.js +++ b/static/js/colorutils.js @@ -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; +} diff --git a/static/js/contentcollector.js b/static/js/contentcollector.js index 883ca09f..e5a90586 100644 --- a/static/js/contentcollector.js +++ b/static/js/contentcollector.js @@ -692,3 +692,8 @@ function makeContentCollector(collectStyles, browser, apool, domInterface, class return cc; } + +if (typeof exports !== 'undefined') { +exports.sanitizeUnicode = sanitizeUnicode; +exports.makeContentCollector = makeContentCollector; +} diff --git a/static/js/cssmanager.js b/static/js/cssmanager.js index b8208b83..1d45f302 100644 --- a/static/js/cssmanager.js +++ b/static/js/cssmanager.js @@ -118,3 +118,7 @@ function makeCSSManager(emptyStylesheetTitle, top) } }; } + +if (typeof exports !== 'undefined') { +exports.makeCSSManager = makeCSSManager; +} diff --git a/static/js/cssmanager_client.js b/static/js/cssmanager_client.js index 60bf9f8c..3db467e3 100644 --- a/static/js/cssmanager_client.js +++ b/static/js/cssmanager_client.js @@ -114,3 +114,7 @@ function makeCSSManager(emptyStylesheetTitle) } }; } + +if (typeof exports !== 'undefined') { +exports.makeCSSManager = makeCSSManager; +} diff --git a/static/js/domline.js b/static/js/domline.js index 84aeb4a8..7ebf5b35 100644 --- a/static/js/domline.js +++ b/static/js/domline.js @@ -310,3 +310,7 @@ domline.processSpaces = function(s, doesWrap) } return parts.join(''); }; + +if (typeof exports !== 'undefined') { +exports.domline = domline; +} diff --git a/static/js/domline_client.js b/static/js/domline_client.js index 9f47dae5..e995140f 100644 --- a/static/js/domline_client.js +++ b/static/js/domline_client.js @@ -309,3 +309,7 @@ domline.processSpaces = function(s, doesWrap) } return parts.join(''); }; + +if (typeof exports !== 'undefined') { +exports.domline = domline; +} diff --git a/static/js/draggable.js b/static/js/draggable.js index 7bf523eb..1d0ddb4c 100644 --- a/static/js/draggable.js +++ b/static/js/draggable.js @@ -193,3 +193,7 @@ function makeResizableHPane(left, sep, right, minLeft, minRight, sepWidth, sepOf } }); } + +if (typeof exports !== 'undefined') { +exports.makeDraggable = makeDraggable; +} diff --git a/static/js/easysync2.js b/static/js/easysync2.js index 17ab585d..81a416b2 100644 --- a/static/js/easysync2.js +++ b/static/js/easysync2.js @@ -2508,3 +2508,8 @@ Changeset.followAttributes = function(att1, att2, pool) } return buf.toString(); }; + +if (typeof exports !== 'undefined') { +exports.Changeset = Changeset; +exports.AttribPool = AttribPool; +} diff --git a/static/js/easysync2_client.js b/static/js/easysync2_client.js index 3611da23..5745110e 100644 --- a/static/js/easysync2_client.js +++ b/static/js/easysync2_client.js @@ -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; +} diff --git a/static/js/linestylefilter.js b/static/js/linestylefilter.js index 13a74618..e990a68b 100644 --- a/static/js/linestylefilter.js +++ b/static/js/linestylefilter.js @@ -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; +} diff --git a/static/js/linestylefilter_client.js b/static/js/linestylefilter_client.js index 9fd2a3f8..a4536490 100644 --- a/static/js/linestylefilter_client.js +++ b/static/js/linestylefilter_client.js @@ -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; +} diff --git a/static/js/pad2.js b/static/js/pad2.js index 5872b7a1..8a2c3384 100644 --- a/static/js/pad2.js +++ b/static/js/pad2.js @@ -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; +} diff --git a/static/js/pad_connectionstatus.js b/static/js/pad_connectionstatus.js index d35eb02d..bec359c3 100644 --- a/static/js/pad_connectionstatus.js +++ b/static/js/pad_connectionstatus.js @@ -85,3 +85,7 @@ var padconnectionstatus = (function() }; return self; }()); + +if (typeof exports !== 'undefined') { +exports.padconnectionstatus = padconnectionstatus; +} diff --git a/static/js/pad_cookie.js b/static/js/pad_cookie.js index 64211750..d8eb464c 100644 --- a/static/js/pad_cookie.js +++ b/static/js/pad_cookie.js @@ -126,3 +126,7 @@ var padcookie = (function() }; return self; }()); + +if (typeof exports !== 'undefined') { +exports.padcookie = padcookie; +} diff --git a/static/js/pad_docbar.js b/static/js/pad_docbar.js index c67ca55c..09315c77 100644 --- a/static/js/pad_docbar.js +++ b/static/js/pad_docbar.js @@ -456,3 +456,7 @@ var paddocbar = (function() }; return self; }()); + +if (typeof exports !== 'undefined') { +exports.paddocbar = paddocbar; +} diff --git a/static/js/pad_editbar.js b/static/js/pad_editbar.js index 6cd5163d..6754e99c 100644 --- a/static/js/pad_editbar.js +++ b/static/js/pad_editbar.js @@ -230,3 +230,7 @@ var padeditbar = (function() }; return self; }()); + +if (typeof exports !== 'undefined') { +exports.padeditbar = padeditbar; +} diff --git a/static/js/pad_editor.js b/static/js/pad_editor.js index 6daf5e7d..929112bb 100644 --- a/static/js/pad_editor.js +++ b/static/js/pad_editor.js @@ -150,3 +150,7 @@ var padeditor = (function() }; return self; }()); + +if (typeof exports !== 'undefined') { +exports.padeditor = padeditor; +} diff --git a/static/js/pad_impexp.js b/static/js/pad_impexp.js index 23b7134c..638991a6 100644 --- a/static/js/pad_impexp.js +++ b/static/js/pad_impexp.js @@ -325,3 +325,7 @@ var padimpexp = (function() }; return self; }()); + +if (typeof exports !== 'undefined') { +exports.padimpexp = padimpexp; +} diff --git a/static/js/pad_modals.js b/static/js/pad_modals.js index cf9d0435..d5e7811b 100644 --- a/static/js/pad_modals.js +++ b/static/js/pad_modals.js @@ -364,3 +364,7 @@ var padmodals = (function() }; return self; }()); + +if (typeof exports !== 'undefined') { +exports.padmodals = padmodals; +} diff --git a/static/js/pad_savedrevs.js b/static/js/pad_savedrevs.js index 487e85f1..7aadea71 100644 --- a/static/js/pad_savedrevs.js +++ b/static/js/pad_savedrevs.js @@ -518,3 +518,7 @@ var padsavedrevs = (function() }; return self; }()); + +if (typeof exports !== 'undefined') { +exports.padsavedrevs = padsavedrevs; +} diff --git a/static/js/pad_userlist.js b/static/js/pad_userlist.js index 74867491..96513225 100644 --- a/static/js/pad_userlist.js +++ b/static/js/pad_userlist.js @@ -805,3 +805,7 @@ function showColorPicker() $($("#colorpickerswatches li")[myUserInfo.colorId]).addClass("picked"); //seems weird } } + +if (typeof exports !== 'undefined') { +exports.paduserlist = paduserlist; +} diff --git a/static/js/pad_utils.js b/static/js/pad_utils.js index 9083fa9b..3c73aa06 100644 --- a/static/js/pad_utils.js +++ b/static/js/pad_utils.js @@ -486,3 +486,7 @@ window.onerror = function test (msg, url, linenumber) return false; }; + +if (typeof exports !== 'undefined') { +exports.padutils = padutils; +} diff --git a/static/js/plugins.js b/static/js/plugins.js index 74193462..2cf0e0e2 100644 --- a/static/js/plugins.js +++ b/static/js/plugins.js @@ -31,3 +31,7 @@ plugins = { }).join(sep || ""); } }; + +if (typeof exports !== 'undefined') { +exports.plugins = plugins; +} diff --git a/static/js/skiplist.js b/static/js/skiplist.js index c9654be4..995cd6bc 100644 --- a/static/js/skiplist.js +++ b/static/js/skiplist.js @@ -488,3 +488,7 @@ that is a string. } return self; } + +if (typeof exports !== 'undefined') { +exports.newSkipList = newSkipList; +} diff --git a/static/js/undomodule.js b/static/js/undomodule.js index 3891629a..a0073e19 100644 --- a/static/js/undomodule.js +++ b/static/js/undomodule.js @@ -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; +} diff --git a/static/js/virtual_lines.js b/static/js/virtual_lines.js index ece96b14..32fc5887 100644 --- a/static/js/virtual_lines.js +++ b/static/js/virtual_lines.js @@ -384,3 +384,7 @@ function makeVirtualLineView(lineNode) } } + +if (typeof exports !== 'undefined') { +exports.makeVirtualLineView = makeVirtualLineView; +}