/[drupal]/contributions/modules/bbcode_wysiwyg/bbcode_wysiwyg.js
ViewVC logotype

Diff of /contributions/modules/bbcode_wysiwyg/bbcode_wysiwyg.js

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1.2.5, Tue Apr 29 04:09:59 2008 UTC revision 1.1.2.6, Tue Apr 29 06:14:11 2008 UTC
# Line 7  Drupal.bbcodeAutoAttach = function() { Line 7  Drupal.bbcodeAutoAttach = function() {
7    var out = '', settings = Drupal.settings.bbcode_wysiwyg;    var out = '', settings = Drupal.settings.bbcode_wysiwyg;
8    out += '<div class="bbcode_wysiwyg">';    out += '<div class="bbcode_wysiwyg">';
9    for(var button in settings.buttons) {    for(var button in settings.buttons) {
10      if (settings.buttons[button]) {      var charcode = settings.buttons[button];
11        out += '<input type="button" class="bbcode-'+ button +'" value="'+ button +'" />';      if (charcode) {
12          out += '<input type="button" class="bbcode-'+ button +'" value="'+ button +'" title="CTRL + SHIFT + '+ String.fromCharCode(charcode).toUpperCase() +'" />';
13      }      }
14    }    }
15    out += '</div>';    out += '</div>';
# Line 199  Drupal.bbcodeInsertAtCursor = function(f Line 200  Drupal.bbcodeInsertAtCursor = function(f
200    
201    
202  Drupal.bbcodeKeydown = function(keycode) {  Drupal.bbcodeKeydown = function(keycode) {
203    switch (keycode)  {    var settings = Drupal.settings.bbcode_wysiwyg;
204      // ctrl  
205      case 17:    // shift
206        BBC_CTRL = true;    if (keycode == 16) {
207      break;      BBC_SHFT = true;
208      }
209      // shift  
210      case 16:    // ctrl
211        BBC_SHFT = true;    if (keycode == 17) {
212      break;      BBC_CTRL = true;
213      }
214      // B  
215      case 66:    if (BBC_CTRL && BBC_SHFT) {
216        if (BBC_CTRL && BBC_SHFT)  {      for (var button in settings.buttons) {
217          Drupal.bbcodeClick('bold');        if (keycode == settings.buttons[button]) {
218          BBC_CTRL = false;          Drupal.bbcodeClick(button);
         BBC_SHFT = false;  
         break;  
       }  
     break;  
   
     // Q  
     case 81:  
       if (BBC_CTRL && BBC_SHFT)  {  
         Drupal.bbcodeClick('quote');  
         BBC_CTRL = false;  
         BBC_SHFT = false;  
         break;  
       }  
     break;  
   
     // I  
     case 73:  
       if (BBC_CTRL && BBC_SHFT)  {  
         Drupal.bbcodeClick('italic');  
         BBC_CTRL = false;  
         BBC_SHFT = false;  
         break;  
       }  
     break;  
   
     // L  
     case 76:  
       if (BBC_CTRL && BBC_SHFT)  {  
         Drupal.bbcodeClick('link');  
219          BBC_CTRL = false;          BBC_CTRL = false;
220          BBC_SHFT = false;          BBC_SHFT = false;
221          break;          break;
222        }        }
223        break;      }
     default:  
     break;  
224    }    }
225  }  }
226    
227    
228  Drupal.bbcodeKeyup = function(keycode){  Drupal.bbcodeKeyup = function(keycode){
229    switch (keycode) {    // shift
230      // ctrl    if (keycode == 16) {
231      case 17:      BBC_SHFT = false;
232        BBC_CTRL = false;    }
233      break;  
234      // ctrl
235      // shift    if (keycode == 17) {
236      case 16:      BBC_CTRL = false;
       BBC_SHFT = false;  
     break;  
237    }    }
238  }  }
239    

Legend:
Removed from v.1.1.2.5  
changed lines
  Added in v.1.1.2.6

  ViewVC Help
Powered by ViewVC 1.1.2