From c089fc57539e6e7bf4ea26e5fa8fa8762d0d3643 Mon Sep 17 00:00:00 2001 From: Wes Cossick Date: Tue, 14 Jul 2015 00:40:36 -0500 Subject: [PATCH] Title attributes added to toolbar buttons --- source files/simplemde.js | 45 ++++++++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 17 deletions(-) diff --git a/source files/simplemde.js b/source files/simplemde.js index e042c67..645f0f6 100644 --- a/source files/simplemde.js +++ b/source files/simplemde.js @@ -40,6 +40,9 @@ function createIcon(name, options) { el.title = el.title.replace('Alt', '⌥'); } } + + if(options.title) + el.title = options.title; el.className = options.className || 'icon-' + name; return el; @@ -393,46 +396,54 @@ function wordCount(data) { var toolbar = [{ name: 'bold', action: toggleBold, - className: "fa fa-bold" - }, { + className: "fa fa-bold", + title: "Bold", + }, + { name: 'italic', action: toggleItalic, - className: "fa fa-italic" + className: "fa fa-italic", + title: "Italic", }, '|', - { name: 'quote', action: toggleBlockquote, - className: "fa fa-quote-left" - }, { + className: "fa fa-quote-left", + title: "Quote", + }, + { name: 'unordered-list', action: toggleUnOrderedList, - className: "fa fa-list-ul" - }, { + className: "fa fa-list-ul", + title: "Generic List", + }, + { name: 'ordered-list', action: toggleOrderedList, - className: "fa fa-list-ol" + className: "fa fa-list-ol", + title: "Numbered List", }, '|', - { name: 'link', action: drawLink, - className: "fa fa-link" - }, { + className: "fa fa-link", + title: "Create Link", + }, + { name: 'image', action: drawImage, - className: "fa fa-picture-o" + className: "fa fa-picture-o", + title: "Insert Image", }, '|', - { name: 'preview', action: togglePreview, - className: "fa fa-eye" - }, -]; + className: "fa fa-eye", + title: "Toggle Preview", + }]; /** * Interface of SimpleMDE.