Browse Source

Removed Wikipedia loading from Internet Explorer to prevent breaking in IE closes #106

pull/127/head
Zach Wise 13 years ago
parent
commit
cbcf46656c
  1. 6
      compiled/js/locale/de.js
  2. 6
      compiled/js/locale/en.js
  3. 6
      compiled/js/locale/es.js
  4. 6
      compiled/js/locale/fr.js
  5. 6
      compiled/js/locale/is.js
  6. 6
      compiled/js/locale/it.js
  7. 6
      compiled/js/locale/kr.js
  8. 6
      compiled/js/locale/nl.js
  9. 6
      compiled/js/locale/pt-br.js
  10. 6
      compiled/js/locale/zh-ch.js
  11. 6
      compiled/js/locale/zh-tw.js
  12. 6
      compiled/js/timeline-min.js
  13. 71
      compiled/js/timeline.js
  14. 38
      source/js/VMM.ExternalAPI.js
  15. 2
      source/js/VMM.Timeline.js
  16. 31
      source/js/VMM.Util.js

6
compiled/js/locale/de.js

File diff suppressed because one or more lines are too long

6
compiled/js/locale/en.js

File diff suppressed because one or more lines are too long

6
compiled/js/locale/es.js

File diff suppressed because one or more lines are too long

6
compiled/js/locale/fr.js

File diff suppressed because one or more lines are too long

6
compiled/js/locale/is.js

File diff suppressed because one or more lines are too long

6
compiled/js/locale/it.js

File diff suppressed because one or more lines are too long

6
compiled/js/locale/kr.js

File diff suppressed because one or more lines are too long

6
compiled/js/locale/nl.js

File diff suppressed because one or more lines are too long

6
compiled/js/locale/pt-br.js

File diff suppressed because one or more lines are too long

6
compiled/js/locale/zh-ch.js

File diff suppressed because one or more lines are too long

6
compiled/js/locale/zh-tw.js

File diff suppressed because one or more lines are too long

6
compiled/js/timeline-min.js vendored

File diff suppressed because one or more lines are too long

71
compiled/js/timeline.js

@ -2123,28 +2123,34 @@ if(typeof VMM != 'undefined' && typeof VMM.ExternalAPI == 'undefined') {
var the_url = "http://en.wikipedia.org/w/api.php?action=query&prop=extracts&titles=" + api_obj.url + "&format=json&exintro=1&callback=?";
VMM.getJSON(the_url, function(d) {
var wiki_extract = VMM.Util.getObjectAttributeByIndex(d.query.pages, 0).extract;
var wiki_title = VMM.Util.getObjectAttributeByIndex(d.query.pages, 0).title;
var _wiki = "";
var wiki_text = "";
var wiki_text_array = wiki_extract.split("<p>");
var wiki_number_of_paragraphs = 1;
trace(d);
if ( VMM.Browser.browser == "Explorer" && parseInt(VMM.Browser.version, 10) >= 7 && window.XDomainRequest) {
VMM.attachElement("#"+api_obj.id, "<p>Wikipedia entry unable to load using Internet Explorer.</p>" );
} else {
var wiki_extract = VMM.Util.getObjectAttributeByIndex(d.query.pages, 0).extract;
var wiki_title = VMM.Util.getObjectAttributeByIndex(d.query.pages, 0).title;
var _wiki = "";
var wiki_text = "";
var wiki_text_array = wiki_extract.split("<p>");
var wiki_number_of_paragraphs = 1;
for(var i = 0; i < wiki_text_array.length; i++) {
if (i+1 <= wiki_number_of_paragraphs && i+1 < wiki_text_array.length) {
wiki_text += "<p>" + wiki_text_array[i+1];
for(var i = 0; i < wiki_text_array.length; i++) {
if (i+1 <= wiki_number_of_paragraphs && i+1 < wiki_text_array.length) {
wiki_text += "<p>" + wiki_text_array[i+1];
}
}
}
_wiki = "<h4><a href='http://en.wikipedia.org/wiki/" + wiki_title + "' target='_blank'>" + wiki_title + "</a></h4>";
_wiki += "<div class='wiki-source'>From Wikipedia, the free encyclopedia</span>";
_wiki += VMM.Util.linkify_wikipedia(wiki_text);
_wiki = "<h4><a href='http://en.wikipedia.org/wiki/" + wiki_title + "' target='_blank'>" + wiki_title + "</a></h4>";
_wiki += "<div class='wiki-source'>From Wikipedia, the free encyclopedia</span>";
_wiki += VMM.Util.linkify_wikipedia(wiki_text);
if (wiki_extract.match("REDIRECT")) {
if (wiki_extract.match("REDIRECT")) {
} else {
VMM.attachElement("#"+api_obj.id, _wiki );
} else {
VMM.attachElement("#"+api_obj.id, _wiki );
}
}
});
},
@ -3516,14 +3522,19 @@ if(typeof VMM != 'undefined' && typeof VMM.Util == 'undefined') {
/* GET OBJECT ATTRIBUTE BY INDEX
================================================== */
getObjectAttributeByIndex: function(obj, index) {
var i = 0;
for (var attr in obj){
if (index === i){
return obj[attr];
if(typeof obj != 'undefined') {
var i = 0;
for (var attr in obj){
if (index === i){
return obj[attr];
}
i++;
}
i++;
return "";
} else {
return "";
}
return null;
},
/* RANDOM BETWEEN
================================================== */
@ -3910,7 +3921,9 @@ if(typeof VMM != 'undefined' && typeof VMM.Util == 'undefined') {
return text
.replace(urlPattern, "<a target='_blank' href='http://en.wikipedia.org/wiki/$&' onclick='void(0)'>$&</a>")
.replace(/<i\b[^>]*>/gim, "")
.replace(/<\/i>/gim, "");
.replace(/<\/i>/gim, "")
.replace(/<b\b[^>]*>/gim, "")
.replace(/<\/b>/gim, "");
},
/* Turns plain text links into real links
================================================== */
@ -4098,8 +4111,14 @@ if(typeof VMM != 'undefined' && typeof VMM.Util == 'undefined') {
__firstToUpperCase: function (w) {
var split = w.split(/(^[^a-zA-Z0-9]*[a-zA-Z0-9])(.*)$/);
split[1] = split[1].toUpperCase();
return split.join('');
if (split[1]){
split[1] = split[1].toUpperCase();
return split.join('');
} else {
return "";
}
},
};
@ -6083,7 +6102,7 @@ if(typeof VMM != 'undefined' && typeof VMM.Timeline == 'undefined') {
_date.fulldate = _date.startdate.getTime();
if (config.embed) {
document.title = _date.headline;
//document.title = _date.headline;
}
_dates.push(_date);

38
source/js/VMM.ExternalAPI.js

@ -601,28 +601,34 @@ if(typeof VMM != 'undefined' && typeof VMM.ExternalAPI == 'undefined') {
var the_url = "http://en.wikipedia.org/w/api.php?action=query&prop=extracts&titles=" + api_obj.url + "&format=json&exintro=1&callback=?";
VMM.getJSON(the_url, function(d) {
var wiki_extract = VMM.Util.getObjectAttributeByIndex(d.query.pages, 0).extract;
var wiki_title = VMM.Util.getObjectAttributeByIndex(d.query.pages, 0).title;
var _wiki = "";
var wiki_text = "";
var wiki_text_array = wiki_extract.split("<p>");
var wiki_number_of_paragraphs = 1;
trace(d);
if ( VMM.Browser.browser == "Explorer" && parseInt(VMM.Browser.version, 10) >= 7 && window.XDomainRequest) {
VMM.attachElement("#"+api_obj.id, "<p>Wikipedia entry unable to load using Internet Explorer.</p>" );
} else {
var wiki_extract = VMM.Util.getObjectAttributeByIndex(d.query.pages, 0).extract;
var wiki_title = VMM.Util.getObjectAttributeByIndex(d.query.pages, 0).title;
var _wiki = "";
var wiki_text = "";
var wiki_text_array = wiki_extract.split("<p>");
var wiki_number_of_paragraphs = 1;
for(var i = 0; i < wiki_text_array.length; i++) {
if (i+1 <= wiki_number_of_paragraphs && i+1 < wiki_text_array.length) {
wiki_text += "<p>" + wiki_text_array[i+1];
for(var i = 0; i < wiki_text_array.length; i++) {
if (i+1 <= wiki_number_of_paragraphs && i+1 < wiki_text_array.length) {
wiki_text += "<p>" + wiki_text_array[i+1];
}
}
}
_wiki = "<h4><a href='http://en.wikipedia.org/wiki/" + wiki_title + "' target='_blank'>" + wiki_title + "</a></h4>";
_wiki += "<div class='wiki-source'>From Wikipedia, the free encyclopedia</span>";
_wiki += VMM.Util.linkify_wikipedia(wiki_text);
_wiki = "<h4><a href='http://en.wikipedia.org/wiki/" + wiki_title + "' target='_blank'>" + wiki_title + "</a></h4>";
_wiki += "<div class='wiki-source'>From Wikipedia, the free encyclopedia</span>";
_wiki += VMM.Util.linkify_wikipedia(wiki_text);
if (wiki_extract.match("REDIRECT")) {
if (wiki_extract.match("REDIRECT")) {
} else {
VMM.attachElement("#"+api_obj.id, _wiki );
} else {
VMM.attachElement("#"+api_obj.id, _wiki );
}
}
});
},

2
source/js/VMM.Timeline.js

@ -505,7 +505,7 @@ if(typeof VMM != 'undefined' && typeof VMM.Timeline == 'undefined') {
_date.fulldate = _date.startdate.getTime();
if (config.embed) {
document.title = _date.headline;
//document.title = _date.headline;
}
_dates.push(_date);

31
source/js/VMM.Util.js

@ -28,14 +28,19 @@ if(typeof VMM != 'undefined' && typeof VMM.Util == 'undefined') {
/* GET OBJECT ATTRIBUTE BY INDEX
================================================== */
getObjectAttributeByIndex: function(obj, index) {
var i = 0;
for (var attr in obj){
if (index === i){
return obj[attr];
if(typeof obj != 'undefined') {
var i = 0;
for (var attr in obj){
if (index === i){
return obj[attr];
}
i++;
}
i++;
return "";
} else {
return "";
}
return null;
},
/* RANDOM BETWEEN
================================================== */
@ -422,7 +427,9 @@ if(typeof VMM != 'undefined' && typeof VMM.Util == 'undefined') {
return text
.replace(urlPattern, "<a target='_blank' href='http://en.wikipedia.org/wiki/$&' onclick='void(0)'>$&</a>")
.replace(/<i\b[^>]*>/gim, "")
.replace(/<\/i>/gim, "");
.replace(/<\/i>/gim, "")
.replace(/<b\b[^>]*>/gim, "")
.replace(/<\/b>/gim, "");
},
/* Turns plain text links into real links
================================================== */
@ -610,8 +617,14 @@ if(typeof VMM != 'undefined' && typeof VMM.Util == 'undefined') {
__firstToUpperCase: function (w) {
var split = w.split(/(^[^a-zA-Z0-9]*[a-zA-Z0-9])(.*)$/);
split[1] = split[1].toUpperCase();
return split.join('');
if (split[1]){
split[1] = split[1].toUpperCase();
return split.join('');
} else {
return "";
}
},
};

Loading…
Cancel
Save