Skip to content

Commit

Permalink
#3594 Fix tests
Browse files Browse the repository at this point in the history
- Fix JS validation errors
- Update help file validation to expect filenames without .md
  • Loading branch information
NateWr committed Oct 30, 2018
1 parent 3c69ec0 commit 3e1bb71
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 14 deletions.
1 change: 1 addition & 0 deletions js/controllers/HelpPanelHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@
* @param {{
* caller: jQueryObject,
* topic: string
* section: string
* }} options The options with which to open this handler
*/
$.pkp.controllers.HelpPanelHandler.prototype.openPanel_ =
Expand Down
8 changes: 5 additions & 3 deletions js/controllers/SiteHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,14 @@
'/plugins/generic/tinymce/plugins/pkpWordcount/plugin.js');


var contentCSS = $.pkp.app.tinyMceContentCSS;
var contentCSS = $.pkp.app.tinyMceContentCSS,
tinymceParams,
tinymceParamDefaults;
if ($.pkp.app.cdnEnabled) {
contentCSS = contentCSS + ', ' + $.pkp.app.tinyMceContentFont;
}

var tinymceParams, tinymceParamDefaults = {
tinymceParamDefaults = {
width: '100%',
resize: 'both',
entity_encoding: 'raw',
Expand Down Expand Up @@ -646,7 +648,7 @@
*/
$.pkp.controllers.SiteHandler.prototype.handleNotifyEvent =
function(caller, settings) {
pnotify = new PNotify(settings);
var pnotify = new PNotify(settings);
};


Expand Down
13 changes: 8 additions & 5 deletions js/controllers/modal/ModalHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,12 @@
$modalElement.removeClass('is_visible');
this.trigger('pkpModalClose');
setTimeout(function() {
if (modalHandler.options.closeCleanVueInstances.length) {
for (var i = 0; i < modalHandler.options.closeCleanVueInstances.length; i++) {
var id = modalHandler.options.closeCleanVueInstances[i];
var vueInstances = modalHandler.options.closeCleanVueInstances,
i,
id;
if (vueInstances.length) {
for (i = 0; i < vueInstances.length; i++) {
id = vueInstances[i];
if (typeof pkp.registry._instances[id] !== 'undefined') {
pkp.registry._instances[id].$destroy();
}
Expand Down Expand Up @@ -328,8 +331,8 @@
* from a child form has been fired, and this form matches the config id
*
* @param {Object} source The Vue.js component which fired the event
* @param {Object} data Data attached to the event, which will include the
* form id.
* @param {Object} formId The form component's id prop
* @private
*/
$.pkp.controllers.modal.ModalHandler.prototype.onFormSuccess_ =
function(source, formId) {
Expand Down
1 change: 1 addition & 0 deletions js/controllers/tab/workflow/WorkflowTabHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
$.pkp.controllers.tab =
$.pkp.controllers.tab || {};


/** @type {Object} */
$.pkp.controllers.tab.workflow =
$.pkp.controllers.tab.workflow || {};
Expand Down
2 changes: 1 addition & 1 deletion templates/controllers/tab/workflow/editorial.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
{include file="controllers/notification/inPlaceNotification.tpl" notificationId="editingNotification_"|concat:$submission->getId() requestOptions=$editingNotificationRequestOptions refreshOn="stageStatusUpdated"}

{* Help Link *}
{help file="editorial-workflow/copyediting.md" class="pkp_help_tab"}
{help file="editorial-workflow/copyediting" class="pkp_help_tab"}

<div class="pkp_context_sidebar">
{capture assign=copyeditingEditorDecisionsUrl}{url router=$smarty.const.ROUTE_PAGE page="workflow" op="editorDecisionActions" submissionId=$submission->getId() stageId=$stageId escape=false}{/capture}
Expand Down
2 changes: 1 addition & 1 deletion templates/controllers/tab/workflow/review.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*}

{* Help tab *}
{help file="editorial-workflow/review.md" class="pkp_help_tab"}
{help file="editorial-workflow/review" class="pkp_help_tab"}

<script type="text/javascript">
// Attach the JS file tab handler.
Expand Down
2 changes: 1 addition & 1 deletion templates/controllers/tab/workflow/submission.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*}

{* Help Link *}
{help file="editorial-workflow/submission.md" class="pkp_help_tab"}
{help file="editorial-workflow/submission" class="pkp_help_tab"}

<div class="pkp_context_sidebar">
{capture assign=submissionEditorDecisionsUrl}{url router=$smarty.const.ROUTE_PAGE page="workflow" op="editorDecisionActions" submissionId=$submission->getId() stageId=$stageId contextId="submission" escape=false}{/capture}
Expand Down
4 changes: 2 additions & 2 deletions tools/checkHelp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
# Look for help filenames referred to in templates and check that they all exist (in English)
ERRORS=0
for filename in `find . -name \*.tpl -exec sed -n -e "s/.*{help[^}]file=\"\([^\"#]\+\)[#\"].*/\1/p" "{}" ";"`; do
if [ ! -f docs/manual/en/$filename ]; then
echo "Help file \"$filename\" referred to in template does not exist!"
if [ ! -f docs/manual/en/$filename.md ]; then
echo "Help file \"$filename.md\" referred to in template does not exist!"
ERRORS=1
fi
done
Expand Down
4 changes: 3 additions & 1 deletion tools/closure-externs.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,9 @@ plupload.Uploader.prototype.removeFile = function(f) {};
plupload.Uploader.prototype.bind = function(eventName, f) {};

$.pkp.app = {
baseUrl: ''
baseUrl: '',
tinyMceContentCSS: '',
tinyMceContentFont: ''
};

$.pkp.locale = {
Expand Down

0 comments on commit 3e1bb71

Please sign in to comment.