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.
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
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.
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
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
Outputs a standard framify JSON response object.
To give a standard framify Unauthorized response, { response: 401, data: { message: "Unauthorized", command: "retry" } }, run
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
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
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}}') } }
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.
Returns an array with no duplicate values. To remove duplicates in the Array [ "Apple","Apple","Banana","Rice","Beans","Apple","Mango","Beans","Banana" ] , run:
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:
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:
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
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
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
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
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" } }) } }
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
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
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)
} }
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
Handles the registration of users on the local platform.
To perform a user registration, ensure that all required registration parameters are provided; then run
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
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
Handles the registration of users against a remote platform.
To perform a user registration, ensure that all required registration parameters are provided; then run
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
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: