Changes in [2015:207daf1715b5:2016:de3cc666a75c]
- Files:
-
- 1 added
- 4 deleted
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
admin/blog_pref.php
r1979 r2014 326 326 form::combo('url_scan',$url_scan_combo,$blog_settings->system->url_scan).'</p>'; 327 327 328 # Test URL of blog by testing it's ATOM feed 329 $file = $blog_url.$core->url->getURLFor('feed','atom'); 330 $path = ''; 331 $status = '404'; 332 $content = ''; 333 $client = netHttp::initClient($file,$path); 334 if ($client !== false) { 335 $client->setTimeout(4); 336 $client->setUserAgent($_SERVER['HTTP_USER_AGENT']); 337 $client->get($path); 338 $status = $client->getStatus(); 339 $content = $client->getContent(); 340 } 341 if ($status != '200') { 342 // Might be 404 (URL not found), 670 (blog not online), ... 343 echo 344 '<p class="form-note warn">'. 345 sprintf(__('The URL of blog or the URL scan method might not be well set (<code>%s</code> return a <strong>%s</strong> status).'), 346 $file,$status). 347 '</p>'; 348 } else { 349 if (substr($content,0,6) != '<?xml ') { 350 // Not well formed XML feed 328 try 329 { 330 # Test URL of blog by testing it's ATOM feed 331 $file = $blog_url.$core->url->getURLFor('feed','atom'); 332 $path = ''; 333 $status = '404'; 334 $content = ''; 335 336 $client = netHttp::initClient($file,$path); 337 if ($client !== false) { 338 $client->setTimeout(4); 339 $client->setUserAgent($_SERVER['HTTP_USER_AGENT']); 340 $client->get($path); 341 $status = $client->getStatus(); 342 $content = $client->getContent(); 343 } 344 if ($status != '200') { 345 // Might be 404 (URL not found), 670 (blog not online), ... 351 346 echo 352 347 '<p class="form-note warn">'. 353 sprintf(__('The URL of blog or the URL scan method might not be well set (<code>%s</code> does not return an ATOM feed).'),354 $file ).348 sprintf(__('The URL of blog or the URL scan method might not be well set (<code>%s</code> return a <strong>%s</strong> status).'), 349 $file,$status). 355 350 '</p>'; 351 } else { 352 if (substr($content,0,6) != '<?xml ') { 353 // Not well formed XML feed 354 echo 355 '<p class="form-note warn">'. 356 sprintf(__('The URL of blog or the URL scan method might not be well set (<code>%s</code> does not return an ATOM feed).'), 357 $file). 358 '</p>'; 359 } 356 360 } 357 361 } 358 362 catch (Exception $e) 363 { 364 $core->error->add($e->getMessage()); 365 } 359 366 echo 360 367 '<p><label for="blog_status">'.__('Blog status:').'</label>'. -
admin/js/jquery/jquery.pageTabs.js
r1792 r2010 1 jQuery.pageTabs = function(start_tab,settings) { 2 return new jQuery._pageTabs(start_tab,settings); 3 }; 1 (function($) { 2 'use strict'; 3 4 $.pageTabs = function(start_tab, opts) { 5 var defaults = { 6 containerClass: 'part-tabs', 7 partPrefix: 'part-', 8 contentClass: 'multi-part', 9 activeClass: 'part-tabs-active', 10 idTabPrefix: 'part-tabs-' 11 }; 12 13 var options = $.extend({}, defaults, opts); 14 var active_tab = start_tab || ''; 15 var hash = $.pageTabsGetHash(); 4 16 5 jQuery._pageTabs = function(start_tab,settings) { 6 var defaults = { 7 className: 'multi-part', 8 listClassName: 'part-tabs', 9 breakerClassName: 'clear' 17 if (hash !== undefined && hash) { 18 $('ul li a[href$="#'+hash+'"]').parent().trigger('click'); 19 active_tab = hash; 20 } else { // open first part 21 active_tab = $('.'+options.contentClass+':eq(0)').attr('id'); 22 } 23 24 createTabs(active_tab, options); 25 26 $('ul li', '.'+options.containerClass).click(function(e) { 27 $(this).parent().find('li.'+options.activeClass).removeClass(options.activeClass); 28 $(this).addClass(options.activeClass); 29 $('.'+options.contentClass+'.active').removeClass('active').hide(); 30 $('#'+options.partPrefix+getId($(this).find('a').attr('href'))).addClass('active').show(); 31 }); 32 33 return this; 34 }; 35 36 var createTabs = function createTabs(start_tab, options) { 37 var lis = [], li_class = '', to_trigger = null; 38 39 $('.'+options.contentClass).each(function() { 40 if (start_tab != $(this).attr('id')) { 41 $(this).hide(); 42 li_class = ''; 43 } else { 44 $(this).addClass('active'); 45 to_trigger = $(this); 46 li_class = ' class="'+options.activeClass+'"'; 47 } 48 lis.push('<li id="'+options.idTabPrefix+$(this).attr('id')+'"'+li_class 49 +'><a href="#'+$(this).attr('id')+'">'+$(this).attr('title')+'</a></li>'); 50 $(this).attr('id', options.partPrefix + $(this).attr('id')); 51 }); 52 53 $('<div class="'+options.containerClass+'"><ul>'+lis.join('')+'</ul></div>') 54 .insertBefore($('.'+options.contentClass).get(0)); 55 56 if (to_trigger != null) { 57 $(to_trigger).onetabload(); 58 $(to_trigger).tabload(); 59 } 60 61 }; 62 63 var getId = function getId(href) { 64 return href.split('#').join(''); 10 65 }; 11 66 12 var index = start_tab ? start_tab : 0; 13 var hash = document.location.hash.split('#').join(''); 14 if( hash != '' ) { 15 var index = hash; 16 } 17 18 this.params = jQuery.extend(defaults,settings); 19 this.divs = jQuery('div.'+this.params.className); 20 this.createList(); 21 this.showDiv(index); 22 var pageTabs = this; 23 24 window.onhashchange = function (event) { 25 pageTabs.showDiv(document.location.hash.split('#').join('')); 26 } 27 }; 28 29 jQuery._pageTabs.prototype = { 30 items: new Array(), 31 32 createList: function() { 33 if (this.divs.length <= 0) { 34 return; 35 } 36 37 this.block = document.createElement('div'); 38 this.block.className = this.params.listClassName; 39 this.list = document.createElement('ul'); 40 //this.list.className = this.params.listClassName; 41 this.block.appendChild(this.list); 42 var li, a; 43 44 var This = this; 45 var i=0; 46 jQuery('.'+this.params.className).each(function() { 47 if (this.tagName == "DIV") { 48 li = document.createElement('li'); 49 a = document.createElement('a'); 50 $(a).html(this.title); 51 this.title = ''; 52 a.fn = This.showDiv; 53 a.index = this.id || i; 54 a.href = '#'+a.index; 55 li.id = "part-tabs-"+a.index; 56 a.obj = This; 57 li.appendChild(a); 58 This.list.appendChild(li); 59 This.items[i] = li; 60 i++; 61 } else { 62 li = document.createElement('li'); 63 li.className = This.params.listClassName+'-link'; 64 li.appendChild(this); 65 This.list.appendChild(li); 66 } 67 }); 68 69 this.breaker = document.createElement('br'); 70 this.breaker.className = this.params.breakerClassName; 71 72 jQuery(this.divs.get(0)).before(this.block); 73 jQuery(this.block).after(this.breaker); 74 }, 75 76 showDiv: function(index) { 77 var This = this; 78 var i = 0; 79 var to_trigger = null; 80 var exists = false; 81 82 this.divs.each(function() { 83 if ((this.id != '' && this.id == index) || i == index) { 84 exists = true; 85 } 86 i++; 87 }); 88 89 i = 0; 90 91 if( exists ) { 92 this.divs.each(function() { 93 if ((this.id != '' && this.id == index) || i == index) { 94 jQuery(this).show(0); 95 This.items[i].className = This.params.listClassName+'-active'; 96 to_trigger = i; 97 } else { 98 jQuery(this).hide(0); 99 This.items[i].className = ''; 100 } 101 102 i++; 103 }); 104 } 105 106 if (to_trigger != null) { 107 jQuery(this.divs[to_trigger]).onetabload(); 108 jQuery(this.divs[to_trigger]).tabload(); 109 } 110 } 111 }; 67 $.pageTabsGetHash = function() { 68 return document.location.hash.split('#').join(''); 69 }; 70 })(jQuery); 112 71 113 72 jQuery.fn.tabload = function(f) { … … 122 81 return this; 123 82 }; 83 124 84 jQuery.fn.onetabload = function(f) { 125 85 this.each(function() { -
admin/js/prelude.js
r1947 r2009 7 7 aElts[i].onfocus=function() { 8 8 $('#prelude a').removeClass('hidden'); 9 $('#wrapper').css('padding-top', '1em'); // il vaudrait mieux ajouter une class with-prelude … 10 $('#help-button').css('top', '1em'); // … mais addClass ne marche pas (?) 11 $('#collapser').css('top', '1em'); 9 12 } 10 13 } -
admin/style/default.css
r2006 r2013 25 25 display: table; 26 26 } 27 #wrapper {27 #wrapper, #wrapper.with-prelude { 28 28 position: relative; 29 29 padding-top: 1.5em; … … 865 865 margin: 0; 866 866 font-size: 1em; 867 vertical-align: top; 867 868 } 868 869 /* h1 */ 869 870 h1 { 870 padding: 0;871 margin: 0;872 871 text-indent: -1000px; 873 872 width: 16.5em; … … 891 890 max-width: 20em; 892 891 } 893 #top-info-blog a{894 margin- left: 1.33em;892 .with-js #top-info-blog select, .no-js #top-info-blog input[type=submit] { 893 margin-right: 1.33em; 895 894 } 896 895 #top-info-blog input[type=submit] { … … 908 907 /* top-info-user */ 909 908 #top-info-user { 910 padding : 0 18px 0 0;909 padding-right: 18px; 911 910 list-style-type: none; 912 911 text-align: right; … … 1008 1007 } 1009 1008 #qx:focus { 1010 border -color:#bee74b;1009 border: 1px solid #bee74b; 1011 1010 } 1012 1011 #search-menu input[type="submit"] { … … 2085 2084 } 2086 2085 /* password indicator */ 2086 .install .pw-table, .install .pw-cell, .install .pwindicator { 2087 display: block; 2088 } 2087 2089 .pw-table { 2088 2090 display: table; -
inc/admin/lib.dc.page.php
r2005 r2011 452 452 '<p>'. 453 453 sprintf(__('See also %s'),sprintf('<a href="help.php">%s</a>',__('the global help'))). 454 ' </p>'.454 '.</p>'. 455 455 '</div></div>'; 456 456 } … … 649 649 '<script type="text/javascript">'."\n". 650 650 "//<![CDATA[\n". 651 "\$(function() {\n". 652 " pagetabs = \$.pageTabs(".$default.");\n". 653 "});\n". 654 "\n//]]>\n". 655 "</script>\n". 656 "<!--[if lt IE 8]>\n". 657 self::jsLoad('js/ie7/ie7-hashchange.js'). 658 '<script type="text/javascript">'."\n". 659 "//<![CDATA[\n". 660 "\$(function() {". 661 "\$(window).hashchange( function(){". 662 "pagetabs.showDiv(document.location.hash.split('#').join(''));". 663 "});". 664 "});". 651 '$(function() {'."\n". 652 '$.pageTabs(".$default.");'."\n". 653 '});'."\n". 665 654 "\n//]]>\n". 666 "</script>\n". 667 "<![endif]-->\n"; 668 } 655 "</script>\n"; 656 } 669 657 670 658 public static function jsModal() -
tests/functional/fixtures/tabs.html
r1737 r2010 1 2 <!-- page tabs --> 3 <script type="text/javascript" src="../../admin/js/jquery/jquery.pageTabs.js"></script> 4 5 <div id="tab-1" class="multi-part" title="Tab 1"> 6 <h3>Tab 1 - content</h3> 1 <div class="multi-part" id="user-options" title="My options"> 2 <p>My options</p> 7 3 </div> 8 <div id="tab-2" class="multi-part" title="Tab 2">9 <h3>Tab 2 - content</h3>4 <div class="multi-part" id="user-profile" title="My profile"> 5 <p>My profile</p> 10 6 </div> 11 <div id="tab-3" class="multi-part" title="Tab 3">12 <h3>Tab 3 - content</h3>13 </div >7 <div class="multi-part" id="user-favorites" title="My favorites"> 8 <p>My favorites</p> 9 </div -
tests/functional/index.html
r1737 r2010 7 7 <script type="text/javascript" src="lib/jasmine.js"></script> 8 8 <script type="text/javascript" src="lib/jasmine-html.js"></script> 9 9 10 <!-- use same jquery --> 10 11 <script type="text/javascript" src="../../admin/js/jquery/jquery.js"></script> … … 14 15 <script type="text/javascript" src="../../admin/js/_users_actions.js"></script> 15 16 <script type="text/javascript" src="../../admin/js/common.js"></script> 17 <script type="text/javascript" src="../../admin/js/jquery/jquery.pageTabs.js"></script> 16 18 17 19 <script type="text/javascript" src="js/fix_include.js"></script> … … 28 30 <script type="text/javascript" src="../../admin/js/jsUpload/jquery.fileupload-resize.js"></script> 29 31 <script type="text/javascript" src="../../admin/js/jsUpload/jquery.fileupload-ui.js"></script> 30 <script type="text/javascript" src="../../admin/js/_media.js"></script> 31 32 <script type="text/javascript" src="../../admin/js/_media.js"></script> 33 32 34 <!-- <script type="text/javascript" src="spec/users_actions.js"></script> --> 33 35 <script type="text/javascript" src="spec/toggle_with_legend.js"></script> -
tests/functional/spec/media_manager.js
r1724 r2010 3 3 it("Enhanced uploader can be temporarily enabled", function() { 4 4 loadFixtures('form_media_disabled.html'); 5 loadStyleFixtures(' jsUpload/style.css');5 loadStyleFixtures('default.css'); 6 6 7 7 $('#fileupload').enhancedUploader(); … … 18 18 it("Enhanced uploader can be temporarily disabled", function() { 19 19 loadFixtures('form_media_enabled.html'); 20 loadStyleFixtures(' jsUpload/style.css');20 loadStyleFixtures('default.css'); 21 21 22 22 $('#fileupload').enhancedUploader(); -
tests/functional/spec/page_tabs.js
r1737 r2010 1 1 describe("tabs method (admin/js/pageTabs.js)", function() { 2 3 it("Construct tabs using div content", function() { 2 it("Must construct tabs using div content", function() { 3 loadFixtures('tabs.html'); 4 loadStyleFixtures('default.css'); 5 6 expect($('#user-options')).toBeVisible(); 7 expect($('#user-profile')).toBeVisible(); 8 expect($('#user-favorites')).toBeVisible(); 9 expect($('.part-tabs')).not.toExist(); 10 11 $.pageTabs('user-options'); 12 expect($('#part-user-options')).toBeVisible(); 13 expect($('#part-user-profile')).not.toBeVisible(); 14 expect($('#part-user-favorites')).not.toBeVisible(); 15 16 expect($('.part-tabs')).toExist(); 17 expect($('.part-tabs ul li#part-tabs-user-options')).toExist(); 18 expect($('.part-tabs ul li#part-tabs-user-profile')).toExist(); 19 expect($('.part-tabs ul li#part-tabs-user-favorites')).toExist(); 20 expect($('#part-tabs-user-options')).toHaveClass('part-tabs-active'); 21 }); 22 23 it("Must open first part if pageTabs called without argument", function() { 24 loadFixtures('tabs.html'); 25 loadStyleFixtures('default.css'); 26 27 $.pageTabs(); 28 expect($('#part-user-options')).toBeVisible(); 29 expect($('#part-user-profile')).not.toBeVisible(); 30 expect($('#part-user-favorites')).not.toBeVisible(); 31 expect($('#part-tabs-user-options')).toHaveClass('part-tabs-active'); 32 }); 33 34 it("Must change visible part when clicking another tab", function() { 35 loadFixtures('tabs.html'); 36 loadStyleFixtures('default.css'); 4 37 38 $.pageTabs('user-options'); 39 expect($('#part-user-options')).toBeVisible(); 40 expect($('#part-user-profile')).not.toBeVisible(); 41 expect($('#part-user-favorites')).not.toBeVisible(); 42 43 $('.part-tabs ul li a[href="#user-profile"]').click(); 44 expect($('#part-tabs-user-profile')).toHaveClass('part-tabs-active'); 45 expect($('#part-user-options')).not.toBeVisible(); 46 expect($('#part-user-profile')).toBeVisible(); 47 }); 48 49 it("Must change opened part if corresponding anchor is in url", function() { 5 50 loadFixtures('tabs.html'); 6 7 expect($('#tab-1')).toBeVisible(); 8 expect($('#tab-2')).toBeVisible(); 9 expect($('#tab-3')).toBeVisible(); 10 11 expect($('.part-tabs')).not.toExist(); 12 13 $.pageTabs('tab-1'); 14 15 expect($('#tab-1')).toBeVisible(); 16 expect($('#tab-2')).not.toBeVisible(); 17 expect($('#tab-3')).not.toBeVisible(); 18 19 expect($('.part-tabs ul li#part-tabs-tab-1 a[href=#tab-1]')).toExist(); 20 expect($('.part-tabs ul li#part-tabs-tab-2 a[href=#tab-2]')).toExist(); 21 expect($('.part-tabs ul li#part-tabs-tab-3 a[href=#tab-3]')).toExist(); 22 23 expect($('.part-tabs ul li#part-tabs-tab-1')).toHaveClass('part-tabs-active'); 24 25 }); 26 27 it("Change tabs when changing the hash", function() { 28 29 runs(function() { 30 loadFixtures('tabs-iframe.html'); 31 }); 32 33 waitsFor(function() { 34 return $("#testtab").contents().find('#tab-3').get(0); 35 }, 10000); 36 37 runs(function() { 38 f$ = $("#testtab").get(0).contentWindow.$; 39 f$.pageTabs('tab-1'); 51 loadStyleFixtures('default.css'); 40 52 41 expect(f$('#tab-1').get(0)).toBeVisible(); 42 expect(f$('#tab-2').get(0)).not.toBeVisible(); 43 44 expect(f$('.part-tabs ul li#part-tabs-tab-1').get(0)).toHaveClass('part-tabs-active'); 45 expect(f$('.part-tabs ul li#part-tabs-tab-2').get(0)).not.toHaveClass('part-tabs-active'); 46 47 $("#testtab").attr('src', $("#testtab").attr('src')+'#tab-2'); 48 }); 49 50 waitsFor(function() { 51 f$ = $("#testtab").get(0).contentWindow.$; 52 return f$('#tab-1').is(':not(:visible)'); 53 }, 10000); 54 55 runs(function() { 56 f$ = $("#testtab").get(0).contentWindow.$; 57 58 expect(f$('#tab-2').get(0)).toBeVisible(); 59 60 expect(f$('.part-tabs ul li#part-tabs-tab-1').get(0)).not.toHaveClass('part-tabs-active'); 61 expect(f$('.part-tabs ul li#part-tabs-tab-2').get(0)).toHaveClass('part-tabs-active'); 62 63 }); 64 65 }); 66 67 it("Load the correct tab with the correct hash", function() { 68 69 runs(function() { 70 loadFixtures('tabs-iframe.html'); 71 $("#testtab").attr('src', $("#testtab").attr('src')+'#tab-3'); 72 }); 73 74 waitsFor(function() { 75 cond1 = $("#testtab").attr('src').split('#')[1] != ''; 76 cond2 = $("#testtab").contents().find('#tab-3').get(0); 77 return cond1 && cond2; 78 }, 10000); 79 80 runs(function() { 81 f$ = $("#testtab").get(0).contentWindow.$; 82 f$.pageTabs('tab-1'); 83 84 expect(f$('#tab-1').get(0)).not.toBeVisible(); 85 expect(f$('#tab-3').get(0)).toBeVisible(); 86 87 expect(f$('.part-tabs ul li#part-tabs-tab-1').get(0)).not.toHaveClass('part-tabs-active'); 88 expect(f$('.part-tabs ul li#part-tabs-tab-3').get(0)).toHaveClass('part-tabs-active'); 89 }); 90 53 spyOn(jQuery, 'pageTabsGetHash').andReturn('user-favorites'); 54 $.pageTabs(); 55 expect($('#part-user-options')).not.toBeVisible(); 56 expect($('#part-user-profile')).not.toBeVisible(); 57 expect($('#part-user-favorites')).toBeVisible(); 91 58 }); 92 59 }); 60 -
tests/functional/spec/users_actions.js
r1724 r2010 1 1 describe("updatePermissionsForm method (admin/js/_users_actions.js)", function() { 2 2 it("Click admin persmission must checked all associated permissions", function() { 3 loadFixtures(' normal.html');3 loadFixtures('form_permissions.html'); 4 4 $('#permissions-form').updatePermissionsForm(); 5 5 var permissions = ['usage','publish','delete','contentadmin','categories']; … … 13 13 14 14 it("Click contentadmin persmission must checked all associated permissions", function() { 15 loadFixtures(' normal.html');15 loadFixtures('form_persmissions.html'); 16 16 $('#permissions-form').updatePermissionsForm(); 17 17 var permissions = ['usage','publish','delete'];
Note: See TracChangeset
for help on using the changeset viewer.