I have a some default SharePoint complicated javascript function and I'm not sure how to override it, replace it.
In gerenal i know how to replace the functions, so that your implementation is called instead of the default implementation, but i dont know exactly how to do it for it.
So this script is very large i will post just small piece for illustration, the whole sciprt you can find in /layouts/navresizer.js
This is what i have to override:
Microsoft.Office.Server.Ajax.NavResizer.prototype = {
.....
$20: function ($p0) {
if (this.$1E) {
$p0.preventDefault();
}
},
$21: function ($p0) {
var $0 = $p0.target;
this.$1F = ($0 === this.$A);
if (this.$1F || $0 === this.$B) {
this.$1E = $0;
this.$18 = $p0.clientX;
this.$19 = $p0.clientY;
Sys.UI.DomEvent.removeHandler(this.$1E, 'mousedown', this.$12);
var $1 = document.body; Sys.UI.DomEvent.addHandler($1, 'mouseup', this.$13);
Sys.UI.DomEvent.addHandler($1, 'mousemove', this.$14);
$1.style.cursor = (this.$1F) ? 'e-resize' : 'n-resize';
this.$1A = this.get_$42();
this.$1B = this.get_$43();
$1.focus();
Sys.UI.DomEvent.addHandler($1, 'selectstart', this.$15);
$p0.preventDefault();
}
},
$22: function ($p0) {
this.$34($p0);
var $0 = document.body;
Sys.UI.DomEvent.removeHandler($0, 'mouseup', this.$13);
Sys.UI.DomEvent.removeHandler($0, 'mousemove', this.$14);
Sys.UI.DomEvent.addHandler($0, 'selectstart', this.$15);
$0.style.cursor = 'default';
Sys.UI.DomEvent.addHandler(this.$1E, 'mousedown', this.$12);
this.$1E = null;
},
$23: function ($p0) {
this.$34($p0);
},
$24: function ($p0) {
this.$26();
},
get_$25: function () {
ULS4S1: ;
if (this.$10) { return this.$C; }
else { return $get('LeftNavigationAreaCell'); }
},
$26: function () {
ULS4S1: ;
if (!Microsoft.Office.Server.Ajax.NavResizer.$5F(this.get_$25())) {
var $0 = Microsoft.Office.Server.Ajax.NavResizer.$50(this.get_$25()) + this.$31;
if ($0 > this.get_$42()) { this.set_$44(this.set_$42(this.$27($0))); this.$30(); }
}
},
$27: function ($p0) {
if ($p0 > this.get_$2B()) { $p0 = this.get_$2B(); }
if ($p0 < this.get_$29()) { $p0 = this.get_$29(); }
return $p0;
}, $28: function ($p0) {
if ($p0 < this.get_$2C()) { $p0 = this.get_$2C(); }
return $p0;
},
get_$29: function () {
ULS4S1: ;
return this.$1D;
} .........
Basically it is one of those functions: but they are all comma seperated so i dont know if i can override one of them seperatly.
So prolly i have to override everything.
But because it is that complicated i dont know how to override it, could anyone give me an idea how to do it?