Skip to content

Commit

Permalink
Use classis js to work with older browsers
Browse files Browse the repository at this point in the history
Only newer browsers can handle let and backtick strings.

Fixes #1445
  • Loading branch information
bitwiseman committed Jul 9, 2018
1 parent 2a4b63d commit cfb1af1
Showing 1 changed file with 42 additions and 40 deletions.
82 changes: 42 additions & 40 deletions web/common-function.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ function beautify() {
try {
additional_options = JSON.parse(additional_options);
opts = mergeObjects(opts, additional_options);
} catch {
} catch (e) {
$('#additional-options-error').show();
}
}
Expand Down Expand Up @@ -223,45 +223,47 @@ function mergeObjects(allOptions, additionalOptions) {
}

function submitIssue() {
let url = 'https://github.com/beautify-web/js-beautify/issues/new?';
let body = `# Description
> NOTE:
> * Check the list of open issues before filing a new issue.
> * Please update the expect output section to match how you would prefer the code to look.
# Input
The code looked like this before beautification:
\`\`\`
${the.lastInput}
\`\`\`
# Current Output
The code actually looked like this after beautification:
\`\`\`
${the.lastOutput}
\`\`\`
# Expected Output
The code should have looked like this after beautification:
\`\`\`
/*Adjust the code to look how you prefer the output to be.*/
${the.lastInput}
\`\`\`
## Environment
Browser User Agent:
${navigator.userAgent}
Language Selected:
${the.language}
## Settings
Example:
\`\`\`json
${the.lastOpts}
\`\`\`
`
var encoded = encodeURIComponent(body);
var url = 'https://github.com/beautify-web/js-beautify/issues/new?';
var submit_body = [
'# Description',
'> NOTE:',
'> * Check the list of open issues before filing a new issue.',
'> * Please update the expect output section to match how you would prefer the code to look.',
'',
'# Input',
'The code looked like this before beautification:',
'```',
the.lastInput,
'```',
'',
'# Current Output',
'The code actually looked like this after beautification:',
'```',
the.lastOutput,
'```',
'',
'# Expected Output',
'The code should have looked like this after beautification:',
'```',
'/*Adjust the code to look how you prefer the output to be.*/',
the.lastInput,
'```',
'',
'## Environment',
'Browser User Agent:',
navigator.userAgent,
'',
'Language Selected:',
the.language,
'',
'## Settings',
'Example:',
'```json',
the.lastOpts,
'```',
''];

var encoded = encodeURIComponent(submit_body.join('\n'));
url += 'body=' + encoded;

console.log(url);
Expand Down

0 comments on commit cfb1af1

Please sign in to comment.