Skip to content

Commit

Permalink
Improve script installation/update change log handling
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyvion committed Oct 3, 2018
1 parent 7bc6758 commit 01acc21
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 3 deletions.
1 change: 0 additions & 1 deletion assets/js/qc-ext-qcChangeLogDirective.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ var qcExt;
} else {
return;
}
$('#changeLogDialog').modal('show');
self.versionUpdated = true;
});

Expand Down
16 changes: 16 additions & 0 deletions assets/js/qc-ext-qcExtraDirective.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,17 @@ var qcExt;
comicService.comic > constants.taglineThreshold) {
self.missingDataInfo.push('a tagline');
}

if (qcExt.settings.version === undefined) {
// Version is undefined. We're a new user!
$log.debug('qcExtra(): Version undefined!');
self.showWelcomeMessage = true;
} else if (qcExt.settings.version !==
self.currentVersion) {
// Version is changed. Script has been updated!
$log.debug('qcExtra(): Version different!');
self.showUpdateMessage = true;
}
});
});

Expand Down Expand Up @@ -239,6 +250,11 @@ var qcExt;
$log.debug(item);
};

this.showChangeLog = function() {
self.showWelcomeMessage = false;
self.showUpdateMessage = false;
$('#changeLogDialog').modal('show');
};
}

qcExt.app.directive('qcExtra', function() {
Expand Down
10 changes: 9 additions & 1 deletion assets/sass/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,15 @@ $link-color: #2ba6cb;
margin-top: 10px;

&.first-header {
margin-top: 0px;
margin-top: 0;
}

&.update-header {
margin-top: 0;
margin-bottom: 0;

color: #e43;
font-weight: bold;
}

small {
Expand Down
4 changes: 3 additions & 1 deletion assets/templates/changeLog.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ <h4>Script updated!</h4>
<div ng-if="!clvm.previousVersion">
<h4>Script installed!</h4>
<p>Thank you for installing Questionable Content Extensions!</p>
</div>
</div>

<h4>NextVersion <small>NextDate</small></h4>
<ul>
<li>Use Angular's date formatting for a better user experience</li>
<li>Don't throw change log in user's face on update or fresh installation, instead show small notice</li>
</ul>

<h4>0.5.1 <small>April 8, 2017</small></h4>
Expand Down
12 changes: 12 additions & 0 deletions assets/templates/extra.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,18 @@
<tr ng-repeat="message in e.messages">
<td>{{ message }}</td>
</tr>
<tr ng-if="e.showWelcomeMessage">
<td>
<h1 class="update-header">Welcome to QC&nbsp;Extensions!</h1>
<a class="qc" ng-click="e.showChangeLog()">See change log!</a>
</td>
</tr>
<tr ng-if="e.showUpdateMessage">
<td>
<h1 class="update-header">QC Extensions updated!</h1>
<a class="qc" ng-click="e.showChangeLog()">See what's new!</a>
</td>
</tr>
<tr ng-if="e.settings.editMode && e.editorData.missing.any">
<td>
<h1 class="first-header">Comics with missing items</h1>
Expand Down

0 comments on commit 01acc21

Please sign in to comment.