Skip to content

Commit

Permalink
Removed parseRemote() code.
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartloxton committed May 12, 2008
1 parent 8251771 commit 05f7adc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 26 deletions.
2 changes: 2 additions & 0 deletions README.textile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
h3. jQuery Microformats

*At the moment and for the next few days (maybe weeks) only parseLocal will be available as I am going to write all the parsers then apply the remote system*

jQuery Microformats is an in development jQuery plugin for parsing local and remote documents for "microformats":http://microformats.org/wiki/Main_Page.

h3. Example Code
Expand Down
3 changes: 1 addition & 2 deletions hcard.htm
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<script type="text/javascript">
$(document).ready(function() {
$.microformats.parseLocal();
console.log($.microformats.hCards[0].org);
console.log($.microformats.hCards);
});

</script>
Expand Down Expand Up @@ -40,6 +40,5 @@
<span class="email">info@commerce.net</span>
</div>
</div>

</body>
</html>
33 changes: 9 additions & 24 deletions lib/jquery.microformats.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,21 @@ jQuery.fn.parseMicroformatAttribute = function() {
}
};
jQuery.microformats = {

availableFormats: ['hCard', 'hCalendar', 'hReview', 'XFN'],
hCards: [],
hCalendars: [],
hReviews: [],
XF: [],
lastRemote: false,
documentParsed: {
hCard : false,
hCalender : false,
hEvent : false,
XFN : false
},
hCard: function(target, settings){
//console.log(settings);
//console.log(target);
var foundHCards = [];
var standardAttributes = [
{name: 'fn', class: '.fn'},
Expand Down Expand Up @@ -52,7 +54,11 @@ jQuery.microformats = {
]
}
];
//console.log(target);
console.log(target);
console.log(typeof(target));
jQuery(target).find('.vcard').each(function() {
alert('anything');
var vCardObject = {};
var current = this;
jQuery.each(standardAttributes, function() {
Expand Down Expand Up @@ -132,27 +138,6 @@ jQuery.microformats = {
}
},
parseRemote : function(target, settings) {
settings = jQuery.extend({
microformats: "all",
appendToLocal: true
}, settings);
var page = '';
console.log(target);
$('body').load('http://digg.com/users/MakiMaki');
if(typeof(settings.microformats) == "string") {
if(settings.microformats == 'all') {
settings.microformats = this.availableFormats;
} else {
settings.microformats = [settings.microformats];
}
}
var passedSettings = {
appendToLocal: settings.appendToLocal
}
for(i = 0; i < settings.microformats.length; i++) {
if(jQuery.isFunction(eval('jQuery.microformats.'+settings.microformats[i]))) {
eval('jQuery.microformats.'+settings.microformats[i]+'(page, passedSettings)');
}
}
return true;
}
};
};

0 comments on commit 05f7adc

Please sign in to comment.