Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added button to insert dial (in progress..)

  • Loading branch information...
commit 17e7e1224a934bd25cb5a49aef23cc85aeabc4eb 1 parent 57dc4fd
Ildefonso Martínez authored
41 Includes/editors/ckeditor_settings.js
@@ -8,7 +8,7 @@ CKEDITOR.editorConfig = function(config) {
8 8 config.toolbar = 'Emoncms3_Toolbar';
9 9
10 10 config.toolbar_Emoncms3_Toolbar = [
11   - { name: 'document', items : [ 'Source','-','NewPage','AjaxSave','DocProps','Emoncms3Preview','Print','-','Templates' ] },
  11 + { name: 'document', items : [ 'Source','-','NewPage','e3Save','DocProps','e3Preview','Print','-','Templates' ] },
12 12 { name: 'clipboard', items : [ 'Cut','Copy','Paste','PasteText','PasteFromWord','-','Undo','Redo' ] },
13 13 { name: 'editing', items : [ 'Find','Replace','-','SelectAll','-','SpellChecker', 'Scayt' ] },
14 14 { name: 'forms', items : [ 'Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton',
@@ -22,17 +22,18 @@ CKEDITOR.editorConfig = function(config) {
22 22 '/',
23 23 { name: 'styles', items : [ 'Styles','Format','Font','FontSize' ] },
24 24 { name: 'colors', items : [ 'TextColor','BGColor' ] },
25   - { name: 'tools', items : [ 'Maximize', 'ShowBlocks','-','About' ] }
  25 + { name: 'tools', items : [ 'Maximize', 'ShowBlocks','-','About' ] },
  26 + { name: 'e3widgets', items : [ 'e3dial' ] }
26 27 ];
27 28
28   - config.extraPlugins = 'AjaxSave,Emoncms3Preview';
  29 + config.extraPlugins = 'e3Save,e3Preview,e3dial';
29 30 config.fillEmptyBlocks = false;
30 31 config.contentsCss = path+'Views/theme/dark/style.css';
31 32
32 33 // Save button
33   - CKEDITOR.plugins.add('AjaxSave', {
  34 + CKEDITOR.plugins.add('e3Save', {
34 35 init : function(editor) {
35   - var pluginName = 'AjaxSave';
  36 + var pluginName = 'e3Save';
36 37
37 38 editor.addCommand(pluginName, {
38 39 // Save button pressed
@@ -43,7 +44,7 @@ CKEDITOR.editorConfig = function(config) {
43 44 canUndo : true
44 45 });
45 46
46   - editor.ui.addButton('AjaxSave', {
  47 + editor.ui.addButton('e3Save', {
47 48 label : 'Save',
48 49 command : pluginName,
49 50 className : 'cke_button_save'
@@ -52,9 +53,9 @@ CKEDITOR.editorConfig = function(config) {
52 53 });
53 54
54 55 // Preview button
55   - CKEDITOR.plugins.add('Emoncms3Preview', {
  56 + CKEDITOR.plugins.add('e3Preview', {
56 57 init : function(editor) {
57   - var pluginName = 'Emoncms3Preview';
  58 + var pluginName = 'e3Preview';
58 59
59 60 editor.addCommand(pluginName, {
60 61 // Save button pressed
@@ -65,11 +66,33 @@ CKEDITOR.editorConfig = function(config) {
65 66 canUndo : true
66 67 });
67 68
68   - editor.ui.addButton('Emoncms3Preview', {
  69 + editor.ui.addButton('e3Preview', {
69 70 label : 'Preview',
70 71 command : pluginName,
71 72 className : 'cke_button_preview'
72 73 });
73 74 }
74 75 });
  76 +
  77 + // insert dial
  78 + CKEDITOR.plugins.add('e3dial', {
  79 + init : function(editor) {
  80 + var pluginName = 'e3dial';
  81 +
  82 + editor.addCommand(pluginName, {
  83 + // insert dial button pressed
  84 + exec : function(editor) {
  85 + editor.insertHtml("<div class='dial' feed='power' max='500' scale='1' units='V'></div>");
  86 + },
  87 + canUndo : true
  88 + });
  89 +
  90 + editor.ui.addButton('e3dial', {
  91 + label : 'Dial',
  92 + command : pluginName,
  93 + className : 'cke_button_preview'
  94 + });
  95 + }
  96 + });
  97 +
75 98 };
1  Views/dashboard_view.php
@@ -67,7 +67,6 @@
67 67 //ev.editor.insertHtml( $("#page").html() );
68 68 ev.editor.setData( $("#page").html() );
69 69
70   -
71 70 // On instance ready we show the botton preview
72 71 show_dashboard();
73 72 });

0 comments on commit 17e7e12

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