diff --git a/CONTROL/control b/CONTROL/control index bf78c4f..9f3c125 100644 --- a/CONTROL/control +++ b/CONTROL/control @@ -1,7 +1,7 @@ Package: webif Priority: optional Section: web -Version: 1.0.14-1 +Version: 1.0.14-2 Architecture: mipsel Maintainer: af123@hummypkg.org.uk Depends: webif-channelicons(>=1.1.11),lighttpd(>=1.4.35-2),jim(>=0.75-1),jim-oo,jim-sqlite3(>=0.75),jim-cgi(>=0.7),jim-binary(>=0.75),service-control(>=1.2),busybox(>=1.20.2-1),lsof,epg(>=1.0.13),hmt(>=1.1.19),ssmtp,anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.0.2),webif-charts(>=1.2-1),stripts(>=1.2.5-3),smartmontools,tmenu(>=1.08),ffmpeg,id3v2,multienv(>=1.6),mongoose diff --git a/webif/html/lib/jquery.plugin/confirmAction/jconfirmaction.jquery.css b/webif/html/lib/jquery.plugin/confirmAction/jconfirmaction.jquery.css index c322c74..ad87228 100644 --- a/webif/html/lib/jquery.plugin/confirmAction/jconfirmaction.jquery.css +++ b/webif/html/lib/jquery.plugin/confirmAction/jconfirmaction.jquery.css @@ -7,11 +7,12 @@ height: 78px; font-size: 13px; line-height: 1.5em; - background: url('/img/bubble.png') left top no-repeat; + background: url(/img/bubble.png) left top no-repeat; padding: 10px 0 0 0; text-shadow: 0px 1px 0px #fff; margin-left: -7em; margin-top: -6em; + z-index: 1000; opacity: 0; } @@ -24,7 +25,7 @@ height: 21px; color: #fff; text-shadow: 0px 1px 0px #000; - background: url('/img/button.png') left top no-repeat; + background: url(/img/button.png) left top no-repeat; } .jcatitle { diff --git a/webif/html/lib/jquery.plugin/confirmAction/jconfirmaction.jquery.js b/webif/html/lib/jquery.plugin/confirmAction/jconfirmaction.jquery.js index b9252d9..893c64b 100644 --- a/webif/html/lib/jquery.plugin/confirmAction/jconfirmaction.jquery.js +++ b/webif/html/lib/jquery.plugin/confirmAction/jconfirmaction.jquery.js @@ -1,50 +1,53 @@ /* * jQuery Plugin : jConfirmAction * - * by Hidayat Sagita + * Original by Hidayat Sagita * http://www.webstuffshare.com * Licensed Under GPL version 2 license. * + * Modified by af123 */ (function($){ - - jQuery.fn.jConfirmAction = function (options, callback) { - - // Some jConfirmAction options (limited to customize language) : - // question : a text for your question. - // yesAnswer : a text for Yes answer. - // cancelAnswer : a text for Cancel/No answer. - var theOptions = jQuery.extend ({ + jQuery.fn.dojConfirmAction = function(options, callback) { + var options = jQuery.extend ({ question: "Are You Sure?", yesAnswer: "Yes", cancelAnswer: "Cancel" }, options); - - return this.each (function () { - $(this).click(function(e) { - e.preventDefault(); + var obj = $(this); - var p = $(this); - - if($(this).next('.question').length <= 0) - $(this).after('
'+theOptions.question+'
'+theOptions.yesAnswer+''+theOptions.cancelAnswer+'
'); - - $(this).next('.jcaquestion').animate({opacity: 1}, 300); - - $('.jcayes').bind('click', function() { - callback(p); - }); - - $('.jcacancel').bind('click', function(){ - $(this).parents('.jcaquestion').fadeOut(300, function() { - $(this).remove(); - }); - }); - + if (obj.next('.jcaquestion').length <= 0) + { + obj.after('
' + + options.question + '
' + + '' + options.yesAnswer + + '' + + '' + options.cancelAnswer + + '
'); + + o = obj.next('.jcaquestion'); + + o.animate({opacity: 1}, 300); + o.find('.jcayes').on('click', function() { + callback(obj); }); - - }); + o.find('.jcacancel').on('click', function() { + $(this).parents('.jcaquestion') + .fadeOut(300, function() { + $(this).remove(); + }); + }); + } } + + jQuery.fn.jConfirmAction = function(options, callback) { + return this.each(function () { + $(this).on('click', function(e) { + e.preventDefault(); + $(this).dojConfirmAction(options, callback); + }); + }); + }; })(jQuery); diff --git a/webif/html/lib/jquery.plugin/enadis/enadis.js b/webif/html/lib/jquery.plugin/enadis/enadis.js index 9656c76..216cf24 100755 --- a/webif/html/lib/jquery.plugin/enadis/enadis.js +++ b/webif/html/lib/jquery.plugin/enadis/enadis.js @@ -6,7 +6,7 @@ $(this) .removeClass('ui-state-disabled') .removeClass('ui-button-disabled') - .removeProp('disabled') + .prop('disabled', false) .removeAttr('aria-disabled'); }); }; diff --git a/webif/include/diskspace.jim b/webif/include/diskspace.jim index da337bd..9458dd9 100755 --- a/webif/include/diskspace.jim +++ b/webif/include/diskspace.jim @@ -1,9 +1,18 @@ #!/mod/bin/jimsh source /mod/webif/lib/setup -require system.class +require system.class pretty_size + +lassign [system diskspace 1] size used perc free fperc tsrbuf tsrused + +# Calculate the TSR reserve +set tsrreserve $($tsrbuf - $tsrused) +# Adjust values to account for the TSR reserve +set free $($free - $tsrreserve) +set used $($size - $free) +set fperc $($free * 100 / $size) +set perc $(100 - $fperc) -lassign [system diskspace] size used perc free fperc set dsindex $($perc * 25 / 100 + 1) if {$dsindex > 25} { set dsindex 25 } set dsfile [format "%02d" $dsindex] @@ -27,9 +36,9 @@ puts "
- Total space: $size
- Used: $used ($perc%)
- Free: $free ($fperc%) + Total space: [pretty_size $size]
+ Used: [pretty_size $used] ($perc%)
+ Free: [pretty_size $free] ($fperc%)
" diff --git a/webif/lib/system.class b/webif/lib/system.class index 64de84d..10083e9 100644 --- a/webif/lib/system.class +++ b/webif/lib/system.class @@ -181,13 +181,24 @@ proc {system diskspace} {{raw 0}} { set perc $($used * 100 / $size) set fperc $(100 - $perc) + if {[file isdirectory /mnt/hd2/Tsr]} { + set tsrbuf 21474836480 + lassign [exec du -ks /mnt/hd2/Tsr] tsrused + set tsrused $($tsrused * 1024) + } else { + set tsrbuf 0 + set tsrused 0 + } + if {!$raw} { set size [pretty_size $size] set free [pretty_size $free] set used [pretty_size $used] + set tsrbuf [pretty_size $tsrbuf] + set tsrused [pretty_size $tsrused] } - return [list $size $used $perc $free $fperc] + return [list $size $used $perc $free $fperc $tsrbuf $tsrused] } proc {system diskfree} {} {