Index: trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.css |
— | — | @@ -849,20 +849,21 @@ |
850 | 850 | float: left; |
851 | 851 | width: 340px; |
852 | 852 | } |
853 | | -.articleFeedbackv5-confirmation-panel .articleFeedbackv5-panel-leftContent .articleFeedbackv5-confirmation-text { |
| 853 | +.articleFeedbackv5-confirmation-text { |
854 | 854 | display: inline-block; |
855 | 855 | background: #f7f5f5; |
856 | 856 | border: 1px solid #cccaca; |
857 | 857 | padding: 5px 10px; |
858 | 858 | line-height: 25px; |
859 | | - |
| 859 | + font-size: 0.75em; |
| 860 | + font-weight: normal; |
860 | 861 | } |
861 | | -.articleFeedbackv5-confirmation-panel .articleFeedbackv5-panel-leftContent .articleFeedbackv5-confirmation-text .articleFeedbackv5-confirmation-thanks { |
| 862 | +.articleFeedbackv5-confirmation-text .articleFeedbackv5-confirmation-thanks { |
862 | 863 | font-weight: bold; |
863 | 864 | font-style: italic; |
864 | 865 | display: inline-block; |
865 | | - padding: 0 0 0 24px; |
866 | | - margin: 0 9px 0 0; |
| 866 | + padding: 0 0 0 30px; |
| 867 | + margin: 0 10px 0 0; |
867 | 868 | height: 25px; |
868 | 869 | /* @embed */ |
869 | 870 | background: url(images/bg-confirmation-thanks.png) 0 center no-repeat; |
— | — | @@ -945,7 +946,7 @@ |
946 | 947 | margin-bottom: 5px; |
947 | 948 | } |
948 | 949 | |
949 | | -/*** CTA has a button to remove itself from the page ***/ |
| 950 | +/*** CTA overrides ***/ |
950 | 951 | |
951 | 952 | .articleFeedbackv5-clear-trigger { |
952 | 953 | display: block; |
— | — | @@ -965,3 +966,13 @@ |
966 | 967 | cursor: pointer; |
967 | 968 | text-decoration: none; |
968 | 969 | } |
| 970 | + |
| 971 | +.articleFeedbackv5-cta-1 .articleFeedbackv5-tooltip { |
| 972 | + top: -405px; |
| 973 | + right: -68px; |
| 974 | +} |
| 975 | + |
| 976 | +.articleFeedbackv5-panel .articleFeedbackv5-cta-1 h2.articleFeedbackv5-title { |
| 977 | + font-weight: normal; |
| 978 | +} |
| 979 | + |
Index: trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.js |
— | — | @@ -61,6 +61,11 @@ |
62 | 62 | $.articleFeedbackv5.debug = mw.config.get( 'wgArticleFeedbackv5Debug' ) ? true : false; |
63 | 63 | |
64 | 64 | /** |
| 65 | + * Have the containers been added? |
| 66 | + */ |
| 67 | + $.articleFeedbackv5.hasContainers = false; |
| 68 | + |
| 69 | + /** |
65 | 70 | * Has the form been loaded yet? |
66 | 71 | */ |
67 | 72 | $.articleFeedbackv5.isLoaded = false; |
— | — | @@ -132,20 +137,19 @@ |
133 | 138 | $.articleFeedbackv5.revisionId = mw.config.get( 'wgCurRevisionId' ); |
134 | 139 | |
135 | 140 | /** |
136 | | - * Whether we're showing a form, a CTA, or nothing |
| 141 | + * What we're meant to be showing: a form, a CTA, a showstopper error, or nothing |
137 | 142 | */ |
| 143 | + $.articleFeedbackv5.toDisplay = 'form'; |
| 144 | + |
| 145 | + /** |
| 146 | + * What we're actually showing |
| 147 | + */ |
138 | 148 | $.articleFeedbackv5.nowShowing = 'none'; |
139 | 149 | |
140 | 150 | /** |
141 | 151 | * The feedback ID (collected on submit, for use in tracking edits) |
142 | 152 | */ |
143 | 153 | $.articleFeedbackv5.feedbackId = 0; |
144 | | - |
145 | | - /** |
146 | | - * Currently displayed placeholder text for option 2. This is a workaround for Chrome/FF |
147 | | - * behavior overlays. |
148 | | - */ |
149 | | - $.currentDefaultText = ""; |
150 | 154 | |
151 | 155 | // }}} |
152 | 156 | // {{{ Templates |
— | — | @@ -461,6 +465,12 @@ |
462 | 466 | */ |
463 | 467 | commentDefault: {}, |
464 | 468 | |
| 469 | + /** |
| 470 | + * Currently displayed placeholder text. This is a workaround for Chrome/FF |
| 471 | + * automatic focus in overlays. |
| 472 | + */ |
| 473 | + currentDefaultText: '', |
| 474 | + |
465 | 475 | // }}} |
466 | 476 | // {{{ templates |
467 | 477 | |
— | — | @@ -611,7 +621,7 @@ |
612 | 622 | // Clear out the question on focus |
613 | 623 | $block.find( '.articleFeedbackv5-comment textarea' ) |
614 | 624 | .focus( function () { |
615 | | - if ( $( this ).val() == $.currentDefaultText ) { |
| 625 | + if ( $( this ).val() == $.articleFeedbackv5.currentBucket().currentDefaultText ) { |
616 | 626 | $( this ).val( '' ); |
617 | 627 | $(this).addClass( 'active' ); |
618 | 628 | } |
— | — | @@ -678,14 +688,14 @@ |
679 | 689 | } else { |
680 | 690 | for ( var t in $.articleFeedbackv5.currentBucket().commentDefault ) { |
681 | 691 | if ( $c.val() == $.articleFeedbackv5.currentBucket().commentDefault[t] ) { |
682 | | - empty = true; |
| 692 | + empty = true; |
683 | 693 | } |
684 | 694 | } |
685 | 695 | } |
686 | 696 | if ( empty ) { |
687 | 697 | $c.val( $.articleFeedbackv5.currentBucket().commentDefault[key] ); |
688 | 698 | // Store default text, workaround for overlay bug in Chrome/FF |
689 | | - $.currentDefaultText = $.articleFeedbackv5.currentBucket().commentDefault[key]; |
| 699 | + $.articleFeedbackv5.currentBucket().currentDefaultText = $.articleFeedbackv5.currentBucket().commentDefault[key]; |
690 | 700 | } |
691 | 701 | } else { |
692 | 702 | // Clear checked |
— | — | @@ -1795,10 +1805,6 @@ |
1796 | 1806 | <div class="clear"></div>\ |
1797 | 1807 | <div class="articleFeedbackv5-confirmation-panel">\ |
1798 | 1808 | <div class="articleFeedbackv5-panel-leftContent">\ |
1799 | | - <div class="articleFeedbackv5-confirmation-text">\ |
1800 | | - <span class="articleFeedbackv5-confirmation-thanks"><html:msg key="cta1-thanks" /></span>\ |
1801 | | - <span class="articleFeedbackv5-confirmation-follow-up"><html:msg key="cta1-confirmation-followup" /></span>\ |
1802 | | - </div>\ |
1803 | 1809 | <h3 class="articleFeedbackv5-confirmation-title"><html:msg key="cta1-confirmation-title" /></h3>\ |
1804 | 1810 | <p class="articleFeedbackv5-confirmation-wikipediaWorks"><html:msg key="cta1-confirmation-call" /></p>\ |
1805 | 1811 | <p class="articleFeedbackv5-confirmation-learnHow"><a target="_blank" href="#"><html:msg key="cta1-learn-how" /> »</a></p>\ |
— | — | @@ -1806,6 +1812,16 @@ |
1807 | 1813 | <a href="&action=edit" class="articleFeedbackv5-edit-cta-link"><span class="ui-button-text"><html:msg key="cta1-edit-linktext" /></span></a>\ |
1808 | 1814 | <div class="clear"></div>\ |
1809 | 1815 | </div>\ |
| 1816 | + ', |
| 1817 | + |
| 1818 | + /** |
| 1819 | + * The title/confirmation |
| 1820 | + */ |
| 1821 | + titleConfirm: '\ |
| 1822 | + <div class="articleFeedbackv5-confirmation-text">\ |
| 1823 | + <span class="articleFeedbackv5-confirmation-thanks"><html:msg key="cta1-thanks" /></span>\ |
| 1824 | + <span class="articleFeedbackv5-confirmation-follow-up"><html:msg key="cta1-confirmation-followup" /></span>\ |
| 1825 | + </div>\ |
1810 | 1826 | ' |
1811 | 1827 | |
1812 | 1828 | }, |
— | — | @@ -1819,7 +1835,10 @@ |
1820 | 1836 | * @return string the title |
1821 | 1837 | */ |
1822 | 1838 | getTitle: function () { |
1823 | | -// return 'TODO: EDIT CTA'; |
| 1839 | + |
| 1840 | + var $title = $( '<div></div>' ).html( $.articleFeedbackv5.currentCTA().templates.titleConfirm ); |
| 1841 | + $title.localize( { 'prefix': 'articlefeedbackv5-' } ); |
| 1842 | + return $title.html(); |
1824 | 1843 | }, |
1825 | 1844 | |
1826 | 1845 | // }}} |
— | — | @@ -1834,7 +1853,7 @@ |
1835 | 1854 | |
1836 | 1855 | // Start up the block to return |
1837 | 1856 | var $block = $( $.articleFeedbackv5.currentCTA().templates.block ); |
1838 | | - |
| 1857 | + |
1839 | 1858 | // Fill in the tutorial link |
1840 | 1859 | $block.find( '.articleFeedbackv5-confirmation-learnHow a' ) |
1841 | 1860 | .attr( 'href', mw.msg( 'articlefeedbackv5-cta1-learn-how-url' ) ); |
— | — | @@ -1895,7 +1914,7 @@ |
1896 | 1915 | // When the tool is visible, load the form |
1897 | 1916 | $.articleFeedbackv5.$holder.appear( function () { |
1898 | 1917 | if ( !$.articleFeedbackv5.isLoaded ) { |
1899 | | - $.articleFeedbackv5.loadForm(); |
| 1918 | + $.articleFeedbackv5.load(); |
1900 | 1919 | } |
1901 | 1920 | } ); |
1902 | 1921 | // Keep track of links that must be removed after a successful submission |
— | — | @@ -2042,7 +2061,7 @@ |
2043 | 2062 | if($.articleFeedbackv5.submissionEnabled == state ) { |
2044 | 2063 | return; |
2045 | 2064 | } |
2046 | | - |
| 2065 | + |
2047 | 2066 | if ( state ) { |
2048 | 2067 | $.articleFeedbackv5.find( '.articleFeedbackv5-submit' ).button( 'enable' ); |
2049 | 2068 | } else { |
— | — | @@ -2079,32 +2098,56 @@ |
2080 | 2099 | // }}} |
2081 | 2100 | // {{{ Process methods |
2082 | 2101 | |
2083 | | - // {{{ loadForm |
| 2102 | + // {{{ load |
2084 | 2103 | |
2085 | 2104 | /** |
2086 | | - * Build the form and load it into the document |
| 2105 | + * Loads the tool onto the page |
| 2106 | + * |
| 2107 | + * @param display string "form" or "cta" |
2087 | 2108 | */ |
2088 | | - $.articleFeedbackv5.loadForm = function () { |
| 2109 | + $.articleFeedbackv5.load = function ( display ) { |
2089 | 2110 | |
2090 | | - // Build the form |
2091 | | - var bucket = $.articleFeedbackv5.currentBucket(); |
2092 | | - if ( !( 'buildForm' in bucket ) ) { |
2093 | | - $.articleFeedbackv5.isLoaded = true; |
2094 | | - return; |
| 2111 | + if ( display ) { |
| 2112 | + $.articleFeedbackv5.toDisplay = ( display == 'cta' ? 'cta' : 'form' ); |
2095 | 2113 | } |
2096 | | - var $block = bucket.buildForm(); |
2097 | | - if ( 'bindEvents' in bucket ) { |
2098 | | - bucket.bindEvents( $block ); |
| 2114 | + |
| 2115 | + $.articleFeedbackv5.clearContainers(); |
| 2116 | + $.articleFeedbackv5.nowShowing = 'none'; |
| 2117 | + |
| 2118 | + if ( 'form' == $.articleFeedbackv5.toDisplay ) { |
| 2119 | + var bucket = $.articleFeedbackv5.currentBucket(); |
| 2120 | + if ( !( 'buildForm' in bucket ) ) { |
| 2121 | + $.articleFeedbackv5.isLoaded = true; |
| 2122 | + return; |
| 2123 | + } |
| 2124 | + $.articleFeedbackv5.loadContainers(); |
| 2125 | + $.articleFeedbackv5.showForm(); |
2099 | 2126 | } |
2100 | 2127 | |
2101 | | - // Wrap it in a panel |
| 2128 | + else if ( 'cta' == $.articleFeedbackv5.toDisplay ) { |
| 2129 | + var cta = $.articleFeedbackv5.currentCTA(); |
| 2130 | + if ( !( 'build' in cta ) ) { |
| 2131 | + $.articleFeedbackv5.isLoaded = true; |
| 2132 | + return; |
| 2133 | + } |
| 2134 | + $.articleFeedbackv5.loadContainers(); |
| 2135 | + $.articleFeedbackv5.showCTA(); |
| 2136 | + } |
| 2137 | + |
| 2138 | + }; |
| 2139 | + |
| 2140 | + // }}} |
| 2141 | + // {{{ loadContainers |
| 2142 | + |
| 2143 | + /** |
| 2144 | + * Builds containers and loads them onto the page |
| 2145 | + */ |
| 2146 | + $.articleFeedbackv5.loadContainers = function () { |
| 2147 | + |
| 2148 | + // Set up the panel |
2102 | 2149 | var $wrapper = $( $.articleFeedbackv5.templates.panelOuter ); |
2103 | | - $wrapper.find( '.articleFeedbackv5-ui' ) |
2104 | | - .addClass( 'articleFeedbackv5-option-' + $.articleFeedbackv5.bucketId ); |
2105 | | - $wrapper.find( '.articleFeedbackv5-ui-inner' ) |
2106 | | - .append( $block ); |
2107 | 2150 | |
2108 | | - // Set up the help tooltip |
| 2151 | + // Add the help tooltip |
2109 | 2152 | $wrapper.find( '.articleFeedbackv5-tooltip-link' ) |
2110 | 2153 | .attr( 'href', mw.msg( 'articlefeedbackv5-help-tooltip-linkurl' ) ) |
2111 | 2154 | .click( function ( e ) { |
— | — | @@ -2116,11 +2159,6 @@ |
2117 | 2160 | } ); |
2118 | 2161 | $wrapper.find( '.articleFeedbackv5-tooltip' ).hide(); |
2119 | 2162 | |
2120 | | - // Set the title |
2121 | | - if ( 'getTitle' in bucket ) { |
2122 | | - $wrapper.find( '.articleFeedbackv5-title' ).html( bucket.getTitle() ); |
2123 | | - } |
2124 | | - |
2125 | 2163 | // Set up the tooltip trigger for the panel version |
2126 | 2164 | $wrapper.find( '.articleFeedbackv5-title-wrap' ).append( $.articleFeedbackv5.templates.helpToolTipTrigger ); |
2127 | 2165 | $wrapper.find( '.articleFeedbackv5-tooltip-trigger' ).click( function () { |
— | — | @@ -2165,9 +2203,41 @@ |
2166 | 2204 | } ); |
2167 | 2205 | $titlebar.localize( { 'prefix': 'articlefeedbackv5-' } ); |
2168 | 2206 | |
2169 | | - // Set loaded |
2170 | | - $.articleFeedbackv5.isLoaded = true; |
| 2207 | + // Mark that we have containers |
| 2208 | + $.articleFeedbackv5.hasContainers = true; |
| 2209 | + }; |
2171 | 2210 | |
| 2211 | + // }}} |
| 2212 | + // {{{ showForm |
| 2213 | + |
| 2214 | + /** |
| 2215 | + * Builds the form and loads it into the document |
| 2216 | + */ |
| 2217 | + $.articleFeedbackv5.showForm = function () { |
| 2218 | + |
| 2219 | + // Build the form |
| 2220 | + var bucket = $.articleFeedbackv5.currentBucket(); |
| 2221 | + var $block = bucket.buildForm(); |
| 2222 | + if ( 'bindEvents' in bucket ) { |
| 2223 | + bucket.bindEvents( $block ); |
| 2224 | + } |
| 2225 | + $block.localize( { 'prefix': 'articlefeedbackv5-' } ); |
| 2226 | + |
| 2227 | + // Add it to the appropriate container |
| 2228 | + $.articleFeedbackv5.find( '.articleFeedbackv5-ui-inner' ) |
| 2229 | + .append( $block ); |
| 2230 | + |
| 2231 | + // Set the appropriate class on the ui block |
| 2232 | + $.articleFeedbackv5.find( '.articleFeedbackv5-ui' ) |
| 2233 | + .addClass( 'articleFeedbackv5-option-' + $.articleFeedbackv5.bucketId ) |
| 2234 | + .removeClass( 'articleFeedbackv5-cta-' + $.articleFeedbackv5.ctaId ); |
| 2235 | + |
| 2236 | + // Set the title |
| 2237 | + if ( 'getTitle' in bucket ) { |
| 2238 | + $.articleFeedbackv5.$holder.find( '.articleFeedbackv5-title' ).html( bucket.getTitle() ); |
| 2239 | + $.articleFeedbackv5.$dialog.dialog( 'option', 'title', bucket.getTitle() ); |
| 2240 | + } |
| 2241 | + |
2172 | 2242 | // Do anything special the bucket requires |
2173 | 2243 | if ( 'afterBuild' in bucket ) { |
2174 | 2244 | bucket.afterBuild(); |
— | — | @@ -2277,6 +2347,8 @@ |
2278 | 2348 | * Shows a CTA |
2279 | 2349 | */ |
2280 | 2350 | $.articleFeedbackv5.showCTA = function () { |
| 2351 | + |
| 2352 | + // Build the form |
2281 | 2353 | var cta = $.articleFeedbackv5.currentCTA(); |
2282 | 2354 | if ( !( 'build' in cta ) ) { |
2283 | 2355 | return; |
— | — | @@ -2286,15 +2358,23 @@ |
2287 | 2359 | cta.bindEvents( $block ); |
2288 | 2360 | } |
2289 | 2361 | $block.localize( { 'prefix': 'articlefeedbackv5-' } ); |
| 2362 | + |
| 2363 | + // Add it to the appropriate container |
| 2364 | + $.articleFeedbackv5.find( '.articleFeedbackv5-ui-inner' ).empty(); |
| 2365 | + $.articleFeedbackv5.find( '.articleFeedbackv5-ui-inner' ) |
| 2366 | + .append( $block ); |
| 2367 | + |
| 2368 | + // Set the appropriate class on the ui block |
| 2369 | + $.articleFeedbackv5.find( '.articleFeedbackv5-ui' ) |
| 2370 | + .removeClass( 'articleFeedbackv5-option-' + $.articleFeedbackv5.bucketId ) |
| 2371 | + .addClass( 'articleFeedbackv5-cta-' + $.articleFeedbackv5.ctaId ); |
| 2372 | + |
| 2373 | + // Set the title in both places |
2290 | 2374 | if ( 'getTitle' in cta ) { |
2291 | | - if ( $.articleFeedbackv5.inDialog ) { |
2292 | | - $.articleFeedbackv5.$dialog.dialog( 'option', 'title', cta.getTitle() ); |
2293 | | - } else { |
2294 | | - $.articleFeedbackv5.find( '.articleFeedbackv5-title' ).html( cta.getTitle() ); |
2295 | | - } |
| 2375 | + $.articleFeedbackv5.$dialog.dialog( 'option', 'title', cta.getTitle() ); |
| 2376 | + $.articleFeedbackv5.find( '.articleFeedbackv5-title' ).html( cta.getTitle() ); |
2296 | 2377 | } |
2297 | | - $.articleFeedbackv5.find( '.articleFeedbackv5-ui' ).empty(); |
2298 | | - $.articleFeedbackv5.find( '.articleFeedbackv5-ui' ).append( $block ); |
| 2378 | + |
2299 | 2379 | // Add a close button to clear out the panel |
2300 | 2380 | var $close = $( '<a class="articleFeedbackv5-clear-trigger">x</a>' ) |
2301 | 2381 | .click( function (e) { |
— | — | @@ -2303,6 +2383,10 @@ |
2304 | 2384 | } ); |
2305 | 2385 | $.articleFeedbackv5.$holder.find( '.articleFeedbackv5-title-wrap .articleFeedbackv5-tooltip-trigger' ) |
2306 | 2386 | .before( $close ); |
| 2387 | + |
| 2388 | + // Reset the panel dimensions |
| 2389 | + $.articleFeedbackv5.setDialogDimensions(); |
| 2390 | + |
2307 | 2391 | $.articleFeedbackv5.nowShowing = 'cta'; |
2308 | 2392 | }; |
2309 | 2393 | |
— | — | @@ -2313,17 +2397,25 @@ |
2314 | 2398 | * Clears out the panel |
2315 | 2399 | */ |
2316 | 2400 | $.articleFeedbackv5.clear = function () { |
2317 | | - |
2318 | 2401 | $.articleFeedbackv5.isLoaded = false; |
2319 | 2402 | $.articleFeedbackv5.inDialog = false; |
2320 | 2403 | $.articleFeedbackv5.submissionEnabled = false; |
2321 | 2404 | $.articleFeedbackv5.feedbackId = 0; |
| 2405 | + $.articleFeedbackv5.clearContainers(); |
| 2406 | + $.articleFeedbackv5.nowShowing = 'none'; |
| 2407 | + }; |
2322 | 2408 | |
| 2409 | + // }}} |
| 2410 | + // {{{ clearContainers |
| 2411 | + |
| 2412 | + /** |
| 2413 | + * Wipes the containers from the page |
| 2414 | + */ |
| 2415 | + $.articleFeedbackv5.clearContainers = function () { |
2323 | 2416 | $.articleFeedbackv5.$holder.empty(); |
2324 | | - $.articleFeedbackv5.$dialog.remove(); |
2325 | | - |
2326 | | - |
2327 | | - $.articleFeedbackv5.nowShowing = 'none'; |
| 2417 | + if ( $.articleFeedbackv5.$dialog ) { |
| 2418 | + $.articleFeedbackv5.$dialog.remove(); |
| 2419 | + } |
2328 | 2420 | }; |
2329 | 2421 | |
2330 | 2422 | // }}} |
— | — | @@ -2366,7 +2458,7 @@ |
2367 | 2459 | $err.html( $err.html().replace( "\n", '<br />' ) ); |
2368 | 2460 | $.articleFeedbackv5.$toRemove.remove(); |
2369 | 2461 | $.articleFeedbackv5.$toRemove = $( [] ); |
2370 | | - $.articleFeedbackv5.nowShowing = 'none'; |
| 2462 | + $.articleFeedbackv5.nowShowing = 'error'; |
2371 | 2463 | }; |
2372 | 2464 | |
2373 | 2465 | // }}} |
— | — | @@ -2518,21 +2610,14 @@ |
2519 | 2611 | // $.articleFeedbackv5.clear(); |
2520 | 2612 | } |
2521 | 2613 | if ( !$.articleFeedbackv5.isLoaded ) { |
2522 | | - $.articleFeedbackv5.loadForm(); |
| 2614 | + $.articleFeedbackv5.load(); |
2523 | 2615 | } |
2524 | 2616 | if ( !$.articleFeedbackv5.inDialog ) { |
2525 | | - var w = $.articleFeedbackv5.$holder.find( '.articleFeedbackv5-ui' ).width(); |
2526 | | - var h = $.articleFeedbackv5.$holder.find( '.articleFeedbackv5-ui' ).height(); |
2527 | | - var o = $link.offset(); |
2528 | | - var x = 'center'; |
2529 | | - // var y = o.top - h - 20; |
2530 | | - var y = 'center'; |
| 2617 | + $.articleFeedbackv5.setDialogDimensions(); |
2531 | 2618 | $.articleFeedbackv5.$holder.find( '.articleFeedbackv5-tooltip' ).hide(); |
2532 | 2619 | $inner = $.articleFeedbackv5.$holder.find( '.articleFeedbackv5-ui' ).detach(); |
2533 | 2620 | $.articleFeedbackv5.$dialog.append( $inner ); |
2534 | | - $.articleFeedbackv5.$dialog.dialog( 'option', 'width', w + 25 ); |
2535 | | - $.articleFeedbackv5.$dialog.dialog( 'option', 'height', h + 70 ); |
2536 | | - $.articleFeedbackv5.$dialog.dialog( 'option', 'position', [ x, y ] ); |
| 2621 | + $.articleFeedbackv5.$dialog.dialog( 'option', 'position', [ 'center', 'center' ] ); |
2537 | 2622 | $.articleFeedbackv5.$dialog.dialog( 'open' ); |
2538 | 2623 | $.articleFeedbackv5.setLinkId( $link.data( 'linkId' ) ); |
2539 | 2624 | |
— | — | @@ -2564,9 +2649,22 @@ |
2565 | 2650 | }; |
2566 | 2651 | |
2567 | 2652 | // }}} |
| 2653 | + // {{{ setDialogDimensions |
2568 | 2654 | |
| 2655 | + /** |
| 2656 | + * Sets the dialog's dimensions |
| 2657 | + */ |
| 2658 | + $.articleFeedbackv5.setDialogDimensions = function () { |
| 2659 | + var w = $.articleFeedbackv5.find( '.articleFeedbackv5-ui' ).width(); |
| 2660 | + var h = $.articleFeedbackv5.find( '.articleFeedbackv5-ui' ).height(); |
| 2661 | + $.articleFeedbackv5.$dialog.dialog( 'option', 'width', w + 25 ); |
| 2662 | + $.articleFeedbackv5.$dialog.dialog( 'option', 'height', h + 70 ); |
| 2663 | + }; |
| 2664 | + |
2569 | 2665 | // }}} |
2570 | 2666 | |
| 2667 | + // }}} |
| 2668 | + |
2571 | 2669 | // }}} |
2572 | 2670 | // {{{ articleFeedbackv5 plugin |
2573 | 2671 | |