"use strict" in most (if not all) our javascript

+ fix one variable leaking in global nameespace
This commit is contained in:
Matthias BUSSONNIER 2013-08-09 14:56:52 +02:00
parent 88384c963f
commit 13ff842be5
15 changed files with 17 additions and 1 deletions

View File

@ -12,6 +12,7 @@
IPython.namespace('IPython.dialog');
IPython.dialog = (function (IPython) {
"use strict";
var modal = function (options) {
var dialog = $("<div/>").addClass("modal").attr("role", "dialog");

View File

@ -17,6 +17,7 @@
// $([IPython.events]).on('event.Namespace',function () {});
var IPython = (function (IPython) {
"use strict";
var utils = IPython.utils;

View File

@ -8,6 +8,8 @@
var IPython = IPython || {};
IPython.namespace = function (ns_string) {
"use strict";
var parts = ns_string.split('.'),
parent = IPython,
i;

View File

@ -10,6 +10,7 @@
//============================================================================
var IPython = (function (IPython) {
"use strict";
var Page = function () {
this.style();

View File

@ -11,6 +11,7 @@
$(document).ready(function () {
"use strict";
IPython.page = new IPython.Page();
IPython.page.show();

View File

@ -11,6 +11,7 @@
IPython.namespace('IPython.utils');
IPython.utils = (function (IPython) {
"use strict";
//============================================================================
// Cross-browser RegEx Split
@ -366,7 +367,7 @@ IPython.utils = (function (IPython) {
};
// http://stackoverflow.com/questions/2400935/browser-detection-in-javascript
browser = (function() {
var browser = (function() {
var N= navigator.appName, ua= navigator.userAgent, tem;
var M= ua.match(/(opera|chrome|safari|firefox|msie)\/?\s*(\.?\d+(\.\d+)*)/i);
if (M && (tem= ua.match(/version\/([\.\d]+)/i))!= null) M[2]= tem[1];

View File

@ -16,6 +16,7 @@
*/
var IPython = (function (IPython) {
"use strict";
var utils = IPython.utils;

View File

@ -4,6 +4,7 @@
// to do, but at least the simple one for now.
CodeMirror.requireMode('python',function(){
"use strict";
CodeMirror.defineMode("ipython", function(conf, parserConf) {

View File

@ -10,6 +10,7 @@
//============================================================================
var IPython = (function (IPython) {
"use strict";
var MainToolBar = function (selector) {
IPython.ToolBar.apply(this, arguments);

View File

@ -17,6 +17,7 @@
var IPython = (function (IPython) {
"use strict";
/**
* A MenuBar Class to generate the menubar of IPython noteboko

View File

@ -10,6 +10,7 @@
//============================================================================
var IPython = (function (IPython) {
"use strict";
var utils = IPython.utils;
var key = IPython.utils.keycodes;

View File

@ -10,6 +10,7 @@
//============================================================================
var IPython = (function (IPython) {
"use strict";
var utils = IPython.utils;

View File

@ -10,6 +10,7 @@
//============================================================================
var IPython = (function (IPython) {
"use strict";
var QuickHelp = function (selector) {
};

View File

@ -10,6 +10,7 @@
//============================================================================
var IPython = (function (IPython) {
"use strict";
var utils = IPython.utils;

View File

@ -15,6 +15,7 @@
*/
var IPython = (function (IPython) {
"use strict";
/**
* A generic toolbar on which one can add button