localizing use of the jQuery variable, avoid collision with $
This commit is contained in:
parent
0f35faa159
commit
b2ac271d9c
|
@ -482,4 +482,4 @@
|
|||
exports.toDomNode = toDomNode;
|
||||
|
||||
exports.escapeString = escapeString;
|
||||
}(this.plt.baselib, $));
|
||||
}(this.plt.baselib, jQuery));
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
|
||||
// list structures (pairs, empty)
|
||||
(function (baselib) {
|
||||
(function (baselib, $) {
|
||||
'use strict';
|
||||
var exports = {};
|
||||
baselib.lists = exports;
|
||||
|
@ -347,4 +347,4 @@
|
|||
exports.listToArray = listToArray;
|
||||
exports.arrayToList = arrayToList;
|
||||
|
||||
}(this.plt.baselib));
|
||||
}(this.plt.baselib, jQuery));
|
|
@ -147,4 +147,4 @@
|
|||
exports.StandardInputPort = StandardInputPort;
|
||||
|
||||
|
||||
}(this.plt.baselib, $));
|
||||
}(this.plt.baselib, jQuery));
|
||||
|
|
|
@ -308,4 +308,4 @@
|
|||
exports.isStruct = isStruct;
|
||||
exports.isStructType = isStructType;
|
||||
exports.isStructTypeProperty = isStructTypeProperty;
|
||||
}(this.plt.baselib, $));
|
||||
}(this.plt.baselib, jQuery));
|
|
@ -1,6 +1,6 @@
|
|||
/*jslint devel: false, browser: true, unparam: true, vars: true, plusplus: true, maxerr: 500, indent: 4 */
|
||||
// Structure types
|
||||
(function (baselib) {
|
||||
(function (baselib,$) {
|
||||
"use strict";
|
||||
var exports = {};
|
||||
baselib.symbols = exports;
|
||||
|
@ -87,4 +87,4 @@
|
|||
exports.makeSymbol = makeSymbol;
|
||||
exports.isSymbol = isSymbol;
|
||||
|
||||
}(this.plt.baselib));
|
||||
}(this.plt.baselib, jQuery));
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
// All of the values here are namespaced under "plt.runtime".
|
||||
/*global $*/
|
||||
(function(plt) {
|
||||
(function(plt, $) {
|
||||
'use strict';
|
||||
var runtime = {};
|
||||
plt.runtime = runtime;
|
||||
|
@ -1417,4 +1417,4 @@
|
|||
|
||||
|
||||
exports['makeRandomNonce'] = makeRandomNonce;
|
||||
}(this.plt));
|
||||
}(this.plt, jQuery));
|
||||
|
|
|
@ -60,9 +60,13 @@ jQuery(document).ready(function() {
|
|||
if (e.which == 13 && !prompt.attr('disabled')) {
|
||||
onExpressionEntered();
|
||||
}});
|
||||
var afterReplSetup = function() {
|
||||
|
||||
var afterReplSetup = function(theRepl) {
|
||||
repl = theRepl;
|
||||
prompt.val('');
|
||||
prompt.removeAttr('disabled');
|
||||
};
|
||||
var repl = new plt.runtime.Repl({ write: write }, afterReplSetup);
|
||||
|
||||
var repl;
|
||||
plt.runtime.makeRepl({ write: write }, afterReplSetup);
|
||||
});
|
||||
|
|
|
@ -4,6 +4,13 @@
|
|||
// options: { compilerUrl: string,,
|
||||
// write: (dom-node -> void)
|
||||
// language: string }
|
||||
|
||||
// makeRepl: options (Repl -> void) -> void
|
||||
var makeRepl = function(options, afterSetup) {
|
||||
new Repl(options, afterSetup);
|
||||
return;
|
||||
};
|
||||
|
||||
var Repl = function(options, afterSetup) {
|
||||
this.M = plt.runtime.currentMachine;
|
||||
this.compilerUrl = options.compilerUrl || 'rpc.html';
|
||||
|
@ -80,7 +87,6 @@
|
|||
var setupMachine = function(that, afterSetup) {
|
||||
var M = that.M;
|
||||
M.reset();
|
||||
|
||||
// We configure the machine's output to send it to the
|
||||
// "output" DOM node.
|
||||
M.params.currentDisplayer = function(MACHINE, domNode) {
|
||||
|
@ -99,7 +105,7 @@
|
|||
// FIXME: this should be getting the namespace,
|
||||
// not the export dictionary...
|
||||
M.params.currentNamespace = semanticsModule.getExports();
|
||||
afterSetup();
|
||||
afterSetup(that);
|
||||
},
|
||||
function(err) {
|
||||
// Nothing should work if we can't get this to work.
|
||||
|
@ -189,5 +195,5 @@
|
|||
//////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Expose to the outside world as plt.runtime.Repl.
|
||||
plt.runtime.Repl = Repl;
|
||||
plt.runtime.makeRepl = makeRepl;
|
||||
}());
|
||||
|
|
Loading…
Reference in New Issue
Block a user