author | Clipperz <info@clipperz.com> | 2013-01-31 13:42:04 (UTC) |
---|---|---|
committer | Clipperz <info@clipperz.com> | 2013-01-31 13:42:04 (UTC) |
commit | 07d0357beef5d9328a2dd8d07ad7b39c87ac55e4 (patch) (unidiff) | |
tree | f7a4aed8848302db153c2a211f8e58b944eb4c5b /frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/CardDialogController.js | |
parent | 767a3dcf48b6ac911c088af5dd7738a728eb6b99 (diff) | |
download | clipperz-07d0357beef5d9328a2dd8d07ad7b39c87ac55e4.zip clipperz-07d0357beef5d9328a2dd8d07ad7b39c87ac55e4.tar.gz clipperz-07d0357beef5d9328a2dd8d07ad7b39c87ac55e4.tar.bz2 |
Updated Copyright claims
- updated reference dates;
- removed reference to Community Edition;
- normalized logging using Clipperz.log[Warn|Error|Debug]
Diffstat (limited to 'frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/CardDialogController.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/CardDialogController.js | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/CardDialogController.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/CardDialogController.js index effde31..b1ff81f 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/CardDialogController.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/CardDialogController.js | |||
@@ -1,118 +1,116 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); |
27 | 25 | ||
28 | Clipperz.PM.UI.Web.Controllers.CardDialogController = function(args) { | 26 | Clipperz.PM.UI.Web.Controllers.CardDialogController = function(args) { |
29 | args = args || {}; | 27 | args = args || {}; |
30 | 28 | ||
31 | Clipperz.PM.UI.Web.Controllers.CardDialogController.superclass.constructor.call(this, args); | 29 | Clipperz.PM.UI.Web.Controllers.CardDialogController.superclass.constructor.call(this, args); |
32 | 30 | ||
33 | this._record = args.record || Clipperz.Base.exception.raise('MandatoryParameter'); | 31 | this._record = args.record || Clipperz.Base.exception.raise('MandatoryParameter'); |
34 | this._delegate = args.delegate || Clipperz.Base.exception.raise('MandatoryParameter'); | 32 | this._delegate = args.delegate || Clipperz.Base.exception.raise('MandatoryParameter'); |
35 | 33 | ||
36 | this._referenceElement = null; | 34 | this._referenceElement = null; |
37 | this._cardDialogComponent = null; | 35 | this._cardDialogComponent = null; |
38 | 36 | ||
39 | this._fieldsReferences = {}; | 37 | this._fieldsReferences = {}; |
40 | this._directLoginReferences = {}; | 38 | this._directLoginReferences = {}; |
41 | 39 | ||
42 | this._directLoginWizardController = null; | 40 | this._directLoginWizardController = null; |
43 | this._directLoginEditingComponent = null; | 41 | this._directLoginEditingComponent = null; |
44 | this._isDirectLoginEditingComponentVisible = false; | 42 | this._isDirectLoginEditingComponentVisible = false; |
45 | 43 | ||
46 | return this; | 44 | return this; |
47 | }; | 45 | }; |
48 | 46 | ||
49 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Controllers.CardDialogController, Object, { | 47 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Controllers.CardDialogController, Object, { |
50 | 48 | ||
51 | 'toString': function() { | 49 | 'toString': function() { |
52 | return "Clipperz.PM.UI.Web.Controllers.CardDialogController"; | 50 | return "Clipperz.PM.UI.Web.Controllers.CardDialogController"; |
53 | }, | 51 | }, |
54 | 52 | ||
55 | //------------------------------------------------------------------------- | 53 | //------------------------------------------------------------------------- |
56 | 54 | ||
57 | 'record': function () { | 55 | 'record': function () { |
58 | return this._record; | 56 | return this._record; |
59 | }, | 57 | }, |
60 | 58 | ||
61 | 'delegate': function () { | 59 | 'delegate': function () { |
62 | return this._delegate; | 60 | return this._delegate; |
63 | }, | 61 | }, |
64 | 62 | ||
65 | //------------------------------------------------------------------------- | 63 | //------------------------------------------------------------------------- |
66 | 64 | ||
67 | 'fieldsReferences': function () { | 65 | 'fieldsReferences': function () { |
68 | return this._fieldsReferences; | 66 | return this._fieldsReferences; |
69 | }, | 67 | }, |
70 | 68 | ||
71 | 'directLoginReferences': function () { | 69 | 'directLoginReferences': function () { |
72 | return this._directLoginReferences; | 70 | return this._directLoginReferences; |
73 | }, | 71 | }, |
74 | 72 | ||
75 | //------------------------------------------------------------------------- | 73 | //------------------------------------------------------------------------- |
76 | 74 | ||
77 | 'referenceElement': function () { | 75 | 'referenceElement': function () { |
78 | return this._referenceElement; | 76 | return this._referenceElement; |
79 | }, | 77 | }, |
80 | 78 | ||
81 | 'setReferenceElement': function (anElement) { | 79 | 'setReferenceElement': function (anElement) { |
82 | this._referenceElement = anElement; | 80 | this._referenceElement = anElement; |
83 | }, | 81 | }, |
84 | 82 | ||
85 | //------------------------------------------------------------------------- | 83 | //------------------------------------------------------------------------- |
86 | 84 | ||
87 | 'cardDialogComponent': function () { | 85 | 'cardDialogComponent': function () { |
88 | if (this._cardDialogComponent == null) { | 86 | if (this._cardDialogComponent == null) { |
89 | this._cardDialogComponent = new Clipperz.PM.UI.Web.Components.CardDialogComponent(); | 87 | this._cardDialogComponent = new Clipperz.PM.UI.Web.Components.CardDialogComponent(); |
90 | 88 | ||
91 | MochiKit.Signal.connect(this._cardDialogComponent, 'cancel', this, 'handleCancel'); | 89 | MochiKit.Signal.connect(this._cardDialogComponent, 'cancel', this, 'handleCancel'); |
92 | MochiKit.Signal.connect(this._cardDialogComponent, 'save', this, 'handleSave'); | 90 | MochiKit.Signal.connect(this._cardDialogComponent, 'save', this, 'handleSave'); |
93 | 91 | ||
94 | MochiKit.Signal.connect(this._cardDialogComponent, 'addField', this, 'handleAddField'); | 92 | MochiKit.Signal.connect(this._cardDialogComponent, 'addField', this, 'handleAddField'); |
95 | MochiKit.Signal.connect(this._cardDialogComponent, 'changedValue',this, 'handleChangedValue'); | 93 | MochiKit.Signal.connect(this._cardDialogComponent, 'changedValue',this, 'handleChangedValue'); |
96 | 94 | ||
97 | MochiKit.Signal.connect(this._cardDialogComponent, 'addDirectLogin',this, 'handleAddDirectLogin'); | 95 | MochiKit.Signal.connect(this._cardDialogComponent, 'addDirectLogin',this, 'handleAddDirectLogin'); |
98 | MochiKit.Signal.connect(this._cardDialogComponent, 'keyPressed',this, 'handleCardDialogComponentKeyPressed'); | 96 | MochiKit.Signal.connect(this._cardDialogComponent, 'keyPressed',this, 'handleCardDialogComponentKeyPressed'); |
99 | } | 97 | } |
100 | 98 | ||
101 | return this._cardDialogComponent; | 99 | return this._cardDialogComponent; |
102 | }, | 100 | }, |
103 | 101 | ||
104 | //========================================================================= | 102 | //========================================================================= |
105 | 103 | ||
106 | 'directLoginWizardController': function () { | 104 | 'directLoginWizardController': function () { |
107 | if (this._directLoginWizardController == null) { | 105 | if (this._directLoginWizardController == null) { |
108 | this._directLoginWizardController = new Clipperz.PM.UI.Web.Controllers.DirectLoginWizardController({ | 106 | this._directLoginWizardController = new Clipperz.PM.UI.Web.Controllers.DirectLoginWizardController({ |
109 | 'cardLabel': this.cardDialogComponent().title(), | 107 | 'cardLabel': this.cardDialogComponent().title(), |
110 | 'directLoginEditingComponent': this.directLoginEditingComponent() | 108 | 'directLoginEditingComponent': this.directLoginEditingComponent() |
111 | }) | 109 | }) |
112 | 110 | ||
113 | MochiKit.Signal.connect(this._directLoginWizardController, 'exit',this, 'handleHideDirectLoginEditingComponent'); | 111 | MochiKit.Signal.connect(this._directLoginWizardController, 'exit',this, 'handleHideDirectLoginEditingComponent'); |
114 | MochiKit.Signal.connect(this._directLoginWizardController, 'done',this, 'handleCompleteDirectLoginEditingComponent'); | 112 | MochiKit.Signal.connect(this._directLoginWizardController, 'done',this, 'handleCompleteDirectLoginEditingComponent'); |
115 | } | 113 | } |
116 | 114 | ||
117 | return this._directLoginWizardController; | 115 | return this._directLoginWizardController; |
118 | }, | 116 | }, |
@@ -281,193 +279,192 @@ Clipperz.Base.extend(Clipperz.PM.UI.Web.Controllers.CardDialogController, Object | |||
281 | 279 | ||
282 | MochiKit.Base.method(this, 'fieldsReferences'), | 280 | MochiKit.Base.method(this, 'fieldsReferences'), |
283 | MochiKit.Base.values, | 281 | MochiKit.Base.values, |
284 | MochiKit.Base.partial(MochiKit.Base.map, MochiKit.Base.method(this, 'updateRecordFieldValues')), | 282 | MochiKit.Base.partial(MochiKit.Base.map, MochiKit.Base.method(this, 'updateRecordFieldValues')), |
285 | 283 | ||
286 | MochiKit.Base.method(this, 'directLoginReferences'), | 284 | MochiKit.Base.method(this, 'directLoginReferences'), |
287 | MochiKit.Base.values, | 285 | MochiKit.Base.values, |
288 | MochiKit.Base.partial(MochiKit.Base.map, MochiKit.Base.method(this, 'updateRecordDirectLoginValues')), | 286 | MochiKit.Base.partial(MochiKit.Base.map, MochiKit.Base.method(this, 'updateRecordDirectLoginValues')), |
289 | 287 | ||
290 | MochiKit.Base.method(this.directLoginEditingComponent(), 'directLoginReference'), | 288 | MochiKit.Base.method(this.directLoginEditingComponent(), 'directLoginReference'), |
291 | MochiKit.Base.method(this.record(), 'directLoginWithReference'), | 289 | MochiKit.Base.method(this.record(), 'directLoginWithReference'), |
292 | MochiKit.Base.method(this, 'updateRecordDirectLoginDetails'), | 290 | MochiKit.Base.method(this, 'updateRecordDirectLoginDetails'), |
293 | 291 | ||
294 | MochiKit.Base.noop | 292 | MochiKit.Base.noop |
295 | ], {trace:false}); | 293 | ], {trace:false}); |
296 | }, | 294 | }, |
297 | 295 | ||
298 | //------------------------------------------------------------------------- | 296 | //------------------------------------------------------------------------- |
299 | 297 | ||
300 | 'updateRecordFieldValues': function (aFieldReference) { | 298 | 'updateRecordFieldValues': function (aFieldReference) { |
301 | var deferredResult; | 299 | var deferredResult; |
302 | 300 | ||
303 | deferredResult = Clipperz.Async.callbacks('CardDialogController.updateRecordFieldValues', [ | 301 | deferredResult = Clipperz.Async.callbacks('CardDialogController.updateRecordFieldValues', [ |
304 | MochiKit.Base.method(aFieldReference['component'],'label'), | 302 | MochiKit.Base.method(aFieldReference['component'],'label'), |
305 | MochiKit.Base.method(aFieldReference['field'], 'setLabel'), | 303 | MochiKit.Base.method(aFieldReference['field'], 'setLabel'), |
306 | 304 | ||
307 | MochiKit.Base.method(aFieldReference['component'],'value'), | 305 | MochiKit.Base.method(aFieldReference['component'],'value'), |
308 | MochiKit.Base.method(aFieldReference['field'], 'setValue'), | 306 | MochiKit.Base.method(aFieldReference['field'], 'setValue'), |
309 | 307 | ||
310 | MochiKit.Base.method(aFieldReference['component'],'isHidden'), | 308 | MochiKit.Base.method(aFieldReference['component'],'isHidden'), |
311 | MochiKit.Base.method(aFieldReference['field'], 'setIsHidden'), | 309 | MochiKit.Base.method(aFieldReference['field'], 'setIsHidden'), |
312 | 310 | ||
313 | MochiKit.Base.method(aFieldReference['field'], 'actionType'), | 311 | MochiKit.Base.method(aFieldReference['field'], 'actionType'), |
314 | MochiKit.Base.method(aFieldReference['component'],'setActionType') | 312 | MochiKit.Base.method(aFieldReference['component'],'setActionType') |
315 | ], {trace:false}); | 313 | ], {trace:false}); |
316 | 314 | ||
317 | return deferredResult; | 315 | return deferredResult; |
318 | }, | 316 | }, |
319 | 317 | ||
320 | //------------------------------------------------------------------------- | 318 | //------------------------------------------------------------------------- |
321 | 319 | ||
322 | 'updateRecordDirectLoginValues': function (aDirectLoginReference) { | 320 | 'updateRecordDirectLoginValues': function (aDirectLoginReference) { |
323 | var deferredResult; | 321 | var deferredResult; |
324 | 322 | ||
325 | deferredResult = Clipperz.Async.callbacks('CardDialogController.updateRecordDirectLoginValues', [ | 323 | deferredResult = Clipperz.Async.callbacks('CardDialogController.updateRecordDirectLoginValues', [ |
326 | MochiKit.Base.method(aDirectLoginReference['component'], 'label'), | 324 | MochiKit.Base.method(aDirectLoginReference['component'], 'label'), |
327 | MochiKit.Base.method(aDirectLoginReference['directLogin'], 'setLabel') | 325 | MochiKit.Base.method(aDirectLoginReference['directLogin'], 'setLabel') |
328 | ], {trace:false}); | 326 | ], {trace:false}); |
329 | 327 | ||
330 | return deferredResult; | 328 | return deferredResult; |
331 | }, | 329 | }, |
332 | 330 | ||
333 | //------------------------------------------------------------------------- | 331 | //------------------------------------------------------------------------- |
334 | 332 | ||
335 | 'updateRecordDirectLoginDetails': function (aDirectLogin) { | 333 | 'updateRecordDirectLoginDetails': function (aDirectLogin) { |
336 | var result; | 334 | var result; |
337 | 335 | ||
338 | if (MochiKit.Base.isUndefinedOrNull(aDirectLogin)) { | 336 | if (MochiKit.Base.isUndefinedOrNull(aDirectLogin)) { |
339 | result = MochiKit.Async.succeed(); | 337 | result = MochiKit.Async.succeed(); |
340 | } else { | 338 | } else { |
341 | result = Clipperz.Async.callbacks("CardDialogController.updateRecordDirectLoginDetails", [ | 339 | result = Clipperz.Async.callbacks("CardDialogController.updateRecordDirectLoginDetails", [ |
342 | MochiKit.Base.method(this.directLoginEditingComponent(), 'label'), | 340 | MochiKit.Base.method(this.directLoginEditingComponent(), 'label'), |
343 | MochiKit.Base.method(aDirectLogin, 'setLabel'), | 341 | MochiKit.Base.method(aDirectLogin, 'setLabel'), |
344 | MochiKit.Base.method(this.directLoginEditingComponent(), 'favicon'), | 342 | MochiKit.Base.method(this.directLoginEditingComponent(), 'favicon'), |
345 | MochiKit.Base.method(aDirectLogin, 'setFavicon') | 343 | MochiKit.Base.method(aDirectLogin, 'setFavicon') |
346 | ], {trace:false}); | 344 | ], {trace:false}); |
347 | } | 345 | } |
348 | 346 | ||
349 | return result; | 347 | return result; |
350 | }, | 348 | }, |
351 | 349 | ||
352 | //========================================================================= | 350 | //========================================================================= |
353 | 351 | ||
354 | 'addField': function () { | 352 | 'addField': function () { |
355 | return this.record().addField({ | 353 | return this.record().addField({ |
356 | 'label':this.cardDialogComponent().newFieldLabel(), | 354 | 'label':this.cardDialogComponent().newFieldLabel(), |
357 | 'value':this.cardDialogComponent().newFieldValue(), | 355 | 'value':this.cardDialogComponent().newFieldValue(), |
358 | 'isHidden':this.cardDialogComponent().newFieldIsHidden() | 356 | 'isHidden':this.cardDialogComponent().newFieldIsHidden() |
359 | }); | 357 | }); |
360 | }, | 358 | }, |
361 | 359 | ||
362 | 'handleAddField': function () { | 360 | 'handleAddField': function () { |
363 | return Clipperz.Async.callbacks("CardDialogController.handleAddField", [ | 361 | return Clipperz.Async.callbacks("CardDialogController.handleAddField", [ |
364 | MochiKit.Base.method(this, 'addField'), | 362 | MochiKit.Base.method(this, 'addField'), |
365 | 363 | ||
366 | MochiKit.Base.method(this, 'addCardDialogComponentWithField'), | 364 | MochiKit.Base.method(this, 'addCardDialogComponentWithField'), |
367 | MochiKit.Base.method(this.cardDialogComponent(), 'resetNewFieldInputs'), | 365 | MochiKit.Base.method(this.cardDialogComponent(), 'resetNewFieldInputs'), |
368 | 366 | ||
369 | MochiKit.Base.method(this.cardDialogComponent(), 'fixRendering'), | 367 | MochiKit.Base.method(this.cardDialogComponent(), 'fixRendering'), |
370 | MochiKit.Base.method(this, 'handleChangedValue') | 368 | MochiKit.Base.method(this, 'handleChangedValue') |
371 | ], {trace:false}) | 369 | ], {trace:false}) |
372 | }, | 370 | }, |
373 | 371 | ||
374 | //------------------------------------------------------------------------- | 372 | //------------------------------------------------------------------------- |
375 | 373 | ||
376 | 'handlePerformFieldAction': function (aFieldID, aTargetElement) { | 374 | 'handlePerformFieldAction': function (aFieldID, aTargetElement) { |
377 | //console.log("### targetElement", aTargetElement); | ||
378 | return Clipperz.Async.callbacks("CardDialogController.handleDeleteField", [ | 375 | return Clipperz.Async.callbacks("CardDialogController.handleDeleteField", [ |
379 | MochiKit.Base.method(this.record(), 'fields'), | 376 | MochiKit.Base.method(this.record(), 'fields'), |
380 | MochiKit.Base.itemgetter(aFieldID), | 377 | MochiKit.Base.itemgetter(aFieldID), |
381 | Clipperz.Async.collectResults("CardDialogController.handleDeleteField <collect results>", { | 378 | Clipperz.Async.collectResults("CardDialogController.handleDeleteField <collect results>", { |
382 | 'value':MochiKit.Base.methodcaller('value'), | 379 | 'value':MochiKit.Base.methodcaller('value'), |
383 | 'type': MochiKit.Base.methodcaller('actionType') | 380 | 'type': MochiKit.Base.methodcaller('actionType') |
384 | }, {trace:false}), | 381 | }, {trace:false}), |
385 | MochiKit.Base.bind(function (someValues) { | 382 | MochiKit.Base.bind(function (someValues) { |
386 | switch (someValues['type']) { | 383 | switch (someValues['type']) { |
387 | case 'NONE': | 384 | case 'NONE': |
388 | throw "this event handler should not be triggered for fields with type 'NONE'"; | 385 | throw "this event handler should not be triggered for fields with type 'NONE'"; |
389 | break; | 386 | break; |
390 | case 'URL': | 387 | case 'URL': |
391 | var url; | 388 | var url; |
392 | 389 | ||
393 | url = someValues['value']; | 390 | url = someValues['value']; |
394 | if (/^https?\:\/\//.test(url) == false) { | 391 | if (/^https?\:\/\//.test(url) == false) { |
395 | url = 'http://' + url; | 392 | url = 'http://' + url; |
396 | } | 393 | } |
397 | 394 | ||
398 | window.open(url); | 395 | window.open(url); |
399 | break; | 396 | break; |
400 | case 'EMAIL': | 397 | case 'EMAIL': |
401 | var url; | 398 | var url; |
402 | 399 | ||
403 | url = 'mailto:' + someValues['value']; | 400 | url = 'mailto:' + someValues['value']; |
404 | 401 | ||
405 | MochiKit.DOM.currentWindow().location = url; | 402 | MochiKit.DOM.currentWindow().location = url; |
406 | break; | 403 | break; |
407 | case 'PASSWORD': | 404 | case 'PASSWORD': |
408 | //Clipperz.log("SHOW PASSWORD " + someValues['value']); | 405 | //Clipperz.log("SHOW PASSWORD " + someValues['value']); |
409 | this.showPasswordTooltip(someValues['value'], aTargetElement); | 406 | this.showPasswordTooltip(someValues['value'], aTargetElement); |
410 | break; | 407 | break; |
411 | } | 408 | } |
412 | }, this) | 409 | }, this) |
413 | ], {trace:false}); | 410 | ], {trace:false}); |
414 | }, | 411 | }, |
415 | 412 | ||
416 | //------------------------------------------------------------------------- | 413 | //------------------------------------------------------------------------- |
417 | 414 | ||
418 | 'handleDeleteField': function (aFieldID) { | 415 | 'handleDeleteField': function (aFieldID) { |
419 | return Clipperz.Async.callbacks("CardDialogController.handleDeleteField", [ | 416 | return Clipperz.Async.callbacks("CardDialogController.handleDeleteField", [ |
420 | MochiKit.Base.method(this.record(), 'fields'), | 417 | MochiKit.Base.method(this.record(), 'fields'), |
421 | MochiKit.Base.itemgetter(aFieldID), | 418 | MochiKit.Base.itemgetter(aFieldID), |
422 | MochiKit.Base.method(this.record(), 'removeField'), | 419 | MochiKit.Base.method(this.record(), 'removeField'), |
423 | 420 | ||
424 | MochiKit.Base.method(this, 'fieldsReferences'), | 421 | MochiKit.Base.method(this, 'fieldsReferences'), |
425 | MochiKit.Base.itemgetter(aFieldID), | 422 | MochiKit.Base.itemgetter(aFieldID), |
426 | MochiKit.Base.itemgetter('component'), | 423 | MochiKit.Base.itemgetter('component'), |
427 | 424 | ||
428 | function (aComponent) { | 425 | function (aComponent) { |
429 | return Clipperz.Async.callbacks("CardDialogController.handleDeleteField [fade and remove]", [ | 426 | return Clipperz.Async.callbacks("CardDialogController.handleDeleteField [fade and remove]", [ |
430 | MochiKit.Base.partial(Clipperz.Visual.deferredAnimation, MochiKit.Visual.fade, aComponent.element(), {from:1.0, to:0.0, duration:0.5}), | 427 | MochiKit.Base.partial(Clipperz.Visual.deferredAnimation, MochiKit.Visual.fade, aComponent.element(), {from:1.0, to:0.0, duration:0.5}), |
431 | // Clipperz.Visual.deferredAnimation(MochiKit.Visual.fade, aComponent.element(), {from:1.0, to:0.0, duration:0.5}), | 428 | // Clipperz.Visual.deferredAnimation(MochiKit.Visual.fade, aComponent.element(), {from:1.0, to:0.0, duration:0.5}), |
432 | MochiKit.Base.method(aComponent, 'remove') | 429 | MochiKit.Base.method(aComponent, 'remove') |
433 | ], {trace:false}); | 430 | ], {trace:false}); |
434 | }, | 431 | }, |
435 | 432 | ||
436 | MochiKit.Base.bind(function () { | 433 | MochiKit.Base.bind(function () { |
437 | delete this.fieldsReferences()[aFieldID]; | 434 | delete this.fieldsReferences()[aFieldID]; |
438 | }, this), | 435 | }, this), |
439 | 436 | ||
440 | MochiKit.Base.method(this.cardDialogComponent(), 'fixRendering'), | 437 | MochiKit.Base.method(this.cardDialogComponent(), 'fixRendering'), |
441 | MochiKit.Base.method(this, 'handleChangedValue') | 438 | MochiKit.Base.method(this, 'handleChangedValue') |
442 | ], {trace:false}); | 439 | ], {trace:false}); |
443 | }, | 440 | }, |
444 | 441 | ||
445 | //========================================================================= | 442 | //========================================================================= |
446 | 443 | ||
447 | 'handleDeleteDirectLogin': function(aDirectLoginReference) { | 444 | 'handleDeleteDirectLogin': function(aDirectLoginReference) { |
448 | var cardDialogComponent; | 445 | var cardDialogComponent; |
449 | 446 | ||
450 | cardDialogComponent = this.cardDialogComponent(); | 447 | cardDialogComponent = this.cardDialogComponent(); |
451 | 448 | ||
452 | return Clipperz.Async.callbacks("CardDialogController.handleDeleteDirectLogin", [ | 449 | return Clipperz.Async.callbacks("CardDialogController.handleDeleteDirectLogin", [ |
453 | MochiKit.Base.method(this.record(), 'directLogins'), | 450 | MochiKit.Base.method(this.record(), 'directLogins'), |
454 | MochiKit.Base.itemgetter(aDirectLoginReference), | 451 | MochiKit.Base.itemgetter(aDirectLoginReference), |
455 | MochiKit.Base.methodcaller('remove'), | 452 | MochiKit.Base.methodcaller('remove'), |
456 | 453 | ||
457 | MochiKit.Base.method(this, 'directLoginReferences'), | 454 | MochiKit.Base.method(this, 'directLoginReferences'), |
458 | MochiKit.Base.itemgetter(aDirectLoginReference), | 455 | MochiKit.Base.itemgetter(aDirectLoginReference), |
459 | MochiKit.Base.itemgetter('component'), | 456 | MochiKit.Base.itemgetter('component'), |
460 | 457 | ||
461 | function (aComponent) { | 458 | function (aComponent) { |
462 | return Clipperz.Async.callbacks("CardDialogController.handleDeleteDirectLogin [fade and remove]", [ | 459 | return Clipperz.Async.callbacks("CardDialogController.handleDeleteDirectLogin [fade and remove]", [ |
463 | MochiKit.Base.partial(Clipperz.Visual.deferredAnimation, MochiKit.Visual.fade, aComponent.element(), {from:1.0, to:0.0, duration:0.5}),// Clipperz.Visual.deferredAnimation(MochiKit.Visual.fade, aComponent.element(), {from:1.0, to:0.0, duration:0.5}), | 460 | MochiKit.Base.partial(Clipperz.Visual.deferredAnimation, MochiKit.Visual.fade, aComponent.element(), {from:1.0, to:0.0, duration:0.5}),// Clipperz.Visual.deferredAnimation(MochiKit.Visual.fade, aComponent.element(), {from:1.0, to:0.0, duration:0.5}), |
464 | /// MochiKit.Base.method(aComponent, 'remove') | 461 | /// MochiKit.Base.method(aComponent, 'remove') |
465 | MochiKit.Base.method(cardDialogComponent, 'removeDirectLoginComponent', aComponent) | 462 | MochiKit.Base.method(cardDialogComponent, 'removeDirectLoginComponent', aComponent) |
466 | ], {trace:false}); | 463 | ], {trace:false}); |
467 | }, | 464 | }, |
468 | 465 | ||
469 | MochiKit.Base.bind(function () { | 466 | MochiKit.Base.bind(function () { |
470 | delete this.directLoginReferences()[aDirectLoginReference]; | 467 | delete this.directLoginReferences()[aDirectLoginReference]; |
471 | }, this), | 468 | }, this), |
472 | 469 | ||
473 | MochiKit.Base.method(this.cardDialogComponent(), 'fixRendering'), | 470 | MochiKit.Base.method(this.cardDialogComponent(), 'fixRendering'), |