Changeset 1847
- Timestamp:
- 07/23/10 19:06:05 (19 months ago)
- Location:
- plugins/apostrophePlugin/branches/features/cropping
- Files:
-
- 1 added
- 10 modified
-
lib/action/BaseaMediaActions.class.php (modified) (1 diff)
-
lib/toolkit/aMediaTools.php (modified) (1 diff)
-
modules/aMedia/templates/_browser.php (modified) (1 diff)
-
modules/aMedia/templates/_describeConstraints.php (modified) (1 diff)
-
modules/aMedia/templates/_multipleList.php (modified) (2 diffs)
-
modules/aMedia/templates/_selectMultiple.php (modified) (2 diffs)
-
modules/aMedia/templates/indexSuccess.php (modified) (3 diffs)
-
modules/aSlideshowSlot/templates/_normalView.php (modified) (1 diff)
-
web/css/a.css (modified) (5 diffs)
-
web/images/a-icon-crop.png (added)
-
web/js/aCrop.js (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
plugins/apostrophePlugin/branches/features/cropping/lib/action/BaseaMediaActions.class.php
r1775 r1847 21 21 } 22 22 23 //$this->getResponse()->addStylesheet('/apostrophePlugin/css/aToolkit.css', 'first'); // Merged into a.css 2/3/201024 23 $this->getResponse()->addStylesheet('/apostrophePlugin/css/a.css', 'first'); 25 24 $this->getResponse()->addJavascript('/apostrophePlugin/js/aControls.js'); 26 25 $this->getResponse()->addJavascript('/apostrophePlugin/js/aUI.js'); 27 $this->getResponse()->addJavascript('/apostrophePlugin/js/jquery.hotkeys-0.7.9.min.js');28 26 } 29 27 -
plugins/apostrophePlugin/branches/features/cropping/lib/toolkit/aMediaTools.php
r1774 r1847 160 160 "resizeType" => "s"), 161 161 "selected_constraints" => array( 162 "width" => 1 34,162 "width" => 100, 163 163 "height" => false, 164 164 "resizeType" => "c",), -
plugins/apostrophePlugin/branches/features/cropping/modules/aMedia/templates/_browser.php
r844 r1847 1 1 <?php use_helper('I18N') ?> 2 <?php // Media is now an engine, so there's a page ?> 3 <?php $page = aTools::getCurrentPage() ?> 2 4 3 5 <?php // Entire media browser goes into what would otherwise be the regular apostrophe subnav ?> 4 6 <?php slot('a-subnav') ?> 5 6 <?php // Media is now an engine, so there's a page ?>7 <?php $page = aTools::getCurrentPage() ?>8 7 9 8 <?php // For backwards compatibility reasons it is best to implement these as before and after partials ?> -
plugins/apostrophePlugin/branches/features/cropping/modules/aMedia/templates/_describeConstraints.php
r1510 r1847 26 26 // Markup change: for I18N it's better to use a list here rather than 27 27 // trying to create a sentence with commas and 'and' 28 echo('<h 3>' . __("Displaying only %t% with:", array('%t%' => $type), 'apostrophe') . '</h3>');28 echo('<h4>' . __("Displaying only %t% with:", array('%t%' => $type), 'apostrophe') . '</h4>'); 29 29 echo('<ul class="a-constraints">'); 30 30 foreach ($clauses as $clause) -
plugins/apostrophePlugin/branches/features/cropping/modules/aMedia/templates/_multipleList.php
r1777 r1847 9 9 <?php $id = $item->getId() ?> 10 10 <ul class="a-controls a-media-multiple-list-controls"> 11 <li> 12 <a href="#crop" onclick="return false;" class="a-btn icon a-crop no-label">Crop</a> 13 </li> 11 14 <li><?php echo jq_link_to_remote(__("remove this item", null, 'apostrophe'), 12 15 array( … … 22 25 <div class="a-media-selected-item-drag-overlay" title="<?php echo __('Drag & Drop to Order', null, 'apostrophe') ?>"></div> 23 26 <div class="a-media-selected-item-overlay"></div> 24 <img src="<?php echo url_for($item->getCropThumbnailUrl()) ?>" />27 <img src="<?php echo url_for($item->getCropThumbnailUrl()) ?>" class="a-thumbnail" /> 25 28 26 29 </li> -
plugins/apostrophePlugin/branches/features/cropping/modules/aMedia/templates/_selectMultiple.php
r1774 r1847 10 10 <?php $type = "media item" ?> 11 11 <?php endif ?> 12 <p><?php echo __('Select one or more %typeplural% by clicking on them below. Drag and drop %typeplural% to reorder them within the list of selected items. Remove %typeplural% by clicking on the trashcan.', array('%typeplural%' => __($type . 's')), 'apostrophe') ?> 13 <?php if ($limitSizes): ?> 14 <?php echo __('Only appropriately sized %typeplural% are shown.', array('%typeplural%' => __($type . 's')), 'apostrophe') ?> 15 <?php endif ?> 16 <?php echo __('When you\'re done, click "Save."', null, 'apostrophe') ?></p> 17 18 <ul id="a-media-selection-preview"> 19 <?php include_partial("aMedia/multiplePreview", array("items" => $items)) ?> 20 </ul> 21 22 <ul class="a-controls a-media-crop-controls"> 23 <li><?php echo jq_link_to_function(__("Set Crop", null, 'apostrophe'), "aCrop.setCrop('".url_for('aMedia/crop')."')", array("class"=>"a-btn save")) ?></li> 24 <li><?php echo jq_link_to_function(__("Reset", null, 'apostrophe'), "aCrop.resetCrop()", array("class"=>"a-btn icon a-cancel event-default")) ?></li> 25 </ul> 12 <h3><?php echo $label ?></h3> 26 13 27 14 <ul id="a-media-selection-list"> … … 30 17 31 18 <?php echo jq_sortable_element("#a-media-selection-list", array("url" => "aMedia/multipleOrder")) ?> 19 <br class="c"/> 32 20 33 <br class="c"/> 21 <div class="a-crop-workspace"> 22 <h4> Crop Image </h4> 23 <br class="c"/> 24 <ul id="a-media-selection-preview"> 25 <?php include_partial("aMedia/multiplePreview", array("items" => $items)) ?> 26 </ul> 27 <ul class="a-controls a-media-crop-controls"> 28 <li><?php echo jq_link_to_function(__("Set Crop", null, 'apostrophe'), "aCrop.setCrop('".url_for('aMedia/crop')."')", array("class"=>"a-btn save")) ?></li> 29 <li><?php echo jq_link_to_function(__("Reset", null, 'apostrophe'), "aCrop.resetCrop()", array("class"=>"a-btn icon a-cancel event-default")) ?></li> 30 </ul> 31 </div> 34 32 35 33 <ul class="a-controls a-media-slideshow-controls"> 36 <li><?php echo link_to(__("Save ", null, 'apostrophe'), "aMedia/selected", array("class"=>"a-btn save")) ?></li>37 <li><?php echo link_to(__("Cancel", null, 'apostrophe'), "aMedia/selectCancel", array("class"=>"a-btn icon a-cancel event-default")) ?></li>34 <li><?php echo link_to(__("Save Slideshow", null, 'apostrophe'), "aMedia/selected", array("class"=>"a-btn save big")) ?></li> 35 <li><?php echo link_to(__("Cancel", null, 'apostrophe'), "aMedia/selectCancel", array("class"=>"a-btn icon a-cancel big no-label")) ?></li> 38 36 </ul> 39 37 40 38 </div> 41 <br class="c"/> 42 39 <br class="c"/> -
plugins/apostrophePlugin/branches/features/cropping/modules/aMedia/templates/indexSuccess.php
r1774 r1847 12 12 <?php if (aMediaTools::isSelecting()): ?> 13 13 14 <?php if (isset($label)): ?> 15 <h3><?php echo htmlspecialchars($label) ?> or <?php echo link_to(__("Cancel", null, 'apostrophe'), "aMedia/selectCancel", array("class"=>"a-btn a-cancel text-only")) ?></h3> 16 <?php endif ?> 17 18 <?php include_partial('aMedia/describeConstraints') ?> 19 20 <?php include_component('aMedia', 'selectMultiple', array('limitSizes' => $limitSizes)) ?> 14 <?php include_component('aMedia', 'selectMultiple', array('limitSizes' => $limitSizes, 'label' => (isset($label)?$label:null))) ?> 21 15 22 16 <?php endif ?> … … 28 22 <div class="a-media-library"> 29 23 24 <h3>Media Library</h3> 25 26 <?php if ($limitSizes): ?> 27 <h4 class="a-help"><?php echo __('Some %typeplural% in your media library may not be large enough to be selected. Only %typeplural% that can be used are displayed currently.', array('%typeplural%' => __($type . 's')), 'apostrophe') ?></h4> 28 <?php endif ?> 29 30 30 <?php if (aMediaTools::userHasUploadPrivilege()): ?> 31 32 31 <ul class="a-controls a-media-controls"> 33 32 <?php $selecting = aMediaTools::isSelecting() ?> … … 45 44 <li><a href="<?php echo url_for("aMedia/editPdf") ?>" class="a-btn icon big a-add"><?php echo __('Add PDF', null, 'apostrophe') ?></a></li> 46 45 <?php endif ?> 47 48 46 </ul> 49 50 47 <?php endif ?> 51 48 -
plugins/apostrophePlugin/branches/features/cropping/modules/aSlideshowSlot/templates/_normalView.php
r1057 r1847 20 20 "aMediaIds" => implode(",", $itemIds), 21 21 "type" => "image", 22 "label" => __(" Create a Slideshow", null, 'apostrophe'),22 "label" => __("You are creating a slideshow of images.", null, 'apostrophe'), 23 23 "after" => url_for("aSlideshowSlot/edit") . "?" . 24 24 http_build_query( -
plugins/apostrophePlugin/branches/features/cropping/web/css/a.css
r1770 r1847 701 701 { 702 702 padding: 0 !important; 703 } 704 705 .icon.a-crop 706 { 707 background-image: url(/apostrophePlugin/images/a-icon-crop.png); 703 708 } 704 709 … … 3963 3968 { 3964 3969 margin-bottom: 10px; 3965 float: left;3966 display: inline;3967 3970 padding-bottom:10px; 3968 background-color: #eee; 3971 padding: 10px; 3972 margin: 0 0 20px -1px; 3973 background-color: #efefef; 3974 -moz-border-radius: 6px; 3975 -webkit-border-radius: 6px; 3976 border-radius: 6px; 3977 -moz-box-shadow: 0 0 6px rgba(0, 0, 0, 0.20); 3978 -webkit-box-shadow: 0 0 6px rgba(0, 0, 0, 0.20); 3979 box-shadow: 0 0 6px rgba(0, 0, 0, 0.20); 3969 3980 border: 1px solid #ccc; 3970 padding: 10px;3981 overflow: auto; 3971 3982 } 3972 3983 … … 4024 4035 float:left; 4025 4036 width:100%; 4026 margin: 20px 0;4037 margin:10px 0; 4027 4038 } 4028 4039 … … 4033 4044 width:auto; 4034 4045 height:auto; 4035 margin-left:160px;4036 4046 } 4037 4047 li.a-media-selection-preview-item.current { … … 4045 4055 left:1px; 4046 4056 width: 150px; 4057 } 4058 4059 .a-crop-workspace 4060 { 4061 overflow: hidden; 4062 display: none; 4063 width: 100%; 4064 margin: 20px 0 20px -10px; 4065 padding: 10px; 4066 } 4067 4068 .a-crop-workspace h4 4069 { 4070 color:#ddd; 4047 4071 } 4048 4072 -
plugins/apostrophePlugin/branches/features/cropping/web/js/aCrop.js
r1777 r1847 24 24 } 25 25 26 $(aCrop.el.slideshowList).find('li ').click(aCrop.thumbnailClickHandler);26 $(aCrop.el.slideshowList).find('li .a-crop').click(aCrop.thumbnailClickHandler); 27 27 }, 28 28 … … 40 40 return; 41 41 } 42 43 // TODO: Make this work -- 44 // This would set the initial crop selection to be the maximum size, centered for the image being cropped 45 // This would work except it's using the full image dimensions, not the dimensions of the crop image workspace 46 // setSelectCenter = imageInfo.height / 2; 47 // setSelectHeight = imageInfo.width * aCrop.options.aspectRatio; 48 // setSelectY1 = setSelectHeight / 2; 49 // setSelectY2 = setSelectY1 + setSelectHeight; 50 42 51 aCrop.api = $.Jcrop(cropEl); 43 52 aCrop.api.setOptions({ 44 53 allowSelect: false, 45 54 aspectRatio: aCrop.options.aspectRatio, 55 // setSelect: [0,setSelectY1,imageInfo.width,setSelectY2], 46 56 minSize: aCrop.options.minimumSize ? aCrop.options.minimumSize : [1,1], 47 57 maxSize: aCrop.options.maximumSize ? aCrop.options.maximumSize : [imageInfo.width, imageInfo.height], … … 49 59 }); 50 60 aCrop.setAspectMask(cropEl); 51 $('.a-media-crop-controls').clone().appendTo('.jcrop-holder div:first').show();61 // $('.a-media-crop-controls').appendTo('.jcrop-holder div:first').show(); 52 62 }, 53 63 … … 87 97 88 98 thumbnailClickHandler: function(e){ 89 var mediaId = aCrop.getMediaIdForLi( e.currentTarget);99 var mediaId = aCrop.getMediaIdForLi($(e.currentTarget).parents('.a-media-selection-list-item')); 90 100 if (mediaId) 91 101 { 92 102 $('#' + aCrop.el.previewList.replace('#','') + '-' + mediaId).addClass('current').siblings().removeClass('current'); 103 $('.a-crop-workspace').fadeIn(); 93 104 } 94 105 aCrop.startCrop(); … … 145 156 // make sure delete button is visible 146 157 aUI("a-media-selection-list"); 158 $(".a-crop-workspace").fadeTo(500,1).fadeOut(); 147 159 }); 148 160 }, … … 169 181 170 182 aCrop.api.setSelect(coords); 183 $(".a-crop-workspace").fadeTo(500,1).fadeOut(); 171 184 } 172 185 }

