/*
=============================================================
RichStyle 2.0 Framework beta2
Copyright © 2006-2015 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 =["firefox", "55.0", "gecko", "20100101",];
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-2017 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('href','./');
$('.domain-downloads').attr('href','downloads.php');
$('.domain-contact').attr('href','contact.php');
$('.domain-donate').attr('href','donate.php');
$('.domain-preferences').attr('href','preferences.php');
$('.domain-jobs').attr('href','jobs.php');
$('.domain-rss').attr('href','#');
$('.service-twitter').attr('href','https://twitter.com/richstyle_org').attr('target','_blank');
$('.service-linkedin').attr('href','https://www.linkedin.com/in/anasrm').attr('target','_blank');
$('.service-identica').attr('href','https://identi.ca/richstyle').attr('target','_blank');
$('.service-facebook').attr('href','https://facebook.com/').attr('target','_blank');
$('.standard-richstyle').attr('href','http://richstyle.org/').attr('target','_blank');
$('.standard-HTML5').attr('target','_blank');
$('.standard-HTML5-Semantics').attr('href','http://validator.w3.org/check/referer').attr('target','_blank');
$('.standard-HTML5-Styling').attr('href','http://jigsaw.w3.org/css-validator/check/referer?profile=css3').attr('target','_blank');
$('.standard-HTML5-Performance').attr('href','http://developers.google.com/speed/pagespeed/insights/?url=').attr('target','_blank');
$('.standard-HTML5-Device-Access').attr('href','http://validator.w3.org/mobile/').attr('target','_blank');
$('.standard-HTML5-Connectivity').attr('target','_blank');
$('.standard-HTML5-MultiMedia').attr('target','_blank');
$('.standard-HTML5-Offline-Storage').attr('target','_blank');
$('.standard-HTML5-3D-Effects').attr('target','_blank');
$('[rel="license"]').attr('href','http://creativecommons.org/licenses/by-nc-nd/3.0/').attr('target','_blank');
$('.page-go-top').fadeOut('0');
$('.domain-ftp').attr('href','ftp://#');
$('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);
// lang(en)
$('.domain-home:lang(en)').attr('title','Home');
$('.domain-about:lang(en)').attr('title','About').attr('href','about.php');
$('.domain-documentation:lang(en)').attr('title','Documentation').attr('href','documentation.php');
$('.domain-downloads:lang(en)').attr('title','Downloads');
$('.domain-contact:lang(en)').attr('title','Contact');
$('.domain-donate:lang(en)').attr('title','Donate!');
$('.domain-legal:lang(en)').attr('title','Legal').attr('href','legal.php');
$('.domain-preferences:lang(en)').attr('title','Preferences');
$('.domain-jobs:lang(en)').attr('title','jobs');
$('.domain-rss:lang(en)').attr('title','RSS');
$('nav.toolbar input[type="search"]:lang(en)').attr('placeholder','Search');
$('.dialog-close:lang(en)').attr('title','Close');
$('.service-twitter:lang(en)').attr('title','Twitter');
$('.service-linkedin:lang(en)').attr('title','LinkedIn');
$('.service-identica:lang(en)').attr('title','Identica');
$('.service-facebook:lang(en)').attr('title','Facebook');
$('.standard-richstyle:lang(en)').attr('title','RichStyle Powered');
$('.standard-HTML5:lang(en)').attr('title','HTML5 Logo');
$('.standard-HTML5-Semantics:lang(en)').attr('title','Semantics');
$('.standard-HTML5-Styling:lang(en)').attr('title','Styling');
$('.standard-HTML5-Performance:lang(en)').attr('title','Performance');
$('.standard-HTML5-Device-Access:lang(en)').attr('title','Device Access');
$('.standard-HTML5-Connectivity:lang(en)').attr('title','Connectivity');
$('.standard-HTML5-MultiMedia:lang(en)').attr('title','MultiMedia');
$('.standard-HTML5-Offline-Storage:lang(en)').attr('title','Offline Storage');
$('.standard-HTML5-3D-Effects:lang(en)').attr('title','3D Effects');
$('[rel="license"]:lang(en)').attr('title','License');
$('.page-go-top:lang(en)').attr('title','Top');
$('.domain-ftp:lang(en)').attr('title','FTP');
$('input[type="search"] ~ button[type="submit"]:lang(en)').attr('title','Search');
$('.page-fullscreen:lang(en)').attr('title','FullScreen');
$('.domain-menu:lang(en)').attr('title','Menu');
$('.page-refresh:lang(en)').attr('title','Refresh');
$('.page-print:lang(en)').attr('title','Print');
$('.page-bookmark:lang(en)').attr('title','Add to Bookmarks');
$('.filelist h1:lang(en)').html('Downloads');
$('.contact h1:lang(en)').html('Contact me');
$('.donate h1:lang(en)').html('Donate!');
$('.filelist th:nth-child(2) a:lang(en)').html('File Name');
$('.filelist th:nth-child(3) a:lang(en)').html('Size');
$('.filelist th:nth-child(4) a:lang(en)').html('Type');
$('.filelist th:nth-child(5) a:lang(en)').html('Last Update');
$('.filelist th:nth-child(6):lang(en)').html('What’s New?');
$('.filelist th:nth-child(6):lang(en)').attr('title','Updated within the last 14 days');
$('label[for="uname"]:lang(en)').html('Your Name:');
$('label[for="umail"]:lang(en)').html('Your E-Mail:');
$('label[for="uemail"]:lang(en)').html('Your E-Mail:');
$('label[for="subject"]:lang(en)').html('Subject:');
$('label[for="message"]:lang(en)').html('Message:');
$('#uname:lang(en)').attr('placeholder','Enter your name');
$('#umail:lang(en)').attr('placeholder','Enter your email address');
$('#uemail:lang(en)').attr('placeholder','Enter your email address');
$('#subject:lang(en)').attr('placeholder','Enter a subject');
$('#message:lang(en)').attr('placeholder','Write a message');
$('button[type="reset"].succeeded:lang(en)').html('Your message has been sent successfully!');
$('button[type="reset"]:lang(en)').attr('title','Close');
$('.contact button[type="submit"]:lang(en)').html('Submit');
$('.social-stats header:lang(en)').html('Social Stats');
$('.ads header:lang(en)').html('Ads');
$('#MailingList header:lang(en)').html('Join My Mailinglist');
$('#MailingList button[type="submit"]:lang(en)').html('Subscribe');
$('.donate > p:lang(en)').html('Thanks for your support!');
$('label[for="os0"]:lang(en)').html('Amount:');
$('label[for="os1"]:lang(en)').html('Comment:');
$('input[name="os1"]:lang(en)').attr('placeholder','Write a comment');
$('.donate button[type="submit"]:lang(en)').html('Donate!');
$('[class^="http-error"] p:lang(en)').html('Sorry, you will be directed to the home page within seconds.');
$('.http-error-401 header:lang(en)').text('Error 401');
$('.http-error-403 header:lang(en)').text('Error 403');
$('.http-error-404 header:lang(en)').text('Error 404');
$('.http-error-405 header:lang(en)').text('Error 405');
$('.http-error-500 header:lang(en)').text('Error 500');
$('.http-error-401 h1:lang(en)').text('Authorization Required!');
$('.http-error-403 h1:lang(en)').text('Forbidden!');
$('.http-error-404 h1:lang(en)').text('Page Not Found!');
$('.http-error-405 h1:lang(en)').text('Method Not Allowed!');
$('.http-error-500 h1:lang(en)').text('Internal Server Error');
// lang(en)
$('header.demo:lang(en)').html('Demo');
$('a.demo-web:lang(en)').html('Demo Web Page').attr('href','demo-web.php');
$('a.demo-doc:lang(en)').html('Demo Document').attr('href','demo-doc.php');
$('a.demo-font:lang(en)').html('RichStyle Font').attr('href','font.php');
$('header.web-standards:lang(en)').html('Web Standards');
$('a.web-standards-intro:lang(en)').html('Introduction').attr('href','web-standards.php');
$('a.html5-quick-reference:lang(en)').html('HTML5 Quick Reference').attr('href','html5-quick-reference.php');
$('a.css3-quick-reference:lang(en)').html('CSS3 Quick Reference').attr('href','css3-quick-reference.php');
$('a.check-boxes-and-radio-buttons-in-html6:lang(en)').html('Check Boxes and Radio Buttons in HTML6').attr('href','a-proposal-for-representing-check-boxes-and-radio-buttons-in-html6.php');
$('header.software-engineering:lang(en)').html('Software Engineering');
$('a.software-engineering-intro:lang(en)').html('Introduction').attr('href','software-engineering.php');
$('a.icon-standardization-for-web-applications:lang(en)').html('Icon Standardization for Web Applications').attr('href','icon-standardization-for-web-applications.php');
$('a.algorithmic-usability-measurement:lang(en)').html('Algorithmic Usability Measurement').attr('href','algorithmic-usability-measurement.php');
$('a.richstyle-software-process:lang(en)').html('Richstyle Software Process').attr('href','richstyle-software-process.php');
$('header.foss-licenses:lang(en)').html('FOSS Licenses');
$('a.foss-licenses-intro:lang(en)').html('Introduction').attr('href','foss-licenses.php');
$('a.gnu-gpl2:lang(en)').html('GNU GPL 2.0').attr('href','gnu-gpl2.php');
$('a.affero-gpl1:lang(en)').html('Affero GPL 1.0').attr('href','affero-gpl1.php');
$('a.apache2-license:lang(en)').html('Apache 2 License').attr('href','apache2-license.php');
$('a.bsd-license:lang(en)').html('BSD License').attr('href','bsd-license.php');
$('a.mit-license:lang(en)').html('MIT License').attr('href','mit-license.php');
$('a.w3c-notice-and-license:lang(en)').html('W3C Notice and License').attr('href','w3c-notice-and-license.php');
$('a.debian-social-contract:lang(en)').html('Debian Social Contract').attr('href','debian-social-contract.php');
$('a.gnu-fdl-12:lang(en)').html('GNU FDL 1.2').attr('href','gnu-fdl-1.2.php');
$('header.linux-fundamentals:lang(en)').html('Linux Fundamentals');
$('a.linux-fundamentals-①-repository-concept:lang(en)').html('Repository Concept').attr('href','linux-fundamentals-1-repository-concept-ar.php');
$('a.linux-fundamentals-②-software-manager-vs-package-manager:lang(en)').html('Software Manager vs Package Manager').attr('href','linux-fundamentals-2-software-manager-vs-package-manager-ar.php');
$('a.linux-fundamentals-③-software-alternatives:lang(en)').html('Software Alternatives').attr('href','linux-fundamentals-3-software-alternatives-ar.php');
$('a.linux-fundamentals-④-faq:lang(en)').html('FAQ').attr('href','linux-fundamentals-4-faq-ar.php');
$('header.reviews:lang(en)').html('Reviews');
$('a.arabic-calligraphy-in-computing-era:lang(en)').html('Arabic Calligraphy in Computing Era').attr('href','arabic-calligraphy-in-computing-era-ar.php');
$('a.css-will-change-property:lang(en)').html('Everything You Need to Know About the CSS will-change Property').attr('href','css-will-change-property.php');
$('a.elementaryos-freya:lang(en)').html('An overview of elementayOS - Freya').attr('href','elementaryos-freya.php');
$('a.arabic-ubuntu-font-beta-the-first-impression:lang(en)').html('Arabic Ubuntu Font (Beta): The First Impression').attr('href','arabic-ubuntu-font-beta-the-first-impression.php');
});
//-----------------------------------------------
// 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();
});
//-----------------------------------------------
// Close Dialog
$('.dialog-close').bind('click',function() {
history.go(-1);
});
$('dialog:has(img)').bind('click',function() {
history.go(-1);
});
//-----------------------------------------------
// 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: ";