Changeset 991

Show
Ignore:
Timestamp:
11/20/08 22:10:36 (7 weeks ago)
Author:
lucy
Message:

quickrate rating stars added. some more cleanups of unused js and css files, etc

Location:
huginmunin/trunk/web/hm/app
Files:
12 modified

Legend:

Unmodified
Added
Removed
  • huginmunin/trunk/web/hm/app/lib/params.py

    r565 r991  
    22 
    33import re 
    4 param_re = re.compile(r'^(?:([a-z_]+)|\[(\d*)\]|\[([a-z_0-9]*)\])') 
     4# i added the \. so that input type=image would work 
     5# since that creates name.x and name.y parameters 
     6param_re = re.compile(r'^(?:([a-z_\.]+)|\[(\d*)\]|\[([a-z_0-9]*)\])') 
    57 
    68class InvalidParameter(Exception): pass 
  • huginmunin/trunk/web/hm/app/media/css/general.css

    r990 r991  
    3838    margin: 0; 
    3939    padding: 0; 
    40     border: 0; 
     40/*    border: 0; otherwise inputs are grey rectangles instead of round buttons */ 
    4141} 
    4242 
     
    564564 
    565565input, #submit, select, textarea, button { 
    566         border:.10em #d0d0dd solid; 
     566/*      border:.10em #d0d0dd solid; otherwise inputs are grey rectangles instead of round buttons */ 
    567567} 
    568568 
  • huginmunin/trunk/web/hm/app/media/css/quickrate.css

    r990 r991  
    3636.rating_choice {padding: 1.1em .58em 5.8em .58em; margin: auto; 
    3737        } 
     38         
     39.star { width: 4em; padding: 0em; margin: 0em; } 
    3840 
    3941 
  • huginmunin/trunk/web/hm/app/media/js/blocks.js

    r990 r991  
    6161 
    6262        // add tag edit in place 
    63 /*      $(".edit").editable( 
    64                 function(value, settings) { 
    65                         var id = $(this).attr("id"); 
    66                         $.post("/Main/save_text/",  { 'oid': 'ADDTAG', 'text': value, 'node_id': id }, 
    67                                    function() { 
    68                                            $(".edit").removeClass("edit"); 
    69                                            // err, need to then apply editable. loop. 
    70                                            //.after("<li class='edit cursor link' id=\'id\'>add tag</li>"); 
    71                         }); 
    72                         return(value); 
    73                 }, 
    74                 {  
    75                          type    : 'textarea', 
    76                          tooltip : 'Click to edit', 
    77                          indicator : 'Saving...', 
    78                          submit : 'save', 
    79                          cancel : 'cancel', 
    80                          style: 'inherit', 
    81                 } 
    82          ); 
    83 */       
     63 
     64//      $(".edit").editable(  
     65//                      function(value, settings) { 
     66//                              var id = $(this).attr("id"); 
     67//                              $.post("/Main/save_text/",  { 'oid': 'ADDTAG', 'text': value, 'node_id': id }, 
     68//                                              function() { 
     69//                                                 $(".edit").removeClass("edit"); 
     70//                                                 // err, need to then apply editable. loop. 
     71//                                                 //.after("<li class='edit cursor link' id=\'id\'>add tag</li>"); 
     72//                                         } 
     73//                              ); 
     74//                              return(value); 
     75//                      }, 
     76//                      {  
     77//                              type    : 'textarea', 
     78//                              tooltip : 'Click to edit', 
     79//                              indicator : 'Saving...', 
     80//                              submit : 'save', 
     81//                              cancel : 'cancel', 
     82//                              style: 'inherit', 
     83//                      } 
     84//      ); 
    8485}); 
    8586 
     
    8889  // help buttons 
    8990         
    90         $("#turn_on_help").hide(); 
    91  
    92         $("#turn_on_help").click( function() { 
    93                 $(".help").show(); 
    94                 $("#turn_off_help").toggle(); 
    95                 $("#turn_on_help").toggle(); 
    96         }); 
    97  
    98         $("#turn_off_help").click( function() { 
    99                 $(".help").hide(); 
    100                 $("#turn_off_help").toggle(); 
    101                 $("#turn_on_help").toggle(); 
    102         }); 
     91//      $("#turn_on_help").hide(); 
     92// 
     93//      $("#turn_on_help").click( function() { 
     94//              $(".help").show(); 
     95//              $("#turn_off_help").toggle(); 
     96//              $("#turn_on_help").toggle(); 
     97//      }); 
     98// 
     99//      $("#turn_off_help").click( function() { 
     100//              $(".help").hide(); 
     101//              $("#turn_off_help").toggle(); 
     102//              $("#turn_on_help").toggle(); 
     103//      }); 
    103104 
    104105 
  • huginmunin/trunk/web/hm/app/templates/base.html

    r976 r991  
    3939        <!--<script type="text/javascript" charset="utf-8" src="/Main/media/js/jquery.min.js"></script> old --> 
    4040        <script type="text/javascript" charset="utf-8" src="/Main/media/js/jquery-1.2.6.pack.js"></script> 
    41         <script type="text/javascript" charset="utf-8" src="/Main/media/js/jquery.tablesorter.js"></script> 
     41        {# i don't think we use this anymore <script type="text/javascript" charset="utf-8" src="/Main/media/js/jquery.tablesorter.js"></script> #} 
    4242        {# i don't think we use this anymore <script type="text/javascript" charset="utf-8" src="/Main/media/js/jquery.jtageditor.js"></script> #} 
    4343        <script type="text/javascript" charset="utf-8" src="/Main/media/js/jquery.rte.js"></script> 
    4444        <script type="text/javascript" charset="utf-8" src="/Main/media/js/jquery.rater.js"></script> 
    45         <script type="text/javascript" charset="utf-8" src="/Main/media/js/jquery.jeditable.pack.js"></script> 
     45        {# file appears to be unused <script type="text/javascript" charset="utf-8" src="/Main/media/js/jquery.jeditable.pack.js"></script> #} 
    4646        {# file appears not to exist <script type="text/javascript" charset="utf-8" src="/Main/media/js/jquery.form.js"></script> #} 
    4747         
     
    6565        <script type="text/javascript" charset="utf-8" src="/Main/media/js/main.js"></script> 
    6666        <script type="text/javascript" charset="utf-8" src="/Main/media/js/slide.js"></script> 
    67         <script type="text/javascript" charset="utf-8" src="/Main/media/js/blocks.js"></script> 
     67        {# we don't use this anymore <script type="text/javascript" charset="utf-8" src="/Main/media/js/blocks.js"></script> #} 
    6868        <!--script type="text/javascript" charset="utf-8" src="/Main/media/js/node_list.js"></script--> 
    6969        <script type="text/javascript" charset="utf-8" src="/Main/media/js/behavior.js"></script> 
  • huginmunin/trunk/web/hm/app/templates/browse/browse_list.html

    r963 r991  
    1414        {% include 'graph/nodes.html' %} 
    1515 
    16         {% block javascript_includes %} 
    17                 {{ block.super }} 
    18                 <script type="text/javascript" charset="utf-8" src="/Main/media/js/filter_nodes.js"></script>    
    19         {% endblock %} 
    20  
    2116{% endblock %} 
    2217 
  • huginmunin/trunk/web/hm/app/templates/browse/node_listing_expanded.html

    r953 r991  
    11{% extends "browse_extension.html" %} 
    22 
    3         {% block title %} 
    4                 BuyItLikeYouMeanIt.org - Information about {{ node.label }}  
    5                         {% for tag in node.information %}: {{ tab.label }}; {% endfor %} 
    6         {% endblock %} 
     3{% block title %} 
     4        BuyItLikeYouMeanIt.org - Information about {{ node.label }}  
     5        {% for tag in node.information %}: {{ tab.label }}; {% endfor %} 
     6{% endblock %} 
    77 
    88{% block big_box %} 
     
    1212 
    1313                {% include 'node/behaviors.html' %} 
     14                 
     15        <SCRIPT type="text/javascript"> 
     16          $(document).ready(function() { 
     17                // show rating guide 
     18                $(".rating_guide_show").click( function() { 
     19                        $(this).siblings(".rating_guide").html(" \ 
     20          <ol> \ 
     21            <li value='9 -' class='bold'>Amazing. <span class='normal'>Uniquely allows others to improve even while continuing to be great.</span></li> \ 
     22            <li value='8 -' class='bold'>Excellent. <span class='normal'>Extremely helpful and the result of deliberate and lasting effort.</span></li> \ 
     23            <li value='7 -' class='bold'>Very Good. <span class='normal'>Shows how much can be accomplished through concern and compromise.</span></li> \ 
     24            <li value='6 -' class='bold'>Good. <span class='normal'>Beginning to be on the right track, but could certainly stand to improve. </span></li> \ 
     25            <li value='5 -' class='bold'>Marginal. <span class='normal'>Neither good nor bad. Perhaps its effect is legitamately unknown.</span></li> \ 
     26            <li value='4 -' class='bold'>Bad. <span class='normal'>Cause for very real concern and should be improved.</span></li> \ 
     27            <li value='3 -' class='bold'>Very Bad. <span class='normal'>Represents irresponsible neglect of a serious issue.</span></li> \ 
     28            <li value='2 -' class='bold'>Terrible. <span class='normal'>As bad as a behavior can get without deliberately trying for The Worst.</span></li> \ 
     29            <li value='1 -' class='bold'>Dreadful. <span class='normal'>Deliberately, effectively and cruelly harmful. It can seem overwhelming.</span></li> \ 
     30          </ol> \ 
     31                        "); 
     32                        $(this).hide(); 
     33                        $(this).siblings(".rating_guide_hide").show(); 
     34                }); 
     35                // hide rating guide 
     36                $(".rating_guide_hide").click( function() { 
     37                        $(this).siblings(".rating_guide").html(""); // this could be hidden if show knows to check 
     38                        $(this).hide(); 
     39                        $(this).siblings(".rating_guide_show").show(); 
     40                }); 
     41         
     42                $(".rating_guide_hide").hide(); 
     43          }); 
     44        </SCRIPT> 
    1445{% endblock %} 
    15  
    16  
    17 {% block javascript_includes %} 
    18   {{ block.super }}      
    19 {% endblock %} 
  • huginmunin/trunk/web/hm/app/templates/graph/page.html

    r953 r991  
    2929{% endblock %}   
    3030 
    31  
    32 {% block javascript_includes %} 
    33   {{ block.super }} 
    34   <script type="text/javascript" charset="utf-8" src="/Main/media/js/filter_nodes.js"></script> 
    35          
    36 {% endblock %} 
  • huginmunin/trunk/web/hm/app/templates/node/page.html

    r968 r991  
    3636        {# endpane #} 
    3737{% endblock %}    
    38  
    39  
    40 {% block javascript_includes %} 
    41   {{ block.super }} 
    42          
    43 {% endblock %} 
    44  
    45  
  • huginmunin/trunk/web/hm/app/templates/quickrate/quickrate_extension.html

    r990 r991  
    1111 
    1212<link rel="stylesheet" type="text/css" href="/Main/media/css/quickrate.css"></link> 
    13 <script type="text/javascript" charset="utf-8" src="/Main/media/js/jquery.min.js"></script> 
    1413 
    1514<h1> 
  • huginmunin/trunk/web/hm/app/templates/quickrate/rate_review.html

    r990 r991  
    1515{% block form %} 
    1616<div class="rating_choice"> 
    17         <form method="post" action=""> 
     17        <form method="post" action="" class="stars"> 
     18        {% spaceless %} {# to prevent spaces getting added between stars and messing up hover experience #} 
    1819                {% for rating in ratings %} 
    19                         <input type="submit" name="rating" value="{{ rating }}" /> 
     20                        <input class="star" type="image" name="rating" value="{{ rating }}" src="/Main/media/img/stars/BlankStar{{ rating }}.png" /> 
    2021                {% endfor %} 
     22        {% endspaceless %} 
    2123        </form> 
     24        <div class="rating_guide"> 
     25                <!-- javascript puts text here when hover on input star --> 
     26        </div> 
    2227</div> 
     28 
     29<SCRIPT type="text/javascript"> 
     30        $(document).ready(function() { 
     31                $(".star").hover( 
     32                        function() { // over 
     33                                var current_rating = $(this).attr("value"); 
     34                                $(".stars").children().each( function() { 
     35                                        var rating = $(this).attr("value"); 
     36                                        if (rating <= current_rating) { 
     37                                                $(this).attr("src", "/Main/media/img/stars/Star"+rating+".png"); 
     38                                        } else { 
     39                                                $(this).attr("src", "/Main/media/img/stars/BlankStar"+rating+".png"); 
     40                                        } 
     41                                }); 
     42                                // add rating guide text 
     43                                $(".rating_guide").html(text[9-current_rating]); 
     44                        }, 
     45                        function() { // out 
     46                                $(".stars").children().each( function() { 
     47                                        var rating = $(this).attr("value"); 
     48                                        $(this).attr("src", "/Main/media/img/stars/BlankStar"+rating+".png"); 
     49                                }); 
     50                                $(".rating_guide").html(""); 
     51                        } 
     52                ); 
     53 
     54                var text = [ 
     55                        "<p value='9 -' class='bold'>Amazing. <span class='normal'>Uniquely allows others to improve even while continuing to be great.</span></p>", 
     56                        "<p value='8 -' class='bold'>Excellent. <span class='normal'>Extremely helpful and the result of deliberate and lasting effort.</span></p>", 
     57                        "<p value='7 -' class='bold'>Very Good. <span class='normal'>Shows how much can be accomplished through concern and compromise.</span></p>", 
     58                        "<p value='6 -' class='bold'>Good. <span class='normal'>Beginning to be on the right track, but could certainly stand to improve. </span></p>", 
     59                        "<p value='5 -' class='bold'>Marginal. <span class='normal'>Neither good nor bad. Perhaps its effect is legitamately unknown.</span></p>", 
     60                        "<p value='4 -' class='bold'>Bad. <span class='normal'>Cause for very real concern and should be improved.</span></p>", 
     61                        "<p value='3 -' class='bold'>Very Bad. <span class='normal'>Represents irresponsible neglect of a serious issue.</span></p>", 
     62                        "<p value='2 -' class='bold'>Terrible. <span class='normal'>As bad as a behavior can get without deliberately trying for The Worst.</span></p>", 
     63                        "<p value='1 -' class='bold'>Dreadful. <span class='normal'>Deliberately, effectively and cruelly harmful. It can seem overwhelming.</span></p>" 
     64                ]; 
     65        }); 
     66</SCRIPT> 
    2367{% endblock %} 
  • huginmunin/trunk/web/hm/app/views/main.py

    r989 r991  
    11101110    try: 
    11111111        if request.POST: 
    1112             print request.POST 
    11131112            page = request.POST.get('page', 'unknown') 
    11141113            user_id = request.POST.get('user_id', 'no user id')