Changeset 2aaa08 in indico


Ignore:
Timestamp:
04/20/10 16:15:35 (3 years ago)
Author:
Pedro Ferreira <jose.pedro.ferreira@…>
Branches:
master, burotel, hello-world-walkthrough, ipv6, new-webex, v0.97-series, v0.98-series, v0.98.2, v0.98.3, v0.98b1, v0.98b2, v0.99, 051b2622c51afb171a1dedb46a0df4fbb0cbd02e, d9941f8582b36b24821a11ea5ba16fda6a457fb1
Children:
0009bb
Parents:
434f2b
git-author:
David Martín Clavo <david.martin.clavo@…> (04/06/10 17:32:20)
git-committer:
Pedro Ferreira <jose.pedro.ferreira@…> (04/20/10 16:15:35)
Message:

[IMP] Collaboration: ConfirmPopup? in remove

File:
1 edited

Legend:

Unmodified
Added
Removed
  • indico/htdocs/js/indico/Collaboration/Collaboration.js

    r12c4a0 r2aaa08  
    12031203var removeBooking = function(booking, conferenceId) { 
    12041204 
    1205     var title = "Remove booking"; 
    1206  
    1207     var popup = new ExclusivePopup(title, function(){return true;}); 
    1208  
    1209     popup.draw = function(){ 
    1210         var self = this; 
    1211         var span = Html.span("", "Are you sure you want to remove that " + booking.type + " booking?"); 
    1212  
    1213         // We construct the "ok" button and what happens when it's pressed 
    1214         var okButton = Html.input('button', null, "Remove"); 
    1215         okButton.observeClick(function() { 
    1216             var killProgress = IndicoUI.Dialogs.Util.progress("Removing your booking..."); 
    1217  
    1218             indicoRequest( 
    1219                 'collaboration.removeCSBooking', 
    1220                 { 
    1221                     conference: conferenceId, 
    1222                     bookingId: booking.id 
    1223                 }, 
    1224                 function(result,error) { 
    1225                     if (!error) { 
    1226                         // If the server found no problems, we remove the booking from the watchlist and remove the corresponding iframe. 
    1227                         if (result && result.error) { 
    1228                             killProgress(); 
    1229                             codes[booking.type].errorHandler('remove', result); 
    1230                         } else { 
    1231                             hideAllInfoRows(false); 
    1232                             bookings.removeAt(getBookingIndexById(booking.id)) 
    1233                             showAllInfoRows(false); 
    1234                             removeIFrame(booking); 
    1235                             refreshStartAllStopAllButtons(); 
    1236                             refreshTableHead(); 
    1237  
    1238                             if (pluginHasFunction(booking.type, 'postDelete')) { 
    1239                                 codes[booking.type].postDelete(result); 
    1240                             } 
     1205    var confirmHandler = function(confirm) { if (confirm) { 
     1206 
     1207        var killProgress = IndicoUI.Dialogs.Util.progress($T("Removing your booking...")); 
     1208 
     1209        indicoRequest( 
     1210            'collaboration.removeCSBooking', 
     1211            { 
     1212                conference: conferenceId, 
     1213                bookingId: booking.id 
     1214            }, 
     1215            function(result,error) { 
     1216                if (!error) { 
     1217                    // If the server found no problems, we remove the booking from the watchlist and remove the corresponding iframe. 
     1218                    if (result && result.error) { 
     1219                        killProgress(); 
     1220                        codes[booking.type].errorHandler('remove', result); 
     1221                    } else { 
     1222                        hideAllInfoRows(false); 
     1223                        bookings.removeAt(getBookingIndexById(booking.id)) 
     1224                        showAllInfoRows(false); 
     1225                        removeIFrame(booking); 
     1226                        refreshStartAllStopAllButtons(); 
     1227                        refreshTableHead(); 
     1228 
     1229                        if (pluginHasFunction(booking.type, 'postDelete')) { 
     1230                            codes[booking.type].postDelete(result); 
    12411231                        } 
    1242                         killProgress(); 
    1243                     } else { 
    1244                         killProgress(); 
    1245                         IndicoUtil.errorReport(error); 
    12461232                    } 
    1247                 } 
    1248             ); 
    1249             self.close(); 
    1250         }); 
    1251  
    1252         // We construct the "cancel" button and what happens when it's pressed (which is: just close the dialog) 
    1253         var cancelButton = Html.input('button', {style:{marginLeft:pixels(5)}}, "Cancel"); 
    1254         cancelButton.observeClick(function(){ 
    1255             self.close(); 
    1256         }); 
    1257  
    1258         var buttonDiv = Html.div({style:{textAlign:"center", marginTop:pixels(10)}}, okButton, cancelButton) 
    1259  
    1260         return this.ExclusivePopup.prototype.draw.call(this, Widget.block([span, Html.br(), buttonDiv])); 
    1261     }; 
    1262     popup.open(); 
     1233                    killProgress(); 
     1234                } else { 
     1235                    killProgress(); 
     1236                    IndicoUtil.errorReport(error); 
     1237                } 
     1238            } 
     1239        ); 
     1240    }}; 
     1241 
     1242    IndicoUI.Dialogs.Util.confirm($T("Remove booking"), 
     1243            Html.div({style:{paddingTop:pixels(10), paddingBottom:pixels(10)}}, $T("Are you sure you want to remove that ") + booking.type + $T(" booking?")), 
     1244            confirmHandler); 
    12631245}; 
    12641246 
Note: See TracChangeset for help on using the changeset viewer.