Commit Graph

785 Commits

Author SHA1 Message Date
Waseem Daher 40a8ee48a5 Make stream_list only contain lowercase stream names.
(imported from commit 350f1b20987206c1e910fcc5c2926bd6e96baaeb)
2013-01-07 17:36:37 -05:00
Waseem Daher baba72e3b8 Cause case to be respected when adding a subscription.
And have its colorpicker work.

(imported from commit 998c54153518bb94b7ce41e073078675767694c0)
2013-01-07 17:36:03 -05:00
Waseem Daher 5501558fa7 Only request background color for stream messages.
subs.get_color is expecting a string, and so if you do this on
a PM, it breaks.

(imported from commit acf6d51b84d7bbbe643466f1f72f90a8f6cf16f6)
2013-01-07 17:34:27 -05:00
Tyler Hallada b6e1024b69 Display composebox again upon server errors
Also removed .show()s for the alert on does-not-exist and not-subscribed, where
a blank error would display. This should fix the underlying issue with #166:
that hiding the composebox before send_message() was called would hide server
errors.

(imported from commit a8a50cdf82ddf1d15f1e405432ff3bbfdb7a491a)
2013-01-07 17:03:34 -05:00
Zev Benjamin 9b3e4a8bed Don't focus the new stream box after sucessfully subscribing or unsubscribing
If you have a lot of subscriptions that you're trying to modify,
jumping back up to the top of the page is very disruptive.  We still
show the success message, which has the effect of scrolling the page
and is thus surprising, but that's better than the user completely
losing their place.

We do need a story for informing users about failures to subscribe or
unsubscribe, though.  We currently jump back to the top so they can
see the error, but that's not optimal.

(imported from commit 48d938ddc47f286a72e2147f4459b91ca5684e36)
2013-01-07 13:48:19 -05:00
Zev Benjamin 42bf93fb07 Add expandable settings panel for subscription entries
(imported from commit 3c07dcac7ec8086d417c2898a307ee67fc286704)
2013-01-07 13:48:19 -05:00
Zev Benjamin e1a3765644 Give each subscription an id for easier DOM manipulation
(imported from commit 976744174d06abf8bde651ca815d8fe17b8e64ff)
2013-01-07 13:48:19 -05:00
Zev Benjamin 2b4b827715 Fix repeatedly clicking the subscribe/unsubscribe button
(imported from commit e85f2678a4ca896e5a9bd40d37c3713153825c4d)
2013-01-04 18:11:07 -05:00
Zev Benjamin aad09fc267 Merge stream_set and stream_color into a single data structure
(imported from commit 88324e0d296f192feac4f5ecf45f347712cc5914)
2013-01-04 18:11:07 -05:00
Jeff Arnold ff57c9af59 Immediately load_old_messages when the user arrives via a #narrow URL
(imported from commit 9705cbb70f9ce62ea5e362212ac91daf1b97ff13)
2012-12-21 12:13:42 -05:00
Jeff Arnold 8b56de22e0 Make #narrowing to a stream with no recent messages not error
(imported from commit b8f0ff9b81876927a59139385d52a9ace96f7559)
2012-12-21 12:12:08 -05:00
Tyler Hallada a3ccfdc78f Set bottom_whitespace height on resize with js
CSS height percentage was not working because parent div has an undefined
height, so instead it is set to 40% of the window height on resize (and initial
load) via JavaScript.

Fixes trac ticket #24.

(imported from commit 2c6a8489585c4bf70c44469ce8628264ec3fbc36)
2012-12-20 22:41:47 -05:00
Jeff Arnold 4feae6b202 Make the back button work for the settings and subscriptions pages
(imported from commit 650c884abc9514cdfc934ae01e0a490f5f681292)
2012-12-20 14:45:11 -05:00
Jeff Arnold f4ddf4412b Make it possible to paste a #narrow URL into a new tab
(imported from commit 0a2ac3e7100627fd02874b02c1b5abe6d4b58c77)
2012-12-20 14:45:11 -05:00
Tyler Hallada d179de07f6 Clear the composebox on open instead of close
Variables like stream, subject, and message were getting cleared from the DOM
when the compose box was closed. The "Create and send" button was trying to
access these variables to create a new stream, but they were gone. Now they
are cleared when a new compose is started.

Fixes trac ticket #568.

(imported from commit 39ccaaeacb3f92f4b1d771be1b34ff660e0d5883)
2012-12-19 15:07:04 -05:00
Jeff Arnold db6f03d46d Make the back button work when narrowed
(imported from commit be922b06e7b53ec21751e67a490bb518333c3e6c)
2012-12-19 14:46:31 -05:00
Zev Benjamin a92a35906c Reset favicon after setting window.location.hash
Firefox drops the favicon after modifying window.location.hash, so we
reset it after modifying it.  See
https://bugzilla.mozilla.org/show_bug.cgi?id=408415 and
https://bugzilla.mozilla.org/show_bug.cgi?id=519028

This fixes #422

(imported from commit 3d7ac5ba28a4fa94d2bd9a0f711db8cd538039d3)
2012-12-17 20:55:47 -05:00
Zev Benjamin 989cee3194 Only set the hash portion of the URL for future-proofing
(imported from commit b860e6c5dde0a75c54678d6a6798611497c1db39)
2012-12-17 20:54:32 -05:00
Tim Abbott 0dda71fb54 Fix website improperly submitting a last value of -1.
We were submitting a 'last' value of -1 to the server at startup,
which is invalid but normally ended up being OK because the user
usually had no messages whatsoever or had last be updated via
get_old_messages before the get_updates call went through.

(imported from commit df55ac1cdac443721c06ebed94a1c4b3ec7af2d1)
2012-12-14 17:15:32 -05:00
Keegan McAllister 197d0dcc01 Revert "Pause for 25 ms in between successful get_updates calls"
This was not totally effective, and with the previous commit it is no longer
needed.

This reverts commit e86c0b653669cf86b0d8956c2c85eb7610fc342f.

(imported from commit 0de5bfec87147b1336f6f79c33d4e32493e1e508)
2012-12-14 16:22:42 -05:00
Keegan McAllister 44b9925bfc Configure get_updates timeout in settings.py
(imported from commit 2a647bdd73c43ca5fed704925808efafc70da044)
2012-12-14 16:22:42 -05:00
Waseem Daher 7de057dcb0 Remove unescaped use of stream name in subscriptions page.
This was causing issues with our ability to unsubscribe from
streams with " in their names.

The solution here is a bit hacky, since it depends on the JavaScript
being fairly aware of the layout of the DOM, which is not great.
But it works.

This fixes Trac #328.

(imported from commit a1b6c8e1f3a9daacdc48920a195717aa89b3a9a9)
2012-12-13 15:46:30 -05:00
Waseem Daher 858d638960 Make subscriptions page slightly more robust to weird characters.
This fixes Trac #522, which previously prevented you from
subscribing to a stream named
    '"]'); alert('hi');

This does not fix #328, which is that you can't unsubscribe
from 'Waseem', among other things.

(imported from commit 869063cafa9e7e988aea993d072ca1ad880bcee1)
2012-12-13 15:46:30 -05:00
Waseem Daher 622bcb9ef4 Call the colorpicker drawing code just once, rather than in a tight loop.
Unfortunately, this doesn't actually give us much performance gain
either; it's not really the calls to 'find' that are taking any time.
But I do find this a little cleaner as well.

Simply initializing 100 colorpickers with our options takes about 700ms.
Initializing ~100 colorpickers with the total default set of options
shaves that down to about 300-400ms (though obviously doesn't quite
achieve what we want).

(imported from commit 7084b35fb6e77600edfcdcfcc2761a11e6f38c03)
2012-12-13 15:46:30 -05:00
Waseem Daher cd237c3429 Smarter template invocation on settings page.
Rather than calling the template generating code once per
subscription, let's just do it in a batch when possible.

With about 100 subscriptions, the "fetch" call takes about 800ms to
render (while testing locally) both before and after this change,
which is somewhat disappointing.

But this *is* cleaner!

(imported from commit 9ba8819524da86c00a2508349be0ea0ddd48606b)
2012-12-13 15:46:30 -05:00
Zev Benjamin 695d9a4dc6 Change get_updates_params.reload_pending to reload.is_pending() as the former no longer exists
(imported from commit fdc59a27230cb49adee2f5444e440aaa84103e5e)
2012-12-11 16:40:26 -05:00
Waseem Daher 4bb330bb21 Allow 'Esc' to clear a keyboard-driven Find.
(imported from commit d48028531b6e7286d177790ec5adb2e5f256b1e0)
2012-12-07 15:01:20 -05:00
Waseem Daher 64b3f072fe Restore "Enter advances find" behavior.
This fixes https://trac.humbughq.com/ticket/546.

It's a little unpleasant that this special-casing lives in hotkey.js
-- instead you could imagine doing something where there was a whole
special set of hotkeys when a search is active, like we do with the
composebox, but this gets the job and is probably simplest.

I would have written this as a case that just falls through in the
else condition, but jslint doesn't like that.

(imported from commit 65a1b8aa1efc356b6690dc177058a4fb9e12745a)
2012-12-07 15:01:20 -05:00
Jeff Arnold d67e2cc4f3 Put the domain earlier in the titlebar, to help distinguish tabs
(imported from commit 225072a7cc044b011114a8630b02d74640b39d55)
2012-12-05 16:03:02 -05:00
Tim Abbott 72b9f25cbd Don't try to scroll to show composebox when no messages are showing.
(imported from commit 3835c7de0f3cad777b1fd5b609e9dc71635422ac)
2012-12-05 14:06:57 -05:00
Keegan McAllister fb77bdf359 bugdown: Set link target, title attributes on the server
For consistency.  Fixes #266.

(imported from commit 63e199a0fe4534df804a82cc98a1fdcf8ccb45da)
2012-12-05 13:54:43 -05:00
Jeff Arnold 8d4ddeb57d Keep text in the compose box when another stream/subj is clicked on
(imported from commit f063c92c4378074a7b27e45787dd1591fdde98b7)
2012-12-05 13:12:52 -05:00
Waseem Daher f3ba899fe1 Fix responsive layout on Subscriptions and Settings page.
This was a really cute bug where our layout messes up if you resize
the page while "Subscriptions" (or to a less visible extent,
"Settings") is active.

The problem here is that we compute the size of the top navbar
based on the size of main_div -- but when main_div is hidden,
it has a width of zero!

We need to instead look at the width of the pane that *is* active.

Resolves https://trac.humbughq.com/ticket/216

(imported from commit adbef00d190845f90c5cfdb46df4ec7b703635ef)
2012-12-04 23:00:06 -05:00
Zev Benjamin 7e4776322d [manual] Unify huddles and personals into private messages on the receive path
feedback-bot and zephyr_mirror will need to be updated and restarted
when this is deployed to prod.

(imported from commit fe2b524424c174bcb1b717a851a5d3815fda3f69)
2012-12-04 18:01:51 -05:00
Waseem Daher af401fe659 Fix "resizing window breaks in Chrome" issue.
Ironically, I think this might've bee introduced by
commit ca35321c02d5e79e4f9c439a662805c016a333ed,
'Fix "resizing window breaks in Firefox" issue'.

Basically, when the window is 776px wide according to
window.innerWidth, that's the width not including the
scrollbar. However, in Chrome, the media query seems to ignore the
width of the scrollbar, so from the CSS's perspective, the window is
actually ~766px wide, so it goes into condensed mode.

But the rest of our code doesn't, which causes the break.

A bit more on this browser-specific difference at:
http://www.456bereastreet.com/archive/201101/media_queries_viewport_width_scrollbars_and_webkit_browsers/

So the issue we have is, to match the CSS's behavior:
* In Firefox, we should be listening to window.innerWidth
* In Chrome, we should be listening to window.width

We fix this hopefully once and for all by using window.matchMedia --
aka the exact same query that the CSS itself uses. As discussed in my
last commit, this feature is unavailable in IE<10, so we provide a
potentially more fragile fallback, i.e. what we did before this
commit.

(imported from commit d8e6425b81c90c8e0fdda28e7273988c9bfd67ec)
2012-12-04 14:52:29 -05:00
Tim Abbott 386e9eeb22 Fix load_old_messages being called with NaN argument.
(imported from commit 32cb17c98b81a40861f3d825e17a687575f35542)
2012-12-04 14:13:04 -05:00
Keegan McAllister 7907be735e hotkey: Make Enter an alias for 'r'
(imported from commit 9bf1b97304a4a4c1100826fefbba8edf1e4cff12)
2012-12-04 10:52:44 -05:00
Jeff Arnold f014163aed When narrowed, we want to load messages older than the oldest message
in the narrowed view, not messages older than the oldest message in
the home view

Tim provided most of the code for this patch

(imported from commit ec0bbfd344cac351f56a456fc560848603721135)
2012-12-03 15:58:26 -05:00
Keegan McAllister f61c26c361 preventDefault for modal mousewheel events but not e.g. subscriptions tab
Fixes mousewheel scrolling on the subscriptions tab.

(imported from commit 38d214fd53a478f3076dbfa4d7942ff13ec61369)
2012-12-03 15:35:46 -05:00
Keegan McAllister 2401fab25c Replace home_tab_active with home_tab_obscured
(imported from commit fb8c47079e63594a22c3d47fcf373887bda6e499)
2012-12-03 15:35:46 -05:00
Jessica McKellar 2fd3eb521c Refactor colorizing requests into a subscription properties model.
(imported from commit da4bfee4a12e941d4ec4c9f140973bb138c82c93)
2012-12-03 12:46:27 -05:00
Jessica McKellar 6a316daee8 Add frontend support for colorizing streams.
(imported from commit 48395ba915d6b22d8a7a8c7fbfb5e462680cef09)
2012-12-03 12:46:27 -05:00
Waseem Daher f71affdc11 Layout for colorizing streams.
(imported from commit 50d359ed44f46a0c666778bf510dafbb3e6e6f97)
2012-12-03 12:46:26 -05:00
Zev Benjamin c5bf05ad0a Make clicking on 'Find <search term>' work
(imported from commit 756bd6cb3533e985e031954ece9228a146c5160e)
2012-11-30 17:03:52 -05:00
Zev Benjamin 0af3199d7c Desynchronize web client reloads
(imported from commit 216df5996f597ccd47bbc80e3f2fdaae751789d0)
2012-11-30 15:04:46 -05:00
Zev Benjamin 46f4a5eb38 Add util module
(imported from commit 3844e136fb799c6f57f8823255addf00a07ef686)
2012-11-30 15:04:46 -05:00
Zev Benjamin d29c77b14c Name unconditional reload time constant and appropriately move its use
(imported from commit 5ead2dbe0f170f8b93e726de6d6ed10a985882ab)
2012-11-30 15:03:19 -05:00
Jessica McKellar 37968bc9c7 If necessary, scroll to avoid occluding the message to which you are replying.
(imported from commit adf23d647a3d462d6236d8f1039da89a31b782d5)
2012-11-30 14:32:41 -05:00
Keegan McAllister 83660d7020 mousewheel: Explain why the home_tab_active() check is outside throttled_mousewheelhandler
(imported from commit 6fd5504fb5fb0e72426fa60e051b7e912696b8c2)
2012-11-30 13:58:04 -05:00
Keegan McAllister 3ce4427614 ui.js: Whitespace fixes
(imported from commit d7bb9fe17e319f60f1cc65bdfd381dc2f5d25a3a)
2012-11-30 13:01:02 -05:00