Browse Source

Formatting

master
Chimo 6 years ago
parent
commit
c1ece02066
4 changed files with 13 additions and 12 deletions
  1. +8
    -7
      .jscsrc
  2. +1
    -1
      main.js
  3. +2
    -2
      sources/gnufm.js
  4. +2
    -2
      sources/mediagoblin.js

+ 8
- 7
.jscsrc View File

@ -1,9 +1,10 @@
{
"preset": "jquery",
"validateLineBreaks": null,
"requireCamelCaseOrUpperCaseIdentifiers": null,
"maximumLineLength": 500,
"requireBlocksOnNewline": true,
"requireSpaceBeforeBlockStatements": true,
"disallowMixedSpacesAndTabs": true
"preset": "jquery",
"validateLineBreaks": null,
"requireCamelCaseOrUpperCaseIdentifiers": null,
"maximumLineLength": 500,
"requireBlocksOnNewline": true,
"requireSpaceBeforeBlockStatements": true,
"disallowMixedSpacesAndTabs": true,
"validateIndentation": 4
}

+ 1
- 1
main.js View File

@ -150,7 +150,7 @@
for ( i = 0; i < len; i += 1 ) {
sub = subs[ i ];
if ( !sources[ sub.topic] ) {
if ( !sources[ sub.topic ] ) {
sources[ sub.topic ] = require( "./sources/" + sub.type + ".js" );
types[ sub.topic ] = sub.type;
}


+ 2
- 2
sources/gnufm.js View File

@ -17,7 +17,7 @@
album = item.getElementsByTagName( "album" )[ 0 ],
albumUrl = album.getAttribute( "url" ),
albumTitle = album.textContent,
onAlbum = (albumUrl && albumTitle) ? " on <a href='" + album.getAttribute( "url" ) + "'>" + album.textContent + "</a>" : "";
onAlbum = ( albumUrl && albumTitle ) ? " on <a href='" + album.getAttribute( "url" ) + "'>" + album.textContent + "</a>" : "";
event.title = "Listened to";
event.source = trackUrl; // TODO
@ -25,7 +25,7 @@
" by <a href='" + artist.getAttribute( "url" ) + "'>" + artist.textContent + "</a>" +
onAlbum;
event.published = item.getElementsByTagName( "published" )[0].textContent;
event.published = item.getElementsByTagName( "published" )[ 0 ].textContent;
event.objectType = "audio";
event.verb = "listen";


+ 2
- 2
sources/mediagoblin.js View File

@ -17,8 +17,8 @@
event.title = "Posted an image";
// FIXME: should fetch based on "type" attr, not node position
event.source = links[0].getAttribute( "href" );
img = "<img src='" + links[1].getAttribute( "href" ) + "'>";
event.source = links[ 0 ].getAttribute( "href" );
img = "<img src='" + links[ 1 ].getAttribute( "href" ) + "'>";
event.published = item.getElementsByTagName( "updated" )[ 0 ].textContent;


Loading…
Cancel
Save