##// END OF EJS Templates
convention, jQuery variable start with $...
Matthias BUSSONNIER -
Show More
@@ -61,7 +61,7 b' var IPython = (function (IPython) {'
61 this.metaui = new IPython.MetaUI(this);
61 this.metaui = new IPython.MetaUI(this);
62
62
63 var cell = $('<div></div>').addClass('cell border-box-sizing code_cell vbox');
63 var cell = $('<div></div>').addClass('cell border-box-sizing code_cell vbox');
64 cell.append(this.metaui.element);
64 cell.append(this.metaui.$element);
65 cell.attr('tabindex','2');
65 cell.attr('tabindex','2');
66 var input = $('<div></div>').addClass('input hbox');
66 var input = $('<div></div>').addClass('input hbox');
67 input.append($('<div/>').addClass('prompt input_prompt'));
67 input.append($('<div/>').addClass('prompt input_prompt'));
@@ -19,7 +19,7 b' var IPython = (function (IPython) {'
19 this.bind_events();
19 this.bind_events();
20 $(this.selector)
20 $(this.selector)
21 .append($('<label/>').text('MetaUI'))
21 .append($('<label/>').text('MetaUI'))
22 .append(IPython.MetaUI.dropdown_preset_selector)
22 .append(IPython.MetaUI.$dropdown_preset_selector)
23 };
23 };
24
24
25 MainToolBar.prototype = new IPython.ToolBar();
25 MainToolBar.prototype = new IPython.ToolBar();
@@ -27,20 +27,20 b' var IPython = (function (IPython) {'
27 */
27 */
28 var MetaUI = function (cell) {
28 var MetaUI = function (cell) {
29 MetaUI._instances.push(this);
29 MetaUI._instances.push(this);
30 this.metainner = $('<div/>');
30 this.$metainner = $('<div/>');
31 this.cell = cell;
31 this.cell = cell;
32 this.element = $('<div/>').addClass('metaedit')
32 this.$element = $('<div/>').addClass('metaedit')
33 .append(this.metainner)
33 .append(this.$metainner)
34 this.rebuild();
34 this.rebuild();
35 return this;
35 return this;
36 };
36 };
37
37
38 MetaUI.dropdown_preset_selector = $('<select/>')
38 MetaUI.$dropdown_preset_selector = $('<select/>')
39 .attr('id','metaui_selector')
39 .attr('id','metaui_selector')
40 .append($('<option/>').attr('value','').text('-'))
40 .append($('<option/>').attr('value','').text('-'))
41
41
42 MetaUI.dropdown_preset_selector.change(function(){
42 MetaUI.$dropdown_preset_selector.change(function(){
43 var val = MetaUI.dropdown_preset_selector.val()
43 var val = MetaUI.$dropdown_preset_selector.val()
44 if(val ==''){
44 if(val ==''){
45 $('body').removeClass('editmetaon')
45 $('body').removeClass('editmetaon')
46 } else {
46 } else {
@@ -155,7 +155,7 b' var IPython = (function (IPython) {'
155 */
155 */
156 MetaUI.register_preset = function(name, preset_list){
156 MetaUI.register_preset = function(name, preset_list){
157 MetaUI._presets[name] = preset_list
157 MetaUI._presets[name] = preset_list
158 MetaUI.dropdown_preset_selector.append(
158 MetaUI.$dropdown_preset_selector.append(
159 $('<option/>').attr('value',name).text(name)
159 $('<option/>').attr('value',name).text(name)
160 )
160 )
161 }
161 }
@@ -201,8 +201,8 b' var IPython = (function (IPython) {'
201 MetaUI.prototype.rebuild = function(){
201 MetaUI.prototype.rebuild = function(){
202 // strip evrything from the div
202 // strip evrything from the div
203 // which is probabli metainner.
203 // which is probabli metainner.
204 // or this.element.
204 // or this.$element.
205 this.metainner.empty();
205 this.$metainner.empty();
206 //this.add_raw_edit_button()
206 //this.add_raw_edit_button()
207
207
208
208
@@ -213,7 +213,7 b' var IPython = (function (IPython) {'
213 var local_div = $('<div/>').addClass('button_container');
213 var local_div = $('<div/>').addClass('button_container');
214 // Note,
214 // Note,
215 // do this the other way, wrap in try/catch and don't append if any errors.
215 // do this the other way, wrap in try/catch and don't append if any errors.
216 this.metainner.append(local_div)
216 this.$metainner.append(local_div)
217 cdict[preset[index]](local_div,this.cell)
217 cdict[preset[index]](local_div,this.cell)
218 }
218 }
219
219
@@ -44,7 +44,7 b' var IPython = (function (IPython) {'
44 TextCell.prototype.create_element = function () {
44 TextCell.prototype.create_element = function () {
45 var cell = $("<div>").addClass('cell text_cell border-box-sizing vbox');
45 var cell = $("<div>").addClass('cell text_cell border-box-sizing vbox');
46 this.metaui = new IPython.MetaUI(this);
46 this.metaui = new IPython.MetaUI(this);
47 cell.append(this.metaui.element);
47 cell.append(this.metaui.$element);
48 cell.attr('tabindex','2');
48 cell.attr('tabindex','2');
49 var input_area = $('<div/>').addClass('text_cell_input border-box-sizing');
49 var input_area = $('<div/>').addClass('text_cell_input border-box-sizing');
50 this.code_mirror = CodeMirror(input_area.get(0), {
50 this.code_mirror = CodeMirror(input_area.get(0), {
General Comments 0
You need to be logged in to leave comments. Login now