by axew3 » Mon Jan 28, 2019 2:29 pm
ok look may i have over complicate things, it seem to me lack of the right tricky and easy logic that exist behind, even if i've not still discover. I will return over as soon i stop to
fight with an mmpeg install on a centoOS cloud server unable to compile it correctly like a newbie from hours now- damned
But in the while the patched code may can be something like this (that maybe resolve the problem):
Code: Select all
<script>
// a simple mChat style/display example setup for WP
if( /#w3allmchatif/ig.exec(document.URL) != null || /#w3allmchatif/ig.exec(document.location.href) != null ){
var boardU = "{BOARD_URL}";
var hnofollow = 0;
$( document ).ready(function() {
$( "body" ).on("click", "a", function(e) {
var href = $(this).attr("href");
if( typeof href != 'undefined' && this.href[this.href.length -1] != '#' && /\?jumpto=/ig.exec(this.href) == null )
{
if( href.indexOf(boardU) < 0 || href.indexOf('i=permissions&mode=setting_user_global') > -1 || href.indexOf('/mchat') > -1 ){
//if(href.indexOf('/mchat') > -1){
if( /[.+[\/mchat]$/ig.exec(href) !== null ){
return;
}
hnofollow = 1;
e.preventDefault();
e.stopPropagation();
window.open(href,'_blank');
return;
} else {
e.preventDefault();
e.stopPropagation();
window.open(href,'_blank');
return;
}
}
});
$( "#page-header,#page-footer" ).css( { "height" : "0px", "max-height" : "0px", "overflow": "hidden" } ); // can't be none, or events will not affect
$( "body" ).css( "padding", "0px" );
$( ".page-body h2" ).css( "display", "none" );
$( "div.mchat-text blockquote div cite a" ).click(function(e) {
if( /\?jumpto=/ig.exec(this.href) == null ){
e.preventDefault();
if(hnofollow < 1){
window.open(this.href,'_blank');
}
return;
}
});
$( "div.list-inner span.mchat-title a" ).click(function(e) {
e.preventDefault();
window.open(this.href,'_blank');
return;
});
$( "body" ).on("click", ".username,.username-coloured,#mchat-legend a,cite a", function(e) {
var href = $(this).attr("href");
if( typeof href != 'undefined' && /\?jumpto=/ig.exec(this.href) == null ){
e.preventDefault();
if(hnofollow < 1){
window.open(href,'_blank');
}
return;
}
});
}); // ready
}
</script>
ok look may i have over complicate things, it seem to me lack of the right tricky and easy logic that exist behind, even if i've not still discover. I will return over as soon i stop to [i]fight with an mmpeg install on a centoOS cloud server[/i] :( unable to compile it correctly like a newbie from hours now- damned
[b]But in the while the patched code may can be something like this (that maybe resolve the problem):[/b]
[code]<script>
// a simple mChat style/display example setup for WP
if( /#w3allmchatif/ig.exec(document.URL) != null || /#w3allmchatif/ig.exec(document.location.href) != null ){
var boardU = "{BOARD_URL}";
var hnofollow = 0;
$( document ).ready(function() {
$( "body" ).on("click", "a", function(e) {
var href = $(this).attr("href");
if( typeof href != 'undefined' && this.href[this.href.length -1] != '#' && /\?jumpto=/ig.exec(this.href) == null )
{
if( href.indexOf(boardU) < 0 || href.indexOf('i=permissions&mode=setting_user_global') > -1 || href.indexOf('/mchat') > -1 ){
//if(href.indexOf('/mchat') > -1){
if( /[.+[\/mchat]$/ig.exec(href) !== null ){
return;
}
hnofollow = 1;
e.preventDefault();
e.stopPropagation();
window.open(href,'_blank');
return;
} else {
e.preventDefault();
e.stopPropagation();
window.open(href,'_blank');
return;
}
}
});
$( "#page-header,#page-footer" ).css( { "height" : "0px", "max-height" : "0px", "overflow": "hidden" } ); // can't be none, or events will not affect
$( "body" ).css( "padding", "0px" );
$( ".page-body h2" ).css( "display", "none" );
$( "div.mchat-text blockquote div cite a" ).click(function(e) {
if( /\?jumpto=/ig.exec(this.href) == null ){
e.preventDefault();
if(hnofollow < 1){
window.open(this.href,'_blank');
}
return;
}
});
$( "div.list-inner span.mchat-title a" ).click(function(e) {
e.preventDefault();
window.open(this.href,'_blank');
return;
});
$( "body" ).on("click", ".username,.username-coloured,#mchat-legend a,cite a", function(e) {
var href = $(this).attr("href");
if( typeof href != 'undefined' && /\?jumpto=/ig.exec(this.href) == null ){
e.preventDefault();
if(hnofollow < 1){
window.open(href,'_blank');
}
return;
}
});
}); // ready
}
</script>[/code]