How to cancel autoload modal?

Hi @asmecher,

How to cancel autoload file upload modal for submission step 2?

Regards,

Hi @peditor,

What version of OJS are you using? (Please include this with your posts.)

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

I’m using OJS 3.2.0-2. I want to cancel autoload file upload modal for submission step 2? How can i do this?

Regards,

Hi @peditor,

That’s implemented in lib/pkp/js/pages/submission/SubmissionStep2FormHandler.js:

/**
 * When the files grid is shown on step 2, click the 'add files'
 *  link action.
 * @private
 * @param {HTMLElement} sourceElement The element that
 *  issued the event.
 * @param {Event} event The triggering event.
 * @param {?string} data additional event data.
 */
$.pkp.pages.submission.SubmissionStep2FormHandler.
               prototype.showFileUploadWizard_ = function(sourceElement, event, data) {
         // OJS and OMP use addFile; PPS uses addGalley
        $('#' + data).find('[id*="-addFile-button-"], [id*="-addGalley-button-"]')
                        .click();
};

However, if you’re using the minified Javascript (see the enable_minified setting in config.inc.php, you’ll have to rebuild the compiled Javascript before changes will take effect. The lib/pkp/tools/buildjs.sh script does that.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

Thank you, for your help. It worked fine when minified off. I get the error below when The lib/pkp/tools/buildjs.sh script run.

Starting PKP JavaScript builder.
Copyright (c) 2014-2020 Simon Fraser University
Copyright (c) 2010-2020 John Willinsky
which: no gjslint in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin)

Google Closure Linter not found in PATH. Please go
to https://developers.google.com/closure/utilities/docs/linter_howto
and make sure that you correctly install the tool before you run
buildjs.sh.

JSLint4Java must be installed in the ‘/root/bin’
directory. Please download the tool from
http://code.google.com/p/jslint4java/,
rename it to jslint4java.jar and try again.

Google Closure Compiler not found in ‘/root/bin’
Please go to https://developers.google.com/closure/compiler/
and download the tool. Then try again.

Exiting!

Regards,

Hi @peditor,

Yes, you’re missing some tools that are required to build the Javascript. Follow the instructions given by above to install them. On the Travis (Ubuntu-based) platform, those steps are scripted in the https://github.com/pkp/pkp-lib/blob/master/tools/travis/install-linter.sh script. You can use those commands as an example. Note that this script is intended for the Travis environment, though, so you might need to adapt the commands for your own system.

Regards,
Alec Smecher
Public Knowledge Project Team

Thank you @asmecher
Regards,

Hi @asmecher

I get the error below when Buildjs.sh script run.

`Compile (Check)...`

        /tmp/tmp.8UukMkIDIJ/lib/pkp/js/lib/jquery/plugins/jquery.form.js:26: ERROR - [JSC_PARSE_ERROR] Parse error. ')' expected
        "use strict";
        ^

        /tmp/tmp.8UukMkIDIJ/lib/pkp/js/lib/jquery/plugins/jquery.pkp.js:87: ERROR - [JSC_PARSE_ERROR] Parse error. primary expression expected
        })(jQuery);
         ^

        /tmp/tmp.8UukMkIDIJ/lib/pkp/js/lib/jquery/plugins/jquery.tag-it.js:590: ERROR - [JSC_PARSE_ERROR] Parse error. primary expression expected
        })(jQuery);
         ^

        3 error(s), 0 warning(s)

Found Errors! Not minified.

Hi @peditor,

I’d suggest trying with the version of the JS linter that’s referenced in the install-linter.sh script linked above; I suspect you’re using a different version of the linter with different rules.

Regards,
Alec Smecher
Public Knowledge Project Team