Skip to content

Commit

Permalink
Replaces inline onclick handler for .status_timestamp.
Browse files Browse the repository at this point in the history
Also moved reference to serendipity_editor.js before the closing
body element. This way, jQuery's $(document).ready() equals
$(window).load(), so we don't have to use that any longer.
  • Loading branch information
yellowled committed May 31, 2013
1 parent c0e8922 commit 75d45f8
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 18 deletions.
2 changes: 1 addition & 1 deletion templates/2k11/admin/entries.inc.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@

<div class="entry_info clearfix">
<span class="status_timestamp">
{$entry.timestamp|@formatTime:"{$CONST.DATE_FORMAT_SHORT}"}{if $entry.timestamp <= ($entry.last_modified - 1800)} <a class="icon_link" href="#" title="{$CONST.LAST_UPDATED}: {$entry.last_modified|@formatTime:"{$CONST.DATE_FORMAT_SHORT}"}" onclick="alert(this.title)"><span class="icon-info-circle"></span><span class="visuallyhidden"> {$CONST.LAST_UPDATED}</span></a>{/if}
{$entry.timestamp|@formatTime:"{$CONST.DATE_FORMAT_SHORT}"}{if $entry.timestamp <= ($entry.last_modified - 1800)} <a class="icon_link" href="#" title="{$CONST.LAST_UPDATED}: {$entry.last_modified|@formatTime:"{$CONST.DATE_FORMAT_SHORT}"}"><span class="icon-info-circle"></span><span class="visuallyhidden"> {$CONST.LAST_UPDATED}</span></a>{/if}
</span>

<span class="entry_meta">{$CONST.POSTED_BY} {$entry.author|escape}
Expand Down
6 changes: 2 additions & 4 deletions templates/2k11/admin/index.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="{$admin_vars.css_file}">
<script src="{serendipity_getFile file='admin/js/modernizr-2.6.2.min.js'}"></script>
{if $admin_vars.admin_installed}
{serendipity_hookPlugin hook="backend_header" hookAll="true"}
{/if}
<script src="{serendipity_getFile file='admin/serendipity_editor.js'}"></script>
{if $admin_vars.admin_installed}{serendipity_hookPlugin hook="backend_header" hookAll="true"}{/if}
</head>
<body id="serendipity_admin_page">
{if NOT $admin_vars.no_banner}
Expand Down Expand Up @@ -182,5 +179,6 @@
<p>{$admin_vars.version_info}</p>
</footer>
{/if}
<script src="{serendipity_getFile file='admin/serendipity_editor.js'}"></script>
</body>
</html>
29 changes: 16 additions & 13 deletions templates/2k11/admin/serendipity_editor.js.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -666,18 +666,21 @@ function highlightComment(id, checkvalue) {
footer: '#meta'
});

// Wait until content including images is loaded
$(window).load(function() {
// Fire WYSIWYG editor(s)
spawn();
// Equal Heights
var $eqHeights = $('body').has('.equal_heights');
if($eqHeights.size() > 0) {
$('.equal_heights').syncHeight({
updateOnResize: true
});
}
// Fire WYSIWYG editor(s)
spawn();

// Click events
$('.status_timestamp > a').click(function(e) {
alert($(this).attr('title'));
e.preventDefault();
});

// Equal Heights
var $eqHeights = $('body').has('.equal_heights');

if($eqHeights.size() > 0) {
$('.equal_heights').syncHeight({
updateOnResize: true
});
}
})(jQuery);

0 comments on commit 75d45f8

Please sign in to comment.