Making WordPress.org

Ticket #830: 830.patch

File 830.patch, 28.6 KB (added by ocean90, 6 years ago)
  • trunk/trac.wordpress.org/templates/core/site-specific.html

     
    5050        duck_: 'Core Committer'
    5151};
    5252
     53var wpTracAutoCompleteUsers = {
     54        include: $.map( wpTracContributorLabels, function( v, k ) { return k } ),
     55        exclude: [
     56                'slackbot',
     57                'ircbot',
     58        ]
     59};
     60
    5361</script>
    5462</body>
    5563</html>
  • trunk/trac.wordpress.org/templates/site.html

     
    299299        var wpBugGardener = true;
    300300        </script>
    301301
     302        <script py:if="req.authname">
     303        var wpTracCurrentUser = "${req.authname}";
     304        </script>
     305
    302306        <!--! JavaScript -->
    303307        <script src="//s.w.org/style/trac/wp-trac.js?${scripts_version}"></script>
    304308
  • trunk/wordpress.org/public_html/style/trac/jquery.atwho.min.js

     
     1/*! jquery.atwho - v1.0.1 %>
     2* Copyright (c) 2015 chord.luo <chord.luo@gmail.com>;
     3* homepage: http://ichord.github.com/At.js
     4* Licensed MIT
     5*/
     6!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(c){return a.returnExportsGlobal=b(c)}):"object"==typeof exports?module.exports=b(require("jquery")):b(jQuery)}(this,function(){var a,b,c,d,e,f,g,h,i,j=[].slice,k={}.hasOwnProperty,l=function(a,b){function c(){this.constructor=a}for(var d in b)k.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a};b=function(){function a(a){this.currentFlag=null,this.controllers={},this.aliasMaps={},this.$inputor=$(a),this.setupRootElement(),this.listen()}return a.prototype.createContainer=function(a){var b;return null!=(b=this.$el)&&b.remove(),$(a.body).append(this.$el=$("<div class='atwho-container'></div>"))},a.prototype.setupRootElement=function(a,b){var c;if(null==b&&(b=!1),a)this.window=a.contentWindow,this.document=a.contentDocument||this.window.document,this.iframe=a;else{this.document=this.$inputor[0].ownerDocument,this.window=this.document.defaultView||this.document.parentWindow;try{this.iframe=this.window.frameElement}catch(d){throw c=d,this.iframe=null,new Error("iframe auto-discovery is failed.\nPlease use `serIframe` to set the target iframe manually.")}}return this.createContainer((this.iframeAsRoot=b)?this.document:document)},a.prototype.controller=function(a){var b,c,d,e;if(this.aliasMaps[a])c=this.controllers[this.aliasMaps[a]];else{e=this.controllers;for(d in e)if(b=e[d],d===a){c=b;break}}return c?c:this.controllers[this.currentFlag]},a.prototype.setContextFor=function(a){return this.currentFlag=a,this},a.prototype.reg=function(a,b){var c,d;return c=(d=this.controllers)[a]||(d[a]=this.$inputor.is("[contentEditable]")?new e(this,a):new h(this,a)),b.alias&&(this.aliasMaps[b.alias]=a),c.init(b),this},a.prototype.listen=function(){return this.$inputor.on("compositionstart",function(a){return function(){var b;return null!=(b=a.controller())&&b.view.hide(),a.isComposing=!0}}(this)).on("compositionend",function(a){return function(){return a.isComposing=!1}}(this)).on("keyup.atwhoInner",function(a){return function(b){return a.onKeyup(b)}}(this)).on("keydown.atwhoInner",function(a){return function(b){return a.onKeydown(b)}}(this)).on("scroll.atwhoInner",function(a){return function(b){var c;return null!=(c=a.controller())?c.view.hide(b):void 0}}(this)).on("blur.atwhoInner",function(a){return function(b){var c;return(c=a.controller())?c.view.hide(b,c.getOpt("displayTimeout")):void 0}}(this)).on("click.atwhoInner",function(a){return function(b){return a.dispatch(b)}}(this))},a.prototype.shutdown=function(){var a,b,c;c=this.controllers;for(b in c)a=c[b],a.destroy(),delete this.controllers[b];return this.$inputor.off(".atwhoInner"),this.$el.remove()},a.prototype.dispatch=function(a){return $.map(this.controllers,function(b){return function(c){var d;return(d=c.getOpt("delay"))?(clearTimeout(b.delayedCallback),b.delayedCallback=setTimeout(function(){return c.lookUp(a)?b.setContextFor(c.at):void 0},d)):c.lookUp(a)?b.setContextFor(c.at):void 0}}(this))},a.prototype.onKeyup=function(a){var b;switch(a.keyCode){case f.ESC:a.preventDefault(),null!=(b=this.controller())&&b.view.hide();break;case f.DOWN:case f.UP:case f.CTRL:$.noop();break;case f.P:case f.N:a.ctrlKey||this.dispatch(a);break;default:this.dispatch(a)}},a.prototype.onKeydown=function(a){var b,c;if(b=null!=(c=this.controller())?c.view:void 0,b&&b.visible())switch(a.keyCode){case f.ESC:a.preventDefault(),b.hide(a);break;case f.UP:a.preventDefault(),b.prev();break;case f.DOWN:a.preventDefault(),b.next();break;case f.P:if(!a.ctrlKey)return;a.preventDefault(),b.prev();break;case f.N:if(!a.ctrlKey)return;a.preventDefault(),b.next();break;case f.TAB:case f.ENTER:case f.SPACE:if(!b.visible())return;if(!this.controller().getOpt("spaceSelectsMatch")&&a.keyCode===f.SPACE)return;a.preventDefault(),b.choose(a);break;default:$.noop()}},a}(),c=function(){function a(a,b){this.app=a,this.at=b,this.$inputor=this.app.$inputor,this.id=this.$inputor[0].id||this.uid(),this.setting=null,this.query=null,this.pos=0,this.range=null,0===(this.$el=$("#atwho-ground-"+this.id,this.app.$el)).length&&this.app.$el.append(this.$el=$("<div id='atwho-ground-"+this.id+"'></div>")),this.model=new g(this),this.view=new i(this)}return a.prototype.uid=function(){return(Math.random().toString(16)+"000000000").substr(2,8)+(new Date).getTime()},a.prototype.init=function(a){return this.setting=$.extend({},this.setting||$.fn.atwho["default"],a),this.view.init(),this.model.reload(this.setting.data)},a.prototype.destroy=function(){return this.trigger("beforeDestroy"),this.model.destroy(),this.view.destroy(),this.$el.remove()},a.prototype.callDefault=function(){var a,b,c;c=arguments[0],a=2<=arguments.length?j.call(arguments,1):[];try{return d[c].apply(this,a)}catch(e){return b=e,$.error(""+b+" Or maybe At.js doesn't have function "+c)}},a.prototype.trigger=function(a,b){var c,d;return null==b&&(b=[]),b.push(this),c=this.getOpt("alias"),d=c?""+a+"-"+c+".atwho":""+a+".atwho",this.$inputor.trigger(d,b)},a.prototype.callbacks=function(a){return this.getOpt("callbacks")[a]||d[a]},a.prototype.getOpt=function(a){var b;try{return this.setting[a]}catch(c){return b=c,null}},a.prototype.insertContentFor=function(a){var b,c;return c=this.getOpt("insertTpl"),b=$.extend({},a.data("item-data"),{"atwho-at":this.at}),this.callbacks("tplEval").call(this,c,b)},a.prototype.renderView=function(a){var b;return b=this.getOpt("searchKey"),a=this.callbacks("sorter").call(this,this.query.text,a.slice(0,1001),b),this.view.render(a.slice(0,this.getOpt("limit")))},a.arrayToDefaultHash=function(a){var b,c,d,e;if(!$.isArray(a))return a;for(e=[],c=0,d=a.length;d>c;c++)b=a[c],e.push($.isPlainObject(b)?b:{name:b});return e},a.prototype.lookUp=function(a){var b,c;if(b=this.catchQuery(a))return c=function(a){return a&&a.length>0?this.renderView(this.constructor.arrayToDefaultHash(a)):this.view.hide()},this.model.query(b.text,$.proxy(c,this)),b},a}(),h=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}return l(b,a),b.prototype.catchQuery=function(){var a,b,c,d,e,f;return b=this.$inputor.val(),a=this.$inputor.caret("pos",{iframe:this.app.iframe}),f=b.slice(0,a),d=this.callbacks("matcher").call(this,this.at,f,this.getOpt("startWithSpace")),"string"==typeof d&&d.length<=this.getOpt("maxLen",20)?(e=a-d.length,c=e+d.length,this.pos=e,d={text:d,headPos:e,endPos:c},this.trigger("matched",[this.at,d.text])):(d=null,this.view.hide()),this.query=d},b.prototype.rect=function(){var a,b,c;if(a=this.$inputor.caret("offset",this.pos-1,{iframe:this.app.iframe}))return this.app.iframe&&!this.app.iframeAsRoot&&(b=$(this.app.iframe).offset(),a.left+=b.left,a.top+=b.top),c=this.app.document.selection?0:2,{left:a.left,top:a.top,bottom:a.top+a.height+c}},b.prototype.insert=function(a){var b,c,d,e,f;return b=this.$inputor,c=b.val(),d=c.slice(0,Math.max(this.query.headPos-this.at.length,0)),e=""===(e=this.getOpt("suffix"))?e:e||" ",a+=e,f=""+d+a+c.slice(this.query.endPos||0),b.val(f),b.caret("pos",d.length+a.length,{iframe:this.app.iframe}),b.is(":focus")||b.focus(),b.change()},b}(c),e=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}return l(b,a),b.prototype._getRange=function(){var a;return a=this.app.window.getSelection(),a.rangeCount>0?a.getRangeAt(0):void 0},b.prototype._setRange=function(a,b,c){return null==c&&(c=this._getRange()),c?(b=$(b)[0],"after"===a?(c.setEndAfter(b),c.setStartAfter(b)):(c.setEndBefore(b),c.setStartBefore(b)),c.collapse(!1),this._clearRange(c)):void 0},b.prototype._clearRange=function(a){var b;return null==a&&(a=this._getRange()),b=this.app.window.getSelection(),b.removeAllRanges(),b.addRange(a)},b.prototype._movingEvent=function(a){var b;return"click"===a.type||(b=a.which)===f.RIGHT||b===f.LEFT||b===f.UP||b===f.DOWN},b.prototype._unwrap=function(a){var b;return a=$(a).unwrap().get(0),(b=a.nextSibling)&&b.nodeValue&&(a.nodeValue+=b.nodeValue,$(b).remove()),a},b.prototype.catchQuery=function(a){var b,c,d,e,g,h,i,j,k,l;if(!this.app.isComposing&&(k=this._getRange())){if(a.which===f.ENTER)return(c=$(k.startContainer).closest(".atwho-query")).contents().unwrap(),c.is(":empty")&&c.remove(),(c=$(".atwho-query",this.app.document)).text(c.text()).contents().last().unwrap(),void this._clearRange();if(/firefox/i.test(navigator.userAgent)){if($(k.startContainer).is(this.$inputor))return void this._clearRange();a.which===f.BACKSPACE&&k.startContainer.nodeType===document.ELEMENT_NODE&&(i=k.startOffset-1)>=0?(l=k.cloneRange(),l.setStart(k.startContainer,i),$(l.cloneContents()).contents().last().is(".atwho-inserted")&&(e=$(k.startContainer).contents().get(i),this._setRange("after",$(e).contents().last()))):a.which===f.LEFT&&k.startContainer.nodeType===document.TEXT_NODE&&(b=$(k.startContainer.previousSibling),b.is(".atwho-inserted")&&0===k.startOffset&&this._setRange("after",b.contents().last()))}return $(k.startContainer).closest(".atwho-inserted").addClass("atwho-query").siblings().removeClass("atwho-query"),(c=$(".atwho-query",this.app.document)).length>0&&c.is(":empty")&&0===c.text().length&&c.remove(),this._movingEvent(a)||c.removeClass("atwho-inserted"),l=k.cloneRange(),l.setStart(k.startContainer,0),h=this.callbacks("matcher").call(this,this.at,l.toString(),this.getOpt("startWithSpace")),0===c.length&&"string"==typeof h&&(d=k.startOffset-this.at.length-h.length)>=0&&(k.setStart(k.startContainer,d),k.surroundContents((c=$("<span class='atwho-query'/>",this.app.document))[0]),g=c.contents().last().get(0),/firefox/i.test(navigator.userAgent)?(k.setStart(g,g.length),k.setEnd(g,g.length),this._clearRange(k)):this._setRange("after",g,k)),"string"==typeof h&&h.length<=this.getOpt("maxLen",20)?(j={text:h,el:c},this.trigger("matched",[this.at,j.text]),this.query=j):(this.view.hide(),this.query={el:c},c.text().indexOf(this.at)>=0&&(this._movingEvent(a)&&c.hasClass("atwho-inserted")?c.removeClass("atwho-query"):!1!==this.callbacks("afterMatchFailed").call(this,this.at,c)&&this._setRange("after",this._unwrap(c.text(c.text()).contents().first()))),null)}},b.prototype.rect=function(){var a,b,c;return c=this.query.el.offset(),this.app.iframe&&!this.app.iframeAsRoot&&(b=(a=$(this.app.iframe)).offset(),c.left+=b.left-this.$inputor.scrollLeft(),c.top+=b.top-this.$inputor.scrollTop()),c.bottom=c.top+this.query.el.height(),c},b.prototype.insert=function(a){var b,c,d;return c=(c=this.getOpt("suffix"))?c:c||" ",this.query.el.removeClass("atwho-query").addClass("atwho-inserted").html(a),(b=this._getRange())&&(b.setEndAfter(this.query.el[0]),b.collapse(!1),b.insertNode(d=this.app.document.createTextNode(c)),this._setRange("after",d,b)),this.$inputor.is(":focus")||this.$inputor.focus(),this.$inputor.change()},b}(c),g=function(){function a(a){this.context=a,this.at=this.context.at,this.storage=this.context.$inputor}return a.prototype.destroy=function(){return this.storage.data(this.at,null)},a.prototype.saved=function(){return this.fetch()>0},a.prototype.query=function(a,b){var c,d,e;return c=this.fetch(),d=this.context.getOpt("searchKey"),c=this.context.callbacks("filter").call(this.context,a,c,d)||[],e=this.context.callbacks("remoteFilter"),c.length>0||!e&&0===c.length?b(c):e.call(this.context,a,b)},a.prototype.fetch=function(){return this.storage.data(this.at)||[]},a.prototype.save=function(a){return this.storage.data(this.at,this.context.callbacks("beforeSave").call(this.context,a||[]))},a.prototype.load=function(a){return!this.saved()&&a?this._load(a):void 0},a.prototype.reload=function(a){return this._load(a)},a.prototype._load=function(a){return"string"==typeof a?$.ajax(a,{dataType:"json"}).done(function(a){return function(b){return a.save(b)}}(this)):this.save(a)},a}(),i=function(){function a(a){this.context=a,this.$el=$("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>"),this.timeoutID=null,this.context.$el.append(this.$el),this.bindEvent()}return a.prototype.init=function(){var a;return a=this.context.getOpt("alias")||this.context.at.charCodeAt(0),this.$el.attr({id:"at-view-"+a})},a.prototype.destroy=function(){return this.$el.remove()},a.prototype.bindEvent=function(){var a;return a=this.$el.find("ul"),a.on("mouseenter.atwho-view","li",function(b){return a.find(".cur").removeClass("cur"),$(b.currentTarget).addClass("cur")}).on("click.atwho-view","li",function(b){return function(c){return a.find(".cur").removeClass("cur"),$(c.currentTarget).addClass("cur"),b.choose(c),c.preventDefault()}}(this))},a.prototype.visible=function(){return this.$el.is(":visible")},a.prototype.choose=function(a){var b,c;return(b=this.$el.find(".cur")).length&&(c=this.context.insertContentFor(b),this.context.insert(this.context.callbacks("beforeInsert").call(this.context,c,b),b),this.context.trigger("inserted",[b,a]),this.hide(a)),this.context.getOpt("hideWithoutSuffix")?this.stopShowing=!0:void 0},a.prototype.reposition=function(a){var b,c,d,e;return e=this.context.app.iframeAsRoot?this.context.app.window:window,a.bottom+this.$el.height()-$(e).scrollTop()>$(e).height()&&(a.bottom=a.top-this.$el.height()),a.left>(c=$(e).width()-this.$el.width()-5)&&(a.left=c),b={left:a.left,top:a.bottom},null!=(d=this.context.callbacks("beforeReposition"))&&d.call(this.context,b),this.$el.offset(b),this.context.trigger("reposition",[b])},a.prototype.next=function(){var a,b;return a=this.$el.find(".cur").removeClass("cur"),b=a.next(),b.length||(b=this.$el.find("li:first")),b.addClass("cur"),this.$el.animate({scrollTop:Math.max(0,a.innerHeight()*(b.index()+2)-this.$el.height())},150)},a.prototype.prev=function(){var a,b;return a=this.$el.find(".cur").removeClass("cur"),b=a.prev(),b.length||(b=this.$el.find("li:last")),b.addClass("cur"),this.$el.animate({scrollTop:Math.max(0,a.innerHeight()*(b.index()+2)-this.$el.height())},150)},a.prototype.show=function(){var a;return this.stopShowing?void(this.stopShowing=!1):(this.visible()||(this.$el.show(),this.$el.scrollTop(0),this.context.trigger("shown")),(a=this.context.rect())?this.reposition(a):void 0)},a.prototype.hide=function(a,b){var c;if(this.visible())return isNaN(b)?(this.$el.hide(),this.context.trigger("hidden",[a])):(c=function(a){return function(){return a.hide()}}(this),clearTimeout(this.timeoutID),this.timeoutID=setTimeout(c,b))},a.prototype.render=function(a){var b,c,d,e,f,g,h;if(!($.isArray(a)&&a.length>0))return void this.hide();for(this.$el.find("ul").empty(),c=this.$el.find("ul"),f=this.context.getOpt("displayTpl"),g=0,h=a.length;h>g;g++)d=a[g],d=$.extend({},d,{"atwho-at":this.context.at}),e=this.context.callbacks("tplEval").call(this.context,f,d),b=$(this.context.callbacks("highlighter").call(this.context,e,this.context.query.text)),b.data("item-data",d),c.append(b);return this.show(),this.context.getOpt("highlightFirst")?c.find("li:first").addClass("cur"):void 0},a}(),f={DOWN:40,UP:38,ESC:27,TAB:9,ENTER:13,CTRL:17,P:80,N:78,LEFT:37,UP:38,RIGHT:39,DOWN:40,BACKSPACE:8,SPACE:32},d={beforeSave:function(a){return c.arrayToDefaultHash(a)},matcher:function(a,b,c){var d,e,f,g;return a=a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),c&&(a="(?:^|\\s)"+a),f=decodeURI("%C3%80"),g=decodeURI("%C3%BF"),e=new RegExp(""+a+"([A-Za-z"+f+"-"+g+"0-9_.+-]*)$|"+a+"([^\\x00-\\xff]*)$","gi"),d=e.exec(b),d?d[2]||d[1]:null},filter:function(a,b,c){var d,e,f,g;for(g=[],e=0,f=b.length;f>e;e++)d=b[e],~new String(d[c]).toLowerCase().indexOf(a.toLowerCase())&&g.push(d);return g},remoteFilter:null,sorter:function(a,b,c){var d,e,f,g;if(!a)return b;for(g=[],e=0,f=b.length;f>e;e++)d=b[e],d.atwho_order=new String(d[c]).toLowerCase().indexOf(a.toLowerCase()),d.atwho_order>-1&&g.push(d);return g.sort(function(a,b){return a.atwho_order-b.atwho_order})},tplEval:function(a,b){var c;try{return a.replace(/\$\{([^\}]*)\}/g,function(a,c){return b[c]})}catch(d){return c=d,""}},highlighter:function(a,b){var c;return b?(c=new RegExp(">\\s*(\\w*?)("+b.replace("+","\\+")+")(\\w*)\\s*<","ig"),a.replace(c,function(a,b,c,d){return"> "+b+"<strong>"+c+"</strong>"+d+" <"})):a},beforeInsert:function(a){return a},beforeReposition:function(a){return a},afterMatchFailed:function(){}},a={load:function(a,b){var c;return(c=this.controller(a))?c.model.load(b):void 0},isSelecting:function(){var a;return null!=(a=this.controller())?a.view.visible():void 0},setIframe:function(a,b){return this.setupRootElement(a,b),null},run:function(){return this.dispatch()},destroy:function(){return this.shutdown(),this.$inputor.data("atwho",null)}},$.fn.atwho=function(c){var d,e;return e=arguments,d=null,this.filter('textarea, input, [contenteditable=""], [contenteditable=true]').each(function(){var f,g;return(g=(f=$(this)).data("atwho"))||f.data("atwho",g=new b(this)),"object"!=typeof c&&c?a[c]&&g?d=a[c].apply(g,Array.prototype.slice.call(e,1)):$.error("Method "+c+" does not exist on jQuery.caret"):g.reg(c.at,c)}),d||this},$.fn.atwho["default"]={at:void 0,alias:void 0,data:null,displayTpl:"<li>${name}</li>",insertTpl:"${atwho-at}${name}",callbacks:d,searchKey:"name",suffix:void 0,hideWithoutSuffix:!1,startWithSpace:!0,highlightFirst:!0,limit:5,maxLen:20,displayTimeout:300,delay:null,spaceSelectsMatch:!1}});
  • trunk/wordpress.org/public_html/style/trac/jquery.caret.min.js

     
     1/*! jquery.caret 2015-02-01 */
     2!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(c){return a.returnExportsGlobal=b(c)}):"object"==typeof exports?module.exports=b(require("jquery")):b(jQuery)}(this,function(a){"use strict";var b,c,d,e,f,g,h,i,j,k,l;k="caret",b=function(){function b(a){this.$inputor=a,this.domInputor=this.$inputor[0]}return b.prototype.setPos=function(){return this.domInputor},b.prototype.getIEPosition=function(){return this.getPosition()},b.prototype.getPosition=function(){var a,b;return b=this.getOffset(),a=this.$inputor.offset(),b.left-=a.left,b.top-=a.top,b},b.prototype.getOldIEPos=function(){var a,b;return b=h.selection.createRange(),a=h.body.createTextRange(),a.moveToElementText(this.domInputor),a.setEndPoint("EndToEnd",b),a.text.length},b.prototype.getPos=function(){var a,b,c;return(c=this.range())?(a=c.cloneRange(),a.selectNodeContents(this.domInputor),a.setEnd(c.endContainer,c.endOffset),b=a.toString().length,a.detach(),b):h.selection?this.getOldIEPos():void 0},b.prototype.getOldIEOffset=function(){var a,b;return a=h.selection.createRange().duplicate(),a.moveStart("character",-1),b=a.getBoundingClientRect(),{height:b.bottom-b.top,left:b.left,top:b.top}},b.prototype.getOffset=function(){var b,c,d,e,f;return j.getSelection&&(d=this.range())?(d.endOffset-1>0&&d.endContainer===!this.domInputor&&(b=d.cloneRange(),b.setStart(d.endContainer,d.endOffset-1),b.setEnd(d.endContainer,d.endOffset),e=b.getBoundingClientRect(),c={height:e.height,left:e.left+e.width,top:e.top},b.detach()),c&&0!==(null!=c?c.height:void 0)||(b=d.cloneRange(),f=a(h.createTextNode("|")),b.insertNode(f[0]),b.selectNode(f[0]),e=b.getBoundingClientRect(),c={height:e.height,left:e.left,top:e.top},f.remove(),b.detach())):h.selection&&(c=this.getOldIEOffset()),c&&(c.top+=a(j).scrollTop(),c.left+=a(j).scrollLeft()),c},b.prototype.range=function(){var a;if(j.getSelection)return a=j.getSelection(),a.rangeCount>0?a.getRangeAt(0):null},b}(),c=function(){function b(a){this.$inputor=a,this.domInputor=this.$inputor[0]}return b.prototype.getIEPos=function(){var a,b,c,d,e,f,g;return b=this.domInputor,f=h.selection.createRange(),e=0,f&&f.parentElement()===b&&(d=b.value.replace(/\r\n/g,"\n"),c=d.length,g=b.createTextRange(),g.moveToBookmark(f.getBookmark()),a=b.createTextRange(),a.collapse(!1),e=g.compareEndPoints("StartToEnd",a)>-1?c:-g.moveStart("character",-c)),e},b.prototype.getPos=function(){return h.selection?this.getIEPos():this.domInputor.selectionStart},b.prototype.setPos=function(a){var b,c;return b=this.domInputor,h.selection?(c=b.createTextRange(),c.move("character",a),c.select()):b.setSelectionRange&&b.setSelectionRange(a,a),b},b.prototype.getIEOffset=function(a){var b,c,d,e;return c=this.domInputor.createTextRange(),a||(a=this.getPos()),c.move("character",a),d=c.boundingLeft,e=c.boundingTop,b=c.boundingHeight,{left:d,top:e,height:b}},b.prototype.getOffset=function(b){var c,d,e;return c=this.$inputor,h.selection?(d=this.getIEOffset(b),d.top+=a(j).scrollTop()+c.scrollTop(),d.left+=a(j).scrollLeft()+c.scrollLeft(),d):(d=c.offset(),e=this.getPosition(b),d={left:d.left+e.left-c.scrollLeft(),top:d.top+e.top-c.scrollTop(),height:e.height})},b.prototype.getPosition=function(b){var c,e,f,g,h,i,j;return c=this.$inputor,g=function(b){return a("<div></div>").text(b).html().replace(/\r\n|\r|\n/g,"<br/>").replace(/\s/g,"&nbsp;")},void 0===b&&(b=this.getPos()),j=c.val().slice(0,b),f=c.val().slice(b),h="<span style='position: relative; display: inline;'>"+g(j)+"</span>",h+="<span id='caret' style='position: relative; display: inline;'>|</span>",h+="<span style='position: relative; display: inline;'>"+g(f)+"</span>",i=new d(c),e=i.create(h).rect()},b.prototype.getIEPosition=function(a){var b,c,d,e,f;return d=this.getIEOffset(a),c=this.$inputor.offset(),e=d.left-c.left,f=d.top-c.top,b=d.height,{left:e,top:f,height:b}},b}(),d=function(){function b(a){this.$inputor=a}return b.prototype.css_attr=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle","borderTopWidth","boxSizing","fontFamily","fontSize","fontWeight","height","letterSpacing","lineHeight","marginBottom","marginLeft","marginRight","marginTop","outlineWidth","overflow","overflowX","overflowY","paddingBottom","paddingLeft","paddingRight","paddingTop","textAlign","textOverflow","textTransform","wordBreak","wordWrap"],b.prototype.mirrorCss=function(){var b,c=this;return b={position:"absolute",left:-9999,top:0,zIndex:-2e4,whiteSpace:"pre-wrap"},"TEXTAREA"===this.$inputor.prop("tagName")&&this.css_attr.push("width"),a.each(this.css_attr,function(a,d){return b[d]=c.$inputor.css(d)}),b},b.prototype.create=function(b){return this.$mirror=a("<div></div>"),this.$mirror.css(this.mirrorCss()),this.$mirror.html(b),this.$inputor.after(this.$mirror),this},b.prototype.rect=function(){var a,b,c;return a=this.$mirror.find("#caret"),b=a.position(),c={left:b.left,top:b.top,height:a.height()},this.$mirror.remove(),c},b}(),e={contentEditable:function(a){return!(!a[0].contentEditable||"true"!==a[0].contentEditable)}},g={pos:function(a){return a||0===a?this.setPos(a):this.getPos()},position:function(a){return h.selection?this.getIEPosition(a):this.getPosition(a)},offset:function(a){var b;return b=this.getOffset(a)}},h=null,j=null,i=null,l=function(a){var b;return(b=null!=a?a.iframe:void 0)?(i=b,j=b.contentWindow,h=b.contentDocument||j.document):(i=void 0,j=window,h=document)},f=function(a){var b;h=a[0].ownerDocument,j=h.defaultView||h.parentWindow;try{return i=j.frameElement}catch(c){b=c}},a.fn.caret=function(d,f,h){var i;return g[d]?(a.isPlainObject(f)?(l(f),f=void 0):l(h),i=e.contentEditable(this)?new b(this):new c(this),g[d].apply(i,[f])):a.error("Method "+d+" does not exist on jQuery.caret")},a.fn.caret.EditableCaret=b,a.fn.caret.InputCaret=c,a.fn.caret.Utils=e,a.fn.caret.apis=g});
     3 No newline at end of file
  • trunk/wordpress.org/public_html/style/trac/wp-trac.css

     
    16481648        display: none;
    16491649}
    16501650
     1651/**
     1652 * Autocomplete via At.js.
     1653 */
     1654
     1655.atwho-container {
     1656        font-size: 1.3em
     1657}
     1658
     1659.atwho-view {
     1660        position: absolute;
     1661        top: 0;
     1662        left: 0;
     1663        display: none;
     1664        margin-top: 18px;
     1665        background: #fff;
     1666        color: black;
     1667        border: 1px solid #ccc;
     1668        box-shadow: 0 1px 2px rgba(0,0,0,0.1);
     1669        min-width: 120px;
     1670        max-height: 200px;
     1671        overflow: auto;
     1672        z-index: 11110 !important;
     1673}
     1674
     1675.atwho-view .cur {
     1676        background: #0073aa;
     1677        color: #fff;
     1678}
     1679
     1680.atwho-view .cur small {
     1681        color: #fff;
     1682}
     1683
     1684.atwho-view strong {
     1685        color: #0073aa;
     1686}
     1687
     1688.atwho-view .cur strong {
     1689        color: #fff;
     1690        font: bold;
     1691}
     1692
     1693.atwho-view ul {
     1694        /* width: 100px; */
     1695        list-style: none;
     1696        padding: 0;
     1697        margin: auto;
     1698}
     1699
     1700.atwho-view ul li {
     1701        display: block;
     1702        padding: 5px 10px;
     1703        border-bottom: 1px solid #ccc;
     1704        cursor: pointer;
     1705}
     1706
     1707.atwho-view ul li:last-child {
     1708        border-bottom: 0;
     1709}
     1710
     1711.atwho-view small {
     1712        font-size: smaller;
     1713        color: #777;
     1714        font-weight: normal;
     1715}
     1716
     1717
    16511718/* =Responsive / Mobile
    16521719----------------------------------------------- */
    16531720@media (max-width: 770px) {
  • trunk/wordpress.org/public_html/style/trac/wp-trac.js

     
    4343        wpTrac = {
    4444
    4545                gardener: typeof wpBugGardener !== 'undefined',
     46                currentUser: wpTracCurrentUser,
    4647
    4748                init: function() {
    4849                        wpTrac.hacks();
     
    5455                                wpTrac.showContributorLabels( wpTracContributorLabels );
    5556                        }
    5657
     58                        wpTrac.autocomplete.init();
     59
    5760                        if ( ! $(document.body).hasClass( 'plugins' ) ) {
    5861                                wpTrac.workflow.init();
    5962                                if ( $(document.body).hasClass( 'core' ) ) {
     
    7376                                }
    7477                        });
    7578                },
     79
    7680                // These ticket hacks need to be re-run after ticket previews.
    7781                postPreviewHacks: function() {
    7882                        // Automatically preview images.
     
    411415                        });
    412416                },
    413417
     418                autocomplete: (function() {
     419                        var users,
     420                                attachments,
     421                                settings = {};
     422
     423                        return {
     424                                init: function() {
     425                                        if ( ! $( '#comment' ).length ) {
     426                                                return;
     427                                        }
     428
     429                                        if ( 'undefined' !== typeof wpTracAutoCompleteUsers ) {
     430                                                settings = wpTracAutoCompleteUsers;
     431                                        }
     432
     433                                        users = this.getUsers();
     434                                        attachments  = this.getAttachments();
     435
     436                                        $( '#comment' ).atwho({
     437                                                at:  '@',
     438                                                data: users
     439                                        }).atwho({
     440                                                at: '[att',
     441                                                insertTpl: '${atwho-at}achment:${name}]',
     442                                                displayTpl: '<li>${display}</li>',
     443                                                data: attachments
     444                                        });
     445                                },
     446
     447                                getUsers: function() {
     448                                        var users  = [], exclude = [];
     449
     450                                        if ( 'undefined' !== settings.exclude ) {
     451                                                exclude = settings.exclude;
     452                                        }
     453
     454                                        // Most recent should show up first.
     455                                        $( $( '.change .username' ).get().reverse() ).each( function() {
     456                                                var username = $(this).data( 'username' );
     457                                                if (
     458                                                        typeof username !== 'undefined' &&
     459                                                        -1 === $.inArray( username, users ) &&
     460                                                        -1 === $.inArray( username, exclude )
     461                                                ) {
     462                                                        users.push( $(this).data( 'username' ) );
     463                                                }
     464                                        });
     465
     466                                        // Add additional users.
     467                                        if ( 'undefined' !== typeof settings.include ) {
     468                                                $.each( settings.include, function( k, username ) {
     469                                                        if ( -1 === $.inArray( username, users ) ) {
     470                                                                users.push( username );
     471                                                        }
     472                                                });
     473                                        }
     474
     475                                        // Exclude current user.
     476                                        if ( 'undefined' !== wpTrac.currentUser ) {
     477                                                users = $.grep( users, function( user ) {
     478                                                        return user != wpTrac.currentUser;
     479                                                });
     480                                        }
     481
     482                                        return users;
     483                                },
     484
     485                                getAttachments: function() {
     486                                        var attachments = [];
     487
     488                                        // Most recent should show up first.
     489                                        $ ($( 'dl.attachments dt' ).get().reverse() ).each( function() {
     490                                                attachments.push({
     491                                                        display: $( this ).text(),
     492                                                        name: $( this ).find( 'a[title="View attachment"]' ).text()
     493                                                });
     494                                        });
     495
     496                                        return attachments;
     497                                }
     498                        };
     499                }()),
     500
    414501                workflow: (function() {
    415502                        var keywords = {},
    416503                                originalKeywords = {},