New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vCard/JSON extraction #19443
vCard/JSON extraction #19443
Changes from 1 commit
eb2c7e0
015ef37
43aeb7c
f306835
0530512
f939632
3d68d2a
a4ed961
4628943
cbfc666
146dd58
9284187
dd4dc70
43650c2
19408a0
79d140d
aab6900
35468f8
8cafd64
87d1efa
c580c3f
3cd9731
d0cb12e
0ae2d08
7131823
a3e5b9f
0e5023d
37f70c6
543de1c
a781bba
04a043d
c740aab
File filter...
Jump to…
Updated code to pass the type of microdata as a parameter
- Loading branch information
Some generated files are not rendered by default. Learn more.
| @@ -193,6 +193,6 @@ pub trait WindowMethods { | ||
| /// run the event loop at the vsync interval. | ||
| fn set_animation_state(&self, _state: AnimationState) {} | ||
|
|
||
| /// Print Microdata on the Console | ||
| fn print_microdata(&self, _data: String) {} | ||
| /// Print Microdata on the Console or write to file | ||
| fn print_microdata(&self, _data: String, _datatype: String) {} | ||
jdm
Member
|
||
| } | ||
| @@ -1711,12 +1711,12 @@ impl Document { | ||
|
|
||
| // Step 13. | ||
jdm
Member
|
||
| let htmlelement = self.get_html_element(); | ||
| let result = Microdata::parse(self, htmlelement.unwrap().upcast::<Node>()); //Chirag | ||
| let result = Microdata::parse(self, htmlelement.unwrap().upcast::<Node>()); | ||
| if !result.get("vcard").unwrap().is_empty() { | ||
| let event = ScriptMsg::SendMicrodata(result.get("vcard").unwrap().to_string()); | ||
| let event = ScriptMsg::SendMicrodata(result.get("vcard").unwrap().to_string(), "vcard".to_string()); | ||
| self.send_to_constellation(event); | ||
| } else { | ||
| let event = ScriptMsg::SendMicrodata(result.get("json").unwrap().to_string()); | ||
| let event = ScriptMsg::SendMicrodata(result.get("json").unwrap().to_string(), "json".to_string()); | ||
| self.send_to_constellation(event); | ||
| } | ||
| } | ||
We should provide slightly more informative documentation here ;)