@Framify




Welcome to Framify,

The Framify framework is built upon the bixbyte-frame framework ( a back end development framework for the nodejs runtime ) and framify.js ( an Angular 1X UI agnostic platform for eased interaction with the bixbyte-frame platform).
The Angular Module to be included in your application is framify.js
It depends on ui.router ,framify-paginate ,ngStorage ,jsonForatter ,chart.js ,ngAria ,ngMaterial, UIKit, socket.io, jQuery and ngMessages all of which can be found in the framify_dependencies.js or framify_bundled.js files of the framify.js package.

The app service


app.scheme
This is a reference to access scheme that the application is utilizing.
{ { app.scheme } }
Currently {{app.scheme}}

app.ip
This is a reference to the ip or server_name that the application is being accesssed on.
{ { app.ip } }

Currently {{app.ip}}

app.port
This is a reference to the port that the application is being accessed through.
{ { app.port } }

Currently {{app.port || 'default (80)'}}

app.hlink / app.url
This is a reference to the root url of the application.
{ { app.hlink } } or { { app.url } }

Currently {{app.hlink}}

app.nav
This is a reference to the application's main navigation object.
{ { app.nav } }

Currently : {{app.nav}}

app.redirect (Function (http_location) )
This performs a plain http redirect by updating the global window.location reference.
{ { app.redirect( http_path ) } }

Example: app.redirect('https://google.com') will redirect you to google's homepage at https://google.com.

app.setVar (Function (object_name ,key_to_add ,value_to_add) )
Adds a key value pair to a JSON object or returns a new one where none exists.
Example
With an object var people = {}
To set add a new value 'John' with the value { "name": "John Doe", "age":20 } ,Run
{ { people = app.setVar(people, 'John', { "name": "John Doe", "age":20 } ) } }
Giving the resultant object
 {{data.sample_setVar}} 

app.str (Function (json_encoded_object) )
Transforms a viable JSON object into a string.
To transform the JSON object { name: { first: 'John', last: 'Doe' }, age: 1000 }, run
{ { app.str( { name: { first: 'John', last: 'Doe' }, age: 1000 } ) } }

which outputs '{{app.str({ name: { first: 'John', last: 'Doe' }, age: 1000 })}}'.

app.json (Function (stringified_json_object) )
Transforms a viable string into an accessible JSON object.
To transform the string '{"name":{"first":"John","last":"Doe"},"age":1000}', run
{ { app.json('{"name":{"first":"John","last":"Doe"},"age":1000}') } }

which outputs
 {{data.sample_json}}

app.jsonify (Promise (stringified_json_object) )
Transforms a viable string into an accessible JSON object.
To transform the string '{"name":{"first":"John","last":"Doe"},"age":1000}', run
{ { app.jsonify('{"name":{"first":"John","last":"Doe"},"age":1000}') } }

Which returns a then-able object

app.md5 (Function (object_to_encode) )
Outputs an MD5 hash of the provided argument.
To MD5 the value 'framify', run
{ { app.md5( 'framify' ) } }

which outputs {{app.md5('framify')}}.

app.md5ify (Promise (object_to_encode) )
Outputs an MD5 hash of the provided argument.
To MD5 the value 'framify', run
{ { app.md5ify( 'framify' ) } }

Which returns a then-able object.

app.base64_encode (Function (object_to_encode) )
Outputs a base64 encoded string of the provided argument.
To base64 encode the value 'framify', run
{ { app.base64_encode( 'framify' ) } }

which outputs {{app.base64_encode('framify')}}.

app.base64_encodify (Promise (object_to_encode) )
Outputs a base64 encoded string of the provided argument.
To base64 encode the value 'framify', run
{ { app.base64_encodify( 'framify' ) } }

Which returns a then-able object.

app.base64_decode (Function (base64_encoded_object_to_decode) )
Outputs a base64 decode string of the provided base64 encoded string.
To base64 encode the value 'ZnJhbWlmeQ==', run
{ { app.base64_decode( 'ZnJhbWlmeQ==' ) } }

which outputs {{app.base64_decode('ZnJhbWlmeQ==')}}.

app.base64_decodify (Promise (base64_encoded_object_to_decode) )
Outputs a base64 decode string of the provided base64 encoded string.
To base64 encode the value 'ZnJhbWlmeQ==', run
{ { app.base64_decodify( 'ZnJhbWlmeQ==' ) } }

Which returns a then-able object.

app.upload (Function (file_data,upload_handler_location) )
This performs a basic file upload using Angular JS' $http.post method.
It is therefore advisable to use the inbuilt 'fileModel' directive when using this method.
{ { app.upload( { file_reference_object, 'minutes'  } ) } }

Example: app.upload( file_reference_object, 'minutes') will upload the referenced file object to the upload/minutes route for processing.

app.keys (Function (json_object) )
Outputs an Array containing all of the provided objects' first level keys.
To obtain the keys of the object { name: { first: 'John', last: 'Doe' }, age: 1000 }), run
{ { app.keys( { name: { first: 'John', last: 'Doe' }, age: 1000 }) ) } }

which outputs
 {{data.sample_keys}} 

app.vals (Function (json_object) )
Outputs an Array containing all of the provided objects' first level values.
To obtain the values of the object { name: { first: 'John', last: 'Doe' }, age: 1000 }, run
{ { app.vals( { name: { first: 'John', last: 'Doe' }, age: 1000 }) ) } }

which outputs
 {{data.sample_vals}} 

app.parseInt (Function (str_to_parse) )

Parses a String value into an integer.
To parseInt a String '1234', run
{ { app.parseInt( '1234' ) } }

which returns {{app.parseInt( '1234' )}}.

app.doNothing (Promise () )

A placeholder promise to do absolutely nothing.
Sometimes you just to do nothing and yet the application screams for something. This is to silence it
{ { app.doNothing( ) } }
can be chained with a .then or .catch e.g.
{ { app.doNothing( ).then(app.doNothing).catch(app.doNothing) } }

app.getNumbers (Function (str_to_analyse) )

Extracts the first consecutive array of number(s) from a String.
To getNumbers from a String 'BabyDimples1234', run
{ { app.getNumbers('BabyDimples1234' ) } }

which returns {{app.getNumbers( 'BabyDimples1234' )}}.

app.notify (Promise (message ,bootstrap_class ,timeout, position) )

Simple UIKit based notification.
Defaults
message
: 'A blank notification was triggered.'
bootstrap_class: info [success ,primary ,warning ,danger ]
timeout: 6000
position: 'top-center' [top-left ,top-center ,top-right ,bottom-left ,bottom-center ,bottom-right]
{ { app.notify( ) } }
Example
<button class="md-btn md-btn-primary" ng-click="app.notify('Welcome to Framify').catch(app.doNothing)"> Notify </button>

app.countries
Outputs an Array of alphabetically ordered 240 country objects in the format { name: "x", value: 'y' } (Ideal for use in select elements).
{ { app.countries } }

Currently {{app.countries}}

app.makeResponse / app.make_response (Function (response_code,message,command) )
Outputs a standard framify JSON response object.
To give a standard framify Unauthorized response, { response: 401, data: { message: "Unauthorized", command: "retry" } }, run
{ { app.makeResponse(401,'Unauthorized','retry') } }

which outputs
 {{data.sample_makeresponse}} 

app.date (Function () )
Outputs the complete current Date Object.
To output the current date object, run
{ { app.date( ) } }

which outputs {{app.date()}}.

app.newDate / app.new_date (Function () )
Outputs the complete current Date String.
To output the current date string, run
{ { app.newDate( ) } }

which outputs {{app.newDate()}}.

app.isoDate / app.iso_date (Function () )
Outputs the complete current Date in ISO format.
To output the current date, run
{ { app.isoDate( ) } }

which outputs {{app.isoDate()}}.

app.getIsoDate / app.get_iso_date (Function (date_string) )
Converts a date string to ISO format.
To output the current date {{app.newDate()}} into ISO format, run
{ { app.getIsoDate( {{ app.newDate() }}  ) } }

which outputs {{app.getIsoDate( app.newDate() )}}.

app.toIsoDate / app.to_iso_date (Function (date_object) )
Converts a date object to ISO format.
To output a date object {{app.date()}} into ISO format, run
{ { app.toIsoDate( {{app.date()}} ) } }
which outputs {{ app.toIsoDate( app.date() ) }}

app.dateTime / app.date_time (Function () )
Outputs the complete current Date in dd-mm-yyyy hh:mm format.
To output the current date, run
{ { app.dateTime( ) } }

which outputs {{app.dateTime()}}.

app.getDateTime / app.get_date_time (Function (date_string) )
Outputs the provided date String in dd-mm-yyyy hh:mm format.
To output the current date {{app.newDate()}} in date-time format, run
{ { app.getDateTime( {{app.newDate()}}  ) } }

which outputs {{app.getDateTime( app.newDate() )}}.

app.toDateTime / app.to_date_time (Function (date_object) )
Converts a date object to dd-mm-yyyy hh:mm format.
To output a date object {{app.date()}} into ISO format, run
{ { app.toDateTime( {{app.date()}} ) } }
which outputs {{ app.toDateTime( app.date() ) }}

app.monthNum / app.month_num (Function () )
Outputs the current month number in.
To output the current month number, run
{ { app.monthNum( ) } }

which outputs {{app.monthNum()}}.

app.getMonthNum / app.get_month_num (Function (date_string) )
Outputs the provided date String in mm format.
To output the current date {{app.newDate()}} in month-number format, run
{ { app.getMonthNum( {{app.newDate()}}  ) } }

which outputs {{app.getMonthNum( app.newDate() )}}.

app.toMonthNum / app.to_month_num (Function (date_object) )
Converts a date object to mm format.
To convert a date object {{app.date()}} into month-number format, run
{ { app.toMonthNum( {{app.date()}} ) } }
which outputs {{ app.toMonthNum( app.date() ) }}

app.month_array
This is a reference to a zero indexed month array.
{ { app.month_array } }

Returns {{app.month_array}}

app.month_o_array
This is a reference to a month object array in the format [{id: "", name: ""}].
It is ideal for use in select lists.
{ { app.month_o_array } }

Returns {{app.month_o_array}}

app.ajax / app.cgi (Promise (http_method, target_url, data) )
Returns a jQuery then-able after performing a http request guided by the provided parameters.
To make an http POST request to {{remoteAuth.url}}/echo where the parameters are user=framify@bixbyte.io and status=200, run
{ { app.ajax('GET','{{remoteAuth.url}}/echo',{ user: 'framify@bixbyte.io'  , status : 200 }).then(app.handler).catch(app.handler) } }

app.getJSON / app.get_json (Promise (http_method, target_url, data) )
Returns a jQuery then-able after performing a http getJSON request guided by the provided parameters.
To make a request to github's API at https://api.github.com/users/ianmin2, run
{ { app.getJSON('https://api.github.com/users/ianmin2').then(app.remote_handler).catch(app.remote_handler) } }

app.loadify (Promise (timeout_duration_in_ms, message) )
Blocks the UI for the specified amount of time while displaying the specified message.
If no timeout duration is specified, the promise returns an instance the resultantmodal element ready for a custom .hide()
To show the loadify modal saying Performing Task for 4000ms, run
{ { app.loadify(4000,'Performing task') } }

app.alert (Promise (title, message, callback) )
Displays a custom modal bearing the specified title and message.
If a callback function is passed, the message parameter is passed to it.
To show the alert modal titled Sample Alert bearing the message You are connected to framify on {{app.hlink}}., run
{ { app.alert('Sample Alert','You are connected to framify on {{app.hlink}}') } }

app.confirm (Promise (title, message, callback) )
Displays a custom confirmation modal bearing the specified title and message.
If a callback function is passed, the message parameter is passed to it.
To show the confirm modal titled Sample confirm bearing the message Make a donation for the Framify Application at {{app.hlink}}., run
{ { app.confirm('Sample confirm','Make a donation for the Framify Application at {{app.hlink}}') } }

app.prompt (Promise (title ,label ,placeholder ,callback) )
Displays a custom promptation modal bearing the specified title and message.
If a callback function is passed, the message parameter is passed to it.
To show the prompt modal titled What site are you currently on? with the label Website: and the placeholder {{app.hlink}}, run
{ { app.prompt('What site are you currently on?','Website','{{app.hlink}}') } }

app.isemail
Returns an Ecmascript RegEx pattern to validate email addresses.
{ { app.isemail } }

app.isEmail / app.is_email (Function (text_toValidate) )
Returns a boolean value after evaluating whether or not a given text is a valid email address; Usage:
{ { app.isEmail( 'framify@bixbyte.io' ) } }
Returns {{ app.isEmail( 'framify@bixbyte.io' ) }}

app.isusername
Returns an Ecmascript RegEx pattern to validate a username.
{ { app.isusername } }

app.isUsername / app.is_username (Function (text_toValidate) )
Returns a boolean value after evaluating whether or not a given text is a valid username; Usage:
{ { app.isUsername( 'framify' ) } }
Returns {{ app.isUsername( 'framify' ) }}

app.ispassword
Returns an Ecmascript RegEx pattern to validate a password.
{ { app.ispassword } }

app.isPassword / app.is_password (Function (text_toValidate) )
Returns a boolean value after evaluating whether or not a given text is a valid Password; Usage:
{ { app.isPassword( 'framify' ) } }
Returns {{ app.isPassword( 'framify' ) }}

app.isnumber
Returns an Ecmascript RegEx pattern to validate a number.
{ { app.isnumber } }

app.isNumber / app.is_number (Function (text_toValidate) )
Returns a boolean value after evaluating whether or not a given text is a valid Number; Usage:
{ { app.isNumber( 126157412 ) } }
Returns {{ app.isNumber( 126157412 ) }}

app.istelephone
Returns an Ecmascript RegEx pattern to validate a telephone.
{ { app.istelephone } }

app.isTelephone / app.is_telephone (Function (text_toValidate) )
Returns a boolean value after evaluating whether or not a given text is a valid Telephone; Usage:
{ { app.isTelephone( '+254701234567' ) } }
Returns {{ app.isTelephone( '+254701234567' ) }}

app.isdatetime
Returns an Ecmascript RegEx pattern to validate a date-time value in the format DD-MM-YYYY HH:MM e.g 29-02-2013 22:16.
{ { app.isdatetime } }

app.is_date_time / app.isDateTime (Function (text_toValidate) )
Returns a boolean value after evaluating whether or not a given text is a valid date-time value in the format DD-MM-YYYY HH:MM; Usage:
{ { app.isDateTime(  {{app.dateTime()}} ) } }
Returns {{ app.isDateTime( '03-05-2017 19:25' ) }}

app.matches (Function (value_1,value_2) )
Returns a boolean value after evaluating whether or not the given parameters are identical to each other. Example:
{ { app.matches(  {{app.dateTime()}} , {{app.dateTime()}}  ) } }
Returns {{ app.matches( app.dateTime() , app.dateTime() ) }}

app.num2month (Function (zero_initiated_month_number) )
Returns the month name when fed the month number. Jan = 0 & Dec = 11 . Example:
{ { app.num2month( 1 ) } }
Returns {{ app.num2month( '1' ) }}
It is ideal for use with the app.month_array and app.month_o_array objects

app.unique /app.removeDuplicates / app.remove_duplicates (Function (Array) )
Returns an array with no duplicate values. To remove duplicates in the Array [ "Apple","Apple","Banana","Rice","Beans","Apple","Mango","Beans","Banana" ] , run:
{ { app.unique(  [ "Apple","Apple","Banana","Rice","Beans","Apple","Mango","Beans","Banana" ]  ) } }
Returns {{ app.unique( [ "Apple","Apple","Banana","Rice","Beans","Apple","Mango","Beans","Banana" ] ) }}

app.count (Function (value_to_search_for, Array_to_search) )
Returns the number of instances of an object/element in an array. E.g
To find the total number of occurences of "Apple" in [ "Apple","Apple","Banana","Rice","Beans","Apple","Mango","Beans","Banana" ], run:
{ { app.count( "Apple", [ "Apple","Apple","Banana","Rice","Beans","Apple","Mango","Beans","Banana" ]  ) } }
which returns {{app.count( "Apple", [ "Apple","Apple","Banana","Rice","Beans","Apple","Mango","Beans","Banana" ] )}}
Multiple Item search

You can also search for multiple terms provided they are specified as an Array. e.g To find the number of references to Apple, Banana, Nanasi and Beans that occurs in the Array [ "Apple","Apple","Banana","Rice","Beans","Apple","Mango","Beans","Banana" ] , run:
{ { app.count( ["Apple","Banana","Nanasi","Beans"], [ "Apple","Apple","Banana","Rice","Beans","Apple","Mango","Beans","Banana" ]  ) } }
Which returns {{ app.count( ["Apple","Banana","Nanasi","Beans"], [ "Apple","Apple","Banana","Rice","Beans","Apple","Mango","Beans","Banana" ] ) }}

app.post (Promise ( target_url, data) )
Returns a then-able after performing a http request guided by the provided parameters.
To make an http POST request to {{remoteAuth.url}}/echo where the parameters are service=demo, time={{app.date()}} and status=200, run
{ { app.post('{{remoteAuth.url}}/echo',{ service: "demo", time : {{app.date()}} , status : 200 }).then(app.handler).catch(app.handler) } }

app.get (Promise ( target_url, data) )
Returns a then-able after performing a http request guided by the provided parameters.
To make an http get request to {{remoteAuth.url}}/echo where the parameters are q=framify and status=401, run
{ { app.get('{{remoteAuth.url}}/echo',{ q: 'framify', status: 401}).then(app.handler).catch(app.handler) } }

app.put (Promise ( target_url, data) )
Returns a then-able after performing a http request guided by the provided parameters.
To make an http put request to {{remoteAuth.url}}/echo where the parameters are q=framify and status=401, run
{ { app.put('{{remoteAuth.url}}/echo',{ q: 'framify', status: 500}).then(app.handler).catch(app.handler) } }

app.delete (Promise ( target_url, data) )
Returns a then-able after performing a http request guided by the provided parameters.
To make an http delete request to {{remoteAuth.url}}/echo where the parameters are q=framify and status=401, run
{ { app.delete('{{remoteAuth.url}}/echo',{ q: 'framify', status: 301}).then(app.handler).catch(app.handler) } }

app.db (Promise ( data, target_url) )
Performs a request to interact with the framify-db component.
To query the database, ensure that the database is well configured and that you are loged in as a user ; then run
{ { app.db({ command: 'get', table: 'users', specifics: 'id,username' }).then(app.handler).catch(app.handler) } }

app.handler (Function( framify_make_response_object) )
Creates an alert based on the http status code in the response_object.status object value
A sample framify formatted response of {"response":200, "data": { "message": "Successfully set the parameter", "command": "done" } } can be handled by running:
{ { app.handler({"response":200, "data": { "message": "Successfully set the parameter", "command": "done" } }) } }

The sms service


sms.start (Promise (framify_sms_gateway_server_url) )
Starts the SMS gateway connection
To start the SMS gateway connection via the official SMS gateway, run
{ { sms.start( 'http://41.89.162.252:3000' ) } }


sms.stop (Promise () )
stops the SMS gateway connection
To stop the SMS gateway connection to an SMS gateway, run
{ { sms.stop( ) } }


sms.SMS (Promise ( formatted_sms_object ) )
Sends an already formatted SMS object.
The format required is { "telephone": "087987986", "message": "Hello Stranger", "password": "Your device's FRAMIFY SMS Authentication Key" }, e.g:
{ { sms.SMS( { "telephone": "087987986", "message": "Hello Stranger", "password": "3*5************" } ) } }

sms.oneSMS (Promise ( recipient_telephone ,message ,client_authentication_key ) )
Sends a single SMS message.
To send an SMS message (after establishing a connection to the gateway), run:
{ { sms.oneSMS(  "087987986", "Hello Stranger", "3*5************"  ) } }

sms.bulkSMS (Promise ( recipients_telephone_array ,message ,client_authentication_key ) )
Sends an SMS String to multiple users.
To send an SMS message (after establishing a connection to the gateway), run:
{ { sms.bulkSMS(  ["087987986","0324243686"], "Hello Stranger", "3*5************"  ) } }

app.db (Promise ( data, target_url) )
Performs a request to interact with the framify-db component.
To query the database, ensure that the database is well configured and that you are loged in as a user ; then run
{ { app.db({ command: 'get', table: 'users', specifics: 'id,username' }).then(app.handler).catch(app.handler) } }

app.mail (Promise ( data, target_url) )
Performs a request to interact with the framify-mail component.
To send an email, run
        { { 
            app.mail(
                {
                    from: `TEST EMAIL `,
                    to: [recipient@domain.ext], // Define the main recipient of the message
                    bcc: [recipient2@domain.ext], //You can BCC someone here
                    subject: `Your Subject Here`,
                    text: `Hello subscriber,\nWe at {{app.hlink}} have missed you so much!!\n\nSincerely\n\tSender's Name. `,
                    html: `<font color="gray"><u><h2>We Miss you!</u></font></h2>
                                                <br>
                                                Hello subscriber,<br><br>
                                                We at {{app.hlink}} have missed you so much!!
                                                <br><br>
                                                We hope that you consider coming back to us
                                                <br>
                                                <h4>Sincerely:</h4>
                                                <br>
                                                <i><u>The sender.</u></i>
                                                <br><br><br>
                                                `,
                    attachment: `file upload reference`
                };    
            ).then(app.handler).catch(app.handler) 
       } }

The cgi service


cgi.ajax (Promise ( data, target_url) )
Performs a jQuery POST request to interact with the framify-db component.
To query the database, ensure that the database is well configured and that you are loged in as a user ; then run
{ { cgi.ajax({ command: 'get', table: 'users', specifics: 'id,username' }).then(app.handler).catch(app.handler) } }

cgi.mail (Promise ( data, target_url) )
Performs a jQuery http POST request to interact with the framify-mail component.
To send an email, run
        { { 
            cgi.mail(
                {
                    from: `TEST EMAIL `,
                    to: [recipient@domain.ext], // Define the main recipient of the message
                    bcc: [recipient2@domain.ext], //You can BCC someone here
                    subject: `Your Subject Here`,
                    text: `Hello subscriber,\nWe at {{app.hlink}} have missed you so much!!\n\nSincerely\n\tSender's Name. `,
                    html: `<font color="gray"><u><h2>We Miss you!</u></font></h2>
                                                <br>
                                                Hello subscriber,<br><br>
                                                We at {{app.hlink}} have missed you so much!!
                                                <br><br>
                                                We hope that you consider coming back to us
                                                <br>
                                                <h4>Sincerely:</h4>
                                                <br>
                                                <i><u>The sender.</u></i>
                                                <br><br><br>
                                                `,
                    attachment: `file upload reference`
                };    
            ).then(app.handler).catch(app.handler) 
       } }

The auth service

DO NOT USE ON A REMOTELY HOSTED CLIENT

auth.SetAuth / auth.set_auth (Promise ( auth_token ) )
Sets the authentication header in the http headers. Where no token is passed as a parameter, it seeks to see if any signs of a token exist.
To inject an authentication token, ( Which should be done sparingly since it is otherwise automatically handled ); run
{ { auth.set_auth( "YOUR_AUTH_TOKEN" ).then(app.handler).catch(app.handler) } }

auth.Register / auth.register (Promise ( registration_object_parameters ) )
Handles the registration of users on the local platform.
To perform a user registration, ensure that all required registration parameters are provided; then run
{ { auth.register( { YOUR REGISTRATION OBJECT } ).then(app.handler).catch(app.handler) } }

auth.Login / auth.login (Promise ( login_authentication_object ) )
Handles the login of users on the local platform.
To perform a user login, ensure that all required login parameters are provided; then run
{ { auth.login( { YOUR LOGIN AUTHENTICATION OBJECT } ).then(app.handler).catch(app.handler) } }

auth.Logout / auth.logout (Promise ( ) )
Handles the logout of users on the local platform.
To perform a user logout, run
{ { auth.logout( ).then(app.handler).catch(app.handler) } }

The remoteAuth service

USE ON A REMOTELY HOSTED CLIENT.

remoteAuth.url
Returns a string of the currently defined remote server . The default is http://bixbyte.io.
{ { remoteAuth.url } }
returns {{remoteAuth.url}}

remoteAuth.setUrl / remoteAuth.set_url (Promise ( remote_server_root_url ) )
Sets the remote server that the client application communicates with. ( Defaults to http://bixbyte.io ) where no parameter is defined.
To setup a remote server URL definition; run
{ { remoteAuth.set_url( "scheme://domain.ext/" ).then(app.handler).catch(app.handler) } }

remoteAuth.SetAuth / remoteAuth.set_auth (Promise ( auth_token ) )
Sets the authentication header in the http headers. Where no token is passed as a parameter, it seeks to see if any signs of a token exist.
To inject an authentication token, ( Which should be done sparingly since it is otherwise automatically handled ); run
{ { remoteAuth.set_auth( "YOUR_AUTH_TOKEN" ).then(app.handler).catch(app.handler) } }

remoteAuth.Register / remoteAuth.register (Promise ( registration_object_parameters ) )
Handles the registration of users against a remote platform.
To perform a user registration, ensure that all required registration parameters are provided; then run
{ { remoteAuth.register( { YOUR REGISTRATION OBJECT } ).then(app.handler).catch(app.handler) } }

remoteAuth.Login / remoteAuth.login (Promise ( login_authentication_object ) )
Handles the login of users against a remote platform.
To perform a user login, ensure that all required login parameters are provided; then run
{ { remoteAuth.login( { YOUR LOGIN AUTHENTICATION OBJECT } ).then(app.handler).catch(app.handler) } }

remoteAuth.Logout / remoteAuth.logout (Promise ( ) )
Handles the logout of users against a remote platform.
To perform a user logout, run
{ { remoteAuth.logout( ).then(app.handler).catch(app.handler) } }

The contenteditable directive

Angular Attribute Only directive.

Makes the content on a given UI element editable The directive takes no value. .
< div contenteditable ng_model="data.contenteditable"> I AM AN EDITABLE DIV < /div >

The fileModel directive

Angular Attribute Only directive.

Binds the value of an HTML file input to the parent angular $scope It takes the value equivalent to the value of the desired $scope binding..
To bind the value of a selected file to the model fileVal, we run
 <input type="file" class="btn btn-success" file-model="fileVal"> 
Which produces
Fileval:  {{fileVal}}
        

The framifyContoller controller

An Absolute Necessity.

current
Returns a string of the currently defined remote server . The default is http://bixbyte.io.
{ { current } }
Currently: {{current}}

ui
Returns a JSON object of the currently active UI parameters/elements.
{ { ui } }
Currently: {{ui}}

nav
Returns a JSON Aray of the applcation navigation elements.
{ { nav } }
Currently: {{nav}}

links
Returns a JSON Aray of the applcation generated navigation links.
{ { links } }
Currently: {{links}}

exec (Function ( function_or_promise_to_run ) )
performs the execution of a dormant function/promise.
{ { exec( function_reference ) } }

setVar / set_var (Function ( initial_object, [key], value ) )
Returns a JSON Object containing the new values as well as the old. ( Appends a key:value pair to a JSON Object. )
{ { set_var( {}, ["application"], "framify.js" ) } }
Which returns {{ setVar( {}, ["application"], "framify.js" ) }}

appRedirect / app_redirect (Function ( partial_app_substate ) )
Redirects the application to app.partial_app_substate
{ { app_redirect( "login" ) } }
redirects to app.login

goTo / go_to (Function ( complete_app_substate ) )
Redirects the application to app.complete_app_substate
{ { go_to( "login" ) } }
redirects to login

unwanted
Returns an Array of the unwanted Object Keys.
{ { unwanted } }
Currently: {{unwanted}}

removeUnwanted / remove_unwanted (Function ( object_to_work_on ) )
Removes the currently defined unwanted Keys from the specified object e.g
{ { remove_unwanted(  { $index: 1, $$hashKey: "23467324h" , name: "Author" } ) } }
returns {{ removeUnwanted( { $index: 1, $$hashKey: "23467324h" , name: "Author" } ) }}

add (Promise ( table ,data ,field_names_to_md5 ,callback ) )
Adds a data record to the database table defined while performaing any required md5-ing on the client side
{ { add( 'people', { name: 'John Doe', age: '100123', email: 'john@vampires.com', secret_key: 'john_doe' }, 'secret_key' ) } }

update (Promise ( table ,data ,field_names_to_md5 ,callback ) )
Updates a data record in the database table defined while performaing any required md5-ing on the client side
{ { update( 'people', { name: 'John Doe', age: '100123', email: 'john@vampires.com', secret_key: 'john_doe_new_pass' }, 'secret_key', extras: ' email=john@vampires.com ' ) } }

fetch (Promise ( table ,data ,field_names_to_md5 ,callback ) )
Fetches data record(s) in the database table defined while performaing any required md5-ing on the client side
{ { fetch( 'people', { 'extras': 'LIMIT 10' ) } }

del (Promise ( table ,data ,field_names_to_md5 ,callback ) )
Deletes data record(s) in the database table defined while performaing any required md5-ing on the client side
{ { del( 'people', { email: 'john@vampires.com' ) } }

custom (Promise ( table ,data ,field_names_to_md5 ,callback ) )
Performs a custom SQL query in the database table defined
{ { custom( 'people', { query: 'SELECT * FROM people' ) } }

count (Promise ( table ,data ,field_names_to_md5 ,callback ) )
Performs a count of the specified parameter value(s) in the database table defined
{ { count( 'people', { specifics: 'name', email: 'john@vampires.com' ) } }

sanitize / delParams / del_params (Promise ( object, comma_delimited_keys_to_remove ) )
Removes the currently defined coma delimited purge keys from the specified object e.g
{ { sanitize( { name: 'Author', 'age': 12234, telephone: '0756159785', 'position': 'General Manager' }, 'age,telephone' ) } }

dPush / d_push (Function ( object, key_name, key_value ) )
Adds a key - value pair to the supplied object e.g
{ { dPush( {}, 'framework', { name: 'framify', last_viewed: '{{app.date_time()}}' } ) } }
Resulting in {{ dPush( {}, 'framework', { name: 'framify', last_viewed: app.date_time() } ) }}

dPushify / d_pushify (Promise ( object, key_name, key_value ) )
Adds a key - value pair to the supplied object e.g
{ { dPushify( {}, 'framework', { name: 'framify', last_viewed: '{{app.date_time()}}' } ) } }

currmoin
Returns the current non framify-formatted month number.
{ { currmoin } } or { { app.month_array[ currmoin - 1 ]  } }
i.e : {{currmoin}} or {{app.month_array[ currmoin - 1 ] }}

setMoin / set_moin (Function ( month_number ) )
Changes the numeric value of the current Month currmoin object. Usage:
{ { setMoin( 01 ) } }

addExtras (Promise ((targetObj ,extrasObj ,comma_delimeted_key_rename_in_extras ,keys_to_remove_from_extras) )
Adds an extras object to an Object while performing some modifications. e.g. running:
        { { 
            addExtras(  
                { 
                    to_do: ['Breakfast with Brad','Meeting with Vlad','Lunch in Chad','Tea with Bad','Supper in bed']
                }
                ,{ moin:'{{currmoin}}' ,heure:'{{app.date_time()}}' ,autres:'Pas d\'autres'  }
               ,'moin:month,heure:date'
               ,'autres'
            ) 
        } }
        

add_extras (Promise ((targetObj ,extrasObj ,[target_rename_keys,extras_rename_keys] ,[target_remove_keys,extras_remove_keys]) )
Adds an extras object to an Object while performing some modifications. e.g. running:
        { { 
            add_extras(  
                { 
                    to_do: ['Lunch in Chad','Tea with Bad','Supper in bed']
                    ,done: ['Breakfast with Brad','Meeting with Vlad']
                    ,another_time: ['Buy Milk']
                    ,forget: ['Say Happy birthday to nemesis']
                }
                ,{ 
                    moin:'{{currmoin}}' 
                    ,heure:'{{app.date_time()}}' 
                    ,autres:'Pas d\'autres'  
                }
               ,['another_time:postponed','moin:month,heure:date']
               ,['forget','autres']
            ) 
        } }
        

handlers.regSuccess / handlers.reg_success (Function ( message ) )
Displays a registration succeeded message and redirects the application to the app.login state. Usage:
{ { handlers.regSuccess(  ) } }

r_handlers.regSuccess / r_handlers.reg_success (Function ( message ) )
Displays a registration succeeded message and redirects the application to the app.login state. Usage:
{ { r_handlers.regSuccess(  ) } }

handlers.loginSuccess / handlers.login_success (Function ( message ) )
Displays a login succeeded message and redirects the application to the app.panel state. Usage:
{ { handlers.loginSuccess(  ) } }

r_handlers.loginSuccess / r_handlers.login_success (Function ( message ) )
Displays a login succeeded message and redirects the application to the app.panel state. Usage:
{ { r_handlers.loginSuccess(  ) } }

handlers.regError / handlers.reg_error (Function ( message ) )
Displays a login failed message. Usage:
{ { handlers.regError(  ) } }

r_handlers.regError / r_handlers.reg_error (Function ( message ) )
Displays a login failed message. Usage:
{ { r_handlers.regError(  ) } }

handlers.identity (Function ( ) )
Checks with the application server for the user's access credentials and redirects to app.login state If the user is loged out, inexistent or the lease has expired. Usage:
{ { handlers.identity(  ) } }

r_handlers.identity (Function ( ) )
Checks with the application server for the user's access credentials and redirects to app.login state If the user is loged out, inexistent or the lease has expired. Usage:
{ { r_handlers.identity(  ) } }

handlers.isLogedIn / handlers.is_loged_in (Function ( message ) )
Performs a login status check to ensure that a User is rightly aloted their privileges on the system:
{ { handlers.isLogedIn(  ) } }

r_handlers.isLogedIn / r_handlers.is_loged_in (Function ( message ) )
Performs a login status check to ensure that a User is rightly aloted their privileges on the system:
{ { r_handlers.isLogedIn(  ) } }