/*! Autosize v1.18.1 - 2013-11-05 Automatically adjust textarea height based on user input. (c) 2013 Jack Moore - http://www.jacklmoore.com/autosize license: http://www.opensource.org/licenses/mit-license.php */ (function(e){var t,o={className:"autosizejs",append:"",callback:!1,resizeDelay:10},i='"); editor = a.find('textarea'); editor.jqte({focus: function(){stopBlur=true;setTimeout(function(){stopBlur=false;},200);},blur: function(){setTimeout(function(){if(stopBlur)return;fieldSave(a.attr('id'),a.find('div.jqte_editor').html());},50)}}); $('div.jqte_tool').click(function(){ stopBlur = true; setTimeout(function(){stopBlur = false;},200); a.find('div.jqte_editor').focus(); }); a.find('div.jqte_editor').focus(); } else{ a.html(""); a.children(':first').focus().autosize().trigger('autosize.resize'); } changing = true; }); $('.toggle').click(function(){ $('.hide').toggle('200'); }); }); function nl2br(s){ return (s + '').replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1
$2'); } function fieldSave(key,val){ $.post('editText.php', {fieldname: key, content: val}).done(function(data){ if(key == 'themeSelect'){location.reload(true);} else if(val==''){$('#'+key).html($('#'+key).attr('title'));} else {$("#"+key).html(data);} changing = false; }); }