Anonymous avatar Anonymous committed baf1530

added random quotes via ajax

Comments (0)

Files changed (19)

src/en/index.html

 					
 				</div>
                                 <div class="quote">
-                                        <em>Random testimony: "I understood how to install Mercurial and how to use it in a few minutes." -Giorgos Keramidas</em>
+                                        <em id="quote">Random testimony: "I understood how to install Mercurial and how to use it in a few minutes." -Giorgos Keramidas</em>
                                         <!-- other nice quotes: 
                                         ## From the strengths of Mercurial discussion: 
                                         Just works the way I expect - Paul Moore

src/en/javascript/main.js

 
 var xmlhttp = null;
 
-function loadXMLDoc(url) {
+function loadXMLDoc(url, stateChange) {
     if (window.XMLHttpRequest) {// code for Firefox, Opera, IE7, etc.
         xmlhttp = new XMLHttpRequest();
     } else if (window.ActiveXObject) {// code for IE6, IE5
     }
 }
 
-function stateChange() {
+// client OS specific page section
+function browserUsageRequestStateChange() {
     if (xmlhttp.readyState==4) {// 4 = "loaded"
         document.getElementById('replace').innerHTML = xmlhttp.responseText;
     }
 
 addLoadEvent(function () {
     if (navigator.appVersion.indexOf("Win")!=-1) {
-        loadXMLDoc("win.html");
+        loadXMLDoc("win.html", browserUsageRequestStateChange);
     }
 });
+
+// random quotes
+function quoteRequestStateChange() {
+    if (xmlhttp.readyState==4) {// 4 = "loaded"
+        document.getElementById('quote').innerHTML = xmlhttp.responseText;
+    }
+}
+
+function randomNumber(low, high) {
+    return Math.floor(Math.random()*(high-low+1))+low;
+}
+
+addLoadEvent(function () {
+    loadXMLDoc("quotes/" + randomNumber(1, 17) + ".txt", quoteRequestStateChange);
+});

src/en/quotes/1.txt

+Random testimony: "I understood how to install Mercurial and how to use it in a few minutes." -Giorgos Keramidas 

src/en/quotes/10.txt

+Random testimony: The included web server [...] replaces a lot of functionality of GUI tools in a truly multiplatform way. - Daniel Serpell 

src/en/quotes/11.txt

+Random testimony: There isn't much to learn to be effective. - Doug Philips 

src/en/quotes/12.txt

+Random testimony: It took my less than an hour to understand it. - Thomas Burdick 

src/en/quotes/13.txt

+Random testimony: It has a tortoise so I can actually show my boss its highly productive even in windows. - Thomas Burdick 

src/en/quotes/14.txt

+Random testimony: The commands usually do what I assume them to do. - Bastian Doetsch 

src/en/quotes/15.txt

+Mercurial's conceptual model is clean and simple enough to carry around in my head" - hgbook 

src/en/quotes/16.txt

+Random testimony: It's so easy to start a project; hg init, and you're good to go. - Paul Fisher 

src/en/quotes/17.txt

+Random testimony: It simply works [...]. - Hans Meine 

src/en/quotes/2.txt

+Random testimony: Just works the way I expect - Paul Moore 

src/en/quotes/3.txt

+Random testimony: It took me one evening to get comfortable with it.  About a month to better understand its distributed nature. - Isaac Jurado 

src/en/quotes/4.txt

+Random testimony: Mercurial strikes a marvelous balance between these two ends.  It can be configured to support either simple environments or very complicated streams of changes interacting in custom ways, and it does all that without becoming a humongous monster of complexity. - Giorgos Keramidas 

src/en/quotes/5.txt

+Random testimony: The dev's of Hg are generally friendly and approachable. - Gerard Korsten 

src/en/quotes/6.txt

+Random testimony: The code base for Hg is pretty small and yet its pretty feature complete. - Gerard Korsten 

src/en/quotes/7.txt

+Random testimony: Simplicity, being distributed, extensibility, speed, familiarity, bash completion, understandable and reasonably small code base - Peter Arrenbrecht 

src/en/quotes/8.txt

+Random testimony: The team on the project gradually grew from just me to a few people here and abroad. This was a totally seamless experience - Peter Arrenbrecht 

src/en/quotes/9.txt

+Random testimony: Easy to understand at a practical level. - Michael Estrand 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.