Commit Graph

15506 Commits

Author SHA1 Message Date
Mikael Nordfeldth
d59eb5e184 Dynamically generate thumbnails (see full text)
The File object now stores width and height of files that can
supply this kind of information. Formats which we can not read
natively in PHP do not currently benefit from this. However an
event hook will be introduced later.

The CreateFileImageThumbnail event is renamed to:
CreateFileImageThumbnailSource to clarify that the hooks should not
generate their own thumbnails but only the source image. Also it now
accepts File objects, not MediaFile objects.

The thumbnail generation is documented in the source code. For
developers, call 'getThumbnail' on a File object and hope for the best.

Default thumbnail sizes have increased to be more appealing.
2014-04-21 20:46:11 +02:00
Mikael Nordfeldth
7f3611c51c use intval() instead of floor() for int return type 2014-04-21 19:32:08 +02:00
Mikael Nordfeldth
49a7cb9d84 Action->int(...) never replied with integers 2014-04-21 14:46:41 +02:00
Mikael Nordfeldth
86ddf120d7 Better event name (creating thumbnail _source_) 2014-04-21 12:33:41 +02:00
Mikael Nordfeldth
b3bf036975 Preparing File for dynamic thumbnail generation. 2014-04-21 12:33:26 +02:00
Mikael Nordfeldth
43a3f5ea90 File_oembed::saveNew are File::saveNew are static
Also did some non-backwards-compatible (to StatusNet) code cleanup.
2014-04-20 16:10:05 +02:00
Mikael Nordfeldth
72707ddc26 deprecate Notice::bestUrl() in favor of getUrl() 2014-04-20 15:28:31 +02:00
Mikael Nordfeldth
7ca6597c7f Missing semi colon in showNotice class. 2014-04-19 22:20:45 +02:00
Mikael Nordfeldth
639cf48cc7 OStatus onStartNoticeSourceLink to use exceptions 2014-04-19 22:18:36 +02:00
Mikael Nordfeldth
132be99506 Improve ShownoticeAction remote redirect code 2014-04-19 22:13:48 +02:00
Mikael Nordfeldth
454a9bc1c4 Use getUrl() instead of ->url in OembedAction 2014-04-19 22:05:44 +02:00
Mikael Nordfeldth
2c1dcc7f14 Fixes to URI/URL handling for notices 2014-04-19 22:04:52 +02:00
Mikael Nordfeldth
cecec3b088 No need for common_notice_uri anymore 2014-04-18 23:36:07 +02:00
Mikael Nordfeldth
85b022246f Handle missing URIs and URLs better 2014-04-18 23:36:01 +02:00
Mikael Nordfeldth
3e2136f222 Avoid double colon on Notice URI generation 2014-04-18 23:17:34 +02:00
Mikael Nordfeldth
e0e69ddd7c Throw exception when we can't get the url for a notice 2014-04-18 23:17:15 +02:00
Mikael Nordfeldth
7025817cc1 File_thumbnail lacked getUrl function
The only reason it worked was because DB fetches calls to get$varname if
the dataobject has a variable with the specific name. However, it started
blurting out errors that the case must be correct (which would require
'geturl' to be the function name).

Since we probably want to replace DB sometime, we'll just override this
auto-fetching mechanism and use more explicitly defined functions.
2014-04-18 23:06:28 +02:00
Mikael Nordfeldth
28dc361a15 Set new notice uri to something that's not a URL 2014-04-18 22:42:01 +02:00
Mikael Nordfeldth
37e9366e88 We get profiles directly, there's no user object anymore 2014-04-18 22:18:11 +02:00
Mikael Nordfeldth
c656b5a510 Thumbnails are not faded anymore (CSS opacity) 2014-04-18 11:10:59 +02:00
Mikael Nordfeldth
54f3b4be47 Thumbnails are now by default squares of 150px 2014-04-18 11:07:59 +02:00
Mikael Nordfeldth
07b232774d Enable square thumbnailing 2014-04-18 11:07:45 +02:00
Mikael Nordfeldth
71bda34e72 Thumbnail default set to 150px square 2014-04-17 15:15:12 +02:00
Mikael Nordfeldth
d3b4a8616d Original name preserved in uploaded file.
Avoiding collisions with date (shorter than before) and 4 character
random alphanumeric string. I bet someone could mass-upload files
and generate all combinations of aaaa-zzzz during the course of a
day, but then maybe that user should be disabled anyway :)
(filling the collision space will cause a never-ending loop).
2014-04-16 23:17:27 +02:00
Mikael Nordfeldth
5ef6ee4bc5 Better plugin description for VideoThumbnails 2014-04-16 22:12:15 +02:00
Mikael Nordfeldth
06d4cecf7f MediaFile thumbnail event hooks + VideoThumbnails plugin
The exception thrown from MediaFile will be caught and simply result in
no thumbnail at all right now. In the future we might use a catch-all
and have a "cannot generate preview"-icon or something.

VideoThumbnails requires php5-ffmpeg and php5-gd.
2014-04-16 21:48:58 +02:00
Mikael Nordfeldth
00aa3fa734 ImageFile unlink function referenced bad path 2014-04-16 20:08:21 +02:00
Mikael Nordfeldth
418b3c3c53 Some files got updated coding style
Actions have $this->scoped as the current profile which we can gladly
replace all the $cur=common_current_user() with.

And we want the prepare/handle functions to be protected. Plus only
the prepare function uses $args (which _must_ be an array).
2014-04-15 10:49:20 +02:00
Mikael Nordfeldth
90a593718f HTML5 video/audio support in attachments 2014-04-14 14:06:11 +02:00
Mikael Nordfeldth
da06350a72 Added some free codecs for media attachments 2014-04-14 13:52:03 +02:00
Mikael Nordfeldth
a2a2105058 HTML5 required attribute for some input forms 2014-04-06 11:27:41 +02:00
Mikael Nordfeldth
0777aa5487 Removed Daisychain folder, legacy stuff 2014-04-06 11:26:12 +02:00
Mikael Nordfeldth
220b51d8be Merge commit 'refs/merge-requests/199' of git://gitorious.org/statusnet/mainline into statusnet-merge-requests/199 2014-03-31 13:09:11 +02:00
Mikael Nordfeldth
710b7f61a2 Merge commit 'refs/merge-requests/12' of git://gitorious.org/statusnet/gnu-social into merge-requests/12 2014-03-31 12:36:55 +02:00
Florian Hülsmann
58d1300745 fixed config for php >=5; see php.net/array_merge 2014-03-30 16:56:48 +02:00
Mikael Nordfeldth
758ac0bdc5 Autoloaded library files do not need explicit require_once 2014-03-18 11:22:21 +01:00
Mikael Nordfeldth
d2104b89d9 Comment improvements with spl_autoload_register 2014-03-18 11:20:58 +01:00
Mikael Nordfeldth
53d54eb929 Documentation changes for source info (s/SN/GS/) 2014-03-18 11:13:47 +01:00
Mikael Nordfeldth
3d0994bcca Updating Markdown class + use spl_autoload_register
spl_autoload_register now calls the GNUsocial_class_autoload function
instead of us replacing the magic __autoload($cls). This means we can
queue up other autoload functions, such as the one now used for extlib
functions which exist directly in the 'extlib/' folder or have proper
namespacing (which our new Markdown class does).
2014-03-18 10:52:17 +01:00
Mikael Nordfeldth
7cd3879306 Merge branch 'master' of gitorious.org:statusnet/gnu-social 2014-03-15 14:06:07 +01:00
Mikael Nordfeldth
0a4e1e0f1b Revert "Don't add redundant includedir INSTALLDIR.'/extlib/'"
This reverts commit 31d8069779.

I didn't notice any errors because I had php-pear installed. :]
2014-03-15 14:04:11 +01:00
Mikael Nordfeldth
44d292b33b PEAR System.php updated to 1.9.4 2014-03-15 14:01:10 +01:00
Mikael Nordfeldth
cb3d863668 Updated and moved XMPP documentation into plugin. 2014-03-11 00:11:25 +01:00
Mikael Nordfeldth
e9e4190b64 IrcManager does not have serverError, so it must throw ServerException 2014-03-10 00:30:41 +01:00
Mikael Nordfeldth
c00491cd7a Cosmetic changes to common_redirect, clientError, serverError
Since these functions exit (or throw exception) after running, there
is no need to have a 'return' statement or similar afterwards.
2014-03-10 00:25:57 +01:00
Mikael Nordfeldth
acbe94936f common_redirect and clientError exits, so refactor
One Event would never be called, and other stuff were redundant clauses.
2014-03-10 00:24:32 +01:00
Mikael Nordfeldth
8d655bc706 Add support for 'nohub' sub_state in FeedSub
(requires upgrade.php run)
2014-03-09 23:03:54 +01:00
Mikael Nordfeldth
4f4abca338 OAuthException should be detected for autoloading
Or we may have conflicts with other filesin not in extlib.
2014-03-09 22:17:58 +01:00
Mikael Nordfeldth
31d8069779 Don't add redundant includedir INSTALLDIR.'/extlib/' 2014-03-09 22:11:08 +01:00
Mikael Nordfeldth
779ce40ac3 Add functions to avoid direct variable access 2014-03-09 13:31:05 +01:00