- Code comments: Coding standards within

- Refactoring (minor): Use single quotes in PHP
master
Brett Zamir 2018-05-31 07:52:13 +08:00
parent 8f53e34c0c
commit a5c25a2113
6 changed files with 31 additions and 31 deletions

View File

@ -15,28 +15,28 @@ svgEditor.addExtension('mathjax', function () {
// Configuration of the MathJax extention.
// This will be added to the head tag before MathJax is loaded.
const /* mathjaxConfiguration = '<script type="text/x-mathjax-config">\
MathJax.Hub.Config({\
extensions: ["tex2jax.js"],\
jax: ["input/TeX","output/SVG"],\
showProcessingMessages: true,\
showMathMenu: false,\
showMathMenuMSIE: false,\
errorSettings: {\
message: ["[Math Processing Error]"],\
style: {color: "#CC0000", "font-style":"italic"}\
},\
elements: [],\
tex2jax: {\
ignoreClass: "tex2jax_ignore2", processClass: "tex2jax_process2",\
},\
TeX: {\
extensions: ["AMSmath.js","AMSsymbols.js","noErrors.js","noUndefined.js"]\
},\
"SVG": {\
}\
});\
</script>', */
const /* mathjaxConfiguration = `<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ['tex2jax.js'],
jax: ['input/TeX', 'output/SVG'],
showProcessingMessages: true,
showMathMenu: false,
showMathMenuMSIE: false,
errorSettings: {
message: ['[Math Processing Error]'],
style: {color: '#CC0000', 'font-style': 'italic'}
},
elements: [],
tex2jax: {
ignoreClass: 'tex2jax_ignore2', processClass: 'tex2jax_process2',
},
TeX: {
extensions: ['AMSmath.js', 'AMSsymbols.js', 'noErrors.js', 'noUndefined.js']
},
SVG: {
}
});
</script>`, */
// mathjaxSrc = 'http://cdn.mathjax.org/mathjax/latest/MathJax.js',
// Had been on https://c328740.ssl.cf1.rackcdn.com/mathjax/latest/MathJax.js?config=TeX-AMS-MML_SVG.js
// Obtained Text-AMS-MML_SVG.js from https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.3/config/TeX-AMS-MML_SVG.js

View File

@ -4,7 +4,7 @@
// files to your server which may cause disk space or possibly security problems
require('savefile_config.php');
if (!isset($_POST['output_svg'])) {
print "You must supply output_svg";
print 'You must supply output_svg';
exit;
}
$svg = $_POST['output_svg'];

View File

@ -785,7 +785,7 @@ const jPicker = function ($) {
return { r: this.hexToInt(r), g: this.hexToInt(g), b: this.hexToInt(b), a: this.hexToInt(a) };
},
validateHex (hex) {
// if (typeof hex === "object") return "";
// if (typeof hex === 'object') return '';
hex = hex.toLowerCase().replace(/[^a-f0-9]/g, '');
if (hex.length > 8) hex = hex.substring(0, 8);
return hex;

View File

@ -57,12 +57,12 @@ const removeAttributes = function (node, attributes) {
const svgElementToPdf = function (element, pdf, options) {
// pdf is a jsPDF object
// console.log("options =", options);
// console.log('options =', options);
const remove = (options.removeInvalid === undefined ? false : options.removeInvalid);
const k = (options.scale === undefined ? 1.0 : options.scale);
let colorMode = null;
[].forEach.call(element.children, function (node) {
// console.log("passing: ", node);
// console.log('passing: ', node);
// let hasStrokeColor = false;
let hasFillColor = false;
let fillRGB;
@ -192,7 +192,7 @@ const svgElementToPdf = function (element, pdf, options) {
x = parseInt(node.getAttribute('x'), 10) - xOffset;
y = parseInt(node.getAttribute('y'), 10);
}
// console.log("fontSize:", pdfFontSize, "text:", node.textContent);
// console.log('fontSize:', pdfFontSize, 'text:', node.textContent);
pdf.setFontSize(pdfFontSize).text(
k * x,
k * y,

View File

@ -2145,8 +2145,8 @@ editor.init = function () {
break;
// TODO: Update values that change on move/resize, etc
// case "select":
// case "resize":
// case 'select':
// case 'resize':
// break;
}
}
@ -5121,7 +5121,7 @@ editor.init = function () {
updateCanvas(true);
// });
// const revnums = "svg-editor.js ($Rev$) ";
// const revnums = 'svg-editor.js ($Rev$) ';
// revnums += svgCanvas.getVersion();
// $('#copyright')[0].setAttribute('title', revnums);

View File

@ -295,7 +295,7 @@ export const walkTreePost = function (elem, cbFn) {
*/
export const getUrlFromAttr = function (attrVal) {
if (attrVal) {
// url("#somegrad")
// url('#somegrad')
if (attrVal.startsWith('url("')) {
return attrVal.substring(5, attrVal.indexOf('"', 6));
}