Skip to content

Commit

Permalink
Compatibility with new WRMS UI
Browse files Browse the repository at this point in the history
  • Loading branch information
jlabusch committed Feb 4, 2014
1 parent a31126f commit b53054b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "wrms-kanban",
"version": "0.6.13",
"version": "0.7.0",
"update_url": "http://foo.wgtn.cat-it.co.nz/wrms-kanban.xml",
"description": "Generates simple Kanban boards for WRMS ticket groups",
"icons": {
Expand Down
14 changes: 5 additions & 9 deletions wrms-kanban.js
Original file line number Diff line number Diff line change
Expand Up @@ -446,22 +446,19 @@
return m;
}

// We can't use anchors on WRMS > 2.10.1 :(
var kanban = {
show: function(){
$('#kanban-overlay').height($(document).height());
$('#kanban-overlay').show();
var h = window.location.href;
window.location.href = h + (h.match(/#kanban$/) ? '' :
h.match(/#$/) ? 'kanban' :
'#kanban');
},
hide: function(){
$('#kanban-overlay').hide();
window.location.href = window.location.href.replace(/kanban$/, '');
}
};

$(document).ready(function(){
var new_wrms = $('.tab-title').length;
try{
__parent_wr = $('#tmnu > a:nth-of-type(1)').text().match(/(\d+)/)[1];

Expand Down Expand Up @@ -492,7 +489,9 @@
apply_override('Pending QA', 'Test');
apply_override('QA Approved', 'UAT');
}
var details = $('table.wr-details').find('tr:nth-of-type(13) > td').text();
var details = new_wrms === 0
? $('table.wr-details').find('tr:nth-of-type(13) > td').text()
: $('th.prompt:contains(Details)').next().text();
_.each(details.split(/\n/), function(line){
var override = line.match(/\[kanban:\s*([a-zA-Z ]+?)\s*->\s*([a-zA-Z ]+?)\s*\]/);
if (override){
Expand All @@ -514,9 +513,6 @@
}
__model = render_model(validate_model(r));
});
if (window.location.href.match(/#kanban/)){
kanban.show();
}
setTimeout(update_children, __refresh_interval);
}catch(ex){
log.error('main', 'Exception while adding Kanban menu entry', ex);
Expand Down

0 comments on commit b53054b

Please sign in to comment.