Changeset 1736

Show
Ignore:
Timestamp:
05/17/08 01:55:22 (7 months ago)
Author:
ringmaster
Message:

Bringing postgres branch up to trunk head.

Location:
branches/postgres/htdocs/system
Files:
13 modified
2 copied

Legend:

Unmodified
Added
Removed
  • branches/postgres/htdocs/system/admin/comments.php

    r1702 r1736  
    44    <span class="older pct10"><a href="#" onclick="timeline.skipLoupeLeft();return false">&laquo; Older</a></span> 
    55    <span class="currentposition pct15 minor">0-0 of 0</span> 
    6     <span class="search pct50"><input type="search" placeholder="Type and wait to search for any entry component" autosave="habaricontent" results="10"></span> 
     6    <span class="search pct50"><input type="search" placeholder="Type and wait to search for any entry component" autosave="habaricontent" results="10" value="<?php echo $search_args ?>"></span> 
    77    <span class="nothing pct15">&nbsp;</span> 
    88    <span class="newer pct10"><a href="#" onclick="timeline.skipLoupeRight();return false">Newer &raquo;</a></span> 
     
    3131    <input type="hidden" name="search" value="<?php echo $search; ?>"> 
    3232    <input type="hidden" name="limit" value="<?php echo $limit; ?>"> 
    33     <input type="hidden" name="index" value="<?php echo $index; ?>"> 
    3433    <input type="hidden" name="search_status" value="<?php echo $search_status; ?>"> 
    3534    <input type="hidden" id="nonce" name="nonce" value="<?php echo $wsse['nonce']; ?>"> 
     
    111110        type: "POST", 
    112111        url: "<?php echo URL::get('admin_ajax', array('context' => 'comments')); ?>", 
    113         data: "offset=" + (parseInt(c) - parseInt(b)) + "&limit=" + (parseInt(b) - parseInt(a)) + 
     112        data: "offset=" + (parseInt(c) - parseInt(b)) + "&limit=" + (1 + parseInt(b) - parseInt(a)) + 
    114113            <?php 
    115114                $vars= Controller::get_handler_vars(); 
  • branches/postgres/htdocs/system/admin/css/admin.css

    r1703 r1736  
    779779    top: 14px; 
    780780    left: 20px; 
    781     font-size: 1.5em; 
    782     line-height: 20px; 
     781    font-size: 1.5em !important; 
     782    line-height: 22px !important; 
    783783    } 
    784784 
     
    957957    } 
    958958 
     959 
    959960/* PLUGINS */ 
     961 
     962.plugins .item { 
     963    padding: 4px 40px; 
     964    margin: 10px -40px; 
     965    } 
     966 
     967.plugins .item:hover { 
     968    background: #eee; 
     969    } 
     970 
     971.plugins .item .dropbutton { 
     972    top: 5px !important; 
     973    right: 40px !important; 
     974    } 
     975 
     976.plugins .head { 
     977    margin: 0; 
     978    font-size: 1.1em; 
     979    } 
    960980 
    961981.plugins .description { 
    962982    margin: 0; 
    963983    width: 70%; 
    964     } 
    965  
    966 .plugins .item { 
    967         padding: 9px 0; 
    968         border-bottom: 1px dotted #e6e6e6; 
    969984    } 
    970985 
     
    10291044.manage .item .title { 
    10301045    margin-left: 5px; 
     1046    white-space: nowrap; 
     1047    width: 25% !important; 
     1048    overflow: hidden; 
     1049    text-overflow: ellipsis; 
     1050    position: absolute; 
    10311051    } 
    10321052 
     
    10401060    } 
    10411061 
     1062.manage .state { 
     1063    text-transform: capitalize; 
     1064    } 
     1065 
     1066 
    10421067/* COMMENTS */ 
    10431068 
     
    10731098 
    10741099.navigator { 
    1075     padding: ; 
     1100    padding:0 ; 
    10761101    } 
    10771102 
     
    11211146    display: table-row; 
    11221147    height: inherit; 
    1123     overflow: none; 
     1148    overflow: hidden; 
    11241149    position: relative; 
    11251150    } 
     
    13041329    } 
    13051330 
    1306 ul.tabs li.first.last a { 
     1331ul.tabs li.first-child.last-child a { 
    13071332    width: 150px; 
    13081333    } 
     
    13421367    } 
    13431368 
    1344 .splitterinside a { 
     1369.splitterinside * a { 
    13451370    color: #999; 
    13461371    } 
  • branches/postgres/htdocs/system/admin/dashboard.php

    r1699 r1736  
    4949        ?> 
    5050        </p> 
     51         
     52        <?php 
     53 
     54            if ( count( $updates ) > 0 ) { 
     55                 
     56                foreach ( $updates as $update ) { 
     57                     
     58                    $class= implode( ' ', $update['severity'] ); 
     59                     
     60                    if ( in_array( 'critical', $update['severity'] ) ) { 
     61                        $update_text= _t( '<a href="%1s">%2s %3s</a> is a critical update.' ); 
     62                    } 
     63                    elseif ( count( $update['severity'] ) > 1 ) { 
     64                        $update_text= _t( '<a href="%1s">%2s %3s</a> contains bug fixes and additional features.' ); 
     65                    } 
     66                    elseif ( in_array( 'bugfix', $update['severity'] ) ) { 
     67                        $update_text= _t( '<a href="%1s">%2s %3s</a> contains bug fixes.' ); 
     68                    } 
     69                    elseif ( in_array( 'feature', $update['severity'] ) ) { 
     70                        $update_text= _t( '<a href="%1s">%2s %3s</a> contains additional features.' ); 
     71                    } 
     72                     
     73                    $update_text= sprintf( $updatetext, $update['url'], $update['name'], $update['latest_version'] ); 
     74                     
     75                    ?> 
     76                     
     77                        <p class="<?php echo $class; ?>"><?php echo $update_text; ?></p> 
     78                     
     79                    <?php 
     80                     
     81                } 
     82                 
     83            } 
     84         
     85        ?> 
     86         
    5187</div> 
    5288 
  • branches/postgres/htdocs/system/admin/entries.php

    r1702 r1736  
    55    <span class="older pct10"><a href="#" onclick="timeline.skipLoupeLeft();return false">&laquo; Older</a></span> 
    66    <span class="currentposition pct15 minor">0-0 of 0</span> 
    7     <span class="search pct50"><input type="search" placeholder="Type and wait to search for any entry component" autosave="habaricontent" results="10"></span> 
     7    <span class="search pct50"><input type="search" placeholder="Type and wait to search for any entry component" autosave="habaricontent" results="10" value="<?php echo $search_args ?>"></span> 
    88    <span class="nothing pct15">&nbsp;</span> 
    99    <span class="newer pct10"><a href="#" onclick="timeline.skipLoupeRight();return false">Newer &raquo;</a></span> 
     
    8888        type: "POST", 
    8989        url: "<?php echo URL::get('admin_ajax', array('context' => 'entries')); ?>", 
    90         data: "offset=" + (parseInt(c) - parseInt(b)) + "&limit=" + (parseInt(b) - parseInt(a)) + 
     90        data: "offset=" + (parseInt(c) - parseInt(b)) + "&limit=" + (1 + parseInt(b) - parseInt(a)) + 
    9191            <?php 
    9292                $vars= Controller::get_handler_vars(); 
  • branches/postgres/htdocs/system/admin/entries_items.php

    r1690 r1736  
    99        <span class="state pct10"><a href="<?php URL::out('admin', array('page' => 'entries', 'type' => $post->content_type, 'status' => $post->status ) ); ?>"><?php echo $post->statusname; ?></a></span> 
    1010        <span class="author pct20"><a href="<?php URL::out('admin', array('page' => 'entries', 'user_id' => $post->user_id, 'type' => $post->content_type, 'status' => 'any') ); ?>"><span class="dim">by</span> <?php echo $post->author->username; ?></a></span> 
    11         <span class="time pct10"><span class="dim">at</span> <strong><?php echo date('H:i', strtotime($post->pubdate)); ?></strong></span> 
    1211        <span class="date pct15"><a href="<?php URL::out('admin', array('page' => 'entries', 'type' => $post->content_type, 'year_month' => date( 'Y-m', strtotime( $post->pubdate ) ) ) ); ?>"><span class="dim">on</span> <?php echo date('M j, Y', strtotime($post->pubdate)); ?></a></span> 
     12        <span class="time pct10"><span class="dim">at <?php echo date('H:i', strtotime($post->pubdate)); ?></span></span> 
    1313 
    1414        <ul class="dropbutton"> 
  • branches/postgres/htdocs/system/admin/js/admin.js

    r1700 r1736  
    2121    init: function() { 
    2222        if(!$('.item.controls input[type=checkbox]')) return; 
    23          
     23 
    2424        itemManage.initItems(); 
    25          
     25 
    2626        $('.item.controls input[type=checkbox]').change(function () { 
    2727            if($('.item.controls span.selectedtext').hasClass('all')) { 
     
    3131            } 
    3232        }); 
    33          
     33 
    3434        $('.item.controls input.submitbutton').click(function () { 
    3535            if($('.item.controls select.actiondropdown').val() == 1) { 
     
    5454    changeItem: function() { 
    5555        var selected = {}; 
    56          
     56 
    5757        if(itemManage.selected.length != 0) { 
    5858            selected = itemManage.selected; 
    5959        } 
    60                  
     60 
    6161        $('.item .checkboxandtitle input[type=checkbox]:checked').each(function() { 
    6262            id = $(this).attr('id'); 
     
    6969            selected['p' + id] = 0; 
    7070        }); 
    71          
     71 
    7272        itemManage.selected = selected; 
    73              
     73 
    7474        visible = $('.item .checkboxandtitle input[type=checkbox]:checked').length; 
    7575        count = 0; 
     
    7979            } 
    8080        } 
    81          
     81 
    8282        if(count == 0) { 
    8383            $('.item.controls input[type=checkbox]').each(function() { 
     
    117117    remove: function( id ) { 
    118118        spinner.start(); 
    119          
     119 
    120120        var query= {} 
    121121        if ( id == null ) { 
     
    141141} 
    142142 
     143// Tag Management 
     144var tagManage = { 
     145    init: function() { 
     146        // Return if we're not on the tags page 
     147        if(!$('.page-tags').length) return; 
     148 
     149        $('.tags .tag').click(function() { 
     150                $(this).toggleClass('selected'); 
     151                tagManage.changeTag(); 
     152            } 
     153        ); 
     154 
     155        $('.tags.controls input.deletebutton').click(function () { 
     156            tagManage.remove(); 
     157        }); 
     158        $('.tags.controls input.renamebutton').click(function () { 
     159            tagManage.rename(); 
     160        }); 
     161    }, 
     162    changeTag: function() { 
     163        count = $('.tags .tag.selected').length; 
     164 
     165        if(count == 0) { 
     166            $('.tags.controls span.selectedtext').addClass('none').removeClass('all').text('None selected'); 
     167        } else if(count == $('.tags .tag').length) { 
     168            $('.tags.controls span.selectedtext').removeClass('none').addClass('all').text('All selected'); 
     169        } else { 
     170            $('.tags.controls span.selectedtext').removeClass('none').removeClass('all').text(count + ' selected'); 
     171        } 
     172    } 
     173} 
     174 
    143175// TIMELINE 
    144176var timeline = { 
     
    148180 
    149181        var timelineWidth = $('.years').width(); 
    150          
     182 
    151183        // get an array of posts per month 
    152         timeline.monthData= []; 
    153         timeline.monthWidths= []; 
     184        timeline.monthData= [0]; 
     185        timeline.monthWidths= [0]; 
    154186        timeline.totalCount= 0; 
    155187        $('.years span').each(function(i) { 
     
    159191        }); 
    160192 
     193        // if there are fewer than 20 things, set the handle width to the timelineWidth 
     194        var minWidth= ( timelineWidth < 20 ) ? timelineWidth : 20; 
     195 
    161196        $('.track') 
    162197        .width($('.years').width()) 
    163198        .slider({ 
    164199            handle: '.handle', 
    165             maxValue: timelineWidth-20, 
    166             startValue: timelineWidth-20, 
     200            maxValue: timelineWidth - minWidth, 
     201            startValue: timelineWidth - minWidth, 
    167202            axis: 'horizontal', 
    168203            stop: function(event, ui) { 
     
    190225                timeline.t1 = setTimeout('timeline.skipLoupeRight()', 300); 
    191226        }); 
    192  
     227         
     228        // update current position text 
     229        loupeStartPosition = timeline.indexFromPosition( parseInt($('.handle').css('left')) ); 
     230        $('.currentposition').text( loupeStartPosition +'-'+ timeline.totalCount +' of '+ timeline.totalCount ); 
     231         
    193232        // Spool the timeline handle 
    194         timelineHandle.init() 
     233        timelineHandle.init( ( timelineWidth < 20 ) ? timelineWidth : 20 ); 
    195234    }, 
    196235    skipLoupeLeft: function(e) { 
     
    217256    indexFromPosition: function(pos) { 
    218257        var monthBoundary= 0; 
    219         var monthIndex= 0; 
     258        var monthIndex= 1; 
    220259        var month= 0; 
    221260        var i; 
    222      
     261 
    223262        // get the index of the first post in the month that the handle is over 
    224      
     263 
    225264        for ( i = 0; i < timeline.monthWidths.length && monthBoundary + timeline.monthWidths[i] < pos; i++ ) { 
    226265            monthBoundary += timeline.monthWidths[i]; 
     
    228267            month= i + 1; 
    229268        } 
    230      
     269 
    231270        // the index is the offset from this boundary, but it cannot be greater than 
    232271        // the number of posts in the month (the month has some extra padding which 
    233272        // increases its width). 
    234         return monthIndex + Math.min( pos - monthBoundary, timeline.monthData[month] ); 
     273        var padding= parseInt( $('.years span').css('margin-left') ); 
     274        padding= padding ? padding : 0; 
     275        return monthIndex + Math.min( 
     276                                    Math.max( pos - ( monthBoundary + padding ), 0 ), 
     277                                    timeline.monthData[month] - 1 ); 
    235278    } 
    236279} 
     
    239282// TIMELINE HANDLE 
    240283var timelineHandle = { 
    241     init: function() { 
     284    init: function( handleWidth ) { 
     285        $('.handle').css('width', handleWidth + 'px'); 
    242286        // Resize Handle Left 
    243287        $('.resizehandleleft') 
     
    289333 
    290334        $('.currentposition').text( loupeStartPosition +'-'+ loupeEndPosition +' of '+ timeline.totalCount ); 
    291          
     335 
    292336        /* AJAX call to fetch needed info goes here. */ 
    293337        if(jQuery.isFunction(this.loupeUpdate)) { 
     
    382426            $('#menulist li').removeClass('carrot') 
    383427        }) 
    384                  
     428 
    385429        // Open menu on Q 
    386430        $.hotkeys.add('q', {propagate:true, disableInInput: true}, function(){ 
     
    394438            } 
    395439        }); 
    396          
     440 
    397441        // Close menu on ESC 
    398442        $.hotkeys.add('esc', {propagate:true, disableInInput: false}, function(){ 
     
    400444            dropButton.hideMenu(); 
    401445        }); 
    402          
     446 
    403447        // Down arrow 
    404448        $.hotkeys.add('down', {propagate:true, disableInInput: true}, function(){ 
     
    418462            } 
    419463        }); 
    420          
     464 
    421465        // Up arrow 
    422466        $.hotkeys.add('up', {propagate:true, disableInInput: true}, function(){ 
     
    436480            } 
    437481        }); 
    438          
     482 
    439483        // Enter & Carrot 
    440484        $.hotkeys.add('return', {propagate:true, disableInInput: true}, function(){ 
     
    445489            } 
    446490        }); 
    447          
     491 
    448492        // Page hotkeys 
    449493        $('#menu ul li').each(function() { 
     
    505549 
    506550        liveSearch.prevSearch= liveSearch.input.val(); 
    507          
     551 
    508552        if ( jQuery.isFunction( liveSearch.search ) ) { 
    509553            return liveSearch.search(); 
     
    555599    timeline.init(); 
    556600    itemManage.init(); 
     601    tagManage.init(); 
    557602    liveSearch.init(); 
    558603 
  • branches/postgres/htdocs/system/admin/options.php

    r1654 r1736  
    4545    <div class="container settings"> 
    4646        <h2>Publishing</h2> 
    47         <div class="item clear" id="siteabout"> 
    48             <span class="column span-5"> 
    49                 <label for="sitetagline">About</label> 
    50             </span> 
    51             <span class="column span-14 last"> 
    52                 <textarea name="about" id="about" class="border"><?php Options::out('about'); ?></textarea> 
    53             </span> 
    54         </div> 
    55          
    5647        <div class="item clear" id="encoding"> 
    5748            <span class="column span-5"> 
    58                 <label for="encoding">Items per page</label> 
     49                <label for="encoding">Items per Page</label> 
    5950            </span> 
    6051            <span class="column span-5 last"> 
     
    6556        <div class="item clear" id="encoding"> 
    6657            <span class="column span-5"> 
    67                 <label for="encoding">Send Pingbacks to linked URLs</label> 
     58                <label for="encoding">Send Pingbacks to Links</label> 
    6859            </span> 
    6960            <span class="column span-5 last"> 
     
    7465        <div class="item clear" id="encoding"> 
    7566            <span class="column span-5"> 
    76                 <label for="encoding">Require comment authors info</label> 
     67                <label for="encoding">Require Comment Author Info</label> 
    7768            </span> 
    7869            <span class="column span-5 last"> 
  • branches/postgres/htdocs/system/admin/tags.php

    r1650 r1736  
    11<?php include('header.php');?> 
    22 
    3  
    4 <div class="container timeline"> 
     3<div class="container"><!-- TODO: implement the tags loupe --> 
    54    <span class="older pct10"><a href="#">&laquo; Older</a></span> 
    65    <span class="currentposition pct15 minor">0-20 of 480</span> 
     
    109</div> 
    1110<?php 
    12     $tags=Tags::get(); 
     11    $tags= $available_tags; 
    1312    //what's the max count? 
    1413    //ugly! and probably needs to be a Tags method or something 
     
    1817<div class="container tags"> 
    1918<?php foreach ($tags as $tag) { ?> 
    20     <a href="#" class="tag wt<?php echo round(($tag->count * 10)/$max); ?>"><span><?php echo $tag->tag; ?></span><sup><?php echo $tag->count; ?></sup></a> 
     19    <a href="#" id="<?php echo 'tag_' . $tag->id ?>" class="tag wt<?php echo round(($tag->count * 10)/$max); ?>"><span><?php echo $tag->tag; ?></span><sup><?php echo $tag->count; ?></sup></a> 
    2120<?php } ?> 
    2221        <ul class="dropbutton"> 
     
    2928<div class="container tags transparent"> 
    3029 
    31     <div class="item controls"> 
     30    <div class="tags controls"> 
    3231        <span class="checkboxandselected pct15"> 
    3332            <span class="selectedtext minor none">None selected</span> 
     
    3635        <span class="or pct5">or</span> 
    3736        <span class="renamecontrols"> 
    38             <input type="text"></input> 
     37            <input type="text" class="renametext"></input> 
    3938            <input type="button" value="Rename" class="renamebutton"></input> 
    4039        </span> 
     40        <input type="hidden" id="nonce" name="nonce" value="<?php echo $wsse['nonce']; ?>"> 
     41        <input type="hidden" id="timestamp" name="timestamp" value="<?php echo $wsse['timestamp']; ?>"> 
     42        <input type="hidden" id="PasswordDigest" name="PasswordDigest" value="<?php echo $wsse['digest']; ?>"> 
    4143    </div> 
    4244</div> 
    4345 
     46<script type="text/javascript"> 
     47tagManage.remove= function() { 
     48    spinner.start(); 
    4449 
     50    selected= $('.tags .tag.selected'); 
     51    if ( selected.length == 0 ) { 
     52        humanMsg.displayMsg('You need to select some tags before you can delete them.'); 
     53        return; 
     54    } 
     55    var query= {} 
     56 
     57    selected.each(function() { 
     58        query[$(this).attr('id')]= 1; 
     59    }); 
     60 
     61    query['action']= 'delete'; 
     62    query['timestamp']= $('input#timestamp').attr('value'); 
     63    query['nonce']= $('input#nonce').attr('value'); 
     64    query['digest']= $('input#PasswordDigest').attr('value'); 
     65    $.post( 
     66        "<?php echo URL::get('admin_ajax', array('context' => 'tags')); ?>", 
     67        query, 
     68        function(msg) { 
     69            spinner.stop(); 
     70            //TODO When there's a loupe, update it 
     71            //timelineHandle.updateLoupeInfo(); 
     72            selected.remove(); 
     73            humanMsg.displayMsg(msg); 
     74            tagManage.changeTag(); 
     75        }, 
     76        'json' 
     77    ); 
     78}; 
     79tagManage.rename= function() { 
     80    selected= $('.tags .tag.selected'); 
     81    master= $('.tags.controls input.renametext').val().trim(); 
     82 
     83    if ( selected.length == 0 ) { 
     84        humanMsg.displayMsg('You need to select some tags before you can rename them.'); 
     85        return; 
     86    } 
     87    else if ( master == '' ) { 
     88        humanMsg.displayMsg('You need to enter a new tag to rename tags.'); 
     89        return; 
     90    } 
     91    var query= {} 
     92 
     93    // Unselect the master, if it's selected 
     94    $('.tags .tag:contains(' + master + ')').each(function() { 
     95        if ($(this).find('span').text() == master) { 
     96            $(this).removeClass('selected'); 
     97        } 
     98    }) 
     99 
     100    spinner.start(); 
     101 
     102    selected.each(function() { 
     103        que