Commit Graph

49 Commits

Author SHA1 Message Date
atimmer
1f707de9dd Docs: Improve wp-admin JSDoc structural data globally.
JSDoc takes it structural data from `@namespace`, `@lends` and `@memberOf`. This change fixes these tags for all JavaScript files in the wp-admin folder.

* Add jsdoc configuration to parse wp-admin/js files. Use `jsdoc -c jsdoc.conf.json` to generate JSDoc.
* Define all used namespaces using `@namespace`.
* Define each usage of the extend function as a prototype assignment using `@lends`.
* Add `@alias` if JSDoc cannot detect the correct name automatically.

This has previously been corrected for all `wp-includes` JavaScript files: [41351].

Props herregroen.
Fixes #42485.

Built from https://develop.svn.wordpress.org/trunk@42403


git-svn-id: http://core.svn.wordpress.org/trunk@42232 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-12-15 13:42:46 +00:00
Adam Silverstein
8a23b80b56 Docs: JSDoc improvements for namespaces.
Improve JS parsing of our inline JSDocs by introducing `@namespace`, `@lends` and `@memberOf`. Helps set the way for showing our JavaScript documentation on developer.wordpress.org, see https://meta.trac.wordpress.org/ticket/3063.

* Define all used namespaces using @namespace.
* Correctly specify in which namespace each class is using @memberOf.
* Define each usage of the extend function as a prototype assignment using @lends.
* Some comment blocks were moved to correct the parsing of certain definitions. 

Props herregroen, atimmer, netweb, SergeyBiryukov.  
Fixes #41682.

Built from https://develop.svn.wordpress.org/trunk@41351


git-svn-id: http://core.svn.wordpress.org/trunk@41184 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-08 18:42:49 +00:00
Andrew Ozz
e983399136 Media: properly refresh the position of the Plupload shim so it moves over the Select Files button or off the screen. Fixes selecting files in MS Edge on the Media grid and Media -> Add New screens.
Fixes #37039.
Built from https://develop.svn.wordpress.org/trunk@37722


git-svn-id: http://core.svn.wordpress.org/trunk@37688 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-16 04:54:29 +00:00
Dominik Schilling
e5ea82d81a Spelling: Standardize on "front end"/"back end" (noun) and "front-end"/"back-end" (adjective).
Props obrienlabs, thewanderingbrit.
Fixes #34887.
Built from https://develop.svn.wordpress.org/trunk@36709


git-svn-id: http://core.svn.wordpress.org/trunk@36676 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-02-25 12:53:27 +00:00
Scott Taylor
8ec224c2f9 Revert [34009], broke uploads.
See #24934.


Built from https://develop.svn.wordpress.org/trunk@34047


git-svn-id: http://core.svn.wordpress.org/trunk@34015 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-11 18:04:26 +00:00
Scott Taylor
da6101d311 WP Plupload: on FileUploaded, allow success and error callbacks to receive server responses after a successful upload.
Props ippetkov.
Fixes #24934.

Built from https://develop.svn.wordpress.org/trunk@34009


git-svn-id: http://core.svn.wordpress.org/trunk@33978 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-10 18:19:24 +00:00
Scott Taylor
2d1080aed1 Improve wp.Uploader documentation.
Props ericlewis.
See #30260.

Built from https://develop.svn.wordpress.org/trunk@30244


git-svn-id: http://core.svn.wordpress.org/trunk@30244 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-05 19:37:23 +00:00
Scott Taylor
fb019893f9 In wp.Uploader, when uploader:ready is triggered, set ready to true on the instance. This allows media workflows to check for an existing uploaded instance when opening.
Without this check, workflows might wait for `uploader:ready`, which could already have been fired. This would result in an unresponsive editor dropzone.

Fixes #29689.

Built from https://develop.svn.wordpress.org/trunk@29917


git-svn-id: http://core.svn.wordpress.org/trunk@29669 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-16 05:54:18 +00:00
Mark Jaquith
0d3b83551f Use HTTPS URLs for core.trac.wordpress.org
see #27115
Built from https://develop.svn.wordpress.org/trunk@29788


git-svn-id: http://core.svn.wordpress.org/trunk@29560 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-09-29 13:28:16 +00:00
Dominik Schilling
c7ec095da1 Plupload wrapper: Call init callback on PostInit event.
Fixes the background image uploader in Customizer, which was broken after [27316].

fixes #27620.
Built from https://develop.svn.wordpress.org/trunk@27933


git-svn-id: http://core.svn.wordpress.org/trunk@27763 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-03 19:44:15 +00:00
Scott Taylor
d85ac5b841 Let us pass jshint:core.
Built from https://develop.svn.wordpress.org/trunk@27693


git-svn-id: http://core.svn.wordpress.org/trunk@27532 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-24 23:02:13 +00:00
Sergey Biryukov
f20dbd9c68 Fix typo in a comment. see #25663.
Built from https://develop.svn.wordpress.org/trunk@27681


git-svn-id: http://core.svn.wordpress.org/trunk@27522 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-24 09:09:14 +00:00
Andrew Ozz
69b74a75cd Plupload: switch to urlstream upload method when the 'flash' runtime is used in non IE browsers. This ensures cookies are sent but limits the maximum file size that flash can handle.
By default only IE9 and older use flash so this change is mostly for completeness. It would affect only the (extremely rare) cases where a plugin disables the html5 runtime.
Built from https://develop.svn.wordpress.org/trunk@27662


git-svn-id: http://core.svn.wordpress.org/trunk@27505 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-23 23:45:19 +00:00
Andrew Nacin
482856e2e1 Add the ability to drag and drop files directly onto the editor.
The file will then begin to upload and the media manager will open.

props kovshenin.
see #19845.

Built from https://develop.svn.wordpress.org/trunk@27343


git-svn-id: http://core.svn.wordpress.org/trunk@27195 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-01 21:34:17 +00:00
Andrew Ozz
d896fa2487 Upgrade Plupload to 2.1.1, props kovshenin, see #25663
Built from https://develop.svn.wordpress.org/trunk@27316


git-svn-id: http://core.svn.wordpress.org/trunk@27168 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-02-27 20:01:16 +00:00
Andrew Nacin
adbf36d393 Fix JSHint errors in wp-plupload.js.
props atimmer.
fixes #26044.

Built from https://develop.svn.wordpress.org/trunk@26213


git-svn-id: http://core.svn.wordpress.org/trunk@26121 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-11-15 14:27:09 +00:00
Sergey Biryukov
8d659b278c Fix docblock formatting. fixes #25893.
Built from https://develop.svn.wordpress.org/trunk@26081


git-svn-id: http://core.svn.wordpress.org/trunk@26001 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-11-11 13:32:10 +00:00
Mark Jaquith
0e5fcefe03 Ignore failed uploads. props koopersmith. fixes #22849
git-svn-id: http://core.svn.wordpress.org/trunk@23162 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-10 22:58:28 +00:00
Andrew Nacin
c29cae34d0 Properly apply CSS and an ID attribute to the select files container. props koopersmith. fixes #22780. see #22762.
git-svn-id: http://core.svn.wordpress.org/trunk@23100 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-06 07:00:41 +00:00
Ryan Boren
52a9a8cb81 Fix uploads in IE9
Props koopersmith
fixes #22762


git-svn-id: http://core.svn.wordpress.org/trunk@23079 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-05 21:21:17 +00:00
Daryl Koopersmith
81d474cda0 Toggle display of plupload overlays when the select files button is hidden. see #22732.
git-svn-id: http://core.svn.wordpress.org/trunk@23053 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-05 00:45:21 +00:00
Ryan Boren
63662a9b7b In the QuickPress media modal, use the new post id when a post is published.
Props nacin, koopersmith
fixes #22673


git-svn-id: http://core.svn.wordpress.org/trunk@22994 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-03 07:17:10 +00:00
Andrew Nacin
d8c942f26c wp.media instead of just media. props alexkingorg, see #22676.
git-svn-id: http://core.svn.wordpress.org/trunk@22974 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-02 19:24:22 +00:00
Ryan Boren
b73c43e0e2 Update the "Uploaded to this post" filter view when uploading new files.
* Add an Attachments collection filter for uploadedTo (post_parent).
* Correct an erroneous map from the non-existent parent prop to post_parent.
* Define default menuOrder and uploadedTo props for uploading attachments.
* Unify filterable props into a single method (improving validation performance for calls to set with multiple properties).

Props koopersmith
fixes #22654


git-svn-id: http://core.svn.wordpress.org/trunk@22951 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-30 15:11:44 +00:00
Daryl Koopersmith
14af860aab Uploader: Display a more specific error message when a file exceeds the file size limit. see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22822 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-22 12:18:17 +00:00
Daryl Koopersmith
688b8de348 Media: Display WordPress and plupload error messages whenever an upload fails. see #22243, #22186, #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22818 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-22 10:56:10 +00:00
Daryl Koopersmith
1e472d8974 Media: Add global upload progress to the sidebar. see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22816 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-22 09:32:21 +00:00
Daryl Koopersmith
095093e390 Uploader: Route plupload errors to the correct handler and prevent naming conflicts. see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22789 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-21 20:17:25 +00:00
Daryl Koopersmith
46020c6dd0 Uploader: Correctly trigger error callback. see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22788 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-21 20:12:02 +00:00
Daryl Koopersmith
fd78be75d9 Media Uploader: Change an uploaded attachment's 'updating' key with the rest of the returned attributes to allow events bound to 'change:updating' to access the new properties. see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22709 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-20 11:52:08 +00:00
Daryl Koopersmith
498e4c1366 Media: Ensure variables in the attachment details template have defined defaults.
* Adds styling to the upload progress bar in the attachment details template.
* Defines the `filename` attribute when Plupload creates the client-side `Attachment` model.

fixes #22410, see #21390.


git-svn-id: http://core.svn.wordpress.org/trunk@22543 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-11 05:16:41 +00:00
Daryl Koopersmith
53ccb09bce Give media a heart transplant.
Revises the concept of the media controller and workspace views (i.e. two central points of control) to be more granular. The main media object is now the `Frame`, which is a hybrid view and state machine.

The state machine is a collection of states, which are just generic instances of `Backbone.Model`. This circumvents the problem of juggling global parameters when changing states. Each state contains its own event loop. All events are also forwarded to the frame itself (as is the case in all model/collection relationships).

The frame view contains several regions, each of which can be overridden without harming or re-rendering the other regions. These work well when used in conjunction with the state machine events.

This removes the upload sidebar (don't worry, visible upload UI will return). Drag and drop uploading still works. The ability to upload has been abstracted into its own view (instead of being attached to the central workspace view).

Editing galleries is temporarily broken — the gallery creation and editing experiences will be unified in a future patch.

Adds events to detect dragging changes in `wp.Uploader` and adds methods to detect and leverage browser support for CSS3 transitions.

see #21390, #21809.


git-svn-id: http://core.svn.wordpress.org/trunk@22320 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-10-28 23:29:17 +00:00
Daryl Koopersmith
1baac22e9d Improve the lazy instantiation of the 'wp' JavaScript variable. props evansolomon, fixes #22113.
git-svn-id: http://core.svn.wordpress.org/trunk@22126 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-10-06 00:43:36 +00:00
Daryl Koopersmith
336cd3d632 When uploading files through the Plupload bridge, attempt to detect images on upload. see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22041 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-27 05:52:42 +00:00
Daryl Koopersmith
7fb2c8b4f7 Use JS Attachment models in wp.Uploader. fixes #21868.
Moves the uploading Attachments queue from the media workspace view to the uploader itself. This ensures that all attachments are added to the central attachmnet store.

Updates wp.Uploader to pass Attachment models to callbacks instead of Plupload file objects. Attachments in the process of uploading have a reference to the file object (which can be fetched by calling `attachment.get('file');`).

Also updates the customizer to be compatible with the API changes.


git-svn-id: http://core.svn.wordpress.org/trunk@21814 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-11 16:55:58 +00:00
Daryl Koopersmith
fefc19f7be Do not instantiate a Plupload instance when the wp-plupload bridge has neither a browse button nor a dropzone. fixes #21707.
git-svn-id: http://core.svn.wordpress.org/trunk@21722 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-04 04:10:00 +00:00
Daryl Koopersmith
c2e9648620 Improve consistency in wp.Uploader callbacks; pass file objects to all handlers. see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@21656 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-29 19:56:42 +00:00
Daryl Koopersmith
0015503c26 Allow elements within a wp.Uploader dropzone to be repositioned when the drag-over class is added. fixes #21705.
git-svn-id: http://core.svn.wordpress.org/trunk@21630 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-27 22:20:23 +00:00
Andrew Nacin
2710bcade1 Switch to .min for compressed JS and CSS files.
* This moves our "development" versions from .dev.js to .js (same for css).
 * The compressed version then moves from .js to .min.js (same for css).

By switching to the standard .min convention, it sets expectations for developers,
and works nicely with existing tools such as ack.

fixes #21633.



git-svn-id: http://core.svn.wordpress.org/trunk@21592 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-23 00:04:18 +00:00
bumpbot
50b0511449 Compress scripts/styles: 3.5-alpha-21382.
git-svn-id: http://core.svn.wordpress.org/trunk@21382 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-01 02:58:20 +00:00
bumpbot
d15f104e4b Compress scripts/styles: 3.4-RC1-21015.
git-svn-id: http://core.svn.wordpress.org/trunk@21015 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-06-06 21:51:13 +00:00
bumpbot
71b00f37aa Compress scripts/styles: 3.4-beta4-20929.
git-svn-id: http://core.svn.wordpress.org/trunk@20929 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-05-26 05:58:26 +00:00
bumpbot
e12aedf713 Compress scripts/styles: 3.4-beta4-20762.
git-svn-id: http://core.svn.wordpress.org/trunk@20762 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-05-10 00:58:25 +00:00
bumpbot
572fc170fe Compress scripts/styles: 3.4-beta4-20760.
git-svn-id: http://core.svn.wordpress.org/trunk@20760 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-05-09 21:58:31 +00:00
bumpbot
f92e8411f8 Compress scripts/styles: 3.4-beta3-20578.
git-svn-id: http://svn.automattic.com/wordpress/trunk@20578 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-04-24 19:58:21 +00:00
bumpbot
ca047faab9 Compress scripts/styles: 3.4-beta2-20546.
git-svn-id: http://svn.automattic.com/wordpress/trunk@20546 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-04-20 02:58:21 +00:00
bumpbot
3c1ed96efe Compress scripts/styles: 3.4-alpha-20296.
git-svn-id: http://svn.automattic.com/wordpress/trunk@20296 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-03-28 04:58:24 +00:00
bumpbot
88fbf34f8f Compress scripts/styles: 3.4-alpha-20180.
git-svn-id: http://svn.automattic.com/wordpress/trunk@20180 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-03-15 04:15:22 +00:00
koopersmith
c06576d410 Theme Customizer: First pass for upload controls, using background image as an example. Add a wrapper for Plupload that allows for custom upload UIs. see #19910.
wp.Uploader is a wrapper that provides a simple way to upload an attachment (using the wp_ajax_upload_attachment handler). It is intentionally decoupled from the UI. When an upload succeeds, it will receive the attachment information (id, url, meta, etc) as a JSON response. If the upload fails, the wrapper handles both WordPress and plupload errors through a single handler.

As todos, we should add drag classes for the uploader dropzone and account for the rough 100mb filesize limit in most browsers. The UI for the customizer upload controls could be improved as well.

git-svn-id: http://svn.automattic.com/wordpress/trunk@20179 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-03-15 04:14:05 +00:00