Changeset 31534
- Timestamp:
- 02/25/2015 01:49:26 AM (10 years ago)
- Location:
- trunk/src
- Files:
-
- 5 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/admin-ajax.php
r31333 r31534 62 62 'send-attachment-to-editor', 'save-attachment-order', 'heartbeat', 'get-revision-diffs', 63 63 'save-user-color-scheme', 'update-widget', 'query-themes', 'parse-embed', 'set-attachment-thumbnail', 64 'parse-media-shortcode', 'destroy-sessions', 'install-plugin', 'update-plugin' 64 'parse-media-shortcode', 'destroy-sessions', 'install-plugin', 'update-plugin', 'press-this-save-post', 65 'press-this-add-category', 65 66 ); 66 67 -
trunk/src/wp-admin/css/forms.css
r31422 r31534 685 685 .pressthis { 686 686 margin: 20px 0; 687 vertical-align: top; 688 position: relative; 689 z-index: 1; 687 690 } 688 691 … … 749 752 } 750 753 754 .pressthis .button { 755 margin-left: 10px; 756 padding: 0; 757 height: auto; 758 vertical-align: top; 759 } 760 761 .pressthis button .dashicons { 762 margin: 5px 8px 6px 7px; 763 color: #777; 764 } 765 766 .press-this-install { 767 margin: 20px 0 0 0; 768 padding: 0.7em 2em 1em; 769 max-width: 520px; 770 } 771 772 .press-this-install textarea { 773 width: 100%; 774 font-size: 1em; 775 } 776 777 .press-this-install h4 { 778 margin: 2em 0 1em; 779 } 780 781 /* to override the button class being applied */ 782 .pressthis .button.button { 783 margin-left: 10px; 784 padding: 0; 785 height: auto; 786 vertical-align: top; 787 } 788 789 .pressthis button .dashicons { 790 margin: 5px 8px 6px 7px; 791 color: #777; 792 } 793 794 .press-this-install { 795 margin: 20px 0 0 0; 796 padding: 0.7em 2em 1em; 797 max-width: 520px; 798 } 799 800 .press-this-install textarea { 801 width: 100%; 802 font-size: 1em; 803 } 804 805 .press-this-install h4 { 806 margin: 2em 0 1em; 807 } 808 809 751 810 /*------------------------------------------------------------------------------ 752 811 20.0 - Settings -
trunk/src/wp-admin/css/press-this.css
r31422 r31534 1 .press-this #message { 2 border-left: 4px solid #7ad03a; 3 padding: 1px 12px; 4 background-color: #fff; 5 -webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,0.1); 6 box-shadow: 0 1px 1px 0 rgba(0,0,0,0.1); 7 } 8 9 .press-this #side-sortables .category-tabs li { 10 display: inline; 11 line-height: 1.35em; 12 } 13 14 body.press-this ul.category-tabs li.tabs a { 15 color: #32373c; 16 } 17 18 .press-this #content-resize-handle { 19 bottom: 2px; 20 } 21 22 body.press-this { 23 color: #32373c; 1 /* 2 Press This styles :) 3 */ 4 5 6 /** 7 * Normalize 8 * 9 * normalize.css v3.0.0 | MIT License | git.io/normalize 10 */ 11 html { 12 font-family: sans-serif; 13 -ms-text-size-adjust: 100%; 14 -webkit-text-size-adjust: 100%; 15 } 16 17 body { 24 18 margin: 0; 25 padding: 0; 26 min-width: 708px; 27 min-height: 400px; 28 } 29 30 .press-this #titlediv #title { 31 font-size: 1.4em; 32 } 33 34 .press-this #site-heading:before { 35 top: 3px; 36 position: relative; 37 display: inline-block; 38 font: normal 18px/1 'dashicons'; 39 speak: none; 40 color: #727272; 41 content: '\f120'; 42 -webkit-font-smoothing: antialiased; 43 -moz-osx-font-smoothing: grayscale; 44 } 45 46 .press-this #wphead { 47 height: 32px; 48 margin-left: 0; 49 margin-right: 0; 50 margin-bottom: 5px; 51 } 52 53 .press-this #header-logo { 54 float: left; 55 margin: 7px 7px 0; 56 -webkit-user-select: none; 57 -moz-user-select: none; 58 -ms-user-select: none; 59 user-select: none; 60 } 61 62 .press-this #wphead h1 { 63 font-weight: normal; 64 font-size: 16px; 65 line-height: 32px; 66 margin: 0; 67 float: left; 68 } 69 70 .press-this #wphead h1 a { 71 text-decoration: none; 72 } 73 74 .press-this #wphead h1 a:hover { 75 text-decoration: underline; 76 } 77 78 .press-this #message { 79 margin: 10px 0; 80 } 81 82 .press-this .posting { 83 margin-right: 250px; 84 } 85 86 .press-this-sidebar { 87 float: right; 88 width: 240px; 89 padding-top: 10px; 90 } 91 92 .press-this #title { 93 margin-left: 0; 94 margin-right: 0; 19 } 20 21 *, 22 *:before, 23 *:after { 95 24 -webkit-box-sizing: border-box; 96 25 -moz-box-sizing: border-box; 97 26 box-sizing: border-box; 98 27 } 99 100 .press-this .tagchecklist { 101 margin-top: 8px; 102 } 103 104 .press-this #titlediv { 28 @media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-resolution: 144dpi) { 29 *, 30 *:before, 31 *:after { 32 -webkit-font-smoothing: antialiased; 33 } 34 } 35 36 article, 37 aside, 38 details, 39 figcaption, 40 figure, 41 footer, 42 header, 43 hgroup, 44 main, 45 nav, 46 section, 47 summary { 48 display: block; 49 } 50 51 audio, 52 canvas, 53 progress, 54 video { 55 display: inline-block; 56 vertical-align: baseline; 57 } 58 59 audio:not([controls]) { 60 display: none; 61 height: 0; 62 } 63 64 [hidden], 65 template { 66 display: none; 67 } 68 69 a { 70 background: transparent; 71 } 72 73 a:active, 74 a:hover { 75 outline: 0; 76 } 77 78 abbr[title] { 79 border-bottom: 1px dotted; 80 } 81 82 b, 83 strong { 84 font-weight: bold; 85 } 86 87 dfn { 88 font-style: italic; 89 } 90 91 h1 { 92 font-size: 2em; 93 margin: 0.67em 0; 94 } 95 96 mark { 97 background: #ff0; 98 color: #000; 99 } 100 101 small { 102 font-size: 80%; 103 } 104 105 sub, 106 sup { 107 font-size: 75%; 108 line-height: 0; 109 position: relative; 110 vertical-align: baseline; 111 } 112 113 sup { 114 top: -0.5em; 115 } 116 117 sub { 118 bottom: -0.25em; 119 } 120 121 img { 122 border: 0; 123 } 124 125 svg:not(:root) { 126 overflow: hidden; 127 } 128 129 figure { 130 margin: 1em 40px; 131 } 132 133 hr { 134 -webkit-box-sizing: content-box; 135 -moz-box-sizing: content-box; 136 box-sizing: content-box; 137 height: 0; 138 } 139 140 pre { 141 overflow: auto; 142 } 143 144 code, 145 kbd, 146 pre, 147 samp { 148 font-family: monospace, monospace; 149 font-size: 1em; 150 } 151 152 button, 153 input, 154 optgroup, 155 select, 156 textarea { 157 color: inherit; 158 font: inherit; 105 159 margin: 0; 106 160 } 107 161 108 .press-this #wp-content-wrap #wp-content-editor-tools { 162 button { 163 overflow: visible; 164 } 165 166 button, 167 select { 168 text-transform: none; 169 } 170 171 button, 172 html input[type="button"], 173 input[type="reset"], 174 input[type="submit"] { 175 -webkit-appearance: button; 176 cursor: pointer; 177 } 178 179 button[disabled], 180 html input[disabled] { 181 cursor: default; 182 } 183 184 button::-moz-focus-inner, 185 input::-moz-focus-inner { 186 border: 0; 109 187 padding: 0; 110 top: 3px; 188 } 189 190 input { 191 line-height: normal; 192 } 193 194 input[type="checkbox"], 195 input[type="radio"] { 196 -webkit-box-sizing: border-box; 197 -moz-box-sizing: border-box; 198 box-sizing: border-box; 199 padding: 0; 200 } 201 202 input[type="number"]::-webkit-inner-spin-button, 203 input[type="number"]::-webkit-outer-spin-button { 204 height: auto; 205 } 206 207 input[type="search"] { 208 -webkit-appearance: textfield; 209 -webkit-box-sizing: content-box; 210 -moz-box-sizing: content-box; 211 box-sizing: content-box; 212 } 213 214 input[type="search"]::-webkit-search-cancel-button, 215 input[type="search"]::-webkit-search-decoration { 216 -webkit-appearance: none; 217 } 218 219 fieldset { 220 border: 1px solid #c0c0c0; 221 margin: 0 2px; 222 padding: 0.35em 0.625em 0.75em; 223 } 224 225 legend { 226 border: 0; 227 padding: 0; 228 } 229 230 textarea { 231 overflow: auto; 232 } 233 234 optgroup { 235 font-weight: bold; 236 } 237 238 table { 239 border-collapse: collapse; 240 border-spacing: 0; 241 } 242 243 td, 244 th { 245 padding: 0; 246 } 247 248 .clearfix:before, 249 .clearfix:after { 250 content: ""; 251 display: table; 252 } 253 .clearfix:after { 254 clear: both; 255 } 256 257 .hide-if-js { 258 display: none; 259 } 260 261 .screen-reader-text, 262 .taghint { 263 position: absolute; 264 margin: -1px; 265 padding: 0; 266 height: 1px; 267 width: 1px; 111 268 overflow: hidden; 112 } 113 114 .press-this .wp-media-buttons { 269 clip: rect(0 0 0 0); 270 border: 0; 271 } 272 273 274 /** 275 * Typography 276 * 277 * Base element typographic styles. 278 */ 279 body, 280 button, 281 input, 282 select, 283 textarea { 284 color: #404040; 285 font-family: "Open Sans", Helvetica, Arial, sans-serif; 286 font-size: 20px; 287 font-weight: 400; 288 line-height: 1.6; 289 } 290 291 h1, 292 h2, 293 h3, 294 h4, 295 h5, 296 h6 { 297 clear: both; 298 } 299 300 p { 301 margin-bottom: 1.5em; 302 } 303 304 b, 305 strong { 306 font-weight: 700; 307 } 308 309 310 /** 311 * Buttons 312 * 313 * Pushing buttons is what I do. 314 */ 315 .button-primary, 316 .button-subtle, 317 .scan-submit { 318 display: inline-block; 319 margin: 0; 320 padding: 0 10px 1px; 321 border-width: 1px; 322 border-style: solid; 323 -webkit-border-radius: 3px; 324 border-radius: 3px; 325 font-size: 13px; 326 line-height: 2; 327 text-decoration: none; 328 white-space: nowrap; 329 cursor: pointer; 330 -webkit-appearance: none; 331 } 332 333 .button-primary { 334 background: #2ea2cc; 335 border-color: #2581a2; 336 color: #fff; 337 } 338 339 .button-primary:hover, 340 .button-primary:focus { 341 background: #2991b7; 342 border-color: #20708e; 343 color: #fff; 344 outline: 0; 345 } 346 347 .button-primary:active { 348 background: #2581a2; 349 border-color: #20708e; 350 color: #fff; 351 } 352 353 .button-primary[disabled], 354 .button-primary:disabled { 355 color: #c7ced1 !important; 356 background: #2688ab !important; 357 border-color: #20708e !important; 358 } 359 360 .button-primary:visited { 361 color: #fff; 362 } 363 364 .button-subtle { 365 background: none; 366 border: 0; 367 color: #0074a2; 368 } 369 370 .button-subtle:visited { 371 color: #0074a2; 372 } 373 374 .button-subtle:focus, 375 .button-subtle:hover, 376 .button-subtle:active { 377 color: #2ea2cc; 378 } 379 380 .button-subtle:focus, 381 .button-subtle:active { 382 outline: 0; 383 text-decoration: underline; 384 } 385 386 .button-reset { 387 margin: 0; 388 padding: 0; 389 border: 0; 390 background: none; 391 cursor: pointer; 392 -webkit-appearance: none; 393 } 394 395 .button-reset:focus { 396 outline: 0; 397 } 398 399 400 /** 401 * Forms 402 * 403 * So many input types. 404 */ 405 button, 406 input, 407 select, 408 textarea { 409 font-size: 100%; 410 margin: 0; 411 vertical-align: baseline; 412 *vertical-align: middle; 413 } 414 415 [type="checkbox"], 416 [type="radio"] { 417 padding: 0; 418 } 419 420 [type="search"] { 421 -webkit-appearance: textfield; 422 -webkit-box-sizing: content-box; 423 -moz-box-sizing: content-box; 424 box-sizing: content-box; 425 } 426 427 [type="search"]::-webkit-search-decoration { 428 -webkit-appearance: none; 429 } 430 431 button::-moz-focus-inner, 432 input::-moz-focus-inner { 433 border: 0; 434 padding: 0; 435 } 436 437 [type="text"], 438 [type="email"], 439 [type="url"], 440 [type="password"], 441 [type="search"], 442 textarea { 443 padding: 0.4em 0.75em; 444 color: #333; 445 border: 1px solid #ccc; 446 } 447 448 [type="text"]:focus, 449 [type="email"]:focus, 450 [type="url"]:focus, 451 [type="password"]:focus, 452 [type="search"]:focus, 453 textarea:focus { 454 color: #333; 455 outline: 0; 456 } 457 458 textarea { 459 overflow: auto; 460 padding-left: 3px; 461 vertical-align: top; 462 } 463 464 465 /** 466 * Links 467 */ 468 a { 469 color: #0074a2; 470 } 471 472 a:visited { 473 color: #0074a2; 474 } 475 476 a:hover, 477 a:focus, 478 a:active { 479 color: #2ea2cc; 480 } 481 482 483 /** 484 * Lists 485 */ 486 ul, 487 ol { 488 margin: 0 0 1.5em 3em; 489 } 490 491 ul { 492 list-style: disc; 493 } 494 495 ol { 496 list-style: decimal; 497 } 498 499 li > ul, 500 li > ol { 501 margin-bottom: 0; 502 margin-left: 1.5em; 503 } 504 505 dt { 506 font-weight: 700; 507 } 508 509 dd { 510 margin: 0 1.5em 1.5em; 511 } 512 513 514 /** 515 * Post formats 516 * 517 * Complete styles for post formats UI 518 */ 519 /* TODO if we remove the <br> during merge, this can go. */ 520 #post-formats-select br { 521 display: none; 522 } 523 524 /* TODO Needed after merge? */ 525 .post-format { 526 width: 0; 527 height: 0; 528 position: absolute; 529 top: -9999px; 530 } 531 532 .lt-ie9 .post-format { 533 margin: 17px 12px 0 13px; 534 width: auto; 535 height: auto; 536 position: static; 537 top: auto; 538 float: left; 539 width: 16px; 540 height: 16px; 541 } 542 543 .post-format-icon { 544 position: relative; 545 display: block; 546 padding: 13px 2px 14px 13px; 547 cursor: pointer; 548 } 549 550 .post-format-icon:before, 551 .post-format-icon:after { 552 content: ""; 553 display: inline-block; 554 width: 20px; 555 height: 20px; 556 margin-right: 10px; 557 font-size: 20px; 558 line-height: 1; 559 font-family: dashicons; 560 text-decoration: inherit; 561 color: #9ea7af; 562 font-weight: 400; 563 font-style: normal; 564 vertical-align: top; 565 text-align: center; 566 -webkit-transition: color .1s ease-in 0; 567 transition: color .1s ease-in 0; 568 -webkit-font-smoothing: antialiased; 569 -moz-osx-font-smoothing: grayscale; 570 } 571 572 .post-format-icon:before { 573 content: "\f109"; 574 } 575 576 .post-format-icon:after { 577 display: none; 578 content: "\f147"; 579 float: right; 580 } 581 582 .post-format:checked + .post-format-icon { 583 -webkit-box-shadow: inset 6px 0 0 #2ea2cc; 584 box-shadow: inset 6px 0 0 #2ea2cc; 585 background: rgba(46, 162, 204, 0.1); 586 } 587 588 .post-format:checked + .post-format-icon:before, 589 .post-format:checked + .post-format-icon:after { 590 color: #333; 591 } 592 593 .post-format:focus + .post-format-icon { 594 background: #2ea2cc; 595 color: #fff; 596 } 597 598 .post-format:focus + .post-format-icon:before, 599 .post-format:focus + .post-format-icon:after { 600 color: #fff; 601 } 602 603 .post-format:checked + .post-format-icon:after { 604 display: block; 605 } 606 607 .lt-ie9 .post-format-icon { 608 margin-left: 16px; 609 } 610 611 .post-format-aside:before { 612 content: "\f123"; 613 } 614 615 .post-format-image:before { 616 content: "\f128"; 617 } 618 619 .post-format-video:before { 620 content: "\f126"; 621 } 622 623 .post-format-audio:before { 624 content: "\f127"; 625 } 626 627 .post-format-quote:before { 628 content: "\f122"; 629 } 630 631 .post-format-link:before { 632 content: "\f103"; 633 } 634 635 .post-format-gallery:before { 636 content: "\f161"; 637 } 638 639 640 /** 641 * Tags 642 * 643 * Complete styles for tags UI 644 */ 645 .tagsdiv p { 646 margin: 0; 647 } 648 649 .tagsdiv .ajaxtag { 650 position: relative; 651 } 652 653 .tagsdiv .newtag { 654 display: block; 655 position: relative; 656 padding: 11px 58px 11px 16px; 657 width: 100%; 658 border: 0; 659 border-bottom: 1px solid #e5e5e5; 660 font-size: 16px; 661 } 662 663 .tagsdiv .tagadd { 664 position: absolute; 665 top: 0; 666 right: 0; 667 bottom: 1px; 668 border: 0; 669 -webkit-border-radius: 0; 670 border-radius: 0; 671 padding: 0 16px; 672 background: #f7f7f7; 673 border-left: 1px solid #f1f1f1; 674 } 675 676 .tagsdiv .tagadd:hover, 677 .tagsdiv .tagadd:active, 678 .tagsdiv .tagadd:focus { 679 outline: 0; 680 background: #2991b7; 681 border-color: #20708e; 682 color: #fff; 683 } 684 685 .tagsdiv .howto { 686 color: #727272; 687 font-style: italic; 688 margin: 10px 0 6px 16px; 689 } 690 691 692 /* Tag hint TODO needed? */ 693 /* Tag suggestions */ 694 .ac_results { 695 padding: 0; 696 margin: -1px 0 0 -1px; 697 list-style: none; 698 position: absolute; 699 z-index: 10000; 700 display: none; 701 border: 1px solid #d8d8d8; 702 background-color: #fff; 703 font-size: 14px; 704 } 705 706 .ac_results li { 707 padding: 6px 16px; 708 white-space: nowrap; 709 color: #101010; 710 text-align: left; 711 } 712 713 .ac_results .ac_over { 714 background-color: #e5e5e5; 715 background-color: #2ea2cc; 716 color: #fff; 717 cursor: pointer; 718 } 719 720 .ac_match { 721 text-decoration: underline; 722 } 723 724 /* Tags */ 725 .tagchecklist { 726 padding: 16px 28px 5px; 727 } 728 729 .tagchecklist:before, 730 .tagchecklist:after { 731 content: ""; 732 display: table; 733 } 734 735 .tagchecklist:after { 736 clear: both; 737 } 738 739 .tagchecklist span { 740 display: block; 741 margin-right: 25px; 742 float: left; 743 font-size: 13px; 744 line-height: 1.8; 745 white-space: nowrap; 115 746 cursor: default; 116 padding: 8px 8px 6px; 117 } 118 119 .press-this #wp-content-wrap #wp-content-media-buttons a { 120 padding: 0; 121 line-height: normal; 122 height: auto; 123 font-size: 16px; 124 } 125 126 .press-this #wp-content-wrap .mce-toolbar .mce-btn-group .mce-btn { 127 margin: 0 1px; 128 } 129 130 .press-this #wp-content-wrap .mce-toolbar .mce-btn button { 131 padding: 2px 3px; 132 } 133 134 .press-this #wp-content-wrap div.mce-toolbar-grp, 135 .press-this #wp-content-wrap .quicktags-toolbar { 136 padding-right: 3px; 137 } 138 139 .press-this .howto { 140 margin-top: 2px; 141 margin-bottom: 3px; 142 font-size: 12px; 143 font-style: italic; 144 display: block; 145 } 146 147 .press-this #wp-content-editor-container { 148 clear: none; 149 } 150 151 .press-this #poststuff .inside { 152 margin-top: 18px; 153 } 154 155 .press-this .category-tabs { 156 margin-bottom: 3px; 157 } 158 159 /* Editor/Main Column */ 160 .press-this #poststuff { 161 margin: 0 8px; 162 padding: 0; 163 } 164 165 .press-this #photo-add-url-div input[type="text"] { 166 width: 220px; 167 } 168 169 #poststuff #editor-toolbar { 170 height: 30px; 171 } 172 173 .posting { 174 margin-right: 212px; 175 position: relative; 176 } 177 178 .press-this .inner-sidebar { 179 width: 200px; 180 } 181 182 .press-this .inner-sidebar .sleeve { 183 padding-top: 5px; 184 } 185 186 .press-this #submitdiv p { 187 margin: 0; 188 padding: 6px; 189 } 190 191 .press-this #submitdiv #publishing-actions { 192 border-bottom: 1px solid #dfdfdf; 193 } 194 195 .press-this #publish { 196 float: right; 197 } 198 199 .press-this #poststuff h2, 200 .press-this #poststuff h3 { 201 font-size: 14px; 202 line-height: 1; 203 } 204 205 .press-this #tagsdiv-post_tag h3, 206 .press-this #categorydiv h3 { 747 } 748 749 @media (max-width: 600px) { 750 .tagchecklist span { 751 margin-bottom: 15px; 752 font-size: 16px; 753 line-height: 1.3; 754 } 755 } 756 757 .tagchecklist .ntdelbutton { 758 margin: 1px 0 0 -17px; 207 759 cursor: pointer; 208 } 209 210 .press-this #submitdiv h3 { 211 cursor: default; 212 } 213 214 h3.tb { 215 font-weight: 600; 216 font-size: 12px; 217 margin-left: 5px; 218 } 219 220 .press-this .postbox, 221 .press-this .stuffbox { 222 margin-bottom: 10px; 223 min-width: 0; 224 } 225 226 .press-this #submitdiv:hover .handlediv { 227 background: none; 228 } 229 230 .tbtitle { 231 font-size: 1.7em; 232 outline: none; 233 padding: 3px 4px; 234 border: 1px solid #dfdfdf; 235 } 236 237 .press-this .actions { 238 float: right; 239 margin: -19px 0 0; 240 } 241 242 .press-this #extra-fields .actions { 243 margin: -32px -7px 0 0; 244 } 245 246 .press-this .actions li { 247 float: left; 248 list-style: none; 249 margin-right: 10px; 250 } 251 252 #extra-fields .button { 253 margin-right: 5px; 254 } 255 256 /* Photo Styles */ 257 #photo_saving { 258 margin: 0 8px 8px; 259 vertical-align: middle; 260 } 261 262 #img_container_container { 263 overflow: auto; 264 } 265 266 #extra-fields { 267 margin-top: 10px; 268 position: relative; 269 } 270 271 #extra-fields h2 { 272 margin: 12px; 273 } 274 275 #waiting { 276 margin-top: 10px; 277 overflow: hidden; 278 } 279 280 #waiting span { 281 float: right; 282 margin: 0 0 0 5px; 283 } 284 285 #waiting .spinner { 286 display: block; 287 } 288 289 #extra-fields .postbox { 290 margin-bottom: 5px; 291 } 292 293 #extra-fields .titlewrap { 294 padding: 0; 295 overflow: auto; 296 height: 120px; 297 } 298 299 #img_container a { 760 width: 20px; 761 height: 20px; 300 762 display: block; 301 763 float: left; 764 text-indent: 0; 302 765 overflow: hidden; 303 } 304 305 #img_container img, 306 #img_container a { 307 width: 68px; 308 height: 68px; 309 } 310 311 #img_container img { 766 position: absolute; 767 outline: 0; 768 } 769 770 .tagchecklist .ntdelbutton:before { 771 content: '\f153'; 772 display: block; 773 margin: 2px 0; 774 height: 20px; 775 width: 20px; 776 background: 0 0; 777 color: #9ea7af; 778 font: 400 16px/1 dashicons; 779 text-align: center; 780 speak: none; 781 -webkit-font-smoothing: antialiased; 782 } 783 784 .tagchecklist .ntdelbutton:focus:before { 785 color: #2ea2cc; 786 } 787 788 789 /* THE TAG CLOUD. */ 790 .tagsdiv + p { 791 margin: 0; 792 } 793 794 .tagcloud-link { 795 display: block; 796 padding: 0 16px; 797 text-decoration: none; 798 outline: 0; 799 } 800 801 .tagcloud-link:focus { 802 text-decoration: underline; 803 } 804 805 .popular-tags { 312 806 border: none; 313 background-color: #f4f4f4; 807 line-height: 2em; 808 padding: 8px 12px 12px; 809 text-align: justify; 810 } 811 812 .popular-tags a { 813 padding: 0 3px; 814 } 815 816 .the-tagcloud { 817 margin: 0; 818 padding: 16px; 819 } 820 821 .the-tagcloud a { 822 text-decoration: none; 823 outline: 0; 824 } 825 826 .the-tagcloud a:focus { 827 text-decoration: underline; 828 } 829 830 .tagcloud h3 { 831 margin: 2px 0 12px; 832 } 833 834 835 /** 836 * Categories 837 * 838 * Complete styles for post categories UI 839 */ 840 input[type="search"].categories-search, 841 .add-category-name { 842 display: block; 843 width: 100%; 844 padding: 0.85714em 1.07143em; 845 border: 0; 846 -webkit-border-radius: 0; 847 border-radius: 0; 848 border-bottom: 1px solid #e5e5e5; 849 font-size: 14px; 850 -webkit-appearance: none; 851 appearance: none; 852 } 853 854 @media (max-width: 600px) { 855 input[type="search"].categories-search, 856 .add-category-name { 857 /* Needs to be 16px to prevent zooming on iOS. Guh. */ 858 font-size: 16px; 859 } 860 } 861 862 .add-cat-toggle { 863 float: right; 864 margin-top: -33px; 865 } 866 867 .add-cat-toggle:focus { 868 text-decoration: none; 869 color: #2ea2cc; 870 } 871 872 .add-cat-toggle.is-toggled { 873 margin-top: -36px; 874 } 875 876 .add-cat-toggle.is-toggled .dashicons:before { 877 content: "\f179"; 878 } 879 880 .add-category { 881 position: relative; 882 border-bottom: 1px solid #e5e5e5; 883 } 884 885 .add-category.is-hidden { 886 display: none; 887 } 888 889 .add-category .add-cat-submit { 890 position: absolute; 891 top: 0; 892 right: 0; 893 border: 0; 894 -webkit-border-radius: 0; 895 border-radius: 0; 896 padding: 12px 16px; 897 background: #f7f7f7; 898 border-left: 1px solid #f1f1f1; 899 } 900 901 .add-category .add-cat-submit:hover, 902 .add-category .add-cat-submit:active, 903 .add-category .add-cat-submit:focus { 904 outline: 0; 905 background: #2991b7; 906 border-color: #20708e; 907 color: #fff; 908 } 909 910 /* Parent category select */ 911 .postform-wrapper { 912 padding: 12px; 913 } 914 915 .postform { 916 display: block; 917 margin: 0; 918 width: 100%; 919 height: 34px; 920 border: 0; 921 -webkit-border-radius: 0; 922 border-radius: 0; 923 border: 1px solid #e5e5e5; 924 background: #fff; 925 -webkit-background-size: 20px 20px; 926 background-size: 20px 20px; 927 overflow: hidden; 928 line-height: 21px; 929 text-overflow: ellipsis; 930 text-decoration: none; 931 vertical-align: top; 932 white-space: nowrap; 314 933 cursor: pointer; 315 } 316 317 #img_container a, 318 #img_container a:link, 319 #img_container a:visited { 320 border: 1px solid #ccc; 934 outline: 0; 935 } 936 937 .postform:focus { 938 border-color: #0074a2; 939 -webkit-box-shadow: 0 0 0 3px #2ea2cc; 940 box-shadow: 0 0 0 3px #2ea2cc; 941 outline: 0; 942 -moz-outline: none; 943 -moz-user-focus: ignore; 944 } 945 946 .postform::-ms-expand { 947 display: none; 948 } 949 950 .postform::-ms-value { 951 background: none; 952 color: #727272; 953 } 954 955 .postform:-moz-focusring { 956 color: transparent; 957 text-shadow: 0 0 0 #727272; 958 } 959 960 /* Category list */ 961 .categories-select { 962 margin: 0; 963 padding: 0; 964 list-style: none; 965 } 966 967 .categories-select ul { 968 margin: 0; 969 padding: 0; 970 list-style: none; 971 } 972 973 .categories-select input { 974 clear: none; 975 position: absolute; 976 top: 0; 977 left: 0; 321 978 display: block; 979 line-height: 0; 980 width: 100%; 981 height: 100%; 982 outline: 0; 983 padding: 0; 984 border: 0; 985 -webkit-border-radius: 0; 986 border-radius: 0; 987 text-align: center; 988 vertical-align: middle; 989 -webkit-appearance: none; 990 appearance: none; 991 cursor: pointer; 992 } 993 994 .categories-select input:checked { 995 -webkit-box-shadow: inset 6px 0 0 #2ea2cc; 996 box-shadow: inset 6px 0 0 #2ea2cc; 997 background: rgba(46, 162, 204, 0.1); 998 } 999 1000 .categories-select input:checked:after { 1001 display: inline-block; 1002 content: "\f147"; 1003 position: absolute; 1004 top: 13px; 1005 right: 0; 1006 width: 20px; 1007 height: 20px; 1008 margin-right: 10px; 1009 font-size: 20px; 1010 line-height: 1; 1011 font-family: dashicons; 1012 text-decoration: inherit; 1013 color: #222; 1014 font-weight: 400; 1015 font-style: normal; 1016 vertical-align: top; 1017 text-align: center; 1018 -webkit-transition: color .1s ease-in 0; 1019 transition: color .1s ease-in 0; 1020 -webkit-font-smoothing: antialiased; 1021 -moz-osx-font-smoothing: grayscale; 1022 } 1023 1024 .categories-select input:focus { 1025 -webkit-box-shadow: inset 6px 0 0 #2ea2cc; 1026 box-shadow: inset 6px 0 0 #2ea2cc; 1027 background: rgba(46, 162, 204, 0.05); 1028 } 1029 1030 .categories-select label { 322 1031 position: relative; 323 } 324 325 #img_container a:hover, 326 #img_container a:active { 327 border-color: #000; 328 z-index: 1000; 329 border-width: 1px; 330 } 331 332 /* Video */ 333 #embed-code { 1032 display: block; 1033 padding: 13px 16px 14px 16px; 1034 cursor: pointer; 1035 background: #fff; 1036 } 1037 1038 .categories-select ul label { 1039 padding-left: 24px; 1040 } 1041 1042 .categories-select ul ul label { 1043 padding-left: 32px; 1044 } 1045 1046 .categories-select ul ul ul label { 1047 padding-left: 40px; 1048 } 1049 1050 .categories-select ul ul ul ul label { 1051 padding-left: 48px; 1052 } 1053 1054 .categories-select ul ul ul ul ul label { 1055 padding-left: 56px; 1056 } 1057 1058 .categories-select ul ul ul ul ul ul label { 1059 padding-left: 64px; 1060 } 1061 1062 .categories-select .is-hidden { 1063 display: none; 1064 } 1065 1066 .categories-select .is-hidden.searched-parent { 1067 display: block; 1068 } 1069 1070 .lt-ie9 .categories-select input { 1071 top: 50%; 1072 right: 10px; 1073 left: auto; 1074 margin-top: -8px; 1075 width: 16px; 1076 height: 16px; 1077 } 1078 1079 /* TODO Reformats checkbox on Firefox until we remove checkbox in merge */ 1080 @-moz-document url-prefix() { 1081 .categories-select input { 1082 top: 50%; 1083 right: 10px; 1084 left: auto; 1085 margin-top: -8px; 1086 width: 16px; 1087 height: 16px; 1088 } 1089 } 1090 1091 /* Category search */ 1092 .categories-search-wrapper { 1093 position: relative; 1094 } 1095 1096 .categories-search-wrapper.is-hidden { 1097 display: none; 1098 } 1099 1100 .categories-search-wrapper label { 1101 position: absolute; 1102 top: 50%; 1103 right: 10px; 1104 margin-top: -10px; 1105 color: #9ea7af; 1106 } 1107 1108 1109 /** 1110 * Main 1111 */ 1112 html, 1113 body { 1114 overflow-x: hidden; 1115 } 1116 1117 @media (min-width: 901px) { 1118 html, 1119 body { 1120 height: 100%; 1121 } 1122 } 1123 1124 html { 1125 background: #fff; 1126 -webkit-box-shadow: -10px 0 0 rgba(0, 0, 0, 0.3); 1127 box-shadow: -10px 0 0 rgba(0, 0, 0, 0.3); 1128 } 1129 1130 @media (max-width: 900px) { 1131 body { 1132 font-size: 16px; 1133 } 1134 } 1135 1136 @media (max-width: 320px) { 1137 body { 1138 font-size: 14px; 1139 } 1140 } 1141 1142 .lt-ie9 { 1143 overflow: visible; 1144 } 1145 1146 .adminbar { 1147 position: relative; 334 1148 width: 100%; 335 height: 98px; 336 } 337 338 /* Categories */ 339 .press-this .categorydiv div.tabs-panel { 340 height: 100px; 341 } 342 343 /* Tags */ 344 .press-this .tagsdiv .newtag { 345 width: 120px; 346 } 347 348 .press-this #content { 349 margin: 5px 0; 350 padding: 0 5px; 351 border: 0 none; 352 height: 340px; 353 font-family: Consolas, Monaco, monospace; 1149 padding: 0 0.8em; 1150 min-height: 3.2em; 1151 background: #222; 1152 color: #fff; 1153 z-index: 9999; 1154 } 1155 1156 .adminbar:before, 1157 .adminbar:after { 1158 content: ""; 1159 display: table; 1160 } 1161 1162 .adminbar:after { 1163 clear: both; 1164 } 1165 1166 .adminbar .dashicons { 1167 color: #999; 1168 } 1169 1170 .adminbar button { 1171 position: absolute; 1172 top: 50%; 1173 right: 6px; 1174 margin-top: -13px; 1175 } 1176 1177 @media (max-width: 320px) { 1178 .adminbar { 1179 min-height: 45px; 1180 } 1181 } 1182 1183 .current-site { 1184 margin-top: 0.5625em; 1185 font-size: 16px; 1186 line-height: 44px; 1187 font-weight: 400; 1188 overflow: hidden; 1189 white-space: nowrap; 1190 text-overflow: ellipsis; 1191 } 1192 1193 @media (max-width: 600px) { 1194 .current-site { 1195 margin: 3px 0 0; 1196 } 1197 } 1198 1199 @media (max-width: 320px) { 1200 .current-site { 1201 margin: 0; 1202 font-size: 14px; 1203 } 1204 } 1205 1206 .current-site span:nth-child(2) { 1207 color: #ededed; 1208 } 1209 1210 @media (max-width: 320px) { 1211 .current-site span:nth-child(2) { 1212 font-weight: 600; 1213 } 1214 } 1215 1216 .current-site .dashicons-wordpress { 1217 position: relative; 1218 top: -1px; 1219 margin-right: 10px; 1220 vertical-align: middle; 1221 } 1222 1223 .options-open, 1224 .options-close { 1225 display: none; 1226 } 1227 1228 @media (max-width: 900px) { 1229 .options-open, 1230 .options-close { 1231 display: block; 1232 } 1233 } 1234 1235 .options-open.is-hidden, 1236 .options-close.is-hidden { 1237 display: none; 1238 } 1239 1240 .options-open:focus .dashicons { 1241 color: #fff; 1242 text-decoration: none; 1243 } 1244 1245 .options-open .dashicons { 1246 margin-top: 3px; 1247 } 1248 1249 .options-close { 1250 color: #2ea2cc; 1251 } 1252 1253 .alert { 1254 position: relative; 1255 margin: 0; 1256 padding: 16px 50px; 1257 border-bottom: 1px solid #e5e5e5; 1258 font-size: 14px; 1259 } 1260 1261 .alert:before { 1262 content: ''; 1263 position: absolute; 1264 top: 50%; 1265 left: 30px; 1266 width: 8px; 1267 height: 8px; 1268 margin-top: -4px; 1269 -webkit-border-radius: 50%; 1270 border-radius: 50%; 1271 background: #2ea2cc; 1272 } 1273 1274 @media (max-width: 600px) { 1275 .alert { 1276 padding: 16px 35px; 1277 } 1278 .alert:before { 1279 left: 15px; 1280 } 1281 } 1282 1283 .alert.is-hidden { 1284 display: none; 1285 } 1286 .alert.is-error:before { 1287 background: red; 1288 } 1289 1290 .scan { 1291 position: relative; 1292 border-bottom: 1px solid #e5e5e5; 1293 } 1294 1295 @media (max-width: 900px) { 1296 .scan form { 1297 -webkit-transition: opacity .3s ease-in-out; 1298 transition: opacity .3s ease-in-out; 1299 } 1300 .scan.is-hidden form { 1301 opacity: .2; 1302 pointer-events: none; 1303 } 1304 } 1305 1306 .scan-url { 1307 display: block; 1308 border: 0; 1309 padding: 0.85714em 1.07143em; 1310 font-size: 14px; 1311 width: 100%; 1312 } 1313 1314 @media (max-width: 600px) { 1315 .scan-url { 1316 font-size: 16px; 1317 } 1318 } 1319 1320 .scan-submit { 1321 position: absolute; 1322 top: 0; 1323 right: 0; 1324 bottom: 0; 1325 padding: 0.85714em 1.07143em; 1326 background: #f7f7f7; 1327 border-color: #dedede; 1328 border-bottom: 0; 1329 border-left: 1px solid #f1f1f1; 1330 -webkit-border-radius: 0; 1331 border-radius: 0; 1332 color: #555; 1333 font-size: 14px; 1334 line-height: 1.6; 1335 } 1336 1337 .scan-submit:hover, 1338 .scan-submit:focus { 1339 background: #2991b7; 1340 border-color: #20708e; 1341 color: #fff; 1342 outline: 0; 1343 } 1344 1345 .scan-submit:active { 1346 background: #2581a2; 1347 border-color: #20708e; 1348 color: #fff; 1349 } 1350 1351 .scan-submit:visited { 1352 color: #555; 1353 } 1354 1355 .wrapper { 1356 position: relative; 1357 margin-bottom: 60px; 1358 margin-right: 320px; 1359 } 1360 1361 .wrapper:before, 1362 .wrapper:after { 1363 content: ""; 1364 display: table; 1365 } 1366 1367 .wrapper:after { 1368 clear: both; 1369 } 1370 1371 @media (max-width: 900px) { 1372 .wrapper { 1373 margin: 0; 1374 width: 100%; 1375 } 1376 } 1377 1378 .editor-wrapper { 1379 overflow: auto; 1380 float: left; 1381 width: 100%; 1382 } 1383 1384 .editor-wrapper:before, 1385 .editor-wrapper:after { 1386 content: ""; 1387 display: table; 1388 } 1389 1390 .editor-wrapper:after { 1391 clear: both; 1392 } 1393 1394 .editor { 1395 padding: 0 1.5em 4.75em; 1396 max-width: 700px; 1397 margin: 0 auto; 1398 } 1399 1400 @media (min-width: 901px) { 1401 .editor { 1402 max-width: 760px; 1403 } 1404 } 1405 1406 @media (max-width: 320px) { 1407 .editor { 1408 padding: 0; 1409 } 1410 } 1411 1412 .post-title, 1413 .post-title-placeholder { 1414 margin: 0; 1415 padding: .83em 0; 1416 width: 100%; 1417 border-bottom: 1px solid #e5e5e5; 1418 font-size: 32px; 1419 line-height: 1.4; 1420 font-weight: 700; 1421 } 1422 1423 .post-title:active, 1424 .post-title:focus, 1425 .post-title-placeholder:active, 1426 .post-title-placeholder:focus { 1427 outline: 0; 1428 -webkit-box-shadow: inset 0px -3px 0 #2ea2cc; 1429 box-shadow: inset 0px -3px 0 #2ea2cc; 1430 border-color: #2ea2cc; 1431 } 1432 1433 @media (max-width: 900px) { 1434 .post-title, 1435 .post-title-placeholder { 1436 font-size: 24px; 1437 } 1438 } 1439 1440 @media (max-height: 400px) { 1441 .post-title, 1442 .post-title-placeholder { 1443 padding: 15px 0; 1444 font-size: 16px; 1445 } 1446 } 1447 1448 @media (max-width: 320px) { 1449 .post-title, 1450 .post-title-placeholder { 1451 font-size: 16px; 1452 font-weight: 600; 1453 padding: 1.14286em 1.42857em; 1454 } 1455 } 1456 1457 .post-title { 1458 /* IE8 fallback */ 1459 background: url(data:image/gif;base64,R0lGODlhAQABAJEAAAAAAP///////wAAACH5BAEHAAIALAAAAAABAAEAAAICVAEAOw==); 1460 background: none, none; 1461 } 1462 1463 .post-title:before { 1464 /* Keeps empty container from collapsing */ 1465 content: '\a0'; 1466 display: inline-block; 1467 width: 0; 1468 speak: none; 1469 } 1470 1471 .post-title-placeholder { 1472 position: absolute; 1473 border: 0; 1474 color: #9ea7af; 1475 z-index: -1; 1476 } 1477 1478 .post-title-placeholder.is-hidden { 1479 display: none; 1480 } 1481 1482 /* Suggested images */ 1483 .featured-container { 1484 position: relative; 1485 padding: 2px 0; 1486 border-bottom: 1px solid #e5e5e5; 1487 } 1488 1489 .all-media { 1490 display: none; 1491 overflow: auto; 1492 max-height: 150px; 1493 max-height: 40vw; 1494 } 1495 1496 .all-media:before, .all-media:after { 1497 content: ""; 1498 display: table; 1499 } 1500 1501 .all-media:after { 1502 clear: both; 1503 } 1504 1505 @media (min-width: 321px) { 1506 .all-media { 1507 max-height: 250px; 1508 max-height: 40vw; 1509 } 1510 } 1511 1512 @media (min-width: 601px) { 1513 .all-media { 1514 max-height: 200px; 1515 max-height: 18.75vw; 1516 } 1517 } 1518 1519 .wppt-all-media-list { 1520 list-style: none; 1521 margin: 0; 1522 padding: 0; 1523 } 1524 1525 .suggested-media-thumbnail:focus, 1526 .suggested-media-embed:focus { 1527 outline: 0; 1528 -webkit-box-shadow: inset 0 0 0 3px #2ea2cc; 1529 box-shadow: inset 0 0 0 3px #2ea2cc; 1530 } 1531 1532 .suggested-media-thumbnail { 1533 position: relative; 1534 display: block; 1535 float: left; 1536 width: 16.66%; 1537 padding: 16.66% 0 0 16.66%; 1538 background-position: center; 1539 background-repeat: no-repeat; 1540 -webkit-background-size: cover; 1541 background-size: cover; 1542 background-color: #d8d8d8; 1543 color: #fff; 1544 color: rgba(255, 255, 255, 0.6); 1545 cursor: pointer; 1546 } 1547 1548 .suggested-media-thumbnail:hover, 1549 .suggested-media-thumbnail:active, 1550 .suggested-media-thumbnail:focus { 1551 color: #fff; 1552 } 1553 1554 .suggested-media-thumbnail:before, 1555 .suggested-media-thumbnail:after { 1556 display: inline-block; 1557 position: absolute; 1558 font-size: 20px; 1559 line-height: 1; 1560 font-family: dashicons; 1561 text-decoration: inherit; 1562 font-weight: 400; 1563 font-style: normal; 1564 -webkit-transition: color .1s ease-in 0; 1565 transition: color .1s ease-in 0; 1566 -webkit-font-smoothing: antialiased; 1567 -moz-osx-font-smoothing: grayscale; 1568 } 1569 1570 .suggested-media-thumbnail:before { 1571 left: 50%; 1572 top: 50%; 1573 margin: -20px 0 0 -20px; 1574 font-size: 40px; 1575 } 1576 1577 .suggested-media-thumbnail:after { 1578 content: "\f132"; 1579 right: 3%; 1580 bottom: 2%; 1581 } 1582 1583 @media (min-width: 601px) { 1584 .suggested-media-thumbnail { 1585 width: 12.5%; 1586 padding: 12.5% 0 0 12.5%; 1587 } 1588 } 1589 1590 .suggested-media-embed:before { 1591 content: "\f104"; 1592 color: #fff; 1593 color: rgba(255, 255, 255, 0.9); 1594 } 1595 1596 .suggested-media-embed.is-audio:hover:before, 1597 .suggested-media-embed.is-audio:active:before, 1598 .suggested-media-embed.is-audio:focus:before, 1599 .suggested-media-embed.is-tweet:hover:before, 1600 .suggested-media-embed.is-tweet:active:before, 1601 .suggested-media-embed.is-tweet:focus:before { 1602 color: #fff; 1603 } 1604 1605 .suggested-media-embed.is-video { 1606 background-color: #222; 1607 } 1608 1609 .suggested-media-embed.is-video:hover:before, 1610 .suggested-media-embed.is-video:active:before, 1611 .suggested-media-embed.is-video:focus:before { 1612 color: rgba(255, 255, 255, 0.2); 1613 } 1614 1615 .suggested-media-embed.is-video:before { 1616 content: "\f236"; 1617 } 1618 1619 .suggested-media-embed.is-audio { 1620 background-color: #ff7d44; 1621 } 1622 1623 .suggested-media-embed.is-audio:before { 1624 content: "\f127"; 1625 } 1626 1627 .suggested-media-embed.is-tweet { 1628 background-color: #55acee; 1629 } 1630 1631 .suggested-media-embed.is-tweet:before { 1632 content: "\f301"; 1633 } 1634 1635 .all-media-visible .all-media { 1636 display: block; 1637 } 1638 1639 .no-media { 1640 margin: 0; 1641 padding: 0; 1642 border: 0; 1643 } 1644 1645 /* Actions bar */ 1646 .press-this-actions { 1647 position: fixed; 1648 bottom: 0; 1649 left: 0; 1650 width: 100%; 1651 background: #f1f1f1; 1652 background: rgba(241, 241, 241, 0.9); 1653 border-top: 1px solid #e5e5e5; 1654 } 1655 1656 @media (max-width: 900px) { 1657 .press-this-actions { 1658 -webkit-transform: translateY(0); 1659 -ms-transform: translateY(0); 1660 transform: translateY(0); 1661 -webkit-transition: -webkit-transform .3s ease-in-out; 1662 transition: transform .3s ease-in-out; 1663 } 1664 .press-this-actions.is-hidden { 1665 -webkit-transform: translateY(100%); 1666 -ms-transform: translateY(100%); 1667 transform: translateY(100%); 1668 } 1669 } 1670 1671 .add-media { 1672 float: left; 1673 margin: 14px 0 14px 30px; 1674 font-size: 0; 1675 } 1676 1677 @media (max-width: 320px) { 1678 .add-media { 1679 margin: 10px 0 10px 10px; 1680 } 1681 } 1682 1683 .insert-media { 1684 color: #9ea7af; 1685 float: left; 1686 margin: 0; 1687 padding: 0; 1688 border: 0; 1689 border-right: 1px solid #e5e5e5; 1690 -webkit-border-radius: 0; 1691 border-radius: 0; 1692 background: none; 1693 -webkit-box-shadow: none; 1694 box-shadow: none; 1695 overflow: hidden; 1696 } 1697 1698 .insert-media:hover, 1699 .insert-media:focus, 1700 .insert-media:active { 1701 margin: 0; 1702 background: none; 1703 border-color: #e5e5e5; 1704 color: #222; 1705 } 1706 1707 .insert-media:focus, 1708 .insert-media:active { 1709 outline: 0; 1710 color: #2ea2cc; 1711 text-decoration: none; 1712 } 1713 1714 .insert-media .dashicons { 1715 padding: 11px; 1716 width: 63px; 1717 height: 58px; 1718 font-size: 40px; 1719 } 1720 1721 @media (max-width: 320px) { 1722 .insert-media .dashicons { 1723 width: 55px; 1724 height: 49px; 1725 padding: 14px; 1726 font-size: 20px; 1727 } 1728 } 1729 1730 .post-actions { 1731 float: right; 1732 margin: 14px 30px 14px 0; 1733 font-size: 0; 1734 } 1735 1736 @media (max-width: 320px) { 1737 .post-actions { 1738 margin: 10px 10px 10px 0; 1739 } 1740 } 1741 1742 /* TinyMCE styles */ 1743 .editor .wp-media-buttons { 1744 float: none; 1745 } 1746 1747 .editor div.mce-toolbar-grp { 1748 padding: 0.71429em 0; 1749 background: none; 1750 border: 0; 1751 } 1752 1753 @media (max-height: 400px), (max-width: 320px) { 1754 .editor div.mce-toolbar-grp { 1755 padding: 0; 1756 } 1757 } 1758 1759 .mce-stack-layout:before, 1760 .mce-stack-layout:after { 1761 content: ""; 1762 display: table; 1763 } 1764 1765 .mce-stack-layout:after { 1766 clear: both; 1767 } 1768 1769 .mce-container.mce-toolbar { 1770 float: left; 1771 } 1772 1773 .mce-container.mce-toolbar:nth-child(2) { 1774 float: right; 1775 } 1776 1777 @media (max-width: 600px) { 1778 #mceu_11, 1779 #mceu_12 { 1780 position: absolute; 1781 margin: -1px; 1782 padding: 0; 1783 height: 1px; 1784 width: 1px; 1785 overflow: hidden; 1786 clip: rect(0 0 0 0); 1787 border: 0; 1788 } 1789 1790 #mceu_11:focus, 1791 #mceu_12:focus { 1792 position: static; 1793 margin: 1px; 1794 padding: inherit; 1795 height: auto; 1796 width: auto; 1797 overflow: visible; 1798 clip: auto; 1799 border: 1px solid #999; 1800 } 1801 } 1802 1803 #wp-link-wrap.search-panel-visible { 354 1804 font-size: 13px; 355 line-height: 19px; 356 background: transparent; 357 } 358 359 /* Submit */ 360 .press-this #publishing-actions .spinner { 361 display: inline; 362 vertical-align: middle; 363 } 364 365 /* =Media Queries 366 -------------------------------------------------------------- */ 367 368 /* Reset responsive styles in Press This */ 369 @media screen and ( max-width: 782px ) { 370 .press-this ul.category-tabs li.tabs { 371 padding: 3px 5px 5px; /* Reset tabs in Press This to standard size */ 372 } 373 374 .press-this a.wp-switch-editor { 375 font: 13px/19px "Open Sans", sans-serif; 376 margin: 5px 0 0 5px; 377 padding: 3px 8px 4px; 378 } 379 380 .press-this #wp-content-media-buttons a { 381 padding: 0; 382 line-height: normal; 383 height: auto; 384 } 385 386 .press-this #wp-content-editor-tools { 387 padding: 0; 388 top: 3px; 389 } 390 391 .press-this .category-tabs { 392 margin-top: 0; 393 } 394 395 .press-this .tagsdiv .newtag { 396 width: 120px; 397 padding: 3px 5px; 398 margin-bottom: 0; 399 } 400 401 .press-this .tagchecklist { 402 padding: 0; 403 margin-bottom: 0; 404 } 405 406 .press-this .wp_themeSkin a.mceButton { 407 width: 20px; 408 height: 20px; 409 } 410 411 .press-this .wp_themeSkin .mceButton .mceIcon { 412 margin: 0; 413 } 414 415 .press-this #poststuff h3, 416 .press-this .metabox-holder h3 { 417 padding: 7px 12px; 418 } 419 420 .press-this input[type=checkbox], 421 .press-this input[type=radio] { 422 height: 16px; 423 width: 16px; 424 } 425 426 .press-this input[type=checkbox]:checked:before { 427 width: 16px; 428 font: normal 21px/1 'dashicons'; 429 margin: -3px 0 0 -4px; 430 } 431 432 .press-this input[type=radio]:checked:before { 433 font: normal 21px/1 'dashicons'; 434 width: 6px; 435 height: 6px; 436 margin: 4px; 437 } 438 439 .press-this ul.categorychecklist ul, 440 .press-this ul.categorychecklist li { 441 margin-top: 0; 442 margin-bottom: 0; 443 } 444 445 .press-this div.quicktags-toolbar input { 446 padding: 2px 4px; 447 } 448 449 .press-this textarea, 450 .press-this input { 451 font-size: 14px; 452 } 453 454 .press-this .tagchecklist span { 455 font-size: 13px; 456 line-height: 1.8em; 457 } 458 } 1805 } 1806 1807 /* Options panel (sidebar) */ 1808 .options-panel { 1809 position: relative; 1810 float: right; 1811 margin-right: -320px; 1812 width: 320px; 1813 border-left: 1px solid #e5e5e5; 1814 font-size: 14px; 1815 /* Keeps background the full height of the screen */ 1816 -webkit-box-shadow: 5001px 5000px 0 5000px #fff, 5000px 5000px 0 5000px #e5e5e5; 1817 box-shadow: 5001px 5000px 0 5000px #fff, 5000px 5000px 0 5000px #e5e5e5; 1818 } 1819 1820 @media (max-width: 900px) { 1821 .options-panel { 1822 background: #fff; 1823 -webkit-transform: translateX(-100%); 1824 -ms-transform: translateX(-100%); 1825 transform: translateX(-100%); 1826 -webkit-transition: -webkit-transform .3s ease-in-out; 1827 transition: transform .3s ease-in-out; 1828 } 1829 1830 .options-panel.is-hidden { 1831 visibility: hidden; 1832 } 1833 1834 .options-panel.is-off-screen { 1835 -webkit-transform: translateX(0); 1836 -ms-transform: translateX(0); 1837 transform: translateX(0); 1838 } 1839 } 1840 1841 @media (max-width: 320px) { 1842 .options-panel { 1843 margin-right: -100%; 1844 width: 100%; 1845 border: 0; 1846 -webkit-box-shadow: 5001px 5000px 0 5000px #fff; 1847 box-shadow: 5001px 5000px 0 5000px #fff; 1848 } 1849 } 1850 1851 .post-options { 1852 background: #fff; 1853 position: absolute; 1854 right: 0; 1855 width: 100%; 1856 overflow-x: hidden; 1857 } 1858 1859 .post-options .post-option-contents { 1860 margin-left: 3px; 1861 color: #333; 1862 } 1863 1864 .post-options .dashicons-arrow-right-alt2 { 1865 position: absolute; 1866 top: 50%; 1867 right: 8px; 1868 margin-top: -10px; 1869 } 1870 1871 .lt-ie9 .options-panel, 1872 .lt-ie9 .post-options { 1873 border-left: 1px solid #e5e5e5; 1874 } 1875 1876 .lt-ie9 .post-options.is-off-screen { 1877 border: 0; 1878 } 1879 1880 .post-option { 1881 position: relative; 1882 } 1883 1884 .post-options .post-option { 1885 display: block; 1886 width: 100%; 1887 padding: 13px 37px 13px 14px; 1888 border-bottom: 1px solid #e5e5e5; 1889 text-decoration: none; 1890 text-align: left; 1891 color: #9ea7af; 1892 text-overflow: ellipsis; 1893 white-space: nowrap; 1894 overflow: hidden; 1895 -webkit-transition: -webkit-transform .3s ease-in-out; 1896 transition: transform .3s ease-in-out; 1897 } 1898 1899 .post-options .post-option:focus { 1900 outline: 0; 1901 -webkit-box-shadow: inset 5px 0 0 #2ea2cc; 1902 box-shadow: inset 5px 0 0 #2ea2cc; 1903 } 1904 1905 .is-off-screen > .post-option { 1906 right: 100%; 1907 } 1908 1909 .is-hidden > .post-option { 1910 visibility: hidden; 1911 } 1912 1913 @media (min-width: 1px) { 1914 .is-off-screen > .post-option { 1915 right: auto; 1916 -webkit-transform: translateX(-100%); 1917 -ms-transform: translateX(-100%); 1918 transform: translateX(-100%); 1919 } 1920 } 1921 1922 .post-option-title { 1923 display: inline-block; 1924 margin: 0 0 0 8px; 1925 font-size: 14px; 1926 font-weight: normal; 1927 } 1928 1929 .setting-modal { 1930 position: relative; 1931 top: 0; 1932 left: 0; 1933 width: 100%; 1934 overflow: hidden; 1935 -webkit-transition: -webkit-transform .3s ease-in-out; 1936 transition: transform .3s ease-in-out; 1937 } 1938 1939 .setting-modal.is-hidden { 1940 visibility: hidden; 1941 height: 0; 1942 } 1943 1944 .setting-modal.is-off-screen { 1945 left: 100%; 1946 } 1947 1948 @media (min-width: 1px) { 1949 .setting-modal.is-off-screen { 1950 left: 0; 1951 -webkit-transform: translateX(100%); 1952 -ms-transform: translateX(100%); 1953 transform: translateX(100%); 1954 } 1955 } 1956 1957 .modal-close { 1958 display: block; 1959 width: 100%; 1960 padding: 13px 14px; 1961 border-bottom: 1px solid #e5e5e5; 1962 color: #2ea2cc; 1963 text-decoration: none; 1964 text-align: left; 1965 } 1966 1967 .modal-close:focus { 1968 outline: 0; 1969 -webkit-box-shadow: inset 5px 0 0 #2ea2cc; 1970 box-shadow: inset 5px 0 0 #2ea2cc; 1971 } 1972 1973 .setting-title { 1974 position: relative; 1975 top: -1px; 1976 margin-left: 11px; 1977 } -
trunk/src/wp-admin/css/wp-admin.css
r27199 r31534 8 8 @import url(media.css); 9 9 @import url(themes.css); 10 @import url(press-this.css);11 10 @import url(about.css); 12 11 @import url(nav-menus.css); -
trunk/src/wp-admin/includes/ajax-actions.php
r31511 r31534 2955 2955 wp_send_json_success( $status ); 2956 2956 } 2957 2958 /** 2959 * AJAX handler for saving a post from Ptrss This. 2960 * 2961 * @since 4.2.0 2962 */ 2963 function wp_ajax_press_this_save_post() { 2964 if ( empty( $GLOBALS['wp_press_this'] ) ) { 2965 include( ABSPATH . 'wp-admin/includes/class-wp-press-this.php' ); 2966 } 2967 2968 $GLOBALS['wp_press_this']->save_post(); 2969 } 2970 2971 /** 2972 * AJAX handler for creating new category from Ptrss This. 2973 * 2974 * @since 4.2.0 2975 */ 2976 function wp_ajax_press_this_add_category() { 2977 if ( empty( $GLOBALS['wp_press_this'] ) ) { 2978 include( ABSPATH . 'wp-admin/includes/class-wp-press-this.php' ); 2979 } 2980 2981 $GLOBALS['wp_press_this']->add_category(); 2982 } -
trunk/src/wp-admin/js/post.js
r30698 r31534 8 8 window.wp = window.wp || {}; 9 9 10 // return an array with any duplicate, whitespace or values removed 11 function array_unique_noempty(a) { 12 var out = []; 13 jQuery.each( a, function(key, val) { 14 val = jQuery.trim(val); 15 if ( val && jQuery.inArray(val, out) == -1 ) 16 out.push(val); 17 } ); 18 return out; 19 } 20 21 ( function($) { 10 ( function( $ ) { 22 11 var titleHasFocus = false; 23 24 tagBox = {25 clean : function(tags) {26 var comma = postL10n.comma;27 if ( ',' !== comma )28 tags = tags.replace(new RegExp(comma, 'g'), ',');29 tags = tags.replace(/\s*,\s*/g, ',').replace(/,+/g, ',').replace(/[,\s]+$/, '').replace(/^[,\s]+/, '');30 if ( ',' !== comma )31 tags = tags.replace(/,/g, comma);32 return tags;33 },34 35 parseTags : function(el) {36 var id = el.id, num = id.split('-check-num-')[1], taxbox = $(el).closest('.tagsdiv'),37 thetags = taxbox.find('.the-tags'), comma = postL10n.comma,38 current_tags = thetags.val().split(comma), new_tags = [];39 delete current_tags[num];40 41 $.each( current_tags, function(key, val) {42 val = $.trim(val);43 if ( val ) {44 new_tags.push(val);45 }46 });47 48 thetags.val( this.clean( new_tags.join(comma) ) );49 50 this.quickClicks(taxbox);51 return false;52 },53 54 quickClicks : function(el) {55 var thetags = $('.the-tags', el),56 tagchecklist = $('.tagchecklist', el),57 id = $(el).attr('id'),58 current_tags, disabled;59 60 if ( !thetags.length )61 return;62 63 disabled = thetags.prop('disabled');64 65 current_tags = thetags.val().split(postL10n.comma);66 tagchecklist.empty();67 68 $.each( current_tags, function( key, val ) {69 var span, xbutton;70 71 val = $.trim( val );72 73 if ( ! val )74 return;75 76 // Create a new span, and ensure the text is properly escaped.77 span = $('<span />').text( val );78 79 // If tags editing isn't disabled, create the X button.80 if ( ! disabled ) {81 xbutton = $( '<a id="' + id + '-check-num-' + key + '" class="ntdelbutton">X</a>' );82 xbutton.click( function(){ tagBox.parseTags(this); });83 span.prepend(' ').prepend( xbutton );84 }85 86 // Append the span to the tag list.87 tagchecklist.append( span );88 });89 },90 91 flushTags : function(el, a, f) {92 var tagsval, newtags, text,93 tags = $('.the-tags', el),94 newtag = $('input.newtag', el),95 comma = postL10n.comma;96 a = a || false;97 98 text = a ? $(a).text() : newtag.val();99 tagsval = tags.val();100 newtags = tagsval ? tagsval + comma + text : text;101 102 newtags = this.clean( newtags );103 newtags = array_unique_noempty( newtags.split(comma) ).join(comma);104 tags.val(newtags);105 this.quickClicks(el);106 107 if ( !a )108 newtag.val('');109 if ( 'undefined' == typeof(f) )110 newtag.focus();111 112 return false;113 },114 115 get : function(id) {116 var tax = id.substr(id.indexOf('-')+1);117 118 $.post(ajaxurl, {'action':'get-tagcloud', 'tax':tax}, function(r, stat) {119 if ( 0 === r || 'success' != stat )120 r = wpAjax.broken;121 122 r = $('<p id="tagcloud-'+tax+'" class="the-tagcloud">'+r+'</p>');123 $('a', r).click(function(){124 tagBox.flushTags( $(this).closest('.inside').children('.tagsdiv'), this);125 return false;126 });127 128 $('#'+id).after(r);129 });130 },131 132 init : function() {133 var t = this, ajaxtag = $('div.ajaxtag');134 135 $('.tagsdiv').each( function() {136 tagBox.quickClicks(this);137 });138 139 $('input.tagadd', ajaxtag).click(function(){140 t.flushTags( $(this).closest('.tagsdiv') );141 });142 143 $('div.taghint', ajaxtag).click(function(){144 $(this).css('visibility', 'hidden').parent().siblings('.newtag').focus();145 });146 147 $('input.newtag', ajaxtag).blur(function() {148 if ( '' === this.value )149 $(this).parent().siblings('.taghint').css('visibility', '');150 }).focus(function(){151 $(this).parent().siblings('.taghint').css('visibility', 'hidden');152 }).keyup(function(e){153 if ( 13 == e.which ) {154 tagBox.flushTags( $(this).closest('.tagsdiv') );155 return false;156 }157 }).keypress(function(e){158 if ( 13 == e.which ) {159 e.preventDefault();160 return false;161 }162 }).each(function(){163 var tax = $(this).closest('div.tagsdiv').attr('id');164 $(this).suggest( ajaxurl + '?action=ajax-tag-search&tax=' + tax, { delay: 500, minchars: 2, multiple: true, multipleSep: postL10n.comma + ' ' } );165 });166 167 // save tags on post save/publish168 $('#post').submit(function(){169 $('div.tagsdiv').each( function() {170 tagBox.flushTags(this, false, 1);171 });172 });173 174 // tag cloud175 $('a.tagcloud-link').click(function(){176 tagBox.get( $(this).attr('id') );177 $(this).unbind().click(function(){178 $(this).siblings('.the-tagcloud').toggle();179 return false;180 });181 return false;182 });183 }184 };185 12 186 13 commentsBox = { … … 573 400 // multi-taxonomies 574 401 if ( $('#tagsdiv-post_tag').length ) { 575 tagBox.init();402 window.tagBox && window.tagBox.init(); 576 403 } else { 577 404 $('#side-sortables, #normal-sortables, #advanced-sortables').children('div.postbox').each(function(){ 578 405 if ( this.id.indexOf('tagsdiv-') === 0 ) { 579 tagBox.init();406 window.tagBox && window.tagBox.init(); 580 407 return false; 581 408 } -
trunk/src/wp-admin/options-writing.php
r28083 r31534 114 114 </table> 115 115 116 <h3 class="title"><?php _e('Press This') ?></h3>117 <p><?php _e('Press This is a bookmarklet: a little app that runs in your browser and lets you grab bits of the web.');?></p>118 <p><?php _e('Use Press This to clip text, images and videos from any web page. Then edit and add more straight from Press This before you save or publish it in a post on your site.'); ?></p>119 <p><?php _e('Drag-and-drop the following link to your bookmarks bar or right click it and add it to your favorites for a posting shortcut.') ?></p>120 <p class="pressthis"><a onclick="return false;" oncontextmenu="if(window.navigator.userAgent.indexOf('WebKit')!=-1||window.navigator.userAgent.indexOf('MSIE')!=-1){jQuery('.pressthis-code').show().find('textarea').focus().select();return false;}" href="<?php echo htmlspecialchars( get_shortcut_link() ); ?>"><span><?php _e('Press This') ?></span></a></p>121 <div class="pressthis-code" style="display:none;">122 <p class="description"><?php _e('If your bookmarks toolbar is hidden: copy the code below, open your Bookmarks manager, create new bookmark, type Press This into the name field and paste the code into the URL field.') ?></p>123 <p><textarea rows="5" cols="120" readonly="readonly"><?php echo htmlspecialchars( get_shortcut_link() ); ?></textarea></p>124 </div>125 126 116 <?php 127 117 /** This filter is documented in wp-admin/options.php */ -
trunk/src/wp-admin/press-this.php
r31034 r31534 12 12 require_once( dirname( __FILE__ ) . '/admin.php' ); 13 13 14 header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));15 16 14 if ( ! current_user_can( 'edit_posts' ) || ! current_user_can( get_post_type_object( 'post' )->cap->create_posts ) ) 17 15 wp_die( __( 'Cheatin’ uh?' ), 403 ); 18 16 19 /** 20 * Press It form handler. 21 * 22 * @since 2.6.0 23 * 24 * @return int Post ID 25 */ 26 function press_it() { 27 28 $post = get_default_post_to_edit(); 29 $post = get_object_vars($post); 30 $post_ID = $post['ID'] = (int) $_POST['post_id']; 31 32 if ( !current_user_can('edit_post', $post_ID) ) 33 wp_die(__('You are not allowed to edit this post.')); 34 35 $post['post_category'] = isset($_POST['post_category']) ? $_POST['post_category'] : ''; 36 $post['tax_input'] = isset($_POST['tax_input']) ? $_POST['tax_input'] : ''; 37 $post['post_title'] = isset($_POST['title']) ? $_POST['title'] : ''; 38 $content = isset($_POST['content']) ? $_POST['content'] : ''; 39 40 $upload = false; 41 if ( !empty($_POST['photo_src']) && current_user_can('upload_files') ) { 42 foreach( (array) $_POST['photo_src'] as $key => $image) { 43 // See if files exist in content - we don't want to upload non-used selected files. 44 if ( strpos($_POST['content'], htmlspecialchars($image)) !== false ) { 45 $desc = isset($_POST['photo_description'][$key]) ? $_POST['photo_description'][$key] : ''; 46 $upload = media_sideload_image($image, $post_ID, $desc); 47 48 // Replace the POSTED content <img> with correct uploaded ones. Regex contains fix for Magic Quotes 49 if ( !is_wp_error($upload) ) 50 $content = preg_replace('/<img ([^>]*)src=\\\?(\"|\')'.preg_quote(htmlspecialchars($image), '/').'\\\?(\2)([^>\/]*)\/*>/is', $upload, $content); 51 } 52 } 53 } 54 // Set the post_content and status. 55 $post['post_content'] = $content; 56 if ( isset( $_POST['publish'] ) && current_user_can( 'publish_posts' ) ) 57 $post['post_status'] = 'publish'; 58 elseif ( isset( $_POST['review'] ) ) 59 $post['post_status'] = 'pending'; 60 else 61 $post['post_status'] = 'draft'; 62 63 // Error handling for media_sideload. 64 if ( is_wp_error($upload) ) { 65 wp_delete_post($post_ID); 66 wp_die( esc_html( $upload->get_error_message() ) ); 67 } else { 68 // Post formats. 69 if ( isset( $_POST['post_format'] ) ) { 70 if ( current_theme_supports( 'post-formats', $_POST['post_format'] ) ) 71 set_post_format( $post_ID, $_POST['post_format'] ); 72 elseif ( '0' == $_POST['post_format'] ) 73 set_post_format( $post_ID, false ); 74 } 75 76 $post_ID = wp_update_post($post); 77 } 78 79 return $post_ID; 17 if ( empty( $GLOBALS['wp_press_this'] ) ) { 18 include( ABSPATH . 'wp-admin/includes/class-wp-press-this.php' ); 80 19 } 81 20 82 // For submitted posts. 83 if ( isset($_REQUEST['action']) && 'post' == $_REQUEST['action'] ) { 84 check_admin_referer('press-this'); 85 $posted = $post_ID = press_it(); 86 } else { 87 $post = get_default_post_to_edit('post', true); 88 $post_ID = $post->ID; 89 } 90 91 // Set Variables 92 $title = isset( $_GET['t'] ) ? trim( strip_tags( html_entity_decode( wp_unslash( $_GET['t'] ) , ENT_QUOTES) ) ) : ''; 93 94 $selection = ''; 95 if ( !empty($_GET['s']) ) { 96 $selection = str_replace(''', "'", wp_unslash($_GET['s'])); 97 $selection = trim( htmlspecialchars( html_entity_decode($selection, ENT_QUOTES) ) ); 98 } 99 100 if ( ! empty($selection) ) { 101 $selection = preg_replace('/(\r?\n|\r)/', '</p><p>', $selection); 102 $selection = '<p>' . str_replace('<p></p>', '', $selection) . '</p>'; 103 } 104 105 $url = isset($_GET['u']) ? esc_url($_GET['u']) : ''; 106 $image = isset($_GET['i']) ? $_GET['i'] : ''; 107 108 if ( !empty($_REQUEST['ajax']) ) { 109 switch ($_REQUEST['ajax']) { 110 case 'video': ?> 111 <script type="text/javascript"> 112 jQuery('.select').click(function() { 113 append_editor(jQuery('#embed-code').val()); 114 jQuery('#extra-fields').hide(); 115 jQuery('#extra-fields').html(''); 116 }); 117 jQuery('.close').click(function() { 118 jQuery('#extra-fields').hide(); 119 jQuery('#extra-fields').html(''); 120 }); 121 </script> 122 <div class="postbox"> 123 <h2><label for="embed-code"><?php _e('Embed Code') ?></label></h2> 124 <div class="inside"> 125 <textarea name="embed-code" id="embed-code" rows="8" cols="40"><?php echo esc_textarea( $selection ); ?></textarea> 126 <p id="options"><a href="#" class="select button"><?php _e('Insert Video'); ?></a> <a href="#" class="close button"><?php _e('Cancel'); ?></a></p> 127 </div> 128 </div> 129 <?php break; 130 131 case 'photo_thickbox': ?> 132 <script type="text/javascript"> 133 jQuery('.cancel').click(function() { 134 tb_remove(); 135 }); 136 jQuery('.select').click(function() { 137 image_selector(this); 138 }); 139 </script> 140 <h3 class="tb"><label for="tb_this_photo_description"><?php _e('Description') ?></label></h3> 141 <div class="titlediv"> 142 <div class="titlewrap"> 143 <input id="tb_this_photo_description" name="photo_description" class="tb_this_photo_description tbtitle text" type="text" onkeypress="if(event.keyCode==13) image_selector(this);" value="<?php echo esc_attr($title);?>"/> 144 </div> 145 </div> 146 147 <p class="centered"> 148 <input type="hidden" name="this_photo" value="<?php echo esc_attr( $image ); ?>" id="tb_this_photo" class="tb_this_photo" /> 149 <a href="#" class="select"> 150 <img src="<?php echo esc_url( $image ); ?>" alt="<?php esc_attr_e( 'Click to insert.' ); ?>" title="<?php esc_attr_e( 'Click to insert.' ); ?>" /> 151 </a> 152 </p> 153 154 <p id="options"><a href="#" class="select button"><?php _e('Insert Image'); ?></a> <a href="#" class="cancel button"><?php _e('Cancel'); ?></a></p> 155 <?php break; 156 case 'photo_images': 157 /** 158 * Retrieve all image URLs from given URI. 159 * 160 * @since 2.6.0 161 * 162 * @param string $uri 163 * @return string 164 */ 165 function get_images_from_uri($uri) { 166 $uri = preg_replace('/\/#.+?$/','', $uri); 167 if ( preg_match( '/\.(jpe?g|jpe|gif|png)\b/i', $uri ) && !strpos( $uri, 'blogger.com' ) ) 168 return "'" . esc_attr( html_entity_decode($uri) ) . "'"; 169 $content = wp_remote_fopen($uri); 170 if ( false === $content ) 171 return ''; 172 $host = parse_url($uri); 173 $pattern = '/<img ([^>]*)src=(\"|\')([^<>\'\"]+)(\2)([^>]*)\/*>/i'; 174 $content = str_replace(array("\n","\t","\r"), '', $content); 175 preg_match_all($pattern, $content, $matches); 176 if ( empty($matches[0]) ) 177 return ''; 178 $sources = array(); 179 foreach ($matches[3] as $src) { 180 181 // If no http in URL. 182 if (strpos($src, 'http') === false) 183 // If it doesn't have a relative URI. 184 if ( strpos($src, '../') === false && strpos($src, './') === false && strpos($src, '/') === 0) 185 $src = 'http://'.str_replace('//','/', $host['host'].'/'.$src); 186 else 187 $src = 'http://'.str_replace('//','/', $host['host'].'/'.dirname($host['path']).'/'.$src); 188 $sources[] = esc_url($src); 189 } 190 return "'" . implode("','", $sources) . "'"; 191 } 192 $url = wp_kses(urldecode($url), null); 193 echo 'new Array('.get_images_from_uri($url).')'; 194 break; 195 196 case 'photo_js': ?> 197 // Gather images and load some default JS. 198 var last = null 199 var img, img_tag, aspect, w, h, skip, i, strtoappend = ""; 200 if(photostorage == false) { 201 var my_src = eval( 202 jQuery.ajax({ 203 type: "GET", 204 url: "<?php echo esc_url($_SERVER['PHP_SELF']); ?>", 205 cache : false, 206 async : false, 207 data: "ajax=photo_images&u=<?php echo urlencode($url); ?>", 208 dataType : "script" 209 }).responseText 210 ); 211 if(my_src.length == 0) { 212 var my_src = eval( 213 jQuery.ajax({ 214 type: "GET", 215 url: "<?php echo esc_url($_SERVER['PHP_SELF']); ?>", 216 cache : false, 217 async : false, 218 data: "ajax=photo_images&u=<?php echo urlencode($url); ?>", 219 dataType : "script" 220 }).responseText 221 ); 222 if(my_src.length == 0) { 223 strtoappend = '<?php _e('Unable to retrieve images or no images on page.'); ?>'; 224 } 225 } 226 } 227 for (i = 0; i < my_src.length; i++) { 228 img = new Image(); 229 img.src = my_src[i]; 230 img_attr = 'id="img' + i + '"'; 231 skip = false; 232 233 maybeappend = '<a href="?ajax=photo_thickbox&i=' + encodeURIComponent(img.src) + '&u=<?php echo urlencode($url); ?>&height=400&width=500" title="" class="thickbox"><img src="' + img.src + '" ' + img_attr + '/></a>'; 234 235 if (img.width && img.height) { 236 if (img.width >= 30 && img.height >= 30) { 237 aspect = img.width / img.height; 238 scale = (aspect > 1) ? (71 / img.width) : (71 / img.height); 239 240 w = img.width; 241 h = img.height; 242 243 if (scale < 1) { 244 w = parseInt(img.width * scale); 245 h = parseInt(img.height * scale); 246 } 247 img_attr += ' style="width: ' + w + 'px; height: ' + h + 'px;"'; 248 strtoappend += maybeappend; 249 } 250 } else { 251 strtoappend += maybeappend; 252 } 253 } 254 255 function pick(img, desc) { 256 if (img) { 257 if('object' == typeof jQuery('.photolist input') && jQuery('.photolist input').length != 0) length = jQuery('.photolist input').length; 258 if(length == 0) length = 1; 259 jQuery('.photolist').append('<input name="photo_src[' + length + ']" value="' + img +'" type="hidden"/>'); 260 jQuery('.photolist').append('<input name="photo_description[' + length + ']" value="' + desc +'" type="hidden"/>'); 261 insert_editor( "\n\n" + encodeURI('<p style="text-align: center;"><a href="<?php echo $url; ?>"><img src="' + img +'" alt="' + desc + '" /></a></p>')); 262 } 263 return false; 264 } 265 266 function image_selector(el) { 267 var desc, src, parent = jQuery(el).closest('#photo-add-url-div'); 268 269 if ( parent.length ) { 270 desc = parent.find('input.tb_this_photo_description').val() || ''; 271 src = parent.find('input.tb_this_photo').val() || '' 272 } else { 273 desc = jQuery('#tb_this_photo_description').val() || ''; 274 src = jQuery('#tb_this_photo').val() || '' 275 } 276 277 tb_remove(); 278 pick(src, desc); 279 jQuery('#extra-fields').hide(); 280 jQuery('#extra-fields').html(''); 281 return false; 282 } 283 284 jQuery('#extra-fields').html('<div class="postbox"><h2><?php _e( 'Add Photos' ); ?> <small id="photo_directions">(<?php _e("click images to select") ?>)</small></h2><ul class="actions"><li><a href="#" id="photo-add-url" class="button button-small"><?php _e("Add from URL") ?> +</a></li></ul><div class="inside"><div class="titlewrap"><div id="img_container"></div></div><p id="options"><a href="#" class="close button"><?php _e('Cancel'); ?></a><a href="#" class="refresh button"><?php _e('Refresh'); ?></a></p></div>'); 285 jQuery('#img_container').html(strtoappend); 286 <?php break; 287 } 288 die; 289 } 290 291 wp_enqueue_style( 'colors' ); 292 wp_enqueue_script( 'post' ); 293 add_thickbox(); 294 _wp_admin_html_begin(); 295 ?> 296 <title><?php _e('Press This') ?></title> 297 <script type="text/javascript"> 298 addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}}; 299 var ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>', pagenow = 'press-this', isRtl = <?php echo (int) is_rtl(); ?>; 300 var photostorage = false; 301 </script> 302 303 <?php 304 /** This action is documented in wp-admin/admin-header.php */ 305 do_action( 'admin_enqueue_scripts', 'press-this.php' ); 306 307 /** 308 * Fires when styles are printed for the Press This admin page. 309 * 310 * @since 3.7.0 311 */ 312 do_action( 'admin_print_styles-press-this.php' ); 313 314 /** This action is documented in wp-admin/admin-header.php */ 315 do_action( 'admin_print_styles' ); 316 317 /** 318 * Fires when scripts are printed for the Press This admin page. 319 * 320 * @since 3.7.0 321 */ 322 do_action( 'admin_print_scripts-press-this.php' ); 323 324 /** This action is documented in wp-admin/admin-header.php */ 325 do_action( 'admin_print_scripts' ); 326 327 /** 328 * Fires in the head tag on the Press This admin page. 329 * 330 * @since 3.7.0 331 */ 332 do_action( 'admin_head-press-this.php' ); 333 334 /** This action is documented in wp-admin/admin-header.php */ 335 do_action( 'admin_head' ); 336 ?> 337 <script type="text/javascript"> 338 var wpActiveEditor = 'content'; 339 340 function insert_plain_editor(text) { 341 if ( typeof(QTags) != 'undefined' ) 342 QTags.insertContent(text); 343 } 344 function set_editor(text) { 345 if ( '' == text || '<p></p>' == text ) 346 text = '<p><br /></p>'; 347 348 if ( tinyMCE.activeEditor ) 349 tinyMCE.execCommand('mceSetContent', false, text); 350 } 351 function insert_editor(text) { 352 if ( '' != text && tinyMCE.activeEditor && ! tinyMCE.activeEditor.isHidden()) { 353 tinyMCE.execCommand('mceInsertContent', false, '<p>' + decodeURI(tinymce.DOM.decode(text)) + '</p>', {format : 'raw'}); 354 } else { 355 insert_plain_editor(decodeURI(text)); 356 } 357 } 358 function append_editor(text) { 359 if ( '' != text && tinyMCE.activeEditor && ! tinyMCE.activeEditor.isHidden()) { 360 tinyMCE.execCommand('mceSetContent', false, tinyMCE.activeEditor.getContent({format : 'raw'}) + '<p>' + text + '</p>'); 361 } else { 362 insert_plain_editor(text); 363 } 364 } 365 366 function show(tab_name) { 367 jQuery('#extra-fields').html(''); 368 switch(tab_name) { 369 case 'video' : 370 jQuery('#extra-fields').load('<?php echo esc_url($_SERVER['PHP_SELF']); ?>', { ajax: 'video', s: '<?php echo esc_attr($selection); ?>'}, function() { 371 <?php 372 $content = ''; 373 if ( preg_match("/youtube\.com\/watch/i", $url) ) { 374 list($domain, $video_id) = explode("v=", $url); 375 $video_id = esc_attr($video_id); 376 $content = '<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/' . $video_id . '"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/' . $video_id . '" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>'; 377 378 } elseif ( preg_match("/vimeo\.com\/[0-9]+/i", $url) ) { 379 list($domain, $video_id) = explode(".com/", $url); 380 $video_id = esc_attr($video_id); 381 $content = '<object width="400" height="225"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://www.vimeo.com/moogaloop.swf?clip_id=' . $video_id . '&server=www.vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1" /> <embed src="http://www.vimeo.com/moogaloop.swf?clip_id=' . $video_id . '&server=www.vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="225"></embed></object>'; 382 383 if ( trim($selection) == '' ) 384 $selection = '<p><a href="http://www.vimeo.com/' . $video_id . '?pg=embed&sec=' . $video_id . '">' . $title . '</a> on <a href="http://vimeo.com?pg=embed&sec=' . $video_id . '">Vimeo</a></p>'; 385 386 } elseif ( strpos( $selection, '<object' ) !== false ) { 387 $content = $selection; 388 } 389 ?> 390 jQuery('#embed-code').prepend('<?php echo htmlentities($content); ?>'); 391 }); 392 jQuery('#extra-fields').show(); 393 return false; 394 break; 395 case 'photo' : 396 function setup_photo_actions() { 397 jQuery('.close').click(function() { 398 jQuery('#extra-fields').hide(); 399 jQuery('#extra-fields').html(''); 400 }); 401 jQuery('.refresh').click(function() { 402 photostorage = false; 403 show('photo'); 404 }); 405 jQuery('#photo-add-url').click(function(){ 406 var form = jQuery('#photo-add-url-div').clone(); 407 jQuery('#img_container').empty().append( form.show() ); 408 }); 409 jQuery('#waiting').hide(); 410 jQuery('#extra-fields').show(); 411 } 412 413 jQuery('#waiting').show(); 414 if(photostorage == false) { 415 jQuery.ajax({ 416 type: "GET", 417 cache : false, 418 url: "<?php echo esc_url($_SERVER['PHP_SELF']); ?>", 419 data: "ajax=photo_js&u=<?php echo urlencode($url)?>", 420 dataType : "script", 421 success : function(data) { 422 eval(data); 423 photostorage = jQuery('#extra-fields').html(); 424 setup_photo_actions(); 425 } 426 }); 427 } else { 428 jQuery('#extra-fields').html(photostorage); 429 setup_photo_actions(); 430 } 431 return false; 432 break; 433 } 434 } 435 jQuery(document).ready(function($) { 436 var $contnet = $( '#content' ); 437 438 // Resize screen. 439 window.resizeTo(760,580); 440 441 // Set button actions. 442 jQuery('#photo_button').click(function() { show('photo'); return false; }); 443 jQuery('#video_button').click(function() { show('video'); return false; }); 444 445 // Auto select. 446 <?php if ( preg_match("/youtube\.com\/watch/i", $url) ) { ?> 447 show('video'); 448 <?php } elseif ( preg_match("/vimeo\.com\/[0-9]+/i", $url) ) { ?> 449 show('video'); 450 <?php } elseif ( preg_match("/flickr\.com/i", $url) ) { ?> 451 show('photo'); 452 <?php } ?> 453 jQuery('#title').unbind(); 454 jQuery('#publish, #save').click(function() { jQuery('.press-this #publishing-actions .spinner').css('display', 'inline-block'); }); 455 456 $('#tagsdiv-post_tag, #categorydiv').children('h3, .handlediv').click(function(){ 457 $(this).siblings('.inside').toggle(); 458 }); 459 460 if ( $( '#wp-content-wrap' ).hasClass( 'html-active' ) && window.switchEditors && 461 ( tinyMCEPreInit.mceInit.content && tinyMCEPreInit.mceInit.content.wpautop ) ) { 462 // The Text editor is default, run the initial content through pre_wpautop() to convert the paragraphs 463 $contnet.text( window.switchEditors.pre_wpautop( $contnet.text() ) ); 464 } 465 }); 466 </script> 467 </head> 468 <?php 469 $admin_body_class = ( is_rtl() ) ? 'rtl' : ''; 470 $admin_body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_locale() ) ) ); 471 ?> 472 <body class="press-this wp-admin wp-core-ui <?php echo $admin_body_class; ?>"> 473 <form action="press-this.php?action=post" method="post"> 474 <div id="poststuff" class="metabox-holder"> 475 <div id="side-sortables" class="press-this-sidebar"> 476 <div class="sleeve"> 477 <?php wp_nonce_field('press-this') ?> 478 <input type="hidden" name="post_type" id="post_type" value="text"/> 479 <input type="hidden" name="autosave" id="autosave" /> 480 <input type="hidden" id="original_post_status" name="original_post_status" value="draft" /> 481 <input type="hidden" id="prev_status" name="prev_status" value="draft" /> 482 <input type="hidden" id="post_id" name="post_id" value="<?php echo (int) $post_ID; ?>" /> 483 484 <!-- This div holds the photo metadata --> 485 <div class="photolist"></div> 486 487 <div id="submitdiv" class="postbox"> 488 <div class="handlediv" title="<?php esc_attr_e( 'Click to toggle' ); ?>"><br /></div> 489 <h3 class="hndle"><?php _e('Press This') ?></h3> 490 <div class="inside"> 491 <p id="publishing-actions"> 492 <?php 493 submit_button( __( 'Save Draft' ), 'button', 'draft', false, array( 'id' => 'save' ) ); 494 if ( current_user_can('publish_posts') ) { 495 submit_button( __( 'Publish' ), 'primary', 'publish', false ); 496 } else { 497 echo '<br /><br />'; 498 submit_button( __( 'Submit for Review' ), 'primary', 'review', false ); 499 } ?> 500 <span class="spinner" style="display: none;"></span> 501 </p> 502 <?php if ( current_theme_supports( 'post-formats' ) && post_type_supports( 'post', 'post-formats' ) ) : 503 $post_formats = get_theme_support( 'post-formats' ); 504 if ( is_array( $post_formats[0] ) ) : 505 $default_format = get_option( 'default_post_format', '0' ); 506 ?> 507 <p> 508 <label for="post_format"><?php _e( 'Post Format:' ); ?> 509 <select name="post_format" id="post_format"> 510 <option value="0"><?php echo get_post_format_string( 'standard' ); ?></option> 511 <?php foreach ( $post_formats[0] as $format ): ?> 512 <option<?php selected( $default_format, $format ); ?> value="<?php echo esc_attr( $format ); ?>"> <?php echo esc_html( get_post_format_string( $format ) ); ?></option> 513 <?php endforeach; ?> 514 </select></label> 515 </p> 516 <?php endif; endif; ?> 517 </div> 518 </div> 519 520 <?php $tax = get_taxonomy( 'category' ); ?> 521 <div id="categorydiv" class="postbox"> 522 <div class="handlediv" title="<?php esc_attr_e( 'Click to toggle' ); ?>"><br /></div> 523 <h3 class="hndle"><?php _e('Categories') ?></h3> 524 <div class="inside"> 525 <div id="taxonomy-category" class="categorydiv"> 526 527 <ul id="category-tabs" class="category-tabs"> 528 <li class="tabs"><a href="#category-all"><?php echo $tax->labels->all_items; ?></a></li> 529 <li class="hide-if-no-js"><a href="#category-pop"><?php _e( 'Most Used' ); ?></a></li> 530 </ul> 531 532 <div id="category-pop" class="tabs-panel" style="display: none;"> 533 <ul id="categorychecklist-pop" class="categorychecklist form-no-clear" > 534 <?php $popular_ids = wp_popular_terms_checklist( 'category' ); ?> 535 </ul> 536 </div> 537 538 <div id="category-all" class="tabs-panel"> 539 <ul id="categorychecklist" data-wp-lists="list:category" class="categorychecklist form-no-clear"> 540 <?php wp_terms_checklist($post_ID, array( 'taxonomy' => 'category', 'popular_cats' => $popular_ids ) ) ?> 541 </ul> 542 </div> 543 544 <?php if ( !current_user_can($tax->cap->assign_terms) ) : ?> 545 <p><em><?php _e('You cannot modify this Taxonomy.'); ?></em></p> 546 <?php endif; ?> 547 <?php if ( current_user_can($tax->cap->edit_terms) ) : ?> 548 <div id="category-adder" class="wp-hidden-children"> 549 <h4> 550 <a id="category-add-toggle" href="#category-add" class="hide-if-no-js"> 551 <?php printf( __( '+ %s' ), $tax->labels->add_new_item ); ?> 552 </a> 553 </h4> 554 <p id="category-add" class="category-add wp-hidden-child"> 555 <label class="screen-reader-text" for="newcategory"><?php echo $tax->labels->add_new_item; ?></label> 556 <input type="text" name="newcategory" id="newcategory" class="form-required form-input-tip" value="<?php echo esc_attr( $tax->labels->new_item_name ); ?>" aria-required="true"/> 557 <label class="screen-reader-text" for="newcategory_parent"> 558 <?php echo $tax->labels->parent_item_colon; ?> 559 </label> 560 <?php wp_dropdown_categories( array( 'taxonomy' => 'category', 'hide_empty' => 0, 'name' => 'newcategory_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => '— ' . $tax->labels->parent_item . ' —' ) ); ?> 561 <input type="button" id="category-add-submit" data-wp-lists="add:categorychecklist:category-add" class="button category-add-submit" value="<?php echo esc_attr( $tax->labels->add_new_item ); ?>" /> 562 <?php wp_nonce_field( 'add-category', '_ajax_nonce-add-category', false ); ?> 563 <span id="category-ajax-response"></span> 564 </p> 565 </div> 566 <?php endif; ?> 567 </div> 568 </div> 569 </div> 570 571 <div id="tagsdiv-post_tag" class="postbox"> 572 <div class="handlediv" title="<?php esc_attr_e( 'Click to toggle' ); ?>"><br /></div> 573 <h3><span><?php _e('Tags'); ?></span></h3> 574 <div class="inside"> 575 <div class="tagsdiv" id="post_tag"> 576 <div class="jaxtag"> 577 <label class="screen-reader-text" for="newtag"><?php _e('Tags'); ?></label> 578 <input type="hidden" name="tax_input[post_tag]" class="the-tags" id="tax-input[post_tag]" value="" /> 579 <div class="ajaxtag"> 580 <input type="text" name="newtag[post_tag]" class="newtag form-input-tip" size="16" autocomplete="off" value="" /> 581 <input type="button" class="button tagadd" value="<?php esc_attr_e('Add'); ?>" /> 582 </div> 583 </div> 584 <div class="tagchecklist"></div> 585 </div> 586 <p class="tagcloud-link"><a href="#titlediv" class="tagcloud-link" id="link-post_tag"><?php _e('Choose from the most used tags'); ?></a></p> 587 </div> 588 </div> 589 </div> 590 </div> 591 <div class="posting"> 592 593 <div id="wphead"> 594 <h1 id="site-heading"> 595 <a href="<?php echo get_option('home'); ?>/" target="_blank"> 596 <span id="site-title"><?php bloginfo('name'); ?></span> 597 </a> 598 </h1> 599 </div> 600 601 <?php 602 if ( isset($posted) && intval($posted) ) { 603 $post_ID = intval($posted); ?> 604 <div id="message" class="updated"> 605 <p><strong><?php _e('Your post has been saved.'); ?></strong> 606 <a onclick="window.opener.location.replace(this.href); window.close();" href="<?php echo get_permalink($post_ID); ?>"><?php _e('View post'); ?></a> 607 | <a href="<?php echo get_edit_post_link( $post_ID ); ?>" onclick="window.opener.location.replace(this.href); window.close();"><?php _e('Edit Post'); ?></a> 608 | <a href="#" onclick="window.close();"><?php _e('Close Window'); ?></a></p> 609 </div> 610 <?php } ?> 611 612 <div id="titlediv"> 613 <div class="titlewrap"> 614 <input name="title" id="title" class="text" type="text" value="<?php echo esc_attr($title);?>"/> 615 </div> 616 </div> 617 618 <div id="waiting" style="display: none"><span class="spinner"></span> <span><?php esc_html_e( 'Loading…' ); ?></span></div> 619 620 <div id="extra-fields" style="display: none"></div> 621 622 <div class="postdivrich"> 623 <?php 624 625 $editor_settings = array( 626 'teeny' => true, 627 'textarea_rows' => '15' 628 ); 629 630 $content = ''; 631 if ( $selection ) 632 $content .= $selection; 633 634 if ( $url ) { 635 $content .= '<p>'; 636 637 if ( $selection ) 638 $content .= __('via '); 639 640 $content .= sprintf( "<a href='%s'>%s</a>.</p>", esc_url( $url ), esc_html( $title ) ); 641 } 642 643 remove_action( 'media_buttons', 'media_buttons' ); 644 add_action( 'media_buttons', 'press_this_media_buttons' ); 645 function press_this_media_buttons() { 646 _e( 'Add:' ); 647 648 if ( current_user_can('upload_files') ) { 649 ?> 650 <a id="photo_button" title="<?php esc_attr_e('Insert an Image'); ?>" href="#"> 651 <img alt="<?php esc_attr_e('Insert an Image'); ?>" src="<?php echo esc_url( admin_url( 'images/media-button-image.gif?ver=20100531' ) ); ?>"/></a> 652 <?php 653 } 654 ?> 655 <a id="video_button" title="<?php esc_attr_e('Embed a Video'); ?>" href="#"><img alt="<?php esc_attr_e('Embed a Video'); ?>" src="<?php echo esc_url( admin_url( 'images/media-button-video.gif?ver=20100531' ) ); ?>"/></a> 656 <?php 657 } 658 659 wp_editor( $content, 'content', $editor_settings ); 660 661 ?> 662 </div> 663 </div> 664 </div> 665 </form> 666 <div id="photo-add-url-div" style="display:none;"> 667 <table><tr> 668 <td><label for="this_photo"><?php _e('URL') ?></label></td> 669 <td><input type="text" id="this_photo" name="this_photo" class="tb_this_photo text" onkeypress="if(event.keyCode==13) image_selector(this);" /></td> 670 </tr><tr> 671 <td><label for="this_photo_description"><?php _e('Description') ?></label></td> 672 <td><input type="text" id="this_photo_description" name="photo_description" class="tb_this_photo_description text" onkeypress="if(event.keyCode==13) image_selector(this);" value="<?php echo esc_attr($title);?>"/></td> 673 </tr><tr> 674 <td><input type="button" class="button" onclick="image_selector(this)" value="<?php esc_attr_e('Insert Image'); ?>" /></td> 675 </tr></table> 676 </div> 677 <?php 678 /** This action is documented in wp-admin/admin-footer.php */ 679 do_action( 'admin_footer' ); 680 /** This action is documented in wp-admin/admin-footer.php */ 681 do_action( 'admin_print_footer_scripts' ); 682 ?> 683 <script type="text/javascript">if(typeof wpOnload=='function')wpOnload();</script> 684 </body> 685 </html> 21 $GLOBALS['wp_press_this']->html(); -
trunk/src/wp-admin/tools.php
r27469 r31534 39 39 <div class="tool-box"> 40 40 <h3 class="title"><?php _e('Press This') ?></h3> 41 <p><?php _e('Press This is a bookmarklet: a little app that runs in your browser and lets you grab bits of the web.');?></p> 41 <div class="postbox press-this-install"> 42 <p><?php _e( 'Press This is a little app that lets you grab bits of the web and create new posts with ease.' );?></p> 43 <p><?php _e( 'Use Press This to clip text, images and videos from any web page. Then edit and add more straight from Press This before you save or publish it in a post on your site.' ); ?></p> 44 </div> 42 45 43 <p><?php _e('Use Press This to clip text, images and videos from any web page. Then edit and add more straight from Press This before you save or publish it in a post on your site.'); ?></p> 44 <p class="description"><?php _e('Drag-and-drop the following link to your bookmarks bar or right click it and add it to your favorites for a posting shortcut.') ?></p> 45 <p class="pressthis"><a onclick="return false;" oncontextmenu="if(window.navigator.userAgent.indexOf('WebKit')!=-1||window.navigator.userAgent.indexOf('MSIE')!=-1){jQuery('.pressthis-code').show().find('textarea').focus().select();return false;}" href="<?php echo htmlspecialchars( get_shortcut_link() ); ?>"><span><?php _e('Press This') ?></span></a></p> 46 <div class="pressthis-code" style="display:none;"> 47 <p class="description"><?php _e('If your bookmarks toolbar is hidden: copy the code below, open your Bookmarks manager, create new bookmark, type Press This into the name field and paste the code into the URL field.') ?></p> 48 <p><textarea rows="5" cols="120" readonly="readonly"><?php echo htmlspecialchars( get_shortcut_link() ); ?></textarea></p> 46 <form> 47 <div class="postbox press-this-install"> 48 <h3><?php _e( 'Install Press This' ); ?></h3> 49 <h4><?php _e( 'Bookmarklet' ); ?></h4> 50 <p><?php _e( 'Drag the bookmarklet below to your bookmarks bar. Then, when you\'re on a page you want to share, simply "press" it.' ); ?></p> 51 52 <p class="pressthis"> 53 <a class="" onclick="return false;" href="<?php echo htmlspecialchars( get_shortcut_link() ); ?>"><span><?php _e( 'Press This' ) ?></span></a> 54 <button type="button" class="button button-secondary js-show-pressthis-code-wrap" aria-expanded="false" aria-controls="pressthis-code-wrap"> 55 <span class="dashicons dashicons-clipboard"></span> 56 <span class="screen-reader-text"><?php _e( 'Copy Press This Bookmarklet' ) ?></span> 57 </button> 58 </p> 59 60 <div class="hidden js-pressthis-code-wrap"> 61 <p id="pressthis-code-desc"> 62 <?php _e( 'If you can\'t drag it to your bookmarks, copy the following code and create new bookmark. Paste the code into the new bookmark\'s URL field.' ) ?> 63 </p> 64 <p> 65 <textarea class="js-pressthis-code" rows="5" cols="120" readonly="readonly" aria-labelledby="pressthis-code-desc"><?php echo htmlspecialchars( get_shortcut_link() ); ?></textarea> 66 </p> 67 </div> 68 69 <h4><?php _e( 'Direct link (best for mobile)' ); ?></h4> 70 <p><?php _e( 'Follow the link to open Press This. Then add it to your device\'s bookmarks or home screen.' ); ?></p> 71 72 <p> 73 <a class="button button-secondary" href="<?php echo htmlspecialchars( admin_url( 'press-this.php' ) ); ?>"><?php _e( 'Open Press This' ) ?></a> 74 </p> 75 <script> 76 jQuery( document ).ready( function( $ ) { 77 var $showPressThisWrap = $( '.js-show-pressthis-code-wrap' ); 78 var $pressthisCode = $( '.js-pressthis-code' ); 79 80 $showPressThisWrap.on( 'click', function( event ) { 81 var $this = $( this ); 82 83 $this.parent().next( '.js-pressthis-code-wrap' ).slideToggle( 200 ); 84 $this.attr( 'aria-expanded', $this.attr( 'aria-expanded' ) === 'false' ? 'true' : 'false' ); 85 }); 86 87 // Select Press This code when focusing (tabbing) or clicking the textarea. 88 $pressthisCode.on( 'click focus', function() { 89 var self = this; 90 setTimeout( function() { self.select(); }, 50 ); 91 }); 92 93 }); 94 </script> 49 95 </div> 96 </form> 50 97 </div> 51 98 <?php -
trunk/src/wp-includes/link-template.php
r31480 r31534 2595 2595 */ 2596 2596 function get_shortcut_link() { 2597 // In case of breaking changes, version this. #WP20071 2598 $link = "javascript: 2599 var d=document, 2600 w=window, 2601 e=w.getSelection, 2602 k=d.getSelection, 2603 x=d.selection, 2604 s=(e?e():(k)?k():(x?x.createRange().text:0)), 2605 f='" . admin_url('press-this.php') . "', 2606 l=d.location, 2607 e=encodeURIComponent, 2608 u=f+'?u='+e(l.href)+'&t='+e(d.title)+'&s='+e(s)+'&v=4'; 2609 a=function(){if(!w.open(u,'t','toolbar=0,resizable=1,scrollbars=1,status=1,width=720,height=570'))l.href=u;}; 2610 if (/Firefox/.test(navigator.userAgent)) setTimeout(a, 0); else a(); 2611 void(0)"; 2612 2613 $link = str_replace(array("\r", "\n", "\t"), '', $link); 2597 global $is_IE, $wp_version; 2598 2599 $bookmarklet_version = 5; 2600 $link = ''; 2601 2602 if ( $is_IE ) { 2603 /** 2604 * Return the old/shorter bookmarklet code for MSIE 8 and lower, 2605 * since they only support a max length of ~2000 characters for 2606 * bookmark[let] URLs, which is way to small for our smarter one. 2607 * Do update the version number so users do not get the "upgrade your 2608 * bookmarklet" notice when using PT in those browsers. 2609 */ 2610 $ua = $_SERVER['HTTP_USER_AGENT']; 2611 2612 if ( ! empty( $ua ) && preg_match( '/\bMSIE (\d)/', $ua, $matches ) && (int) $matches[1] <= 8 ) { 2613 $link = "javascript: 2614 var d=document, 2615 w=window, 2616 e=w.getSelection, 2617 k=d.getSelection, 2618 x=d.selection, 2619 s=(e?e():(k)?k():(x?x.createRange().text:0)), 2620 f='" . admin_url('press-this.php') . "', 2621 l=d.location, 2622 e=encodeURIComponent, 2623 u=f+'?u='+e(l.href)+'&t='+e(d.title)+'&s='+e(s)+'&v=" . $bookmarklet_version . "'; 2624 a=function(){if(!w.open(u,'t','toolbar=0,resizable=1,scrollbars=1,status=1,width=600,height=700'))l.href=u;}; 2625 if (/Firefox/.test(navigator.userAgent)) setTimeout(a, 0); else a(); 2626 void(0)"; 2627 } 2628 } 2629 2630 if ( empty( $link ) ) { 2631 $suffix = '.min'; 2632 $develop_src = false !== strpos( $wp_version, '-src' ); 2633 2634 if ( $develop_src || ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ) { 2635 $suffix = ''; 2636 } 2637 2638 $url = admin_url( 'press-this.php' ) . '?v=' . $bookmarklet_version; 2639 2640 $link = 'javascript:' . file_get_contents( ABSPATH . "wp-admin/js/bookmarklet$suffix.js" ); 2641 $link = str_replace( 'window.pt_url', wp_json_encode( $url ), $link ); 2642 } 2643 2644 $link = str_replace( array( "\r", "\n", "\t" ), '', $link ); 2614 2645 2615 2646 /** -
trunk/src/wp-includes/script-loader.php
r31526 r31534 440 440 $scripts->add( 'postbox', "/wp-admin/js/postbox$suffix.js", array('jquery-ui-sortable'), false, 1 ); 441 441 442 $scripts->add( 'post', "/wp-admin/js/post$suffix.js", array('suggest', 'wp-lists', 'postbox'), false, 1 ); 442 $scripts->add( 'tags-box', "/wp-admin/js/tags-box$suffix.js", array( 'jquery', 'suggest' ), false, 1 ); 443 did_action( 'init' ) && $scripts->localize( 'tags-box', 'tagsBoxL10n', array( 444 'tagDelimiter' => _x( ',', 'tag delimiter' ), 445 ) ); 446 447 $scripts->add( 'post', "/wp-admin/js/post$suffix.js", array( 'suggest', 'wp-lists', 'postbox', 'tags-box' ), false, 1 ); 443 448 did_action( 'init' ) && $scripts->localize( 'post', 'postL10n', array( 444 449 'ok' => __('OK'), … … 462 467 'privatelyPublished' => __('Privately Published'), 463 468 'published' => __('Published'), 464 'comma' => _x( ',', 'tag delimiter' ),465 469 'saveAlert' => __('The changes you made will be lost if you navigate away from this page.'), 466 470 'savingText' => __('Saving Draft…'), 467 471 ) ); 468 472 473 $scripts->add( 'press-this', "/wp-admin/js/press-this$suffix.js", array( 'jquery', 'tags-box' ), false, 1 ); 474 did_action( 'init' ) && $scripts->localize( 'press-this', 'pressThisL10n', array( 475 /** 476 * press_this_source_string: string displayed before the source attribution string, defaults to "Source:". 477 * 478 * @since 4.2 479 * @see https://github.com/MichaelArestad/Press-This/issues/25 480 * 481 * @param string $string Internationalized source string 482 * 483 * @return string Source string 484 */ 485 'source' => apply_filters( 'press_this_source_string', __( 'Source:' ) ), 486 487 /** 488 * press_this_source_link: HTML link format for the source attribution, can control target, class, etc 489 * 490 * @since 4.2 491 * @see https://github.com/MichaelArestad/Press-This/issues/25 492 * 493 * @param string $link_format Internationalized link format, %1$s is link href, %2$s is link text 494 * 495 * @return string Link markup 496 */ 497 'sourceLink' => apply_filters( 'press_this_source_link', __( '<a href="%1$s">%2$s</a>' ) ), 498 'newPost' => __( 'Title' ), 499 'unexpectedError' => __( 'Sorry, but an unexpected error occurred.' ), 500 'saveAlert' => __( 'The changes you made will be lost if you navigate away from this page.' ), 501 'allMediaHeading' => __( 'Suggested media' ), 502 'suggestedEmbedAlt' => __( 'Suggested embed #%d' ), 503 'suggestedImgAlt' => __( 'Suggested image #%d' ), 504 ) ); 505 469 506 $scripts->add( 'editor-expand', "/wp-admin/js/editor-expand$suffix.js", array( 'jquery' ), false, 1 ); 470 507 … … 634 671 $styles->add( 'customize-controls', "/wp-admin/css/customize-controls$suffix.css", array( 'wp-admin', 'colors', 'ie', 'imgareaselect' ) ); 635 672 $styles->add( 'customize-widgets', "/wp-admin/css/customize-widgets$suffix.css", array( 'wp-admin', 'colors' ) ); 673 $styles->add( 'press-this', "/wp-admin/css/press-this$suffix.css", array( 'open-sans' ) ); 674 636 675 $styles->add( 'ie', "/wp-admin/css/ie$suffix.css" ); 637 638 676 $styles->add_data( 'ie', 'conditional', 'lte IE 7' ); 639 677
Note: See TracChangeset
for help on using the changeset viewer.