mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-16 20:05:14 +02:00
Merge branch 'master' into develop
This commit is contained in:
commit
3d6e3cbb78
59 changed files with 11590 additions and 10998 deletions
11
view/theme/frio/js/mod_display.js
Normal file
11
view/theme/frio/js/mod_display.js
Normal file
|
@ -0,0 +1,11 @@
|
|||
/**
|
||||
* @brief Javascript for the display module
|
||||
*/
|
||||
|
||||
// Catch the GUID from the URL
|
||||
var itemGuid = window.location.pathname.split("/").pop();
|
||||
|
||||
$(window).load(function(){
|
||||
// Scroll to the Item by its GUID
|
||||
scrollToItem('item-'+itemGuid);
|
||||
});
|
|
@ -189,11 +189,19 @@ function confirmDelete() { return confirm(aStr.delitem); }
|
|||
|
||||
function dropItem(url, object) {
|
||||
var confirm = confirmDelete();
|
||||
|
||||
//if the first character of the object is #, remove it because
|
||||
// we use getElementById which don't need the #
|
||||
// getElementByID selects elements even if there are special characters
|
||||
// in the ID (like %) which won't work with jQuery
|
||||
/// @todo ceck if we can solve this in the template
|
||||
object = object.indexOf('#') == 0 ? object.substring(1) : object;
|
||||
|
||||
if(confirm) {
|
||||
$('body').css('cursor', 'wait');
|
||||
$(object).fadeTo('fast', 0.33, function () {
|
||||
$(document.getElementById(object)).fadeTo('fast', 0.33, function () {
|
||||
$.get(url).done(function() {
|
||||
$(object).remove();
|
||||
$(document.getElementById(object)).remove();
|
||||
$('body').css('cursor', 'auto');
|
||||
});
|
||||
});
|
||||
|
|
|
@ -542,3 +542,31 @@ String.prototype.rtrim = function() {
|
|||
var trimmed = this.replace(/\s+$/g, '');
|
||||
return trimmed;
|
||||
};
|
||||
|
||||
// Scroll to a specific item and highlight it
|
||||
// Note: jquery.color.js is needed
|
||||
function scrollToItem(itemID) {
|
||||
if( typeof itemID === "undefined")
|
||||
return;
|
||||
|
||||
var elm = $('#'+itemID);
|
||||
// Test if the Item exists
|
||||
if(!elm.length)
|
||||
return;
|
||||
|
||||
// Define the colors which are used for highlighting
|
||||
var colWhite = {backgroundColor:'#F5F5F5'};
|
||||
var colShiny = {backgroundColor:'#FFF176'};
|
||||
|
||||
// Get the Item Position (we need to substract 100 to match
|
||||
// correct position
|
||||
var itemPos = $(elm).offset().top - 100;
|
||||
|
||||
// Scroll to the DIV with the ID (GUID)
|
||||
$('html, body').animate({
|
||||
scrollTop: itemPos
|
||||
}, 400, function() {
|
||||
// Highlight post/commenent with ID (GUID)
|
||||
$(elm).animate(colWhite, 1000).animate(colShiny).animate(colWhite, 600);
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue