| @@ 4650-4741 (lines=92) @@ | ||
| 4647 | } |
|
| 4648 | }); |
|
| 4649 | ||
| 4650 | function WindowManagerImpl (editor) { |
|
| 4651 | var open$$1 = function (args, params, closeCallback) { |
|
| 4652 | var win; |
|
| 4653 | args.title = args.title || ' '; |
|
| 4654 | args.url = args.url || args.file; |
|
| 4655 | if (args.url) { |
|
| 4656 | args.width = parseInt(args.width || 320, 10); |
|
| 4657 | args.height = parseInt(args.height || 240, 10); |
|
| 4658 | } |
|
| 4659 | if (args.body) { |
|
| 4660 | args.items = { |
|
| 4661 | defaults: args.defaults, |
|
| 4662 | type: args.bodyType || 'form', |
|
| 4663 | items: args.body, |
|
| 4664 | data: args.data, |
|
| 4665 | callbacks: args.commands |
|
| 4666 | }; |
|
| 4667 | } |
|
| 4668 | if (!args.url && !args.buttons) { |
|
| 4669 | args.buttons = [ |
|
| 4670 | { |
|
| 4671 | text: 'Ok', |
|
| 4672 | subtype: 'primary', |
|
| 4673 | onclick: function () { |
|
| 4674 | win.find('form')[0].submit(); |
|
| 4675 | } |
|
| 4676 | }, |
|
| 4677 | { |
|
| 4678 | text: 'Cancel', |
|
| 4679 | onclick: function () { |
|
| 4680 | win.close(); |
|
| 4681 | } |
|
| 4682 | } |
|
| 4683 | ]; |
|
| 4684 | } |
|
| 4685 | win = new Window$$1(args); |
|
| 4686 | win.on('close', function () { |
|
| 4687 | closeCallback(win); |
|
| 4688 | }); |
|
| 4689 | if (args.data) { |
|
| 4690 | win.on('postRender', function () { |
|
| 4691 | this.find('*').each(function (ctrl) { |
|
| 4692 | var name$$1 = ctrl.name(); |
|
| 4693 | if (name$$1 in args.data) { |
|
| 4694 | ctrl.value(args.data[name$$1]); |
|
| 4695 | } |
|
| 4696 | }); |
|
| 4697 | }); |
|
| 4698 | } |
|
| 4699 | win.features = args || {}; |
|
| 4700 | win.params = params || {}; |
|
| 4701 | win = win.renderTo(document.body).reflow(); |
|
| 4702 | return win; |
|
| 4703 | }; |
|
| 4704 | var alert$$1 = function (message, choiceCallback, closeCallback) { |
|
| 4705 | var win; |
|
| 4706 | win = MessageBox.alert(message, function () { |
|
| 4707 | choiceCallback(); |
|
| 4708 | }); |
|
| 4709 | win.on('close', function () { |
|
| 4710 | closeCallback(win); |
|
| 4711 | }); |
|
| 4712 | return win; |
|
| 4713 | }; |
|
| 4714 | var confirm$$1 = function (message, choiceCallback, closeCallback) { |
|
| 4715 | var win; |
|
| 4716 | win = MessageBox.confirm(message, function (state) { |
|
| 4717 | choiceCallback(state); |
|
| 4718 | }); |
|
| 4719 | win.on('close', function () { |
|
| 4720 | closeCallback(win); |
|
| 4721 | }); |
|
| 4722 | return win; |
|
| 4723 | }; |
|
| 4724 | var close$$1 = function (window$$1) { |
|
| 4725 | window$$1.close(); |
|
| 4726 | }; |
|
| 4727 | var getParams = function (window$$1) { |
|
| 4728 | return window$$1.params; |
|
| 4729 | }; |
|
| 4730 | var setParams = function (window$$1, params) { |
|
| 4731 | window$$1.params = params; |
|
| 4732 | }; |
|
| 4733 | return { |
|
| 4734 | open: open$$1, |
|
| 4735 | alert: alert$$1, |
|
| 4736 | confirm: confirm$$1, |
|
| 4737 | close: close$$1, |
|
| 4738 | getParams: getParams, |
|
| 4739 | setParams: setParams |
|
| 4740 | }; |
|
| 4741 | } |
|
| 4742 | ||
| 4743 | var get = function (editor) { |
|
| 4744 | var renderUI = function (args) { |
|
| @@ 4128-4219 (lines=92) @@ | ||
| 4125 | } |
|
| 4126 | }); |
|
| 4127 | ||
| 4128 | function WindowManagerImpl (editor) { |
|
| 4129 | var open$$1 = function (args, params, closeCallback) { |
|
| 4130 | var win; |
|
| 4131 | args.title = args.title || ' '; |
|
| 4132 | args.url = args.url || args.file; |
|
| 4133 | if (args.url) { |
|
| 4134 | args.width = parseInt(args.width || 320, 10); |
|
| 4135 | args.height = parseInt(args.height || 240, 10); |
|
| 4136 | } |
|
| 4137 | if (args.body) { |
|
| 4138 | args.items = { |
|
| 4139 | defaults: args.defaults, |
|
| 4140 | type: args.bodyType || 'form', |
|
| 4141 | items: args.body, |
|
| 4142 | data: args.data, |
|
| 4143 | callbacks: args.commands |
|
| 4144 | }; |
|
| 4145 | } |
|
| 4146 | if (!args.url && !args.buttons) { |
|
| 4147 | args.buttons = [ |
|
| 4148 | { |
|
| 4149 | text: 'Ok', |
|
| 4150 | subtype: 'primary', |
|
| 4151 | onclick: function () { |
|
| 4152 | win.find('form')[0].submit(); |
|
| 4153 | } |
|
| 4154 | }, |
|
| 4155 | { |
|
| 4156 | text: 'Cancel', |
|
| 4157 | onclick: function () { |
|
| 4158 | win.close(); |
|
| 4159 | } |
|
| 4160 | } |
|
| 4161 | ]; |
|
| 4162 | } |
|
| 4163 | win = new Window$$1(args); |
|
| 4164 | win.on('close', function () { |
|
| 4165 | closeCallback(win); |
|
| 4166 | }); |
|
| 4167 | if (args.data) { |
|
| 4168 | win.on('postRender', function () { |
|
| 4169 | this.find('*').each(function (ctrl) { |
|
| 4170 | var name$$1 = ctrl.name(); |
|
| 4171 | if (name$$1 in args.data) { |
|
| 4172 | ctrl.value(args.data[name$$1]); |
|
| 4173 | } |
|
| 4174 | }); |
|
| 4175 | }); |
|
| 4176 | } |
|
| 4177 | win.features = args || {}; |
|
| 4178 | win.params = params || {}; |
|
| 4179 | win = win.renderTo(document.body).reflow(); |
|
| 4180 | return win; |
|
| 4181 | }; |
|
| 4182 | var alert$$1 = function (message, choiceCallback, closeCallback) { |
|
| 4183 | var win; |
|
| 4184 | win = MessageBox.alert(message, function () { |
|
| 4185 | choiceCallback(); |
|
| 4186 | }); |
|
| 4187 | win.on('close', function () { |
|
| 4188 | closeCallback(win); |
|
| 4189 | }); |
|
| 4190 | return win; |
|
| 4191 | }; |
|
| 4192 | var confirm$$1 = function (message, choiceCallback, closeCallback) { |
|
| 4193 | var win; |
|
| 4194 | win = MessageBox.confirm(message, function (state) { |
|
| 4195 | choiceCallback(state); |
|
| 4196 | }); |
|
| 4197 | win.on('close', function () { |
|
| 4198 | closeCallback(win); |
|
| 4199 | }); |
|
| 4200 | return win; |
|
| 4201 | }; |
|
| 4202 | var close$$1 = function (window$$1) { |
|
| 4203 | window$$1.close(); |
|
| 4204 | }; |
|
| 4205 | var getParams = function (window$$1) { |
|
| 4206 | return window$$1.params; |
|
| 4207 | }; |
|
| 4208 | var setParams = function (window$$1, params) { |
|
| 4209 | window$$1.params = params; |
|
| 4210 | }; |
|
| 4211 | return { |
|
| 4212 | open: open$$1, |
|
| 4213 | alert: alert$$1, |
|
| 4214 | confirm: confirm$$1, |
|
| 4215 | close: close$$1, |
|
| 4216 | getParams: getParams, |
|
| 4217 | setParams: setParams |
|
| 4218 | }; |
|
| 4219 | } |
|
| 4220 | ||
| 4221 | var get = function (editor, panel) { |
|
| 4222 | var renderUI = function () { |
|