1
1
Fork 0
This commit is contained in:
friendica 2012-12-31 14:54:31 -08:00
commit 405f37b7ae
38 changed files with 73 additions and 41 deletions

View file

@ -248,11 +248,16 @@ ACL.prototype.populate = function(data){
that.list_content.height(height); that.list_content.height(height);
$(data.items).each(function(){ $(data.items).each(function(){
html = "<div class='acl-list-item {4} {5}' title='{6}' id='{2}{3}'>"+that.item_tpl+"</div>"; html = "<div class='acl-list-item {4} {5}' title='{6}' id='{2}{3}'>"+that.item_tpl+"</div>";
html = html.format( this.photo, this.name, this.type, this.id, '', this.network, this.link ); html = html.format(this.photo, this.name, this.type, this.id, '', this.network, this.link);
if (this.uids!=undefined) that.group_uids[this.id] = this.uids; if (this.uids!=undefined) that.group_uids[this.id] = this.uids;
//console.log(html); //console.log(html);
that.list_content.append(html); that.list_content.append(html);
}); });
$(".acl-list-item img[data-src]").each(function(i, el){
// Replace data-src attribute with src attribute for every image
$(el).attr('src', $(el).data("src"));
$(el).removeAttr("data-src");
});
that.update_view(); that.update_view();
} }

View file

@ -181,7 +181,14 @@
html = notifications_tpl.format(e.attr('href'),e.attr('photo'), text, e.attr('date'), e.attr('seen')); html = notifications_tpl.format(e.attr('href'),e.attr('photo'), text, e.attr('date'), e.attr('seen'));
nnm.append(html); nnm.append(html);
}); });
$("img[data-src]", nnm).each(function(i, el){
// Replace data-src attribute with src attribute for every image
$(el).attr('src', $(el).data("src"));
$(el).removeAttr("data-src");
});
} }
notif = eNotif.attr('count'); notif = eNotif.attr('count');
if (notif>0){ if (notif>0){
$("#nav-notifications-linkmenu").addClass("on"); $("#nav-notifications-linkmenu").addClass("on");
@ -202,8 +209,7 @@
}); });
}); });
NavUpdate(); NavUpdate();
// Allow folks to stop the ajax page updates with the pause/break key // Allow folks to stop the ajax page updates with the pause/break key
$(document).keydown(function(event) { $(document).keydown(function(event) {

View file

@ -9,7 +9,7 @@
</div> </div>
<div class="acl-list-item" rel="acl-template" style="display:none"> <div class="acl-list-item" rel="acl-template" style="display:none">
<img src="{0}"><p>{1}</p> <img data-src="{0}"><p>{1}</p>
<a href="#" class='acl-button-show'>$show</a> <a href="#" class='acl-button-show'>$show</a>
<a href="#" class='acl-button-hide'>$hide</a> <a href="#" class='acl-button-hide'>$hide</a>
</div> </div>

View file

@ -64,5 +64,5 @@
</nav> </nav>
<ul id="nav-notifications-template" style="display:none;" rel="template"> <ul id="nav-notifications-template" style="display:none;" rel="template">
<li class="{4}"><a href="{0}"><img src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li> <li class="{4}"><a href="{0}"><img data-src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li>
</ul> </ul>

View file

@ -9,7 +9,7 @@
</div> </div>
<div class="acl-list-item" rel="acl-template" style="display:none"> <div class="acl-list-item" rel="acl-template" style="display:none">
<img src="{0}"><p>{1}</p> <img data-src="{0}"><p>{1}</p>
<a href="#" class='acl-button-show'>{{$show}}</a> <a href="#" class='acl-button-show'>{{$show}}</a>
<a href="#" class='acl-button-hide'>{{$hide}}</a> <a href="#" class='acl-button-hide'>{{$hide}}</a>
</div> </div>

View file

@ -64,5 +64,5 @@
</nav> </nav>
<ul id="nav-notifications-template" style="display:none;" rel="template"> <ul id="nav-notifications-template" style="display:none;" rel="template">
<li class="{4}"><a href="{0}"><img src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li> <li class="{4}"><a href="{0}"><img data-src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li>
</ul> </ul>

View file

@ -69,7 +69,7 @@
</nav> </nav>
<ul id="nav-notifications-template" style="display:none;" rel="template"> <ul id="nav-notifications-template" style="display:none;" rel="template">
<li class="{4}"><a href="{0}"><img src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li> <li class="{4}"><a href="{0}"><img data-src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li>
</ul> </ul>
<script> <script>
var pagetitle = null; var pagetitle = null;

View file

@ -69,7 +69,7 @@
</nav> </nav>
<ul id="nav-notifications-template" style="display:none;" rel="template"> <ul id="nav-notifications-template" style="display:none;" rel="template">
<li class="{4}"><a href="{0}"><img src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li> <li class="{4}"><a href="{0}"><img data-src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li>
</ul> </ul>
<script> <script>
var pagetitle = null; var pagetitle = null;

View file

@ -2,8 +2,8 @@
<div class="directory-item" id="directory-item-$id" > <div class="directory-item" id="directory-item-$id" >
<div class="directory-photo-wrapper" id="directory-photo-wrapper-$id" > <div class="directory-photo-wrapper" id="directory-photo-wrapper-$id" >
<div class="directory-photo" id="directory-photo-$id" > <div class="directory-photo" id="directory-photo-$id" >
<a href="$profile-link" class="directory-profile-link" id="directory-profile-link-$id" > <a href="$profile_link" class="directory-profile-link" id="directory-profile-link-$id" >
<img class="directory-photo-img" src="$photo" alt="$alt-text" title="$alt-text" /> <img class="directory-photo-img" src="$photo" alt="$alt_text" title="$alt_text" />
</a> </a>
</div> </div>
</div> </div>

View file

@ -144,7 +144,7 @@
<ul id="nav-notifications-template" style="display:none;" rel="template"> <ul id="nav-notifications-template" style="display:none;" rel="template">
<li class="{4}"><a href="{0}"><img src="{1}">{2} <span class="notif-when">{3}</span></a></li> <li class="{4}"><a href="{0}"><img data-src="{1}">{2} <span class="notif-when">{3}</span></a></li>
</ul> </ul>

View file

@ -144,7 +144,7 @@
<ul id="nav-notifications-template" style="display:none;" rel="template"> <ul id="nav-notifications-template" style="display:none;" rel="template">
<li class="{4}"><a href="{0}"><img src="{1}">{2} <span class="notif-when">{3}</span></a></li> <li class="{4}"><a href="{0}"><img data-src="{1}">{2} <span class="notif-when">{3}</span></a></li>
</ul> </ul>

View file

@ -393,9 +393,9 @@ if ($color=="dark") $color_path = "/diabook-dark/";
$profile_link = $a->get_baseurl() . '/profile/' . ((strlen($rr['nickname'])) ? $rr['nickname'] : $rr['profile_uid']); $profile_link = $a->get_baseurl() . '/profile/' . ((strlen($rr['nickname'])) ? $rr['nickname'] : $rr['profile_uid']);
$entry = replace_macros($tpl,array( $entry = replace_macros($tpl,array(
'$id' => $rr['id'], '$id' => $rr['id'],
'$profile-link' => zrl($rr['url']), '$profile_link' => zrl($rr['url']),
'$photo' => $rr[$photo], '$photo' => $rr[$photo],
'$alt-text' => $rr['name'], '$alt_text' => $rr['name'],
)); ));
$aside['$comunity_profiles_items'][] = $entry; $aside['$comunity_profiles_items'][] = $entry;
} }
@ -422,9 +422,9 @@ if ($color=="dark") $color_path = "/diabook-dark/";
$profile_link = $a->get_baseurl() . '/profile/' . ((strlen($rr['nickname'])) ? $rr['nickname'] : $rr['profile_uid']); $profile_link = $a->get_baseurl() . '/profile/' . ((strlen($rr['nickname'])) ? $rr['nickname'] : $rr['profile_uid']);
$entry = replace_macros($tpl,array( $entry = replace_macros($tpl,array(
'$id' => $rr['id'], '$id' => $rr['id'],
'$profile-link' => $profile_link, '$profile_link' => $profile_link,
'$photo' => $a->get_cached_avatar_image($rr[$photo]), '$photo' => $a->get_cached_avatar_image($rr[$photo]),
'$alt-text' => $rr['name'], '$alt_text' => $rr['name'],
)); ));
$aside['$lastusers_items'][] = $entry; $aside['$lastusers_items'][] = $entry;
} }
@ -501,9 +501,9 @@ if ($color=="dark") $color_path = "/diabook-dark/";
$entry = replace_macros($tpl,array( $entry = replace_macros($tpl,array(
'$id' => $rr['id'], '$id' => $rr['id'],
'$profile-link' => $photo_page, '$profile_link' => $photo_page,
'$photo' => $photo_url, '$photo' => $photo_url,
'$alt-text' => $rr['username']." : ".$rr['desc'], '$alt_text' => $rr['username']." : ".$rr['desc'],
)); ));
$aside['$photos_items'][] = $entry; $aside['$photos_items'][] = $entry;

View file

@ -139,7 +139,7 @@ $langselector
<ul id="nav-notifications-template" style="display:none;" rel="template"> <ul id="nav-notifications-template" style="display:none;" rel="template">
<li class="{4}"> <li class="{4}">
<a href="{0}"><img src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a> <a href="{0}"><img data-src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a>
</li> </li>
</ul> </ul>

View file

@ -139,7 +139,7 @@
<ul id="nav-notifications-template" style="display:none;" rel="template"> <ul id="nav-notifications-template" style="display:none;" rel="template">
<li class="{4}"> <li class="{4}">
<a href="{0}"><img src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a> <a href="{0}"><img data-src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a>
</li> </li>
</ul> </ul>

View file

@ -66,5 +66,5 @@
</nav> </nav>
<ul id="nav-notifications-template" style="display:none;" rel="template"> <ul id="nav-notifications-template" style="display:none;" rel="template">
<li class="{4}"><a href="{0}"><img src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li> <li class="{4}"><a href="{0}"><img data-src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li>
</ul> </ul>

View file

@ -66,5 +66,5 @@
</nav> </nav>
<ul id="nav-notifications-template" style="display:none;" rel="template"> <ul id="nav-notifications-template" style="display:none;" rel="template">
<li class="{4}"><a href="{0}"><img src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li> <li class="{4}"><a href="{0}"><img data-src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li>
</ul> </ul>

View file

@ -64,5 +64,5 @@
</nav> </nav>
<ul id="nav-notifications-template" style="display:none;" rel="template"> <ul id="nav-notifications-template" style="display:none;" rel="template">
<li class="{4}"><a href="{0}"><img src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li> <li class="{4}"><a href="{0}"><img data-src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li>
</ul> </ul>

View file

@ -64,5 +64,5 @@
</nav> </nav>
<ul id="nav-notifications-template" style="display:none;" rel="template"> <ul id="nav-notifications-template" style="display:none;" rel="template">
<li class="{4}"><a href="{0}"><img src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li> <li class="{4}"><a href="{0}"><img data-src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li>
</ul> </ul>

View file

@ -9,7 +9,7 @@
</div> </div>
<div class="acl-list-item" rel="acl-template" style="display:none"> <div class="acl-list-item" rel="acl-template" style="display:none">
<img src="{0}"><p>{1}</p> <img data-src="{0}"><p>{1}</p>
<a href="#" class='acl-button-show'>$show</a> <a href="#" class='acl-button-show'>$show</a>
<a href="#" class='acl-button-hide'>$hide</a> <a href="#" class='acl-button-hide'>$hide</a>
</div> </div>

View file

@ -253,6 +253,11 @@ ACL.prototype.populate = function(data){
//console.log(html); //console.log(html);
that.list_content.append(html); that.list_content.append(html);
}); });
$(".acl-list-item img[data-src]").each(function(i, el){
// Replace data-src attribute with src attribute for every image
$(el).attr('src', $(el).data("src"));
$(el).removeAttr("data-src");
});
that.update_view(); that.update_view();
} }

View file

@ -187,6 +187,12 @@
html = notifications_tpl.format(e.attr('href'),e.attr('photo'), text, e.attr('date'), e.attr('seen')); html = notifications_tpl.format(e.attr('href'),e.attr('photo'), text, e.attr('date'), e.attr('seen'));
nnm.append(html); nnm.append(html);
}); });
$("img[data-src]", nnm).each(function(i, el){
// Replace data-src attribute with src attribute for every image
$(el).attr('src', $(el).data("src"));
$(el).removeAttr("data-src");
});
} }
notif = eNotif.attr('count'); notif = eNotif.attr('count');
if (notif>0){ if (notif>0){

View file

@ -142,5 +142,5 @@
</nav> </nav>
<ul id="nav-notifications-template" style="display:none;" rel="template"> <ul id="nav-notifications-template" style="display:none;" rel="template">
<li class="{4}"><a href="{0}"><img src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li> <li class="{4}"><a href="{0}"><img data-src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li>
</ul> </ul>

View file

@ -9,7 +9,7 @@
</div> </div>
<div class="acl-list-item" rel="acl-template" style="display:none"> <div class="acl-list-item" rel="acl-template" style="display:none">
<img src="{0}"><p>{1}</p> <img data-src="{0}"><p>{1}</p>
<a href="#" class='acl-button-show'>{{$show}}</a> <a href="#" class='acl-button-show'>{{$show}}</a>
<a href="#" class='acl-button-hide'>{{$hide}}</a> <a href="#" class='acl-button-hide'>{{$hide}}</a>
</div> </div>

View file

@ -142,5 +142,5 @@
</nav> </nav>
<ul id="nav-notifications-template" style="display:none;" rel="template"> <ul id="nav-notifications-template" style="display:none;" rel="template">
<li class="{4}"><a href="{0}"><img src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li> <li class="{4}"><a href="{0}"><img data-src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li>
</ul> </ul>

View file

@ -9,7 +9,6 @@
</div> </div>
<div class="acl-list-item" rel="acl-template" style="display:none"> <div class="acl-list-item" rel="acl-template" style="display:none">
<img src="{0}"><p>{1}</p>
<a href="#" class='acl-button-show'>$show</a> <a href="#" class='acl-button-show'>$show</a>
<a href="#" class='acl-button-hide'>$hide</a> <a href="#" class='acl-button-hide'>$hide</a>
</div> </div>

View file

@ -253,6 +253,11 @@ ACL.prototype.populate = function(data){
//console.log(html); //console.log(html);
that.list_content.append(html); that.list_content.append(html);
}); });
$(".acl-list-item img[data-src]").each(function(i, el){
// Replace data-src attribute with src attribute for every image
$(el).attr('src', $(el).data("src"));
$(el).removeAttr("data-src");
});
that.update_view(); that.update_view();
} }

View file

@ -179,6 +179,12 @@
html = notifications_tpl.format(e.attr('href'),e.attr('photo'), text, e.attr('date'), e.attr('seen')); html = notifications_tpl.format(e.attr('href'),e.attr('photo'), text, e.attr('date'), e.attr('seen'));
nnm.append(html); nnm.append(html);
}); });
$("img[data-src]", nnm).each(function(i, el){
// Replace data-src attribute with src attribute for every image
$(el).attr('src', $(el).data("src"));
$(el).removeAttr("data-src");
});
} }
notif = eNotif.attr('count'); notif = eNotif.attr('count');
if (notif>0){ if (notif>0){

View file

@ -146,5 +146,5 @@
</nav> </nav>
<ul id="nav-notifications-template" style="display:none;" rel="template"> <ul id="nav-notifications-template" style="display:none;" rel="template">
<li class="{4}"><a href="{0}"><img src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li> <li class="{4}"><a href="{0}"><img data-src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li>
</ul> </ul>

View file

@ -9,7 +9,7 @@
</div> </div>
<div class="acl-list-item" rel="acl-template" style="display:none"> <div class="acl-list-item" rel="acl-template" style="display:none">
<img src="{0}"><p>{1}</p> <img data-src="{0}"><p>{1}</p>
<a href="#" class='acl-button-show'>{{$show}}</a> <a href="#" class='acl-button-show'>{{$show}}</a>
<a href="#" class='acl-button-hide'>{{$hide}}</a> <a href="#" class='acl-button-hide'>{{$hide}}</a>
</div> </div>

View file

@ -146,5 +146,5 @@
</nav> </nav>
<ul id="nav-notifications-template" style="display:none;" rel="template"> <ul id="nav-notifications-template" style="display:none;" rel="template">
<li class="{4}"><a href="{0}"><img src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li> <li class="{4}"><a href="{0}"><img data-src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li>
</ul> </ul>

View file

@ -89,7 +89,7 @@
</nav> </nav>
<ul id="nav-notifications-template" style="display:none;" rel="template"> <ul id="nav-notifications-template" style="display:none;" rel="template">
<li><a href="{0}"><img src="{1}">{2} <span class="notif-when">{3}</span></a></li> <li><a href="{0}"><img data-src="{1}">{2} <span class="notif-when">{3}</span></a></li>
</ul> </ul>
<div style="position: fixed; top: 3px; left: 5px; z-index:9999">$langselector</div> <div style="position: fixed; top: 3px; left: 5px; z-index:9999">$langselector</div>

View file

@ -89,7 +89,7 @@
</nav> </nav>
<ul id="nav-notifications-template" style="display:none;" rel="template"> <ul id="nav-notifications-template" style="display:none;" rel="template">
<li><a href="{0}"><img src="{1}">{2} <span class="notif-when">{3}</span></a></li> <li><a href="{0}"><img data-src="{1}">{2} <span class="notif-when">{3}</span></a></li>
</ul> </ul>
<div style="position: fixed; top: 3px; left: 5px; z-index:9999">{{$langselector}}</div> <div style="position: fixed; top: 3px; left: 5px; z-index:9999">{{$langselector}}</div>

View file

@ -62,7 +62,7 @@
</div> </div>
<ul id="nav-notifications-template" style="display:none;" rel="template"> <ul id="nav-notifications-template" style="display:none;" rel="template">
<li class="{4}"><a href="{0}"><img src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li> <li class="{4}"><a href="{0}"><img data-src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li>
</ul> </ul>
<div style="position: fixed; top: 3px; left: 5px; z-index:9999">$langselector</div> <div style="position: fixed; top: 3px; left: 5px; z-index:9999">$langselector</div>

View file

@ -62,7 +62,7 @@
</div> </div>
<ul id="nav-notifications-template" style="display:none;" rel="template"> <ul id="nav-notifications-template" style="display:none;" rel="template">
<li class="{4}"><a href="{0}"><img src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li> <li class="{4}"><a href="{0}"><img data-src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li>
</ul> </ul>
<div style="position: fixed; top: 3px; left: 5px; z-index:9999">{{$langselector}}</div> <div style="position: fixed; top: 3px; left: 5px; z-index:9999">{{$langselector}}</div>

View file

@ -60,7 +60,7 @@
<ul id="nav-notifications-template" style="display:none;" rel="template"> <ul id="nav-notifications-template" style="display:none;" rel="template">
<li class="{4}"><a href="{0}"><img src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li> <li class="{4}"><a href="{0}"><img data-src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li>
</ul> </ul>

View file

@ -60,7 +60,7 @@
<ul id="nav-notifications-template" style="display:none;" rel="template"> <ul id="nav-notifications-template" style="display:none;" rel="template">
<li class="{4}"><a href="{0}"><img src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li> <li class="{4}"><a href="{0}"><img data-src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li>
</ul> </ul>

View file

@ -104,7 +104,7 @@
</nav> </nav>
<ul id="nav-notifications-template" style="display:none;" rel="template"> <ul id="nav-notifications-template" style="display:none;" rel="template">
<li><a href="{0}"><img src="{1}">{2} <span class="notif-when">{3}</span></a></li> <li><a href="{0}"><img data-src="{1}">{2} <span class="notif-when">{3}</span></a></li>
</ul> </ul>
{# {#

View file

@ -104,7 +104,7 @@
</nav> </nav>
<ul id="nav-notifications-template" style="display:none;" rel="template"> <ul id="nav-notifications-template" style="display:none;" rel="template">
<li><a href="{0}"><img src="{1}">{2} <span class="notif-when">{3}</span></a></li> <li><a href="{0}"><img data-src="{1}">{2} <span class="notif-when">{3}</span></a></li>
</ul> </ul>
{{* {{*