extraPlugins: 'inline_resize',
toolbar: buttons,
disableAutoInline: true,
- title: false
+ title: false,
+ disableNativeSpellChecker: false
};
config.height = $e.height();
// - dialog: an optional object of options passed to the $.dialog() call
// - load: an optional function that is called after the content has been loaded successfully (only if an AJAX call is made)
ns.popup_dialog = function(params) {
+ if (kivi.Materialize)
+ return kivi.Materialize.popup_dialog(params);
+
var dialog;
params = params || { };
$input.prop('selectionStart', position);
$input.prop('selectionEnd', position);
};
+
+ ns._shell_escape = function(str) {
+ if (str.match(/^[a-zA-Z0-9.,_=+/-]+$/))
+ return str;
+
+ return "'" + str.replace(/'/, "'\\''") + "'";
+ };
+
+ ns.call_as_curl = function(params) {
+ params = params || {};
+ var uri = document.documentURI.replace(/\?.*/, '');
+ var command = ['curl', '--user', kivi.myconfig.login + ':SECRET', '--request', params.method || 'POST']
+
+ $(params.data || []).each(function(idx, elt) {
+ command = command.concat([ '--form-string', elt.name + '=' + (elt.value || '') ]);
+ });
+
+ command.push(uri);
+
+ return $.map(command, function(elt, idx) {
+ return kivi._shell_escape(elt);
+ }).join(' ');
+ };
});
kivi = namespace('kivi');