JavaScript Feature Detection in Drupal Behavior

JavaScript Feature Detection in Drupal Behavior

بيع اسهم وربه This is a very lightweight way to add feature detection to your Drupal site. Add this Javascript file to your theme and then include it in your theme.info file for the best results. 

مراجعة الروبوت خيار ثنائي

http://bpsca.net/?kisel=%D8%A7%D9%84%D9%85%D8%AF%D9%8A%D9%86%D9%87-%D9%84%D9%84%D8%A7%D8%B3%D9%87%D9%85-%D8%B9%D9%85%D8%A7%D9%86&a5c=6b The file adds a Drupal Behaviour that adds classes to the HTML tag of the page so that you can interact better with the users browser. 

الأسهم خيار ثنائي

http://theshopsonelpaseo.com/?syzen=%D8%AA%D8%AF%D8%A7%D9%88%D9%84-%D8%A7%D8%B3%D9%87%D9%85-%D8%A7%D9%84%D9%8A%D9%88%D9%88%D9%88%D9%88%D9%85&1c1=e8 The features this detects are listed below: 

http://parts.powercut.co.uk/?risep=%D8%A7%D9%84%D8%AE%D9%8A%D8%A7%D8%B1%D8%A7%D8%AA-%D8%A7%D9%84%D8%AB%D9%86%D8%A7%D8%A6%D9%8A%D8%A9-%D8%AA%D8%B3%D8%A7%D8%B9%D8%AF&8ef=81
  • Flash 
  • Sliverlight 
  • PDF 
  • QuickTime 
  • Windows Media Player 
  • Shockwave 
  • RealPalayer 
  • Java 

http://chrisdrake.net/?kilko=%D8%A7%D8%B9%D9%84%D9%89-%D8%B3%D8%B9%D8%B1-%D9%84%D9%84%D8%B0%D9%87%D8%A8-%D9%81%D9%8A-%D8%A7%D9%84%D8%B3%D8%B9%D9%88%D8%AF%D9%8A%D8%A9&6ac=8f This is also available to download from my GitHub account. 

موقع انترنت

اتبع الموقع (function($) { Drupal.behaviors.featureDetection = {}; Drupal.behaviors.featureDetection.results = {}; Drupal.behaviors.featureDetection.pluginList = { flash: { activex: "ShockwaveFlash.ShockwaveFlash", plugin: /flash/gim, name: "flash" }, sl: { activex: ["AgControl.AgControl"], plugin: /silverlight/gim, name: "sl" }, pdf: { activex: "PDF.PdfCtrl", plugin: /adobe\s?acrobat/gim, name: "pdf" }, qtime: { activex: "QuickTime.QuickTime", plugin: /quicktime/gim, name: "qtime" }, wmp: { activex: "WMPlayer.OCX", plugin: /(windows\smedia)|(Microsoft)/gim, name: "wmp" }, shk: { activex: "SWCtl.SWCtl", plugin: /shockwave/gim, name: "shk" }, rp: { activex: "RealPlayer", plugin: /realplayer/gim, name: "rp" }, java: { activex: navigator.javaEnabled(), plugin: /java/gim, name: "java" } }; Drupal.behaviors.featureDetection.isSupported = function(p) { if (window.ActiveXObject) { try { new ActiveXObject(Drupal.behaviors.featureDetection.pluginList[p].activex); Drupal.behaviors.featureDetection.results[p] = true; } catch (e) { Drupal.behaviors.featureDetection.results[p] = false; } } else { $.each(navigator.plugins, function() { if (this.name.match(Drupal.behaviors.featureDetection.pluginList[ p].plugin)) { Drupal.behaviors.featureDetection.results[p] = true; return false; } else { Drupal.behaviors.featureDetection.results[p] = false; } }); } }; $.each(Drupal.behaviors.featureDetection.pluginList, function(i, n) { Drupal.behaviors.featureDetection.isSupported(i); }); $.each(Drupal.behaviors.featureDetection.results, function(i, n) { $('html').addClass(i + '-' + n); }); })(jQuery);

Comment

By submitting this form, you accept the Mollom privacy policy.