mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 15:36:16 -04:00
Implement require
of dependencies for all pad_*
modules.
Create a lazily-defined local reference for pad on initialization in each pad module in order to avoid circular dependency. At some point in the future this dependency should instead be injected into each module on initialization.
This commit is contained in:
parent
7f98116a43
commit
fa2a6e9ee6
11 changed files with 62 additions and 5 deletions
|
@ -34,6 +34,7 @@ var padutils = {
|
|||
},
|
||||
uniqueId: function()
|
||||
{
|
||||
var pad = require('/pad2').pad; // Sidestep circular dependency
|
||||
function encodeNum(n, width)
|
||||
{
|
||||
// returns string that is exactly 'width' chars, padding with zeros
|
||||
|
@ -226,6 +227,7 @@ var padutils = {
|
|||
},
|
||||
timediff: function(d)
|
||||
{
|
||||
var pad = require('/pad2').pad; // Sidestep circular dependency
|
||||
function format(n, word)
|
||||
{
|
||||
n = Math.round(n);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue