Browse Source

srcs: objectType, verb -> object_type, object_verb

To match the db column names
master
Chimo 5 years ago
parent
commit
3d54bbe25a
  1. 4
      classes/Event.js
  2. 4
      sources/blog.js
  3. 4
      sources/gnufm.js
  4. 14
      sources/gnusocial.js
  5. 4
      sources/gogs.js
  6. 4
      sources/mediagoblin.js
  7. 4
      sources/pullet.js
  8. 4
      sources/webmention.js

4
classes/Event.js

@ -58,8 +58,8 @@
that.published,
null,
that.foreign_url,
that.objectType,
that.verb
that.object_type,
that.object_verb
],
callback
);

4
sources/blog.js

@ -18,8 +18,8 @@
event.content = "<h2>" + item.getElementsByTagName( "title" )[ 0 ].textContent + "</h2>" +
item.getElementsByTagName( "summary" )[ 0 ].textContent +
"<p><a href='" + event.foreign_url + "'>read more...</a></p>";
event.objectType = "article";
event.verb = "post";
event.object_type = "article";
event.object_verb = "post";
return event;
};

4
sources/gnufm.js

@ -26,8 +26,8 @@
onAlbum;
event.published = item.getElementsByTagName( "published" )[ 0 ].textContent;
event.objectType = "audio";
event.verb = "listen";
event.object_type = "audio";
event.object_verb = "listen";
return event;
};

14
sources/gnusocial.js

@ -19,15 +19,15 @@
event = {};
event.published = item.getElementsByTagName( "published" )[ 0 ].textContent;
event.verb = activityRE.exec( item.getElementsByTagNameNS( activityNS, "verb" )[ 0 ].textContent )[ 0 ];
event.objectType = activityRE.exec( item.getElementsByTagNameNS( activityNS, "object-type" )[ 0 ].textContent )[ 0 ];
event.object_verb = activityRE.exec( item.getElementsByTagNameNS( activityNS, "verb" )[ 0 ].textContent )[ 0 ];
event.object_type = activityRE.exec( item.getElementsByTagNameNS( activityNS, "object-type" )[ 0 ].textContent )[ 0 ];
event.foreign_url = item.getElementsByTagName( "link" )[ 0 ].getAttribute( "href" );
switch ( event.verb ) {
switch ( event.object_verb ) {
case "favorite":
reply_to = item.getElementsByTagName( "link" )[ 2 ].getAttribute( "href" );
by = / by ([^:]+)/.exec( item.getElementsByTagName( "content" )[ 0 ].textContent )[ 0 ];
event.title = "Favorited a <a class='u-like-of' href='" + reply_to + "'>" + event.objectType + "</a>" + by;
event.title = "Favorited a <a class='u-like-of' href='" + reply_to + "'>" + event.object_type + "</a>" + by;
event.content = item.getElementsByTagNameNS( activityNS, "object" )[ 0 ].getElementsByTagName( "content" )[ 0 ].textContent;
break;
case "share": /* repeat */
@ -47,16 +47,16 @@
.getElementsByTagName( "content" )[ 0 ].textContent;
break;
case "post":
event.title = "Posted a " + event.objectType;
event.title = "Posted a " + event.object_type;
if ( event.objectType === "bookmark" ) {
if ( event.object_type === "bookmark" ) {
event.content = item.getElementsByTagNameNS( activityNS, "object" )[ 0 ].getElementsByTagName( "content" )[ 0 ].textContent;
} else { /* note, comment */
event.content = item.getElementsByTagName( "content" )[ 0 ].textContent;
}
break;
case "join":
event.title = "Joined a " + event.objectType;
event.title = "Joined a " + event.object_type;
event.content = "<a href='" +
item
.getElementsByTagNameNS( activityNS, "object" )[ 0 ]

4
sources/gogs.js

@ -65,8 +65,8 @@
event.published = $( ".time-since" ).attr( "title" );
event.content = getContent( $items, $ );
event.objectType = "file"; // ?
event.verb = "update"; // ?
event.object_type = "file"; // ?
event.object_verb = "update"; // ?
return event;
};

4
sources/mediagoblin.js

@ -34,8 +34,8 @@
event.content = contentTitle + event.content + "<br>" + img;
event.objectType = "image";
event.verb = "post";
event.object_type = "image";
event.object_verb = "post";
return event;
};

4
sources/pullet.js

@ -16,8 +16,8 @@
event.foreign_url = item.getElementsByTagName( "link" )[ 0 ].getAttribute( "href" );
event.published = item.getElementsByTagName( "published" )[ 0 ].textContent;
event.content = item.getElementsByTagName( "content" )[ 0 ].textContent;
event.objectType = "place";
event.verb = "checkin";
event.object_type = "place";
event.object_verb = "checkin";
return event;
};

4
sources/webmention.js

@ -16,8 +16,8 @@
event.foreign_url = item.getElementsByTagName( "link" )[ 0 ].getAttribute( "href" );
event.published = item.getElementsByTagName( "published" )[ 0 ].textContent;
event.content = item.getElementsByTagName( "content" )[ 0 ].textContent;
event.objectType = "article";
event.verb = "like"; // FIXME: This file is 'webmention' but this says 'like'
event.object_type = "article";
event.object_verb = "like"; // FIXME: This file is 'webmention' but this says 'like'
return event;
};

Loading…
Cancel
Save