From f0ba08ced62b6fb3d1d5c7f1c1dd18b9b880a515 Mon Sep 17 00:00:00 2001 From: "Anthony G. Basile" Date: Sat, 10 Mar 2018 19:10:16 -0500 Subject: Update mantra 3.0.4 Signed-off-by: Anthony G. Basile --- themes/mantra/404.php | 6 +- themes/mantra/admin/admin-functions.php | 7 +- themes/mantra/admin/css/admin.css | 894 ++-- themes/mantra/admin/custom-styles.php | 299 -- themes/mantra/admin/defaults.php | 415 +- themes/mantra/admin/images/coffee.png | Bin 7120 -> 4623 bytes themes/mantra/admin/images/icon-facebook.png | Bin 0 -> 757 bytes themes/mantra/admin/images/icon-googleplus.png | Bin 0 -> 1230 bytes themes/mantra/admin/images/icon-twitter.png | Bin 0 -> 1193 bytes themes/mantra/admin/js/admin.js | 48 +- themes/mantra/admin/main.php | 97 +- themes/mantra/admin/sanitize.php | 172 +- themes/mantra/admin/settings.php | 1909 ++++----- themes/mantra/archive.php | 12 +- themes/mantra/attachment.php | 13 +- themes/mantra/author.php | 11 +- themes/mantra/category.php | 9 +- themes/mantra/content-aside.php | 49 - themes/mantra/content-chat.php | 50 - themes/mantra/content-frontpage.php | 37 - themes/mantra/content-gallery.php | 76 - themes/mantra/content-image.php | 43 - themes/mantra/content-link.php | 50 - themes/mantra/content-page.php | 30 - themes/mantra/content-quote.php | 47 - themes/mantra/content-status.php | 49 - themes/mantra/content.php | 85 - themes/mantra/content/content-aside.php | 49 + themes/mantra/content/content-chat.php | 50 + themes/mantra/content/content-frontpage.php | 37 + themes/mantra/content/content-gallery.php | 76 + themes/mantra/content/content-image.php | 43 + themes/mantra/content/content-link.php | 50 + themes/mantra/content/content-page.php | 30 + themes/mantra/content/content-quote.php | 47 + themes/mantra/content/content-status.php | 49 + themes/mantra/content/content.php | 85 + themes/mantra/editor-style-rtl.css | 56 - themes/mantra/editor-style.css | 287 -- themes/mantra/functions.php | 4 +- themes/mantra/header.php | 8 +- themes/mantra/images/back2top.png | Bin 3659 -> 0 bytes themes/mantra/images/bullet.png | Bin 501 -> 0 bytes themes/mantra/images/bullets/arrow_black.png | Bin 226 -> 0 bytes themes/mantra/images/bullets/arrow_white.png | Bin 283 -> 0 bytes themes/mantra/images/bullets/bullet_dark.png | Bin 304 -> 0 bytes themes/mantra/images/bullets/bullet_gray.png | Bin 304 -> 0 bytes themes/mantra/images/bullets/bullet_light.png | Bin 270 -> 0 bytes themes/mantra/images/bullets/mantra_dot2.png | Bin 181 -> 0 bytes themes/mantra/images/bullets/square_dark.png | Bin 247 -> 0 bytes themes/mantra/images/bullets/square_white.png | Bin 250 -> 0 bytes themes/mantra/images/bullets/triangle_dark.png | Bin 311 -> 0 bytes themes/mantra/images/bullets/triangle_gray.png | Bin 346 -> 0 bytes themes/mantra/images/bullets/triangle_white.png | Bin 271 -> 0 bytes themes/mantra/images/headers/mantra.png | Bin 19384 -> 0 bytes themes/mantra/images/headers/mantra_thumbnail.png | Bin 19341 -> 0 bytes themes/mantra/images/icon-back.png | Bin 242 -> 0 bytes themes/mantra/images/icon-featured.png | Bin 1395 -> 0 bytes themes/mantra/images/icon-tooltip.png | Bin 619 -> 0 bytes themes/mantra/images/nivoslider/arrows.png | Bin 824 -> 0 bytes themes/mantra/images/nivoslider/bullets.png | Bin 1281 -> 0 bytes themes/mantra/images/nivoslider/loading.gif | Bin 1737 -> 0 bytes themes/mantra/images/pins/Pin1.png | Bin 1114 -> 0 bytes themes/mantra/images/pins/Pin2.png | Bin 1323 -> 0 bytes themes/mantra/images/pins/Pin3.png | Bin 1322 -> 0 bytes themes/mantra/images/pins/Pin4.png | Bin 1146 -> 0 bytes themes/mantra/images/pins/Pin5.png | Bin 1156 -> 0 bytes themes/mantra/images/pins/mantra_dot.png | Bin 181 -> 0 bytes themes/mantra/images/post-formats/brackets.png | Bin 1315 -> 0 bytes themes/mantra/images/post-formats/brackets2.png | Bin 4552 -> 0 bytes themes/mantra/images/post-formats/bubble.png | Bin 932 -> 0 bytes themes/mantra/images/post-formats/link.png | Bin 1606 -> 0 bytes themes/mantra/images/post-formats/picture.png | Bin 874 -> 0 bytes themes/mantra/images/post-formats/quotes.png | Bin 691 -> 0 bytes themes/mantra/images/slider/mantra-column.jpg | Bin 6975 -> 0 bytes themes/mantra/images/slider/mantra-slide1.jpg | Bin 90735 -> 0 bytes themes/mantra/images/slider/mantra-slide2.jpg | Bin 39538 -> 0 bytes themes/mantra/images/socials/Amazon.png | Bin 5105 -> 0 bytes themes/mantra/images/socials/Dailymotion.png | Bin 5976 -> 0 bytes themes/mantra/images/socials/Delicious.png | Bin 1864 -> 0 bytes themes/mantra/images/socials/DeviantArt.png | Bin 1725 -> 0 bytes themes/mantra/images/socials/Digg.png | Bin 2388 -> 0 bytes themes/mantra/images/socials/Etsy.png | Bin 2494 -> 0 bytes themes/mantra/images/socials/Facebook.png | Bin 2174 -> 0 bytes themes/mantra/images/socials/Flickr.png | Bin 2277 -> 0 bytes themes/mantra/images/socials/GoodReads.png | Bin 2667 -> 0 bytes themes/mantra/images/socials/Google.png | Bin 2702 -> 0 bytes themes/mantra/images/socials/GooglePlus.png | Bin 2606 -> 0 bytes themes/mantra/images/socials/IMDb.png | Bin 2783 -> 0 bytes themes/mantra/images/socials/Instagram.png | Bin 3522 -> 0 bytes themes/mantra/images/socials/LastFM.png | Bin 2466 -> 0 bytes themes/mantra/images/socials/LinkedIn.png | Bin 2444 -> 0 bytes themes/mantra/images/socials/Mail.png | Bin 1812 -> 0 bytes themes/mantra/images/socials/MySpace.png | Bin 2658 -> 0 bytes themes/mantra/images/socials/Picasa.png | Bin 2426 -> 0 bytes themes/mantra/images/socials/Pinterest.png | Bin 1952 -> 0 bytes themes/mantra/images/socials/RSS.png | Bin 2987 -> 0 bytes themes/mantra/images/socials/Reddit.png | Bin 2857 -> 0 bytes themes/mantra/images/socials/Skype.png | Bin 2636 -> 0 bytes themes/mantra/images/socials/SoundCloud.png | Bin 1946 -> 0 bytes themes/mantra/images/socials/Steam.png | Bin 2807 -> 0 bytes themes/mantra/images/socials/StumbleUpon.png | Bin 2613 -> 0 bytes themes/mantra/images/socials/Technorati.png | Bin 2704 -> 0 bytes themes/mantra/images/socials/Tumblr.png | Bin 1598 -> 0 bytes themes/mantra/images/socials/Twitch.png | Bin 4801 -> 0 bytes themes/mantra/images/socials/Twitter.png | Bin 2180 -> 0 bytes themes/mantra/images/socials/VK.png | Bin 4366 -> 0 bytes themes/mantra/images/socials/Vimeo.png | Bin 1774 -> 0 bytes themes/mantra/images/socials/WordPress.png | Bin 2677 -> 0 bytes themes/mantra/images/socials/Xing.png | Bin 4834 -> 0 bytes themes/mantra/images/socials/Yahoo.png | Bin 2332 -> 0 bytes themes/mantra/images/socials/Yelp.png | Bin 5049 -> 0 bytes themes/mantra/images/socials/YouTube.png | Bin 3144 -> 0 bytes themes/mantra/includes/custom-styles.php | 302 ++ themes/mantra/includes/theme-comments.php | 65 +- themes/mantra/includes/theme-frontpage.php | 382 +- themes/mantra/includes/theme-functions.php | 517 +-- themes/mantra/includes/theme-hooks.php | 3 +- themes/mantra/includes/theme-loop.php | 169 +- themes/mantra/includes/theme-setup.php | 201 +- themes/mantra/includes/theme-styles.php | 176 +- themes/mantra/index.php | 17 +- themes/mantra/js/PIE/PIE.htc | 96 - themes/mantra/js/PIE/PIE.js | 88 - themes/mantra/js/PIE/PIE.php | 19 - themes/mantra/js/PIE/PIE_uncompressed.htc | 4505 -------------------- themes/mantra/js/PIE/PIE_uncompressed.js | 4474 ------------------- themes/mantra/js/frontend.js | 256 -- .../ui-bg_diagonals-thick_18_b81900_40x40.png | Bin 260 -> 0 bytes .../ui-bg_diagonals-thick_20_666666_40x40.png | Bin 251 -> 0 bytes .../images/ui-bg_flat_10_000000_40x100.png | Bin 178 -> 0 bytes .../images/ui-bg_glass_100_f6f6f6_1x400.png | Bin 104 -> 0 bytes .../images/ui-bg_glass_100_fdf5ce_1x400.png | Bin 125 -> 0 bytes .../images/ui-bg_glass_65_ffffff_1x400.png | Bin 105 -> 0 bytes .../images/ui-bg_gloss-wave_35_f6a828_500x100.png | Bin 3762 -> 0 bytes .../ui-bg_highlight-soft_100_eeeeee_1x100.png | Bin 90 -> 0 bytes .../ui-bg_highlight-soft_75_ffe45c_1x100.png | Bin 129 -> 0 bytes .../images/ui-icons_222222_256x240.png | Bin 4369 -> 0 bytes .../images/ui-icons_228ef1_256x240.png | Bin 4369 -> 0 bytes .../images/ui-icons_ef8c08_256x240.png | Bin 4369 -> 0 bytes .../images/ui-icons_ffd27a_256x240.png | Bin 4369 -> 0 bytes .../images/ui-icons_ffffff_256x240.png | Bin 4369 -> 0 bytes .../css/ui-lightness/jquery-ui-1.8.16.custom.css | 568 --- themes/mantra/js/nivo-slider.js | 10 - themes/mantra/languages/mantra.pot | 1347 +++--- themes/mantra/license.txt | 281 -- themes/mantra/page.php | 31 +- themes/mantra/readme.txt | 166 +- themes/mantra/resources/css/editor-style-rtl.css | 56 + themes/mantra/resources/css/editor-style.css | 287 ++ themes/mantra/resources/css/rtl.css | 528 +++ themes/mantra/resources/css/style-mobile.css | 339 ++ themes/mantra/resources/fonts/elusive.eot | Bin 0 -> 24152 bytes themes/mantra/resources/fonts/elusive.svg | 111 + themes/mantra/resources/fonts/elusive.ttf | Bin 0 -> 23988 bytes themes/mantra/resources/fonts/elusive.woff | Bin 0 -> 14740 bytes themes/mantra/resources/images/back2top.png | Bin 0 -> 3659 bytes themes/mantra/resources/images/bullet.png | Bin 0 -> 501 bytes .../resources/images/bullets/arrow_black.png | Bin 0 -> 226 bytes .../resources/images/bullets/arrow_white.png | Bin 0 -> 283 bytes .../resources/images/bullets/bullet_dark.png | Bin 0 -> 304 bytes .../resources/images/bullets/bullet_gray.png | Bin 0 -> 304 bytes .../resources/images/bullets/bullet_light.png | Bin 0 -> 270 bytes .../resources/images/bullets/mantra_dot2.png | Bin 0 -> 181 bytes .../resources/images/bullets/square_dark.png | Bin 0 -> 247 bytes .../resources/images/bullets/square_white.png | Bin 0 -> 250 bytes .../resources/images/bullets/triangle_dark.png | Bin 0 -> 311 bytes .../resources/images/bullets/triangle_gray.png | Bin 0 -> 346 bytes .../resources/images/bullets/triangle_white.png | Bin 0 -> 271 bytes themes/mantra/resources/images/headers/mantra.png | Bin 0 -> 19384 bytes .../resources/images/headers/mantra_thumbnail.png | Bin 0 -> 19341 bytes themes/mantra/resources/images/icon-back.png | Bin 0 -> 242 bytes themes/mantra/resources/images/icon-featured.png | Bin 0 -> 1395 bytes themes/mantra/resources/images/icon-tooltip.png | Bin 0 -> 619 bytes .../mantra/resources/images/nivoslider/arrows.png | Bin 0 -> 824 bytes .../mantra/resources/images/nivoslider/bullets.png | Bin 0 -> 1281 bytes .../mantra/resources/images/nivoslider/loading.gif | Bin 0 -> 1737 bytes themes/mantra/resources/images/pins/Pin1.png | Bin 0 -> 1114 bytes themes/mantra/resources/images/pins/Pin2.png | Bin 0 -> 1323 bytes themes/mantra/resources/images/pins/Pin3.png | Bin 0 -> 1322 bytes themes/mantra/resources/images/pins/Pin4.png | Bin 0 -> 1146 bytes themes/mantra/resources/images/pins/Pin5.png | Bin 0 -> 1156 bytes themes/mantra/resources/images/pins/mantra_dot.png | Bin 0 -> 181 bytes .../resources/images/post-formats/brackets.png | Bin 0 -> 1315 bytes .../resources/images/post-formats/brackets2.png | Bin 0 -> 4552 bytes .../resources/images/post-formats/bubble.png | Bin 0 -> 932 bytes .../mantra/resources/images/post-formats/link.png | Bin 0 -> 1606 bytes .../resources/images/post-formats/picture.png | Bin 0 -> 874 bytes .../resources/images/post-formats/quotes.png | Bin 0 -> 691 bytes .../resources/images/slider/mantra-column-1.jpg | Bin 0 -> 26107 bytes .../resources/images/slider/mantra-column-2.jpg | Bin 0 -> 34733 bytes .../resources/images/slider/mantra-column-3.jpg | Bin 0 -> 25492 bytes .../resources/images/slider/mantra-slider-1.jpg | Bin 0 -> 125928 bytes .../resources/images/slider/mantra-slider-2.jpg | Bin 0 -> 257554 bytes .../resources/images/slider/mantra-slider-3.jpg | Bin 0 -> 81487 bytes themes/mantra/resources/images/socials/AIM.png | Bin 0 -> 1119 bytes themes/mantra/resources/images/socials/AboutMe.png | Bin 0 -> 722 bytes themes/mantra/resources/images/socials/Amazon.png | Bin 0 -> 3866 bytes themes/mantra/resources/images/socials/Contact.png | Bin 0 -> 840 bytes .../mantra/resources/images/socials/Delicious.png | Bin 0 -> 708 bytes .../mantra/resources/images/socials/DeviantArt.png | Bin 0 -> 1020 bytes themes/mantra/resources/images/socials/Digg.png | Bin 0 -> 954 bytes themes/mantra/resources/images/socials/Discord.png | Bin 0 -> 3418 bytes .../mantra/resources/images/socials/Dribbble.png | Bin 0 -> 1385 bytes themes/mantra/resources/images/socials/Etsy.png | Bin 0 -> 915 bytes .../mantra/resources/images/socials/Facebook.png | Bin 0 -> 714 bytes themes/mantra/resources/images/socials/Flickr.png | Bin 0 -> 770 bytes .../mantra/resources/images/socials/FriendFeed.png | Bin 0 -> 1165 bytes themes/mantra/resources/images/socials/Github.png | Bin 0 -> 1391 bytes .../mantra/resources/images/socials/GoodReads.png | Bin 0 -> 977 bytes .../mantra/resources/images/socials/GooglePlus.png | Bin 0 -> 1214 bytes themes/mantra/resources/images/socials/IMDb.png | Bin 0 -> 751 bytes .../mantra/resources/images/socials/Instagram.png | Bin 0 -> 1005 bytes themes/mantra/resources/images/socials/LastFM.png | Bin 0 -> 1092 bytes .../mantra/resources/images/socials/LinkedIn.png | Bin 0 -> 843 bytes themes/mantra/resources/images/socials/Mail.png | Bin 0 -> 840 bytes themes/mantra/resources/images/socials/MindVox.png | Bin 0 -> 1031 bytes themes/mantra/resources/images/socials/MySpace.png | Bin 0 -> 1061 bytes .../mantra/resources/images/socials/Newsvine.png | Bin 0 -> 1079 bytes themes/mantra/resources/images/socials/Patreon.png | Bin 0 -> 3394 bytes themes/mantra/resources/images/socials/PayPal.png | Bin 0 -> 3417 bytes themes/mantra/resources/images/socials/Phone.png | Bin 0 -> 889 bytes themes/mantra/resources/images/socials/Picasa.png | Bin 0 -> 1285 bytes .../mantra/resources/images/socials/Pinterest.png | Bin 0 -> 1090 bytes themes/mantra/resources/images/socials/RSS.png | Bin 0 -> 1161 bytes themes/mantra/resources/images/socials/Reddit.png | Bin 0 -> 1281 bytes .../mantra/resources/images/socials/ShareThis.png | Bin 0 -> 1025 bytes themes/mantra/resources/images/socials/Skype.png | Bin 0 -> 1169 bytes .../mantra/resources/images/socials/SoundCloud.png | Bin 0 -> 724 bytes .../mantra/resources/images/socials/Steam-old.png | Bin 0 -> 3404 bytes .../resources/images/socials/Steam-round.png | Bin 0 -> 3877 bytes themes/mantra/resources/images/socials/Steam.png | Bin 0 -> 3877 bytes .../resources/images/socials/StumbleUpon.png | Bin 0 -> 1287 bytes .../mantra/resources/images/socials/Technorati.png | Bin 0 -> 1100 bytes .../resources/images/socials/TripAdvisor.png | Bin 0 -> 1260 bytes themes/mantra/resources/images/socials/Tumblr.png | Bin 0 -> 875 bytes themes/mantra/resources/images/socials/Twitch.png | Bin 0 -> 3547 bytes .../resources/images/socials/Twitter-old.png | Bin 0 -> 863 bytes themes/mantra/resources/images/socials/Twitter.png | Bin 0 -> 3360 bytes themes/mantra/resources/images/socials/VK.png | Bin 0 -> 1109 bytes themes/mantra/resources/images/socials/Vimeo.png | Bin 0 -> 1025 bytes .../mantra/resources/images/socials/WordPress.png | Bin 0 -> 1338 bytes themes/mantra/resources/images/socials/Xing.png | Bin 0 -> 983 bytes themes/mantra/resources/images/socials/Yahoo.png | Bin 0 -> 842 bytes themes/mantra/resources/images/socials/Yelp.png | Bin 0 -> 3904 bytes .../resources/images/socials/YouTube-old.png | Bin 0 -> 1151 bytes themes/mantra/resources/images/socials/YouTube.png | Bin 0 -> 3162 bytes themes/mantra/resources/js/PIE/PIE.htc | 96 + themes/mantra/resources/js/PIE/PIE.js | 88 + themes/mantra/resources/js/PIE/PIE.php | 19 + .../mantra/resources/js/PIE/PIE_uncompressed.htc | 4505 ++++++++++++++++++++ themes/mantra/resources/js/PIE/PIE_uncompressed.js | 4474 +++++++++++++++++++ themes/mantra/resources/js/frontend.js | 190 + .../ui-bg_diagonals-thick_18_b81900_40x40.png | Bin 0 -> 260 bytes .../ui-bg_diagonals-thick_20_666666_40x40.png | Bin 0 -> 251 bytes .../images/ui-bg_flat_10_000000_40x100.png | Bin 0 -> 178 bytes .../images/ui-bg_glass_100_f6f6f6_1x400.png | Bin 0 -> 104 bytes .../images/ui-bg_glass_100_fdf5ce_1x400.png | Bin 0 -> 125 bytes .../images/ui-bg_glass_65_ffffff_1x400.png | Bin 0 -> 105 bytes .../images/ui-bg_gloss-wave_35_f6a828_500x100.png | Bin 0 -> 3762 bytes .../ui-bg_highlight-soft_100_eeeeee_1x100.png | Bin 0 -> 90 bytes .../ui-bg_highlight-soft_75_ffe45c_1x100.png | Bin 0 -> 129 bytes .../images/ui-icons_222222_256x240.png | Bin 0 -> 4369 bytes .../images/ui-icons_228ef1_256x240.png | Bin 0 -> 4369 bytes .../images/ui-icons_ef8c08_256x240.png | Bin 0 -> 4369 bytes .../images/ui-icons_ffd27a_256x240.png | Bin 0 -> 4369 bytes .../images/ui-icons_ffffff_256x240.png | Bin 0 -> 4369 bytes .../css/ui-lightness/jquery-ui-1.8.16.custom.css | 568 +++ themes/mantra/resources/js/nivo-slider.js | 10 + themes/mantra/rtl.css | 403 -- themes/mantra/screenshot.png | Bin 408491 -> 812309 bytes themes/mantra/search.php | 9 +- themes/mantra/searchform.php | 17 +- themes/mantra/sidebar-footer.php | 63 +- themes/mantra/sidebar.php | 198 +- themes/mantra/single.php | 45 +- themes/mantra/style-mobile.css | 194 - themes/mantra/style.css | 1275 ++++-- themes/mantra/tag.php | 11 +- themes/mantra/template-blog.php | 54 - themes/mantra/template-onecolumn.php | 39 - themes/mantra/template-page-with-intro.php | 54 - themes/mantra/template-threecolumns-center.php | 26 - themes/mantra/template-threecolumns-left.php | 26 - themes/mantra/template-threecolumns-right.php | 26 - themes/mantra/template-twocolumns-left.php | 26 - themes/mantra/template-twocolumns-right.php | 26 - themes/mantra/templates/template-blog.php | 54 + themes/mantra/templates/template-onecolumn.php | 39 + .../mantra/templates/template-page-with-intro.php | 54 + .../templates/template-threecolumns-center.php | 26 + .../templates/template-threecolumns-left.php | 26 + .../templates/template-threecolumns-right.php | 26 + .../mantra/templates/template-twocolumns-left.php | 26 + .../mantra/templates/template-twocolumns-right.php | 26 + 295 files changed, 16494 insertions(+), 16498 deletions(-) delete mode 100644 themes/mantra/admin/custom-styles.php create mode 100644 themes/mantra/admin/images/icon-facebook.png create mode 100644 themes/mantra/admin/images/icon-googleplus.png create mode 100644 themes/mantra/admin/images/icon-twitter.png delete mode 100644 themes/mantra/content-aside.php delete mode 100644 themes/mantra/content-chat.php delete mode 100644 themes/mantra/content-frontpage.php delete mode 100644 themes/mantra/content-gallery.php delete mode 100644 themes/mantra/content-image.php delete mode 100644 themes/mantra/content-link.php delete mode 100644 themes/mantra/content-page.php delete mode 100644 themes/mantra/content-quote.php delete mode 100644 themes/mantra/content-status.php delete mode 100644 themes/mantra/content.php create mode 100644 themes/mantra/content/content-aside.php create mode 100644 themes/mantra/content/content-chat.php create mode 100644 themes/mantra/content/content-frontpage.php create mode 100644 themes/mantra/content/content-gallery.php create mode 100644 themes/mantra/content/content-image.php create mode 100644 themes/mantra/content/content-link.php create mode 100644 themes/mantra/content/content-page.php create mode 100644 themes/mantra/content/content-quote.php create mode 100644 themes/mantra/content/content-status.php create mode 100644 themes/mantra/content/content.php delete mode 100644 themes/mantra/editor-style-rtl.css delete mode 100644 themes/mantra/editor-style.css delete mode 100644 themes/mantra/images/back2top.png delete mode 100644 themes/mantra/images/bullet.png delete mode 100644 themes/mantra/images/bullets/arrow_black.png delete mode 100644 themes/mantra/images/bullets/arrow_white.png delete mode 100644 themes/mantra/images/bullets/bullet_dark.png delete mode 100644 themes/mantra/images/bullets/bullet_gray.png delete mode 100644 themes/mantra/images/bullets/bullet_light.png delete mode 100644 themes/mantra/images/bullets/mantra_dot2.png delete mode 100644 themes/mantra/images/bullets/square_dark.png delete mode 100644 themes/mantra/images/bullets/square_white.png delete mode 100644 themes/mantra/images/bullets/triangle_dark.png delete mode 100644 themes/mantra/images/bullets/triangle_gray.png delete mode 100644 themes/mantra/images/bullets/triangle_white.png delete mode 100644 themes/mantra/images/headers/mantra.png delete mode 100644 themes/mantra/images/headers/mantra_thumbnail.png delete mode 100644 themes/mantra/images/icon-back.png delete mode 100644 themes/mantra/images/icon-featured.png delete mode 100644 themes/mantra/images/icon-tooltip.png delete mode 100644 themes/mantra/images/nivoslider/arrows.png delete mode 100644 themes/mantra/images/nivoslider/bullets.png delete mode 100644 themes/mantra/images/nivoslider/loading.gif delete mode 100644 themes/mantra/images/pins/Pin1.png delete mode 100644 themes/mantra/images/pins/Pin2.png delete mode 100644 themes/mantra/images/pins/Pin3.png delete mode 100644 themes/mantra/images/pins/Pin4.png delete mode 100644 themes/mantra/images/pins/Pin5.png delete mode 100644 themes/mantra/images/pins/mantra_dot.png delete mode 100644 themes/mantra/images/post-formats/brackets.png delete mode 100644 themes/mantra/images/post-formats/brackets2.png delete mode 100644 themes/mantra/images/post-formats/bubble.png delete mode 100644 themes/mantra/images/post-formats/link.png delete mode 100644 themes/mantra/images/post-formats/picture.png delete mode 100644 themes/mantra/images/post-formats/quotes.png delete mode 100644 themes/mantra/images/slider/mantra-column.jpg delete mode 100644 themes/mantra/images/slider/mantra-slide1.jpg delete mode 100644 themes/mantra/images/slider/mantra-slide2.jpg delete mode 100644 themes/mantra/images/socials/Amazon.png delete mode 100644 themes/mantra/images/socials/Dailymotion.png delete mode 100644 themes/mantra/images/socials/Delicious.png delete mode 100644 themes/mantra/images/socials/DeviantArt.png delete mode 100644 themes/mantra/images/socials/Digg.png delete mode 100644 themes/mantra/images/socials/Etsy.png delete mode 100644 themes/mantra/images/socials/Facebook.png delete mode 100644 themes/mantra/images/socials/Flickr.png delete mode 100644 themes/mantra/images/socials/GoodReads.png delete mode 100644 themes/mantra/images/socials/Google.png delete mode 100644 themes/mantra/images/socials/GooglePlus.png delete mode 100644 themes/mantra/images/socials/IMDb.png delete mode 100644 themes/mantra/images/socials/Instagram.png delete mode 100644 themes/mantra/images/socials/LastFM.png delete mode 100644 themes/mantra/images/socials/LinkedIn.png delete mode 100644 themes/mantra/images/socials/Mail.png delete mode 100644 themes/mantra/images/socials/MySpace.png delete mode 100644 themes/mantra/images/socials/Picasa.png delete mode 100644 themes/mantra/images/socials/Pinterest.png delete mode 100644 themes/mantra/images/socials/RSS.png delete mode 100644 themes/mantra/images/socials/Reddit.png delete mode 100644 themes/mantra/images/socials/Skype.png delete mode 100644 themes/mantra/images/socials/SoundCloud.png delete mode 100644 themes/mantra/images/socials/Steam.png delete mode 100644 themes/mantra/images/socials/StumbleUpon.png delete mode 100644 themes/mantra/images/socials/Technorati.png delete mode 100644 themes/mantra/images/socials/Tumblr.png delete mode 100644 themes/mantra/images/socials/Twitch.png delete mode 100644 themes/mantra/images/socials/Twitter.png delete mode 100644 themes/mantra/images/socials/VK.png delete mode 100644 themes/mantra/images/socials/Vimeo.png delete mode 100644 themes/mantra/images/socials/WordPress.png delete mode 100644 themes/mantra/images/socials/Xing.png delete mode 100644 themes/mantra/images/socials/Yahoo.png delete mode 100644 themes/mantra/images/socials/Yelp.png delete mode 100644 themes/mantra/images/socials/YouTube.png create mode 100644 themes/mantra/includes/custom-styles.php delete mode 100644 themes/mantra/js/PIE/PIE.htc delete mode 100644 themes/mantra/js/PIE/PIE.js delete mode 100644 themes/mantra/js/PIE/PIE.php delete mode 100644 themes/mantra/js/PIE/PIE_uncompressed.htc delete mode 100644 themes/mantra/js/PIE/PIE_uncompressed.js delete mode 100644 themes/mantra/js/frontend.js delete mode 100644 themes/mantra/js/jqueryui/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png delete mode 100644 themes/mantra/js/jqueryui/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png delete mode 100644 themes/mantra/js/jqueryui/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png delete mode 100644 themes/mantra/js/jqueryui/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png delete mode 100644 themes/mantra/js/jqueryui/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png delete mode 100644 themes/mantra/js/jqueryui/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png delete mode 100644 themes/mantra/js/jqueryui/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png delete mode 100644 themes/mantra/js/jqueryui/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png delete mode 100644 themes/mantra/js/jqueryui/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png delete mode 100644 themes/mantra/js/jqueryui/css/ui-lightness/images/ui-icons_222222_256x240.png delete mode 100644 themes/mantra/js/jqueryui/css/ui-lightness/images/ui-icons_228ef1_256x240.png delete mode 100644 themes/mantra/js/jqueryui/css/ui-lightness/images/ui-icons_ef8c08_256x240.png delete mode 100644 themes/mantra/js/jqueryui/css/ui-lightness/images/ui-icons_ffd27a_256x240.png delete mode 100644 themes/mantra/js/jqueryui/css/ui-lightness/images/ui-icons_ffffff_256x240.png delete mode 100644 themes/mantra/js/jqueryui/css/ui-lightness/jquery-ui-1.8.16.custom.css delete mode 100644 themes/mantra/js/nivo-slider.js delete mode 100644 themes/mantra/license.txt create mode 100644 themes/mantra/resources/css/editor-style-rtl.css create mode 100644 themes/mantra/resources/css/editor-style.css create mode 100644 themes/mantra/resources/css/rtl.css create mode 100644 themes/mantra/resources/css/style-mobile.css create mode 100644 themes/mantra/resources/fonts/elusive.eot create mode 100644 themes/mantra/resources/fonts/elusive.svg create mode 100644 themes/mantra/resources/fonts/elusive.ttf create mode 100644 themes/mantra/resources/fonts/elusive.woff create mode 100644 themes/mantra/resources/images/back2top.png create mode 100644 themes/mantra/resources/images/bullet.png create mode 100644 themes/mantra/resources/images/bullets/arrow_black.png create mode 100644 themes/mantra/resources/images/bullets/arrow_white.png create mode 100644 themes/mantra/resources/images/bullets/bullet_dark.png create mode 100644 themes/mantra/resources/images/bullets/bullet_gray.png create mode 100644 themes/mantra/resources/images/bullets/bullet_light.png create mode 100644 themes/mantra/resources/images/bullets/mantra_dot2.png create mode 100644 themes/mantra/resources/images/bullets/square_dark.png create mode 100644 themes/mantra/resources/images/bullets/square_white.png create mode 100644 themes/mantra/resources/images/bullets/triangle_dark.png create mode 100644 themes/mantra/resources/images/bullets/triangle_gray.png create mode 100644 themes/mantra/resources/images/bullets/triangle_white.png create mode 100644 themes/mantra/resources/images/headers/mantra.png create mode 100644 themes/mantra/resources/images/headers/mantra_thumbnail.png create mode 100644 themes/mantra/resources/images/icon-back.png create mode 100644 themes/mantra/resources/images/icon-featured.png create mode 100644 themes/mantra/resources/images/icon-tooltip.png create mode 100644 themes/mantra/resources/images/nivoslider/arrows.png create mode 100644 themes/mantra/resources/images/nivoslider/bullets.png create mode 100644 themes/mantra/resources/images/nivoslider/loading.gif create mode 100644 themes/mantra/resources/images/pins/Pin1.png create mode 100644 themes/mantra/resources/images/pins/Pin2.png create mode 100644 themes/mantra/resources/images/pins/Pin3.png create mode 100644 themes/mantra/resources/images/pins/Pin4.png create mode 100644 themes/mantra/resources/images/pins/Pin5.png create mode 100644 themes/mantra/resources/images/pins/mantra_dot.png create mode 100644 themes/mantra/resources/images/post-formats/brackets.png create mode 100644 themes/mantra/resources/images/post-formats/brackets2.png create mode 100644 themes/mantra/resources/images/post-formats/bubble.png create mode 100644 themes/mantra/resources/images/post-formats/link.png create mode 100644 themes/mantra/resources/images/post-formats/picture.png create mode 100644 themes/mantra/resources/images/post-formats/quotes.png create mode 100644 themes/mantra/resources/images/slider/mantra-column-1.jpg create mode 100644 themes/mantra/resources/images/slider/mantra-column-2.jpg create mode 100644 themes/mantra/resources/images/slider/mantra-column-3.jpg create mode 100644 themes/mantra/resources/images/slider/mantra-slider-1.jpg create mode 100644 themes/mantra/resources/images/slider/mantra-slider-2.jpg create mode 100644 themes/mantra/resources/images/slider/mantra-slider-3.jpg create mode 100644 themes/mantra/resources/images/socials/AIM.png create mode 100644 themes/mantra/resources/images/socials/AboutMe.png create mode 100644 themes/mantra/resources/images/socials/Amazon.png create mode 100644 themes/mantra/resources/images/socials/Contact.png create mode 100644 themes/mantra/resources/images/socials/Delicious.png create mode 100644 themes/mantra/resources/images/socials/DeviantArt.png create mode 100644 themes/mantra/resources/images/socials/Digg.png create mode 100644 themes/mantra/resources/images/socials/Discord.png create mode 100644 themes/mantra/resources/images/socials/Dribbble.png create mode 100644 themes/mantra/resources/images/socials/Etsy.png create mode 100644 themes/mantra/resources/images/socials/Facebook.png create mode 100644 themes/mantra/resources/images/socials/Flickr.png create mode 100644 themes/mantra/resources/images/socials/FriendFeed.png create mode 100644 themes/mantra/resources/images/socials/Github.png create mode 100644 themes/mantra/resources/images/socials/GoodReads.png create mode 100644 themes/mantra/resources/images/socials/GooglePlus.png create mode 100644 themes/mantra/resources/images/socials/IMDb.png create mode 100644 themes/mantra/resources/images/socials/Instagram.png create mode 100644 themes/mantra/resources/images/socials/LastFM.png create mode 100644 themes/mantra/resources/images/socials/LinkedIn.png create mode 100644 themes/mantra/resources/images/socials/Mail.png create mode 100644 themes/mantra/resources/images/socials/MindVox.png create mode 100644 themes/mantra/resources/images/socials/MySpace.png create mode 100644 themes/mantra/resources/images/socials/Newsvine.png create mode 100644 themes/mantra/resources/images/socials/Patreon.png create mode 100644 themes/mantra/resources/images/socials/PayPal.png create mode 100644 themes/mantra/resources/images/socials/Phone.png create mode 100644 themes/mantra/resources/images/socials/Picasa.png create mode 100644 themes/mantra/resources/images/socials/Pinterest.png create mode 100644 themes/mantra/resources/images/socials/RSS.png create mode 100644 themes/mantra/resources/images/socials/Reddit.png create mode 100644 themes/mantra/resources/images/socials/ShareThis.png create mode 100644 themes/mantra/resources/images/socials/Skype.png create mode 100644 themes/mantra/resources/images/socials/SoundCloud.png create mode 100644 themes/mantra/resources/images/socials/Steam-old.png create mode 100644 themes/mantra/resources/images/socials/Steam-round.png create mode 100644 themes/mantra/resources/images/socials/Steam.png create mode 100644 themes/mantra/resources/images/socials/StumbleUpon.png create mode 100644 themes/mantra/resources/images/socials/Technorati.png create mode 100644 themes/mantra/resources/images/socials/TripAdvisor.png create mode 100644 themes/mantra/resources/images/socials/Tumblr.png create mode 100644 themes/mantra/resources/images/socials/Twitch.png create mode 100644 themes/mantra/resources/images/socials/Twitter-old.png create mode 100644 themes/mantra/resources/images/socials/Twitter.png create mode 100644 themes/mantra/resources/images/socials/VK.png create mode 100644 themes/mantra/resources/images/socials/Vimeo.png create mode 100644 themes/mantra/resources/images/socials/WordPress.png create mode 100644 themes/mantra/resources/images/socials/Xing.png create mode 100644 themes/mantra/resources/images/socials/Yahoo.png create mode 100644 themes/mantra/resources/images/socials/Yelp.png create mode 100644 themes/mantra/resources/images/socials/YouTube-old.png create mode 100644 themes/mantra/resources/images/socials/YouTube.png create mode 100644 themes/mantra/resources/js/PIE/PIE.htc create mode 100644 themes/mantra/resources/js/PIE/PIE.js create mode 100644 themes/mantra/resources/js/PIE/PIE.php create mode 100644 themes/mantra/resources/js/PIE/PIE_uncompressed.htc create mode 100644 themes/mantra/resources/js/PIE/PIE_uncompressed.js create mode 100644 themes/mantra/resources/js/frontend.js create mode 100644 themes/mantra/resources/js/jqueryui/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png create mode 100644 themes/mantra/resources/js/jqueryui/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png create mode 100644 themes/mantra/resources/js/jqueryui/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png create mode 100644 themes/mantra/resources/js/jqueryui/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png create mode 100644 themes/mantra/resources/js/jqueryui/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png create mode 100644 themes/mantra/resources/js/jqueryui/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png create mode 100644 themes/mantra/resources/js/jqueryui/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png create mode 100644 themes/mantra/resources/js/jqueryui/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png create mode 100644 themes/mantra/resources/js/jqueryui/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png create mode 100644 themes/mantra/resources/js/jqueryui/css/ui-lightness/images/ui-icons_222222_256x240.png create mode 100644 themes/mantra/resources/js/jqueryui/css/ui-lightness/images/ui-icons_228ef1_256x240.png create mode 100644 themes/mantra/resources/js/jqueryui/css/ui-lightness/images/ui-icons_ef8c08_256x240.png create mode 100644 themes/mantra/resources/js/jqueryui/css/ui-lightness/images/ui-icons_ffd27a_256x240.png create mode 100644 themes/mantra/resources/js/jqueryui/css/ui-lightness/images/ui-icons_ffffff_256x240.png create mode 100644 themes/mantra/resources/js/jqueryui/css/ui-lightness/jquery-ui-1.8.16.custom.css create mode 100644 themes/mantra/resources/js/nivo-slider.js delete mode 100644 themes/mantra/rtl.css delete mode 100644 themes/mantra/style-mobile.css delete mode 100644 themes/mantra/template-blog.php delete mode 100644 themes/mantra/template-onecolumn.php delete mode 100644 themes/mantra/template-page-with-intro.php delete mode 100644 themes/mantra/template-threecolumns-center.php delete mode 100644 themes/mantra/template-threecolumns-left.php delete mode 100644 themes/mantra/template-threecolumns-right.php delete mode 100644 themes/mantra/template-twocolumns-left.php delete mode 100644 themes/mantra/template-twocolumns-right.php create mode 100644 themes/mantra/templates/template-blog.php create mode 100644 themes/mantra/templates/template-onecolumn.php create mode 100644 themes/mantra/templates/template-page-with-intro.php create mode 100644 themes/mantra/templates/template-threecolumns-center.php create mode 100644 themes/mantra/templates/template-threecolumns-left.php create mode 100644 themes/mantra/templates/template-threecolumns-right.php create mode 100644 themes/mantra/templates/template-twocolumns-left.php create mode 100644 themes/mantra/templates/template-twocolumns-right.php diff --git a/themes/mantra/404.php b/themes/mantra/404.php index 150ee244..c3d5f5ea 100644 --- a/themes/mantra/404.php +++ b/themes/mantra/404.php @@ -22,11 +22,13 @@ get_header(); ?> - + + + - \ No newline at end of file + * { -display:none; + display:none; +} + +#accordion > h3, +#accordion > h2 { + display:block; } -#accordion > h3, #accordion > h2 { -display:block; +.ui-accordion { + background: #FFF; +} + +.ui-accordion .ui-widget-content:not(#slider-range) { + background: #FFF !important; + border: 1px solid #FFF !important; } .ui-accordion-content { -background:#FFF !important; -margin-bottom:10px !important; -border:none !important; -overflow: hidden; -padding:1em !important; + background:#FFF !important; + margin-bottom:10px !important; + border:none !important; + overflow: hidden; + padding:1em !important; +} + +.ui-accordion .ui-accordion-content { + overflow: hidden !important; + padding:0 !important; +} + +.ui-accordion .ui-accordion-content-overflow { + overflow: visible !important; } -.ui-accordion .ui-accordion-content { overflow: hidden !important;padding:0 !important; } -.ui-accordion .ui-accordion-content-overflow { overflow: visible !important; } .ui-state-active { - background:#444 !important; - color:#FFF !important; - border:none !important; + background: #EEE !important; + color: #111 !important; + border: none !important; } -.darkbg{ +.darkbg { background:#ddd !important; } -#status{ + +#status { font-family:Arial; padding:5px; } -ul#files{ list-style:none; padding:0; margin:0; } -ul#files li{ padding:10px; margin-bottom:2px; width:400px; float:left; margin-right:10px;} -ul#files li img{ max-width:180px; max-height:150px; } -.success{ background:#99f099; border:1px solid #339933; } -.error{ background:#f0c6c3; border:1px solid #cc6622; } + +ul#files { + list-style: none; + padding: 0; + margin: 0; +} + +ul#files li { + padding: 10px; + margin-bottom: 2px; + width: 400px; + float: left; + margin-right: 10px; +} + +ul#files li img { + max-width: 180px; + max-height: 150px; +} + +.success { + background: #99f099; + border: 1px solid #339933; +} + +.error { + background: #f0c6c3; + border: 1px solid #cc6622; +} #uploadpreview { -max-width:64px; -display:block;float:left; -border:1px solid #DDD; -padding:2px; + max-width: 64px; + display: block; + float: left; + border: 1px solid #DDD; + padding: 2px; } #filename { -display:block; -width:auto; -float:left; -margin-left:10px; -font-weight:bold; + display: block; + width: auto; + float: left; + margin-left: 10px; + font-weight: bold; } #uploadarea { -margin-top:10px; + margin-top: 10px; } -#absolutedim, #relativedim { -margin-top:30px; -position:relative; +#absolutedim, +#relativedim { + margin-top: 40px; + position: relative; } -#absolutedim small, #relativedim small{ -margin-top:20px;} -.slmini, #cdimensions { -display:block; -float:none; +#absolutedim small, +#relativedim small { + margin-top: 20px; +} + +.slmini, +#cdimensions { + display: block; + float: none; } .slmini { -background:#F9F9F9; -border-bottom:1px solid #E7E7E7; -padding:15px 5px 15px 10px; + background: #F9F9F9; + border-bottom: 1px solid #E7E7E7; + padding: 15px 5px 15px 10px; } .slmini b { -width:130px; -display:inline-block; -float:left; -text-transform:uppercase; -font-weight:normal; -font-style:italic; + width: 130px; + display: inline-block; + float: left; + text-transform: uppercase; + font-weight: normal; + font-style: italic; + color: #888; } .slidebox { -background:#F7F7F7; -border-bottom:2px solid #eaeaea; -transition:border-color .3s ease-in-out; + background:#F7F7F7; + border-bottom:2px solid #eaeaea; + transition:border-color .3s ease-in-out; } .slidebox:hover { -border-color:#8CB3B3; + border-color:#8CB3B3; } -.slidercontent{ -display:none; -padding:0 10px 10px; +.slidercontent { + display:none; + padding: 0 20px 10px; } - -.slidetitle{ -color:#777; -background:#F7F7F7; -padding: 2px 10px; -margin:3px; -cursor:pointer; +.slidetitle { + position: relative; + color:#777; + background:#F7F7F7; + padding: 5px 10px; + margin: 3px; + cursor:pointer; } -.slidetitle:after { -content:"\25BC"; -float:right; -margin-right:5px; -color:#AAA; -font-size:10px; +.slidetitle::after { + content:"\25BC"; + position: absolute; + right: 5px; + top: 50%; + font-size:10px; + color:#AAA; + -webkit-transform: translateY(-50%); + transform: translateY(-50%); } .slidetitle:hover{ -background:#F6F6F6; + background: #F6F6F6; } .slidetitle:hover:after { -color:#6C9393; + color: #6C9393; } .slidebox h5 { -display:inline-block; -float:none; -font-size:12px; -background:#FFF; -color:#777; -padding:0 10px; -margin:10px 0px 0 10px; -position:relative; -top:2px; -border:1px solid #DFDFDF; -border-bottom:none; --moz-border-radius:4px; --webkit-border-radius:4px; -border-radius:4px; + display: inline-block; + float: none; + font-size: 13px; + background: #FFF; + color: #777; + padding: 5px 10px; + margin: 20px 0 0 15px; + position: relative; + top: 3px; + border: 1px solid #DFDFDF; + border-bottom: none; } .slidebox .description { -display:block; -float:none; + display:block; + float:none; } -.slidebox input[type="text"], .slidebox textarea { -width:100%; -border-color:#DFDFDF !important; -color:#444; +#accordion .slidebox input[type="text"], +#accordion .slidebox textarea { + width: 100%; + max-width: 100%; + padding: 10px; + border-color: #DFDFDF !important; + color: #444; } -#sliderCustomSlides {margin-top:10px;} +#sliderCustomSlides { + margin-top: 10px; +} a.upload_image_button { -text-decoration:none; -clear:both; -padding:2px 4px; -display:block; -float:none; + text-decoration:none; + clear:both; + padding:2px 4px; + display:block; + float:none; } -.wp-core-ui .button, .wp-core-ui .button-secondary { -background:#FFF; -text-transform:uppercase; --moz-border-radius:0; --webkit-border-radius:0; -border-radius:0; -border-bottom:1px solid #555; +.wp-core-ui .button, +.wp-core-ui .button-secondary { + height: auto; + border: 2px solid #555; + padding: 5px 15px; + letter-spacing: 1px; + border-radius: 0; + text-transform: uppercase; + background: #FFF; } -.wp-core-ui .button:hover, .wp-core-ui .button-secondary:hover { -border-bottom:1px solid #000; +.wp-core-ui .button:hover, +.wp-core-ui .button-secondary:hover { + border-color: #000; } #submitDiv input.button { -font-size:13px !important; -padding:4px 10px !important; -height:auto; -text-transform:uppercase; -border-bottom:3px solid #555; + font-size: 13px !important; + padding: 8px 16px !important; + height: auto; + text-transform: uppercase; + border: 3px solid #555; + letter-spacing: 2px; } .header_upload_inputs { -width:300px; + width: 300px; } /* NEWS LISTS */ #righty .news-list li { -background:#FFF; -padding:7px; -border:1px solid #EEE; + background: #FFF; + padding: 7px; + border: 1px solid #EEE; } #righty span.news-item-date { -color:#999; -font-size:11px; + color: #999; + font-size: 11px; } a.news-header { -text-decoration:none; -color:#4C7373; -font-size:14px; -font-weight:bold; -text-transform:uppercase; + text-decoration: none; + color: #4C7373; + font-size: 14px; + font-weight: bold; + text-transform: uppercase; } -a.news-header:hover, a.news-read:hover { -color:#C47D09 !important; +a.news-header:hover, +a.news-read:hover { + color: #C47D09 !important; } /*Tooltip */ .tooltip_div{ -display:inline-block; -clear:none; -height:22px; -line-height:22px; + display: inline-block; + clear: none; + height: 22px; + line-height: 22px; } a.tooltip{ -display:inline-block; -clear:none; -height:22px; -line-height:22px; -margin-left:7px; + display: inline-block; + clear: none; + height: 22px; + line-height: 22px; + margin-left: 7px; } a.tooltip img { -vertical-align:bottom; + vertical-align: bottom; } .ui-tooltip { -display:block; -max-width:300px; -padding:5px; -z-index:3; + display: block; + max-width: 300px; + padding: 5px; + z-index: 3; } /* ADMIN HEADER AND LINKS */ #admin_header { - padding-top:10px; - padding-left:20px; - display:block; - float:left; - } + padding-top: 10px; + padding-left: 20px; + display: block; + float: left; +} + #admin_links { - display:block; - float:left; - clear:both; - text-align:left; - margin-left:97px; - margin-top:-17px; - } + display: block; + float: left; + clear: both; + text-align: left; + margin-left: 97px; + margin-top: -17px; + margin-bottom: 20px; +} #admin_links a { -display:block; -float:left; -margin-left:3px; -margin-right:9px; -text-decoration:none; -font-family:Segoe UI, Arial; -font-size:11px; -color:#000000; -text-transform:uppercase; + display: block; + float: left; + margin-left: 3px; + margin-right: 9px; + text-decoration: none; + font-size: 11px; + color: #000000; + text-transform: uppercase; } #admin_links a:hover { -color:#C47D09; -} - -.wrap div.updated, .wrap div.error { -margin-left: 15px; margin-right: 15px; -margin-top: 20px; } + color: #C47D09; +} + +.wrap div.updated, +.wrap div.error { + margin-left: 15px; + margin-right: 15px; + margin-top: 20px; +} + +.cryout-admin .social-buttons { + text-align: center; +} +.cryout-admin .social-buttons a { + display: inline-block; +} +.cryout-admin .social-buttons a img { + max-width: 32px; + max-height: 32px; +} +.cryout-admin .social-buttons a img + img { + margin-left: 10px; +} #jsAlert { -margin: 0 15px 10px; -background-color: #F4F8FA; -border-color: #BCE8F1; border-style: solid; border-radius: 0; border-width: 0 0 0 3px; -padding:5px 10px; + margin: 0 15px 10px; + background-color: #F4F8FA; + border-color: #BCE8F1; + border-style: solid; + border-radius: 0; + border-width: 0 0 0 3px; + padding: 5px 10px; } /* FB button fix */ @@ -630,19 +712,73 @@ padding:5px 10px; margin:0 8px; } -#mantra-settings-placeholder { - background: #fff; - padding: 0 10px 10px 10px; } +#mantra-settings-placeholder { + background: #fff; + padding: 0 10px 10px 10px; +} -#mantra-settings-placeholder h3 { - background: #444; - color: #fff; - text-transform: uppercase; - font-weight: 400; - padding: 10px; - margin: 0 -10px; - font-size: 14px; } +#mantra-settings-placeholder h3 { + background: #444; + color: #fff; + text-transform: uppercase; + font-weight: 400; + padding: 10px; + margin: 0 -10px; + font-size: 14px; +} -#mantra-settings-placeholder a { - color: #24C1BB; } +#mantra-settings-placeholder a { + color: #24C1BB; +} +/* + Responsive admin +*/ + +@media ( max-width: 800px ) { + + .cryout-admin #lefty, + .cryout-admin #righty { + min-width: 300px; + max-width: 100%; + padding: 0; + } + + .cryout-admin .form-table th { + width: auto; + } + + .cryout-admin .slmini b { + width: 100%; + margin-bottom: 5px; + } + + #accordion select, + #accordion input[type="text"], + #accordion textarea { + display: inline !important; + width: auto !important; + max-width: 70%; + } + + #accordion textarea { + max-width: 60% !important; + } + + #accordion select { + font-family: "Segoe UI, Arial"; + } + + .cryout-admin .slidebox a.upload_image_button { + float: none; + } + + #accordion .slidebox input[type="text"], + #accordion .slidebox textarea { + display: block !important; + float: none !important; + width: 100% !important; + max-width: 100% !important; + } + +} diff --git a/themes/mantra/admin/custom-styles.php b/themes/mantra/admin/custom-styles.php deleted file mode 100644 index b544ff86..00000000 --- a/themes/mantra/admin/custom-styles.php +++ /dev/null @@ -1,299 +0,0 @@ - $value) { - ${"$key"} = esc_attr($value) ; -} -if ($mantra_dimselect=="Absolute") { -$totalwidth = $mantra_sidewidth+$mantra_sidebar+50; -$contentSize = $mantra_sidewidth; -$sidebarSize = $mantra_sidebar; -} -else if ($mantra_dimselect=="Relative") { -$totalwidth = $mantra_sidewidthRel+$mantra_sidebarRel; -$contentSize = intval(($mantra_sidewidthRel/$totalwidth*100)-2); -$sidebarSize = intval(($mantra_sidebarRel/$totalwidth*100)-2); -} -ob_start(); ?> - - - - $value) { - ${"$key"} = esc_attr($value) ; } - -if ($mantra_customcss != "") { - return ''; - } -} - -function mantra_customjs() { -$mantra_options= mantra_get_theme_options(); -foreach ($mantra_options as $key => $value) { - ${"$key"} = esc_attr($value) ; } - -if ($mantra_customjs != "") { - echo ''; - } -} -?> diff --git a/themes/mantra/admin/defaults.php b/themes/mantra/admin/defaults.php index 5027179b..8acc4c21 100644 --- a/themes/mantra/admin/defaults.php +++ b/themes/mantra/admin/defaults.php @@ -4,211 +4,210 @@ $mantra_defaults = array( -"mantra_db" => "1.0", - -"mantra_side" => "2cSr", -"mantra_dimselect" => 'Absolute', -"mantra_sidewidth" => 800, -"mantra_sidebar" => 250, -"mantra_sidewidthRel" => 60, -"mantra_sidebarRel" => 20, -"mantra_mobile" => "Enable", -"mantra_zoom" => 0, -"mantra_hcontain" => "", - - -"mantra_frontpage" => "Disable", -"mantra_frontposts" => "Disable", -"mantra_frontpostscount" => 5, -"mantra_menualign" => "left", -"mantra_fpsliderwidth" => "800", -"mantra_fpsliderheight" => "250", -"mantra_fpslideranim" => "random", -"mantra_fpsliderborderwidth" => "10", -"mantra_fpsliderbordercolor" => "#EEEEEE", -"mantra_fpslidertime" => "750", -"mantra_fpsliderpause" => "5000", -"mantra_fpslidernav" => "Bullets", -"mantra_fpsliderarrows" => "Visible on Hover", - -"mantra_slideShortcode" => "", -"mantra_slideType" => "Custom Slides", -"mantra_slideCateg" => "", -"mantra_slideNumber" => "5", -"mantra_slideSpecific" => "", - -"mantra_sliderimg1" => get_template_directory_uri()."/images/slider/mantra-slide1.jpg", -"mantra_slidertitle1" => "This is the caption title", -"mantra_slidertext1" => "And this is the text that could accompany it. It is all optional so if you delete it in the Mantra Settings there will be no more caption with the black background.", -"mantra_sliderlink1" => "", -"mantra_sliderimg2" => get_template_directory_uri()."/images/slider/mantra-slide2.jpg", -"mantra_slidertitle2" => "This is yet another caption title", -"mantra_slidertext2" => 'And some more text to give you as an example. You can use links and other type of HTML formats.', -"mantra_sliderlink2" => "", -"mantra_sliderimg3" => "", -"mantra_slidertitle3" => "", -"mantra_slidertext3" => "", -"mantra_sliderlink3" => "", -"mantra_sliderimg4" => "", -"mantra_slidertitle4" => "", -"mantra_slidertext4" => "", -"mantra_sliderlink4" => "", -"mantra_sliderimg5" => "", -"mantra_slidertitle5" => "", -"mantra_slidertext5" => "", -"mantra_sliderlink5" => "", - -"mantra_nrcolumns" => "4", -"mantra_colimageheight" => "120", -"mantra_columnreadmore" => "Read more", - -"mantra_columnimg1" => get_template_directory_uri()."/images/slider/mantra-column.jpg", -"mantra_columntitle1" => "Hi there!", -"mantra_columntext1" => "You can also have some text here. Just like with the slider, it is all optional (including the title and the link inputs). All you need is an image, unless you want the Mantra image above to follow you everywhere.", -"mantra_columnlink1" => "", -"mantra_columnimg2" => get_template_directory_uri()."/images/slider/mantra-column.jpg", -"mantra_columntitle2" => " HTML tags", -"mantra_columntext2" => 'You can also have links here as well as some HTML tags.', -"mantra_columnlink2" => "", -"mantra_columnimg3" => get_template_directory_uri()."/images/slider/mantra-column.jpg", -"mantra_columntitle3" => "", -"mantra_columntext3" => "", -"mantra_columnlink3" => "", -"mantra_columnimg4" => get_template_directory_uri()."/images/slider/mantra-column.jpg", -"mantra_columntitle4" => "", -"mantra_columntext4" => "", -"mantra_columnlink4" => "", - -"mantra_fronttext1" => "This could be a title", -"mantra_fronttext2" => "And this is a second title", -"mantra_fronttitlecolor" => "#333333", -"mantra_fronttext3" => "And here you could have a whole lot of text. Or not. It is all up to you. Deleting all text inside the appropriate input in the Mantra Settings will remove this whole text zone. It can also contain some HTML tags.
Just try everything out and see what suits you. Have fun and good luck! ", -"mantra_fronttext4" => "", - -"mantra_fronthideheader" => "", -"mantra_fronthidemenu" => "", -"mantra_fronthidewidget" => "", -"mantra_fronthidefooter" => "", -"mantra_fronthideback" => "", - - -"mantra_hheight" => "75", -"mantra_hcenter" => "", -"mantra_hratio" => "", -"mantra_menurounded" => "Enable", -"mantra_logoupload" => "", -"mantra_favicon" => "", -"mantra_siteheader" => "Site Title and Description", -"mantra_headermargintop" => "20", -"mantra_headermarginleft" => "40", - -"mantra_fontfamily" => 'Segoe UI, Arial, sans-serif', -"mantra_googlefont" => '', -"mantra_googlefont2" => '', -"mantra_fontsize" => "14px", -"mantra_fonttitle" => 'Georgia, Times New Roman, Times, serif', -"mantra_googlefonttitle" => '', -"mantra_googlefonttitle2" => '', -"mantra_headfontsize" => "Default", -"mantra_fontside" => 'Helvetica, sans-serif', -"mantra_googlefontside" => '', -"mantra_googlefontside2" => '', -"mantra_sidefontsize" => "Default", -"mantra_fontsubheader" => 'Georgia, Times New Roman, Times, serif', -"mantra_googlefontsubheader" => '', -"mantra_googlefontsubheader2" => '', -"mantra_textalign" => "Default", -"mantra_parmargin" => "1.5em", -"mantra_parindent" => "0px", -"mantra_headerindent" => "Disable", -"mantra_lineheight" => "Default", -"mantra_wordspace" => "Default", -"mantra_letterspace" => "Default", -"mantra_textshadow" => "Enable", - -"mantra_contentbg" => "#FFFFFF", -"mantra_menubg" => "#FAFAFA", -"mantra_s1bg" => "", -"mantra_s2bg" => "", -"mantra_backcolor" => "#444444", -"mantra_headercolor" => "#333333", -"mantra_prefootercolor" => "#222222", -"mantra_footercolor" => "#171717", -"mantra_titlecolor" => "#0D85CC", -"mantra_descriptioncolor" => "#999999", -"mantra_contentcolor" => "#333333", -"mantra_linkscolor" => "#0D85CC", -"mantra_hovercolor" => "#12a7ff", -"mantra_headtextcolor" => "#444444", -"mantra_headtexthover" => "#000000", -"mantra_sideheadbackcolor" => "#444444", -"mantra_sideheadtextcolor" => "#2EA5FD", - -"mantra_footerheader" => "#0C85CD", -"mantra_footertext" => "#666666", -"mantra_footerhover" => "#888888", - -"mantra_breadcrumbs" => "Disable", -"mantra_pagination" => "Enable", -"mantra_caption" => "Light", -"mantra_image" => "Seven", -"mantra_pin" => "Pin2", -"mantra_sidebullet" => "arrow_white", -"mantra_metaback" => "Gray", -"mantra_postseparator" => "Hide", -"mantra_contentlist" => "Show", -"mantra_pagetitle" => "Show", -"mantra_categtitle" => "Show", -"mantra_tables" => "Disable", -"mantra_backtop" => "Enable", -"mantra_comtext" => "Show", -"mantra_comclosed" => "Hide everywhere", -"mantra_comoff" => "Show", - -"mantra_postcomlink" => "Show", -"mantra_postdate" => "Show", -"mantra_posttime" => "Hide", -"mantra_postauthor" => "Show", -"mantra_postcateg" => "Show", -"mantra_posttag" => "Show", -"mantra_postbook" => "Show", -"mantra_postmetas" => "Show", - -"mantra_excerpthome" => "Full Post", -"mantra_excerptsticky" => "Full Post", -"mantra_excerptarchive" => "Full Post", -"mantra_excerptwords" => "50", -"mantra_magazinelayout" => "Disable", -"mantra_excerptdots" => " …", -"mantra_excerptcont" => " Continue reading", -"mantra_excerpttags" => "Disable", - -"mantra_fpost" => "Disable", -"mantra_fpostlink" => "1", -"mantra_fauto" => "Disable", -"mantra_falign" => "Left", -"mantra_fwidth" => "250", -"mantra_fheight" => "150", -"mantra_fcrop" => "", -"mantra_fheader" => "Disable", - -"mantra_social1" => "Facebook", -"mantra_social2" => "#", -"mantra_social3" => "Twitter", -"mantra_social4" => "#", -"mantra_social5" => "RSS", -"mantra_social6" => "#", -"mantra_social7" => "", -"mantra_social8" => "", -"mantra_social9" => "", -"mantra_social10" => "", -"mantra_socialsdisplay0" => "1", -"mantra_socialsdisplay1" => "", -"mantra_socialsdisplay2" => "", -"mantra_socialsdisplay3" => "1", - -"mantra_copyright" => "", -"mantra_customcss" => "/* Mantra Custom CSS */ ", -"mantra_customjs" => ""); - -?> \ No newline at end of file + "mantra_db" => "1.0", + + "mantra_side" => "2cSr", + "mantra_dimselect" => 'Absolute', + "mantra_sidewidth" => 800, + "mantra_sidebar" => 340, + "mantra_sidewidthRel" => 60, + "mantra_sidebarRel" => 20, + "mantra_mobile" => "Enable", + "mantra_zoom" => 0, + "mantra_hcontain" => "", + + "mantra_frontpage" => "Disable", + "mantra_frontposts" => "Enable", + "mantra_frontpostscount" => 5, + "mantra_menualign" => "left", + "mantra_fpsliderwidth" => "1050", + "mantra_fpsliderheight" => "450", + "mantra_fpslideranim" => "random", + "mantra_fpsliderborderwidth" => "20", + "mantra_fpsliderbordercolor" => "#111111", + "mantra_fpslidertime" => "750", + "mantra_fpsliderpause" => "5000", + "mantra_fpslidernav" => "Bullets", + "mantra_fpsliderarrows" => "Visible on Hover", + + "mantra_slideShortcode" => "", + "mantra_slideType" => "Custom Slides", + "mantra_slideCateg" => "", + "mantra_slideNumber" => "3", + "mantra_slideSpecific" => "", + + "mantra_sliderimg1" => get_template_directory_uri()."/resources/images/slider/mantra-slider-1.jpg", + "mantra_slidertitle1" => "This is the caption title", + "mantra_slidertext1" => "Maecenas mauris ante, mollis ac semper in, laoreet ac augue. Nunc ut turpis ipsum. Phasellus fringilla commodo tortor eu imperdiet. Etiam vehicula mollis pulvinar. In vestibulum eros et elit vehicula, eu egestas arcu feugiat. Lorem ipsum dolor sit amet, consectetur adipiscing.", + "mantra_sliderlink1" => "", + "mantra_sliderimg2" => get_template_directory_uri()."/resources/images/slider/mantra-slider-2.jpg", + "mantra_slidertitle2" => "This is yet another caption title", + "mantra_slidertext2" => 'Phasellus sit amet diam a metus iaculis sollicitudin. Nulla sed risus quis justo malesuada elementum ut nulla eget leo maximus. Proin maximus dolor vel mauris volutpat blandit. Mauris urna nunc, pellentesque vel mauris vitae, convallis rutrum felis.', + "mantra_sliderlink2" => "", + "mantra_sliderimg3" => get_template_directory_uri()."/resources/images/slider/mantra-slider-3.jpg", + "mantra_slidertitle3" => "A third example", + "mantra_slidertext3" => "Phasellus non sagittis nibh. Curabitur quis lacus congue magna dapibus elementum. Nulla eu nulla est. Cras faucibus orci ante, vel sollicitudin quam lacinia gravida. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus vel ligula efficitur massa condimentum consequat aliquam at lectus. Duis pellentesque, ante sed mattis tincidunt.", + "mantra_sliderlink3" => "", + "mantra_sliderimg4" => "", + "mantra_slidertitle4" => "", + "mantra_slidertext4" => "", + "mantra_sliderlink4" => "", + "mantra_sliderimg5" => "", + "mantra_slidertitle5" => "", + "mantra_slidertext5" => "", + "mantra_sliderlink5" => "", + + "mantra_nrcolumns" => "3", + "mantra_colimageheight" => "215", + "mantra_columnreadmore" => "Read more", + + "mantra_columnimg1" => get_template_directory_uri()."/resources/images/slider/mantra-column-1.jpg", + "mantra_columntitle1" => "Customizable", + "mantra_columntext1" => "Aenean ut tempus quam, vitae ornare tellus. Suspendisse ligula nisi, vestibulum vitae suscipit nec, ornare eu lorem. Vestibulum tempor suscipit lacus nec vestibulum. Nullam convallis odio.", + "mantra_columnlink1" => "", + "mantra_columnimg2" => get_template_directory_uri()."/resources/images/slider/mantra-column-2.jpg", + "mantra_columntitle2" => "HTML5 and CSS3", + "mantra_columntext2" => 'Phasellus sit amet diam a metus iaculis sollicitudin. Nulla sed risus quis justo malesuada elementum ut nulla eget leo maximus. Proin maximus dolor vel mauris volutpat blandit.', + "mantra_columnlink2" => "", + "mantra_columnimg3" => get_template_directory_uri()."/resources/images/slider/mantra-column-3.jpg", + "mantra_columntitle3" => "Responsive", + "mantra_columntext3" => "Phasellus non sagittis nibh. Curabitur quis lacus congue magna dapibus elementum. Etiam non pellentesque orci. Mauris urna nunc, pellentesque vel mauris vitae, convallis rutrum felis.", + "mantra_columnlink3" => "", + "mantra_columnimg4" => "", + "mantra_columntitle4" => "", + "mantra_columntext4" => "", + "mantra_columnlink4" => "", + + "mantra_fronttext1" => "", + "mantra_fronttext2" => "", + "mantra_fronttitlecolor" => "#333333", + "mantra_fronttext3" => "Phasellus hendrerit feugiat sollicitudin. Proin accumsan lacus ac dui pulvinar, ut gravida enim feugiat. Pellentesque semper faucibus varius. Nunc gravida, neque ac bibendum placerat, magna nisl consequat mi, nec egestas enim erat sed lacus. Quisque id ipsum in augue finibus euismod in eu diam. Sed vulputate mollis lectus, sit amet semper eros dictum quis. Vivamus nisl eros, facilisis facilisis orci ac, iaculis consequat justo. ", + "mantra_fronttext4" => "", + + "mantra_fronthideheader" => "", + "mantra_fronthidemenu" => "", + "mantra_fronthidewidget" => "", + "mantra_fronthidefooter" => "", + "mantra_fronthideback" => "", + + "mantra_hheight" => "125", + "mantra_hcenter" => "", + "mantra_hratio" => "", + "mantra_menurounded" => "Enable", + "mantra_logoupload" => "", + "mantra_favicon" => "", + "mantra_siteheader" => "Site Title and Description", + "mantra_headermargintop" => "30", + "mantra_headermarginleft" => "30", + + "mantra_fontfamily" => 'Segoe UI, Arial, sans-serif', + "mantra_googlefont" => 'Open Sans:400,700', + "mantra_googlefont2" => '', + "mantra_fontsize" => "15px", + "mantra_fonttitle" => 'Default', + "mantra_googlefonttitle" => 'Merriweather:400,700', + "mantra_googlefonttitle2" => '', + "mantra_headfontsize" => "Default", + "mantra_fontside" => 'Default', + "mantra_googlefontside" => 'Open Sans:400,700', + "mantra_googlefontside2" => '', + "mantra_sidefontsize" => "Default", + "mantra_fontsubheader" => 'Default', + "mantra_googlefontsubheader" => 'Merriweather:400,700', + "mantra_googlefontsubheader2" => '', + "mantra_textalign" => "Default", + "mantra_parmargin" => "1.5em", + "mantra_parindent" => "0px", + "mantra_headerindent" => "Disable", + "mantra_lineheight" => "Default", + "mantra_wordspace" => "Default", + "mantra_letterspace" => "Default", + + "mantra_contentbg" => "#FFFFFF", + "mantra_menubg" => "#FAFAFA", + "mantra_s1bg" => "", + "mantra_s2bg" => "", + "mantra_backcolor" => "#444444", + "mantra_headercolor" => "#333333", + "mantra_prefootercolor" => "#222222", + "mantra_footercolor" => "#171717", + "mantra_titlecolor" => "#0D85CC", + "mantra_descriptioncolor" => "#999999", + "mantra_contentcolor" => "#555555", + "mantra_linkscolor" => "#0D85CC", + "mantra_hovercolor" => "#12a7ff", + "mantra_headtextcolor" => "#444444", + "mantra_headtexthover" => "#000000", + "mantra_sideheadbackcolor" => "#444444", + "mantra_sideheadtextcolor" => "#FFFFFF", + + "mantra_footerheader" => "#FFFFFF", + "mantra_footertext" => "#666666", + "mantra_footerhover" => "#888888", + + "mantra_breadcrumbs" => "Disable", + "mantra_pagination" => "Enable", + "mantra_caption" => "Light", + "mantra_image" => "None", + "mantra_pin" => "Pin2", + "mantra_sidebullet" => "arrow_white", + "mantra_metaback" => "Gray", + "mantra_postseparator" => "Hide", + "mantra_contentlist" => "Show", + "mantra_pagetitle" => "Show", + "mantra_categtitle" => "Show", + "mantra_tables" => "Disable", + "mantra_backtop" => "Enable", + "mantra_comtext" => "Show", + "mantra_comclosed" => "Hide everywhere", + "mantra_comoff" => "Show", + + "mantra_postcomlink" => "Show", + "mantra_postdate" => "Show", + "mantra_posttime" => "Hide", + "mantra_postauthor" => "Show", + "mantra_postcateg" => "Show", + "mantra_posttag" => "Show", + "mantra_postbook" => "Show", + "mantra_postmetas" => "Show", + + "mantra_excerpthome" => "Excerpt", + "mantra_excerptsticky" => "Full Post", + "mantra_excerptarchive" => "Excerpt", + "mantra_excerptwords" => "50", + "mantra_magazinelayout" => "Disable", + "mantra_excerptdots" => "…", + "mantra_excerptcont" => " Continue reading", + "mantra_excerpttags" => "Disable", + + "mantra_fpost" => "Enable", + "mantra_fpostlink" => "1", + "mantra_fauto" => "Disable", + "mantra_falign" => "Left", + "mantra_fwidth" => "250", + "mantra_fheight" => "150", + "mantra_fcrop" => "", + "mantra_fheader" => "Disable", + + "mantra_social1" => "Facebook", + "mantra_social2" => "https://www.facebook.com/Profile_or_Page", + "mantra_social3" => "Twitter", + "mantra_social4" => "https://twitter.com/username", + "mantra_social5" => "RSS", + "mantra_social6" => "http://mydomain.tld/feed/", + "mantra_social7" => "", + "mantra_social8" => "", + "mantra_social9" => "", + "mantra_social10" => "", + "mantra_socialsdisplay0" => "1", + "mantra_socialsdisplay1" => "", + "mantra_socialsdisplay2" => "1", + "mantra_socialsdisplay3" => "1", + + "mantra_copyright" => "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla massa diam, tempus a finibus et, euismod nec arcu. Praesent ultrices massa at molestie facilisis.", + "mantra_customcss" => "/* Mantra Custom CSS */ ", + "mantra_customjs" => "" + +); + +// FIN \ No newline at end of file diff --git a/themes/mantra/admin/images/coffee.png b/themes/mantra/admin/images/coffee.png index 6a94cc89..d9b12477 100644 Binary files a/themes/mantra/admin/images/coffee.png and b/themes/mantra/admin/images/coffee.png differ diff --git a/themes/mantra/admin/images/icon-facebook.png b/themes/mantra/admin/images/icon-facebook.png new file mode 100644 index 00000000..9dc3dfcf Binary files /dev/null and b/themes/mantra/admin/images/icon-facebook.png differ diff --git a/themes/mantra/admin/images/icon-googleplus.png b/themes/mantra/admin/images/icon-googleplus.png new file mode 100644 index 00000000..c606e8f0 Binary files /dev/null and b/themes/mantra/admin/images/icon-googleplus.png differ diff --git a/themes/mantra/admin/images/icon-twitter.png b/themes/mantra/admin/images/icon-twitter.png new file mode 100644 index 00000000..009ae3cf Binary files /dev/null and b/themes/mantra/admin/images/icon-twitter.png differ diff --git a/themes/mantra/admin/js/admin.js b/themes/mantra/admin/js/admin.js index 639d7974..d518ed2b 100644 --- a/themes/mantra/admin/js/admin.js +++ b/themes/mantra/admin/js/admin.js @@ -3,7 +3,7 @@ */ function media_upload( button_class) { - if (!window.wp || !window.wp.media || !window.wp.media.editor || !window.wp.media.editor.send || !window.wp.media.editor.send.attachment) return; + if (!window.wp || !window.wp.media || !window.wp.media.editor || !window.wp.media.editor.send || !window.wp.media.editor.send.attachment) return; var _custom_media = true, _orig_send_attachment = wp.media.editor.send.attachment; jQuery('body').on('click',button_class, function(e) { @@ -17,7 +17,7 @@ function media_upload( button_class) { _custom_media = true; wp.media.editor.send.attachment = function(props, attachment){ if ( _custom_media ) { - /* jQuery('.custom_media_id').val(attachment.id); */ + /* jQuery('.custom_media_id').val(attachment.id); */ uploadparent.find('.slideimages').val(attachment.url); uploadparent.find('.imagebox').attr('src',attachment.url); /* jQuery('.custom_media_image').attr('src',attachment.url).css('display','block'); */ @@ -28,13 +28,13 @@ function media_upload( button_class) { wp.media.editor.open(button); return false; }); -} - -jQuery(document).ready(function() { +} + +jQuery(document).ready(function() { var uploadparent = 0; - media_upload( '.upload_image_button' ); - + media_upload( '.upload_image_button' ); + // Show/hide slides jQuery('.slidetitle').click(function() { jQuery(this).next().toggle("fast"); @@ -68,8 +68,8 @@ jQuery(document).ready(function() { case "Slider Shortcode" : jQuery('#sliderShortcode').show("normal"); - break; - + break; + case "Custom Slides" : jQuery('#sliderCustomSlides').show("normal"); break; @@ -101,7 +101,7 @@ jQuery(document).ready(function() { }//switch });//function - + jQuery('#mantra_slideType').trigger('change'); //Slide type value @@ -135,15 +135,15 @@ jQuery(document).ready(function() { // Create accordion from existing settings table jQuery('.form-table').wrap('
'); jQuery(function() { - if (jQuery( "#accordion h2" ).length > 0) { - // wordpress 4.4+ changed headings to h2 - jQuery( "#accordion" ).accordion({ - header: 'h2', - heightStyle: "content", - collapsible: true, - navigation: true, - active: false - }); + if (jQuery( "#accordion h2" ).length > 0) { + // wordpress 4.4+ changed headings to h2 + jQuery( "#accordion" ).accordion({ + header: 'h2', + heightStyle: "content", + collapsible: true, + navigation: true, + active: false + }); } else { jQuery( "#accordion" ).accordion({ header: 'h3', @@ -155,7 +155,7 @@ jQuery(document).ready(function() { }); } }); - + if (vercomp(jQuery.ui.version,"1.9.0")) { // tooltip function is included since jQuery UI 1.9.0 tooltip_terain(); @@ -212,7 +212,7 @@ jQuery(document).ready(function() { // inform the user about the old partially unsupported version jQuery("#jsAlert").after("

Mantra has detected you are running an old version of Wordpress (jQuery) and will be running in compatibility mode. Some features may not work correctly. Consider updating your Wordpress to the latest version.

"); } - + jQuery('#jsAlert').hide(); });// ready @@ -224,13 +224,13 @@ function startfarb(a,b) { jQuery(a).click(function() { if(jQuery(b).css('display') == 'none') { - jQuery(b).parents('div:eq(0)').addClass('ui-accordion-content-overflow'); + jQuery(b).parents('.ui-accordion-content').addClass('ui-accordion-content-overflow'); jQuery(b).css('display','inline-block').hide().show(300); } }); jQuery(document).mousedown( function() { - jQuery(b).hide(700, function(){ jQuery(b).parents('div:eq(0)').removeClass('ui-accordion-content-overflow'); }); + jQuery(b).hide(700, function(){ jQuery(b).parents('.ui-accordion-content').removeClass('ui-accordion-content-overflow'); }); // todo: find a better way to remove class after the fade on IEs }); } @@ -295,4 +295,4 @@ window.twttr = (function (d, s, id) { return window.twttr || (t = { _e: [], ready: function (f) { t._e.push(f) } }); }(document, "script", "twitter-wjs")); -/* FIN */ \ No newline at end of file +/* FIN */ diff --git a/themes/mantra/admin/main.php b/themes/mantra/admin/main.php index 16d64563..35500898 100644 --- a/themes/mantra/admin/main.php +++ b/themes/mantra/admin/main.php @@ -1,7 +1,7 @@ $value) { - ${"$key"} = $value ; -} - - // Hooks/Filters // add_action('admin_init', 'mantra_init_fn' ); // hooked by the settings plugin add_action('admin_menu', 'mantra_add_page_fn'); add_action('init', 'mantra_init'); - -$mantra_options= mantra_get_theme_options(); +$mantra_options = mantra_get_theme_options(); +extract( $mantra_options ); // Registering and enqueuing all scripts and styles for the init hook function mantra_init() { @@ -43,15 +37,12 @@ function mantra_add_page_fn() { $page = add_theme_page('Mantra Settings', 'Mantra Settings', 'edit_theme_options', 'mantra-page', 'mantra_page_fn'); add_action( 'admin_print_styles-'.$page, 'mantra_admin_styles' ); add_action('admin_print_scripts-'.$page, 'mantra_admin_scripts'); - } // Adding the styles for the Mantra admin page used when mantra_add_page_fn() is launched function mantra_admin_styles() { - wp_register_style( 'mantra-admin-style',get_template_directory_uri() . '/admin/css/admin.css', NULL, _CRYOUT_THEME_VERSION ); - wp_register_style( 'jquery-ui-style',get_template_directory_uri() . '/js/jqueryui/css/ui-lightness/jquery-ui-1.8.16.custom.css', NULL, _CRYOUT_THEME_VERSION ); - wp_enqueue_style( 'mantra-admin-style' ); - wp_enqueue_style( 'jquery-ui-style' ); + wp_enqueue_style( 'mantra-admin-style', get_template_directory_uri() . '/admin/css/admin.css', NULL, _CRYOUT_THEME_VERSION ); + wp_enqueue_style( 'mantra-jqueryui-style', get_template_directory_uri() . '/resources/js/jqueryui/css/ui-lightness/jquery-ui-1.8.16.custom.css', NULL, _CRYOUT_THEME_VERSION ); } // Adding the styles for the Mantra admin page used when mantra_add_page_fn() is launched @@ -72,7 +63,7 @@ function mantra_admin_scripts() { } // For the WP uploader - if(function_exists('wp_enqueue_media')) { + if (function_exists('wp_enqueue_media')) { wp_enqueue_media(); } else { wp_enqueue_script('media-upload'); @@ -81,19 +72,17 @@ function mantra_admin_scripts() { } // The JS used in the admin - wp_register_script('cryout-admin-js',get_template_directory_uri() . '/admin/js/admin.js', NULL, _CRYOUT_THEME_VERSION ); - wp_enqueue_script('cryout-admin-js'); + wp_enqueue_script( 'mantra-admin-js', get_template_directory_uri() . '/admin/js/admin.js', NULL, _CRYOUT_THEME_VERSION ); } // The settings sections. All the referenced functions are found in admin-functions.php function mantra_init_fn(){ - register_setting('ma_options', 'ma_options', 'ma_options_validate' ); -/************** - sections -**************/ + /************** + sections + **************/ add_settings_section('layout_section', __('Layout Settings','mantra'), 'cryout_section_layout_fn', 'mantra-page'); add_settings_section('header_section', __('Header Settings','mantra'), 'cryout_section_header_fn', 'mantra-page'); @@ -107,12 +96,13 @@ function mantra_init_fn(){ add_settings_section('socials_section', __('Social Media Settings','mantra') , 'cryout_section_social_fn', 'mantra-page'); add_settings_section('misc_section', __('Miscellaneous Settings','mantra') , 'cryout_section_misc_fn', 'mantra-page'); -/*** layout ***/ + /*** layout ***/ add_settings_field('mantra_side', __('Main Layout','mantra') , 'cryout_setting_side_fn', 'mantra-page', 'layout_section'); add_settings_field('mantra_sidewidth', __('Content / Sidebar Width','mantra') , 'cryout_setting_sidewidth_fn', 'mantra-page', 'layout_section'); + add_settings_field('mantra_magazinelayout', __('Magazine Layout','mantra') , 'cryout_setting_magazinelayout_fn', 'mantra-page', 'layout_section'); add_settings_field('mantra_mobile', __('Responsiveness','mantra') , 'cryout_setting_mobile_fn', 'mantra-page', 'layout_section'); -/*** presentation ***/ + /*** presentation ***/ add_settings_field('mantra_frontpage', __('Enable Presentation Page','mantra') , 'cryout_setting_frontpage_fn', 'mantra-page', 'presentation_section'); add_settings_field('mantra_frontposts', __('Show Posts on Presentation Page','mantra') , 'cryout_setting_frontposts_fn', 'mantra-page', 'presentation_section'); add_settings_field('mantra_frontslider', __('Slider Settings','mantra') , 'cryout_setting_frontslider_fn', 'mantra-page', 'presentation_section'); @@ -120,15 +110,17 @@ function mantra_init_fn(){ add_settings_field('mantra_frontcolumns', __('Presentation Page Columns','mantra') , 'cryout_setting_frontcolumns_fn', 'mantra-page', 'presentation_section'); add_settings_field('mantra_fronttext', __('Extras','mantra') , 'cryout_setting_fronttext_fn', 'mantra-page', 'presentation_section'); -/*** header ***/ + /*** header ***/ add_settings_field('mantra_hheight', __('Header Height','mantra') , 'cryout_setting_hheight_fn', 'mantra-page', 'header_section'); add_settings_field('mantra_himage', __('Header Image','mantra') , 'cryout_setting_himage_fn', 'mantra-page', 'header_section'); add_settings_field('mantra_siteheader', __('Site Header','mantra') , 'cryout_setting_siteheader_fn', 'mantra-page', 'header_section'); add_settings_field('mantra_logoupload', __('Custom Logo Upload','mantra') , 'cryout_setting_logoupload_fn', 'mantra-page', 'header_section'); add_settings_field('mantra_headermargin', __('Header Spacing','mantra') , 'cryout_setting_headermargin_fn', 'mantra-page', 'header_section'); + add_settings_field('mantra_menualign', __('Main Menu Alignment','mantra') , 'cryout_setting_menualign_fn', 'mantra-page', 'header_section'); add_settings_field('mantra_menurounded', __('Rounded Menu Corners','mantra') , 'cryout_setting_menurounded_fn', 'mantra-page', 'header_section'); add_settings_field('mantra_favicon', __('FavIcon Upload','mantra') , 'cryout_setting_favicon_fn', 'mantra-page', 'header_section'); -/*** text ***/ + + /*** text ***/ add_settings_field('mantra_fontfamily', __('General Font','mantra') , 'cryout_setting_fontfamily_fn', 'mantra-page', 'text_section'); add_settings_field('mantra_fontsize', __('General Font Size','mantra') , 'cryout_setting_fontsize_fn', 'mantra-page', 'text_section'); add_settings_field('mantra_fonttitle', __('Post Title Font ','mantra') , 'cryout_setting_fonttitle_fn', 'mantra-page', 'text_section'); @@ -143,8 +135,8 @@ function mantra_init_fn(){ add_settings_field('mantra_lineheight', __('Line Height','mantra') , 'cryout_setting_lineheight_fn', 'mantra-page', 'text_section'); add_settings_field('mantra_wordspace', __('Word spacing','mantra') , 'cryout_setting_wordspace_fn', 'mantra-page', 'text_section'); add_settings_field('mantra_letterspace', __('Letter spacing','mantra') , 'cryout_setting_letterspace_fn', 'mantra-page', 'text_section'); - add_settings_field('mantra_textshadow', __('Text shadow','mantra') , 'cryout_setting_textshadow_fn', 'mantra-page', 'text_section'); -/*** appereance ***/ + + /*** appearance ***/ add_settings_field('mantra_sitebackground', __('Background Image','mantra') , 'cryout_setting_sitebackground_fn', 'mantra-page', 'appereance_section'); add_settings_field('mantra_backcolor', __('Background Color','mantra') , 'cryout_setting_backcolor_fn', 'mantra-page', 'appereance_section'); add_settings_field('mantra_headercolor', __('Header (Banner and Menu) Background Color','mantra') , 'cryout_setting_headercolor_fn', 'mantra-page', 'appereance_section'); @@ -152,10 +144,8 @@ function mantra_init_fn(){ add_settings_field('mantra_menubg', __('Menu Items Background Color','mantra') , 'cryout_setting_menubg_fn', 'mantra-page', 'appereance_section'); add_settings_field('mantra_s1bg', __('First Sidebar Background Color','mantra') , 'cryout_setting_first_sidebar_fn', 'mantra-page', 'appereance_section'); add_settings_field('mantra_s2bg', __('Second Sidebar Background Color','mantra') , 'cryout_setting_second_sidebar_fn', 'mantra-page', 'appereance_section'); - add_settings_field('mantra_titlecolor', __('Site Title Color','mantra') , 'cryout_setting_titlecolor_fn', 'mantra-page', 'appereance_section'); add_settings_field('mantra_descriptioncolor', __('Site Description Color','mantra') , 'cryout_setting_descriptioncolor_fn', 'mantra-page', 'appereance_section'); - add_settings_field('mantra_contentcolor', __('Content Text Color','mantra') , 'cryout_setting_contentcolor_fn', 'mantra-page', 'appereance_section'); add_settings_field('mantra_linkscolor', __('Links Color','mantra') , 'cryout_setting_linkscolor_fn', 'mantra-page', 'appereance_section'); add_settings_field('mantra_hovercolor', __('Links Hover Color','mantra') , 'cryout_setting_hovercolor_fn', 'mantra-page', 'appereance_section'); @@ -168,10 +158,10 @@ function mantra_init_fn(){ add_settings_field('mantra_footerheader', __('Footer Widget Header Text Color','mantra') , 'cryout_setting_footerheader_fn', 'mantra-page', 'appereance_section'); add_settings_field('mantra_footertext', __('Footer Widget Link Color','mantra') , 'cryout_setting_footertext_fn', 'mantra-page', 'appereance_section'); add_settings_field('mantra_footerhover', __('Footer Widget Hover Color','mantra') , 'cryout_setting_footerhover_fn', 'mantra-page', 'appereance_section'); -/*** graphics ***/ + + /*** graphics ***/ add_settings_field('mantra_breadcrumbs', __('Breadcrumbs','mantra') , 'cryout_setting_breadcrumbs_fn', 'mantra-page', 'graphics_section'); add_settings_field('mantra_pagination', __('Pagination','mantra') , 'cryout_setting_pagination_fn', 'mantra-page', 'graphics_section'); - add_settings_field('mantra_menualign', __('Main Menu Alignment','mantra') , 'cryout_setting_menualign_fn', 'mantra-page', 'graphics_section'); add_settings_field('mantra_image', __('Post Images Border','mantra') , 'cryout_setting_image_fn', 'mantra-page', 'graphics_section'); add_settings_field('mantra_caption', __('Caption Border','mantra') , 'cryout_setting_caption_fn', 'mantra-page', 'graphics_section'); add_settings_field('mantra_pin', __('Caption Pin','mantra') , 'cryout_setting_pin_fn', 'mantra-page', 'graphics_section'); @@ -186,7 +176,8 @@ function mantra_init_fn(){ add_settings_field('mantra_comtext', __('Text Under Comments','mantra') , 'cryout_setting_comtext_fn', 'mantra-page', 'graphics_section'); add_settings_field('mantra_comclosed', __('Comments are closed text','mantra') , 'cryout_setting_comclosed_fn', 'mantra-page', 'graphics_section'); add_settings_field('mantra_comoff', __('Comments off','mantra') , 'cryout_setting_comoff_fn', 'mantra-page', 'graphics_section'); -/*** post metas***/ + + /*** post metas ***/ add_settings_field('mantra_postcomlink', __('Post Comments Link','mantra') , 'cryout_setting_postcomlink_fn', 'mantra-page', 'post_section'); add_settings_field('mantra_postdate', __('Post Date','mantra') , 'cryout_setting_postdate_fn', 'mantra-page', 'post_section'); add_settings_field('mantra_posttime', __('Post Time','mantra') , 'cryout_setting_posttime_fn', 'mantra-page', 'post_section'); @@ -195,29 +186,32 @@ function mantra_init_fn(){ add_settings_field('mantra_postmetas', __('Meta Bar','mantra') , 'cryout_setting_postmetas_fn', 'mantra-page', 'post_section'); add_settings_field('mantra_posttag', __('Post Tags','mantra') , 'cryout_setting_posttag_fn', 'mantra-page', 'post_section'); add_settings_field('mantra_postbook', __('Post Permalink','mantra') , 'cryout_setting_postbook_fn', 'mantra-page', 'post_section'); -/*** post exceprts***/ + + /*** post exceprts ***/ add_settings_field('mantra_excerpthome', __('Post Excerpts on Home Page','mantra') , 'cryout_setting_excerpthome_fn', 'mantra-page', 'excerpt_section'); add_settings_field('mantra_excerptsticky', __('Affect Sticky Posts','mantra') , 'cryout_setting_excerptsticky_fn', 'mantra-page', 'excerpt_section'); add_settings_field('mantra_excerptarchive', __('Post Excerpts on Archive and Category Pages','mantra') , 'cryout_setting_excerptarchive_fn', 'mantra-page', 'excerpt_section'); add_settings_field('mantra_excerptwords', __('Number of Words for Post Excerpts ','mantra') , 'cryout_setting_excerptwords_fn', 'mantra-page', 'excerpt_section'); - add_settings_field('mantra_magazinelayout', __('Magazine Layout','mantra') , 'cryout_setting_magazinelayout_fn', 'mantra-page', 'excerpt_section'); add_settings_field('mantra_excerptdots', __('Excerpt suffix','mantra') , 'cryout_setting_excerptdots_fn', 'mantra-page', 'excerpt_section'); add_settings_field('mantra_excerptcont', __('Continue reading link text ','mantra') , 'cryout_setting_excerptcont_fn', 'mantra-page', 'excerpt_section'); add_settings_field('mantra_excerpttags', __('HTML tags in Excerpts','mantra') , 'cryout_setting_excerpttags_fn', 'mantra-page', 'excerpt_section'); -/*** featured ***/ + + /*** featured ***/ add_settings_field('mantra_fpost', __('Featured Images as POST Thumbnails ','mantra') , 'cryout_setting_fpost_fn', 'mantra-page', 'featured_section'); add_settings_field('mantra_fauto', __('Auto Select Images From Posts ','mantra') , 'cryout_setting_fauto_fn', 'mantra-page', 'featured_section'); add_settings_field('mantra_falign', __('Thumbnails Alignment ','mantra') , 'cryout_setting_falign_fn', 'mantra-page', 'featured_section'); add_settings_field('mantra_fsize', __('Thumbnails Size ','mantra') , 'cryout_setting_fsize_fn', 'mantra-page', 'featured_section'); add_settings_field('mantra_fheader', __('Featured Images as HEADER Images ','mantra') , 'cryout_setting_fheader_fn', 'mantra-page', 'featured_section'); -/*** socials ***/ + + /*** socials ***/ add_settings_field('mantra_socials1', __('Link nr. 1','mantra') , 'cryout_setting_socials1_fn', 'mantra-page', 'socials_section'); add_settings_field('mantra_socials2', __('Link nr. 2','mantra') , 'cryout_setting_socials2_fn', 'mantra-page', 'socials_section'); add_settings_field('mantra_socials3', __('Link nr. 3','mantra') , 'cryout_setting_socials3_fn', 'mantra-page', 'socials_section'); add_settings_field('mantra_socials4', __('Link nr. 4','mantra') , 'cryout_setting_socials4_fn', 'mantra-page', 'socials_section'); add_settings_field('mantra_socials5', __('Link nr. 5','mantra') , 'cryout_setting_socials5_fn', 'mantra-page', 'socials_section'); add_settings_field('mantra_socialshow', __('Socials display','mantra') , 'cryout_setting_socialsdisplay_fn', 'mantra-page', 'socials_section'); -/*** misc ***/ + + /*** misc ***/ add_settings_field('mantra_copyright', __('Custom Footer Text','mantra') , 'cryout_setting_copyright_fn', 'mantra-page', 'misc_section'); add_settings_field('mantra_customcss', __('Custom CSS','mantra') , 'cryout_setting_customcss_fn', 'mantra-page', 'misc_section'); add_settings_field('mantra_customjs', __('Custom JavaScript','mantra') , 'cryout_setting_customjs_fn', 'mantra-page', 'misc_section'); @@ -241,7 +235,7 @@ function mantra_page_fn() { } ?> -
+

@@ -263,7 +257,7 @@ function mantra_page_fn() { } ?>
Checking jQuery functionality...
If this message remains visible after the page has loaded then there is a problem with your WordPress jQuery library. This can have several causes, including incompatible plugins. -The Parabola Settings page cannot function without jQuery.
+The Settings page cannot function without jQuery.
+ + +

Or socially smother, caress and embrace us:

-
@@ -314,7 +317,6 @@ The Parabola Settings page cannot function without jQuery.
-
@@ -354,8 +356,9 @@ The Parabola Settings page cannot function without jQuery.
array( + "Segoe UI, Arial, sans-serif", + "Verdana, Geneva, sans-serif ", + "Geneva, sans-serif ", + "Helvetica Neue, Arial, Helvetica, sans-serif", + "Helvetica, sans-serif", + "Century Gothic, AppleGothic, sans-serif", + "Futura, Century Gothic, AppleGothic, sans-serif", + "Calibri, Arian, sans-serif", + "Myriad Pro, Myriad,Arial, sans-serif", + "Trebuchet MS, Arial, Helvetica, sans-serif", + "Gill Sans, Calibri, Trebuchet MS, sans-serif", + "Impact, Haettenschweiler, Arial Narrow Bold, sans-serif ", + "Tahoma, Geneva, sans-serif", + "Arial, Helvetica, sans-serif" , + "Arial Black, Gadget, sans-serif", + "Lucida Sans Unicode, Lucida Grande, sans-serif ", + ), + 'fontSerif' => array( + "Georgia, Times New Roman, Times, serif", + "Times New Roman, Times, serif", + "Cambria, Georgia, Times, Times New Roman, serif", + "Palatino Linotype, Book Antiqua, Palatino, serif", + "Book Antiqua, Palatino, serif", + "Palatino, serif", + "Baskerville, Times New Roman, Times, serif", + "Bodoni MT, serif", + "Copperplate Light, Copperplate Gothic Light, serif", + "Garamond, Times New Roman, Times, serif", + ), + 'fontMono' => array( + "Courier New, Courier, monospace", + "Lucida Console, Monaco, monospace", + "Consolas, Lucida Console, Monaco, monospace", + "Monaco, monospace", + ), + 'fontCursive' => array( + "Lucida Casual, Comic Sans MS , cursive ", + "Brush Script MT,Phyllis,Lucida Handwriting,cursive", + "Phyllis,Lucida Handwriting,cursive", + "Lucida Handwriting,cursive", + "Comic Sans MS, cursive", + ), +); + +/* Social media networks */ +$mantra_socials = array( + "AboutMe", "AIM", "Amazon", "Contact", "Delicious", "DeviantArt", + "Digg", "Discord", "Dribbble", "Etsy", "Facebook", "Flickr", + "FriendFeed", "Github", "GoodReads", "GooglePlus", "IMDb", "Instagram", + "LastFM", "LinkedIn", "Mail", "MindVox", "MySpace", "Newsvine", + "Patreon", "PayPal", "Phone", "Picasa", "Pinterest", "Reddit", + "RSS", "ShareThis", "Skype", "Steam", "Steam-old", "SoundCloud", + "StumbleUpon", "Technorati", "TripAdvisor", "Tumblr", "Twitch", "Twitter", + "Twitter-old", "Vimeo", "VK", "WordPress", "Yahoo", "Yelp", + "YouTube", "YouTube-old", "Xing", + ); + +if ( !function_exists ('ma_options_validate') ) : /* * * Validate user data * */ function ma_options_validate($input) { -global $mantra_defaults; - // Sanitize the texbox input + global $mantra_defaults; -/*** 1 ***/ - if(isset($input['mantra_sidewidth']) && is_numeric($input['mantra_sidewidth']) && $input['mantra_sidewidth']>=500 && $input['mantra_sidewidth'] <=1760) {} else {$input['mantra_sidewidth']=$mantra_defaults['mantra_sidewidth']; } - if(isset($input['mantra_sidebar']) && is_numeric($input['mantra_sidebar']) && $input['mantra_sidebar']>=220 && $input['mantra_sidebar'] <=800) {} else {$input['mantra_sidebar']=$mantra_defaults['mantra_sidebar']; } + /** 1 **/ + + if (isset($input['mantra_sidewidth']) && is_numeric($input['mantra_sidewidth']) && $input['mantra_sidewidth']>=500 && $input['mantra_sidewidth'] <=1760) {} else {$input['mantra_sidewidth']=$mantra_defaults['mantra_sidewidth']; } + if (isset($input['mantra_sidebar']) && is_numeric($input['mantra_sidebar']) && $input['mantra_sidebar']>=220 && $input['mantra_sidebar'] <=800) {} else {$input['mantra_sidebar']=$mantra_defaults['mantra_sidebar']; } - if(isset($input['mantra_sidewidthRel']) && is_numeric($input['mantra_sidewidthRel']) && $input['mantra_sidewidthRel']>=40 && $input['mantra_sidewidthRel'] <=80) {} else {$input['mantra_sidewidthRel']=$mantra_defaults['mantra_sidewidthRel']; } - if(isset($input['mantra_sidebarRel']) && is_numeric($input['mantra_sidebarRel']) && $input['mantra_sidebarRel']>=20 && $input['mantra_sidebarRel'] <=50) {} else {$input['mantra_sidebarRel']=$mantra_defaults['mantra_sidebarRel']; } + if (isset($input['mantra_sidewidthRel']) && is_numeric($input['mantra_sidewidthRel']) && $input['mantra_sidewidthRel']>=40 && $input['mantra_sidewidthRel'] <=80) {} else {$input['mantra_sidewidthRel']=$mantra_defaults['mantra_sidewidthRel']; } + if (isset($input['mantra_sidebarRel']) && is_numeric($input['mantra_sidebarRel']) && $input['mantra_sidebarRel']>=20 && $input['mantra_sidebarRel'] <=50) {} else {$input['mantra_sidebarRel']=$mantra_defaults['mantra_sidebarRel']; } if (isset($input['mantra_zoom'])) $input['mantra_zoom'] = "1"; else $input['mantra_zoom'] = 0; @@ -109,7 +117,7 @@ global $mantra_defaults; $input['mantra_fwidth'] = intval(wp_kses_data($input['mantra_fwidth'])); $input['mantra_fheight'] = intval(wp_kses_data($input['mantra_fheight'])); -/*** 2 ***/ + /** 2 **/ $cryout_special_terms = array('mailto:','callto://'); $cryout_special_keys = array('Mail', 'Skype'); @@ -124,8 +132,8 @@ global $mantra_defaults; endif; } for ($i=0;$i<=5;$i++) { - if (!isset($input['mantra_socialsdisplay'.$i])) {$input['mantra_socialsdisplay'.$i] = "0";} - } + if (!isset($input['mantra_socialsdisplay'.$i])) { $input['mantra_socialsdisplay'.$i] = "0"; } + } $input['mantra_favicon'] = esc_url_raw($input['mantra_favicon']); $input['mantra_logoupload'] = esc_url_raw($input['mantra_logoupload']); @@ -140,32 +148,6 @@ global $mantra_defaults; $input['mantra_googlefontside'] = trim(wp_kses_data($input['mantra_googlefontside'])); $input['mantra_googlefontsubheader'] = trim(wp_kses_data($input['mantra_googlefontsubheader'])); - if($input['mantra_googlefont']) { - $mantra_googlefont2 = $input['mantra_googlefont']; - $mantra_googlefont2= preg_replace( '/\s+/', '+', $mantra_googlefont2 ); - $mantra_googlefont2= "//fonts.googleapis.com/css?family=".$mantra_googlefont2; - $input['mantra_googlefont2'] = $mantra_googlefont2; - } else $input['mantra_googlefont2'] = ''; - if($input['mantra_googlefonttitle']) { - $mantra_googlefonttitle2 = $input['mantra_googlefonttitle']; - $mantra_googlefonttitle2= preg_replace( '/\s+/', '+', $mantra_googlefonttitle2 ); - $mantra_googlefonttitle2= "//fonts.googleapis.com/css?family=".$mantra_googlefonttitle2; - $input['mantra_googlefonttitle2'] = $mantra_googlefonttitle2; - } else $input['mantra_googlefonttitle2'] = ''; - if($input['mantra_googlefontside']) { - $mantra_googlefontside2 = $input['mantra_googlefontside']; - $mantra_googlefontside2= preg_replace( '/\s+/', '+', $mantra_googlefontside2 ); - $mantra_googlefontside2= "//fonts.googleapis.com/css?family=".$mantra_googlefontside2; - $input['mantra_googlefontside2'] = $mantra_googlefontside2; - } else $input['mantra_googlefontside2'] = ''; - if($input['mantra_googlefontsubheader']) { - $mantra_googlefontsubheader2 = $input['mantra_googlefontsubheader']; - $mantra_googlefontsubheader2= preg_replace( '/\s+/', '+', $mantra_googlefontsubheader2 ); - $mantra_googlefontsubheader2= "//fonts.googleapis.com/css?family=".$mantra_googlefontsubheader2; - $input['mantra_googlefontsubheader2'] = $mantra_googlefontsubheader2; - } else $input['mantra_googlefontsubheader2'] = ''; - - $input['mantra_frontpostscount'] = intval(wp_kses_data($input['mantra_frontpostscount'])); $input['mantra_fpsliderborderwidth'] = intval(wp_kses_data($input['mantra_fpsliderborderwidth'])); @@ -176,7 +158,8 @@ global $mantra_defaults; $input['mantra_fpsliderwidth'] = intval(wp_kses_data($input['mantra_fpsliderwidth'])); $input['mantra_fpsliderheight'] = intval(wp_kses_data($input['mantra_fpsliderheight'])); -/** 3 ***/ + /** 3 **/ + $input['mantra_sliderimg1'] = wp_kses_data($input['mantra_sliderimg1']); $input['mantra_slidertitle1'] = wp_kses_data($input['mantra_slidertitle1']); $input['mantra_slidertext1'] = wp_kses_post($input['mantra_slidertext1']); @@ -200,7 +183,8 @@ global $mantra_defaults; $input['mantra_colimageheight'] = intval(wp_kses_data($input['mantra_colimageheight'])); -/** 4 **/ + /** 4 **/ + $input['mantra_columnimg1'] = wp_kses_data($input['mantra_columnimg1']); $input['mantra_columntitle1'] = wp_kses_data($input['mantra_columntitle1']); $input['mantra_columntext1'] = wp_kses_post($input['mantra_columntext1']); @@ -227,13 +211,13 @@ global $mantra_defaults; $input['mantra_fronttext3'] = trim( wp_kses_post($input['mantra_fronttext3'])); $input['mantra_fronttext4'] = trim (wp_kses_post($input['mantra_fronttext4'])); - $resetDefault = ( ! empty( $input['mantra_defaults']) ? true : false ); + $resetDefault = ( ! empty( $input['mantra_defaults']) ? true : false ); - if ($resetDefault) {$input=$mantra_defaults;} + if ($resetDefault) { $input = $mantra_defaults; } return $input; // return validated input } - endif; -?> + +// FIN \ No newline at end of file diff --git a/themes/mantra/admin/settings.php b/themes/mantra/admin/settings.php index 196be4c3..7f21ab3c 100644 --- a/themes/mantra/admin/settings.php +++ b/themes/mantra/admin/settings.php @@ -14,15 +14,14 @@ function cryout_section_featured_fn() { } function cryout_section_social_fn() { } function cryout_section_misc_fn() { } + //////////////////////////////// //// LAYOUT SETTINGS /////////// //////////////////////////////// - -// RADIO-BUTTON - Name: ma_options[side] function cryout_setting_side_fn() { -global $mantra_options; - $items = array("1c", "2cSr", "2cSl", "3cSr" , "3cSl", "3cSs"); + global $mantra_options; + $options = array("1c", "2cSr", "2cSl", "3cSr" , "3cSl", "3cSs"); $layout_text["1c"] = __("One column (no sidebars)","mantra"); $layout_text["2cSr"] = __("Two columns, sidebar on the right","mantra"); $layout_text["2cSl"] = __("Two columns, sidebar on the left","mantra"); @@ -30,13 +29,12 @@ global $mantra_options; $layout_text["3cSl"] = __("Three columns, sidebars on the left","mantra"); $layout_text["3cSs"] = __("Three columns, one sidebar on each side","mantra"); -// For backward compatibility; + // For backward compatibility; if ($mantra_options['mantra_side'] == 'Disable') $mantra_options['mantra_side'] = '1c'; if ($mantra_options['mantra_side'] == 'Right') $mantra_options['mantra_side'] = '2cSr'; if ($mantra_options['mantra_side'] == 'Left') $mantra_options['mantra_side'] = '2cSl'; - - foreach($items as $item) { + foreach($options as $item) { $checkedClass = ($mantra_options['mantra_side']==$item) ? ' checkedClass' : ''; echo ""; + echo "
".__("Enable to make Mantra fully responsive. The layout and general sizes of your blog will adjust depending on what device and what resolution it is viewed in.
Do not disable unless you have a good reason to.","mantra")."
"; } - //////////////////////////////// //// PRESENTATION SETTINGS ///////////// //////////////////////////////// - -//CHECKBOX - Name: ma_options[frontpage] function cryout_setting_frontpage_fn() { global $mantra_options; - $items = array ("Enable" , "Disable"); - $itemsare = array( __("Enable","mantra"), __("Disable","mantra")); + $options = array ("Enable" , "Disable"); + $labels = array( __("Enable","mantra"), __("Disable","mantra")); echo ""; echo "
".__("Enable the presentation front-page. This will become your new home page. It has a slider and columns for presentation text and images.
If you have this enabled but don't see a Presentation page then go to Settings » Reading and make sure you have selected Front Page Displays as Your Latest Posts.","mantra")."
"; if ($mantra_options['mantra_frontpage'] == 'Enable' && get_option('show_on_front') != 'posts') { printf ( '
'.__('You have enabled the Presentation Page but your WordPress\' Front page displays option is set to use a static page. WordPress guidelines require that the static page option have priority over theme options.
Go to %1$s and set the Front page displays option to Your latest posts to display the presentation page.',"mantra").'
', ' Settings » Reading'); }; - } function cryout_setting_frontposts_fn() { global $mantra_options; - $items = array ("Enable" , "Disable"); - $itemsare = array( __("Enable","mantra"), __("Disable","mantra")); + $options = array ("Enable" , "Disable"); + $labels = array( __("Enable","mantra"), __("Disable","mantra")); echo " "; echo " ".__('posts','mantra'); + echo absint( $mantra_options['mantra_frontpostscount'] )."'> ".__('posts','mantra'); echo "
".__("Enable to display latest posts on the presentation page, below the columns. Sticky posts are always displayed and not counted.","mantra")."
"; } -//CHECKBOX - Name: ma_options[frontslider] + function cryout_setting_frontslider_fn() { global $mantra_options; - - + echo "
".__("Slider Dimensions:","mantra")." "; echo " px (".__("width","mantra").") X "; echo " px (".__("height","mantra").")"; echo "".__("The dimensions of your slider. Make sure your images are of the same size.","mantra")."
"; echo "
".__("Animation:","mantra")." "; - $items = array ("random" , "fold", "fade", "slideInRight", "slideInLeft", "sliceDown", "sliceDownLeft", "sliceUp", "sliceUpLeft", "sliceUpDown" , "sliceUpDownLeft", "boxRandom", "boxRain", "boxRainReverse", "boxRainGrow" , "boxRainGrowReverse"); - $itemsare = array( __("Random","mantra"), __("Fold","mantra"), __("Fade","mantra"), __("SlideInRight","mantra"), __("SlideInLeft","mantra"), __("SliceDown","mantra"), __("SliceDownLeft","mantra"), __("SliceUp","mantra"), __("SliceUpLeft","mantra"), __("SliceUpDown","mantra"), __("SliceUpDownLeft","mantra"), __("BoxRandom","mantra"), __("BoxRain","mantra"), __("BoxRainReverse","mantra"), __("BoxRainGrow","mantra"), __("BoxRainGrowReverse","mantra")); + $options = array ("random" , "fold", "fade", "slideInRight", "slideInLeft", "sliceDown", "sliceDownLeft", "sliceUp", "sliceUpLeft", "sliceUpDown" , "sliceUpDownLeft", "boxRandom", "boxRain", "boxRainReverse", "boxRainGrow" , "boxRainGrowReverse"); + $labels = array( __("Random","mantra"), __("Fold","mantra"), __("Fade","mantra"), __("SlideInRight","mantra"), __("SlideInLeft","mantra"), __("SliceDown","mantra"), __("SliceDownLeft","mantra"), __("SliceUp","mantra"), __("SliceUpLeft","mantra"), __("SliceUpDown","mantra"), __("SliceUpDownLeft","mantra"), __("BoxRandom","mantra"), __("BoxRain","mantra"), __("BoxRainReverse","mantra"), __("BoxRainGrow","mantra"), __("BoxRainGrowReverse","mantra")); echo ""; echo "".__("The transition effect your slider will have.","mantra")."
"; @@ -280,29 +210,28 @@ function cryout_setting_frontslider_fn() { echo "
".__("Slider navigation:","mantra")." "; - $items = array ("Numbers" , "Bullets" ,"None"); - $itemsare = array( __("Numbers","mantra"), __("Bullets","mantra"), __("None","mantra")); + $options = array ("Numbers" , "Bullets" ,"None"); + $labels = array( __("Numbers","mantra"), __("Bullets","mantra"), __("None","mantra")); echo ""; echo "".__("Your slider navigation type. Shown under the slider.","mantra")."
"; echo "
".__("Slider arrows:","mantra")." "; - $items = array ("Always Visible" , "Visible on Hover" ,"Hidden"); - $itemsare = array( __("Always Visible","mantra"), __("Visible on Hover","mantra"), __("Hidden","mantra")); + $options = array ("Always Visible" , "Visible on Hover" ,"Hidden"); + $labels = array( __("Always Visible","mantra"), __("Visible on Hover","mantra"), __("Hidden","mantra")); echo ""; echo "".__("The Left and Right arrows on your slider","mantra")."
"; - ?> - - - -".__("Select the content you want to load in your slides:","mantra")." "; echo ""; echo "
".__("Your slides' content. Only the image is required, all other fields are optional. Only the slides with an image selected will become acitve and visible in the live slider.","mantra")."
"; ?> -
- -' /> +
+ +' />
@@ -414,259 +315,253 @@ foreach($items as $id=>$item) {
- Choose the cateogry: ','mantra'); ?> - + Choose the cateogry: ','mantra'); ?> +
- ' /> - + ' /> +
- -
-

-
-
- - -
-' /> -
- -
-' /> -
-
- -
-

-
-
- - -
-' /> -
- -
-' /> -
-
- -
-

-
-
- - -
-' /> -
- -
-' /> -
-
- -
-

-
-
- - -
-' /> -
- -
-' /> -
-
- -
-

-
-
- - -
-' /> -
- -
-' /> -
-
+ +
+

+
+
+ + +
+ ' /> +
+ +
+ ' /> +
+
+ +
+

+
+
+ + +
+ ' /> +
+ +
+ ' /> +
+
+ +
+

+
+
+ + +
+ ' /> +
+ +
+ ' /> +
+
+ +
+

+
+
+ + +
+ ' /> +
+ +
+ ' /> +
+
+ +
+

+
+
+ + +
+ ' /> +
+ +
+ ' /> +
+
".__("Number of columns:","mantra")." "; - $items = array ("0" ,"1", "2" , "3" , "4"); + echo "
".__("Number of columns:","mantra")." "; + $options = array ("0" ,"1", "2" , "3" , "4"); echo "
"; -echo "
".__("Image Height:","mantra")." "; + echo "
".__("Image Height:","mantra")." "; echo " px
"; -?> -
-' /> -".__("The linked text that appears at the bottom of all the columns. You can delete all text inside if you don't want it.","mantra")."
"; - -?> -
-

-
-
- - -
-' /> -
- -
-' /> -
-
- -
-

-
-
- - -
-' /> -
- -
-' /> -
-
- -
-

-
-
- - -
Title
-' /> -
- -
-' /> -
-
- -
-

-
-
- - -
-' /> -
- -
-' /> -
-
- - +
+ ' /> + +
+
+

+
+
+ + +
+ ' /> +
+ +
+ ' /> +
+
+ +
+

+
+
+ + +
+ ' /> +
+ +
+ ' /> +
+
+ +
+

+
+
+ + +
+ ' /> +
+ +
+ ' /> +
+
+ +
+

+
+
+ + +
+ ' /> +
+ +
+ ' /> +
+
+ +

".__("Extra Text","mantra")."

"; - -echo "
Text for the Presentation Page".__("More text for your front page. The top title is above the slider, the second title between the slider and the columns and 2 more rows of text under the columns. - It's all optional so leave any input field empty if it's not required. ","mantra")."
"; - - echo "
".__("Top Title","mantra")."

"; -echo "
".__("Second Title","mantra")."
"; - echo ""; - -echo "
".__("Title color","mantra")."
"; - echo ''; - echo '
'; - -echo "
".__("Bottom Text 1","mantra")."
"; - echo ""; -echo "
".__("Bottom Text 2","mantra")."
"; - echo "
"; - - - - - - -echo "

".__("Hide areas","mantra")."

"; - -echo "
".__("Choose the areas to hide on the first page.","mantra")."
"; - - $items = array( "FronHeader", "FrontMenu", "FrontWidget" , "FrontFooter","FrontBack"); - - $checkedClass0 = ($mantra_options['mantra_fronthideheader']=='1') ? ' checkedClass0' : ''; - $checkedClass1 = ($mantra_options['mantra_fronthidemenu']=='1') ? ' checkedClass1' : ''; - $checkedClass2 = ($mantra_options['mantra_fronthidewidget']=='1') ? ' checkedClass2' : ''; - $checkedClass3 = ($mantra_options['mantra_fronthidefooter']=='1') ? ' checkedClass3' : ''; - $checkedClass4 = ($mantra_options['mantra_fronthideback']=='1') ? ' checkedClass4' : ''; - - echo " "; - - echo " "; - - echo " "; - - echo " "; - - echo " "; - - -echo "
"; - - + ?> +
+

+
+
+ + It's all optional so leave any input field empty if it's not required.","mantra") ?> +
+

+ ' /> +
+ ' /> +
+ +
+ +
+ +
+ +
+
+ +
+

+
+
+ + + + + + +
+
+
"; /////HEADER SETTINGS////////// ///////////////////////////// - //SELECT - Name: ma_options[hheight] -function cryout_setting_hheight_fn() { - global $mantra_options;?> -' /> px -".__("Select the header's height. After saving the settings make sure you reupload a new header image (if you're using one). The header's width will be = ","mantra").$totally."px."; +function cryout_setting_hheight_fn() { + global $mantra_options; ?> ' /> px + +
+
".__("The header image should not be used to display logos.
Enable ratio preservation to force the header image aspect ratio. Keep in mind that short images will become very small on mobile devices.","mantra")."
"; echo "
"; + echo " value='1' id='mantra_hcenter' name='ma_options[mantra_hcenter]' type='checkbox'/>Center horizontally"; - echo " "; - + echo " value='1' id='mantra_hratio' name='ma_options[mantra_hratio]' type='checkbox'/>Keep aspect ratio"; } -//CHECKBOX - Name: ma_options[menurounded] function cryout_setting_menurounded_fn() { global $mantra_options; - $items = array ("Enable" , "Disable"); - $itemsare = array( __("Enable","mantra"), __("Disable","mantra")); + $options = array ("Enable" , "Disable"); + $labels = array( __("Enable","mantra"), __("Disable","mantra")); echo ""; echo "
".__("Enable or disable the round corners for the main menu items.","mantra")."
"; - } -//CHECKBOX - Name: ma_options[linkheader] function cryout_setting_siteheader_fn() { global $mantra_options; - $items = array ("Site Title and Description" , "Custom Logo" , "Clickable header image" , "Empty"); - $itemsare = array( __("Site Title and Description","mantra"), __("Custom Logo","mantra"), __("Clickable header image","mantra"), __("Empty","mantra")); + $options = array ("Site Title and Description" , "Custom Logo" , "Clickable header image" , "Empty"); + $labels = array( __("Site Title and Description","mantra"), __("Custom Logo","mantra"), __("Clickable header image","mantra"), __("Empty","mantra")); echo ""; echo "
".__("Choose what to display inside your header area.","mantra")."
"; } -// TEXTBOX - Name: ma_options[favicon] function cryout_setting_logoupload_fn() { - global $mantra_options; - echo '
'; -?> - ' class="imagebox" style="display:;max-height:60px" />
- -".__("Custom Logo upload. The logo will appear over the heder image if you have used one.","mantra")."
"; ?> -
- - - +
+ ' class="imagebox" style="max-height:60px" />
+ +
+
+
+ -' /> px     -' /> px -".__("Select the top spacing for the header. Use it to better position your site title and description or custom logo inside the header. ","mantra").""; + global $mantra_options; ?> + ' /> px     + ' /> px +
+ '; -?> - ' class="imagebox" width="64" height="64"/>
- -".__("Limitations: It has to be an image. It should be max 64x64 pixels in dimensions. Recommended file extensions .ico and .png.
Note that some browsers do not display the changed favicon instantly.","mantra")."
"; ?> -
- - - +
+ ' class="imagebox" width="64" height="64"/>
+ +
Note that some browsers do not display the changed favicon instantly.","mantra") ?>
+
+
+ "; - foreach($items as $item) { - echo ""; -} + foreach($options as $item) { + echo ""; + } echo ""; echo "
".__("Select the font size you'll use in your blog. Pages, posts and comments will be affected. Buttons, Headers and Side menus will remain the same.","mantra")."
"; } - -//SELECT - Name: ma_options[fontfamily] -function cryout_setting_fontfamily_fn() { - global $mantra_options; - global $fontSans, $fontSerif, $fontMono, $fontCursive; - - echo ""; - +/** font select generator function used by the font options below + * @since mantra 3.0.3 */ +function cryout_fontselect_helper( $option_id, $include_default = false ) { + global $mantra_options; + global $mantra_fonts; + ?> + + ".__("Select the font family you'll use in your blog. All content text will be affected (including menu buttons). ","mantra")."
"; echo ''; - echo "
".__("Or insert your Google Font below. Please only isert the name of the font.
Ex: Marko One. Go to google fonts for some font inspiration.","mantra")."
"; - - + echo "
".__("Or insert your Google Font identifier.
Ex: Marko One. Go to Google fonts for some font inspiration.","mantra")."
"; } -//SELECT - Name: ma_options[fonttitle] function cryout_setting_fonttitle_fn() { global $mantra_options; - global $fontSans, $fontSerif, $fontMono, $fontCursive; - - echo ""; + cryout_fontselect_helper( 'mantra_fonttitle', true ); echo "
".__("Select the font family you want for your titles. It will affect post titles and page titles. Leave 'Default' and the general font you selected will be used.","mantra")."

"; echo ''; - echo "
".__("Or insert your Google Font below. Please only isert the name of the font.
Ex: Marko One. Go to google fonts for some font inspiration.","mantra")."
"; - - - - + echo "
".__("Or insert your Google Font identifier.
Ex: Marko One. Go to Google fonts for some font inspiration.","mantra")."
"; } -//SELECT - Name: ma_options[fontside] function cryout_setting_fontside_fn() { global $mantra_options; - global $fontSans, $fontSerif, $fontMono, $fontCursive; - - echo ""; + cryout_fontselect_helper( 'mantra_fontside', true ); echo "
".__("Select the font family you want your sidebar(s) to have. Text in sidebars will be affected, including any widgets. Leave 'Default' and the general font you selected will be used.","mantra")."

"; echo ''; - echo "
".__("Or insert your Google Font below. Please only isert the name of the font.
Ex: Marko One. Go to google fonts for some font inspiration.","mantra")."
"; - - - + echo "
".__("Or insert your Google Font identifier.
Ex: Marko One. Go to Google fonts for some font inspiration.","mantra")."
"; } - -//SELECT - Name: ma_options[fontsubheader] -function cryout_setting_fontsubheader_fn() { +function cryout_setting_fontsubheader_fn() { global $mantra_options; - global $fontSans, $fontSerif, $fontMono, $fontCursive; - - echo ""; + + cryout_fontselect_helper( 'mantra_fontsubheader', true ); echo "
".__("Select the font family you want your headings to have (h1 - h6 tags will be affected). Leave 'Default' and the general font you selected will be used.","mantra")."

"; - echo ''; - echo "
".__("Or insert your Google Font below. Please only isert the name of the font.
Ex: Marko One. Go to google fonts for some font inspiration.","mantra")."
"; - - + echo "
".__("Or insert your Google Font identifier.
Ex: Marko One. Go to Google fonts for some font inspiration.","mantra")."
"; } -//SELECT - Name: ma_options[headfontsize] -function cryout_setting_headfontsize_fn() { +function cryout_setting_headfontsize_fn() { global $mantra_options; - $items = array ("Default" , "14px" , "16px" , "18px" , "20px", "22px" , "24px" , "26px" , "28px" , "30px" , "32px" , "34px" , "36px", "38px" , "40px"); - $itemsare = array( __("Default","mantra") ,"14px" , "16px" , "18px" , "20px", "22px" , "24px" , "26px" , "28px" , "30px" , "32px" , "34px" , "36px", "38px" , "40px"); + $options = array ("Default" , "14px" , "16px" , "18px" , "20px", "22px" , "24px" , "26px" , "28px" , "30px" , "32px" , "34px" , "36px", "38px" , "40px"); + $labels = array( __("Default","mantra") ,"14px" , "16px" , "18px" , "20px", "22px" , "24px" , "26px" , "28px" , "30px" , "32px" , "34px" , "36px", "38px" , "40px"); echo ""; echo "
".__("Post Header Font size. Leave 'Default' for normal settings (size value will be as set in the CSS).","mantra")."
"; } -//SELECT - Name: ma_options[sidefontsize] function cryout_setting_sidefontsize_fn() { global $mantra_options; - $items = array ("Default" , "8px" , "9px" , "10px" , "11px", "12px" , "13px" , "14px" , "15px" , "16px" , "17px" , "18px"); - $itemsare = array( __("Default","mantra") , "8px" , "9px" , "10px" , "11px", "12px" , "13px" , "14px" , "15px" , "16px" , "17px" , "18px"); + $options = array ("Default" , "8px" , "9px" , "10px" , "11px", "12px" , "13px" , "14px" , "15px" , "16px" , "17px" , "18px"); + $labels = array( __("Default","mantra") , "8px" , "9px" , "10px" , "11px", "12px" , "13px" , "14px" , "15px" , "16px" , "17px" , "18px"); echo ""; echo "
".__("Sidebar Font size. Leave 'Default' for normal settings (size value will be as set in the CSS).","mantra")."
"; } -//SELECT - Name: ma_options[textalign] function cryout_setting_textalign_fn() { global $mantra_options; - $items = array ("Default" , "Left" , "Right" , "Justify" , "Center"); - $itemsare = array( __("Default","mantra"), __("Left","mantra"), __("Right","mantra"), __("Justify","mantra"), __("Center","mantra")); + $options = array ("Default" , "Left" , "Right" , "Justify" , "Center"); + $labels = array( __("Default","mantra"), __("Left","mantra"), __("Right","mantra"), __("Justify","mantra"), __("Center","mantra")); echo ""; echo "
".__("This overwrites the text alignment in posts and pages. Leave 'Default' for normal settings (alignment will remain as declared in posts, comments etc.).","mantra")."
"; } -//SELECT - Name: ma_options[parindent] function cryout_setting_parmargin_fn() { global $mantra_options; - $items = array ("0.0em", "0.5em", "1.0em" , "1.1em" , "1.2em" , "1.3em" , "1.4em", "1.5em", "1.6em", "1.7em"); + $options = array ("0.0em", "0.5em", "1.0em" , "1.1em" , "1.2em" , "1.3em" , "1.4em", "1.5em", "1.6em", "1.7em"); echo ""; echo "
".__("Choose the spacing between paragraphs.","mantra")."
"; } - -//SELECT - Name: ma_options[parindent] function cryout_setting_parindent_fn() { global $mantra_options; - $items = array ("0px" , "5px" , "10px" , "15px" , "20px"); + $options = array ("0px" , "5px" , "10px" , "15px" , "20px"); echo ""; echo "
".__("Choose the indent for your paragraphs.","mantra")."
"; } - -//CHECKBOX - Name: ma_options[headerindent] function cryout_setting_headerindent_fn() { global $mantra_options; - $items = array ("Enable" , "Disable"); - $itemsare = array( __("Enable","mantra"), __("Disable","mantra")); + $options = array ("Enable" , "Disable"); + $labels = array( __("Enable","mantra"), __("Disable","mantra")); echo ""; echo "
".__("Disable the default header and title indent (left margin).","mantra")."
"; } -//SELECT - Name: ma_options[lineheight] function cryout_setting_lineheight_fn() { global $mantra_options; - $items = array ("Default" ,"0.8em" , "0.9em", "1.0em" , "1.1em" , "1.2em" , "1.3em", "1.4em" , "1.5em" , "1.6em" , "1.7em" , "1.8em" , "1.9em" , "2.0em"); - $itemsare = array( __("Default","mantra"),"0.8em" , "0.9em", "1.0em" , "1.1em" , "1.2em" , "1.3em", "1.4em" , "1.5em" , "1.6em" , "1.7em" , "1.8em" , "1.9em" , "2.0em"); + $options = array ("Default" ,"0.8em" , "0.9em", "1.0em" , "1.1em" , "1.2em" , "1.3em", "1.4em" , "1.5em" , "1.6em" , "1.7em" , "1.8em" , "1.9em" , "2.0em"); + $labels = array( __("Default","mantra"),"0.8em" , "0.9em", "1.0em" , "1.1em" , "1.2em" , "1.3em", "1.4em" , "1.5em" , "1.6em" , "1.7em" , "1.8em" , "1.9em" , "2.0em"); echo ""; echo "
".__("Text line height. The height between 2 rows of text. Leave 'Default' for normal settings (size value will be as set in the CSS).","mantra")."
"; } -//SELECT - Name: ma_options[wordspace] -function cryout_setting_wordspace_fn() { +function cryout_setting_wordspace_fn() { global $mantra_options; - $items = array ("Default" ,"-3px" , "-2px", "-1px" , "0px" , "1px" , "2px", "3px" , "4px" , "5px" , "10px"); - $itemsare = array( __("Default","mantra"),"-3px" , "-2px", "-1px" , "0px" , "1px" , "2px", "3px" , "4px" , "5px" , "10px"); + $options = array ("Default" ,"-3px" , "-2px", "-1px" , "0px" , "1px" , "2px", "3px" , "4px" , "5px" , "10px"); + $labels = array( __("Default","mantra"),"-3px" , "-2px", "-1px" , "0px" , "1px" , "2px", "3px" , "4px" , "5px" , "10px"); echo ""; echo "
".__("The space between words. Leave 'Default' for normal settings (size value will be as set in the CSS).","mantra")."
"; } -//SELECT - Name: ma_options[letterspace] -function cryout_setting_letterspace_fn() { +function cryout_setting_letterspace_fn() { global $mantra_options; - $items = array ("Default" ,"-0.05em" , "-0.04em", "-0.03em" , "-0.02em" , "-0.01em" , "0.01em", "0.02em" , "0.03em" , "0.04em" , "0.05em"); - $itemsare = array( __("Default","mantra"),"-0.05em" , "-0.04em", "-0.03em" , "-0.02em" , "-0.01em" , "0.01em", "0.02em" , "0.03em" , "0.04em" , "0.05em"); + $options = array ("Default" ,"-0.05em" , "-0.04em", "-0.03em" , "-0.02em" , "-0.01em" , "0.01em", "0.02em" , "0.03em" , "0.04em" , "0.05em"); + $labels = array( __("Default","mantra"),"-0.05em" , "-0.04em", "-0.03em" , "-0.02em" , "-0.01em" , "0.01em", "0.02em" , "0.03em" , "0.04em" , "0.05em"); echo ""; echo "
".__("The space between letters. Leave 'Default' for normal settings (size value will be as set in the CSS).","mantra")."
"; } - -//CHECKBOX - Name: ma_options[textshadow] -function cryout_setting_textshadow_fn() { - global $mantra_options; - $items = array ("Enable" , "Disable"); - $itemsare = array( __("Enable","mantra"), __("Disable","mantra")); - echo ""; - echo "
".__("Disable the default text shadow on headers and titles.","mantra")."
"; -} - //////////////////////////////// -//// APPEREANCE SETTINGS /////// +//// APPEARANCE SETTINGS /////// //////////////////////////////// function cryout_setting_sitebackground_fn() { - echo "".__('Define background image','mantra').""; + echo "".__('Define background image','mantra').""; } // cryout_setting_sitebackground_fn() - -//TEXT - Name: ma_options[backcolor] -function cryout_setting_backcolor_fn() { +function cryout_setting_backcolor_fn() { global $mantra_options; echo ''; echo '
'; echo "
".__("Background color (Default value is 444444).","mantra")."
"; } -//TEXT - Name: ma_options[headercolor] -function cryout_setting_headercolor_fn() { +function cryout_setting_headercolor_fn() { global $mantra_options; echo ''; echo '
'; echo "
".__("Header background color (Default value is 333333). You can delete all inside text for no background color.","mantra")."
"; } -function cryout_setting_contentbg_fn() { +function cryout_setting_contentbg_fn() { global $mantra_options; echo ''; echo '
'; echo "
".__("Content background color (Default value is FFFFFF). Works best with really light colors.","mantra")."
"; } -function cryout_setting_menubg_fn() { +function cryout_setting_menubg_fn() { global $mantra_options; echo ''; echo '
'; echo "
".__("Main menu background color (Default value is FAFAFA). Should be the same color as the content bg or something just as light.","mantra")."
"; } -function cryout_setting_first_sidebar_fn() { +function cryout_setting_first_sidebar_fn() { global $mantra_options; echo ''; echo '
'; echo "
".__("First sidebar background color (Default is no color for a transparent sidebar).","mantra")."
"; } -function cryout_setting_second_sidebar_fn() { +function cryout_setting_second_sidebar_fn() { global $mantra_options; echo ''; echo '
'; echo "
".__("Second sidebar background color (Default is no color for a transparent sidebar).","mantra")."
"; } -//TEXT - Name: ma_options[prefootercolor] -function cryout_setting_prefootercolor_fn() { +function cryout_setting_prefootercolor_fn() { global $mantra_options; echo ''; echo '
'; echo "
".__("Footer widget-area background color. (Default value is 171717).","mantra")."
"; } -//TEXT - Name: ma_options[footercolor] -function cryout_setting_footercolor_fn() { +function cryout_setting_footercolor_fn() { global $mantra_options; echo ''; echo '
'; echo "
".__("Footer background color (Default value is 222222).","mantra")."
"; } -//TEXT - Name: ma_options[titlecolor] -function cryout_setting_titlecolor_fn() { +function cryout_setting_titlecolor_fn() { global $mantra_options; echo ''; echo '
'; echo "
".__("Your blog's title color (Default value is 0D85CC).","mantra")."
"; } -//TEXT - Name: ma_options[descriptioncolor] -function cryout_setting_descriptioncolor_fn() { +function cryout_setting_descriptioncolor_fn() { global $mantra_options; echo ''; echo '
'; echo "
".__("Your blog's description color(Default value is 222222).","mantra")."
"; } -//TEXT - Name: ma_options[contentcolor] -function cryout_setting_contentcolor_fn() { +function cryout_setting_contentcolor_fn() { global $mantra_options; echo ''; echo '
'; echo "
".__("Content Text Color (Default value is 333333).","mantra")."
"; } -//TEXT - Name: ma_options[linkscolor] -function cryout_setting_linkscolor_fn() { +function cryout_setting_linkscolor_fn() { global $mantra_options; echo ''; echo '
'; echo "
".__("Links color (Default value is 0D85CC).","mantra")."
"; } -//TEXT - Name: ma_options[hovercolor] -function cryout_setting_hovercolor_fn() { +function cryout_setting_hovercolor_fn() { global $mantra_options; echo ''; echo '
'; echo "
".__("Links color on mouse over (Default value is 333333).","mantra")."
"; } -//TEXT - Name: ma_options[headtextcolor] -function cryout_setting_headtextcolor_fn() { +function cryout_setting_headtextcolor_fn() { global $mantra_options; echo ''; echo '
'; echo "
".__("Post Header Text Color (Default value is 333333).","mantra")."
"; } -//TEXT - Name: ma_options[headtexthover] -function cryout_setting_headtexthover_fn() { +function cryout_setting_headtexthover_fn() { global $mantra_options; echo ''; echo '
'; echo "
".__("Post Header Text Color on Mouse over (Default value is 000000).","mantra")."
"; } -//TEXT - Name: ma_options[sideheadbackcolor] function cryout_setting_sideheadbackcolor_fn() { global $mantra_options; echo ''; @@ -1274,32 +988,28 @@ function cryout_setting_sideheadbackcolor_fn() { } -//TEXT - Name: ma_options[sideheadtextcolor] -function cryout_setting_sideheadtextcolor_fn() { +function cryout_setting_sideheadtextcolor_fn() { global $mantra_options; echo ''; echo '
'; echo "
".__("Sidebar Header Text Color(Default value is 2EA5FD).","mantra")."
"; } -//TEXT - Name: ma_options[footerheader] -function cryout_setting_footerheader_fn() { +function cryout_setting_footerheader_fn() { global $mantra_options; echo ''; echo '
'; echo "
".__("Footer Widget Text Color (Default value is 0D85CC).","mantra")."
"; } -//TEXT - Name: ma_options[footertext] -function cryout_setting_footertext_fn() { +function cryout_setting_footertext_fn() { global $mantra_options; echo ''; echo '
'; echo "
".__("Footer Widget Link Color (Default value is 666666).","mantra")."
"; } -//TEXT - Name: ma_options[footerhover] -function cryout_setting_footerhover_fn() { +function cryout_setting_footerhover_fn() { global $mantra_options; echo ''; echo '
'; @@ -1311,267 +1021,244 @@ function cryout_setting_footerhover_fn() { //// GRAPHICS SETTINGS ///////// //////////////////////////////// - - -//CHECKBOX - Name: ma_options[breadcrumbs] function cryout_setting_breadcrumbs_fn() { global $mantra_options; - $items = array ("Enable" , "Disable"); - $itemsare = array( __("Enable","mantra"), __("Disable","mantra")); - echo ""; + foreach($options as $id=>$item) { + echo ""; + } echo ""; echo "
".__("Show breadcrumbs at the top of the content area. Breadcrumbs are a form of navigation that keeps track of your location withtin the site.","mantra")."
"; } -//CHECKBOX - Name: ma_options[pagination] function cryout_setting_pagination_fn() { global $mantra_options; - $items = array ("Enable" , "Disable"); - $itemsare = array( __("Enable","mantra"), __("Disable","mantra")); + $options = array ("Enable" , "Disable"); + $labels = array( __("Enable","mantra"), __("Disable","mantra")); echo ""; echo "
".__("Show numbered pagination. Where there is more than one page, instead of the bottom Older Posts and Newer posts links you have a numbered pagination. ","mantra")."
"; } function cryout_setting_menualign_fn() { global $mantra_options; - $items = array ("left", "center", "right"); - $itemsare = array( __("Left","mantra"), __("Center","mantra"), __("Right","mantra")); + $options = array ("left", "center", "right"); + $labels = array( __("Left","mantra"), __("Center","mantra"), __("Right","mantra")); echo ""; echo "
".__("Select the desired main menu items alignment. Center option is only valid for single line menus.","mantra")."
"; } -//SELECT - Name: ma_options[caption] function cryout_setting_caption_fn() { -global $mantra_options; - $items = array ("White" , "Light" , "Light Gray" , "Gray" , "Dark Gray" , "Black"); - $itemsare = array( __("White","mantra"), __("Light","mantra"), __("Light Gray","mantra"), __("Gray","mantra"), __("Dark Gray","mantra"), __("Black","mantra")); + global $mantra_options; + $options = array ("White" , "Light" , "Light Gray" , "Gray" , "Dark Gray" , "Black"); + $labels = array( __("White","mantra"), __("Light","mantra"), __("Light Gray","mantra"), __("Gray","mantra"), __("Dark Gray","mantra"), __("Black","mantra")); echo ""; echo "
".__("This setting changes the look of your captions. Images that are not inserted through captions will not be affected.","mantra")."
"; } -// RADIO-BUTTON - Name: ma_options[image] function cryout_setting_image_fn() { global $mantra_options; - $items = array("None", "One", "Two", "Three" , "Four", "Five", "Six", "Seven"); - foreach($items as $item) { - + $options = array("None", "One", "Two", "Three" , "Four", "Five", "Six", "Seven"); + foreach($options as $item) { $checkedClass = ($mantra_options['mantra_image']==$item) ? ' checkedClass' : ''; - echo " "; + checked($mantra_options['mantra_image'],$item); + echo " value='$item' id='$item$item' onClick=\"changeBorder('$item','images');\" name='ma_options[mantra_image]' type='radio' />"; } - - echo "
".__("The border around your inserted images. ","mantra")."
"; + echo "
".__("The border around your inserted images. ","mantra")."
"; } -// RADIO-BUTTON - Name: ma_options[pin] function cryout_setting_pin_fn() { global $mantra_options; - $items = array("mantra_dot", "Pin1", "Pin2", "Pin3" , "Pin4", "Pin5"); - foreach($items as $item) { + $options = array("mantra_dot", "Pin1", "Pin2", "Pin3" , "Pin4", "Pin5"); + foreach($options as $item) { $none=''; if ($item == 'mantra_dot') { $none='None'; } $checkedClass = ($mantra_options['mantra_pin']==$item) ? ' checkedClass' : ''; echo ""; + echo " value='$item' onClick=\"changeBorder('$item','pins');\" name='ma_options[mantra_pin]' type='radio' />$none"; } - echo "
".__("The image on top of your captions. ","mantra")."
"; + echo "
".__("The image on top of your captions. ","mantra")."
"; } -// RADIO-BUTTON - Name: ma_options[sidebullet] function cryout_setting_sidebullet_fn() { global $mantra_options; - $items = array("mantra_dot2", "arrow_black", "arrow_white", "bullet_dark" , "bullet_gray", "bullet_light", "square_dark", "square_white", "triangle_dark" , "triangle_gray", "triangle_white"); - foreach($items as $item) { + $options = array("mantra_dot2", "arrow_black", "arrow_white", "bullet_dark" , "bullet_gray", "bullet_light", "square_dark", "square_white", "triangle_dark" , "triangle_gray", "triangle_white"); + foreach($options as $item) { $none=''; if ($item == 'mantra_dot2') { $none='None'; } $checkedClass = ($mantra_options['mantra_sidebullet']==$item) ? ' checkedClass' : ''; echo ""; + echo " value='$item' onClick=\"changeBorder('$item','sidebullets');\" name='ma_options[mantra_sidebullet]' type='radio' />$none"; } echo "
".__("The sidebar list bullets. ","mantra")."
"; } -//CHECKBOX - Name: ma_options[metaback] function cryout_setting_metaback_fn() { global $mantra_options; - $items = array ("Gray" , "White", "None"); - $itemsare = array( __("Gray","mantra"), __("White","mantra"), __("None","mantra")); + $options = array ("Gray" , "White", "None"); + $labels = array( __("Gray","mantra"), __("White","mantra"), __("None","mantra")); echo ""; echo "
".__("The background for your post-metas area (under your post tiltes). Gray by default.","mantra")."
"; } -//CHECKBOX - Name: ma_options[postseparator] function cryout_setting_postseparator_fn() { global $mantra_options; - $items = array ("Show" , "Hide"); - $itemsare = array( __("Show","mantra"), __("Hide","mantra")); + $options = array ("Show" , "Hide"); + $labels = array( __("Show","mantra"), __("Hide","mantra")); echo ""; echo "
".__("Hide or show a horizontal rule to separate posts.","mantra")."
"; } -//CHECKBOX - Name: ma_options[contentlist] function cryout_setting_contentlist_fn() { global $mantra_options; - $items = array ("Show" , "Hide"); - $itemsare = array( __("Show","mantra"), __("Hide","mantra")); + $options = array ("Show" , "Hide"); + $labels = array( __("Show","mantra"), __("Hide","mantra")); echo ""; echo "
".__("Hide or show bullets next to lists that are in your content area (posts, pages etc.).","mantra")."
"; } - -//CHECKBOX - Name: ma_options[pagetitle] function cryout_setting_pagetitle_fn() { global $mantra_options; - $items = array ("Show" , "Hide"); - $itemsare = array( __("Show","mantra"), __("Hide","mantra")); + $options = array ("Show" , "Hide"); + $labels = array( __("Show","mantra"), __("Hide","mantra")); echo ""; echo "
".__("Hide or show Page titles on any created pages. ","mantra")."
"; } -//CHECKBOX - Name: ma_options[categtitle] function cryout_setting_categtitle_fn() { global $mantra_options; - $items = array ("Show" , "Hide"); - $itemsare = array( __("Show","mantra"), __("Hide","mantra")); + $options = array ("Show" , "Hide"); + $labels = array( __("Show","mantra"), __("Hide","mantra")); echo ""; echo "
".__("Hide or show Page titles on Category Pages. ","mantra")."
"; } -//CHECKBOX - Name: ma_options[tables] function cryout_setting_tables_fn() { global $mantra_options; - $items = array ("Enable" , "Disable"); - $itemsare = array( __("Enable","mantra"), __("Disable","mantra")); + $options = array ("Enable" , "Disable"); + $labels = array( __("Enable","mantra"), __("Disable","mantra")); echo ""; echo "
".__("Hide table borders and background color.","mantra")."
"; } -//CHECKBOX - Name: ma_options[comtext] function cryout_setting_comtext_fn() { global $mantra_options; - $items = array ("Show" , "Hide"); - $itemsare = array( __("Show","mantra"), __("Hide","mantra")); + $options = array ("Show" , "Hide"); + $labels = array( __("Show","mantra"), __("Hide","mantra")); echo ""; echo "
".__("Hide the explanatory text under the comments form. (starts with You may use these HTML tags and attributes:...).","mantra")."
"; } -//CHECKBOX - Name: ma_options[comclosed] function cryout_setting_comclosed_fn() { global $mantra_options; - $items = array ("Show" , "Hide in posts", "Hide in pages", "Hide everywhere"); - $itemsare = array( __("Show","mantra"), __("Hide in posts","mantra"), __("Hide in pages","mantra"), __("Hide everywhere","mantra")); + $options = array ("Show" , "Hide in posts", "Hide in pages", "Hide everywhere"); + $labels = array( __("Show","mantra"), __("Hide in posts","mantra"), __("Hide in pages","mantra"), __("Hide everywhere","mantra")); echo ""; echo "
".__("Hide the Comments are closed text that by default shows up on pages or posts with the comments disabled.","mantra")."
"; } -//CHECKBOX - Name: ma_options[comoff] function cryout_setting_comoff_fn() { global $mantra_options; - $items = array ("Show" , "Hide"); - $itemsare = array( __("Show","mantra"), __("Hide","mantra")); + $options = array ("Show" , "Hide"); + $labels = array( __("Show","mantra"), __("Hide","mantra")); echo ""; echo "
".__("Hide the Comments off text next to posts that have comments disabled.","mantra")."
"; } - -//CHECKBOX - Name: ma_options[backtop] function cryout_setting_backtop_fn() { global $mantra_options; - $items = array ("Enable" , "Disable"); - $itemsare = array( __("Enable","mantra"), __("Disable","mantra")); + $options = array ("Enable" , "Disable"); + $labels = array( __("Enable","mantra"), __("Disable","mantra")); echo ""; echo "
".__("Enable the Back to Top button. The button appears after scrolling the page down.","mantra")."
"; } @@ -1581,122 +1268,114 @@ foreach($items as $id=>$item) { //// POST SETTINGS ///////////// //////////////////////////////// -//CHECKBOX - Name: ma_options[postdate] function cryout_setting_postcomlink_fn() { global $mantra_options; - $items = array ("Show" , "Hide"); - $itemsare = array( __("Show","mantra"), __("Hide","mantra")); + $options = array ("Show" , "Hide"); + $labels = array( __("Show","mantra"), __("Hide","mantra")); echo ""; echo "
".__("Hide or show the Leave a comment or x Comments next to posts or post excerpts.","mantra")."
"; } -//CHECKBOX - Name: ma_options[postdate] function cryout_setting_postdate_fn() { global $mantra_options; - $items = array ("Show" , "Hide"); - $itemsare = array( __("Show","mantra"), __("Hide","mantra")); + $options = array ("Show" , "Hide"); + $labels = array( __("Show","mantra"), __("Hide","mantra")); echo ""; echo "
".__("Hide or show the post date.","mantra")."
"; } -//CHECKBOX - Name: ma_options[posttime] function cryout_setting_posttime_fn() { global $mantra_options; - $items = array ("Show" , "Hide"); - $itemsare = array( __("Show","mantra"), __("Hide","mantra")); + $options = array ("Show" , "Hide"); + $labels = array( __("Show","mantra"), __("Hide","mantra")); echo ""; echo "
".__("Show the post time with the date. Time will not be visible if the Post Date is hidden.","mantra")."
"; } -//CHECKBOX - Name: ma_options[postauthor] function cryout_setting_postauthor_fn() { global $mantra_options; - $items = array ("Show" , "Hide"); - $itemsare = array( __("Show","mantra"), __("Hide","mantra")); + $options = array ("Show" , "Hide"); + $labels = array( __("Show","mantra"), __("Hide","mantra")); echo ""; echo "
".__("Hide or show the post author.","mantra")."
"; } -//CHECKBOX - Name: ma_options[postcateg] function cryout_setting_postcateg_fn() { global $mantra_options; - $items = array ("Show" , "Hide"); - $itemsare = array( __("Show","mantra"), __("Hide","mantra")); + $options = array ("Show" , "Hide"); + $labels = array( __("Show","mantra"), __("Hide","mantra")); echo ""; echo "
".__("Hide the post category.","mantra")."
"; } -//CHECKBOX - Name: ma_options[postbook] function cryout_setting_postbook_fn() { global $mantra_options; - $items = array ("Show" , "Hide"); - $itemsare = array( __("Show","mantra"), __("Hide","mantra")); + $options = array ("Show" , "Hide"); + $labels = array( __("Show","mantra"), __("Hide","mantra")); echo ""; echo "
".__("Hide the 'Bookmark permalink'.","mantra")."
"; } -//CHECKBOX - Name: ma_options[postmetas] function cryout_setting_postmetas_fn() { global $mantra_options; - $items = array ("Show" , "Hide"); - $itemsare = array( __("Show","mantra"), __("Hide","mantra")); + $options = array ("Show" , "Hide"); + $labels = array( __("Show","mantra"), __("Hide","mantra")); echo ""; echo "
".__("Hide the meta bar. All meta info in it will be hidden.","mantra")."
"; } -//CHECKBOX - Name: ma_options[posttag] function cryout_setting_posttag_fn() { global $mantra_options; - $items = array ("Show" , "Hide"); - $itemsare = array( __("Show","mantra"), __("Hide","mantra")); + $options = array ("Show" , "Hide"); + $labels = array( __("Show","mantra"), __("Hide","mantra")); echo ""; echo "
".__("Hide the post tags.","mantra")."
"; } @@ -1706,55 +1385,48 @@ foreach($items as $id=>$item) { //// EXCERPT SETTINGS ///////////// //////////////////////////////// - -//CHECKBOX - Name: ma_options[excerpthome] function cryout_setting_excerpthome_fn() { global $mantra_options; - $items = array ("Excerpt" , "Full Post"); - $itemsare = array( __("Excerpt","mantra"), __("Full Post","mantra")); + $options = array ("Excerpt" , "Full Post"); + $labels = array( __("Excerpt","mantra"), __("Full Post","mantra")); echo ""; echo "
".__("Excerpts on the main page. Only standard posts will be affected. All other post formats (aside, image, chat, quote etc.) have their specific formating.","mantra")."
"; } -//CHECKBOX - Name: ma_options[excerptsticky] function cryout_setting_excerptsticky_fn() { global $mantra_options; - $items = array ("Excerpt" , "Full Post"); - $itemsare = array( __("Excerpt","mantra"), __("Full Post","mantra")); + $options = array ("Excerpt" , "Full Post"); + $labels = array( __("Excerpt","mantra"), __("Full Post","mantra")); echo ""; echo "
".__("Choose if you want the sticky posts on your home page to be visible in full or just the excerpts. ","mantra")."
"; } - -//CHECKBOX - Name: ma_options[excerptarchive] function cryout_setting_excerptarchive_fn() { global $mantra_options; - $items = array ("Excerpt" , "Full Post"); - $itemsare = array( __("Excerpt","mantra"), __("Full Post","mantra")); + $options = array ("Excerpt" , "Full Post"); + $labels = array( __("Excerpt","mantra"), __("Full Post","mantra")); echo ""; echo "
".__("Excerpts on archive, categroy and search pages. Same as above, only standard posts will be affected.","mantra")."
"; } - -// TEXTBOX - Name: ma_options[excerptwords] function cryout_setting_excerptwords_fn() { global $mantra_options; echo ""; @@ -1762,46 +1434,42 @@ function cryout_setting_excerptwords_fn() { will take the reader to the full post page.","mantra").""; } -//CHECKBOX - Name: ma_options[magazinelayout] function cryout_setting_magazinelayout_fn() { global $mantra_options; - $items = array ("Enable" , "Disable"); - $itemsare = array( __("Enable","mantra"), __("Disable","mantra")); + $options = array ("Enable" , "Disable"); + $labels = array( __("Enable","mantra"), __("Disable","mantra")); echo ""; echo "
".__("Enable the Magazine Layout. This layout applies to pages with posts and shows 2 posts per row.","mantra")."
"; } -// TEXTBOX - Name: ma_options[excerptdots] function cryout_setting_excerptdots_fn() { global $mantra_options; echo ""; echo "
".__("Replaces the three dots ('[...])' that are appended automatically to excerpts.","mantra")."
"; } -// TEXTBOX - Name: ma_options[excerptcont] function cryout_setting_excerptcont_fn() { global $mantra_options; echo ""; echo "
".__("Edit the 'Continue Reading' link added to your post excerpts.","mantra")."
"; } -//CHECKBOX - Name: ma_options[excerpttags] function cryout_setting_excerpttags_fn() { global $mantra_options; - $items = array ("Enable" , "Disable"); - $itemsare = array( __("Enable","mantra"), __("Disable","mantra")); + $options = array ("Enable" , "Disable"); + $labels = array( __("Enable","mantra"), __("Disable","mantra")); echo ""; echo "
".sprintf(__("By default WordPress excerpts remove all HTML tags (%s and all others) and only clean text is left in the excerpt. Enabling this option allows HTML tags to remain in excerpts so all your default formating will be kept.
Just a warning: If HTML tags are enabled, you have to make sure @@ -1813,90 +1481,76 @@ they are not left open. So if within your post you have an opened HTML tag but t /// FEATURED IMAGE SETTINGS //// //////////////////////////////// - -//CHECKBOX - Name: ma_options[fpost] function cryout_setting_fpost_fn() { global $mantra_options; - $items = array ("Enable" , "Disable"); - $itemsare = array( __("Enable","mantra"), __("Disable","mantra")); + $options = array ("Enable" , "Disable"); + $labels = array( __("Enable","mantra"), __("Disable","mantra")); echo ""; $checkedClass = ($mantra_options['mantra_fpostlink']=='1') ? ' checkedClass' : ''; - - - echo " "; - - + echo " value='1' id='$options[0]$options[0]' name='ma_options[mantra_fpostlink]' type='checkbox' /> Link the thumbail to the post "; + echo "
".__("Show featured images as thumbnails on posts. The images must be selected for each post in the Featured Image section.","mantra")."
"; } -//CHECKBOX - Name: ma_options[fauto] function cryout_setting_fauto_fn() { global $mantra_options; - $items = array ("Enable" , "Disable"); - $itemsare = array( __("Enable","mantra"), __("Disable","mantra")); + $options = array ("Enable" , "Disable"); + $labels = array( __("Enable","mantra"), __("Disable","mantra")); echo ""; echo "
".__("Show the first image that you inserted in a post as a thumbnail. If you enable this option, the first image in your post will be used even if you selected a Featured Image in you post.","mantra")."
"; } - -//CHECKBOX - Name: ma_options[falign] function cryout_setting_falign_fn() { global $mantra_options; - $items = array ("Left" , "Center", "Right"); - $itemsare = array( __("Left","mantra"), __("Center","mantra"), __("Right","mantra")); + $options = array ("Left" , "Center", "Right"); + $labels = array( __("Left","mantra"), __("Center","mantra"), __("Right","mantra")); echo ""; echo "
".__("Thumbnail alignment.","mantra")."
"; } - -// TEXTBOX - Name: ma_options[fwidth] function cryout_setting_fsize_fn() { global $mantra_options; echo "px (width) X "; echo "px (height)"; - + $checkedClass = ($mantra_options['mantra_fcrop']=='1') ? ' checkedClass' : ''; - - echo " "; - - + echo "
".__("The size you want the thumbnails to have (in pixels). By default imges will be scaled with aspect ratio kept. Choose to crop the images if you want the exact size.","mantra")."
"; } - -//CHECKBOX - Name: ma_options[fheader] function cryout_setting_fheader_fn() { global $mantra_options; - $items = array ("Enable" , "Disable"); - $itemsare = array( __("Enable","mantra"), __("Disable","mantra")); + $options = array ("Enable" , "Disable"); + $labels = array( __("Enable","mantra"), __("Disable","mantra")); echo ""; echo "
".__("Show featured images on headers. The header will be replaced with a featured image if you selected it as a Featured Image in the post and and if it is bigger or at least equal to the current header size.","mantra")."
"; @@ -1907,23 +1561,22 @@ foreach($items as $id=>$item) { /// SOCIAL SETTINGS //// //////////////////////// -// TEXTBOX - Name: ma_options[social1] - - - function cryout_setting_social_master($i) { + global $mantra_options; + global $mantra_socials; + $cryout_special_keys = array('Mail', 'Skype'); $cryout_social_small = array ( - '',__('Select your desired Social network from the left dropdown menu and insert your corresponding address in the right input field. (ex: http://www.facebook.com/yourname )','mantra'), - '',__("You can insert up to 5 different social sites and addresses.",'mantra'), - '',__("There are a total of 27 social networks to choose from. ",'mantra'), - '',__("You can leave any number of inputs empty. " ,'mantra'), - '',__("You can choose the same social media any number of times. ",'mantra') + '', __('Select your desired Social network from the left dropdown menu and insert your corresponding address in the right input field. (ex: http://www.facebook.com/yourname )','mantra'), + '', __("You can insert up to 5 different social sites and addresses.",'mantra'), + '', __("There are a total of 27 social networks to choose from. ",'mantra'), + '', __("You can leave any number of inputs empty. " ,'mantra'), + '', __("You can choose the same social media any number of times. ",'mantra') ); $j=$i+1; - global $mantra_options, $socialNetworks; echo " Top right corner of header "; + global $mantra_options; + $options = array( "Header", "CLeft", "CRight" , "Footer"); - echo " "; + $checkedClass0 = ($mantra_options['mantra_socialsdisplay0']=='1') ? ' checkedClass0' : ''; + $checkedClass1 = ($mantra_options['mantra_socialsdisplay1']=='1') ? ' checkedClass1' : ''; + $checkedClass2 = ($mantra_options['mantra_socialsdisplay2']=='1') ? ' checkedClass2' : ''; + $checkedClass3 = ($mantra_options['mantra_socialsdisplay3']=='1') ? ' checkedClass3' : ''; - echo " "; + echo " "; - echo " "; + echo " "; + echo " "; + echo " "; - echo "

".__("Choose the areas where to display the social icons.","mantra")."

"; + echo "

".__("Choose the areas where to display the social icons.","mantra")."

"; } @@ -2001,26 +1646,22 @@ global $mantra_options; /// MISC SETTINGS //// //////////////////////// - -// TEXTBOX - Name: ma_options[copyright] function cryout_setting_copyright_fn() { global $mantra_options; echo ""; echo "
".__("Insert custom text or HTML code that will appear last in you footer.
You can use HTML to insert links, images and special characters like © .","mantra")."
"; } - -// TEXTBOX - Name: ma_options[customcss] function cryout_setting_customcss_fn() { global $mantra_options; echo ""; echo "
".__("Insert your custom CSS here. Any CSS declarations made here will overwrite Mantra's (even the custom options specified right here in the Mantra Settings page).
Your custom CSS will be preserved when updating the theme.
The <style> tags are not needed.","mantra")."
"; } -// TEXTBOX - Name: ma_options[customjs] function cryout_setting_customjs_fn() { global $mantra_options; echo ""; echo "
".__("Insert your custom Javascript code here. (Google Analytics and any other forms of Analytic software).
The <script> tags are not needed.","mantra")."
"; } -?> \ No newline at end of file + +// FIN \ No newline at end of file diff --git a/themes/mantra/archive.php b/themes/mantra/archive.php index bc644e7c..ade04b3c 100644 --- a/themes/mantra/archive.php +++ b/themes/mantra/archive.php @@ -16,9 +16,9 @@ get_header(); ?>
- + - +
- - \ No newline at end of file + post_parent ) ) : ?> -

« %s', get_the_title( $post->post_parent ) ); ?>

@@ -29,7 +29,7 @@ get_header(); ?> printf(''.__('By','mantra').' %2$s', 'meta-prep meta-prep-author', sprintf( '%3$s', - get_author_posts_url( get_the_author_meta( 'ID' ) ), + esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), sprintf( esc_attr__( 'View all posts by %s', 'mantra' ), get_the_author() ), get_the_author() ) @@ -49,7 +49,7 @@ get_header(); ?> $metadata = wp_get_attachment_metadata(); printf( __( 'Full size is %s pixels', 'mantra'), sprintf( '%3$s × %4$s', - wp_get_attachment_url(), + esc_url( wp_get_attachment_url() ), esc_attr( __('Link to full-size image', 'mantra') ), $metadata['width'], $metadata['height'] @@ -82,7 +82,7 @@ get_header(); ?> $next_attachment_url = wp_get_attachment_url(); } ?> -

ID, array( $attachment_size, 9999 ) ); // filterable image width with, essentially, no limit for image height. ?>

@@ -92,7 +92,7 @@ get_header(); ?>
- +
post_excerpt ) ) the_excerpt(); ?>
@@ -116,4 +116,5 @@ get_header(); ?> - +
- + - + * If you want to overload this in a child theme then include a file * called content-___.php (where ___ is the Post Format name) and that will be used instead. */ - get_template_part( 'content', get_post_format() ); + get_template_part( 'content/content', get_post_format() ); ?> @@ -82,11 +82,12 @@ get_header(); ?> - +
- \ No newline at end of file +
- +
- + - -
> -
-

- - - -
- -
- -
- -
- →', 'mantra' ) ); ?> - '' ) ); ?> -
- -
- - - - ', '' ); ?> -
-
diff --git a/themes/mantra/content-chat.php b/themes/mantra/content-chat.php deleted file mode 100644 index d85f0784..00000000 --- a/themes/mantra/content-chat.php +++ /dev/null @@ -1,50 +0,0 @@ - - -
> -
-

- - -
- -
- -
- -
- →', 'mantra' ) ); ?> - '' ) ); ?> -
- -
- - - - - - ', '' ); ?> -
-
diff --git a/themes/mantra/content-frontpage.php b/themes/mantra/content-frontpage.php deleted file mode 100644 index 1998135c..00000000 --- a/themes/mantra/content-frontpage.php +++ /dev/null @@ -1,37 +0,0 @@ - -
-
- - - $mantra_options['mantra_frontpostscount']) ); ?> - have_posts() ) : $the_query->the_post(); ?> - - - - - - - -
-
-

-
- -
-

- -
-
- -
- -
\ No newline at end of file diff --git a/themes/mantra/content-gallery.php b/themes/mantra/content-gallery.php deleted file mode 100644 index 2332eeda..00000000 --- a/themes/mantra/content-gallery.php +++ /dev/null @@ -1,76 +0,0 @@ - $value) { ${"$key"} = $value ; } -?> - -
> -
-

- - -
- -
- -
- -
- $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC', 'numberposts' => 999 ) ); - if ( $images ) : - $total_images = count( $images ); - $image = array_shift( $images ); - $image_img_tag = wp_get_attachment_image( $image->ID, 'thumbnail' );*/ - $images = mantra_get_gallery_images(); - if ( $images ) : $total_images = count( $images ); - $image = array_shift( $images ); - - if (is_sticky() && $mantra_excerptsticky == "Full Post") $sticky_test=1; else $sticky_test=0; - if ($mantra_excerpthome != "Full Post" && $sticky_test==0): - /*?> - - - */ - mantra_set_featured_thumb(); - ?> -

%2$s photo.', 'This gallery contains %2$s photos.', $total_images, 'mantra' ), - 'href="' . esc_url( get_permalink() ) . '" title="' . sprintf( esc_attr__( 'Permalink to %s', 'mantra' ), the_title_attribute( 'echo=0' ) ) . '" rel="bookmark"', - number_format_i18n( $total_images ) - ); ?>

- - - '' ) ); ?> -
- -
- - - - - ', '' ); ?> -
-
diff --git a/themes/mantra/content-image.php b/themes/mantra/content-image.php deleted file mode 100644 index c53ea855..00000000 --- a/themes/mantra/content-image.php +++ /dev/null @@ -1,43 +0,0 @@ - -
> -
-

- - - -
- -
- →', 'mantra' ) ); ?> - '' ) ); ?> -
- -
- - - - - ', '' ); ?> -
-
diff --git a/themes/mantra/content-link.php b/themes/mantra/content-link.php deleted file mode 100644 index e6f6493c..00000000 --- a/themes/mantra/content-link.php +++ /dev/null @@ -1,50 +0,0 @@ - - -
> -
-

- - -
- -
- -
- -
- →', 'mantra' ) ); ?> - '' ) ); ?> -
- -
- - - - - - ', '' ); ?> -
-
diff --git a/themes/mantra/content-page.php b/themes/mantra/content-page.php deleted file mode 100644 index 17248f0c..00000000 --- a/themes/mantra/content-page.php +++ /dev/null @@ -1,30 +0,0 @@ - - -
> - -

- -

- - -
- - '' ) ); ?> - ', '' ); ?> -
-
- - -

- - - diff --git a/themes/mantra/content-quote.php b/themes/mantra/content-quote.php deleted file mode 100644 index b0105a79..00000000 --- a/themes/mantra/content-quote.php +++ /dev/null @@ -1,47 +0,0 @@ - - -
> -
-

- - -
- -
- -
- -
- →', 'mantra' ) ); ?> - '' ) ); ?> -
- -
- - - - - ', '' ); ?> -
-
diff --git a/themes/mantra/content-status.php b/themes/mantra/content-status.php deleted file mode 100644 index 75d91d6b..00000000 --- a/themes/mantra/content-status.php +++ /dev/null @@ -1,49 +0,0 @@ - - -
> -
-

- -
- -
- -
- -
-
- -
- -
→', 'mantra' ) ); ?>
- '' ) ); ?> -
- -
- - - - ', '' ); ?> -
-
diff --git a/themes/mantra/content.php b/themes/mantra/content.php deleted file mode 100644 index e8e266e6..00000000 --- a/themes/mantra/content.php +++ /dev/null @@ -1,85 +0,0 @@ - $value) { - ${"$key"} = $value ; -} - -?> - -
> -
-

- - - -

- - - - - -
- - - -
- - -
- -
- - - '' ) ); ?> -
- - - - - -
- - -
- -
- - '' ) ); ?> -
- -
- - - - ', '' ); ?> -
- -
- - - \ No newline at end of file diff --git a/themes/mantra/content/content-aside.php b/themes/mantra/content/content-aside.php new file mode 100644 index 00000000..5b275d81 --- /dev/null +++ b/themes/mantra/content/content-aside.php @@ -0,0 +1,49 @@ + + +
> +
+

+ + + +
+ +
+ +
+ +
+ →', 'mantra' ) ); ?> + '' ) ); ?> +
+ +
+ + + + ', '' ); ?> +
+
diff --git a/themes/mantra/content/content-chat.php b/themes/mantra/content/content-chat.php new file mode 100644 index 00000000..d85f0784 --- /dev/null +++ b/themes/mantra/content/content-chat.php @@ -0,0 +1,50 @@ + + +
> +
+

+ + +
+ +
+ +
+ +
+ →', 'mantra' ) ); ?> + '' ) ); ?> +
+ +
+ + + + + + ', '' ); ?> +
+
diff --git a/themes/mantra/content/content-frontpage.php b/themes/mantra/content/content-frontpage.php new file mode 100644 index 00000000..aeb96e07 --- /dev/null +++ b/themes/mantra/content/content-frontpage.php @@ -0,0 +1,37 @@ + +
+
+ + + $mantra_options['mantra_frontpostscount']) ); ?> + have_posts() ) : $the_query->the_post(); ?> + + + + + + + +
+
+

+
+ +
+

+ +
+
+ +
+ +
diff --git a/themes/mantra/content/content-gallery.php b/themes/mantra/content/content-gallery.php new file mode 100644 index 00000000..2332eeda --- /dev/null +++ b/themes/mantra/content/content-gallery.php @@ -0,0 +1,76 @@ + $value) { ${"$key"} = $value ; } +?> + +
> +
+

+ + +
+ +
+ +
+ +
+ $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC', 'numberposts' => 999 ) ); + if ( $images ) : + $total_images = count( $images ); + $image = array_shift( $images ); + $image_img_tag = wp_get_attachment_image( $image->ID, 'thumbnail' );*/ + $images = mantra_get_gallery_images(); + if ( $images ) : $total_images = count( $images ); + $image = array_shift( $images ); + + if (is_sticky() && $mantra_excerptsticky == "Full Post") $sticky_test=1; else $sticky_test=0; + if ($mantra_excerpthome != "Full Post" && $sticky_test==0): + /*?> + + + */ + mantra_set_featured_thumb(); + ?> +

%2$s photo.', 'This gallery contains %2$s photos.', $total_images, 'mantra' ), + 'href="' . esc_url( get_permalink() ) . '" title="' . sprintf( esc_attr__( 'Permalink to %s', 'mantra' ), the_title_attribute( 'echo=0' ) ) . '" rel="bookmark"', + number_format_i18n( $total_images ) + ); ?>

+ + + '' ) ); ?> +
+ +
+ + + + + ', '' ); ?> +
+
diff --git a/themes/mantra/content/content-image.php b/themes/mantra/content/content-image.php new file mode 100644 index 00000000..c53ea855 --- /dev/null +++ b/themes/mantra/content/content-image.php @@ -0,0 +1,43 @@ + +
> +
+

+ + + +
+ +
+ →', 'mantra' ) ); ?> + '' ) ); ?> +
+ +
+ + + + + ', '' ); ?> +
+
diff --git a/themes/mantra/content/content-link.php b/themes/mantra/content/content-link.php new file mode 100644 index 00000000..e6f6493c --- /dev/null +++ b/themes/mantra/content/content-link.php @@ -0,0 +1,50 @@ + + +
> +
+

+ + +
+ +
+ +
+ +
+ →', 'mantra' ) ); ?> + '' ) ); ?> +
+ +
+ + + + + + ', '' ); ?> +
+
diff --git a/themes/mantra/content/content-page.php b/themes/mantra/content/content-page.php new file mode 100644 index 00000000..17248f0c --- /dev/null +++ b/themes/mantra/content/content-page.php @@ -0,0 +1,30 @@ + + +
> + +

+ +

+ + +
+ + '' ) ); ?> + ', '' ); ?> +
+
+ + +

+ + + diff --git a/themes/mantra/content/content-quote.php b/themes/mantra/content/content-quote.php new file mode 100644 index 00000000..b0105a79 --- /dev/null +++ b/themes/mantra/content/content-quote.php @@ -0,0 +1,47 @@ + + +
> +
+

+ + +
+ +
+ +
+ +
+ →', 'mantra' ) ); ?> + '' ) ); ?> +
+ +
+ + + + + ', '' ); ?> +
+
diff --git a/themes/mantra/content/content-status.php b/themes/mantra/content/content-status.php new file mode 100644 index 00000000..75d91d6b --- /dev/null +++ b/themes/mantra/content/content-status.php @@ -0,0 +1,49 @@ + + +
> +
+

+ +
+ +
+ +
+ +
+
+ +
+ +
→', 'mantra' ) ); ?>
+ '' ) ); ?> +
+ +
+ + + + ', '' ); ?> +
+
diff --git a/themes/mantra/content/content.php b/themes/mantra/content/content.php new file mode 100644 index 00000000..e8e266e6 --- /dev/null +++ b/themes/mantra/content/content.php @@ -0,0 +1,85 @@ + $value) { + ${"$key"} = $value ; +} + +?> + +
> +
+

+ + + +

+ + + + + +
+ + + +
+ + +
+ +
+ + + '' ) ); ?> +
+ + + + + +
+ + +
+ +
+ + '' ) ); ?> +
+ +
+ + + + ', '' ); ?> +
+ +
+ + + \ No newline at end of file diff --git a/themes/mantra/editor-style-rtl.css b/themes/mantra/editor-style-rtl.css deleted file mode 100644 index e44679af..00000000 --- a/themes/mantra/editor-style-rtl.css +++ /dev/null @@ -1,56 +0,0 @@ -/* -Theme Name: Mantra -*/ -/* -Used to style the TinyMCE editor. -*/ -html .mceContentBody{ - direction:rtl; - unicode-bidi:embed; - float:right; -} -* { - font-family: Arial, Tahoma, sans-serif; -} -/* Text elements */ -ul { - margin: 0 -18px 18px 0; -} -ol { - margin: 0 -18px 18px 0; -} -dd { - margin-right: 0; -} -blockquote { - font-style: normal; -} -table { - text-align: right; - margin: 0 0 24px -1px; -} -html .mceContentBody{ - direction:rtl; - unicode-bidi:embed; - float:right; -} -* { - font-family: Arial, Tahoma, sans-serif; -} -/* Text elements */ -ul { - margin: 0 -18px 18px 0; -} -ol { - margin: 0 -18px 18px 0; -} -dd { - margin-right: 0; -} -blockquote { - font-style: normal; -} -table { - text-align: right; - margin: 0 0 24px -1px; -} \ No newline at end of file diff --git a/themes/mantra/editor-style.css b/themes/mantra/editor-style.css deleted file mode 100644 index 9eefb8bc..00000000 --- a/themes/mantra/editor-style.css +++ /dev/null @@ -1,287 +0,0 @@ -/* -Theme Name: Mantra -*/ -/* -Used to style the TinyMCE editor. -*/ - -* { - font-family: Georgia, "Bitstream Charter", serif; - color: #444; - line-height: 1.5; -} -p, -dl, -td, -th, -ul, -ol, -blockquote { - font-size: 16px; -} -tr th, -thead th, -label, -tr th, -thead th { - font-family: "Helvetica Neue", Arial, Helvetica, "Nimbus Sans L", sans-serif; -} -pre { - font-family: "Courier 10 Pitch", Courier, monospace; -} -code, code var { - font-family: Monaco, Consolas, "Andale Mono", "DejaVu Sans Mono", monospace; -} -body, input, textarea { - font-size: 12px; - line-height: 18px; -} -hr { - background-color: #e7e7e7; - border:0; - height: 1px; - margin-bottom: 18px; - clear:both; -} -/* Text elements */ -p { - margin-bottom: 18px; -} -ul { - list-style: square; - margin: 0 0 18px 1.5em; -} -ol { - list-style: decimal; - margin: 0 0 18px 1.5em; -} -ol ol { - list-style:upper-alpha; -} -ol ol ol { - list-style:lower-roman; -} -ol ol ol ol { - list-style:lower-alpha; -} -ul ul, -ol ol, -ul ol, -ol ul { - margin-bottom:0; -} -dl { - margin:0 0 24px 0; -} -dt { - font-weight: bold; -} -dd { - margin-bottom: 18px; -} -strong { - font-weight: bold; - color: #000; -} -cite, -em, -i { - font-style: italic; - border: none; -} -big { - font-size: 131.25%; -} -ins { - background: #ffffcc; - border: none; - color: #333; -} -del { - text-decoration: line-through; - color: #555; -} -blockquote { - font-style: italic; - padding: 0 3em; -} -blockquote cite, -blockquote em, -blockquote i { - font-style: normal; -} -pre { - background: #f7f7f7; - color: #222; - line-height: 18px; - margin-bottom: 18px; - padding: 1.5em; -} -abbr, -acronym { - border-bottom: 1px dotted #666; - cursor: help; -} -ins { - text-decoration: none; -} -sup, -sub { - height: 0; - line-height: 1; - vertical-align: baseline; - position: relative; - font-size: 10px; -} -sup { - bottom: 1ex; -} -sub { - top: .5ex; -} -a:link { - color:#0066cc; -} -a:visited { - color:#743399; -} -a:active, -a:hover { - color: #ff4b33; -} -p, -ul, -ol, -dd, -pre, -hr { - margin-bottom:24px; -} -ul ul, -ol ol, -ul ol, -ol ul { - margin-bottom:0; -} -pre, -kbd, -tt, -var { - font-size: 15px; - line-height: 21px; -} -code { - font-size: 13px; -} -strong, -b, -dt, -th { - color: #000; -} -h1, -h2, -h3, -h4, -h5, -h6 { - color: #000; - margin: 0 0 20px 0; - line-height: 1.5em; - font-weight: normal; -} -h1 { - font-size: 2.4em; -} -h2 { - font-size: 1.8em; -} -h3 { - font-size: 1.4em; -} -h4 { - font-size: 1.2em; -} -h5 { - font-size: 1em; -} -h6 { - font-size: 0.9em; -} -table { - border: 1px solid #e7e7e7 !important; - text-align: left; - margin: 0 -1px 24px 0; - width: 100%; - border-collapse: collapse; - border-spacing: 0; -} -tr th, -thead th { - border: none !important; - color: #888; - font-size: 12px; - font-weight: bold; - line-height: 18px; - padding: 9px 24px; -} -tr td { - border: none !important; - border-top: 1px solid #e7e7e7 !important; - padding: 6px 24px; -} - - -img { - margin: 0; - height:auto; -} -.alignleft, -img.alignleft { - display: inline; - float: left; - margin-right: 24px; - margin-top: 4px; -} -.alignright, -img.alignright { - display: inline; - float: right; - margin-left: 24px; - margin-top: 4px; -} -.aligncenter, -img.aligncenter { - clear: both; - display: block; - margin-left: auto; - margin-right: auto; -} -img.alignleft, -img.alignright, -img.aligncenter { - margin-bottom: 12px; -} -.wp-caption { - border: none; - background: #f1f1f1; - color: #888; - font-size: 12px; - line-height: 18px; - text-align: center; - margin-bottom: 20px; - padding: 4px; - -moz-border-radius: 0; - -khtml-border-radius: 0; - -webkit-border-radius: 0; - border-radius: 0; -} -.wp-caption img { - margin: 5px; -} -.wp-caption p.wp-caption-text { - margin: 0 0 4px; -} -.wp-smiley { - margin:0; -} \ No newline at end of file diff --git a/themes/mantra/functions.php b/themes/mantra/functions.php index 354ac3ac..107e5d7a 100644 --- a/themes/mantra/functions.php +++ b/themes/mantra/functions.php @@ -9,7 +9,7 @@ // theme specifics define ('_CRYOUT_THEME_NAME','mantra'); -define ('_CRYOUT_THEME_VERSION','2.6.1.1'); +define ('_CRYOUT_THEME_VERSION','3.0.4'); require_once(get_template_directory() . "/admin/main.php"); // Load necessary admin files @@ -23,4 +23,4 @@ require_once(get_template_directory() . "/includes/theme-functions.php"); // The require_once(get_template_directory() . "/includes/theme-hooks.php"); // Theme hooks require_once(get_template_directory() . "/includes/tgm.php"); // TGM-PA -?> +// FIN diff --git a/themes/mantra/header.php b/themes/mantra/header.php index 554dfb04..212be8f3 100644 --- a/themes/mantra/header.php +++ b/themes/mantra/header.php @@ -12,7 +12,7 @@ > - + +   \n"; + } } endif; function mantra_nextpage_links($defaults) { -$args = array( -'link_before' => '', -'link_after' => '', -); -$r = wp_parse_args($args, $defaults); -return $r; + $args = array( + 'link_before' => '', + 'link_after' => '', + ); + $r = wp_parse_args($args, $defaults); + return $r; } -add_filter('wp_link_pages_args','mantra_nextpage_links'); +add_filter( 'wp_link_pages_args', 'mantra_nextpage_links' ); /** * Site info */ -function mantra_site_info() { -$mantra_options= mantra_get_theme_options(); -foreach ($mantra_options as $key => $value) { - ${"$key"} = $value ; -} ?> -
- - | & - -
- +
+ + | & + +
$value) { - ${"$key"} = $value ; - } - echo ''; + global $mantra_options; ?> + + ","",0); - endwhile; else: endif; - - // Reset Query - wp_reset_query(); - - return $testVar; -} -endif; - - // Favicon function mantra_fav_icon() { global $mantra_options; - foreach ($mantra_options as $key => $value) { ${"$key"} = $value ;} - echo ''; - echo ''; + echo ''; + echo ''; } -if ($mantra_options['mantra_favicon']) add_action ('cryout_header_hook','mantra_fav_icon'); +if ($mantra_options['mantra_favicon']) add_action( 'cryout_header_hook', 'mantra_fav_icon' ); + +// FIN \ No newline at end of file diff --git a/themes/mantra/includes/theme-hooks.php b/themes/mantra/includes/theme-hooks.php index f0d60b97..062452c8 100644 --- a/themes/mantra/includes/theme-hooks.php +++ b/themes/mantra/includes/theme-hooks.php @@ -156,4 +156,5 @@ function cryout_before_content_hook() { function cryout_after_content_hook() { do_action('cryout_after_content_hook'); } -?> + +// FIN \ No newline at end of file diff --git a/themes/mantra/includes/theme-loop.php b/themes/mantra/includes/theme-loop.php index 479d172f..d2a6b8e9 100644 --- a/themes/mantra/includes/theme-loop.php +++ b/themes/mantra/includes/theme-loop.php @@ -17,7 +17,7 @@ */ function mantra_excerpt_length( $length ) { global $mantra_excerptwords; - return $mantra_excerptwords; + return absint( $mantra_excerptwords ); } add_filter( 'excerpt_length', 'mantra_excerpt_length' ); @@ -29,7 +29,7 @@ add_filter( 'excerpt_length', 'mantra_excerpt_length' ); */ function mantra_continue_reading_link() { global $mantra_excerptcont; - return ' ' .$mantra_excerptcont.' ' . ''; + return ' ' . wp_kses_post( $mantra_excerptcont ).' ' . ''; } /** @@ -43,7 +43,7 @@ function mantra_continue_reading_link() { */ function mantra_auto_excerpt_more( $more ) { global $mantra_excerptdots; - return $mantra_excerptdots. mantra_continue_reading_link(); + return wp_kses_post( $mantra_excerptdots ). mantra_continue_reading_link(); } add_filter( 'excerpt_more', 'mantra_auto_excerpt_more' ); @@ -77,7 +77,7 @@ add_filter( 'get_the_excerpt', 'mantra_custom_excerpt_more' ); */ function mantra_more_link($more_link, $more_link_text) { global $mantra_excerptcont; - $new_link_text = $mantra_excerptcont; + $new_link_text = wp_kses_post( $mantra_excerptcont ); if (preg_match("/custom=(.*)/",$more_link_text,$m) ) { $new_link_text = $m[1]; }; @@ -94,44 +94,40 @@ add_filter('the_content_more_link', 'mantra_more_link',10,2); */ function mantra_trim_excerpt($text) { -global $mantra_excerptwords; -global $mantra_excerptcont; -global $mantra_excerptdots; -$raw_excerpt = $text; -if ( '' == $text ) { - //Retrieve the post content. - $text = get_the_content(''); - - //Delete all shortcode tags from the content. - $text = strip_shortcodes( $text ); - - $text = apply_filters('the_content', $text); - $text = str_replace(']]>', ']]>', $text); - - $allowed_tags = ',,,,
    ,
  • ,,

    ,

    ,

    ,

    ,

    ,
    ,
    ,,,,
    ,

    '; - $text = strip_tags($text, $allowed_tags); - - $words = preg_split("/[\n\r\t ]+/", $text, $mantra_excerptwords + 1, PREG_SPLIT_NO_EMPTY); - if ( count($words) > $mantra_excerptwords ) { - array_pop($words); - $text = implode(' ', $words); - $text = $text .' '.$mantra_excerptdots. ' ' .$mantra_excerptcont.' ' . ''; - } else { - $text = implode(' ', $words); - } -} -return apply_filters('wp_trim_excerpt', $text, $raw_excerpt); + global $mantra_excerptwords; + global $mantra_excerptcont; + global $mantra_excerptdots; + $raw_excerpt = $text; + if ( '' == $text ) { + //Retrieve the post content. + $text = get_the_content(''); + + //Delete all shortcode tags from the content. + $text = strip_shortcodes( $text ); + + $text = apply_filters('the_content', $text); + $text = str_replace(']]>', ']]>', $text); + + $allowed_tags = ',,,,

      ,
    • ,,

      ,

      ,

      ,

      ,

      ,
      ,
      ,,,,
      ,

      '; + $text = strip_tags($text, $allowed_tags); + + $words = preg_split("/[\n\r\t ]+/", $text, $mantra_excerptwords + 1, PREG_SPLIT_NO_EMPTY); + if ( count($words) > $mantra_excerptwords ) { + array_pop($words); + $text = implode(' ', $words); + $text = $text .' '.$mantra_excerptdots. ' ' .$mantra_excerptcont.' ' . ''; + } else { + $text = implode(' ', $words); + } + } + return apply_filters('wp_trim_excerpt', $text, $raw_excerpt); } - - - if ($mantra_excerpttags=='Enable') { -remove_filter('get_the_excerpt', 'wp_trim_excerpt'); -add_filter('get_the_excerpt', 'mantra_trim_excerpt'); + remove_filter('get_the_excerpt', 'wp_trim_excerpt'); + add_filter('get_the_excerpt', 'mantra_trim_excerpt'); } - /** * Remove inline styles printed when the gallery shortcode is used. * @@ -153,28 +149,24 @@ if ( ! function_exists( 'mantra_posted_on' ) ) : * @since mantra 0.5 */ function mantra_posted_on() { -global $mantra_options; -foreach ($mantra_options as $key => $value) { - ${"$key"} = $value ; -} - -$date_string = '|'; -$date_string .= ''; + $date_string = '|'; + $date_string .= ''; -// If author is hidden don't give it a value -$author_string = sprintf( ''.__( 'By ','mantra'). ' |', - get_author_posts_url( get_the_author_meta( 'ID' ) ), - sprintf( esc_attr__( 'View all posts by %s', 'mantra' ), get_the_author() ), - get_the_author() - ); + // If author is hidden don't give it a value + $author_string = sprintf( ' %4$s |', + esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), + sprintf( esc_attr__( 'View all posts by %s', 'mantra' ), get_the_author() ), + get_the_author(), + __('By ', 'mantra') + ); -// Print the meta data - printf( '  %4$s '.$date_string.' %2$s ', + // Print the meta data + printf( ' %4$s '.$date_string.' %2$s ', 'meta-prep meta-prep-author', get_the_category_list( ', ' ), sprintf( ' - %2$s', - get_permalink(), + esc_url( get_permalink() ), esc_attr( get_the_time() ), get_the_date() ), $author_string @@ -183,13 +175,13 @@ $author_string = sprintf( ''.__( 'By ','mantra'). ' } endif; -// Remove category from rel in categry tags. -add_filter( 'the_category', 'mantra_remove_category_tag' ); -add_filter( 'get_the_category_list', 'mantra_remove_category_tag' ); +// Remove category from rel in category tags. function mantra_remove_category_tag( $text ) { -$text = str_replace('rel="category tag"', 'rel="tag"', $text); return $text; + return str_replace('rel="category tag"', 'rel="tag"', $text); } +add_filter( 'the_category', 'mantra_remove_category_tag' ); +add_filter( 'get_the_category_list', 'mantra_remove_category_tag' ); if ( ! function_exists( 'mantra_posted_in' ) ) : @@ -213,7 +205,7 @@ function mantra_posted_in() { $posted_in, get_the_category_list( ', ' ), $tag_list, - get_permalink(), + esc_url( get_permalink() ), the_title_attribute( 'echo=0' ) ); } @@ -235,32 +227,26 @@ function mantra_content_nav( $nav_id ) { } endif; // mantra_content_nav -// Custom image size for use with post thumbnails -if($mantra_fcrop) -add_image_size( 'custom', $mantra_fwidth, $mantra_fheight, true ); -else -add_image_size( 'custom', $mantra_fwidth, $mantra_fheight ); - - -function cryout_echo_first_image ($postID) -{ +/** + * Returns src of image first attached to the post + */ +function cryout_echo_first_image( $postID ) { $args = array( - 'numberposts' => 1, - 'order'=> 'ASC', - 'post_mime_type' => 'image', - 'post_parent' => $postID, - 'post_status' => 'any', - 'post_type' => 'any' + 'numberposts' => 1, + 'order'=> 'ASC', + 'post_mime_type' => 'image', + 'post_parent' => $postID, + 'post_status' => 'any', + 'post_type' => 'any', ); $attachments = get_children( $args ); - //print_r($attachments); if ($attachments) { foreach($attachments as $attachment) { $image_attributes = wp_get_attachment_image_src( $attachment->ID, 'custom' ) ? wp_get_attachment_image_src( $attachment->ID, 'custom' ) : wp_get_attachment_image_src( $attachment->ID, 'custom' ); - return $image_attributes[0]; + return esc_url( $image_attributes[0] ); } } @@ -273,29 +259,26 @@ if ( ! function_exists( 'mantra_set_featured_thumb' ) ) : function mantra_set_featured_thumb() { global $mantra_options; - foreach ($mantra_options as $key => $value) { - ${"$key"} = $value ; + extract($mantra_options); + global $post; + $image_src = cryout_echo_first_image($post->ID); + + if ( function_exists("has_post_thumbnail") && has_post_thumbnail() && $mantra_fpost=='Enable') { + the_post_thumbnail( 'custom', array( "class" => "align" . strtolower($mantra_falign) . " post-thumbnail" ) ); + } elseif ($mantra_fpost=='Enable' && $mantra_fauto=="Enable" && $image_src && ($mantra_excerptarchive != "Full Post" || $mantra_excerpthome != "Full Post")) { ?> + + <?php echo the_title_attribute('echo=0') ?> + + ID); - - if ( function_exists("has_post_thumbnail") && has_post_thumbnail() && $mantra_fpost=='Enable') - the_post_thumbnail( 'custom', array("class" => "align".strtolower($mantra_falign)." post_thumbnail" ) ); - - else if ($mantra_fpost=='Enable' && $mantra_fauto=="Enable" && $image_src && ($mantra_excerptarchive != "Full Post" || $mantra_excerpthome != "Full Post")) - echo '' ; - - } endif; // mantra_set_featured_thumb -if ($mantra_fpost=='Enable' && $mantra_fpostlink) add_filter( 'post_thumbnail_html', 'mantra_thumbnail_link', 10, 2 ); - /** * The thumbnail gets a link to the post's page */ - function mantra_thumbnail_link( $html, $post_id ) { - $html = '' . $html . ''; - return $html; + return '' . $html . ''; } -?> +if ($mantra_fpost=='Enable' && $mantra_fpostlink) add_filter( 'post_thumbnail_html', 'mantra_thumbnail_link', 10, 2 ); + +// FIN \ No newline at end of file diff --git a/themes/mantra/includes/theme-setup.php b/themes/mantra/includes/theme-setup.php index ecf57fdb..5bc922a1 100644 --- a/themes/mantra/includes/theme-setup.php +++ b/themes/mantra/includes/theme-setup.php @@ -6,15 +6,8 @@ * @subpackage Functions */ -/* -// Bringing up Mantra Settings page after install -if ( is_admin() && isset($_GET['activated'] ) && $pagenow == "themes.php" ) { - wp_redirect( 'themes.php?page=mantra-page' ); -} -*/ +$mantra_totalSize = $mantra_sidebar + $mantra_sidewidth; -$mantra_totalSize = $mantra_sidebar + $mantra_sidewidth+50; - /** * @@ -25,9 +18,6 @@ $mantra_totalSize = $mantra_sidebar + $mantra_sidewidth+50; /** * Set the content width based on the theme's design and stylesheet. - * - * Used to set the width of images and content. Should be equal to the width the theme - * is designed for, generally via the style.css stylesheet. */ if ( ! isset( $content_width ) ) $content_width = $mantra_sidewidth; @@ -58,10 +48,13 @@ if ( ! function_exists( 'mantra_setup' ) ): * @since mantra 0.5 */ function mantra_setup() { - + global $mantra_totalSize; + global $mantra_options; + extract( $mantra_options ); + // This theme styles the visual editor with editor-style.css to match the theme style. add_editor_style(); - + // Support title tag since WP 4.1 add_theme_support( 'title-tag' ); @@ -92,37 +85,33 @@ function mantra_setup() { // This theme allows users to set a custom background add_theme_support( 'custom-background' ); - // We'll be using post thumbnails for custom header images on posts and pages. - // We want them to be the same size as the header. - // Larger images will be auto-cropped to fit, smaller ones will be ignored. See header.php. - global $mantra_hheight; - $mantra_hheight=(int)$mantra_hheight; - global $mantra_totalSize; - add_image_size('header', apply_filters( 'mantra_header_image_width', $mantra_totalSize ), apply_filters( 'mantra_header_image_height', $mantra_hheight), true ); + // Register image size for the theme's header area + $mantra_hheight = intval( $mantra_hheight ); + add_image_size( 'header', apply_filters( 'mantra_header_image_width', $mantra_totalSize ), apply_filters( 'mantra_header_image_height', $mantra_hheight), true ); + + // Register image size for presentation page slider + add_image_size( 'slider', apply_filters( 'mantra_slider_image_width', $mantra_fpsliderwidth ), apply_filters( 'mantra_slider_image_height', $mantra_fpsliderheight ), true ); + + // Register custom image size for use with post thumbnails + add_image_size( 'custom', apply_filters( 'mantra_featured_image_width', $mantra_fwidth ), apply_filters( 'mantra_featured_image_height', $mantra_fheight ), !empty($mantra_fcrop) ); - global $mantra_fpsliderwidth; - global $mantra_fpsliderheight; - add_image_size( 'slider', $mantra_fpsliderwidth, $mantra_fpsliderheight, true ); - // Add a way for the custom header to be styled in the admin panel that controls - // custom headers. See mantra_admin_header_style(), below. define( 'NO_HEADER_TEXT', true ); - // Add support for flexible headers $header_args = array( - 'flex-height' => true, 'height' => $mantra_hheight, - 'flex-width' => true, 'width' => $mantra_totalSize, 'max-width' => 1920, 'default-image' => '', - 'admin-head-callback' => 'mantra_admin_header_style', + // support flexible (no-crop) headers + 'flex-height' => true, + 'flex-width' => true, ); add_theme_support( 'custom-header', $header_args ); // Default custom headers packaged with the theme. %s is a placeholder for the theme template directory URI. register_default_headers( array( 'mantra' => array( - 'url' => '%s/images/headers/mantra.png', - 'thumbnail_url' => '%s/images/headers/mantra-thumbnail.png', + 'url' => '%s/resources/images/headers/mantra.png', + 'thumbnail_url' => '%s/resources/images/headers/mantra-thumbnail.png', // translators: header image description 'description' => __( 'mantra', 'mantra' ) ), @@ -130,37 +119,28 @@ function mantra_setup() { } endif; -// remove obsolete mantra functions action hooks -if ( ! function_exists( 'mantra_remove_obsolete_functions' ) ) : -function mantra_remove_obsolete_functions() { - remove_filter( 'wp_title', 'mantra_filter_wp_title' ); - remove_filter('wp_title_rss','mantra_filter_wp_title_rss'); -} -add_action('init','mantra_remove_obsolete_functions'); -endif; - // Backwards compatibility for the title-tag if ( ! function_exists( '_wp_render_title_tag' ) ) : add_action( 'wp_head', 'mantra_render_title' ); - add_filter( 'wp_title', 'mantra_filter_wp_title2' ); - add_filter('wp_title_rss','mantra_filter_wp_title_rss2'); + add_filter( 'wp_title', 'mantra_filter_wp_title' ); + add_filter( 'wp_title_rss', 'mantra_filter_wp_title_rss'); endif; -function mantra_render_title() { ?> - <?php wp_title( '', true, 'right' ); ?> -<?php wp_title( '', true, 'right' ); ?>0)&&(strlen($title)>0))?$title.' - '.$site_name:$title.$site_name); + $filtered_title = ( ( ( strlen($site_name)>0 ) && ( strlen($title)>0) ) ? $title . ' - ' . $site_name : $title . $site_name ); // Get the Site Description $site_description = get_bloginfo( 'description' ); // If site front page, append description - if ( (is_home() || is_front_page()) && $site_description ) { + if ( ( is_home() || is_front_page() ) && $site_description ) { // Append Site Description to title - $filtered_title = ((strlen($site_name)>0)&&(strlen($site_description)>0))?$site_name. " | ".$site_description:$site_name.$site_description; + $filtered_title = ( ( strlen($site_name)>0 ) && ( strlen($site_description)>0 ) ) ? $site_name . " | " . $site_description : $site_name . $site_description; } // Add pagination if that's the case global $page, $paged; @@ -171,35 +151,10 @@ function mantra_filter_wp_title2( $title ) { return $filtered_title; } -function nirvana_filter_wp_title_rss2($title) { +function mantra_filter_wp_title_rss($title) { return ' '; } -if ( ! function_exists( 'mantra_admin_header_style' ) ) : -/** - * Styles the header image displayed on the Appearance > Header admin panel. - * - * Referenced via add_custom_image_header() in mantra_setup(). - * - * @since mantra 0.5 - */ -function mantra_admin_header_style() { -?> - - 'nav', 'container_class' => 'topmenu', 'theme_location' => 'top', 'depth' => 1 ) ); - } - - add_action ('cryout_wrapper_hook','mantra_top_menu'); - - // MAIN MENU - function mantra_main_menu() { - /* Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff */ ?> -

      - 'menu', 'menu_id' =>'prime_nav', 'theme_location' => 'primary' ) ); + if ( has_nav_menu( 'top' ) ) + wp_nav_menu( array( + 'container' => 'nav', + 'container_class' => 'topmenu', + 'theme_location' => 'top', + 'depth' => 1, + ) ); } - -add_action ('cryout_access_hook','mantra_main_menu'); +add_action( 'cryout_wrapper_hook', 'mantra_top_menu' ); + +// MAIN MENU +function mantra_main_menu() { + ?> + + 'menu', + 'menu_id' =>'prime_nav', + 'theme_location' => 'primary' + ) ); +} +add_action( 'cryout_access_hook', 'mantra_main_menu' ); // FOOTER MENU - function mantra_footer_menu() { - if ( has_nav_menu( 'footer' ) ) wp_nav_menu( array( 'container' => 'nav', 'container_class' => 'footermenu', 'theme_location' => 'footer', 'depth' => 1 ) ); - } - - add_action ('cryout_footer_hook','mantra_footer_menu',10); +function mantra_footer_menu() { + if ( has_nav_menu( 'footer' ) ) + wp_nav_menu( array( + 'container' => 'nav', + 'container_class' => 'footermenu', + 'theme_location' => 'footer', + 'depth' => 1 + ) ); +} +add_action( 'cryout_footer_hook', 'mantra_footer_menu' ); + - /** * Register widgetized areas, including two sidebars and four widget-ready columns in the footer. * @@ -340,8 +309,8 @@ function mantra_widgets_init() { 'before_title' => '

      ', 'after_title' => '

      ', ) ); - - // Area 9, located above the content area. Empty by default. + + // Area 9, located above the content area. Empty by default. register_sidebar( array( 'name' => __( 'Above content Widget Area', 'mantra' ), 'id' => 'above-content-widget-area', @@ -351,8 +320,8 @@ function mantra_widgets_init() { 'before_title' => '

      ', 'after_title' => '

      ', ) ); - - // Area 10, located below the content area. Empty by default. + + // Area 10, located below the content area. Empty by default. register_sidebar( array( 'name' => __( 'Below Content Widget Area', 'mantra' ), 'id' => 'below-content-widget-area', @@ -371,7 +340,6 @@ add_action( 'widgets_init', 'mantra_widgets_init' ); * Creates different class names for footer widgets depending on their number. * This way they can fit the footer area. */ - function mantra_footer_sidebar_class() { $count = 0; @@ -409,19 +377,22 @@ function mantra_footer_sidebar_class() { } - function mantra_above_widget() { - if ( is_active_sidebar( 'above-content-widget-area' )) { ?> -
        - -
      - +
        + +
      + -
        - -
      - \ No newline at end of file + if ( is_active_sidebar( 'below-content-widget-area' )) { ?> +
        + +
      + '; -else return ''; + global $mantra_options; + if ($mantra_options['mantra_zoom'] == 1) { + echo '' . PHP_EOL; + } else { + echo '' . PHP_EOL; + } } +if ($mantra_options['mantra_mobile']) add_action( 'cryout_seo_hook', 'mantra_mobile_meta' ); -function mantra_register_styles() { +function mantra_enqueue_styles() { global $mantra_options; - foreach ($mantra_options as $key => $value) { ${"$key"} = $value ;} - - wp_register_style( 'mantras', get_stylesheet_uri(), NULL, _CRYOUT_THEME_VERSION ); - - if($mantra_mobile=="Enable") { wp_register_style( 'mantra-mobile', get_template_directory_uri() . '/style-mobile.css', NULL, _CRYOUT_THEME_VERSION );} - - wp_register_style( 'mantra_googlefont', esc_attr($mantra_googlefont2 )); - wp_register_style( 'mantra_googlefonttitle', esc_attr($mantra_googlefonttitle2 )); - wp_register_style( 'mantra_googlefontside',esc_attr($mantra_googlefontside2) ); - wp_register_style( 'mantra_googlefontsubheader', esc_attr($mantra_googlefontsubheader2) ); - -} -add_action('init', 'mantra_register_styles' ); + // Main theme style + wp_enqueue_style( 'mantra-style', get_stylesheet_uri(), NULL, _CRYOUT_THEME_VERSION ); + // Google Fonts + if (!empty($mantra_options['mantra_googlefont'])) + wp_enqueue_style( 'mantra-googlefont', "//fonts.googleapis.com/css?family=" . preg_replace( '/\s+/', '+', esc_attr($mantra_options['mantra_googlefont']) ) ); + if (!empty($mantra_options['mantra_googlefonttitle'])) + wp_enqueue_style( 'mantra-googlefont-title', "//fonts.googleapis.com/css?family=" . preg_replace( '/\s+/', '+', esc_attr($mantra_options['mantra_googlefonttitle']) ) ); + if (!empty($mantra_options['mantra_googlefontside'])) + wp_enqueue_style( 'mantra-googlefont-side', "//fonts.googleapis.com/css?family=" . preg_replace( '/\s+/', '+', esc_attr($mantra_options['mantra_googlefontside']) ) ); + if (!empty($mantra_options['mantra_googlefontsubheader'])) + wp_enqueue_style( 'mantra-googlefont-headings', "//fonts.googleapis.com/css?family=" . preg_replace( '/\s+/', '+', esc_attr($mantra_options['mantra_googlefontsubheader']) ) ); -function mantra_enqueue_styles() { - global $mantra_options; - foreach ($mantra_options as $key => $value) { ${"$key"} = $value ;} - - wp_enqueue_style( 'mantras'); - - wp_enqueue_style( 'mantra_googlefont'); - wp_enqueue_style( 'mantra_googlefonttitle'); - wp_enqueue_style( 'mantra_googlefontside'); - wp_enqueue_style( 'mantra_googlefontsubheader'); + // Options-based generated styling + wp_add_inline_style( 'mantra-style', preg_replace( "/[\n\r\t\s]+/", " ", mantra_custom_styles() ) ); // includes/custom-styles.php + // Presentation Page options-based styling (only used when needed) + if ( ($mantra_options['mantra_frontpage']=="Enable") && is_front_page() ) { + wp_add_inline_style( 'mantra-style', preg_replace( "/[\n\r\t\s]+/", " ", mantra_frontpage_css() ) ); // also in includes/custom-styles.php + } + + // RTL support + if ( is_rtl() ) wp_enqueue_style( 'mantra-rtl', get_template_directory_uri() . '/resources/css/rtl.css', NULL, _CRYOUT_THEME_VERSION ); + + // User supplied custom styling + wp_add_inline_style( 'mantra-style', preg_replace( "/[\n\r\t\s]+/", " ", mantra_customcss() ) ); // also in includes/custom-styles.php + + /// Responsive styling (loaded last) + if ( $mantra_options['mantra_mobile']=="Enable" ) { + wp_enqueue_style( 'mantra-mobile', get_template_directory_uri() . '/resources/css/style-mobile.css', NULL, _CRYOUT_THEME_VERSION ); + } } - add_action('wp_enqueue_scripts', 'mantra_enqueue_styles' ); - -function mantra_styles_echo() { - global $mantra_options; - - foreach ($mantra_options as $key => $value) { ${"$key"} = $value ;} - - echo preg_replace("/[\n\r\t\s]+/"," " ,mantra_custom_styles())."\n"; - if(($mantra_frontpage=="Enable")&&is_front_page()) { echo preg_replace("/[\n\r\t\s]+/"," " ,mantra_frontpage_css())."\n";} - if($mantra_mobile=="Enable") {wp_enqueue_style( 'mantra-mobile'); echo mantra_mobile_meta();} - echo preg_replace("/[\n\r\t\s]+/"," " ,mantra_customcss())."\n"; -} - -add_action('wp_head', 'mantra_styles_echo'); - - -// JS loading and hook into wp_enque_scripts - -add_action('wp_head', 'mantra_customjs' ); - +// JS loading and hook into wp_enque_scripts +add_action('wp_head', 'mantra_customjs' ); // Scripts loading and hook into wp_enque_scripts - function mantra_scripts_method() { -global $mantra_options; -foreach ($mantra_options as $key => $value) { - ${"$key"} = $value ; - } + global $mantra_options; -// If frontend - load the js for the menu and the social icons animations + // If frontend - load the js for the menu and the social icons animations if ( !is_admin() ) { - wp_register_script('cryout-frontend',get_template_directory_uri() . '/js/frontend.js', array('jquery'), _CRYOUT_THEME_VERSION ); - wp_enqueue_script('cryout-frontend'); - // If mantra from page is enabled and the current page is home page - load the nivo slider js - if($mantra_frontpage == "Enable" && is_front_page()) { - wp_register_script('cryout-nivoSlider',get_template_directory_uri() . '/js/nivo-slider.js', array('jquery'), _CRYOUT_THEME_VERSION ); - wp_enqueue_script('cryout-nivoSlider'); - } + wp_enqueue_script( 'mantra-frontend', get_template_directory_uri() . '/resources/js/frontend.js', array('jquery'), _CRYOUT_THEME_VERSION ); + + $js_options = array( + 'responsive' => 0, + 'image_class' => '', + 'equalize_sidebars' => 0, + ); + $js_options['image_class'] = 'image' . $mantra_options['mantra_image']; + if ( $mantra_options['mantra_mobile'] == "Enable" ) { $js_options['responsive'] = 1; } + if ( !empty($mantra_options['mantra_s1bg']) || !empty($mantra_options['mantra_s2bg']) ) { $js_options['equalize_sidebars'] = 1; } + + wp_localize_script( 'mantra-frontend', 'mantra_options', $js_options ); + + // If mantra presentation page is enabled and the current page is home page - load the nivo slider js + if ( $mantra_options['mantra_frontpage'] == "Enable" && is_front_page() ) { + wp_enqueue_script( 'mantra-nivoslider', get_template_directory_uri() . '/resources/js/nivo-slider.js', array('jquery'), _CRYOUT_THEME_VERSION ); + } + } - /* We add some JavaScript to pages with the comment form * to support sites with threaded comments (when in use). @@ -97,37 +92,36 @@ foreach ($mantra_options as $key => $value) { if ( is_singular() && get_option( 'thread_comments' ) ) wp_enqueue_script( 'comment-reply' ); } - add_action('wp_enqueue_scripts', 'mantra_scripts_method'); /** * Adding CSS3 PIE behavior to elements that need it */ function mantra_ie_pie() { - echo ' - -'; + ob_start(); + echo ''; + echo preg_replace( "/[\n\r\t\s]+/", " ", ob_get_clean() ); } add_action('wp_head', 'mantra_ie_pie', 10); -?> \ No newline at end of file +// FIN diff --git a/themes/mantra/index.php b/themes/mantra/index.php index 7daad5d9..35300b7c 100644 --- a/themes/mantra/index.php +++ b/themes/mantra/index.php @@ -11,16 +11,16 @@ * @package Cryout Creations * @subpackage Mantra */ -get_header(); +get_header(); if ($mantra_frontpage=="Enable" && is_front_page() ): mantra_frontpage_generator(); - if ($mantra_frontposts=="Enable"): get_template_part('content','frontpage'); endif; + if ($mantra_frontposts=="Enable"): get_template_part('content/content','frontpage'); endif; else: ?>
      - +
      - + @@ -28,8 +28,8 @@ else: - - + + @@ -52,6 +52,7 @@ else:
      - \ No newline at end of file + +get_footer(); \ No newline at end of file diff --git a/themes/mantra/js/PIE/PIE.htc b/themes/mantra/js/PIE/PIE.htc deleted file mode 100644 index ca3b5470..00000000 --- a/themes/mantra/js/PIE/PIE.htc +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - - - - diff --git a/themes/mantra/js/PIE/PIE.js b/themes/mantra/js/PIE/PIE.js deleted file mode 100644 index d36448a9..00000000 --- a/themes/mantra/js/PIE/PIE.js +++ /dev/null @@ -1,88 +0,0 @@ -/* -PIE: CSS3 rendering for IE -Version 1.0.0 -http://css3pie.com -Dual-licensed for use under the Apache License Version 2.0 or the General Public License (GPL) Version 2. -*/ -(function(){ -var doc = document;var f=window.PIE; -if(!f){f=window.PIE={F:"-pie-",nb:"Pie",La:"pie_",Ac:{TD:1,TH:1},cc:{TABLE:1,THEAD:1,TBODY:1,TFOOT:1,TR:1,INPUT:1,TEXTAREA:1,SELECT:1,OPTION:1,IMG:1,HR:1},fc:{A:1,INPUT:1,TEXTAREA:1,SELECT:1,BUTTON:1},Gd:{submit:1,button:1,reset:1},aa:function(){}};try{doc.execCommand("BackgroundImageCache",false,true)}catch(aa){}for(var ba=4,Z=doc.createElement("div"),ca=Z.getElementsByTagName("i"),ga;Z.innerHTML=" - - - - - - - - diff --git a/themes/mantra/js/PIE/PIE_uncompressed.js b/themes/mantra/js/PIE/PIE_uncompressed.js deleted file mode 100644 index 85f6785e..00000000 --- a/themes/mantra/js/PIE/PIE_uncompressed.js +++ /dev/null @@ -1,4474 +0,0 @@ -/* -PIE: CSS3 rendering for IE -Version 1.0.0 -http://css3pie.com -Dual-licensed for use under the Apache License Version 2.0 or the General Public License (GPL) Version 2. -*/ -(function(){ -var doc = document;var PIE = window['PIE']; - -if( !PIE ) { - PIE = window['PIE'] = { - CSS_PREFIX: '-pie-', - STYLE_PREFIX: 'Pie', - CLASS_PREFIX: 'pie_', - tableCellTags: { - 'TD': 1, - 'TH': 1 - }, - - /** - * Lookup table of elements which cannot take custom children. - */ - childlessElements: { - 'TABLE':1, - 'THEAD':1, - 'TBODY':1, - 'TFOOT':1, - 'TR':1, - 'INPUT':1, - 'TEXTAREA':1, - 'SELECT':1, - 'OPTION':1, - 'IMG':1, - 'HR':1 - }, - - /** - * Elements that can receive user focus - */ - focusableElements: { - 'A':1, - 'INPUT':1, - 'TEXTAREA':1, - 'SELECT':1, - 'BUTTON':1 - }, - - /** - * Values of the type attribute for input elements displayed as buttons - */ - inputButtonTypes: { - 'submit':1, - 'button':1, - 'reset':1 - }, - - emptyFn: function() {} - }; - - // Force the background cache to be used. No reason it shouldn't be. - try { - doc.execCommand( 'BackgroundImageCache', false, true ); - } catch(e) {} - - (function() { - /* - * IE version detection approach by James Padolsey, with modifications -- from - * http://james.padolsey.com/javascript/detect-ie-in-js-using-conditional-comments/ - */ - var ieVersion = 4, - div = doc.createElement('div'), - all = div.getElementsByTagName('i'), - shape; - while ( - div.innerHTML = '', - all[0] - ) {} - PIE.ieVersion = ieVersion; - - // Detect IE6 - if( ieVersion === 6 ) { - // IE6 can't access properties with leading dash, but can without it. - PIE.CSS_PREFIX = PIE.CSS_PREFIX.replace( /^-/, '' ); - } - - PIE.ieDocMode = doc.documentMode || PIE.ieVersion; - - // Detect VML support (a small number of IE installs don't have a working VML engine) - div.innerHTML = ''; - shape = div.firstChild; - shape.style['behavior'] = 'url(#default#VML)'; - PIE.supportsVML = (typeof shape['adj'] === "object"); - }()); -/** - * Utility functions - */ -(function() { - var vmlCreatorDoc, - idNum = 0, - imageSizes = {}; - - - PIE.Util = { - - /** - * To create a VML element, it must be created by a Document which has the VML - * namespace set. Unfortunately, if you try to add the namespace programatically - * into the main document, you will get an "Unspecified error" when trying to - * access document.namespaces before the document is finished loading. To get - * around this, we create a DocumentFragment, which in IE land is apparently a - * full-fledged Document. It allows adding namespaces immediately, so we add the - * namespace there and then have it create the VML element. - * @param {string} tag The tag name for the VML element - * @return {Element} The new VML element - */ - createVmlElement: function( tag ) { - var vmlPrefix = 'css3vml'; - if( !vmlCreatorDoc ) { - vmlCreatorDoc = doc.createDocumentFragment(); - vmlCreatorDoc.namespaces.add( vmlPrefix, 'urn:schemas-microsoft-com:vml' ); - } - return vmlCreatorDoc.createElement( vmlPrefix + ':' + tag ); - }, - - - /** - * Generate and return a unique ID for a given object. The generated ID is stored - * as a property of the object for future reuse. - * @param {Object} obj - */ - getUID: function( obj ) { - return obj && obj[ '_pieId' ] || ( obj[ '_pieId' ] = '_' + ++idNum ); - }, - - - /** - * Simple utility for merging objects - * @param {Object} obj1 The main object into which all others will be merged - * @param {...Object} var_args Other objects which will be merged into the first, in order - */ - merge: function( obj1 ) { - var i, len, p, objN, args = arguments; - for( i = 1, len = args.length; i < len; i++ ) { - objN = args[i]; - for( p in objN ) { - if( objN.hasOwnProperty( p ) ) { - obj1[ p ] = objN[ p ]; - } - } - } - return obj1; - }, - - - /** - * Execute a callback function, passing it the dimensions of a given image once - * they are known. - * @param {string} src The source URL of the image - * @param {function({w:number, h:number})} func The callback function to be called once the image dimensions are known - * @param {Object} ctx A context object which will be used as the 'this' value within the executed callback function - */ - withImageSize: function( src, func, ctx ) { - var size = imageSizes[ src ], img, queue; - if( size ) { - // If we have a queue, add to it - if( Object.prototype.toString.call( size ) === '[object Array]' ) { - size.push( [ func, ctx ] ); - } - // Already have the size cached, call func right away - else { - func.call( ctx, size ); - } - } else { - queue = imageSizes[ src ] = [ [ func, ctx ] ]; //create queue - img = new Image(); - img.onload = function() { - size = imageSizes[ src ] = { w: img.width, h: img.height }; - for( var i = 0, len = queue.length; i < len; i++ ) { - queue[ i ][ 0 ].call( queue[ i ][ 1 ], size ); - } - img.onload = null; - }; - img.src = src; - } - } - }; -})();/** - * Utility functions for handling gradients - */ -PIE.GradientUtil = { - - getGradientMetrics: function( el, width, height, gradientInfo ) { - var angle = gradientInfo.angle, - startPos = gradientInfo.gradientStart, - startX, startY, - endX, endY, - startCornerX, startCornerY, - endCornerX, endCornerY, - deltaX, deltaY, - p, UNDEF; - - // Find the "start" and "end" corners; these are the corners furthest along the gradient line. - // This is used below to find the start/end positions of the CSS3 gradient-line, and also in finding - // the total length of the VML rendered gradient-line corner to corner. - function findCorners() { - startCornerX = ( angle >= 90 && angle < 270 ) ? width : 0; - startCornerY = angle < 180 ? height : 0; - endCornerX = width - startCornerX; - endCornerY = height - startCornerY; - } - - // Normalize the angle to a value between [0, 360) - function normalizeAngle() { - while( angle < 0 ) { - angle += 360; - } - angle = angle % 360; - } - - // Find the start and end points of the gradient - if( startPos ) { - startPos = startPos.coords( el, width, height ); - startX = startPos.x; - startY = startPos.y; - } - if( angle ) { - angle = angle.degrees(); - - normalizeAngle(); - findCorners(); - - // If no start position was specified, then choose a corner as the starting point. - if( !startPos ) { - startX = startCornerX; - startY = startCornerY; - } - - // Find the end position by extending a perpendicular line from the gradient-line which - // intersects the corner opposite from the starting corner. - p = PIE.GradientUtil.perpendicularIntersect( startX, startY, angle, endCornerX, endCornerY ); - endX = p[0]; - endY = p[1]; - } - else if( startPos ) { - // Start position but no angle specified: find the end point by rotating 180deg around the center - endX = width - startX; - endY = height - startY; - } - else { - // Neither position nor angle specified; create vertical gradient from top to bottom - startX = startY = endX = 0; - endY = height; - } - deltaX = endX - startX; - deltaY = endY - startY; - - if( angle === UNDEF ) { - // Get the angle based on the change in x/y from start to end point. Checks first for horizontal - // or vertical angles so they get exact whole numbers rather than what atan2 gives. - angle = ( !deltaX ? ( deltaY < 0 ? 90 : 270 ) : - ( !deltaY ? ( deltaX < 0 ? 180 : 0 ) : - -Math.atan2( deltaY, deltaX ) / Math.PI * 180 - ) - ); - normalizeAngle(); - findCorners(); - } - - return { - angle: angle, - startX: startX, - startY: startY, - endX: endX, - endY: endY, - startCornerX: startCornerX, - startCornerY: startCornerY, - endCornerX: endCornerX, - endCornerY: endCornerY, - deltaX: deltaX, - deltaY: deltaY, - lineLength: PIE.GradientUtil.distance( startX, startY, endX, endY ) - } - }, - - /** - * Find the point along a given line (defined by a starting point and an angle), at which - * that line is intersected by a perpendicular line extending through another point. - * @param x1 - x coord of the starting point - * @param y1 - y coord of the starting point - * @param angle - angle of the line extending from the starting point (in degrees) - * @param x2 - x coord of point along the perpendicular line - * @param y2 - y coord of point along the perpendicular line - * @return [ x, y ] - */ - perpendicularIntersect: function( x1, y1, angle, x2, y2 ) { - // Handle straight vertical and horizontal angles, for performance and to avoid - // divide-by-zero errors. - if( angle === 0 || angle === 180 ) { - return [ x2, y1 ]; - } - else if( angle === 90 || angle === 270 ) { - return [ x1, y2 ]; - } - else { - // General approach: determine the Ax+By=C formula for each line (the slope of the second - // line is the negative inverse of the first) and then solve for where both formulas have - // the same x/y values. - var a1 = Math.tan( -angle * Math.PI / 180 ), - c1 = a1 * x1 - y1, - a2 = -1 / a1, - c2 = a2 * x2 - y2, - d = a2 - a1, - endX = ( c2 - c1 ) / d, - endY = ( a1 * c2 - a2 * c1 ) / d; - return [ endX, endY ]; - } - }, - - /** - * Find the distance between two points - * @param {Number} p1x - * @param {Number} p1y - * @param {Number} p2x - * @param {Number} p2y - * @return {Number} the distance - */ - distance: function( p1x, p1y, p2x, p2y ) { - var dx = p2x - p1x, - dy = p2y - p1y; - return Math.abs( - dx === 0 ? dy : - dy === 0 ? dx : - Math.sqrt( dx * dx + dy * dy ) - ); - } - -};/** - * - */ -PIE.Observable = function() { - /** - * List of registered observer functions - */ - this.observers = []; - - /** - * Hash of function ids to their position in the observers list, for fast lookup - */ - this.indexes = {}; -}; -PIE.Observable.prototype = { - - observe: function( fn ) { - var id = PIE.Util.getUID( fn ), - indexes = this.indexes, - observers = this.observers; - if( !( id in indexes ) ) { - indexes[ id ] = observers.length; - observers.push( fn ); - } - }, - - unobserve: function( fn ) { - var id = PIE.Util.getUID( fn ), - indexes = this.indexes; - if( id && id in indexes ) { - delete this.observers[ indexes[ id ] ]; - delete indexes[ id ]; - } - }, - - fire: function() { - var o = this.observers, - i = o.length; - while( i-- ) { - o[ i ] && o[ i ](); - } - } - -};/* - * Simple heartbeat timer - this is a brute-force workaround for syncing issues caused by IE not - * always firing the onmove and onresize events when elements are moved or resized. We check a few - * times every second to make sure the elements have the correct position and size. See Element.js - * which adds heartbeat listeners based on the custom -pie-poll flag, which defaults to true in IE8-9 - * and false elsewhere. - */ - -PIE.Heartbeat = new PIE.Observable(); -PIE.Heartbeat.run = function() { - var me = this, - interval; - if( !me.running ) { - interval = doc.documentElement.currentStyle.getAttribute( PIE.CSS_PREFIX + 'poll-interval' ) || 250; - (function beat() { - me.fire(); - setTimeout(beat, interval); - })(); - me.running = 1; - } -}; -/** - * Create an observable listener for the onunload event - */ -(function() { - PIE.OnUnload = new PIE.Observable(); - - function handleUnload() { - PIE.OnUnload.fire(); - window.detachEvent( 'onunload', handleUnload ); - window[ 'PIE' ] = null; - } - - window.attachEvent( 'onunload', handleUnload ); - - /** - * Attach an event which automatically gets detached onunload - */ - PIE.OnUnload.attachManagedEvent = function( target, name, handler ) { - target.attachEvent( name, handler ); - this.observe( function() { - target.detachEvent( name, handler ); - } ); - }; -})()/** - * Create a single observable listener for window resize events. - */ -PIE.OnResize = new PIE.Observable(); - -PIE.OnUnload.attachManagedEvent( window, 'onresize', function() { PIE.OnResize.fire(); } ); -/** - * Create a single observable listener for scroll events. Used for lazy loading based - * on the viewport, and for fixed position backgrounds. - */ -(function() { - PIE.OnScroll = new PIE.Observable(); - - function scrolled() { - PIE.OnScroll.fire(); - } - - PIE.OnUnload.attachManagedEvent( window, 'onscroll', scrolled ); - - PIE.OnResize.observe( scrolled ); -})(); -/** - * Listen for printing events, destroy all active PIE instances when printing, and - * restore them afterward. - */ -(function() { - - var elements; - - function beforePrint() { - elements = PIE.Element.destroyAll(); - } - - function afterPrint() { - if( elements ) { - for( var i = 0, len = elements.length; i < len; i++ ) { - PIE[ 'attach' ]( elements[i] ); - } - elements = 0; - } - } - - if( PIE.ieDocMode < 9 ) { - PIE.OnUnload.attachManagedEvent( window, 'onbeforeprint', beforePrint ); - PIE.OnUnload.attachManagedEvent( window, 'onafterprint', afterPrint ); - } - -})();/** - * Create a single observable listener for document mouseup events. - */ -PIE.OnMouseup = new PIE.Observable(); - -PIE.OnUnload.attachManagedEvent( doc, 'onmouseup', function() { PIE.OnMouseup.fire(); } ); -/** - * Wrapper for length and percentage style values. The value is immutable. A singleton instance per unique - * value is returned from PIE.getLength() - always use that instead of instantiating directly. - * @constructor - * @param {string} val The CSS string representing the length. It is assumed that this will already have - * been validated as a valid length or percentage syntax. - */ -PIE.Length = (function() { - var lengthCalcEl = doc.createElement( 'length-calc' ), - parent = doc.body || doc.documentElement, - s = lengthCalcEl.style, - conversions = {}, - units = [ 'mm', 'cm', 'in', 'pt', 'pc' ], - i = units.length, - instances = {}; - - s.position = 'absolute'; - s.top = s.left = '-9999px'; - - parent.appendChild( lengthCalcEl ); - while( i-- ) { - s.width = '100' + units[i]; - conversions[ units[i] ] = lengthCalcEl.offsetWidth / 100; - } - parent.removeChild( lengthCalcEl ); - - // All calcs from here on will use 1em - s.width = '1em'; - - - function Length( val ) { - this.val = val; - } - Length.prototype = { - /** - * Regular expression for matching the length unit - * @private - */ - unitRE: /(px|em|ex|mm|cm|in|pt|pc|%)$/, - - /** - * Get the numeric value of the length - * @return {number} The value - */ - getNumber: function() { - var num = this.num, - UNDEF; - if( num === UNDEF ) { - num = this.num = parseFloat( this.val ); - } - return num; - }, - - /** - * Get the unit of the length - * @return {string} The unit - */ - getUnit: function() { - var unit = this.unit, - m; - if( !unit ) { - m = this.val.match( this.unitRE ); - unit = this.unit = ( m && m[0] ) || 'px'; - } - return unit; - }, - - /** - * Determine whether this is a percentage length value - * @return {boolean} - */ - isPercentage: function() { - return this.getUnit() === '%'; - }, - - /** - * Resolve this length into a number of pixels. - * @param {Element} el - the context element, used to resolve font-relative values - * @param {(function():number|number)=} pct100 - the number of pixels that equal a 100% percentage. This can be either a number or a - * function which will be called to return the number. - */ - pixels: function( el, pct100 ) { - var num = this.getNumber(), - unit = this.getUnit(); - switch( unit ) { - case "px": - return num; - case "%": - return num * ( typeof pct100 === 'function' ? pct100() : pct100 ) / 100; - case "em": - return num * this.getEmPixels( el ); - case "ex": - return num * this.getEmPixels( el ) / 2; - default: - return num * conversions[ unit ]; - } - }, - - /** - * The em and ex units are relative to the font-size of the current element, - * however if the font-size is set using non-pixel units then we get that value - * rather than a pixel conversion. To get around this, we keep a floating element - * with width:1em which we insert into the target element and then read its offsetWidth. - * For elements that won't accept a child we insert into the parent node and perform - * additional calculation. If the font-size *is* specified in pixels, then we use that - * directly to avoid the expensive DOM manipulation. - * @param {Element} el - * @return {number} - */ - getEmPixels: function( el ) { - var fs = el.currentStyle.fontSize, - px, parent, me; - - if( fs.indexOf( 'px' ) > 0 ) { - return parseFloat( fs ); - } - else if( el.tagName in PIE.childlessElements ) { - me = this; - parent = el.parentNode; - return PIE.getLength( fs ).pixels( parent, function() { - return me.getEmPixels( parent ); - } ); - } - else { - el.appendChild( lengthCalcEl ); - px = lengthCalcEl.offsetWidth; - if( lengthCalcEl.parentNode === el ) { //not sure how this could be false but it sometimes is - el.removeChild( lengthCalcEl ); - } - return px; - } - } - }; - - - /** - * Retrieve a PIE.Length instance for the given value. A shared singleton instance is returned for each unique value. - * @param {string} val The CSS string representing the length. It is assumed that this will already have - * been validated as a valid length or percentage syntax. - */ - PIE.getLength = function( val ) { - return instances[ val ] || ( instances[ val ] = new Length( val ) ); - }; - - return Length; -})(); -/** - * Wrapper for a CSS3 bg-position value. Takes up to 2 position keywords and 2 lengths/percentages. - * @constructor - * @param {Array.} tokens The tokens making up the background position value. - */ -PIE.BgPosition = (function() { - - var length_fifty = PIE.getLength( '50%' ), - vert_idents = { 'top': 1, 'center': 1, 'bottom': 1 }, - horiz_idents = { 'left': 1, 'center': 1, 'right': 1 }; - - - function BgPosition( tokens ) { - this.tokens = tokens; - } - BgPosition.prototype = { - /** - * Normalize the values into the form: - * [ xOffsetSide, xOffsetLength, yOffsetSide, yOffsetLength ] - * where: xOffsetSide is either 'left' or 'right', - * yOffsetSide is either 'top' or 'bottom', - * and x/yOffsetLength are both PIE.Length objects. - * @return {Array} - */ - getValues: function() { - if( !this._values ) { - var tokens = this.tokens, - len = tokens.length, - Tokenizer = PIE.Tokenizer, - identType = Tokenizer.Type, - length_zero = PIE.getLength( '0' ), - type_ident = identType.IDENT, - type_length = identType.LENGTH, - type_percent = identType.PERCENT, - type, value, - vals = [ 'left', length_zero, 'top', length_zero ]; - - // If only one value, the second is assumed to be 'center' - if( len === 1 ) { - tokens.push( new Tokenizer.Token( type_ident, 'center' ) ); - len++; - } - - // Two values - CSS2 - if( len === 2 ) { - // If both idents, they can appear in either order, so switch them if needed - if( type_ident & ( tokens[0].tokenType | tokens[1].tokenType ) && - tokens[0].tokenValue in vert_idents && tokens[1].tokenValue in horiz_idents ) { - tokens.push( tokens.shift() ); - } - if( tokens[0].tokenType & type_ident ) { - if( tokens[0].tokenValue === 'center' ) { - vals[1] = length_fifty; - } else { - vals[0] = tokens[0].tokenValue; - } - } - else if( tokens[0].isLengthOrPercent() ) { - vals[1] = PIE.getLength( tokens[0].tokenValue ); - } - if( tokens[1].tokenType & type_ident ) { - if( tokens[1].tokenValue === 'center' ) { - vals[3] = length_fifty; - } else { - vals[2] = tokens[1].tokenValue; - } - } - else if( tokens[1].isLengthOrPercent() ) { - vals[3] = PIE.getLength( tokens[1].tokenValue ); - } - } - - // Three or four values - CSS3 - else { - // TODO - } - - this._values = vals; - } - return this._values; - }, - - /** - * Find the coordinates of the background image from the upper-left corner of the background area. - * Note that these coordinate values are not rounded. - * @param {Element} el - * @param {number} width - the width for percentages (background area width minus image width) - * @param {number} height - the height for percentages (background area height minus image height) - * @return {Object} { x: Number, y: Number } - */ - coords: function( el, width, height ) { - var vals = this.getValues(), - pxX = vals[1].pixels( el, width ), - pxY = vals[3].pixels( el, height ); - - return { - x: vals[0] === 'right' ? width - pxX : pxX, - y: vals[2] === 'bottom' ? height - pxY : pxY - }; - } - }; - - return BgPosition; -})(); -/** - * Wrapper for a CSS3 background-size value. - * @constructor - * @param {String|PIE.Length} w The width parameter - * @param {String|PIE.Length} h The height parameter, if any - */ -PIE.BgSize = (function() { - - var CONTAIN = 'contain', - COVER = 'cover', - AUTO = 'auto'; - - - function BgSize( w, h ) { - this.w = w; - this.h = h; - } - BgSize.prototype = { - - pixels: function( el, areaW, areaH, imgW, imgH ) { - var me = this, - w = me.w, - h = me.h, - areaRatio = areaW / areaH, - imgRatio = imgW / imgH; - - if ( w === CONTAIN ) { - w = imgRatio > areaRatio ? areaW : areaH * imgRatio; - h = imgRatio > areaRatio ? areaW / imgRatio : areaH; - } - else if ( w === COVER ) { - w = imgRatio < areaRatio ? areaW : areaH * imgRatio; - h = imgRatio < areaRatio ? areaW / imgRatio : areaH; - } - else if ( w === AUTO ) { - h = ( h === AUTO ? imgH : h.pixels( el, areaH ) ); - w = h * imgRatio; - } - else { - w = w.pixels( el, areaW ); - h = ( h === AUTO ? w / imgRatio : h.pixels( el, areaH ) ); - } - - return { w: w, h: h }; - } - - }; - - BgSize.DEFAULT = new BgSize( AUTO, AUTO ); - - return BgSize; -})(); -/** - * Wrapper for angle values; handles conversion to degrees from all allowed angle units - * @constructor - * @param {string} val The raw CSS value for the angle. It is assumed it has been pre-validated. - */ -PIE.Angle = (function() { - function Angle( val ) { - this.val = val; - } - Angle.prototype = { - unitRE: /[a-z]+$/i, - - /** - * @return {string} The unit of the angle value - */ - getUnit: function() { - return this._unit || ( this._unit = this.val.match( this.unitRE )[0].toLowerCase() ); - }, - - /** - * Get the numeric value of the angle in degrees. - * @return {number} The degrees value - */ - degrees: function() { - var deg = this._deg, u, n; - if( deg === undefined ) { - u = this.getUnit(); - n = parseFloat( this.val, 10 ); - deg = this._deg = ( u === 'deg' ? n : u === 'rad' ? n / Math.PI * 180 : u === 'grad' ? n / 400 * 360 : u === 'turn' ? n * 360 : 0 ); - } - return deg; - } - }; - - return Angle; -})();/** - * Abstraction for colors values. Allows detection of rgba values. A singleton instance per unique - * value is returned from PIE.getColor() - always use that instead of instantiating directly. - * @constructor - * @param {string} val The raw CSS string value for the color - */ -PIE.Color = (function() { - var instances = {}; - - function Color( val ) { - this.val = val; - } - - /** - * Regular expression for matching rgba colors and extracting their components - * @type {RegExp} - */ - Color.rgbaRE = /\s*rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d+|\d*\.\d+)\s*\)\s*/; - - Color.names = { - "aliceblue":"F0F8FF", "antiquewhite":"FAEBD7", "aqua":"0FF", - "aquamarine":"7FFFD4", "azure":"F0FFFF", "beige":"F5F5DC", - "bisque":"FFE4C4", "black":"000", "blanchedalmond":"FFEBCD", - "blue":"00F", "blueviolet":"8A2BE2", "brown":"A52A2A", - "burlywood":"DEB887", "cadetblue":"5F9EA0", "chartreuse":"7FFF00", - "chocolate":"D2691E", "coral":"FF7F50", "cornflowerblue":"6495ED", - "cornsilk":"FFF8DC", "crimson":"DC143C", "cyan":"0FF", - "darkblue":"00008B", "darkcyan":"008B8B", "darkgoldenrod":"B8860B", - "darkgray":"A9A9A9", "darkgreen":"006400", "darkkhaki":"BDB76B", - "darkmagenta":"8B008B", "darkolivegreen":"556B2F", "darkorange":"FF8C00", - "darkorchid":"9932CC", "darkred":"8B0000", "darksalmon":"E9967A", - "darkseagreen":"8FBC8F", "darkslateblue":"483D8B", "darkslategray":"2F4F4F", - "darkturquoise":"00CED1", "darkviolet":"9400D3", "deeppink":"FF1493", - "deepskyblue":"00BFFF", "dimgray":"696969", "dodgerblue":"1E90FF", - "firebrick":"B22222", "floralwhite":"FFFAF0", "forestgreen":"228B22", - "fuchsia":"F0F", "gainsboro":"DCDCDC", "ghostwhite":"F8F8FF", - "gold":"FFD700", "goldenrod":"DAA520", "gray":"808080", - "green":"008000", "greenyellow":"ADFF2F", "honeydew":"F0FFF0", - "hotpink":"FF69B4", "indianred":"CD5C5C", "indigo":"4B0082", - "ivory":"FFFFF0", "khaki":"F0E68C", "lavender":"E6E6FA", - "lavenderblush":"FFF0F5", "lawngreen":"7CFC00", "lemonchiffon":"FFFACD", - "lightblue":"ADD8E6", "lightcoral":"F08080", "lightcyan":"E0FFFF", - "lightgoldenrodyellow":"FAFAD2", "lightgreen":"90EE90", "lightgrey":"D3D3D3", - "lightpink":"FFB6C1", "lightsalmon":"FFA07A", "lightseagreen":"20B2AA", - "lightskyblue":"87CEFA", "lightslategray":"789", "lightsteelblue":"B0C4DE", - "lightyellow":"FFFFE0", "lime":"0F0", "limegreen":"32CD32", - "linen":"FAF0E6", "magenta":"F0F", "maroon":"800000", - "mediumauqamarine":"66CDAA", "mediumblue":"0000CD", "mediumorchid":"BA55D3", - "mediumpurple":"9370D8", "mediumseagreen":"3CB371", "mediumslateblue":"7B68EE", - "mediumspringgreen":"00FA9A", "mediumturquoise":"48D1CC", "mediumvioletred":"C71585", - "midnightblue":"191970", "mintcream":"F5FFFA", "mistyrose":"FFE4E1", - "moccasin":"FFE4B5", "navajowhite":"FFDEAD", "navy":"000080", - "oldlace":"FDF5E6", "olive":"808000", "olivedrab":"688E23", - "orange":"FFA500", "orangered":"FF4500", "orchid":"DA70D6", - "palegoldenrod":"EEE8AA", "palegreen":"98FB98", "paleturquoise":"AFEEEE", - "palevioletred":"D87093", "papayawhip":"FFEFD5", "peachpuff":"FFDAB9", - "peru":"CD853F", "pink":"FFC0CB", "plum":"DDA0DD", - "powderblue":"B0E0E6", "purple":"800080", "red":"F00", - "rosybrown":"BC8F8F", "royalblue":"4169E1", "saddlebrown":"8B4513", - "salmon":"FA8072", "sandybrown":"F4A460", "seagreen":"2E8B57", - "seashell":"FFF5EE", "sienna":"A0522D", "silver":"C0C0C0", - "skyblue":"87CEEB", "slateblue":"6A5ACD", "slategray":"708090", - "snow":"FFFAFA", "springgreen":"00FF7F", "steelblue":"4682B4", - "tan":"D2B48C", "teal":"008080", "thistle":"D8BFD8", - "tomato":"FF6347", "turquoise":"40E0D0", "violet":"EE82EE", - "wheat":"F5DEB3", "white":"FFF", "whitesmoke":"F5F5F5", - "yellow":"FF0", "yellowgreen":"9ACD32" - }; - - Color.prototype = { - /** - * @private - */ - parse: function() { - if( !this._color ) { - var me = this, - v = me.val, - vLower, - m = v.match( Color.rgbaRE ); - if( m ) { - me._color = 'rgb(' + m[1] + ',' + m[2] + ',' + m[3] + ')'; - me._alpha = parseFloat( m[4] ); - } - else { - if( ( vLower = v.toLowerCase() ) in Color.names ) { - v = '#' + Color.names[vLower]; - } - me._color = v; - me._alpha = ( v === 'transparent' ? 0 : 1 ); - } - } - }, - - /** - * Retrieve the value of the color in a format usable by IE natively. This will be the same as - * the raw input value, except for rgba values which will be converted to an rgb value. - * @param {Element} el The context element, used to get 'currentColor' keyword value. - * @return {string} Color value - */ - colorValue: function( el ) { - this.parse(); - return this._color === 'currentColor' ? el.currentStyle.color : this._color; - }, - - /** - * Retrieve the alpha value of the color. Will be 1 for all values except for rgba values - * with an alpha component. - * @return {number} The alpha value, from 0 to 1. - */ - alpha: function() { - this.parse(); - return this._alpha; - } - }; - - - /** - * Retrieve a PIE.Color instance for the given value. A shared singleton instance is returned for each unique value. - * @param {string} val The CSS string representing the color. It is assumed that this will already have - * been validated as a valid color syntax. - */ - PIE.getColor = function(val) { - return instances[ val ] || ( instances[ val ] = new Color( val ) ); - }; - - return Color; -})();/** - * A tokenizer for CSS value strings. - * @constructor - * @param {string} css The CSS value string - */ -PIE.Tokenizer = (function() { - function Tokenizer( css ) { - this.css = css; - this.ch = 0; - this.tokens = []; - this.tokenIndex = 0; - } - - /** - * Enumeration of token type constants. - * @enum {number} - */ - var Type = Tokenizer.Type = { - ANGLE: 1, - CHARACTER: 2, - COLOR: 4, - DIMEN: 8, - FUNCTION: 16, - IDENT: 32, - LENGTH: 64, - NUMBER: 128, - OPERATOR: 256, - PERCENT: 512, - STRING: 1024, - URL: 2048 - }; - - /** - * A single token - * @constructor - * @param {number} type The type of the token - see PIE.Tokenizer.Type - * @param {string} value The value of the token - */ - Tokenizer.Token = function( type, value ) { - this.tokenType = type; - this.tokenValue = value; - }; - Tokenizer.Token.prototype = { - isLength: function() { - return this.tokenType & Type.LENGTH || ( this.tokenType & Type.NUMBER && this.tokenValue === '0' ); - }, - isLengthOrPercent: function() { - return this.isLength() || this.tokenType & Type.PERCENT; - } - }; - - Tokenizer.prototype = { - whitespace: /\s/, - number: /^[\+\-]?(\d*\.)?\d+/, - url: /^url\(\s*("([^"]*)"|'([^']*)'|([!#$%&*-~]*))\s*\)/i, - ident: /^\-?[_a-z][\w-]*/i, - string: /^("([^"]*)"|'([^']*)')/, - operator: /^[\/,]/, - hash: /^#[\w]+/, - hashColor: /^#([\da-f]{6}|[\da-f]{3})/i, - - unitTypes: { - 'px': Type.LENGTH, 'em': Type.LENGTH, 'ex': Type.LENGTH, - 'mm': Type.LENGTH, 'cm': Type.LENGTH, 'in': Type.LENGTH, - 'pt': Type.LENGTH, 'pc': Type.LENGTH, - 'deg': Type.ANGLE, 'rad': Type.ANGLE, 'grad': Type.ANGLE - }, - - colorFunctions: { - 'rgb': 1, 'rgba': 1, 'hsl': 1, 'hsla': 1 - }, - - - /** - * Advance to and return the next token in the CSS string. If the end of the CSS string has - * been reached, null will be returned. - * @param {boolean} forget - if true, the token will not be stored for the purposes of backtracking with prev(). - * @return {PIE.Tokenizer.Token} - */ - next: function( forget ) { - var css, ch, firstChar, match, val, - me = this; - - function newToken( type, value ) { - var tok = new Tokenizer.Token( type, value ); - if( !forget ) { - me.tokens.push( tok ); - me.tokenIndex++; - } - return tok; - } - function failure() { - me.tokenIndex++; - return null; - } - - // In case we previously backed up, return the stored token in the next slot - if( this.tokenIndex < this.tokens.length ) { - return this.tokens[ this.tokenIndex++ ]; - } - - // Move past leading whitespace characters - while( this.whitespace.test( this.css.charAt( this.ch ) ) ) { - this.ch++; - } - if( this.ch >= this.css.length ) { - return failure(); - } - - ch = this.ch; - css = this.css.substring( this.ch ); - firstChar = css.charAt( 0 ); - switch( firstChar ) { - case '#': - if( match = css.match( this.hashColor ) ) { - this.ch += match[0].length; - return newToken( Type.COLOR, match[0] ); - } - break; - - case '"': - case "'": - if( match = css.match( this.string ) ) { - this.ch += match[0].length; - return newToken( Type.STRING, match[2] || match[3] || '' ); - } - break; - - case "/": - case ",": - this.ch++; - return newToken( Type.OPERATOR, firstChar ); - - case 'u': - if( match = css.match( this.url ) ) { - this.ch += match[0].length; - return newToken( Type.URL, match[2] || match[3] || match[4] || '' ); - } - } - - // Numbers and values starting with numbers - if( match = css.match( this.number ) ) { - val = match[0]; - this.ch += val.length; - - // Check if it is followed by a unit - if( css.charAt( val.length ) === '%' ) { - this.ch++; - return newToken( Type.PERCENT, val + '%' ); - } - if( match = css.substring( val.length ).match( this.ident ) ) { - val += match[0]; - this.ch += match[0].length; - return newToken( this.unitTypes[ match[0].toLowerCase() ] || Type.DIMEN, val ); - } - - // Plain ol' number - return newToken( Type.NUMBER, val ); - } - - // Identifiers - if( match = css.match( this.ident ) ) { - val = match[0]; - this.ch += val.length; - - // Named colors - if( val.toLowerCase() in PIE.Color.names || val === 'currentColor' || val === 'transparent' ) { - return newToken( Type.COLOR, val ); - } - - // Functions - if( css.charAt( val.length ) === '(' ) { - this.ch++; - - // Color values in function format: rgb, rgba, hsl, hsla - if( val.toLowerCase() in this.colorFunctions ) { - function isNum( tok ) { - return tok && tok.tokenType & Type.NUMBER; - } - function isNumOrPct( tok ) { - return tok && ( tok.tokenType & ( Type.NUMBER | Type.PERCENT ) ); - } - function isValue( tok, val ) { - return tok && tok.tokenValue === val; - } - function next() { - return me.next( 1 ); - } - - if( ( val.charAt(0) === 'r' ? isNumOrPct( next() ) : isNum( next() ) ) && - isValue( next(), ',' ) && - isNumOrPct( next() ) && - isValue( next(), ',' ) && - isNumOrPct( next() ) && - ( val === 'rgb' || val === 'hsa' || ( - isValue( next(), ',' ) && - isNum( next() ) - ) ) && - isValue( next(), ')' ) ) { - return newToken( Type.COLOR, this.css.substring( ch, this.ch ) ); - } - return failure(); - } - - return newToken( Type.FUNCTION, val ); - } - - // Other identifier - return newToken( Type.IDENT, val ); - } - - // Standalone character - this.ch++; - return newToken( Type.CHARACTER, firstChar ); - }, - - /** - * Determine whether there is another token - * @return {boolean} - */ - hasNext: function() { - var next = this.next(); - this.prev(); - return !!next; - }, - - /** - * Back up and return the previous token - * @return {PIE.Tokenizer.Token} - */ - prev: function() { - return this.tokens[ this.tokenIndex-- - 2 ]; - }, - - /** - * Retrieve all the tokens in the CSS string - * @return {Array.} - */ - all: function() { - while( this.next() ) {} - return this.tokens; - }, - - /** - * Return a list of tokens from the current position until the given function returns - * true. The final token will not be included in the list. - * @param {function():boolean} func - test function - * @param {boolean} require - if true, then if the end of the CSS string is reached - * before the test function returns true, null will be returned instead of the - * tokens that have been found so far. - * @return {Array.} - */ - until: function( func, require ) { - var list = [], t, hit; - while( t = this.next() ) { - if( func( t ) ) { - hit = true; - this.prev(); - break; - } - list.push( t ); - } - return require && !hit ? null : list; - } - }; - - return Tokenizer; -})();/** - * Handles calculating, caching, and detecting changes to size and position of the element. - * @constructor - * @param {Element} el the target element - */ -PIE.BoundsInfo = function( el ) { - this.targetElement = el; -}; -PIE.BoundsInfo.prototype = { - - _locked: 0, - - positionChanged: function() { - var last = this._lastBounds, - bounds; - return !last || ( ( bounds = this.getBounds() ) && ( last.x !== bounds.x || last.y !== bounds.y ) ); - }, - - sizeChanged: function() { - var last = this._lastBounds, - bounds; - return !last || ( ( bounds = this.getBounds() ) && ( last.w !== bounds.w || last.h !== bounds.h ) ); - }, - - getLiveBounds: function() { - var el = this.targetElement, - rect = el.getBoundingClientRect(), - isIE9 = PIE.ieDocMode === 9, - isIE7 = PIE.ieVersion === 7, - width = rect.right - rect.left; - return { - x: rect.left, - y: rect.top, - // In some cases scrolling the page will cause IE9 to report incorrect dimensions - // in the rect returned by getBoundingClientRect, so we must query offsetWidth/Height - // instead. Also IE7 is inconsistent in using logical vs. device pixels in measurements - // so we must calculate the ratio and use it in certain places as a position adjustment. - w: isIE9 || isIE7 ? el.offsetWidth : width, - h: isIE9 || isIE7 ? el.offsetHeight : rect.bottom - rect.top, - logicalZoomRatio: ( isIE7 && width ) ? el.offsetWidth / width : 1 - }; - }, - - getBounds: function() { - return this._locked ? - ( this._lockedBounds || ( this._lockedBounds = this.getLiveBounds() ) ) : - this.getLiveBounds(); - }, - - hasBeenQueried: function() { - return !!this._lastBounds; - }, - - lock: function() { - ++this._locked; - }, - - unlock: function() { - if( !--this._locked ) { - if( this._lockedBounds ) this._lastBounds = this._lockedBounds; - this._lockedBounds = null; - } - } - -}; -(function() { - -function cacheWhenLocked( fn ) { - var uid = PIE.Util.getUID( fn ); - return function() { - if( this._locked ) { - var cache = this._lockedValues || ( this._lockedValues = {} ); - return ( uid in cache ) ? cache[ uid ] : ( cache[ uid ] = fn.call( this ) ); - } else { - return fn.call( this ); - } - } -} - - -PIE.StyleInfoBase = { - - _locked: 0, - - /** - * Create a new StyleInfo class, with the standard constructor, and augmented by - * the StyleInfoBase's members. - * @param proto - */ - newStyleInfo: function( proto ) { - function StyleInfo( el ) { - this.targetElement = el; - this._lastCss = this.getCss(); - } - PIE.Util.merge( StyleInfo.prototype, PIE.StyleInfoBase, proto ); - StyleInfo._propsCache = {}; - return StyleInfo; - }, - - /** - * Get an object representation of the target CSS style, caching it for each unique - * CSS value string. - * @return {Object} - */ - getProps: function() { - var css = this.getCss(), - cache = this.constructor._propsCache; - return css ? ( css in cache ? cache[ css ] : ( cache[ css ] = this.parseCss( css ) ) ) : null; - }, - - /** - * Get the raw CSS value for the target style - * @return {string} - */ - getCss: cacheWhenLocked( function() { - var el = this.targetElement, - ctor = this.constructor, - s = el.style, - cs = el.currentStyle, - cssProp = this.cssProperty, - styleProp = this.styleProperty, - prefixedCssProp = ctor._prefixedCssProp || ( ctor._prefixedCssProp = PIE.CSS_PREFIX + cssProp ), - prefixedStyleProp = ctor._prefixedStyleProp || ( ctor._prefixedStyleProp = PIE.STYLE_PREFIX + styleProp.charAt(0).toUpperCase() + styleProp.substring(1) ); - return s[ prefixedStyleProp ] || cs.getAttribute( prefixedCssProp ) || s[ styleProp ] || cs.getAttribute( cssProp ); - } ), - - /** - * Determine whether the target CSS style is active. - * @return {boolean} - */ - isActive: cacheWhenLocked( function() { - return !!this.getProps(); - } ), - - /** - * Determine whether the target CSS style has changed since the last time it was used. - * @return {boolean} - */ - changed: cacheWhenLocked( function() { - var currentCss = this.getCss(), - changed = currentCss !== this._lastCss; - this._lastCss = currentCss; - return changed; - } ), - - cacheWhenLocked: cacheWhenLocked, - - lock: function() { - ++this._locked; - }, - - unlock: function() { - if( !--this._locked ) { - delete this._lockedValues; - } - } -}; - -})();/** - * Handles parsing, caching, and detecting changes to background (and -pie-background) CSS - * @constructor - * @param {Element} el the target element - */ -PIE.BackgroundStyleInfo = PIE.StyleInfoBase.newStyleInfo( { - - cssProperty: PIE.CSS_PREFIX + 'background', - styleProperty: PIE.STYLE_PREFIX + 'Background', - - attachIdents: { 'scroll':1, 'fixed':1, 'local':1 }, - repeatIdents: { 'repeat-x':1, 'repeat-y':1, 'repeat':1, 'no-repeat':1 }, - originAndClipIdents: { 'padding-box':1, 'border-box':1, 'content-box':1 }, - positionIdents: { 'top':1, 'right':1, 'bottom':1, 'left':1, 'center':1 }, - sizeIdents: { 'contain':1, 'cover':1 }, - propertyNames: { - CLIP: 'backgroundClip', - COLOR: 'backgroundColor', - IMAGE: 'backgroundImage', - ORIGIN: 'backgroundOrigin', - POSITION: 'backgroundPosition', - REPEAT: 'backgroundRepeat', - SIZE: 'backgroundSize' - }, - - /** - * For background styles, we support the -pie-background property but fall back to the standard - * backround* properties. The reason we have to use the prefixed version is that IE natively - * parses the standard properties and if it sees something it doesn't know how to parse, for example - * multiple values or gradient definitions, it will throw that away and not make it available through - * currentStyle. - * - * Format of return object: - * { - * color: , - * bgImages: [ - * { - * imgType: 'image', - * imgUrl: 'image.png', - * imgRepeat: <'no-repeat' | 'repeat-x' | 'repeat-y' | 'repeat'>, - * bgPosition: , - * bgAttachment: <'scroll' | 'fixed' | 'local'>, - * bgOrigin: <'border-box' | 'padding-box' | 'content-box'>, - * bgClip: <'border-box' | 'padding-box'>, - * bgSize: , - * origString: 'url(img.png) no-repeat top left' - * }, - * { - * imgType: 'linear-gradient', - * gradientStart: , - * angle: , - * stops: [ - * { color: , offset: }, - * { color: , offset: }, ... - * ] - * } - * ] - * } - * @param {String} css - * @override - */ - parseCss: function( css ) { - var el = this.targetElement, - cs = el.currentStyle, - tokenizer, token, image, - tok_type = PIE.Tokenizer.Type, - type_operator = tok_type.OPERATOR, - type_ident = tok_type.IDENT, - type_color = tok_type.COLOR, - tokType, tokVal, - beginCharIndex = 0, - positionIdents = this.positionIdents, - gradient, stop, width, height, - props = { bgImages: [] }; - - function isBgPosToken( token ) { - return token && token.isLengthOrPercent() || ( token.tokenType & type_ident && token.tokenValue in positionIdents ); - } - - function sizeToken( token ) { - return token && ( ( token.isLengthOrPercent() && PIE.getLength( token.tokenValue ) ) || ( token.tokenValue === 'auto' && 'auto' ) ); - } - - // If the CSS3-specific -pie-background property is present, parse it - if( this.getCss3() ) { - tokenizer = new PIE.Tokenizer( css ); - image = {}; - - while( token = tokenizer.next() ) { - tokType = token.tokenType; - tokVal = token.tokenValue; - - if( !image.imgType && tokType & tok_type.FUNCTION && tokVal === 'linear-gradient' ) { - gradient = { stops: [], imgType: tokVal }; - stop = {}; - while( token = tokenizer.next() ) { - tokType = token.tokenType; - tokVal = token.tokenValue; - - // If we reached the end of the function and had at least 2 stops, flush the info - if( tokType & tok_type.CHARACTER && tokVal === ')' ) { - if( stop.color ) { - gradient.stops.push( stop ); - } - if( gradient.stops.length > 1 ) { - PIE.Util.merge( image, gradient ); - } - break; - } - - // Color stop - must start with color - if( tokType & type_color ) { - // if we already have an angle/position, make sure that the previous token was a comma - if( gradient.angle || gradient.gradientStart ) { - token = tokenizer.prev(); - if( token.tokenType !== type_operator ) { - break; //fail - } - tokenizer.next(); - } - - stop = { - color: PIE.getColor( tokVal ) - }; - // check for offset following color - token = tokenizer.next(); - if( token.isLengthOrPercent() ) { - stop.offset = PIE.getLength( token.tokenValue ); - } else { - tokenizer.prev(); - } - } - // Angle - can only appear in first spot - else if( tokType & tok_type.ANGLE && !gradient.angle && !stop.color && !gradient.stops.length ) { - gradient.angle = new PIE.Angle( token.tokenValue ); - } - else if( isBgPosToken( token ) && !gradient.gradientStart && !stop.color && !gradient.stops.length ) { - tokenizer.prev(); - gradient.gradientStart = new PIE.BgPosition( - tokenizer.until( function( t ) { - return !isBgPosToken( t ); - }, false ) - ); - } - else if( tokType & type_operator && tokVal === ',' ) { - if( stop.color ) { - gradient.stops.push( stop ); - stop = {}; - } - } - else { - // Found something we didn't recognize; fail without adding image - break; - } - } - } - else if( !image.imgType && tokType & tok_type.URL ) { - image.imgUrl = tokVal; - image.imgType = 'image'; - } - else if( isBgPosToken( token ) && !image.bgPosition ) { - tokenizer.prev(); - image.bgPosition = new PIE.BgPosition( - tokenizer.until( function( t ) { - return !isBgPosToken( t ); - }, false ) - ); - } - else if( tokType & type_ident ) { - if( tokVal in this.repeatIdents && !image.imgRepeat ) { - image.imgRepeat = tokVal; - } - else if( tokVal in this.originAndClipIdents && !image.bgOrigin ) { - image.bgOrigin = tokVal; - if( ( token = tokenizer.next() ) && ( token.tokenType & type_ident ) && - token.tokenValue in this.originAndClipIdents ) { - image.bgClip = token.tokenValue; - } else { - image.bgClip = tokVal; - tokenizer.prev(); - } - } - else if( tokVal in this.attachIdents && !image.bgAttachment ) { - image.bgAttachment = tokVal; - } - else { - return null; - } - } - else if( tokType & type_color && !props.color ) { - props.color = PIE.getColor( tokVal ); - } - else if( tokType & type_operator && tokVal === '/' && !image.bgSize && image.bgPosition ) { - // background size - token = tokenizer.next(); - if( token.tokenType & type_ident && token.tokenValue in this.sizeIdents ) { - image.bgSize = new PIE.BgSize( token.tokenValue ); - } - else if( width = sizeToken( token ) ) { - height = sizeToken( tokenizer.next() ); - if ( !height ) { - height = width; - tokenizer.prev(); - } - image.bgSize = new PIE.BgSize( width, height ); - } - else { - return null; - } - } - // new layer - else if( tokType & type_operator && tokVal === ',' && image.imgType ) { - image.origString = css.substring( beginCharIndex, tokenizer.ch - 1 ); - beginCharIndex = tokenizer.ch; - props.bgImages.push( image ); - image = {}; - } - else { - // Found something unrecognized; chuck everything - return null; - } - } - - // leftovers - if( image.imgType ) { - image.origString = css.substring( beginCharIndex ); - props.bgImages.push( image ); - } - } - - // Otherwise, use the standard background properties; let IE give us the values rather than parsing them - else { - this.withActualBg( PIE.ieDocMode < 9 ? - function() { - var propNames = this.propertyNames, - posX = cs[propNames.POSITION + 'X'], - posY = cs[propNames.POSITION + 'Y'], - img = cs[propNames.IMAGE], - color = cs[propNames.COLOR]; - - if( color !== 'transparent' ) { - props.color = PIE.getColor( color ) - } - if( img !== 'none' ) { - props.bgImages = [ { - imgType: 'image', - imgUrl: new PIE.Tokenizer( img ).next().tokenValue, - imgRepeat: cs[propNames.REPEAT], - bgPosition: new PIE.BgPosition( new PIE.Tokenizer( posX + ' ' + posY ).all() ) - } ]; - } - } : - function() { - var propNames = this.propertyNames, - splitter = /\s*,\s*/, - images = cs[propNames.IMAGE].split( splitter ), - color = cs[propNames.COLOR], - repeats, positions, origins, clips, sizes, i, len, image, sizeParts; - - if( color !== 'transparent' ) { - props.color = PIE.getColor( color ) - } - - len = images.length; - if( len && images[0] !== 'none' ) { - repeats = cs[propNames.REPEAT].split( splitter ); - positions = cs[propNames.POSITION].split( splitter ); - origins = cs[propNames.ORIGIN].split( splitter ); - clips = cs[propNames.CLIP].split( splitter ); - sizes = cs[propNames.SIZE].split( splitter ); - - props.bgImages = []; - for( i = 0; i < len; i++ ) { - image = images[ i ]; - if( image && image !== 'none' ) { - sizeParts = sizes[i].split( ' ' ); - props.bgImages.push( { - origString: image + ' ' + repeats[ i ] + ' ' + positions[ i ] + ' / ' + sizes[ i ] + ' ' + - origins[ i ] + ' ' + clips[ i ], - imgType: 'image', - imgUrl: new PIE.Tokenizer( image ).next().tokenValue, - imgRepeat: repeats[ i ], - bgPosition: new PIE.BgPosition( new PIE.Tokenizer( positions[ i ] ).all() ), - bgOrigin: origins[ i ], - bgClip: clips[ i ], - bgSize: new PIE.BgSize( sizeParts[ 0 ], sizeParts[ 1 ] ) - } ); - } - } - } - } - ); - } - - return ( props.color || props.bgImages[0] ) ? props : null; - }, - - /** - * Execute a function with the actual background styles (not overridden with runtimeStyle - * properties set by the renderers) available via currentStyle. - * @param fn - */ - withActualBg: function( fn ) { - var isIE9 = PIE.ieDocMode > 8, - propNames = this.propertyNames, - rs = this.targetElement.runtimeStyle, - rsImage = rs[propNames.IMAGE], - rsColor = rs[propNames.COLOR], - rsRepeat = rs[propNames.REPEAT], - rsClip, rsOrigin, rsSize, rsPosition, ret; - - if( rsImage ) rs[propNames.IMAGE] = ''; - if( rsColor ) rs[propNames.COLOR] = ''; - if( rsRepeat ) rs[propNames.REPEAT] = ''; - if( isIE9 ) { - rsClip = rs[propNames.CLIP]; - rsOrigin = rs[propNames.ORIGIN]; - rsPosition = rs[propNames.POSITION]; - rsSize = rs[propNames.SIZE]; - if( rsClip ) rs[propNames.CLIP] = ''; - if( rsOrigin ) rs[propNames.ORIGIN] = ''; - if( rsPosition ) rs[propNames.POSITION] = ''; - if( rsSize ) rs[propNames.SIZE] = ''; - } - - ret = fn.call( this ); - - if( rsImage ) rs[propNames.IMAGE] = rsImage; - if( rsColor ) rs[propNames.COLOR] = rsColor; - if( rsRepeat ) rs[propNames.REPEAT] = rsRepeat; - if( isIE9 ) { - if( rsClip ) rs[propNames.CLIP] = rsClip; - if( rsOrigin ) rs[propNames.ORIGIN] = rsOrigin; - if( rsPosition ) rs[propNames.POSITION] = rsPosition; - if( rsSize ) rs[propNames.SIZE] = rsSize; - } - - return ret; - }, - - getCss: PIE.StyleInfoBase.cacheWhenLocked( function() { - return this.getCss3() || - this.withActualBg( function() { - var cs = this.targetElement.currentStyle, - propNames = this.propertyNames; - return cs[propNames.COLOR] + ' ' + cs[propNames.IMAGE] + ' ' + cs[propNames.REPEAT] + ' ' + - cs[propNames.POSITION + 'X'] + ' ' + cs[propNames.POSITION + 'Y']; - } ); - } ), - - getCss3: PIE.StyleInfoBase.cacheWhenLocked( function() { - var el = this.targetElement; - return el.style[ this.styleProperty ] || el.currentStyle.getAttribute( this.cssProperty ); - } ), - - /** - * Tests if style.PiePngFix or the -pie-png-fix property is set to true in IE6. - */ - isPngFix: function() { - var val = 0, el; - if( PIE.ieVersion < 7 ) { - el = this.targetElement; - val = ( '' + ( el.style[ PIE.STYLE_PREFIX + 'PngFix' ] || el.currentStyle.getAttribute( PIE.CSS_PREFIX + 'png-fix' ) ) === 'true' ); - } - return val; - }, - - /** - * The isActive logic is slightly different, because getProps() always returns an object - * even if it is just falling back to the native background properties. But we only want - * to report is as being "active" if either the -pie-background override property is present - * and parses successfully or '-pie-png-fix' is set to true in IE6. - */ - isActive: PIE.StyleInfoBase.cacheWhenLocked( function() { - return (this.getCss3() || this.isPngFix()) && !!this.getProps(); - } ) - -} );/** - * Handles parsing, caching, and detecting changes to border CSS - * @constructor - * @param {Element} el the target element - */ -PIE.BorderStyleInfo = PIE.StyleInfoBase.newStyleInfo( { - - sides: [ 'Top', 'Right', 'Bottom', 'Left' ], - namedWidths: { - 'thin': '1px', - 'medium': '3px', - 'thick': '5px' - }, - - parseCss: function( css ) { - var w = {}, - s = {}, - c = {}, - active = false, - colorsSame = true, - stylesSame = true, - widthsSame = true; - - this.withActualBorder( function() { - var el = this.targetElement, - cs = el.currentStyle, - i = 0, - style, color, width, lastStyle, lastColor, lastWidth, side, ltr; - for( ; i < 4; i++ ) { - side = this.sides[ i ]; - - ltr = side.charAt(0).toLowerCase(); - style = s[ ltr ] = cs[ 'border' + side + 'Style' ]; - color = cs[ 'border' + side + 'Color' ]; - width = cs[ 'border' + side + 'Width' ]; - - if( i > 0 ) { - if( style !== lastStyle ) { stylesSame = false; } - if( color !== lastColor ) { colorsSame = false; } - if( width !== lastWidth ) { widthsSame = false; } - } - lastStyle = style; - lastColor = color; - lastWidth = width; - - c[ ltr ] = PIE.getColor( color ); - - width = w[ ltr ] = PIE.getLength( s[ ltr ] === 'none' ? '0' : ( this.namedWidths[ width ] || width ) ); - if( width.pixels( this.targetElement ) > 0 ) { - active = true; - } - } - } ); - - return active ? { - widths: w, - styles: s, - colors: c, - widthsSame: widthsSame, - colorsSame: colorsSame, - stylesSame: stylesSame - } : null; - }, - - getCss: PIE.StyleInfoBase.cacheWhenLocked( function() { - var el = this.targetElement, - cs = el.currentStyle, - css; - - // Don't redraw or hide borders for cells in border-collapse:collapse tables - if( !( el.tagName in PIE.tableCellTags && el.offsetParent.currentStyle.borderCollapse === 'collapse' ) ) { - this.withActualBorder( function() { - css = cs.borderWidth + '|' + cs.borderStyle + '|' + cs.borderColor; - } ); - } - return css; - } ), - - /** - * Execute a function with the actual border styles (not overridden with runtimeStyle - * properties set by the renderers) available via currentStyle. - * @param fn - */ - withActualBorder: function( fn ) { - var rs = this.targetElement.runtimeStyle, - rsWidth = rs.borderWidth, - rsColor = rs.borderColor, - ret; - - if( rsWidth ) rs.borderWidth = ''; - if( rsColor ) rs.borderColor = ''; - - ret = fn.call( this ); - - if( rsWidth ) rs.borderWidth = rsWidth; - if( rsColor ) rs.borderColor = rsColor; - - return ret; - } - -} ); -/** - * Handles parsing, caching, and detecting changes to border-radius CSS - * @constructor - * @param {Element} el the target element - */ -(function() { - -PIE.BorderRadiusStyleInfo = PIE.StyleInfoBase.newStyleInfo( { - - cssProperty: 'border-radius', - styleProperty: 'borderRadius', - - parseCss: function( css ) { - var p = null, x, y, - tokenizer, token, length, - hasNonZero = false; - - if( css ) { - tokenizer = new PIE.Tokenizer( css ); - - function collectLengths() { - var arr = [], num; - while( ( token = tokenizer.next() ) && token.isLengthOrPercent() ) { - length = PIE.getLength( token.tokenValue ); - num = length.getNumber(); - if( num < 0 ) { - return null; - } - if( num > 0 ) { - hasNonZero = true; - } - arr.push( length ); - } - return arr.length > 0 && arr.length < 5 ? { - 'tl': arr[0], - 'tr': arr[1] || arr[0], - 'br': arr[2] || arr[0], - 'bl': arr[3] || arr[1] || arr[0] - } : null; - } - - // Grab the initial sequence of lengths - if( x = collectLengths() ) { - // See if there is a slash followed by more lengths, for the y-axis radii - if( token ) { - if( token.tokenType & PIE.Tokenizer.Type.OPERATOR && token.tokenValue === '/' ) { - y = collectLengths(); - } - } else { - y = x; - } - - // Treat all-zero values the same as no value - if( hasNonZero && x && y ) { - p = { x: x, y : y }; - } - } - } - - return p; - } -} ); - -var zero = PIE.getLength( '0' ), - zeros = { 'tl': zero, 'tr': zero, 'br': zero, 'bl': zero }; -PIE.BorderRadiusStyleInfo.ALL_ZERO = { x: zeros, y: zeros }; - -})();/** - * Handles parsing, caching, and detecting changes to border-image CSS - * @constructor - * @param {Element} el the target element - */ -PIE.BorderImageStyleInfo = PIE.StyleInfoBase.newStyleInfo( { - - cssProperty: 'border-image', - styleProperty: 'borderImage', - - repeatIdents: { 'stretch':1, 'round':1, 'repeat':1, 'space':1 }, - - parseCss: function( css ) { - var p = null, tokenizer, token, type, value, - slices, widths, outsets, - slashCount = 0, - Type = PIE.Tokenizer.Type, - IDENT = Type.IDENT, - NUMBER = Type.NUMBER, - PERCENT = Type.PERCENT; - - if( css ) { - tokenizer = new PIE.Tokenizer( css ); - p = {}; - - function isSlash( token ) { - return token && ( token.tokenType & Type.OPERATOR ) && ( token.tokenValue === '/' ); - } - - function isFillIdent( token ) { - return token && ( token.tokenType & IDENT ) && ( token.tokenValue === 'fill' ); - } - - function collectSlicesEtc() { - slices = tokenizer.until( function( tok ) { - return !( tok.tokenType & ( NUMBER | PERCENT ) ); - } ); - - if( isFillIdent( tokenizer.next() ) && !p.fill ) { - p.fill = true; - } else { - tokenizer.prev(); - } - - if( isSlash( tokenizer.next() ) ) { - slashCount++; - widths = tokenizer.until( function( token ) { - return !token.isLengthOrPercent() && !( ( token.tokenType & IDENT ) && token.tokenValue === 'auto' ); - } ); - - if( isSlash( tokenizer.next() ) ) { - slashCount++; - outsets = tokenizer.until( function( token ) { - return !token.isLength(); - } ); - } - } else { - tokenizer.prev(); - } - } - - while( token = tokenizer.next() ) { - type = token.tokenType; - value = token.tokenValue; - - // Numbers and/or 'fill' keyword: slice values. May be followed optionally by width values, followed optionally by outset values - if( type & ( NUMBER | PERCENT ) && !slices ) { - tokenizer.prev(); - collectSlicesEtc(); - } - else if( isFillIdent( token ) && !p.fill ) { - p.fill = true; - collectSlicesEtc(); - } - - // Idents: one or values for 'repeat' - else if( ( type & IDENT ) && this.repeatIdents[value] && !p.repeat ) { - p.repeat = { h: value }; - if( token = tokenizer.next() ) { - if( ( token.tokenType & IDENT ) && this.repeatIdents[token.tokenValue] ) { - p.repeat.v = token.tokenValue; - } else { - tokenizer.prev(); - } - } - } - - // URL of the image - else if( ( type & Type.URL ) && !p.src ) { - p.src = value; - } - - // Found something unrecognized; exit. - else { - return null; - } - } - - // Validate what we collected - if( !p.src || !slices || slices.length < 1 || slices.length > 4 || - ( widths && widths.length > 4 ) || ( slashCount === 1 && widths.length < 1 ) || - ( outsets && outsets.length > 4 ) || ( slashCount === 2 && outsets.length < 1 ) ) { - return null; - } - - // Fill in missing values - if( !p.repeat ) { - p.repeat = { h: 'stretch' }; - } - if( !p.repeat.v ) { - p.repeat.v = p.repeat.h; - } - - function distributeSides( tokens, convertFn ) { - return { - 't': convertFn( tokens[0] ), - 'r': convertFn( tokens[1] || tokens[0] ), - 'b': convertFn( tokens[2] || tokens[0] ), - 'l': convertFn( tokens[3] || tokens[1] || tokens[0] ) - }; - } - - p.slice = distributeSides( slices, function( tok ) { - return PIE.getLength( ( tok.tokenType & NUMBER ) ? tok.tokenValue + 'px' : tok.tokenValue ); - } ); - - if( widths && widths[0] ) { - p.widths = distributeSides( widths, function( tok ) { - return tok.isLengthOrPercent() ? PIE.getLength( tok.tokenValue ) : tok.tokenValue; - } ); - } - - if( outsets && outsets[0] ) { - p.outset = distributeSides( outsets, function( tok ) { - return tok.isLength() ? PIE.getLength( tok.tokenValue ) : tok.tokenValue; - } ); - } - } - - return p; - } - -} );/** - * Handles parsing, caching, and detecting changes to box-shadow CSS - * @constructor - * @param {Element} el the target element - */ -PIE.BoxShadowStyleInfo = PIE.StyleInfoBase.newStyleInfo( { - - cssProperty: 'box-shadow', - styleProperty: 'boxShadow', - - parseCss: function( css ) { - var props, - getLength = PIE.getLength, - Type = PIE.Tokenizer.Type, - tokenizer; - - if( css ) { - tokenizer = new PIE.Tokenizer( css ); - props = { outset: [], inset: [] }; - - function parseItem() { - var token, type, value, color, lengths, inset, len; - - while( token = tokenizer.next() ) { - value = token.tokenValue; - type = token.tokenType; - - if( type & Type.OPERATOR && value === ',' ) { - break; - } - else if( token.isLength() && !lengths ) { - tokenizer.prev(); - lengths = tokenizer.until( function( token ) { - return !token.isLength(); - } ); - } - else if( type & Type.COLOR && !color ) { - color = value; - } - else if( type & Type.IDENT && value === 'inset' && !inset ) { - inset = true; - } - else { //encountered an unrecognized token; fail. - return false; - } - } - - len = lengths && lengths.length; - if( len > 1 && len < 5 ) { - ( inset ? props.inset : props.outset ).push( { - xOffset: getLength( lengths[0].tokenValue ), - yOffset: getLength( lengths[1].tokenValue ), - blur: getLength( lengths[2] ? lengths[2].tokenValue : '0' ), - spread: getLength( lengths[3] ? lengths[3].tokenValue : '0' ), - color: PIE.getColor( color || 'currentColor' ) - } ); - return true; - } - return false; - } - - while( parseItem() ) {} - } - - return props && ( props.inset.length || props.outset.length ) ? props : null; - } -} ); -/** - * Retrieves the state of the element's visibility and display - * @constructor - * @param {Element} el the target element - */ -PIE.VisibilityStyleInfo = PIE.StyleInfoBase.newStyleInfo( { - - getCss: PIE.StyleInfoBase.cacheWhenLocked( function() { - var cs = this.targetElement.currentStyle; - return cs.visibility + '|' + cs.display; - } ), - - parseCss: function() { - var el = this.targetElement, - rs = el.runtimeStyle, - cs = el.currentStyle, - rsVis = rs.visibility, - csVis; - - rs.visibility = ''; - csVis = cs.visibility; - rs.visibility = rsVis; - - return { - visible: csVis !== 'hidden', - displayed: cs.display !== 'none' - } - }, - - /** - * Always return false for isActive, since this property alone will not trigger - * a renderer to do anything. - */ - isActive: function() { - return false; - } - -} ); -PIE.RendererBase = { - - /** - * Create a new Renderer class, with the standard constructor, and augmented by - * the RendererBase's members. - * @param proto - */ - newRenderer: function( proto ) { - function Renderer( el, boundsInfo, styleInfos, parent ) { - this.targetElement = el; - this.boundsInfo = boundsInfo; - this.styleInfos = styleInfos; - this.parent = parent; - } - PIE.Util.merge( Renderer.prototype, PIE.RendererBase, proto ); - return Renderer; - }, - - /** - * Flag indicating the element has already been positioned at least once. - * @type {boolean} - */ - isPositioned: false, - - /** - * Determine if the renderer needs to be updated - * @return {boolean} - */ - needsUpdate: function() { - return false; - }, - - /** - * Run any preparation logic that would affect the main update logic of this - * renderer or any of the other renderers, e.g. things that might affect the - * element's size or style properties. - */ - prepareUpdate: PIE.emptyFn, - - /** - * Tell the renderer to update based on modified properties - */ - updateProps: function() { - this.destroy(); - if( this.isActive() ) { - this.draw(); - } - }, - - /** - * Tell the renderer to update based on modified element position - */ - updatePos: function() { - this.isPositioned = true; - }, - - /** - * Tell the renderer to update based on modified element dimensions - */ - updateSize: function() { - if( this.isActive() ) { - this.draw(); - } else { - this.destroy(); - } - }, - - - /** - * Add a layer element, with the given z-order index, to the renderer's main box element. We can't use - * z-index because that breaks when the root rendering box's z-index is 'auto' in IE8+ standards mode. - * So instead we make sure they are inserted into the DOM in the correct order. - * @param {number} index - * @param {Element} el - */ - addLayer: function( index, el ) { - this.removeLayer( index ); - for( var layers = this._layers || ( this._layers = [] ), i = index + 1, len = layers.length, layer; i < len; i++ ) { - layer = layers[i]; - if( layer ) { - break; - } - } - layers[index] = el; - this.getBox().insertBefore( el, layer || null ); - }, - - /** - * Retrieve a layer element by its index, or null if not present - * @param {number} index - * @return {Element} - */ - getLayer: function( index ) { - var layers = this._layers; - return layers && layers[index] || null; - }, - - /** - * Remove a layer element by its index - * @param {number} index - */ - removeLayer: function( index ) { - var layer = this.getLayer( index ), - box = this._box; - if( layer && box ) { - box.removeChild( layer ); - this._layers[index] = null; - } - }, - - - /** - * Get a VML shape by name, creating it if necessary. - * @param {string} name A name identifying the element - * @param {string=} subElName If specified a subelement of the shape will be created with this tag name - * @param {Element} parent The parent element for the shape; will be ignored if 'group' is specified - * @param {number=} group If specified, an ordinal group for the shape. 1 or greater. Groups are rendered - * using container elements in the correct order, to get correct z stacking without z-index. - */ - getShape: function( name, subElName, parent, group ) { - var shapes = this._shapes || ( this._shapes = {} ), - shape = shapes[ name ], - s; - - if( !shape ) { - shape = shapes[ name ] = PIE.Util.createVmlElement( 'shape' ); - if( subElName ) { - shape.appendChild( shape[ subElName ] = PIE.Util.createVmlElement( subElName ) ); - } - - if( group ) { - parent = this.getLayer( group ); - if( !parent ) { - this.addLayer( group, doc.createElement( 'group' + group ) ); - parent = this.getLayer( group ); - } - } - - parent.appendChild( shape ); - - s = shape.style; - s.position = 'absolute'; - s.left = s.top = 0; - s['behavior'] = 'url(#default#VML)'; - } - return shape; - }, - - /** - * Delete a named shape which was created by getShape(). Returns true if a shape with the - * given name was found and deleted, or false if there was no shape of that name. - * @param {string} name - * @return {boolean} - */ - deleteShape: function( name ) { - var shapes = this._shapes, - shape = shapes && shapes[ name ]; - if( shape ) { - shape.parentNode.removeChild( shape ); - delete shapes[ name ]; - } - return !!shape; - }, - - - /** - * For a given set of border radius length/percentage values, convert them to concrete pixel - * values based on the current size of the target element. - * @param {Object} radii - * @return {Object} - */ - getRadiiPixels: function( radii ) { - var el = this.targetElement, - bounds = this.boundsInfo.getBounds(), - w = bounds.w, - h = bounds.h, - tlX, tlY, trX, trY, brX, brY, blX, blY, f; - - tlX = radii.x['tl'].pixels( el, w ); - tlY = radii.y['tl'].pixels( el, h ); - trX = radii.x['tr'].pixels( el, w ); - trY = radii.y['tr'].pixels( el, h ); - brX = radii.x['br'].pixels( el, w ); - brY = radii.y['br'].pixels( el, h ); - blX = radii.x['bl'].pixels( el, w ); - blY = radii.y['bl'].pixels( el, h ); - - // If any corner ellipses overlap, reduce them all by the appropriate factor. This formula - // is taken straight from the CSS3 Backgrounds and Borders spec. - f = Math.min( - w / ( tlX + trX ), - h / ( trY + brY ), - w / ( blX + brX ), - h / ( tlY + blY ) - ); - if( f < 1 ) { - tlX *= f; - tlY *= f; - trX *= f; - trY *= f; - brX *= f; - brY *= f; - blX *= f; - blY *= f; - } - - return { - x: { - 'tl': tlX, - 'tr': trX, - 'br': brX, - 'bl': blX - }, - y: { - 'tl': tlY, - 'tr': trY, - 'br': brY, - 'bl': blY - } - } - }, - - /** - * Return the VML path string for the element's background box, with corners rounded. - * @param {Object.<{t:number, r:number, b:number, l:number}>} shrink - if present, specifies number of - * pixels to shrink the box path inward from the element's four sides. - * @param {number=} mult If specified, all coordinates will be multiplied by this number - * @param {Object=} radii If specified, this will be used for the corner radii instead of the properties - * from this renderer's borderRadiusInfo object. - * @return {string} the VML path - */ - getBoxPath: function( shrink, mult, radii ) { - mult = mult || 1; - - var r, str, - bounds = this.boundsInfo.getBounds(), - w = bounds.w * mult, - h = bounds.h * mult, - radInfo = this.styleInfos.borderRadiusInfo, - floor = Math.floor, ceil = Math.ceil, - shrinkT = shrink ? shrink.t * mult : 0, - shrinkR = shrink ? shrink.r * mult : 0, - shrinkB = shrink ? shrink.b * mult : 0, - shrinkL = shrink ? shrink.l * mult : 0, - tlX, tlY, trX, trY, brX, brY, blX, blY; - - if( radii || radInfo.isActive() ) { - r = this.getRadiiPixels( radii || radInfo.getProps() ); - - tlX = r.x['tl'] * mult; - tlY = r.y['tl'] * mult; - trX = r.x['tr'] * mult; - trY = r.y['tr'] * mult; - brX = r.x['br'] * mult; - brY = r.y['br'] * mult; - blX = r.x['bl'] * mult; - blY = r.y['bl'] * mult; - - str = 'm' + floor( shrinkL ) + ',' + floor( tlY ) + - 'qy' + floor( tlX ) + ',' + floor( shrinkT ) + - 'l' + ceil( w - trX ) + ',' + floor( shrinkT ) + - 'qx' + ceil( w - shrinkR ) + ',' + floor( trY ) + - 'l' + ceil( w - shrinkR ) + ',' + ceil( h - brY ) + - 'qy' + ceil( w - brX ) + ',' + ceil( h - shrinkB ) + - 'l' + floor( blX ) + ',' + ceil( h - shrinkB ) + - 'qx' + floor( shrinkL ) + ',' + ceil( h - blY ) + ' x e'; - } else { - // simplified path for non-rounded box - str = 'm' + floor( shrinkL ) + ',' + floor( shrinkT ) + - 'l' + ceil( w - shrinkR ) + ',' + floor( shrinkT ) + - 'l' + ceil( w - shrinkR ) + ',' + ceil( h - shrinkB ) + - 'l' + floor( shrinkL ) + ',' + ceil( h - shrinkB ) + - 'xe'; - } - return str; - }, - - - /** - * Get the container element for the shapes, creating it if necessary. - */ - getBox: function() { - var box = this.parent.getLayer( this.boxZIndex ), s; - - if( !box ) { - box = doc.createElement( this.boxName ); - s = box.style; - s.position = 'absolute'; - s.top = s.left = 0; - this.parent.addLayer( this.boxZIndex, box ); - } - - return box; - }, - - - /** - * Hide the actual border of the element. In IE7 and up we can just set its color to transparent; - * however IE6 does not support transparent borders so we have to get tricky with it. Also, some elements - * like form buttons require removing the border width altogether, so for those we increase the padding - * by the border size. - */ - hideBorder: function() { - var el = this.targetElement, - cs = el.currentStyle, - rs = el.runtimeStyle, - tag = el.tagName, - isIE6 = PIE.ieVersion === 6, - sides, side, i; - - if( ( isIE6 && ( tag in PIE.childlessElements || tag === 'FIELDSET' ) ) || - tag === 'BUTTON' || ( tag === 'INPUT' && el.type in PIE.inputButtonTypes ) ) { - rs.borderWidth = ''; - sides = this.styleInfos.borderInfo.sides; - for( i = sides.length; i--; ) { - side = sides[ i ]; - rs[ 'padding' + side ] = ''; - rs[ 'padding' + side ] = ( PIE.getLength( cs[ 'padding' + side ] ) ).pixels( el ) + - ( PIE.getLength( cs[ 'border' + side + 'Width' ] ) ).pixels( el ) + - ( PIE.ieVersion !== 8 && i % 2 ? 1 : 0 ); //needs an extra horizontal pixel to counteract the extra "inner border" going away - } - rs.borderWidth = 0; - } - else if( isIE6 ) { - // Wrap all the element's children in a custom element, set the element to visiblity:hidden, - // and set the wrapper element to visiblity:visible. This hides the outer element's decorations - // (background and border) but displays all the contents. - // TODO find a better way to do this that doesn't mess up the DOM parent-child relationship, - // as this can interfere with other author scripts which add/modify/delete children. Also, this - // won't work for elements which cannot take children, e.g. input/button/textarea/img/etc. Look into - // using a compositor filter or some other filter which masks the border. - if( el.childNodes.length !== 1 || el.firstChild.tagName !== 'ie6-mask' ) { - var cont = doc.createElement( 'ie6-mask' ), - s = cont.style, child; - s.visibility = 'visible'; - s.zoom = 1; - while( child = el.firstChild ) { - cont.appendChild( child ); - } - el.appendChild( cont ); - rs.visibility = 'hidden'; - } - } - else { - rs.borderColor = 'transparent'; - } - }, - - unhideBorder: function() { - - }, - - - /** - * Destroy the rendered objects. This is a base implementation which handles common renderer - * structures, but individual renderers may override as necessary. - */ - destroy: function() { - this.parent.removeLayer( this.boxZIndex ); - delete this._shapes; - delete this._layers; - } -}; -/** - * Root renderer; creates the outermost container element and handles keeping it aligned - * with the target element's size and position. - * @param {Element} el The target element - * @param {Object} styleInfos The StyleInfo objects - */ -PIE.RootRenderer = PIE.RendererBase.newRenderer( { - - isActive: function() { - var children = this.childRenderers; - for( var i in children ) { - if( children.hasOwnProperty( i ) && children[ i ].isActive() ) { - return true; - } - } - return false; - }, - - needsUpdate: function() { - return this.styleInfos.visibilityInfo.changed(); - }, - - updatePos: function() { - if( this.isActive() ) { - var el = this.getPositioningElement(), - par = el, - docEl, - parRect, - tgtCS = el.currentStyle, - tgtPos = tgtCS.position, - boxPos, - s = this.getBox().style, cs, - x = 0, y = 0, - elBounds = this.boundsInfo.getBounds(), - logicalZoomRatio = elBounds.logicalZoomRatio; - - if( tgtPos === 'fixed' && PIE.ieVersion > 6 ) { - x = elBounds.x * logicalZoomRatio; - y = elBounds.y * logicalZoomRatio; - boxPos = tgtPos; - } else { - // Get the element's offsets from its nearest positioned ancestor. Uses - // getBoundingClientRect for accuracy and speed. - do { - par = par.offsetParent; - } while( par && ( par.currentStyle.position === 'static' ) ); - if( par ) { - parRect = par.getBoundingClientRect(); - cs = par.currentStyle; - x = ( elBounds.x - parRect.left ) * logicalZoomRatio - ( parseFloat(cs.borderLeftWidth) || 0 ); - y = ( elBounds.y - parRect.top ) * logicalZoomRatio - ( parseFloat(cs.borderTopWidth) || 0 ); - } else { - docEl = doc.documentElement; - x = ( elBounds.x + docEl.scrollLeft - docEl.clientLeft ) * logicalZoomRatio; - y = ( elBounds.y + docEl.scrollTop - docEl.clientTop ) * logicalZoomRatio; - } - boxPos = 'absolute'; - } - - s.position = boxPos; - s.left = x; - s.top = y; - s.zIndex = tgtPos === 'static' ? -1 : tgtCS.zIndex; - this.isPositioned = true; - } - }, - - updateSize: PIE.emptyFn, - - updateVisibility: function() { - var vis = this.styleInfos.visibilityInfo.getProps(); - this.getBox().style.display = ( vis.visible && vis.displayed ) ? '' : 'none'; - }, - - updateProps: function() { - if( this.isActive() ) { - this.updateVisibility(); - } else { - this.destroy(); - } - }, - - getPositioningElement: function() { - var el = this.targetElement; - return el.tagName in PIE.tableCellTags ? el.offsetParent : el; - }, - - getBox: function() { - var box = this._box, el; - if( !box ) { - el = this.getPositioningElement(); - box = this._box = doc.createElement( 'css3-container' ); - box.style['direction'] = 'ltr'; //fix positioning bug in rtl environments - - this.updateVisibility(); - - el.parentNode.insertBefore( box, el ); - } - return box; - }, - - finishUpdate: PIE.emptyFn, - - destroy: function() { - var box = this._box, par; - if( box && ( par = box.parentNode ) ) { - par.removeChild( box ); - } - delete this._box; - delete this._layers; - } - -} ); -/** - * Renderer for element backgrounds. - * @constructor - * @param {Element} el The target element - * @param {Object} styleInfos The StyleInfo objects - * @param {PIE.RootRenderer} parent - */ -PIE.BackgroundRenderer = PIE.RendererBase.newRenderer( { - - boxZIndex: 2, - boxName: 'background', - - needsUpdate: function() { - var si = this.styleInfos; - return si.backgroundInfo.changed() || si.borderRadiusInfo.changed(); - }, - - isActive: function() { - var si = this.styleInfos; - return si.borderImageInfo.isActive() || - si.borderRadiusInfo.isActive() || - si.backgroundInfo.isActive() || - ( si.boxShadowInfo.isActive() && si.boxShadowInfo.getProps().inset ); - }, - - /** - * Draw the shapes - */ - draw: function() { - var bounds = this.boundsInfo.getBounds(); - if( bounds.w && bounds.h ) { - this.drawBgColor(); - this.drawBgImages(); - } - }, - - /** - * Draw the background color shape - */ - drawBgColor: function() { - var props = this.styleInfos.backgroundInfo.getProps(), - bounds = this.boundsInfo.getBounds(), - el = this.targetElement, - color = props && props.color, - shape, w, h, s, alpha; - - if( color && color.alpha() > 0 ) { - this.hideBackground(); - - shape = this.getShape( 'bgColor', 'fill', this.getBox(), 1 ); - w = bounds.w; - h = bounds.h; - shape.stroked = false; - shape.coordsize = w * 2 + ',' + h * 2; - shape.coordorigin = '1,1'; - shape.path = this.getBoxPath( null, 2 ); - s = shape.style; - s.width = w; - s.height = h; - shape.fill.color = color.colorValue( el ); - - alpha = color.alpha(); - if( alpha < 1 ) { - shape.fill.opacity = alpha; - } - } else { - this.deleteShape( 'bgColor' ); - } - }, - - /** - * Draw all the background image layers - */ - drawBgImages: function() { - var props = this.styleInfos.backgroundInfo.getProps(), - bounds = this.boundsInfo.getBounds(), - images = props && props.bgImages, - img, shape, w, h, s, i; - - if( images ) { - this.hideBackground(); - - w = bounds.w; - h = bounds.h; - - i = images.length; - while( i-- ) { - img = images[i]; - shape = this.getShape( 'bgImage' + i, 'fill', this.getBox(), 2 ); - - shape.stroked = false; - shape.fill.type = 'tile'; - shape.fillcolor = 'none'; - shape.coordsize = w * 2 + ',' + h * 2; - shape.coordorigin = '1,1'; - shape.path = this.getBoxPath( 0, 2 ); - s = shape.style; - s.width = w; - s.height = h; - - if( img.imgType === 'linear-gradient' ) { - this.addLinearGradient( shape, img ); - } - else { - shape.fill.src = img.imgUrl; - this.positionBgImage( shape, i ); - } - } - } - - // Delete any bgImage shapes previously created which weren't used above - i = images ? images.length : 0; - while( this.deleteShape( 'bgImage' + i++ ) ) {} - }, - - - /** - * Set the position and clipping of the background image for a layer - * @param {Element} shape - * @param {number} index - */ - positionBgImage: function( shape, index ) { - var me = this; - PIE.Util.withImageSize( shape.fill.src, function( size ) { - var el = me.targetElement, - bounds = me.boundsInfo.getBounds(), - elW = bounds.w, - elH = bounds.h; - - // It's possible that the element dimensions are zero now but weren't when the original - // update executed, make sure that's not the case to avoid divide-by-zero error - if( elW && elH ) { - var fill = shape.fill, - si = me.styleInfos, - border = si.borderInfo.getProps(), - bw = border && border.widths, - bwT = bw ? bw['t'].pixels( el ) : 0, - bwR = bw ? bw['r'].pixels( el ) : 0, - bwB = bw ? bw['b'].pixels( el ) : 0, - bwL = bw ? bw['l'].pixels( el ) : 0, - bg = si.backgroundInfo.getProps().bgImages[ index ], - bgPos = bg.bgPosition ? bg.bgPosition.coords( el, elW - size.w - bwL - bwR, elH - size.h - bwT - bwB ) : { x:0, y:0 }, - repeat = bg.imgRepeat, - pxX, pxY, - clipT = 0, clipL = 0, - clipR = elW + 1, clipB = elH + 1, //make sure the default clip region is not inside the box (by a subpixel) - clipAdjust = PIE.ieVersion === 8 ? 0 : 1; //prior to IE8 requires 1 extra pixel in the image clip region - - // Positioning - find the pixel offset from the top/left and convert to a ratio - // The position is shifted by half a pixel, to adjust for the half-pixel coordorigin shift which is - // needed to fix antialiasing but makes the bg image fuzzy. - pxX = Math.round( bgPos.x ) + bwL + 0.5; - pxY = Math.round( bgPos.y ) + bwT + 0.5; - fill.position = ( pxX / elW ) + ',' + ( pxY / elH ); - - // Set the size of the image. We have to actually set it to px values otherwise it will not honor - // the user's browser zoom level and always display at its natural screen size. - fill['size']['x'] = 1; //Can be any value, just has to be set to "prime" it so the next line works. Weird! - fill['size'] = size.w + 'px,' + size.h + 'px'; - - // Repeating - clip the image shape - if( repeat && repeat !== 'repeat' ) { - if( repeat === 'repeat-x' || repeat === 'no-repeat' ) { - clipT = pxY + 1; - clipB = pxY + size.h + clipAdjust; - } - if( repeat === 'repeat-y' || repeat === 'no-repeat' ) { - clipL = pxX + 1; - clipR = pxX + size.w + clipAdjust; - } - shape.style.clip = 'rect(' + clipT + 'px,' + clipR + 'px,' + clipB + 'px,' + clipL + 'px)'; - } - } - } ); - }, - - - /** - * Draw the linear gradient for a gradient layer - * @param {Element} shape - * @param {Object} info The object holding the information about the gradient - */ - addLinearGradient: function( shape, info ) { - var el = this.targetElement, - bounds = this.boundsInfo.getBounds(), - w = bounds.w, - h = bounds.h, - fill = shape.fill, - stops = info.stops, - stopCount = stops.length, - PI = Math.PI, - GradientUtil = PIE.GradientUtil, - perpendicularIntersect = GradientUtil.perpendicularIntersect, - distance = GradientUtil.distance, - metrics = GradientUtil.getGradientMetrics( el, w, h, info ), - angle = metrics.angle, - startX = metrics.startX, - startY = metrics.startY, - startCornerX = metrics.startCornerX, - startCornerY = metrics.startCornerY, - endCornerX = metrics.endCornerX, - endCornerY = metrics.endCornerY, - deltaX = metrics.deltaX, - deltaY = metrics.deltaY, - lineLength = metrics.lineLength, - vmlAngle, vmlGradientLength, vmlColors, - stopPx, vmlOffsetPct, - p, i, j, before, after; - - // In VML land, the angle of the rendered gradient depends on the aspect ratio of the shape's - // bounding box; for example specifying a 45 deg angle actually results in a gradient - // drawn diagonally from one corner to its opposite corner, which will only appear to the - // viewer as 45 degrees if the shape is equilateral. We adjust for this by taking the x/y deltas - // between the start and end points, multiply one of them by the shape's aspect ratio, - // and get their arctangent, resulting in an appropriate VML angle. If the angle is perfectly - // horizontal or vertical then we don't need to do this conversion. - vmlAngle = ( angle % 90 ) ? Math.atan2( deltaX * w / h, deltaY ) / PI * 180 : ( angle + 90 ); - - // VML angles are 180 degrees offset from CSS angles - vmlAngle += 180; - vmlAngle = vmlAngle % 360; - - // Add all the stops to the VML 'colors' list, including the first and last stops. - // For each, we find its pixel offset along the gradient-line; if the offset of a stop is less - // than that of its predecessor we increase it to be equal. We then map that pixel offset to a - // percentage along the VML gradient-line, which runs from shape corner to corner. - p = perpendicularIntersect( startCornerX, startCornerY, angle, endCornerX, endCornerY ); - vmlGradientLength = distance( startCornerX, startCornerY, p[0], p[1] ); - vmlColors = []; - p = perpendicularIntersect( startX, startY, angle, startCornerX, startCornerY ); - vmlOffsetPct = distance( startX, startY, p[0], p[1] ) / vmlGradientLength * 100; - - // Find the pixel offsets along the CSS3 gradient-line for each stop. - stopPx = []; - for( i = 0; i < stopCount; i++ ) { - stopPx.push( stops[i].offset ? stops[i].offset.pixels( el, lineLength ) : - i === 0 ? 0 : i === stopCount - 1 ? lineLength : null ); - } - // Fill in gaps with evenly-spaced offsets - for( i = 1; i < stopCount; i++ ) { - if( stopPx[ i ] === null ) { - before = stopPx[ i - 1 ]; - j = i; - do { - after = stopPx[ ++j ]; - } while( after === null ); - stopPx[ i ] = before + ( after - before ) / ( j - i + 1 ); - } - // Make sure each stop's offset is no less than the one before it - stopPx[ i ] = Math.max( stopPx[ i ], stopPx[ i - 1 ] ); - } - - // Convert to percentage along the VML gradient line and add to the VML 'colors' value - for( i = 0; i < stopCount; i++ ) { - vmlColors.push( - ( vmlOffsetPct + ( stopPx[ i ] / vmlGradientLength * 100 ) ) + '% ' + stops[i].color.colorValue( el ) - ); - } - - // Now, finally, we're ready to render the gradient fill. Set the start and end colors to - // the first and last stop colors; this just sets outer bounds for the gradient. - fill['angle'] = vmlAngle; - fill['type'] = 'gradient'; - fill['method'] = 'sigma'; - fill['color'] = stops[0].color.colorValue( el ); - fill['color2'] = stops[stopCount - 1].color.colorValue( el ); - if( fill['colors'] ) { //sometimes the colors object isn't initialized so we have to assign it directly (?) - fill['colors'].value = vmlColors.join( ',' ); - } else { - fill['colors'] = vmlColors.join( ',' ); - } - }, - - - /** - * Hide the actual background image and color of the element. - */ - hideBackground: function() { - var rs = this.targetElement.runtimeStyle; - rs.backgroundImage = 'url(about:blank)'; //ensures the background area reacts to mouse events - rs.backgroundColor = 'transparent'; - }, - - destroy: function() { - PIE.RendererBase.destroy.call( this ); - var rs = this.targetElement.runtimeStyle; - rs.backgroundImage = rs.backgroundColor = ''; - } - -} ); -/** - * Renderer for element borders. - * @constructor - * @param {Element} el The target element - * @param {Object} styleInfos The StyleInfo objects - * @param {PIE.RootRenderer} parent - */ -PIE.BorderRenderer = PIE.RendererBase.newRenderer( { - - boxZIndex: 4, - boxName: 'border', - - needsUpdate: function() { - var si = this.styleInfos; - return si.borderInfo.changed() || si.borderRadiusInfo.changed(); - }, - - isActive: function() { - var si = this.styleInfos; - return si.borderRadiusInfo.isActive() && - !si.borderImageInfo.isActive() && - si.borderInfo.isActive(); //check BorderStyleInfo last because it's the most expensive - }, - - /** - * Draw the border shape(s) - */ - draw: function() { - var el = this.targetElement, - props = this.styleInfos.borderInfo.getProps(), - bounds = this.boundsInfo.getBounds(), - w = bounds.w, - h = bounds.h, - shape, stroke, s, - segments, seg, i, len; - - if( props ) { - this.hideBorder(); - - segments = this.getBorderSegments( 2 ); - for( i = 0, len = segments.length; i < len; i++) { - seg = segments[i]; - shape = this.getShape( 'borderPiece' + i, seg.stroke ? 'stroke' : 'fill', this.getBox() ); - shape.coordsize = w * 2 + ',' + h * 2; - shape.coordorigin = '1,1'; - shape.path = seg.path; - s = shape.style; - s.width = w; - s.height = h; - - shape.filled = !!seg.fill; - shape.stroked = !!seg.stroke; - if( seg.stroke ) { - stroke = shape.stroke; - stroke['weight'] = seg.weight + 'px'; - stroke.color = seg.color.colorValue( el ); - stroke['dashstyle'] = seg.stroke === 'dashed' ? '2 2' : seg.stroke === 'dotted' ? '1 1' : 'solid'; - stroke['linestyle'] = seg.stroke === 'double' && seg.weight > 2 ? 'ThinThin' : 'Single'; - } else { - shape.fill.color = seg.fill.colorValue( el ); - } - } - - // remove any previously-created border shapes which didn't get used above - while( this.deleteShape( 'borderPiece' + i++ ) ) {} - } - }, - - - /** - * Get the VML path definitions for the border segment(s). - * @param {number=} mult If specified, all coordinates will be multiplied by this number - * @return {Array.} - */ - getBorderSegments: function( mult ) { - var el = this.targetElement, - bounds, elW, elH, - borderInfo = this.styleInfos.borderInfo, - segments = [], - floor, ceil, wT, wR, wB, wL, - round = Math.round, - borderProps, radiusInfo, radii, widths, styles, colors; - - if( borderInfo.isActive() ) { - borderProps = borderInfo.getProps(); - - widths = borderProps.widths; - styles = borderProps.styles; - colors = borderProps.colors; - - if( borderProps.widthsSame && borderProps.stylesSame && borderProps.colorsSame ) { - if( colors['t'].alpha() > 0 ) { - // shortcut for identical border on all sides - only need 1 stroked shape - wT = widths['t'].pixels( el ); //thickness - wR = wT / 2; //shrink - segments.push( { - path: this.getBoxPath( { t: wR, r: wR, b: wR, l: wR }, mult ), - stroke: styles['t'], - color: colors['t'], - weight: wT - } ); - } - } - else { - mult = mult || 1; - bounds = this.boundsInfo.getBounds(); - elW = bounds.w; - elH = bounds.h; - - wT = round( widths['t'].pixels( el ) ); - wR = round( widths['r'].pixels( el ) ); - wB = round( widths['b'].pixels( el ) ); - wL = round( widths['l'].pixels( el ) ); - var pxWidths = { - 't': wT, - 'r': wR, - 'b': wB, - 'l': wL - }; - - radiusInfo = this.styleInfos.borderRadiusInfo; - if( radiusInfo.isActive() ) { - radii = this.getRadiiPixels( radiusInfo.getProps() ); - } - - floor = Math.floor; - ceil = Math.ceil; - - function radius( xy, corner ) { - return radii ? radii[ xy ][ corner ] : 0; - } - - function curve( corner, shrinkX, shrinkY, startAngle, ccw, doMove ) { - var rx = radius( 'x', corner), - ry = radius( 'y', corner), - deg = 65535, - isRight = corner.charAt( 1 ) === 'r', - isBottom = corner.charAt( 0 ) === 'b'; - return ( rx > 0 && ry > 0 ) ? - ( doMove ? 'al' : 'ae' ) + - ( isRight ? ceil( elW - rx ) : floor( rx ) ) * mult + ',' + // center x - ( isBottom ? ceil( elH - ry ) : floor( ry ) ) * mult + ',' + // center y - ( floor( rx ) - shrinkX ) * mult + ',' + // width - ( floor( ry ) - shrinkY ) * mult + ',' + // height - ( startAngle * deg ) + ',' + // start angle - ( 45 * deg * ( ccw ? 1 : -1 ) // angle change - ) : ( - ( doMove ? 'm' : 'l' ) + - ( isRight ? elW - shrinkX : shrinkX ) * mult + ',' + - ( isBottom ? elH - shrinkY : shrinkY ) * mult - ); - } - - function line( side, shrink, ccw, doMove ) { - var - start = ( - side === 't' ? - floor( radius( 'x', 'tl') ) * mult + ',' + ceil( shrink ) * mult : - side === 'r' ? - ceil( elW - shrink ) * mult + ',' + floor( radius( 'y', 'tr') ) * mult : - side === 'b' ? - ceil( elW - radius( 'x', 'br') ) * mult + ',' + floor( elH - shrink ) * mult : - // side === 'l' ? - floor( shrink ) * mult + ',' + ceil( elH - radius( 'y', 'bl') ) * mult - ), - end = ( - side === 't' ? - ceil( elW - radius( 'x', 'tr') ) * mult + ',' + ceil( shrink ) * mult : - side === 'r' ? - ceil( elW - shrink ) * mult + ',' + ceil( elH - radius( 'y', 'br') ) * mult : - side === 'b' ? - floor( radius( 'x', 'bl') ) * mult + ',' + floor( elH - shrink ) * mult : - // side === 'l' ? - floor( shrink ) * mult + ',' + floor( radius( 'y', 'tl') ) * mult - ); - return ccw ? ( doMove ? 'm' + end : '' ) + 'l' + start : - ( doMove ? 'm' + start : '' ) + 'l' + end; - } - - - function addSide( side, sideBefore, sideAfter, cornerBefore, cornerAfter, baseAngle ) { - var vert = side === 'l' || side === 'r', - sideW = pxWidths[ side ], - beforeX, beforeY, afterX, afterY; - - if( sideW > 0 && styles[ side ] !== 'none' && colors[ side ].alpha() > 0 ) { - beforeX = pxWidths[ vert ? side : sideBefore ]; - beforeY = pxWidths[ vert ? sideBefore : side ]; - afterX = pxWidths[ vert ? side : sideAfter ]; - afterY = pxWidths[ vert ? sideAfter : side ]; - - if( styles[ side ] === 'dashed' || styles[ side ] === 'dotted' ) { - segments.push( { - path: curve( cornerBefore, beforeX, beforeY, baseAngle + 45, 0, 1 ) + - curve( cornerBefore, 0, 0, baseAngle, 1, 0 ), - fill: colors[ side ] - } ); - segments.push( { - path: line( side, sideW / 2, 0, 1 ), - stroke: styles[ side ], - weight: sideW, - color: colors[ side ] - } ); - segments.push( { - path: curve( cornerAfter, afterX, afterY, baseAngle, 0, 1 ) + - curve( cornerAfter, 0, 0, baseAngle - 45, 1, 0 ), - fill: colors[ side ] - } ); - } - else { - segments.push( { - path: curve( cornerBefore, beforeX, beforeY, baseAngle + 45, 0, 1 ) + - line( side, sideW, 0, 0 ) + - curve( cornerAfter, afterX, afterY, baseAngle, 0, 0 ) + - - ( styles[ side ] === 'double' && sideW > 2 ? - curve( cornerAfter, afterX - floor( afterX / 3 ), afterY - floor( afterY / 3 ), baseAngle - 45, 1, 0 ) + - line( side, ceil( sideW / 3 * 2 ), 1, 0 ) + - curve( cornerBefore, beforeX - floor( beforeX / 3 ), beforeY - floor( beforeY / 3 ), baseAngle, 1, 0 ) + - 'x ' + - curve( cornerBefore, floor( beforeX / 3 ), floor( beforeY / 3 ), baseAngle + 45, 0, 1 ) + - line( side, floor( sideW / 3 ), 1, 0 ) + - curve( cornerAfter, floor( afterX / 3 ), floor( afterY / 3 ), baseAngle, 0, 0 ) - : '' ) + - - curve( cornerAfter, 0, 0, baseAngle - 45, 1, 0 ) + - line( side, 0, 1, 0 ) + - curve( cornerBefore, 0, 0, baseAngle, 1, 0 ), - fill: colors[ side ] - } ); - } - } - } - - addSide( 't', 'l', 'r', 'tl', 'tr', 90 ); - addSide( 'r', 't', 'b', 'tr', 'br', 0 ); - addSide( 'b', 'r', 'l', 'br', 'bl', -90 ); - addSide( 'l', 'b', 't', 'bl', 'tl', -180 ); - } - } - - return segments; - }, - - destroy: function() { - var me = this; - if (me.finalized || !me.styleInfos.borderImageInfo.isActive()) { - me.targetElement.runtimeStyle.borderColor = ''; - } - PIE.RendererBase.destroy.call( me ); - } - - -} ); -/** - * Renderer for border-image - * @constructor - * @param {Element} el The target element - * @param {Object} styleInfos The StyleInfo objects - * @param {PIE.RootRenderer} parent - */ -PIE.BorderImageRenderer = PIE.RendererBase.newRenderer( { - - boxZIndex: 5, - pieceNames: [ 't', 'tr', 'r', 'br', 'b', 'bl', 'l', 'tl', 'c' ], - - needsUpdate: function() { - return this.styleInfos.borderImageInfo.changed(); - }, - - isActive: function() { - return this.styleInfos.borderImageInfo.isActive(); - }, - - draw: function() { - this.getBox(); //make sure pieces are created - - var props = this.styleInfos.borderImageInfo.getProps(), - borderProps = this.styleInfos.borderInfo.getProps(), - bounds = this.boundsInfo.getBounds(), - el = this.targetElement, - pieces = this.pieces; - - PIE.Util.withImageSize( props.src, function( imgSize ) { - var elW = bounds.w, - elH = bounds.h, - zero = PIE.getLength( '0' ), - widths = props.widths || ( borderProps ? borderProps.widths : { 't': zero, 'r': zero, 'b': zero, 'l': zero } ), - widthT = widths['t'].pixels( el ), - widthR = widths['r'].pixels( el ), - widthB = widths['b'].pixels( el ), - widthL = widths['l'].pixels( el ), - slices = props.slice, - sliceT = slices['t'].pixels( el ), - sliceR = slices['r'].pixels( el ), - sliceB = slices['b'].pixels( el ), - sliceL = slices['l'].pixels( el ); - - // Piece positions and sizes - function setSizeAndPos( piece, w, h, x, y ) { - var s = pieces[piece].style, - max = Math.max; - s.width = max(w, 0); - s.height = max(h, 0); - s.left = x; - s.top = y; - } - setSizeAndPos( 'tl', widthL, widthT, 0, 0 ); - setSizeAndPos( 't', elW - widthL - widthR, widthT, widthL, 0 ); - setSizeAndPos( 'tr', widthR, widthT, elW - widthR, 0 ); - setSizeAndPos( 'r', widthR, elH - widthT - widthB, elW - widthR, widthT ); - setSizeAndPos( 'br', widthR, widthB, elW - widthR, elH - widthB ); - setSizeAndPos( 'b', elW - widthL - widthR, widthB, widthL, elH - widthB ); - setSizeAndPos( 'bl', widthL, widthB, 0, elH - widthB ); - setSizeAndPos( 'l', widthL, elH - widthT - widthB, 0, widthT ); - setSizeAndPos( 'c', elW - widthL - widthR, elH - widthT - widthB, widthL, widthT ); - - - // image croppings - function setCrops( sides, crop, val ) { - for( var i=0, len=sides.length; i < len; i++ ) { - pieces[ sides[i] ]['imagedata'][ crop ] = val; - } - } - - // corners - setCrops( [ 'tl', 't', 'tr' ], 'cropBottom', ( imgSize.h - sliceT ) / imgSize.h ); - setCrops( [ 'tl', 'l', 'bl' ], 'cropRight', ( imgSize.w - sliceL ) / imgSize.w ); - setCrops( [ 'bl', 'b', 'br' ], 'cropTop', ( imgSize.h - sliceB ) / imgSize.h ); - setCrops( [ 'tr', 'r', 'br' ], 'cropLeft', ( imgSize.w - sliceR ) / imgSize.w ); - - // edges and center - // TODO right now this treats everything like 'stretch', need to support other schemes - //if( props.repeat.v === 'stretch' ) { - setCrops( [ 'l', 'r', 'c' ], 'cropTop', sliceT / imgSize.h ); - setCrops( [ 'l', 'r', 'c' ], 'cropBottom', sliceB / imgSize.h ); - //} - //if( props.repeat.h === 'stretch' ) { - setCrops( [ 't', 'b', 'c' ], 'cropLeft', sliceL / imgSize.w ); - setCrops( [ 't', 'b', 'c' ], 'cropRight', sliceR / imgSize.w ); - //} - - // center fill - pieces['c'].style.display = props.fill ? '' : 'none'; - }, this ); - }, - - getBox: function() { - var box = this.parent.getLayer( this.boxZIndex ), - s, piece, i, - pieceNames = this.pieceNames, - len = pieceNames.length; - - if( !box ) { - box = doc.createElement( 'border-image' ); - s = box.style; - s.position = 'absolute'; - - this.pieces = {}; - - for( i = 0; i < len; i++ ) { - piece = this.pieces[ pieceNames[i] ] = PIE.Util.createVmlElement( 'rect' ); - piece.appendChild( PIE.Util.createVmlElement( 'imagedata' ) ); - s = piece.style; - s['behavior'] = 'url(#default#VML)'; - s.position = "absolute"; - s.top = s.left = 0; - piece['imagedata'].src = this.styleInfos.borderImageInfo.getProps().src; - piece.stroked = false; - piece.filled = false; - box.appendChild( piece ); - } - - this.parent.addLayer( this.boxZIndex, box ); - } - - return box; - }, - - prepareUpdate: function() { - if (this.isActive()) { - var me = this, - el = me.targetElement, - rs = el.runtimeStyle, - widths = me.styleInfos.borderImageInfo.getProps().widths; - - // Force border-style to solid so it doesn't collapse - rs.borderStyle = 'solid'; - - // If widths specified in border-image shorthand, override border-width - // NOTE px units needed here as this gets used by the IE9 renderer too - if ( widths ) { - rs.borderTopWidth = widths['t'].pixels( el ) + 'px'; - rs.borderRightWidth = widths['r'].pixels( el ) + 'px'; - rs.borderBottomWidth = widths['b'].pixels( el ) + 'px'; - rs.borderLeftWidth = widths['l'].pixels( el ) + 'px'; - } - - // Make the border transparent - me.hideBorder(); - } - }, - - destroy: function() { - var me = this, - rs = me.targetElement.runtimeStyle; - rs.borderStyle = ''; - if (me.finalized || !me.styleInfos.borderInfo.isActive()) { - rs.borderColor = rs.borderWidth = ''; - } - PIE.RendererBase.destroy.call( this ); - } - -} ); -/** - * Renderer for outset box-shadows - * @constructor - * @param {Element} el The target element - * @param {Object} styleInfos The StyleInfo objects - * @param {PIE.RootRenderer} parent - */ -PIE.BoxShadowOutsetRenderer = PIE.RendererBase.newRenderer( { - - boxZIndex: 1, - boxName: 'outset-box-shadow', - - needsUpdate: function() { - var si = this.styleInfos; - return si.boxShadowInfo.changed() || si.borderRadiusInfo.changed(); - }, - - isActive: function() { - var boxShadowInfo = this.styleInfos.boxShadowInfo; - return boxShadowInfo.isActive() && boxShadowInfo.getProps().outset[0]; - }, - - draw: function() { - var me = this, - el = this.targetElement, - box = this.getBox(), - styleInfos = this.styleInfos, - shadowInfos = styleInfos.boxShadowInfo.getProps().outset, - radii = styleInfos.borderRadiusInfo.getProps(), - len = shadowInfos.length, - i = len, j, - bounds = this.boundsInfo.getBounds(), - w = bounds.w, - h = bounds.h, - clipAdjust = PIE.ieVersion === 8 ? 1 : 0, //workaround for IE8 bug where VML leaks out top/left of clip region by 1px - corners = [ 'tl', 'tr', 'br', 'bl' ], corner, - shadowInfo, shape, fill, ss, xOff, yOff, spread, blur, shrink, color, alpha, path, - totalW, totalH, focusX, focusY, isBottom, isRight; - - - function getShadowShape( index, corner, xOff, yOff, color, blur, path ) { - var shape = me.getShape( 'shadow' + index + corner, 'fill', box, len - index ), - fill = shape.fill; - - // Position and size - shape['coordsize'] = w * 2 + ',' + h * 2; - shape['coordorigin'] = '1,1'; - - // Color and opacity - shape['stroked'] = false; - shape['filled'] = true; - fill.color = color.colorValue( el ); - if( blur ) { - fill['type'] = 'gradienttitle'; //makes the VML gradient follow the shape's outline - hooray for undocumented features?!?! - fill['color2'] = fill.color; - fill['opacity'] = 0; - } - - // Path - shape.path = path; - - // This needs to go last for some reason, to prevent rendering at incorrect size - ss = shape.style; - ss.left = xOff; - ss.top = yOff; - ss.width = w; - ss.height = h; - - return shape; - } - - - while( i-- ) { - shadowInfo = shadowInfos[ i ]; - xOff = shadowInfo.xOffset.pixels( el ); - yOff = shadowInfo.yOffset.pixels( el ); - spread = shadowInfo.spread.pixels( el ); - blur = shadowInfo.blur.pixels( el ); - color = shadowInfo.color; - // Shape path - shrink = -spread - blur; - if( !radii && blur ) { - // If blurring, use a non-null border radius info object so that getBoxPath will - // round the corners of the expanded shadow shape rather than squaring them off. - radii = PIE.BorderRadiusStyleInfo.ALL_ZERO; - } - path = this.getBoxPath( { t: shrink, r: shrink, b: shrink, l: shrink }, 2, radii ); - - if( blur ) { - totalW = ( spread + blur ) * 2 + w; - totalH = ( spread + blur ) * 2 + h; - focusX = totalW ? blur * 2 / totalW : 0; - focusY = totalH ? blur * 2 / totalH : 0; - if( blur - spread > w / 2 || blur - spread > h / 2 ) { - // If the blur is larger than half the element's narrowest dimension, we cannot do - // this with a single shape gradient, because its focussize would have to be less than - // zero which results in ugly artifacts. Instead we create four shapes, each with its - // gradient focus past center, and then clip them so each only shows the quadrant - // opposite the focus. - for( j = 4; j--; ) { - corner = corners[j]; - isBottom = corner.charAt( 0 ) === 'b'; - isRight = corner.charAt( 1 ) === 'r'; - shape = getShadowShape( i, corner, xOff, yOff, color, blur, path ); - fill = shape.fill; - fill['focusposition'] = ( isRight ? 1 - focusX : focusX ) + ',' + - ( isBottom ? 1 - focusY : focusY ); - fill['focussize'] = '0,0'; - - // Clip to show only the appropriate quadrant. Add 1px to the top/left clip values - // in IE8 to prevent a bug where IE8 displays one pixel outside the clip region. - shape.style.clip = 'rect(' + ( ( isBottom ? totalH / 2 : 0 ) + clipAdjust ) + 'px,' + - ( isRight ? totalW : totalW / 2 ) + 'px,' + - ( isBottom ? totalH : totalH / 2 ) + 'px,' + - ( ( isRight ? totalW / 2 : 0 ) + clipAdjust ) + 'px)'; - } - } else { - // TODO delete old quadrant shapes if resizing expands past the barrier - shape = getShadowShape( i, '', xOff, yOff, color, blur, path ); - fill = shape.fill; - fill['focusposition'] = focusX + ',' + focusY; - fill['focussize'] = ( 1 - focusX * 2 ) + ',' + ( 1 - focusY * 2 ); - } - } else { - shape = getShadowShape( i, '', xOff, yOff, color, blur, path ); - alpha = color.alpha(); - if( alpha < 1 ) { - // shape.style.filter = 'alpha(opacity=' + ( alpha * 100 ) + ')'; - // ss.filter = 'progid:DXImageTransform.Microsoft.BasicImage(opacity=' + ( alpha ) + ')'; - shape.fill.opacity = alpha; - } - } - } - } - -} ); -/** - * Renderer for re-rendering img elements using VML. Kicks in if the img has - * a border-radius applied, or if the -pie-png-fix flag is set. - * @constructor - * @param {Element} el The target element - * @param {Object} styleInfos The StyleInfo objects - * @param {PIE.RootRenderer} parent - */ -PIE.ImgRenderer = PIE.RendererBase.newRenderer( { - - boxZIndex: 6, - boxName: 'imgEl', - - needsUpdate: function() { - var si = this.styleInfos; - return this.targetElement.src !== this._lastSrc || si.borderRadiusInfo.changed(); - }, - - isActive: function() { - var si = this.styleInfos; - return si.borderRadiusInfo.isActive() || si.backgroundInfo.isPngFix(); - }, - - draw: function() { - this._lastSrc = src; - this.hideActualImg(); - - var shape = this.getShape( 'img', 'fill', this.getBox() ), - fill = shape.fill, - bounds = this.boundsInfo.getBounds(), - w = bounds.w, - h = bounds.h, - borderProps = this.styleInfos.borderInfo.getProps(), - borderWidths = borderProps && borderProps.widths, - el = this.targetElement, - src = el.src, - round = Math.round, - cs = el.currentStyle, - getLength = PIE.getLength, - s, zero; - - // In IE6, the BorderRenderer will have hidden the border by moving the border-width to - // the padding; therefore we want to pretend the borders have no width so they aren't doubled - // when adding in the current padding value below. - if( !borderWidths || PIE.ieVersion < 7 ) { - zero = PIE.getLength( '0' ); - borderWidths = { 't': zero, 'r': zero, 'b': zero, 'l': zero }; - } - - shape.stroked = false; - fill.type = 'frame'; - fill.src = src; - fill.position = (w ? 0.5 / w : 0) + ',' + (h ? 0.5 / h : 0); - shape.coordsize = w * 2 + ',' + h * 2; - shape.coordorigin = '1,1'; - shape.path = this.getBoxPath( { - t: round( borderWidths['t'].pixels( el ) + getLength( cs.paddingTop ).pixels( el ) ), - r: round( borderWidths['r'].pixels( el ) + getLength( cs.paddingRight ).pixels( el ) ), - b: round( borderWidths['b'].pixels( el ) + getLength( cs.paddingBottom ).pixels( el ) ), - l: round( borderWidths['l'].pixels( el ) + getLength( cs.paddingLeft ).pixels( el ) ) - }, 2 ); - s = shape.style; - s.width = w; - s.height = h; - }, - - hideActualImg: function() { - this.targetElement.runtimeStyle.filter = 'alpha(opacity=0)'; - }, - - destroy: function() { - PIE.RendererBase.destroy.call( this ); - this.targetElement.runtimeStyle.filter = ''; - } - -} ); -/** - * Root renderer for IE9; manages the rendering layers in the element's background - * @param {Element} el The target element - * @param {Object} styleInfos The StyleInfo objects - */ -PIE.IE9RootRenderer = PIE.RendererBase.newRenderer( { - - updatePos: PIE.emptyFn, - updateSize: PIE.emptyFn, - updateVisibility: PIE.emptyFn, - updateProps: PIE.emptyFn, - - outerCommasRE: /^,+|,+$/g, - innerCommasRE: /,+/g, - - setBackgroundLayer: function(zIndex, bg) { - var me = this, - bgLayers = me._bgLayers || ( me._bgLayers = [] ), - undef; - bgLayers[zIndex] = bg || undef; - }, - - finishUpdate: function() { - var me = this, - bgLayers = me._bgLayers, - bg; - if( bgLayers && ( bg = bgLayers.join( ',' ).replace( me.outerCommasRE, '' ).replace( me.innerCommasRE, ',' ) ) !== me._lastBg ) { - me._lastBg = me.targetElement.runtimeStyle.background = bg; - } - }, - - destroy: function() { - this.targetElement.runtimeStyle.background = ''; - delete this._bgLayers; - } - -} ); -/** - * Renderer for element backgrounds, specific for IE9. Only handles translating CSS3 gradients - * to an equivalent SVG data URI. - * @constructor - * @param {Element} el The target element - * @param {Object} styleInfos The StyleInfo objects - */ -PIE.IE9BackgroundRenderer = PIE.RendererBase.newRenderer( { - - bgLayerZIndex: 1, - - needsUpdate: function() { - var si = this.styleInfos; - return si.backgroundInfo.changed(); - }, - - isActive: function() { - var si = this.styleInfos; - return si.backgroundInfo.isActive() || si.borderImageInfo.isActive(); - }, - - draw: function() { - var me = this, - props = me.styleInfos.backgroundInfo.getProps(), - bg, images, i = 0, img, bgAreaSize, bgSize; - - if ( props ) { - bg = []; - - images = props.bgImages; - if ( images ) { - while( img = images[ i++ ] ) { - if (img.imgType === 'linear-gradient' ) { - bgAreaSize = me.getBgAreaSize( img.bgOrigin ); - bgSize = ( img.bgSize || PIE.BgSize.DEFAULT ).pixels( - me.targetElement, bgAreaSize.w, bgAreaSize.h, bgAreaSize.w, bgAreaSize.h - ), - bg.push( - 'url(data:image/svg+xml,' + escape( me.getGradientSvg( img, bgSize.w, bgSize.h ) ) + ') ' + - me.bgPositionToString( img.bgPosition ) + ' / ' + bgSize.w + 'px ' + bgSize.h + 'px ' + - ( img.bgAttachment || '' ) + ' ' + ( img.bgOrigin || '' ) + ' ' + ( img.bgClip || '' ) - ); - } else { - bg.push( img.origString ); - } - } - } - - if ( props.color ) { - bg.push( props.color.val ); - } - - me.parent.setBackgroundLayer(me.bgLayerZIndex, bg.join(',')); - } - }, - - bgPositionToString: function( bgPosition ) { - return bgPosition ? bgPosition.tokens.map(function(token) { - return token.tokenValue; - }).join(' ') : '0 0'; - }, - - getBgAreaSize: function( bgOrigin ) { - var me = this, - el = me.targetElement, - bounds = me.boundsInfo.getBounds(), - elW = bounds.w, - elH = bounds.h, - w = elW, - h = elH, - borders, getLength, cs; - - if( bgOrigin !== 'border-box' ) { - borders = me.styleInfos.borderInfo.getProps(); - if( borders && ( borders = borders.widths ) ) { - w -= borders[ 'l' ].pixels( el ) + borders[ 'l' ].pixels( el ); - h -= borders[ 't' ].pixels( el ) + borders[ 'b' ].pixels( el ); - } - } - - if ( bgOrigin === 'content-box' ) { - getLength = PIE.getLength; - cs = el.currentStyle; - w -= getLength( cs.paddingLeft ).pixels( el ) + getLength( cs.paddingRight ).pixels( el ); - h -= getLength( cs.paddingTop ).pixels( el ) + getLength( cs.paddingBottom ).pixels( el ); - } - - return { w: w, h: h }; - }, - - getGradientSvg: function( info, bgWidth, bgHeight ) { - var el = this.targetElement, - stopsInfo = info.stops, - stopCount = stopsInfo.length, - metrics = PIE.GradientUtil.getGradientMetrics( el, bgWidth, bgHeight, info ), - startX = metrics.startX, - startY = metrics.startY, - endX = metrics.endX, - endY = metrics.endY, - lineLength = metrics.lineLength, - stopPx, - i, j, before, after, - svg; - - // Find the pixel offsets along the CSS3 gradient-line for each stop. - stopPx = []; - for( i = 0; i < stopCount; i++ ) { - stopPx.push( stopsInfo[i].offset ? stopsInfo[i].offset.pixels( el, lineLength ) : - i === 0 ? 0 : i === stopCount - 1 ? lineLength : null ); - } - // Fill in gaps with evenly-spaced offsets - for( i = 1; i < stopCount; i++ ) { - if( stopPx[ i ] === null ) { - before = stopPx[ i - 1 ]; - j = i; - do { - after = stopPx[ ++j ]; - } while( after === null ); - stopPx[ i ] = before + ( after - before ) / ( j - i + 1 ); - } - } - - svg = [ - '' + - '' + - '' - ]; - - // Convert to percentage along the SVG gradient line and add to the stops list - for( i = 0; i < stopCount; i++ ) { - svg.push( - '' - ); - } - - svg.push( - '' + - '' + - '' + - '' - ); - - return svg.join( '' ); - }, - - destroy: function() { - this.parent.setBackgroundLayer( this.bgLayerZIndex ); - } - -} ); -/** - * Renderer for border-image - * @constructor - * @param {Element} el The target element - * @param {Object} styleInfos The StyleInfo objects - * @param {PIE.RootRenderer} parent - */ -PIE.IE9BorderImageRenderer = PIE.RendererBase.newRenderer( { - - REPEAT: 'repeat', - STRETCH: 'stretch', - ROUND: 'round', - - bgLayerZIndex: 0, - - needsUpdate: function() { - return this.styleInfos.borderImageInfo.changed(); - }, - - isActive: function() { - return this.styleInfos.borderImageInfo.isActive(); - }, - - draw: function() { - var me = this, - props = me.styleInfos.borderImageInfo.getProps(), - borderProps = me.styleInfos.borderInfo.getProps(), - bounds = me.boundsInfo.getBounds(), - repeat = props.repeat, - repeatH = repeat.h, - repeatV = repeat.v, - el = me.targetElement, - isAsync = 0; - - PIE.Util.withImageSize( props.src, function( imgSize ) { - var elW = bounds.w, - elH = bounds.h, - imgW = imgSize.w, - imgH = imgSize.h, - - // The image cannot be referenced as a URL directly in the SVG because IE9 throws a strange - // security exception (perhaps due to cross-origin policy within data URIs?) Therefore we - // work around this by converting the image data into a data URI itself using a transient - // canvas. This unfortunately requires the border-image src to be within the same domain, - // which isn't a limitation in true border-image, so we need to try and find a better fix. - imgSrc = me.imageToDataURI( props.src, imgW, imgH ), - - REPEAT = me.REPEAT, - STRETCH = me.STRETCH, - ROUND = me.ROUND, - ceil = Math.ceil, - - zero = PIE.getLength( '0' ), - widths = props.widths || ( borderProps ? borderProps.widths : { 't': zero, 'r': zero, 'b': zero, 'l': zero } ), - widthT = widths['t'].pixels( el ), - widthR = widths['r'].pixels( el ), - widthB = widths['b'].pixels( el ), - widthL = widths['l'].pixels( el ), - slices = props.slice, - sliceT = slices['t'].pixels( el ), - sliceR = slices['r'].pixels( el ), - sliceB = slices['b'].pixels( el ), - sliceL = slices['l'].pixels( el ), - centerW = elW - widthL - widthR, - middleH = elH - widthT - widthB, - imgCenterW = imgW - sliceL - sliceR, - imgMiddleH = imgH - sliceT - sliceB, - - // Determine the size of each tile - 'round' is handled below - tileSizeT = repeatH === STRETCH ? centerW : imgCenterW * widthT / sliceT, - tileSizeR = repeatV === STRETCH ? middleH : imgMiddleH * widthR / sliceR, - tileSizeB = repeatH === STRETCH ? centerW : imgCenterW * widthB / sliceB, - tileSizeL = repeatV === STRETCH ? middleH : imgMiddleH * widthL / sliceL, - - svg, - patterns = [], - rects = [], - i = 0; - - // For 'round', subtract from each tile's size enough so that they fill the space a whole number of times - if (repeatH === ROUND) { - tileSizeT -= (tileSizeT - (centerW % tileSizeT || tileSizeT)) / ceil(centerW / tileSizeT); - tileSizeB -= (tileSizeB - (centerW % tileSizeB || tileSizeB)) / ceil(centerW / tileSizeB); - } - if (repeatV === ROUND) { - tileSizeR -= (tileSizeR - (middleH % tileSizeR || tileSizeR)) / ceil(middleH / tileSizeR); - tileSizeL -= (tileSizeL - (middleH % tileSizeL || tileSizeL)) / ceil(middleH / tileSizeL); - } - - - // Build the SVG for the border-image rendering. Add each piece as a pattern, which is then stretched - // or repeated as the fill of a rect of appropriate size. - svg = [ - '' - ]; - - function addImage( x, y, w, h, cropX, cropY, cropW, cropH, tileW, tileH ) { - patterns.push( - '' + - '' + - '' + - '' + - '' - ); - rects.push( - '' - ); - i++; - } - addImage( 0, 0, widthL, widthT, 0, 0, sliceL, sliceT, widthL, widthT ); // top left - addImage( widthL, 0, centerW, widthT, sliceL, 0, imgCenterW, sliceT, tileSizeT, widthT ); // top center - addImage( elW - widthR, 0, widthR, widthT, imgW - sliceR, 0, sliceR, sliceT, widthR, widthT ); // top right - addImage( 0, widthT, widthL, middleH, 0, sliceT, sliceL, imgMiddleH, widthL, tileSizeL ); // middle left - if ( props.fill ) { // center fill - addImage( widthL, widthT, centerW, middleH, sliceL, sliceT, imgCenterW, imgMiddleH, - tileSizeT || tileSizeB || imgCenterW, tileSizeL || tileSizeR || imgMiddleH ); - } - addImage( elW - widthR, widthT, widthR, middleH, imgW - sliceR, sliceT, sliceR, imgMiddleH, widthR, tileSizeR ); // middle right - addImage( 0, elH - widthB, widthL, widthB, 0, imgH - sliceB, sliceL, sliceB, widthL, widthB ); // bottom left - addImage( widthL, elH - widthB, centerW, widthB, sliceL, imgH - sliceB, imgCenterW, sliceB, tileSizeB, widthB ); // bottom center - addImage( elW - widthR, elH - widthB, widthR, widthB, imgW - sliceR, imgH - sliceB, sliceR, sliceB, widthR, widthB ); // bottom right - - svg.push( - '' + - patterns.join('\n') + - '' + - rects.join('\n') + - '' - ); - - me.parent.setBackgroundLayer( me.bgLayerZIndex, 'url(data:image/svg+xml,' + escape( svg.join( '' ) ) + ') no-repeat border-box border-box' ); - - // If the border-image's src wasn't immediately available, the SVG for its background layer - // will have been created asynchronously after the main element's update has finished; we'll - // therefore need to force the root renderer to sync to the final background once finished. - if( isAsync ) { - me.parent.finishUpdate(); - } - }, me ); - - isAsync = 1; - }, - - /** - * Convert a given image to a data URI - */ - imageToDataURI: (function() { - var uris = {}; - return function( src, width, height ) { - var uri = uris[ src ], - image, canvas; - if ( !uri ) { - image = new Image(); - canvas = doc.createElement( 'canvas' ); - image.src = src; - canvas.width = width; - canvas.height = height; - canvas.getContext( '2d' ).drawImage( image, 0, 0 ); - uri = uris[ src ] = canvas.toDataURL(); - } - return uri; - } - })(), - - prepareUpdate: PIE.BorderImageRenderer.prototype.prepareUpdate, - - destroy: function() { - var me = this, - rs = me.targetElement.runtimeStyle; - me.parent.setBackgroundLayer( me.bgLayerZIndex ); - rs.borderColor = rs.borderStyle = rs.borderWidth = ''; - } - -} ); - -PIE.Element = (function() { - - var wrappers = {}, - lazyInitCssProp = PIE.CSS_PREFIX + 'lazy-init', - pollCssProp = PIE.CSS_PREFIX + 'poll', - trackActiveCssProp = PIE.CSS_PREFIX + 'track-active', - trackHoverCssProp = PIE.CSS_PREFIX + 'track-hover', - hoverClass = PIE.CLASS_PREFIX + 'hover', - activeClass = PIE.CLASS_PREFIX + 'active', - focusClass = PIE.CLASS_PREFIX + 'focus', - firstChildClass = PIE.CLASS_PREFIX + 'first-child', - ignorePropertyNames = { 'background':1, 'bgColor':1, 'display': 1 }, - classNameRegExes = {}, - dummyArray = []; - - - function addClass( el, className ) { - el.className += ' ' + className; - } - - function removeClass( el, className ) { - var re = classNameRegExes[ className ] || - ( classNameRegExes[ className ] = new RegExp( '\\b' + className + '\\b', 'g' ) ); - el.className = el.className.replace( re, '' ); - } - - function delayAddClass( el, className /*, className2*/ ) { - var classes = dummyArray.slice.call( arguments, 1 ), - i = classes.length; - setTimeout( function() { - if( el ) { - while( i-- ) { - addClass( el, classes[ i ] ); - } - } - }, 0 ); - } - - function delayRemoveClass( el, className /*, className2*/ ) { - var classes = dummyArray.slice.call( arguments, 1 ), - i = classes.length; - setTimeout( function() { - if( el ) { - while( i-- ) { - removeClass( el, classes[ i ] ); - } - } - }, 0 ); - } - - - - function Element( el ) { - var renderers, - rootRenderer, - boundsInfo = new PIE.BoundsInfo( el ), - styleInfos, - styleInfosArr, - initializing, - initialized, - eventsAttached, - eventListeners = [], - delayed, - destroyed, - poll; - - /** - * Initialize PIE for this element. - */ - function init() { - if( !initialized ) { - var docEl, - bounds, - ieDocMode = PIE.ieDocMode, - cs = el.currentStyle, - lazy = cs.getAttribute( lazyInitCssProp ) === 'true', - trackActive = cs.getAttribute( trackActiveCssProp ) !== 'false', - trackHover = cs.getAttribute( trackHoverCssProp ) !== 'false', - childRenderers; - - // Polling for size/position changes: default to on in IE8, off otherwise, overridable by -pie-poll - poll = cs.getAttribute( pollCssProp ); - poll = ieDocMode > 7 ? poll !== 'false' : poll === 'true'; - - // Force layout so move/resize events will fire. Set this as soon as possible to avoid layout changes - // after load, but make sure it only gets called the first time through to avoid recursive calls to init(). - if( !initializing ) { - initializing = 1; - el.runtimeStyle.zoom = 1; - initFirstChildPseudoClass(); - } - - boundsInfo.lock(); - - // If the -pie-lazy-init:true flag is set, check if the element is outside the viewport and if so, delay initialization - if( lazy && ( bounds = boundsInfo.getBounds() ) && ( docEl = doc.documentElement || doc.body ) && - ( bounds.y > docEl.clientHeight || bounds.x > docEl.clientWidth || bounds.y + bounds.h < 0 || bounds.x + bounds.w < 0 ) ) { - if( !delayed ) { - delayed = 1; - PIE.OnScroll.observe( init ); - } - } else { - initialized = 1; - delayed = initializing = 0; - PIE.OnScroll.unobserve( init ); - - // Create the style infos and renderers - if ( ieDocMode === 9 ) { - styleInfos = { - backgroundInfo: new PIE.BackgroundStyleInfo( el ), - borderImageInfo: new PIE.BorderImageStyleInfo( el ), - borderInfo: new PIE.BorderStyleInfo( el ) - }; - styleInfosArr = [ - styleInfos.backgroundInfo, - styleInfos.borderImageInfo - ]; - rootRenderer = new PIE.IE9RootRenderer( el, boundsInfo, styleInfos ); - childRenderers = [ - new PIE.IE9BackgroundRenderer( el, boundsInfo, styleInfos, rootRenderer ), - new PIE.IE9BorderImageRenderer( el, boundsInfo, styleInfos, rootRenderer ) - ]; - } else { - - styleInfos = { - backgroundInfo: new PIE.BackgroundStyleInfo( el ), - borderInfo: new PIE.BorderStyleInfo( el ), - borderImageInfo: new PIE.BorderImageStyleInfo( el ), - borderRadiusInfo: new PIE.BorderRadiusStyleInfo( el ), - boxShadowInfo: new PIE.BoxShadowStyleInfo( el ), - visibilityInfo: new PIE.VisibilityStyleInfo( el ) - }; - styleInfosArr = [ - styleInfos.backgroundInfo, - styleInfos.borderInfo, - styleInfos.borderImageInfo, - styleInfos.borderRadiusInfo, - styleInfos.boxShadowInfo, - styleInfos.visibilityInfo - ]; - rootRenderer = new PIE.RootRenderer( el, boundsInfo, styleInfos ); - childRenderers = [ - new PIE.BoxShadowOutsetRenderer( el, boundsInfo, styleInfos, rootRenderer ), - new PIE.BackgroundRenderer( el, boundsInfo, styleInfos, rootRenderer ), - //new PIE.BoxShadowInsetRenderer( el, boundsInfo, styleInfos, rootRenderer ), - new PIE.BorderRenderer( el, boundsInfo, styleInfos, rootRenderer ), - new PIE.BorderImageRenderer( el, boundsInfo, styleInfos, rootRenderer ) - ]; - if( el.tagName === 'IMG' ) { - childRenderers.push( new PIE.ImgRenderer( el, boundsInfo, styleInfos, rootRenderer ) ); - } - rootRenderer.childRenderers = childRenderers; // circular reference, can't pass in constructor; TODO is there a cleaner way? - } - renderers = [ rootRenderer ].concat( childRenderers ); - - // Add property change listeners to ancestors if requested - initAncestorEventListeners(); - - // Add to list of polled elements in IE8 - if( poll ) { - PIE.Heartbeat.observe( update ); - PIE.Heartbeat.run(); - } - - // Trigger rendering - update( 1 ); - } - - if( !eventsAttached ) { - eventsAttached = 1; - if( ieDocMode < 9 ) { - addListener( el, 'onmove', handleMoveOrResize ); - } - addListener( el, 'onresize', handleMoveOrResize ); - addListener( el, 'onpropertychange', propChanged ); - if( trackHover ) { - addListener( el, 'onmouseenter', mouseEntered ); - } - if( trackHover || trackActive ) { - addListener( el, 'onmouseleave', mouseLeft ); - } - if( trackActive ) { - addListener( el, 'onmousedown', mousePressed ); - } - if( el.tagName in PIE.focusableElements ) { - addListener( el, 'onfocus', focused ); - addListener( el, 'onblur', blurred ); - } - PIE.OnResize.observe( handleMoveOrResize ); - - PIE.OnUnload.observe( removeEventListeners ); - } - - boundsInfo.unlock(); - } - } - - - - - /** - * Event handler for onmove and onresize events. Invokes update() only if the element's - * bounds have previously been calculated, to prevent multiple runs during page load when - * the element has no initial CSS3 properties. - */ - function handleMoveOrResize() { - if( boundsInfo && boundsInfo.hasBeenQueried() ) { - update(); - } - } - - - /** - * Update position and/or size as necessary. Both move and resize events call - * this rather than the updatePos/Size functions because sometimes, particularly - * during page load, one will fire but the other won't. - */ - function update( force ) { - if( !destroyed ) { - if( initialized ) { - var i, len = renderers.length; - - lockAll(); - for( i = 0; i < len; i++ ) { - renderers[i].prepareUpdate(); - } - if( force || boundsInfo.positionChanged() ) { - /* TODO just using getBoundingClientRect (used internally by BoundsInfo) for detecting - position changes may not always be accurate; it's possible that - an element will actually move relative to its positioning parent, but its position - relative to the viewport will stay the same. Need to come up with a better way to - track movement. The most accurate would be the same logic used in RootRenderer.updatePos() - but that is a more expensive operation since it does some DOM walking, and we want this - check to be as fast as possible. */ - for( i = 0; i < len; i++ ) { - renderers[i].updatePos(); - } - } - if( force || boundsInfo.sizeChanged() ) { - for( i = 0; i < len; i++ ) { - renderers[i].updateSize(); - } - } - rootRenderer.finishUpdate(); - unlockAll(); - } - else if( !initializing ) { - init(); - } - } - } - - /** - * Handle property changes to trigger update when appropriate. - */ - function propChanged() { - var i, len = renderers.length, - renderer, - e = event; - - // Some elements like fire onpropertychange events for old-school background properties - // ('background', 'bgColor') when runtimeStyle background properties are changed, which - // results in an infinite loop; therefore we filter out those property names. Also, 'display' - // is ignored because size calculations don't work correctly immediately when its onpropertychange - // event fires, and because it will trigger an onresize event anyway. - if( !destroyed && !( e && e.propertyName in ignorePropertyNames ) ) { - if( initialized ) { - lockAll(); - for( i = 0; i < len; i++ ) { - renderers[i].prepareUpdate(); - } - for( i = 0; i < len; i++ ) { - renderer = renderers[i]; - // Make sure position is synced if the element hasn't already been rendered. - // TODO this feels sloppy - look into merging propChanged and update functions - if( !renderer.isPositioned ) { - renderer.updatePos(); - } - if( renderer.needsUpdate() ) { - renderer.updateProps(); - } - } - rootRenderer.finishUpdate(); - unlockAll(); - } - else if( !initializing ) { - init(); - } - } - } - - - /** - * Handle mouseenter events. Adds a custom class to the element to allow IE6 to add - * hover styles to non-link elements, and to trigger a propertychange update. - */ - function mouseEntered() { - //must delay this because the mouseenter event fires before the :hover styles are added. - delayAddClass( el, hoverClass ); - } - - /** - * Handle mouseleave events - */ - function mouseLeft() { - //must delay this because the mouseleave event fires before the :hover styles are removed. - delayRemoveClass( el, hoverClass, activeClass ); - } - - /** - * Handle mousedown events. Adds a custom class to the element to allow IE6 to add - * active styles to non-link elements, and to trigger a propertychange update. - */ - function mousePressed() { - //must delay this because the mousedown event fires before the :active styles are added. - delayAddClass( el, activeClass ); - - // listen for mouseups on the document; can't just be on the element because the user might - // have dragged out of the element while the mouse button was held down - PIE.OnMouseup.observe( mouseReleased ); - } - - /** - * Handle mouseup events - */ - function mouseReleased() { - //must delay this because the mouseup event fires before the :active styles are removed. - delayRemoveClass( el, activeClass ); - - PIE.OnMouseup.unobserve( mouseReleased ); - } - - /** - * Handle focus events. Adds a custom class to the element to trigger a propertychange update. - */ - function focused() { - //must delay this because the focus event fires before the :focus styles are added. - delayAddClass( el, focusClass ); - } - - /** - * Handle blur events - */ - function blurred() { - //must delay this because the blur event fires before the :focus styles are removed. - delayRemoveClass( el, focusClass ); - } - - - /** - * Handle property changes on ancestors of the element; see initAncestorEventListeners() - * which adds these listeners as requested with the -pie-watch-ancestors CSS property. - */ - function ancestorPropChanged() { - var name = event.propertyName; - if( name === 'className' || name === 'id' ) { - propChanged(); - } - } - - function lockAll() { - boundsInfo.lock(); - for( var i = styleInfosArr.length; i--; ) { - styleInfosArr[i].lock(); - } - } - - function unlockAll() { - for( var i = styleInfosArr.length; i--; ) { - styleInfosArr[i].unlock(); - } - boundsInfo.unlock(); - } - - - function addListener( targetEl, type, handler ) { - targetEl.attachEvent( type, handler ); - eventListeners.push( [ targetEl, type, handler ] ); - } - - /** - * Remove all event listeners from the element and any monitored ancestors. - */ - function removeEventListeners() { - if (eventsAttached) { - var i = eventListeners.length, - listener; - - while( i-- ) { - listener = eventListeners[ i ]; - listener[ 0 ].detachEvent( listener[ 1 ], listener[ 2 ] ); - } - - PIE.OnUnload.unobserve( removeEventListeners ); - eventsAttached = 0; - eventListeners = []; - } - } - - - /** - * Clean everything up when the behavior is removed from the element, or the element - * is manually destroyed. - */ - function destroy() { - if( !destroyed ) { - var i, len; - - removeEventListeners(); - - destroyed = 1; - - // destroy any active renderers - if( renderers ) { - for( i = 0, len = renderers.length; i < len; i++ ) { - renderers[i].finalized = 1; - renderers[i].destroy(); - } - } - - // Remove from list of polled elements in IE8 - if( poll ) { - PIE.Heartbeat.unobserve( update ); - } - // Stop onresize listening - PIE.OnResize.unobserve( update ); - - // Kill references - renderers = boundsInfo = styleInfos = styleInfosArr = el = null; - } - } - - - /** - * If requested via the custom -pie-watch-ancestors CSS property, add onpropertychange and - * other event listeners to ancestor(s) of the element so we can pick up style changes - * based on CSS rules using descendant selectors. - */ - function initAncestorEventListeners() { - var watch = el.currentStyle.getAttribute( PIE.CSS_PREFIX + 'watch-ancestors' ), - i, a; - if( watch ) { - watch = parseInt( watch, 10 ); - i = 0; - a = el.parentNode; - while( a && ( watch === 'NaN' || i++ < watch ) ) { - addListener( a, 'onpropertychange', ancestorPropChanged ); - addListener( a, 'onmouseenter', mouseEntered ); - addListener( a, 'onmouseleave', mouseLeft ); - addListener( a, 'onmousedown', mousePressed ); - if( a.tagName in PIE.focusableElements ) { - addListener( a, 'onfocus', focused ); - addListener( a, 'onblur', blurred ); - } - a = a.parentNode; - } - } - } - - - /** - * If the target element is a first child, add a pie_first-child class to it. This allows using - * the added class as a workaround for the fact that PIE's rendering element breaks the :first-child - * pseudo-class selector. - */ - function initFirstChildPseudoClass() { - var tmpEl = el, - isFirst = 1; - while( tmpEl = tmpEl.previousSibling ) { - if( tmpEl.nodeType === 1 ) { - isFirst = 0; - break; - } - } - if( isFirst ) { - addClass( el, firstChildClass ); - } - } - - - // These methods are all already bound to this instance so there's no need to wrap them - // in a closure to maintain the 'this' scope object when calling them. - this.init = init; - this.update = update; - this.destroy = destroy; - this.el = el; - } - - Element.getInstance = function( el ) { - var id = PIE.Util.getUID( el ); - return wrappers[ id ] || ( wrappers[ id ] = new Element( el ) ); - }; - - Element.destroy = function( el ) { - var id = PIE.Util.getUID( el ), - wrapper = wrappers[ id ]; - if( wrapper ) { - wrapper.destroy(); - delete wrappers[ id ]; - } - }; - - Element.destroyAll = function() { - var els = [], wrapper; - if( wrappers ) { - for( var w in wrappers ) { - if( wrappers.hasOwnProperty( w ) ) { - wrapper = wrappers[ w ]; - els.push( wrapper.el ); - wrapper.destroy(); - } - } - wrappers = {}; - } - return els; - }; - - return Element; -})(); - -/* - * This file exposes the public API for invoking PIE. - */ - - -/** - * @property supportsVML - * True if the current IE browser environment has a functioning VML engine. Should be true - * in most IEs, but in rare cases may be false. If false, PIE will exit immediately when - * attached to an element; this property may be used for debugging or by external scripts - * to perform some special action when VML support is absent. - * @type {boolean} - */ -PIE[ 'supportsVML' ] = PIE.supportsVML; - - -/** - * Programatically attach PIE to a single element. - * @param {Element} el - */ -PIE[ 'attach' ] = function( el ) { - if (PIE.ieDocMode < 10 && PIE.supportsVML) { - PIE.Element.getInstance( el ).init(); - } -}; - - -/** - * Programatically detach PIE from a single element. - * @param {Element} el - */ -PIE[ 'detach' ] = function( el ) { - PIE.Element.destroy( el ); -}; - - -} // if( !PIE ) -})(); \ No newline at end of file diff --git a/themes/mantra/js/frontend.js b/themes/mantra/js/frontend.js deleted file mode 100644 index 27b22a59..00000000 --- a/themes/mantra/js/frontend.js +++ /dev/null @@ -1,256 +0,0 @@ -/****************************** - Mantra Theme - custom scripting - (c) Cryout Creations - www.cryoutcreations.eu -*******************************/ - - -jQuery(document).ready(function() { - -/* standard menu touch support for tablets */ - var isTouch = ('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch; /* check touch support */ - jQuery('#access .menu > ul > li a').click(function(e){ - var $link_id = jQuery(this).attr('href'); - if (jQuery(this).parent().data('clicked') == $link_id) { /* second touch */ - jQuery(this).parent().data('clicked', null); - return true; - } - else { /* first touch */ - if (isTouch && (jQuery(this).parent().children('ul').length >0)) e.preventDefault(); - jQuery(this).parent().data('clicked', $link_id); - } - }); - -/* Back to top button animation */ -jQuery(function() { - jQuery(window).scroll(function() { - var x=jQuery(this).scrollTop(); - var ver = getInternetExplorerVersion(); - /* no fade animation (transparency) if IE8 or below */ - if ( ver > -1 && ver <= 8 ) { - if(x != 0) { - jQuery('#toTop').show(); - } else { - jQuery('#toTop').hide(); - } - } - /* fade animation if not IE8 or below */ - else { - if(x != 0) { - jQuery('#toTop').fadeIn(3000); - } else { - jQuery('#toTop').fadeOut(); - } - } - }); - jQuery('#toTop').click(function() { jQuery('body,html').animate({scrollTop:0},800); }); -}); - - -/* Menu animation */ -jQuery("#access ul ul").css({display: "none"}); /* Opera Fix */ -jQuery("#access").removeClass("jssafe"); /* JS failsafe */ -jQuery("#access .menu ul li").hoverIntent({ - over: function(){jQuery(this).children("ul").show(400);}, - out: function(){ jQuery(this).children('ul').hide();}, - timeout:400} -); - - -/* Social Icons Animation */ -jQuery(".socialicons").hover( - function(){ jQuery(this).animate({"top": "-3px" },{ queue: false, duration:125}); }, - function(){ jQuery(this).animate({ "top": "0px" }, { queue: false, duration:125 }); -}); - - -/*! http://tinynav.viljamis.com v1.03 by @viljamis - mod 0.1.1 by cryout creations */ -(function ($, window, i) { - $.fn.tinyNav = function (options) { - - /* Default settings */ - var settings = $.extend({ - 'active' : 'selected', /* String: Set the "active" class */ - 'header' : '' /* Show header instead of the active item */ - }, options); - - return this.each(function () { - - i++; /* Used for namespacing */ - - var $nav = $(this), - /* Namespacing */ - namespace = 'tinynav', - namespace_i = namespace + i, - l_namespace_i = '.l_' + namespace_i, - $select = $('
      fire onpropertychange events for old-school background properties + // ('background', 'bgColor') when runtimeStyle background properties are changed, which + // results in an infinite loop; therefore we filter out those property names. Also, 'display' + // is ignored because size calculations don't work correctly immediately when its onpropertychange + // event fires, and because it will trigger an onresize event anyway. + if( !destroyed && !( e && e.propertyName in ignorePropertyNames ) ) { + if( initialized ) { + lockAll(); + for( i = 0; i < len; i++ ) { + renderers[i].prepareUpdate(); + } + for( i = 0; i < len; i++ ) { + renderer = renderers[i]; + // Make sure position is synced if the element hasn't already been rendered. + // TODO this feels sloppy - look into merging propChanged and update functions + if( !renderer.isPositioned ) { + renderer.updatePos(); + } + if( renderer.needsUpdate() ) { + renderer.updateProps(); + } + } + rootRenderer.finishUpdate(); + unlockAll(); + } + else if( !initializing ) { + init(); + } + } + } + + + /** + * Handle mouseenter events. Adds a custom class to the element to allow IE6 to add + * hover styles to non-link elements, and to trigger a propertychange update. + */ + function mouseEntered() { + //must delay this because the mouseenter event fires before the :hover styles are added. + delayAddClass( el, hoverClass ); + } + + /** + * Handle mouseleave events + */ + function mouseLeft() { + //must delay this because the mouseleave event fires before the :hover styles are removed. + delayRemoveClass( el, hoverClass, activeClass ); + } + + /** + * Handle mousedown events. Adds a custom class to the element to allow IE6 to add + * active styles to non-link elements, and to trigger a propertychange update. + */ + function mousePressed() { + //must delay this because the mousedown event fires before the :active styles are added. + delayAddClass( el, activeClass ); + + // listen for mouseups on the document; can't just be on the element because the user might + // have dragged out of the element while the mouse button was held down + PIE.OnMouseup.observe( mouseReleased ); + } + + /** + * Handle mouseup events + */ + function mouseReleased() { + //must delay this because the mouseup event fires before the :active styles are removed. + delayRemoveClass( el, activeClass ); + + PIE.OnMouseup.unobserve( mouseReleased ); + } + + /** + * Handle focus events. Adds a custom class to the element to trigger a propertychange update. + */ + function focused() { + //must delay this because the focus event fires before the :focus styles are added. + delayAddClass( el, focusClass ); + } + + /** + * Handle blur events + */ + function blurred() { + //must delay this because the blur event fires before the :focus styles are removed. + delayRemoveClass( el, focusClass ); + } + + + /** + * Handle property changes on ancestors of the element; see initAncestorEventListeners() + * which adds these listeners as requested with the -pie-watch-ancestors CSS property. + */ + function ancestorPropChanged() { + var name = event.propertyName; + if( name === 'className' || name === 'id' ) { + propChanged(); + } + } + + function lockAll() { + boundsInfo.lock(); + for( var i = styleInfosArr.length; i--; ) { + styleInfosArr[i].lock(); + } + } + + function unlockAll() { + for( var i = styleInfosArr.length; i--; ) { + styleInfosArr[i].unlock(); + } + boundsInfo.unlock(); + } + + + function addListener( targetEl, type, handler ) { + targetEl.attachEvent( type, handler ); + eventListeners.push( [ targetEl, type, handler ] ); + } + + /** + * Remove all event listeners from the element and any monitored ancestors. + */ + function removeEventListeners() { + if (eventsAttached) { + var i = eventListeners.length, + listener; + + while( i-- ) { + listener = eventListeners[ i ]; + listener[ 0 ].detachEvent( listener[ 1 ], listener[ 2 ] ); + } + + PIE.OnUnload.unobserve( removeEventListeners ); + eventsAttached = 0; + eventListeners = []; + } + } + + + /** + * Clean everything up when the behavior is removed from the element, or the element + * is manually destroyed. + */ + function destroy() { + if( !destroyed ) { + var i, len; + + removeEventListeners(); + + destroyed = 1; + + // destroy any active renderers + if( renderers ) { + for( i = 0, len = renderers.length; i < len; i++ ) { + renderers[i].finalized = 1; + renderers[i].destroy(); + } + } + + // Remove from list of polled elements in IE8 + if( poll ) { + PIE.Heartbeat.unobserve( update ); + } + // Stop onresize listening + PIE.OnResize.unobserve( update ); + + // Kill references + renderers = boundsInfo = styleInfos = styleInfosArr = el = null; + } + } + + + /** + * If requested via the custom -pie-watch-ancestors CSS property, add onpropertychange and + * other event listeners to ancestor(s) of the element so we can pick up style changes + * based on CSS rules using descendant selectors. + */ + function initAncestorEventListeners() { + var watch = el.currentStyle.getAttribute( PIE.CSS_PREFIX + 'watch-ancestors' ), + i, a; + if( watch ) { + watch = parseInt( watch, 10 ); + i = 0; + a = el.parentNode; + while( a && ( watch === 'NaN' || i++ < watch ) ) { + addListener( a, 'onpropertychange', ancestorPropChanged ); + addListener( a, 'onmouseenter', mouseEntered ); + addListener( a, 'onmouseleave', mouseLeft ); + addListener( a, 'onmousedown', mousePressed ); + if( a.tagName in PIE.focusableElements ) { + addListener( a, 'onfocus', focused ); + addListener( a, 'onblur', blurred ); + } + a = a.parentNode; + } + } + } + + + /** + * If the target element is a first child, add a pie_first-child class to it. This allows using + * the added class as a workaround for the fact that PIE's rendering element breaks the :first-child + * pseudo-class selector. + */ + function initFirstChildPseudoClass() { + var tmpEl = el, + isFirst = 1; + while( tmpEl = tmpEl.previousSibling ) { + if( tmpEl.nodeType === 1 ) { + isFirst = 0; + break; + } + } + if( isFirst ) { + addClass( el, firstChildClass ); + } + } + + + // These methods are all already bound to this instance so there's no need to wrap them + // in a closure to maintain the 'this' scope object when calling them. + this.init = init; + this.update = update; + this.destroy = destroy; + this.el = el; + } + + Element.getInstance = function( el ) { + var id = PIE.Util.getUID( el ); + return wrappers[ id ] || ( wrappers[ id ] = new Element( el ) ); + }; + + Element.destroy = function( el ) { + var id = PIE.Util.getUID( el ), + wrapper = wrappers[ id ]; + if( wrapper ) { + wrapper.destroy(); + delete wrappers[ id ]; + } + }; + + Element.destroyAll = function() { + var els = [], wrapper; + if( wrappers ) { + for( var w in wrappers ) { + if( wrappers.hasOwnProperty( w ) ) { + wrapper = wrappers[ w ]; + els.push( wrapper.el ); + wrapper.destroy(); + } + } + wrappers = {}; + } + return els; + }; + + return Element; +})(); + +/* + * This file exposes the public API for invoking PIE. + */ + + +/** + * @property supportsVML + * True if the current IE browser environment has a functioning VML engine. Should be true + * in most IEs, but in rare cases may be false. If false, PIE will exit immediately when + * attached to an element; this property may be used for debugging or by external scripts + * to perform some special action when VML support is absent. + * @type {boolean} + */ +PIE[ 'supportsVML' ] = PIE.supportsVML; + + +/** + * Programatically attach PIE to a single element. + * @param {Element} el + */ +PIE[ 'attach' ] = function( el ) { + if (PIE.ieDocMode < 10 && PIE.supportsVML) { + PIE.Element.getInstance( el ).init(); + } +}; + + +/** + * Programatically detach PIE from a single element. + * @param {Element} el + */ +PIE[ 'detach' ] = function( el ) { + PIE.Element.destroy( el ); +}; + + +} // if( !PIE ) +})(); \ No newline at end of file diff --git a/themes/mantra/resources/js/frontend.js b/themes/mantra/resources/js/frontend.js new file mode 100644 index 00000000..391a5550 --- /dev/null +++ b/themes/mantra/resources/js/frontend.js @@ -0,0 +1,190 @@ +/****************************** + Mantra Theme + custom scripting + (c) Cryout Creations + www.cryoutcreations.eu +*******************************/ + + +jQuery(document).ready(function() { + +/* Standard menu touch support for tablets */ +var custom_event = ('ontouchstart' in window) ? 'touchstart' : 'click'; /* check touch support */ +var ios = /iPhone|iPad|iPod/i.test(navigator.userAgent); + jQuery('#access .menu > ul > li a').on('click', function(e){ + var $link_id = jQuery(this).attr('href'); + if (jQuery(this).parent().data('clicked') == $link_id) { /* second touch */ + jQuery(this).parent().data('clicked', null); + } + else { /* first touch */ + if (custom_event != 'click' && !ios && (jQuery(this).parent().children('ul').length >0)) {e.preventDefault();} + jQuery(this).parent().data('clicked', $link_id); + } + }); + +/* Back to top button animation */ +jQuery(function() { + jQuery(window).scroll(function() { + var x=jQuery(this).scrollTop(); + + if(x != 0) { + jQuery('#toTop').addClass('showtop') + } else { + jQuery('#toTop').removeClass('showtop'); + } + + }); + jQuery('#toTop').click(function() { jQuery('body,html').animate({scrollTop:0},800); }); +}); + + +/* Menu animation */ +jQuery("#access ul ul").css({display: "none"}); /* Opera Fix */ +jQuery("#access").removeClass("jssafe"); /* JS failsafe */ +jQuery("#access .menu ul li").hoverIntent({ + over: function(){jQuery(this).children("ul").fadeIn(300);}, + out: function(){ jQuery(this).children('ul').fadeOut();}, + timeout:300} +); + + +/* detect and apply custom class for safari */ +if (navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1) { + jQuery('body').addClass('safari'); +} + +/* Add custom borders to images */ +jQuery("img.alignnone, img.alignleft, img.aligncenter, img.alignright").addClass(mantra_options.image_class); + + +}); +/* end document.ready */ + +/* Mobile Menu v2 */ +function mantra_mobilemenu_init() { + var state = false; + jQuery("#nav-toggle").click(function(){ + jQuery("#access").slideToggle(function(){ if (state) {jQuery(this).removeAttr( 'style' )}; state = ! state; } ); + }); +} + +jQuery(window).load(function() { + mantra_mobilemenu_init(); +}); + +/* Columns equalizer, used if at least one sidebar has a bg color */ +function equalizeHeights(){ + var h1 = jQuery("#primary").height(); + var h2 = jQuery("#secondary").height(); + var h3 = jQuery("#content").height(); + var max = Math.max(h1,h2,h3); + if (h1').parent('.fluid-width-video-wrapper').css('padding-top', (aspectRatio * 100)+"%"); + $this.removeAttr('height').removeAttr('width'); + }); + }); + + } +})( jQuery ); + + +/*! + * hoverIntent r7 // 2013.03.11 // jQuery 1.9.1+ + * http://cherne.net/brian/resources/jquery.hoverIntent.html + * + * You may use hoverIntent under the terms of the MIT license. + * Copyright 2007, 2013 Brian Cherne + */ +(function(e){e.fn.hoverIntent=function(t,n,r){var i={interval:100,sensitivity:7,timeout:0};if(typeof t==="object"){i=e.extend(i,t)}else if(e.isFunction(n)){i=e.extend(i,{over:t,out:n,selector:r})}else{i=e.extend(i,{over:t,out:t,selector:n})}var s,o,u,a;var f=function(e){s=e.pageX;o=e.pageY};var l=function(t,n){n.hoverIntent_t=clearTimeout(n.hoverIntent_t);if(Math.abs(u-s)+Math.abs(a-o)0){if(r.startSlide>=i.totalSlides){r.startSlide=i.totalSlides-1}i.currentSlide=r.startSlide}if(e(o[i.currentSlide]).is("img")){i.currentImage=e(o[i.currentSlide])}else{i.currentImage=e(o[i.currentSlide]).find("img:first")}if(e(o[i.currentSlide]).is("a")){e(o[i.currentSlide]).css("display","block")}var u=e("").addClass("nivo-main-image");u.attr("src",i.currentImage.attr("src")).show();s.append(u);e(window).resize(function(){s.children("img").width(s.width());u.attr("src",i.currentImage.attr("src"));u.stop().height("auto");e(".nivo-slice").remove();e(".nivo-box").remove()});s.append(e('
      '));var a=function(t){var n=e(".nivo-caption",s);if(i.currentImage.attr("title")!=""&&i.currentImage.attr("title")!=undefined){var r=i.currentImage.attr("title");if(r.substr(0,1)=="#")r=e(r).html();if(n.css("display")=="block"){setTimeout(function(){n.html(r)},t.animSpeed)}else{n.html(r);n.stop().fadeIn(t.animSpeed)}}else{n.stop().fadeOut(t.animSpeed)}};a(r);var f=0;if(!r.manualAdvance&&o.length>1){f=setInterval(function(){d(s,o,r,false)},r.pauseTime)}if(r.directionNav){s.append('");e(s).on("click","a.nivo-prevNav",function(){if(i.running){return false}clearInterval(f);f="";i.currentSlide-=2;d(s,o,r,"prev")});e(s).on("click","a.nivo-nextNav",function(){if(i.running){return false}clearInterval(f);f="";d(s,o,r,"next")})}if(r.controlNav){i.controlNavEl=e('
      ');s.after(i.controlNavEl);for(var l=0;l')}else{i.controlNavEl.append(''+(l+1)+"")}}e("a:eq("+i.currentSlide+")",i.controlNavEl).addClass("active");e("a",i.controlNavEl).bind("click",function(){if(i.running)return false;if(e(this).hasClass("active"))return false;clearInterval(f);f="";u.attr("src",i.currentImage.attr("src"));i.currentSlide=e(this).attr("rel")-1;d(s,o,r,"control")})}if(r.pauseOnHover){s.hover(function(){i.paused=true;clearInterval(f);f=""},function(){i.paused=false;if(f===""&&!r.manualAdvance){f=setInterval(function(){d(s,o,r,false)},r.pauseTime)}})}s.bind("nivo:animFinished",function(){u.attr("src",i.currentImage.attr("src"));i.running=false;e(o).each(function(){if(e(this).is("a")){e(this).css("display","none")}});if(e(o[i.currentSlide]).is("a")){e(o[i.currentSlide]).css("display","block")}if(f===""&&!i.paused&&!r.manualAdvance){f=setInterval(function(){d(s,o,r,false)},r.pauseTime)}r.afterChange.call(this)});var h=function(t,n,r){if(e(r.currentImage).parent().is("a"))e(r.currentImage).parent().css("display","block");e('img[src="'+r.currentImage.attr("src")+'"]',t).not(".nivo-main-image,.nivo-control img").width(t.width()).css("visibility","hidden").show();var i=e('img[src="'+r.currentImage.attr("src")+'"]',t).not(".nivo-main-image,.nivo-control img").parent().is("a")?e('img[src="'+r.currentImage.attr("src")+'"]',t).not(".nivo-main-image,.nivo-control img").parent().height():e('img[src="'+r.currentImage.attr("src")+'"]',t).not(".nivo-main-image,.nivo-control img").height();for(var s=0;s').css({left:o*s+"px",width:t.width()-o*s+"px",height:i+"px",opacity:"0",overflow:"hidden"}))}else{t.append(e('
      ').css({left:o*s+"px",width:o+"px",height:i+"px",opacity:"0",overflow:"hidden"}))}}e(".nivo-slice",t).height(i);u.stop().animate({height:e(r.currentImage).height()},n.animSpeed)};var p=function(t,n,r){if(e(r.currentImage).parent().is("a"))e(r.currentImage).parent().css("display","block");e('img[src="'+r.currentImage.attr("src")+'"]',t).not(".nivo-main-image,.nivo-control img").width(t.width()).css("visibility","hidden").show();var i=Math.round(t.width()/n.boxCols),s=Math.round(e('img[src="'+r.currentImage.attr("src")+'"]',t).not(".nivo-main-image,.nivo-control img").height()/n.boxRows);for(var o=0;o').css({opacity:0,left:i*a+"px",top:s*o+"px",width:t.width()-i*a+"px"}));e('.nivo-box[name="'+a+'"]',t).height(e('.nivo-box[name="'+a+'"] img',t).height()+"px")}else{t.append(e('
      ').css({opacity:0,left:i*a+"px",top:s*o+"px",width:i+"px"}));e('.nivo-box[name="'+a+'"]',t).height(e('.nivo-box[name="'+a+'"] img',t).height()+"px")}}}u.stop().animate({height:e(r.currentImage).height()},n.animSpeed)};var d=function(t,n,r,i){var s=t.data("nivo:vars");if(s&&s.currentSlide===s.totalSlides-1){r.lastSlide.call(this)}if((!s||s.stop)&&!i){return false}r.beforeChange.call(this);if(!i){u.attr("src",s.currentImage.attr("src"))}else{if(i==="prev"){u.attr("src",s.currentImage.attr("src"))}if(i==="next"){u.attr("src",s.currentImage.attr("src"))}}s.currentSlide++;if(s.currentSlide===s.totalSlides){s.currentSlide=0;r.slideshowEnd.call(this)}if(s.currentSlide<0){s.currentSlide=s.totalSlides-1}if(e(n[s.currentSlide]).is("img")){s.currentImage=e(n[s.currentSlide])}else{s.currentImage=e(n[s.currentSlide]).find("img:first")}if(r.controlNav){e("a",s.controlNavEl).removeClass("active");e("a:eq("+s.currentSlide+")",s.controlNavEl).addClass("active")}a(r);e(".nivo-slice",t).remove();e(".nivo-box",t).remove();var o=r.effect,f="";if(r.effect==="random"){f=new Array("sliceDownRight","sliceDownLeft","sliceUpRight","sliceUpLeft","sliceUpDown","sliceUpDownLeft","fold","fade","boxRandom","boxRain","boxRainReverse","boxRainGrow","boxRainGrowReverse");o=f[Math.floor(Math.random()*(f.length+1))];if(o===undefined){o="fade"}}if(r.effect.indexOf(",")!==-1){f=r.effect.split(",");o=f[Math.floor(Math.random()*f.length)];if(o===undefined){o="fade"}}if(s.currentImage.attr("data-transition")){o=s.currentImage.attr("data-transition")}s.running=true;var l=0,c=0,d="",m="",g="",y="";if(o==="sliceDown"||o==="sliceDownRight"||o==="sliceDownLeft"){h(t,r,s);l=0;c=0;d=e(".nivo-slice",t);if(o==="sliceDownLeft"){d=e(".nivo-slice",t)._reverse()}d.each(function(){var n=e(this);n.css({top:"0px"});if(c===r.slices-1){setTimeout(function(){n.animate({opacity:"1.0"},r.animSpeed,"",function(){t.trigger("nivo:animFinished")})},100+l)}else{setTimeout(function(){n.animate({opacity:"1.0"},r.animSpeed)},100+l)}l+=50;c++})}else if(o==="sliceUp"||o==="sliceUpRight"||o==="sliceUpLeft"){h(t,r,s);l=0;c=0;d=e(".nivo-slice",t);if(o==="sliceUpLeft"){d=e(".nivo-slice",t)._reverse()}d.each(function(){var n=e(this);n.css({bottom:"0px"});if(c===r.slices-1){setTimeout(function(){n.animate({opacity:"1.0"},r.animSpeed,"",function(){t.trigger("nivo:animFinished")})},100+l)}else{setTimeout(function(){n.animate({opacity:"1.0"},r.animSpeed)},100+l)}l+=50;c++})}else if(o==="sliceUpDown"||o==="sliceUpDownRight"||o==="sliceUpDownLeft"){h(t,r,s);l=0;c=0;var b=0;d=e(".nivo-slice",t);if(o==="sliceUpDownLeft"){d=e(".nivo-slice",t)._reverse()}d.each(function(){var n=e(this);if(c===0){n.css("top","0px");c++}else{n.css("bottom","0px");c=0}if(b===r.slices-1){setTimeout(function(){n.animate({opacity:"1.0"},r.animSpeed,"",function(){t.trigger("nivo:animFinished")})},100+l)}else{setTimeout(function(){n.animate({opacity:"1.0"},r.animSpeed)},100+l)}l+=50;b++})}else if(o==="fold"){h(t,r,s);l=0;c=0;e(".nivo-slice",t).each(function(){var n=e(this);var i=n.width();n.css({top:"0px",width:"0px"});if(c===r.slices-1){setTimeout(function(){n.animate({width:i,opacity:"1.0"},r.animSpeed,"",function(){t.trigger("nivo:animFinished")})},100+l)}else{setTimeout(function(){n.animate({width:i,opacity:"1.0"},r.animSpeed)},100+l)}l+=50;c++})}else if(o==="fade"){h(t,r,s);m=e(".nivo-slice:first",t);m.css({width:t.width()+"px"});m.animate({opacity:"1.0"},r.animSpeed*2,"",function(){t.trigger("nivo:animFinished")})}else if(o==="slideInRight"){h(t,r,s);m=e(".nivo-slice:first",t);m.css({width:"0px",opacity:"1"});m.animate({width:t.width()+"px"},r.animSpeed*2,"",function(){t.trigger("nivo:animFinished")})}else if(o==="slideInLeft"){h(t,r,s);m=e(".nivo-slice:first",t);m.css({width:"0px",opacity:"1",left:"",right:"0px"});m.animate({width:t.width()+"px"},r.animSpeed*2,"",function(){m.css({left:"0px",right:""});t.trigger("nivo:animFinished")})}else if(o==="boxRandom"){p(t,r,s);g=r.boxCols*r.boxRows;c=0;l=0;y=v(e(".nivo-box",t));y.each(function(){var n=e(this);if(c===g-1){setTimeout(function(){n.animate({opacity:"1"},r.animSpeed,"",function(){t.trigger("nivo:animFinished")})},100+l)}else{setTimeout(function(){n.animate({opacity:"1"},r.animSpeed)},100+l)}l+=20;c++})}else if(o==="boxRain"||o==="boxRainReverse"||o==="boxRainGrow"||o==="boxRainGrowReverse"){p(t,r,s);g=r.boxCols*r.boxRows;c=0;l=0;var w=0;var E=0;var S=[];S[w]=[];y=e(".nivo-box",t);if(o==="boxRainReverse"||o==="boxRainGrowReverse"){y=e(".nivo-box",t)._reverse()}y.each(function(){S[w][E]=e(this);E++;if(E===r.boxCols){w++;E=0;S[w]=[]}});for(var x=0;x=0&&T li {padding-left:0;padding-right:20px;} -.entry-content ul, .entry-summary ul {margin-right:0;} - -/* -LAYOUT: Two-Column (Right) -DESCRIPTION: Two-column fixed layout with one sidebar right of content -*/ - -#container { - float: right; -} - - -/* =Structure --------------------------------------------------------------- */ - -/* The main theme structure */ -#footer-widget-area .widget-area { - float: right; -} -#footer-widget-area #fourth { -} -#site-info { -} -#site-generator { - float: left; -} - - -/* =Global Elements --------------------------------------------------------------- */ - -/* Text elements */ -ul { - margin: 0 1.5em 18px 0; -} - -.widget-area ul ul li { -background:url("images/bullets/arrow_white.png") no-repeat scroll right 8px transparent; -padding-right:12px; -} -#calendar_wrap { - margin-right: 10px; -} - -.widget_search #s, #search #s { - border-radius: 0 10px 0 0; - display: block; - float: right; - font-family: Arial !important; - font-size: 14px; - margin-bottom: 20px; - margin-right: 10%; - padding-bottom: 4px; - padding-right: 10px; - padding-top: 6px; - width: 60%; -} - -.widget_search #searchsubmit { - background: none repeat scroll 0 0 #777777; - border: medium none; - color: #EEEEEE; - cursor: pointer; - display: block; - float: right; - font-family: Arial !important; - font-size: 12px; - height: 28px; - right: -28px; - margin: 0; - padding: 0; - position: relative; - text-shadow: 0 -1px 0 #000000; - top: 0; - width: 27px; -} - -blockquote { - font-style: normal; -} - -/* Text meant only for screen readers */ -.screen-reader-text { - left: 9000px; - text-indent:-9000px; - overflow:hidden; -} - - -/* =Header --------------------------------------------------------------- */ - -#site-title { - float: right; - margin-right: 20px; - padding-right: 20px; -} - -#site-description { - clear: left; - float: right; - font-style: normal; -} - -/* =Menu --------------------------------------------------------------- */ - -#access { - float:right; -} - -#access .menu-header, -div.menu { - margin-right: 12px; - margin-left: 0; -} - -#access .menu-header li, -div.menu li{ - float:right; -} - -#access ul ul { -margin-right:0; -} - -#access ul li { - float:right; -} - - -/* =Content --------------------------------------------------------------- */ - -#content table { - text-align: right; - margin: 0 0 24px -1px; -} -.page-title span { - font-style:normal; -} - -#content ul > li { - background-position: right 10px; -} - -.entry-title, -.entry-meta{ - clear: right; - float: right; -} - -.entry-meta { - width: 100%; - -webkit-box-sizing:border-box; - -moz-box-sizing:border-box; - box-sizing:border-box; -} - -.entry-meta .comments-link {float: left;} - -#content .format-status .entry-meta2 { -clear:left; -float:right; -margin-right:0; -padding-right:0; -} - -.status_content { -float:right; -} - -.entry-meta span, .entry-meta2 span{ - float: right; - padding-left:3px; -} - -.entry-meta2 .edit-link, .entry-meta3 .edit-link, .edit-link { - float: left; -} - -.entry-meta span .bl_sep, .entry-meta2 span .bl_sep { - float: left ; -padding-right:5px; -} - -.format-status .avatar { -float:right; -margin-left:10px; -margin-right:0; -} - -#content h3.entry-format { -line-height:1em ; -margin-top:5px; -margin-left:10px; -margin-bottom:0px; -float:right; -} - -#content .format-status h3.entry-format { -margin-left:10px; -} - - -.entry-content input.file, -.entry-content input.button { - margin-left: 24px; - margin-right:0; -} -.entry-content blockquote.left { - float: right; - margin-right: 0; - margin-left: 24px; - text-align: left; -} -.entry-content blockquote.right { - float: left; - margin-right: 24px; - margin-left: 0; - text-align: right; -} -#entry-author-info #author-avatar { - float: right; - margin: 0 0 0 -104px; -} -#entry-author-info #author-description { - float: right; - margin: 0 104px 0 0; -} - -.continue-reading-link { - display:inline-block; -} - -.continue-reading-link .meta-nav { - display:inline-block; - float:left; - -webkit-transform:rotate(180deg); - -moz-transform:rotate(180deg); - transform:rotate(180deg); -} - -.sticky hgroup { - background: url("images/icon-featured.png") no-repeat scroll right 10px transparent; - padding-right: 35px; -} - -.pagination span, .pagination a { -float:right; -} - -article.format-link, article.format-quote, article.format-image, article.format-chat, article.format-aside { - background-position: right 10px; -} - -article.format-link header, article.format-quote header, article.format-image header, article.format-chat header, article.format-aside header { - padding-left: 0; - padding-right: 60px; -} - - -#respond label { -float:right; -} -#commentform { -float:right; -} - -#commentform label { -width:15%; -} - -#respond .required { -float:right; -} - -#respond .comment-notes { -float:right; -text-align:right; -} -/* Gallery listing --------------------------------------------------------------- */ - -.category-gallery .gallery-thumb { - float: right; - margin-left:20px; - margin-right:0; -} - - -/* Images --------------------------------------------------------------- */ - -#content .gallery .gallery-caption { - margin-right: 0; -} - -#content .gallery .gallery-item { - float: right; -} - -#content .entry-title { - float:none; -} - -/* =Navigation --------------------------------------------------------------- */ -.nav-previous { - float: right; -} -.nav-next { - float: left; - text-align:left; -} - -.theme-default .nivo-controlNav { - direction:ltr; -} - -/* =Comments --------------------------------------------------------------- */ - -.commentlist li.comment { - padding: 0 66px 0 0; -} -.commentlist .avatar { - right: 0; - left: auto; -} -.comment-author .says, #comments .pingback .url { - font-style: normal; -} - -/* Comments form */ -.children #respond { - margin: 0 0 0 48px; -} - -/* =Widget Areas --------------------------------------------------------------- */ - -.widget-title { -text-align:right; -padding-left:0 !important; -padding-right:20px !important; -} - -.widget-area ul { - margin-right: 0; -} -.widget-area ul ul { - margin-right: 1.3em; - margin-left: 0; -} -#wp-calendar caption { - text-align: right; -} -#wp-calendar tfoot #next { - text-align: left; -} - -/* Main sidebars */ -#main .widget-area ul { - margin-right: 0; - padding: 0 0 0 20px; -} -#main .widget-area ul ul { - margin-right: 1.3em; - margin-left: 0; -} - -/* =Footer --------------------------------------------------------------- */ -#site-generator { - font-style:normal; -} -#site-generator a { - background-position: right center; - padding-right: 20px; - padding-left: 0; -} \ No newline at end of file diff --git a/themes/mantra/screenshot.png b/themes/mantra/screenshot.png index 9d636905..f630f9e1 100644 Binary files a/themes/mantra/screenshot.png and b/themes/mantra/screenshot.png differ diff --git a/themes/mantra/search.php b/themes/mantra/search.php index c5ec2e42..a94c68e0 100644 --- a/themes/mantra/search.php +++ b/themes/mantra/search.php @@ -12,10 +12,10 @@ get_header(); ?>
      - + - + ' . get_search_query() . '' ); ?>
      @@ -27,7 +27,7 @@ get_header(); ?> * If you want to overload this in a child theme then include a file * called loop-search.php and that will be used instead. */ - get_template_part( 'content', get_post_format() ); + get_template_part( 'content/content', get_post_format() ); ?> @@ -50,4 +50,5 @@ get_header(); ?>
      - + - - - \ No newline at end of file + + + diff --git a/themes/mantra/sidebar-footer.php b/themes/mantra/sidebar-footer.php index ba95abd0..7ea36d76 100644 --- a/themes/mantra/sidebar-footer.php +++ b/themes/mantra/sidebar-footer.php @@ -18,42 +18,43 @@ && ! is_active_sidebar( 'second-footer-widget-area' ) && ! is_active_sidebar( 'third-footer-widget-area' ) && ! is_active_sidebar( 'fourth-footer-widget-area' ) - ) + ) return; // If we get this far, we have widgets. Let do this. ?> - diff --git a/themes/mantra/sidebar.php b/themes/mantra/sidebar.php index 6a4f2cf8..5bd0fa62 100644 --- a/themes/mantra/sidebar.php +++ b/themes/mantra/sidebar.php @@ -7,97 +7,97 @@ * @since mantra 0.5 */ -/* This retrieves admin options. */ -$mantra_options= mantra_get_theme_options(); -foreach ($mantra_options as $key => $value) { - ${"$key"} = esc_attr($value) ; -} - -if (is_page_template() && !is_page_template('template-blog.php') && !is_page_template('template-onecolumn.php') && !is_page_template('template-page-with-intro.php') ) { -?> - - - +if ( is_page_template() && + !is_page_template('templates/template-blog.php') && + !is_page_template('templates/template-onecolumn.php') && + !is_page_template('templates/template-page-with-intro.php') ) { + ?> + + + + + -else -if ($mantra_side != "1c") { ?> + - - -