d12382b342d6dd277dd5383808c04b645205061c.svn-base 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. var outerLayout;
  2. $(document).ready( function() {
  3. // create the OUTER LAYOUT
  4. outerLayout = $("body").layout(layoutSettings_Outer);
  5. // BIND events to hard-coded buttons in the NORTH toolbar
  6. var westSelector = "body > .ui-layout-west";
  7. var eastSelector = "body > .ui-layout-east";
  8. // CREATE SPANs for pin-buttons - using a generic class as identifiers
  9. $("<span></span>").addClass("pin-button").prependTo(westSelector);
  10. $("<span></span>").addClass("pin-button").prependTo(eastSelector);
  11. // BIND events to pin-buttons to make them functional
  12. outerLayout.addPinBtn(westSelector +" .pin-button", "west");
  13. outerLayout.addPinBtn(eastSelector +" .pin-button", "east");
  14. // CREATE SPANs for close-buttons - using unique IDs as identifiers
  15. $("<span></span>").attr("id", "west-closer").prependTo(westSelector);
  16. $("<span></span>").attr("id", "east-closer").prependTo(eastSelector);
  17. // BIND layout events to close-buttons to make them functional
  18. //outerLayout.addCloseBtn("#west-closer", "west");
  19. //outerLayout.addCloseBtn("#east-closer", "east");
  20. });
  21. var layoutSettings_Outer = {
  22. name: "outerLayout" // NO FUNCTIONAL USE, but could be used by custom code to 'identify' a layout
  23. // options.defaults apply to ALL PANES - but overridden by pane-specific settings
  24. , defaults: {
  25. size: "auto"
  26. , minSize: 50
  27. , paneClass: "pane" // default = 'ui-layout-pane'
  28. , resizerClass: "resizer" // default = 'ui-layout-resizer'
  29. , togglerClass: "toggler" // default = 'ui-layout-toggler'
  30. , buttonClass: "button" // default = 'ui-layout-button'
  31. , contentSelector: ".content" // inner div to auto-size so only it scrolls, not the entire pane!
  32. , contentIgnoreSelector: "span" // 'paneSelector' for content to 'ignore' when measuring room for content
  33. , togglerLength_open: 35 // WIDTH of toggler on north/south edges - HEIGHT on east/west edges
  34. , togglerLength_closed: 35 // "100%" OR -1 = full height
  35. , hideTogglerOnSlide: true // hide the toggler when pane is 'slid open'
  36. , togglerTip_open: "收起面板"
  37. , togglerTip_closed: "展开面板"
  38. , resizerTip: "拖动面板"
  39. , sliderTip: "展开面板"
  40. // effect defaults - overridden on some panes
  41. , fxName: "slide" // none, slide, drop, scale
  42. , fxSpeed_open: 750
  43. , fxSpeed_close: 1500
  44. , fxSettings_open: {easing: "easeInQuint"}
  45. , fxSettings_close: {easing: "easeOutQuint"}
  46. }
  47. , north: {
  48. minSize: 28
  49. , size: 200
  50. , spacing_closed: 5 // HIDE resizer & toggler when 'closed'
  51. , resizable: true
  52. , slidable: true // REFERENCE - cannot slide if spacing_closed = 0
  53. , initClosed: false
  54. }
  55. , south: {
  56. minSize: 28
  57. , size: 200
  58. , spacing_closed: 5 // HIDE resizer & toggler when 'closed'
  59. , resizable: true
  60. , slidable: true // REFERENCE - cannot slide if spacing_closed = 0
  61. , initClosed: false
  62. }
  63. , west: {
  64. size: 120
  65. , spacing_closed: 21 // wider space when closed
  66. , togglerLength_closed: 21 // make toggler 'square' - 21x21
  67. , togglerAlign_closed: "top" // align to top of resizer
  68. , togglerLength_open: 0 // NONE - using custom togglers INSIDE west-pane
  69. , togglerTip_open: "收起主菜单"
  70. , togglerTip_closed: "展开主菜单"
  71. , resizerTip_open: "拖动面板"
  72. , slideTrigger_open: "click" // default
  73. , resizable: true
  74. , slidable: false // REFERENCE - cannot slide if spacing_closed = 0
  75. , initClosed: false
  76. // add 'bounce' option to default 'slide' effect
  77. , fxSettings_open: {easing: "easeOutBounce"}
  78. }
  79. , east: {
  80. size: 200
  81. , resizable: true
  82. , spacing_closed: 21 // wider space when closed
  83. , togglerLength_closed: 21 // make toggler 'square' - 21x21
  84. , togglerAlign_closed: "top" // align to top of resizer
  85. , togglerLength_open: 0 // NONE - using custom togglers INSIDE east-pane
  86. , togglerTip_open: "关起工具箱"
  87. , togglerTip_closed: "打开工具箱"
  88. , resizerTip_open: "拖动面板"
  89. , slideTrigger_open: "click"
  90. , initClosed: true
  91. // override default effect, speed, and settings
  92. , fxName: "drop"
  93. , fxSpeed: "normal"
  94. , fxSettings: {easing: ""} // nullify default easing
  95. }
  96. , center: {
  97. minWidth: 200
  98. , minHeight: 200
  99. }
  100. };