Index: trunk/extensions/Survey/resources/ext.survey.tag.js |
— | — | @@ -11,7 +11,7 @@ |
12 | 12 | function getCookieName( options ) { |
13 | 13 | return ( typeof options.id !== 'undefined' ) ? |
14 | 14 | 'survey-id-' + options.id |
15 | | - : 'survey-name-' + options.name |
| 15 | + : 'survey-name-' + options.name; |
16 | 16 | } |
17 | 17 | |
18 | 18 | function getCookie( options ) { |
— | — | @@ -42,13 +42,13 @@ |
43 | 43 | var cookie = getCookie( options ); |
44 | 44 | |
45 | 45 | if ( cookie !== 'done' ) { |
46 | | - if ( ( options.pages === 0 || parseInt( cookie ) >= options.pages ) ) { |
| 46 | + if ( ( options.pages === 0 || parseInt( cookie, 10 ) >= options.pages ) ) { |
47 | 47 | $tag.mwSurvey( options ); |
48 | 48 | setCookie( options, 'done' ); |
49 | 49 | } |
50 | 50 | else if ( options.pages !== 0 ) { |
51 | | - var nr = parseInt( getCookie( options ) ); |
52 | | - setCookie( options, ( isNaN( nr ) ? 0 : nr ) + 1 ) |
| 51 | + var nr = parseInt( getCookie( options ), 10 ); |
| 52 | + setCookie( options, ( isNaN( nr ) ? 0 : nr ) + 1 ); |
53 | 53 | } |
54 | 54 | } |
55 | 55 | } |
— | — | @@ -65,8 +65,8 @@ |
66 | 66 | var options = { |
67 | 67 | 'ratio': typeof ratioAttr === 'undefined' ? 1 : parseFloat( ratioAttr ) / 100, |
68 | 68 | 'cookie': $tag.attr( 'survey-data-cookie' ) !== 'no', |
69 | | - 'expiry': typeof expiryAttr === 'undefined' ? 60 * 60 * 24 * 30 : parseInt( expiryAttr ), |
70 | | - 'pages': typeof pagesAttr === 'undefined' ? 0 : parseInt( pagesAttr ) |
| 69 | + 'expiry': typeof expiryAttr === 'undefined' ? 60 * 60 * 24 * 30 : parseInt( expiryAttr, 10 ), |
| 70 | + 'pages': typeof pagesAttr === 'undefined' ? 0 : parseInt( pagesAttr, 10 ) |
71 | 71 | }; |
72 | 72 | |
73 | 73 | if ( $tag.attr( 'survey-data-id' ) ) { |
Index: trunk/extensions/Survey/resources/jquery.survey.js |
— | — | @@ -297,7 +297,7 @@ |
298 | 298 | 'requireEnabled': $this.attr( 'survey-data-require-enabled' ) !== '0' |
299 | 299 | }, |
300 | 300 | function( surveyData ) { |
301 | | - if ( 0 in surveyData ) { |
| 301 | + if ( surveyData.hasOwnProperty( 0 ) ) { |
302 | 302 | _this.initSurvey( surveyData[0] ); |
303 | 303 | } |
304 | 304 | else { |