You are here

lab.bueditor.txt in BUEditor 6.2

Same filename and directory in other branches
  1. 7 import/lab.bueditor.txt
array (
  'name' => 'Lab',
  'pages' => 'node/*
comment/*',
  'excludes' => 'edit-log',
  'iconpath' => '%BUEDITOR/icons',
  'spriteon' => '0',
  'buttons' => 
  array (
    0 => 
    array (
      'title' => 'Tag dialog',
      'content' => 'js:
var form = [
  {
    name: \'foo\',
    title: \'Foo\',
    attributes: {style: \'color: red\', onchange: \'this.form.attr_bar.value = this.value\'},
    value: \'\',
    getnext: true,
    required: true,
    prefix: \'prefix-\',
    type: \'select\',
    options: {\'\': \'no value\', 1: \'value-1\', n: \'value-n\'}
  },
  {
    name: \'bar\',
    attributes: {value: \'bar\', disabled: \'disabled\'},
    value: \'bar bar\',
    suffix: \'-suffix\'
  },
  \'baz\'
];
var options = {};
options.title = \'Dialog title\';
options.stitle = \'Submit it!\';
options.validate = function(tag, form) {
  return confirm(\'Confirm?\');
};
options.submit = function(tag, form) {
  var str = \'\\nForm elements name-value pairs\\n\';
  $.each(form.elements, function(i, el){
    str += el.name +\'=\'+ el.value +\'\\n\';
  });
  E.replaceSelection(str);
};

E.tagDialog(\'tag\', form, options);',
      'icon' => 'Custom Form',
      'accesskey' => 'D',
      'weight' => '0',
    ),
    1 => 
    array (
      'title' => 'Toggle tag',
      'content' => 'js: E.toggleTag(\'strong\', {\'class\': \'error\', style: \'font: courier\'});',
      'icon' => 'Toggle tag',
      'accesskey' => 'T',
      'weight' => '1',
    ),
    2 => 
    array (
      'title' => 'AjaxPreview',
      'content' => 'js: E.prvAjax();',
      'icon' => 'XPreview',
      'accesskey' => 'E',
      'weight' => '2',
    ),
    3 => 
    array (
      'title' => 'Find',
      'content' => 'js: E.frForm();',
      'icon' => 'Find',
      'accesskey' => 'F',
      'weight' => '3',
    ),
    4 => 
    array (
      'title' => 'Replace',
      'content' => 'js: E.frForm({
  isrep: true, //enable replace
  iscase: true, //enable case sensitive switch
  isreg: true, //enable regular expression switch
  title: \'Replace some text\' //custom title
});',
      'icon' => 'Replace',
      'accesskey' => 'R',
      'weight' => '4',
    ),
    5 => 
    array (
      'title' => 'Undo',
      'content' => 'js: E.undo();',
      'icon' => 'Undo',
      'accesskey' => 'Z',
      'weight' => '5',
    ),
    6 => 
    array (
      'title' => 'Redo',
      'content' => 'js: E.redo();',
      'icon' => 'Redo',
      'accesskey' => 'Y',
      'weight' => '6',
    ),
    7 => 
    array (
      'title' => 'tpl:break',
      'content' => '<br />',
      'icon' => '',
      'accesskey' => '',
      'weight' => '7',
    ),
    8 => 
    array (
      'title' => 'Test accessibility',
      'content' => 'js:
var $html = $(\'<p>Open this using Ctrl+J</p><p>Use UP, DOWN, ENTER, ESC</p><p><a href="#" title="Option1">Choose Option1</a></p><p><a href="#" title="Option2">Choose Option2</a></p><p><a href="#" title="Option3">Choose Option3</a></p>\');

$html.find(\'a\').click(function(){
  E.replaceSelection(this.title + \' was chosen\');
  return false;
});

E.quickPop.open($html);',
      'icon' => 'Choose',
      'accesskey' => 'J',
      'weight' => '8',
    ),
    9 => 
    array (
      'title' => 'Direct IMCE',
      'content' => 'js: E.imce && E.imce.url && 
E.imce.open({
  ready: E.imce.readyDefault,
  sendto: function(file, win, pop) {
    if (!file.width) return win.imce.setMessage(\'Please select an image file!\', \'error\');
    pop.close();
    E.replaceSelection(\'<img src="\'+ file.url +\'" width="\'+ file.width +\'" height="\'+ file.height +\'" alt="\'+ file.name +\'">\').focus();
  }
});',
      'icon' => 'Image(IMCE)',
      'accesskey' => 'M',
      'weight' => '9',
    ),
    10 => 
    array (
      'title' => 'Auto LI',
      'content' => '<ul>
  <li>Press enter to insert another list item</li>%TEXT%
</ul>',
      'icon' => 'Auto LI',
      'accesskey' => 'L',
      'weight' => '10',
    ),
    11 => 
    array (
      'title' => 'Help',
      'content' => 'js: E.help();',
      'icon' => '???',
      'accesskey' => 'H',
      'weight' => '11',
    ),
    12 => 
    array (
      'title' => 'tpl:Extend postprocesses',
      'content' => 'js:
BUE.postprocess._lab1 = function(E, $) {
  E.ACAdd(\'BUE\', \' rocks!\');/*add an autocomplete pair*/
  E.history.period = 100;/*change state saving period of undo history from 500ms to 100ms*/
};',
      'icon' => '',
      'accesskey' => '',
      'weight' => '12',
    ),
    13 => 
    array (
      'title' => 'tpl:Druplicon',
      'content' => 'js:
setTimeout(function(){$(\'#editor-demo\').val(\'This is the guinea pig editor including all libraries(minified version is %BUEDITOR/library/bue.min.all.js) that come with bueditor. \\nThis text was inserted here by a template button running javascript code.\\n\\nHere you can experience:\\n- CTRL shortcuts(try Ctrl+J when the cursor is in the textarea)\\n- TAB-indent, Shift+TAB-unindent, ENTER-auto indent\\n- Autocomplete (type "BUE" or an html/bbcode tag, e.g. "<em>")\\n- Cross-browser undo/redo\\n- CSS3 popups, shortcuts in popups\\n- Find & Replace inside the textarea\\n- Ajax preview\');});

return \'<img src="\'+ Drupal.settings.basePath +\'misc/druplicon.png" width="16" height="16" title="Me inserted the initial text" alt="druplicon" />\';',
      'icon' => '',
      'accesskey' => '',
      'weight' => '13',
    ),
  ),
  'icons' => 
  array (
  ),
  'library' => 
  array (
    '%BUEDITOR/library/bue.popup.js' => '',
    '%BUEDITOR/library/bue.popup.css' => '',
    '%BUEDITOR/library/bue.markup.js' => '',
    '%BUEDITOR/library/bue.preview.js' => '',
    '%BUEDITOR/library/bue.imce.js' => '',
    '%BUEDITOR/library/bue.misc.js' => '',
    '%BUEDITOR/library/bue.autocomplete.js' => '',
    '%BUEDITOR/library/bue.ctrl.js' => '',
    '%BUEDITOR/library/bue.find.js' => '',
    '%BUEDITOR/library/bue.history.js' => '',
    '%BUEDITOR/library/bue.li.js' => '',
    '%BUEDITOR/library/bue.tab.js' => '',
  ),
)

File

import/lab.bueditor.txt
View source
  1. array (
  2. 'name' => 'Lab',
  3. 'pages' => 'node/*
  4. comment/*',
  5. 'excludes' => 'edit-log',
  6. 'iconpath' => '%BUEDITOR/icons',
  7. 'spriteon' => '0',
  8. 'buttons' =>
  9. array (
  10. 0 =>
  11. array (
  12. 'title' => 'Tag dialog',
  13. 'content' => 'js:
  14. var form = [
  15. {
  16. name: \'foo\',
  17. title: \'Foo\',
  18. attributes: {style: \'color: red\', onchange: \'this.form.attr_bar.value = this.value\'},
  19. value: \'\',
  20. getnext: true,
  21. required: true,
  22. prefix: \'prefix-\',
  23. type: \'select\',
  24. options: {\'\': \'no value\', 1: \'value-1\', n: \'value-n\'}
  25. },
  26. {
  27. name: \'bar\',
  28. attributes: {value: \'bar\', disabled: \'disabled\'},
  29. value: \'bar bar\',
  30. suffix: \'-suffix\'
  31. },
  32. \'baz\'
  33. ];
  34. var options = {};
  35. options.title = \'Dialog title\';
  36. options.stitle = \'Submit it!\';
  37. options.validate = function(tag, form) {
  38. return confirm(\'Confirm?\');
  39. };
  40. options.submit = function(tag, form) {
  41. var str = \'\\nForm elements name-value pairs\\n\';
  42. $.each(form.elements, function(i, el){
  43. str += el.name +\'=\'+ el.value +\'\\n\';
  44. });
  45. E.replaceSelection(str);
  46. };
  47. E.tagDialog(\'tag\', form, options);',
  48. 'icon' => 'Custom Form',
  49. 'accesskey' => 'D',
  50. 'weight' => '0',
  51. ),
  52. 1 =>
  53. array (
  54. 'title' => 'Toggle tag',
  55. 'content' => 'js: E.toggleTag(\'strong\', {\'class\': \'error\', style: \'font: courier\'});',
  56. 'icon' => 'Toggle tag',
  57. 'accesskey' => 'T',
  58. 'weight' => '1',
  59. ),
  60. 2 =>
  61. array (
  62. 'title' => 'AjaxPreview',
  63. 'content' => 'js: E.prvAjax();',
  64. 'icon' => 'XPreview',
  65. 'accesskey' => 'E',
  66. 'weight' => '2',
  67. ),
  68. 3 =>
  69. array (
  70. 'title' => 'Find',
  71. 'content' => 'js: E.frForm();',
  72. 'icon' => 'Find',
  73. 'accesskey' => 'F',
  74. 'weight' => '3',
  75. ),
  76. 4 =>
  77. array (
  78. 'title' => 'Replace',
  79. 'content' => 'js: E.frForm({
  80. isrep: true, //enable replace
  81. iscase: true, //enable case sensitive switch
  82. isreg: true, //enable regular expression switch
  83. title: \'Replace some text\' //custom title
  84. });',
  85. 'icon' => 'Replace',
  86. 'accesskey' => 'R',
  87. 'weight' => '4',
  88. ),
  89. 5 =>
  90. array (
  91. 'title' => 'Undo',
  92. 'content' => 'js: E.undo();',
  93. 'icon' => 'Undo',
  94. 'accesskey' => 'Z',
  95. 'weight' => '5',
  96. ),
  97. 6 =>
  98. array (
  99. 'title' => 'Redo',
  100. 'content' => 'js: E.redo();',
  101. 'icon' => 'Redo',
  102. 'accesskey' => 'Y',
  103. 'weight' => '6',
  104. ),
  105. 7 =>
  106. array (
  107. 'title' => 'tpl:break',
  108. 'content' => '
    ',
  109. 'icon' => '',
  110. 'accesskey' => '',
  111. 'weight' => '7',
  112. ),
  113. 8 =>
  114. array (
  115. 'title' => 'Test accessibility',
  116. 'content' => 'js:
  117. var $html = $(\'

    Open this using Ctrl+J

    Use UP, DOWN, ENTER, ESC

    Choose Option1

    Choose Option2

    Choose Option3

    \');
  118. $html.find(\'a\').click(function(){
  119. E.replaceSelection(this.title + \' was chosen\');
  120. return false;
  121. });
  122. E.quickPop.open($html);',
  123. 'icon' => 'Choose',
  124. 'accesskey' => 'J',
  125. 'weight' => '8',
  126. ),
  127. 9 =>
  128. array (
  129. 'title' => 'Direct IMCE',
  130. 'content' => 'js: E.imce && E.imce.url &&
  131. E.imce.open({
  132. ready: E.imce.readyDefault,
  133. sendto: function(file, win, pop) {
  134. if (!file.width) return win.imce.setMessage(\'Please select an image file!\', \'error\');
  135. pop.close();
  136. E.replaceSelection(\'\'+ file.name +\'\').focus();
  137. }
  138. });',
  139. 'icon' => 'Image(IMCE)',
  140. 'accesskey' => 'M',
  141. 'weight' => '9',
  142. ),
  143. 10 =>
  144. array (
  145. 'title' => 'Auto LI',
  146. 'content' => '
    • Press enter to insert another list item
    • %TEXT%
    ',
  147. 'icon' => 'Auto LI',
  148. 'accesskey' => 'L',
  149. 'weight' => '10',
  150. ),
  151. 11 =>
  152. array (
  153. 'title' => 'Help',
  154. 'content' => 'js: E.help();',
  155. 'icon' => '???',
  156. 'accesskey' => 'H',
  157. 'weight' => '11',
  158. ),
  159. 12 =>
  160. array (
  161. 'title' => 'tpl:Extend postprocesses',
  162. 'content' => 'js:
  163. BUE.postprocess._lab1 = function(E, $) {
  164. E.ACAdd(\'BUE\', \' rocks!\');/*add an autocomplete pair*/
  165. E.history.period = 100;/*change state saving period of undo history from 500ms to 100ms*/
  166. };',
  167. 'icon' => '',
  168. 'accesskey' => '',
  169. 'weight' => '12',
  170. ),
  171. 13 =>
  172. array (
  173. 'title' => 'tpl:Druplicon',
  174. 'content' => 'js:
  175. setTimeout(function(){$(\'#editor-demo\').val(\'This is the guinea pig editor including all libraries(minified version is %BUEDITOR/library/bue.min.all.js) that come with bueditor. \\nThis text was inserted here by a template button running javascript code.\\n\\nHere you can experience:\\n- CTRL shortcuts(try Ctrl+J when the cursor is in the textarea)\\n- TAB-indent, Shift+TAB-unindent, ENTER-auto indent\\n- Autocomplete (type "BUE" or an html/bbcode tag, e.g. "")\\n- Cross-browser undo/redo\\n- CSS3 popups, shortcuts in popups\\n- Find & Replace inside the textarea\\n- Ajax preview\');});
  176. return \'druplicon\';',
  177. 'icon' => '',
  178. 'accesskey' => '',
  179. 'weight' => '13',
  180. ),
  181. ),
  182. 'icons' =>
  183. array (
  184. ),
  185. 'library' =>
  186. array (
  187. '%BUEDITOR/library/bue.popup.js' => '',
  188. '%BUEDITOR/library/bue.popup.css' => '',
  189. '%BUEDITOR/library/bue.markup.js' => '',
  190. '%BUEDITOR/library/bue.preview.js' => '',
  191. '%BUEDITOR/library/bue.imce.js' => '',
  192. '%BUEDITOR/library/bue.misc.js' => '',
  193. '%BUEDITOR/library/bue.autocomplete.js' => '',
  194. '%BUEDITOR/library/bue.ctrl.js' => '',
  195. '%BUEDITOR/library/bue.find.js' => '',
  196. '%BUEDITOR/library/bue.history.js' => '',
  197. '%BUEDITOR/library/bue.li.js' => '',
  198. '%BUEDITOR/library/bue.tab.js' => '',
  199. ),
  200. )