From c99817b1b70778de059823134b3c59f61fe1add9 Mon Sep 17 00:00:00 2001 From: Jay Salvat Date: Wed, 23 Feb 2011 21:53:31 +0100 Subject: [PATCH 01/60] Added jQuery 1.5 link --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 38fc339..af3834d 100644 --- a/index.html +++ b/index.html @@ -5,7 +5,7 @@ markItUp! Universal markup editor - + From 157249d6a73820367cc205046cfd871f00de8b3b Mon Sep 17 00:00:00 2001 From: Jay Salvat Date: Wed, 23 Feb 2011 21:53:44 +0100 Subject: [PATCH 02/60] Added quotes to jQuery attribute selectors --- markitup/jquery.markitup.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/markitup/jquery.markitup.js b/markitup/jquery.markitup.js index 8c69b78..15f21c3 100644 --- a/markitup/jquery.markitup.js +++ b/markitup/jquery.markitup.js @@ -506,7 +506,7 @@ if (e.type === 'keydown') { if (ctrlKey === true) { - li = $("a[accesskey="+String.fromCharCode(e.keyCode)+"]", header).parent('li'); + li = $('a[accesskey="'+String.fromCharCode(e.keyCode)+'"]', header).parent('li'); if (li.length !== 0) { ctrlKey = false; setTimeout(function() { From 93b517cdf6fe39553c69da692ad54d64960dc0e9 Mon Sep 17 00:00:00 2001 From: Jay Salvat Date: Wed, 23 Feb 2011 21:54:26 +0100 Subject: [PATCH 03/60] Modified Changelog --- CHANGELOG.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cbdcf88..041cc1d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ -markItUp! 1.1.9 +markItUp! 1.1.11 CHANGE LOG +markItUp! 1.1.11 xxxx-xx-xx +- Updated: jQuery 1.5 +- Added quotes to attribute selectors + markItUp! 1.1.10 2011-02-20 - Improved: Ajax property 'dataType' set to 'text' - Improved: Ajax property 'global' set to 'false' From f60743df4f806294496c38ef79a241b4f6cefbf3 Mon Sep 17 00:00:00 2001 From: Jay Salvat Date: Thu, 24 Mar 2011 10:52:57 +0100 Subject: [PATCH 04/60] Updated to jQuery 1.5.1 --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index af3834d..d10a801 100644 --- a/index.html +++ b/index.html @@ -5,7 +5,7 @@ markItUp! Universal markup editor - + From ce474f1c77e54ebb25998fa79f5b727176199165 Mon Sep 17 00:00:00 2001 From: Jay Salvat Date: Thu, 24 Mar 2011 10:53:13 +0100 Subject: [PATCH 05/60] Tried to fix the endless IE caret position bug --- CHANGELOG.md | 1 + markitup/jquery.markitup.js | 21 ++++++++++----------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 041cc1d..3f75a82 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ CHANGE LOG markItUp! 1.1.11 xxxx-xx-xx - Updated: jQuery 1.5 - Added quotes to attribute selectors +- Tried to fix the endless IE caret position bug markItUp! 1.1.10 2011-02-20 - Improved: Ajax property 'dataType' set to 'text' diff --git a/markitup/jquery.markitup.js b/markitup/jquery.markitup.js index 15f21c3..e0c7082 100644 --- a/markitup/jquery.markitup.js +++ b/markitup/jquery.markitup.js @@ -358,7 +358,7 @@ // Substract linefeed in IE function fixIeBug(string) { if ($.browser.msie) { - return string.length - string.replace(/\r/g, '').length; + return string.length - string.replace(/\r*/g, '').length; } return 0; } @@ -398,16 +398,15 @@ scrollPosition = textarea.scrollTop; if (document.selection) { - selection = document.selection; - if ($.browser.msie) { // ie - var range = selection.createRange(); - var stored_range = range.duplicate(); - stored_range.moveToElementText(textarea); - stored_range.setEndPoint('EndToEnd', range); - var s = stored_range.text.length - range.text.length; - - caretPosition = s - (textarea.value.substr(0, s).length - textarea.value.substr(0, s).replace(/\r/g, '').length); - selection = range.text; + selection = document.selection.createRange().text; + if ($.browser.msie) { // ie + var range = document.selection.createRange(), rangeCopy = range.duplicate(); + rangeCopy.moveToElementText(textarea); + caretPosition = -1; + while(rangeCopy.inRange(range)) { + rangeCopy.moveStart('character'); + caretPosition ++; + } } else { // opera caretPosition = textarea.selectionStart; } From 8f464f1665a7e31747f2ec67d7aa1d7c871dd772 Mon Sep 17 00:00:00 2001 From: Jay Salvat Date: Thu, 24 Mar 2011 10:57:27 +0100 Subject: [PATCH 06/60] Added metakey support for Mac users (michal-krause) --- CHANGELOG.md | 1 + markitup/jquery.markitup.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f75a82..9344953 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ markItUp! 1.1.11 xxxx-xx-xx - Updated: jQuery 1.5 - Added quotes to attribute selectors - Tried to fix the endless IE caret position bug +- Added metakey support for Mac users (michal-krause) markItUp! 1.1.10 2011-02-20 - Improved: Ajax property 'dataType' set to 'text' diff --git a/markitup/jquery.markitup.js b/markitup/jquery.markitup.js index e0c7082..b1b3365 100644 --- a/markitup/jquery.markitup.js +++ b/markitup/jquery.markitup.js @@ -501,7 +501,7 @@ function keyPressed(e) { shiftKey = e.shiftKey; altKey = e.altKey; - ctrlKey = (!(e.altKey && e.ctrlKey)) ? e.ctrlKey : false; + ctrlKey = (!(e.altKey && e.ctrlKey)) ? e.ctrlKey || e.metaKey : false; if (e.type === 'keydown') { if (ctrlKey === true) { From 318ee89a60a6ecf6b848c33b1307a7ba97855e30 Mon Sep 17 00:00:00 2001 From: Aleksandr Levchuk Date: Sat, 16 Apr 2011 18:04:13 -0700 Subject: [PATCH 07/60] Typo fix --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index d10a801..83d2a34 100644 --- a/index.html +++ b/index.html @@ -60,6 +60,6 @@

markItUp!

<p><strong>markItUp!</strong> is a JavaScript plugin built on the jQuery library. It allows you to turn any textarea into a markup editor. Html, Textile, Wiki Syntax, Markdown, BBcode or even your own markup system can be easily implemented.</p>

-

Support the projet : Donate | Contact

+

Support the project : Donate | Contact

From 0cd479b6f050112ee5daefa96ecf0ac173b99c4c Mon Sep 17 00:00:00 2001 From: Aleksandr Levchuk Date: Sun, 17 Apr 2011 00:18:03 -0700 Subject: [PATCH 08/60] Multiline support for code, quotations, and lists --- markitup/jquery.markitup.js | 29 +++++++++++++++--- markitup/sets/default/images/list-bullet.png | Bin 0 -> 344 bytes markitup/sets/default/images/list-numeric.png | Bin 0 -> 357 bytes markitup/sets/default/set.js | 5 ++- markitup/sets/default/style.css | 13 ++++++-- 5 files changed, 38 insertions(+), 9 deletions(-) create mode 100644 markitup/sets/default/images/list-bullet.png create mode 100644 markitup/sets/default/images/list-numeric.png diff --git a/markitup/jquery.markitup.js b/markitup/jquery.markitup.js index e0c7082..b877305 100644 --- a/markitup/jquery.markitup.js +++ b/markitup/jquery.markitup.js @@ -237,18 +237,37 @@ var placeHolder = prepare(clicked.placeHolder); var replaceWith = prepare(clicked.replaceWith); var closeWith = prepare(clicked.closeWith); + var multilineSupport = prepare(clicked.multilineSupport); + var openBlockWith = prepare(clicked.openBlockWith); + var closeBlockWith = prepare(clicked.closeBlockWith); + if (replaceWith !== "") { block = openWith + replaceWith + closeWith; } else if (selection === '' && placeHolder !== '') { block = openWith + placeHolder + closeWith; } else { - string = string || selection; - if (string.match(/ $/)) { - block = openWith + string.replace(/ $/, '') + closeWith + ' '; - } else { - block = openWith + string + closeWith; + string = string || selection; + + var lines = [string] + // Apply action to every line or on the whole block? + if (multilineSupport == 'true') + lines = string.replace(/\n+$/, '').split("\n") + + var blocks = []; + for (var l=0; l < lines.length; l++) { + line = lines[l]; + if (line.match(/ +$/)) { + blocks.push(openWith + line.replace(/ $/, '') + closeWith + ' '); + } else { + blocks.push(openWith + line + closeWith); + } } + + block = blocks.join("\n"); } + + block = openBlockWith + block + closeBlockWith; + return { block:block, openWith:openWith, replaceWith:replaceWith, diff --git a/markitup/sets/default/images/list-bullet.png b/markitup/sets/default/images/list-bullet.png new file mode 100644 index 0000000000000000000000000000000000000000..4a8672bde48f806d3d4d37db192588a9aa3eac10 GIT binary patch literal 344 zcmV-e0jK_nP)PbXFR5;6H z`2YVu10|S&DhA}te_Swi*Xsu$nk)lAnzx?+_#Z@r_~qs0*+Bfiq@?73K|#U)?Ck9S zsi~>|6A}{sM@B~e4-O9gPhA%bd?2RGd{of6>E(lvp1b6Ep>6&12TPB<{a?EDDL4@0 z;^ML+A|n0=1_u83^78uc?CkvC#>VEqiHXU7U0vP(YHDhzff&$ntDt1@;|H#l*M@2! z+U8#>h@W=vfpy*`^1J}j+`sMRe-I7g8yOj8Yin!&S5Z;VicFNp}SURRVGD{CSNFe~ni^^#wyl5uzj4je z|23%2?k#{x(*%mqe9M%mih+W%ElRQ}7!$^91> z7ymCLB=nz$hvz>#JNtiTW@gkt1Zf0eyP_){bPq%T_kY#2Z7&xs00000NkvXXu0mjf DNYA0= literal 0 HcmV?d00001 diff --git a/markitup/sets/default/set.js b/markitup/sets/default/set.js index f3e08ff..a11bfb7 100644 --- a/markitup/sets/default/set.js +++ b/markitup/sets/default/set.js @@ -18,10 +18,13 @@ mySettings = { {name:'Italic', key:'I', openWith:'(!(|!|)!)', closeWith:'(!(|!|)!)' }, {name:'Stroke through', key:'S', openWith:'', closeWith:'' }, {separator:'---------------' }, + {name:'Bulleted List', openWith:"
  • ", closeWith:'
  • ', multilineSupport:true, openBlockWith:"
      \n", closeBlockWith:"\n
    "}, + {name:'Numeric List', openWith:"
  • ", closeWith:'
  • ', multilineSupport:true, openBlockWith:"
      \n", closeBlockWith:"\n
    "}, + {separator:'---------------' }, {name:'Picture', key:'P', replaceWith:'[![Alternative text]!]' }, {name:'Link', key:'L', openWith:'', closeWith:'', placeHolder:'Your text to link...' }, {separator:'---------------' }, {name:'Clean', className:'clean', replaceWith:function(markitup) { return markitup.selection.replace(/<(.*?)>/g, "") } }, {name:'Preview', className:'preview', call:'preview'} ] -} \ No newline at end of file +} diff --git a/markitup/sets/default/style.css b/markitup/sets/default/style.css index 0794ab1..b1d20d6 100644 --- a/markitup/sets/default/style.css +++ b/markitup/sets/default/style.css @@ -13,15 +13,22 @@ } .markItUp .markItUpButton4 a { - background-image:url(images/picture.png); + background-image:url(images/list-bullet.png); } .markItUp .markItUpButton5 a { - background-image:url(images/link.png); + background-image:url(images/list-numeric.png); } .markItUp .markItUpButton6 a { + background-image:url(images/picture.png); +} +.markItUp .markItUpButton7 a { + background-image:url(images/link.png); +} + +.markItUp .markItUpButton8 a { background-image:url(images/clean.png); } .markItUp .preview a { background-image:url(images/preview.png); -} \ No newline at end of file +} From 5f0a5a02762966cc1fd1fd7796bf17e13b0ee28c Mon Sep 17 00:00:00 2001 From: Jay Salvat Date: Thu, 21 Apr 2011 16:12:10 +0200 Subject: [PATCH 09/60] Added the 'multiline:true' propertie support --- markitup/jquery.markitup.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/markitup/jquery.markitup.js b/markitup/jquery.markitup.js index b1b3365..3bd48c6 100644 --- a/markitup/jquery.markitup.js +++ b/markitup/jquery.markitup.js @@ -3,7 +3,7 @@ // v 1.1.x // Dual licensed under the MIT and GPL licenses. // ---------------------------------------------------------------------------- -// Copyright (C) 2007-2010 Jay Salvat +// Copyright (C) 2007-2011 Jay Salvat // http://markitup.jaysalvat.com/ // ---------------------------------------------------------------------------- // Permission is hereby granted, free of charge, to any person obtaining a copy @@ -276,12 +276,12 @@ // callbacks before insertion prepare(options.beforeInsert); prepare(clicked.beforeInsert); - if (ctrlKey === true && shiftKey === true) { + if ((ctrlKey === true && shiftKey === true) || button.multiline === true) { prepare(clicked.beforeMultiInsert); } $.extend(hash, { line:1 }); - if (ctrlKey === true && shiftKey === true) { + if ((ctrlKey === true && shiftKey === true) || button.multiline === true) { lines = selection.split(/\r?\n/); for (j = 0, n = lines.length, i = 0; i < n; i++) { if ($.trim(lines[i]) !== '') { From c4a8c6ef375c39fd010389eaf639bfef95848a88 Mon Sep 17 00:00:00 2001 From: Jay Salvat Date: Thu, 24 Mar 2011 10:57:27 +0100 Subject: [PATCH 10/60] Added metakey support for Mac users (michal-krause) --- CHANGELOG.md | 1 + markitup/jquery.markitup.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f75a82..9344953 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ markItUp! 1.1.11 xxxx-xx-xx - Updated: jQuery 1.5 - Added quotes to attribute selectors - Tried to fix the endless IE caret position bug +- Added metakey support for Mac users (michal-krause) markItUp! 1.1.10 2011-02-20 - Improved: Ajax property 'dataType' set to 'text' diff --git a/markitup/jquery.markitup.js b/markitup/jquery.markitup.js index b877305..6fd6059 100644 --- a/markitup/jquery.markitup.js +++ b/markitup/jquery.markitup.js @@ -520,7 +520,7 @@ function keyPressed(e) { shiftKey = e.shiftKey; altKey = e.altKey; - ctrlKey = (!(e.altKey && e.ctrlKey)) ? e.ctrlKey : false; + ctrlKey = (!(e.altKey && e.ctrlKey)) ? e.ctrlKey || e.metaKey : false; if (e.type === 'keydown') { if (ctrlKey === true) { From d19455e32a99b52c92e1a5780f8d2f5c622e588f Mon Sep 17 00:00:00 2001 From: Jay Salvat Date: Thu, 21 Apr 2011 16:12:10 +0200 Subject: [PATCH 11/60] Added the 'multiline:true' propertie support --- markitup/jquery.markitup.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/markitup/jquery.markitup.js b/markitup/jquery.markitup.js index 6fd6059..b096c11 100644 --- a/markitup/jquery.markitup.js +++ b/markitup/jquery.markitup.js @@ -3,7 +3,7 @@ // v 1.1.x // Dual licensed under the MIT and GPL licenses. // ---------------------------------------------------------------------------- -// Copyright (C) 2007-2010 Jay Salvat +// Copyright (C) 2007-2011 Jay Salvat // http://markitup.jaysalvat.com/ // ---------------------------------------------------------------------------- // Permission is hereby granted, free of charge, to any person obtaining a copy @@ -295,12 +295,12 @@ // callbacks before insertion prepare(options.beforeInsert); prepare(clicked.beforeInsert); - if (ctrlKey === true && shiftKey === true) { + if ((ctrlKey === true && shiftKey === true) || button.multiline === true) { prepare(clicked.beforeMultiInsert); } $.extend(hash, { line:1 }); - if (ctrlKey === true && shiftKey === true) { + if ((ctrlKey === true && shiftKey === true) || button.multiline === true) { lines = selection.split(/\r?\n/); for (j = 0, n = lines.length, i = 0; i < n; i++) { if ($.trim(lines[i]) !== '') { From 05163d6b83a5fcecb41c430032a5c10f6300dcd5 Mon Sep 17 00:00:00 2001 From: Jay Salvat Date: Mon, 25 Apr 2011 11:48:59 +0200 Subject: [PATCH 12/60] Switched mouseup to mousedown event to solve Ctrl key problem on Webkit --- markitup/jquery.markitup.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/markitup/jquery.markitup.js b/markitup/jquery.markitup.js index b096c11..787bc7e 100644 --- a/markitup/jquery.markitup.js +++ b/markitup/jquery.markitup.js @@ -164,7 +164,7 @@ return false; }).bind("focusin", function(){ $$.focus(); - }).mousedown(function() { + }).mouseup(function() { if (button.call) { eval(button.call)(); } @@ -281,7 +281,6 @@ var len, j, n, i; hash = clicked = button; get(); - $.extend(hash, { line:"", root:options.root, textarea:textarea, @@ -431,6 +430,7 @@ } } else { // gecko & webkit caretPosition = textarea.selectionStart; + selection = textarea.value.substring(caretPosition, textarea.selectionEnd); } return selection; @@ -520,7 +520,7 @@ function keyPressed(e) { shiftKey = e.shiftKey; altKey = e.altKey; - ctrlKey = (!(e.altKey && e.ctrlKey)) ? e.ctrlKey || e.metaKey : false; + ctrlKey = (!(e.altKey && e.ctrlKey)) ? (e.ctrlKey || e.metaKey) : false; if (e.type === 'keydown') { if (ctrlKey === true) { @@ -528,7 +528,7 @@ if (li.length !== 0) { ctrlKey = false; setTimeout(function() { - li.triggerHandler('mousedown'); + li.triggerHandler('mouseup'); },1); return false; } From 47e4225eb738c1018b61a995e57597e669067ccb Mon Sep 17 00:00:00 2001 From: Jay Salvat Date: Mon, 25 Apr 2011 14:29:42 +0200 Subject: [PATCH 13/60] Merge and tweak multiline support from alevchuk --- markitup/jquery.markitup.js | 26 ++++++++-------- markitup/sets/default/set.js | 60 ++++++++++++++++++------------------ 2 files changed, 43 insertions(+), 43 deletions(-) diff --git a/markitup/jquery.markitup.js b/markitup/jquery.markitup.js index 787bc7e..ee0d894 100644 --- a/markitup/jquery.markitup.js +++ b/markitup/jquery.markitup.js @@ -233,14 +233,14 @@ // build block to insert function build(string) { - var openWith = prepare(clicked.openWith); - var placeHolder = prepare(clicked.placeHolder); - var replaceWith = prepare(clicked.replaceWith); - var closeWith = prepare(clicked.closeWith); - var multilineSupport = prepare(clicked.multilineSupport); - var openBlockWith = prepare(clicked.openBlockWith); - var closeBlockWith = prepare(clicked.closeBlockWith); - + var openWith = prepare(clicked.openWith); + var placeHolder = prepare(clicked.placeHolder); + var replaceWith = prepare(clicked.replaceWith); + var closeWith = prepare(clicked.closeWith); + var openBlockWith = prepare(clicked.openBlockWith); + var closeBlockWith = prepare(clicked.closeBlockWith); + var multiline = clicked.multiline; + if (replaceWith !== "") { block = openWith + replaceWith + closeWith; } else if (selection === '' && placeHolder !== '') { @@ -249,9 +249,9 @@ string = string || selection; var lines = [string] - // Apply action to every line or on the whole block? - if (multilineSupport == 'true') - lines = string.replace(/\n+$/, '').split("\n") + if (multiline == true) { + lines = string.replace(/\n+$/, '').split("\n") + } var blocks = []; for (var l=0; l < lines.length; l++) { @@ -299,7 +299,7 @@ } $.extend(hash, { line:1 }); - if ((ctrlKey === true && shiftKey === true) || button.multiline === true) { + if ((ctrlKey === true && shiftKey === true)) { lines = selection.split(/\r?\n/); for (j = 0, n = lines.length, i = 0; i < n; i++) { if ($.trim(lines[i]) !== '') { @@ -351,7 +351,7 @@ $.extend(hash, { line:'', selection:selection }); // callbacks after insertion - if (ctrlKey === true && shiftKey === true) { + if ((ctrlKey === true && shiftKey === true) || button.multiline === true) { prepare(clicked.afterMultiInsert); } prepare(clicked.afterInsert); diff --git a/markitup/sets/default/set.js b/markitup/sets/default/set.js index a11bfb7..b7fdf81 100644 --- a/markitup/sets/default/set.js +++ b/markitup/sets/default/set.js @@ -1,30 +1,30 @@ -// ---------------------------------------------------------------------------- -// markItUp! -// ---------------------------------------------------------------------------- -// Copyright (C) 2008 Jay Salvat -// http://markitup.jaysalvat.com/ -// ---------------------------------------------------------------------------- -// Html tags -// http://en.wikipedia.org/wiki/html -// ---------------------------------------------------------------------------- -// Basic set. Feel free to add more tags -// ---------------------------------------------------------------------------- -mySettings = { - onShiftEnter: {keepDefault:false, replaceWith:'
    \n'}, - onCtrlEnter: {keepDefault:false, openWith:'\n

    ', closeWith:'

    '}, - onTab: {keepDefault:false, replaceWith:' '}, - markupSet: [ - {name:'Bold', key:'B', openWith:'(!(|!|)!)', closeWith:'(!(|!|)!)' }, - {name:'Italic', key:'I', openWith:'(!(|!|)!)', closeWith:'(!(|!|)!)' }, - {name:'Stroke through', key:'S', openWith:'', closeWith:'' }, - {separator:'---------------' }, - {name:'Bulleted List', openWith:"
  • ", closeWith:'
  • ', multilineSupport:true, openBlockWith:"
      \n", closeBlockWith:"\n
    "}, - {name:'Numeric List', openWith:"
  • ", closeWith:'
  • ', multilineSupport:true, openBlockWith:"
      \n", closeBlockWith:"\n
    "}, - {separator:'---------------' }, - {name:'Picture', key:'P', replaceWith:'[![Alternative text]!]' }, - {name:'Link', key:'L', openWith:'', closeWith:'', placeHolder:'Your text to link...' }, - {separator:'---------------' }, - {name:'Clean', className:'clean', replaceWith:function(markitup) { return markitup.selection.replace(/<(.*?)>/g, "") } }, - {name:'Preview', className:'preview', call:'preview'} - ] -} +// ---------------------------------------------------------------------------- +// markItUp! +// ---------------------------------------------------------------------------- +// Copyright (C) 2011 Jay Salvat +// http://markitup.jaysalvat.com/ +// ---------------------------------------------------------------------------- +// Html tags +// http://en.wikipedia.org/wiki/html +// ---------------------------------------------------------------------------- +// Basic set. Feel free to add more tags +// ---------------------------------------------------------------------------- +var mySettings = { + onShiftEnter: {keepDefault:false, replaceWith:'
    \n'}, + onCtrlEnter: {keepDefault:false, openWith:'\n

    ', closeWith:'

    '}, + onTab: {keepDefault:false, replaceWith:' '}, + markupSet: [ + {name:'Bold', key:'B', openWith:'(!(|!|)!)', closeWith:'(!(|!|)!)' }, + {name:'Italic', key:'I', openWith:'(!(|!|)!)', closeWith:'(!(|!|)!)' }, + {name:'Stroke through', key:'S', openWith:'', closeWith:'' }, + {separator:'---------------' }, + {name:'Bulleted List', openWith:'
  • ', closeWith:'
  • ', multiline:true, openBlockWith:'
      \n', closeBlockWith:'\n
    '}, + {name:'Numeric List', openWith:'
  • ', closeWith:'
  • ', multiline:true, openBlockWith:'
      \n', closeBlockWith:'\n
    '}, + {separator:'---------------' }, + {name:'Picture', key:'P', replaceWith:'[![Alternative text]!]' }, + {name:'Link', key:'L', openWith:'', closeWith:'', placeHolder:'Your text to link...' }, + {separator:'---------------' }, + {name:'Clean', className:'clean', replaceWith:function(markitup) { return markitup.selection.replace(/<(.*?)>/g, "") } }, + {name:'Preview', className:'preview', call:'preview'} + ] +} From b8f02d4775b2be7bb18b4cda785bcfd9d17ec912 Mon Sep 17 00:00:00 2001 From: Jay Salvat Date: Mon, 25 Apr 2011 14:34:51 +0200 Subject: [PATCH 14/60] Fixed multiline with IE \r --- markitup/jquery.markitup.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/markitup/jquery.markitup.js b/markitup/jquery.markitup.js index ee0d894..a9fe021 100644 --- a/markitup/jquery.markitup.js +++ b/markitup/jquery.markitup.js @@ -249,9 +249,10 @@ string = string || selection; var lines = [string] - if (multiline == true) { - lines = string.replace(/\n+$/, '').split("\n") - } + // if (multiline == true) { + // lines = string.replace(/\n+$/, '').split("\n") + // } + lines = selection.split(/\r?\n/); var blocks = []; for (var l=0; l < lines.length; l++) { From c3c735084144e7869503d2233064b0cf6809fdd5 Mon Sep 17 00:00:00 2001 From: Jay Salvat Date: Mon, 25 Apr 2011 14:39:52 +0200 Subject: [PATCH 15/60] Excluded empty lines on multiline insertion --- markitup/jquery.markitup.js | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/markitup/jquery.markitup.js b/markitup/jquery.markitup.js index a9fe021..557647a 100644 --- a/markitup/jquery.markitup.js +++ b/markitup/jquery.markitup.js @@ -248,20 +248,17 @@ } else { string = string || selection; - var lines = [string] - // if (multiline == true) { - // lines = string.replace(/\n+$/, '').split("\n") - // } - lines = selection.split(/\r?\n/); - - var blocks = []; + var lines = selection.split(/\r?\n/), blocks = []; for (var l=0; l < lines.length; l++) { - line = lines[l]; - if (line.match(/ +$/)) { - blocks.push(openWith + line.replace(/ $/, '') + closeWith + ' '); - } else { - blocks.push(openWith + line + closeWith); - } + line = lines[l]; + if ($.trim(line) == '') { + continue; + } + if (line.match(/ +$/)) { + blocks.push(openWith + line.replace(/ $/, '') + closeWith + ' '); + } else { + blocks.push(openWith + line + closeWith); + } } block = blocks.join("\n"); From b889a32317f40e27f12dfccf2f958fa842a537fe Mon Sep 17 00:00:00 2001 From: Jay Salvat Date: Mon, 25 Apr 2011 15:06:08 +0200 Subject: [PATCH 16/60] Updated the demo with jQuery 1.5.2 --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 83d2a34..8041de7 100644 --- a/index.html +++ b/index.html @@ -5,7 +5,7 @@ markItUp! Universal markup editor - + From dc6e9695f4856d08ad5d7455dd569930a7d49b2a Mon Sep 17 00:00:00 2001 From: Jay Salvat Date: Mon, 25 Apr 2011 15:08:16 +0200 Subject: [PATCH 17/60] Updated the Changelog --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9344953..f483566 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,8 @@ markItUp! 1.1.11 CHANGE LOG markItUp! 1.1.11 xxxx-xx-xx -- Updated: jQuery 1.5 +- Added multiline support (alevchuk) +- Updated with jQuery 1.5.2 - Added quotes to attribute selectors - Tried to fix the endless IE caret position bug - Added metakey support for Mac users (michal-krause) From ed52a8910f69dfef49c8719b3a1797401d11a3cc Mon Sep 17 00:00:00 2001 From: Amroth Date: Mon, 18 Jul 2011 11:14:48 -0400 Subject: [PATCH 18/60] enable parsing the markup in javascript --- markitup/jquery.markitup.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/markitup/jquery.markitup.js b/markitup/jquery.markitup.js index 4e2357c..8628ea7 100644 --- a/markitup/jquery.markitup.js +++ b/markitup/jquery.markitup.js @@ -36,6 +36,7 @@ previewAutoRefresh: true, previewPosition: 'after', previewTemplatePath: '~/templates/preview.html', + previewParser: false, previewParserPath: '', previewParserVar: 'data', resizeHandle: true, @@ -474,7 +475,10 @@ function renderPreview() { var phtml; - if (options.previewParserPath !== '') { + if (options.previewParser && typeof options.previewParser === 'function') { + var data = options.previewParser( $$.val() ); + writeInPreview( localize(data, 1) ); + } else if (options.previewParserPath !== '') { $.ajax({ type: 'POST', dataType: 'text', From f614f3ea67ce584f458a37fb551a4f1ef954e4be Mon Sep 17 00:00:00 2001 From: Jay Salvat Date: Tue, 19 Jul 2011 12:07:46 +0200 Subject: [PATCH 19/60] Update to jQuery 1.6.2 --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 8041de7..5a3b037 100644 --- a/index.html +++ b/index.html @@ -5,7 +5,7 @@ markItUp! Universal markup editor - + From 636fe32ba1fa4295493f935f7f6faf0289c9b474 Mon Sep 17 00:00:00 2001 From: Jay Salvat Date: Tue, 19 Jul 2011 12:07:57 +0200 Subject: [PATCH 20/60] Update Changelog --- CHANGELOG.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f483566..fffe4d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,10 @@ markItUp! 1.1.11 CHANGE LOG -markItUp! 1.1.11 xxxx-xx-xx +markItUp! 1.1.11 2011-07-19 +- Enabled parsing the markup in javascript (amroth) - Added multiline support (alevchuk) -- Updated with jQuery 1.5.2 +- Updated with jQuery 1.6.2 - Added quotes to attribute selectors - Tried to fix the endless IE caret position bug - Added metakey support for Mac users (michal-krause) From ca688f909d4f7af3a51cfa7e21fd4d6341c358a0 Mon Sep 17 00:00:00 2001 From: Jay Salvat Date: Thu, 11 Aug 2011 14:23:50 +0200 Subject: [PATCH 21/60] Fix the bug where no tag were inserted on a empty selection --- markitup/jquery.markitup.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/markitup/jquery.markitup.js b/markitup/jquery.markitup.js index 8628ea7..b25f9d5 100644 --- a/markitup/jquery.markitup.js +++ b/markitup/jquery.markitup.js @@ -250,11 +250,9 @@ string = string || selection; var lines = selection.split(/\r?\n/), blocks = []; + for (var l=0; l < lines.length; l++) { line = lines[l]; - if ($.trim(line) == '') { - continue; - } if (line.match(/ +$/)) { blocks.push(openWith + line.replace(/ $/, '') + closeWith + ' '); } else { From f6041b8c78d4d993a12186cc6a819da29f72bd42 Mon Sep 17 00:00:00 2001 From: Jay Salvat Date: Thu, 11 Aug 2011 14:31:24 +0200 Subject: [PATCH 22/60] Better trailing space management on insertion --- markitup/jquery.markitup.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/markitup/jquery.markitup.js b/markitup/jquery.markitup.js index b25f9d5..10add9d 100644 --- a/markitup/jquery.markitup.js +++ b/markitup/jquery.markitup.js @@ -253,8 +253,9 @@ for (var l=0; l < lines.length; l++) { line = lines[l]; - if (line.match(/ +$/)) { - blocks.push(openWith + line.replace(/ $/, '') + closeWith + ' '); + var trailingSpaces; + if (trailingSpaces = line.match(/ *$/)) { + blocks.push(openWith + line.replace(/ *$/g, '') + closeWith + trailingSpaces); } else { blocks.push(openWith + line + closeWith); } From 979af07d31335bd58d6a3a50e26920bfa0b2e44c Mon Sep 17 00:00:00 2001 From: Jay Salvat Date: Thu, 11 Aug 2011 14:35:44 +0200 Subject: [PATCH 23/60] Updated Changelog --- CHANGELOG.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fffe4d2..556db9b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ -markItUp! 1.1.11 +markItUp! 1.1.12 CHANGE LOG +markItUp! 1.1.12 2011-08-11 +- Fixed the insertion on empty selection +- Enhanced the trailing space management + markItUp! 1.1.11 2011-07-19 - Enabled parsing the markup in javascript (amroth) - Added multiline support (alevchuk) From 328291e49a3c7e1fb76b3342f112734864836205 Mon Sep 17 00:00:00 2001 From: Jay Salvat Date: Tue, 16 Aug 2011 15:54:49 +0200 Subject: [PATCH 24/60] Multiline is fixed. --- markitup/jquery.markitup.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/markitup/jquery.markitup.js b/markitup/jquery.markitup.js index 10add9d..9f48bdd 100644 --- a/markitup/jquery.markitup.js +++ b/markitup/jquery.markitup.js @@ -249,9 +249,13 @@ } else { string = string || selection; - var lines = selection.split(/\r?\n/), blocks = []; + var lines = [string], blocks = []; - for (var l=0; l < lines.length; l++) { + if (multiline === true) { + lines = string.split(/\r?\n/); + } + + for (var l = 0; l < lines.length; l++) { line = lines[l]; var trailingSpaces; if (trailingSpaces = line.match(/ *$/)) { @@ -307,6 +311,7 @@ lines[i] = ""; } } + string = { block:lines.join('\n')}; start = caretPosition; len = string.block.length + (($.browser.opera) ? n-1 : 0); From f9d976895feb61aba3a5751fe4d8032d8d82b224 Mon Sep 17 00:00:00 2001 From: Joyce Babu Date: Tue, 29 May 2012 17:30:19 +0530 Subject: [PATCH 25/60] Updated events to use namespace --- markitup/jquery.markitup.js | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) mode change 100644 => 100755 markitup/jquery.markitup.js diff --git a/markitup/jquery.markitup.js b/markitup/jquery.markitup.js old mode 100644 new mode 100755 index 9f48bdd..788a2ed --- a/markitup/jquery.markitup.js +++ b/markitup/jquery.markitup.js @@ -109,26 +109,26 @@ if (options.resizeHandle === true && $.browser.safari !== true) { resizeHandle = $('
    ') .insertAfter($$) - .bind("mousedown", function(e) { + .bind("mousedown.markItUp", function(e) { var h = $$.height(), y = e.clientY, mouseMove, mouseUp; mouseMove = function(e) { $$.css("height", Math.max(20, e.clientY+h-y)+"px"); return false; }; mouseUp = function(e) { - $("html").unbind("mousemove", mouseMove).unbind("mouseup", mouseUp); + $("html").unbind("mousemove.markItUp", mouseMove).unbind("mouseup.markItUp", mouseUp); return false; }; - $("html").bind("mousemove", mouseMove).bind("mouseup", mouseUp); + $("html").bind("mousemove.markItUp", mouseMove).bind("mouseup.markItUp", mouseUp); }); footer.append(resizeHandle); } // listen key events - $$.keydown(keyPressed).keyup(keyPressed); + $$.bind('keydown.markItUp', keyPressed).bind('keyup', keyPressed); // bind an event to catch external calls - $$.bind("insertion", function(e, settings) { + $$.bind("insertion.markItUp", function(e, settings) { if (settings.target !== false) { get(); } @@ -138,7 +138,7 @@ }); // remember the last focus - $$.focus(function() { + $$.bind('focus.markItUp', function() { $.markItUp.focused = this; }); } @@ -159,28 +159,27 @@ t += levels[j]+"-"; } li = $('
  • '+(button.name||'')+'
  • ') - .bind("contextmenu", function() { // prevent contextmenu on mac and allow ctrl+click + .bind("contextmenu.markItUp", function() { // prevent contextmenu on mac and allow ctrl+click return false; - }).click(function() { + }).bind('click.markItUp', function() { return false; - }).bind("focusin", function(){ + }).bind("focusin.markItUp", function(){ $$.focus(); - }).mouseup(function() { + }).bind('mouseup', function() { if (button.call) { eval(button.call)(); } setTimeout(function() { markup(button) },1); return false; - }).hover(function() { + }).bind('mouseenter.markItUp', function() { $('> ul', this).show(); $(document).one('click', function() { // close dropmenu if click outside $('ul ul', header).hide(); } ); - }, function() { + }).bind('mouseleave.markItUp', function() { $('> ul', this).hide(); - } - ).appendTo(ul); + }).appendTo(ul); if (button.dropMenu) { levels.push(i); $(li).addClass('markItUpDropMenu').append(dropMenus(button.dropMenu)); @@ -577,7 +576,7 @@ $.fn.markItUpRemove = function() { return this.each(function() { - var $$ = $(this).unbind().removeClass('markItUpEditor'); + var $$ = $(this).unbind(".markItUp").removeClass('markItUpEditor'); $$.parent('div').parent('div.markItUp').parent('div').replaceWith($$); } ); From 995efcfcf304760688073bc081879ff727231089 Mon Sep 17 00:00:00 2001 From: "dr. Hannibal Lecter" Date: Tue, 19 Jun 2012 12:14:27 +0200 Subject: [PATCH 26/60] Added the previewHandler option to allow complete control over preview --- markitup/jquery.markitup.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/markitup/jquery.markitup.js b/markitup/jquery.markitup.js index 788a2ed..481525a 100755 --- a/markitup/jquery.markitup.js +++ b/markitup/jquery.markitup.js @@ -32,6 +32,7 @@ options = { id: '', nameSpace: '', root: '', + previewHandler: false, previewInWindow: '', // 'width=800, height=600, resizable=yes, scrollbars=yes' previewAutoRefresh: true, previewPosition: 'after', @@ -440,7 +441,9 @@ // open preview window function preview() { - if (!previewWindow || previewWindow.closed) { + if (typeof options.previewHandler === 'function') { + previewWindow = true; + } else if (!previewWindow || previewWindow.closed) { if (options.previewInWindow) { previewWindow = window.open('', 'preview', options.previewInWindow); $(window).unload(function() { @@ -476,9 +479,11 @@ renderPreview(); } - function renderPreview() { + function renderPreview() { var phtml; - if (options.previewParser && typeof options.previewParser === 'function') { + if (options.previewHandler && typeof options.previewHandler === 'function') { + options.previewHandler( $$.val() ); + } else if (options.previewParser && typeof options.previewParser === 'function') { var data = options.previewParser( $$.val() ); writeInPreview( localize(data, 1) ); } else if (options.previewParserPath !== '') { From cf8a47f37cd7231491b0f6b5bc733fd83eb80fa7 Mon Sep 17 00:00:00 2001 From: UltCombo Date: Fri, 3 Aug 2012 13:54:40 -0300 Subject: [PATCH 27/60] Fixed Ctrl+Enter syntax error Since the accesskey value was quoted in version 1.1.11, pressing Ctrl+Enter results in a syntax error due to the non-escaped line break in the middle of the string as shown currently in the latest stable release: http://markitup.jaysalvat.com/downloads/demo.php?id=releases/latest This fix works by manually escaping the line break character, allowing the script to insert a

    tag when Ctrl+Enter is pressed. --- markitup/jquery.markitup.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/markitup/jquery.markitup.js b/markitup/jquery.markitup.js index 481525a..0bdca8e 100755 --- a/markitup/jquery.markitup.js +++ b/markitup/jquery.markitup.js @@ -534,7 +534,7 @@ if (e.type === 'keydown') { if (ctrlKey === true) { - li = $('a[accesskey="'+String.fromCharCode(e.keyCode)+'"]', header).parent('li'); + li = $('a[accesskey="'+((e.keyCode == 13) ? '\\n' : String.fromCharCode(e.keyCode))+'"]', header).parent('li'); if (li.length !== 0) { ctrlKey = false; setTimeout(function() { From 6725d74db2404f2debedb4a63d896302107570d7 Mon Sep 17 00:00:00 2001 From: Jay Salvat Date: Thu, 30 Aug 2012 14:03:08 +0200 Subject: [PATCH 28/60] Change mode --- CHANGELOG.md | 0 README.md | 0 images/body.png | Bin images/jaysalvat.png | Bin images/markitup.png | Bin images/style.css | 0 index.html | 0 markitup/jquery.markitup.js | 0 markitup/sets/default/images/bold.png | Bin markitup/sets/default/images/clean.png | Bin markitup/sets/default/images/image.png | Bin markitup/sets/default/images/italic.png | Bin markitup/sets/default/images/link.png | Bin markitup/sets/default/images/list-bullet.png | Bin markitup/sets/default/images/list-numeric.png | Bin markitup/sets/default/images/picture.png | Bin markitup/sets/default/images/preview.png | Bin markitup/sets/default/images/stroke.png | Bin markitup/sets/default/set.js | 0 markitup/sets/default/style.css | 0 markitup/skins/markitup/images/bg-container.png | Bin markitup/skins/markitup/images/bg-editor-bbcode.png | Bin .../skins/markitup/images/bg-editor-dotclear.png | Bin markitup/skins/markitup/images/bg-editor-html.png | Bin markitup/skins/markitup/images/bg-editor-json.png | Bin .../skins/markitup/images/bg-editor-markdown.png | Bin .../skins/markitup/images/bg-editor-textile.png | Bin markitup/skins/markitup/images/bg-editor-wiki.png | Bin markitup/skins/markitup/images/bg-editor-xml.png | Bin markitup/skins/markitup/images/bg-editor.png | Bin markitup/skins/markitup/images/handle.png | Bin markitup/skins/markitup/images/menu.png | Bin markitup/skins/markitup/images/submenu.png | Bin markitup/skins/markitup/style.css | 0 markitup/skins/simple/images/handle.png | Bin markitup/skins/simple/images/menu.png | Bin markitup/skins/simple/images/submenu.png | Bin markitup/skins/simple/style.css | 0 markitup/templates/preview.css | 0 markitup/templates/preview.html | 0 40 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 CHANGELOG.md mode change 100644 => 100755 README.md mode change 100644 => 100755 images/body.png mode change 100644 => 100755 images/jaysalvat.png mode change 100644 => 100755 images/markitup.png mode change 100644 => 100755 images/style.css mode change 100644 => 100755 index.html mode change 100644 => 100755 markitup/jquery.markitup.js mode change 100644 => 100755 markitup/sets/default/images/bold.png mode change 100644 => 100755 markitup/sets/default/images/clean.png mode change 100644 => 100755 markitup/sets/default/images/image.png mode change 100644 => 100755 markitup/sets/default/images/italic.png mode change 100644 => 100755 markitup/sets/default/images/link.png mode change 100644 => 100755 markitup/sets/default/images/list-bullet.png mode change 100644 => 100755 markitup/sets/default/images/list-numeric.png mode change 100644 => 100755 markitup/sets/default/images/picture.png mode change 100644 => 100755 markitup/sets/default/images/preview.png mode change 100644 => 100755 markitup/sets/default/images/stroke.png mode change 100644 => 100755 markitup/sets/default/set.js mode change 100644 => 100755 markitup/sets/default/style.css mode change 100644 => 100755 markitup/skins/markitup/images/bg-container.png mode change 100644 => 100755 markitup/skins/markitup/images/bg-editor-bbcode.png mode change 100644 => 100755 markitup/skins/markitup/images/bg-editor-dotclear.png mode change 100644 => 100755 markitup/skins/markitup/images/bg-editor-html.png mode change 100644 => 100755 markitup/skins/markitup/images/bg-editor-json.png mode change 100644 => 100755 markitup/skins/markitup/images/bg-editor-markdown.png mode change 100644 => 100755 markitup/skins/markitup/images/bg-editor-textile.png mode change 100644 => 100755 markitup/skins/markitup/images/bg-editor-wiki.png mode change 100644 => 100755 markitup/skins/markitup/images/bg-editor-xml.png mode change 100644 => 100755 markitup/skins/markitup/images/bg-editor.png mode change 100644 => 100755 markitup/skins/markitup/images/handle.png mode change 100644 => 100755 markitup/skins/markitup/images/menu.png mode change 100644 => 100755 markitup/skins/markitup/images/submenu.png mode change 100644 => 100755 markitup/skins/markitup/style.css mode change 100644 => 100755 markitup/skins/simple/images/handle.png mode change 100644 => 100755 markitup/skins/simple/images/menu.png mode change 100644 => 100755 markitup/skins/simple/images/submenu.png mode change 100644 => 100755 markitup/skins/simple/style.css mode change 100644 => 100755 markitup/templates/preview.css mode change 100644 => 100755 markitup/templates/preview.html diff --git a/CHANGELOG.md b/CHANGELOG.md old mode 100644 new mode 100755 diff --git a/README.md b/README.md old mode 100644 new mode 100755 diff --git a/images/body.png b/images/body.png old mode 100644 new mode 100755 diff --git a/images/jaysalvat.png b/images/jaysalvat.png old mode 100644 new mode 100755 diff --git a/images/markitup.png b/images/markitup.png old mode 100644 new mode 100755 diff --git a/images/style.css b/images/style.css old mode 100644 new mode 100755 diff --git a/index.html b/index.html old mode 100644 new mode 100755 diff --git a/markitup/jquery.markitup.js b/markitup/jquery.markitup.js old mode 100644 new mode 100755 diff --git a/markitup/sets/default/images/bold.png b/markitup/sets/default/images/bold.png old mode 100644 new mode 100755 diff --git a/markitup/sets/default/images/clean.png b/markitup/sets/default/images/clean.png old mode 100644 new mode 100755 diff --git a/markitup/sets/default/images/image.png b/markitup/sets/default/images/image.png old mode 100644 new mode 100755 diff --git a/markitup/sets/default/images/italic.png b/markitup/sets/default/images/italic.png old mode 100644 new mode 100755 diff --git a/markitup/sets/default/images/link.png b/markitup/sets/default/images/link.png old mode 100644 new mode 100755 diff --git a/markitup/sets/default/images/list-bullet.png b/markitup/sets/default/images/list-bullet.png old mode 100644 new mode 100755 diff --git a/markitup/sets/default/images/list-numeric.png b/markitup/sets/default/images/list-numeric.png old mode 100644 new mode 100755 diff --git a/markitup/sets/default/images/picture.png b/markitup/sets/default/images/picture.png old mode 100644 new mode 100755 diff --git a/markitup/sets/default/images/preview.png b/markitup/sets/default/images/preview.png old mode 100644 new mode 100755 diff --git a/markitup/sets/default/images/stroke.png b/markitup/sets/default/images/stroke.png old mode 100644 new mode 100755 diff --git a/markitup/sets/default/set.js b/markitup/sets/default/set.js old mode 100644 new mode 100755 diff --git a/markitup/sets/default/style.css b/markitup/sets/default/style.css old mode 100644 new mode 100755 diff --git a/markitup/skins/markitup/images/bg-container.png b/markitup/skins/markitup/images/bg-container.png old mode 100644 new mode 100755 diff --git a/markitup/skins/markitup/images/bg-editor-bbcode.png b/markitup/skins/markitup/images/bg-editor-bbcode.png old mode 100644 new mode 100755 diff --git a/markitup/skins/markitup/images/bg-editor-dotclear.png b/markitup/skins/markitup/images/bg-editor-dotclear.png old mode 100644 new mode 100755 diff --git a/markitup/skins/markitup/images/bg-editor-html.png b/markitup/skins/markitup/images/bg-editor-html.png old mode 100644 new mode 100755 diff --git a/markitup/skins/markitup/images/bg-editor-json.png b/markitup/skins/markitup/images/bg-editor-json.png old mode 100644 new mode 100755 diff --git a/markitup/skins/markitup/images/bg-editor-markdown.png b/markitup/skins/markitup/images/bg-editor-markdown.png old mode 100644 new mode 100755 diff --git a/markitup/skins/markitup/images/bg-editor-textile.png b/markitup/skins/markitup/images/bg-editor-textile.png old mode 100644 new mode 100755 diff --git a/markitup/skins/markitup/images/bg-editor-wiki.png b/markitup/skins/markitup/images/bg-editor-wiki.png old mode 100644 new mode 100755 diff --git a/markitup/skins/markitup/images/bg-editor-xml.png b/markitup/skins/markitup/images/bg-editor-xml.png old mode 100644 new mode 100755 diff --git a/markitup/skins/markitup/images/bg-editor.png b/markitup/skins/markitup/images/bg-editor.png old mode 100644 new mode 100755 diff --git a/markitup/skins/markitup/images/handle.png b/markitup/skins/markitup/images/handle.png old mode 100644 new mode 100755 diff --git a/markitup/skins/markitup/images/menu.png b/markitup/skins/markitup/images/menu.png old mode 100644 new mode 100755 diff --git a/markitup/skins/markitup/images/submenu.png b/markitup/skins/markitup/images/submenu.png old mode 100644 new mode 100755 diff --git a/markitup/skins/markitup/style.css b/markitup/skins/markitup/style.css old mode 100644 new mode 100755 diff --git a/markitup/skins/simple/images/handle.png b/markitup/skins/simple/images/handle.png old mode 100644 new mode 100755 diff --git a/markitup/skins/simple/images/menu.png b/markitup/skins/simple/images/menu.png old mode 100644 new mode 100755 diff --git a/markitup/skins/simple/images/submenu.png b/markitup/skins/simple/images/submenu.png old mode 100644 new mode 100755 diff --git a/markitup/skins/simple/style.css b/markitup/skins/simple/style.css old mode 100644 new mode 100755 diff --git a/markitup/templates/preview.css b/markitup/templates/preview.css old mode 100644 new mode 100755 diff --git a/markitup/templates/preview.html b/markitup/templates/preview.html old mode 100644 new mode 100755 From 9f2a51a1181e0409e62e2613c90e785021e54f9e Mon Sep 17 00:00:00 2001 From: Jay Salvat Date: Thu, 30 Aug 2012 14:17:21 +0200 Subject: [PATCH 29/60] Add package.json --- package.json | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 package.json diff --git a/package.json b/package.json new file mode 100644 index 0000000..c14a5a1 --- /dev/null +++ b/package.json @@ -0,0 +1,27 @@ +{ + "name": "markItUp! ", + "title": "markItUp! universal markup jQuery editor", + "description": "markItUp! is a JavaScript plugin built on the jQuery library. It allows you to turn any textarea into a markup editor. Html, Textile, Wiki Syntax, Markdown, BBcode or even your own Markup system can be easily implemented.", + "version": "1.1", + "homepage": "http://markitup.jaysalvat.com/", + "author": { + "name": "Jay Salvat", + "email": "", + "url": "http://jaysalvat.com" + }, + "repository": { + "type": "git", + "url": "https://github.com/markitup/1.x" + }, + "licenses": [ + { + "type": "MIT", + "url": "http://www.opensource.org/licenses/MIT" + }, + { + "type": "GPL", + "url": "http://www.opensource.org/licenses/GPL-2.0" + } + ], + "keywords": [ "jquery", "markup", "editor", "markdown", "wiki", "bbcode", "html", "textile" ] +} \ No newline at end of file From a439ef9da6d2b05a24507aad5492d07b43b25a67 Mon Sep 17 00:00:00 2001 From: Jay Salvat Date: Thu, 30 Aug 2012 14:29:41 +0200 Subject: [PATCH 30/60] Add jQuery 1.8 to the demo --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 5a3b037..94b8b0f 100755 --- a/index.html +++ b/index.html @@ -5,7 +5,7 @@ markItUp! Universal markup editor - + From 179289e8b10c9b1e691a41621b86674e5c304d96 Mon Sep 17 00:00:00 2001 From: Jay Salvat Date: Thu, 30 Aug 2012 14:35:45 +0200 Subject: [PATCH 31/60] Rewrite the demo page HTML5 oriented --- index.html | 59 +++++++++++++++++++++++++++--------------------------- 1 file changed, 29 insertions(+), 30 deletions(-) diff --git a/index.html b/index.html index 94b8b0f..91b7c3e 100755 --- a/index.html +++ b/index.html @@ -1,24 +1,36 @@ - - + + - -markItUp! Universal markup editor - - - - - - - - - - - + + markItUp! Universal markup editor + + + + + + + + + + + +

    markItUp!

    +

    By Jay Salvat

    +

    Downloads, examples and documentation at http://markitup.jaysalvat.com.

    +

    Click this link to insert content from anywhere in the page or this one to remove markItUp!

    +

    + +

    +

    Support the project : Donate | Contact

    + -

    markItUp!

    -

    By Jay Salvat

    -

    Downloads, examples and documentation at http://markitup.jaysalvat.com.

    -

    Click this link to insert content from anywhere in the page or this one to remove markItUp!

    -

    - -

    -

    Support the project : Donate | Contact

    From 2a18bb61b951fa0f27834fd895f34b5d10d2825a Mon Sep 17 00:00:00 2001 From: Jay Salvat Date: Thu, 30 Aug 2012 14:37:51 +0200 Subject: [PATCH 32/60] Change comment date --- markitup/jquery.markitup.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/markitup/jquery.markitup.js b/markitup/jquery.markitup.js index 0bdca8e..848ea46 100755 --- a/markitup/jquery.markitup.js +++ b/markitup/jquery.markitup.js @@ -3,7 +3,7 @@ // v 1.1.x // Dual licensed under the MIT and GPL licenses. // ---------------------------------------------------------------------------- -// Copyright (C) 2007-2011 Jay Salvat +// Copyright (C) 2007-2012 Jay Salvat // http://markitup.jaysalvat.com/ // ---------------------------------------------------------------------------- // Permission is hereby granted, free of charge, to any person obtaining a copy From 8caad82647ed08313a509f99299d7927ea45aa32 Mon Sep 17 00:00:00 2001 From: Jay Salvat Date: Thu, 30 Aug 2012 14:47:02 +0200 Subject: [PATCH 33/60] Added some line to Changelog.md --- CHANGELOG.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 556db9b..a4ff88f 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,13 @@ -markItUp! 1.1.12 +markItUp! 1.1.13 CHANGE LOG +markItUp! 1.1.12 2012-08-30 +- Fixed Ctrl+Enter syntax error (UltCombo) +- Added the previewHandler option to allow complete control over preview (lecterror) +- Updated events to use namespace (JoyceBabu) +- Added package.json +- Updated jQuery version to 1.8 in the demo + markItUp! 1.1.12 2011-08-11 - Fixed the insertion on empty selection - Enhanced the trailing space management From 78008958108959677d38f4612a85cc2f6896df86 Mon Sep 17 00:00:00 2001 From: Jay Salvat Date: Thu, 30 Aug 2012 15:19:47 +0200 Subject: [PATCH 34/60] Added ability to render preview in a DOM element --- CHANGELOG.md | 1 + markitup/jquery.markitup.js | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a4ff88f..493feff 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ markItUp! 1.1.13 CHANGE LOG markItUp! 1.1.12 2012-08-30 +- Added ability to render preview in a DOM element (ytjohn & jaysalvat) - Fixed Ctrl+Enter syntax error (UltCombo) - Added the previewHandler option to allow complete control over preview (lecterror) - Updated events to use namespace (JoyceBabu) diff --git a/markitup/jquery.markitup.js b/markitup/jquery.markitup.js index 848ea46..16061ab 100755 --- a/markitup/jquery.markitup.js +++ b/markitup/jquery.markitup.js @@ -34,6 +34,7 @@ root: '', previewHandler: false, previewInWindow: '', // 'width=800, height=600, resizable=yes, scrollbars=yes' + previewInElement: '', previewAutoRefresh: true, previewPosition: 'after', previewTemplatePath: '~/templates/preview.html', @@ -142,6 +143,10 @@ $$.bind('focus.markItUp', function() { $.markItUp.focused = this; }); + + if (options.previewInElement) { + refreshPreview(); + } } // recursively build header with dropMenus from markupset @@ -443,6 +448,8 @@ function preview() { if (typeof options.previewHandler === 'function') { previewWindow = true; + } else if (options.previewInElement) { + previewWindow = $(options.previewInElement); } else if (!previewWindow || previewWindow.closed) { if (options.previewInWindow) { previewWindow = window.open('', 'preview', options.previewInWindow); @@ -485,7 +492,7 @@ options.previewHandler( $$.val() ); } else if (options.previewParser && typeof options.previewParser === 'function') { var data = options.previewParser( $$.val() ); - writeInPreview( localize(data, 1) ); + writeInPreview(localize(data, 1) ); } else if (options.previewParserPath !== '') { $.ajax({ type: 'POST', @@ -513,7 +520,9 @@ } function writeInPreview(data) { - if (previewWindow.document) { + if (options.previewInElement) { + $(options.previewInElement).html(data); + } else if (previewWindow.document) { try { sp = previewWindow.document.documentElement.scrollTop } catch(e) { From 1a209ed1136b2d364fe66acdc1837ef4bea87a24 Mon Sep 17 00:00:00 2001 From: Jay Salvat Date: Thu, 30 Aug 2012 15:20:00 +0200 Subject: [PATCH 35/60] Minor HTML changes --- index.html | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/index.html b/index.html index 91b7c3e..91f7d9f 100755 --- a/index.html +++ b/index.html @@ -20,17 +20,15 @@

    markItUp!

    By Jay Salvat

    Downloads, examples and documentation at http://markitup.jaysalvat.com.

    Click this link to insert content from anywhere in the page or this one to remove markItUp!

    -

    -

    Support the project : Donate | Contact