Commits on Jul 10, 2008
  1. Update

    pudge committed Jul 10, 2008
  2. Fix for comments loading in wrong order

    Async was our problem here, sync shouldn't cause a serious problem
    pudge committed Jul 10, 2008
  3. Dumb BBEdit syntax coloring fix

    pudge committed Jul 10, 2008
  4. Teach the tag widget about `contexts' for suggesting related tags

    For now, build just the nod and nix contexts in the convenient template already
    using those tags: nodnix_menus.  Really, though, this needs to be moved into a
    template of its own, probably also containing the well known tags stuff from the
    earlier widget styling commit.
    	+ firehose_up_down (called when you click the +/- capsule) now always
    	  wants to show the tag widget (if any), and sets its context
    	+ adding widget function: set_context.  Looks up the context by name in
    	  a global map, extracting a list of tags; then set_tags the new list
    	  as '<context>tags...' allowing any get="context" listeners to do the
    	  right thing
    	+ build the context map, filling in just nod context, nix context
    committed Jul 10, 2008
  5. Teach the tag widget to style tags with global observations

    E.g., if a tag appears both in the user tag bar and the top tags bar, then every
    occurance of the tag anywhere in that widget should be styled to reflect that.
    With that knowledge, the css rules could (for instance) hide in the user bar any
    tags that also appear in the top tags bar.
    Also made the style code smarter about `well known tags', though this machinery
    needs to move into a template.
    Big changes in the css to (a) make my rules win over more general base rules,
    (b) make the tag menus at least visible if not usable, (c) hide tags, as above,
    (d) renaming the prefix styles, (e) adding new styles for some of the well known
    committed Jul 10, 2008
  6. As with tag-widgets, allow tag-bars to be stubs; saving code in favor…

    … of templates
    The stub-expanding code decides you are a stubbed tag-bar if
    	(a) you say so, class="tbar stub"
    	(b) you have a 'get' attribute and _no_ class attribute
    Sample tag-bar stubs:
    	<div class="tbar stub" get="user" label="My Tags">tag1 tag2 tag3</div>
    	<div get="top"></div>
    The stub class will be deleted, and 'tbar' will be added if not present.  The
    value of your label attribute will become the content in an <h1 class="legend">
    element; the attribute itself will be deleted.  A menu attribute can override
    the default tag menus; the attribute itself will be deleted.
    	+ tagbar_data.list_el, the saved reference to the <ul> is now a jQuery
    	  object, so renamed $list_el
    	+ twidget_fns.init: no longer adds specific bars, now just expands stubs
    	+ new init_tag_bar(): expands and initializes a stubbed tag-bar
    	+ rewrote create_tag_bar() to now be a wrapper around init_tag_bar
    	+ added stub tag-bars to the widget template; we are no longer
    	  hand-coding them
    	+ create_firehose_vote_handler: assigns a class to prevent its listener
    	  from being treated like a stub
    committed Jul 9, 2008
  7. Make tag-widget only show up for admins with users_param tagwidget_debug

    The template checks the extra condition.  Other code now more carefully checks
    if a tag widget is actually available.
    	+ only include tag widget html if the user has tagwidget_debug set
    	+ firehose_fix_up_down: test if we actually found one; comment
    	+ firehose_handle_update: only install doubleclick if I actually see one
    	  or more tag widgets in the document
    	+ firehose_collapse_entry: also close the tag widget, if any; clean up
    committed Jul 10, 2008
Commits on Jul 9, 2008
  1. More accurate popularity for comments

    Comments were being added to the hose with popularity based on
    current score, but score wasn't being taken into account for
    popularity changes based on tags.
    jamiemccarthy committed Jul 9, 2008
  2. Insert some needy comments into the hose

    Based on vars, a certain fraction of comments with a minimum level
    of neediness will be inserted into the hose once their neediness
    crosses that threshold (so they can be metamoderated).  Also, all
    comments inserted into the hose get their popularity and editorpop
    scores immediately recalculated.
    jamiemccarthy committed Jul 9, 2008
Commits on Jul 8, 2008
  1. Revert "For tag bars, teach FireHose ajax to fetch top tags, respect …

    This reverts commit 103283a.
    The function ajaxSetGetCombinedTags is now the preferred call for this.
    committed Jul 8, 2008
  2. Revert "For tag bars, teach FireHose ajax to fetch combined tags (use…

    …r, top, system)"
    This reverts commit 4eeb3b1.
    The function ajaxSetGetCombinedTags is now the preferred call for this.
    committed Jul 8, 2008
  3. Bugfix: "Happily, jQuery's show() and hide() still work" (26f05cd) wa…

    …s overly optimistic
    Yes, show() still shows it and my hide() still hides it, but once hide() has put
    style='display: none' on the feedback element, that trumps the css rule to show
    it for autocomplete feedback.  Instead of adding 'display: none' (as hide does),
    we need to delete 'display: block'.  Since that's the only style on the element,
    we can just remove the style attribute itself.
    It's better when I let my commits bake locally a while before I push them, to
    avoid these little commits that should have just been --amend.
    committed Jul 8, 2008
  4. Hook jQuery's autocompleter into the tag-widget's busy feedback

    We want autocomplete to show the same `busy' feedback while fetching completions
    that we already show while setting and fetching tags.  Unfortunately, jQuery's
    autocompleter has only one means of showing this feedback: when it starts an
    ajax request, it sets a class ('ac_loading' by default) on the input field; on
    completion, it removes the class.  Because we're not allowed (HTML law) to put
    our feedback element logically inside the input element, we make it be the
    immediate next sibling of the input field and use the CSS adjacent-sibling
    selector, '+', to manage its visibility.
    Happily, jQuery's show() and hide() still work so no changes are needed to the
    existing busy code.
    committed Jul 8, 2008
  5. Connect jQuery's autocomplete to the tag-widget input field

    	+ since the autocompleter won't let us specify directly, make POST the
    	  default for $.ajax
    	+ in tag-widget's init(), hook up an autocompleter for the input field
    	+ jQuery's autocompleter sends the prefix as $form->{q}, so teach
    	  ajaxListTagnames to try that if it doesn't find $form->{prefix}
    committed Jul 8, 2008
  6. Bugfix: firehose was hiding tag-widget's spinner because they both us…

    …ed '.busy'
    changed the class used within the widget to 'widget-busy' so the firehose will
    no longer fiddle with my feedback elements accidentally.
    committed Jul 8, 2008
  7. Bugfix: the submit function was on the form, but thought it was on th…

    …e field
    	+ rename to form_submit_tags, since it's on the form not the field
    	+ find the input field within the form
    	+ call the renamed function
    committed Jul 8, 2008
  8. fix typo poll->polls

    tvroom committed Jul 8, 2008
  9. Whitespace fixes + don't wait to remove firehose items, fast hardware…

    … will do the wrong thing
    tvroom committed Jul 2, 2008
  10. Fields find the widget, not the reverse; rename one of the normalize …

    There's no reason to make the widget know anything specific about the input
    field(s); in fact, it's more efficient if the input field knows directly how to
    call the widget's submit_tags function --- because then the widget doesn't have
    to search for the input field.  Made this easy to say in the HTML for the field
    by factoring it into a global function: textfield_submit_tags().
    Renamed normalize_tag_command to normalize_tag_menu_command for clarity.
    committed Jul 8, 2008
Commits on Jul 7, 2008
  1. Teach the firehose that double-click means to show the in-progress ta…

    …g widget
    Admin-only and certainly not the decided way to activate the tag widget; just
    something that makes it testable.
    committed Jun 27, 2008
  2. Tag-widget: add input field, animate open/close, add spinner, fix css

    Added a text field (in a form), and for better css control wrapped the tag bars
    themselves in a div of their own.  Added css to support both "stack" and "train"
    layouts of the bars.  We are currently using the "train" (one-line) layout.
    _submit_fetch core starts the busy spinner on entry, stops it after all work from
    the completion function is done.
    For paranoia, handle a possible case in the firehose vote handler, where Jamie
    tells me both nod and nix.
    Added some debugging css to show Rob the top and system tag-bars.
    committed Jun 27, 2008
  3. Factor up firehose-specific knowledge from the tag-widget

    	+ add firehose_fix_up_down() to separate consequences from the source of
    	  changes, as both the +/- capsule and the tag-widget can nod/nix
    	+ factoring that functionality out of firehose_up_down
    	+ a tag-widget isn't specific to the firehose (eventually anyway), so
    	  item_id might refer to other data types
    	+ $parent_entry is needed to mark the containing entry when a tag-widget
    	  is open, to allow Wes to style everything appropriately
    	+ rename to open_firehose_tag_widget, close_firehose_tag_widget, and move
    	  firehose-specific code/selectors into these functions (and move these
    	  functions to the bottom of the file)
    	+ add create_firehose_vote_handler, a connector that gets notified of the
    	  nod/nix state of an item, and calls into our new firehose_fix_up_down
    committed Jul 7, 2008
  4. Move all communication up into the tag-widget; use the new ajax op from

    tag_click( event ):
    	+ renamed to click_tag, since it is now the only handler
    	+ normalize the command, until Jamie makes 'opposites' handle nod/nix
    	+ if the shift key is down, don't do the command, just add it to the field
    	+ the widget will end up handling this action (whatever it may be) not the bar
    	+ but don't assume there _is_ a widget
    	+ remove fetch_tags, all communication lives in the widget now
    	+ remove click_tag, the global click_tag handler is the way to do it now
    	+ init now makes a (temporary) nod/nix bar
    	+ init appends an array of 3 items, instead of doing 3 appends
    	+ each_bar is no longer needed; because:
    	+ set_tags now routes input to children by the 'get' attribute; e.g., if
    	  you want to be notified of user tags, you have the attribute
    	  'get="user"', and anytime new user tags arrive, your set_tags()
    	  function will be called (even if you're not a tag bar)
    	+ simplified the each inside set_tags, as the simplified form is no
    	  longer allowed; tags will always be the fully annotated set of lists
    	+ factor the ajax core out of fetch tags, teach it the new ajax_op
    	+ implement submit_tags, using the factored fetch machinery
    	+ two blank lines between functions, just like tbar_fns
    	+ individual bars no longer handle communication, so no need to remember id
    	+ simplify menu templates
    normalize stuff:
    	+ currently, because of a limitation in Jamie's 'opposites' code, I need
    	  to preprocess my commands a little to ensure the right thing happens.
    	  _normalize_nodnix() explains that preprocessing exactly
    	+ normalize_tag_command() turns a tag/op pair into a command (ready to
    	  be normalized)
    	+ fix the special case where a tag is a single character
    committed Jul 3, 2008
  5. Teach how to getUserNodNixForGlobj for ajaxSetGetCombinedTags…

    … new <vote> category
    	+ getTagsByGlobjid learned a new option, limit_to_tagnames (an array)
    	+ new sub getUserNodNixForGlobj calls it using the new option
    	+ ajaxSetGetCombinedTags uses getUserNodNixForGlobj to populate <vote> list
    	+ added <vote> category, filled by caller supplied vote_tags
    	+ now always prints every list, even empty ones (since empty is meaningful)
    committed Jul 7, 2008
  6. Teach setTagsForGlobj some extra options needed for new uses by ajaxS…

    	+ for deactivateTag, we sometimes need tagname_required
    	+ for getTagsByNameAndIdArrayref, we sometimes need include_private
    	+ fixed comments about the two paths for deactivating tags
    	+ tell setTagsForGlobj, this is one of the times when tagname_required
    committed Jul 7, 2008
  7. Bunches of D2 fixes

    - Make threshold and totals update for submitted comments
    - Make keybindings work if no comments are visible on initial load
    - Do not mark unread hidden comments as read
    - Do not try to focus on cid=0 (doesn't exist!)
    - Skip first comment if already read
    pudge committed Jul 7, 2008