Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zaporylie/drupal-ajax_markup
This is not official project repository. For details please visit https://www.drupal.org/project/ajax_markup
https://github.com/zaporylie/drupal-ajax_markup
Last synced: 7 days ago
JSON representation
This is not official project repository. For details please visit https://www.drupal.org/project/ajax_markup
- Host: GitHub
- URL: https://github.com/zaporylie/drupal-ajax_markup
- Owner: zaporylie
- Created: 2015-02-20T18:52:45.000Z (over 9 years ago)
- Default Branch: 7.x-2.x
- Last Pushed: 2015-02-21T09:20:27.000Z (over 9 years ago)
- Last Synced: 2023-03-24T01:55:50.584Z (over 1 year ago)
- Language: JavaScript
- Size: 125 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.txt
Awesome Lists containing this project
README
- Ajax markup:
Provides an API for generating filtered markup using ajax.- INSTALL:
Just enable it at module administration page.- USE:
1) Load the API by calling ajax_markup_on() at server side.if (module_invoke('ajax_markup', 'on')) {
drupal_add_js(YOUR_SCRIPT.js);
}2) Inside YOUR_SCRIPT.js call $.ajaxMarkup
$.ajaxMarkup(INPUT, INPUT_FORMAT, CALLBACK);
function CALLBACK(OUTPUT, SUCCESS, REQUEST) {
if (SUCCESS) $('div#preview').html(OUTPUT);
else alert(OUTPUT);
}INPUT: String of which you want to get a filtered version.
INPUT_FORMAT: Integer representing one of the drupal input formats. Provide 0 for the default.
CALLBACK: Function to send the output after the request.
OUTPUT: String that is the filtered INPUT. Content depends on the INPUT_FORMAT and SUCCESS state.
SUCCESS: Boolean representing the status of the request.
REQUEST: XmlHttpRequest. Not available when the OUTPUT is retrieved from the cache.- ALSO:
API provides a function that tries to get the INPUT_FORMAT of a textarea.$.ajaxMarkup.getFormat('#edit-body'); //returns 0 (the default format) when there is no input format for the element.
- ACCESS:
Users must have "access ajax markup" permission.
Users must have access to the supplied INPUT_FORMAT, otherwise the default format is used.