Commit de203e6e authored by yPhil's avatar yPhil

Doc: Code example

parent 62a16728
......@@ -783,9 +783,9 @@
}
},
"feedrat": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/feedrat/-/feedrat-1.0.4.tgz",
"integrity": "sha512-lA8cSSUdugJirXi4/zg0gzsq/4MYqpshDJj9jOKMUV//hsJLgAJxbClOpJJGO3sMXDuJbzIvTzHMAWN7HKidlw==",
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/feedrat/-/feedrat-1.0.5.tgz",
"integrity": "sha512-aFITuYXg977le3snPCd+KmoNS08cuSbu14eXArO2kQFev/ahki74ctcpSQld+z1kwj1LU8alhH6M+X77lzPdTA==",
"requires": {
"request": "2.83.0"
}
......
......@@ -98,7 +98,11 @@ legend {
}
.ui-state-success {
background-color: #88DC00 !important;
background-color: #DFF2BF !important;
}
.ui-state-error {
background-color: #FFBABA !important;
}
.logoItem {
......
......@@ -146,16 +146,12 @@ var Dialog = (function() {
$guessField = $dialog.find('input#feedGuess'),
$guessGroup = $dialog.find('div#feedGuess').controlgroup(),
$urlGroup = $guessGroup.parent(),
$guessCandidate = $('<div id="guessCandidate">'),
$okButton = $('.ui-dialog-buttonpane').find('button:contains("OK")').addClass('okButton');
var oldUrl = $dataStore.data('url'),
oldType = $dataStore.data('type'),
oldLimit = $dataStore.data('limit');
// $dialog.find('div#feedGuessContainer').controlgroup();
// $guessField.val(oldUrl);
$guessButton.click(function(event) {
console.log('\nGuess: %s', $guessField.val());
......@@ -171,18 +167,20 @@ var Dialog = (function() {
$guessSpinner.removeClass('spinner icon-cog');
}).done(function(feed, status) {
console.log( 'OK %s (status %s)', feed, status);
// $guessCandidate.append(feed).appendTo($urlGroup);
$guessField.val(feed);
$guessSpinner.addClass('icon-ok');
$guessButton.addClass('ui-state-success');
$okButton.addClass("ui-state-success");
$okButton.removeClass('ui-state-error')
.addClass("ui-state-success");
}).fail(function(feed, status) {
console.log( 'ERROR %s (status: %s)', $guessField.val(), status);
$guessSpinner.removeClass('icon-cog spinner')
.addClass('icon-cancel-circled');
$guessButton.addClass('ui-state-error');
$okButton.addClass("ui-state-error");
}).always(function(feed, status) {
console.log( 'Always %s (status: %s)', $guessField.val(), status);
});
......
......@@ -92,15 +92,9 @@ router.get('/discover', function(req, res, next) {
feedrat(req.query.url, function(err, u) {
if (typeof u === 'undefined' || !u) {
console.log('Url: ' + req.query.url)
// res.send(err);
res.status(500).send('Something broke!')
} else {
// console.log('Url: ' + req.query.feedhost + '\nError: ' + JSON.stringify(err))
res.send(u)
// console.log('Err: ' + JSON.stringify(err))
}
});
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment