diff --git a/module/bug/view/buildtemplates.html.php b/module/bug/view/buildtemplates.html.php index ec310597b4..bc721a113c 100644 --- a/module/bug/view/buildtemplates.html.php +++ b/module/bug/view/buildtemplates.html.php @@ -10,22 +10,6 @@ function setTemplate(templateID) $("#steps").val(steps); } -/* 保存bug模板。*/ -function saveTemplate() -{ - content = $("#steps").val(); - jPrompt(setTemplateTitle, '','', function(r) - { - if(!r || !content) return; - saveTemplateLink = createLink('bug', 'saveTemplate'); - steps = $("#steps").val(); - $.post(saveTemplateLink, {title:r, content:content}, function(data) - { - $('#tplBox').html(data); - }); - }); -} - /* 删除bug模板。*/ function deleteTemplate(templateID) { @@ -33,16 +17,13 @@ function deleteTemplate(templateID) hiddenwin.location.href = createLink('bug', 'deleteTemplate', 'templateID=' + templateID); $('#tplBox' + templateID).addClass('hidden'); } - -var setTemplateTitle = 'bug->setTemplateTitle;?>'; $template) { echo ""; - echo ($key + 1) . ". $template->title"; + echo $lang->arrow. "$template->title"; echo html::commonButton('x', "onclick=deleteTemplate($template->id)"); echo ""; echo '
'; } -echo html::commonButton($lang->save, 'onclick=saveTemplate()'); diff --git a/module/bug/view/create.html.php b/module/bug/view/create.html.php index 30bd425f41..5b5cbbc8d6 100644 --- a/module/bug/view/create.html.php +++ b/module/bug/view/create.html.php @@ -25,6 +25,7 @@ + + + + diff --git a/www/js/jquery/xheditor/xheditor-en.min.js b/www/js/jquery/xheditor/xheditor-en.min.js new file mode 100644 index 0000000000..010536cbcc --- /dev/null +++ b/www/js/jquery/xheditor/xheditor-en.min.js @@ -0,0 +1,93 @@ +(function(e){if(e.xheditor)return false;e.fn.xheditor=function(C){var F=[];this.each(function(){if(e.nodeName(this,"TEXTAREA"))if(C===false){if(this.xheditor){this.xheditor.remove();this.xheditor=null}}else if(!this.xheditor){var G=/({.*})/.exec(e(this).attr("class"));if(G){try{G=eval("("+G[1]+")")}catch(Q){}C=e.extend({},G,C)}G=new e.xheditor(this,C);if(G.init()){this.xheditor=G;F.push(G)}}});if(F.length==0)F=false;if(F.length==1)F=F[0];return F};var Y=0,wa=e.browser.version,D=e.browser.msie,oa= +e.browser.mozilla,Z=e.browser.safari,Xa=e.browser.opera,T=false,pa=true,L,ea,fa,ga,xa,U;e("script[src*=xheditor]").each(function(){var C=this.src;if(C.match(/xheditor[^\/]*\.js/i)){U=C.replace(/[\?#].*$/,"").replace(/(^|[\/\\])[^\/]*$/,"$1");return false}});var Ya={27:"esc",9:"tab",32:"space",13:"enter",8:"backspace",145:"scroll",20:"capslock",144:"numlock",19:"pause",45:"insert",36:"home",46:"del",35:"end",33:"pageup",34:"pagedown",37:"left",38:"up",39:"right",40:"down",112:"f1",113:"f2",114:"f3", +115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12"},Za=["#FFFFFF","#CCCCCC","#C0C0C0","#999999","#666666","#333333","#000000","#FFCCCC","#FF6666","#FF0000","#CC0000","#990000","#660000","#330000","#FFCC99","#FF9966","#FF9900","#FF6600","#CC6600","#993300","#663300","#FFFF99","#FFFF66","#FFCC66","#FFCC33","#CC9933","#996633","#663333","#FFFFCC","#FFFF33","#FFFF00","#FFCC00","#999900","#666600","#333300","#99FF99","#66FF99","#33FF33","#33CC00","#009900","#006600","#003300", +"#99FFFF","#33FFFF","#66CCCC","#00CCCC","#339999","#336666","#003333","#CCFFFF","#66FFFF","#33CCFF","#3366FF","#3333FF","#000099","#000066","#CCCCFF","#9999FF","#6666CC","#6633FF","#6600CC","#333399","#330099","#FFCCFF","#FF99FF","#CC66CC","#CC33CC","#993399","#663366","#330033"],$a=[{n:"p",t:"Paragraph"},{n:"h1",t:"Heading 1"},{n:"h2",t:"Heading 2"},{n:"h3",t:"Heading 3"},{n:"h4",t:"Heading 4"},{n:"h5",t:"Heading 5"},{n:"h6",t:"Heading 6"},{n:"pre",t:"Preformatted"},{n:"address",t:"Address"}],ab= +[{n:"Arial"},{n:"Arial Narrow"},{n:"Arial Black"},{n:"Comic Sans MS"},{n:"Courier New"},{n:"System"},{n:"Times New Roman"},{n:"Tahoma"},{n:"Verdana"}],N=[{n:"xx-small",wkn:"x-small",s:"8pt",t:"xx-small"},{n:"x-small",wkn:"small",s:"10pt",t:"x-small"},{n:"small",wkn:"medium",s:"12pt",t:"small"},{n:"medium",wkn:"large",s:"14pt",t:"medium"},{n:"large",wkn:"x-large",s:"18pt",t:"large"},{n:"x-large",wkn:"xx-large",s:"24pt",t:"x-large"},{n:"xx-large",wkn:"-webkit-xxx-large",s:"36pt",t:"xx-large"}],bb=[{s:"Align left", +v:"justifyleft",t:"Align left"},{s:"Align center",v:"justifycenter",t:"Align center"},{s:"Align right",v:"justifyright",t:"Align right"},{s:"Align full",v:"justifyfull",t:"Align full"}],cb=[{s:"Ordered list",v:"insertOrderedList",t:"Ordered list"},{s:"Unordered list",v:"insertUnorderedList",t:"Unordered list"}],db={"default":{name:"Default",width:24,height:24,line:7,list:{smile:"Smile",tongue:"Tongue",titter:"Titter",laugh:"Laugh",sad:"Sad",wronged:"Wronged",fastcry:"Fast cry",cry:"Cry",wail:"Wail", +mad:"Mad",knock:"Knock",curse:"Curse",crazy:"Crazy",angry:"Angry",ohmy:"Oh my",awkward:"Awkward",panic:"Panic",shy:"Shy",cute:"Cute",envy:"Envy",proud:"Proud",struggle:"Struggle",quiet:"Quiet",shutup:"Shut up",doubt:"Doubt",despise:"Despise",sleep:"Sleep",bye:"Bye"}}},ha={Cut:{t:"Cut (Ctrl+X)"},Copy:{t:"Copy (Ctrl+C)"},Paste:{t:"Paste (Ctrl+V)"},Pastetext:{t:"Paste as plain text",h:D?0:1},Blocktag:{t:"Block tag",h:1},Fontface:{t:"Font family",h:1},FontSize:{t:"Font size",h:1},Bold:{t:"Bold (Ctrl+B)", +s:"Ctrl+B"},Italic:{t:"Italic (Ctrl+I)",s:"Ctrl+I"},Underline:{t:"Underline (Ctrl+U)",s:"Ctrl+U"},Strikethrough:{t:"Strikethrough (Ctrl+S)",s:"Ctrl+S"},FontColor:{t:"Select text color",h:1},BackColor:{t:"Select background color",h:1},SelectAll:{t:"SelectAll (Ctrl+A)"},Removeformat:{t:"Remove formatting"},Align:{t:"Align",h:1},List:{t:"List",h:1},Outdent:{t:"Outdent (Shift+Tab)",s:"Shift+Tab"},Indent:{t:"Indent (Tab)",s:"Tab"},Link:{t:"Insert/edit link",h:1},Unlink:{t:"Unlink"},Img:{t:"Insert/edit image", +h:1},Flash:{t:"Insert/edit flash",h:1},Media:{t:"Insert/edit media",h:1},Emot:{t:"Emotions",s:"ctrl+e",h:1},Table:{t:"Insert a new table",h:1},Source:{t:"Edit source code"},Print:{t:"Print (Ctrl+P)",s:"Ctrl+P"},Fullscreen:{t:"Toggle fullscreen (Esc)",s:"Esc"},About:{t:"About xhEditor"}},ya={mini:"Bold,Italic,Underline,Strikethrough,Separator,Align,List,Separator,Link,Img,About",simple:"Blocktag,Fontface,FontSize,Bold,Italic,Underline,Strikethrough,FontColor,BackColor,Separator,Align,List,Outdent,Indent,Separator,Link,Img,Emot,About", +full:"Cut,Copy,Paste,Pastetext,Separator,Blocktag,Fontface,FontSize,Bold,Italic,Underline,Strikethrough,FontColor,BackColor,SelectAll,Removeformat,Separator,Align,List,Outdent,Indent,Separator,Link,Unlink,Img,Flash,Media,Emot,Table,Separator,Source,Print,Fullscreen,About"};ya.mfull=ya.full.replace(/Separator(,Align)/i,"BtnBr$1");e.xheditor=function(C,F){function G(){setTimeout(b.setSource,10)}function Q(){b.getSource()}function eb(){if(D&&!H){var a;a=xa[0].contentWindow.document.body;a.innerHTML= +"";a.createTextRange().execCommand("Paste");a=a.innerHTML;if(!a.match(/mso-|MsoNormal/i))return true;if(a.indexOf(" ")==0)a=a.substring(6);a=b.cleanHTML(a);a=b.formatXHTML(a);a=b.cleanWord(a);b.pasteHTML(a);return false}}function za(a){try{b._exec("styleWithCSS",a,true)}catch(c){try{b._exec("useCSS",!a,true)}catch(d){}}}function Aa(){if(Ba&&!H){za(false);try{b._exec("enableObjectResizing",true,true)}catch(a){}if(D)try{b._exec("BackgroundImageCache",true,true)}catch(c){}}}function fb(a){if(H|| +a.which!=13||a.shiftKey||a.ctrlKey||a.altKey)return true;a=b.getParent("p,h1,h2,h3,h4,h5,h6,pre,address,div,li");if(a.is("li"))return true;if(b.settings.forcePtag)a.length==0&&b._exec("formatblock","

");else{b.pasteHTML("
");return false}}function Ca(){if(!oa&&!Z){ia&&O.height("100%").css("height",O.outerHeight()-J.outerHeight());D&&J.hide().show()}}function gb(a){a=a.target;if(a.tagName.match(/(img|embed)/i)){var c=b.getSel(),d=b.getRng();d.selectNode(a);c.removeAllRanges();c.addRange(d)}} +function V(a,c,d){if(!c)return false;var g="_xhe_"+c;d&&a.attr(c,d).removeAttr(g).attr(g,d);return a.attr(g)||a.attr(c)}function Ia(){pa&&b.hidePanel()}function hb(a){if(H)return true;var c=a.which,d=Ya[c];c=d?d:String.fromCharCode(c).toLowerCase();sKey="";sKey+=a.ctrlKey?"ctrl+":"";sKey+=a.altKey?"alt+":"";sKey+=a.shiftKey?"shift+":"";sKey+=c;a=ja[sKey];var g;for(g in a){g=a[g];if(e.isFunction(g)){if(g.call(b)===false)return false}else{b.exec(g);return false}}}function $(a,c){var d=typeof a;if(!c)return d!= +"undefined";if(c=="array"&&a.hasOwnProperty&&a instanceof Array)return true;return d==c}function Da(a,c){var d=location.protocol,g=location.hostname,m=location.port,j=location.pathname.replace(/\\/g,"/").replace(/[^\/]+$/i,"");m=m==""?"80":m;a=e.trim(a);if(d=="file:")c="abs";if(c!="abs")a=a.replace(RegExp(d+"\\/\\/"+g.replace(/\./g,"\\.")+"(?::"+m+")"+(m=="80"?"?":"")+"(/|$)","i"),"/");if(c=="rel")a=a.replace(RegExp("^"+j.replace(/([\/\.\+\[\]\(\)])/g,"\\$1"),"i"),"");if(c!="rel")a.match(/^((https?|file):\/\/|\/)/i)|| +(a=j+a);if(c=="abs")a.match(/(https?|file):\/\//i)||(a=d+"//"+location.host+a);return a}function Ja(a){var c=Math.floor(Math.log(a)/Math.log(1024));return(a/Math.pow(1024,Math.floor(c))).toFixed(2)+["Byte","KB","MB","GB","TB","PB"][c]}function W(){return false}var b=this,P=e(C),Ka=P.closest("form"),J,O,R,qa,w,ra,aa,Ba=false,H=false,ia=false,La,ka=false,Ma="",M=null,Ea,la=false,Fa=false,ba=null,X=null,S=0;this.settings=e.extend({},{skin:"default",tools:"full",clickCancelDialog:true,linkTag:false,internalScript:false, +inlineScript:false,internalStyle:true,inlineStyle:true,showBlocktag:false,forcePtag:true,upLinkExt:"zip,rar,txt",upImgExt:"jpg,jpeg,gif,png",upFlashExt:"swf",upMediaExt:"wmv,avi,wma,mp3,mid",modalWidth:350,modalHeight:220,modalTitle:true,defLinkText:"Click to open link",layerShadow:3,emotMark:false,upBtnText:"Upload",wordDeepClean:true,hoverExecDelay:100,html5Upload:true,upMultiple:99},F);var sa=b.settings.plugins,ta=[];if(sa){ha=e.extend({},ha,sa);e.each(sa,function(a){ta.push(a)});ta=ta.join(",")}if(b.settings.tools.match(/^\s*(m?full|simple|mini)\s*$/i)){var Na= +ya[e.trim(b.settings.tools)];b.settings.tools=b.settings.tools.match(/m?full/i)&&sa?Na.replace("Table","Table,"+ta):Na}b.settings.tools.match(/(^|,)\s*About\s*(,|$)/i)||(b.settings.tools+=",About");b.settings.tools=b.settings.tools.split(",");U=Da(U,"abs");var Oa="xheCSS_"+b.settings.skin,ma="xhe"+Y+"_container",Pa="xhe"+Y+"_Tool",Qa="xhe"+Y+"_iframearea",Ra="xhe"+Y+"_iframe",ua="xhe"+Y+"_fixffcursor",ca="",Ga=U+"xheditor_skin/"+b.settings.skin+"/",va=db,Sa=Da(U,"rel")+"xheditor_emot/",Ha="";va=e.extend({}, +va,b.settings.emots);if(ka=b.settings.showBlocktag)ca+=" showBlocktag";var ja=[];this.init=function(){e("#"+Oa).length==0&&e("head").append('');var a=b.settings.width||C.style.width||P.outerWidth();S=b.settings.height||C.style.height||P.outerHeight();if($(S,"string"))S=S.replace(/[^\d]+/g,"");if(a<=0||S<=0){alert("Current textarea is hidden, please make it show before initialization xhEditor, or directly initialize the height."); +return false}if(/^[0-9\.]+$/i.test(""+a))a+="px";var c=[''],d,g,m=/Separator|BtnBr/i;e.each(b.settings.tools,function(i,f){d=ha[f];f.match(m)&&c.push('');if(f=="Separator")c.push('');else if(f=="BtnBr")c.push("
");else{g=d.c?d.c:"xheIcon xheBtn"+f;c.push('');d.s&& +b.addShortcuts(d.s,f)}f.match(m)&&c.push('')});c.push('
');P.after(e(''));J=e("#"+Pa);O=e("#"+Qa);a='';var j=b.settings.loadCSS;if(j)if($(j,"array"))for(var l in j)a+='';else a+=j.match(/\s*]*?)?>[\s\S]+?<\/style>\s*/i)?j:'';a+='';b.win=R=e("#"+Ra)[0].contentWindow;qa=e(R);try{this.doc=w=R.document;ra=e(w);w.open();w.write(a);w.close();if(D)w.body.contentEditable="true";else w.designMode="On"}catch(h){}setTimeout(Aa,300);b.setSource();R.setInterval=null;J.append(c.join("")).bind("mousedown contextmenu",W).click(function(i){var f=e(i.target).closest("a");if(f.is(".xheEnabled")){M=i;b.exec(f.attr("name"))}return false});J.find(".xheButton").hover(function(i){var f=e(this),k=b.settings.hoverExecDelay,n=X; +X=null;if(k==-1||la||!f.is(".xheEnabled"))return false;if(n&&n>10){la=true;setTimeout(function(){la=false},100);return false}var q=f.attr("name");if(ha[q].h!=1){b.hidePanel();return false}if(Fa)k=0;if(k>=0)Ea=setTimeout(function(){M=i;ba={x:M.clientX,y:M.clientY};b.exec(q)},k)},function(){ba=null;Ea&&clearTimeout(Ea)}).mousemove(function(i){if(ba){var f={x:i.clientX-ba.x,y:i.clientY-ba.y};if(Math.abs(f.x)>1||Math.abs(f.y)>1){if(f.x>0&&f.y>0){f=Math.round(Math.atan(f.y/f.x)/0.017453293);X=X?(X+f)/ +2:f}else X=null;ba={x:i.clientX,y:i.clientY}}}});L=e("#xhePanel");ea=e("#xheShadow");fa=e("#xheCntLine");xa=e("#xheTempIframe");if(L.length==0){L=e('

').mousedown(function(i){i.stopPropagation()});ea=e('
');fa=e('
');setTimeout(function(){e(document.body).append(L).append(ea).append(fa);if(D)e(document.body).append(xa=e(''));J=e("#"+Pa);O=e("#"+Qa);a='';var j=b.settings.loadCSS;if(j)if($(j,"array"))for(var l in j)a+='';else a+=j.match(/\s*]*?)?>[\s\S]+?<\/style>\s*/i)?j:'';a+='';b.win=R=e("#"+Ra)[0].contentWindow;qa=e(R);try{this.doc=w=R.document;ra=e(w);w.open();w.write(a);w.close();if(D)w.body.contentEditable="true";else w.designMode="On"}catch(h){}setTimeout(Aa,300);b.setSource();R.setInterval=null;J.append(c.join("")).bind("mousedown contextmenu",W).click(function(i){var f=e(i.target).closest("a");if(f.is(".xheEnabled")){M=i;b.exec(f.attr("name"))}return false});J.find(".xheButton").hover(function(i){var f=e(this),k=b.settings.hoverExecDelay,n=X; +X=null;if(k==-1||la||!f.is(".xheEnabled"))return false;if(n&&n>10){la=true;setTimeout(function(){la=false},100);return false}var q=f.attr("name");if(ha[q].h!=1){b.hidePanel();return false}if(Fa)k=0;if(k>=0)Ea=setTimeout(function(){M=i;ba={x:M.clientX,y:M.clientY};b.exec(q)},k)},function(){ba=null;Ea&&clearTimeout(Ea)}).mousemove(function(i){if(ba){var f={x:i.clientX-ba.x,y:i.clientY-ba.y};if(Math.abs(f.x)>1||Math.abs(f.y)>1){if(f.x>0&&f.y>0){f=Math.round(Math.atan(f.y/f.x)/0.017453293);X=X?(X+f)/ +2:f}else X=null;ba={x:i.clientX,y:i.clientY}}}});L=e("#xhePanel");ea=e("#xheShadow");fa=e("#xheCntLine");xa=e("#xheTempIframe");if(L.length==0){L=e('
').mousedown(function(i){i.stopPropagation()});ea=e('
');fa=e('
');setTimeout(function(){e(document.body).append(L).append(ea).append(fa);if(D)e(document.body).append(xa=e(''));J=e("#"+Pa);O=e("#"+Qa);a='';var j=b.settings.loadCSS;if(j)if($(j,"array"))for(var l in j)a+='';else a+=j.match(/\s*]*?)?>[\s\S]+?<\/style>\s*/i)?j:'';a+='';b.win=R=e("#"+Ra)[0].contentWindow;qa=e(R);try{this.doc=w=R.document;ra=e(w);w.open();w.write(a);w.close();if(D)w.body.contentEditable="true";else w.designMode="On"}catch(h){}setTimeout(Aa, +300);b.setSource();R.setInterval=null;J.append(c.join("")).bind("mousedown contextmenu",W).click(function(i){var f=e(i.target).closest("a");if(f.is(".xheEnabled")){M=i;b.exec(f.attr("name"))}return false});J.find(".xheButton").hover(function(i){var f=e(this),k=b.settings.hoverExecDelay,n=X;X=null;if(k==-1||la||!f.is(".xheEnabled"))return false;if(n&&n>10){la=true;setTimeout(function(){la=false},100);return false}var q=f.attr("name");if(ha[q].h!=1){b.hidePanel();return false}if(Fa)k=0;if(k>=0)Ea=setTimeout(function(){M= +i;ba={x:M.clientX,y:M.clientY};b.exec(q)},k)},function(){ba=null;Ea&&clearTimeout(Ea)}).mousemove(function(i){if(ba){var f={x:i.clientX-ba.x,y:i.clientY-ba.y};if(Math.abs(f.x)>1||Math.abs(f.y)>1){if(f.x>0&&f.y>0){f=Math.round(Math.atan(f.y/f.x)/0.017453293);X=X?(X+f)/2:f}else X=null;ba={x:i.clientX,y:i.clientY}}}});L=e("#xhePanel");ea=e("#xheShadow");fa=e("#xheCntLine");xa=e("#xheTempIframe");if(L.length==0){L=e('
').mousedown(function(i){i.stopPropagation()});ea=e('
'); +fa=e('
');setTimeout(function(){e(document.body).append(L).append(ea).append(fa);if(D)e(document.body).append(xa=e('