Advertisement
6RUN0

examle bueditor button

Jul 19th, 2013
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. js:
  2. var form = [
  3.   {
  4.     name: 'title',
  5.     title: 'Скачать',
  6.     required: true,
  7.   },
  8.   {
  9.     name: 'size',
  10.     title: 'Размер',
  11.     required: true,
  12.     getnext: true,
  13.   },
  14.  
  15.   {
  16.     name: 'measure',
  17.     title: '',
  18.     value: 'Mb',
  19.     required: true,
  20.     type: 'select',
  21.     attributes: {style: 'margin-left: 5px'},
  22.     options: {'Tb': 'Tb', 'Mb': 'Mb', 'Kb': 'Kb', 'b': 'b'}
  23.   },
  24.   {
  25.     name: 'urls',
  26.     title: '',
  27.     required: true,
  28.     type: 'textarea',
  29.     attributes: {rows : '15', cols : '40'}
  30.   },
  31. ];
  32. var options = {};
  33. options.title = 'Ссылки';
  34. options.stitle = 'Применить';
  35. //options.validate = function(tag, form) {
  36. //  return confirm('Confirm?');
  37. //};
  38. options.submit = function(tag, form) {
  39.   var str = '\nForm elements name-value pairs\n';
  40.   $.each(form.elements, function(i, el){
  41.     str += el.name +'='+ el.value +'\n';
  42.   });
  43.   E.replaceSelection(str);
  44. };
  45.  
  46. E.tagDialog('tag', form, options);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement