Skip to content

Commit

Permalink
title wikiBtn
Browse files Browse the repository at this point in the history
  • Loading branch information
mistermboy committed Aug 7, 2020
1 parent 3223cdd commit 4ae7dfe
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 21 deletions.
29 changes: 18 additions & 11 deletions dist/yashe.bundled.min.js

Large diffs are not rendered by default.

10 changes: 7 additions & 3 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ const extendCmInstance = function(yashe) {
prettyUtils.prettify(yashe);
if(yashe.hasErrors())yashe.undo(); //Just in case the prettify fail
}else{

interact.showErrAlertMsg(yashe);
}
}

Expand Down Expand Up @@ -396,7 +396,9 @@ root.storeContent = function(yashe) {
root.prettify = function(yashe){
if(!yashe.hasErrors()){
prettyUtils.prettify(yashe);
// if(yashe.hasErrors())yashe.undo(); //Just in case the prettify fail
if(yashe.hasErrors())yashe.undo(); //Just in case the prettify fail
}else{
interact.showErrAlertMsg(yashe);
}
}

Expand All @@ -406,10 +408,12 @@ root.prettify = function(yashe){
* @return {string} Check result
*/
const checkSyntax = function(yashe) {
return syntaxUtils.checkSyntax(yashe);
syntaxUtils.checkSyntax(yashe);
return syntaxUtils.reCheckSyntax(yashe);
};



// ---- Static Utils -----

// first take all codeMirror references and store them in the YASHE object
Expand Down
2 changes: 1 addition & 1 deletion src/utils/interactUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ var startWikiFormat = function(yashe){
var stopWikiFormat = function(yashe,history){
yashe.wikiFormatInProgress = false;
setTimeout(() => { //Just to wait until the last comment is setted
$('#wikiBtn').attr("title", "Add Wikidata Comments");
$('#wikiBtn').attr("title", "Generate Wikidata Comments");
$('#wikiBtn').empty();
$('#wikiBtn').removeClass("yashe_stopBtn");
$('#wikiBtn').addClass("yashe_wikiBtnAfter");
Expand Down
15 changes: 9 additions & 6 deletions src/utils/syntaxUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,6 @@ var checkSyntax = function(yashe) {
yashe.setGutterMarker(l, "gutterErrorBar", warningEl);


//$('.CodeMirror-gutters').css('box-shadow','0px 0px 6px 1px #FFB5B5');
$('.CodeMirror-linenumber').css('color','#FF4A4A')
// $('.CodeMirror-gutters').css('background',' #FFE3E3');
yashe.queryValid = false;
return false;
}
Expand Down Expand Up @@ -103,8 +100,6 @@ var checkSyntax = function(yashe) {

yashe.shapes = Object.assign([],yashe.defShapes);

$('.CodeMirror-gutters').css('box-shadow','none');
$('.CodeMirror-linenumber').css('color','#999')
yashe.prevQueryValid = yashe.queryValid;
return true;
};
Expand Down Expand Up @@ -225,6 +220,14 @@ var checkSyntax = function(yashe) {
yashe.setGutterMarker(line, "gutterErrorBar", warningEl);
}


var reCheckSyntax = function(yashe){
setTimeout(() => {
checkSyntax(yashe);
}, 380);
}

module.exports = {
checkSyntax:checkSyntax
checkSyntax:checkSyntax,
reCheckSyntax:reCheckSyntax
};

0 comments on commit 4ae7dfe

Please sign in to comment.