Created
July 30, 2019 11:07
-
-
Save nvn-odoo/60026ff91c36878ac677df9ea4bb3730 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// use cjs to run javascript on pages. | |
String.prototype.replaceAll = function(search, replacement) { | |
var target = this; | |
return target.replace(new RegExp(search, 'g'), replacement); | |
}; | |
setInterval(function(){ | |
$('.o_thread_message_content').each(function(i, el) { | |
if($(el).html() !== "" ) { | |
var temp = $(el).html().toString(); | |
if ( temp !== temp.toLowerCase() ) | |
{ | |
console.log("lovelify -- transform to lowercase") | |
$(el).html($(el).html().toLowerCase()); | |
} | |
var temp = $(el).html().toString(); | |
if ( temp !== temp.replaceAll("urgent", "cool") ) | |
{ | |
console.log("lovelify -- urgent -> cool") | |
$(el).html($(el).html().replaceAll("urgent", "cool")); | |
} | |
var temp = $(el).html().toString(); | |
if ( temp !== temp.replaceAll("!", "♥") ) | |
{ | |
console.log("lovelify -- ! -> heart") | |
$(el).html($(el).html().replaceAll("!", "♥")); | |
} | |
} | |
}); | |
if (!( $(".o_form_sheet_bg").css('resize') == 'horizontal') ) | |
{ | |
$(".o_form_sheet_bg").css("resize","horizontal") | |
} | |
}, 2000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment