Sha256: 8369747dd3164e413b58aeda0ea2bc9cee92e93900a1baa0ae447089948be1f4

Contents?: true

Size: 556 Bytes

Versions: 11

Compression:

Stored size: 556 Bytes

Contents

// Depends on jsonlint.js from https://github.com/zaach/jsonlint

// declare global: jsonlint

CodeMirror.registerHelper("lint", "json", function(text) {
  var found = [];
  jsonlint.parseError = function(str, hash) {
    var loc = hash.loc;
    found.push({from: CodeMirror.Pos(loc.first_line - 1, loc.first_column),
                to: CodeMirror.Pos(loc.last_line - 1, loc.last_column),
                message: str});
  };
  try { jsonlint.parse(text); }
  catch(e) {}
  return found;
});
CodeMirror.jsonValidator = CodeMirror.lint.json; // deprecated

Version data entries

11 entries across 11 versions & 3 rubygems

Version Path
gump-0.1.6 server/assets/js/jquery.codemirror/addon/lint/json-lint.js
codemirror-rails-3.24 vendor/assets/javascripts/codemirror/addons/lint/json-lint.js
codemirror-rails-3.23 vendor/assets/javascripts/codemirror/addons/lint/json-lint.js
codemirror-rails-3.22 vendor/assets/javascripts/codemirror/addons/lint/json-lint.js
codemirror-rails-3.21 vendor/assets/javascripts/codemirror/addons/lint/json-lint.js
codemirror-rails-3.20 vendor/assets/javascripts/codemirror/addons/lint/json-lint.js
codemirror-rails-3.19 vendor/assets/javascripts/codemirror/addons/lint/json-lint.js
codemirror-rails-3.18 vendor/assets/javascripts/codemirror/addons/lint/json-lint.js
poly-cms-0.1.2 core/admin/assets/js/vendor/codemirror/addon/lint/json-lint.js
poly-cms-0.1.1 core/admin/assets/js/vendor/codemirror/addon/lint/json-lint.js
poly-cms-0.1.0 core/admin/assets/js/vendor/codemirror/addon/lint/json-lint.js