Hey programmer,
Hopefully, you have all upgraded to Surebert 4.0 which was a major change. Below is an overview of what problems you might run into upgrading pre surebert 4.0 code to surebert 4.0+ code.
--Paul Visco
new sb.element({tag : 'div'});
sb.include('forms.textarea');
and use like this sb.forms.textarea.allowTabs('#myTextArea');
sb.include('css.styleSheet');
var mySheet= new sb.css.styleSheet('http://estrip.org/test.css');
sb.include('arrays.inject');
moved the following sb.arrays methods into their own files under /arrays
avg, copy, empty, inject, max, min, mostCommon, natsort, random, range, reduce, regex, remove, shuffle, sum, unique, iterate (cycle, first, last, prev, next, pointer, current)
//add alias back if you want sb.browser.scrollPos = sb.browser.getScrollPosition;
previous global that were removed, add them back as desired in your own code var ajax = sb.ajax; var events = sb.events; var forget= sb.cookies.forget; var recall= sb.cookies.recall; var remove = sb.dom.remove; var replace = sb.dom.replace; var remember= sb.cookies.remember; var txt = sb.dom.txt; var typeOf = sb.typeOf
sb.include('browser.$_GET');
sb.include('element.prototype.quiver');
$('#myDiv').quiver();
e.g. if(window.navigator.userAgent.match(/linux/i)){
//do something
}
sb.nodeList.prototype.addClass = sb.nodeList.prototype.addClassName; sb.nodeList.prototype.attr = sb.nodeList.prototype.setAttribute; sb.nodeList.prototype.removeClass = sb.nodeList.prototype.removeClassName;
Array.prototype.each = Array.prototype.forEach;
background-image:url('../media/shadow.png');
sb.ie6.pngFixBg('#myDiv'); //this one is not recursive
sb.ie6.pngFix('#control_panel');
sb.include('arrays.inject');
sb.include('colors');
alert(sb.included);
sb.loadDebug =1;
var aj=new sb.ajax({
data : {
c : 'yes',
day : 'monday'
},
url : '../_development/notes.txt',
debug : 1
}).fetch();
var a = [0,1,2,3,4,5,6];
window.setInterval(function(){
document.title = a.cycle();
}, 1000);
sb.element.prototype.getY();
sb.element.prototype.getX();
sb.element.prototype.clearPosition();
var div = new sb.element({
tag : 'div',
innerHTML : 'dd',
styles : {
backgroundColor : 'red',
width : '0px',
height : '20px'
}
});
div.appendTo('body');
sb.bandwidthTest = {
/**
begin = 45596
kbps = 3185
size = 45596
*/
onComplete : function(o){
sb.consol.dump(o);
},
/*
kb = 45.596
time = 100
*/
onProgress: function(o){
sb.consol.dump(o);
div.style.width = (Math.round(o.kb)*10)+'px';
}
};
sb.onFlashGateLoad.push(function(){
sb.sticker.getBandwidth();
});
sb.include('sticker');
sb.soundCheck();
sb.consol.onlog = function(str){
alert(str);
}