Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Fix bookmarklet
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed Sep 8, 2014
1 parent 2e548ff commit 7c48d24
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
10 changes: 7 additions & 3 deletions core/src/plugins/gui.light/ajxp-dl-later.js
Expand Up @@ -20,7 +20,11 @@
window.logAjxpEven = false;
function logAjxpBmAction(text){
window.logAjxpEven = !window.logAjxpEven;
$('actions_log').insert('<div class="ajxp_bm_log_action" style="background-color:#'+(window.logAjxpEven?'eee':'fff')+'">' + text + '<div>');
if($('actions_log')){
$('actions_log').insert('<div class="ajxp_bm_log_action" style="background-color:#'+(window.logAjxpEven?'eee':'fff')+'">' + text + '<div>');
}else if(window.console){
console.log(text);
}
}
function string_to_slug(str) {
str = str.replace('https://', '').replace('http://', '');
Expand Down Expand Up @@ -61,7 +65,7 @@ document.observe("ajaxplorer:gui_loaded", function(){
//logAjxpBmAction('Creating download file ' + filename + ' pointing to ' + params['dl_later']);
conn.sendSync();

if(params["dl_now"] && params["dl_now"] == "true"){
if(params["dl_now"] && params["dl_now"].startsWith("true")){
window.setTimeout(function(){
conn.setMethod('GET');
conn.setParameters({
Expand All @@ -71,7 +75,7 @@ document.observe("ajaxplorer:gui_loaded", function(){
delete_dlfile:'true',
dir:params['folder'] || '/'
});
//logAjxpBmAction('Triggering download in background. This window will close automatically.');
logAjxpBmAction('Triggering download in background. This window will close automatically.');
conn.onComplete = function(){
logAjxpBmAction('Download started');
document.location.href="plugins/gui.light/close.html";// Will trigger the onload event to close the frame!!
Expand Down
6 changes: 6 additions & 0 deletions core/src/plugins/gui.light/manifest.xml
Expand Up @@ -49,6 +49,12 @@
</div>
</div>
]]></template>
<template name="main_vision" element="ajxp_desktop" position="top" theme="vision"><![CDATA[
<div id="actions_log" style="overflow: hidden;font-size: 17px;height: 128px;border-radius: 5px;background-color: #BBB;padding: 3px;"></div>
]]></template>
<template name="main_orbit" element="ajxp_desktop" position="top" theme="orbit"><![CDATA[
<div id="actions_log" style="overflow: hidden;font-size: 17px;height: 128px;border-radius: 5px;background-color: #BBB;padding: 3px;"></div>
]]></template>
</client_configs>
</registry_contributions>
<dependencies>
Expand Down

0 comments on commit 7c48d24

Please sign in to comment.