Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Better code readability.
Browse files Browse the repository at this point in the history
  • Loading branch information
cheeaun committed Feb 9, 2009
1 parent 711f96d commit 9507968
Showing 1 changed file with 56 additions and 10 deletions.
66 changes: 56 additions & 10 deletions Source/MooEditable/MooEditable.js
Expand Up @@ -33,7 +33,7 @@ var MooEditable = new Class({
paragraphise: true,
xhtml : true,
semantics : true,
buttons: 'bold,italic,underline,strikethrough,|,insertunorderedlist,insertorderedlist,indent,outdent,|,undo,redo,|,createlink,unlink,|,urlimage,|,toggleview',
buttons: 'bold, italic, underline, strikethrough, |, insertunorderedlist, insertorderedlist, indent, outdent, |, undo, redo, |, createlink, unlink, |, urlimage, |, toggleview',
mode: 'icons'
},

Expand Down Expand Up @@ -108,6 +108,7 @@ var MooEditable = new Class({

var toolbarButtons = this.options.buttons.split(',');
var buttons = toolbarButtons.map(function(command, idx){
command = command.trim();
if (command == '|') return new Element('span', {'class': 'toolbar-separator'});
var b = new Element('button', {
'class': command + '-button toolbar-button',
Expand Down Expand Up @@ -614,16 +615,61 @@ MooEditable.Selection = new Class({

MooEditable.Actions = new Hash({

bold: {title: 'Bold', shortcut: 'b', tags: ['b', 'strong'], css: {'font-weight': 'bold'}},
italic: {title: 'Italic', shortcut: 'i', tags: ['i', 'em'], css: {'font-style': 'italic'}},
underline: {title: 'Underline', shortcut: 'u', tags: ['u'], css: {'text-decoration': 'underline'}},
strikethrough: {title: 'Strikethrough', shortcut: 's', tags: ['s', 'strike'], css: {'text-decoration': 'line-through'}},
insertunorderedlist: {title: 'Unordered List', tags: ['ul']},
insertorderedlist: {title: 'Ordered List', tags: ['ol']},
indent: {title: 'Indent', tags: ['blockquote']},
bold: {
title: 'Bold',
shortcut: 'b',
tags: ['b', 'strong'],
css: {'font-weight': 'bold'}
},

italic: {
title: 'Italic',
shortcut: 'i',
tags: ['i', 'em'],
css: {'font-style': 'italic'}
},

underline: {
title: 'Underline',
shortcut: 'u',
tags: ['u'],
css: {'text-decoration': 'underline'}
},

strikethrough: {
title: 'Strikethrough',
shortcut: 's',
tags: ['s', 'strike'],
css: {'text-decoration': 'line-through'}
},

insertunorderedlist: {
title: 'Unordered List',
tags: ['ul']
},

insertorderedlist: {
title: 'Ordered List',
tags: ['ol']
},

indent: {
title: 'Indent',
tags: ['blockquote']
},

outdent: {title: 'Outdent'},
undo: {title: 'Undo', shortcut: 'z'},
redo: {title: 'Redo', shortcut: 'y'},

undo: {
title: 'Undo',
shortcut: 'z'
},

redo: {
title: 'Redo',
shortcut: 'y'
},

unlink: {title: 'Remove Hyperlink'},

createlink: {
Expand Down

0 comments on commit 9507968

Please sign in to comment.