Commit graph

226 commits

Author SHA1 Message Date
David Cormier
8d94dffec9 Rename isMobileDevice to isMobileUi
Right now we are only checking the width screen so we are not
detecting anything that is mobile specific. Will rename to
isMobileDevice when we introduce more specific checks.
2014-03-30 20:16:29 -04:00
Felix Eckhofer
3ed3df9ede Only hide bufferlist when switching to mobile
Showing the keyboard on mobile will trigger a resize event, therefore
trying to use the bufferlist filter will actually hide the bufferlist
making the feature unusable. Bug introduced by 554b1669.
2014-03-30 23:59:52 +02:00
Lorenz Hübschle-Schneider
0e3bf78087 Fix bug where no (more) lines were loaded despite there being more 2014-03-24 18:05:06 +00:00
David Cormier
2000437c3a Merge pull request #238 from lorenzhs/trailingcomma
remove trailing commas
2014-03-19 14:28:54 -04:00
Lorenz Hübschle-Schneider
0ff0c995d4 remove trailing commas 2014-03-19 18:02:20 +00:00
David Cormier
f20f7f950e Merge pull request #234 from lorenzhs/notificationcount
Add notification count to notifications
2014-03-19 13:13:04 -04:00
Felix Eckhofer
9d0fb6b0cd Update path to icon for notifications 2014-03-18 10:53:23 +01:00
Lorenz Hübschle-Schneider
54bb156f01 Add notification count to notifications 2014-03-13 20:33:46 +00:00
Lorenz Hübschle-Schneider
554b16698a Show sidebar when switching from mobile to desktop view
(or the other way around)
2014-03-13 18:49:29 +00:00
David Cormier
24a7fe2d42 Merge pull request #230 from lorenzhs/fixirclinky
Don't irc linky #foo after forward / backward slashes
2014-03-10 14:23:47 -04:00
Lorenz Hübschle-Schneider
a51e5c17ae Don't irc linky #foo after forward / backward slashes
This broke some URLs like http://caniuse.com/#feat=flexbox
2014-03-10 17:19:02 +00:00
Lorenz Hübschle-Schneider
90b29cc5ad Don't update read marker if no more lines could be fetched
Fixes disappearing read marker (set to -1)
2014-03-10 17:10:56 +00:00
Lorenz Hübschle-Schneider
203680ff58 Try to fetch all unread lines if that is a reasonable amount
Partially fixes #139 in that it tries to accomplish this, but until we can request
only non-filtered lines from WeeChat, the best thing we can do is guessing.
2014-03-08 22:47:24 +00:00
David Cormier
a3410d45c1 Merge pull request #225 from lorenzhs/defernicklist
Defer nicklist loading until buffer is opened
2014-03-08 17:43:53 -05:00
Lorenz Hübschle-Schneider
dc0ce33bea Fetch nicklist by buffer name, not pointer
An invalid pointer will crash WeeChat, while an invalid name will not. A pointer
becomes invalid e.g. if the buffer is closed by another client, g-b not updated,
and the buffer then selected in g-b.
2014-03-08 21:35:03 +00:00
Lorenz Hübschle-Schneider
730c7dab8d Load lines before nicklist
Nicklist is not nearly as important as the actual lines, load them first for better perceived performance. Parsing the nicklist can take a noticeable amount of time for channels with thousands of occupants.

This also improves/fixes the nicklist emptiness check
2014-03-08 21:34:39 +00:00
Lorenz Hübschle-Schneider
14575f3547 Remove debug logging 2014-03-08 17:07:54 +00:00
Lorenz Hübschle-Schneider
ac548777fc Defer nicklist loading until buffer is opened
Drastically improves startup time for users with buffers that have thousands of users
2014-03-08 16:10:41 +00:00
Lorenz Hübschle-Schneider
739c4de0ef Add a isNicklistEmpty method to buffer model, speed up nicklist decision
Flattening the nicklist is really unnecessary. This method is 10x faster for short
nicklists, and much faster for buffers with lots of users.
2014-03-07 17:52:32 +00:00
David Cormier
ff1f240854 Merge pull request #217 from lorenzhs/notificationfix
Display all parts of message prefix in notification
2014-03-06 08:22:25 -05:00
Lorenz Hübschle-Schneider
4e315b53a8 Display all parts of message prefix in notification
Previously, we only got the first part -- which would be "@" for an op, and not their nick.
2014-03-05 13:31:54 +00:00
Lorenz Hübschle-Schneider
71cafde5a3 Reset unread count on disconnect 2014-03-05 13:21:12 +00:00
Lorenz Hübschle-Schneider
58a26ceea9 Treat messages arriving in active buffer as unread if window is not focused 2014-03-05 13:21:08 +00:00
David Cormier
055dc9eba9 Merge pull request #215 from lorenzhs/patch-1
Tweak channel highlighting regex
2014-03-05 08:13:53 -05:00
David Cormier
2e7c6b3fbe Merge pull request #214 from torhve/fix-bufferlist
Fix bufferlist not working after reconnect

Fix #183
Open #73
2014-03-05 08:11:12 -05:00
Lorenz Hübschle-Schneider
01f213147e Tweak channel highlighting regex
Don't require white space at the start, punctuation marks are good, too.
2014-03-05 10:56:36 +00:00
Tor Hveem
5552d40ec2 Fix bufferlist not working after reconnect 2014-03-05 11:22:03 +01:00
David Cormier
f9defeed9f Use "sonar" sound for notifications 2014-03-04 08:26:32 -05:00
Lorenz Hübschle-Schneider
aecae9f0e6 Optionally play a sound on notification
Fixes #42
TODO: find and add a sound file
2014-03-03 21:23:15 -05:00
David Cormier
8a6337e873 Merge pull request #204 from lorenzhs/numlines
Recalculate number of lines needed on resizing
2014-02-28 09:11:39 -05:00
Lorenz Hübschle-Schneider
a3b52ddddd Recalculate number of lines needed on resizing
The issue with #bufferlines on mobile has been fixed in 0d580cc, so calculate
the number of (non-wrapping) lines that fit in the window and add a buffer of 10
for hidden lines and to allow scrolling up to fetch more lines (#202)
2014-02-28 10:23:10 +00:00
David Cormier
c4dc74ca8d Make allLinesFetched an attribute of buffer
Remove noMoreLines from the rootScope.
2014-02-27 21:55:42 -05:00
Tor Hveem
892dac5fbc Variable fix, and compare fix 2014-02-27 21:55:42 -05:00
Tor Hveem
c80e3ce005 Fix spaces 2014-02-27 21:55:42 -05:00
Tor Hveem
ad68e32c08 Don't show fetch more lines when there aren't any 2014-02-27 21:55:42 -05:00
David Cormier
a5006ce966 Fix jshint error 2014-02-27 21:25:59 -05:00
Tor Hveem
5dd11d72c0 Fix alt-n again 2014-02-28 00:31:32 +01:00
Tor Hveem
00906f34cb Add chrome keycode for < 2014-02-28 00:13:21 +01:00
David Cormier
d5cbdf2d4a Respect mobile users settings
Do not set the values for "nonicklist" "noembed" and "notimestamp"
regardless of what the mobile user had set. Only change the default
values for the bindings if none has been set.

Fix #147
2014-02-27 08:28:01 -05:00
Tor Hveem
bebc1c7bce Remove duplicate bufferlist storage. Only use object 2014-02-26 19:39:48 +01:00
David Cormier
71a3f00479 Merge pull request #187 from torhve/master
call the right scope
2014-02-26 08:13:43 -05:00
Lorenz Hübschle-Schneider
0cc693fe7d Move mobile device detection to a function
avoids code duplication
2014-02-25 21:17:29 +00:00
Lorenz Hübschle-Schneider
1664b34cc9 Reorder statements for easier reading 2014-02-25 21:12:36 +00:00
Lorenz Hübschle-Schneider
997fe91d3e Remove redundant line
localStorage triggers this on page load anyway
2014-02-25 21:12:36 +00:00
Lorenz Hübschle-Schneider
3f68a156a4 Move initialisation code to functions 2014-02-25 21:12:36 +00:00
Lorenz Hübschle-Schneider
e301849a73 Remove unused functions and parameters 2014-02-25 21:12:36 +00:00
Lorenz Hübschle-Schneider
330942b111 Remove unused variable 2014-02-25 21:12:36 +00:00
Tor Hveem
d6a64b32b9 call the right scope 2014-02-25 17:33:05 +01:00
David Cormier
4451bff60d Move activeBufferChanged listener to WeechatCtrl
I don't believe that the inputBar directive should know about the
mobile cutoff we have set for GB. We should aim to make it as
reusable as possible
2014-02-25 09:14:08 -05:00
David Cormier
c04b6e64f6 Let user specify the id of the input bar
Input bar id is not globally set, but passed to the directive
through the input-id attribute.
2014-02-25 09:12:52 -05:00
David Cormier
f3f5330aed Merge pull request #178 from cormier/fix-74
Fix nick completion issues
2014-02-24 12:20:05 -05:00
David Cormier
c163e9933f Merge pull request #171 from lorenzhs/fixduplicatenotifications
[WIP?] Fix an issue with notifications being shown when fetching old lines
2014-02-24 10:23:04 -05:00
Felix Eckhofer
c1c2297833 Add nick to highlight notification from channels 2014-02-24 15:41:15 +01:00
Felix Eckhofer
b3b4651e33 Remove trailing spaces 2014-02-24 11:41:25 +01:00
Felix Eckhofer
7a003f8227 Focus input bar when not on mobile
This improves the UX on desktop while avoiding the virtual keyboard
popping up on touch devices
2014-02-24 11:41:20 +01:00
David Cormier
5f25a96b51 Work with inputNode element directly
Instead of using $scope.command, we work with the inputNode element
directly to have control over the caret position. This let us have
nick completition in the same way as WeeChat.

Fix #74
2014-02-23 10:55:59 -05:00
David Cormier
f141095312 Add method to retrieve inputNode element from directive 2014-02-23 10:48:21 -05:00
Lorenz Hübschle-Schneider
17cc3c9088 Disable swiping on desktop 2014-02-23 14:17:59 +00:00
Felix Eckhofer
fa01c0a53f Install Firefox Webapp from local checkout
Ask Firefox to install the currently running copy of glowing bear
instead of the copy from torhve.github.io

This also fixes a bug when glowing bear is not running from a
subdirectory (or one other than /glowing-bear) which would lead to a 404
because of torhve.github.io/original_subdir being loaded instead of
/glowing-bear.

Note that installing to a different subdirectory than /glowing-bear will
lead to the icons not being found due to the fact that all icon paths
inside manifest.webapp have to be absolute.
2014-02-22 13:46:45 +01:00
David Cormier
efda3d4963 Merge pull request #170 from lorenzhs/fixactivityswitch
Fix "Switch to buffer with activity" skipping buffers with notifications
2014-02-21 13:49:23 -05:00
Lorenz Hübschle-Schneider
4736da2d92 Fix an issue with notifications being shown when fetching old lines
@xt, does this fix the issue for you?

While we're at it, fix the annoying jump-to-bottom when loading more lines.
2014-02-21 16:33:10 +00:00
Lorenz Hübschle-Schneider
d4a5218922 Fix "Switch to buffer with activity" skipping buffers with notifications
This caused two buffer switches in a row, in effect forgetting the notifications
2014-02-21 16:03:35 +00:00
David Cormier
a28ee6033b Merge pull request #163 from lorenzhs/flashtitle
Flash title when receiving lines in the background & make use of favico configurable
2014-02-21 09:58:28 -05:00
David Cormier
e468fe57f0 Merge pull request #169 from cormier/fix-73
Reinitialize context when relay closes connection
2014-02-21 09:47:04 -05:00
David Cormier
7b79d7dc5a Merge pull request #166 from torhve/swipe-animate
Use ngAnimate to animate sidebar hiding/showing
2014-02-21 09:46:36 -05:00
Tor Hveem
056aa3deed Use CSS classes instead of javascript for margin 2014-02-21 15:35:06 +01:00
David Cormier
83fe15d326 Merge pull request #168 from lorenzhs/notifications
Notifications: Improve channel detection
2014-02-21 08:59:08 -05:00
David Cormier
b09e328463 Reinitialize context when relay closes connection
Fixes #73
2014-02-21 08:54:17 -05:00
Lorenz Hübschle-Schneider
df1bb08749 Only update title for notifications, not other kinds of activity
Also make the unread count the first thing in the title
2014-02-21 10:22:27 +00:00
Lorenz Hübschle-Schneider
effa64084b Notifications: Improve channel detection 2014-02-21 09:49:03 +00:00
Felix Eckhofer
e0aef4c6e1 make enter switch to the first match in the list 2014-02-21 09:55:56 +01:00
Felix Eckhofer
fead046eed use alt-g for filter bufferlist
this is more consistent with the other existing shortcuts and is also
the same shortcut go.py recommends in weechat-curses
2014-02-21 09:45:56 +01:00
Tor Hveem
46b503e1b4 Use ngAnimate to animate sidebar hiding/showing 2014-02-21 09:34:30 +01:00
David Cormier
f10e44efe4 Merge pull request #164 from lorenzhs/notifications
Rework notifications
2014-02-20 19:31:32 -05:00
Lorenz Hübschle-Schneider
e5f33275bd Fix the confirmation dialog when closing the tab
* Only nag if we're connected
* Set event return value so Chrome shows the dialog
2014-02-20 23:52:45 +00:00
Lorenz Hübschle-Schneider
157917d40c Rework notifications
* Improve content of notifications
  * More descriptive title
  * The bug that caused the need for manually assembling the message has been fixed (#161 or c5e548c8ab)
* Permission for displaying notifications can only be requested upon user interaction in Chrome, not on page load. Bind to connect button
* Take user to g-b tab and buffer causing the notification on click
2014-02-20 23:29:17 +00:00
Lorenz Hübschle-Schneider
d4207ed7e0 Update title with unread count
Further discussion required on a few points:
* show notifications only or unread lines as well?
* only use this when favico is disabled, or indepently?
I welcome all feedback.

Fixes #22
2014-02-20 22:47:53 +00:00
Lorenz Hübschle-Schneider
9ac7b341ec Make use of favico an option
@tribut: does this resolve your issue?
2014-02-20 22:47:24 +00:00
David Cormier
5b5082dfd4 Merge pull request #160 from cormier/previous-buffer
PR#155 with shortcut added in front page instructions
close #155
2014-02-19 11:53:06 -05:00
David Cormier
80841154b6 Merge pull request #159 from lorenzhs/fixircregex
Reduce number of false positives in IRC channel linkification
2014-02-19 10:46:13 -05:00
Lorenz Hübschle-Schneider
389d6bdedb Reduce number of false positives in IRC channel linkification 2014-02-19 15:38:07 +00:00
David Cormier
51cde96bf6 Standardize code presentation
Fix indentation (4 spaces, no tabs)
Fix indentation in CSS
Fix comment position in CSS file
2014-02-19 10:27:46 -05:00
David Cormier
8e44757e61 Replace magic number 968 with variable 2014-02-19 10:18:20 -05:00
David Cormier
11e5b6fbda Merge development branch of creesch 2014-02-19 09:58:31 -05:00
David Cormier
2e5e3a45eb Revert "Collapse sidebar with css selector"
This reverts commit 3a5dfd5e94.
2014-02-19 09:53:03 -05:00
Tor Hveem
2aa1e02bea New keybinding: Alt-< to switch to previous buffer. Same key as WeeChat 2014-02-19 10:58:26 +01:00
Lorenz Hübschle-Schneider
e5476dfd02 Whitespace fixes, some {} blocks 2014-02-18 18:13:23 +00:00
creesch
abefa7430a Implement swiping for mobile devices 2014-02-18 14:40:02 +01:00
David Cormier
27690ada58 Work around a WeeChat protocol inconvenience
Until WeeChat sends a confirmation for init we have to assume
that the commands will be received synchronously even though
they are sent asynchronously
2014-02-17 21:46:00 -05:00
David Cormier
ba20a79c72 Send init commands when connection is successful
Initialization commands are sent when we are sure that
the password has been accepted and that the init has been
processed by the weechat relay
2014-02-17 21:19:34 -05:00
David Cormier
8c386f7553 Create helper functions for initialization methods 2014-02-17 21:15:10 -05:00
David Cormier
3a5dfd5e94 Collapse sidebar with css selector
Fixes #152
2014-02-17 20:49:49 -05:00
Lorenz Hübschle-Schneider
c490e33898 IRC linky: don't match HTML encoded chars (&#41;, &gt;, etc.) 2014-02-17 20:08:55 +00:00
David Cormier
4e5f239980 Merge pull request #144 from lorenzhs/linkify
Linkify IRC channels
2014-02-17 10:24:00 -05:00
Lorenz Hübschle-Schneider
c1760e5433 Fix JS coding style
TODO: rebase this as a fixup. I don't think the github web interface supports that.
2014-02-17 12:37:14 +00:00
Lorenz Hübschle-Schneider
1a5b36b6f7 switchToActivityBuffer: Prioritise notifications
If there is a buffer with a notification, go there. Otherwise, go to one with unread lines.
2014-02-17 12:31:23 +00:00
Lorenz Hübschle-Schneider
93f40c64e9 Fix embed DOM classes
Classes, IDs and Names in the DOM have to begin with a letter. The $$hashKey
however might not, so prefix it with embed_. This also makes the classes more
unique, which is a good thing. Additionally, don't scroll on undefined should that
ever happen.

Fixes #45
2014-02-16 16:55:27 -05:00
Lorenz Hübschle-Schneider
2e963da581 Don't use jQuery, simplify 2014-02-16 16:55:27 -05:00
Lorenz Hübschle-Schneider
e48fe29cf8 Automatically scroll plugins into view 2014-02-16 16:55:27 -05:00
Lorenz Hübschle-Schneider
eaf5adf467 Linkify IRC channels
Make '#foo' in a message or buffer title clickable, taking the user to the IRC
channel specified, joining it if necessary.
2014-02-16 14:10:56 +00:00
Lorenz Hübschle-Schneider
f70f399741 remove unnecessary use of jQuery 2014-02-15 11:39:11 -05:00
Lorenz Hübschle-Schneider
f018876987 Fix botched merge 2014-02-14 16:40:44 +00:00
David Cormier
36049447cd Fix jshint errors 2014-02-14 09:32:30 -05:00
Tor Hveem
0f44465faa Better connection / password error handling 2014-02-14 09:16:40 -05:00
David Cormier
e68e7dd01d websockets: add support for user specified onmessage 2014-02-14 09:09:09 -05:00
Lorenz Hübschle-Schneider
f8f25107de Fix read marker and scrolling behaviour
* don't always jump to the bottom on incoming messages
* don't fiddle with the read marker when loading more lines
2014-02-11 21:45:57 +00:00
Lorenz Hübschle-Schneider
7c2403e7a1 Scrolling: Do not use webkit-specific function to scroll readmarker into view
Sorry for that.
2014-02-11 20:40:25 +00:00
Lorenz Hübschle-Schneider
8068be8de2 Remove setting and calculate number of lines from display properties 2014-02-10 20:18:44 +00:00
Lorenz Hübschle-Schneider
56055d61c8 Make the code a little prettier 2014-02-10 20:18:40 +00:00
Lorenz Hübschle-Schneider
40716ca649 Fix issue with incorrect read marker on startup 2014-02-10 20:15:50 +00:00
Lorenz Hübschle-Schneider
7764fc6910 Dynamically load lines for each buffer on startup
Add setting for number of lines to fetch initally.

TODO: styling
2014-02-10 20:15:50 +00:00
Lorenz Hübschle-Schneider
5a90e2e830 Fix scrolling issue and reduce the number of scrolling events on startup
Don't trigger scrolling on each line when batch loading lines
2014-02-10 20:15:50 +00:00
Lorenz Hübschle-Schneider
32bcb1c943 Fetch more lines on request 2014-02-10 20:15:50 +00:00
Lorenz Hübschle-Schneider
6b31a3e59a Reset favico on unloading. Should resolve bookmark favicon issue.
See https://github.com/ejci/favico.js/issues/23 for detail
2014-02-10 19:26:30 +00:00
David Cormier
0107dabb2d Fix jshint errors 2014-02-09 19:40:25 -05:00
David Cormier
81054f06bd Move specific weechat websocket manipulation in glowingbear.js 2014-02-09 19:40:25 -05:00
David Cormier
a49ce938ea Add comments to websocket handlers 2014-02-09 19:40:25 -05:00
David Cormier
1da061fec2 Rename conn module to ngWebsockets 2014-02-09 19:40:25 -05:00
David Cormier
1b1b97c448 Remove unnecessary onmessage function 2014-02-09 19:40:25 -05:00
David Cormier
eddffd6e63 Remove spurious dependencies from connection 2014-02-09 19:40:25 -05:00
David Cormier
d4a4f1bd7f Create websockets module 2014-02-09 19:40:10 -05:00
Lorenz H-S
7d386f04c2 Use strict comparison operators 2014-02-08 13:20:33 +00:00
Lorenz H-S
0cd4f04740 improve spacing and other syntactical stuff 2014-02-08 13:14:23 +00:00
David Cormier
f4ee683100 Only retrieve plugin content when 'Show Content' is pressed 2014-02-06 21:21:49 -05:00
David Cormier
6b12926887 Move plugin to it's own directive 2014-02-06 21:00:07 -05:00
David Cormier
6605a49f7c Rename websockets.js to glowingbear.js 2014-02-06 20:39:58 -05:00
Renamed from js/websockets.js (Browse further)