Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

For admins only, add a 'note' signal in hose entry titles

It's not a button, just a flag.
  • Loading branch information...
commit a259a6ce36c3d176e84d3a544fd486c638f3e701 1 parent 6f44367
Scott Collins authored
2  plugins/Ajax/htdocs/images/admin.js
@@ -332,7 +332,7 @@ function firehose_save_note(id) {
332 332
 	var $entry = $('#firehose-'+id);
333 333
 
334 334
 	var note_text = $entry.find('#note-input-'+id).val();
335  
-	$entry.find('.note-wrapper')[note_text ? 'removeClass' : 'addClass']('no-note');
  335
+	$entry.find('.note-flag, .note-wrapper').toggleClassTo('no-note', !note_text);
336 336
 
337 337
 	ajax_update({
338 338
 		op:	'firehose_save_note',
10  plugins/Ajax/htdocs/images/common.js
@@ -899,6 +899,16 @@ function firehose_init_tagui( $new_entries ){
899 899
 
900 900
 			if ( fh_is_admin ) {
901 901
 				this.command_pipeline.push(firehose_handle_admin_commands);
  902
+
  903
+				var $note_flag = $this.find('.title h3').
  904
+					append('<span class="note-flag">note</span>').
  905
+					find('.note-flag').
  906
+					attr('title', "don't click; I am not a button");
  907
+
  908
+				var $note_wrapper = $this.find('.note-wrapper');
  909
+				if ( ! $note_wrapper.length || $note_wrapper.hasClass('no-note') ) {
  910
+					$note_flag.addClass('no-note');
  911
+				}
902 912
 			}
903 913
 
904 914
 			this.command_pipeline.push(
11  plugins/Ajax/htdocs/images/tagui.css
@@ -364,7 +364,7 @@ div.tag-display {
364 364
 }
365 365
 
366 366
 .tag-widget .admin-buttons {
367  
-	padding-right: 2.7em;
  367
+	padding-right: 0.7em;
368 368
 }
369 369
 
370 370
 .tag-widget .admin-buttons .note-input {
@@ -433,3 +433,12 @@ div.article div.title div.nod-nix-reasons span.tag {
433 433
 .nod-nix-reasons .tag-display:hover ul {
434 434
 	background-color: inherit;
435 435
 }
  436
+
  437
+.note-flag {
  438
+	position: absolute;
  439
+	right: 6em;
  440
+}
  441
+
  442
+.note-flag.no-note {
  443
+	opacity: 0;
  444
+}
2  plugins/FireHose/templates/tag_widget;firehose;default
@@ -49,7 +49,7 @@ __template__
49 49
 				[%# the note button %]
50 50
 				<span class="admin-note">
51 51
 				<a id="note-text-[% item.id %]" href="#" onclick="firehose_open_note('[% item.id %]'); return false">
52  
-					[%- IF !item.note  %]N[% END -%][% item.note | strip_literal -%]
  52
+					[%- IF !item.note  %]Note[% END -%][% item.note | strip_literal -%]
53 53
 				</a>
54 54
 				</span>
55 55
 			</div>

0 notes on commit a259a6c

Please sign in to comment.
Something went wrong with that request. Please try again.