Keyboard shortcut "." (Operations Dialog) does not work after last update

Rasmus Luckow-Nielsen August 6, 2012

We have a onDemand Jira and use Greenhopper a lot. We're very fond of using keyboard shortcuts, but the last couple of weeks the . shortcut does not seem to work properly, and I can see errors reported in Chromes inspector (see screenshot).

We're primarily using Chrome on OSX, and it seems to have been the issue since your last update of Jira onDemand (where it began to hint the usage of , in order to do something).

Full error rapport:

Uncaught TypeError: Cannot set property 'triggerEvent' of undefined com.atlassian.jira.jira-quick-edit-plugin:quick-form.js:2

Uncaught TypeError: Cannot call method 'extend' of undefined com.atlassian.jira.jira-quick-edit-plugin:quick-create-issue.js:1

Your are trying to create a ToggleBlock with selector '.toggle-trigger'.One already exists with this trigger so has been ignored. batch.js:480

Your are trying to create a ToggleBlock with selector '.toggle-trigger'.One already exists with this trigger so has been ignored. batch.js:480

Failed to run init function: TypeError: Cannot set property 'type' of undefined

function ($) {

var effect = fade;

var dd,

cache = {},

cache_stack = ,

current_active,

browser = AJS.$.browser;

var hider = function (list) {

$(a span, list).each(function () {

var $a = $(this);

$a.addClass('search-result');

this.realhtml = this.realhtml || $a.html();

var words = this.realhtml.split( );

$a.html( + words.join( ) + );

var elpss = AJS(var);

elpss.html(…);

$a.append(elpss);

this.elpss = elpss;

var elwidth = $a 0 .elpss 0 .offsetWidth,

width = $a 0 .parentNode.parentNode.parentNode.parentNode.offsetWidth,

isLong = false;

$(span, $a).each(function (i) {

var $word = $(this);

if (isLong) {

$word.hide();

} else {

$word.show();

if (this.offsetLeft + this.offsetWidth + elwidth > width) {

$word.hide();

isLong = true;

}

}

});

$a 0 .elpss isLong ? show : hide ();

});

$(img, list).each(function() {

var $img = $(this);

var span = $img.siblings(a).children(span:first-child);

span.css('background-image', 'url(' + $img.attr('src') + ')');

$img.remove();

});

};

var moveHandler = function(selected, direction) {

if (current_active) {

current_active.removeClass('active');

}

current_active = selected;

current_active.addClass('active');

}

// see JST-5408

var displayEscapeHandler = function(obj) {

// search link for comes already html encoded

if(obj.className == 'search-for'){

return obj.name;

}

// the rest need to be encoded manually

if (AJS.escapeHtml) {

return AJS.escapeHtml(obj.name);

} else {

// confluence, fisheye, bamboo all run older versions of AJS that do not

// contain an escape HTML function.

// when they upgrade to AJS/AUI 3.4, we can remove this

return obj.name.replace(/&/g,'&')

.replace(/>/g,'>')

.replace(/</g,'&lt;')>

.replace(//g,'"')

.replace(/'/g,''')

}

}

var searchBox = $(#studio-quick-search-query);

if ($.browser.webkit) {

searchBox 0 .type = search;

searchBox 0 .setAttribute(results, 10);

}

searchBox.focus(function () {

this.style.color = #000;

if (this.defaultValue == this.value) {

this.value = ;

}

}).blur(function () {

this.style.color = #ccc;

if (this.value.replace(/ s+/g, ) == ) {

this.value = this.defaultValue;

}

});

var jsonparser = function (json, resultStatus) {

var matches = json.statusMessage ? {html: json.statusMessage, className: error} : json.contentNameMatches;

var old_dd = dd;

current_active = null;

dd = AJS.dropDown(matches, {moveHandler: moveHandler, displayHandler: displayEscapeHandler}) 0 ;

dd.$.attr(id, quick-nav-drop-down).addClass(aui-dropdown); // FE/CRU 2.2 quirk.

dd.onhide = function (causer) {

if (causer == escape) {

searchBox.focus();

}

};

// You need to make all of the elements in the queryTokens Regex-safe

if(AJS.$.isArray(json.queryTokens)) {

var regexEscapedQueryTokens = AJS.$.map(json.queryTokens, RegExp.escape);

var queryTokenRegex = new RegExp(( + regexEscapedQueryTokens.join(|) + ), gi);

$(span, dd.$).html(function(htmlIndex, oldHtml) {

return oldHtml.replace(queryTokenRegex, $1);

});

}

hider(dd.$);

dd.hider = function () {

hider(dd.$);

};

AJS.onTextResize(dd.hider);

if (old_dd) {

dd.show();

dd.method = effect;

AJS.unbindTextResize(old_dd.hider);

old_dd.$.remove();

} else {

dd.show(effect);

}

};

/**

* Creates a scheduler for executing jsonp requests.

* TODO(jwilson): move to a more generic place ie. AUI

* @param initialDelay

* @param timeoutTime

*/

var jsonpTimeoutScheduler = function(initialDelay, timeoutTime) {

if (initialDelay < 0) {

throw ajaxTimeoutScheduler - initialDelay must be >= 0;

}

if (timeoutTime < 0) {

throw ajaxTimeoutScheduler - timeoutTime must >= 0;

}

var id = 0;

var pipeline = {};

var scheduled = {};

var callSuccess = function(ident, data, resultStatus) {

var pipe = pipeline ident ;

// Could check that callback is a function.

if (pipe && AJS.$.isFunction(pipe.callback)) {

// Wrap in try incase .clear() method is scheduled just before.

try {

pipe.callback(data, resultStatus);

} catch (err) {

AJS.log(err);

}

}

};

return {

// Would prefer to use events instead of the shceduled callback

'schedule' : function(requestUrl, requestData, scheduledCallback, successFunc, timeoutFunc) {

var self = this;

++id;

var t1 = setTimeout((function(_id){

var ident = _id;

return function() {

if (!scheduled ident ) {

// Don't schedule

return;

}

var successCallback = function (data, resultStatus) {

self.clear(ident);

successFunc(data, resultStatus);

}

var t2 = setTimeout(function() {

self.clear(ident);

timeoutFunc();

}, timeoutTime);

pipeline ident = {call_id:t1, timeout_id:t2, callback: successCallback};

AJS.$.getJSON(requestUrl, requestData, function(data, resultStatus) {

callSuccess(ident, data, resultStatus);

});

scheduledCallback(ident);

};

})(id), initialDelay);

scheduled id = t1;

return id;

},

'clear' : function(ident) {

delete scheduled ident ;

var pipe = pipeline ident ;

if (pipe) {

// Wrap in try incase the timeout is executed.

try {

clearTimeout(pipe.call_id);

clearTimeout(pipe.timeout_id);

pipe.callback = null

delete pipeline ident ;

} catch(err) {

AJS.log(err);

}

}

}

};

};

var scheduler = jsonpTimeoutScheduler(400, 5000);

var poller;

var quickSearchCallback = function(data, resultStatus) {

jsonparser(data, resultStatus);

};

var scheduledCallback = function(indent) {

var message = {contentNameMatches: {className:loading,html: } , statusMessage: };

jsonparser(message);

}

// Called when the ajax search takes too long.

var timeout = function() {

var searchFor = searchBox.val();

var escapedSearchFor = AJS.escape(searchFor);

// escape the searchFor param.

var htmlEscapedSearchFor = AJS.$('

').text(searchFor).html();

var timeoutMessage = {contentNameMatches: {className:search-for,href: studioData.jiraUrl + /secure/StudioSearch.jspa?query= + escapedSearchFor,icon:,name:Search for ‘+ htmlEscapedSearchFor +’,projectKey:} , queryTokens: searchFor ,statusMessage:};

jsonparser(timeoutMessage);

};

var scheduleSearch = function(value) {

var requestData = {

query : value,

studio : true,

searchAllUrl : studioData.jiraUrl+/secure/StudioSearch.jspa,

userProfileUrl : studioData.jiraUrl+/secure/ViewProfile.jspa?name=

};

var requestUrl = studioData.jiraUrl+/plugins/servlet/studio/quicknav?callback=?;

poller = scheduler.schedule(requestUrl, requestData, scheduledCallback, quickSearchCallback, timeout);

};

function validLength(value) {

return value.length >= 2;

}

function checkQuickSearch() {

var value = searchBox.val();

if (poller) {

scheduler.clear(poller);

poller = null;

checkQuickSearch();

} else if (validLength(value)) {

scheduleSearch(value);

} else {

dd && dd.hide();

}

}

searchBox.keypress(function(e) {

// Have to ignore some keypress events that only FF fires.

if (browser.mozilla && e.keyCode) {

return;

}

setTimeout(checkQuickSearch, 0);

});

searchBox.keyup(function(e) {

var key = e.which || e.keyCode;

switch (key) {

// Delete or backspace

case 8: // backspace key

case 46: // delete key

setTimeout(checkQuickSearch, 0);

break;

default:

// Do nothing

}

});

searchBox.focus(function(){

checkQuickSearch();

});

} batch.js:6

3 answers

1 accepted

0 votes
Answer accepted
Nick Mason
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 7, 2012

The most common cause I've seen for issues like this is a Chrome extension getting in the way. Could you try temporarily disabling all of them and testing again? The '.' shortcut definitely works for me on Mac OS X with both Chrome and Safari.

Rasmus Luckow-Nielsen August 12, 2012

Uhmm, it actually works now, which is weird. Still gets all the warnings in the console though.

And it works whether my 5 extensions are enabled or not.

Oh well, I'm happy now :-)

0 votes
Jon Camfield December 26, 2012

I get this error across multiple browsers when trying to "Switch on Translations" using the InProduct translation plugin

0 votes
Matt Cullerton August 13, 2012

Nick -

I have a situation where I am running into this error using Chrome, with no extensions enabled. Additionally, I am using a standalone system, not OnDemand. Is there a bug tracking this issue?

Thanks,

Matt

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events