/* Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ (function(){CKEDITOR.plugins.add('enterkey',{requires:['keystrokes','indent'],init:function(h){var i=h.specialKeys;i[13]=d;i[CKEDITOR.SHIFT+13]=c;}});var a,b=/^h[1-6]$/;function c(h){a=1;return d(h,h.config.shiftEnterMode);};function d(h,i){if(h.mode!='wysiwyg')return false;if(!i)i=h.config.enterMode;setTimeout(function(){h.fire('saveSnapshot');if(i==CKEDITOR.ENTER_BR||h.getSelection().getStartElement().hasAscendant('pre',true))f(h,i);else e(h,i);a=0;},0);return true;};function e(h,i,j){j=j||g(h);var k=j.document,l=i==CKEDITOR.ENTER_DIV?'div':'p',m=j.splitBlock(l);if(!m)return;var n=m.previousBlock,o=m.nextBlock,p=m.wasStartOfBlock,q=m.wasEndOfBlock,r;if(o){r=o.getParent();if(r.is('li')){o.breakParent(r);o.move(o.getNext(),true);}}else if(n&&(r=n.getParent())&&(r.is('li'))){n.breakParent(r);j.moveToElementEditStart(n.getNext());n.move(n.getPrevious());}if(!p&&!q){if(o.is('li')&&(r=o.getFirst())&&(r.is&&r.is('ul','ol')))o.insertBefore(k.createText('\xa0'),r);if(o)j.moveToElementEditStart(o);}else{if(p&&q&&n.is('li')){h.execCommand('outdent');return;}var s;if(n){if(!a&&!b.test(n.getName()))s=n.clone();}else if(o)s=o.clone();if(!s)s=k.createElement(l);var t=m.elementPath;if(t)for(var u=0,v=t.elements.length;u0;j--)i[j].deleteContents();return i[0];};})();