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

Changeset 1093

Show
Ignore:
Timestamp:
04/29/10 13:14:24 (22 months ago)
Author:
johnnyoffline
Message:

made the Publish button a status message

Location:
plugins/apostropheBlogPlugin/trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • plugins/apostropheBlogPlugin/trunk/modules/aBlogAdmin/templates/_form.php

    r1003 r1093  
    2020<?php // Huge Publish Button and Publish Date ?> 
    2121<div class="published section"> 
    22         <a href="#" class="a-btn big a-publish-post <?php echo ($a_blog_post['status'] == 'published')? 'published':'' ?>" onclick="return false;"> 
     22        <a href="#" class="a-btn big a-publish-post <?php echo ($a_blog_post['status'] == 'published')? 'published':'' ?>" onclick="return false;" id="a-blog-publish-button"> 
    2323          <span class="publish"><?php echo __('Publish', array(), 'apostrophe_blog') ?></span> 
    2424          <span class="unpublish"><?php echo __('Unpublish', array(), 'apostrophe_blog') ?></span> 
     25                <span class="message"></span> 
    2526        </a> 
    2627 
  • plugins/apostropheBlogPlugin/trunk/web/css/aBlog.css

    r1091 r1093  
    669669} 
    670670 
     671.a-btn.a-publish-post.status 
     672{ 
     673color: #fff !important; 
     674text-shadow: 0 1px rgba(0,0,0,0.55) !important; 
     675} 
     676 
     677.a-btn.a-publish-post.highlight 
     678{ 
     679        background-color: #ac3; 
     680} 
     681 
     682.a-btn.a-publish-post .message, 
    671683.a-btn.a-publish-post .unpublish, 
    672684.a-btn.a-publish-post.published .publish 
     
    676688 
    677689.a-btn.a-publish-post .publish, 
    678 .a-btn.a-publish-post.published .unpublish 
     690.a-btn.a-publish-post.published .unpublish, 
     691.a-btn.a-publish-post.status .message 
    679692{ 
    680693display: inline; 
     
    685698color: #000 !important; 
    686699} 
     700 
    687701 
    688702/* Editor Status Messages */ 
  • plugins/apostropheBlogPlugin/trunk/web/js/aBlog.js

    r1067 r1093  
    55         
    66        var postStatus = $('#a_blog_post_status'); 
    7         var publishButton = $('#a-admin-form a.a-publish-post'); 
     7        var publishButton = $('#a-blog-publish-button'); 
    88 
    99        if (status == 'published') { 
     
    1818                        postStatus.val('published'); 
    1919                        publishButton.addClass('published');                     
    20                         sendUserMessage('','Your post is now published.');                       
    2120                } 
    2221                else 
     
    2423                        postStatus.val('draft'); 
    2524                        publishButton.removeClass('published');                  
    26                         sendUserMessage('','You unpublished your post.');                        
    2725                }; 
    2826                 
     
    7371                        checkAndSetPublish(data.aBlogPost.status, slug_url); // Re-set Publish button after ajax 
    7472      updateTitleAndSlug(data.aBlogPost.title, data.aBlogPost.slug); // Update Title and Slug after ajax 
    75                          
     73                        updateMessage(); 
    7674                        aUI('#a-admin-form'); 
    7775      } 
     
    126124        { 
    127125                $('.section.comments .allow_comments_toggle').addClass('enabled').removeClass('disabled'); 
    128                 sendUserMessage('Comments Enabled','Viewers can leave comments on this blog post.'); 
    129126        } 
    130127        else 
    131128        { 
    132129                $('.section.comments .allow_comments_toggle').addClass('disabled').removeClass('enabled');               
    133                 sendUserMessage('Disabled Comments','Viewers of this blog post cannot comment on it.'); 
    134130        } 
    135131} 
     
    138134{ 
    139135        location.reload(true); 
    140         // sendUserMessage(feedback); // See sendUserMessage function below  
    141136} 
    142137 
    143 // Send a message to the blog editor confirming a change made via Ajax 
     138function updateMessage(msg) 
     139{ 
     140        if (typeof msg == 'undefined') { 
     141                msg = 'Saved!'; 
     142        }; 
     143 
     144        var publishButton = $('#a-blog-publish-button'); 
     145 
     146        publishButton.children('.message').text(msg).show().siblings(':not(".message")').hide(); 
     147         
     148        publishButton.addClass('status').addClass('highlight', 500, function() 
     149        { 
     150                publishButton.fadeTo(500,1).removeClass('highlight', 200, function() 
     151                { 
     152                        publishButton.removeClass('status'); 
     153                        if (publishButton.hasClass('published'))  
     154                        { 
     155                                publishButton.children('.publish').show(); 
     156                        } 
     157                        else 
     158                        { 
     159                                publishButton.children('.unpublish').show();                             
     160                        }; 
     161                        publishButton.children('.message').hide();                       
     162                }); 
     163        }); 
     164} 
     165 
    144166function sendUserMessage(label, desc) 
    145167{        
    146168        // Messages are turned off for now! 
     169        // Send a message to the blog editor confirming a change made via Ajax 
    147170         
    148171        // var mLabel = (label)?label.toString():""; // passed from ajaxAction