/*
=============================================================
RichStyle 2.0 Framework beta2
Copyright © 2006-2014 Mohammad Anas Ramadan
http://richstyle.org
anas@richstyle.org
-------------------------------------------------------------
Licensed under Creative Commons License (by-nc-nd) 3.0:
http://creativecommons.org/licenses/by-nc-nd/3.0/
=============================================================
*/
//-----------------------------------------------
// Check Browser Compatibility
//-----------------------------------------------
var valid_Browsers = [
// Browser Name, Browser Version, Layout Engine Name, Layout Engine Version, Real FTP Support, Formal Browser Name.
["arora", "0.10.2", "webkit", "533.3", false, "Arora"],
["chrome", "18.0.1025.151","webkit", "535.19", false, "Chrome"],
["chromium", "18.0.1025.151","webkit", "535.19", false, "Chromium"],
["firefox", "4.0b8", "gecko", "20100101", false, "Firefox"],
["iceweasel", "4.0b8", "gecko", "20100101", false, "IceWeasel"],
["msie", "9.0", "Trident", "5.0", true, "Internet Explorer"],
["konqueror", "4.4", "khtml", "4.4.2", true, "Konqueror"],
["opera", "10.10", "presto", "-----", false, "Opera"],
//["opera", "11.00", "presto", "2.6.37", false, "Opera"],
["seamonkey", "2.1", "Gecko", "20110608", false, "SeaMonkey"],
];
var invalid_Browsers = [
["chrome", "1.0.154.65", "webkit", "525.19", false, "Chrome"],
["epiphany", "2.30.2", "webkit", "531.2", false, "Epiphany"],
["firefox", "4.0b6", "gecko", "20100101", false, "Firefox"],
["galeon", "2.0.6", "gecko", "", false, "Galeon"],
["k-meleon", "1.6.0", "Gecko", "", false, "K-Meleon"],
["navigator", "9.0.0.6", "Gecko", "20080219", false, "Netscape Navigator"],
["midori", "0.2.2", "webkit", "531.2", false, "Midori"],
["msie", "8.0", "Trident", "4.0", true, "Internet Explorer"],
["safari", "5.1.5", "webkit", "534.55.3", false, "Safari"],
["seamonkey", "2.0.13", "Gecko", "20101123", false, "SeaMonkey"],
];
var current_Browser =["chrome", "38.0.2125.101", "webkit", "537.36",];
var valid_Browsers_report = "";
for (var i=0; i < valid_Browsers.length; i++) {
valid_Browsers_report = valid_Browsers_report +
'
'+valid_Browsers[i][5]+' '+ valid_Browsers[i][1]+'';
};
var invalid_Browser_msg = "Sorry, this site requires modern browsers. You have to update your browser to one of the following or later:
" + valid_Browsers_report + "© 2006-2014 Mohαmmαd Anαs Rαmαdαn
";
var browser_compatibility;
for (var i=0; i < valid_Browsers.length; i++) {
if (
valid_Browsers[i][0]==current_Browser[0] &&
valid_Browsers[i][1]<=current_Browser[1]
) {
browser_compatibility = true;
// For testing purposes
// document.write(browser_compatibility+' ');
break;
} else {
browser_compatibility = false;
// For testing purposes
// document.write(browser_compatibility+' ');
}
};
// For testing purposes
// document.write('
'+browser_compatibility+'');
if (browser_compatibility == false) {
// $(function() {$('body').html(invalid_Browser_msg)});
// document.write(invalid_Browser_msg);
// document.write(get_valid_Browsers_report());
}
//-----------------------------------------------
// Events: Actions and Reactions
//-----------------------------------------------
$(function(){
//-----------------------------------------------
// Common Links and Commands
$(window).bind('load',function() {
$('a[href^="http"]').attr('target','_blank');
$('.domain-home').attr('title','Home').attr('href','./');
$('.domain-about').attr('title','About').attr('href','about.php');
$('.domain-documentation').attr('title','Documentation').attr('href','documentation.php');
$('.domain-downloads').attr('title','Downloads').attr('href','downloads.php');
$('.domain-contact').attr('title','Contact').attr('href','contact.php');
$('.domain-donate').attr('title','Donate!').attr('href','https://asnadstore.com/anasr').attr('target','_blank');
$('.domain-legal').attr('title','Legal').attr('href','legal.php');
$('.domain-preferences').attr('title','Preferences').attr('href','preferences.php');
$('.domain-jobs').attr('title','jobs').attr('href','jobs.php');
$('.domain-rss').attr('title','RSS').attr('href','#');
$('.service-twitter').attr('title','Twitter').attr('href','https://twitter.com/richstyle_org').attr('target','_blank');
$('.service-linkedin').attr('title','LinkedIn').attr('href','http://www.linkedin.com/groups/RichStyle-4148598').attr('target','_blank');
$('.service-identica').attr('title','Identica').attr('href','https://identi.ca/richstyle').attr('target','_blank');
$('.service-facebook').attr('title','Facebook').attr('href','https://facebook.com/').attr('target','_blank');
$('.standard-richstyle').attr('title','RichStyle Powered').attr('href','http://richstyle.org/').attr('target','_blank');
$('.standard-HTML5').attr('title','HTML5 Logo').attr('target','_blank');
$('.standard-HTML5-Semantics').attr('title','Semantics').attr('href','http://validator.w3.org/check/referer').attr('target','_blank');
$('.standard-HTML5-Styling').attr('title','Styling').attr('href','http://jigsaw.w3.org/css-validator/check/referer?profile=css3').attr('target','_blank');
$('.standard-HTML5-Performance').attr('title','Performance').attr('href','http://developers.google.com/speed/pagespeed/insights/?url=').attr('target','_blank');
$('.standard-HTML5-Device-Access').attr('title','Device Access').attr('href','http://validator.w3.org/mobile/').attr('target','_blank');
$('.standard-HTML5-Connectivity').attr('title','Connectivity').attr('target','_blank');
$('.standard-HTML5-MultiMedia').attr('title','MultiMedia').attr('target','_blank');
$('.standard-HTML5-Offline-Storage').attr('title','Offline Storage').attr('target','_blank');
$('.standard-HTML5-3D-Effects').attr('title','3D Effects').attr('target','_blank');
$('[rel="license"]').attr('title','License').attr('href','http://creativecommons.org/licenses/by-nc-nd/3.0/').attr('target','_blank');
$('.domain-ftp').attr('title','FTP');
$('input[type="search"] ~ button[type="submit"]').attr('title','Search');
$('.page-fullscreen').attr('title','FullScreen');
$('.domain-menu').attr('title','Menu');
$('.page-refresh').attr('title','Refresh');
$('.page-print').attr('title','Print');
$('.page-go-top').attr('title','Top').fadeOut('0');
$('.page-bookmark').attr('title','Add to Bookmarks');
$('button[type="reset"]').attr('title','Close');
$('aside a').attr('rel','nofollow');
$('footer a:not([rel="license"])').attr('rel','nofollow');
// Context variables
$('.valid_Browsers_report').html(valid_Browsers_report);
$('.current_Browser_0').text(current_Browser[0]);
$('.current_Browser_1').text(current_Browser[1]);
$('.current_Browser_2').text(current_Browser[2]);
$('.current_Browser_3').text(current_Browser[3]);
$('.navigator_appCodeName').text(navigator.appCodeName);
$('.navigator_appName').text(navigator.appName);
$('.navigator_appVersion').text(navigator.appVersion);
$('.navigator_userAgent').text(navigator.userAgent);
$('.navigator_platform').text(navigator.platform);
$('.navigator_userLanguage').text(navigator.userLanguage);
$('.navigator_Language').text(navigator.Language);
});
//-----------------------------------------------
// Toggle Full Screen
$('.page-fullscreen').bind('click',function() {
$('body > header').toggle(500);
$('nav.menu').toggle(500);
$('aside').toggle(500);
});
//-----------------------------------------------
// Toggle Menu
$('.domain-menu').bind('click',function() {
$('nav.menu').toggle(500);
$('main').toggle(500);
});
//-----------------------------------------------
// Print
$('.page-print').bind('click',function() {
print();
});
//-----------------------------------------------
// Refresh
$('.page-refresh').bind('click',function() {
window.location.reload(false);
});
//-----------------------------------------------
// Add to Bookmarks
$(window).bind('load',function() {
// This button wouldn't work under WebKit, so it's disabled.
if (current_Browser[2] == 'webkit') {$('.page-bookmark').hide();}
});
$('.page-bookmark').bind('click',function() {
var pageURL = window.location.href;
var pageTitle = document.title;
if (current_Browser[2] == 'gecko') {window.sidebar.addPanel(pageTitle, pageURL, '');}
if (current_Browser[2] == 'khtml') {window.sidebar.addPanel(pageTitle, pageURL, '');}
if (current_Browser[2] == 'presto') {$(this).attr('rel','sidebar').attr('href',pageURL).attr('title',pageTitle);}
if (current_Browser[2] == 'trident') {window.external.AddFavorite(pageURL, pageTitle);}
});
//-----------------------------------------------
// Go To Top
$(window).scroll(function () {
if ($(this).scrollTop() != 0) {$(".page-go-top").fadeIn(500);}
else {$(".page-go-top").fadeOut(500);}
});
$('.page-go-top').bind('click',function() {
$('html, body').animate({ scrollTop: '0' }, '500');
});
//-----------------------------------------------
// Image Zoom
// $('img:after').css('content','attr(alt)');
// $('img[src*="thmb"]').css('cursor','pointer');
// $('img[src*="thmb"]').attr('title','Zoom in');
// $('img[src*="thmb"]').bind('click',function() {});
//-----------------------------------------------
// Toggle Filelist Mode (HTTP vs FTP)
$('.domain-ftp').bind('click',function() {
$('.filelist table').toggle('500');
$('.filelist iframe').toggle('500');
});
//-----------------------------------------------
// Vote
$('#voteForm').bind('submit',function() {
$('#voteForm').css('visibility','hidden');
$('#voteForm input').css('visibility','hidden');
$('#voteForm meter').css('display','table-cell');
$('#voteForm').fadeOut('500');
$('#voteForm').fadeIn('500');
$('#voteForm').css('visibility','visible');
});
//-----------------------------------------------
});
//-----------------------------------------------
// Show online visitors on browser's status bar
//-----------------------------------------------
window.status = "Online visitors: ";