Changeset 22658
- Timestamp:
- 11/19/2012 03:11:48 AM (12 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/js/media-views.js
r22656 r22658 1092 1092 createStates: function() { 1093 1093 var options = this.options, 1094 main, gallery , batch;1094 main, gallery; 1095 1095 1096 1096 main = { … … 1109 1109 toolbar: 'gallery-add', 1110 1110 excludeState: 'gallery-edit' 1111 };1112 1113 batch = {1114 multiple: true,1115 menu: 'batch',1116 toolbar: 'batch-add',1117 excludeState: 'batch-edit'1118 1111 }; 1119 1112 … … 1146 1139 new media.controller.Upload( _.defaults({ 1147 1140 id: 'gallery-upload' 1148 }, gallery ) ), 1149 1150 // Batch states. 1151 new media.controller.Library({ 1152 id: 'batch-edit', 1153 multiple: false, 1154 describe: true, 1155 edge: 199, 1156 sortable: true, 1157 searchable: false, 1158 menu: 'batch', 1159 toolbar: 'batch-edit', 1160 sidebar: 'attachment-settings' 1161 }), 1162 1163 new media.controller.Library( _.defaults({ 1164 id: 'batch-library', 1165 library: media.query({ type: 'image' }) 1166 }, batch ) ), 1167 1168 new media.controller.Upload( _.defaults({ 1169 id: 'batch-upload' 1170 }, batch ) ) 1141 }, gallery ) ) 1171 1142 ]); 1172 1143 }, … … 1177 1148 var handlers = { 1178 1149 menu: { 1179 'batch': 'batchMenu',1180 1150 'gallery': 'galleryMenu' 1181 1151 }, … … 1193 1163 'main-attachments': 'mainAttachmentsToolbar', 1194 1164 'main-embed': 'mainEmbedToolbar', 1195 'batch-edit': 'batchEditToolbar',1196 'batch-add': 'batchAddToolbar',1197 1165 'gallery-edit': 'galleryEditToolbar', 1198 1166 'gallery-add': 'galleryAddToolbar' … … 1223 1191 } 1224 1192 }); 1225 },1226 1227 batchMenu: function() {1228 var previous = this.previous(),1229 frame = this;1230 1231 this.menu.view( new media.view.Menu({1232 controller: this,1233 views: {1234 cancel: {1235 text: l10n.cancelBatchTitle,1236 priority: 20,1237 click: function() {1238 if ( previous )1239 frame.state( previous );1240 else1241 frame.close();1242 }1243 },1244 separateCancel: new media.View({1245 className: 'separator',1246 priority: 401247 }),1248 'batch-edit': {1249 text: l10n.editBatchTitle,1250 priority: 601251 },1252 'batch-upload': {1253 text: l10n.uploadFilesTitle,1254 priority: 801255 },1256 'batch-library': {1257 text: l10n.mediaLibraryTitle,1258 priority: 1001259 }1260 }1261 }) );1262 1193 }, 1263 1194 … … 1398 1329 }, 1399 1330 1400 batchEditToolbar: function() {1401 this.toolbar.view( new media.view.Toolbar({1402 controller: this,1403 items: {1404 insert: {1405 style: 'primary',1406 text: l10n.insertIntoPost,1407 priority: 80,1408 1409 click: function() {1410 var controller = this.controller,1411 state = controller.state();1412 1413 controller.close();1414 state.trigger( 'insert', state.get('library') );1415 1416 controller.reset();1417 // @todo: Make the state activated dynamic (instead of hardcoded).1418 controller.state('upload');1419 }1420 }1421 }1422 }) );1423 },1424 1425 batchAddToolbar: function() {1426 this.toolbar.view( new media.view.Toolbar({1427 controller: this,1428 items: {1429 insert: {1430 style: 'primary',1431 text: l10n.addToBatch,1432 priority: 80,1433 1434 click: function() {1435 var controller = this.controller,1436 state = controller.state(),1437 edit = controller.get('batch-edit');1438 1439 edit.get('library').add( state.get('selection').models );1440 state.trigger('reset');1441 controller.state('batch-edit');1442 }1443 }1444 }1445 }) );1446 },1447 1448 1331 galleryEditToolbar: function() { 1449 1332 var editing = this.state().get('editing'); -
trunk/wp-includes/media.php
r22648 r22658 1362 1362 'insertEmbed' => __( 'Insert embed' ), 1363 1363 1364 // Batch1365 'batchInsert' => __( 'Batch insert' ),1366 'cancelBatchTitle' => __( '← Cancel Batch' ),1367 'editBatchTitle' => __( 'Edit Batch' ),1368 'addToBatch' => __( 'Add to batch' ),1369 1370 1364 // Gallery 1371 1365 'createGalleryTitle' => __( 'Create Gallery' ),
Note: See TracChangeset
for help on using the changeset viewer.