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
Feeds plugins: CORS enabled pulling #8502
Conversation
@ipaksc it's counter to best practices to add the date to a commit message. It makes the commit very verbose and duplicates info that is already available with the commit. |
180b60f
to
c048446
Compare
Before to merge, I am going to test this PR locally first. |
Test URL: http://universallabs.org/wet/labs/pr-8502/demos/feeds/feeds-en.html |
src/plugins/feeds/feeds-en.hbs
Outdated
@@ -15,6 +15,27 @@ | |||
|
|||
<section> | |||
<h2>Examples</h2> | |||
<section class="wb-feeds limit-3" data-cors="true"> | |||
<h3>Canada News Centre - Manitoba</h3> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you modify the title to indication this example use the CORS?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add also a small description explaining: This method fetch the ATOM feed directly and don't use a third party service.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great
src/plugins/feeds/feeds-fr.hbs
Outdated
@@ -15,6 +15,27 @@ | |||
|
|||
<section> | |||
<h2>Exemples</h2> | |||
<section class="wb-feeds limit-3" data-cors="true"> | |||
<h3>Centre des nouvelles du Canada - Manitoba</h3> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you modify the title to indication this example use the CORS?
What is the net effect of adding data-cors="true" to the mark-up? Is the Yahoo API sill being used? |
@fibrahim The yahoo API should not be used. |
I updated the test site as per the latest Ilya changes. Now the CORS example is the last working example. Test URL: http://universallabs.org/wet/labs/pr-8502/demos/feeds/feeds-en.html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The working example don't work. It seems to conflict with feed that are fetch with the Yahoo API.
f6f0486
to
bcb2c67
Compare
src/plugins/feeds/feeds.js
Outdated
if ( !Array.isArray( data ) ) { | ||
data = [ data ]; | ||
// if CORS -> transform the xml response into a JSON | ||
if ( $( eventTarget ).parentsUntil( selector ).parent().data( "cors" ) === true ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you cache this $( eventTarget ).parentsUntil( selector ).parent()
into a variable.
I updated the test site as per the latest Ilya changes. Test URL: http://universallabs.org/wet/labs/pr-8502/demos/feeds/feeds-en.html |
I updated the test site as per the latest Ilya changes. Test URL: http://universallabs.org/wet/labs/pr-8502/demos/feeds/feeds-en.html |
src/plugins/feeds/feeds.js
Outdated
* @method corsEntry | ||
*/ | ||
corsEntry = function( xmlDoc, limit ) { | ||
var arr_entry = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do one "var" declaration instead of multiple, this is to follow the same coding style as we did elsewhere in WET. This apply to other "var" statement you added in your PR.
c23b50f
to
e27bb5a
Compare
4c6d783
to
bf59537
Compare
src/plugins/feeds/feeds.js
Outdated
|
||
if ( elm ) { | ||
$elm = $( elm ); | ||
$content = $( elm ).find( ".feeds-cont" ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you replace ````$( elm )by
$elm```?
w# with '#' will be ignored, and an empty message aborts the commit.
I updated the test site as per the latest Ilya changes. Test URL: http://universallabs.org/wet/labs/pr-8502/demos/feeds/feeds-en.html |
No description provided.