Notepad.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*!
  2. * Ext JS Library 4.0
  3. * Copyright(c) 2006-2011 Sencha Inc.
  4. * licensing@sencha.com
  5. * http://www.sencha.com/license
  6. */
  7. Ext.define('MyDesktop.Notepad', {
  8. extend: 'Ext.ux.desktop.Module',
  9. requires: [
  10. 'Ext.form.field.HtmlEditor'
  11. //'Ext.form.field.TextArea'
  12. ],
  13. id:'notepad',
  14. init : function(){
  15. this.launcher = {
  16. text: 'Notepad',
  17. iconCls:'notepad'
  18. }
  19. },
  20. createWindow : function(){
  21. var desktop = this.app.getDesktop();
  22. var win = desktop.getWindow('notepad');
  23. if(!win){
  24. win = desktop.createWindow({
  25. id: 'notepad',
  26. title:'Notepad',
  27. width:600,
  28. height:400,
  29. iconCls: 'notepad',
  30. animCollapse:false,
  31. border: false,
  32. //defaultFocus: 'notepad-editor', EXTJSIV-1300
  33. // IE has a bug where it will keep the iframe's background visible when the window
  34. // is set to visibility:hidden. Hiding the window via position offsets instead gets
  35. // around this bug.
  36. hideMode: 'offsets',
  37. layout: 'fit',
  38. items: [
  39. {
  40. xtype: 'htmleditor',
  41. //xtype: 'textarea',
  42. id: 'notepad-editor',
  43. value: [
  44. 'Some <b>rich</b> <font color="red">text</font> goes <u>here</u><br>',
  45. 'Give it a try!'
  46. ].join('')
  47. }
  48. ]
  49. });
  50. }
  51. return win;
  52. }
  53. });