{"id":18419780,"url":"https://github.com/teradata/blue-meanie","last_synced_at":"2025-04-07T13:31:45.535Z","repository":{"id":4407593,"uuid":"5545000","full_name":"Teradata/blue-meanie","owner":"Teradata","description":null,"archived":false,"fork":false,"pushed_at":"2013-01-11T01:10:44.000Z","size":232,"stargazers_count":13,"open_issues_count":0,"forks_count":2,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-03-22T19:12:09.196Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Teradata.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-08-24T19:46:10.000Z","updated_at":"2019-03-23T05:37:47.000Z","dependencies_parsed_at":"2022-09-20T23:02:31.105Z","dependency_job_id":null,"html_url":"https://github.com/Teradata/blue-meanie","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Teradata%2Fblue-meanie","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Teradata%2Fblue-meanie/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Teradata%2Fblue-meanie/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Teradata%2Fblue-meanie/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Teradata","download_url":"https://codeload.github.com/Teradata/blue-meanie/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247661780,"owners_count":20975117,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T04:18:20.238Z","updated_at":"2025-04-07T13:31:43.795Z","avatar_url":"https://github.com/Teradata.png","language":"JavaScript","readme":"Blue Meanie\n-----------\nNo form is safe in Pepperland.\n\nWhat is Blue Meanie?\n--------------------\nBlue Meanie is a simple form validation engine. It accepts rules, validates form elements (event based), and triggers events.\nIt does not care how you render error messages or maintain state. It is a jQuery plugin, of course.\n\nDisclaimer\n----------\nAs of publishing, 01/10/2013, Blue Meanie has some rough edges and needs some improvement. Blue Meanie is currently being used in a limited case.\nBlue Meanie will be refined as/if the scope of usage increases. Blue Meanie is being used as part of larger validation library that contains state\nmanagement and rendering modules. The modules are then tied together through a common API. Documentation and examples will be added as time permits.\n\nHow Does it Work?\n-----------------\nIt listens for certain DOM events and validates when the events occur.\n\nFirst thing you will need are some rules. Rules can be loaded like so:\n```javascript\n$.fn.meanie('addRule', { // this will add the rule to the plugin itself not an instance of the plugin, so that rules can be shared with all instances\n    name: 'required',\n    msg: 'This field is required.',\n    test: function (target, options) {\n        // target is the input being validated\n        // an options argument can be defined when a rule set is created (see example later on)\n        return true; // this should return a boolean value\n    }\n});\n```\n\nNow that we have a rule lets validate a form:\n```javascript\n$('form').meanie({\n    rulesets: [ // there can be an infinite number of rule sets that contain an infinite number of rules\n        {\n            qrysel: 'input[type=\"text\"]', // THIS IS COOL: apply this rule to all elements that match this query selector\n            rules: [\n                {\n                    // use the required rule we defined above; options is an optional argument;\n                    // options will be passed as an argument to validation function (see addRule example above)\n                    { name: 'required', options: {} },\n                    { name: 'number' } // pretend this rule has already been defined\n                }\n            ]\n        }\n    ]\n});\n```\n\nLets listen for validation events:\n```javascript\n$('form').on('meanie.validate', function (event, verdicts) {\n    // when an input is validated an event is triggered\n    // an array of verditc objects is returned; each object cotains the following properties\n    // $target, msg, options, rules, valid\n});\n```\n\nValidate this element:\n```javascript\n// returns an array of verdict objects\n$('form').meanie('validate', target, silent); // target is a DOM element; silent is a bool indicating whether an event should be triggered\n```\n\nLet me see all the rules:\n```javascript\n$('form').meanie('rules');\n```\n\nNo longer validate this element:\n```javascript\n$('form').meanie('remove', target); // target is a DOM element\n```\n\nWe are done validating. Lets remove the validation:\n```javascript\n$('form').meanie('destroy');\n```\n\nLicense\n-------\nCopyright © 2012-2013 by Teradata Corporation.\n\nIssued under the MIT License\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF \n\n\u003cpre\u003e\n::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::\n::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::\n::::::::::::::::::::::::::::::::::::::''``      ``''::::::::::::::::::::::\n::::::::::::::::::::::::::::::::::''                 `':::::::::::::::::::\n::::::::::::::::::::::::::::::::'                      `':::::::::::::::::\n::::::::::::::::::::::::::::::'                          :::::::::::::::::\n:::::::::::::::::::::::::::::'                            ::::::::::::::::\n:::::::::::::::::::::::::::::                             `:::::::::::::::\n:::::::::::::::::::::::::::::                              :::::::::::::::\n::::::::::::::::::::::::::::                               `````''::::::::\n::::::::::::::::::::::::::::                                        `'::::\n::::::::::::::::::::::::::::                                           `::\n::::::::::::::::::::::::::::                                            `:\n::::::::::::::::::::::::::::.\n:::::::::::::::::::::::::::::.\n::::::::::::::::::::::::::::::::\n::::::::::::::::::::::::::::''``?.\n'`.,.`':::::::::::::::::''       \"h\n,d$$$h.`'::::::::::::::'   ,-.    `h\n$$$$$$$h. `:::::::::::'   (   )    F                                     :\n$$$$$$$$$$cc,_````_,,cc    `-'     \"\"==,,_                              ::\n`?$$$$$$$$$$$$$$$$$$$$$.        ,ccc,.    \"\"==-,_                     .:::\n: \"?$$$$$$$$$$$$$$$$$$$$$cccccd$$$$P\"  $hcc,.   `:::.              .::::::\n:::. \"?$$$$$$$$$$$$$$$$$$$$$$$$$$\" /`\",$$$$$$P .::::::::........::::::::::\n::::::..\"\"?$$$$$$$$$$$$$$$$$$$P\".-\",= $$$$$$\" ::::::::::::::::::::::::::::\n:::::::::.. \"\"??$$$$$$$$$???\"\".',d\". d$$$$$F :::::::::::::::::::::::::::::\n:::::::::::::::.;;, .,,,ccc==\",dP', z$$$$$\" ::::::::::::::::::::::::::::::\n:::::::::::::::::::.`\"\"\"\"_,nmPP  ,\",$$$$$' :::::::::::::::::::::::::::::::\n:::::::::::::::::::: \"PPPP\"\"   ,d\",$$$$$$ ::::::::::::::::::::::::::::::::\n::::::::::::::::::::::::     ,d\" ,$$$$$$F ::::::::::::::::::::::::::::::::\n::::::::::::::::::::'`` ::',dP   $$$$$$$F :'':::::::::::::::::::::::::::::\n:::::::::::::::::'`.mbu;;_dP\", ,d$$$$$$P      `''````````'::::::::::::::::\n::::::::::::::'' -c,.\"\"\"\"_,=\",c$$$$$$$??                  `````'':::::::::\n::::::::::::' ,chc,.\"\"???\".,d$$$$$???                             `'''`'::\n::::::::::: ,d$$$$$$$$ccd$$$$$$P\"\"                                      `:\n::::::::::: $$$$$$$$$$$$$$$$???\n::::::::::. $$$$$$$$$$$$$P\"\n::::::::::: `?$$$$$$$$$$\"\n::::::::::::.,`\"??\"\"\"\"??\n:::::::::::::\n:::::::'``':'\n::::::'\n::'`\n\u003c/pre\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteradata%2Fblue-meanie","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fteradata%2Fblue-meanie","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteradata%2Fblue-meanie/lists"}