To participate you must create an account on apostrophenow.org. If you have already done so, click Login.

Changeset 1847

Show
Ignore:
Timestamp:
07/23/10 19:06:05 (19 months ago)
Author:
johnnyoffline
Message:

cleaned up cropping somewhat with rick and jake

Location:
plugins/apostrophePlugin/branches/features/cropping
Files:
1 added
10 modified

Legend:

Unmodified
Added
Removed
  • plugins/apostrophePlugin/branches/features/cropping/lib/action/BaseaMediaActions.class.php

    r1775 r1847  
    2121    } 
    2222     
    23                 //$this->getResponse()->addStylesheet('/apostrophePlugin/css/aToolkit.css', 'first'); // Merged into a.css 2/3/2010 
    2423        $this->getResponse()->addStylesheet('/apostrophePlugin/css/a.css', 'first');     
    2524    $this->getResponse()->addJavascript('/apostrophePlugin/js/aControls.js');    
    2625    $this->getResponse()->addJavascript('/apostrophePlugin/js/aUI.js'); 
    27     $this->getResponse()->addJavascript('/apostrophePlugin/js/jquery.hotkeys-0.7.9.min.js');             
    2826        } 
    2927 
  • plugins/apostrophePlugin/branches/features/cropping/lib/toolkit/aMediaTools.php

    r1774 r1847  
    160160        "resizeType" => "s"), 
    161161    "selected_constraints" => array( 
    162         "width" => 134, 
     162        "width" => 100, 
    163163        "height" => false, 
    164164        "resizeType" => "c",), 
  • plugins/apostrophePlugin/branches/features/cropping/modules/aMedia/templates/_browser.php

    r844 r1847  
    11<?php use_helper('I18N') ?> 
     2<?php // Media is now an engine, so there's a page ?> 
     3<?php $page = aTools::getCurrentPage() ?> 
    24   
    35<?php // Entire media browser goes into what would otherwise be the regular apostrophe subnav ?> 
    46<?php slot('a-subnav') ?> 
    5  
    6 <?php // Media is now an engine, so there's a page ?> 
    7 <?php $page = aTools::getCurrentPage() ?> 
    87 
    98<?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  
    2626  // Markup change: for I18N it's better to use a list here rather than 
    2727  // trying to create a sentence with commas and 'and' 
    28   echo('<h3>' . __("Displaying only %t% with:", array('%t%' => $type), 'apostrophe') . '</h3>'); 
     28  echo('<h4>' . __("Displaying only %t% with:", array('%t%' => $type), 'apostrophe') . '</h4>'); 
    2929  echo('<ul class="a-constraints">'); 
    3030  foreach ($clauses as $clause) 
  • plugins/apostrophePlugin/branches/features/cropping/modules/aMedia/templates/_multipleList.php

    r1777 r1847  
    99        <?php $id = $item->getId() ?> 
    1010  <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> 
    1114          <li><?php echo jq_link_to_remote(__("remove this item", null, 'apostrophe'), 
    1215    array( 
     
    2225        <div class="a-media-selected-item-drag-overlay" title="<?php echo __('Drag &amp; Drop to Order', null, 'apostrophe') ?>"></div> 
    2326        <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" /> 
    2528 
    2629</li> 
  • plugins/apostrophePlugin/branches/features/cropping/modules/aMedia/templates/_selectMultiple.php

    r1774 r1847  
    1010<?php $type = "media item" ?> 
    1111<?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> 
    2613 
    2714        <ul id="a-media-selection-list"> 
     
    3017 
    3118        <?php echo jq_sortable_element("#a-media-selection-list", array("url" => "aMedia/multipleOrder")) ?> 
     19        <br class="c"/> 
    3220 
    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> 
    3432 
    3533        <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> 
    3836        </ul> 
    3937         
    4038</div> 
    41         <br class="c"/> 
    42  
     39<br class="c"/> 
  • plugins/apostrophePlugin/branches/features/cropping/modules/aMedia/templates/indexSuccess.php

    r1774 r1847  
    1212        <?php if (aMediaTools::isSelecting()): ?> 
    1313 
    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))) ?> 
    2115 
    2216        <?php endif ?> 
     
    2822<div class="a-media-library"> 
    2923         
     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         
    3030        <?php if (aMediaTools::userHasUploadPrivilege()): ?> 
    31  
    3231   <ul class="a-controls a-media-controls"> 
    3332     <?php $selecting = aMediaTools::isSelecting() ?> 
     
    4544     <li><a href="<?php echo url_for("aMedia/editPdf") ?>" class="a-btn icon big a-add"><?php echo __('Add PDF', null, 'apostrophe') ?></a></li> 
    4645     <?php endif ?> 
    47  
    4846   </ul> 
    49  
    5047  <?php endif ?> 
    5148         
  • plugins/apostrophePlugin/branches/features/cropping/modules/aSlideshowSlot/templates/_normalView.php

    r1057 r1847  
    2020              "aMediaIds" => implode(",", $itemIds), 
    2121              "type" => "image", 
    22               "label" => __("Create a Slideshow", null, 'apostrophe'), 
     22              "label" => __("You are creating a slideshow of images.", null, 'apostrophe'), 
    2323              "after" => url_for("aSlideshowSlot/edit") . "?" .  
    2424                http_build_query( 
  • plugins/apostrophePlugin/branches/features/cropping/web/css/a.css

    r1770 r1847  
    701701{ 
    702702padding: 0 !important; 
     703} 
     704 
     705.icon.a-crop 
     706{ 
     707background-image: url(/apostrophePlugin/images/a-icon-crop.png); 
    703708} 
    704709 
     
    39633968{ 
    39643969margin-bottom: 10px; 
    3965 float: left; 
    3966 display: inline; 
    39673970padding-bottom:10px; 
    3968 background-color: #eee; 
     3971padding: 10px; 
     3972margin: 0 0 20px -1px; 
     3973background-color: #efefef; 
     3974-moz-border-radius: 6px; 
     3975-webkit-border-radius: 6px; 
     3976border-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); 
     3979box-shadow: 0 0 6px rgba(0, 0, 0, 0.20); 
    39693980border: 1px solid #ccc; 
    3970 padding: 10px; 
     3981overflow: auto; 
    39713982} 
    39723983 
     
    40244035        float:left; 
    40254036        width:100%; 
    4026         margin:20px 0; 
     4037        margin:10px 0; 
    40274038} 
    40284039 
     
    40334044        width:auto; 
    40344045        height:auto; 
    4035         margin-left:160px; 
    40364046} 
    40374047li.a-media-selection-preview-item.current { 
     
    40454055        left:1px; 
    40464056        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; 
    40474071} 
    40484072 
  • plugins/apostrophePlugin/branches/features/cropping/web/js/aCrop.js

    r1777 r1847  
    2424    } 
    2525     
    26     $(aCrop.el.slideshowList).find('li').click(aCrop.thumbnailClickHandler); 
     26    $(aCrop.el.slideshowList).find('li .a-crop').click(aCrop.thumbnailClickHandler); 
    2727  }, 
    2828   
     
    4040                        return; 
    4141                } 
     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 
    4251    aCrop.api = $.Jcrop(cropEl); 
    4352    aCrop.api.setOptions({ 
    4453      allowSelect: false, 
    4554      aspectRatio: aCrop.options.aspectRatio, 
     55                        // setSelect: [0,setSelectY1,imageInfo.width,setSelectY2], 
    4656                        minSize: aCrop.options.minimumSize ? aCrop.options.minimumSize : [1,1], 
    4757      maxSize: aCrop.options.maximumSize ? aCrop.options.maximumSize : [imageInfo.width, imageInfo.height], 
     
    4959    }); 
    5060    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(); 
    5262  }, 
    5363   
     
    8797   
    8898  thumbnailClickHandler: function(e){ 
    89     var mediaId = aCrop.getMediaIdForLi(e.currentTarget); 
     99    var mediaId = aCrop.getMediaIdForLi($(e.currentTarget).parents('.a-media-selection-list-item')); 
    90100                if (mediaId) 
    91101                { 
    92102            $('#' + aCrop.el.previewList.replace('#','') + '-' + mediaId).addClass('current').siblings().removeClass('current'); 
     103                        $('.a-crop-workspace').fadeIn(); 
    93104    } 
    94105    aCrop.startCrop(); 
     
    145156      // make sure delete button is visible 
    146157      aUI("a-media-selection-list"); 
     158                        $(".a-crop-workspace").fadeTo(500,1).fadeOut(); 
    147159    }); 
    148160  }, 
     
    169181     
    170182    aCrop.api.setSelect(coords); 
     183                $(".a-crop-workspace").fadeTo(500,1).fadeOut(); 
    171184  } 
    172185}