summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
c98d0a8)
This is in preparation for the introduction of async behaviors.
Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
+ var URL = _get_URL(site, element);
+ if (!URL) {
+ DDL_log('DirectDL (' + site.pageURL + '): cannot get the URL.');
+ return null;
+ }
+
+ return _add_link(site, URL);
+}
+
+function _get_URL(site, element) {
var content = element.innerHTML;
if (!content) {
DDL_log('DirectDL (' + site.pageURL + '): content is null, cannot find URL.');
var content = element.innerHTML;
if (!content) {
DDL_log('DirectDL (' + site.pageURL + '): content is null, cannot find URL.');
+ return URL;
+}
+
+function _add_link(site, URL) {
+
var links = document.getElementById(site.linkDest);
if (!links) {
DDL_log('DirectDl (' + site.pageURL + '): Cannot add the direct download link.');
var links = document.getElementById(site.linkDest);
if (!links) {
DDL_log('DirectDl (' + site.pageURL + '): Cannot add the direct download link.');