--- /dev/null
+/**
+ * @brief Javascript for the display module
+ */
+
+// Catch the GUID from the URL
+var itemID = window.location.pathname.split("/").pop();
+
+$(document).ready(function(){
+ // Scroll to the Item by its GUID
+ scrollToItem(itemID);
+});
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 searchValue === "undefined")
+ return;
+
+ // Define the colors which are used for highlighting
+ var colWhite = {backgroundColor:'#F5F5F5'};
+ var colShiny = {backgroundColor:'#FFF176'};
+
+ // Scroll to the DIV with the ID (GUID)
+ $('html, body').animate({
+ scrollTop: $('#item-'+itemID).position().top
+ }, 400, function() {
+ // Highlight post/commenent with ID (GUID)
+ $('#item-'+itemID).animate(colWhite, 1000).animate(colShiny).animate(colWhite, 2000);
+ });
+}
<script type="text/javascript" src="view/theme/frio/frameworks/jquery-color/jquery.color.js"></script>
+{{if $mode == display}}<script type="text/javascript" src="view/theme/frio/js/mod_display.js"></script>{{/if}}
{{$live_update}}
</a>
<img id="item-delete-selected-rotator" class="like-rotator" src="images/rotator.gif" style="display: none;" />
{{/if}}
-
-<script>
- var colWhite = {backgroundColor:'#F5F5F5'};
- var colShiny = {backgroundColor:'#FFF176'};
-</script>
-
-{{if $mode == display}}
-<script>
- var id = window.location.pathname.split("/").pop();
- $(window).scrollTop($('#item-'+id).position().top);
- $('#item-'+id).animate(colWhite, 1000).animate(colShiny).animate(colWhite, 2000);
-</script>
-{{/if}}
-