| 1 |
/* |
| 2 |
* Template file from CF7 Smart Grid plugin |
| 3 |
* cf7-grid-layout/admin/js/ui-custom-helper.js |
| 4 |
*/ |
| 5 |
var cf7sgCustomHelperModule = (function (cch) { |
| 6 |
// add functionality for your tag, replace 'your_plugin_tag' with the tap type. |
| 7 |
// example [your_plugin_tag field-name id:field-id class:field-class "additional options"] |
| 8 |
// cch.<your_plugin_tag> = function(tag){ |
| 9 |
// //basic regex to match a shortcode tag. |
| 10 |
// const regex = /\[(your_plugin_tag|your_plugin_tag\*)\s(.[^\s\"\'\]]*)(?:\s(.[^\]]*))\]/img; |
| 11 |
// let m, helpers={'js':[],'php':[]}; |
| 12 |
// while ((m = regex.exec(tag)) !== null) { |
| 13 |
// //match your shortcode string. |
| 14 |
// helpers.php[helpers.php.lenght] = 'class-name-for-grid-filter'; |
| 15 |
// } |
| 16 |
// return helpers; |
| 17 |
// } |
| 18 |
|
| 19 |
//example: [map your-location show_address "lat:12.45;lng:80.09"] |
| 20 |
// cch.map = function(shortcode){ |
| 21 |
// const regex = /\[(map|map\*)\s(.[^\s\"\'\]]*)(?:\s(.[^\]]*))\]/img; |
| 22 |
// let match, helpers={'js':[],'php':[]}; |
| 23 |
// while ((match = regex.exec(shortcode)) !== null) { |
| 24 |
// if(match.indexOf('show_address')>-1){ |
| 25 |
// helpers.php[helpers.php.length] = 'map-show_address'; |
| 26 |
// } |
| 27 |
// } |
| 28 |
// return helpers; |
| 29 |
// } |
| 30 |
return cch; |
| 31 |
}(cf7sgCustomHelperModule || {})); |
| 32 |
|