http://zentaoms.googlecode.com/svn/trunk/module/bug/view/buildtemplates.html.php@1059
Index: buildtemplates.html.php =================================================================== --- buildtemplates.html.php (revision 1058) +++ buildtemplates.html.php (revision 1059) @@ -1,13 +1,37 @@ <style> .button-c {padding:1px} +.ke-icon-savetemplate { + background-image: url(theme/default/images/kindeditor/save.gif); + background-position: center; + width: 56px; + height: 20px; +} </style> <script language='Javascript'> +var setTemplateTitle = '<?php echo $lang->bug->setTemplateTitle;?>'; + +/* 保存模板。*/ +KE.lang.savetemplate = '<?php echo $lang->bug->saveTemplate;?>'; +KE.plugin.savetemplate = { + click: function(id) { + content = KE.html('steps'); + jPrompt(setTemplateTitle, '','', function(r) + { + if(!r || !content) return; + saveTemplateLink = createLink('bug', 'saveTemplate'); + $.post(saveTemplateLink, {title:r, content:content}, function(data) + { + $('#tplBox').html(data); + }); + }); + } +} /* 设置bug模板。*/ function setTemplate(templateID) { $('#tplTitleBox' + templateID).attr('style', 'text-decoration:underline; color:#8B008B'); steps = $('#template' + templateID).text(); - $("#steps").val(steps); + KE.html('steps', steps); } /* 删除bug模板。*/