summaryrefslogtreecommitdiffstats
path: root/extensions/BugModal/web
diff options
context:
space:
mode:
authorByron Jones <glob@mozilla.com>2015-03-24 06:45:44 +0100
committerByron Jones <glob@mozilla.com>2015-03-24 06:45:44 +0100
commit3ac701266452d3509776fe58f9e1b2b8e9f33c1e (patch)
tree88124baaadb529b1c9809f6b3fa20384c1870780 /extensions/BugModal/web
parent11bd061970f8b9c98e6af43a4c8c7ca4bfff9eb3 (diff)
downloadbugzilla-3ac701266452d3509776fe58f9e1b2b8e9f33c1e.tar.gz
bugzilla-3ac701266452d3509776fe58f9e1b2b8e9f33c1e.tar.xz
Bug 1096798: prototype modal show_bug view
Diffstat (limited to 'extensions/BugModal/web')
-rw-r--r--extensions/BugModal/web/ZeroClipboard/ZeroClipboard.min.js9
-rw-r--r--extensions/BugModal/web/ZeroClipboard/ZeroClipboard.swfbin0 -> 6580 bytes
-rw-r--r--extensions/BugModal/web/bug_modal.css666
-rw-r--r--extensions/BugModal/web/bug_modal.js730
-rw-r--r--extensions/BugModal/web/calendar.pngbin0 -> 904 bytes
-rw-r--r--extensions/BugModal/web/throbber.gifbin0 -> 723 bytes
6 files changed, 1405 insertions, 0 deletions
diff --git a/extensions/BugModal/web/ZeroClipboard/ZeroClipboard.min.js b/extensions/BugModal/web/ZeroClipboard/ZeroClipboard.min.js
new file mode 100644
index 000000000..b9c734d01
--- /dev/null
+++ b/extensions/BugModal/web/ZeroClipboard/ZeroClipboard.min.js
@@ -0,0 +1,9 @@
+/*!
+ * ZeroClipboard
+ * The ZeroClipboard library provides an easy way to copy text to the clipboard using an invisible Adobe Flash movie and a JavaScript interface.
+ * Copyright (c) 2009-2014 Jon Rohan, James M. Greene
+ * Licensed MIT
+ * http://zeroclipboard.org/
+ * v2.2.0
+ */
+!function(a,b){"use strict";var c,d,e,f=a,g=f.document,h=f.navigator,i=f.setTimeout,j=f.clearTimeout,k=f.setInterval,l=f.clearInterval,m=f.getComputedStyle,n=f.encodeURIComponent,o=f.ActiveXObject,p=f.Error,q=f.Number.parseInt||f.parseInt,r=f.Number.parseFloat||f.parseFloat,s=f.Number.isNaN||f.isNaN,t=f.Date.now,u=f.Object.keys,v=f.Object.defineProperty,w=f.Object.prototype.hasOwnProperty,x=f.Array.prototype.slice,y=function(){var a=function(a){return a};if("function"==typeof f.wrap&&"function"==typeof f.unwrap)try{var b=g.createElement("div"),c=f.unwrap(b);1===b.nodeType&&c&&1===c.nodeType&&(a=f.unwrap)}catch(d){}return a}(),z=function(a){return x.call(a,0)},A=function(){var a,c,d,e,f,g,h=z(arguments),i=h[0]||{};for(a=1,c=h.length;c>a;a++)if(null!=(d=h[a]))for(e in d)w.call(d,e)&&(f=i[e],g=d[e],i!==g&&g!==b&&(i[e]=g));return i},B=function(a){var b,c,d,e;if("object"!=typeof a||null==a||"number"==typeof a.nodeType)b=a;else if("number"==typeof a.length)for(b=[],c=0,d=a.length;d>c;c++)w.call(a,c)&&(b[c]=B(a[c]));else{b={};for(e in a)w.call(a,e)&&(b[e]=B(a[e]))}return b},C=function(a,b){for(var c={},d=0,e=b.length;e>d;d++)b[d]in a&&(c[b[d]]=a[b[d]]);return c},D=function(a,b){var c={};for(var d in a)-1===b.indexOf(d)&&(c[d]=a[d]);return c},E=function(a){if(a)for(var b in a)w.call(a,b)&&delete a[b];return a},F=function(a,b){if(a&&1===a.nodeType&&a.ownerDocument&&b&&(1===b.nodeType&&b.ownerDocument&&b.ownerDocument===a.ownerDocument||9===b.nodeType&&!b.ownerDocument&&b===a.ownerDocument))do{if(a===b)return!0;a=a.parentNode}while(a);return!1},G=function(a){var b;return"string"==typeof a&&a&&(b=a.split("#")[0].split("?")[0],b=a.slice(0,a.lastIndexOf("/")+1)),b},H=function(a){var b,c;return"string"==typeof a&&a&&(c=a.match(/^(?:|[^:@]*@|.+\)@(?=http[s]?|file)|.+?\s+(?: at |@)(?:[^:\(]+ )*[\(]?)((?:http[s]?|file):\/\/[\/]?.+?\/[^:\)]*?)(?::\d+)(?::\d+)?/),c&&c[1]?b=c[1]:(c=a.match(/\)@((?:http[s]?|file):\/\/[\/]?.+?\/[^:\)]*?)(?::\d+)(?::\d+)?/),c&&c[1]&&(b=c[1]))),b},I=function(){var a,b;try{throw new p}catch(c){b=c}return b&&(a=b.sourceURL||b.fileName||H(b.stack)),a},J=function(){var a,c,d;if(g.currentScript&&(a=g.currentScript.src))return a;if(c=g.getElementsByTagName("script"),1===c.length)return c[0].src||b;if("readyState"in c[0])for(d=c.length;d--;)if("interactive"===c[d].readyState&&(a=c[d].src))return a;return"loading"===g.readyState&&(a=c[c.length-1].src)?a:(a=I())?a:b},K=function(){var a,c,d,e=g.getElementsByTagName("script");for(a=e.length;a--;){if(!(d=e[a].src)){c=null;break}if(d=G(d),null==c)c=d;else if(c!==d){c=null;break}}return c||b},L=function(){var a=G(J())||K()||"";return a+"ZeroClipboard.swf"},M=function(){return null==a.opener&&(!!a.top&&a!=a.top||!!a.parent&&a!=a.parent)}(),N={bridge:null,version:"0.0.0",pluginType:"unknown",disabled:null,outdated:null,sandboxed:null,unavailable:null,degraded:null,deactivated:null,overdue:null,ready:null},O="11.0.0",P={},Q={},R=null,S=0,T=0,U={ready:"Flash communication is established",error:{"flash-disabled":"Flash is disabled or not installed. May also be attempting to run Flash in a sandboxed iframe, which is impossible.","flash-outdated":"Flash is too outdated to support ZeroClipboard","flash-sandboxed":"Attempting to run Flash in a sandboxed iframe, which is impossible","flash-unavailable":"Flash is unable to communicate bidirectionally with JavaScript","flash-degraded":"Flash is unable to preserve data fidelity when communicating with JavaScript","flash-deactivated":"Flash is too outdated for your browser and/or is configured as click-to-activate.\nThis may also mean that the ZeroClipboard SWF object could not be loaded, so please check your `swfPath` configuration and/or network connectivity.\nMay also be attempting to run Flash in a sandboxed iframe, which is impossible.","flash-overdue":"Flash communication was established but NOT within the acceptable time limit","version-mismatch":"ZeroClipboard JS version number does not match ZeroClipboard SWF version number","clipboard-error":"At least one error was thrown while ZeroClipboard was attempting to inject your data into the clipboard","config-mismatch":"ZeroClipboard configuration does not match Flash's reality","swf-not-found":"The ZeroClipboard SWF object could not be loaded, so please check your `swfPath` configuration and/or network connectivity"}},V=["flash-unavailable","flash-degraded","flash-overdue","version-mismatch","config-mismatch","clipboard-error"],W=["flash-disabled","flash-outdated","flash-sandboxed","flash-unavailable","flash-degraded","flash-deactivated","flash-overdue"],X=new RegExp("^flash-("+W.map(function(a){return a.replace(/^flash-/,"")}).join("|")+")$"),Y=new RegExp("^flash-("+W.slice(1).map(function(a){return a.replace(/^flash-/,"")}).join("|")+")$"),Z={swfPath:L(),trustedDomains:a.location.host?[a.location.host]:[],cacheBust:!0,forceEnhancedClipboard:!1,flashLoadTimeout:3e4,autoActivate:!0,bubbleEvents:!0,containerId:"global-zeroclipboard-html-bridge",containerClass:"global-zeroclipboard-container",swfObjectId:"global-zeroclipboard-flash-bridge",hoverClass:"zeroclipboard-is-hover",activeClass:"zeroclipboard-is-active",forceHandCursor:!1,title:null,zIndex:999999999},$=function(a){if("object"==typeof a&&null!==a)for(var b in a)if(w.call(a,b))if(/^(?:forceHandCursor|title|zIndex|bubbleEvents)$/.test(b))Z[b]=a[b];else if(null==N.bridge)if("containerId"===b||"swfObjectId"===b){if(!nb(a[b]))throw new Error("The specified `"+b+"` value is not valid as an HTML4 Element ID");Z[b]=a[b]}else Z[b]=a[b];{if("string"!=typeof a||!a)return B(Z);if(w.call(Z,a))return Z[a]}},_=function(){return Tb(),{browser:C(h,["userAgent","platform","appName"]),flash:D(N,["bridge"]),zeroclipboard:{version:Vb.version,config:Vb.config()}}},ab=function(){return!!(N.disabled||N.outdated||N.sandboxed||N.unavailable||N.degraded||N.deactivated)},bb=function(a,d){var e,f,g,h={};if("string"==typeof a&&a)g=a.toLowerCase().split(/\s+/);else if("object"==typeof a&&a&&"undefined"==typeof d)for(e in a)w.call(a,e)&&"string"==typeof e&&e&&"function"==typeof a[e]&&Vb.on(e,a[e]);if(g&&g.length){for(e=0,f=g.length;f>e;e++)a=g[e].replace(/^on/,""),h[a]=!0,P[a]||(P[a]=[]),P[a].push(d);if(h.ready&&N.ready&&Vb.emit({type:"ready"}),h.error){for(e=0,f=W.length;f>e;e++)if(N[W[e].replace(/^flash-/,"")]===!0){Vb.emit({type:"error",name:W[e]});break}c!==b&&Vb.version!==c&&Vb.emit({type:"error",name:"version-mismatch",jsVersion:Vb.version,swfVersion:c})}}return Vb},cb=function(a,b){var c,d,e,f,g;if(0===arguments.length)f=u(P);else if("string"==typeof a&&a)f=a.split(/\s+/);else if("object"==typeof a&&a&&"undefined"==typeof b)for(c in a)w.call(a,c)&&"string"==typeof c&&c&&"function"==typeof a[c]&&Vb.off(c,a[c]);if(f&&f.length)for(c=0,d=f.length;d>c;c++)if(a=f[c].toLowerCase().replace(/^on/,""),g=P[a],g&&g.length)if(b)for(e=g.indexOf(b);-1!==e;)g.splice(e,1),e=g.indexOf(b,e);else g.length=0;return Vb},db=function(a){var b;return b="string"==typeof a&&a?B(P[a])||null:B(P)},eb=function(a){var b,c,d;return a=ob(a),a&&!vb(a)?"ready"===a.type&&N.overdue===!0?Vb.emit({type:"error",name:"flash-overdue"}):(b=A({},a),tb.call(this,b),"copy"===a.type&&(d=Db(Q),c=d.data,R=d.formatMap),c):void 0},fb=function(){var a=N.sandboxed;if(Tb(),"boolean"!=typeof N.ready&&(N.ready=!1),N.sandboxed!==a&&N.sandboxed===!0)N.ready=!1,Vb.emit({type:"error",name:"flash-sandboxed"});else if(!Vb.isFlashUnusable()&&null===N.bridge){var b=Z.flashLoadTimeout;"number"==typeof b&&b>=0&&(S=i(function(){"boolean"!=typeof N.deactivated&&(N.deactivated=!0),N.deactivated===!0&&Vb.emit({type:"error",name:"flash-deactivated"})},b)),N.overdue=!1,Bb()}},gb=function(){Vb.clearData(),Vb.blur(),Vb.emit("destroy"),Cb(),Vb.off()},hb=function(a,b){var c;if("object"==typeof a&&a&&"undefined"==typeof b)c=a,Vb.clearData();else{if("string"!=typeof a||!a)return;c={},c[a]=b}for(var d in c)"string"==typeof d&&d&&w.call(c,d)&&"string"==typeof c[d]&&c[d]&&(Q[d]=c[d])},ib=function(a){"undefined"==typeof a?(E(Q),R=null):"string"==typeof a&&w.call(Q,a)&&delete Q[a]},jb=function(a){return"undefined"==typeof a?B(Q):"string"==typeof a&&w.call(Q,a)?Q[a]:void 0},kb=function(a){if(a&&1===a.nodeType){d&&(Lb(d,Z.activeClass),d!==a&&Lb(d,Z.hoverClass)),d=a,Kb(a,Z.hoverClass);var b=a.getAttribute("title")||Z.title;if("string"==typeof b&&b){var c=Ab(N.bridge);c&&c.setAttribute("title",b)}var e=Z.forceHandCursor===!0||"pointer"===Mb(a,"cursor");Rb(e),Qb()}},lb=function(){var a=Ab(N.bridge);a&&(a.removeAttribute("title"),a.style.left="0px",a.style.top="-9999px",a.style.width="1px",a.style.height="1px"),d&&(Lb(d,Z.hoverClass),Lb(d,Z.activeClass),d=null)},mb=function(){return d||null},nb=function(a){return"string"==typeof a&&a&&/^[A-Za-z][A-Za-z0-9_:\-\.]*$/.test(a)},ob=function(a){var b;if("string"==typeof a&&a?(b=a,a={}):"object"==typeof a&&a&&"string"==typeof a.type&&a.type&&(b=a.type),b){b=b.toLowerCase(),!a.target&&(/^(copy|aftercopy|_click)$/.test(b)||"error"===b&&"clipboard-error"===a.name)&&(a.target=e),A(a,{type:b,target:a.target||d||null,relatedTarget:a.relatedTarget||null,currentTarget:N&&N.bridge||null,timeStamp:a.timeStamp||t()||null});var c=U[a.type];return"error"===a.type&&a.name&&c&&(c=c[a.name]),c&&(a.message=c),"ready"===a.type&&A(a,{target:null,version:N.version}),"error"===a.type&&(X.test(a.name)&&A(a,{target:null,minimumVersion:O}),Y.test(a.name)&&A(a,{version:N.version})),"copy"===a.type&&(a.clipboardData={setData:Vb.setData,clearData:Vb.clearData}),"aftercopy"===a.type&&(a=Eb(a,R)),a.target&&!a.relatedTarget&&(a.relatedTarget=pb(a.target)),qb(a)}},pb=function(a){var b=a&&a.getAttribute&&a.getAttribute("data-clipboard-target");return b?g.getElementById(b):null},qb=function(a){if(a&&/^_(?:click|mouse(?:over|out|down|up|move))$/.test(a.type)){var c=a.target,d="_mouseover"===a.type&&a.relatedTarget?a.relatedTarget:b,e="_mouseout"===a.type&&a.relatedTarget?a.relatedTarget:b,h=Nb(c),i=f.screenLeft||f.screenX||0,j=f.screenTop||f.screenY||0,k=g.body.scrollLeft+g.documentElement.scrollLeft,l=g.body.scrollTop+g.documentElement.scrollTop,m=h.left+("number"==typeof a._stageX?a._stageX:0),n=h.top+("number"==typeof a._stageY?a._stageY:0),o=m-k,p=n-l,q=i+o,r=j+p,s="number"==typeof a.movementX?a.movementX:0,t="number"==typeof a.movementY?a.movementY:0;delete a._stageX,delete a._stageY,A(a,{srcElement:c,fromElement:d,toElement:e,screenX:q,screenY:r,pageX:m,pageY:n,clientX:o,clientY:p,x:o,y:p,movementX:s,movementY:t,offsetX:0,offsetY:0,layerX:0,layerY:0})}return a},rb=function(a){var b=a&&"string"==typeof a.type&&a.type||"";return!/^(?:(?:before)?copy|destroy)$/.test(b)},sb=function(a,b,c,d){d?i(function(){a.apply(b,c)},0):a.apply(b,c)},tb=function(a){if("object"==typeof a&&a&&a.type){var b=rb(a),c=P["*"]||[],d=P[a.type]||[],e=c.concat(d);if(e&&e.length){var g,h,i,j,k,l=this;for(g=0,h=e.length;h>g;g++)i=e[g],j=l,"string"==typeof i&&"function"==typeof f[i]&&(i=f[i]),"object"==typeof i&&i&&"function"==typeof i.handleEvent&&(j=i,i=i.handleEvent),"function"==typeof i&&(k=A({},a),sb(i,j,[k],b))}return this}},ub=function(a){var b=null;return(M===!1||a&&"error"===a.type&&a.name&&-1!==V.indexOf(a.name))&&(b=!1),b},vb=function(a){var b=a.target||d||null,f="swf"===a._source;switch(delete a._source,a.type){case"error":var g="flash-sandboxed"===a.name||ub(a);"boolean"==typeof g&&(N.sandboxed=g),-1!==W.indexOf(a.name)?A(N,{disabled:"flash-disabled"===a.name,outdated:"flash-outdated"===a.name,unavailable:"flash-unavailable"===a.name,degraded:"flash-degraded"===a.name,deactivated:"flash-deactivated"===a.name,overdue:"flash-overdue"===a.name,ready:!1}):"version-mismatch"===a.name&&(c=a.swfVersion,A(N,{disabled:!1,outdated:!1,unavailable:!1,degraded:!1,deactivated:!1,overdue:!1,ready:!1})),Pb();break;case"ready":c=a.swfVersion;var h=N.deactivated===!0;A(N,{disabled:!1,outdated:!1,sandboxed:!1,unavailable:!1,degraded:!1,deactivated:!1,overdue:h,ready:!h}),Pb();break;case"beforecopy":e=b;break;case"copy":var i,j,k=a.relatedTarget;!Q["text/html"]&&!Q["text/plain"]&&k&&(j=k.value||k.outerHTML||k.innerHTML)&&(i=k.value||k.textContent||k.innerText)?(a.clipboardData.clearData(),a.clipboardData.setData("text/plain",i),j!==i&&a.clipboardData.setData("text/html",j)):!Q["text/plain"]&&a.target&&(i=a.target.getAttribute("data-clipboard-text"))&&(a.clipboardData.clearData(),a.clipboardData.setData("text/plain",i));break;case"aftercopy":wb(a),Vb.clearData(),b&&b!==Jb()&&b.focus&&b.focus();break;case"_mouseover":Vb.focus(b),Z.bubbleEvents===!0&&f&&(b&&b!==a.relatedTarget&&!F(a.relatedTarget,b)&&xb(A({},a,{type:"mouseenter",bubbles:!1,cancelable:!1})),xb(A({},a,{type:"mouseover"})));break;case"_mouseout":Vb.blur(),Z.bubbleEvents===!0&&f&&(b&&b!==a.relatedTarget&&!F(a.relatedTarget,b)&&xb(A({},a,{type:"mouseleave",bubbles:!1,cancelable:!1})),xb(A({},a,{type:"mouseout"})));break;case"_mousedown":Kb(b,Z.activeClass),Z.bubbleEvents===!0&&f&&xb(A({},a,{type:a.type.slice(1)}));break;case"_mouseup":Lb(b,Z.activeClass),Z.bubbleEvents===!0&&f&&xb(A({},a,{type:a.type.slice(1)}));break;case"_click":e=null,Z.bubbleEvents===!0&&f&&xb(A({},a,{type:a.type.slice(1)}));break;case"_mousemove":Z.bubbleEvents===!0&&f&&xb(A({},a,{type:a.type.slice(1)}))}return/^_(?:click|mouse(?:over|out|down|up|move))$/.test(a.type)?!0:void 0},wb=function(a){if(a.errors&&a.errors.length>0){var b=B(a);A(b,{type:"error",name:"clipboard-error"}),delete b.success,i(function(){Vb.emit(b)},0)}},xb=function(a){if(a&&"string"==typeof a.type&&a){var b,c=a.target||null,d=c&&c.ownerDocument||g,e={view:d.defaultView||f,canBubble:!0,cancelable:!0,detail:"click"===a.type?1:0,button:"number"==typeof a.which?a.which-1:"number"==typeof a.button?a.button:d.createEvent?0:1},h=A(e,a);c&&d.createEvent&&c.dispatchEvent&&(h=[h.type,h.canBubble,h.cancelable,h.view,h.detail,h.screenX,h.screenY,h.clientX,h.clientY,h.ctrlKey,h.altKey,h.shiftKey,h.metaKey,h.button,h.relatedTarget],b=d.createEvent("MouseEvents"),b.initMouseEvent&&(b.initMouseEvent.apply(b,h),b._source="js",c.dispatchEvent(b)))}},yb=function(){var a=Z.flashLoadTimeout;if("number"==typeof a&&a>=0){var b=Math.min(1e3,a/10),c=Z.swfObjectId+"_fallbackContent";T=k(function(){var a=g.getElementById(c);Ob(a)&&(Pb(),N.deactivated=null,Vb.emit({type:"error",name:"swf-not-found"}))},b)}},zb=function(){var a=g.createElement("div");return a.id=Z.containerId,a.className=Z.containerClass,a.style.position="absolute",a.style.left="0px",a.style.top="-9999px",a.style.width="1px",a.style.height="1px",a.style.zIndex=""+Sb(Z.zIndex),a},Ab=function(a){for(var b=a&&a.parentNode;b&&"OBJECT"===b.nodeName&&b.parentNode;)b=b.parentNode;return b||null},Bb=function(){var a,b=N.bridge,c=Ab(b);if(!b){var d=Ib(f.location.host,Z),e="never"===d?"none":"all",h=Gb(A({jsVersion:Vb.version},Z)),i=Z.swfPath+Fb(Z.swfPath,Z);c=zb();var j=g.createElement("div");c.appendChild(j),g.body.appendChild(c);var k=g.createElement("div"),l="activex"===N.pluginType;k.innerHTML='<object id="'+Z.swfObjectId+'" name="'+Z.swfObjectId+'" width="100%" height="100%" '+(l?'classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"':'type="application/x-shockwave-flash" data="'+i+'"')+">"+(l?'<param name="movie" value="'+i+'"/>':"")+'<param name="allowScriptAccess" value="'+d+'"/><param name="allowNetworking" value="'+e+'"/><param name="menu" value="false"/><param name="wmode" value="transparent"/><param name="flashvars" value="'+h+'"/><div id="'+Z.swfObjectId+'_fallbackContent">&nbsp;</div></object>',b=k.firstChild,k=null,y(b).ZeroClipboard=Vb,c.replaceChild(b,j),yb()}return b||(b=g[Z.swfObjectId],b&&(a=b.length)&&(b=b[a-1]),!b&&c&&(b=c.firstChild)),N.bridge=b||null,b},Cb=function(){var a=N.bridge;if(a){var d=Ab(a);d&&("activex"===N.pluginType&&"readyState"in a?(a.style.display="none",function e(){if(4===a.readyState){for(var b in a)"function"==typeof a[b]&&(a[b]=null);a.parentNode&&a.parentNode.removeChild(a),d.parentNode&&d.parentNode.removeChild(d)}else i(e,10)}()):(a.parentNode&&a.parentNode.removeChild(a),d.parentNode&&d.parentNode.removeChild(d))),Pb(),N.ready=null,N.bridge=null,N.deactivated=null,c=b}},Db=function(a){var b={},c={};if("object"==typeof a&&a){for(var d in a)if(d&&w.call(a,d)&&"string"==typeof a[d]&&a[d])switch(d.toLowerCase()){case"text/plain":case"text":case"air:text":case"flash:text":b.text=a[d],c.text=d;break;case"text/html":case"html":case"air:html":case"flash:html":b.html=a[d],c.html=d;break;case"application/rtf":case"text/rtf":case"rtf":case"richtext":case"air:rtf":case"flash:rtf":b.rtf=a[d],c.rtf=d}return{data:b,formatMap:c}}},Eb=function(a,b){if("object"!=typeof a||!a||"object"!=typeof b||!b)return a;var c={};for(var d in a)if(w.call(a,d))if("errors"===d){c[d]=a[d]?a[d].slice():[];for(var e=0,f=c[d].length;f>e;e++)c[d][e].format=b[c[d][e].format]}else if("success"!==d&&"data"!==d)c[d]=a[d];else{c[d]={};var g=a[d];for(var h in g)h&&w.call(g,h)&&w.call(b,h)&&(c[d][b[h]]=g[h])}return c},Fb=function(a,b){var c=null==b||b&&b.cacheBust===!0;return c?(-1===a.indexOf("?")?"?":"&")+"noCache="+t():""},Gb=function(a){var b,c,d,e,g="",h=[];if(a.trustedDomains&&("string"==typeof a.trustedDomains?e=[a.trustedDomains]:"object"==typeof a.trustedDomains&&"length"in a.trustedDomains&&(e=a.trustedDomains)),e&&e.length)for(b=0,c=e.length;c>b;b++)if(w.call(e,b)&&e[b]&&"string"==typeof e[b]){if(d=Hb(e[b]),!d)continue;if("*"===d){h.length=0,h.push(d);break}h.push.apply(h,[d,"//"+d,f.location.protocol+"//"+d])}return h.length&&(g+="trustedOrigins="+n(h.join(","))),a.forceEnhancedClipboard===!0&&(g+=(g?"&":"")+"forceEnhancedClipboard=true"),"string"==typeof a.swfObjectId&&a.swfObjectId&&(g+=(g?"&":"")+"swfObjectId="+n(a.swfObjectId)),"string"==typeof a.jsVersion&&a.jsVersion&&(g+=(g?"&":"")+"jsVersion="+n(a.jsVersion)),g},Hb=function(a){if(null==a||""===a)return null;if(a=a.replace(/^\s+|\s+$/g,""),""===a)return null;var b=a.indexOf("//");a=-1===b?a:a.slice(b+2);var c=a.indexOf("/");return a=-1===c?a:-1===b||0===c?null:a.slice(0,c),a&&".swf"===a.slice(-4).toLowerCase()?null:a||null},Ib=function(){var a=function(a){var b,c,d,e=[];if("string"==typeof a&&(a=[a]),"object"!=typeof a||!a||"number"!=typeof a.length)return e;for(b=0,c=a.length;c>b;b++)if(w.call(a,b)&&(d=Hb(a[b]))){if("*"===d){e.length=0,e.push("*");break}-1===e.indexOf(d)&&e.push(d)}return e};return function(b,c){var d=Hb(c.swfPath);null===d&&(d=b);var e=a(c.trustedDomains),f=e.length;if(f>0){if(1===f&&"*"===e[0])return"always";if(-1!==e.indexOf(b))return 1===f&&b===d?"sameDomain":"always"}return"never"}}(),Jb=function(){try{return g.activeElement}catch(a){return null}},Kb=function(a,b){var c,d,e,f=[];if("string"==typeof b&&b&&(f=b.split(/\s+/)),a&&1===a.nodeType&&f.length>0)if(a.classList)for(c=0,d=f.length;d>c;c++)a.classList.add(f[c]);else if(a.hasOwnProperty("className")){for(e=" "+a.className+" ",c=0,d=f.length;d>c;c++)-1===e.indexOf(" "+f[c]+" ")&&(e+=f[c]+" ");a.className=e.replace(/^\s+|\s+$/g,"")}return a},Lb=function(a,b){var c,d,e,f=[];if("string"==typeof b&&b&&(f=b.split(/\s+/)),a&&1===a.nodeType&&f.length>0)if(a.classList&&a.classList.length>0)for(c=0,d=f.length;d>c;c++)a.classList.remove(f[c]);else if(a.className){for(e=(" "+a.className+" ").replace(/[\r\n\t]/g," "),c=0,d=f.length;d>c;c++)e=e.replace(" "+f[c]+" "," ");a.className=e.replace(/^\s+|\s+$/g,"")}return a},Mb=function(a,b){var c=m(a,null).getPropertyValue(b);return"cursor"!==b||c&&"auto"!==c||"A"!==a.nodeName?c:"pointer"},Nb=function(a){var b={left:0,top:0,width:0,height:0};if(a.getBoundingClientRect){var c=a.getBoundingClientRect(),d=f.pageXOffset,e=f.pageYOffset,h=g.documentElement.clientLeft||0,i=g.documentElement.clientTop||0,j=0,k=0;if("relative"===Mb(g.body,"position")){var l=g.body.getBoundingClientRect(),m=g.documentElement.getBoundingClientRect();j=l.left-m.left||0,k=l.top-m.top||0}b.left=c.left+d-h-j,b.top=c.top+e-i-k,b.width="width"in c?c.width:c.right-c.left,b.height="height"in c?c.height:c.bottom-c.top}return b},Ob=function(a){if(!a)return!1;var b=m(a,null),c=r(b.height)>0,d=r(b.width)>0,e=r(b.top)>=0,f=r(b.left)>=0,g=c&&d&&e&&f,h=g?null:Nb(a),i="none"!==b.display&&"collapse"!==b.visibility&&(g||!!h&&(c||h.height>0)&&(d||h.width>0)&&(e||h.top>=0)&&(f||h.left>=0));return i},Pb=function(){j(S),S=0,l(T),T=0},Qb=function(){var a;if(d&&(a=Ab(N.bridge))){var b=Nb(d);A(a.style,{width:b.width+"px",height:b.height+"px",top:b.top+"px",left:b.left+"px",zIndex:""+Sb(Z.zIndex)})}},Rb=function(a){N.ready===!0&&(N.bridge&&"function"==typeof N.bridge.setHandCursor?N.bridge.setHandCursor(a):N.ready=!1)},Sb=function(a){if(/^(?:auto|inherit)$/.test(a))return a;var b;return"number"!=typeof a||s(a)?"string"==typeof a&&(b=Sb(q(a,10))):b=a,"number"==typeof b?b:"auto"},Tb=function(b){var c,d,e,f=N.sandboxed,g=null;if(b=b===!0,M===!1)g=!1;else{try{d=a.frameElement||null}catch(h){e={name:h.name,message:h.message}}if(d&&1===d.nodeType&&"IFRAME"===d.nodeName)try{g=d.hasAttribute("sandbox")}catch(h){g=null}else{try{c=document.domain||null}catch(h){c=null}(null===c||e&&"SecurityError"===e.name&&/(^|[\s\(\[@])sandbox(es|ed|ing|[\s\.,!\)\]@]|$)/.test(e.message.toLowerCase()))&&(g=!0)}}return N.sandboxed=g,f===g||b||Ub(o),g},Ub=function(a){function b(a){var b=a.match(/[\d]+/g);return b.length=3,b.join(".")}function c(a){return!!a&&(a=a.toLowerCase())&&(/^(pepflashplayer\.dll|libpepflashplayer\.so|pepperflashplayer\.plugin)$/.test(a)||"chrome.plugin"===a.slice(-13))}function d(a){a&&(i=!0,a.version&&(l=b(a.version)),!l&&a.description&&(l=b(a.description)),a.filename&&(k=c(a.filename)))}var e,f,g,i=!1,j=!1,k=!1,l="";if(h.plugins&&h.plugins.length)e=h.plugins["Shockwave Flash"],d(e),h.plugins["Shockwave Flash 2.0"]&&(i=!0,l="2.0.0.11");else if(h.mimeTypes&&h.mimeTypes.length)g=h.mimeTypes["application/x-shockwave-flash"],e=g&&g.enabledPlugin,d(e);else if("undefined"!=typeof a){j=!0;try{f=new a("ShockwaveFlash.ShockwaveFlash.7"),i=!0,l=b(f.GetVariable("$version"))}catch(m){try{f=new a("ShockwaveFlash.ShockwaveFlash.6"),i=!0,l="6.0.21"}catch(n){try{f=new a("ShockwaveFlash.ShockwaveFlash"),i=!0,l=b(f.GetVariable("$version"))}catch(o){j=!1}}}}N.disabled=i!==!0,N.outdated=l&&r(l)<r(O),N.version=l||"0.0.0",N.pluginType=k?"pepper":j?"activex":i?"netscape":"unknown"};Ub(o),Tb(!0);var Vb=function(){return this instanceof Vb?void("function"==typeof Vb._createClient&&Vb._createClient.apply(this,z(arguments))):new Vb};v(Vb,"version",{value:"2.2.0",writable:!1,configurable:!0,enumerable:!0}),Vb.config=function(){return $.apply(this,z(arguments))},Vb.state=function(){return _.apply(this,z(arguments))},Vb.isFlashUnusable=function(){return ab.apply(this,z(arguments))},Vb.on=function(){return bb.apply(this,z(arguments))},Vb.off=function(){return cb.apply(this,z(arguments))},Vb.handlers=function(){return db.apply(this,z(arguments))},Vb.emit=function(){return eb.apply(this,z(arguments))},Vb.create=function(){return fb.apply(this,z(arguments))},Vb.destroy=function(){return gb.apply(this,z(arguments))},Vb.setData=function(){return hb.apply(this,z(arguments))},Vb.clearData=function(){return ib.apply(this,z(arguments))},Vb.getData=function(){return jb.apply(this,z(arguments))},Vb.focus=Vb.activate=function(){return kb.apply(this,z(arguments))},Vb.blur=Vb.deactivate=function(){return lb.apply(this,z(arguments))},Vb.activeElement=function(){return mb.apply(this,z(arguments))};var Wb=0,Xb={},Yb=0,Zb={},$b={};A(Z,{autoActivate:!0});var _b=function(a){var b=this;b.id=""+Wb++,Xb[b.id]={instance:b,elements:[],handlers:{}},a&&b.clip(a),Vb.on("*",function(a){return b.emit(a)}),Vb.on("destroy",function(){b.destroy()}),Vb.create()},ac=function(a,d){var e,f,g,h={},i=Xb[this.id],j=i&&i.handlers;if(!i)throw new Error("Attempted to add new listener(s) to a destroyed ZeroClipboard client instance");if("string"==typeof a&&a)g=a.toLowerCase().split(/\s+/);else if("object"==typeof a&&a&&"undefined"==typeof d)for(e in a)w.call(a,e)&&"string"==typeof e&&e&&"function"==typeof a[e]&&this.on(e,a[e]);if(g&&g.length){for(e=0,f=g.length;f>e;e++)a=g[e].replace(/^on/,""),h[a]=!0,j[a]||(j[a]=[]),j[a].push(d);if(h.ready&&N.ready&&this.emit({type:"ready",client:this}),h.error){for(e=0,f=W.length;f>e;e++)if(N[W[e].replace(/^flash-/,"")]){this.emit({type:"error",name:W[e],client:this});break}c!==b&&Vb.version!==c&&this.emit({type:"error",name:"version-mismatch",jsVersion:Vb.version,swfVersion:c})}}return this},bc=function(a,b){var c,d,e,f,g,h=Xb[this.id],i=h&&h.handlers;if(!i)return this;if(0===arguments.length)f=u(i);else if("string"==typeof a&&a)f=a.split(/\s+/);else if("object"==typeof a&&a&&"undefined"==typeof b)for(c in a)w.call(a,c)&&"string"==typeof c&&c&&"function"==typeof a[c]&&this.off(c,a[c]);if(f&&f.length)for(c=0,d=f.length;d>c;c++)if(a=f[c].toLowerCase().replace(/^on/,""),g=i[a],g&&g.length)if(b)for(e=g.indexOf(b);-1!==e;)g.splice(e,1),e=g.indexOf(b,e);else g.length=0;return this},cc=function(a){var b=null,c=Xb[this.id]&&Xb[this.id].handlers;return c&&(b="string"==typeof a&&a?c[a]?c[a].slice(0):[]:B(c)),b},dc=function(a){if(ic.call(this,a)){"object"==typeof a&&a&&"string"==typeof a.type&&a.type&&(a=A({},a));var b=A({},ob(a),{client:this});jc.call(this,b)}return this},ec=function(a){if(!Xb[this.id])throw new Error("Attempted to clip element(s) to a destroyed ZeroClipboard client instance");a=kc(a);for(var b=0;b<a.length;b++)if(w.call(a,b)&&a[b]&&1===a[b].nodeType){a[b].zcClippingId?-1===Zb[a[b].zcClippingId].indexOf(this.id)&&Zb[a[b].zcClippingId].push(this.id):(a[b].zcClippingId="zcClippingId_"+Yb++,Zb[a[b].zcClippingId]=[this.id],Z.autoActivate===!0&&lc(a[b]));var c=Xb[this.id]&&Xb[this.id].elements;-1===c.indexOf(a[b])&&c.push(a[b])}return this},fc=function(a){var b=Xb[this.id];if(!b)return this;var c,d=b.elements;a="undefined"==typeof a?d.slice(0):kc(a);for(var e=a.length;e--;)if(w.call(a,e)&&a[e]&&1===a[e].nodeType){for(c=0;-1!==(c=d.indexOf(a[e],c));)d.splice(c,1);var f=Zb[a[e].zcClippingId];if(f){for(c=0;-1!==(c=f.indexOf(this.id,c));)f.splice(c,1);0===f.length&&(Z.autoActivate===!0&&mc(a[e]),delete a[e].zcClippingId)}}return this},gc=function(){var a=Xb[this.id];return a&&a.elements?a.elements.slice(0):[]},hc=function(){Xb[this.id]&&(this.unclip(),this.off(),delete Xb[this.id])},ic=function(a){if(!a||!a.type)return!1;if(a.client&&a.client!==this)return!1;var b=Xb[this.id],c=b&&b.elements,d=!!c&&c.length>0,e=!a.target||d&&-1!==c.indexOf(a.target),f=a.relatedTarget&&d&&-1!==c.indexOf(a.relatedTarget),g=a.client&&a.client===this;return b&&(e||f||g)?!0:!1},jc=function(a){var b=Xb[this.id];if("object"==typeof a&&a&&a.type&&b){var c=rb(a),d=b&&b.handlers["*"]||[],e=b&&b.handlers[a.type]||[],g=d.concat(e);if(g&&g.length){var h,i,j,k,l,m=this;for(h=0,i=g.length;i>h;h++)j=g[h],k=m,"string"==typeof j&&"function"==typeof f[j]&&(j=f[j]),"object"==typeof j&&j&&"function"==typeof j.handleEvent&&(k=j,j=j.handleEvent),"function"==typeof j&&(l=A({},a),sb(j,k,[l],c))}}},kc=function(a){return"string"==typeof a&&(a=[]),"number"!=typeof a.length?[a]:a},lc=function(a){if(a&&1===a.nodeType){var b=function(a){(a||(a=f.event))&&("js"!==a._source&&(a.stopImmediatePropagation(),a.preventDefault()),delete a._source)},c=function(c){(c||(c=f.event))&&(b(c),Vb.focus(a))};a.addEventListener("mouseover",c,!1),a.addEventListener("mouseout",b,!1),a.addEventListener("mouseenter",b,!1),a.addEventListener("mouseleave",b,!1),a.addEventListener("mousemove",b,!1),$b[a.zcClippingId]={mouseover:c,mouseout:b,mouseenter:b,mouseleave:b,mousemove:b}}},mc=function(a){if(a&&1===a.nodeType){var b=$b[a.zcClippingId];if("object"==typeof b&&b){for(var c,d,e=["move","leave","enter","out","over"],f=0,g=e.length;g>f;f++)c="mouse"+e[f],d=b[c],"function"==typeof d&&a.removeEventListener(c,d,!1);delete $b[a.zcClippingId]}}};Vb._createClient=function(){_b.apply(this,z(arguments))},Vb.prototype.on=function(){return ac.apply(this,z(arguments))},Vb.prototype.off=function(){return bc.apply(this,z(arguments))},Vb.prototype.handlers=function(){return cc.apply(this,z(arguments))},Vb.prototype.emit=function(){return dc.apply(this,z(arguments))},Vb.prototype.clip=function(){return ec.apply(this,z(arguments))},Vb.prototype.unclip=function(){return fc.apply(this,z(arguments))},Vb.prototype.elements=function(){return gc.apply(this,z(arguments))},Vb.prototype.destroy=function(){return hc.apply(this,z(arguments))},Vb.prototype.setText=function(a){if(!Xb[this.id])throw new Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance");return Vb.setData("text/plain",a),this},Vb.prototype.setHtml=function(a){if(!Xb[this.id])throw new Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance");return Vb.setData("text/html",a),this},Vb.prototype.setRichText=function(a){if(!Xb[this.id])throw new Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance");return Vb.setData("application/rtf",a),this},Vb.prototype.setData=function(){if(!Xb[this.id])throw new Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance");return Vb.setData.apply(this,z(arguments)),this},Vb.prototype.clearData=function(){if(!Xb[this.id])throw new Error("Attempted to clear pending clipboard data from a destroyed ZeroClipboard client instance");return Vb.clearData.apply(this,z(arguments)),this},Vb.prototype.getData=function(){if(!Xb[this.id])throw new Error("Attempted to get pending clipboard data from a destroyed ZeroClipboard client instance");return Vb.getData.apply(this,z(arguments))},"function"==typeof define&&define.amd?define(function(){return Vb}):"object"==typeof module&&module&&"object"==typeof module.exports&&module.exports?module.exports=Vb:a.ZeroClipboard=Vb}(function(){return this||window}());
diff --git a/extensions/BugModal/web/ZeroClipboard/ZeroClipboard.swf b/extensions/BugModal/web/ZeroClipboard/ZeroClipboard.swf
new file mode 100644
index 000000000..8bad6a3e3
--- /dev/null
+++ b/extensions/BugModal/web/ZeroClipboard/ZeroClipboard.swf
Binary files differ
diff --git a/extensions/BugModal/web/bug_modal.css b/extensions/BugModal/web/bug_modal.css
new file mode 100644
index 000000000..27a9e3f73
--- /dev/null
+++ b/extensions/BugModal/web/bug_modal.css
@@ -0,0 +1,666 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This Source Code Form is "Incompatible With Secondary Licenses", as
+ * defined by the Mozilla Public License, v. 2.0. */
+
+/* generic */
+
+.container {
+ display: table-cell;
+ width: 100%;
+}
+
+.layout-table {
+ border-spacing: 0;
+}
+
+.layout-table td {
+ padding: 0;
+}
+
+.inline {
+ display: table-cell;
+}
+
+.gravatar {
+ vertical-align: middle;
+ margin-right: 5px;
+}
+
+.flag .vcard {
+ display: inline;
+}
+
+.group-padlock {
+ vertical-align: middle;
+ margin-right: 5px;
+}
+
+button.minor {
+ background-color: #888;
+ background-image: linear-gradient(#aaa, #888);
+ font-size: 11px;
+ padding: 0.25em 0.5em;
+}
+
+button.minor:hover {
+ -webkit-box-shadow: 0 1px 0 0 rgba(0,0,0,0.2), inset 0 -1px 0 0 rgba(0,0,0,0.3), inset 0 12px 24px 2px #bbb;
+ -moz-box-shadow: 0 1px 0 0 rgba(0,0,0,0.2), inset 0 -1px 0 0 rgba(0,0,0,0.3), inset 0 12px 24px 2px #bbb;
+ box-shadow: 0 1px 0 0 rgba(0,0,0,0.2), inset 0 -1px 0 0 rgba(0,0,0,0.3), inset 0 12px 24px 2px #bbb;
+}
+
+button.in-page {
+ background-color: #fff;
+ background-image: linear-gradient(#fff, #fff);
+ color: #000;
+ border: 1px solid #ccc;
+ -webkit-box-shadow: none;
+ -moz-box-shadow: none;
+ box-shadow: none;
+ font-size: 11px;
+ padding: 0.25em 0.5em;
+}
+
+button.in-page:hover {
+ -webkit-box-shadow: inset 0 12px 24px 2px #eee;
+ -moz-box-shadow: inset 0 12px 24px 2px #eee;
+ box-shadow: inset 0 12px 24px 2px #eee;
+ -moz-transition: all linear 100ms;
+ -webkit-transition: all linear 100ms;
+ transition: all linear 100ms;
+}
+
+select[multiple], .text_input, .yui-ac-input, input {
+ font-size: 12px !important;
+}
+
+.spin-toggle {
+ cursor: pointer;
+}
+
+.spin-toggle:hover {
+ text-decoration: underline;
+}
+
+.spin-latch {
+ color: #999;
+ padding-right: 5px;
+}
+
+/* modules */
+
+.module {
+ color: #000;
+ border-radius: 2px;
+ margin-top: 5px;
+ font-size: 13px;
+}
+
+.module.module-collapsed .module-content {
+ border: 1px solid red;
+}
+
+.module-header {
+ background: #eee;
+ padding: 2px 5px;
+ cursor: pointer;
+}
+
+.module-header:hover {
+ outline: 1px solid #ccc;
+}
+
+.module-latch {
+ display: table-cell;
+ padding-left: 5px;
+ padding-right: 5px;
+}
+
+.module-spinner {
+ color: #999;
+ display: table-cell;
+ width: 10px;
+}
+
+.module-title, .module-subtitle {
+ display: table-cell;
+ padding-left: 5px;
+}
+
+.module-subtitle {
+ padding-right: 5px;
+ color: #666;
+ font-size: 12px;
+}
+
+.module .fields-lhs {
+ min-width: 450px;
+ display: table-cell;
+ vertical-align: top;
+}
+
+.module .fields-rhs {
+ min-width: 450px;
+ display: table-cell;
+ vertical-align: top;
+ width: 100%;
+}
+
+.module-content {
+ padding: 2px 5px;
+ background: #fff;
+}
+
+.module .field {
+ margin-top: 4px;
+ vertical-align: top;
+}
+
+.module .field.right {
+}
+
+.module .field .name {
+ display: table-cell;
+ width: 100px;
+ min-width: 100px;
+ text-align: right;
+ vertical-align: top;
+ padding-right: 10px;
+ color: #666;
+}
+
+.module .field.inline .name {
+ min-width: 0px;
+ width: auto;
+ padding-left: 10px;
+}
+
+.module .indent {
+ padding-left: 10px;
+}
+
+.module .field .value {
+ display: table-cell;
+}
+
+.module .field .value.wide {
+ display: block;
+}
+
+.module .field .value.edit {
+ width: 100%;
+}
+
+.module .field .value input {
+ width: 100%;
+}
+
+.module .field .value input[type="checkbox"] {
+ width: auto;
+}
+
+.module .field .value.short input {
+ width: 170px;
+}
+
+/* field types */
+
+input[type="number"] {
+ text-align: right;
+ width: 5em !important;
+}
+
+.cf_date-img, .cf_datetime-img {
+ vertical-align: middle;
+}
+
+/* specific fields */
+
+#field-value-bug_id {
+ font-weight: bold;
+}
+
+#field-value-short_desc {
+ font-weight: bold;
+ font-size: 120%;
+}
+
+#status-needinfo, #status-needinfo .vcard {
+ display: inline;
+}
+
+#duplicate-container, #duplicate-actions {
+ display: table-cell;
+ vertical-align: top;
+ padding-left: 8px;
+}
+
+#dup_id {
+ margin-left: 4px;
+}
+
+#duplicate-container #dup_up {
+ padding-left: 5px;
+}
+
+#after-comment-commit-button {
+ margin-left: -8px;
+}
+
+#needinfo_from_autocomplete {
+ width: auto;
+}
+
+#needinfo_role_identity {
+ margin-left: 5px;
+}
+
+#user-story {
+ margin: 0;
+}
+
+#user-story-actions {
+ float: right;
+}
+
+#login-required {
+ padding: 20px 8px;
+ margin-bottom: 50px;
+}
+
+#product-info, #component-info {
+ color: #484;
+}
+
+#cc-latch {
+ color: #999;
+}
+
+#cc-latch, #cc-summary {
+ cursor: pointer;
+}
+
+#cc-summary:hover {
+ text-decoration: underline;
+}
+
+#cc-list {
+ max-height: 150px;
+ overflow-y: scroll;
+}
+
+/* actions */
+
+#copy-summary {
+ margin-left: 20px;
+}
+
+#top-actions {
+ margin-top: 5px;
+ padding-bottom: 20px;
+}
+
+#top-actions .save-btn {
+ float: right;
+}
+
+#bottom-actions {
+ margin-bottom: 50px;
+}
+
+#bottom-right-actions {
+ float: right;
+}
+
+.edit-textarea-set-btn {
+ float: right;
+}
+
+/* attachments */
+
+#attachments {
+ width: 100%;
+}
+
+#attachments tr:hover {
+ background-image: linear-gradient(to right, #666, rgba(0, 0, 0, 0) 1px);
+}
+
+#attachments td {
+ padding: 4px 8px;
+ vertical-align: top;
+ font-size: 13px;
+ border-bottom: 1px dotted silver;
+}
+
+#attachments .attach-desc-td {
+ width: 100%;
+}
+
+#attachments .attach-desc {
+ font-weight: bold;
+}
+
+#attachments .attach-desc a {
+ color: #000;
+}
+
+#attachments .attach-info {
+ font-size: 11px;
+}
+
+#attachments .attach-time {
+ font-size: 11px;
+}
+
+#attachments .attach-actions {
+ white-space: nowrap;
+}
+
+#attachments .attach-flag {
+ white-space: nowrap;
+}
+
+#attachments .flag-name-status {
+ font-weight: bold;
+}
+
+#attachments .attach-obsolete .attach-desc {
+ text-decoration: line-through;
+}
+
+#attachments .attach-patch {
+ background: #ffc;
+ background-image: linear-gradient(to right, #ffc, #fff);
+}
+
+#attachments .vcard {
+ display: inline;
+}
+
+#attachments-actions {
+ padding: 2px;
+}
+
+#attachments .attach-flag .vcard {
+ white-space: nowrap;
+}
+
+/* flags */
+
+.flags td {
+ font-size: 13px !important;
+}
+
+.flag-name {
+ text-align: right;
+}
+
+td.flag-name, td.flag-requestee {
+ padding-left: 5px;
+}
+
+td.flag-value select {
+ margin-left: 5px;
+}
+
+td.flag-requestee {
+ width: 100%;
+}
+
+.flags .vcard {
+ white-space: nowrap;
+}
+
+.tracking-flags td, .tracking-flags th {
+ padding: 0 5px;
+}
+
+.tracking-flags th {
+ font-weight: normal;
+ text-align: left;
+ color: #666;
+}
+
+.tracking-flag-name, .tracking-flag-tracking {
+ text-align: right;
+ white-space: nowrap;
+}
+
+/* comments and activity */
+
+.change-set {
+ clear: both;
+ -webkit-box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.1);
+ -moz-box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.1);
+ box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.1);
+ border-bottom: 1px solid rgba(0, 0, 0, 0.2);
+ margin-top: 20px;
+ border: 1px solid #ddd;
+}
+
+.change-set:target {
+ outline: 2px solid #0095dd;
+}
+
+.change-head {
+ width: 100%;
+ background: #eee;
+}
+
+.change-gravatar {
+ padding-left: 8px !important;
+}
+
+.change-author {
+ width: 100%;
+ vertical-align: top;
+ padding-top: 4px !important;
+}
+
+.change-author .vcard {
+ display: inline;
+ font-weight: bold;
+}
+
+.change-author .user-role {
+ margin-left: 1em;
+ color: #448844;
+}
+
+
+.change-name, .change-time, .comment-private {
+ display: inline;
+}
+
+.comment-actions {
+ white-space: nowrap;
+ padding: 2px 2px 0 0 !important;
+}
+
+.comment-spinner {
+ font-family: monospace;
+ white-space: nowrap;
+ vertical-align: bottom;
+}
+
+.comment-text {
+ white-space: pre-wrap;
+ font: 13px/1.2 "Droid Sans Mono",Menlo,Monaco,"Courier New",Courier,monospace;
+ background: #fff;
+ margin: 1px 0 0 0;
+ overflow: auto;
+ padding: 8px;
+ border-top: 1px solid #ddd;
+}
+
+.comment-text span.quote, .comment-text span.quote_wrapped {
+ background: #eee !important;
+ color: #444 !important;
+ display: block !important;
+ padding: 5px !important;
+ display: inline-block !important;
+ width: 99% !important;
+}
+
+.comment-tags {
+ padding: 0 8px 2px 8px !important;
+}
+
+.comment-tag {
+ border: 1px solid #ccc;
+ padding: 2px 4px;
+ margin-right: 2px;
+ border-radius: 0.5em;
+ background-color: #fff;
+ color: #000;
+ font-size: 12px;
+}
+
+.comment-collapse-reason {
+ padding: 5px 7px !important;
+ width: 100%;
+}
+
+.default-collapsed {
+ background: inherit;
+ color: #888;
+}
+
+.default-collapsed .comment-actions {
+ padding: 2px;
+}
+
+.private-comment {
+ color: #8b0000;
+ background: #f3eeee;
+}
+
+.activity {
+ padding: 5px 8px;
+ background: #eee;
+ border-top: 1px solid #ddd;
+}
+
+.activity-deleted {
+ text-decoration: line-through;
+}
+
+.change-set .reporter {
+ background-image: linear-gradient(to right, #feb, rgba(0, 0, 0, 0) 150px);
+}
+
+.change-set .assignee {
+ background-image: linear-gradient(to right, #ffc, rgba(0, 0, 0, 0) 150px);
+}
+
+/* add comment */
+
+#add-comment {
+ margin-top: 20px;
+}
+
+#add-comment-label {
+ display: inline;
+ font-weight: bold;
+}
+
+#add-comment-private {
+ float: right;
+}
+
+#comment {
+ width: 100%;
+ box-sizing: border-box !important;
+}
+
+/* controls */
+
+#summary-container {
+ display: table-cell;
+ width: 100%;
+ vertical-align: top;
+}
+
+#xhr-error {
+ background: #fff;
+ color: #000;
+ border-radius: 2px;
+ border: 1px solid maroon;
+ margin: 5px 0px;
+ padding: 5px;
+}
+
+#mode-container {
+ display: table-cell;
+ white-space: nowrap;
+ text-align: right;
+ padding: 5px;
+ margin: 5px;
+}
+
+#mode-btn, #commit-btn {
+ margin: 0 0 5px 0;
+}
+
+#mode-btn-loading, #mode-btn-editing {
+ display: none;
+}
+
+#edit-throbber {
+ margin-right: 5px;
+}
+
+#commit {
+ margin: 5px;
+}
+
+#mode-container .button-row {
+ margin-top: 1px;
+}
+
+/* theme */
+
+#bugzilla-body {
+ margin: 5px !important;
+ max-width: 1024px !important;
+ min-width: 800px !important;
+ width: 100% !important;
+}
+
+#footer {
+ max-width: 1024px !important;
+ min-width: 800px !important;
+}
+
+.vcard {
+ white-space: normal;
+}
+
+.vcard a.disabled {
+ color: #888;
+}
+
+.xdsoft_datetimepicker button, .xdsoft_datetimepicker button:hover {
+ -webkit-box-shadow: none;
+ -moz-box-shadow: none;
+ box-shadow: none;
+}
+
+div.ui-widget-content {
+ background: #fff;
+}
+
+div.ui-tooltip {
+ padding: 4px;
+ font-size: 13px;
+ font-family: inherit;
+ max-width: 500px;
+}
+
+.yui-ac {
+ width: 100%;
+}
+
diff --git a/extensions/BugModal/web/bug_modal.js b/extensions/BugModal/web/bug_modal.js
new file mode 100644
index 000000000..c3fd84e97
--- /dev/null
+++ b/extensions/BugModal/web/bug_modal.js
@@ -0,0 +1,730 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This Source Code Form is "Incompatible With Secondary Licenses", as
+ * defined by the Mozilla Public License, v. 2.0. */
+
+$(function() {
+ 'use strict';
+
+ // all keywords for autocompletion (lazy-loaded on edit)
+ var keywords = [];
+
+ // products with descriptions (also lazy-loaded)
+ var products = [];
+
+ // scroll to an element
+ function scroll_to(el, complete) {
+ var offset = el.offset();
+ $('html, body')
+ .animate({
+ scrollTop: offset.top - 20,
+ scrollLeft: offset.left = 20
+ },
+ 200,
+ complete
+ );
+ }
+
+ // expand all modules
+ $('#expand-all-btn')
+ .click(function(event) {
+ event.preventDefault();
+ var btn = $(event.target);
+ if (btn.data('expanded-modules')) {
+ btn.data('expanded-modules').slideToggle(200, 'swing', function() {
+ btn.data('expanded-spinners').html('&#9656;');
+ });
+ btn.data('expanded-modules', false);
+ btn.text('Expand All');
+ }
+ else {
+ var modules = $('.module-content:hidden');
+ var spinners = $([]);
+ modules.each(function() {
+ spinners.push($(this).parent('.module').find('.module-spinner')[0]);
+ });
+ btn.data('expanded-modules', modules);
+ btn.data('expanded-spinners', spinners);
+ modules.slideToggle(200, 'swing', function() {
+ spinners.html('&#9662;');
+ });
+ btn.text('Collapse');
+ }
+ });
+
+ // expand/colapse module
+ $('.module-header')
+ .click(function(event) {
+ event.preventDefault();
+ var target = $(event.target);
+ var latch = target.hasClass('module-header') ? target.children('.module-latch') : target.parent('.module-latch');
+ var spinner = $(latch.children('.module-spinner')[0]);
+ var module = $(latch.parents('.module')[0]);
+ var content = $(module.children('.module-content')[0]);
+ content.slideToggle(200, 'swing', function() {
+ spinner.html(content.is(':visible') ? '&#9662;' : '&#9656;');
+ });
+ });
+
+ // toggle obsolete attachments
+ $('#attachments-obsolete-btn')
+ .click(function(event) {
+ event.preventDefault();
+ $(event.target).text(($('#attachments tr:hidden').length ? 'Hide' : 'Show') + ' Obsolete Attachments');
+ $('#attachments tr.attach-obsolete').toggle();
+ });
+
+ // comment collapse/expand
+ $('.comment-spinner')
+ .click(function(event) {
+ event.preventDefault();
+ var spinner = $(event.target);
+ var id = spinner.attr('id').match(/\d+$/)[0];
+ // switch to full header for initially collapsed comments
+ if (spinner.attr('id').match(/^ccs-/)) {
+ $('#cc-' + id).hide();
+ $('#ch-' + id).show();
+ }
+ $('#ct-' + id).slideToggle('fast', function() {
+ $('#c' + id).find('.activity').toggle();
+ spinner.text($('#ct-' + id + ':visible').length ? '-' : '+');
+ });
+ });
+
+ // url --> unsafe warning
+ $('.unsafe-url')
+ .click(function(event) {
+ event.preventDefault();
+ if (confirm('This is considered an unsafe URL and could possibly be harmful. ' +
+ 'The full URL is:\n\n' + $(event.target).attr('title') + '\n\nContinue?'))
+ {
+ try {
+ window.open($(event.target).attr('title'));
+ } catch(ex) {
+ alert('Malformed URL');
+ }
+ }
+ });
+
+ // last comment btn
+ $('#last-comment-btn')
+ .click(function(event) {
+ event.preventDefault();
+ var id = $('.comment:last')[0].parentNode.id;
+ scroll_to($('#' + id));
+ window.location.hash = id;
+ });
+
+ // top btn
+ $('#top-btn')
+ .click(function(event) {
+ event.preventDefault();
+ scroll_to($('body'));
+ });
+
+ // use non-native tooltips for relative times and bug summaries
+ $('.rel-time, .bz_bug_link').tooltip({
+ position: { my: "left top+8", at: "left bottom", collision: "flipfit" },
+ show: { effect: 'none' },
+ hide: { effect: 'none' }
+ });
+
+ // tooltips create a new ui-helper-hidden-accessible div each time a
+ // tooltip is shown. this is never removed leading to memory leak and
+ // bloated dom. http://bugs.jqueryui.com/ticket/10689
+ $('.ui-helper-hidden-accessible').remove();
+
+ // product/component info
+ $('.spin-toggle')
+ .click(function(event) {
+ event.preventDefault();
+ var latch = $($(event.target).data('latch'));
+ var el_for = $($(event.target).data('for'));
+
+ if (latch.data('expanded')) {
+ latch.data('expanded', false).html('&#9656;');
+ el_for.hide();
+ }
+ else {
+ latch.data('expanded', true).html('&#9662;');
+ el_for.show();
+ }
+ });
+
+ // cc list
+ $('#cc-latch, #cc-summary')
+ .click(function(event) {
+ event.preventDefault();
+ var latch = $('#cc-latch');
+
+ if (latch.data('expanded')) {
+ latch.data('expanded', false).html('&#9656;');
+ $('#cc-list').hide();
+ }
+ else {
+ latch.data('expanded', true).html('&#9662;');
+ $('#cc-list').show();
+ if (!latch.data('fetched')) {
+ $('#cc-list').html(
+ '<img src="extensions/BugModal/web/throbber.gif" width="16" height="11"> Loading...'
+ );
+ bugzilla_ajax(
+ {
+ url: 'rest/bug_modal/cc/' + BUGZILLA.bug_id
+ },
+ function(data) {
+ $('#cc-list').html(data.html);
+ latch.data('fetched', true);
+ }
+ );
+ }
+ }
+ });
+
+ // copy summary to clipboard
+ if ($('#copy-summary').length) {
+ var zero = new ZeroClipboard($('#copy-summary'));
+ zero.on({
+ 'error': function(event) {
+ console.log(event.message);
+ zero.destroy();
+ $('#copy-summary').hide();
+
+ },
+ 'copy': function(event) {
+ var clipboard = event.clipboardData;
+ clipboard.setData('text/plain', 'Bug ' + BUGZILLA.bug_id + ' - ' + $('#field-value-short_desc').text());
+ }
+ });
+ }
+
+ //
+ // anything after this point is only executed for logged in users
+ //
+
+ if (BUGZILLA.user.id === 0) return;
+
+ // edit/save mode button
+ $('#mode-btn')
+ .click(function(event) {
+ event.preventDefault();
+
+ // hide buttons, old error messages
+ $('#mode-btn-readonly').hide();
+
+ // toggle visibility
+ $('.edit-hide').hide();
+ $('.edit-show').show();
+
+ // expand specific modules
+ $('#module-details .module-header').each(function() {
+ if ($(this.parentNode).find('.module-content:visible').length === 0) {
+ $(this).click();
+ }
+ });
+
+ // if there's no current user-story, it's a better experience if it's editable by default
+ if ($('#cf_user_story').val() === '') {
+ $('#user-story-edit-btn').click();
+ }
+
+ // "loading.." ui
+ $('#mode-btn-loading').show();
+ $('#cancel-btn').prop('disabled', true);
+ $('#mode-btn').prop('disabled', true);
+
+ // load the missing select data
+ bugzilla_ajax(
+ {
+ url: 'rest/bug_modal/edit/' + BUGZILLA.bug_id
+ },
+ function(data) {
+ $('#mode-btn').hide();
+
+ // populate select menus
+ $.each(data.options, function(key, value) {
+ var el = $('#' + key);
+ if (!el) return;
+ var selected = el.val();
+ el.empty();
+ $(value).each(function(i, v) {
+ el.append($('<option>', { value: v.name, text: v.name }));
+ });
+ el.val(selected);
+ if (el.attr('multiple') && value.length < 5) {
+ el.attr('size', value.length);
+ }
+ });
+
+ // build our product description hash
+ $.each(data.options.product, function() {
+ products[this.name] = this.description;
+ });
+
+ // keywords is a multi-value autocomplete
+ // (this should probably be a simple jquery plugin)
+ keywords = data.keywords;
+ $('#keywords')
+ .bind('keydown', function(event) {
+ if (event.keyCode == $.ui.keyCode.TAB && $(this).autocomplete('instance').menu.active)
+ {
+ event.preventDefault();
+ }
+ })
+ .blur(function() {
+ $(this).val($(this).val().replace(/,\s*$/, ''));
+ })
+ .autocomplete({
+ source: function(request, response) {
+ response($.ui.autocomplete.filter(keywords, request.term.split(/,\s*/).pop()));
+ },
+ focus: function() {
+ return false;
+ },
+ select: function(event, ui) {
+ var terms = this.value.split(/,\s*/);
+ terms.pop();
+ terms.push(ui.item.value);
+ terms.push('');
+ this.value = terms.join(', ');
+ return false;
+ }
+ });
+
+ $('#cancel-btn').prop('disabled', false);
+ $('#top-save-btn').show();
+ $('#cancel-btn').show();
+ $('#commit-btn').show();
+ },
+ function() {
+ $('#mode-btn-readonly').show();
+ $('#mode-btn-loading').hide();
+ $('#mode-btn').prop('disabled', false);
+ $('#mode-btn').show();
+ $('#cancel-btn').hide();
+ $('#commit-btn').hide();
+
+ $('.edit-show').hide();
+ $('.edit-hide').show();
+ }
+ );
+ });
+ $('#mode-btn').prop('disabled', false);
+
+ // cc add/remove
+ $('#cc-btn')
+ .click(function(event) {
+ event.preventDefault();
+ var is_cced = $(event.target).data('is-cced') == '1';
+
+ var cc_change;
+ if (is_cced) {
+ cc_change = { remove: [ BUGZILLA.user.login ] };
+ $('#cc-btn')
+ .text('Follow')
+ .data('is-cced', '0')
+ .prop('disabled', true);
+ }
+ else {
+ cc_change = { add: [ BUGZILLA.user.login ] };
+ $('#cc-btn')
+ .text('Stop following')
+ .data('is-cced', '1')
+ .prop('disabled', true);
+ }
+
+ bugzilla_ajax(
+ {
+ url: 'rest/bug/' + BUGZILLA.bug_id,
+ type: 'PUT',
+ data: JSON.stringify({ cc: cc_change })
+ },
+ function(data) {
+ $('#cc-btn').prop('disabled', false);
+ if (!(data.bugs[0].changes && data.bugs[0].changes.cc))
+ return;
+ if (data.bugs[0].changes.cc.added == BUGZILLA.user.login) {
+ $('#cc-btn')
+ .text('Stop following')
+ .data('is-cced', '1');
+ }
+ else if (data.bugs[0].changes.cc.removed == BUGZILLA.user.login) {
+ $('#cc-btn')
+ .text('Follow')
+ .data('is-cced', '0');
+ }
+ },
+ function(message) {
+ $('#cc-btn').prop('disabled', false);
+ }
+ );
+
+ });
+
+ // cancel button, reset the ui back to read-only state
+ // for now, do this with a redirect to self
+ // ideally this should revert all field back to their initially loaded
+ // values and switch the ui back to read-only mode without the redirect
+ $('#cancel-btn')
+ .click(function(event) {
+ event.preventDefault();
+ window.location.replace($('#this-bug').val());
+ });
+
+ // top comment button, scroll the textarea into view
+ $('.comment-btn')
+ .click(function(event) {
+ event.preventDefault();
+ // focus first to grow the textarea, so we scroll to the correct location
+ $('#comment').focus();
+ scroll_to($('#bottom-save-btn'));
+ });
+
+ // needinfo in people section -> scroll to near-comment ui
+ $('#needinfo-scroll')
+ .click(function(event) {
+ event.preventDefault();
+ scroll_to($('#needinfo_role'), function() { $('#needinfo_role').focus(); });
+ });
+
+ // knob
+ $('#bug_status')
+ .change(function(event) {
+ if (event.target.value == "RESOLVED" || event.target.value == "VERIFIED") {
+ $('#resolution').change().show();
+ }
+ else {
+ $('#resolution').hide();
+ $('#duplicate-container').hide();
+ $('#mark-as-dup-btn').show();
+ }
+ })
+ .change();
+ $('#resolution')
+ .change(function(event) {
+ if (event.target.value == "DUPLICATE") {
+ $('#duplicate-container').show();
+ $('#mark-as-dup-btn').hide();
+ $('#dup_id').focus();
+ }
+ else {
+ $('#duplicate-container').hide();
+ $('#mark-as-dup-btn').show();
+ }
+ })
+ .change();
+ $('#mark-as-dup-btn')
+ .click(function(event) {
+ event.preventDefault();
+ $('#bug_status').val('RESOLVED').change();
+ $('#resolution').val('DUPLICATE').change();
+ $('#dup_id').focus();
+ });
+
+ // add see-also button
+ $('.bug-urls-btn')
+ .click(function(event) {
+ event.preventDefault();
+ var name = event.target.id.replace(/-btn$/, '');
+ $(event.target).hide();
+ $('#' + name).show().focus();
+ });
+
+ // bug flag value <select>
+ $('.bug-flag')
+ .change(function(event) {
+ var target = $(event.target);
+ var id = target.prop('id').replace(/^flag(_type)?-(\d+)/, "#requestee$1-$2");
+ if (target.val() == '?') {
+ $(id + '-container').show();
+ $(id).focus().select();
+ }
+ else {
+ $(id + '-container').hide();
+ }
+ });
+
+ // tracking flags
+ $('.tracking-flags select')
+ .change(function(event) {
+ tracking_flag_change(event.target);
+ });
+
+ // add attachments
+ $('#attachments-add-btn')
+ .click(function(event) {
+ event.preventDefault();
+ window.location.replace('attachment.cgi?bugid=' + BUGZILLA.bug_id + '&action=enter');
+ });
+
+ // take button
+ $('#take-btn')
+ .click(function(event) {
+ event.preventDefault();
+ $('#field-assigned_to .edit-hide').hide();
+ $('#field-assigned_to .edit-show').show();
+ $('#assigned_to').val(BUGZILLA.user.login).focus().select();
+ $('#top-save-btn').show();
+ });
+
+ // reply button
+ $('.reply-btn')
+ .click(function(event) {
+ event.preventDefault();
+ var comment_id = $(event.target).data('reply-id');
+ var comment_author = $(event.target).data('reply-name');
+
+ var prefix = "(In reply to " + comment_author + " from comment #" + comment_id + ")\n";
+ var reply_text = "";
+ if (BUGZILLA.user.settings.quote_replies == 'quoted_reply') {
+ var text = $('#ct-' + comment_id).text();
+ reply_text = prefix + wrapReplyText(text);
+ }
+ else if (BUGZILLA.user.settings.quote_replies == 'simply_reply') {
+ reply_text = prefix;
+ }
+
+ // quoting a private comment, check the 'private' cb
+ $('#add-comment-private-cb').prop('checked',
+ $('#add-comment-private-cb:checked').length || $('#is-private-' + comment_id + ':checked').length);
+
+ // remove embedded links to attachment details
+ reply_text = reply_text.replace(/(attachment\s+\d+)(\s+\[[^\[\n]+\])+/gi, '$1');
+
+ if ($('#comment').val() != reply_text) {
+ $('#comment').val($('#comment').val() + reply_text);
+ }
+ scroll_to($('#comment'), function() { $('#comment').focus(); });
+ });
+
+ // add comment --> enlarge on focus
+ if (BUGZILLA.user.settings.zoom_textareas) {
+ $('#comment')
+ .focus(function(event) {
+ $(event.target).attr('rows', 25);
+ });
+ }
+
+ // add comment --> private
+ $('#add-comment-private-cb')
+ .click(function(event) {
+ if ($(event.target).prop('checked')) {
+ $('#comment').addClass('private-comment');
+ }
+ else {
+ $('#comment').removeClass('private-comment');
+ }
+ });
+
+ // show "save changes" button if there are any immediately editable elements
+ if ($('.module select:visible').length || $('.module input:visible').length) {
+ $('#top-save-btn').show();
+ }
+
+ // status/resolve as buttons
+ $('.resolution-btn')
+ .click(function(event) {
+ event.preventDefault();
+ $('#field-status-view').hide();
+ $('#field-status-edit .edit-hide').hide();
+ $('#field-status-edit .edit-show').show();
+ $('#field-status-edit').show();
+ $('#bug_status').val('RESOLVED').change();
+ $('#resolution').val($(event.target).text()).change();
+ $('#top-save-btn').show();
+ if ($(event.target).text() == "DUPLICATE") {
+ scroll_to($('body'));
+ }
+ else {
+ scroll_to($('body'), function() { $('#resolution').focus(); });
+ }
+ });
+ $('.status-btn')
+ .click(function(event) {
+ event.preventDefault();
+ $('#field-status-view').hide();
+ $('#field-status-edit .edit-hide').hide();
+ $('#field-status-edit .edit-show').show();
+ $('#field-status-edit').show();
+ $('#bug_status').val($(event.target).data('status')).change();
+ $('#top-save-btn').show();
+ scroll_to($('body'), function() { $('#bug_status').focus(); });
+ });
+
+ // vote button
+ // ideally this should function like CC and xhr it, but that would require
+ // a rewrite of the voting extension
+ $('#vote-btn')
+ .click(function(event) {
+ event.preventDefault();
+ window.location.replace('page.cgi?id=voting/user.html&bug_id=' + BUGZILLA.bug_id + '#vote_' + BUGZILLA.bug_id);
+ });
+
+ // user-story
+ $('#user-story-edit-btn')
+ .click(function(event) {
+ event.preventDefault();
+ $('#user-story').hide();
+ $('#user-story-edit-btn').hide();
+ $('#cf_user_story').show().focus().select();
+ $('#top-save-btn').show();
+ });
+ $('#user-story-reply-btn')
+ .click(function(event) {
+ event.preventDefault();
+ var text = "(Commenting on User Story)\n" + wrapReplyText($('#cf_user_story').val());
+ var current = $('#comment').val();
+ if (current != text) {
+ $('#comment').val(current + text);
+ $('#comment').focus();
+ scroll_to($('#bottom-save-btn'));
+ }
+ });
+
+ // custom textarea fields
+ $('.edit-textarea-btn')
+ .click(function(event) {
+ event.preventDefault();
+ var id = $(event.target).attr('id').replace(/-edit$/, '');
+ $(event.target).hide();
+ $('#' + id + '-view').hide();
+ $('#' + id).show().focus().select();
+ });
+
+ // date/datetime pickers
+ $('.cf_datetime').datetimepicker({
+ format: 'Y-m-d G:i:s',
+ datepicker: true,
+ timepicker: true,
+ scrollInput: false,
+ lazyInit: false, // there's a bug which prevents img->show from working with lazy:true
+ closeOnDateSelect: true
+ });
+ $('.cf_date').datetimepicker({
+ format: 'Y-m-d',
+ datepicker: true,
+ timepicker: false,
+ scrollInput: false,
+ lazyInit: false,
+ closeOnDateSelect: true
+ });
+ $('.cf_datetime-img, .cf_date-img')
+ .click(function(event) {
+ var id = $(event.target).attr('id').replace(/-img$/, '');
+ $('#' + id).datetimepicker('show');
+ });
+
+ // new bug button
+ $.contextMenu({
+ selector: '#new-bug-btn',
+ trigger: 'left',
+ items: [
+ {
+ name: 'Create a new Bug',
+ callback: function() {
+ window.open('enter_bug.cgi', '_blank');
+ }
+ },
+ {
+ name: '&hellip; in this product',
+ callback: function() {
+ window.open('enter_bug.cgi?product=' + encodeURIComponent($('#product').val()), '_blank');
+ }
+ },
+ {
+ name: '&hellip; in this component',
+ callback: function() {
+ window.open('enter_bug.cgi?' +
+ 'product=' + encodeURIComponent($('#product').val()) +
+ '&component=' + encodeURIComponent($('#component').val()), '_blank');
+ }
+ },
+ {
+ name: '&hellip; that blocks this bug',
+ callback: function() {
+ window.open('enter_bug.cgi?format=__default__' +
+ '&product=' + encodeURIComponent($('#product').val()) +
+ '&blocked=' + BUGZILLA.bug_id, '_blank');
+ }
+ },
+ {
+ name: '&hellip; that depends on this bug',
+ callback: function() {
+ window.open('enter_bug.cgi?format=__default__' +
+ '&product=' + encodeURIComponent($('#product').val()) +
+ '&dependson=' + BUGZILLA.bug_id, '_blank');
+ }
+ },
+ {
+ name: '&hellip; as a clone of this bug',
+ callback: function() {
+ window.open('enter_bug.cgi?format=__default__' +
+ '&product=' + encodeURIComponent($('#product').val()) +
+ '&cloned_bug_id=' + BUGZILLA.bug_id, '_blank');
+ }
+ },
+ {
+ name: '&hellip; as a clone, in a different product',
+ callback: function() {
+ window.open('enter_bug.cgi?format=__default__' +
+ '&cloned_bug_id=' + BUGZILLA.bug_id, '_blank');
+ }
+ },
+ ]
+ });
+
+});
+
+function confirmUnsafeURL(url) {
+ return confirm(
+ 'This is considered an unsafe URL and could possibly be harmful.\n' +
+ 'The full URL is:\n\n' + url + '\n\nContinue?');
+}
+
+// fix url after bug creation/update
+if (history && history.replaceState) {
+ var href = document.location.href;
+ if (!href.match(/show_bug\.cgi/)) {
+ history.replaceState(null, BUGZILLA.bug_title, 'show_bug.cgi?id=' + BUGZILLA.bug_id);
+ document.title = BUGZILLA.bug_title;
+ }
+ if (href.match(/show_bug\.cgi\?.*list_id=/)) {
+ href = href.replace(/[\?&]+list_id=(\d+|cookie)/, '');
+ history.replaceState(null, BUGZILLA.bug_title, href);
+ }
+}
+
+// ajax wrapper, to simplify error handling and auth
+function bugzilla_ajax(request, done_fn, error_fn) {
+ $('#xhr-error').hide('');
+ $('#xhr-error').html('');
+ request.url += (request.url.match('\\?') ? '&' : '?') +
+ 'Bugzilla_api_token=' + encodeURIComponent(BUGZILLA.api_token);
+ if (request.type != 'GET') {
+ request.contentType = 'application/json';
+ }
+ $.ajax(request)
+ .done(function(data) {
+ if (data.error) {
+ $('#xhr-error').html(data.message);
+ $('#xhr-error').show('fast');
+ if (error_fn)
+ error_fn(data.message);
+ }
+ else if (done_fn) {
+ done_fn(data);
+ }
+ })
+ .error(function(data) {
+ $('#xhr-error').html(data.responseJSON.message);
+ $('#xhr-error').show('fast');
+ if (error_fn)
+ error_fn(data.responseJSON.message);
+ });
+}
+
+// no-ops
+function initHidingOptionsForIE() {}
+function showFieldWhen() {}
diff --git a/extensions/BugModal/web/calendar.png b/extensions/BugModal/web/calendar.png
new file mode 100644
index 000000000..5eef6597a
--- /dev/null
+++ b/extensions/BugModal/web/calendar.png
Binary files differ
diff --git a/extensions/BugModal/web/throbber.gif b/extensions/BugModal/web/throbber.gif
new file mode 100644
index 000000000..bc4fa6561
--- /dev/null
+++ b/extensions/BugModal/web/throbber.gif
Binary files differ