Project page: strategievirali.com/en/software/jsvcard.html
The main goal of this library is to make the boring personal data forms filling easier using your own vCard.
To accomplish this a parsing library has been developed from scratch and, taking advantage of HTML5 (jQuery + php when not available), it is possible to read the vCard directly from filesystem.
jsvCard works within HTML5 browsers (actually tested on Google chrome and Firefox) and has fallback for older browsers using a php stub (TODO:state the version of PHP needed)
If you checked out from repository you should run through the building cycle. See BUILDING for the details.
For a running implementation use test.html. If your browser does not support HTML5 File API you should configure your environment to use freadstub.php.
Configuration procedure:
-
Place the content of the “lib” folder in a reachable place
-
Place “freadstub.php” in a reachable and PHPable place
-
Link the jquery, ajaxuploader and jsvcard (in this order) in your target webpage
-
Put a clickable element (an image, a button, …) with a specified id (say “vClickMe”)
-
Create your form and put a specified id (say “vTargetForm”)
-
Insert the correct classes to the form elements to have them populated with the vcard content (see below)
-
Put the init script right before the </body>:
<script type=“text/javascript”> //<![CDATA[ jsvcard = new jsvCard(); // INSERT HERE variables overriding jsvcard.install(“vTargetForm”,“vClickMe”,“bottom-left”); //]]> </script>
Note: You can install jsvcard on any pair of “clickable”, “target form” in the same page. DON’T reuse clickables or forms.
Note: You can skip linking ajaxuploader and installing freadstub.php if you don’t want support for HTML4. You can specify the path for freadstub.php writing this line before the “install” call:
jsvcard.freadstub = “www.my-domain.net/freadstub.php”;
Note: “jsvcard*” identifiers and classes are RESERVED, so use other names.
The position tells the popup position respect to the “vClickMe” element.
Positions:
-
top
-
top-left
-
top-right
-
left
-
right
-
bottom
-
bottom-left
-
bottom-right
TODO: write the supported classes based on fillForm()
Messages are put in some variables inside the jsvCard object. You can change the messages changing the content of these variables.
Variables names:
-
chooseText
-
dropText
-
dropHereText
-
wrongInputText
-
wrongDropText
-
errorReadingText
-
resetText
Pleas look at the source code for a precise reference about these variables, their content ahd thir meaning.
For the definition of the vCard format syntax and (most important) semantics look at these references:
en.wikipedia.org/wiki/VCard www.imc.org/pdi/
www.imc.org/pdi/pdiproddev.html