Skip to content

Instantly share code, notes, and snippets.

@nvn-odoo
Created July 30, 2019 11:07
Show Gist options
  • Save nvn-odoo/60026ff91c36878ac677df9ea4bb3730 to your computer and use it in GitHub Desktop.
Save nvn-odoo/60026ff91c36878ac677df9ea4bb3730 to your computer and use it in GitHub Desktop.
// 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