Plugin Directory


Ignore:
Timestamp:
04/09/2013 06:08:58 PM (13 years ago)
Author:
nickdaugherty
Message:

Version 1.2, including several UI improvements and new plugins / constants

File:
1 edited

Legend:

Unmodified
Added
Removed
  • developer/trunk/developer.js

    r592210 r694698  
    66                href: href,
    77                title: a8c_developer_i18n.lightbox_title,
    8                 innerWidth: 500,
     8                innerWidth: 650,
    99                maxHeight: '100%',
    1010                transition: transition
     
    6161                .success( function( result ) {
    6262                    if ( '1' === result ) {
    63                         $(button).html( a8c_developer_i18n.installed );
     63                        $( button )
     64                            .html( a8c_developer_i18n.installed )
     65                            .nextAll( '.a8c-developer-action-result' )
     66                            .remove();
     67
    6468                        $(button).unbind('click').prop('disabled', true);
    6569                    } else {
    6670                        alert( result );
    67                         $(button).html( a8c_developer_i18n.error );
    68                     }
    69                 })
    70                 .error( function() {
    71                     $(button).html( a8c_developer_i18n.error );
     71
     72                        $( button )
     73                            .html( a8c_developer_i18n.ERROR )
     74                            .nextAll( '.a8c-developer-action-result' )
     75                            .remove();
     76
     77                        $( button ).after( '<span class="a8c-developer-action-result error">' + result + '</span>' );
     78                    }
     79                })
     80                .error( function( response ) {
     81                    $( button )
     82                        .html( a8c_developer_i18n.ERROR )
     83                        .nextAll( '.a8c-developer-action-result' )
     84                        .remove();
     85
     86                    $( button ).after( '<span class="a8c-developer-action-result error">' + response.statusText + ': ' + response.responseText + '</span>' );
    7287                })
    7388            ;
     
    86101                .success( function( result ) {
    87102                    if ( '1' === result ) {
    88                         $(button).html( a8c_developer_i18n.activated );
     103                        $( button )
     104                            .html( a8c_developer_i18n.activated )
     105                            .nextAll( '.a8c-developer-action-result' )
     106                            .remove();
     107
    89108                        $(button).unbind('click').prop('disabled', true);
    90109                    } else {
    91110                        alert( result );
    92                         $(button).html( a8c_developer_i18n.error );
    93                     }
    94                 })
    95                 .error( function() {
    96                     $(button).html( a8c_developer_i18n.error );
    97                 })
    98             ;
     111
     112                        $( button )
     113                            .html( a8c_developer_i18n.ERROR )
     114                            .nextAll( '.a8c-developer-action-result' )
     115                            .remove();
     116
     117                        $( button ).after( '<span class="a8c-developer-action-result error">' + result + '</span>' );
     118                    }
     119                })
     120                .error( function( response ) {
     121                    $( button )
     122                        .html( a8c_developer_i18n.ERROR )
     123                        .nextAll( '.a8c-developer-action-result' )
     124                        .remove();
     125
     126                    $( button ).after( '<span class="a8c-developer-action-result error">' + response.statusText + ': ' + response.responseText + '</span>' );
     127                })
     128            ;
     129        });
     130
     131        $( '.a8c-developer-button-close' ).on( 'click', function() {
     132            $.colorbox.close();
    99133        });
    100134    })(jQuery);
     
    115149                .success( function( result ) {
    116150                    if ( '1' == result ) {
    117                         $(button).html( a8c_developer_i18n.INSTALLED );
    118                     } else {
    119                         $(button).html( a8c_developer_i18n.ERROR );
    120                     }
    121                 })
    122                 .error( function() {
    123                     $(button).html( a8c_developer_i18n.ERROR );
     151                        $( button )
     152                            .nextAll( '.a8c-developer-action-result' )
     153                            .remove();
     154
     155                        $( button ).replaceWith( "<span class='a8c-developer-active'>" + a8c_developer_i18n.ACTIVE + "</span>" );
     156                    } else {
     157                        $( button )
     158                            .html( a8c_developer_i18n.ERROR )
     159                            .nextAll( '.a8c-developer-action-result' )
     160                            .remove();
     161
     162                        $( button ).after( '<span class="a8c-developer-action-result error">' + result + '</span>' );
     163                    }
     164                })
     165                .error( function( response ) {
     166                    $( button )
     167                        .html( a8c_developer_i18n.ERROR )
     168                        .nextAll( '.a8c-developer-action-result' )
     169                        .remove();
     170
     171                    $( button ).after( '<span class="a8c-developer-action-result error">' + response.statusText + ': ' + response.responseText + '</span>' );
    124172                })
    125173            ;
     
    140188                .success( function( result ) {
    141189                    if ( '1' == result ) {
    142                         $(button).replaceWith("<span class='a8c-developer-active'>" + a8c_developer_i18n.ACTIVE + "</span>");
    143                     } else {
    144                         $(button).html( a8c_developer_i18n.ERROR );
    145                     }
    146                 })
    147                 .error( function() {
    148                     $(button).html( a8c_developer_i18n.ERROR );
     190                        $( button )
     191                            .nextAll( '.a8c-developer-action-result' )
     192                            .remove();
     193
     194                        $( button ).replaceWith( "<span class='a8c-developer-active'>" + a8c_developer_i18n.ACTIVE + "</span>" );
     195                    } else {
     196                        $( button )
     197                            .html( a8c_developer_i18n.ERROR )
     198                            .nextAll( '.a8c-developer-action-result' )
     199                            .remove();
     200
     201                        $( button ).after( '<span class="a8c-developer-action-result error">' + result + '</span>' );
     202                    }
     203                })
     204                .error( function( response ) {
     205                    $( button )
     206                        .html( a8c_developer_i18n.ERROR )
     207                        .nextAll( '.a8c-developer-action-result' )
     208                        .remove();
     209
     210                    $( button ).after( '<span class="a8c-developer-action-result error">' + response.statusText + ': ' + response.responseText + '</span>' );
     211                   
    149212                })
    150213            ;
Note: See TracChangeset for help on using the changeset viewer.