mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 23:46:14 -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
|
@ -20,16 +20,23 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
var Ace2Editor = require('/ace').Ace2Editor;
|
||||
var padcookie = require('/pad_cookie').padcookie;
|
||||
var padutils = require('/pad_utils').padutils;
|
||||
|
||||
var padeditor = (function()
|
||||
{
|
||||
var Ace2Editor = undefined;
|
||||
var pad = undefined;
|
||||
var settings = undefined;
|
||||
var self = {
|
||||
ace: null,
|
||||
// this is accessed directly from other files
|
||||
viewZoom: 100,
|
||||
init: function(readyFunc, initialViewOptions)
|
||||
{
|
||||
Ace2Editor = require('/ace').Ace2Editor;
|
||||
pad = require('/pad2').pad; // Sidestep circular dependency (should be injected).
|
||||
settings = require('/pad2').settings;
|
||||
|
||||
function aceReady()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue