Commit Graph

78 Commits

Author SHA1 Message Date
Claas Augner d5e142a336
OC.getCanonicalLocale: fix tests
Signed-off-by: Claas Augner <git@caugner.de>
2018-10-24 11:17:58 +02:00
Claas Augner 00b8be60f2
humanFileSize: use toLocaleString
humanFileSize: add test with locale
humanFileSize: use canonical locale
humanFileSize: skip test w/o toLocaleString support
humanFileSize: stub getCanonicalLocale
OC.getCanonicalLocale: cover undefined case
humanFileSize: fix getCanonicalLocale stub

Signed-off-by: Claas Augner <git@caugner.de>
2018-10-24 09:18:39 +02:00
Christoph Wurst 9af69ca2a5
Fix usage of deprecated OC.webroot
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2018-10-09 13:53:59 +02:00
Christoph Wurst b9720703e8 Add CSRF token controller to retrieve the current CSRF token
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2018-03-08 16:48:50 +01:00
Daniel Calviño Sánchez 9c22e99331 Add extra test cases for password confirmation
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-01-10 16:42:25 +01:00
Abijeet b246ca96ff Added test cases for the fix for the password confirmation box appearing repeatedly.
Signed-off-by: Abijeet <abijeetpatro@gmail.com>
2018-01-10 16:41:27 +01:00
Daniel Calviño Sánchez de4028336a Force the drag to end when the navigation bar Snap is disabled by an app
When a Snap was disabled it stopped listening to the events, but if a
drag gesture was being performed it was kept as active. Thus, when the
Snap was enabled again move events were handled as if the Snap had never
been disabled, causing the gesture handling to continue where it was
left.

When the Snap for the navigation bar is disabled by an app it could be
as a result of a different gesture being recognized by the app (for
example, a vertical swipe) once both gestures have started. In that case
when the other gesture ends and the Snap is enabled again any pointer
movement will cause the navigation bar to slide until an "up" event is
triggered again (obviously not the desired behaviour).

Due to all this now when the Snap for the navigation bar is disabled by
an app the current drag gesture for the navigation bar is ended.

Note that this was added as a parameter to "Snap.disable()" instead of
done unconditionally to keep back-compatibility with the previous
behaviour (probably not really needed as it is unlikely that any app is
using the Snap library relying on that behaviour... but just in case).

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2017-12-14 21:42:39 +01:00
Daniel Calviño Sánchez a5db0d2825 Make possible for apps to disallow the navigation bar slide gesture
On narrow screens a slide gesture can be used to open or close the
navigation bar. However that gesture could conflict at times with the
gestures used by certain apps (for example, if the right sidebar is open
the user may expect to close it by dragging it to the right, but that
could open the navigation bar instead depending on how the events are
handled). This commit makes possible for apps to disallow and allow
again that slide gesture.

In any case, note that applications can only disallow the gesture,
but they can not enable it. That is, they can prevent the gesture from
being used on narrow screens, but they can not make the gesture work on
wide screens; they are always limited by the base rules set by the core.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2017-12-14 21:41:22 +01:00
Daniel Calviño Sánchez 173f28a09d Add unit tests for the navigation bar slide gesture
The slide gesture is enabled or disabled depending on the width of the
browser window. In order to easily control that width the karma-viewport
plugin is now used in the unit tests.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2017-12-14 19:17:40 +01:00
Morris Jobke d790c27a19
Reduce JSHint errors/warnings
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-11-06 09:57:59 +01:00
Morris Jobke 413d671d9e Merge pull request #3635 from individual-it/fix_quota_validation
better quota validation
2017-02-28 00:27:51 -06:00
Artur Neumann 9790fe7f5d make values with white spaces possible
a user might enter values with white spaces, and that should be possible
and valid

Signed-off-by: Artur Neumann <info@individual-it.net>
2017-02-28 08:25:34 +05:45
Artur Neumann f1fccaca06 better quota validation
this fixes #3634

1. fixed computerFileSize to be more picky about incorrect values
2. more tests for computerFileSize
3. use computerFileSize to validate user quota

Signed-off-by: Artur Neumann <info@individual-it.net>
2017-02-28 07:38:11 +05:45
m3ntalsp00n dd9ee2db6f fix tests, longer wait time, update notification stub
Signed-off-by: m3ntalsp00n <m3ntalsp00n@gmail.com>
2017-02-04 18:51:52 +10:00
Christoph Wurst da28a1612e expect warning to be shown
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2017-01-13 11:33:12 +01:00
Patrick Paysant d4c088cb79
Verify input, add more unit tests
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2016-12-19 17:29:20 +01:00
Patrick Paysant ec4bca619d
Add test for unparseable string
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2016-12-19 17:29:13 +01:00
Patrick Paysant ff018d48cf
Implements all comments from @PVince81
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2016-12-19 17:29:05 +01:00
Patrick Paysant 6217393d6a
Adding computerFileSize in OC.Util
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2016-12-19 17:28:58 +01:00
Robin Appelman e055fbd4da
adjust js tests
Signed-off-by: Robin Appelman <robin@icewind.nl>
2016-12-02 13:40:23 +01:00
Vincent Petry 25d9dce067
JS utility function to compare paths
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2016-10-24 21:45:00 +02:00
Christoph Wurst 5ae6d62811
do not reload the page if the server is (temporarily) unreachable 2016-10-03 10:24:47 +02:00
Hendrik Leppelsack 61e604c2d9 adjusts tests to removal of svg fallback 2016-07-01 16:36:37 +02:00
Lukas Reschke 2c4ef37025 Merge pull request #24126 from owncloud/err-reload-delay
Delay reloading the page if an ajax error occurs, show notification
2016-04-22 11:23:39 +02:00
Robin McCorkell 62024d74d4 Add test for reload delay 2016-04-20 22:09:59 +01:00
Morris Jobke 6b66f2dfb4 Merge pull request #23990 from owncloud/heartbeat-debounce
Debounce heartbeat ajax calls to lower the number of requests
2016-04-20 21:23:10 +02:00
Christoph Wurst 2d772eaaa8
Debounce heartbeat ajax calls to lower the number of requests
fixes #22397
2016-04-18 14:19:26 +02:00
Christoph Wurst 5900e46f01
Turn off jQuery animations when testing 2016-04-18 10:41:02 +02:00
Christoph Wurst 3e1f1ccc76 downgrade jquery, update jquery-migrate 2016-04-15 13:55:23 +02:00
Vincent Petry 06e7856400 Adjust core unit tests for unload/reload cases 2016-03-23 10:53:40 +01:00
Vincent Petry 8ea80e114a Accumulate notifications instead of blinking
This makes it possible to display multiple notifications.
If the options.type is set to "error", it will also add a close button.
2016-02-22 17:25:32 +01:00
Vincent Petry b8b77709c0 Add handler for global ajax errors 2016-02-15 12:48:47 +01:00
Morris Jobke 6e096936e5 update JS humanFileSize to use KB instead of kB 2016-01-19 10:51:57 +01:00
Joas Schilling f04151f69b Close the user menu when clicking it again 2015-11-02 10:09:13 +01:00
Vincent Petry 1b7d42c569 Fix OC.joinPaths with empty arguments
When empty arguments are given, the leading or trailing slash was not
detected properly.
2015-07-13 10:57:52 +02:00
Vincent Petry fbc03b43b9 More tests for joinPaths 2015-07-10 15:31:58 +02:00
Vincent Petry 119e27166e Add OC.joinPaths for convenient path joining 2015-07-10 13:02:28 +02:00
Jan-Christoph Borchardt d1db727d1f mock up missing elements in the tests 2015-03-26 17:13:50 +01:00
Lukas Reschke 27c1409be5 Encode parameters in `OC.generateUrl` by itself
This function is often used in a wrong and potential dangerous way... Thus we should escape the URL per default and offer developers to disable the automatic escaping via an option parameter if they really want that behaviour.

Might break some things, however, those things are then easy to fix and we really have a ton of bugs caused by this...

Fixes https://github.com/owncloud/core/issues/14228
2015-02-17 14:41:06 +01:00
Thomas Müller ccc1f09627 generate valid human readable text for 0 - fixed #9342 2015-01-29 17:27:28 +01:00
Morris Jobke 8e1904386f Add timeout for notifications
* options for timeout in seconds and if it contains HTML
* if timeout is 0 it will show the message permanently
* removes the notification after a given (default: 5 seconds) timeframe
* based on work by @brantje
* provide JS unit tests for notifications
2015-01-08 13:06:45 +01:00
Vincent Petry c02ef69521 Simple Plugin system for Javascript 2014-12-01 16:20:44 +01:00
Lukas Reschke d2743e6ad6 Merge pull request #7254 from owncloud/core-sortalgo
Fixed JS sort comparator to be consistent between JS and PHP
2014-09-16 17:29:03 +02:00
Thomas Müller fd92fc7c47 Merge pull request #9753 from owncloud/filepath-css
Remove special case for css in OC.filePath
2014-09-09 13:59:19 +02:00
Lukas Reschke e3c99a8505 Add beforeeach and aftereach 2014-09-09 13:08:50 +02:00
Lukas Reschke cabd70148f Add unittest for filePath 2014-09-09 12:05:19 +02:00
Clark Tomlinson ba0e65753b Init vars with a value if none is provided 2014-08-28 13:53:45 -04:00
Vincent Petry f2001a48a4 Fixed sort algo for additional cases 2014-08-11 13:28:53 +02:00
Vincent Petry 173059f6d0 Fixed file list sorting
Now using a natural sort algorithm that is more consistent between JS
and PHP (although not perfect in some corner cases)

- added OC.Util.naturalSortComparator that uses the same algo that was
  used for the user list
- changed user list and files list to use OC.Util.naturalSortComparator
- removed toLowerCase() and changed the comparator to use
  String.localeCompare()
- added unit tests
- added OC_NaturalSort that is used by OCP\Util::naturalSortCompare()
2014-08-11 13:28:53 +02:00
Vincent Petry 4fea521102 Fix enforced share expiration date to be based on share time 2014-07-21 15:01:20 +02:00