429151, r=sayrer, a=beltzner, don't do internal version checking when adding microformats

This commit is contained in:
mkaply%us.ibm.com 2008-04-15 20:55:02 +00:00
Родитель a293fa0887
Коммит 15d7bc44a6
1 изменённых файлов: 7 добавлений и 15 удалений

Просмотреть файл

@ -1,7 +1,6 @@
var EXPORTED_SYMBOLS = ["Microformats", "adr", "tag", "hCard", "hCalendar", "geo"]; var EXPORTED_SYMBOLS = ["Microformats", "adr", "tag", "hCard", "hCalendar", "geo"];
var Microformats = { var Microformats = {
version: 0.8,
/* When a microformat is added, the name is placed in this list */ /* When a microformat is added, the name is placed in this list */
list: [], list: [],
/* Custom iterator so that microformats can be enumerated as */ /* Custom iterator so that microformats can be enumerated as */
@ -267,16 +266,14 @@ var Microformats = {
}, },
add: function add(microformat, microformatDefinition) { add: function add(microformat, microformatDefinition) {
/* We always replace an existing definition with the new one */ /* We always replace an existing definition with the new one */
if (microformatDefinition.mfVersion == Microformats.version) { if (!Microformats[microformat]) {
if (!Microformats[microformat]) { Microformats.list.push(microformat);
Microformats.list.push(microformat);
}
Microformats[microformat] = microformatDefinition;
microformatDefinition.mfObject.prototype.debug =
function(microformatObject) {
return Microformats.debug(microformatObject)
};
} }
Microformats[microformat] = microformatDefinition;
microformatDefinition.mfObject.prototype.debug =
function(microformatObject) {
return Microformats.debug(microformatObject)
};
}, },
/* All parser specific functions are contained in this object */ /* All parser specific functions are contained in this object */
parser: { parser: {
@ -1136,7 +1133,6 @@ adr.prototype.toString = function() {
} }
var adr_definition = { var adr_definition = {
mfVersion: 0.8,
mfObject: adr, mfObject: adr,
className: "adr", className: "adr",
properties: { properties: {
@ -1203,7 +1199,6 @@ hCard.prototype.toString = function() {
} }
var hCard_definition = { var hCard_definition = {
mfVersion: 0.8,
mfObject: hCard, mfObject: hCard,
className: "vcard", className: "vcard",
required: ["fn"], required: ["fn"],
@ -1414,7 +1409,6 @@ hCalendar.prototype.toString = function() {
} }
var hCalendar_definition = { var hCalendar_definition = {
mfVersion: 0.8,
mfObject: hCalendar, mfObject: hCalendar,
className: "vevent", className: "vevent",
required: ["summary", "dtstart"], required: ["summary", "dtstart"],
@ -1623,7 +1617,6 @@ geo.prototype.toString = function() {
} }
var geo_definition = { var geo_definition = {
mfVersion: 0.8,
mfObject: geo, mfObject: geo,
className: "geo", className: "geo",
required: ["latitude","longitude"], required: ["latitude","longitude"],
@ -1696,7 +1689,6 @@ tag.prototype.toString = function() {
} }
var tag_definition = { var tag_definition = {
mfVersion: 0.8,
mfObject: tag, mfObject: tag,
attributeName: "rel", attributeName: "rel",
attributeValues: "tag", attributeValues: "tag",