// add a new thread
- $j('.tread-wrapper',data).each(function() {
+ $j('.toplevel_item',data).each(function() {
var ident = $j(this).attr('id');
if($j('#' + ident).length == 0 && profile_page == 1) {
}
/* autocomplete @nicknames */
$j(".comment-edit-form textarea").contact_autocomplete(baseurl+"/acl");
+
+ var bimgs = $j(".wall-item-body > img").not(function() { return this.complete; });
+ var bimgcount = bimgs.length;
+
+ if (bimgcount) {
+ bimgs.load(function() {
+ bimgcount--;
+ if (! bimgcount) {
+ collapseHeight();
+
+ }
+ });
+ } else {
+ collapseHeight();
+ }
+
+ });
+ }
+
+ function collapseHeight() {
+ $j(".wall-item-body").each(function() {
+ if($j(this).height() > 310) {
+ if(! $j(this).hasClass('divmore')) {
+ $j(this).divgrow({ initialHeight: 300, showBrackets: false, speed: 0 });
+ $j(this).addClass('divmore');
+ }
+ }
});
}
function getPosition(e) {
var cursor = {x:0, y:0};
- if ( e.pageX || e.pageY ) {
- cursor.x = e.pageX;
- cursor.y = e.pageY;
+ if ( e.touches[0].pageX || e.touches[0].pageY ) {
+ cursor.x = e.touches[0].pageX;
+ cursor.y = e.touches[0].pageY;
}
else {
- if( e.clientX || e.clientY ) {
- cursor.x = e.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft) - document.documentElement.clientLeft;
- cursor.y = e.clientY + (document.documentElement.scrollTop || document.body.scrollTop) - document.documentElement.clientTop;
+ if( e.touches[0].clientX || e.touches[0].clientY ) {
+ cursor.x = e.touches[0].clientX + (document.documentElement.scrollLeft || document.body.scrollLeft) - document.documentElement.clientLeft;
+ cursor.y = e.touches[0].clientY + (document.documentElement.scrollTop || document.body.scrollTop) - document.documentElement.clientTop;
}
else {
- if( e.x || e.y ) {
- cursor.x = e.x;
- cursor.y = e.y;
+ if( e.touches[0].x || e.touches[0].y ) {
+ cursor.touches[0].x = e.touches[0].x;
+ cursor.touches[0].y = e.touches[0].y;
}
}
}
function previewTheme(elm) {
theme = $j(elm).val();
$j.getJSON('pretheme?f=&theme=' + theme,function(data) {
- $j('#theme-preview').html('<div id="theme-desc">' + data.desc + '</div><div id="theme-version">' + data.version + '</div><div id="theme-credits">' + data.credits + '</div><a href="' + data.img + '"><img src="' + data.img + '" width="320" height="240" alt="' + theme + '" /></a>');
+ $j('#theme-preview').html('<div id="theme-desc">' + data.desc + '</div><div id="theme-version">' + data.version + '</div><div id="theme-credits">' + data.credits + '</div>');
});
}