$support = $key . "w/pl"; } } return $support ? $support : "n/a"; } // cache if (filemtime("data.json") <= time() - 86400 * 7) { $data = json_decode(file_get_contents("https://raw.github.com/Fyrd/caniuse/master/data.json")); $arr = array(); foreach ($data->data as $key => $val) { $title = $val->title; $url = "http://caniuse.com/#feat=" . $key; $description = $val->description; $stats = array(); foreach ($val->stats as $browser => $stat) { $stats[$browser] = browserVersion($val->stats->{$browser}); } $arr[] = array("url" => $url, "title" => $title, "description" => str_replace("—", "-", html_entity_decode(trim(str_replace("\n", " ", strip_tags($val->description))))), "stats" => "[IE:{$stats['ie']}, FF:{$stats['firefox']}, GC:{$stats['chrome']}, S:{$stats['safari']}]"); } if (count($arr)) { file_put_contents("data.json", json_encode($arr)); } } if (!isset($query)) { $query = urlencode("css"); } $data = json_decode(file_get_contents("data.json")); $extras = array(); $extras2 = array(); $found = array(); // Fix bug #6
function isBrowserSafari($version = false) { if ($version) { return browserDetect('Safari/') and browserVersion() >= $version; } return browserDetect('Safari/'); }
function load() { $this->addMoreHeaders(JavaScript("var ta;\nvar skin = '" . $this->_name . "';\n")); $this->addMoreHeaders(JavaScript('', array('src' => $this->_findData("wikibits.js")))); if (isBrowserIE()) { $ver = browserVersion(); if ($ver > 5.1 and $ver < 5.9) { $this->addMoreHeaders($this->_CSSlink(0, $this->_findFile('IE55Fixes.css'), 'all')); } elseif ($ver > 5.5 and $ver < 7.0) { $this->addMoreHeaders($this->_CSSlink(0, $this->_findFile('IE60Fixes.css'), 'all')); } elseif ($ver >= 7.0) { $this->addMoreHeaders($this->_CSSlink(0, $this->_findFile('IE70Fixes.css'), 'all')); } else { $this->addMoreHeaders($this->_CSSlink(0, $this->_findFile('IE50Fixes.css'), 'all')); } unset($ver); $this->addMoreHeaders("\n"); $this->addMoreHeaders(JavaScript('', array('src' => $this->_findData("IEFixes.js")))); $this->addMoreHeaders("\n"); $this->addMoreHeaders(HTML::Raw('<meta http-equiv="imagetoolbar" content="no" />')); } $this->addMoreAttr('body', "class-ns-0", HTML::Raw('class="ns-0"')); // CSS file defines fonts, colors and background images for this // style. The companion '*-heavy.css' file isn't defined, it's just // expected to be in the same directory that the base style is in. // This should result in phpwiki-printer.css being used when // printing or print-previewing with style "PhpWiki" or "MacOSX" selected. $this->setDefaultCSS('PhpWiki', array('' => 'monobook.css', 'print' => 'commonPrint.css')); // This allows one to manually select "Printer" style (when browsing page) // to see what the printer style looks like. $this->addAlternateCSS(_("Printer"), 'commonPrint.css', 'print, screen'); $this->addAlternateCSS(_("Top & bottom toolbars"), 'phpwiki-topbottombars.css'); $this->addAlternateCSS(_("Modern"), 'phpwiki-modern.css'); /** * The logo image appears on every page and links to the HomePage. */ $this->addImageAlias('logo', 'MonoBook-Logo.png'); //$this->addImageAlias('logo', WIKI_NAME . 'Logo.png'); /** * The Signature image is shown after saving an edited page. If this * is set to false then the "Thank you for editing..." screen will * be omitted. */ $this->addImageAlias('signature', "Signature.png"); // Uncomment this next line to disable the signature. $this->addImageAlias('signature', false); /* * Link icons. */ /* $this->setLinkIcon('http'); $this->setLinkIcon('https'); $this->setLinkIcon('ftp'); $this->setLinkIcon('mailto'); //$this->setLinkIcon('interwiki'); */ $this->setLinkIcon('wikiuser'); //$this->setLinkIcon('*', 'url'); // front or after //$this->setLinkIconAttr('after'); //$this->setButtonSeparator("\n | "); /** * WikiWords can automatically be split by inserting spaces between * the words. The default is to leave WordsSmashedTogetherLikeSo. */ //$this->setAutosplitWikiWords(false); /** * Layout improvement with dangling links for mostly closed wiki's: * If false, only users with edit permissions will be presented the * special wikiunknown class with "?" and Tooltip. * If true (default), any user will see the ?, but will be presented * the PrintLoginForm on a click. */ $this->setAnonEditUnknownLinks(false); /* * You may adjust the formats used for formatting dates and times * below. (These examples give the default formats.) * Formats are given as format strings to PHP strftime() function See * http://www.php.net/manual/en/function.strftime.php for details. * Do not include the server's zone (%Z), times are converted to the * user's time zone. */ $this->setDateFormat("%B %d, %Y"); $this->setTimeFormat("%H:%M"); /* * To suppress times in the "Last edited on" messages, give a * give a second argument of false: */ //$this->setDateFormat("%B %d, %Y", false); }
function isBrowserOpera($version = false) { if ($version) { return browserDetect('Opera/') and browserVersion() >= $version; } return browserDetect('Opera/'); }