Edit File by line
/home/barbar84/www/wp-conte.../themes/Divi/core/admin/js
File: common.js
(function($){
[0] Fix | Delete
$(document).ready( function(){
[1] Fix | Delete
var user_agent = navigator.userAgent;
[2] Fix | Delete
var is_opera_edge;
[3] Fix | Delete
var browser = user_agent.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))/i) || [];
[4] Fix | Delete
var browser_name = '';
[5] Fix | Delete
var browser_class = '';
[6] Fix | Delete
[7] Fix | Delete
if ( /trident/i.test( browser[0] ) ) {
[8] Fix | Delete
browser_name = 'ie';
[9] Fix | Delete
} else if ( browser[0] === 'Chrome' ) {
[10] Fix | Delete
is_opera_edge = user_agent.match(/\b(OPR|Edge)/);
[11] Fix | Delete
[12] Fix | Delete
if ( is_opera_edge !== null ) {
[13] Fix | Delete
browser_name = is_opera_edge[0].replace('OPR', 'opera');
[14] Fix | Delete
}
[15] Fix | Delete
}
[16] Fix | Delete
[17] Fix | Delete
// use navigator.appName as browser name if we were unable to get it from user_agent
[18] Fix | Delete
if ( '' === browser_name ) {
[19] Fix | Delete
if ('standalone' in window.navigator && !window.navigator.standalone) {
[20] Fix | Delete
browser_name = 'uiwebview';
[21] Fix | Delete
} else {
[22] Fix | Delete
browser_name = browser[0] && '' !== browser[0] ? browser[0] : navigator.appName;
[23] Fix | Delete
}
[24] Fix | Delete
}
[25] Fix | Delete
[26] Fix | Delete
browser_name = browser_name.toLowerCase();
[27] Fix | Delete
[28] Fix | Delete
// convert browser name to class. Some classes do not match the browser name
[29] Fix | Delete
switch( browser_name ) {
[30] Fix | Delete
case 'msie' :
[31] Fix | Delete
browser_class = 'ie';
[32] Fix | Delete
break;
[33] Fix | Delete
case 'firefox' :
[34] Fix | Delete
browser_class = 'gecko';
[35] Fix | Delete
break;
[36] Fix | Delete
default :
[37] Fix | Delete
browser_class = browser_name;
[38] Fix | Delete
break;
[39] Fix | Delete
}
[40] Fix | Delete
[41] Fix | Delete
// add `iphone` class if browsing from iphone
[42] Fix | Delete
if ( user_agent.match(/iPhone/) ) {
[43] Fix | Delete
browser_class += ' iphone';
[44] Fix | Delete
}
[45] Fix | Delete
[46] Fix | Delete
$( 'body' ).addClass( browser_class );
[47] Fix | Delete
});
[48] Fix | Delete
})(jQuery);
[49] Fix | Delete
[50] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function