"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "web/common-function.js" between
js-beautify-1.14.4.tar.gz and js-beautify-1.14.5.tar.gz

About: JS Beautifier is a JavaScript (and bookmarket) beautifier.

common-function.js  (js-beautify-1.14.4):common-function.js  (js-beautify-1.14.5)
/*jshint strict:false, node:false */ /*jshint strict:false, node:false */
/*exported run_tests, read_settings_from_cookie, beautify, submitIssue, copyText , selectAll, clearAll, changeToFileContent*/ /*exported run_tests, read_settings_from_cookie, beautify, submitIssue, copyText , selectAll, clearAll, changeToFileContent, setPreferredColorScheme*/
var the = { var the = {
use_codemirror: !window.location.href.match(/without-codemirror/), use_codemirror: !window.location.href.match(/without-codemirror/),
beautifier_file: window.location.href.match(/debug/) ? 'beautifier' : './beaut ifier.min', beautifier_file: window.location.href.match(/debug/) ? 'beautifier' : './beaut ifier.min',
beautifier: null, beautifier: null,
beautify_in_progress: false, beautify_in_progress: false,
editor: null // codemirror editor editor: null // codemirror editor
}; };
requirejs.config({ requirejs.config({
//By default load any module IDs from js/lib //By default load any module IDs from js/lib
skipping to change at line 366 skipping to change at line 366
reader.readAsText(file, "UTF-8"); reader.readAsText(file, "UTF-8");
reader.onload = function(event) { reader.onload = function(event) {
if (the.editor) { if (the.editor) {
the.editor.setValue(event.target.result); the.editor.setValue(event.target.result);
} else { } else {
$('#source').val(event.target.result); $('#source').val(event.target.result);
} }
}; };
} }
} }
function setPreferredColorScheme() {
var themeToggleBtn = document.querySelector('#theme-toggle-btn');
themeToggleBtn.addEventListener('change', switchTheme, false);
var isPreferredColorSchemeDark = window.matchMedia('(prefers-color-scheme: dar
k)').matches;
if (isPreferredColorSchemeDark) {
themeToggleBtn.checked = true;
$('.CodeMirror').addClass('cm-s-darcula');
$('body').addClass('dark-mode');
$('.logo').children('img').attr("src", "web/banner-dark.svg");
}
}
function switchTheme(themeToggleEvent) {
if (themeToggleEvent.target.checked) {
$('.CodeMirror').addClass('cm-s-darcula');
$('body').addClass('dark-mode');
$('.logo').children('img').attr("src", "web/banner-dark.svg");
} else {
$('.CodeMirror').removeClass('cm-s-darcula');
$('body').removeClass('dark-mode');
$('.logo').children('img').attr("src", "web/banner-light.svg");
}
}
 End of changes. 2 change blocks. 
1 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)