erbook 9.1.0 → 9.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -938,7 +938,7 @@ output: |
938
938
  %= node.output if node = @nodes_by_type['footer_inside_above'].first
939
939
 
940
940
  % if footer = @nodes_by_type['footer'].first
941
- %= footer.content.to_s.to_xhtml
941
+ %= footer.content_xhtml
942
942
 
943
943
  %= node.output if node = @nodes_by_type['footer_inside_below'].first
944
944
  </div>
@@ -972,6 +972,15 @@ javascript: |
972
972
  ).parent('li');
973
973
  }
974
974
 
975
+ //
976
+ // Returns a jQuery element containing a jQuery UI icon of the given name.
977
+ //
978
+ function ui_icon(name) {
979
+ return $('<div/>').addClass('ui-state-default ui-corner-all').append(
980
+ $('<span/>').addClass('ui-icon ui-icon-' + name)
981
+ );
982
+ }
983
+
975
984
  //--------------------------------------------------------------------------
976
985
  // document location
977
986
  //--------------------------------------------------------------------------
@@ -1175,168 +1184,211 @@ javascript: |
1175
1184
 
1176
1185
  $('.tabs:first > ul').append(
1177
1186
  $('<li/>').append(
1178
- $('<a/>').attr('href', '#_search').
1187
+ $('<a/>').attr('id', '_search_link').attr('href', '#_search').
1179
1188
  text(<%= ERBook::PHRASES['Search'].inspect %>)
1180
- )
1181
- ).after(
1182
- $('<div/>').attr('id', '_search').append(
1183
- $('<form/>').append(
1184
- $('<input/>').attr('type', 'text').attr('name', 'q')
1185
- ).append(
1186
- $('<input/>').attr('type', 'submit').
1187
- val(<%= ERBook::PHRASES['Search'].inspect %>).
1188
- css({'margin-left': '0.125em', 'margin-right': '1em'})
1189
- ).append(
1190
- $('<a/>').attr('href',
1191
- 'https://developer.mozilla.org/En/Core_JavaScript_1.5_Guide:Regular_Expressions#Using_Special_Characters'
1192
- ).text(<%= ERBook::PHRASES['Help'].inspect %>)
1193
- ).append(
1194
- $('<p/>').addClass('status')
1195
- ).submit(function(event) {
1196
- event.preventDefault();
1197
-
1198
- var form = $(this);
1199
- var query = form.find(':text').val().replace(/^\s+|\s+$/g, '');
1200
- var status = form.find('.status');
1201
- var results = form.next();
1202
-
1203
- if (/\S/.test(query)) {
1204
- results.text(''); // clear previous results
1205
- status.text(<%= ERBook::PHRASES['Searching...'].inspect %>);
1206
-
1207
- // timeout allows the status.text() to appear
1208
- setTimeout(function() {
1209
- var num_results = 0;
1210
-
1211
- function emit_result(match) {
1212
- // exclude matches from previous search results,
1213
- // the table of contents, and jQuery UI tab bars
1214
- if (match.closest('#_search, #_contents, .ui-tabs-nav').length) {
1215
- return;
1216
- }
1189
+ ).hide()
1190
+ ).append(
1191
+ $('<form/>').attr('id', '_search_form').append(
1192
+ $('<input/>').attr('type', 'text').attr('name', 'q').
1193
+ addClass('initial').attr('title', <%=
1194
+ ERBook::PHRASES['Search with regular expression'].inspect
1195
+ %>).focus(function() {
1196
+ var box = $(this);
1197
+
1198
+ if (box.is('.initial')) {
1199
+ box.val('').removeClass('initial');
1200
+ }
1201
+ }).blur(function() {
1202
+ var box = $(this);
1217
1203
 
1218
- var excerpt;
1204
+ if (! box.val().match(/\S/)) {
1205
+ box.val(box.attr('title')).addClass('initial');
1206
+ }
1207
+ }).blur()
1208
+ ).append(
1209
+ ui_icon('search').attr('id', '_search_start').click(function() {
1210
+ $('#_search_form').submit();
1211
+ })
1212
+ ).append(
1213
+ ui_icon('cancel').attr('id', '_search_stop').hide().click(function() {
1214
+ $(this).attr('clicked', 'clicked');
1215
+ })
1216
+ ).submit(function(event) {
1217
+ event.preventDefault();
1219
1218
 
1220
- // resolve tab panels into their section title
1221
- // because additional matches, which lie within
1222
- // the content of these tab panels, will come
1223
- if (match.is('.ui-tabs-panel')) {
1224
- excerpt = match.find('.title:first').clone().show();
1225
- }
1226
- else {
1227
- excerpt = match.clone();
1228
- }
1219
+ var search_box = $(this).find(':text');
1220
+ var query = search_box.val().replace(/^\s+|\s+$/g, '');
1229
1221
 
1230
- // highlight the query inside the match excerpt
1231
- excerpt.html(excerpt.html().replace(
1232
- new RegExp('(<[^>]*)?(' + query + ')', 'ig'),
1233
- function($0, $1, $2) {
1234
- // only highlight if not inside an XML tag literal
1235
- return $1 ? $0 :
1236
- '<span class="ui-state-error">' + $2 + '</span>';
1237
- }
1238
- ));
1239
-
1240
- num_results += 1;
1241
- var result = $('<li/>').addClass('result').append(
1242
- $('<blockquote/>').addClass('excerpt').append(excerpt)
1243
- ).attr('id', '_search' + num_results).click(
1244
- function(event) {
1245
- event.stopPropagation();
1246
-
1247
- // save this search result's hash in browser history
1248
- // before revealing the matching element so that
1249
- // the user can press the back button to return to
1250
- // this exact spot in the search results listing
1251
- reveal(this, function() {
1252
- if (!$(event.target).is('a')) {
1253
- reveal(match);
1254
- }
1255
- });
1256
- }
1257
- );
1222
+ // ignore empty queries
1223
+ if (!query.match(/\S/)) {
1224
+ return;
1225
+ }
1226
+
1227
+ // detect invalid regexps
1228
+ try {
1229
+ new RegExp(query);
1230
+ }
1231
+ catch(e) {
1232
+ alert(e);
1233
+ return;
1234
+ }
1235
+
1236
+ // one search at a time
1237
+ if (search_box.attr('disabled')) {
1238
+ return;
1239
+ }
1240
+
1241
+ search_box.attr('disabled', 'disabled');
1242
+
1243
+ // begin the search
1244
+ var status = $('#_search > .status');
1245
+ var results = $('#_search > .results');
1258
1246
 
1259
- // show bread-crumb trail for the match
1260
- var first = true;
1261
- match.parents('.ui-tabs-panel').each(function() {
1262
- var panel = $(this);
1263
- var tab = tab_by_panel(panel);
1247
+ // display the search results tab
1248
+ $('#_search_link').click().parent().show();
1264
1249
 
1265
- if (tab.length) {
1266
- if (!first) {
1267
- result.prepend(' &rang; ');
1268
- }
1269
- first = false;
1250
+ // clear previous search results
1251
+ results.text('');
1252
+ status.text(<%= ERBook::PHRASES['Searching...'].inspect %>);
1270
1253
 
1271
- result.prepend(tab.find('a').clone());
1254
+ // timeout allows status updates to appear
1255
+ setTimeout(function() {
1256
+ var num_results = 0;
1257
+
1258
+ function emit_result(match) {
1259
+ // exclude matches from previous search results,
1260
+ // the table of contents, and jQuery UI tab bars
1261
+ if (match.closest('#_search, #_contents, .ui-tabs-nav').length) {
1262
+ return;
1263
+ }
1264
+
1265
+ var excerpt;
1266
+
1267
+ // resolve tab panels into their section title
1268
+ // because additional matches, which lie within
1269
+ // the content of these tab panels, will come
1270
+ if (match.is('.ui-tabs-panel')) {
1271
+ excerpt = match.find('.title:first').clone().show();
1272
+ }
1273
+ else {
1274
+ excerpt = match.clone();
1275
+ }
1276
+
1277
+ // highlight the query inside the match excerpt
1278
+ excerpt.html(excerpt.html().replace(
1279
+ new RegExp('(<[^>]*)?(' + query + ')', 'ig'),
1280
+ function($0, $1, $2) {
1281
+ // only highlight if not inside an XML tag literal
1282
+ return $1 ? $0 :
1283
+ '<span class="ui-state-error">' + $2 + '</span>';
1284
+ }
1285
+ ));
1286
+
1287
+ num_results += 1;
1288
+ var result = $('<li/>').addClass('result').append(
1289
+ $('<blockquote/>').addClass('excerpt').append(excerpt)
1290
+ ).attr('id', '_search' + num_results).click(
1291
+ function(event) {
1292
+ event.stopPropagation();
1293
+
1294
+ // save this search result's hash in browser history
1295
+ // before revealing the matching element so that
1296
+ // the user can press the back button to return to
1297
+ // this exact spot in the search results listing
1298
+ reveal(this, function() {
1299
+ if (!$(event.target).is('a')) {
1300
+ reveal(match);
1272
1301
  }
1273
1302
  });
1303
+ }
1304
+ );
1274
1305
 
1275
- results.append(result);
1306
+ // show bread-crumb trail for the match
1307
+ var first = true;
1308
+ match.parents('.ui-tabs-panel').each(function() {
1309
+ var panel = $(this);
1310
+ var tab = tab_by_panel(panel);
1276
1311
 
1277
- // unhide any hidden elements in the search result
1278
- result.find(':hidden').removeClass('ui-tabs-hide').show();
1312
+ if (tab.length) {
1313
+ if (!first) {
1314
+ result.prepend(' &rang; ');
1315
+ }
1316
+ first = false;
1279
1317
 
1280
- // remove tab bars (used for titles) and mini navigation menus
1281
- result.find('.ui-tabs-nav, .ui-tabs-panel > .nav').remove();
1282
- };
1318
+ result.prepend(tab.find('a').clone());
1319
+ }
1320
+ });
1283
1321
 
1284
- var matching_elems = $('#_body').
1285
- find(':matches("'+ query.replace(/"/, '\\"') +'")');
1322
+ results.append(result);
1286
1323
 
1287
- var prev_match;
1288
- var prev_elem;
1324
+ // unhide any hidden elements in the search result
1325
+ result.find(':hidden').removeClass('ui-tabs-hide').show();
1289
1326
 
1290
- function process_match(i, n) {
1291
- status.text(status.text().
1292
- replace(/( \d+%)?$/, ' ' + Math.round(i / n * 100) + '%'));
1327
+ // remove tab bars (used for titles) and mini navigation menus
1328
+ result.find('.ui-tabs-nav, .ui-tabs-panel > .nav').remove();
1329
+ };
1293
1330
 
1294
- var elem = matching_elems.eq(i);
1331
+ var matching_elems = $('#_body').
1332
+ find(':matches("'+ query.replace(/"/, '\\"') +'")');
1295
1333
 
1296
- // ascend to a larger container for more context
1297
- var match = elem.closest('pre,ul,ol,dl,table,p,div');
1298
- if (!match.length) {
1299
- match = elem;
1300
- }
1334
+ status.text('').progressbar();
1335
+ var start_button = $('#_search_start').hide();
1336
+ var stop_button = $('#_search_stop').show();
1301
1337
 
1302
- if (
1303
- prev_match && prev_match.length &&
1304
- match.get(0) !== prev_match.get(0) && // unique matches only
1305
- elem.parent().get(0) !== prev_elem.get(0) // leaf nodes only
1306
- ) {
1307
- emit_result(prev_match);
1308
- }
1338
+ var prev_match;
1339
+ var prev_elem;
1309
1340
 
1310
- prev_elem = elem;
1311
- prev_match = match;
1341
+ function process_match(i, n) {
1342
+ status.progressbar('value', Math.round(i / n * 100));
1312
1343
 
1313
- if (i < n) {
1314
- setTimeout(function() {
1315
- process_match(i + 1, n);
1316
- }, 0);
1317
- }
1318
- else {
1319
- // handle the last item in this two-stage prev/curr loop
1320
- if (prev_match && prev_match.length) {
1321
- emit_result(prev_match);
1322
- }
1344
+ var elem = matching_elems.eq(i);
1323
1345
 
1324
- if (num_results > 0) {
1325
- status.text(<%= ERBook::PHRASES['%d matches', 0].inspect %>.replace('0', num_results));
1326
- }
1327
- else {
1328
- status.html(<%= ERBook::PHRASES['Not found'].inspect %>);
1329
- }
1330
- }
1346
+ // ascend to a larger container for more context
1347
+ var match = elem.closest('pre,ul,ol,dl,table,p,div');
1348
+ if (!match.length) {
1349
+ match = elem;
1350
+ }
1351
+
1352
+ if (
1353
+ prev_match && prev_match.length &&
1354
+ match.get(0) !== prev_match.get(0) && // unique matches only
1355
+ elem.parent().get(0) !== prev_elem.get(0) // leaf nodes only
1356
+ ) {
1357
+ emit_result(prev_match);
1358
+ }
1359
+
1360
+ prev_elem = elem;
1361
+ prev_match = match;
1362
+
1363
+ if (i < n && !stop_button.attr('clicked')) {
1364
+ // timeout allows status updates to appear
1365
+ setTimeout(function() { process_match(i + 1, n); }, 0);
1366
+ }
1367
+ else {
1368
+ // handle the last item in this two-stage prev/curr loop
1369
+ if (prev_match && prev_match.length) {
1370
+ emit_result(prev_match);
1331
1371
  }
1332
1372
 
1333
- process_match(0, matching_elems.length);
1373
+ status.progressbar('destroy').text(<%=
1374
+ ERBook::PHRASES['%d results', 0].inspect
1375
+ %>.replace('0', num_results));
1334
1376
 
1335
- }, 0);
1377
+ search_box.removeAttr('disabled');
1378
+ stop_button.hide().removeAttr('clicked');
1379
+ start_button.show();
1380
+ }
1336
1381
  }
1337
1382
 
1338
- return false;
1339
- })
1383
+ process_match(0, matching_elems.length);
1384
+
1385
+ }, 0);
1386
+
1387
+ return false;
1388
+ })
1389
+ ).after(
1390
+ $('<div/>').attr('id', '_search').append(
1391
+ $('<p/>').addClass('status')
1340
1392
  ).append(
1341
1393
  $('<ol/>').addClass('results')
1342
1394
  )
@@ -1386,7 +1438,7 @@ javascript: |
1386
1438
  }
1387
1439
 
1388
1440
  return true;
1389
- })
1441
+ }).css('margin-right', '0.3em')
1390
1442
  ).append(
1391
1443
  $('<label/>').attr('for', 'printer_friendly_toggle').
1392
1444
  text(<%= ERBook::PHRASES['Printer friendly'].inspect %>)
@@ -1460,6 +1512,15 @@ javascript: |
1460
1512
  // make external hyperlinks open in a separate window
1461
1513
  $('a[href]').not('[href^=#]').attr('target', '_blank');
1462
1514
 
1515
+ //--------------------------------------------------------------------------
1516
+ // style jQuery UI icons
1517
+ //--------------------------------------------------------------------------
1518
+
1519
+ $('.ui-icon').parent().hover(
1520
+ function() { $(this).addClass('ui-state-hover'); },
1521
+ function() { $(this).removeClass('ui-state-hover'); }
1522
+ );
1523
+
1463
1524
  //--------------------------------------------------------------------------
1464
1525
  // unveil the document
1465
1526
  //--------------------------------------------------------------------------
@@ -1834,8 +1895,30 @@ styles: # these are SASS templates
1834
1895
  text-align: center
1835
1896
 
1836
1897
 
1898
+ #_search_form
1899
+ text-align: right
1900
+ font-weight: normal
1901
+
1902
+ input
1903
+ margin-top: 0.25em
1904
+
1905
+ &.initial
1906
+ color: gray
1907
+ font-style: italic
1908
+
1909
+ #_search_start, #_search_stop
1910
+ float: right
1911
+
1912
+ // 1:2 ratio
1913
+ margin: 0.1625em
1914
+ padding: 0.325em
1915
+
1916
+ &:hover
1917
+ cursor: pointer
1918
+
1919
+
1837
1920
  #_search
1838
- > form
1921
+ > .status
1839
1922
  text-align: center
1840
1923
 
1841
1924
  > .results > .result > .excerpt:hover
@@ -397,9 +397,9 @@
397
397
  ----------------------------------*/
398
398
  .ui-tabs { padding: .2em; zoom: 1; }
399
399
  .ui-tabs .ui-tabs-nav { list-style: none; position: relative; padding: .2em .2em 0; }
400
- .ui-tabs .ui-tabs-nav li { position: relative; float: left; margin: 0 .2em -1px 0; padding: 0 0 1px 0; }
400
+ .ui-tabs .ui-tabs-nav li { position: relative; float: left; margin: 0 .2em -1px 0; padding: 0; }
401
401
  .ui-tabs .ui-tabs-nav li a { float: left; text-decoration: none; padding: .5em 1em; }
402
- .ui-tabs .ui-tabs-nav li.ui-tabs-selected { padding-bottom: 2px; border-bottom-width: 0 !important; }
402
+ .ui-tabs .ui-tabs-nav li.ui-tabs-selected { padding-bottom: 1px; border-bottom-width: 0; }
403
403
  .ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; }
404
404
  .ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
405
405
  .ui-tabs .ui-tabs-panel { padding: 1em 1.4em; display: block; border-width: 0; background: none; }
@@ -20,6 +20,18 @@ jQuery.ui||(function(c){var i=c.fn.remove,d=c.browser.mozilla&&(parseFloat(c.bro
20
20
  * ui.core.js
21
21
  */
22
22
  (function(a){a.widget("ui.tabs",{_init:function(){if(this.options.deselectable!==undefined){this.options.collapsible=this.options.deselectable}this._tabify(true)},_setData:function(b,c){if(b=="selected"){if(this.options.collapsible&&c==this.options.selected){return}this.select(c)}else{this.options[b]=c;if(b=="deselectable"){this.options.collapsible=c}this._tabify()}},_tabId:function(b){return b.title&&b.title.replace(/\s/g,"_").replace(/[^A-Za-z0-9\-_:\.]/g,"")||this.options.idPrefix+a.data(b)},_sanitizeSelector:function(b){return b.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+a.data(this.list[0]));return a.cookie.apply(null,[b].concat(a.makeArray(arguments)))},_ui:function(c,b){return{tab:c,panel:b,index:this.anchors.index(c)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b=a(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(n){this.list=this.element.children("ul:first");this.lis=a("li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return a("a",this)[0]});this.panels=a([]);var p=this,d=this.options;var c=/^#.+/;this.anchors.each(function(r,o){var q=a(o).attr("href");var s=q.split("#")[0],u;if(s&&(s===location.toString().split("#")[0]||(u=a("base")[0])&&s===u.href)){q=o.hash;o.href=q}if(c.test(q)){p.panels=p.panels.add(p._sanitizeSelector(q))}else{if(q!="#"){a.data(o,"href.tabs",q);a.data(o,"load.tabs",q.replace(/#.*$/,""));var w=p._tabId(o);o.href="#"+w;var v=a("#"+w);if(!v.length){v=a(d.panelTemplate).attr("id",w).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(p.panels[r-1]||p.list);v.data("destroy.tabs",true)}p.panels=p.panels.add(v)}else{d.disabled.push(r)}}});if(n){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all");this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(d.selected===undefined){if(location.hash){this.anchors.each(function(q,o){if(o.hash==location.hash){d.selected=q;return false}})}if(typeof d.selected!="number"&&d.cookie){d.selected=parseInt(p._cookie(),10)}if(typeof d.selected!="number"&&this.lis.filter(".ui-tabs-selected").length){d.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))}d.selected=d.selected||0}else{if(d.selected===null){d.selected=-1}}d.selected=((d.selected>=0&&this.anchors[d.selected])||d.selected<0)?d.selected:0;d.disabled=a.unique(d.disabled.concat(a.map(this.lis.filter(".ui-state-disabled"),function(q,o){return p.lis.index(q)}))).sort();if(a.inArray(d.selected,d.disabled)!=-1){d.disabled.splice(a.inArray(d.selected,d.disabled),1)}this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active");if(d.selected>=0&&this.anchors.length){this.panels.eq(d.selected).removeClass("ui-tabs-hide");this.lis.eq(d.selected).addClass("ui-tabs-selected ui-state-active");p.element.queue("tabs",function(){p._trigger("show",null,p._ui(p.anchors[d.selected],p.panels[d.selected]))});this.load(d.selected)}a(window).bind("unload",function(){p.lis.add(p.anchors).unbind(".tabs");p.lis=p.anchors=p.panels=null})}else{d.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))}this.element[d.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");if(d.cookie){this._cookie(d.selected,d.cookie)}for(var g=0,m;(m=this.lis[g]);g++){a(m)[a.inArray(g,d.disabled)!=-1&&!a(m).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled")}if(d.cache===false){this.anchors.removeData("cache.tabs")}this.lis.add(this.anchors).unbind(".tabs");if(d.event!="mouseover"){var f=function(o,i){if(i.is(":not(.ui-state-disabled)")){i.addClass("ui-state-"+o)}};var j=function(o,i){i.removeClass("ui-state-"+o)};this.lis.bind("mouseover.tabs",function(){f("hover",a(this))});this.lis.bind("mouseout.tabs",function(){j("hover",a(this))});this.anchors.bind("focus.tabs",function(){f("focus",a(this).closest("li"))});this.anchors.bind("blur.tabs",function(){j("focus",a(this).closest("li"))})}var b,h;if(d.fx){if(a.isArray(d.fx)){b=d.fx[0];h=d.fx[1]}else{b=h=d.fx}}function e(i,o){i.css({display:""});if(a.browser.msie&&o.opacity){i[0].style.removeAttribute("filter")}}var k=h?function(i,o){a(i).closest("li").removeClass("ui-state-default").addClass("ui-tabs-selected ui-state-active");o.hide().removeClass("ui-tabs-hide").animate(h,h.duration||"normal",function(){e(o,h);p._trigger("show",null,p._ui(i,o[0]))})}:function(i,o){a(i).closest("li").removeClass("ui-state-default").addClass("ui-tabs-selected ui-state-active");o.removeClass("ui-tabs-hide");p._trigger("show",null,p._ui(i,o[0]))};var l=b?function(o,i){i.animate(b,b.duration||"normal",function(){p.lis.removeClass("ui-tabs-selected ui-state-active").addClass("ui-state-default");i.addClass("ui-tabs-hide");e(i,b);p.element.dequeue("tabs")})}:function(o,i,q){p.lis.removeClass("ui-tabs-selected ui-state-active").addClass("ui-state-default");i.addClass("ui-tabs-hide");p.element.dequeue("tabs")};this.anchors.bind(d.event+".tabs",function(){var o=this,r=a(this).closest("li"),i=p.panels.filter(":not(.ui-tabs-hide)"),q=a(p._sanitizeSelector(this.hash));if((r.hasClass("ui-tabs-selected")&&!d.collapsible)||r.hasClass("ui-state-disabled")||r.hasClass("ui-state-processing")||p._trigger("select",null,p._ui(this,q[0]))===false){this.blur();return false}d.selected=p.anchors.index(this);p.abort();if(d.collapsible){if(r.hasClass("ui-tabs-selected")){d.selected=-1;if(d.cookie){p._cookie(d.selected,d.cookie)}p.element.queue("tabs",function(){l(o,i)}).dequeue("tabs");this.blur();return false}else{if(!i.length){if(d.cookie){p._cookie(d.selected,d.cookie)}p.element.queue("tabs",function(){k(o,q)});p.load(p.anchors.index(this));this.blur();return false}}}if(d.cookie){p._cookie(d.selected,d.cookie)}if(q.length){if(i.length){p.element.queue("tabs",function(){l(o,i)})}p.element.queue("tabs",function(){k(o,q)});p.load(p.anchors.index(this))}else{throw"jQuery UI Tabs: Mismatching fragment identifier."}if(a.browser.msie){this.blur()}});this.anchors.bind("click.tabs",function(){return false})},destroy:function(){var b=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var c=a.data(this,"href.tabs");if(c){this.href=c}var d=a(this).unbind(".tabs");a.each(["href","load","cache"],function(e,f){d.removeData(f+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){if(a.data(this,"destroy.tabs")){a(this).remove()}else{a(this).removeClass(["ui-state-default","ui-corner-top","ui-tabs-selected","ui-state-active","ui-state-hover","ui-state-focus","ui-state-disabled","ui-tabs-panel","ui-widget-content","ui-corner-bottom","ui-tabs-hide"].join(" "))}});if(b.cookie){this._cookie(null,b.cookie)}},add:function(e,d,c){if(c===undefined){c=this.anchors.length}var b=this,g=this.options,i=a(g.tabTemplate.replace(/#\{href\}/g,e).replace(/#\{label\}/g,d)),h=!e.indexOf("#")?e.replace("#",""):this._tabId(a("a",i)[0]);i.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var f=a("#"+h);if(!f.length){f=a(g.panelTemplate).attr("id",h).data("destroy.tabs",true)}f.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(c>=this.lis.length){i.appendTo(this.list);f.appendTo(this.list[0].parentNode)}else{i.insertBefore(this.lis[c]);f.insertBefore(this.panels[c])}g.disabled=a.map(g.disabled,function(k,j){return k>=c?++k:k});this._tabify();if(this.anchors.length==1){i.addClass("ui-tabs-selected ui-state-active");f.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){b._trigger("show",null,b._ui(b.anchors[0],b.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[c],this.panels[c]))},remove:function(b){var d=this.options,e=this.lis.eq(b).remove(),c=this.panels.eq(b).remove();if(e.hasClass("ui-tabs-selected")&&this.anchors.length>1){this.select(b+(b+1<this.anchors.length?1:-1))}d.disabled=a.map(a.grep(d.disabled,function(g,f){return g!=b}),function(g,f){return g>=b?--g:g});this._tabify();this._trigger("remove",null,this._ui(e.find("a")[0],c[0]))},enable:function(b){var c=this.options;if(a.inArray(b,c.disabled)==-1){return}this.lis.eq(b).removeClass("ui-state-disabled");c.disabled=a.grep(c.disabled,function(e,d){return e!=b});this._trigger("enable",null,this._ui(this.anchors[b],this.panels[b]))},disable:function(c){var b=this,d=this.options;if(c!=d.selected){this.lis.eq(c).addClass("ui-state-disabled");d.disabled.push(c);d.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[c],this.panels[c]))}},select:function(b){if(typeof b=="string"){b=this.anchors.index(this.anchors.filter("[href$="+b+"]"))}else{if(b===null){b=-1}}if(b==-1&&this.options.collapsible){b=this.options.selected}this.anchors.eq(b).trigger(this.options.event+".tabs")},load:function(e){var c=this,g=this.options,b=this.anchors.eq(e)[0],d=a.data(b,"load.tabs");this.abort();if(!d||this.element.queue("tabs").length!==0&&a.data(b,"cache.tabs")){this.element.dequeue("tabs");return}this.lis.eq(e).addClass("ui-state-processing");if(g.spinner){var f=a("span",b);f.data("label.tabs",f.html()).html(g.spinner)}this.xhr=a.ajax(a.extend({},g.ajaxOptions,{url:d,success:function(i,h){a(c._sanitizeSelector(b.hash)).html(i);c._cleanup();if(g.cache){a.data(b,"cache.tabs",true)}c._trigger("load",null,c._ui(c.anchors[e],c.panels[e]));try{g.ajaxOptions.success(i,h)}catch(j){}c.element.dequeue("tabs")}}))},abort:function(){this.element.queue([]);this.panels.stop(false,true);if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup()},url:function(c,b){this.anchors.eq(c).removeData("cache.tabs").data("load.tabs",b)},length:function(){return this.anchors.length}});a.extend(a.ui.tabs,{version:"1.7.2",getter:"length",defaults:{ajaxOptions:null,cache:false,cookie:null,collapsible:false,disabled:[],event:"click",fx:null,idPrefix:"ui-tabs-",panelTemplate:"<div></div>",spinner:"<em>Loading&#8230;</em>",tabTemplate:'<li><a href="#{href}"><span>#{label}</span></a></li>'}});a.extend(a.ui.tabs.prototype,{rotation:null,rotate:function(d,f){var b=this,g=this.options;var c=b._rotate||(b._rotate=function(h){clearTimeout(b.rotation);b.rotation=setTimeout(function(){var i=g.selected;b.select(++i<b.anchors.length?i:0)},d);if(h){h.stopPropagation()}});var e=b._unrotate||(b._unrotate=!f?function(h){if(h.clientX){b.rotate(null)}}:function(h){t=g.selected;c()});if(d){this.element.bind("tabsshow",c);this.anchors.bind(g.event+".tabs",e);c()}else{clearTimeout(b.rotation);this.element.unbind("tabsshow",c);this.anchors.unbind(g.event+".tabs",e);delete this._rotate;delete this._unrotate}}})})(jQuery);;/*
23
+ * jQuery UI Progressbar 1.7.2
24
+ *
25
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
26
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
27
+ * and GPL (GPL-LICENSE.txt) licenses.
28
+ *
29
+ * http://docs.jquery.com/UI/Progressbar
30
+ *
31
+ * Depends:
32
+ * ui.core.js
33
+ */
34
+ (function(a){a.widget("ui.progressbar",{_init:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this._valueMin(),"aria-valuemax":this._valueMax(),"aria-valuenow":this._value()});this.valueDiv=a('<div class="ui-progressbar-value ui-widget-header ui-corner-left"></div>').appendTo(this.element);this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow").removeData("progressbar").unbind(".progressbar");this.valueDiv.remove();a.widget.prototype.destroy.apply(this,arguments)},value:function(b){if(b===undefined){return this._value()}this._setData("value",b);return this},_setData:function(b,c){switch(b){case"value":this.options.value=c;this._refreshValue();this._trigger("change",null,{});break}a.widget.prototype._setData.apply(this,arguments)},_value:function(){var b=this.options.value;if(b<this._valueMin()){b=this._valueMin()}if(b>this._valueMax()){b=this._valueMax()}return b},_valueMin:function(){var b=0;return b},_valueMax:function(){var b=100;return b},_refreshValue:function(){var b=this.value();this.valueDiv[b==this._valueMax()?"addClass":"removeClass"]("ui-corner-right");this.valueDiv.width(b+"%");this.element.attr("aria-valuenow",b)}});a.extend(a.ui.progressbar,{version:"1.7.2",defaults:{value:0}})})(jQuery);;/*
23
35
  * jQuery UI Effects 1.7.2
24
36
  *
25
37
  * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)