[mission] Don't remove permalink in mission details

This commit is contained in:
fkloft 2015-04-13 22:42:12 +02:00
parent 212b980683
commit 531f707a7c
2 changed files with 9 additions and 15 deletions

View File

@ -34,7 +34,7 @@
margin-bottom: 5px; margin-bottom: 5px;
} }
.plugin-mission-summary > a, .plugin-mission-summary > h4 { .plugin-mission-summary > a {
display: block; display: block;
font-weight: bold; font-weight: bold;
font-size: 1.3em; font-size: 1.3em;
@ -70,8 +70,9 @@
vertical-align: top; vertical-align: top;
} }
.plugin-mission-summary description { .plugin-mission-details .plugin-mission-summary > a,
white-space: pre; .plugin-mission-details .plugin-mission-summary .description {
white-space: pre-line;
margin-left: 110px; margin-left: 110px;
} }

View File

@ -136,7 +136,7 @@ window.plugin.missions = {
var me = this; var me = this;
var markers = this.highlightMissionPortals(mission); var markers = this.highlightMissionPortals(mission);
dialog({ dialog({
// id: 'mission-' + mission.guid, id: 'plugin-mission-details-' + mission.guid.replace(/\./g, '_') /* dots irritate the dialog framework */,
title: mission.title, title: mission.title,
height: 'auto', height: 'auto',
html: this.renderMission(mission), html: this.renderMission(mission),
@ -145,7 +145,7 @@ window.plugin.missions = {
me.unhighlightMissionPortals(markers); me.unhighlightMissionPortals(markers);
}, },
collapseCallback: this.collapseFix, collapseCallback: this.collapseFix,
expandCallback: this.collapseFix expandCallback: this.collapseFix,
}).dialog('option', 'buttons', { }).dialog('option', 'buttons', {
'Zoom to mission': function() { 'Zoom to mission': function() {
me.zoomToMission(mission); me.zoomToMission(mission);
@ -304,13 +304,13 @@ window.plugin.missions = {
var title = container.appendChild(document.createElement('a')); var title = container.appendChild(document.createElement('a'));
title.textContent = mission.title; title.textContent = mission.title;
title.href = '/mission/' + mission.guid; // TODO make IITC load on mission permalinks as well title.href = '/mission/' + mission.guid;
title.addEventListener('click', function(ev) { title.addEventListener('click', function(ev) {
plugin.missions.openMission(mission.guid); this.openMission(mission.guid);
// prevent browser from following link // prevent browser from following link
ev.preventDefault(); ev.preventDefault();
return false; return false;
}, false); }.bind(this), false);
if(cachedMission) { if(cachedMission) {
var span = container.appendChild(document.createElement('span')); var span = container.appendChild(document.createElement('span'));
@ -406,17 +406,10 @@ window.plugin.missions = {
var summary = container.appendChild(this.renderMissionSummary(mission)); var summary = container.appendChild(this.renderMissionSummary(mission));
// replace link with heading
var title = summary.getElementsByTagName('a')[0];
var newtitle = document.createElement('h4');
newtitle.textContent = mission.title;
title.parentNode.replaceChild(newtitle, title);
var desc = summary.appendChild(document.createElement('p')); var desc = summary.appendChild(document.createElement('p'));
desc.className = 'description'; desc.className = 'description';
desc.textContent = mission.description; desc.textContent = mission.description;
var list = container.appendChild(document.createElement('ol')) var list = container.appendChild(document.createElement('ol'))
mission.waypoints.forEach(function(waypoint, index) { mission.waypoints.forEach(function(waypoint, index) {
list.appendChild(this.renderMissionWaypoint(waypoint, index, mission)); list.appendChild(this.renderMissionWaypoint(waypoint, index, mission));