Skip to content
Browse files

renamed some variables in editor.js

  • Loading branch information...
1 parent 9d3aa74 commit 0a245976b7d2b80796b2e22956a6838fe241f59e @splitbrain splitbrain committed
Showing with 18 additions and 18 deletions.
  1. +18 −18 lib/scripts/editor.js
View
36 lib/scripts/editor.js
@@ -14,10 +14,10 @@ var dw_editor = {
* textareas
*/
init: function(){
- var editor = jQuery('#wiki__text');
- if(!editor.length) return;
+ var $editor = jQuery('#wiki__text');
+ if(!$editor.length) return;
- dw_editor.initSizeCtl('#size__ctl',editor);
+ dw_editor.initSizeCtl('#size__ctl',$editor);
},
/**
@@ -29,20 +29,20 @@ var dw_editor = {
* @param selector editor the textarea to control
*/
initSizeCtl: function(ctlarea,editor){
- var ctl = jQuery(ctlarea);
- var textarea = jQuery(editor);
- if(!ctl.length || !textarea.length) return;
+ var $ctl = jQuery(ctlarea);
+ var $textarea = jQuery(editor);
+ if(!$ctl.length || !$textarea.length) return;
var hgt = DokuCookie.getValue('sizeCtl');
if(hgt){
- textarea.css('height', hgt);
+ $textarea.css('height', hgt);
}else{
- textarea.css('height', '300px');
+ $textarea.css('height', '300px');
}
var wrp = DokuCookie.getValue('wrapCtl');
if(wrp){
- dw_editor.setWrap(textarea[0], wrp);
+ dw_editor.setWrap($textarea[0], wrp);
} // else use default value
var l = document.createElement('img');
@@ -54,9 +54,9 @@ var dw_editor = {
jQuery(l).click(function(){dw_editor.sizeCtl(editor,100);});
jQuery(s).click(function(){dw_editor.sizeCtl(editor,-100);});
jQuery(w).click(function(){dw_editor.toggleWrap(editor);});
- ctl.append(l);
- ctl.append(s);
- ctl.append(w);
+ $ctl.append(l);
+ $ctl.append(s);
+ $ctl.append(w);
},
/**
@@ -66,11 +66,11 @@ var dw_editor = {
* @param int val the relative value to resize in pixel
*/
sizeCtl: function(editor,val){
- var textarea = jQuery(editor);
- var height = parseInt(textarea.css('height'));
+ var $textarea = jQuery(editor);
+ var height = parseInt($textarea.css('height'));
height += val;
- textarea.css('height', height+'px');
- DokuCookie.setValue('sizeCtl',textarea.css('height'));
+ $textarea.css('height', height+'px');
+ DokuCookie.setValue('sizeCtl',$textarea.css('height'));
},
/**
@@ -80,14 +80,14 @@ var dw_editor = {
* @param selector editor the textarea to control
*/
toggleWrap: function(editor){
- var textarea = jQuery(editor);
+ var $textarea = jQuery(editor);
var wrap = textarea.attr('wrap');
if(wrap && wrap.toLowerCase() == 'off'){
dw_editor.setWrap(textarea[0], 'soft');
}else{
dw_editor.setWrap(textarea[0], 'off');
}
- DokuCookie.setValue('wrapCtl',textarea.attr('wrap'));
+ DokuCookie.setValue('wrapCtl',$textarea.attr('wrap'));
},
/**

0 comments on commit 0a24597

Please sign in to comment.
Something went wrong with that request. Please try again.