Tuesday, June 24, 2008

ffehr with entry validation

The validation script of cruxade has now landed into ffehr's development repository. For the adventurous, you may download the source code of ffehr following the instructions at: http://ffehr.freefeathers.org/Repo/

By the way, don't forget to update your local copy of cruxade. If you have followed the instructions from the previous blog all you need to do is issue the "bzr bind" command.

$ cd <pristine branch>
$ bzr bind http://cruxade.freefeathers.org/Repo/0.x/extension
$ bzr update

Next time, you need not keep on issuing "bzr branch" nor "bzr bind" to keep in sync with the latest changes of cruxade's source code. "bzr update" will be enough, as long as, you have internet access (of course). Then, to merge the changes from pristine branch to your mods branch will involve the following commands "bzr merge", "bzr conflicts", "bzr resolve".

$ cd <mods branch>
$ bzr merge <path of the pristine branch>
$ bzr conflicts # to check for any conflicts
$ bzr resolve # after fixing the source
$ bzr commit

If you care less about your changes in the mods branch you can simply do a "bzr pull" command, instead of "bzr merge". Take note that "bzr pull" will overwrite the changes you've made, including your previous commits, in the mods branch.

$ cd <mods branch>
$ bzr pull <path of the pristine branch> --overwrite --remember
# next time you only need to do "bzr pull --overwrite" you may have guessed it with the "--remember" switch.

Wait... we're not done yet (too excited are we?) Add the cruxade extension under ffehr's extensions folder, in like manner you have added it in a firefox profile folder.


Friday, June 20, 2008

Cruxade's Validation Library - in action

The validation library has now been incorporated into extendContainer.js, useful for control validation within a form. The development code can be downloaded and tested using the instructions at http://cruxade.freefeathers.org/Repo/

Once you've successfully installed cruxade into firefox, you may see the validation library in action by loading the xul page at chrome://cruxade/content/validation.xul

Keep pouring in your ideas. The improvement of this library will greatly benefit ffehr (http://ffehr.freefeathers.org).


Tuesday, June 3, 2008

Cruxade's Data validation library

I am beginning to create a data validation library under Cruxade. I'll be happy to have your contribution to the code and make it better.

function isBlank(c){
if (null==c) return true;
return c.search(/^\s*$/)!=-1;

function trimSpaces(c){
if (null==c) return "";
if (isBlank(c)) return "";
return c;

function isDigit(n){
if (null==n) return false;
if (typeof n == "number") return true;
n = trimSpaces(n);
return n.search(/^\d+\.*\d*$/)!=-1;

function isDate(d){
if (null==d) return false;
if (d instanceof Date) return true;
d = trimSpaces(d);
if (d.search(/^\d+-\d+-\d+$/)==-1) return false;
var lv_nYear = parseInt(d.match(/^\d+/));
var lv_cMonth = String(d.match(/-\d+-/));
lv_nMonth = parseInt(lv_cMonth.match(/\d+/));
lv_cDay = String(d.match(/-\d+$/));
lv_nDay = parseInt(lv_cDay.match(/\d+/));

// check for leap year and if day corresponds to month
if (lv_nYear < 1) return false;
if ((lv_nMonth < 1 ) || (lv_nMonth > 12)) return false
if ((lv_nDay < 1) || (lv_nDay > 31)) return false;
if (lv_nMonth==2){
if (lv_nDay<=28) return true;
if (lv_nDay>29) return false;
var lv_nScore= 0;
lv_nScore = (lv_nYear % 400==0)?1:0;
if (lv_nScore==0){
lv_nScore = (lv_nYear % 100==0)?-100:0;
lv_nScore = lv_nScore + ((lv_nYear % 4 ==0)?3:0);
return lv_nScore > 0;
if (lv_nDay==31){
var lv_c30month={};
return !(lv_nMonth in lv_c30month);
return true;

edited: 2008-06-06

Monday, June 2, 2008

ffehr-0.1b20080602 release

- auto creation of datastore and datamap folder
- gplv3 image in welcome screen
- GPLv3 license text in COPYING.TXT
-removed conflicting Welcome.css with welcome.css on FAT system
- added datastore.js
- added ffehrdata directory as structure to copy in application's
or extensions's (firefox) folder for newly installed ffehr
- solved ticket #27 creating of multiple profiles for single patient
-fix ticket#45 general admissions printable view defects
- fix ticket#50 Absence of Admission ID in the Admission Patient
- fixed ticket#32 Case Id does not show up at right frame.
- fixing ticket#41 Print preview of Discharge does not show up
Overall Condition value.
- fixed ticket#61 mispelled SURGEON
- maintain app id to sanctuary@freefeathers.org and use required
in install.rdf
- branding folder and sanctuary folder
- restructured library for locale and skin extensions
- added idrc partner logo in welcome page



Please help test this xpi in MacOS.

Cruxade Library: