From 0e4d8c416db4c838e94df3df77c2e4b14a0e1851 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Wed, 17 Jun 2009 07:49:41 +0000 Subject: Removed NoticeHover from JavaScript for speed gain. Using CSS instead to handle the notice hover state. The difference is only seen in the conversation page. --- js/util.js | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'js/util.js') diff --git a/js/util.js b/js/util.js index fd2500d44..ce0c20d31 100644 --- a/js/util.js +++ b/js/util.js @@ -230,21 +230,10 @@ $(document).ready(function(){ }; $("#form_notice").ajaxForm(PostNotice); $("#form_notice").each(addAjaxHidden); - NoticeHover(); NoticeReply(); NoticeAttachments(); }); - -function NoticeHover() { - function mouseHandler(e) { - $(e.target).closest('li.hentry')[(e.type === 'mouseover') ? 'addClass' : 'removeClass']('hover'); - }; - $('#content .notices').mouseover(mouseHandler); - $('#content .notices').mouseout(mouseHandler); -} - - function NoticeReply() { if ($('#notice_data-text').length > 0) { $('#content .notice').each(function() { @@ -319,4 +308,4 @@ function NoticeAttachments() { $(this).closest(".entry-title").removeClass('ov'); } ); -} +} \ No newline at end of file -- cgit v1.2.3-54-g00ecf From 5854fe194a35e1bbf2feb6db415f54f33def2dd9 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Thu, 18 Jun 2009 01:04:12 +0000 Subject: Placed a check to make sure there is a reply button in a notice before applying the dynamic action --- js/util.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'js/util.js') diff --git a/js/util.js b/js/util.js index ce0c20d31..854d25060 100644 --- a/js/util.js +++ b/js/util.js @@ -235,7 +235,7 @@ $(document).ready(function(){ }); function NoticeReply() { - if ($('#notice_data-text').length > 0) { + if ($('#notice_data-text').length > 0 && $('.notice_reply').length > 0) { $('#content .notice').each(function() { var notice = $(this)[0]; $($('.notice_reply', notice)[0]).click(function() { @@ -308,4 +308,4 @@ function NoticeAttachments() { $(this).closest(".entry-title").removeClass('ov'); } ); -} \ No newline at end of file +} -- cgit v1.2.3-54-g00ecf From 77185dd4c67761afbe670a15928c523f4de2842b Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Thu, 18 Jun 2009 01:10:48 +0000 Subject: A little more specific selector for notice reply --- js/util.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/util.js') diff --git a/js/util.js b/js/util.js index 854d25060..17ae4c071 100644 --- a/js/util.js +++ b/js/util.js @@ -235,7 +235,7 @@ $(document).ready(function(){ }); function NoticeReply() { - if ($('#notice_data-text').length > 0 && $('.notice_reply').length > 0) { + if ($('#notice_data-text').length > 0 && $('#content .notice_reply').length > 0) { $('#content .notice').each(function() { var notice = $(this)[0]; $($('.notice_reply', notice)[0]).click(function() { -- cgit v1.2.3-54-g00ecf From eb40fbc17ad1efb0a4c51ee00b1e9408d2af382f Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Tue, 23 Jun 2009 17:05:55 +0000 Subject: On XHR notice post, calls NoticeAttachment to trigger thumbnail and attachment views --- js/util.js | 1 + 1 file changed, 1 insertion(+) (limited to 'js/util.js') diff --git a/js/util.js b/js/util.js index 17ae4c071..65a77960a 100644 --- a/js/util.js +++ b/js/util.js @@ -217,6 +217,7 @@ $(document).ready(function(){ $('#'+li.id).css({display:'none'}); $('#'+li.id).fadeIn(2500); NoticeReply(); + NoticeAttachments(); } } $("#notice_data-text").val(""); -- cgit v1.2.3-54-g00ecf From 0c5c8348277e234f5f3d1e0b4956e698a6f95a14 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Thu, 25 Jun 2009 03:46:52 +0000 Subject: Slightly more specific selector. Looks only in the notices in the content area --- js/util.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'js/util.js') diff --git a/js/util.js b/js/util.js index 65a77960a..221c85120 100644 --- a/js/util.js +++ b/js/util.js @@ -280,13 +280,13 @@ function NoticeAttachments() { timeout : 0 }; - $('a.attachment').click(function() { + $('#content .notice a.attachment').click(function() { $().jOverlay({url: $('address .url')[0].href+'/attachment/' + ($(this).attr('id').substring('attachment'.length + 1)) + '/ajax'}); return false; }); var t; - $("body:not(#shownotice) a.thumbnail").hover( + $("body:not(#shownotice) #content .notice a.thumbnail").hover( function() { var anchor = $(this); $("a.thumbnail").children('img').hide(); -- cgit v1.2.3-54-g00ecf From 1e17f1256a1166db6bd3acd35fd437262ba27ffd Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Thu, 25 Jun 2009 16:55:19 +0000 Subject: Shows the selected file attachment under the form_notice textarea --- js/util.js | 9 +++++++++ theme/base/css/display.css | 5 +++-- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'js/util.js') diff --git a/js/util.js b/js/util.js index 221c85120..9156045bb 100644 --- a/js/util.js +++ b/js/util.js @@ -233,6 +233,7 @@ $(document).ready(function(){ $("#form_notice").each(addAjaxHidden); NoticeReply(); NoticeAttachments(); + NoticeDataAttachSelected(); }); function NoticeReply() { @@ -310,3 +311,11 @@ function NoticeAttachments() { } ); } + +function NoticeDataAttachSelected() { + $('#notice_data-attach').change(function() { + S = '
'+$(this).val()+'
'; + NDAS = $('#notice_data-attach_selected'); + (NDAS.length > 0) ? NDAS.replaceWith(S) : $('#form_notice').append(S); + }); +} diff --git a/theme/base/css/display.css b/theme/base/css/display.css index d01be7700..bfcc9a7fa 100644 --- a/theme/base/css/display.css +++ b/theme/base/css/display.css @@ -510,10 +510,11 @@ margin-bottom:7px; margin-left:18px; float:left; } -#form_notice .error { +#form_notice .error, +#form_notice .success { float:left; clear:both; -width:96.9%; +width:81.5%; margin-bottom:0; line-height:1.618; } -- cgit v1.2.3-54-g00ecf From 6a0571d51b0cafb0dbc7caf3aa61cdfd17d6c7ce Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Thu, 25 Jun 2009 21:01:07 +0000 Subject: Added functionality to remove the notice data attachment --- js/util.js | 14 ++++++++++---- theme/base/css/display.css | 11 +++++++++++ 2 files changed, 21 insertions(+), 4 deletions(-) (limited to 'js/util.js') diff --git a/js/util.js b/js/util.js index 9156045bb..e7c54b74a 100644 --- a/js/util.js +++ b/js/util.js @@ -222,6 +222,7 @@ $(document).ready(function(){ } $("#notice_data-text").val(""); $("#notice_data-attach").val(""); + $('#notice_data-attach_selected').remove(); counter(); } $("#form_notice").removeClass("processing"); @@ -233,7 +234,7 @@ $(document).ready(function(){ $("#form_notice").each(addAjaxHidden); NoticeReply(); NoticeAttachments(); - NoticeDataAttachSelected(); + NoticeDataAttach(); }); function NoticeReply() { @@ -312,10 +313,15 @@ function NoticeAttachments() { ); } -function NoticeDataAttachSelected() { - $('#notice_data-attach').change(function() { - S = '
'+$(this).val()+'
'; +function NoticeDataAttach() { + NDA = $('#notice_data-attach'); + NDA.change(function() { + S = '
'+$(this).val()+'
'; NDAS = $('#notice_data-attach_selected'); (NDAS.length > 0) ? NDAS.replaceWith(S) : $('#form_notice').append(S); + $('#notice_data-attach_selected button').click(function(){ + $('#notice_data-attach_selected').remove(); + NDA.val(''); + }); }); } diff --git a/theme/base/css/display.css b/theme/base/css/display.css index c8f23e4f5..78fcd7ece 100644 --- a/theme/base/css/display.css +++ b/theme/base/css/display.css @@ -517,8 +517,19 @@ clear:both; width:81.5%; margin-bottom:0; line-height:1.618; +} +#form_notice #notice_data-attach_selected code { +float:left; +width:90%; +display:block; +font-size:1.1em; +line-height:1.8; overflow:auto; } +#form_notice #notice_data-attach_selected button { +float:right; +font-size:0.8em; +} /* entity_profile */ .entity_profile { -- cgit v1.2.3-54-g00ecf