test/emission_fichiers/rf_player.js
branchnew-model
changeset 882 61c384dda19e
parent 881 f11b234497f7
child 883 d35ad8111c5e
equal deleted inserted replaced
881:f11b234497f7 882:61c384dda19e
     1 Drupal.behaviors.rfPlayerOpeningLinks = function(context) {
       
     2   $('a.rf-player-open:not(.rf-player-open-processed)', context).each(function () {
       
     3     var common_settings = { 
       
     4       height: 458,
       
     5       width: 560,
       
     6       top: 150,
       
     7       left: 250,
       
     8       windowName: 'player'
       
     9     }
       
    10 
       
    11     var chrome_settings = { 
       
    12       height: 515,
       
    13       width: 560,
       
    14       top: 150,
       
    15       left: 250,
       
    16       windowName: 'player'
       
    17     }
       
    18 
       
    19     var chrome_settings_windows = { 
       
    20       height: 465,
       
    21       width: 560,
       
    22       top: 150,
       
    23       left: 250,
       
    24       windowName: 'player'
       
    25     }
       
    26 
       
    27     var is_chrome = /chrome/.test(navigator.userAgent.toLowerCase());
       
    28     var is_windows = /windows/.test(navigator.userAgent.toLowerCase());
       
    29 
       
    30     if (is_chrome == false) {
       
    31       $(this).popupWindow(common_settings);
       
    32     }
       
    33     else {
       
    34       if (is_windows == false) {
       
    35         $(this).popupWindow(chrome_settings);
       
    36       }
       
    37       else {
       
    38         $(this).popupWindow(chrome_settings_windows);
       
    39       }
       
    40     }
       
    41 
       
    42     // We can add the processed class
       
    43     $(this).addClass('rf-player-open-processed');
       
    44   });
       
    45 };