diff --git a/webroot/css/interface.css b/webroot/css/interface.css deleted file mode 100644 index 94a243b..0000000 --- a/webroot/css/interface.css +++ /dev/null @@ -1,17 +0,0 @@ -*{ - font-family: verdana, arial, sans-serif; -} -.campo{ - width:550px; - height:230px; - background-color:#eee; -} -.botao{ - width:300px; - height:60px; -} -.comment{ - background-color:#eee; - color:#363; - font-size: .7em; -} \ No newline at end of file diff --git a/webroot/js/functions.js b/webroot/js/functions.js deleted file mode 100644 index 1212e8b..0000000 --- a/webroot/js/functions.js +++ /dev/null @@ -1,53 +0,0 @@ -function print_r( array, return_val ) { - // http://kevin.vanzonneveld.net - // + original by: Michael White (http://getsprink.com) - // + improved by: Ben Bryan - // * example 1: print_r(1, true); - // * returns 1: 1 - - var output = "", pad_char = " ", pad_val = 4; - - var formatArray = function (obj, cur_depth, pad_val, pad_char) { - if (cur_depth > 0) { - cur_depth++; - } - - var base_pad = repeat_char(pad_val*cur_depth, pad_char); - var thick_pad = repeat_char(pad_val*(cur_depth+1), pad_char); - var str = ""; - - if (obj instanceof Array || obj instanceof Object) { - str += "Array\n" + base_pad + "(\n"; - for (var key in obj) { - if (obj[key] instanceof Array) { - str += thick_pad + "["+key+"] => "+formatArray(obj[key], cur_depth+1, pad_val, pad_char); - } else { - str += thick_pad + "["+key+"] => " + obj[key] + "\n"; - } - } - str += base_pad + ")\n"; - } else if(obj == null || obj == undefined) { - str = ''; - } else { - str = obj.toString(); - } - - return str; - }; - - var repeat_char = function (len, pad_char) { - var str = ""; - for(var i=0; i < len; i++) { - str += pad_char; - }; - return str; - }; - output = formatArray(array, 0, pad_val, pad_char); - - if (return_val !== true) { - document.write("
" + output + ""); - return true; - } else { - return output; - } -} \ No newline at end of file diff --git a/webroot/js/interface.js b/webroot/js/interface.js deleted file mode 100644 index ecd2fdb..0000000 --- a/webroot/js/interface.js +++ /dev/null @@ -1,67 +0,0 @@ -$(document).ready(function(){ - $("#bt-validate-js").click(validateJs); - $("#bt-validate-php").click(validatePhp); - $("#bt-validate-php-type-cast-mode").click(validatePhpTypeCastMode); -}); - - -function validatePhpTypeCastMode() { - validatePhp(true); -} - -function validatePhp(typeCastMode) { - if(typeCastMode == true) { - typeCastMode = true; - } - else { - typeCastMode = false; - } - - $('#resultados').html('. . . w o r k i n g . . . '); - schema = $('#schema').val(); - json = $('#json').val(); - - $.getJSON( - "validate.php", - {"schema":schema,"json":json,"typeCastMode":typeCastMode}, - phpCallback - ); -} - -function phpCallback(json) { - showResponse(json); -} - -function validateJs() { - $('#resultados').html('. . . w o r k i n g . . . '); - jsons = getJsons(); - //alert(print_r(jsons,true)); - if(jsons.schema) { - validateResponse = JSONSchema.validate(jsons.json,jsons.schema); - } - else { - validateResponse = JSONSchema.validate(jsons.json); - } - showResponse(validateResponse); -} - -function getJsons() { - schema = $('#schema').val(); - json = $('#json').val(); - json = eval( '(' + json + ')' ); - if(schema) { - schema = eval( '(' + schema + ')' ); - } - return {"json":json,"schema":schema}; -} - -function showResponse(validateResponse) { - //alert(print_r(validateResponse,true)); - res = ''+'JSON: '+(validateResponse.valid?' VALID':'INVALID')+'
- JSON- - |
-
- Schema:- - |
-