column.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. 
  2. CKEDITOR.dialog.add( 'column', function( editor )
  3. {
  4. return {
  5. title : '字段属性',
  6. minWidth : 300,
  7. minHeight : 150,
  8. onShow : function()
  9. {
  10. delete this.column;
  11. var element = this.getParentEditor().getSelection().getSelectedElement();
  12. if ( element && /^[ms]:/.test(element.getNameAtt()) )
  13. {
  14. this.column = element;
  15. this.setupContent( element );
  16. }
  17. },
  18. contents : [
  19. {
  20. label : 'tab',
  21. title : 'tab',
  22. elements :
  23. [
  24. {
  25. id: 'table',
  26. type : 'text',
  27. label : '表名',
  28. className : 'cke_disabled',
  29. onLoad : function()
  30. {
  31. this.getInputElement().setAttribute( 'readOnly', true );
  32. },
  33. setup : function(element) {
  34. var value = element.hasAttribute('name') && element.getAttribute('name');
  35. value = value.split(':')[1];
  36. this.setValue(value || '');
  37. }
  38. },
  39. {
  40. id: 'column',
  41. type : 'text',
  42. label : '字段名',
  43. className : 'cke_disabled',
  44. onLoad : function()
  45. {
  46. this.getInputElement().setAttribute( 'readOnly', true );
  47. },
  48. setup : function(element) {
  49. var value = element.hasAttribute('name') && element.getAttribute('name');
  50. value = value.split(':')[2];
  51. this.setValue(value || '');
  52. }
  53. }
  54. ]
  55. }
  56. ]
  57. };
  58. });