Skip to content

otifsolutions/cdn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Generic Form Submit

CDN URL

https://cdnotif.b-cdn.net/js/gfs.min.js

Requirements

jQuery Toastr

Target

All Form tags

Special Tags

  • no_generic Add this as a class on form to DISABLE this js.
  • button[type='submit'] i OR a[href='#finish'] i Elements define the loading attribute that should have d-none class to toggle loading.
  • button[type='submit'] OR a[href='#finish'] Elements should be the form's submit trigger so that these are disabled and enabled automatically.

Response Tags Available

{
  "modal": "#modal_id",
  "feed" : "/url/to/fetch/modal", //If Modal is set
  "message" : "Success Message",
  "location" : "/redirect/to/this/location" //If this is set modal will not work
}

Error Response

{
  "Errors": [
    "Any Heading" : "This is error 1",
    "Any Heading 2": "This is error 2"
  ]
}

Generic Change Status

CDN URL

https://cdnotif.b-cdn.net/js/gcs.min.js

Requirements

jQuery Toastr Swal

Target

On click of the element with the data tag [data-toggle="change-status"]

Special Tags

  • data-feed This data tag defines the feed for where to send the POST call.
  • data-msg This data tag defines the Message to show in the swal

Response Tags Available

{
  "message" : "Success Message",
  "location" : "/redirect/to/this/location"
}

Error Response

{
  "Errors": [
    "Any Heading" : "This is error 1",
    "Any Heading 2": "This is error 2"
  ]
}

Model Feed

CDN URL

https://cdnotif.b-cdn.net/js/mf.min.js

Requirements

jQuery Toastr

Target

On click of the element with the data tag [data-toggle="modal-feed"]

Special Tags

  • data-target This data tag defines the target id for the model to get the data in their .modal-content div.
  • data-feed This data tag defines the feed url from where to get the data to add to the modal's content div.

Response Tags Available

{
  "message" : "Success Message",
  "location" : "/redirect/to/this/location"
}

Error Response

{
  "Errors": [
    "Any Heading" : "This is error 1",
    "Any Heading 2": "This is error 2"
  ]
}

Delete Feed

CDN URL

https://cdnotif.b-cdn.net/js/df.min.js

Requirements

jQuery Toastr Swal

Target

On click of the element with the data tag [data-toggle="delete-feed"]

Special Tags

  • data-feed This data tag defines the feed url from where the DELETE call will be sent.
  • data-msg This data tag defines the Message body of the swal default : You won't be able to revert this!
  • data-confirm-button-text This data tag defines the Confirm Button text : Yes, remove it!
  • data-swal-cancel-text This data tag defines the text for cancel swal : The record has not been deleted.
  • data-swal-confirm-text This data tag defines the text for confirm swal : The record has been deleted.
  • data-swal-confirm-title This data tag defines the title for confirm swal : Deleted!

Response Tags Available

None, It will reload the page by default after success response.

Error Response

{
  "Errors": [
    "Any Heading" : "This is error 1",
    "Any Heading 2": "This is error 2"
  ]
}

Post Feed

CDN URL

https://cdnotif.b-cdn.net/js/pf.min.js

Requirements

jQuery Toastr Swal

Target

On click of the element with the data tag [data-toggle="post-feed"]

Special Tags

  • data-feed This data tag defines the feed url where the POST call will be sent.
  • data-title This defines the title for the swal. Default : Are you sure?
  • data-text This defines the text(html supported) for the swal. Default : This cannot be undone

Response Tags Available

{
  "message" : "Success Message",
  "location" : "/redirect/to/this/location"
}

Error Response

{
  "Errors": [
    "Any Heading" : "This is error 1",
    "Any Heading 2": "This is error 2"
  ]
}

Generic Chart [ApexChart.js]

CDN URL

https://cdnotif.b-cdn.net/js/gc.min.js

Requirements

jQuery ApexChart

Target

All elements with the data tag [data-toggle="generic-chart"]

Special Tags

  • data-type Required Tag. The type of the chart.
  • data-colors Required Tag. The colors of the chart comma seperated.
  • data-height Optional Tag. The height of the chart. Default : 100
  • data-stroke-width Optional Tag. The Stroke width of the chart can be comma seperated. Default : 2.5
  • data-series Optional Tag. Default Data series for the chart. Default :
  • data-no-data Optional Tag. The text to show when there is empty/no data. Default : Not Enough Data
  • data-y-axis-format-type Optional Tag. Use this to enable formating as currency. Support Value : money
  • data-currency Optional Tag. The currency sign to use in the money formator. Default is
  • data-labels Optional Tag. The default labels to populate the chart
  • data-x-axis-labels-colors Optional Tag. The colors for the xaxix labels can be comma seperated
  • data-y-axis-labels-color Optional Tag. The color for the yaxix labels
  • data-grid-border-color Optional Tag. The color for the grid border.
  • data-stacked Optional Tag. Set to enable stacked chart to be true
  • data-fill-opacity Optional Tag. The fill opacity for the chart
  • data-stroke-dash Optional Tag. The stroke for dashed chart can be comma seperated
  • data-legend-position Optional Tag. The position for the legends
  • data-legend-show Optional Tag. Enable legends by this tag
  • data-fill-gradient Optional Tag. To set the fill gradient of the chart. Must use fill-gradient-colors if you use this.
  • data-fill-gradient-colors Optional Tag. The colors for the gradient fill. Can be comma seperated
  • data-feed Optional Tag. Set this to use feed ajax for updating the chart's options or data or labels.

Response Tags Available If feed is set

{
  "keys": ["name1","name2"],
  "values" : [
    {
      "name": "Name1 of series",
      "data": [1,2]
    },
    {
      "name": "Name2 of series",
      "data": [1,2]
    }
  ]
  "options" : {
    //Complete Apexchart options can be used to update chart options here.
  }
}

Error Response

Not supported

About

An internal CDN repository to list and explain all available resources.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published