Index: trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.css |
— | — | @@ -404,7 +404,9 @@ |
405 | 405 | padding-left: 28px; |
406 | 406 | color: #777777; |
407 | 407 | } |
| 408 | + |
408 | 409 | /*---===<<< Sean's Version 5 Styles >>>===---*/ |
| 410 | + |
409 | 411 | .clear { |
410 | 412 | display: block !important; |
411 | 413 | height: 0 !important; |
— | — | @@ -414,12 +416,34 @@ |
415 | 417 | width: 100% !important; |
416 | 418 | border: none !important; |
417 | 419 | } |
418 | | -/* tooltip styling. by default the element to be styled is .tooltip */ |
419 | | -.articleFeedbackv5-panel .title-wrap { |
| 420 | + |
| 421 | +.articleFeedbackv5-panel { |
| 422 | + width: 598px; |
| 423 | + background: #f5faff; |
| 424 | + border: 1px solid #ccc; |
| 425 | + color: #000; |
| 426 | +} |
| 427 | + |
| 428 | +.articleFeedbackv5-panel .articleFeedback-buffer { |
| 429 | + padding: 20px; |
| 430 | +} |
| 431 | + |
| 432 | +.articleFeedbackv5-panel .articleFeedbackv5-title-wrap { |
420 | 433 | position: relative; |
| 434 | + display: block; |
421 | 435 | } |
422 | | -.articleFeedbackv5-panel .articleFeedbackv5-tooltip { |
423 | | - display: none; |
| 436 | + |
| 437 | +.articleFeedbackv5-panel .articleFeedbackv5-ui { |
| 438 | + clear: both; |
| 439 | + display: block; |
| 440 | +} |
| 441 | + |
| 442 | +.articleFeedbackv5-panel h2 { |
| 443 | + float: left; |
| 444 | + border: none; |
| 445 | +} |
| 446 | + |
| 447 | +.articleFeedbackv5-tooltip { |
424 | 448 | position: absolute; |
425 | 449 | z-index: 15; |
426 | 450 | top: -185px; |
— | — | @@ -428,33 +452,24 @@ |
429 | 453 | width: 234px; |
430 | 454 | color: #000; |
431 | 455 | } |
432 | | -.articleFeedbackv5-panel .articleFeedbackv5-tooltip .tooltip-top { |
| 456 | + |
| 457 | +.articleFeedbackv5-tooltip .tooltip-top { |
433 | 458 | background: url(images/bg-tooltip-top.png); |
434 | 459 | height: 11px; |
435 | 460 | } |
436 | | -.articleFeedbackv5-panel .articleFeedbackv5-tooltip .tooltip-repeat { |
| 461 | + |
| 462 | +.articleFeedbackv5-tooltip .tooltip-repeat { |
437 | 463 | background: url(images/bg-tooltip.png) repeat-y; |
438 | 464 | padding: 0 20px 1px; |
439 | 465 | margin: 0; |
440 | 466 | } |
441 | | -.articleFeedbackv5-panel .articleFeedbackv5-tooltip .tooltip-bottom { |
| 467 | + |
| 468 | +.articleFeedbackv5-tooltip .tooltip-bottom { |
442 | 469 | background: url(images/bg-tooltip-bottom.png); |
443 | 470 | height: 26px; |
444 | 471 | } |
445 | | -.articleFeedbackv5-panel { |
446 | | - width: 598px; |
447 | | - background: #f5faff; |
448 | | - border: 1px solid #ccc; |
449 | | - color: #000; |
450 | | -} |
451 | | -.articleFeedbackv5-panel .articleFeedback-buffer { |
452 | | - padding: 20px; |
453 | | -} |
454 | | -.articleFeedbackv5-panel h2 { |
455 | | - float: left; |
456 | | - border: none; |
457 | | -} |
458 | | -.articleFeedbackv5-panel .articleFeedbackv5-tooltip-trigger { |
| 472 | + |
| 473 | +.articleFeedbackv5-tooltip-trigger { |
459 | 474 | display: block; |
460 | 475 | height: 27px; |
461 | 476 | width: 26px; |
— | — | @@ -463,31 +478,38 @@ |
464 | 479 | position: relative; |
465 | 480 | text-indent: -9999px; |
466 | 481 | } |
467 | | -.articleFeedbackv5-panel .articleFeedbackv5-tooltip-trigger:hover { |
| 482 | + |
| 483 | +.articleFeedbackv5-tooltip-trigger:hover { |
468 | 484 | background: url(images/bg-tooltip-trigger-hov.png) no-repeat; |
469 | 485 | cursor: pointer; |
470 | 486 | text-decoration: none; |
471 | 487 | } |
472 | | -.articleFeedbackv5-panel .form-row { |
| 488 | + |
| 489 | +.articleFeedbackv5-ui .form-row { |
473 | 490 | margin: 0 0 15px; |
474 | 491 | } |
475 | | -.articleFeedbackv5-panel .instructions-left { |
| 492 | + |
| 493 | +.articleFeedbackv5-ui .instructions-left { |
476 | 494 | float:left; |
477 | 495 | margin: 0 15px 0 0; |
478 | 496 | font-size: 1.2em; |
479 | 497 | } |
480 | | -.articleFeedbackv5-panel .buttons { |
| 498 | + |
| 499 | +.articleFeedbackv5-ui .buttons { |
481 | 500 | float: left; |
482 | 501 | } |
483 | | -.articleFeedbackv5-panel .buttons .form-item { |
| 502 | + |
| 503 | +.articleFeedbackv5-ui .buttons .form-item { |
484 | 504 | float: left; |
485 | 505 | margin: 0 15px 0 0; |
486 | 506 | } |
487 | | -.articleFeedbackv5-panel .buttons label, |
488 | | -.articleFeedbackv5-panel .buttons input { |
| 507 | + |
| 508 | +.articleFeedbackv5-ui .buttons label, |
| 509 | +.articleFeedbackv5-ui .buttons input { |
489 | 510 | display: none; |
490 | 511 | } |
491 | | -.articleFeedbackv5-panel .buttons .articleFeedbackv5-button-placeholder { |
| 512 | + |
| 513 | +.articleFeedbackv5-ui .buttons .articleFeedbackv5-button-placeholder { |
492 | 514 | display: inline-block; |
493 | 515 | height: 20px; |
494 | 516 | width: 50px; |
— | — | @@ -500,14 +522,17 @@ |
501 | 523 | border-radius: 3px; /* future proofing */ |
502 | 524 | -khtml-border-radius: 3px; /* for old Konqueror browsers */ |
503 | 525 | } |
504 | | -.articleFeedbackv5-panel .buttons .articleFeedbackv5-button-placeholder:hover { |
| 526 | + |
| 527 | +.articleFeedbackv5-ui .buttons .articleFeedbackv5-button-placeholder:hover { |
505 | 528 | background: url(images/bg-button.png) repeat-x; |
506 | 529 | cursor: pointer; |
507 | 530 | } |
508 | | -.articleFeedbackv5-panel .buttons .articleFeedbackv5-button-placeholder-active { |
| 531 | + |
| 532 | +.articleFeedbackv5-ui .buttons .articleFeedbackv5-button-placeholder-active { |
509 | 533 | background: url(images/bg-button.png) repeat-x; |
510 | 534 | } |
511 | | -.articleFeedbackv5-panel .feedback-text { |
| 535 | + |
| 536 | +.articleFeedbackv5-ui .feedback-text { |
512 | 537 | resize: none; |
513 | 538 | background: #fff; |
514 | 539 | border: 1px solid #000; |
— | — | @@ -519,19 +544,23 @@ |
520 | 545 | font: sans-serif; |
521 | 546 | color: #ddd; |
522 | 547 | } |
523 | | -.articleFeedbackv5-panel .feedback-text.active { |
| 548 | + |
| 549 | +.articleFeedbackv5-ui .feedback-text.active { |
524 | 550 | color: #000; |
525 | 551 | } |
526 | | -.articleFeedbackv5-panel .articleFeedbackv5-disclosure { |
| 552 | + |
| 553 | +.articleFeedbackv5-ui .articleFeedbackv5-disclosure { |
527 | 554 | float: right; |
528 | 555 | width: 335px; |
529 | 556 | margin: 10px 0 0; |
530 | 557 | } |
531 | | -.articleFeedbackv5-panel .articleFeedbackv5-disclosure p { |
| 558 | + |
| 559 | +.articleFeedbackv5-ui .articleFeedbackv5-disclosure p { |
532 | 560 | margin: 0; |
533 | 561 | font-size: 0.75em; |
534 | 562 | } |
535 | | -.articleFeedbackv5-panel .articleFeedbackv5-submit { |
| 563 | + |
| 564 | +.articleFeedbackv5-ui .articleFeedbackv5-submit { |
536 | 565 | float: left; |
537 | 566 | height: 30px; |
538 | 567 | width: auto; |
— | — | @@ -548,7 +577,8 @@ |
549 | 578 | -webkit-box-shadow: -3px 3px 3px #999; |
550 | 579 | box-shadow: -3px 3px 3px #999; |
551 | 580 | } |
552 | | -.articleFeedbackv5-panel .articleFeedbackv5-submit span { |
| 581 | + |
| 582 | +.articleFeedbackv5-ui .articleFeedbackv5-submit span { |
553 | 583 | font-size: 16px; |
554 | 584 | display: inline-block; |
555 | 585 | height: 21px; |
— | — | @@ -558,10 +588,12 @@ |
559 | 589 | padding: 0 30px 0 0; |
560 | 590 | background: url(images/bg-submit-icon.png) right center no-repeat; |
561 | 591 | } |
| 592 | + |
562 | 593 | /*** Option 2 ***/ |
563 | 594 | .articleFeedbackv5-tags ul { |
564 | 595 | margin: 0 0 10px; |
565 | 596 | } |
| 597 | + |
566 | 598 | .articleFeedbackv5-tags ul li { |
567 | 599 | color: #666; |
568 | 600 | list-style: none; |
— | — | @@ -578,14 +610,17 @@ |
579 | 611 | -khtml-border-radius: 8px; /* for old Konqueror browsers */ |
580 | 612 | position: relative; |
581 | 613 | } |
| 614 | + |
582 | 615 | .articleFeedbackv5-tags ul li:first-child { |
583 | 616 | margin: 0; |
584 | 617 | } |
| 618 | + |
585 | 619 | .articleFeedbackv5-tags ul li:hover, .articleFeedbackv5-tags ul li.active { |
586 | 620 | background: #fff; |
587 | 621 | border-color: #ccc; |
588 | 622 | color: #000; |
589 | 623 | } |
| 624 | + |
590 | 625 | .articleFeedbackv5-tags ul li.active .tag-selector { |
591 | 626 | position: absolute; |
592 | 627 | background: url(images/bg-tag-active.png) no-repeat center bottom; |
— | — | @@ -596,9 +631,11 @@ |
597 | 632 | left: 50%; |
598 | 633 | margin: 0 0 0 -5px; |
599 | 634 | } |
| 635 | + |
600 | 636 | .articleFeedbackv5-tags ul li input { |
601 | 637 | display: none; |
602 | 638 | } |
| 639 | + |
603 | 640 | .articleFeedbackv5-tags ul li label { |
604 | 641 | padding: 0 0 0 22px; |
605 | 642 | cursor: pointer; |
— | — | @@ -606,61 +643,82 @@ |
607 | 644 | height: 16px; |
608 | 645 | line-height: 18px; |
609 | 646 | } |
| 647 | + |
610 | 648 | .articleFeedbackv5-tags ul li .articleFeedbackv5-bucket2-suggestion-label { |
611 | 649 | background: url(images/bg-tag-suggestion-off.png) no-repeat 0 center; |
612 | 650 | } |
| 651 | + |
613 | 652 | .articleFeedbackv5-tags ul li .articleFeedbackv5-bucket2-question-label { |
614 | 653 | background: url(images/bg-tag-question-off.png) no-repeat 0 center; |
615 | 654 | } |
| 655 | + |
616 | 656 | .articleFeedbackv5-tags ul li .articleFeedbackv5-bucket2-problem-label { |
617 | 657 | background: url(images/bg-tag-problem-off.png) no-repeat 0 center; |
618 | 658 | } |
| 659 | + |
619 | 660 | .articleFeedbackv5-tags ul li .articleFeedbackv5-bucket2-praise-label { |
620 | 661 | background: url(images/bg-tag-praise-off.png) no-repeat 0 center; |
621 | 662 | } |
| 663 | + |
622 | 664 | .articleFeedbackv5-tags ul li:hover .articleFeedbackv5-bucket2-suggestion-label, |
623 | 665 | .articleFeedbackv5-tags ul li.active .articleFeedbackv5-bucket2-suggestion-label { |
624 | 666 | background: url(images/bg-tag-suggestion-on.png) no-repeat 0 center; |
625 | 667 | } |
| 668 | + |
626 | 669 | .articleFeedbackv5-tags ul li:hover .articleFeedbackv5-bucket2-question-label, |
627 | 670 | .articleFeedbackv5-tags ul li.active .articleFeedbackv5-bucket2-question-label { |
628 | 671 | background: url(images/bg-tag-question-on.png) no-repeat 0 center; |
629 | 672 | } |
| 673 | + |
630 | 674 | .articleFeedbackv5-tags ul li:hover .articleFeedbackv5-bucket2-problem-label, |
631 | 675 | .articleFeedbackv5-tags ul li.active .articleFeedbackv5-bucket2-problem-label { |
632 | 676 | background: url(images/bg-tag-problem-on.png) no-repeat 0 center; |
633 | 677 | } |
| 678 | + |
634 | 679 | .articleFeedbackv5-tags ul li:hover .articleFeedbackv5-bucket2-praise-label, |
635 | 680 | .articleFeedbackv5-tags ul li.active .articleFeedbackv5-bucket2-praise-label { |
636 | 681 | background: url(images/bg-tag-praise-on.png) no-repeat 0 center; |
637 | 682 | } |
| 683 | + |
638 | 684 | /*** Option 3 ***/ |
639 | 685 | .articleFeedbackv5-rating-new .articleFeedbackv5-rating-label { |
640 | 686 | background: url(images/bg-rating-off.png) no-repeat; |
641 | 687 | } |
| 688 | + |
642 | 689 | .articleFeedbackv5-rating-new .articleFeedbackv5-rating-label.active { |
643 | 690 | background: url(images/bg-rating-on.png) no-repeat; |
644 | 691 | } |
| 692 | + |
645 | 693 | .articleFeedbackv5-rating .articleFeedbackv5-rating-prompt { |
646 | 694 | } |
647 | 695 | |
648 | 696 | |
649 | 697 | /*** Dialog ***/ |
650 | 698 | .articleFeedbackv5-dialog { |
| 699 | + border: 1px solid #cccccc; |
| 700 | +} |
| 701 | + |
| 702 | +.articleFeedbackv5-dialog.ui-dialog .ui-widget-header { |
| 703 | + background: #f5faff !important; |
651 | 704 | border: none; |
652 | 705 | } |
653 | | -.articleFeedbackv5-dialog.ui-widget-content, |
| 706 | + |
| 707 | +.articleFeedbackv5-dialog.ui-dialog .ui-dialog-content { |
| 708 | + background: #f5faff; |
| 709 | +} |
| 710 | + |
654 | 711 | .articleFeedbackv5-dialog.ui-dialog .ui-widget-header { |
655 | | - background: transparent !important; |
| 712 | + font-weight: normal; |
| 713 | + margin-bottom: 0; |
| 714 | + padding-top: .5em; |
| 715 | + padding-bottom: .17em; |
656 | 716 | } |
657 | | -.articleFeedbackv5-dialog .ui-widget-header { |
658 | | - border: none; |
| 717 | + |
| 718 | +.articleFeedbackv5-dialog.ui-dialog .articleFeedbackv5-tooltip-trigger { |
| 719 | + margin-right: 20px; |
659 | 720 | } |
660 | | -.articleFeedbackv5-dialog .ui-dialog-titlebar-close { |
661 | | - background-color: white; |
662 | | - border: 1px solid gray; |
663 | | - top: 35px !important; |
664 | | - right: -5px !important; |
665 | | - padding: 0; |
| 721 | + |
| 722 | +.articleFeedbackv5-dialog.ui-dialog .articleFeedbackv5-tooltip { |
| 723 | + right: -67px; |
666 | 724 | } |
667 | 725 | |
Index: trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.js |
— | — | @@ -139,13 +139,26 @@ |
140 | 140 | |
141 | 141 | panelOuter: '\ |
142 | 142 | <div class="articleFeedbackv5-panel">\ |
143 | | - <div class="articleFeedbackv5-buffer articleFeedbackv5-ui">\ |
| 143 | + <div class="articleFeedbackv5-buffer">\ |
| 144 | + <div class="articleFeedbackv5-title-wrap">\ |
| 145 | + <h2 class="articleFeedbackv5-title"></h2>\ |
| 146 | + </div>\ |
| 147 | + <div class="articleFeedbackv5-ui" />\ |
144 | 148 | </div>\ |
145 | | - <div class="articleFeedbackv5-error"><div class="articleFeedbackv5-error-message"><html:msg key="error" /></div></div>\ |
| 149 | + <div class="articleFeedbackv5-error"><div class="articleFeedbackv5-error-message"></div></div>\ |
146 | 150 | <div style="clear:both;"></div>\ |
147 | 151 | </div>\ |
148 | | - ', |
| 152 | + ', |
149 | 153 | |
| 154 | + dialogInner: '\ |
| 155 | + <div class="articleFeedbackv5-dialog-inner">\ |
| 156 | + <div class="articleFeedbackv5-buffer">\ |
| 157 | + </div>\ |
| 158 | + <div class="articleFeedbackv5-error"><div class="articleFeedbackv5-error-message"></div></div>\ |
| 159 | + <div style="clear:both;"></div>\ |
| 160 | + </div>\ |
| 161 | + ', |
| 162 | + |
150 | 163 | helpToolTip: '\ |
151 | 164 | <a class="articleFeedbackv5-tooltip-trigger"></a>\ |
152 | 165 | <div class="articleFeedbackv5-tooltip">\ |
— | — | @@ -198,41 +211,50 @@ |
199 | 212 | */ |
200 | 213 | block: '\ |
201 | 214 | <form>\ |
202 | | - <div class="title-wrap">\ |
203 | | - <h2 class="articleFeedbackv5-title"><html:msg key="bucket1-title" /></h2>\ |
204 | | - </div>\ |
205 | | - <div class="form-row articleFeedbackv5-bucket1-toggle">\ |
206 | | - <p class="instructions-left"><html:msg key="bucket1-question-toggle" /></p>\ |
207 | | - <div class="buttons">\ |
208 | | - <div class="form-item" rel="yes" id="articleFeedbackv5-bucket1-toggle-wrapper-yes">\ |
209 | | - <label for="articleFeedbackv5-bucket1-toggle-yes"><html:msg key="bucket1-toggle-found-yes-full" /></label>\ |
210 | | - <span class="articleFeedbackv5-button-placeholder"><html:msg key="bucket1-toggle-found-yes" value="yes" /></span>\ |
211 | | - <input type="radio" name="toggle" id="articleFeedbackv5-bucket1-toggle-yes" class="query-button" value="yes" />\ |
| 215 | + <div class="form-row articleFeedbackv5-bucket1-toggle">\ |
| 216 | + <p class="instructions-left"><html:msg key="bucket1-question-toggle" /></p>\ |
| 217 | + <div class="buttons">\ |
| 218 | + <div class="form-item" rel="yes" id="articleFeedbackv5-bucket1-toggle-wrapper-yes">\ |
| 219 | + <label for="articleFeedbackv5-bucket1-toggle-yes"><html:msg key="bucket1-toggle-found-yes-full" /></label>\ |
| 220 | + <span class="articleFeedbackv5-button-placeholder"><html:msg key="bucket1-toggle-found-yes" value="yes" /></span>\ |
| 221 | + <input type="radio" name="toggle" id="articleFeedbackv5-bucket1-toggle-yes" class="query-button" value="yes" />\ |
| 222 | + </div>\ |
| 223 | + <div class="form-item" rel="no" id="articleFeedbackv5-bucket1-toggle-wrapper-no">\ |
| 224 | + <label for="articleFeedbackv5-bucket1-toggle-no"><html:msg key="bucket1-toggle-found-no-full" /></label>\ |
| 225 | + <span class="articleFeedbackv5-button-placeholder"><html:msg key="bucket1-toggle-found-no" /></span>\ |
| 226 | + <input type="radio" name="toggle" id="articleFeedbackv5-bucket1-toggle-no" class="query-button last" value="no" />\ |
| 227 | + </div>\ |
| 228 | + <div class="clear"></div>\ |
212 | 229 | </div>\ |
213 | | - <div class="form-item" rel="no" id="articleFeedbackv5-bucket1-toggle-wrapper-no">\ |
214 | | - <label for="articleFeedbackv5-bucket1-toggle-no"><html:msg key="bucket1-toggle-found-no-full" /></label>\ |
215 | | - <span class="articleFeedbackv5-button-placeholder"><html:msg key="bucket1-toggle-found-no" /></span>\ |
216 | | - <input type="radio" name="toggle" id="articleFeedbackv5-bucket1-toggle-no" class="query-button last" value="no" />\ |
217 | | - </div>\ |
218 | 230 | <div class="clear"></div>\ |
219 | 231 | </div>\ |
| 232 | + <div class="articleFeedbackv5-comment">\ |
| 233 | + <textarea id="find-feedback" class="feedback-text" name="comment"></textarea>\ |
| 234 | + </div>\ |
| 235 | + <div class="articleFeedbackv5-disclosure">\ |
| 236 | + <p class="articlefeedbackv5-shared-on-feedback"></p>\ |
| 237 | + <p class="articlefeedbackv5-transparency-terms"></p>\ |
| 238 | + </div>\ |
| 239 | + <button class="articleFeedbackv5-submit" type="submit" disabled="disabled"><html:msg key="bucket1-form-submit" /></button>\ |
220 | 240 | <div class="clear"></div>\ |
221 | | - </div>\ |
222 | | - <div class="articleFeedbackv5-comment">\ |
223 | | - <textarea id="find-feedback" class="feedback-text" name="comment"></textarea>\ |
224 | | - </div>\ |
225 | | - <div class="articleFeedbackv5-disclosure">\ |
226 | | - <p class="articlefeedbackv5-shared-on-feedback"></p>\ |
227 | | - <p class="articlefeedbackv5-transparency-terms"></p>\ |
228 | | - </div>\ |
229 | | - <button class="articleFeedbackv5-submit" type="submit" disabled="disabled"><html:msg key="bucket1-form-submit" /></button>\ |
230 | | - <div class="clear"></div>\ |
231 | 241 | </form>\ |
232 | 242 | ' |
233 | 243 | |
234 | 244 | }, |
235 | 245 | |
236 | 246 | // }}} |
| 247 | + // {{{ getTitle |
| 248 | + |
| 249 | + /** |
| 250 | + * Gets the title |
| 251 | + * |
| 252 | + * @return string the title |
| 253 | + */ |
| 254 | + getTitle: function () { |
| 255 | + return mw.msg( 'articlefeedbackv5-bucket1-title' ); |
| 256 | + }, |
| 257 | + |
| 258 | + // }}} |
237 | 259 | // {{{ buildForm |
238 | 260 | |
239 | 261 | /** |
— | — | @@ -269,9 +291,6 @@ |
270 | 292 | target: '_blank' |
271 | 293 | } ) ); |
272 | 294 | |
273 | | - // Localize the block |
274 | | - $block.localize( { 'prefix': 'articlefeedbackv5-' } ); |
275 | | - |
276 | 295 | // Turn the submit into a slick button |
277 | 296 | $block.find( '.articleFeedbackv5-submit' ) |
278 | 297 | .button() |
— | — | @@ -431,9 +450,6 @@ |
432 | 451 | */ |
433 | 452 | block: '\ |
434 | 453 | <form>\ |
435 | | - <div class="title-wrap">\ |
436 | | - <h2 class="articleFeedbackv5-title"><html:msg key="bucket2-title" /></h2>\ |
437 | | - </div>\ |
438 | 454 | <div>\ |
439 | 455 | <div class="articleFeedbackv5-tags">\ |
440 | 456 | <ul></ul>\ |
— | — | @@ -471,6 +487,18 @@ |
472 | 488 | }, |
473 | 489 | |
474 | 490 | // }}} |
| 491 | + // {{{ getTitle |
| 492 | + |
| 493 | + /** |
| 494 | + * Gets the title |
| 495 | + * |
| 496 | + * @return string the title |
| 497 | + */ |
| 498 | + getTitle: function () { |
| 499 | + return mw.msg( 'articlefeedbackv5-bucket2-title' ); |
| 500 | + }, |
| 501 | + |
| 502 | + // }}} |
475 | 503 | // {{{ buildForm |
476 | 504 | |
477 | 505 | /** |
— | — | @@ -530,9 +558,6 @@ |
531 | 559 | target: '_blank' |
532 | 560 | } ) ); |
533 | 561 | |
534 | | - // Localize the block |
535 | | - $block.localize( { 'prefix': 'articlefeedbackv5-' } ); |
536 | | - |
537 | 562 | // Turn the submit into a slick button |
538 | 563 | $block.find( '.articleFeedbackv5-submit' ) |
539 | 564 | .button() |
— | — | @@ -705,9 +730,6 @@ |
706 | 731 | */ |
707 | 732 | block: '\ |
708 | 733 | <form>\ |
709 | | - <div class="title-wrap">\ |
710 | | - <h2 class="articleFeedbackv5-title"><html:msg key="bucket3-title" /></h2>\ |
711 | | - </div>\ |
712 | 734 | <div>\ |
713 | 735 | <p class="instructions-left"><html:msg key="bucket3-rating-question" /></p>\ |
714 | 736 | <div class="articleFeedbackv5-rating articleFeedbackv5-rating-new">\ |
— | — | @@ -742,6 +764,18 @@ |
743 | 765 | }, |
744 | 766 | |
745 | 767 | // }}} |
| 768 | + // {{{ getTitle |
| 769 | + |
| 770 | + /** |
| 771 | + * Gets the title |
| 772 | + * |
| 773 | + * @return string the title |
| 774 | + */ |
| 775 | + getTitle: function () { |
| 776 | + return mw.msg( 'articlefeedbackv5-bucket3-title' ); |
| 777 | + }, |
| 778 | + |
| 779 | + // }}} |
746 | 780 | // {{{ buildForm |
747 | 781 | |
748 | 782 | /** |
— | — | @@ -788,9 +822,6 @@ |
789 | 823 | $block.find( '.articleFeedbackv5-comment textarea' ) |
790 | 824 | .val( mw.msg( 'articlefeedbackv5-bucket3-comment-default' ) ); |
791 | 825 | |
792 | | - // Localize the block |
793 | | - $block.localize( { 'prefix': 'articlefeedbackv5-' } ); |
794 | | - |
795 | 826 | // Turn the submit into a slick button |
796 | 827 | $block.find( '.articleFeedbackv5-submit' ) |
797 | 828 | .button() |
— | — | @@ -977,10 +1008,6 @@ |
978 | 1009 | * The template for the whole block |
979 | 1010 | */ |
980 | 1011 | block: '\ |
981 | | - <form>\ |
982 | | - <div class="title-wrap">\ |
983 | | - <h2 class="articleFeedbackv5-title"><html:msg key="bucket4-title" /></h2>\ |
984 | | - </div>\ |
985 | 1012 | <div class="form-row articleFeedbackv5-bucket4-toggle">\ |
986 | 1013 | <h3><html:msg key="bucket4-subhead"></h3>\ |
987 | 1014 | <p class="instructions-left"><html:msg key="bucket4-teaser-line1" /><br />\ |
— | — | @@ -991,12 +1018,23 @@ |
992 | 1019 | </div>\ |
993 | 1020 | <a class="articleFeedbackv5-submit"><html:msg key="bucket4-form-submit" /></a>\ |
994 | 1021 | <div class="clear"></div>\ |
995 | | - </form>\ |
996 | 1022 | ' |
997 | 1023 | |
998 | 1024 | }, |
999 | 1025 | |
1000 | 1026 | // }}} |
| 1027 | + // {{{ getTitle |
| 1028 | + |
| 1029 | + /** |
| 1030 | + * Gets the title |
| 1031 | + * |
| 1032 | + * @return string the title |
| 1033 | + */ |
| 1034 | + getTitle: function () { |
| 1035 | + return mw.msg( 'articlefeedbackv5-bucket4-title' ); |
| 1036 | + }, |
| 1037 | + |
| 1038 | + // }}} |
1001 | 1039 | // {{{ buildForm |
1002 | 1040 | |
1003 | 1041 | /** |
— | — | @@ -1028,9 +1066,6 @@ |
1029 | 1067 | } ) |
1030 | 1068 | ); |
1031 | 1069 | |
1032 | | - // Localize the block |
1033 | | - $block.localize( { 'prefix': 'articlefeedbackv5-' } ); |
1034 | | - |
1035 | 1070 | // Turn the submit into a slick button |
1036 | 1071 | $block.find( '.articleFeedbackv5-submit' ) |
1037 | 1072 | .button() |
— | — | @@ -1072,6 +1107,11 @@ |
1073 | 1108 | */ |
1074 | 1109 | loadAggregate: true, |
1075 | 1110 | |
| 1111 | + /** |
| 1112 | + * Whether we're currently looking at the report |
| 1113 | + */ |
| 1114 | + inReport: false, |
| 1115 | + |
1076 | 1116 | // }}} |
1077 | 1117 | // {{{ templates |
1078 | 1118 | |
— | — | @@ -1087,8 +1127,6 @@ |
1088 | 1128 | <form>\ |
1089 | 1129 | <div class="articleFeedbackv5-switch articleFeedbackv5-switch-report articleFeedbackv5-visibleWith-form" rel="report"><html:msg key="bucket5-report-switch-label" /></div>\ |
1090 | 1130 | <div class="articleFeedbackv5-switch articleFeedbackv5-switch-form articleFeedbackv5-visibleWith-report" rel="form"><html:msg key="bucket5-form-switch-label" /></div>\ |
1091 | | - <div class="articleFeedbackv5-title articleFeedbackv5-visibleWith-form"><html:msg key="bucket5-form-panel-title" /></div>\ |
1092 | | - <div class="articleFeedbackv5-title articleFeedbackv5-visibleWith-report"><html:msg key="bucket5-report-panel-title" /></div>\ |
1093 | 1131 | <div class="articleFeedbackv5-explanation articleFeedbackv5-visibleWith-form"><a class="articleFeedbackv5-explanation-link"><html:msg key="bucket5-form-panel-explanation" /></a></div>\ |
1094 | 1132 | <div class="articleFeedbackv5-description articleFeedbackv5-visibleWith-report"><html:msg key="bucket5-report-panel-description" /></div>\ |
1095 | 1133 | <div style="clear:both;"></div>\ |
— | — | @@ -1153,6 +1191,22 @@ |
1154 | 1192 | }, |
1155 | 1193 | |
1156 | 1194 | // }}} |
| 1195 | + // {{{ getTitle |
| 1196 | + |
| 1197 | + /** |
| 1198 | + * Gets the title |
| 1199 | + * |
| 1200 | + * @return string the title |
| 1201 | + */ |
| 1202 | + getTitle: function () { |
| 1203 | + if ( $.articleFeedbackv5.buckets[5].inReport ) { |
| 1204 | + return mw.msg( 'articlefeedbackv5-bucket5-report-panel-title' ); |
| 1205 | + } else { |
| 1206 | + return mw.msg( 'articlefeedbackv5-bucket5-form-panel-title' ); |
| 1207 | + } |
| 1208 | + }, |
| 1209 | + |
| 1210 | + // }}} |
1157 | 1211 | // {{{ buildForm |
1158 | 1212 | |
1159 | 1213 | /** |
— | — | @@ -1208,9 +1262,6 @@ |
1209 | 1263 | .attr( 'placeholder', mw.msg( 'articlefeedbackv5-bucket5-form-panel-helpimprove-email-placeholder' ) ) |
1210 | 1264 | .placeholder(); // back. compat. for older browsers |
1211 | 1265 | |
1212 | | - // Localize the block |
1213 | | - $block.localize( { 'prefix': 'articlefeedbackv5-' } ); |
1214 | | - |
1215 | 1266 | // Activate tooltips |
1216 | 1267 | $block.find( '[title]' ) |
1217 | 1268 | .tipsy( { |
— | — | @@ -1319,17 +1370,18 @@ |
1320 | 1371 | // Set up form/report switch behavior |
1321 | 1372 | $block.find( '.articleFeedbackv5-switch' ) |
1322 | 1373 | .click( function ( e ) { |
1323 | | - if ( $(this).attr( 'rel' ) == 'report' && $.articleFeedbackv5.currentBucket().loadAggregate ) { |
| 1374 | + var which = $( this ).attr( 'rel' ); |
| 1375 | + if ( which == 'report' && $.articleFeedbackv5.currentBucket().loadAggregate ) { |
1324 | 1376 | $.articleFeedbackv5.currentBucket().loadAggregateRatings(); |
1325 | 1377 | $.articleFeedbackv5.currentBucket().loadAggregate = false; |
1326 | 1378 | } |
1327 | | - $.articleFeedbackv5.$holder.find( '.articleFeedbackv5-visibleWith-' + $(this).attr( 'rel' ) ) |
1328 | | - .show(); |
1329 | | - $.articleFeedbackv5.$holder.find( '.articleFeedbackv5-switch' ) |
1330 | | - .not( $(this) ) |
| 1379 | + $.articleFeedbackv5.find( '.articleFeedbackv5-visibleWith-' + which ).show(); |
| 1380 | + $.articleFeedbackv5.find( '.articleFeedbackv5-switch' ) |
| 1381 | + .not( $( this ) ) |
1331 | 1382 | .each( function () { |
1332 | | - $.articleFeedbackv5.$holder.find( '.articleFeedbackv5-visibleWith-' + $(this).attr( 'rel' ) ).hide(); |
| 1383 | + $.articleFeedbackv5.find( '.articleFeedbackv5-visibleWith-' + $( this ).attr( 'rel' ) ).hide(); |
1333 | 1384 | } ); |
| 1385 | + $.articleFeedbackv5.currentBucket().inReport = which == 'report'; |
1334 | 1386 | e.preventDefault(); |
1335 | 1387 | return false; |
1336 | 1388 | } ); |
— | — | @@ -1541,18 +1593,6 @@ |
1542 | 1594 | } |
1543 | 1595 | } ); |
1544 | 1596 | |
1545 | | - // Expiration |
1546 | | - var $ui = $.articleFeedbackv5.find( 'articleFeedbackv5-ui' ); |
1547 | | - if ( typeof feedback.status === 'string' && feedback.status === 'expired' ) { |
1548 | | - $ui.addClass( 'articleFeedbackv5-expired' ); |
1549 | | - $ui.find( '.articleFeedbackv5-expiry' ) |
1550 | | - .slideDown( 'fast' ); |
1551 | | - } else { |
1552 | | - $ui.removeClass( 'articleFeedbackv5-expired' ) |
1553 | | - $ui.find( '.articleFeedbackv5-expiry' ) |
1554 | | - .slideUp( 'fast' ); |
1555 | | - } |
1556 | | - |
1557 | 1597 | // Status change - un-new the rating controls |
1558 | 1598 | $.articleFeedbackv5.find( '.articleFeedbackv5-rating-new' ) |
1559 | 1599 | .removeClass( 'articleFeedbackv5-rating-new' ); |
— | — | @@ -1582,7 +1622,6 @@ |
1583 | 1623 | data[key] = $.articleFeedbackv5.find( 'input[name="' + key + '"]' ).val(); |
1584 | 1624 | } |
1585 | 1625 | $.articleFeedbackv5.find( '.articleFeedbackv5-expertise input:checked' ).each( function () { |
1586 | | - console.log($(this).is(':checked')); |
1587 | 1626 | data['expertise-' + $( this ).val()] = 1; |
1588 | 1627 | } ); |
1589 | 1628 | return data; |
— | — | @@ -1912,16 +1951,6 @@ |
1913 | 1952 | * @param Element $block the form block |
1914 | 1953 | */ |
1915 | 1954 | $.articleFeedbackv5.addHelpButton = function ( $block ) { |
1916 | | - // Add the help tooltip to the title |
1917 | | - $block.find( '.title-wrap' ) |
1918 | | - .append( $.articleFeedbackv5.templates.helpToolTip ) |
1919 | | - .append( $.articleFeedbackv5.templates.clear ); |
1920 | | - // Start out the tooltip hidden |
1921 | | - $block.find( '.articleFeedbackv5-tooltip' ).hide(); |
1922 | | - // Toogle on click |
1923 | | - $block.find( '.articleFeedbackv5-tooltip-trigger' ).click( function () { |
1924 | | - $.articleFeedbackv5.find( '.articleFeedbackv5-tooltip' ).toggle(); |
1925 | | - } ); |
1926 | 1955 | }; |
1927 | 1956 | |
1928 | 1957 | // }}} |
— | — | @@ -2022,14 +2051,24 @@ |
2023 | 2052 | if ( 'bindEvents' in bucket ) { |
2024 | 2053 | bucket.bindEvents( $block ); |
2025 | 2054 | } |
2026 | | - if ( 'fillForm' in bucket ) { |
2027 | | - bucket.fillForm( $block, response ); |
2028 | | - } |
2029 | 2055 | |
2030 | 2056 | // Wrap it in a panel |
2031 | 2057 | var $wrapper = $( $.articleFeedbackv5.templates.panelOuter ); |
2032 | 2058 | $wrapper.find( '.articleFeedbackv5-ui' ).append( $block ); |
| 2059 | + if ( 'getTitle' in bucket ) { |
| 2060 | + $wrapper.find( '.articleFeedbackv5-title' ).html( bucket.getTitle() ); |
| 2061 | + } |
2033 | 2062 | |
| 2063 | + // Set up the tooltip for the panel version |
| 2064 | + $wrapper.find( '.articleFeedbackv5-title-wrap' ).append( $.articleFeedbackv5.templates.helpToolTip ); |
| 2065 | + $wrapper.find( '.articleFeedbackv5-tooltip' ).hide(); |
| 2066 | + $wrapper.find( '.articleFeedbackv5-tooltip-trigger' ).click( function () { |
| 2067 | + $.articleFeedbackv5.$holder.find( '.articleFeedbackv5-tooltip' ).toggle(); |
| 2068 | + } ); |
| 2069 | + |
| 2070 | + // Localize |
| 2071 | + $wrapper.localize( { 'prefix': 'articlefeedbackv5-' } ); |
| 2072 | + |
2034 | 2073 | // Add it to the page |
2035 | 2074 | $.articleFeedbackv5.$holder |
2036 | 2075 | .html( $wrapper ) |
— | — | @@ -2038,18 +2077,6 @@ |
2039 | 2078 | // Add an empty dialog |
2040 | 2079 | $.articleFeedbackv5.$dialog = $( '<div id="articleFeedbackv5-dialog-wrap"></div>' ); |
2041 | 2080 | $.articleFeedbackv5.$holder.after( $.articleFeedbackv5.$dialog ); |
2042 | | - var w = $.articleFeedbackv5.$holder.find( '.articleFeedbackv5-panel' ).width(); |
2043 | | - var h = $.articleFeedbackv5.$holder.find( '.articleFeedbackv5-panel' ).height(); |
2044 | | - $.articleFeedbackv5.$dialog.dialog( { |
2045 | | - width: w + 20, |
2046 | | - height: h + 50, |
2047 | | - dialogClass: 'articleFeedbackv5-dialog', |
2048 | | - resizable: false, |
2049 | | - autoOpen: false, |
2050 | | - close: function ( event, ui ) { |
2051 | | - $.articleFeedbackv5.closeAsModal(); |
2052 | | - } |
2053 | | - } ); |
2054 | 2081 | |
2055 | 2082 | // Set loaded |
2056 | 2083 | $.articleFeedbackv5.isLoaded = true; |
— | — | @@ -2177,6 +2204,7 @@ |
2178 | 2205 | }; |
2179 | 2206 | |
2180 | 2207 | // }}} |
| 2208 | + |
2181 | 2209 | // }}} |
2182 | 2210 | // {{{ UI methods |
2183 | 2211 | |
— | — | @@ -2189,9 +2217,11 @@ |
2190 | 2218 | */ |
2191 | 2219 | $.articleFeedbackv5.markShowstopperError = function ( message ) { |
2192 | 2220 | console.log( message ); |
| 2221 | + var msg_html = mw.msg( 'articlefeedbackv5-error' ); |
2193 | 2222 | if ($.articleFeedbackv5.debug && message) { |
2194 | | - $.articleFeedbackv5.$holder.find( '.articleFeedbackv5-error-message' ).html( message.replace( "\n", '<br />' ) ); |
| 2223 | + msg_html = message.replace( "\n", '<br />' ); |
2195 | 2224 | } |
| 2225 | + $.articleFeedbackv5.$holder.find( '.articleFeedbackv5-error-message' ).html( msg_html ); |
2196 | 2226 | var veil = $.articleFeedbackv5.$holder.find( '.articleFeedbackv5-error' ); |
2197 | 2227 | var box = $.articleFeedbackv5.$holder.find( '.articleFeedbackv5-panel' ); |
2198 | 2228 | // TODO: Make this smarter -- on ubuntu/ff at least, using the |
— | — | @@ -2253,18 +2283,46 @@ |
2254 | 2284 | /** |
2255 | 2285 | * Opens the feedback tool as a modal window |
2256 | 2286 | * |
2257 | | - * @param linkId string the link ID to set on open |
| 2287 | + * @param $link Element the feedback link |
2258 | 2288 | */ |
2259 | | - $.articleFeedbackv5.openAsModal = function ( linkId ) { |
2260 | | - $.articleFeedbackv5.setLinkId( linkId ); |
| 2289 | + $.articleFeedbackv5.openAsModal = function ( $link ) { |
2261 | 2290 | if ( !$.articleFeedbackv5.isLoaded ) { |
2262 | 2291 | $.articleFeedbackv5.loadForm(); |
2263 | 2292 | } |
2264 | 2293 | if ( !$.articleFeedbackv5.inDialog ) { |
2265 | | - $inner = $.articleFeedbackv5.$holder.find( '.articleFeedbackv5-panel' ).detach(); |
| 2294 | + var w = $.articleFeedbackv5.$holder.find( '.articleFeedbackv5-ui' ).width(); |
| 2295 | + var h = $.articleFeedbackv5.$holder.find( '.articleFeedbackv5-ui' ).height(); |
| 2296 | + var o = $link.offset(); |
| 2297 | + var x = 'center'; |
| 2298 | + // var y = o.top - h - 20; |
| 2299 | + var y = 'center'; |
| 2300 | + $inner = $.articleFeedbackv5.$holder.find( '.articleFeedbackv5-ui' ).detach(); |
2266 | 2301 | $.articleFeedbackv5.$dialog.append( $inner ); |
2267 | | - $.articleFeedbackv5.setLinkId( linkId ); |
2268 | | - $.articleFeedbackv5.$dialog.dialog( 'open' ); |
| 2302 | + $.articleFeedbackv5.setLinkId( $link.data( 'linkId' ) ); |
| 2303 | + $.articleFeedbackv5.$dialog.dialog( { |
| 2304 | + width: w + 20, |
| 2305 | + height: h + 50, |
| 2306 | + position: [ x, y ], |
| 2307 | + dialogClass: 'articleFeedbackv5-dialog', |
| 2308 | + resizable: false, |
| 2309 | + draggable: true, |
| 2310 | + title: $.articleFeedbackv5.currentBucket().getTitle(), |
| 2311 | + modal: true, |
| 2312 | + close: function ( event, ui ) { |
| 2313 | + $.articleFeedbackv5.closeAsModal(); |
| 2314 | + } |
| 2315 | + } ); |
| 2316 | + var $title = $( '#ui-dialog-title-articleFeedbackv5-dialog-wrap' ); |
| 2317 | + var $titlebar = $title.parent(); |
| 2318 | + $title.addClass( 'articleFeedbackv5-title' ); |
| 2319 | + // Set up the tooltip |
| 2320 | + $titlebar.append( $.articleFeedbackv5.templates.helpToolTip ); |
| 2321 | + $titlebar.find( '.articleFeedbackv5-tooltip' ).hide(); |
| 2322 | + $titlebar.find( '.articleFeedbackv5-tooltip-trigger' ).click( function ( e ) { |
| 2323 | + $( e.target ).next( '.articleFeedbackv5-tooltip' ).toggle(); |
| 2324 | + } ); |
| 2325 | + $titlebar.localize( { 'prefix': 'articlefeedbackv5-' } ); |
| 2326 | + |
2269 | 2327 | $.articleFeedbackv5.inDialog = true; |
2270 | 2328 | } |
2271 | 2329 | }; |
— | — | @@ -2278,8 +2336,9 @@ |
2279 | 2337 | $.articleFeedbackv5.closeAsModal = function () { |
2280 | 2338 | if ( $.articleFeedbackv5.inDialog ) { |
2281 | 2339 | $.articleFeedbackv5.setLinkId( '0' ); |
2282 | | - $inner = $.articleFeedbackv5.$dialog.find( '.articleFeedbackv5-panel' ).detach(); |
2283 | | - $.articleFeedbackv5.$holder.append( $inner ); |
| 2340 | + $inner = $.articleFeedbackv5.$dialog.find( '.articleFeedbackv5-ui' ).detach(); |
| 2341 | + $.articleFeedbackv5.$holder.find( '.articleFeedbackv5-buffer' ).append( $inner ); |
| 2342 | + $.articleFeedbackv5.$dialog.dialog( 'destroy' ); |
2284 | 2343 | $.articleFeedbackv5.inDialog = false; |
2285 | 2344 | } |
2286 | 2345 | }; |
Index: trunk/extensions/ArticleFeedbackv5/modules/ext.articleFeedbackv5/ext.articleFeedbackv5.js |
— | — | @@ -18,13 +18,13 @@ |
19 | 19 | }; |
20 | 20 | |
21 | 21 | // Click event |
22 | | -var clickFeedbackLink = function ( linkId ) { |
| 22 | +var clickFeedbackLink = function ( $link ) { |
23 | 23 | // Click tracking |
24 | 24 | if ( useClickTracking && $.isFunction( $.trackActionWithInfo ) ) { |
25 | | - $.trackActionWithInfo( linkInfo[linkId].clickTracking, mw.config.get( 'wgTitle' ) ); |
| 25 | + $.trackActionWithInfo( linkInfo[ $link.data( 'linkId' ) ].clickTracking, mw.config.get( 'wgTitle' ) ); |
26 | 26 | } |
27 | 27 | // Set the link id |
28 | | - $( '#mw-articlefeedbackv5' ).articleFeedbackv5( 'openAsModal', linkId ); |
| 28 | + $( '#mw-articlefeedbackv5' ).articleFeedbackv5( 'openAsModal', $link ); |
29 | 29 | } |
30 | 30 | |
31 | 31 | /* Load at the bottom of the article */ |
— | — | @@ -47,18 +47,21 @@ |
48 | 48 | mw.msg( 'articlefeedbackv5-section-linktext' ) + '</a>' + |
49 | 49 | ']' |
50 | 50 | ); |
51 | | -$( 'span.editsection a.articleFeedbackv5-sectionlink' ).click( function ( e ) { |
52 | | - e.preventDefault(); |
53 | | - clickFeedbackLink( '1' ); |
54 | | -} ); |
| 51 | +$( 'span.editsection a.articleFeedbackv5-sectionlink' ) |
| 52 | + .data( 'linkId', 1 ) |
| 53 | + .click( function ( e ) { |
| 54 | + e.preventDefault(); |
| 55 | + clickFeedbackLink( $( e.target ) ); |
| 56 | + } ); |
55 | 57 | |
56 | 58 | /* Add toolbox link */ |
57 | 59 | var $aftLink4 = $( '<li id="t-articlefeedbackv5"><a href="#mw-articlefeedbackv5"></a></li>' ) |
58 | 60 | .find( 'a' ) |
| 61 | + .data( 'linkId', 4 ) |
59 | 62 | .text( mw.msg( 'articlefeedbackv5-toolbox-linktext' ) ) |
60 | 63 | .click( function ( e ) { |
61 | 64 | e.preventDefault(); |
62 | | - clickFeedbackLink( '4' ); |
| 65 | + clickFeedbackLink( $( e.target ) ); |
63 | 66 | } ) |
64 | 67 | .end(); |
65 | 68 | $( '#p-tb' ).find( 'ul' ).append( $aftLink4 ); |