Skip to content

Commit

Permalink
Merge pull request #8050 from juho-jaakkola/comment_highlight
Browse files Browse the repository at this point in the history
feature(ui): allows highlighting an element whose id is found from the URL
  • Loading branch information
Juho Jaakkola committed Mar 19, 2015
2 parents 0091108 + 60eebdc commit 65a7c43
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 0 deletions.
23 changes: 23 additions & 0 deletions docs/guides/upgrading.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,29 @@ See the administator guides for :doc:`how to upgrade a live site </admin/upgradi
:local:
:depth: 2

From 1.10 to 1.11
=================

Comment highlighting
--------------------

If your theme is using the file ``views/default/css/elements/components.php``, you must add the following style definitions in it to enable highlighting for comments and discussion replies:

.. code:: css
.elgg-comments .elgg-state-highlight {
-webkit-animation: comment-highlight 5s;
animation: comment-highlight 5s;
}
@-webkit-keyframes comment-highlight {
from {background: #dff2ff;}
to {background: white;}
}
@keyframes comment-highlight {
from {background: #dff2ff;}
to {background: white;}
}
From 1.9 to 1.10
================

Expand Down
4 changes: 4 additions & 0 deletions js/lib/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ elgg.ui.init = function () {
}

elgg.ui.initAccessInputs();

// Allow element to be highlighted using CSS if its id is found from the URL
var elementId = elgg.getSelectorFromUrlFragment(document.URL);
$(elementId).addClass('elgg-state-highlight');
};

/**
Expand Down
16 changes: 16 additions & 0 deletions mod/aalborg_theme/views/default/css/elements/components.php
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,22 @@
margin-top: 15px;
}

/* Comment highlighting that automatically fades away */
.elgg-comments .elgg-state-highlight {
-webkit-animation: comment-highlight 5s; /* Chrome, Safari, Opera */
animation: comment-highlight 5s;
}
/* Chrome, Safari, Opera */
@-webkit-keyframes comment-highlight {
from {background: #dff2ff;}
to {background: white;}
}
/* Standard syntax */
@keyframes comment-highlight {
from {background: #dff2ff;}
to {background: white;}
}

/* **************************************
Comments triangle
************************************** */
Expand Down
16 changes: 16 additions & 0 deletions views/default/css/elements/components.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,22 @@
height: auto;
}

/* Comment highlighting that automatically fades away */
.elgg-comments .elgg-state-highlight {
-webkit-animation: comment-highlight 5s; /* Chrome, Safari, Opera */
animation: comment-highlight 5s;
}
/* Chrome, Safari, Opera */
@-webkit-keyframes comment-highlight {
from {background: #dff2ff;}
to {background: white;}
}
/* Standard syntax */
@keyframes comment-highlight {
from {background: #dff2ff;}
to {background: white;}
}

/* ***************************************
Image-related
*************************************** */
Expand Down

0 comments on commit 65a7c43

Please sign in to comment.