From: Samir Benmendil Date: Fri, 23 Aug 2013 05:40:42 +0000 (+0200) Subject: add dwb config X-Git-Url: https://git.rmz.io/dotfiles.git/commitdiff_plain/ad561c6184f822d259c5bd7109e181afab82dee9 add dwb config --- diff --git a/dwb/.gitignore b/dwb/.gitignore new file mode 100644 index 0000000..0756e1f --- /dev/null +++ b/dwb/.gitignore @@ -0,0 +1,7 @@ +forms +default/cookies +default/commands.history +default/history +default/navigate.history +default/search.history +default/session diff --git a/dwb/default/bookmarks b/dwb/default/bookmarks new file mode 100644 index 0000000..1608097 --- /dev/null +++ b/dwb/default/bookmarks @@ -0,0 +1,3 @@ +https://www.facebook.com/?ref=logo Facebook +https://eleum.unimaas.nl/ Blackboard Learn +http://chakra-project.org/ Chakra | Welcome diff --git a/dwb/default/cookies.allow b/dwb/default/cookies.allow new file mode 100644 index 0000000..b7419ee --- /dev/null +++ b/dwb/default/cookies.allow @@ -0,0 +1,6 @@ +.facebook.com +hoof.little.my +.little.my +apis.google.com +.youtube.com +.google.com diff --git a/dwb/default/cookies_session.allow b/dwb/default/cookies_session.allow new file mode 100644 index 0000000..e69de29 diff --git a/dwb/default/custom_keys b/dwb/default/custom_keys new file mode 100644 index 0000000..e69de29 diff --git a/dwb/default/hsts b/dwb/default/hsts new file mode 100644 index 0000000..e69de29 diff --git a/dwb/default/plugins.allow b/dwb/default/plugins.allow new file mode 100644 index 0000000..e69de29 diff --git a/dwb/default/quickmarks b/dwb/default/quickmarks new file mode 100644 index 0000000..e69de29 diff --git a/dwb/default/scripts.allow b/dwb/default/scripts.allow new file mode 100644 index 0000000..e69de29 diff --git a/dwb/greasemonkey/fbpurity.EGHTFVTWO.user.js b/dwb/greasemonkey/fbpurity.EGHTFVTWO.user.js new file mode 100644 index 0000000..dcdba5a --- /dev/null +++ b/dwb/greasemonkey/fbpurity.EGHTFVTWO.user.js @@ -0,0 +1,3818 @@ +// ==UserScript== +// @name Facebook Purity +// @namespace http://steeev.freehostia.com +// @description F.B Purity hides application spam and other clutter from your facebook homepage +// @icon http://fbcdn-profile-a.akamaihd.net/hprofile-ak-snc4/373593_408502197558_209872631_q.jpg +// @include http://*.facebook.com/* +// @include https://*.facebook.com/* +// @match http://*.facebook.com/* +// @match https://*.facebook.com/* +// @exclude http://*.facebook.com/ajax/* +// @exclude https://*.facebook.com/ajax/* +// @exclude http://*.facebook.com/ai.php* +// @exclude https://*.facebook.com/ai.php* +// @exclude http://*.channel.facebook.com/* +// @exclude https://*.channel.facebook.com/* +// @exclude http://*.facebook.com/ai.php?* +// @exclude https://*.facebook.com/ai.php?* +// @grant GM_getValue +// @grant GM_setValue +// @version 8.5.3 - 19th Aug 2013 +// ==/UserScript== + +// these 2 excludes commented out for now, till we investigate which pages we need to exclude, as we need to run on certain "connect" pages for blocking apps. +// @exclude http://*.facebook.com/connect/* +// @exclude https://*.facebook.com/connect/* + +// +// (C) 2009 - 2013 stephen fernandez - http://www.fbpurity.com +// + +// If you like this script please donate, big or small donations, anything is welcome : + +// http://donate.fbpurity.com/ + +// ------------------------------------------------------------ +// F.B. Purity Home Page : http://www.fbpurity.com +// F.B Purity Install : http://install.fbpurity.com +// F.B. Purity Fan Page : http://fans.fbpurity.com +// F.B. Purity UserGuide : http://user-guide.fbpurity.com +// F.B. Purity Custom CSS : http://css.fbpurity.com +// F.B. Purity FAQ / Help : http://faq.fbpurity.com +// F.B. Purity Search : http://search.fbpurity.com +// ------------------------------------------------------------ + +// ABOUT +// ----- +// This greasemonkey script hides all third party facebook application messages from your fb homepage. +// Instructions on how to edit the "whitelist" are available here: http://whitelist.fbpurity.com +// Instructions on how to edit the "extras" are available here: http://extras.fbpurity.com +// Make donations to F.B. Purity, to show your appreciation here: http://donate.fbpurity.com + +// INSTALLATION +// ------------ +// This script is compatible with the following web browsers: Firefox, Google Chrome, Opera and Safari +// +// Full installation instructions are available here: +// http://install.fbpurity.com +// +// If you have any problems, please see the Frequently Asked Questions / Help page: +// http://faq.fbpurity.com + +// UPDATES +// ------- +// 1.51 30th March 2009 Bug fixed: if there were no pending requests, the script didnt work +// 1.52 4th April 2009 removed GM_addStyle command, for better compatibility with other browsers (chrome + opera) +// 1.53 26th April 2009 changed insertpoint so its not dependent on suggestions box +// 1.54 27th April 2009 script is now compatible with Google Chrome + Opera (and possibly safari, not tested yet) +// 1.54a 5th May 2009 fixed a minor bug +// 1.54b 24th June 2009 fixed for facebook code change +// 1.54c 29th July 2009 fixed for facebook code change +// 1.54d 5th Aug 2009 fixed for facebook code change +// 1.54e 26th Aug 2009 fixed for facebook code change +// 1.60 4th Sep 2009 added application whitelisting capability, the default whitelisted apps are: +// FB Iphone, Selective Twitter and Living Social +// 1.61 14th Oct 2009 optimised script, it should run faster and more efficiently now +// added tumblr, digsby and tweetdeck to whitelist, removed livingsocial from whitelist +// 1.8 21st Oct 2009 added "block app" functionality and ability to show just the app messages on the page +// added blackberry app to default whitelist +// 1.8a 22nd Oct 2009 fixed bug with blocking apps if language was not set to english +// 1.8d 23rd Oct 2009 fixed for new facebook update ( "live feed" changes ) +// fixed if you click "Show x similar posts" on an application message, when you have chosen to display the app messages, the app messages will no longer be automatically hidden +// if after you've blocked an app, and there are no more hidden app messages, it now returns to normal homepage view +// 1.8e 26th Oct 2009 script now hides more apps (ones that use widgets) and should also now be restricted to running on the homepage +// 1.9 28th Oct 2009 added filter for "extra" [joined group, became fan, attending event, became friend] messages +// 2.0 31st Oct 2009 fixed Show/Hide Logic, made app+extra filters mutually exclusive, optimised the script a lot +// moved fbpurity bar to the left to regain vertical space on the right hand column +// newly added elements now obey the current filter +// 2.1 2nd Nov 2009 reset show/hide mode to default when user changes fb filter +// added workaround for fb still showing apps that you have "blocked", script now "hides" app as well as blocking it, when you click the "block app" link +// fixed bug with whitelisted apps being displayed via the "show hidden apps" filter +// fixed - block link wasnt showing up on dynamically inserted app messages +// 2.1a 4th Nov 2009 fixed - now also hides apps that dont have a mini-icon +// 2.1b 7th Nov 2009 added option to hide suggestions box +// added facebook for android to whitelist +// 2.2 12th Nov 2009 rewrote filter system, should block absolutely all apps now (except whitelisted ones) +// added filter for photos posted by applications (eg farmville, top friends etc) +// 2.2a 12th Nov 2009 fixed suggestion box filter +// 2.2b 20th Nov 2009 added another "became friends" story id to extras list +// 2.3 31st Jan 2010 fixed block app function for google chrome v4 + hopefully fixed the random script loading problems too +// speeded up script loading time by checking if the DOM is ready, rather than waiting for the whole page to load +// added "attended event" messages to blocked extras list +// added an option to allow blocking of "commented on status" and "likes status" messages +// added facebook for palm to default application whitelist +// 2.3a 5th Feb 2010 fixed bug where the show/hide links wouldnt work if you navigated away from the homepage then came back again +// 2.3b 7th Feb 2010 fixed script to work with new layout +// 2.3c 8th Feb 2010 fixed script to work with custom friends lists +// 2.4 13th Feb 2010 fixed hide suggestions box option (wasnt working on custom friends list pages) +// fixed app filtering ( some apps were getting around the app filter ) +// added the following optional extras : tagged/commented/liked photo, tagged in album, commented/liked album, commented/liked link, wall comment, group wall comment +// 2.4a 18th Feb 2010 added another app exception (generic status updates posted "via some app" - using widgets) +// added motoblur + iphoto uploader to default whitelist +// added optional extra : "Page Wall Comments" +// added optional extra : "Posted Event" +// fixed bug caused by "posted events" + "became friends" sharing same story code +// fixed bug caused by "became friends + became fan of" sharing same story code +// 2.4b 19th Feb 2010 fixed bug in firefox where sometimes the "show extras" link stopped working +// 2.4c 23rd Feb 2010 fixed event/friend/fan story code differentiation +// 2.5 25th Feb 2010 added text filter list, so you can specify words or phrases you want to block from your news feeds +// separated userappwhitelist from the defaultappwhitelist, for easier copying and pasting of application id lists +// added picasa uploader to the default application whitelist +// 2.5a 26th Feb 2010 fixed script to work with latest FB code change +// 2.7 8th Mar 2010 added options editing screen that lets you save your settings for extras, whitelist, suggestions box, and custom text filter +// added sprint/samsung? photo/video uploader, sony/erricson uploader,music player + status shuffle to default whitelist. +// added https:// to the list of included pages for those wanting greater security whilst browsing facebook +// 2.8 13th Mar 2010 fixed suggestions box wasnt being hidden on the requests page if the hide sb option was selected +// fixed options screen occasionally not loading +// added hide option to hide the connect with friends box +// added facebook exporter for iphoto and flickr app to default whitelist +// added "Allow" link to application messages, for auto whitelisting of applications +// 2.8a-test 19thMar2010 alpha test of temp fix for fb codechange, basic (show/hide) functionality should be restored +// 2.8b-test 20thMar2010 fixed bug in show/hide app code, fixed "block app" and "allow" links on application messages +// 2.9 2ndApr2010 Merged 2.8 + 2.8b-test so it doesnt matter which version of the site you are presented with, the script should still work +// Fixed bug in chrome where show/hide functions were sometimes not working. +// Fixed Block + Allow links that were not showing up for certain applications (apps that post as normal FB stories) +// Added LG Mobile, Windows Phone, Twitter and Posterous to the default application whitelist +// Added hide "Sponsored box" (ads) option +// 2.9a 6thApr2010 Fixed bug that was causing Firefox to lock up +// 2.9b 9thApr2010 Fixed after blocking an app, not all the onscreen posts by that app would be hidden +// Made some performance tweaks to make the script run better +// Blocking app no longer requires "hiding" too so removed hideapp function call +// Added Snaptu + SonyEricsson Panel + Nokia to default whitelist +// 2.9c 15thApr2010 Added Ping.fm to default whitelist +// Added a workaround for the bug in firefox which caused the script to fail when cookies are set to: "Keep until:" - "ask me every time" +// 2.9d 15thApr2010 Fixed minor CSS style issue +// Fixed friend/fan stories getting mixed up again (due to Facebooks code tinkering) +// 2.9e 19thApr2010 Fixed bug where the display extras/apps would get screwed up some times +// Fixed "allow" and "block app" buttons were not being hidden by default +// 2.9f 26thApr2010 Fixed Display bug on custom friends list page. +// 2.9g 4thMay2010 Fixed Extras differentiation (friends/fans) +// Added wildcard for included pages +// Added Gwibber to default whitelist +// 2.9h 20thMay2010 Added new "likes website" type story to "became fan of" option +// Fixed differentiation between like+became friends (again) +// 2.9i 11thJun2010 Fixed Block App function +// Added "changed profile info","changed relationship" and "changed profile pic" to the list of hideable extras +// Fixed multiple words/phrases in custom text filter for chrome +// 2.9j 22ndJun2010 Added option to hide "beta testers" box +// Added HTC Sense + Samsung Mobile apps to default Whitelist +// 3.0 30thJun2010 Fixed script for latest FB code change +// Added visual feedback for "block app" function +// Added extra security on domain name parsing +// Stopped script from running in frames +// 3.1 30thJun2010 Fixed for unforseen bugs +// 3.11 9thJul2010 Fixed hide suggestions box (recommended pages + people you may know) +// 3.2 5thAug2010 Fixed "Block" and "Allow" (whitelist) buttons, Added windows live messenger + o2 social link to default whitelist +// 3.3 20thAug2010 Added new extra: "Checked in to location", addded LG Phone app to default whitelist +// 3.4 3rdSep2010 Fixed script to work with facebook's latest code change, added Bloom photo uploader to default whitelist +// 3.4a 11thSep2010 Fixed hide "get connected box" option, fixed freezeup in google chrome when creating a new friends list, fixed regex bug in custom text filter +// 3.4b 14thSep2010 Fixed hide "get connected box" option again, fixed compatibility with ff4 +// 3.4c 22ndSep2010 Fixed hide "get connected box" option again +// 3.5 2ndOct2010 The application filter now also hides "friend began using app/game" messages. Custom text filter now tells you which filter was activated when it hides a message +// 3.6 7thOct2010 Added new extras "uploaded photo, uploaded video, tagged in video, posted note, tagged in note, posted link" +// Added "block app" and "allow app" links for "started using app" type messages +// Added Import and Export Settings functionality. +// Fixed loss of settings when user clears Firefox's cookies +// 3.6a 7thOct2010 Fixed bug with Firefox settings recovery system +// 3.7 14thOct2010 Incorporated new "joined group" story type to existing hide "joined group" extra, incorporated new "changed location" story types to existing "changed location" extra, added hide "poke box" option, added new HTC Sense, live journal and hootsuite to default app whitelist +// 3.8 20thOct2010 Added options to hide the "questions box", "events box" and "requests box" +// 3.8.1 27thOct2010 Fixed: "started using app filter", "hide request box code", added Sony Ericsson X10 mini pro to default application whitelist +// 3.8.2 29thOct2010 Fixed: Whitelist + Block App buttons were no longer showing due to a change in facebooks code. +// 3.8.3 3rdNov2010 Fixed: Whitelist + Block App buttons were no longer showing due to a change in facebooks code. +// Added Yahoo + Sony Ericsson + Vlingo to default whitelist +// Added WL (whitelist + BA (Block App) links for messages posted by applications masquerading as "normal" fb status updates +// 3.9.0 4thNov2010 Added font size option +// 3.9.1 11thNov2010 Streamlined page processing, Fixed font size for group messages, Fixed "needs to access data on all sites" message on google chrome, fixed group wall comments filter, fixed hide questions box option +// 3.9.2 15thNov2010 Updated hide sponsored box code, sponsored box should now be hidden on profiles and pages as well as the homepage/newsfeed, added block/whitelist links for photos/notes created uploaded by applications, tidied up code +// 3.9.3 19thNov2010 Added script collision detection, to check if 2 versions of the script are running at the same time (script+extension etc) +// Altered more font classes to give a more uniform font size across the site. Added Droid + Dell Mobile to default app whitelist +// 3.9.4 25thNov2010 Fixed mangled BA + WL links, Fixed "FB-Glitch" error on friends list pages, Hides sponsored box on search pages if option set, Added link to info about AVG clash, Fixed Opera bug with localstorage +// 3.9.5 7thDec2010 Added "changed to new profile" stories to "updated profile" filter, added new story code to "updated profile" filter, now hides sponsored box in a few more places, added RockMelt to default app whitelist +// 3.9.6 17thDec2010 Added Custom CSS Box, Fixed hide "suggestions" box, Fixed bug with blocking "started using app", Added Friendly for Ipad, Slide, networked blogs, RSS Grafitti, Twitter Feed to default app whitelist +// 4.0.0 23rdDec2010 Fixed intermittent app/extra filter problems, fixed bug with "started using app" previously it didnt check if app was in whitelist, added seesmic to app whitelist, fixed autoplay of videos when toggling show/hide +// 4.1.0 18thJan2011 NEW: Application message filtering can now be turned off, NEW: Can now block multiple applications at the same time +// Hide sponsored box option now hides more ads, Fixed name size on profile pages, Addeed Facebook mobile by Opentech ENG and flipboard to default app whitelist +// 4.3.0 27thJan2011 "App + extra" filtering now works on profile pages, tweaked blockallapp function a little bit (scroll to top, single app block) +// Added "delete all recent activity" button to profile pages, enabled full screen button for youtube videos, added delete friend request button, added nokia N900,and Ovi by Nokia to default app whitelist +// 4.3.1 11thFeb2011 show/hide filters save youtube video's current position, hide sponsored box option now hide ads on new photo lightbox popups, catches more application messages in app filter, fixed del recent activity to work with new https settting, fixed missing info bar on profile pages, fixed anomalous delete button on privacy page, added kodak easyshare,Snaptu for Facebook and Instagram to default app whitelist. +// 4.4.0 17thMar2011 fixed commenting ( hitting return/enter in the textarea no longer submits comments, also added comment button back for comments ) +// fixed filtering on application/profile pages with photo strip at top, fixed intermittent bug with display of block app/whitelist links, added eBuddy, mobileblog + Rockmelt Beta to default whitelist +// 4.4.1 24thMar2011 Fixed block app function. Fixed Delete Recent Activity Function. (Known issue: In FF4 profile page needs to be reloaded to get the "del recent activity" button to show up) +// 4.5.0 29thMar2011 Added an option to hide the new Facebook Questions. Fixed Delete Recent Activity Button not showing up in FF4. Fixed "extras" dual story type separation for facebook videos and events. Fixed options screen layout problem on wide screens. +// 4.5.1 21stApr2011 Fixed for new Relationship stories and new "Is Using Application" stories +// 4.5.2 8thJun2011 fixed block application function, Fixed hide sponsored box code, Fixed a bug with the extras filter, added "no longer listed as" to relationship story filter +// 4.5.3 23rdJun2011 fixed fb places checkin anomaly, merged new "commented on a website" story type with "commented on link" +// 5.0.0 19thJul2011 added "hide chat" option, added "hide happening now" sidebar option, added "hide commented on event wall" extra option, added "hide page updates" extra option, added "hide commented/liked stories on Top News feed" extra option +// 5.1.0 20thSep2011 fixed spaces in application whitelist issue. fixed position of WL + BA links. added "updated school" and "relatives" stories to the updated profile extra filter. added "tagged in a post" stories to "commented/liked status" filter. added "subscribed to" stories to "friends with" extra filter. added windows phone 7, and facebook for windows phone 7 to default whitelist. fixed hiding ads on the photo lightbox +// 5.2.0 21stSep2011 fixed for new newsfeed +// 5.3.0 22ndOct2011 fixed/ish most extra filters (forced to use text filtering, so it only work on english interface), fixed comment button not showing up on ticker and birthday story popups. fixed ticker frame showing when hidden. fixed "meta.match" popup javascript error. fixed hide events box. Fixed BA + WL links not showing up. +// 5.5.0 29thOct2011 fixed various issues with extra filtering, added hide "Shared photo" extra option, ff addon is now restartless and also compatible with seamonkey/iceape +// 6.0.0 1stDec2011 fixed shared photo filter, fixed fan page stories filter, updated facebook places (checkins) filter, sped up the filtering a bit, fixed "likes page" filter, fixed event story filters, removed redundant box hiding options, added hide "read an article" option, reduced wall options to single "wrote on wall" option, added basic check for updates button, stopped filtering the current user and fbp's updates, FBP firefox extension is now restartless, FBP should now be compatible with the Seamonkey and Iceape browsers, app whitelist and custom text filter are now textareas and each item now needs to be on a separate line, rather than comma separated. +// 6.1.1 9thDec2011 fixed too-wide textareas on options screen, fixed fan page story filter + logged in user filter, added "shared an event" to "created event" filter, fixed attending and attended event filters, improved tabbed textareas differentiation, fixed "friend requested" button being erroneously displayed, fixed "fb glitch" error on friends list pages, fixed "shared a link" filter, fixed upload photo button duplication +// 6.3.0 22ndDec2011 added font and background colour options, added hide offline friends in chat option, added separate settings per logged in user, fixed "joined group" filter, fixed "regex error" freezing firefox, fixed https issues with options screen, fixed anomalous "delete" button showing up on timeline page, fixed "liked page" filter,improved fb places filter, added welcome message on first run +// 6.4.0 24thDec2011 Fixed filtering to work with international versions of FB, various other fixes. +// 6.4.1 26thDec2011 Fixed FB for IE7 Spoofing (to help with disabling Timeline) +// 6.4.2 6thJan2012 Fixed Application message filtering. Fixed hidden create album button on group pages. Fixed FB Purity Bar not showing on Friends list feeds. Fixed fbp not working for users with default user icon/pic. Improved welcome page. +// 6.4.3 19thJan2012 Fixed story filtering +// 6.5.0 6thFeb2012 Added an auto update checker, Fixed comment button on new photo lightbox, Fixed birthday comment flyout button, fixed hide ads on photo lightbox, fixed go online/offline chat button when browser is in IE7 spoof mode, fixed hide events box, fixed a memory leak +// 6.6.0 7thFeb2012 Added an option to force the newsfeed to be sorted by most recent, fixed photo comment button for "facebook fan pages" +// 6.6.1 20thFeb2012 Added links to new FBP Fan Page on Google Plus to options screen. Turned on "Hide sponsored box" option by default. Added CSS to hide footer in Right hand column. Fixed youtube scrollbars issue, fixed hidden info on fb questions and fb insights when colour options are set +// 6.6.2 2ndMar2012 Hides "press enter to submit comment" text when comment button enabled, fixes gap on new group pages when in ie7 spoof mode, fixes comment buttons on photo light box, brought back comments/likes on top news stories option +// 6.7.0 28thMar2012 Fixed auto update checker in Firefox, Fixed hide ads in message pages, Fixed comment box growing too big in Safari, fixed hide chat box option, fixed force feed to be sorted by "most recent" option, fixed delete recent activity button +// 6.7.1 3rdApr2012 Improved game/application and extra filtering, fixed hidden images at top of group pages if background colour had been set, fixed opera extension +// 7.0.0 6thApr2012 Added built in IE7 user agent switch for chrome (for disabling timeline), improved CSS fixes for IE7 spoof mode, improved comment button restoration, improved "extra" filters +// 7.1.0 28thApr2012 Fixed hide recent activity button, Fixed comment button on birthday and ticker flyout boxes, If hide "read an article" filter is ticked, it now also hides the "trending articles" box +// 7.5.0 10thMay2012 Fixed news article redirects for Trending Articles stories also fixed the hide trending articles box option, added "block application" link to bottom of all facebook application pages, and "block application" button to all facebook application permission request pages, Fixed "BA" (Block Application) and "WL" (Whitelist) links on application posts in the newsfeed +// Added a single column Timeline layout option, re-added ability to filter "frictionless sharing / FB actions" stories, Fixed hidden comment button in group welcome box +// 7.5.1 25thMay2012 Fixed hiding trending articles option, hide sponsored box option now also hides sponsored stories in the newsfeed, various other minor tweaks and fixes +// 7.5.2 14thJun2012 Fixed various extra filters including ('shared photo' and 'uploaded photo'), fixed news article redirects and hide "trending articles / trending videos" +// 7.6.0 5thJul2012 Removes all external link redirects, so Facebook cant track them or block them. Adds remove event 'x's on events page (chrome + safari only), highlights applications in app center that request email or posting permissions, fixed block application link on application pages +// 7.6.1 1stAug2012 Fixed hide sponsored box +// 7.6.2 28thAug2012 Stopped New User screen from popping up when Facebook resets the user settings. Fixed external link interception. Fixed display anomalies in message send window, stopped hidden button from showing in "liked a page" message in ticker. Added extra highlighting/clarity on the App Center permissions section. +// 7.8.0 7thSep2012 Fixed the user settings, so facebook cant delete them +// Altered block app function to let you block just the app you select, it then asks if you also want to block the other apps +// 7.9.0 Fixed shared a link filter, Separated FB Actions/Frictionless sharing apps from the Trending Articles filter, FB Actions/ Frictionless sharing apps should now be filtered by the apps filter +// Fixed TL button showing incorrect state after login +// 7.9.5 18thSep2012 Fixed comment button (now 2 step submit process), fixed settings bug (facebook was resetting users settings, also clearing browser cookies would reset settings), completely hides sponsored stories from the newsfeed, restored new user greeting +// 7.9.6 26thOct2012 Fixed hide trending articles, Fixed link and news article redirection/interception, Fixed filtering on interest lists, Fixed Block App link on permission request pages, Fixed inline youtube video playing on timeline pages, fixed missing images in fbp interface, fixed highlighting on application permission request dialogs +// 7.9.7 15thNov2012 Fixed for FF17 (extension), Fixed block application function, added a more prominent block app button to appcenter app pages, fixed application filter + instagram whitelisting, Added FBP Info bar and filtering to game and "page feed", Fixed Fan Page filter, so it doesnt affect "Page Feed" or "Interest Lists", fixed emoticons when font size is altered, fixed app blocking for frictionless sharing apps such as netflix, fixed bug with birthday comment flyout (blue box), changed the default "restore comment buton" option to off., updated new user info page to include info about FBP interest list and page notifications. Added "posted an offer" to sponsored story filter +// 8.0.1 30thNov2012 Added options for hiding left hand column links, added "upcoming events" to "hide events box" filter, made font options collapsible, improved ad blocking function +// 8.2.0 --thJan2013 Added "Recently Released Albums" to sponsored box filter, fixed Questions filter, fixed "block app" on opera, Added create a group, create a page, and find friends to links you can hide in the left column. Added "Recent Articles About" and "Most Shared on" to trending articles filter, added "play with friends" story filter +// redesigned options screen, added lots new options, fixed "drag image into box" covering options screen, cleared out lots of dead code, added option to hide smileys, added fix left column in place option +// 8.2.2 13thFeb2013 Fixed slowdown on timeline / like/fan pages. Added hide like suggestions bar, to hide sponsored box option (after you like page, it shows a list of other pages to like). Updated welcome screen to 2 step process. +// 8.3.0 21stMar2013 Added Hide "Gifts" and hide Notification Popup Box options, fixed bug in news panel on fbp options screen (bug-if feed was too short, surfaced due to fb post deletions), fixed add block link to fb apps sidebar, fixed hide all videos filter, fixed hidden event page buttons in single column timeline layout mode, improves group story filtering, fixed hidden file upload buttons when background color is set +// 8.5.0 24thJun2013 Hide sponsored box option now also Hides the page suggestions on page feed, fixed opera specific bug when certain options were selected, fixed hide emoticons for new "feelings" functionality +// Updated for new newsfeed design, Added hide links in right hand column options, Fix saving/retrieving settings. Fixed Timeline cover photo issues. Fixed timeline shift to right on personal timeline pages. Fixed hidden comment button when attaching image to comment. +// 8.5.1 27thJul2013 Fixed hide "shared photos" when they are part of a "multi post update", fixed hidden group count and image attach icon when background color was set, updated "changed location" filter to include "is in" and "was in" a location +// 8.5.2 14thAug2013 Fixed TL button for new search bar, Fixed hide emoticons option, Fixed line-height in ticker and left column when font is set +// 8.5.3 19thAug2013 Fixed Display of FBP info bar + filtering functionality for some users +// (C) stephen fernandez 2009-2013 http://www.fbpurity.com + +// If you like F.B. Purity please donate, big or small donations, anything is welcome +// http://donate.fbpurity.com + +(function() { + + var fbpVersion = "v8.5.3"; + var debug=0; + + var fbpoptsobj = {}; // object to store the preferences etc + try { + if (window.top!=window.self) // dont run on framed pages + if(!window.location.href.match(/connect\/uiserver\.php\?/)) // but allow it to work on embedded permissions pages + return; + } + catch (e) { + ; //return; + //alert('caught error ' + e.message); + //unsafeWindow.console.log(e); + } + + try { + if(!window.location.hostname.match(/facebook\.com$/)) + return; + } + catch(e) { + ; + //alert('caught error ' + e.message); + //unsafeWindow.console.log(e); + } + + // set browser type + var ischrome=(typeof(chrome)!='undefined' && chrome.extension); + var issafari=(typeof(window.navigator.vendor)!='undefined') && (window.navigator.vendor.match(/Apple Computer, Inc\./)) && (window.navigator.userAgent.match(/Version\/5\./) || window.navigator.userAgent.match(/Version\/6\./)); + //var isopera=window.navigator.userAgent.match(/Opera/); + try { + var isopera=(typeof(widget) && typeof(widget.preferences)); + } + catch(e) { + var isopera=0; + } + var isasync=(ischrome || issafari); + + //if(unsafeWindow) + // console.log=unsafeWindow.console.log; + + //check if another version of the script is running at the same time and if so give a warning. + if(document.getElementById('fbpoptslink')) { + var collisionerrormsg='Error: You seem to be running 2 versions of FB Purity at the same time, perhaps you are running the addon and the script version, you need to uninstall or disable one of them, otherwise FBP wont function correctly. (More Info)'; + if(document.getElementById('fbperrormsg')) + document.getElementById('fbperrormsg').innerHTML=collisionerrormsg; + else + window.alert(collisionerrormsg); + } + + var fbpstyle=document.createElement('style'); + var hashead=document.getElementsByTagName('head').length; + + var fbpfreestyle=document.createElement('style'); // for setting a "global" font etc + fbpfreestyle.setAttribute('id','fbpfreestyler'); + fbpfreestyle.setAttribute('type','text/css'); + if(hashead) + document.getElementsByTagName('head')[0].appendChild(fbpfreestyle); + + var fbpboxstyle=document.createElement('style'); // for setting whether boxes are on or off + fbpboxstyle.setAttribute('id','fbpboxstyler'); + fbpboxstyle.setAttribute('type','text/css'); + if(hashead) + document.getElementsByTagName('head')[0].appendChild(fbpboxstyle); + + var fbpcssstyle=document.createElement('style'); // for adding the user's Custom CSS and general css stuff + fbpcssstyle.setAttribute('id','fbpcssstyler'); + fbpcssstyle.setAttribute('type','text/css'); + if(hashead) + document.getElementsByTagName('head')[0].appendChild(fbpcssstyle); + + var fbptlstyle=document.createElement('style'); + fbptlstyle.setAttribute('id','fbptlstyle'); + fbptlstyle.setAttribute('type','text/css'); + if(hashead) + document.getElementsByTagName('head')[0].appendChild(fbptlstyle); + +fbpescaperegex = function(str){ + // to escape brackets entered in the custom text filter, fixes some problems, but causes others... (users regexes that require brackets wont work, but the number of advanced users who will be using brackets are probably countable on one hand ) + var replacements = { + '(': '\\(', + ')': '\\)', + '[': '\\[', + ']': '\\]', + '{': '\\{', + '}': '\\}' + } + var ret = this; + try { + for(key in replacements) { + str = str.replace('' + key, replacements[''+ key],'g'); + } + } + catch(e) { + ; // do nothing, traps an error found in ff 4.0b5 + } + return str; +}; + +var fbpoptslist='becamefriends,becamefan,joinedgroup,attendevent,attendedevent,createdevent,commentlikeslink,commentwall,commentgroupwall,commentpagewall,commenteventwall,updatedprofile,changedprofilepic,changedrelationship,suggestionsbox,connectbox,sponsoredbox,pokebox,happeningnowbar,betabox,commentbutton,offlinefriends,requestsbox,eventsbox,questionsbox,checkedin,uploadedphoto,sharedphoto,uploadedvideo,taggedinvideo,postednote,taggedinnote,postedlink,readarticle,fontfix,fontcolourfix,fontbgcolourfix,fbpfont,fbpfontfix,filterappmessages,recentactivity,chatbox,smileys,fixedleftcolumn,pagestory,sortmostrecent,fixarticleredirects,timelineonecol,upcomingevents,sharedevent,likedlink,sharedpage,commentedlink,hideallphotos,taggedphoto,likedphoto,commentedphoto,sharedvideo,likedvideo,commentedvideo,youtubevideo,sharedstatus,likedstatus,commentedstatus,taggedstatus,hideallvideos,hidealllinks,lcadvertmgr,lcconnect,lcallpages,lcpagesfeed,lclikepages,lcallapps,lcappcenter,lcevents,lcgamesfeed,lcpokes,lcmusic,lcplaceseditor,lcallgroups,lcallinterests,lccreategroup,lccreatepage,lcfindfriends,lcdeveloper,lcfriends,lcgifts,notificationpopup,rcrecommendedpages,rcrelatedgroups,rcpokes,rcbirthdays,rcfriendrequests,rcgamerequests'; + +// new left column options = lcadvertmgr,lcconnect,lcallpages,lcpagesfeed,lclikepages,lcallapps,lcappcenter,lcevents,lcgamesfeed,lcpokes,lcmusic,lcplaceseditor,lcallgroups,lcallinterests,lccreategroup,lccreatepage,lcfindfriends,lcdeveloper,lcfriends +// new right column options = rcrecommendedpages,rcrelatedgroups,rcpokes,rcbirthdays,rcfriendrequests,rcgamerequests +var fbpoptsarr=fbpoptslist.split(','); + +var optsdiv=document.createElement('div'); +optsdiv.setAttribute('id','fbpoptsdiv'); +optsdiv.style.zIndex='155'; //99 (change to 155 to go above drag image box +optsdiv.style.position='absolute'; +optsdiv.style.left='100px'; //143 //150px +optsdiv.style.top='1px'; //42px +optsdiv.style.background='white'; +optsdiv.style.border='3px solid black'; +optsdiv.style.display='none'; + +var fbptips=[ +'
 FBP Tip: Want some help with using the Custom Text Filter? Visit the Custom Text Filter Help Section', +'
 FBP Tip: Want to further customise Facebook? Check out FBP\'s Custom CSS', +'
 FBP Tip: If you have any questions or problems with FBP Check out FBP\'s FAQ / Help Page', +'
 FBP Tip: Donations help keep the FB Purity project alive, Please show your support and Donate.', +'
 FBP Tip: Want to try out new versions of FBP before they are officially released? Join the FBP Beta Testing Page.', +'
 FBP Tip: Please Help me out by telling all your friends about FB Purity: Share FB Purity.' +]; + +var fbpoptshtml= '
'+ +''+ +''+ +'
F.B. Purity Logo' + +'

F.B. Purity ' + fbpVersion + ' Options

     ' + +'
FBP Home | News | User Guide | Help | Fan Page | Contact | Donate         [ X ]
'+ + +//'
Click the Like button on the FBP fan page to ensure you get the latest updates and news from the fan page directly in your newsfeed. Check for latest version
"Like" the FB Purity Fan Page to make sure you get the latest news and updates about F.B. Purity in your feed. (Please note, due to Facebook censorship of the FBP fan page, you now also need to subscribe to notifications from the Fan page, otherwise you wont see the FBP news in your newsfeed. To do this, go to the FBP Fan Page, hover over the "Like" button then select "Get Notifications". Check for latest version
'+ +''+ +'
'+ + +// +// + +'
'+ +'"; + } + this.buildTable =function(endmode){ + if(typeof endmode=='undefined') + return this.table; + else + return this.table + '
'; + +// add new dynamic opts +function optionsbox(mode) { + var table, rowstyle; + this.rownum=1; + if(1) // ischrome doesnt work in safari + var openallboxes=''; + else + var openallboxes=''; + if (typeof mode !='undefined' && mode=='extras') { + this.table=''; + } + else + //this.table="
'+ openallboxes +' Newsfeed Filters  ? Hide
"; + this.table=""; + + // Use tbody to group tables instead of divs ! !!! ! :) + this.tableHeader = function (title, hint, varname) { + //this.table+='

' + title + '

"; + this.table+="
'; + } +} + +newoptscolumn=''; + +// Various Options +v = new optionsbox('extras'); +v.tableHeader('Various Story Types','Hide Various story types from the newsfeed', 'variousopts'); +v.addTableRow('Fan Page Stories','Hide stories posted by Pages you have liked from the newsfeed','pagestory', 'checkbox'); +v.addTableRow('Trending Articles / Videos','Hide Trending Articles / Trending Videos / Most Shared on / Recent Articles About stories from the newsfeed','readarticle', 'checkbox'); +v.addTableRow('Facebook Questions','Hide Facebook Questions stories','questionsbox','checkbox'); +v.addTableRow('Became Friends','Hide Became Friends stories from the newsfeed','becamefriends','checkbox'); +v.addTableRow('Changed Relationship','Hide Changed Relationship stories from the newsfeed','changedrelationship', 'checkbox'); +v.addTableRow('Changed Location','Hide Changed Location (Check-in) Stories','checkedin','checkbox'); +v.addTableRow('Updated Profile Info','Hide Updated Profile Stories','updatedprofile','checkbox'); +v.addTableRow('Joined a Group','Hide Joined Group Stories (and other group related stories)','joinedgroup','checkbox'); +v.addTableRow('Posted Note','Hide Posted Note Stories','postednote','checkbox'); +v.addTableRow('Tagged in Note','Hide Tagged in Note Stories','taggedinnote','checkbox'); +v.tableFooter(); +newoptscolumn+=v.buildTable(); + +// Event Options +v=null +v= new optionsbox(); +v.tableHeader('Event Stories','Hide event stories from the newsfeed', 'eventopts'); +v.addTableRow('Upcoming Events','Hide Upcoming Events / Upcoming Concerts','upcomingevents','checkbox'); +v.addTableRow('Attending Event','Hide Attending Event','attendevent','checkbox'); +v.addTableRow('Attended Event','Hide Attended Event','attendedevent','checkbox'); +v.addTableRow('Created Event','Hide Created Event','createdevent','checkbox'); +//v.addTableRow('Liked Event','Hide Liked Events','likedevent','checkbox'); +v.addTableRow('Shared Event','Hide Shared Events','sharedevent','checkbox'); +v.tableFooter(); +newoptscolumn+=v.buildTable(); + +// Link / Page Options +v=null; +v = new optionsbox(); +v.tableHeader('Link / Page Stories','Hide Link / Page stories from the Newsfeed', 'linkopts'); +//v.addTableRow('Hide All External Links','All External Links from the Newsfeed','hidealllinks', 'checkbox'); +v.addTableRow('Liked Page','Hide Liked Page Stories','becamefan','checkbox'); +v.addTableRow('Shared Page','Hide Shared Page Stories','sharedpage','checkbox'); +v.addTableRow('Liked Link','Hide Liked Link Stories','likedlink','checkbox'); +v.addTableRow('Shared Link','Hide Shared Link Stories from the Newsfeed','postedlink','checkbox'); +v.addTableRow('Commented on Link','Hide Commented on Photo Stories','commentedlink','checkbox'); +v.tableFooter(); +newoptscolumn+=v.buildTable(); + +// Photo Options +v=null; +v = new optionsbox(); +v.tableHeader('Photo Stories','Hide photo stories from the newsfeed', 'photoopts'); +v.addTableRow('Hide All Photos','Hide All Photo stories from the newsfeed','hideallphotos', 'checkbox'); +v.addTableRow('Shared Photo','Hide Shared Photo / Album stories from the newsfeed','sharedphoto','checkbox'); +v.addTableRow('Changed Profile Photo','Hide Updated Profile Picture / Cover Photo stories from the newsfeed','changedprofilepic', 'checkbox'); +v.addTableRow('Uploaded Photo','Hide Added Photo Stories','uploadedphoto','checkbox'); +v.addTableRow('Tagged in Photo','Hide Tagged in Photo / Album stories','taggedphoto','checkbox'); +v.addTableRow('Liked Photo','Hide Liked Photo / Album stories','likedphoto','checkbox'); +v.addTableRow('Commented on Photo','Hide Commented on Photo / Album stories','commentedphoto','checkbox'); +v.tableFooter(); +newoptscolumn+=v.buildTable(); + +// Video Options +v=null; +v = new optionsbox(); +v.tableHeader('Video Stories','Hide Video stories from the Newsfeed', 'videoopts'); +v.addTableRow('Hide All Videos','Hide All Video Stories from the newsfeed','hideallvideos', 'checkbox'); +v.addTableRow('Shared Video','Hide Shared FB Video Stories from the newsfeed','sharedvideo','checkbox'); +v.addTableRow('Uploaded Video','Hide Added Video Stories','uploadedvideo','checkbox'); +v.addTableRow('Tagged in Video','Hide Tagged in Video Stories','taggedinvideo','checkbox'); +v.addTableRow('Liked Video','Hide Liked Video Stories','likedvideo','checkbox'); +v.addTableRow('Commented on Video','Hide Commented on Video Stories','commentedvideo','checkbox'); +v.addTableRow('Youtube / Vimeo Videos','Hide Youtube and Vimeo Stories','youtubevideo','checkbox'); +v.tableFooter(); +newoptscolumn+=v.buildTable(); + +// Status // Wall Options +v=null; +v = new optionsbox(); +v.tableHeader('Status / Wall Stories','Hide Status / Wall stories from the newsfeed', 'statusopts'); +v.addTableRow('Shared Status','Hide Shared Status Stories','sharedstatus','checkbox'); +v.addTableRow('Liked Status','Hide Liked Status Stories','likedstatus','checkbox'); +v.addTableRow('Commented on Status','Hide Commented on Status stories','commentedstatus','checkbox'); +//v.addTableRow('Tagged in Status','Hide Tagged in Status Stories','taggedstatus','checkbox'); // not sure how to handle this, or if its even needed +v.addTableRow('Wrote on Wall','Hide Wrote on Wall Stories (This should work for comments posted to event, page, user and group wall)','commentwall','checkbox'); +v.tableFooter(); +newoptscolumn+=v.buildTable('complete'); + +// end new options layout +fbpoptshtml += newoptscolumn ; + +fbpoptshtml += ''+ +''+ + +''+ +''+ +''+ +//''+ +''+ +''+ +''+ +''+ +''+ +''+ + +''+ +''+ +''+ +''+ +''+ +''+ + +// right column links options +''+ + +// left column links options +''+ + +// fonts and colours section +''+ + +'
More OptionsHide ' + +// new custom text filter/ css / app whitelist tabs +'Custom Text Filter - ' + +'Application Whitelist - ' + +'Custom CSS
' + +'Enter the words or phrases, on separate lines, that you wish to filter from your news feed. (Text Filter Help)
' + +'' + +//(window.navigator.userAgent.match(/Mozilla\/4\.0 \(compatible\; MSIE 7\.0\; Windows/) ? '' : '
 FBP Tip: Want to remove Facebook Timeline? Click here.') + + +fbptips[Math.floor(Math.random() * fbptips.length)] + + +'
'+ +'
Beta Tester Box
Further OptionsSet

Hide Links in Right Column

Hide Links in Left Column

Font and Colour Options

'+ +'' + +'' + +'' + +'' + +'' + +'
' + + +'

'+ +'

If you like F.B. Purity and would like to show your appreciation for all the work
I have put into it and also support future development, please make a donation.

' + + +'
 Please tell all your friends about FBP tooShare on Facebook
'+ +'
'+ +'
Export Settings / Import Settings / ?
'; + +var fbpfirstrunhtml='
'+ +'
X
'+ +'
'+ +'

Hello there! It looks like this is your first time running F.B. Purity *

'+ +'

The functionality of this extension is closely linked to the current design of the Facebook website. When Facebook change the design or functionality of the site, this can sometimes stop F.B. Purity from working correctly.

' + +'

In order to keep up to date with news of any changes that may break F.B. Purity and for news of new versions of F.B Purity that fix any problems or add new functionality, it is extremely important that you click the like button for the F.B. Purity Fan page on Facebook (below). By doing this you should receive news of updates directly in your newsfeed, and you will also be able to leave feedback about the extension there too.

Update: Please note, due to Facebook censorship of the FBP fan page, you now also need to subscribe to notifications from the Fan page, otherwise you wont see the FBP news in your newsfeed. To do this, go to the FBP Fan Page, hover over the "Like" button then select "Get Notifications" and you will be notified whenever there is an important update.

'+ +'

First Step: Click Like:

'+ +'

Next Step: Click here for instructions on how to use F.B. Purity

'+ + +''+ +'
'; + +function hideotherdivs(e) { + divname=e.target.parentNode.id.split(/header/)[0]; + var boxlist="custext,appwhitelist,custcss"; + boxarr=boxlist.split(','); + for (i in boxarr) + if(boxarr[i]==divname) { + document.getElementById(divname + "header").setAttribute('style','background:#ECEFF5; font-weight:bold; font-size:15; border:1 solid'); + document.getElementById(divname + "desc").setAttribute('style','display:block;background:#ECEFF5;'); + document.getElementById(divname + "ta").setAttribute('style','display:block;width:404px;height:275px'); + } + else { + document.getElementById(boxarr[i] + 'header').setAttribute('style','background:white;font-weight:normal;font-size:14;border:0'); + document.getElementById(boxarr[i] + 'desc').setAttribute('style','display:none'); + document.getElementById(boxarr[i] + 'ta').setAttribute('style','display:none;'); + } +} + +function importsettingsbasic(ev) { + + ev.preventDefault(); + fbpsettingstext=prompt('F.B. Purity Settings Importer\n\nPaste in your saved FBP settings text, then click OK.') + + if(fbpsettingstext==null) + return; + + if(!fbpsettingstext.length) { + window.alert('You didnt enter valid settings text'); + return; + } + else { + try { + JSON.parse(fbpsettingstext); + } + catch(e) { + window.alert('Error, settings text malformed, not valid. Import failed!'); + return; + } + fbpsavevalue('fbpoptsjson-' + currentuserid,fbpsettingstext); + + window.alert('Import Successful. FBP Settings have been updated! Page will now reload.'); + + //close prefs screen + document.getElementById('fbpoptsdiv').style.display='none'; + + //reload page to refresh preferences + window.location.reload(true); + } +} + +function exportsettingsbasic(ev) { + ev.preventDefault(); + exportsettingsbasic2(); +} + +// figure out how to use callbacks, may be a better solution here.... + +function exportsettingsbasic2(opts) { + document.getElementById('fbpsettingstext').setAttribute('style','display:block;width:600px;height:220px'); + var exporttext; + if(!opts && opts!='') { + exporttext=fbploadvalue('fbpoptsjson-' + currentuserid,exportsettingsbasic2); + if(exporttext==-999) + return + } + else + exporttext=opts; + + if ((typeof(exporttext)=='undefined') || (exporttext.length =="")) { + exporttext=fbploadvalue('fbpoptsjson',exportsettingsbasic2); + if(exporttext==-999) + return; + } + document.getElementById('fbpsettingstext').textContent=exporttext; + + window.alert('Copy the FBP settings text from the text box below and save it in a document or text file. If you ever need to restore your settings from that file, simply copy the text from the file, click the Import Settings link and paste the text in.'); + // autoselect the text in the textarea + el=document.getElementById('fbpsettingstext'); + var range; + if ((/textarea/i.test(el.tagName)) || ((/input/i.test(el.tagName)) && (/text/i.test(el.type)))) { + el.select(); + } else if (!!window.getSelection) { // FF, Safari, Chrome, Opera + var sel = window.getSelection(); + range = document.createRange(); + range.selectNodeContents(el); + sel.removeAllRanges(); + sel.addRange(range); + } else if (!!document.selection) { // IE + document.selection.empty(); + range = document.body.createTextRange(); + range.moveToElementText(el); + range.select(); + } +} + +function get_cookie ( cookie_name ) +{ + var results = document.cookie.match ( '(^|;) ?' + cookie_name + '=([^;]*)(;|$)' ); + if ( results ) + return ( unescape ( results[2] ) ); + else + return null; +} + +function set_cookie (name,value) { + document.cookie = name+ "=" + escape(value)+ ';expires=01/04/2099 00:00:00'; +} + +// check for GM_set/get API +var isgmapi, islocstor; +try { + if(typeof(GM_setValue)!='undefined') { + GM_setValue('test',1) + if ( GM_getValue('test')==1) + isgmapi=1; + else + isgmapi=0; + } + else + isgmapi=0; +} +catch (e) { + console.log(e); + isgmapi=0; +} +// check for localstorage +try { + if(typeof(window.localStorage)!='undefined') + islocstor=1; + else + islocstor=0; + } +catch(e) { + islocstor=0; +} + +function fbpsavevalue(name,value){ + try { + if(isgmapi) { + GM_setValue(name,value); + } + else if(ischrome) { // ischrome + chrome.extension.sendRequest({method: "setLocalStorage", key: name, value: value}, function(response) { + ;//console.log(response.data); + }); + } + else if(issafari) { //(typeof(window.navigator.vendor)!='undefined') && (window.navigator.vendor.match(/Apple Computer, Inc\./)) && window.navigator.userAgent.match(/Version\/5\./) + safari.self.tab.dispatchMessage("setLocalStorage",{key: name, value: value}); + /*function replyToMessage(response) { + if (response.name === "data") { + console.log('safari save value response:' + response.message); + //if((typeof(response.message) !='undefined') && response.message.match(/\"filterappmessages\"/)) { + // window.localStorage[name]=response.message; + // window.location.reload(); + //} + } + }*/ + // register for message events + //safari.self.addEventListener("message", replyToMessage, false); + } + else if(isopera) { //window.navigator.userAgent.match(/Opera/) + widget.preferences[name]=value; + } + /* if i support localstorage and cookie, the user will repeatedly get the new user screen when the cookies are cleared, so lets comment this out + else if(locstor) { + window.localStorage[name]=value; + } + else + set_cookie(name,value); + */ + } + catch (e) { + //console.log(e); + if(islocstor) + window.localStorage[name]=value; + else + set_cookie(name,value); + } +} + +function fbploadvalue(name,funct){ + if(debug) + console.trace(); + //console.log('entering function : ' + arguments.callee.name); + + try { + if(isgmapi) { + val = GM_getValue(name); + } + else if(ischrome) { + // Chrome Extension + chrome.extension.sendRequest({method: "getLocalStorage", key: name}, function(response) { + //fbpdynamicreload(response.data); // we should maybe figure a way of doing this event driven + if(funct) { + if(debug) + console.log("we in call back, and heres the data: " + response.data); + if((typeof(response)=='undefined') || (typeof(response.data)=='undefined')) + funct(''); + else + funct(response.data); + } + //} + }); + val=-999; + if(debug) + console.log('name: ' + name + ' value' + val); + } + else if(issafari) { + // Safari Extension + safari.self.tab.dispatchMessage("getLocalStorage",name); + function replyToMessage(response) { + if(debug) + console.log(response.message); + if(funct) { + if(debug) + console.log("we in call back, and heres the data: " + response.message); + if(typeof(response.message)=='undefined') + funct(''); + else + funct(response.message); + } + } + // register for message events + safari.self.addEventListener("message", replyToMessage, false); + val=-999; + } + else if(isopera) { + if((typeof(widget.preferences[name]) !='undefined') ) { + val = widget.preferences[name]; + //fbpdynamicreload(); + } + else val=''; + } + } + catch (e) { + console.log(e); + if(islocstor) + val=window.localStorage[name]; + else + val=get_cookie(name); + } + return val; +} + +function initundef() { + if(typeof (fbpoptsobj.filterappmessages) =='undefined') + fbpoptsobj.filterappmessages=1; + if(typeof (fbpoptsobj.sortmostrecent) =='undefined') + fbpoptsobj.sortmostrecent=0; + if(typeof (fbpoptsobj.fixarticleredirects) =='undefined') + fbpoptsobj.fixarticleredirects=1; +} + +function fbpgetprefs(opts) { + if(debug) { + console.trace(); + console.log(arguments.callee.length); + console.log(opts); + //console.log('entering function : ' + arguments.callee.name); + } + + var optsdump; + if(typeof(opts)!='undefined') { + if(opts && opts.length) { + if(debug) + console.log("opts=" + opts); + optsdump=opts; + try { + fbpoptsobj=JSON.parse(optsdump); + } + catch(e) { + console.log('error reading json in fbpgetprefs'); + console.dir(e); + return; + } + initundef(); + initstage2(); + finalstage(); + } + else { + if(debug) + console.log('are we at the top?'); + if(!issafari) // because getting vars out of localstorage is not working in safari, we not checking for first run + fbpfirstruncheck(); + fbpoptsobjinit(); + initundef(); + initstage2(); + finalstage(); + } + } + else { + //console.log("user" + currentuserid); + optsdump = fbploadvalue('fbpoptsjson-' + currentuserid,fbpgetprefs);//'fbpgetprefs' + if(optsdump!=-999) { //if(!isasync) { + if(optsdump && optsdump.length) { + try{ + fbpoptsobj=JSON.parse(optsdump); + } + catch(e) { + fbpoptsobj=JSON.parse(decodeURIComponent(optsdump)); // this line is to make it compatible with older firefox extension which urlencoded/decoded saved values inside the extension + } + initundef(); + initstage2(); + finalstage(); + } + else { + if(debug) + console.log('are we at the bottom?'); + if(!issafari) // because getting vars out of localstorage is not working in safari, we not checking for first run + fbpfirstruncheck(); + fbpoptsobjinit(); + initundef(); + initstage2(); + finalstage(); + } + } + } + //unsafeWindow.console.log(typeof(optsdump) + ' xxx ' + optsdump + 'xxx' + optsdump.length); +} + +function fbpfirstruncheck(result) { + + if(debug) { + console.trace(); + console.log('firstrun? ' + result); + } + //console.log('entering function : ' + arguments.callee.name); + var fbpfirstrun; + //alert("firstres = " + result); + //if(result || (result=='')) { was working on chrome and firefox and opera? + if(typeof(result)!='undefined') { + fbpfirstrun=result; + } + else + fbpfirstrun=fbploadvalue('fbpfirstrun',fbpfirstruncheck); + if(fbpfirstrun==-999) + return; + + //alert("secondres = " + fbpfirstrun); // make sure user is logged in (pageLogo element is there) + if (((fbpfirstrun=='') || (typeof(fbpfirstrun)=='undefined') || (fbpfirstrun==null)) && (!(window.location.href.match(/^https?:\/\/apps\.facebook|^https?:\/\/blog\.facebook|^https?:\/\/secure\.facebook/)))) { + if(!document.getElementById('fbpfirstrundiv') && document.getElementById('blueBar') && document.getElementById('pageLogo')) { + ph=document.getElementById('blueBar'); //pageHead + firstrundiv=document.createElement('div'); + firstrundiv.innerHTML=fbpfirstrunhtml; + if(ph.firstChild) + ph.firstChild.parentNode.insertBefore(firstrundiv, ph.firstChild.nextSibling); + fbpsavevalue('fbpfirstrun',new Date() + ""); + } + } +} + +function checkifupdaterequired(currver,latestver) { + if(debug) + console.trace(); + //console.log('entering function : ' + arguments.callee.name); + + if (currver && latestver) { + var fbpupdatehtml = "**Update** "; + if (currver==latestver) + return; //window.alert('Congrats! You have the latest version of FB Purity :)'); + else { + cvpart1=currver.split(/\./)[0]; + cvpart2=currver.split(/\./)[1]; + cvpart3=currver.split(/\./)[2]; + lvpart1=latestver.split(/\./)[0]; + lvpart2=latestver.split(/\./)[1]; + lvpart3=latestver.split(/\./)[2]; + if(cvpart1=0;i--) + for(i=0;i1) // check if user wants to block all the currently shown applications + if(blockallapps()) + return; + } + if(document.getElementById('blockapplab')) + document.getElementById('blockapplab').style.display='none'; + + document.getElementById(nodeid).setAttribute('style','background:#DCDCDC !important;text-align:center'); + document.getElementById(nodeid).innerHTML='F.B. Purity : Blocking Application : "' + appname + '"    '; + + var http = new window.XMLHttpRequest(); + //var url = window.location.protocol + "//" + window.location.hostname + "/ajax/apps/block_app.php?" + "app_id=" + appid + "&type_index=0&source=about&confirm_id=block_" + appid + "&__a=1"; + //var params = "__d=1&confirm=1&fb_dtsg=" + fb_dtsg + "&ok=Okay" ; + var url = window.location.protocol + "//" + window.location.hostname + "/ajax/apps/block_app.php?" + "app_id=" + appid + "&type_index=0&source=about&confirm_id=block_" + appid; + var params = "__asyncDialog=1&__user=" + currentuserid + "&__a=1&confirmed=1&fb_dtsg=" + fb_dtsg ;// + phstamp:1658166771106811366130 + + http.open("POST", url, true); + http.setRequestHeader("Referer", window.location.protocol + "//" + window.location.hostname + "/apps/application.php?id=" + appid); + http.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); + //http.setRequestHeader("Content-length", params.length); + //http.setRequestHeader("Connection", "close"); + + http.onreadystatechange = function() { + if(http.readyState == 4 && http.status == 200) { + if(!http.responseText.match('\"errorSummary\"')){ + //unsafeWindow.console.log("successfully blocked app : '" + appname + "' with id=" +appid + "\n"); + if((nodeid!='platform_dialog_content') &&(nodeid!='pagelet_canvas_content')) + destroyblockedappstories (appid,'kill'); + else { + document.getElementById(nodeid).innerHTML= '

' +appname + ' has been BLOCKED!' + '

'; + if(document.getElementsByClassName('platform_dialog_bottom_bar_table').length) + document.getElementsByClassName('platform_dialog_bottom_bar_table')[0].style.display='none'; + } + + } + else { + if(http.responseText.match(/\"errorSummary\"\:/)) + var errorsum=http.responseText.match(/\"errorSummary\"\:\"(.*)\",\"error/)[1]; + else + var errorsum=""; + if(http.responseText.match(/\"errorDescription\"\:/)) + var errordesc=http.responseText.match(/\"errorDescription\"\:\"(.*)\",/)[1]; + else + var errordesc=""; + if( errorsum.length && errordesc.length ) + var wholeerror = errorsum + ' : ' + errordesc; + else + var wholeerror = http.responseText; + window.alert('app block failed for some reason:\n\n' + wholeerror); + } + http=null; + } + } + http.send(params); + + } // END blockapp function + + function blockappev(ev) { + + ev.preventDefault(); + var appname=this.getAttribute('appname'); + var appid=this.getAttribute('appid'); + var nodeid=this.getAttribute('nodeid'); + blockapp(appid,appname,nodeid); + } // END blockappev function + + function allowappev(ev) { + + ev.preventDefault(); + var appname=this.getAttribute('appname'); + var appid=this.getAttribute('appid'); + var nodeid=this.getAttribute('nodeid'); + document.getElementById(nodeid).setAttribute('class', document.getElementById(nodeid).getAttribute('class') + ' aid_' + appid); + allowapp(appid,appname); + } // END allowappev function + + function fbpshowblocked() { + + var showhidelink=document.getElementById('fbpshowblockedlink'); + var showorhidetext=showhidelink.textContent; + + var showhidelinkx=document.getElementById('fbpshowblockedxlink'); + var showorhidetextx=showhidelinkx.textContent; + + var blockedmsgs=document.getElementsByClassName('fbpblocked'); + + if (showorhidetext=='Show') { + if(!blockedmsgs.length) + return; + showhidelink.innerHTML='Hide'; + showhidelink.title='Hide Application + Game Stories'; + showhidelinkx.innerHTML='Show'; + showhidelinkx.title='Show Extras (Friend/Group/Fan/Event etc Stories)'; + fbpstyle.textContent=fbpStyleApps; + } + else { + showhidelink.innerHTML='Show'; + showhidelink.title='Show Application + Game Stories'; + fbpstyle.textContent=fbpStyleNormal; + } + + //works better in reverse order + for(i=(blockedmsgs.length-1); i>=0; i--) { + //unsafeWindow.console.log("show block link: " + i); + dspBlockLink(blockedmsgs[i]); + } + + blockedmsgs=null; + + } // END fbpshowblocked function + + function fbpshowblockedx() { + + var showhidelinkx=document.getElementById('fbpshowblockedxlink'); + var showorhidetextx=showhidelinkx.textContent; + + var showhidelink=document.getElementById('fbpshowblockedlink'); + var showorhidetext=showhidelink.textContent; + + var blockedmsgs=document.getElementsByClassName('fbpblockedx'); + + if (showorhidetextx=='Show') { + if(!blockedmsgs.length) + return; + showhidelinkx.innerHTML='Hide'; + showhidelinkx.title='Hide Extras (Friend/Group/Fan/Event etc Stories)'; + showhidelink.innerHTML='Show'; + showhidelink.title='Show Application + Game Stories'; + fbpstyle.textContent=fbpStyleExtras; + } + else { + showhidelinkx.innerHTML='Show'; + showhidelinkx.title='Show Extras (Friend/Group/Fan/Event etc Stories)'; + fbpstyle.textContent=fbpStyleNormal; + } + + blockedmsgs=null; + + } // END fbpshowblockedx + + fbpshowblockedev = function (ev) { + ev.preventDefault(); + fbpshowblocked(); + } + + fbpshowblockedxev = function(ev) { + ev.preventDefault(); + fbpshowblockedx(); + } + + function dspBlockLink(node, blockmode) { + if (node.getElementsByClassName('blocklink').length) + return; + + var appid; + var appname=''; + // check if its a new FB Actions / Frictionless sharing app + //uism =node.getElementsByClassName('uiStreamMessage'); + //if(uism.length) + // if (uism[0].innerHTML.match(/\/hovercard\/application\.php\?id\=(\d*)|\/hovercard\/hovercard\.php\?id=(\d*)/)) + // blockmode='sua'; + + if (typeof(blockmode)=='undefined') { + var footernode, headernode; + headernode=node.getElementsByClassName('uiStreamMessage'); + + if(document.getElementsByClassName('uiStreamFooter') && document.getElementsByClassName('uiStreamFooter').length) { + footernode=node.getElementsByClassName('uiStreamFooter')[0]; + } + else + if(document.getElementsByClassName('UIActionLinks_bottom') && document.getElementsByClassName('UIActionLinks_bottom').length) { + footernode=node.getElementsByClassName('UIActionLinks_bottom')[0]; + } + else { + footernode='x'; //invalid node will cause exception, luckily we have an exception handler isnt it ;-) + } + + //its possibly an app posing as a normal facebook message, so lets try and get the appid from the footer + if(headernode.length && headernode[0].innerHTML.match(/application\.php\?id=(\d+)/)) { + appid=headernode[0].innerHTML.match(/application\.php\?id=(\d+)/)[1]; + } + else if(footernode.innerHTML.match(/php\?id=(\d+)\"|\"\;app_id\"\;\:(\d+)\,/)) { + if(typeof footernode.innerHTML.match(/php\?id=(\d+)\"|\"\;app_id\"\;\:(\d+)\,/)[1] !='undefined') + appid=footernode.innerHTML.match(/php\?id=(\d+)\"|\"\;app_id\"\;\:(\d+)\,/)[1]; + else if(typeof footernode.innerHTML.match(/php\?id=(\d+)\"|\"\;app_id\"\;\:(\d+)\,/)[2] !='undefined') + appid=footernode.innerHTML.match(/php\?id=(\d+)\"|\"\;app_id\"\;\:(\d+)\,/)[2]; + } + else + if(footernode.innerHTML.match(/application\.php\?id=(\d+)/)) { + if(footernode.innerHTML.match(/application\.php\?id=(\d+)/)[1]!='undefined') + appid=footernode.innerHTML.match(/application\.php\?id=(\d+)/)[1]; + } + else + return; + + try { + //appname=footernode.getElementsByClassName("GenericStory_BottomAttribution")[0].getElementsByTagName('a')[0].textContent; + if(footernode.innerHTML.match(/data-appname=/)) + appname=footernode.innerHTML.match(/data-appname="([^"]*)"/)[1] ; + else if (headernode[0].innerHTML.match(/application.php/)){ + appname=headernode[0].innerHTML.match(/application\.php\?id=.*\>(.*)<\/\a\>/)[1]; + } + else + { + flinks=footernode.getElementsByTagName('a'); + appname=flinks[flinks.length-1].textContent; + if(appname=='') + appname=flinks[flinks.length-2].textContent; + } + } catch (e) { + appname='mystery app x'; + //unsafeWindow.console.log('error getting application name'); + } + + } // END if blockmode=normal (if !blockmode.length) + else { + // we are doing this for "started using app/game" (sua) type posts + var uism = node.getElementsByClassName('uiStreamMessage') + var alinks=uism[0].getElementsByTagName('a'); + for(var i=0;iBA"; + blinkspan.getElementsByTagName('a')[0].addEventListener("click", blockappev, false); + //blinkinsertpoint.parentNode.insertBefore(blinkspan, blinkinsertpoint); //(insert before pattern) + blinkinsertpoint.appendChild(blinkspan); + blinkinsertpoint.appendChild(document.createElement('br')); // separate the 2 links + + var alinkspan=document.createElement('div'); + alinkspan.setAttribute('style',"position:relative; opacity:0.5; top : 23px;"); + alinkspan.className=hidebuttonclasses; + + alinkspan.innerHTML="WL"; + alinkspan.getElementsByTagName('a')[0].addEventListener("click", allowappev, false); + //blinkinsertpoint.parentNode.insertBefore(alinkspan, blinkinsertpoint); //(insert before pattern) + blinkinsertpoint.appendChild(alinkspan); + + } // END dspBlockLink function + + function callLater(paramA, paramB, paramC, paramD, paramE){ + return (function(){ + //blockapp(appid, appname, nodeid, auto); + paramA(paramB, paramC, paramD, paramE); + //unsafeWindow.console.log(paramA,paramB, paramC, paramD) + }); + } + + blockallapps = function() { + var appdump=document.getElementsByClassName('fbpblocked'); + var apparray=[]; + var appnamelist=''; + var applength=0; + for(var i=0;iF.B. Purity hid:  0 app [ Show ]  0 extra [ Show ] '; + + fbpurityinfowrapper.appendChild(fbpurityinfo); + fbpurityinfowrapper.appendChild(fbpclear); + + if((document.getElementById('pagelet_composer') || document.getElementById('pagelet_fl_composer')) && (!document.getElementById('fbpurityinfobar'))) // homepage // fanpage or // friends list page + insertpoint.parentNode.insertBefore(fbpurityinfowrapper, insertpoint.nextSibling); // after composer + else if (document.getElementById('profile_stream_composer') && (!document.getElementById('fbpurityinfobar'))) + insertpoint.parentNode.insertBefore(fbpurityinfowrapper, insertpoint.nextSibling); + else if (document.getElementById('timelineNavContent') && (!document.getElementById('fbpurityinfobar'))) { + fbpurityinfowrapper.style.display='none'; // we not showing bar for now, as filtering doesnt work on timeline yet + insertpoint.appendChild(fbpurityinfowrapper); + } + else if(window.location.href.match(/facebook\.com\/apps\/feed/) || window.location.href.match(/facebook\.com\/pages\/feed/)) { // games feed page + insertpoint.insertBefore(fbpurityinfowrapper, insertpoint.firstChild); + } + + document.getElementById('fbpshowblockedlink').addEventListener("click", fbpshowblockedev, false); + document.getElementById('fbpshowblockedxlink').addEventListener("click", fbpshowblockedxev, false); + document.getElementById('fbpoptslink').addEventListener("click", fbptoggleopts, false); + + fpbblockcountspan=document.getElementById('fbpblockcount'); + fpbblockxcountspan=document.getElementById('fbpblockxcount'); + + } + + } + + //if we navigate away from the page then come back, the event listeners seem to disappear, so lets re-add them here. + if( document.getElementById('fbpshowblockedlink') ) { + document.getElementById('fbpshowblockedlink').removeEventListener("click", fbpshowblockedev, false); + document.getElementById('fbpshowblockedlink').addEventListener("click", fbpshowblockedev, false); + } + if( document.getElementById('fbpshowblockedxlink') ) { + document.getElementById('fbpshowblockedxlink').removeEventListener("click", fbpshowblockedxev, false); + document.getElementById('fbpshowblockedxlink').addEventListener("click", fbpshowblockedxev, false); + } + if( document.getElementById('fbpoptslink') ) { + document.getElementById('fbpoptslink').removeEventListener("click", fbptoggleopts, false); + document.getElementById('fbpoptslink').addEventListener("click", fbptoggleopts, false); + } + + // Deal with recent activity blocks + /* + if (thenode.getAttribute && thenode.getAttribute('class') && thenode.getAttribute('class').match(/uiStreamMinistoryGroup/)) { + if(fbpoptsobj.recentactivity) { + thenode.setAttribute('class',thenode.getAttribute('class') + ' fbpblockedx'); + updateblockedcount(); + return; + } + else { + thenode.setAttribute('class',thenode.getAttribute('class') + ' fbpnormal'); + return; + } + } + else if(thenode.getElementsByClassName('uiStreamMinistoryGroup').length) { + var rablocks=thenode.getElementsByClassName('uiStreamMinistoryGroup'); + for(var rai=0;rai'; + monglab.addEventListener('click',fbptasubmit,false); + event.target.parentNode.parentNode.parentNode.appendChild(monglab); + } + } + } + } , false); + + if (document.getElementById('fbpfreestyler')) + document.getElementById('fbpfreestyler').textContent += ' .sendOnEnterTip , .commentUndoTip {display:none !important} .hidden_elem .optimistic_submit, #facebook .child_is_active .hidden_elem.commentBtn, #fbPhotoSnowliftFeedbackInput .hidden_elem.commentBtn {display:block !important;} div.-cx-PRIVATE-fbGiftTodayBirthdaysCoverPhoto__coverBlock {overflow:auto}'; + + bringbackcommentbuttons=function () { + //deal with the ticker flyout comment boxes + var plops=document.getElementsByClassName('uiContextualDialogPositioner'); + var combutts2; + for(var i=0;i=0;j--) + if(!combutts3[j].getAttribute('class').match(/highlighterContent/) && (combutts3[j].nodeName!='DIV')) + combutts3[j].setAttribute('class','uiButton uiButtonConfirm'); + comta=plops[i].getElementsByClassName('enter_submit'); + for(l=comta.length-1;l>=0;l--) + comta[l].setAttribute('class',comta[l].getAttribute('class').replace('enter_submit','')); + } + } + } + + // deal with birthdays box in newsfeed itself + var blobuts=document.querySelectorAll('.-cx-PRIVATE-fbGiftTodayBirthdays__list label.hidden_elem'); + if(blobuts.length) + for(m=0;m +//as=document.getElementsByTagName('a');for(i=0;i=0;v--) + if(legas[v].getAttribute('ajaxify').match(/cid=(\d+)/)) { + bappid=legas[v].getAttribute('ajaxify').match(/cid=(\d+)/)[1]; + break; + } + } + + var titleclass=document.getElementsByClassName('fsxl'); + if(titleclass.length) + var bapname=titleclass[0].textContent; + else + if(document.getElementById('permPanel')) + bapname=document.getElementById('permPanel').getElementsByTagName('b')[0].textContent; + else + var bapname="Application"; + /* + blahlink=document.createElement('a'); + blahlink.setAttribute('ajaxify','/ajax/apps/block_app.php?app_id=' + bappid + '&type_index=0&source=about&confirm_id=block_app_link'); + blahlink.setAttribute('rel','dialog'); + blahlink.setAttribute('id','js_3'); + blahlink.style.marginLeft='4px'; + + blahlab=document.createElement('label'); + blahlab.setAttribute('class','uiButton uiButtonConfirm uiButtonLarge'); + blahlab.setAttribute('id','blockapplab'); + blahlab.setAttribute('appid',bappid); + blahlab.setAttribute('appname',bapname); + blahlab.setAttribute('nodeid','platform_dialog_content'); //globalContainer + //blahlab.setAttribute('style','position:absolute;top:-15px;left:520px'); + blahlab.setAttribute('title','Block this application with F.B. Purity'); + //blahlab.innerHTML=''; + blahlab.innerHTML='Block';//'; + blahlink.appendChild(blahlab); + // new block code, get id of cancel_click button, and click it to close dialog + // + + buttbox=document.getElementsByClassName('rightContent'); + if(buttbox.length) + buttbox[0].appendChild(blahlink); + else { + buttbox2=document.getElementsByClassName('platform_dialog_buttons'); + if(buttbox2.length) + buttbox2[0].appendChild(blahlink); + } + */ + + /* BEGIN NEW / OLD CODE */ + /* ---------------------*/ + blahlab=document.createElement('label'); + blahlab.setAttribute('class','uiButton uiButtonConfirm uiButtonLarge'); + blahlab.setAttribute('id','blockapplab'); + blahlab.setAttribute('appid',bappid); + blahlab.setAttribute('appname',bapname); + blahlab.setAttribute('nodeid','platform_dialog_content');//globalContainer + if(!document.getElementById('platform_dialog_content')) + if(document.getElementsByClassName('tosPane').length) + document.getElementsByClassName('tosPane')[0].setAttribute('id','platform_dialog_content'); + + //blahlab.setAttribute('style','position:absolute;top:-15px;left:520px'); + blahlab.setAttribute('title','Block this application with F.B. Purity'); + blahlab.innerHTML=''; + //document.getElementById('content').appendChild(blahlab); + buttbox=document.getElementsByClassName('rightContent'); + if(buttbox.length) + buttbox[0].appendChild(blahlab); + else { + buttbox2=document.getElementsByClassName('platform_dialog_buttons'); + if(buttbox2.length) + buttbox2[0].appendChild(blahlab); + } + + if(document.getElementById('appblocker')) + document.getElementById('blockapplab').addEventListener('click',blockappev,false); + /* -------------------*/ + /* END NEW / OLD CODE */ + + //if(document.getElementById('appblocker')) + // document.getElementById('blockapplab').addEventListener('click',blockappev,false); + + //if((!location.href.match(/www\.facebook\.com\/connect\/uiserver\.php/)) && document.getElementById('block_app_link')) // hide the original dialog only if we are not in a frame on another site, otherwise we lose the block dialog too + // document.getElementById('block_app_link').addEventListener('click',function() { document.getElementById('cancel_clicked').click();},false); + + // if requesting permission to send direct emails, warn user by highlighting it + highlightemailrequest(); + } +} + +highlightemailrequest = function() { + //console.log('did we get here?') + // if a facebook application is requesting the users email address highlight it + var appperms=document.getElementsByClassName('gdp_list_item'); + if(appperms.length) + for(var i=0;iBA'; + appslist[i].getElementsByClassName('appName')[0].appendChild(tspan); + } + + } + } + //
+ +} // END highlightemailrequest function + +/*BEGIN Check if this page is an authorise app page so we can add a block button +Example URLS https://www.facebook.com/connect/uiserver.php?app_id=216694208368074 +Scenarios: oauth page / request permissions page / app page +*/ +if(window.location.href.match(/\/dialog\/oauth/) || window.location.href.match(/dialog\/permissions\.request/) || window.location.href.match(/\/connect\/uiserver\.php\?/) || window.location.href.match(/\/dialog\/plugin\.perms/)) + if(!window.navigator.userAgent.match(/Opera\//)) + addblockbuttontopermreq(); + else + setTimeout(addblockbuttontopermreq,2000); // pause because opera runs script b4 page has finished loading + +if(window.location.href.match(/\/appcenter\//)) + setTimeout(highlightemailrequest,2500); +/* END Check if this page is an authorise app page so we can add a block button */ + +/* BEGIN add a "block application" link at the bottom left hand corner of all application pages */ +function addblockapplinktoapppage() { +if (window.location.href.match(/\:\/\/apps\./)) { + if(document.getElementById('footerContainer')) { + var footzer=document.getElementById('footerContainer'); + var footytxt='footerContainer'; + } + else { + var footzer=document.getElementById('pagelet_canvas_footer_content'); + var footytxt='pagelet_canvas_footer_content'; + } + if(footzer) { + var fas=footzer.getElementsByTagName('a'); + for(var i=0;iTL'+ + '
X
'; + TLBUTT=document.createElement('div'); + TLBUTT.setAttribute('class','lfloat fbJewel'); + TLBUTT.setAttribute('id','TLJewel'); + TLBUTT.setAttribute('title','F.B. Purity: Single Column Timeline Layout'); + if(document.querySelector('body.hasSmurfbar')) + TLBUTT.setAttribute('style','top:0px;margin-left:3px;vertical-align:middle;font-size:20px;font-color:#173a85;font-weight:bold; left: 614px; top: -20px !important; '); // + else + TLBUTT.setAttribute('style','top:0px;margin-left:3px;vertical-align:middle;font-size:20px;font-color:#173a85;font-weight:bold'); + + TLBUTT.innerHTML=TLBUTTHTML; + window.setTimeout( function(){ + var datd=document.getElementById('navSearch'); + if(!datd) + datd=document.querySelector('div[role="search"]'); + if(datd && (!document.getElementById('TLJewel'))) { + datd.parentNode.insertBefore(TLBUTT,datd.nextSibling); + document.getElementById('TLINK').addEventListener('click',toggletimeline,false); + } + },0); + // END add TL button next to search box +} + +function resetclasses () { + var fbpn,a; + var arrResetClasses=['fbpnormal','fbpblockedx','fbpblocked']; + for(a in arrResetClasses) { + //console.log(arrResetClasses[a]); + fbpn=document.getElementsByClassName(arrResetClasses[a]); + for(i=fbpn.length;i>0;i--) { + //console.log(i); + fbpn[i-1].setAttribute('class',fbpn[i-1].getAttribute('class').replace(arrResetClasses[a],'')); + } + //console.log("fbpoptsobj.filterappmessages=" + fbpoptsobj.filterappmessages + " current arr length=" + document.getElementsByClassName(arrResetClasses[a]).length); + } +} + +function fbpurify() { + if(debug) + console.trace(); + + var crappyappmsgcounter=0; + var xtramsgcounter=0; + fbpstyle.setAttribute('id','fbpstyler'); + fbpstyle.setAttribute('type','text/css'); + fbpStyleApps= ".fbpblocked {border-style: dashed !important; border-width:1px !important; border-top: 0px !important; border-color: pink !important; display:block !important} .fbpblockedx {display:none !important} .fbpnormal {display:none !important}"; + if(document.querySelector('body.hasSmurfbar')) + fbpStyleExtras= ".fbpblocked {display:none !important} .fbpblockedx {border-style: dashed !important; border-width:1px !important; border-top: 0px !important; border-color: blue !important; display:block !important} .fbpnormal {display:none !important}"; + else + fbpStyleExtras= ".fbpblocked {display:none !important} .fbpblockedx {border-style: dashed !important; border-width:1px !important; border-top: 0px !important; border-color: lightblue !important; display:block !important} .fbpnormal {display:none !important}"; + fbpStyleNormal= ".fbpblocked {display:none !important} .fbpblockedx {display:none !important} .fbpnormal {display:block !important}"; + fbpstyle.textContent=fbpStyleNormal; + + if(document.getElementsByTagName('head')) { + document.getElementsByTagName('head')[0].appendChild(fbpstyle); + } + document.addEventListener("DOMNodeInserted", fpInsertedNodeDomHandler, false); + + if(document.getElementById('pagelet_home_stream') || document.getElementById('pagelet_litestand_section') || document.getElementById('stream_pagelet')) + cleartheshizzle(document); + +} // END fbpurify function + + +var waitfordom1=setInterval(function(){ + if(document.getElementById('globalContainer')) { + clearInterval(waitfordom1); + if(window.navigator.userAgent.match(/Opera/)) + fbpgetprefs(); // grab user prefs if available if not populate them with defaults + //bringbacknormalcommenting(); + window.setTimeout(bringbacknormalcommenting,2000); // prefs werent being read in before running this, so i added a short delay + window.setTimeout(addexternallinkfix,2000); + //addexternallinkfix(); + tlbuttinit(); // initialise the timeline single column button + } + }, 500); + +// only run if DOM has loaded +finalstage=function () { +// we should check to see if fbpurify is already running... + +if(document.getElementById('pagelet_home_stream') || document.getElementById('pagelet_litestand_section') || document.getElementById('stream_pagelet')) { // || document.getElementById('pagelet_group_mall') || document.getElementById('timelineNavContent') // || document.getElementById('profile_minifeed') + fbpurify(); +} +else { + var waitfordom=setInterval(function(){ + if(document.getElementById('pagelet_home_stream') || document.getElementById('pagelet_litestand_section') || document.getElementById('stream_pagelet')) { // || document.getElementById('pagelet_group_mall') || document.getElementById('timelineNavContent') // || document.getElementById('profile_minifeed') + clearInterval(waitfordom); + fbpurify(); + } + }, 500); +} +} // end finalstage function; + +if(!window.navigator.userAgent.match(/Opera/)) + fbpgetprefs(); // opera loads the script before the page has loaded, so we need to delay a bit for opera, and load prefs in the waitfordom1 function instead. + +})(); \ No newline at end of file diff --git a/dwb/greasemonkey/ponyhoof.user.js b/dwb/greasemonkey/ponyhoof.user.js new file mode 100644 index 0000000..c71c00b --- /dev/null +++ b/dwb/greasemonkey/ponyhoof.user.js @@ -0,0 +1,9887 @@ +// ==UserScript== +// @name Ponyhoof +// @namespace http://www.facebook.com/ponyhoof +// @run-at document-start +// @version 1.631 +// @installURL https://hoof.little.my/files/ponyhoof.user.js +// @updateURL https://hoof.little.my/files/ponyhoof.meta.js +// @icon https://hoof.little.my/files/app32.png +// @icon64 https://hoof.little.my/files/icon64.png +// @description Ponify Facebook and make it 20% cooler! +// @author The Ponyhoof Team http://ponyhoof.little.my +// @developer Ng Yik Phang +// @contributor James +// @contributor http://ponyhoof.little.my/credits +// @homepage http://ponyhoof.little.my +// @supportURL http://www.facebook.com/Ponyhoof +// @contributionURL http://ponyhoof.little.my/donate +// @include http://*.facebook.com/* +// @include https://*.facebook.com/* +// @include http://*.little.my/* +// @include https://*.little.my/* +// @match http://*.facebook.com/* +// @match https://*.facebook.com/* +// @match http://*.little.my/* +// @match https://*.little.my/* +// @exclude http://*.facebook.com/ai.php* +// @exclude http://*.facebook.com/l.php* +// @exclude http://*.facebook.com/ajax/* +// @exclude http://*.channel.facebook.com/* +// @exclude http://static.*.facebook.com/* +// @exclude http://graph.facebook.com/* +// @exclude http://0.facebook.com/* +// @exclude https://*.facebook.com/ai.php* +// @exclude https://*.facebook.com/l.php* +// @exclude https://*.facebook.com/ajax/* +// @exclude https://*.channel.facebook.com/* +// @exclude https://s-static.*.facebook.com/* +// @exclude https://graph.facebook.com/* +// @exclude https://0.facebook.com/* +// @exclude https://paste.little.my/* +// ==/UserScript== + +/******************************************************************************* + * Please visit http://jointheherd.lttle.my for the official install! + *******************************************************************************/ + + +(function() { + if (window.location.hostname.indexOf('facebook.com') == -1 && window.location.hostname.indexOf('little.my') == -1) { + return; + } + + /** + * Hoof Framework + * + * @author ngyikp (http://www.facebook.com/ngyikp) + */ +var d = document, w = window; +var ELEMENT_NODE = 1; +var TEXT_NODE = 3; + +var SIG = '[Hoof Framework]'; +var FRIENDLYNAME = 'Hoof Framework'; +var CANLOG = true; + +var userSettings = {}; + +var USERAGENT = w.navigator.userAgent.toLowerCase(); +var ISOPERABLINK = /OPR\//.test(w.navigator.userAgent); +var ISOPERA = !ISOPERABLINK && (typeof opera != 'undefined' || /opera/i.test(USERAGENT)); +var ISCHROME = !ISOPERABLINK && (typeof chrome != 'undefined' || /chrome/i.test(USERAGENT)); +var ISFIREFOX = /firefox/i.test(USERAGENT); +var ISSAFARI = !ISOPERABLINK && !ISCHROME && /safari/i.test(USERAGENT); +var ISMOBILE = /iphone|ipad|ipod|android|blackberry|mini|windows\sce|palm/i.test(USERAGENT); + +// R.I.P. unsafeWindow in Chrome 27+ http://crbug.com/222652 +if (typeof unsafeWindow == 'undefined') { + var USW = w; +} else { + var USW = unsafeWindow; +} + +function log(msg) { + if (CANLOG) { + if (typeof console !== 'undefined' && console.log) { + console.log(SIG + ' ' + msg); + } + } +} + +function dir(msg) { + if (CANLOG) { + if (typeof console !== 'undefined' && console.dir) { + console.dir(SIG + ' ' + msg); + } + } +} + +function debug(msg) { + if (CANLOG) { + if (typeof console !== 'undefined') { + if (console.debug) { + console.debug(SIG + ' ' + msg); + } else if (console.log) { + console.log(SIG + ' ' + msg); + } + } + } +} + +function info(msg) { + if (CANLOG) { + if (typeof console !== 'undefined') { + if (console.info) { + console.info(SIG + ' ' + msg); + } else if (console.log) { + console.log(SIG + ' ' + msg); + } + } + } +} + +function warn(msg) { + if (CANLOG) { + if (typeof console !== 'undefined') { + if (console.warn) { + console.warn(SIG + ' ' + msg); + } else if (console.log) { + console.log(SIG + ' ' + msg); + } + } + } +} + +function error(msg) { + if (CANLOG) { + if (typeof console !== 'undefined') { + if (console.error) { + console.error(SIG + ' ' + msg); + } else if (console.log) { + console.log(SIG + ' ' + msg); + } + } + } +} + +function trace() { + if (CANLOG) { + if (typeof console !== 'undefined' && console.trace) { + console.trace(); + } + } +} + +function $(id) { + return d.getElementById(id); +} + +function randNum(min, max) { + return min + Math.floor(Math.random() * (max - min + 1)); +} + +function hasClass(ele, c) { + if (!ele) { + return false; + } + if (ele.classList) { + return ele.classList.contains(c); + } + + var regex = new RegExp("(^|\\s)"+c+"(\\s|$)"); + if (ele.className) { // element node + return (ele.className && regex.test(ele.className)); + } else { // string + return (ele && regex.test(ele)); + } +} + +function addClass(ele, c) { + if (ele.classList) { + ele.classList.add(c); + } else if (!hasClass(ele, c)) { + ele.className += ' '+c; + } +} + +function removeClass(ele, c) { + if (ele.classList) { + ele.classList.remove(c); + } else { + ele.className = ele.className.replace(new RegExp('(^|\\s)'+c+'(?:\\s|$)','g'),'$1').replace(/\s+/g,' ').replace(/^\s*|\s*$/g,''); + } +} + +function toggleClass(ele, c) { + if (hasClass(ele, c)) { + removeClass(ele, c); + } else { + ele.className += ' ' + c; + } +} + +function clickLink(el) { + if (!el) { + return false; + } + + try { + var evt = d.createEvent('MouseEvents'); + evt.initMouseEvent('click', true, true, w, 0, 0, 0, 0, 0, false, false, false, false, 0, null); + el.dispatchEvent(evt); + return true; + } catch (e) { + return false; + } +} + +function cookie(n) { + try { + return unescape(d.cookie.match('(^|;)?'+n+'=([^;]*)(;|$)')[2]); + } catch (e) { + return null; + } +} + +function injectManualStyle(css, id) { + if ($('ponyhoof_style_'+id)) { + return $('ponyhoof_style_'+id); + } + + var n = d.createElement('style'); + n.type = 'text/css'; + if (id) { + n.id = 'ponyhoof_style_'+id; + } + n.textContent = '/* '+SIG+' */'+css; + + if (d.head) { + d.head.appendChild(n); + } else if (d.body) { + d.body.appendChild(n); + } else { + d.documentElement.appendChild(n); + } + + return n; +} + +function fadeOut(ele, callback) { + addClass(ele, 'ponyhoof_fadeout'); + + w.setTimeout(function() { + ele.style.display = 'none'; + + if (callback) { + callback(ele); + } + }, 250); +} + +function getFbDomain() { + if (w.location.hostname == 'beta.facebook.com') { + return w.location.hostname; + } + return 'www.facebook.com'; +} + +function onPageReady(callback) { + var _loop = function() { + if (/loaded|complete/.test(d.readyState)) { + callback(); + } else { + w.setTimeout(_loop, 100); + } + }; + _loop(); +} + +var loopClassName = function(name, func) { + var l = d.getElementsByClassName(name); + if (l) { + for (var i = 0, len = l.length; i < len; i++) { + func(l[i]); + } + } +}; + +function $$(parent, query, func) { + if (!parent) { + return; + } + var l = parent.querySelectorAll(query); + if (l.length) { + for (var i = 0, len = l.length; i < len; i++) { + func(l[i]); + } + } +} + +// Hacky code adapted from http://www.javascripter.net/faq/browsern.htm +function getBrowserVersion() { + var ua = w.navigator.userAgent; + var fullVersion = ''+parseFloat(w.navigator.appVersion); + var majorVersion = parseInt(w.navigator.appVersion, 10); + var nameOffset, offset, ix; + + if (ua.indexOf('Opera') != -1) { + // In Opera, the true version is after 'Opera' or after 'Version' + offset = ua.indexOf('Opera'); + fullVersion = ua.substring(offset + 6); + + if (ua.indexOf('Version') != -1) { + offset = ua.indexOf('Version'); + fullVersion = ua.substring(offset + 8); + } + } else if (ua.indexOf('OPR/') != -1) { + offset = ua.indexOf('OPR/'); + fullVersion = ua.substring(offset + 4); + } else if (ua.indexOf('MSIE') != -1) { + // In MSIE, the true version is after 'MSIE' in userAgent + offset = ua.indexOf('MSIE'); + fullVersion = ua.substring(offset + 5); + } else if (ua.indexOf('Chrome') != -1) { + // In Chrome, the true version is after 'Chrome' + offset = ua.indexOf('Chrome'); + fullVersion = ua.substring(offset + 7); + } else if (ua.indexOf('Safari') != -1) { + // In Safari, the true version is after 'Safari' or after 'Version' + offset = ua.indexOf('Safari'); + fullVersion = ua.substring(offset + 7); + + if (ua.indexOf('Version') != -1) { + offset = ua.indexOf('Version'); + fullVersion = ua.substring(offset + 8); + } + } else if (ua.indexOf('Firefox') != -1) { + // In Firefox, the true version is after 'Firefox' + offset = ua.indexOf('Firefox'); + fullVersion = ua.substring(offset + 8); + } else { + throw "Unsupported browser"; + } + + if ((ix = fullVersion.indexOf(';')) != -1) { + fullVersion = fullVersion.substring(0, ix); + } + if ((ix = fullVersion.indexOf(' ')) != -1) { + fullVersion = fullVersion.substring(0, ix); + } + + majorVersion = parseInt(''+fullVersion,10); + if (isNaN(majorVersion)) { + fullVersion = ''+parseFloat(w.navigator.appVersion); + majorVersion = parseInt(w.navigator.appVersion,10); + } + + return { + major: majorVersion + ,full: fullVersion + }; +} + +// http://wiki.greasespot.net/Content_Script_Injection +var contentEval = function(source, arg) { + var arg = arg || {}; + if (typeof source === 'function') { + source = '(' + source + ')(' + JSON.stringify(arg) + ');' + } + + var script = d.createElement('script'); + script.textContent = source; + d.documentElement.appendChild(script); + d.documentElement.removeChild(script); +}; + +var supportsRange = function() { + var i = d.createElement('input'); + i.setAttribute('type', 'range'); + return i.type !== 'text'; +}; + +var supportsCssTransition = function() { + var s = d.createElement('div').style; + return ('transition' in s || 'WebkitTransition' in s || 'MozTransition' in s || 'msTransition' in s || 'OTransition' in s); +}; + +// Menu +var MENUS = {}; +var Menu = function(id, p) { + var k = this; + + k.id = id; + MENUS['ponyhoof_menu_'+k.id] = k; + k.menu = null; // outer wrap + k.selectorMenu = null; // .uiMenu.uiSelectorMenu + k.menuInner = null; // .uiMenuInner + k.content = null; // .uiScrollableAreaContent + k.button = null; + k.wrap = null; // ponyhoof_menu_wrap, used to separate button and menu + + k.menuSearch = null; // .ponyhoof_menu_search + k.menuSearchInput = null; + k.menuSearchNoResults = null; + k.focusStealer = null; + + k.hasScrollableArea = false; + k.scrollableAreaDiv = null; // .uiScrollableArea + k.scrollableArea = null; // FB ScrollableArea class + + k.p = p; + k.afterClose = function() {}; + + k.canSearch = true; + k.alwaysOverflow = false; + k.rightFaced = false; + k.buttonTextClipped = 0; + + k.createButton = function(startText) { + if (!startText) { + startText = ''; + } + + var buttonText = d.createElement('span'); + buttonText.className = 'uiButtonText'; + buttonText.innerHTML = startText; + + k.button = d.createElement('a'); + k.button.href = '#'; + k.button.className = 'uiButton ponyhoof_button_menu'; + k.button.setAttribute('role', 'button'); + k.button.setAttribute('aria-haspopup', 'true'); + if (k.buttonTextClipped) { + k.button.className += ' ponyhoof_button_clipped'; + buttonText.style.maxWidth = k.buttonTextClipped+'px'; + } + k.button.appendChild(buttonText); + + k.wrap = d.createElement('div'); + k.wrap.className = 'ponyhoof_menu_wrap'; + if (k.rightFaced) { + k.wrap.className += ' uiSelectorRight'; + } + k.wrap.appendChild(k.button); + k.p.appendChild(k.wrap); + + return k.button; + } + + k.createMenu = function() { + if ($('ponyhoof_menu_'+k.id)) { + k.menu = $('ponyhoof_menu_'+k.id); + k.menuInner = k.menu.getElementsByClassName('uiMenuInner')[0]; + return k.menu; + } + + k.injectStyle(); + + k.menu = d.createElement('div'); + k.menu.className = 'ponyhoof_menu uiSelectorMenuWrapper'; + k.menu.id = 'ponyhoof_menu_'+k.id; + k.menu.setAttribute('role', 'menu'); + //k.menu.style.display = 'none'; + k.menu.addEventListener('click', function(e) { + e.stopPropagation(); + return false; + }, false); + k.wrap.appendChild(k.menu); + + k.selectorMenu = d.createElement('div'); + k.selectorMenu.className = 'uiMenu uiSelectorMenu'; + k.menu.appendChild(k.selectorMenu); + + k.menuInner = d.createElement('div'); + k.menuInner.className = 'uiMenuInner'; + k.selectorMenu.appendChild(k.menuInner); + + k.content = d.createElement('div'); + k.content.className = 'uiScrollableAreaContent'; + k.menuInner.appendChild(k.content); + + if (k.canSearch) { + k.menuSearch = d.createElement('div'); + k.menuSearch.className = 'ponyhoof_menu_search'; + k.content.appendChild(k.menuSearch); + + k.menuSearchInput = d.createElement('input'); + k.menuSearchInput.type = 'text'; + k.menuSearchInput.className = 'inputtext'; + k.menuSearchInput.placeholder = "Search"; + k.menuSearch.appendChild(k.menuSearchInput); + + k.menuSearchNoResults = d.createElement('div'); + k.menuSearchNoResults.className = 'ponyhoof_menu_search_noResults'; + k.menuSearchNoResults.textContent = "No results"; + k.menuSearch.appendChild(k.menuSearchNoResults); + + k.menuSearchInput.addEventListener('keydown', k.searchEscapeKey, false); + k.menuSearchInput.addEventListener('input', k.performSearch, false); + + k.focusStealer = d.createElement('input'); + k.focusStealer.type = 'text'; + k.focusStealer.setAttribute('aria-hidden', 'true'); + k.focusStealer.style.position = 'absolute'; + k.focusStealer.style.top = '-9999px'; + k.focusStealer.style.left = '-9999px'; + k.focusStealer.addEventListener('focus', k.focusStealerFocused, false); + k.selectorMenu.appendChild(k.focusStealer); + } + + return k.menu; + }; + + k.attachButton = function() { + k.button.addEventListener('click', function(e) { + k.toggle(); + e.stopPropagation(); + e.preventDefault(); + }, false); + }; + + k.changeButtonText = function(text) { + k.button.getElementsByClassName('uiButtonText')[0].innerHTML = text; + k.button.setAttribute('data-ponyhoof-button-orig', text); + k.button.setAttribute('data-ponyhoof-button-text', text); + + if (k.buttonTextClipped) { + k.button.title = text; + } + }; + + k.createSeperator = function() { + var sep = d.createElement('div'); + sep.className = 'uiMenuSeparator'; + k.content.appendChild(sep); + }; + + k.createMenuItem = function(param) { + var menuItem = new MenuItem(k); + menuItem._create(param); + + k.content.appendChild(menuItem.menuItem); + + return menuItem; + }; + + k.injectStyle = function() { + var css = ''; + css += 'html .ponyhoof_dialog .ponyhoof_button_menu, .ponyhoof_menuitem_checked {background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAfQAAADdCAYAAABNAoDAAAADbElEQVR42u3Xv06aARTG4XN93oYm7eDgakw7OXsD3oBpByevBhRKVVSooIDrKR9TGxOhSRM5n8+T/MKf8C1neUMkAFBeLF5eUpIk1S4W80VKkqTaxXw+T0mSVLuYzeYpSZJqF7PnWUqSpNrF0/NTSpKk2sX0aZqSJKl2MZ0u30iSpHdtZ+90bW89H5PJJCVJ0vu3e3iWRycXr2q+X/dsPD7+SkmStB19/vr9rzFvPm/yXIzH45QkSdvTwfH5asyb102fifFo+UaSJG1VqzH/h9/HaPSQkiSpdvFwf5+SJKl2cXd3l5IkqXYxHA5TkiTVLm5vb1OSJNUurm9uUpIk1S6ur3+mJEmqXQwGg5QkSbWLH/1+SpKk2kW/30tJklS76F31UpIk1S6uLi9TkiTVLrrdbkqSpNpFp9NJSZJUO4MuSZJBlyRJBl2SJBl0SZJk0CVJMuiSJMmgS5Ikgy5Jkgy6JEkGXZIkGXRJkmTQJUmSQZckyaBLkiSDLkmSDLokSTLokiQZdEmSZNAlSZJBlyRJBl2SpPYPOgAAAAAAAAAAAAAAAAAAAAAAAAD/WW7AlQCg+Ki7DgAUH3VXAYDio+4aAFB81F0BAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD4cHb2TnNdrgQABewenuXRycWrmu9dBwAK+fTl2+TPMW8+uwoAFHRwfL4a8+bVNQCg+Ki7AgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAW29/fz9dAQCKj7lBB4AWjLlBB4BC423MAaAl/8aNOQC0YNCNOQC0aNRdAwCKj7orAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwBq55AoAUHzMDToAtGDMDToAFBpvYw4ALfk3bswBoAWDbswBoEWj7hoAUHzUXQEAAAAAAN7yG6s7d/s7eB9vAAAAAElFTkSuQmCC") !important;background-repeat:no-repeat;-webkit-background-size:500px 221px;-moz-background-size:500px 221px;background-size:500px 221px;}'; + + css += 'html .ponyhoof_dialog .ponyhoof_button_menu {background-position:right 0;padding-right:23px;}'; + css += 'html .ponyhoof_button_menu:active {background-position:right -98px;}'; + css += 'html .openToggler .ponyhoof_button_menu {background-color:#6D84B4;background-position:right -49px;border-color:#3B5998;border-bottom-color:#6D84B4;-moz-box-shadow:none;box-shadow:none;}'; + css += 'html .openToggler .ponyhoof_button_menu .uiButtonText {color:#fff;}'; + + css += '.ponyhoof_menu_label {padding:7px 4px 0 0;}'; + css += '.ponyhoof_menu_label, .ponyhoof_menu_withlabel .ponyhoof_menu_wrap {display:inline-block;}'; + css += '.ponyhoof_menu_withlabel {margin-bottom:8px;}'; + css += '.ponyhoof_menu_withlabel + .ponyhoof_menu_withlabel {margin-top:-8px;}'; + css += '.ponyhoof_menu_withlabel .ponyhoof_button_menu {margin-top:-3px;}'; + css += '.ponyhoof_menu_labelbreak .ponyhoof_menu_label {display:block;padding-bottom:7px;}'; + + css += '.ponyhoof_menu_wrap {position:relative;}'; + css += 'html .ponyhoof_menu {z-index:1999;display:none;min-width:0;-webkit-user-select:none;-moz-user-select:none;user-select:none;}'; + css += '.ponyhoof_menu_wrap.openToggler .ponyhoof_menu {display:block;}'; + css += '.ponyhoof_menu_wrap + .uiButton {margin:4px 0 0 4px;}'; + css += '.ponyhoof_menu .uiMenu {background:#fff;border:1px solid #777;border-bottom:2px solid #293E6A;color:#000;position:absolute;overflow:auto;overflow-x:hidden;text-align:left;}'; + css += '.ponyhoof_menu .uiMenu.overflow {resize:vertical;height:200px;min-height:200px;}'; + css += '.ponyhoof_menu_wrap.uiSelectorRight .uiMenu {left:auto;right:0;}'; + css += '.ponyhoof_menu .ponyhoof_menu_search {padding:0 3px;margin-bottom:4px;}'; + css += '.ponyhoof_menu .ponyhoof_menu_search input {width:100%;resize:none;}'; + css += '.ponyhoof_menu .ponyhoof_menu_search_noResults {display:none;color:#999;text-align:center;margin-top:7px;width:100px;}'; + css += '.ponyhoof_menuitem {border:solid #fff;border-width:1px 0;color:#111;display:block;font-weight:normal;line-height:16px;padding:1px 22px;text-decoration:none;outline:none;-webkit-user-drag:none;resize:none;}'; + css += '.ponyhoof_menu .ponyhoof_menuitem {color:#111;}'; + css += '.ponyhoof_menuitem:hover, .ponyhoof_menuitem:active, .ponyhoof_menuitem:focus {background-color:#6d84b4;border-color:#3b5998;color:#fff;text-decoration:none;}'; + css += '.ponyhoof_menuitem_checked {background-position:0 -146px;font-weight:bold;}'; + css += '.ponyhoof_menuitem_checked:hover, .ponyhoof_menuitem_checked:active, .ponyhoof_menuitem_checked:focus {background-position:0 -206px;}'; + css += '.ponyhoof_menuitem_span {white-space:nowrap;text-overflow:ellipsis;display:inline-block;overflow:hidden;padding-right:16px;max-width:400px;}'; + + css += '.ponyhoof_button_clipped .uiButtonText {text-overflow:ellipsis;overflow:hidden;}'; + + injectManualStyle(css, 'menu'); + }; + + k.open = function() { + k.closeAllMenus(); + + addClass(k.wrap, 'openToggler'); + + if (!hasClass(k.menuInner.parentNode, 'overflow') && (k.menuInner.parentNode.offsetHeight >= 224 || k.alwaysOverflow)) { + addClass(k.menuInner.parentNode, 'overflow'); + } + + if (k.canSearch) { + var scrollTop = k.selectorMenu.scrollTop; + k.menuSearchInput.focus(); + k.menuSearchInput.select(); + + k.selectorMenu.scrollTop = scrollTop; + } + + d.body.addEventListener('keydown', k.documentEscapeKey, false); + d.body.addEventListener('click', k.documentClick, false); + }; + + k.close = function() { + if (hasClass(k.wrap, 'openToggler')) { + removeClass(k.wrap, 'openToggler'); + d.body.removeEventListener('keydown', k.documentEscapeKey, false); + d.body.removeEventListener('click', k.documentClick, false); + + k.afterClose(); + } + }; + + k.closeAllMenus = function() { + for (var menu in MENUS) { + if (MENUS.hasOwnProperty(menu)) { + MENUS[menu].close(); + } + } + }; + + k.toggle = function() { + if (hasClass(k.wrap, 'openToggler')) { + k.close(); + } else { + k.open(); + } + }; + + k.changeChecked = function(menuItem) { + var already = k.menu.getElementsByClassName('ponyhoof_menuitem_checked'); + if (already.length) { + removeClass(already[0], 'ponyhoof_menuitem_checked'); + } + addClass(menuItem.menuItem, 'ponyhoof_menuitem_checked'); + }; + + k.performSearch = function() { + var val = k.menuSearchInput.value; + var regex = new RegExp(val, 'i'); + + var count = 0; + $$(k.menu, '.ponyhoof_menuitem', function(menuitem) { + if (val == '') { + menuitem.style.display = ''; + return; + } + + if (!hasClass(menuitem, 'unsearchable')) { + menuitem.style.display = 'none'; + + var compare = menuitem.textContent; + if (menuitem.getAttribute('data-ponyhoof-menu-searchAlternate')) { + compare = menuitem.getAttribute('data-ponyhoof-menu-searchAlternate'); + } + + if (regex.test(compare)) { + menuitem.style.display = 'block'; + count += 1; + } + } else { + menuitem.style.display = 'none'; + } + }); + + $$(k.menu, '.ponyhoof_menu_search_noResults', function(ele) { + if (val) { + if (!count) { + ele.style.display = 'block'; + } else { + ele.style.display = 'none'; + } + } else { + ele.style.display = 'none'; + } + }); + + $$(k.menu, '.uiMenuSeparator', function(menuitem) { + if (val == '') { + menuitem.style.display = ''; + return; + } + + menuitem.style.display = 'none'; + }); + + if (k.hasScrollableArea) { + k.scrollableArea.poke(); + } + }; + + k.searchEscapeKey = function(e) { + if (e.which == 27) { + if (k.menuSearchInput.value != '') { + k.menuSearchInput.value = ''; + k.performSearch(); + } else { + k.close(); + if (k.button) { + k.button.focus(); + } + } + e.stopPropagation(); + e.cancelBubble = true; + } + }; + + k.documentEscapeKey = function(e) { + if (e.which == 27 && hasClass(k.wrap, 'openToggler')) { // esc + k.close(); + e.stopPropagation(); + e.cancelBubble = true; + + if (k.button) { + k.button.focus(); + } + } + }; + + k.documentClick = function(e) { + k.close(); + e.stopPropagation(); + e.preventDefault(); + }; + + k.focusStealerFocused = function(e) { + if (k.canSearch) { + k.menuSearchInput.focus(); + } + }; +}; + +var MenuItem = function(menu) { + var k = this; + + k.menuItem = null; + k.menu = menu; + k.onclick = null; + + k._create = function(param) { + k.menuItem = d.createElement('a'); + k.menuItem.href = '#'; + k.menuItem.className = 'ponyhoof_menuitem'; + k.menuItem.setAttribute('role', 'menuitem'); + + if (param.check) { + k.menuItem.className += ' ponyhoof_menuitem_checked'; + } + + if (param.data) { + k.menuItem.setAttribute('data-ponyhoof-menu-data', param.data); + } + + if (param.title) { + k.menuItem.setAttribute('aria-label', param.title); + k.menuItem.setAttribute('data-hover', 'tooltip'); + } + + if (param.unsearchable) { + k.menuItem.className += ' unsearchable'; + } + + if (param.searchAlternate) { + k.menuItem.setAttribute('data-ponyhoof-menu-searchAlternate', param.searchAlternate); + } + + if (param.extraClass) { + k.menuItem.className += param.extraClass; + } + + k.menuItem.innerHTML = ''+param.html+''; + + if (param.onclick) { + k.onclick = param.onclick; + } + k.menuItem.addEventListener('click', function(e) { + e.stopPropagation(); + if (k.onclick) { + k.onclick(k, k.menu); + } + + return false; + }, false); + k.menuItem.addEventListener('dragstart', function() { + return false; + }, false); + + return k.menuItem; + }; + + k.getText = function() { + return k.menuItem.getElementsByClassName('ponyhoof_menuitem_span')[0].innerHTML; + }; +}; + +// Dialog +var DIALOGS = {}; +var DIALOGCOUNT = 400; +var Dialog = function(id) { + var k = this; + + k.dialog = null; + k.generic_dialogDiv = null; + k.popup_dialogDiv = null; + k.id = id; + k.visible = false; + + k.alwaysModal = false; + k.noTitle = false; + k.noBottom = false; + + k.canCardspace = true; + k.cardSpaceTimer = null; + k.cardspaced = false; + + k.onclose = function() {}; + k.onclosefinish = function() {}; + k.canCloseByEscapeKey = true; + + k.skeleton = ''; + + k.create = function() { + //if (DIALOGS[k.id]) { + // log("Attempting to recreate dialog ID \""+k.id+"\""); + // return DIALOGS[k.id].dialog; + //} + + //DIALOGS[k.id] = k; + + log("Creating "+k.id+" dialog..."); + + k.injectStyle(); + + DIALOGCOUNT += 1; + k.skeleton = ''; + k.skeleton += ''; + + INTERNALUPDATE = true; + + k.dialog = d.createElement('div'); + k.dialog.className = 'ponyhoof_dialog'; + k.dialog.id = 'ponyhoof_dialog_'+k.id; + k.dialog.innerHTML = k.skeleton; + d.body.appendChild(k.dialog); + + INTERNALUPDATE = false; + + k.generic_dialogDiv = k.dialog.getElementsByClassName('pop_dialog')[0]; + k.popup_dialogDiv = k.dialog.getElementsByClassName('popup')[0]; + + if (k.alwaysModal) { + addClass(k.generic_dialogDiv, 'generic_dialog_modal'); + } + if (k.noTitle) { + addClass(k.dialog.getElementsByTagName('h3')[0], 'hidden_elem'); + } + if (k.noBottom) { + addClass(k.dialog.getElementsByClassName('bottom')[0], 'hidden_elem'); + } + + k.show(); + + return k.dialog; + }; + + k.injectStyle = function() { + var cx = '._6nw'; + if (d.getElementsByClassName('-cx-PUBLIC-hasLitestand__body').length) { + cx = '.-cx-PUBLIC-hasLitestand__body'; + } + + var css = ''; + css += '.ponyhoof_message .wrap {margin-top:3px;background:transparent !important;display:block;}'; + css += '.ponyhoof_message .uiButton.rfloat {margin-left:10px;}'; + + css += '.ponyhoof_dialog, .ponyhoof_dialog .body {font-size:11px;}'; + css += cx+' .ponyhoof_dialog, '+cx+' .ponyhoof_dialog .body {font-size:12px;}'; + css += '.ponyhoof_dialog iframe {-webkit-user-select:none;-moz-user-select:none;user-select:none;}'; + css += '.ponyhoof_dialog textarea, .ponyhoof_dialog input[type="text"] {cursor:text;-moz-box-sizing:border-box;box-sizing:border-box;}'; + css += '.ponyhoof_dialog .generic_dialog_modal, .ponyhoof_dialog .generic_dialog_fixed_overflow {background-color:rgba(0,0,0,.4) !important;}'; + css += '.ponyhoof_dialog .generic_dialog {z-index:250;}'; + css += '.ponyhoof_dialog .generic_dialog_popup {margin-top:80px;}'; + css += '.ponyhoof_dialog .popup {width:465px;margin:0 auto;cursor:default;-moz-box-shadow:0 2px 26px rgba(0, 0, 0, .3), 0 0 0 1px rgba(0, 0, 0, .1);box-shadow:0 2px 26px rgba(0, 0, 0, .3), 0 0 0 1px rgba(0, 0, 0, .1);}'; + css += cx+' .ponyhoof_dialog .popup {font-family:"Helvetica Neue", Helvetica, Arial, "lucida grande",tahoma,verdana,arial,sans-serif;}'; + css += '.ponyhoof_dialog .wrap {background:#fff;color:#000;}'; + css += '.ponyhoof_dialog h3 {background-color:#6D84B4;border:1px solid #3B5998;border-bottom:0;color:#fff;font-size:14px !important;font-weight:bold !important;padding:5px 5px 5px 10px;cursor:help;min-height:17px;font-family:\'lucida grande\',tahoma,verdana,arial,sans-serif !important;line-height:1.28 !important;}'; + css += cx+' .ponyhoof_dialog h3 {background:#f5f6f7;border:0;border-bottom:1px solid #e5e5e5;-moz-border-radius:3px 3px 0 0;border-radius:3px 3px 0 0;color:#4e5665;line-height:19px !important;padding:10px 12px;text-shadow:0 1px 0 #fff;font-family:\'Helvetica Neue\', Helvetica, Arial, \'lucida grande\',tahoma,verdana,arial,sans-serif !important;}'; + css += '.ponyhoof_dialog h3:before {background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABDUlEQVQ4y43TzytEURQH8BnDyGKKZIGlHwtTrKZQNmJPWMxO2VopKdkoCzul7PwBkpK17NlYkGz8G7LzsXBe3cbz3tz69s65536/nfe951ZQ6cAkWjn7ucjb3MdjxFWMJLVlrJYJTGAp4l4coBH5A95C+F+BFH14QTPyRawUdVDHcJLX/K52tx70YxuXmMZ6CNxFfQEzZR7UcRvEr/h+4hnv3QhkuPF3bRT9whZOMRB5u4P8gdkwNlfgPA5WMZYQv5N4raiDKcxjEFc4w2EQX3GCC4yXeTCE0eRW4CipX2Ov20GqhPM7yWRmHRUKzOEePTgOgzOBXWyWCTTxFIRWCHb9GrMRbsSN1AK5Z38AQdAu/IfZJw8AAAAASUVORK5CYII=");background-repeat: no-repeat;display:inline-block;float:right;content:" ";width:16px;height:16px;opacity:.713;}'; + css += cx+' .ponyhoof_dialog h3:before {display:none;}'; + css += '.ponyhoof_dialog .body {border:1px solid #555;border-top-width:0;}'; + css += '.ponyhoof_dialog h3.hidden_elem + .body {border-top-width:1px;}'; + css += cx+' .ponyhoof_dialog .body {border:0;}'; + css += '.ponyhoof_dialog .content {padding:10px;}'; + css += '.ponyhoof_dialog .bottom {background:#F2F2F2;border-top:1px solid #ccc;padding:8px 10px 8px 10px;text-align:right;}'; + css += cx+' .ponyhoof_dialog .bottom {-moz-border-radius:0 0 3px 3px;border-radius:0 0 3px 3px;}'; + css += '.ponyhoof_dialog .bottom .lfloat {line-height:17px;margin-top:4px;}'; + + css += '.ponyhoof_dialog_header {background:#F2F2F2;border:solid #E2E2E2;border-width:1px 0;padding:4px 10px 5px;color:#333;font-size:11px;margin:0 -10px 8px;display:block;font-weight:bold;}'; + css += '.ponyhoof_tabs {padding:4px 10px 0;background:#F2F2F2;border-bottom:1px solid #ccc;margin:-10px -10px 10px;}'; + css += '.ponyhoof_tabs a {margin:3px 10px 0 0;padding:5px 8px;float:left;}'; + css += '.ponyhoof_tabs a.active {color:#333;padding:4px 7px 5px;background:#fff;border:1px solid #ccc;border-bottom:1px solid #fff;margin-bottom:-1px;text-decoration:none;}'; + css += '.ponyhoof_tabs_section {display:none;}'; + + if (ISMOBILE) { + css += '#ponyhoof_welcome_scenery {background-image:none !important;}'; + css += '.ponyhoof_dialog .generic_dialog {position:absolute;}'; + css += '.ponyhoof_menu .uiMenu.overflow {resize:none !important;height:auto !important;}'; + } + + injectManualStyle(css, 'dialog'); + }; + + k.show = function() { + removeClass(k.dialog, 'ponyhoof_fadeout'); + removeClass(k.generic_dialogDiv, 'ponyhoof_fadeout'); + + k.visible = true; + k.dialog.style.display = 'block'; + k.generic_dialogDiv.style.display = 'block'; + + if (ISMOBILE) { + k.canCardspace = false; + } + + if (k.canCardspace) { + w.addEventListener('resize', k.onBodyResize, false); + k.cardSpaceTick(); + } + + if (k.canCloseByEscapeKey) { + d.body.addEventListener('keydown', k.documentEscapeKey, false); + } + }; + + k.close = function(callback) { + k.onclose(); + + if (!userSettings.disable_animation) { + fadeOut(k.dialog, function() { + if (callback) { + callback(); + } + k.onclosefinish(); + }); + if (callback) { + log("Legacy dialog close code found"); + } + + if (ISOPERA) { + fadeOut(k.generic_dialogDiv); + } + } else { + k.dialog.style.display = 'none'; + if (callback) { + callback(); + } + k.onclosefinish(); + } + + k._close(); + }; + + k.hide = function() { + k.onclose(); + + k.dialog.style.display = 'none'; + + k._close(); + }; + + k._close = function() { + k.visible = false; + + w.removeEventListener('resize', k.onBodyResize, false); + w.clearTimeout(k.cardSpaceTimer); + + if (k.cardspaced) { + removeClass(d.documentElement, 'generic_dialog_overflow_mode'); + if (!k.alwaysModal) { + removeClass(k.generic_dialogDiv, 'generic_dialog_modal'); + } + } + removeClass(k.generic_dialogDiv, 'generic_dialog_fixed_overflow'); + k.cardspaced = false; + + d.body.removeEventListener('keydown', k.documentEscapeKey, false); + }; + + k.changeTitle = function(c) { + INTERNALUPDATE = true; + var title = k.dialog.getElementsByTagName('h3'); + if (title.length) { + title = title[0]; + title.innerHTML = c; + } + INTERNALUPDATE = false; + }; + + k.changeContent = function(c) { + INTERNALUPDATE = true; + var content = k.dialog.getElementsByClassName('content'); + if (content.length) { + content = content[0]; + content.innerHTML = c; + } + INTERNALUPDATE = false; + }; + + k.changeBottom = function(c) { + INTERNALUPDATE = true; + var bottom = k.dialog.getElementsByClassName('bottom'); + if (bottom.length) { + bottom = bottom[0]; + bottom.innerHTML = c; + } + INTERNALUPDATE = false; + }; + + k.addCloseButton = function(callback) { + var text = "Close"; + if (CURRENTLANG && CURRENTLANG.close) { + text = CURRENTLANG.close; + } + + var close = ''+text+''; + k.changeBottom(close); + + k.dialog.querySelector('.bottom .uiButton').addEventListener('click', function(e) { + k.close(function() { + if (callback) { + log("Legacy dialog close code found"); + callback(); + } + }); + e.preventDefault(); + }, false); + }; + + k.onBodyResize = function() { + if (k.canCardspace) { + var dialogHeight = k.popup_dialogDiv.clientHeight + 80 + 40; + var windowHeight = w.innerHeight; + + if (dialogHeight > windowHeight) { + if (!k.cardspaced) { + addClass(d.documentElement, 'generic_dialog_overflow_mode'); + if (!k.alwaysModal) { + addClass(k.generic_dialogDiv, 'generic_dialog_modal'); + } + addClass(k.generic_dialogDiv, 'generic_dialog_fixed_overflow'); + + k.cardspaced = true; + } + } else { + if (k.cardspaced) { + removeClass(d.documentElement, 'generic_dialog_overflow_mode'); + if (!k.alwaysModal) { + removeClass(k.generic_dialogDiv, 'generic_dialog_modal'); + } + removeClass(k.generic_dialogDiv, 'generic_dialog_fixed_overflow'); + + k.cardspaced = false; + } + } + } + }; + + k.cardSpaceTick = function() { + if (k.canCardspace && k.visible) { + k.onBodyResize(); + k.cardSpaceTimer = w.setTimeout(k.cardSpaceTick, 500); + } else { + w.clearTimeout(k.cardSpaceTimer); + } + }; + + k.documentEscapeKey = function(e) { + if (k.canCloseByEscapeKey) { + if (e.which == 27 && k.visible) { // esc + k.close(); + e.stopPropagation(); + e.cancelBubble = true; + } + } + }; + + if (DIALOGS[k.id]) { + log("Attempting to recreate dialog ID \""+k.id+"\""); + return DIALOGS[k.id]; + } + DIALOGS[k.id] = k; +}; + +function createSimpleDialog(id, title, message) { + if (DIALOGS[id]) { + DIALOGS[id].show(); + return DIALOGS[id]; + } + + var di = new Dialog(id); + di.create(); + di.changeTitle(title); + di.changeContent(message); + di.addCloseButton(); + + return di; +}; + +function injectSystemStyle() { + var css = ''; + css += '.ponyhoof_show_if_injected {display:none;}'; + css += '.ponyhoof_hide_if_injected {display:block;}'; + css += '.ponyhoof_hide_if_injected.inline {display:inline;}'; + css += 'html.ponyhoof_injected .ponyhoof_show_if_injected {display:block;}'; + css += 'html.ponyhoof_injected .ponyhoof_hide_if_injected {display:none;}'; + css += '.ponyhoof_show_if_loaded {display:none;}'; + css += '.ponyhoof_updater_latest, .ponyhoof_updater_newVersion, .ponyhoof_updater_error {display:none;}'; + + css += '.ponyhoof_fadeout {opacity:0;-webkit-transition:opacity .25s linear;-moz-transition:opacity .25s linear;-o-transition:opacity .25s linear;transition:opacity .25s linear;}'; + css += '.ponyhoof_message {padding:10px;color:#000;font-weight:bold;overflow:hidden;}'; + + css += '.ponyhoof_loading {background:url("//fbstatic-a.akamaihd.net/rsrc.php/v2/y4/x/GsNJNwuI-UM.gif") no-repeat;display:inline-block;width:16px;height:11px;margin:6px 0 0 6px;}'; + css += '.ponyhoof_loading.ponyhoof_show_if_injected {display:none;}'; + css += 'html.ponyhoof_injected .ponyhoof_loading_pony {display:inline-block;}'; + + css += '.uiHelpLink {background:url("data:image/gif;base64,R0lGODlhDAALAJEAANvb26enp////wAAACH5BAEAAAIALAAAAAAMAAsAAAIblI8WkbcswAtAwWVzwoIbSWliBzWjR5abagoFADs=") no-repeat 0 center;display:inline-block;height:9px;width:12px;}'; + + css += '.uiInputLabel + .uiInputLabel {margin-top:3px;}'; + css += '.uiInputLabelCheckbox {float:left;margin:0;padding:0;}'; + css += '.uiInputLabel label {color:#333;display:block;font-weight:normal;margin-left:17px;vertical-align:baseline;}'; + css += '.webkit.mac .uiInputLabel label {margin-left:16px;}'; + css += '.webkit.mac .uiInputLabelCheckbox {margin-top:2px;}'; + + injectManualStyle(css, 'system'); +} + +// http://www.html5rocks.com/en/tutorials/pagevisibility/intro/ +var _hiddenPropCached = ''; +var getHiddenProp = function() { + if (_hiddenPropCached) { + return _hiddenPropCached; + } + + var prefixes = ['webkit', 'moz', 'ms', 'o']; + + if ('hidden' in document) { + _hiddenPropCached = 'hidden'; + return _hiddenPropCached; + } + + for (var i = 0, len = prefixes.length; i < len; i++){ + if ((prefixes[i] + 'Hidden') in document) { + _hiddenPropCached = prefixes[i] + 'Hidden'; + return _hiddenPropCached; + } + } + + return null; +}; +var isPageHidden = function() { + var prop = getHiddenProp(); + if (!prop) { + return false; + } + + return document[prop]; +}; + // http://www.myersdaily.org/joseph/javascript/md5.js +function md5cycle(f,c){var b=f[0],a=f[1],d=f[2],e=f[3],b=ff(b,a,d,e,c[0],7,-680876936),e=ff(e,b,a,d,c[1],12,-389564586),d=ff(d,e,b,a,c[2],17,606105819),a=ff(a,d,e,b,c[3],22,-1044525330),b=ff(b,a,d,e,c[4],7,-176418897),e=ff(e,b,a,d,c[5],12,1200080426),d=ff(d,e,b,a,c[6],17,-1473231341),a=ff(a,d,e,b,c[7],22,-45705983),b=ff(b,a,d,e,c[8],7,1770035416),e=ff(e,b,a,d,c[9],12,-1958414417),d=ff(d,e,b,a,c[10],17,-42063),a=ff(a,d,e,b,c[11],22,-1990404162),b=ff(b,a,d,e,c[12],7,1804603682),e=ff(e,b,a,d,c[13],12,-40341101),d=ff(d,e,b,a,c[14],17,-1502002290),a=ff(a,d,e,b,c[15],22,1236535329),b=gg(b,a,d,e,c[1],5,-165796510),e=gg(e,b,a,d,c[6],9,-1069501632),d=gg(d,e,b,a,c[11],14,643717713),a=gg(a,d,e,b,c[0],20,-373897302),b=gg(b,a,d,e,c[5],5,-701558691),e=gg(e,b,a,d,c[10],9,38016083),d=gg(d,e,b,a,c[15],14,-660478335),a=gg(a,d,e,b,c[4],20,-405537848),b=gg(b,a,d,e,c[9],5,568446438),e=gg(e,b,a,d,c[14],9,-1019803690),d=gg(d,e,b,a,c[3],14,-187363961),a=gg(a,d,e,b,c[8],20,1163531501),b=gg(b,a,d,e,c[13],5,-1444681467),e=gg(e,b,a,d,c[2],9,-51403784),d=gg(d,e,b,a,c[7],14,1735328473),a=gg(a,d,e,b,c[12],20,-1926607734),b=hh(b,a,d,e,c[5],4,-378558),e=hh(e,b,a,d,c[8],11,-2022574463),d=hh(d,e,b,a,c[11],16,1839030562),a=hh(a,d,e,b,c[14],23,-35309556),b=hh(b,a,d,e,c[1],4,-1530992060),e=hh(e,b,a,d,c[4],11,1272893353),d=hh(d,e,b,a,c[7],16,-155497632),a=hh(a,d,e,b,c[10],23,-1094730640),b=hh(b,a,d,e,c[13],4,681279174),e=hh(e,b,a,d,c[0],11,-358537222),d=hh(d,e,b,a,c[3],16,-722521979),a=hh(a,d,e,b,c[6],23,76029189),b=hh(b,a,d,e,c[9],4,-640364487),e=hh(e,b,a,d,c[12],11,-421815835),d=hh(d,e,b,a,c[15],16,530742520),a=hh(a,d,e,b,c[2],23,-995338651),b=ii(b,a,d,e,c[0],6,-198630844),e=ii(e,b,a,d,c[7],10,1126891415),d=ii(d,e,b,a,c[14],15,-1416354905),a=ii(a,d,e,b,c[5],21,-57434055),b=ii(b,a,d,e,c[12],6,1700485571),e=ii(e,b,a,d,c[3],10,-1894986606),d=ii(d,e,b,a,c[10],15,-1051523),a=ii(a,d,e,b,c[1],21,-2054922799),b=ii(b,a,d,e,c[8],6,1873313359),e=ii(e,b,a,d,c[15],10,-30611744),d=ii(d,e,b,a,c[6],15,-1560198380),a=ii(a,d,e,b,c[13],21,1309151649),b=ii(b,a,d,e,c[4],6,-145523070),e=ii(e,b,a,d,c[11],10,-1120210379),d=ii(d,e,b,a,c[2],15,718787259),a=ii(a,d,e,b,c[9],21,-343485551);f[0]=add32(b,f[0]);f[1]=add32(a,f[1]);f[2]=add32(d,f[2]);f[3]=add32(e,f[3])}function cmn(f,c,b,a,d,e){c=add32(add32(c,f),add32(a,e));return add32(c<>>32-d,b)}function ff(f,c,b,a,d,e,g){return cmn(c&b|~c&a,f,c,d,e,g)}function gg(f,c,b,a,d,e,g){return cmn(c&a|b&~a,f,c,d,e,g)}function hh(f,c,b,a,d,e,g){return cmn(c^b^a,f,c,d,e,g)}function ii(f,c,b,a,d,e,g){return cmn(b^(c|~a),f,c,d,e,g)}function md51(f){var txt="";var c=f.length,b=[1732584193,-271733879,-1732584194,271733878],a;for(a=64;a<=f.length;a+=64)md5cycle(b,md5blk(f.substring(a-64,a)));f=f.substring(a-64);var d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(a=0;a>2]|=f.charCodeAt(a)<<(a%4<<3);d[a>>2]|=128<<(a%4<<3);if(55a;a++)d[a]=0}d[14]=8*c;md5cycle(b,d);return b}function md5blk(f){var c=[],b;for(b=0;64>b;b+=4)c[b>>2]=f.charCodeAt(b)+(f.charCodeAt(b+1)<<8)+(f.charCodeAt(b+2)<<16)+(f.charCodeAt(b+3)<<24);return c}var hex_chr="0123456789abcdef".split("");function rhex(f){for(var c="",b=0;4>b;b++)c+=hex_chr[f>>8*b+4&15]+hex_chr[f>>8*b&15];return c}function hex(f){for(var c=0;c>16)+(c>>16)+(b>>16)<<16|b&65535}); + var VERSION = 1.631; + var FRIENDLYNAME = 'P'+'onyh'+'oof'; + var SIG = '['+FRIENDLYNAME+' v'+VERSION+']'; + var DISTRIBUTION = 'userjs'; + + var runMe = true; + var STORAGEMETHOD = 'none'; + var INTERNALUPDATE = false; + var USINGMUTATION = false; + + var CURRENTPONY = null; + var REALPONY = CURRENTPONY; + var BRONYNAME = ''; + var USERID = 0; + var UILANG = 'en_US'; + var CURRENTLANG = {}; + var ISUSINGPAGE = false; + var ISUSINGBUSINESS = false; + + var SETTINGSPREFIX = ''; + var globalSettings = {}; + var GLOBALDEFAULTSETTINGS = { + 'allowLoginScreen':true, + 'runForNewUsers':true, + 'globalSettingsMigrated':false, 'lastUserId':0, 'lastVersion':'' + }; + + var PONIES = [{"code":"trixie","name":"Trixie","users":["trixie"],"menu_title":"The Great and Powerful Trixie demands your attention!","color":["6e98b4","3a7196"],"icon16":"trixie\/icon16_2.png","soundNotif":"trixie\/notif","loadingText":"Performing magic..."},{"code":"twilight","name":"Twilight Sparkle","users":["twilight","spark","tw\u0131l\u0131ght","twilite","twi light","\u0162wilight"],"search":"twilight sparkle|twilightsparkle|princess twilight","menu_title":"To switch to Princess Twilight, go to Misc > Appearance","color":["9f6eb4","7a3a96"],"mane6":true,"loadingText":"Studying friendship..."},{"code":"dash","name":"Rainbow Dash","users":["rainbow","dash"],"search":"rainbow dash|rainbowdash|dashie","color":["6e9db4","3a7796"],"soundNotif":"dash\/notif","mane6":true,"loadingText":"Loading... in ten seconds flat!","successText":"Aww yeah!"},{"code":"pinkie","name":"Pinkie Pie","users":["pink"],"search":"pinkie pie|pinkiepie|pinkamena diane pie","color":["b46e8a","963a5f"],"soundNotif":"pinkie\/notif2","mane6":true,"loadingText":"Come on everypony!"},{"code":"applej","name":"Applejack","users":["apple j","applej"],"search":"applejack|apple jack","color":["b4976e","96703a"],"soundNotif":"applej\/notif2","mane6":true,"loadingText":"Hold on there sugarcube!","successText":"Yeehaw!"},{"code":"flutter","name":"Fluttershy","users":["flutter","flut ter"],"search":"fluttershy|flutter shy","color":["b4ae6e","968e3a"],"soundNotif":"flutter\/notif2","mane6":true,"loadingText":"Screaming...","successText":"Yay!"},{"code":"rarity","name":"Rarity","users":["rarity"],"color":["9b6eb4","763a96"],"soundNotif":"rarity\/notif","mane6":true,"loadingText":"Whining...","seperator":true},{"code":"applebloom","name":"Apple Bloom","users":["appleb","apple b"],"search":"apple bloom|applebloom|cmc|cutie mark crusaders","color":["b46e8d","963a63"],"soundNotif":"applebloom\/notif","loadingText":"Getting her cutie mark...","nocutie":true},{"code":"aloe","name":"Aloe","users":["aloe"],"search":"aloe|spa pony|spa ponies","color":["b46e91","963a68"]},{"code":"babsseed","name":"Babs Seed","users":["babs","seed"],"search":"babs seed|babsseed|cmc|cutie mark crusaders","color":["b4976e","96703a"],"nocutie":true},{"code":"berry","name":"Berry Punch","users":["berry"],"color":["a56eb4","823a96"]},{"code":"bigmac","name":"Big Macintosh","users":["bigmac","big mac"],"search":"bigmacintosh|big macintosh|big mcintosh|bigmcintosh","color":["b46e75","963a43"],"soundNotif":"bigmac\/notif","loadingText":"Saying eeyup..."},{"code":"bonbon","name":"Bon Bon","users":["bon bon","bonbon","bon-bon"],"search":"bon bon|bonbon","color":["6e89b4","3a5d96"]},{"code":"braeburn","name":"Braeburn","users":["braeburn","breaburn"],"search":"braeburn|breaburn","color":["b4a86e","96873a"],"icon16":"braeburn\/icon16_2.png"},{"code":"cadance","name":"Cadance","users":["cadance","cadence"],"search":"cadance|cadence|princess cadance|princess cadence","color":["b46e96","963a6e"]},{"code":"carrot","name":"Carrot Top","users":["golden","carrot"],"search":"carrot top|carrottop|golden harvest","menu_title":"Also known as Golden Harvest","color":["b2b46e","93963a"]},{"code":"celestia","name":"Celestia","users":["celestia","trollestia","molestia"],"search":"celestia|princess celestia","color":["b46e98","963a71"],"loadingText":"Raising the sun..."},{"code":"cheerilee","name":"Cheerilee","users":["cheerilee"],"color":["b46e96","963a6e"]},{"code":"colgate","name":"Colgate","users":["colgate","minuette"],"search":"colgate|minuette|minette","menu_title":"Also known as Minuette","color":["6e99b4","3a7396"],"soundNotif":"colgate\/notif","loadingText":"Brushing..."},{"code":"cloudchaser","name":"Cloudchaser","users":["cloudch","cloud ch"],"search":"cloudchaser|cloud chaser|stormwalker|storm walker","menu_title":"Also known as Stormwalker","color":["856eb4","593a96"]},{"code":"daring","name":"Daring Do","users":["daring"],"search":"daring do|daringdo","color":["b4a76e","96853a"]},{"code":"derpy","name":"Derpy Hooves","users":["derpy"],"color":["b4b46e","96963a"],"fbIndex_swf":"derpy\/fbIndex.swf","soundNotif":"derpy\/notif","loadingText":"Wondering what went wrong..."},{"code":"diamondtiara","name":"Diamond Tiara","users":["tiara"],"search":"diamond tiara|diamondtiara","color":["926eb4","6a3a96"],"stack":"villian"},{"code":"discord","name":"Discord","users":["discord"],"color":["b46f6e","963c3a"],"stack":"villian","loadingText":"CHOCOLATE RAIN","nocutie":true},{"code":"whooves","name":"Doctor Whooves","users":["whooves","time turn"],"search":"doctor whooves|doctor hooves|time turner","menu_title":"Also known as Time Turner","color":["b4a06e","967c3a"]},{"code":"fleur","name":"Fleur De Lis","users":["fleur","fluer"],"search":"fleur de lis|fluer de lis|fleur dis lee|fluer dis lee","color":["b46eb4","963a96"]},{"code":"flimflam","name":"Flim and Flam","users":["flim","flam"],"color":["b0b46e","91963a"],"loadingText":"Giving opportunities..."},{"code":"flitter","name":"Flitter","users":["Flitter"],"color":["846eb4","573a96"]},{"code":"gilda","name":"Gilda","users":["gilda"],"color":["b49a6e","96743a"],"stack":"villian","nocutie":true},{"code":"sombra","name":"King Sombra","users":["sombra"],"color":["6eb46e","3a963a"],"stack":"villian","nocutie":true},{"code":"lightningdust","name":"Lightning Dust","users":["lightning"],"color":["6eb4ad","3a968d"]},{"code":"lotus","name":"Lotus","users":["lotus"],"search":"lotus|spa pony|spa ponies","color":["6ea0b4","3a7c96"]},{"code":"luna","name":"Luna","users":["luna"],"search":"luna|princess luna","color":["6e7eb4","3a5096"],"soundNotif":"luna\/notif","loadingText":"Doubling the fun...","successText":"Huzzah!"},{"code":"lyra","name":"Lyra","users":["lyra"],"search":"lyra heartstrings","color":["6eb49d","3a9677"]},{"code":"nightmaremoon","name":"Nightmare Moon","users":["nightmare"],"search":"nightmare moon|nightmaremoon","color":["6e7fb4","3a5196"],"stack":"villian"},{"code":"nurseredheart","name":"Nurse Redheart","users":["nurse","redheart"],"color":["b46e76","963a45"]},{"code":"octavia","name":"Octavia","users":["octavia"],"color":["b4a76e","96853a"]},{"code":"pinkamena","name":"Pinkamena","users":["pinkamena"],"search":"pinkamena diane pie","color":["b46e8c","963a62"],"stack":"villian"},{"code":"chrysalis","name":"Queen Chrysalis","users":["chrysalis"],"search":"queen chrysalis|changeling","color":["6ea2b4","3a7f96"],"stack":"chrysalis","loadingText":"Feeding...","nocutie":true},{"code":"roidrage","name":"Roid Rage","users":["snowflake","roid","rage"],"search":"snowflake|roidrage|roid rage","menu_title":"Also known as Snowflake","color":["b4ae6e","968e3a"],"soundNotif":"_sound\/roidrage_yeah","successText":"YEAH!"},{"code":"rose","name":"Rose","users":["rose"],"search":"roseluck","menu_title":"Also known as Roseluck","color":["b46e8c","963a62"]},{"code":"scootaloo","name":"Scootaloo","users":["scootaloo"],"search":"scootaloo|cmc|cutie mark crusaders|chicken","color":["b4996e","96733a"],"loadingText":"Getting her cutie mark...","nocutie":true},{"code":"shiningarmor","name":"Shining Armor","users":["shining armor"],"search":"shining armor|shiningarmor","color":["6e7bb4","3a4b96"]},{"code":"silverspoon","name":"Silver Spoon","users":["spoon"],"search":"silver spoon|silverspoon","color":["6e97b4","3a7096"],"stack":"villian"},{"code":"soarin","name":"Soarin'","users":["soarin"],"search":"soarin'|wonderbolts","color":["6e9db4","3a7796"]},{"code":"spike","name":"Spike","users":["spike"],"color":["a26eb4","7f3a96"],"nocutie":true},{"code":"spitfire","name":"Spitfire","users":["spitfire"],"search":"spitfire|wonderbolts","color":["b4ae6e","968e3a"],"icon16":"spitfire\/icon16_2.png"},{"code":"sweetieb","name":"Sweetie Belle","users":["sweetieb","sweetie b"],"search":"sweetiebelle|sweetie belle|cmc|cutie mark crusaders","color":["a06eb4","7c3a96"],"soundNotif":"sweetieb\/notif","loadingText":"Getting her cutie mark...","nocutie":true},{"code":"vinyl","name":"Vinyl Scratch","users":["vinyl","vinyx","dj p"],"search":"vinyl scratch|dj pon3|dj-pon3|dj pon 3|dj pon-3","menu_title":"Also known as DJ Pon-3","color":["6ea9b4","3a8896"],"soundNotif":"vinyl\/notif","loadingText":"Wubbing..."},{"code":"zecora","name":"Zecora","users":["zecora"],"color":["b4af6e","96903a"]},{"code":"blank","name":"(Blank)","color":["b46e6e","963a3a"],"hidden":true,"nocutie":true},{"code":"bloomberg","name":"Bloomberg","color":["9fb46e","7a963a"],"hidden":true,"nocutie":true},{"code":"mono","name":"Mono","color":["b46e6e","963a3a"],"stack":"mono","hidden":true},{"code":"taugeh","name":"Taugeh","color":["b4b46e","96963a"],"hidden":true,"nocutie":true}]; + var LANG = {"af_ZA":{"sniff_comment_tooltip_like":"Hou van hierdie opmerking","sniff_comment_tooltip_unlike":"Hou nie meer van hierdie opmerking nie"},"ar_AR":{"sniff_comment_tooltip_like":"\u0627\u0644\u0625\u0639\u062c\u0627\u0628 \u0628\u0627\u0644\u062a\u0639\u0644\u064a\u0642","sniff_comment_tooltip_unlike":"\u0625\u0644\u063a\u0627\u0621 \u0625\u0639\u062c\u0627\u0628\u064a \u0628\u0647\u0630\u0627 \u0627\u0644\u062a\u0639\u0644\u064a\u0642"},"az_AZ":{"sniff_comment_tooltip_like":"Bu r\u0259yi b\u0259y\u0259n","sniff_comment_tooltip_unlike":"Bu \u015f\u0259rhi b\u0259y\u0259nm\u0259"},"be_BY":{"sniff_comment_tooltip_like":"\u041f\u0430\u0434\u0430\u0431\u0430\u0435\u0446\u0446\u0430","sniff_comment_tooltip_unlike":"\u041c\u043d\u0435 \u0431\u043e\u043b\u044c\u0448 \u043d\u0435 \u043f\u0430\u0434\u0430\u0431\u0430\u0435\u0446\u0446\u0430 \u0433\u044d\u0442\u044b \u043a\u0430\u043c\u044d\u043d\u0442\u0430\u0440"},"bg_BG":{"sniff_comment_tooltip_like":"\u0425\u0430\u0440\u0435\u0441\u0432\u0430\u043c \u0442\u043e\u0437\u0438 \u043a\u043e\u043c\u0435\u043d\u0442\u0430\u0440","sniff_comment_tooltip_unlike":"\u0412\u0435\u0447\u0435 \u043d\u0435 \u0445\u0430\u0440\u0435\u0441\u0432\u0430\u043c"},"bn_IN":{"sniff_comment_tooltip_like":"\u09ae\u09a8\u09cd\u09a4\u09ac\u09cd\u09af\u099f\u09bf \u09ad\u09be\u09b2\u09cb \u09b2\u09c7\u0997\u09c7\u099b\u09c7","sniff_comment_tooltip_unlike":"\u09ad\u09be\u09b2\u09cb \u09b2\u09be\u0997\u09c7\u09a8\u09bf"},"bs_BA":{"sniff_comment_tooltip_like":"Svi\u0111a mi se ovaj komentar","sniff_comment_tooltip_unlike":"Ne svi\u0111a mi se komentar"},"ca_ES":{"sniff_comment_tooltip_like":"M'agrada aquest comentari","sniff_comment_tooltip_unlike":"Ja no m'agrada aquest comentari."},"cs_CZ":{"sniff_comment_tooltip_like":"Tento koment\u00e1\u0159 se mi l\u00edb\u00ed.","sniff_comment_tooltip_unlike":"Koment\u00e1\u0159 se mi u\u017e nel\u00edb\u00ed","close":"Zav\u0159\u00edt"},"cy_GB":{"sniff_comment_tooltip_like":"Hoffi'r sylw hwn","sniff_comment_tooltip_unlike":"Peidio hoffi'r sylw hwn"},"da_DK":{"fb_composer_lessons":"Hvilke lektioner i venskab har du l\u00e6rt idag?","sniff_comment_tooltip_like":"Tilkendegiv, at du synes godt om denne kommentar","sniff_comment_tooltip_unlike":"Synes ikke godt om denne kommentar l\u00e6ngere","close":"Luk"},"de_DE":{"fb_composer_lessons":"Welche Lektionen \u00fcber Freundschaft hast Du heute gelernt?","sniff_comment_tooltip_like":"Dieser Kommentar gef\u00e4llt mir","sniff_comment_tooltip_unlike":"Dieser Kommentar gef\u00e4llt mir nicht mehr","close":"Schlie\u00dfen"},"el_GR":{"sniff_comment_tooltip_like":"\u039c\u03bf\u03c5 \u03b1\u03c1\u03ad\u03c3\u03b5\u03b9 \u03b1\u03c5\u03c4\u03cc \u03c4\u03bf \u03c3\u03c7\u03cc\u03bb\u03b9\u03bf","sniff_comment_tooltip_unlike":"\"\u0394\u03b5\u03bd \u03bc\u03bf\u03c5 \u03b1\u03c1\u03ad\u03c3\u03b5\u03b9!\" \u03b1\u03c5\u03c4\u03cc \u03c4\u03bf \u03c3\u03c7\u03cc\u03bb\u03b9\u03bf"},"en_PI":{"sniff_comment_tooltip_like":"This comment be pleasin","sniff_comment_tooltip_unlike":"Care not fer such trifles"},"en_US":{"fb_composer_lessons":"What lessons in friendship have you learned today?","fb_comment_box":"Write a friendship letter...","fb_search_box":"Search for ponies, places and things","fb_search_boxAlt":"Type to search for ponies, places and things","fb_composer_coolstory":"Write a cool story...","fb_composer_ponies":"Ponies!","fb_composer_ponies_caps":"PONIES!!!","fb_share_tooltip":"Remember! You gotta share... You gotta care...","sniff_comment_tooltip_like":"Like this comment","sniff_comment_tooltip_unlike":"Unlike this comment","sniff_fb_search_boxAlt":"Type to search","close":"Close","reloadNow":"Reload now","notNow":"Not now","invertSelection":"Invert selection","finish":"Finish","done":"Eeyup","options_title":"Ponyhoof Options","options_tabs_main":"General","options_tabs_background":"Background","options_tabs_sounds":"Sounds","options_tabs_extras":"Misc","options_tabs_advanced":"Debug","options_tabs_about":"About","settings_disable_runForNewUsers_explain":"If you enable this, Ponyhoof will not automatically run for other Facebook accounts that did not activate Ponyhoof yet. They can still open Ponyhoof Options to re-enable Ponyhoof if they wish to.","settings_extras_login_bg":"Use alternate background","settings_sounds":"Play sounds (e.g. notifications and dialogs)","settings_sounds_noNotification":"Play sounds (e.g. dialogs)","settings_extras_runForNewUsers_explain":"If you disable this, Ponyhoof will not automatically run for other Facebook accounts that did not activate Ponyhoof yet. They can still open Ponyhoof Options to re-enable Ponyhoof if they wish to.","settings_main_visitPage":"Visit the Ponyhoof page for news and help","settings_main_visitPageBusiness":"Visit the Ponyhoof page for news","settings_sounds_unavailable":"Notification sounds are not available on your browser. Please update your browser if possible.","updater_title":"Update Ponyhoof","costume_tooltip":"Limited to certain characters only"},"eo_EO":{"sniff_comment_tooltip_like":"\u015cati \u0109i tiun komenton","sniff_comment_tooltip_unlike":"Ne plu \u015dati \u0109i tiun komenton"},"es_ES":{"sniff_comment_tooltip_like":"Me gusta este comentario","sniff_comment_tooltip_unlike":"Ya no me gusta este comentario","close":"Cerrar"},"es_LA":{"fb_composer_lessons":"\u00bfQue has aprendido hoy sobre la amistad?","fb_comment_box":"Escribe un reporte de amistad...","sniff_comment_tooltip_like":"Me gusta este comentario","sniff_comment_tooltip_unlike":"Ya no me gusta este comentario","close":"Cerrar"},"et_EE":{"sniff_comment_tooltip_like":"Meeldib see kommentaar","sniff_comment_tooltip_unlike":"Ei meeldi enam"},"eu_ES":{"sniff_comment_tooltip_like":"Iruzkin hau atsegin dut","sniff_comment_tooltip_unlike":"Iruzkin hau desatsegin"},"fa_IR":{"sniff_comment_tooltip_like":"\u0627\u06cc\u0646 \u062f\u06cc\u062f\u06af\u0627\u0647 \u0631\u0627 \u0645\u06cc\u200c\u067e\u0633\u0646\u062f\u0645","sniff_comment_tooltip_unlike":"\u0627\u06cc\u0646 \u062f\u06cc\u062f\u06af\u0627\u0647 \u0631\u0627 \u0646\u067e\u0633\u0646\u062f\u06cc\u062f\u0645"},"fb_LT":{"fb_composer_lessons":"W|-|47 \u00a33550|\\|5 !|\\| |=|2!3|\\||)5|-|!|* |-|4\\\/3 '\/0|_| \u00a334|2|\\|3|) 70|)4'\/?","fb_comment_box":"W|2!73 4 |=|2!3|\\||)5|-|!|* \u00a33773|2...","fb_search_box":"S34|2(|-| |=0|2 |*0|\\|!35, |*\u00a34(35 4|\\||) 7|-|!|\\|95","fb_search_boxAlt":"T'\/|*3 70 534|2(|-| |=0|2 |*0|\\|!35, |*\u00a34(35 4|\\||) 7|-|!|\\|95","fb_composer_coolstory":"W|2!73 4 (00\u00a3 570|2'\/...","fb_composer_ponies":"P0|\\|!35!","fb_composer_ponies_caps":"PONIES!!!","fb_share_tooltip":"R3|\\\/|3|\\\/|83|2! Y0|_| 90774 5|-|4|23... Y0|_| 90774 (4|23...","close":"Alt+F4","reloadNow":"R3\u00a304|) |\\|0vv","notNow":"N07 |\\|0vv","invertSelection":"I|\\|\\\/3|27 53\u00a33(7!0|\\|","finish":"F!|\\|!5|-|","done":"E3'\/|_||*","options_title":"P0|\\|'\/|-|00|= O|*7!0|\\|5","options_tabs_main":"G3|\\|3|24\u00a3","options_tabs_background":"B4(k9|20|_||\\||)","options_tabs_sounds":"S0|_||\\||)5","options_tabs_extras":"M!5(","options_tabs_advanced":"D38|_|9","options_tabs_about":"A80|_|7","settings_disable_runForNewUsers_explain":"I|= '\/0|_| 3|\\|48\u00a33 7|-|!5, P0|\\|'\/|-|00|= vv!\u00a3\u00a3 |\\|07 4|_|70|\\\/|47!(4\u00a3\u00a3'\/ |2|_||\\| |=0|2 07|-|3|2 F4(3800k 4((0|_||\\|75 7|-|47 |)!|) |\\|07 4(7!\\\/473 P0|\\|'\/|-|00|= '\/37. T|-|3'\/ (4|\\| 57!\u00a3\u00a3 0|*3|\\| P0|\\|'\/|-|00|= O|*7!0|\\|5 70 |23-3|\\|48\u00a33 P0|\\|'\/|-|00|= !|= 7|-|3'\/ vv!5|-| 70.","settings_extras_login_bg":"U53 4\u00a373|2|\\|473 84(k9|20|_||\\||)","settings_sounds":"P\u00a34'\/ 50|_||\\||)5 (3.9. |\\|07!|=!(47!0|\\|5 4|\\||) |)!4\u00a3095)","settings_sounds_noNotification":"P\u00a34'\/ 50|_||\\||)5 (3.9. |)!4\u00a3095)","settings_extras_runForNewUsers_explain":"I|= '\/0|_| |)!548\u00a33 7|-|!5, P0|\\|'\/|-|00|= vv!\u00a3\u00a3 |\\|07 4|_|70|\\\/|47!(4\u00a3\u00a3'\/ |2|_||\\| |=0|2 07|-|3|2 F4(3800k 4((0|_||\\|75 7|-|47 |)!|) |\\|07 4(7!\\\/473 P0|\\|'\/|-|00|= '\/37. T|-|3'\/ (4|\\| 57!\u00a3\u00a3 0|*3|\\| P0|\\|'\/|-|00|= O|*7!0|\\|5 70 |23-3|\\|48\u00a33 P0|\\|'\/|-|00|= !|= 7|-|3'\/ vv!5|-| 70.","settings_main_visitPage":"V!5!7 7|-|3 P0|\\|'\/|-|00|= |*493 |=0|2 |\\|3vv5 4|\\||) |-|3\u00a3|*","settings_main_visitPageBusiness":"V!5!7 7|-|3 P0|\\|'\/|-|00|= |*493 |=0|2 |\\|3vv5","settings_sounds_unavailable":"N07!|=!(47!0|\\| 50|_||\\||)5 4|23 |\\|07 4\\\/4!\u00a348\u00a33 0|\\| '\/0|_||2 8|20vv53|2. P\u00a33453 |_||*|)473 '\/0|_||2 8|20vv53|2 !|= |*055!8\u00a33.","updater_title":"U|*|)473 P0|\\|'\/|-|00|=","costume_tooltip":"L!|\\\/|!73|) 70 (3|274!|\\| (|-|4|24(73|25 0|\\|\u00a3'\/","sniff_comment_tooltip_like":"<3"},"fi_FI":{"fb_composer_lessons":"Mit\u00e4 oppeja yst\u00e4vyydest\u00e4 olet oppinut t\u00e4n\u00e4\u00e4n?","sniff_comment_tooltip_like":"Tykk\u00e4\u00e4 t\u00e4st\u00e4 kommentista","sniff_comment_tooltip_unlike":"En tykk\u00e4\u00e4k\u00e4\u00e4n","close":"Sulje"},"fo_FO":{"sniff_comment_tooltip_like":"M\u00e6r d\u00e1mar vi\u00f0merkingina"},"fr_CA":{"fb_composer_lessons":"Quelles le\u00e7ons sur l'amiti\u00e9 avez-vous appris aujourd'hui ?","sniff_comment_tooltip_like":"J\u2019aime ce commentaire","sniff_comment_tooltip_unlike":"Je n\u2019aime plus ce commentaire","close":"Fermer"},"fr_FR":{"fb_composer_lessons":"Quelles le\u00e7ons sur l'amiti\u00e9 avez-vous appris aujourd'hui ?","sniff_comment_tooltip_like":"J\u2019aime ce commentaire","sniff_comment_tooltip_unlike":"Je n\u2019aime plus ce commentaire","close":"Fermer"},"fy_NL":{"sniff_comment_tooltip_like":"Leuke reaksje","sniff_comment_tooltip_unlike":"Ik mei net mear oer dit berjocht"},"ga_IE":{"fb_composer_lessons":"cad ceachtanna i cairdeas ad'fhoghlaim t\u00fa inniu?","sniff_comment_tooltip_like":"L\u00e9irigh gur maith leat an tr\u00e1cht seo","sniff_comment_tooltip_unlike":"N\u00ed maith liom an tr\u00e1cht seo","close":"D\u00fan"},"gl_ES":{"sniff_comment_tooltip_like":"G\u00fastame este comentario","sniff_comment_tooltip_unlike":"Xa non me gusta"},"he_IL":{"fb_composer_lessons":"\u05d0\u05d9\u05dc\u05d5 \u05dc\u05e7\u05d7\u05d9\u05dd \u05d1\u05d9\u05d3\u05d9\u05d3\u05d5\u05ea \u05dc\u05de\u05d3\u05ea \u05d4\u05d9\u05d5\u05dd?","sniff_comment_tooltip_like":"\u05d0\u05d5\u05d4\u05d1 \u05d0\u05ea \u05d4\u05ea\u05d2\u05d5\u05d1\u05d4","sniff_comment_tooltip_unlike":"\u05dc\u05d0 \u05d0\u05d4\u05d1\/\u05d4 \u05d0\u05ea \u05ea\u05d2\u05d5\u05d1\u05d4 \u05d6\u05d5","close":"\u05e1\u05d2\u05d5\u05e8"},"hi_IN":{"sniff_comment_tooltip_like":"\u091f\u093f\u092a\u094d\u092a\u0923\u0940 \u092a\u0938\u0902\u0926 \u0915\u0930\u0947\u0902","sniff_comment_tooltip_unlike":"\u0907\u0938 \u091f\u093f\u092a\u094d\u092a\u0923\u0940 \u0915\u094b \u0928\u093e\u092a\u0938\u0902\u0926 \u0915\u0930\u0947\u0902"},"hr_HR":{"sniff_comment_tooltip_like":"Svi\u0111a mi se ovaj komentar","sniff_comment_tooltip_unlike":"Ne svi\u0111a mi se"},"hu_HU":{"fb_composer_lessons":"Mit tanult\u00e1l ma a bar\u00e1ts\u00e1gr\u00f3l?","sniff_comment_tooltip_like":"Tetszik a bejegyz\u00e9s.","sniff_comment_tooltip_unlike":"M\u00e9gsem tetszik","close":"Bez\u00e1r\u00e1s"},"hy_AM":{"sniff_comment_tooltip_like":"\u0540\u0561\u057e\u0561\u0576\u0565\u056c \u0561\u0575\u057d \u0574\u0565\u056f\u0576\u0561\u0562\u0561\u0576\u0578\u0582\u0569\u0575\u0578\u0582\u0576\u0568","sniff_comment_tooltip_unlike":"\u0549\u0570\u0561\u057e\u0561\u0576\u0565\u056c \u0561\u0575\u057d \u0574\u0565\u056f\u0576\u0561\u0562\u0561\u0576\u0578\u0582\u0569\u0575\u0578\u0582\u0576\u0568"},"id_ID":{"fb_composer_lessons":"Apa pelajaran yang kalian dapat tentang persahabatan hari ini?","sniff_comment_tooltip_like":"Suka komentar ini","sniff_comment_tooltip_unlike":"Tidak suka komentar ini","close":"Tutup"},"is_IS":{"sniff_comment_tooltip_like":"L\u00edkar vi\u00f0 \u00feessi umm\u00e6li","sniff_comment_tooltip_unlike":"L\u00edka ekki vi\u00f0 \u00feessi umm\u00e6li"},"it_IT":{"fb_composer_lessons":"Che cosa hai imparato oggi sull'amicizia?","sniff_comment_tooltip_like":"Di' che ti piace questo commento","sniff_comment_tooltip_unlike":"Di' che non ti piace pi\u00f9 questo commento","close":"Chiudi"},"ja_JP":{"fb_composer_lessons":"\u4eca\u65e5\u306f\u53cb\u60c5\u306b\u3069\u306e\u3088\u3046\u306a\u6559\u8a13\u3092\u5b66\u3073\u307e\u3057\u305f\u304b\uff1f","sniff_comment_tooltip_like":"\u3053\u306e\u30b3\u30e1\u30f3\u30c8\u306f\u3044\u3044\u306d\uff01","sniff_comment_tooltip_unlike":"\u3044\u3044\u306d\uff01\u3092\u53d6\u308a\u6d88\u3059","close":"\u9589\u3058\u308b"},"ka_GE":{"sniff_comment_tooltip_like":"\u10db\u10dd\u10d8\u10ec\u10dd\u10dc\u10d4 \u10d4\u10e1 \u10d9\u10dd\u10db\u10d4\u10dc\u10e2\u10d0\u10e0\u10d8","sniff_comment_tooltip_unlike":"\u10d0\u10e6\u10d0\u10e0 \u10db\u10dd\u10db\u10ec\u10dd\u10dc\u10e1 \u10d4\u10e1 \u10d9\u10dd\u10db\u10d4\u10dc\u10e2\u10d0\u10e0\u10d8"},"km_KH":{"sniff_comment_tooltip_like":"\u1785\u17bc\u179b\u1785\u17b7\u178f\u17d2\u178f \u179c\u17b7\u1785\u17b6\u179a \u1793\u17c1\u17c7","sniff_comment_tooltip_unlike":"\u179b\u17c2\u1784\u1785\u17bc\u179b\u1785\u17b7\u178f\u17d2\u178f\u1798\u178f\u17b7\u1793\u17c1\u17c7"},"ko_KR":{"fb_composer_lessons":"\uc6b0\uc815\uc5d0 \uad00\ud574\uc11c \uc624\ub298 \ubb34\uc5c7\uc744 \ubc30\uc6e0\ub098\uc694?","sniff_comment_tooltip_like":"\uc88b\uc544\uc694","sniff_comment_tooltip_unlike":"\uc88b\uc544\uc694 \ucde8\uc18c","close":"\ub2eb\uae30"},"ku_TR":{"sniff_comment_tooltip_like":"V\u00ea \u015f\u00eerovey\u00ea biecib\u00eene","sniff_comment_tooltip_unlike":"V\u00ea \u015firovey\u00ea neecib\u00eene"},"la_VA":[],"lt_LT":{"fb_composer_lessons":"Kokias \u017einias apie draugyst\u0119 i\u0161mokote \u0161iandien?","sniff_comment_tooltip_like":"Patinka \u0161is komentaras","sniff_comment_tooltip_unlike":"Nepatinka \u0161is komentaras","close":"U\u017edaryti"},"lv_LV":{"sniff_comment_tooltip_unlike":"Koment\u0101rs vairs nepat\u012bk"},"mk_MK":{"fb_composer_lessons":"\u041a\u043e\u0438 \u043b\u0435\u043a\u0446\u0438\u0438 \u0437\u0430 \u043f\u0440\u0438\u0458\u0430\u0442\u0435\u043b\u0441\u0442\u0432\u043e\u0442\u043e \u0434\u043e\u0437\u043d\u0430\u0432\u0442\u0435 \u0434\u0435\u043d\u0435\u0441?","sniff_comment_tooltip_like":"\u041c\u0438 \u0441\u0435 \u0434\u043e\u043f\u0430\u0453\u0430 \u043a\u043e\u043c\u0435\u043d\u0442\u0430\u0440\u043e\u0432","sniff_comment_tooltip_unlike":"\u041d\u0435 \u043c\u0438 \u0441\u0435 \u0434\u043e\u043f\u0430\u0453\u0430","close":"\u0417\u0430\u0442\u0432\u043e\u0440\u0438"},"ml_IN":{"sniff_comment_tooltip_like":"\u0d08 \u0d05\u0d2d\u0d3f\u0d2a\u0d4d\u0d30\u0d3e\u0d2f\u0d02 \u0d07\u0d37\u0d4d\u0d1f\u0d2e\u0d3e\u0d2f\u0d3f"},"ms_MY":{"fb_composer_lessons":"Apakah pelajaran tentang persahabatan yang telah anda pelajari hari ini?","fb_comment_box":"Tuliskan surat persahabatan...","fb_composer_ponies":"Kuda!","fb_composer_ponies_caps":"KUDA!!!","sniff_comment_tooltip_like":"Suka komen ini","sniff_comment_tooltip_unlike":"Tidak suka komen ini","close":"Tutup","options_title":"Opsyen Ponyhoof"},"nb_NO":{"sniff_comment_tooltip_like":"Lik denne kommentaren"},"ne_NP":[],"nl_NL":{"fb_composer_lessons":"Wat heb je vandaag geleerd over vriendschap?","sniff_comment_tooltip_like":"Leuke reactie","sniff_comment_tooltip_unlike":"Reactie niet meer leuk","close":"Sluiten"},"pa_IN":{"sniff_comment_tooltip_like":"\u0a07\u0a39 \u0a1f\u0a3f\u0a71\u0a2a\u0a23\u0a40 \u0a2a\u0a38\u0a70\u0a26 \u0a15\u0a30\u0a4b","sniff_comment_tooltip_unlike":"\u0a07\u0a39 \u0a1f\u0a3f\u0a71\u0a2a\u0a23\u0a40 \u0a28\u0a3e\u0a2a\u0a38\u0a70\u0a26 \u0a15\u0a30\u0a4b|"},"pl_PL":{"fb_composer_lessons":"Czego si\u0119 dzisiaj nauczy\u0142e\u015b o przyja\u017ani?","sniff_comment_tooltip_like":"Polub komentarz","sniff_comment_tooltip_unlike":"Nie lubi\u0119 tego komentarza","close":"Zamknij"},"ps_AF":[],"pt_BR":{"fb_composer_lessons":"Quais li\u00e7\u00f5es sobre amizade voc\u00ea aprendeu hoje?","sniff_comment_tooltip_like":"Curtir este coment\u00e1rio","sniff_comment_tooltip_unlike":"Curtir (desfazer) este coment\u00e1rio","close":"Fechar"},"pt_PT":{"fb_composer_lessons":"Que li\u00e7\u00f5es de amizade voc\u00ea aprendeu hoje?","sniff_comment_tooltip_like":"Gosto deste coment\u00e1rio","sniff_comment_tooltip_unlike":"N\u00e3o gosto deste coment\u00e1rio","close":"Fechar"},"ro_RO":{"fb_composer_lessons":"Ce lec\u0163ii despre prietenie ai \u00eenv\u0103\u0163at ast\u0103zi?","sniff_comment_tooltip_like":"\u00cemi place acest comentariu","sniff_comment_tooltip_unlike":"Nu-mi mai place acest comentariu","close":"\u00cenchide"},"ru_RU":{"fb_composer_lessons":"\u041a\u0430\u043a\u0438\u0435 \u0443\u0440\u043e\u043a\u0438 \u0434\u0440\u0443\u0436\u0431\u044b \u0432\u044b \u0432\u044b\u0443\u0447\u0438\u043b\u0438 \u0441\u0435\u0433\u043e\u0434\u043d\u044f?","sniff_comment_tooltip_like":"\u041c\u043d\u0435 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439","sniff_comment_tooltip_unlike":"\u041d\u0435 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f","close":"\u0417\u0430\u043a\u0440\u044b\u0442\u044c"},"sk_SK":{"fb_composer_lessons":"Ak\u00e9 lekcie priate\u013estva si sa nau\u010dil dnes?","sniff_comment_tooltip_like":"P\u00e1\u010di sa mi tento koment\u00e1r","sniff_comment_tooltip_unlike":"Tento koment\u00e1r sa mi u\u017e nep\u00e1\u010di","close":"Zavrie\u0165"},"sl_SI":{"fb_composer_lessons":"Kaj si se o prijateljstvu nau\u010dil\/-a danes?","sniff_comment_tooltip_like":"V\u0161e\u010d mi je","sniff_comment_tooltip_unlike":"Ta komentar mi ni v\u0161e\u010d","close":"Zapri"},"sq_AL":{"sniff_comment_tooltip_like":"P\u00eblqeje k\u00ebt\u00eb koment","sniff_comment_tooltip_unlike":"Mos p\u00eblqe k\u00ebt\u00eb koment"},"sr_RS":{"sniff_comment_tooltip_like":"\u0421\u0432\u0438\u0452\u0430 \u043c\u0438 \u0441\u0435 \u043a\u043e\u043c\u0435\u043d\u0442\u0430\u0440.","sniff_comment_tooltip_unlike":"\u041d\u0435 \u0441\u0432\u0438\u0452\u0430 \u043c\u0438 \u0441\u0435 \u043e\u0432\u0430\u0458 \u043a\u043e\u043c\u0435\u043d\u0442\u0430\u0440","close":"\u0417\u0430\u0442\u0432\u043e\u0440\u0438"},"sv_SE":{"fb_composer_lessons":"Vilka l\u00e4rdomar i v\u00e4nskap har du l\u00e4rt dig idag?","sniff_comment_tooltip_like":"Gilla den h\u00e4r kommentaren","sniff_comment_tooltip_unlike":"Sluta gilla den h\u00e4r kommentaren","close":"St\u00e4ng"},"sw_KE":[],"ta_IN":{"sniff_comment_tooltip_like":"\u0b87\u0b95\u0bcd\u0b95\u0bb0\u0bc1\u0ba4\u0bcd\u0ba4\u0bbf\u0ba9\u0bc8 \u0bb5\u0bbf\u0bb0\u0bc1\u0bae\u0bcd\u0baa\u0bc1\u0b95\u0bbf\u0bb1\u0bc7\u0ba9\u0bcd","sniff_comment_tooltip_unlike":"\u0b87\u0b95\u0bcd\u0b95\u0bb0\u0bc1\u0ba4\u0bcd\u0ba4\u0bbf\u0ba9\u0bc8 \u0bb5\u0bbf\u0bb0\u0bc1\u0bae\u0bcd\u0baa\u0bb5\u0bbf\u0bb2\u0bcd\u0bb2\u0bc8","close":"\u0e1b\u0e34\u0e14"},"te_IN":{"sniff_comment_tooltip_unlike":"\u0c35\u0c4d\u0c2f\u0c3e\u0c16\u0c4d\u0c2f \u0c28\u0c1a\u0c4d\u0c1a\u0c32\u0c47\u0c26\u0c41"},"th_TH":{"sniff_comment_tooltip_like":"\u0e16\u0e39\u0e01\u0e43\u0e08\u0e04\u0e27\u0e32\u0e21\u0e04\u0e34\u0e14\u0e40\u0e2b\u0e47\u0e19\u0e19\u0e35\u0e49","sniff_comment_tooltip_unlike":"\u0e40\u0e25\u0e34\u0e01\u0e16\u0e39\u0e01\u0e43\u0e08\u0e04\u0e27\u0e32\u0e21\u0e04\u0e34\u0e14\u0e40\u0e2b\u0e47\u0e19\u0e19\u0e35\u0e49"},"tl_PH":{"fb_composer_lessons":"Anong mga aralin sa pagkakaibigan ang natutunan mo ngayon?","sniff_comment_tooltip_like":"Gustuhin ang komentong ito","sniff_comment_tooltip_unlike":"Ayawan ang komentong ito","close":"Isara"},"tr_TR":{"fb_composer_lessons":"Bug\u00fcn arkada\u015fl\u0131kla ilgili neler \u00f6\u011frendin?","sniff_comment_tooltip_like":"Bu yorumu be\u011fen","sniff_comment_tooltip_unlike":"Bu yorumu be\u011fenmekten vazge\u00e7","close":"Kapat"},"uk_UA":{"fb_composer_lessons":"\u042f\u043a\u0456 \u0443\u0440\u043e\u043a\u0438 \u0432 \u0434\u0440\u0443\u0436\u0431\u0456 \u0432\u0438 \u0434\u0456\u0437\u043d\u0430\u043b\u0438\u0441\u044f \u0441\u044c\u043e\u0433\u043e\u0434\u043d\u0456?","sniff_comment_tooltip_like":"\u0412\u043f\u043e\u0434\u043e\u0431\u0430\u0442\u0438 \u043a\u043e\u043c\u0435\u043d\u0442\u0430\u0440","sniff_comment_tooltip_unlike":"\u041d\u0435 \u043f\u043e\u0434\u043e\u0431\u0430\u0454\u0442\u044c\u0441\u044f \u043a\u043e\u043c\u0435\u043d\u0442\u0430\u0440","close":"\u0417\u0430\u043a\u0440\u0438\u0442\u0438"},"vi_VN":{"sniff_comment_tooltip_like":"Th\u00edch b\u00ecnh lu\u1eadn n\u00e0y","sniff_comment_tooltip_unlike":"B\u1ecf th\u00edch b\u00ecnh lu\u1eadn n\u00e0y n\u1eefa"},"zh_CN":{"sniff_comment_tooltip_like":"\u559c\u6b22\u6b64\u8bc4\u8bba","sniff_comment_tooltip_unlike":"\u4e0d\u559c\u6b22\u6b64\u8bc4\u8bba","close":"\u5173\u95ed"},"zh_HK":{"sniff_comment_tooltip_like":"\u5c0d\u9019\u5247\u7559\u8a00\u8b9a\u597d","sniff_comment_tooltip_unlike":"\u53d6\u6d88\u8b9a\u597d"},"zh_TW":{"fb_composer_lessons":"\u4f60\u4eca\u5929\u5f9e\u53cb\u60c5\u88e1\u9762\u5b78\u5230\u4e86\u4ec0\u9ebc\uff1f","sniff_comment_tooltip_like":"\u8aaa\u9019\u5247\u7559\u8a00\u8b9a","sniff_comment_tooltip_unlike":"\u6536\u56de\u8b9a","close":"\u95dc\u9589"}}; + var SOUNDS = {"AUTO":{"name":"(Auto-select)","seperator":true},"_sound\/defaultNotification":{"name":"Casting magic","title":"This will also be used for characters that do not have their own notification sound"},"trixie\/notif":{"name":"Trixie - Watch in awe!"},"dash\/notif":{"name":"Rainbow Dash - Aww yeah!"},"pinkie\/notif2":{"name":"Pinkie Pie - *rimshot*"},"applej\/notif":{"name":"Applejack - Yeehaw!"},"flutter\/notif2":{"name":"Fluttershy - Yay!"},"rarity\/notif":{"name":"Rarity - This is whining!"},"applebloom\/notif":{"name":"Apple Bloom - That'll be four bits"},"bigmac\/notif":{"name":"Big Macintosh - Eeyup"},"colgate\/notif":{"name":"Colgate - Why you don't brush your teeth"},"derpy\/notif":{"name":"Derpy Hooves - I brought you a letter!"},"luna\/notif":{"name":"Luna - Huzzah!"},"_sound\/roidrage_yeah":{"name":"Roid Rage\/Snowflake - YEAH!"},"sweetieb\/notif":{"name":"Sweetie Belle - Oh come on!"},"vinyl\/notif":{"name":"Vinyl Scratch - Yeah!","seperator":true},"twilight\/notif":{"name":"Twilight Sparkle - It's not over yet!"},"_sound\/grin2":{"name":"Fluttershy - *squee*"},"_sound\/dash_dundundun":{"name":"Rainbow Dash - DUN DUN DUN"},"_sound\/dash_egghead":{"name":"Rainbow Dash - I'm an egghead"},"_sound\/pinkie_boring":{"name":"Pinkie Pie - Booooring!"},"_sound\/pinkie_gasp":{"name":"Pinkie Pie - *gasp*"},"_sound\/pinkie_partycannon":{"name":"Pinkie Pie - Party cannon"},"_sound\/pinkie_pinkiepiestyle":{"name":"Pinkie Pie - Pinkie Pie style!"},"_sound\/flutter_woohoo":{"name":"Fluttershy - Woo hoo"},"_sound\/octavia_nevermess":{"name":"Octavia - Never mess with Octavia"},"_sound\/rarity_dumbrock":{"name":"Rarity - Dumb rock!"},"_sound\/rarity_itison":{"name":"Rarity - Oh. It. Is. On!"},"_sound\/rarity_wahaha":{"name":"Rarity - Wahaha!"},"_sound\/vinyl_awyeah":{"name":"Vinyl Scratch - Aw yeah!"},"_sound\/vinyl_mybasscannon":{"name":"Vinyl Scratch - My bass cannon!"},"_sound\/vinyl_wubwubwub":{"name":"Vinyl Scratch - Wubwubwub"},"_sound\/vinyl_wubedubdub":{"name":"Vinyl Scratch - Wubedubdub"},"_sound\/vinyl_yougotwubs":{"name":"Vinyl Scratch - You got wubs"}}; + var SOUNDS_CHAT = {"_sound\/grin2":{"name":"Fluttershy - *squee*"},"_sound\/chat_boing":{"name":"Boing"}}; + var HTMLCLASS_SETTINGS = ['login_bg', 'show_messages_other', 'disable_animation', 'pinkieproof', 'disable_emoticons']; + var DEFAULTSETTINGS = { + 'theme':CURRENTPONY, + 'login_bg':false, 'customBg':null, //'allowLoginScreen':true, + 'sounds':false, 'soundsFile':'AUTO', 'soundsNotifTypeBlacklist':'', 'soundsVolume':1, 'chatSound':true, 'chatSoundFile':'_sound/grin2', + 'show_messages_other':true, 'pinkieproof':false, 'forceEnglish':false, 'disable_emoticons':false, 'randomPonies':'', 'costume': '', //'commentBrohoofed':true, + 'disable_animation':false, 'disableDomNodeInserted':false, //'disableCommentBrohoofed':false, + 'customcss':'', 'debug_dominserted_console':false, 'debug_slow_load':false, 'debug_disablelog':false, 'debug_noMutationObserver':false, 'debug_mutationDebug':false, 'debug_exposed':false, 'debug_betaFacebookLinks':false, //'debug_mutationObserver':false, + //'lastVersion':'' + + //'survivedTheNight', 'chatSound1401', 'randomSettingMigrated' + }; + var STACKS_LANG = [{"stack":"pony","people":"ponies","person":"pony","friend":"pal","friends":"pals","friend_logic":"pal","friends_logic":"pals","like":"brohoof","likes":"brohoofs","unlike":"unbrohoof","like_past":"brohoof","likes_past":"brohoofs","liked":"brohoof'd","liked_button":"brohoof'd","liking":"brohoofing"},{"stack":"chrysalis","people":"changelings","person":"changeling","friend":"prey","friends":"prey","friend_logic":"changeling","friends_logic":"changelings","like":"feed","likes":"feeds","unlike":"unfeed","like_past":"fed on","likes_past":"fed on","liked":"fed on","liked_button":"fed","liking":"feeding"},{"stack":"villian","people":"ponies","person":"changeling","friend":"pal","friends":"pals","friend_logic":"pal","friends_logic":"pals","like":"brohoof","likes":"brohoofs","unlike":"unbrohoof","like_past":"brohoof","likes_past":"brohoofs","liked":"brohoof'd","liked_button":"brohoof'd","liking":"brohoofing"}]; + var CURRENTSTACK = STACKS_LANG[0]; + var COSTUMESX = {"winterwrapup":{"name":"Winter Wrap Up","characters":["twilight","dash","pinkie","applej","flutter","rarity","derpy"]},"nightmarenight":{"name":"Nightmare Night","characters":["twilight","dash","pinkie","applej","flutter","applebloom","bigmac","derpy","luna","scootaloo","spike","sweetieb","zecora"]},"hearthwarming":{"name":"Hearth's Warming","characters":["twilight","dash","pinkie","applej","flutter","rarity"]},"season3premiere":{"name":"Season 3 Premiere","characters":["twilight","rarity"]},"crystal":{"name":"Crystal Pony","characters":["twilight","dash","pinkie","applej","flutter","rarity","cadance"]},"wedding":{"name":"Canterlot Wedding","characters":["sweetieb"]},"coronation":{"name":"Princess Coronation Dresses","characters":["dash","pinkie","applej","flutter","rarity","cadance"]},"princess":{"name":"Princess Twilight Sparkle","characters":["twilight"]}}; + var SOUNDS_NOTIFTYPE = { + poke: {name:"Nuzzles", type:"poke"} + ,like: {name:"Brohoofs", type:"like"} + ,group_activity: {name:"New posts in herds and tags about you", type:"group_activity"} + ,group_r2j: {name:"Herd join requests", type:"group_r2j"} + ,group_added_to_group: {name:"Herd invites from friends", type:"group_added_to_group"} + ,plan_reminder: {name:"Adventure reminders", type:"plan_reminder"} + ,follow_profile: {name:"New followers", type:"follow_profile"} + ,photo_made_profile_pic: {name:"Made your pony pic his/her profile picture", type:"photo_made_profile_pic"} + ,answers_answered: {name:"New answers on the Facebook Help Center", type:"answers_answered"} + + ,app_invite: {name:"Game/app requests", type:"app_invite"} + ,close_friend_activity: {name:"Posts from Close Friends", type:"close_friend_activity"} + ,notify_me: {name:"Page posts that you subscribed to", type:"notify_me"} + + //,fbpage_presence: {name:"Facebook nagging you to post to your page", type:"fbpage_presence"} + ,fbpage_fan_invite: {name:"Page invites from friends", type:"fbpage_fan_invite"} + ,page_new_likes: {name:"New page brohoofs", type:"page_new_likes"} + //,fbpage_new_message: {name:"New private messages on your page", type:"fbpage_new_message"} + }; + + var THEMEURL = w.location.protocol + '//hoof.little.my/files/'; + var THEMECSS = THEMEURL+''; + var THEMECSS_EXT = '.css?userscript_version='+VERSION; + var UPDATEURL = w.location.protocol + '//hoof.little.my/files/update_check.js?' + (+new Date()); + + var PONYHOOF_PAGE = '197956210325433'; + var PONYHOOF_URL = '//'+getFbDomain()+'/Ponyhoof'; + var PONYHOOF_README = '//hoof.little.my/files/_welcome/readme.htm?version='+VERSION+'&distribution='+DISTRIBUTION; + + var _ext_messageId = 0; + var _ext_messageCallback = {}; + + // Chrome + var chrome_sendMessage = function(message, callback) { + if (chrome.extension.sendMessage) { + chrome.extension.sendMessage(message, callback); + } else { + chrome.extension.sendRequest(message, callback); + } + }; + + var chrome_storageFallback = false; + var chrome_getValue = function(name, callback) { + if (chrome.storage && !chrome_storageFallback) { + chrome.storage.local.get(name, function(item) { + if (chrome.runtime && chrome.runtime.lastError) { + // Fallback to old storage method + chrome_storageFallback = true; + chrome_getValue(name, callback); + return; + } + + if (Object.keys(item).length === 0) { + callback(null); + return; + } + callback(item[name]); + }); + return; + } + + try { + chrome_sendMessage({'command':'getValue', 'name':name}, function(response) { + if (response && typeof response.val != 'undefined') { + callback(response.val); + } else { + callback(null); + } + }); + } catch (e) { + dir(e); + getValueError(e); + callback(null); + } + }; + + var chrome_setValue = function(name, val) { + if (chrome.storage && !chrome_storageFallback) { + var toSet = {}; + toSet[name] = val; + chrome.storage.local.set(toSet, function() { + if (chrome.runtime && chrome.runtime.lastError) { + saveValueError(chrome.runtime.lastError); + return; + } + }); + return; + } + + chrome_sendMessage({'command':'setValue', 'name':name, 'val':val}, function() {}); + }; + + var chrome_clearStorage = function() { + if (chrome.storage) { + chrome.storage.local.clear(); + } + chrome_sendMessage({'command':'clearStorage'}, function() {}); + }; + + var chrome_ajax = function(details) { + chrome_sendMessage({'command': 'ajax', 'details': details}, function(response) { + if (response.val == 'success') { + if (details.onload) { + details.onload(response.request); + } + } else { + if (details.onerror) { + details.onerror(response.request); + } + } + }); + }; + + if (ISOPERA) { + if (opera.extension) { + opera.extension.onmessage = function(message) { + if (message.data) { + var response = message.data; + var callback = _ext_messageCallback[response.messageid]; + if (callback) { + callback(response.val); + } + } + } + } + + var opera_getValue = function(name, callback) { + _ext_messageCallback[_ext_messageId] = callback; + opera.extension.postMessage({'command':'getValue', 'messageid':_ext_messageId, 'name':name}); + _ext_messageId += 1; + }; + + var opera_setValue = function(name, val) { + opera.extension.postMessage({'command':'setValue', 'name':name, 'val':val}); + }; + + var opera_clearStorage = function() { + opera.extension.postMessage({'command':'clearStorage'}); + }; + + var opera_ajax = function(details) { + _ext_messageCallback[_ext_messageId] = function(response) { + if (response.val == 'success') { + if (details.onload) { + details.onload(response.request); + } + } else { + if (details.onerror) { + details.onerror(response.request); + } + } + }; + var detailsX = { + 'method': details.method + ,'url': details.url + ,'headers': details.headers + ,'data': details.data + }; + opera.extension.postMessage({'command':'ajax', 'messageid':_ext_messageId, 'details':detailsX}); + _ext_messageId += 1; + }; + } + + if (ISSAFARI) { + if (typeof safari != 'undefined') { + safari.self.addEventListener('message', function(message) { + var data = message.message; + if (data) { + var response = data; + var callback = _ext_messageCallback[message.name]; + if (callback) { + callback(response.val); + } + } + }); + } + + var safari_getValue = function(name, callback) { + _ext_messageId = md5(Math.random().toString()); // safari, you don't know what's message passing/callbacks, do you? + _ext_messageCallback[_ext_messageId] = callback; + safari.self.tab.dispatchMessage('getValue', {'messageid':_ext_messageId, 'name':name}); + //_ext_messageId += 1; + }; + + var safari_setValue = function(name, val) { + safari.self.tab.dispatchMessage('setValue', {'name':name, 'val':val}); + }; + + var safari_clearStorage = function() { + safari.self.tab.dispatchMessage('clearStorage', {}); + }; + + var safari_ajax = function(details) { + _ext_messageId = md5(Math.random().toString()); + _ext_messageCallback[_ext_messageId] = function(response) { + if (response.val == 'success') { + if (details.onload) { + details.onload(response.request); + } + } else { + if (details.onerror) { + details.onerror(response.request); + } + } + }; + var detailsX = { + 'method': details.method + ,'url': details.url + ,'headers': details.headers + ,'data': details.data + }; + safari.self.tab.dispatchMessage('ajax', {'messageid':_ext_messageId, 'details':detailsX}); + //_ext_messageId += 1; + }; + } + + if (ISFIREFOX && typeof self != 'undefined' && typeof self.on != 'undefined') { + self.on('message', function(message) { + var data = message; + if (data) { + var response = data; + var callback = _ext_messageCallback[message.messageid]; + if (callback) { + callback(response.val); + } + } + }); + var xpi_getValue = function(name, callback) { + _ext_messageCallback[_ext_messageId] = callback; + self.postMessage({'command':'getValue', 'messageid':_ext_messageId, 'name':name}); + _ext_messageId += 1; + }; + + var xpi_setValue = function(name, val) { + self.postMessage({'command':'setValue', 'name':name, 'val':val}); + }; + + var xpi_clearStorage = function(name, val) { + self.postMessage({'command':'clearStorage'}); + }; + + var xpi_ajax = function(details) { + _ext_messageCallback[_ext_messageId] = function(response) { + if (response.val == 'success') { + if (details.onload) { + details.onload(response.request); + } + } else { + if (details.onerror) { + details.onerror(response.request); + } + } + }; + var detailsX = { + 'method': details.method + ,'url': details.url + ,'headers': details.headers + ,'data': details.data + }; + self.postMessage({'command':'ajax', 'messageid':_ext_messageId, 'details':detailsX}); + _ext_messageId += 1; + }; + } + + if (typeof w.external != 'undefined' && typeof w.external.mxGetRuntime != 'undefined') { + var maxthonRuntime = w.external.mxGetRuntime(); + + maxthonRuntime.listen('messageContentScript', function(message) { + var data = message; + if (data) { + var response = data; + var callback = _ext_messageCallback[message.messageid]; + if (callback) { + callback(response.val); + } + } + }); + + var mxaddon_ajax = function(details) { + _ext_messageCallback[_ext_messageId] = function(response) { + if (response.val == 'success') { + if (details.onload) { + details.onload(response.request); + } + } else { + if (details.onerror) { + details.onerror(response.request); + } + } + }; + var detailsX = { + 'method': details.method + ,'url': details.url + ,'headers': details.headers + ,'data': details.data + }; + maxthonRuntime.post('messageBackground', {'command':'ajax', 'messageid':_ext_messageId, 'details':detailsX}); + _ext_messageId += 1; + }; + } + + function ajax(obj) { + switch (STORAGEMETHOD) { + case 'greasemonkey': + return GM_xmlhttpRequest(obj); + + case 'chrome': + return chrome_ajax(obj); + + case 'opera': + return opera_ajax(obj); + + case 'safari': + return safari_ajax(obj); + + case 'xpi': + return xpi_ajax(obj); + + case 'mxaddon': + return mxaddon_ajax(obj); + + default: + break; + } + + throw { + responseXML:'' + ,responseText:'' + ,readyState:4 + ,responseHeaders:'' + ,status:-100 + ,statusText:'No GM_xmlhttpRequest support' + }; + } + + function isPonyhoofPage(id) { + if (id == PONYHOOF_PAGE) { + return true; + } + return false; + } + + function capitaliseFirstLetter(string) { + return string.charAt(0).toUpperCase() + string.slice(1); + } + + // Settings + for (var i in HTMLCLASS_SETTINGS) { + if (!DEFAULTSETTINGS[HTMLCLASS_SETTINGS[i]]) { + DEFAULTSETTINGS[HTMLCLASS_SETTINGS[i]] = false; + } + } + //DEFAULTSETTINGS.show_messages_other = true; + if (ISMOBILE) { + DEFAULTSETTINGS.disable_animation = true; + } + + function getValueError(extra) { + if (extra === 'ModuleSystem has been deleted' || extra === 'TypeError: Cannot read property \'sendMessage\' of undefined' || extra === 'ModuleSystem has been deleted' || extra === 'TypeError: Cannot read property \'sendMessage\' of undefined') { + createSimpleDialog('localStorageError_getValueChromeExt', "Ponyhoof derp'd", "Ponyhoof has been disabled/updated recently. Please reload the page in order for Ponyhoof to work properly."); + } else { + createSimpleDialog('localStorageError_getValue', "Ponyhoof derp'd", "Ponyhoof can't load your settings. Please try again later.

If you keep seeing this error, please update to the latest version of Ponyhoof if available and visit the Ponyhoof page for help.

"+extra); + } + + trace(); + } + + function saveValueError(extra) { + var desc = "Ponyhoof can't save your settings. There might be a conflict with another extension installed on your browser. Please try again later.

If you keep seeing this error, please update to the latest version of Ponyhoof if available and visit the Ponyhoof page for help.

"+extra; + createSimpleDialog('localStorageError_saveValue', "Ponyhoof derp'd", desc); + + trace(); + } + + function ponyhoofError(extra) { + createSimpleDialog('ponyhoofError', "Ponyhoof derp'd", "Ponyhoof encountered an internal error. Please try again later and update to the latest version of Ponyhoof if available.

"+extra); + + trace(); + } + + function getValue(name, callback) { + switch (STORAGEMETHOD) { + case 'greasemonkey': + callback(GM_getValue(name)); + break; + + case 'chrome': + chrome_getValue(name, callback); + break; + + case 'opera': + opera_getValue(name, callback); + break; + + case 'safari': + safari_getValue(name, callback); + break; + + case 'xpi': + xpi_getValue(name, callback); + break; + + case 'mxaddon': + callback(w.external.mxGetRuntime().storage.getConfig(name)); + break; + + case 'localstorage': + default: + name = 'ponyhoof_'+name; + callback(w.localStorage.getItem(name)); + break; + } + } + + function saveValue(name, v) { + switch (STORAGEMETHOD) { + case 'greasemonkey': + GM_setValue(name, v); + break; + + case 'chrome': + chrome_setValue(name, v); + break; + + case 'opera': + opera_setValue(name, v); + break; + + case 'safari': + safari_setValue(name, v); + break; + + case 'xpi': + xpi_setValue(name, v); + break; + + case 'mxaddon': + w.external.mxGetRuntime().storage.setConfig(name, v); + break; + + case 'localstorage': + default: + name = 'ponyhoof_'+name; + w.localStorage.setItem(name, v); + break; + } + } + + function loadSettings(callback, opts) { + // opts => prefix, defaultsettings + var opts = opts || {prefix:null}; + var settingsKey = 'settings'; + if (opts.prefix != null) { + settingsKey = opts.prefix+settingsKey; + } else { + settingsKey = SETTINGSPREFIX+settingsKey; + } + if (!opts.defaultSettings) { + opts.defaultSettings = DEFAULTSETTINGS; + } + + try { + getValue(settingsKey, function(s) { + if (s) { + s = JSON.parse(s); + if (!s) { + s = {}; + } + } else { + s = {}; + } + for (var i in opts.defaultSettings) { + if (!s.hasOwnProperty(i)) { + s[i] = opts.defaultSettings[i]; + } + } + callback(s); + }); + } catch (e) { + dir(e); + + var extra = ''; + if (e.message) { + extra = ""+e.message+""; + } else { + extra = ""+e.toString()+""; + } + try { + getValueError(extra); + } catch (e) { + onPageReady(function() { + if (d.body) { + getValueError(extra); + } + }); + } + callback(); + return false; + } + } + + function saveSettings(opts) { + // opts => prefix, settings + var opts = opts || {prefix:null, settings:userSettings}; + var settingsKey = 'settings'; + if (opts.prefix != null) { + settingsKey = opts.prefix+settingsKey; + } else { + settingsKey = SETTINGSPREFIX+settingsKey; + } + var settings = userSettings; + if (opts.settings) { + settings = opts.settings; + } + + try { + saveValue(settingsKey, JSON.stringify(settings)); + return true; + } catch (e) { + dir(e); + + var extra = ''; + if (e.message) { + if (e.message == 'ModuleSystem has been deleted' || e.message == 'TypeError: Cannot read property \'sendMessage\' of undefined') { + createSimpleDialog('localStorageError_setValueChromeExt', "Ponyhoof derp'd", "Ponyhoof has been disabled/updated recently. Please reload the page in order for Ponyhoof to work properly."); + callback(); + return; + } + + extra = ""+e.message+""; + } else { + extra = ""+e.toString()+""; + } + saveValueError(extra); + return false; + } + } + + var saveGlobalSettings = function() { + saveSettings({prefix:'global_', settings:globalSettings}); + }; + + function statTrack(stat) { + var i = d.createElement('iframe'); + i.style.position = 'absolute'; + i.style.top = '-9999px'; + i.style.left = '-9999px'; + i.src = '//hoof.little.my/files/_htm/stat_'+stat+'.htm?version='+VERSION; + d.body.appendChild(i); + } + + // Pony selector + var PonySelector = function(p, param) { + var k = this; + + if (param) { + k.param = param; + } else { + k.param = {}; + } + k.p = p; + k.wrap = null; + k.button = null; + + k.oldPony = CURRENTPONY; + k.customClick = function() {}; + k.customCheckCondition = false; + k.overrideClickAction = false; + + k.menu = null; + k.createSelector = function() { + if (k.menu) { + return k.menu; + } + + k.injectStyle(); + + var currentPonyData = convertCodeToData(CURRENTPONY); + var name = "(Nopony)"; + if (currentPonyData) { + name = currentPonyData.name; + } else if (CURRENTPONY == 'RANDOM') { + name = "(Random)"; + } + + var iu = INTERNALUPDATE; + INTERNALUPDATE = true; + + k.menu = new Menu('ponies_'+p.id, k.p/*, {checkable:true}*/); + k.button = k.menu.createButton(name); + k.menu.alwaysOverflow = true; + k.menu.createMenu(); + k.menu.attachButton(); + + if (k.allowRandom) { + var check = false; + if (CURRENTPONY == 'RANDOM') { + check = true; + } + + k.menu.createMenuItem({ + html: "(Random)" + ,title: "To choose who to randomize, go to the Misc tab" + ,check: check + ,unsearchable: true + ,onclick: function(menuItem, menuClass) { + CURRENTPONY = 'RANDOM'; + + changeThemeSmart('RANDOM'); + userSettings.theme = 'RANDOM'; + saveSettings(); + + menuClass.changeButtonText("(Random)"); + menuClass.changeChecked(menuItem); + menuClass.close(); + + if (k.customClick) { + k.customClick(menuItem, menuClass); + } + } + }); + } + + if (k.allowRandom) { + k.menu.createSeperator(); + } + + if (k.param.feature && k.param.feature != -1) { + k._createItem(PONIES[k.param.feature], true); + k.menu.createSeperator(); + } + + for (var i = 0, len = PONIES.length; i < len; i += 1) { + if (k.param.feature && k.param.feature != -1 && PONIES[k.param.feature].code == PONIES[i].code) { + if (PONIES[i].seperator) { + k.menu.createSeperator(); + } + continue; + } + + var check = false; + if (k.customCheckCondition) { + if (k.customCheckCondition(PONIES[i].code)) { + check = true; + } + } else { + if (PONIES[i].code == CURRENTPONY) { + check = true; + } + } + + k._createItem(PONIES[i], check); + + if (PONIES[i].seperator) { + k.menu.createSeperator(); + } + } + + var img = d.createElement('span'); + img.className = 'ponyhoof_loading ponyhoof_show_if_injected ponyhoof_loading_pony'; + k.menu.wrap.appendChild(img); + + INTERNALUPDATE = iu; + }; + + k._createItem = function(ponyData, check) { + var unsearchable = false; + if (ponyData.hidden) { + unsearchable = true; + } + var menuItem = k.menu.createMenuItem({ + html: ponyData.name + ,title: ponyData.menu_title + ,data: ponyData.code + ,check: check + ,unsearchable: unsearchable + ,searchAlternate: ponyData.search + ,onclick: function(menuItem, menuClass) { + if (!k.overrideClickAction) { + var code = ponyData.code; + CURRENTPONY = code; + + changeThemeSmart(code); + userSettings.theme = code; + saveSettings(); + + menuClass.changeButtonText(ponyData.name); + menuClass.changeChecked(menuItem); + menuClass.close(); + } + + if (k.customClick) { + k.customClick(menuItem, menuClass); + } + } + }); + if (ponyData.hidden) { + addClass(menuItem.menuItem, 'ponyhoof_pony_hidden'); + } + }; + + k.injectStyle = function() { + var css = ''; + css += 'html .ponyhoof_pony_hidden {display:none;}'; + for (var i = 0, len = PONIES.length; i < len; i += 1) { + if (PONIES[i].color) { + css += 'html .ponyhoof_menuitem[data-ponyhoof-menu-data="'+PONIES[i].code+'"]:hover, html .ponyhoof_menuitem[data-ponyhoof-menu-data="'+PONIES[i].code+'"]:active, html .ponyhoof_menuitem[data-ponyhoof-menu-data="'+PONIES[i].code+'"]:focus {background-color:#'+PONIES[i].color[0]+' !important;border-top-color:#'+PONIES[i].color[1]+' !important;border-bottom-color:#'+PONIES[i].color[1]+' !important;}'; + } + } + + injectManualStyle(css, 'ponySelector'); + }; + }; + + // Sounds + var _soundCache = {}; + var PonySound = function(id) { + var k = this; + k.id = id; + + k.sound = d.createElement('audio'); + + // Don't loop sounds for 3 seconds + k.wait = 3; + k.respectSettings = true; + k.respectVolumeSetting = true; + + k._time = 0; + + k.source = ''; + k.changeSource = function(source) { + k.source = source; + }; + + k.changeSourceSmart = function(source) { + if (k.canPlayMp3()) { + source = source.replace(/\.EXT/, '.mp3'); + } else if (k.canPlayOgg()) { + source = source.replace(/\.EXT/, '.ogg'); + } else { + throw new Error("No supported audio formats"); + } + + k.changeSource(source); + }; + + k.play = function() { + if (k.respectSettings) { + if (!userSettings.sounds) { + return; + } + } + + if (k.wait == 0) { + k.continuePlaying(); + return; + } + + // Make sure we aren't playing it on another page already + k._time = Math.floor(Date.now() / 1000); + + //try { + getValue(SETTINGSPREFIX+'soundCache', function(s) { + if (typeof s != 'undefined') { + try { + _soundCache = JSON.parse(s); + } catch (e) { + _soundCache = {}; + } + + if (_soundCache == null) { + _soundCache = {}; + } + + if (_soundCache[k.id]) { + if (_soundCache[k.id]+k.wait <= k._time) { + } else { + return; + } + } + } + + k.continuePlaying(); + }); + //} catch (e) { + // k.continuePlaying(); + //} + }; + + k.continuePlaying = function() { + if (k.wait) { + _soundCache[k.id] = k._time; + saveValue(SETTINGSPREFIX+'soundCache', JSON.stringify(_soundCache)); + } + + if (k.respectVolumeSetting) { + k.sound.volume = userSettings.soundsVolume; + } + k.sound.src = k.source; + k.sound.play(); + }; + + // http://html5doctor.com/native-audio-in-the-browser/ + k.audioTagSupported = function() { + return !!(k.sound.canPlayType); + }; + + k.canPlayMp3 = function() { + return !!k.sound.canPlayType && '' != k.sound.canPlayType('audio/mpeg'); + }; + + k.canPlayOgg = function() { + return !!k.sound.canPlayType && '' != k.sound.canPlayType('audio/ogg; codecs="vorbis"'); + }; + }; + + var ponySounds = {}; + function initPonySound(id, source) { + var source = source || ''; + + if (ponySounds[id]) { + if (source) { + ponySounds[id].changeSourceSmart(source); + } + + return ponySounds[id]; + } + + var sound = new PonySound(id); + + if (!sound.audioTagSupported()) { + throw new Error('No