1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Roo.namespace('Pman.Dialog');
7 Pman.Dialog.BAdminImage= function() {}
8 Roo.apply(Pman.Dialog.BAdminImage.prototype, {
11 'ef797d5638c2e1c6b6225b2247541ea5' :"Upload Image or File:",
12 '2859a4ae58ae4e25abdfc530f814e42f' :"Upload an Image or File",
13 'ea4788705e6873b424c65e91c2846b19' :"Cancel",
14 '91412465ea9169dfd901dd5e7c96dd99' :"Upload"
17 'imageUpload_fieldLabel' : 'ef797d5638c2e1c6b6225b2247541ea5' /* Upload Image or File: */
23 show : function(data, cb)
31 this.dialog.show(this.data._el);
34 this.form.setValues(data);
35 this.form.fireEvent('actioncomplete', this.form, { type: 'setdata', data: data });
43 this.dialog = Roo.factory({
46 title : _this._strings['2859a4ae58ae4e25abdfc530f814e42f'] /* Upload an Image or File */,
47 uploadComplete : false,
48 uploadProgress : function()
51 if (!dlg.haveProgress) {
52 Roo.MessageBox.progress("Uploading", "Uploading");
55 if (dlg.haveProgress == 2) {
56 // it's been closed elsewhere..
59 if (dlg.uploadComplete) {
60 Roo.MessageBox.hide();
66 var uid = _this.form.findField('UPLOAD_IDENTIFIER').getValue();
68 url : baseURL + '/Core/UploadProgress.php',
73 success : function(res){
75 if (dlg.haveProgress == 2) {
79 if (dlg.uploadComplete) {
80 Roo.MessageBox.hide();
85 Roo.MessageBox.updateProgress(data.bytes_uploaded/data.bytes_total,
86 Math.floor((data.bytes_total - data.bytes_uploaded)/1000) + 'k remaining'
89 Roo.MessageBox.updateProgress(1,
90 "Upload Complete - processing"
94 dlg.uploadProgress.defer(2000,dlg);
96 failure: function(data) {
102 '|xns' : 'Roo.bootstrap',
106 html : _this._strings['ea4788705e6873b424c65e91c2846b19'] /* Cancel */,
109 click : function (_self, e)
115 '|xns' : 'Roo.bootstrap'
119 html : _this._strings['91412465ea9169dfd901dd5e7c96dd99'] /* Upload */,
122 click : function (_self, e)
126 //_this.dialog.el.mask("Sending");
128 _this.dialog.uploadComplete = false;
129 _this.form.doAction('submit', {
135 _this.dialog.haveProgress = 0; // set to show..
136 _this.dialog.uploadProgress.defer(1000, _this.dialog);
140 '|xns' : 'Roo.bootstrap'
146 style : 'width: 100%',
148 '|xns' : 'Roo.bootstrap',
155 url : baseURL + '/Roo/Images.php',
157 actioncomplete : function(_self,action)
159 _this.dialog.uploadComplete = true;
161 _this.dialog.haveProgress = 2;
163 Roo.MessageBox.hide();
165 if (action.type == 'setdata') {
168 _this.form.findField('imgtype').hide();
170 if(_this.data._show_image_type){
171 _this.form.findField('imgtype').show();
175 this.url = _this.data._url ? baseURL + _this.data._url : baseURL + '/Roo/Images.php';
176 this.el.dom.action = this.url;
177 if (typeof(_this.data.timeout) != 'undefined') {
178 this.timeout = _this.data.timeout;
181 this.findField('UPLOAD_IDENTIFIER').setValue(
182 (new Date() * 1) + '' + Math.random());
188 if (action.type == 'load') {
190 _this.data = action.result.data;
196 if (action.type == 'submit') { // only submitted here if we are
198 Roo.log("Upload success");
200 if (_this.callback) {
201 _this.callback.call(this, action.result.data, action.result.extra);
209 actionfailed : function (_self, action)
211 _this.dialog.uploadComplete = true;
213 _this.dialog.haveProgress = 2;
215 if (action.type == 'submit') {
216 Roo.log("Upload error");
221 Roo.MessageBox.alert("Error", action.result.errorMsg.split(/\n/).join('<BR/>'));
225 Roo.MessageBox.alert("Error", "Saving failed = fix errors and try again");
230 Roo.MessageBox.alert("Error", "Error loading details");
232 render : function (_self)
238 '|xns' : 'Roo.bootstrap',
242 fieldLabel : _this._strings['ef797d5638c2e1c6b6225b2247541ea5'] /* Upload Image or File: */,
245 name : 'imageUpload',
247 '|xns' : 'Roo.bootstrap'
251 inputType : 'hidden',
252 name : 'UPLOAD_IDENTIFIER',
254 '|xns' : 'Roo.bootstrap'
258 inputType : 'hidden',
259 name : 'post_max_size',
261 '|xns' : 'Roo.bootstrap'
265 inputType : 'hidden',
266 name : 'upload_max_filesize',
268 '|xns' : 'Roo.bootstrap'
272 inputType : 'hidden',
275 '|xns' : 'Roo.bootstrap'
279 inputType : 'hidden',
282 '|xns' : 'Roo.bootstrap'
286 inputType : 'hidden',
289 '|xns' : 'Roo.bootstrap'
299 Roo.apply(Pman.Dialog.BAdminImage, Pman.Dialog.BAdminImage.prototype);