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

Show
Ignore:
Timestamp:
09/08/10 15:56:27 (21 months ago)
Author:
tboutell
Message:

* The feed slot is now very, very tolerant. It accepts Twitter @usernames, partial URLs with  http:// missing, and URLs of plain old pages. If you provide the URL of a plain old page it examines that page and pulls out the first RSS feed URL referenced via a 'link' element.
* Automatic open of rich text editor when you add a rich text slot is back (this works for any slot that is correctly set up for it in the slot model class)
* Added the same feature to the RSS feed slot
* Refactored edit button JavaScript? into a.js
* The deprecated 'realSlug' property of slot components has been removed as planned. You should be using realUrl by now so your slots can be embedded in non-CMS pages

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • plugins/apostrophePlugin/trunk/modules/a/templates/_simpleEditButton.php

    r2140 r2152  
    2323 
    2424  <li> 
    25   <?php echo jq_link_to_function(isset($label) ? __($label, null, 'apostrophe') : __("edit", null, 'apostrophe'), "",  
     25  <?php // We want to eliminate jQuery helpers, but writing this link as raw HTML is tricky because ?> 
     26  <?php // of the need to quote the title option right. And link_to doesn't like '#' as a URL. So we use ?> 
     27  <?php // content_tag, Symfony's lower-level helper for outputting any tag and its content programmatically ?> 
     28  <?php echo content_tag('a', isset($label) ? a_($label) : a_("edit"),  
    2629                        array( 
     30                          'href' => '#', 
    2731                                'id' => "a-slot-edit-$pageid-$name-$permid", 
    2832                                'class' => isset($class) ? $class : 'a-btn icon a-edit',  
    29                                 'title' => isset($title) ? $title : __('Edit', null, 'apostrophe'),  
     33                                'title' => isset($title) ? $title : a_('Edit'),  
    3034  )) ?> 
    3135 
    32   <script type="text/javascript" charset="utf-8"> 
    33   <?php // TODO: Rewrite this as a button class scoped to ALL edit buttons so there's only a single instance of this Javascript ?> 
    34         $(document).ready(function() { 
    35           <?php // This is now AJAX code to load the edit view on demand ?> 
    36                 var editBtn = $('#a-slot-edit-<?php echo "$pageid-$name-$permid" ?>'); 
    37                 var editSlot = $('#a-slot-<?php echo "$pageid-$name-$permid" ?>'); 
    38                 editBtn.click(function(event){ 
    39                   if (!editSlot.children('.a-slot-content').children('.a-slot-form').length) 
    40                   { 
    41                   $.get(<?php echo json_encode(url_for($slot->type . 'Slot/ajaxEditView') . '?' . http_build_query(array('id' => $pageid, 'slot' => $name, 'permid' => $permid))) ?>, { }, function(data) {  
    42                       editSlot.children('.a-slot-content').html(data); 
    43                       apostrophe.slotShowEditView(editBtn, editSlot); 
    44                     }); 
    45                   } 
    46                   else 
    47                   { 
    48                     // Reuse edit view 
    49                       apostrophe.slotShowEditView(editBtn, editSlot); 
    50                   } 
    51                   return false; 
    52                 }); 
    53         }); 
    54   </script> 
     36  <?php a_js_call('apostrophe.slotEnableEditButton(?, ?, ?, ?)', $pageid, $name, $permid, url_for($slot->type . 'Slot/ajaxEditView')) ?> 
    5537  </li> 
    5638