Changeset 27031
- Timestamp:
- 01/25/2014 07:38:12 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/js/media-models.js
r26991 r27031 78 78 * Fetches a template by id. 79 79 * See wp.template() in `wp-includes/js/wp-util.js`. 80 * 81 * @borrows wp.template as template 80 82 */ 81 83 template: wp.template, … … 86 88 * Sends a POST request to WordPress. 87 89 * See wp.ajax.post() in `wp-includes/js/wp-util.js`. 90 * 91 * @borrows wp.ajax.post as post 88 92 */ 89 93 post: wp.ajax.post, … … 94 98 * Sends an XHR request to WordPress. 95 99 * See wp.ajax.send() in `wp-includes/js/wp-util.js`. 100 * 101 * @borrows wp.ajax.send as ajax 96 102 */ 97 103 ajax: wp.ajax.send, … … 186 192 /** 187 193 * Triggered when attachment details change 194 * Overrides Backbone.Model.sync 188 195 * 189 196 * @param {string} method … … 272 279 * Convert date strings into Date objects. 273 280 * 274 * @param {Object} resp 275 * @returns {Object} 281 * @param {Object} resp The raw response object, typically returned by fetch() 282 * @returns {Object} The modified response object, which is the attributes hash 283 * to be set on the model. 276 284 */ 277 285 parse: function( resp ) { … … 285 293 }, 286 294 /** 287 * @param {Object} data 288 * @param {Object} options 295 * @param {Object} data The properties to be saved. 296 * @param {Object} options Sync options. e.g. patch, wait, success, error. 289 297 * 290 298 * @this Backbone.Model … … 310 318 }, { 311 319 /** 320 * @static 312 321 * @param {Object} attrs 313 322 * @returns {wp.media.model.Attachment} … … 317 326 }, 318 327 /** 328 * @static 319 329 * @param {string} id 320 330 * @param {Backbone.Model|undefined} attachment … … 619 629 }, 620 630 /** 621 * @param {Object} resp 622 * @param {XMLHttpRequest} xhr 623 * @returns {Array} 631 * Overrides Backbone.Collection.parse 632 * 633 * @param {Object|Array} resp The raw response Object/Array. 634 * @param {Object} xhr 635 * @returns {Array} The array of model attributes to be added to the collection 624 636 */ 625 637 parse: function( resp, xhr ) { … … 691 703 }, { 692 704 /** 705 * @static 693 706 * @param {Backbone.Model} a 694 707 * @param {Backbone.Model} b … … 717 730 return ( 'DESC' === order ) ? compare( a, b, ac, bc ) : compare( b, a, bc, ac ); 718 731 }, 719 732 /** 733 * @namespace 734 */ 720 735 filters: { 721 736 /** 737 * @static 722 738 * Note that this client-side searching is *not* equivalent 723 739 * to our server-side searching. 724 740 * 725 741 * @param {wp.media.model.Attachment} attachment 742 * 743 * @this wp.media.model.Attachments 744 * 726 745 * @returns {Boolean} 727 746 */ … … 737 756 }, 738 757 /** 758 * @static 739 759 * @param {wp.media.model.Attachment} attachment 760 * 761 * @this wp.media.model.Attachments 762 * 740 763 * @returns {Boolean} 741 764 */ … … 745 768 }, 746 769 /** 770 * @static 747 771 * @param {wp.media.model.Attachment} attachment 772 * 773 * @this wp.media.model.Attachments 774 * 748 775 * @returns {Boolean} 749 776 */ … … 760 787 761 788 /** 789 * @static 762 790 * @member {wp.media.model.Attachments} 763 791 */ … … 878 906 }, 879 907 /** 908 * Overrides Backbone.Collection.sync 909 * Overrides wp.media.model.Attachments.sync 910 * 880 911 * @param {String} method 881 912 * @param {Backbone.Model} model … … 916 947 } 917 948 }, { 949 /** 950 * @readonly 951 */ 918 952 defaultProps: { 919 953 orderby: 'date', 920 954 order: 'DESC' 921 955 }, 922 956 /** 957 * @readonly 958 */ 923 959 defaultArgs: { 924 960 posts_per_page: 40 925 961 }, 926 962 /** 963 * @readonly 964 */ 927 965 orderby: { 928 966 allowed: [ 'name', 'author', 'date', 'title', 'modified', 'uploadedTo', 'id', 'post__in', 'menuOrder' ], … … 933 971 } 934 972 }, 935 973 /** 974 * @readonly 975 */ 936 976 propmap: { 937 977 'search': 's', … … 941 981 'uploadedTo': 'post_parent' 942 982 }, 943 983 /** 984 * @static 985 */ 944 986 // Caches query objects so queries can be easily reused. 945 987 get: (function(){ … … 1048 1090 * selected attachments, reset the selection. 1049 1091 * 1092 * Overrides Backbone.Collection.add 1093 * Overrides wp.media.model.Attachments.add 1094 * 1050 1095 * @param {Array} models 1051 1096 * @param {Object} options
Note: See TracChangeset
for help on using the changeset viewer.