Changeset 13175


Ignore:
Timestamp:
11/22/11 12:21:09 (6 months ago)
Author:
MichaelDaum
Message:

Item10818:Item11275:Item11254:

same as on stable branch:

  • fixed jquery.chili to allow other non-recipe css classes in verbatim sections
  • fixed jquery.cookie to return undefined instead of an empty Object when asking for an unknown cookie
  • fixed JQueryAjaxHelper's =users= backend to return users and groups
  • improved jquery-ui-dialog integration

only on trunk:

  • added jquery-1.7 and jquery-1.7.1
  • added new jquery.loader to ease loading sections asynchronously
Location:
trunk/JQueryPlugin
Files:
6 added
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/JQueryPlugin/data/System/JQueryAjaxHelper.txt

    r12773 r13175  
    1 %META:TOPICINFO{author="ProjectContributor" date="1315844220" format="1.1" version="1"}% 
     1%META:TOPICINFO{author="ProjectContributor" date="1320871779" format="1.1" reprev="12" version="12"}% 
    22%META:TOPICPARENT{name="JQueryPlugin"}% 
    33<!-- 
     
    237237     type="regex" 
    238238     scope="topic" 
    239      format="$percntUSERINFO{\"$topic\" format=\"$dollarwikiusername, \"}$percnt" 
     239     format="$percntIF{\"'$percntGROUPINFO{\"$topic\" format=\"$dollarname, \" limit=\"1\"}$percnt'=''\" 
     240          then=\"$percntUSERINFO{\"$topic\" format=\"$dollarwikiname, \"}$percnt\" 
     241          else=\"$percntGROUPINFO{\"$topic\" format=\"$dollarname, \" limit=\"1\"}$percnt\" 
     242        }$percnt" 
    240243     separator="" 
    241244     limit="%URLPARAM{"limit" default="10"}%" 
     
    244247  }%" 
    245248  type="string" 
    246   header="[" 
    247   format="$percntUSERINFO{ 
    248     \"$item\"  
    249     format=\"{\\"label\\":\\"<nop>$dollarwikiname\\", \\"email\\":\\"$dollaremails\\", \\"img\\":\\"$percntFORMFIELD{\"Photo\" topic=\"$item\" default=\"%PUBURLPATH%/%SYSTEMWEB%/JQueryPlugin/images/nobody.gif\" alttext=\"%PUBURLPATH%/%SYSTEMWEB%/JQueryPlugin/images/nobody.gif\" }$percnt\\"}\" 
    250   }$percnt" 
     249  header="[$n" 
     250  format="  {\"label\":\"<nop>$item\",  
     251    \"email\":\"$percntUSERINFO{\"$item\" format=\"$emails\"}$percnt\",  
     252    \"img\":\"$percntFORMFIELD{\"Photo\" topic=\"%USERSWEB%.$item\" default=\"%PUBURLPATH%/%SYSTEMWEB%/JQueryPlugin/images/nobody.gif\" alttext=\"%PUBURLPATH%/%SYSTEMWEB%/JQueryPlugin/images/nobody.gif\" }$percnt\" 
     253  }" 
    251254  separator=",$n" 
    252   footer="]" 
     255  footer="$n]" 
    253256}% 
    254257</literal>%ENDSECTION{"user"}% 
     
    353356</verbatim> 
    354357 
    355 ---++ Example extension based implementations 
    356 The following implementations of some of the server sections depend on the 
    357 installation of optional extensions. 
    358  
    359 ---+++ =user_fast= 
    360 Foswiki:Extensions.DBCachePlugin implementation of the [[#User_selector][user selector]] server section. 
    361 <verbatim class="tml"> 
    362 %STARTSECTION{"user_fast"}%<literal>%FORMAT{ 
    363   "%DBQUERY{ 
    364      "uc(topic) =~ uc('^%URLPARAM{"term" default="does not exist"}%')" 
    365      format="$percntUSERINFO{\"$topic\" format=\"$dollarwikiusername, \"}$percnt" 
    366      separator="" 
    367      limit="%URLPARAM{"limit" default="10"}%" 
    368      nonoise="on" 
    369      web="%USERSWEB%" 
    370   }%" 
    371   type="string" 
    372   header="[" 
    373   format="$percntUSERINFO{ 
    374     \"$item\"  
    375     format=\"{\\"label\\":\\"<nop>$dollarwikiname\\", \\"email\\":\\"$dollaremails\\", \\"img\\":\\"$percntFORMFIELD{\"Photo\" topic=\"$item\" default=\"%PUBURLPATH%/%SYSTEMWEB%/JQueryPlugin/images/nobody.gif\" alttext=\"%PUBURLPATH%/%SYSTEMWEB%/JQueryPlugin/images/nobody.gif\" }$percnt\\"}\" 
    376   }$percnt" 
    377   separator=",$n" 
    378   footer="]" 
    379 }%</literal>%ENDSECTION{"user_fast"}% 
    380 </verbatim> 
    381  
    382358%META:FORM{name="JQueryAjaxHelper"}% 
    383359%META:FIELD{name="Example" attributes="" title="Example" value="example field value"}% 
  • trunk/JQueryPlugin/data/System/JQueryMedia.txt

    r12885 r13175  
    1 %META:TOPICINFO{author="micha" date="1319452868" format="1.1" version="5"}% 
     1%META:TOPICINFO{author="ProjectContributor" date="1319452868" format="1.1" version="5"}% 
    22%META:TOPICPARENT{name="JQueryPlugin"}% 
    33---+ %TOPIC% 
  • trunk/JQueryPlugin/data/System/JQueryPlugin.txt

    r13072 r13175  
    138138|  Version: | %$VERSION% | 
    139139|  Change History: | <!-- versions below in reverse order -->&nbsp; | 
    140 |  TBD          | (4.21) Added config warnings for the deprecated JQuery plugins; \ 
    141                   and a warining for Chili highlighter corruption; | 
     140|  22 Nov 2011: | (4.30) added jquery-1.7 and jquery-1.7.1; \ 
     141                  added jquery.loader to ease loading sections asynchronously | 
     142|  22 Nov 2011: | (4.21) added config warnings for the deprecated JQuery plugins; \ 
     143                  and a warining for Chili highlighter corruption; \ 
     144                  fixed jquery.chili to allow other non-recipe css classes in verbatim sections; \ 
     145                  fixed jquery.cookie to return undefined instead of an empty Object when asking for an unknown cookie; \ 
     146                  fixed <nop>JQueryAjaxHelper's =users= backend to return users and groups | 
     147                  improved jquery-ui-dialog integration | 
    142148|  26 Oct 2011: | fixing compatibility of jquery.media with newer jqueries; \ 
    143149                  fixed placement of jquery.tooltips when viewport at right bottom;\ 
  • trunk/JQueryPlugin/data/System/JQueryTextboxList.txt

    r12885 r13175  
    1 %META:TOPICINFO{author="micha" comment="reprev" date="1319629237" format="1.1" reprev="6" version="6"}% 
     1%META:TOPICINFO{author="ProjectContributor" comment="reprev" date="1319629237" format="1.1" reprev="6" version="6"}% 
    22%META:TOPICPARENT{name="JQueryPlugin"}% 
    33---+ %TOPIC% 
  • trunk/JQueryPlugin/data/System/JQueryUIAutocomplete.txt

    r12773 r13175  
    1 %META:TOPICINFO{author="micha" comment="save topic" date="1316526158" format="1.1" reprev="3" version="3"}% 
     1%META:TOPICINFO{author="ProjectContributor" comment="save topic" date="1316526158" format="1.1" reprev="3" version="3"}% 
    22%META:TOPICPARENT{name="JQueryPlugin"}% 
    33---+!! %TOPIC% 
  • trunk/JQueryPlugin/data/System/JQueryUIDialog.txt

    r12885 r13175  
    1 %META:TOPICINFO{author="micha" comment="save topic" date="1319037739" format="1.1" reprev="6" version="6"}% 
     1%META:TOPICINFO{author="ProjectContributor" comment="save topic" date="1320084362" format="1.1" reprev="6" version="8"}% 
    22%META:TOPICPARENT{name="JQueryPlugin"}% 
    33---+!! %TOPIC% 
     
    4848  ... 
    4949 
    50   <a class="jqUIDialogButton {icon:'ui-icon-circle-check', click: function() { $(this).dialog('close'); }}">%MAKETEXT{"Ok"}%</a> 
    51   <a class="jqUIDialogButton {icon:'ui-icon-cancel', click: function() { $(this).dialog('close'); }}">%MAKETEXT{"Cancel"}%</a> 
     50  <a class="jqUIDialogButton jqUIDialogClose {icon:'ui-icon-circle-check'}">%MAKETEXT{"Ok"}%</a> 
     51  <a class="jqUIDialogButton jqUIDialogClose {icon:'ui-icon-cancel'}">%MAKETEXT{"Cancel"}%</a> 
    5252</div> 
    5353</verbatim> 
     
    9191  et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip 
    9292  ex ea commodo consequat. 
    93   <a class="jqUIDialogButton {icon:'ui-icon-circle-check', click: function() { $(this).dialog('close'); }}">%MAKETEXT{"Ok"}%</a> 
    94   <a class="jqUIDialogButton {icon:'ui-icon-cancel', click: function() { $(this).dialog('close'); }}">%MAKETEXT{"Cancel"}%</a> 
     93  <a class="jqUIDialogButton jqUIDialogClose {icon:'ui-icon-circle-check'}">%MAKETEXT{"Ok"}%</a> 
     94  <a class="jqUIDialogButton jqUIDialogClose {icon:'ui-icon-cancel'}">%MAKETEXT{"Cancel"}%</a> 
    9595</div> 
    9696 
     
    105105  et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip 
    106106  ex ea commodo consequat. 
    107   <a class="jqUIDialogButton {icon:'ui-icon-circle-check', click: function() { $(this).dialog('close'); }}">%MAKETEXT{"Ok"}%</a> 
    108   <a class="jqUIDialogButton {icon:'ui-icon-cancel', click: function() { $(this).dialog('close'); }}">%MAKETEXT{"Cancel"}%</a> 
     107  <a class="jqUIDialogButton jqUIDialogClose {icon:'ui-icon-circle-check'}">%MAKETEXT{"Ok"}%</a> 
     108  <a class="jqUIDialogButton jqUIDialogClose {icon:'ui-icon-cancel'}">%MAKETEXT{"Cancel"}%</a> 
    109109</div> 
    110110%ENDSECTION{"dialog"}% 
  • trunk/JQueryPlugin/lib/Foswiki/Plugins/JQueryPlugin.pm

    r13073 r13175  
    2121 
    2222$VERSION           = '$Rev$'; 
    23 $RELEASE           = '4.21'; 
     23$RELEASE           = '4.30'; 
    2424$SHORTDESCRIPTION  = 'jQuery <nop>JavaScript library for Foswiki'; 
    2525$NO_PREFS_IN_TOPIC = 1; 
     
    259259 
    260260    my $plugins = $params->{_DEFAULT} || ''; 
    261     my $warn    = $params->{warn}     || ''; 
     261    my $warn    = Foswiki::Func::isTrue($params->{warn}, 1); 
    262262    my $errorMsg = ''; 
    263263    foreach my $pluginName ( split( /\s*,\s*/, $plugins ) ) { 
     
    265265        $errorMsg .= 
    266266          "<div class='foswikiAlert'>Error: no such plugin $pluginName</div>" 
    267           if !$plugin && $warn ne 'off'; 
     267          if !$plugin && $warn; 
    268268    } 
    269269 
  • trunk/JQueryPlugin/lib/Foswiki/Plugins/JQueryPlugin/Config.spec

    r13072 r13175  
    2727$Foswiki::cfg{JQueryPlugin}{DefaultPlugins} = ''; 
    2828 
    29 # **SELECT jquery-1.4.3, jquery-1.4.4, jquery-1.5, jquery-1.5.1, jquery-1.5.2, jquery-1.6.1, jquery-1.6.2, jquery-1.6.3, jquery-1.6.4** 
    30 $Foswiki::cfg{JQueryPlugin}{JQueryVersion} = 'jquery-1.6.4'; 
     29# **SELECT jquery-1.4.3, jquery-1.4.4, jquery-1.5, jquery-1.5.1, jquery-1.5.2, jquery-1.6.1, jquery-1.6.2, jquery-1.6.3, jquery-1.6.4, jquery-1.7, jquery-1.7.1** 
     30$Foswiki::cfg{JQueryPlugin}{JQueryVersion} = 'jquery-1.7.1'; 
    3131 
    3232# **SELECT ,base, flickr, foswiki, lightness, redmond, smoothness** 
     
    229229$Foswiki::cfg{JQueryPlugin}{Plugins}{WikiWord}{Enabled} = 1; 
    230230 
     231# **BOOLEAN** 
     232$Foswiki::cfg{JQueryPlugin}{Plugins}{Loader}{Enabled} = 1; 
     233 
    2312341; 
  • trunk/JQueryPlugin/lib/Foswiki/Plugins/JQueryPlugin/MANIFEST

    r13072 r13175  
    9393lib/Foswiki/Plugins/JQueryPlugin/INNERFADE.pm 0644 
    9494lib/Foswiki/Plugins/JQueryPlugin/LIVEQUERY.pm 0644 
     95lib/Foswiki/Plugins/JQueryPlugin/LOADER.pm 0644 
    9596lib/Foswiki/Plugins/JQueryPlugin/LOCALSCROLL.pm 0644 
    9697lib/Foswiki/Plugins/JQueryPlugin/MASKEDINPUT.pm 0644 
     
    144145pub/System/JQueryPlugin/i18n/jquery.ui.datepicker-af.js 0644 
    145146pub/System/JQueryPlugin/i18n/jquery.ui.datepicker-af.js.gz 0644 
     147pub/System/JQueryPlugin/i18n/jquery.ui.datepicker-ar-DZ.js 0644 
     148pub/System/JQueryPlugin/i18n/jquery.ui.datepicker-ar-DZ.js.gz 0644 
    146149pub/System/JQueryPlugin/i18n/jquery.ui.datepicker-ar.js 0644 
    147150pub/System/JQueryPlugin/i18n/jquery.ui.datepicker-ar.js.gz 0644 
     
    296299pub/System/JQueryPlugin/jquery-1.6.4.js.gz 0644 
    297300pub/System/JQueryPlugin/jquery-1.6.4.uncompressed.js 0644 
     301pub/System/JQueryPlugin/jquery-1.7.js 0644 
     302pub/System/JQueryPlugin/jquery-1.7.js.gz 0644 
     303pub/System/JQueryPlugin/jquery-1.7.uncompressed.js 0644 
     304pub/System/JQueryPlugin/jquery-1.7.1.js 0644 
     305pub/System/JQueryPlugin/jquery-1.7.1.js.gz 0644 
     306pub/System/JQueryPlugin/jquery-1.7.1.uncompressed.js 0644 
    298307pub/System/JQueryPlugin/Makefile 0644 
    299308pub/System/JQueryPlugin/Makefile.include 0644 
     
    448457pub/System/JQueryPlugin/plugins/livequery/jquery.livequery.uncompressed.js 0644 
    449458pub/System/JQueryPlugin/plugins/livequery/Makefile 0644 
     459pub/System/JQueryPlugin/plugins/loader/jquery.loader.js 0644 
     460pub/System/JQueryPlugin/plugins/loader/jquery.loader.js.gz 0644 
     461pub/System/JQueryPlugin/plugins/loader/jquery.loader.uncompressed.js 0644 
     462pub/System/JQueryPlugin/plugins/loader/Makefile 0644 
    450463pub/System/JQueryPlugin/plugins/localscroll/jquery.localscroll.js 0644 
    451464pub/System/JQueryPlugin/plugins/localscroll/jquery.localscroll.js.gz 0644 
  • trunk/JQueryPlugin/pub/System/JQueryPlugin

    • Property svn:ignore
      •  

        old new  
        1515jquery-1.6.3.js 
        1616jquery-1.6.4.js 
         17jquery-1.7.js 
         18jquery-1.7.1.js 
  • trunk/JQueryPlugin/pub/System/JQueryPlugin/Makefile

    r12518 r13175  
    1010  jquery-1.6.2.js \ 
    1111  jquery-1.6.3.js \ 
    12   jquery-1.6.4.js 
     12  jquery-1.6.4.js \ 
     13  jquery-1.7.js \ 
     14  jquery-1.7.1.js \ 
    1315 
    1416-include Makefile.include 
  • trunk/JQueryPlugin/pub/System/JQueryPlugin/plugins/Makefile

    r11756 r13175  
    11SUBDIRS=\ 
     2  loader \ 
    23  autocomplete \ 
    34  bgiframe \ 
  • trunk/JQueryPlugin/pub/System/JQueryPlugin/plugins/chili/jquery.chili.init.uncompressed.js

    r12511 r13175  
    55    var $el = jQuery(el), 
    66        recipeName = $el.attr("class") || '',  
    7         re; 
     7        re = /^.*\b(bash|cplusplus|csharp|css|delphi|html|java|js|lotusscript|php-f|php|recipes|sql|tml)\b.*$/; 
    88 
    9     recipeName = recipeName.replace(/\s*{.*}\s*/, ""); 
    10     re = /^(bash|cplusplus|csharp|css|delphi|html|java|js|lotusscript|php-f|php|recipes|sql|tml)$/; 
    11  
    12     return (recipeName && re.test(recipeName))?recipeName : ''; 
     9    return (recipeName && re.test(recipeName))?recipeName.replace(re, "$1"): ''; 
    1310  } 
    1411 
  • trunk/JQueryPlugin/pub/System/JQueryPlugin/plugins/cookie/jquery.cookie.uncompressed.js

    r10288 r13175  
    125125        } 
    126126    } else { // get cookie (or all cookies if name is not provided) 
    127         var returnValue = {}; 
    128127        if (document.cookie) { 
    129             var cookies = document.cookie.split(';'); 
     128            var returnValue, 
     129                cookies = document.cookie.split(';'); 
    130130            for (var i = 0; i < cookies.length; i++) { 
    131131                var cookie = jQuery.trim(cookies[i]); 
     
    139139                } 
    140140            } 
     141            return returnValue; 
    141142        } 
    142         return returnValue; 
    143143    } 
    144144}; 
  • trunk/JQueryPlugin/pub/System/JQueryPlugin/themes/foswiki/jquery-ui.uncompressed.css

    r12885 r13175  
    3636----------------------------------*/ 
    3737.ui-widget {  
    38   color: #111; 
     38  color: #333; 
    3939} 
    4040.ui-widget-content {  
    4141  border: 1px solid #bcbcbc; 
    4242  background: #ffffff; 
    43   color: #111;  
     43  color: #333;  
    4444} 
    4545.ui-widget-header {  
    46   color: #111; 
     46  color: #333; 
    4747  text-shadow: 0px 1px #fff; 
    4848  border-bottom: 1px solid #ddd; 
     
    5656} 
    5757.ui-widget-header a {  
    58   color: #111;  
     58  color: #333;  
    5959} 
    6060 
     
    6666.ui-widget-content .ui-state-default, 
    6767.ui-widget-header .ui-state-default {  
    68   color:#111; 
     68  color:#333; 
    6969  text-shadow: 0px 1px #fff; 
    7070  border: 1px solid #bcbcbc; 
     
    8383.ui-state-default a:visited, 
    8484.ui-state-default a { 
    85   color:#111; 
     85  color:#333; 
    8686  text-decoration: none; 
    8787} 
     
    103103.ui-widget-content .ui-state-focus, 
    104104.ui-widget-header .ui-state-focus {  
    105   color:#111; 
     105  color:#333; 
    106106  border-color:#ababab; 
    107107  background: #ffffff; 
     
    11241124/* 
    11251125.ui-datepicker td .ui-state-hover { 
    1126   color:#111; 
     1126  color:#333; 
    11271127  background:#ededed; 
    11281128  border-color:#ababab; 
  • trunk/JQueryPlugin/pub/System/JQueryPlugin/ui/jquery.ui.dialog.init.uncompressed.js

    r12885 r13175  
    4343    $this.find(".jqUIDialogButton").each(function() { 
    4444      var $button = $(this),  
    45           button = $.extend({ text: $button.text() }, $button.metadata()); 
    46       buttons.push(button); 
     45          button = {}, 
     46          href = $button.attr("href"); 
     47 
     48      button.text = $button.text(); 
     49 
     50      if (typeof(href) !== 'undefined') { 
     51        button.click = function() { 
     52          window.location.href = href; 
     53        }; 
     54      } 
     55 
     56      if ($button.is(".jqUIDialogClose")) { 
     57        button.click = function() { 
     58          $(this).dialog("close"); 
     59        }; 
     60      } 
     61 
     62      if ($button.is(".jqUIDialogSubmit")) { 
     63        button.click = function() { 
     64          $(this).find("form:first").submit(); 
     65        }; 
     66      } 
     67           
     68      buttons.push($.extend(button, $button.metadata())); 
    4769    }).remove(); 
    4870 
     
    6385 
    6486  // dialog link 
    65   $(".jqUIDialogLink").livequery(function() { 
    66     $(this).removeClass("jqUIDialogLink").click(function() { 
    67       var $this = $(this),  
    68           href = $this.attr("href"), 
    69           opts = $.extend({}, dialogLinkDefaults, $this.metadata()); 
     87  $(".jqUIDialogLink").live("click", function() { 
     88    var $this = $(this),  
     89        href = $this.attr("href"), 
     90        opts = $.extend({}, dialogLinkDefaults, $this.metadata()); 
    7091 
    71       if (href.match(/^https?:/)) { 
    72         // this is a link to remote data 
    73         $.get(href, function(content) {  
    74           var $content = $(content), 
    75               id = $content.attr('id'); 
    76           if (!id) { 
    77             id = 'dialog-'+foswiki.getUniqueID(); 
    78             $content.attr('id', id); 
    79           } 
    80           if (opts.cache) { 
    81             $this.attr("href", "#"+id); 
    82           }  
    83           $content.hide(); 
    84           $("body").append($content); 
    85           $content.data("autoOpen", true); 
    86         });  
    87       } else { 
    88         // this is a selector 
    89         $(href).dialog("open"); 
    90       } 
     92    if (href.match(/^https?:/)) { 
     93      // this is a link to remote data 
     94      $.get(href, function(content) {  
     95        var $content = $(content), 
     96            id = $content.attr('id'); 
     97        if (!id) { 
     98          id = 'dialog-'+foswiki.getUniqueID(); 
     99          $content.attr('id', id); 
     100        } 
     101        if (opts.cache) { 
     102          $this.attr("href", "#"+id); 
     103        }  
     104        $content.hide(); 
     105        $("body").append($content); 
     106        $content.data("autoOpen", true); 
     107      });  
     108    } else { 
     109      // this is a selector 
     110      $(href).dialog("open"); 
     111    } 
    91112 
    92       return false; 
    93     }); 
     113    return false; 
    94114  }); 
    95115 
Note: See TracChangeset for help on using the changeset viewer.