From 945007f73d32b3d04443882deb767b2975b5be06 Mon Sep 17 00:00:00 2001 From: hummypkg Date: Tue, 3 Jun 2014 22:03:23 +0000 Subject: [PATCH] add nav buttons + browse hooks git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1927 2a923420-c742-0410-a762-8d5b09965624 --- webif/html/browse/assets.jim | 17 ++++++++ webif/html/browse/index.jim | 7 ++- webif/html/browse/script.js | 40 ++++++------------ webif/html/img/nav/bottom-grey.png | Bin 0 -> 315 bytes webif/html/img/nav/bottom.png | Bin 0 -> 319 bytes webif/html/img/nav/down-grey.png | Bin 0 -> 296 bytes webif/html/img/nav/down.png | Bin 0 -> 300 bytes webif/html/img/nav/first-grey.png | Bin 0 -> 309 bytes webif/html/img/nav/first.png | Bin 0 -> 326 bytes webif/html/img/nav/last-grey.png | Bin 0 -> 323 bytes webif/html/img/nav/last.png | Bin 0 -> 325 bytes webif/html/img/nav/left-grey.png | Bin 0 -> 290 bytes webif/html/img/nav/left.png | Bin 0 -> 300 bytes webif/html/img/nav/right-grey.png | Bin 0 -> 295 bytes webif/html/img/nav/right.png | Bin 0 -> 299 bytes webif/html/img/nav/top-grey.png | Bin 0 -> 299 bytes webif/html/img/nav/top.png | Bin 0 -> 316 bytes webif/html/img/nav/up-grey.png | Bin 0 -> 289 bytes webif/html/img/nav/up.png | Bin 0 -> 300 bytes webif/html/lib/jquery.plugin/enadis/enadis.js | 3 +- webif/lib/bin/auto | 17 ++++++++ webif/lib/browse.class | 4 +- 22 files changed, 58 insertions(+), 30 deletions(-) create mode 100644 webif/html/img/nav/bottom-grey.png create mode 100644 webif/html/img/nav/bottom.png create mode 100644 webif/html/img/nav/down-grey.png create mode 100644 webif/html/img/nav/down.png create mode 100644 webif/html/img/nav/first-grey.png create mode 100644 webif/html/img/nav/first.png create mode 100644 webif/html/img/nav/last-grey.png create mode 100644 webif/html/img/nav/last.png create mode 100644 webif/html/img/nav/left-grey.png create mode 100644 webif/html/img/nav/left.png create mode 100644 webif/html/img/nav/right-grey.png create mode 100644 webif/html/img/nav/right.png create mode 100644 webif/html/img/nav/top-grey.png create mode 100644 webif/html/img/nav/top.png create mode 100644 webif/html/img/nav/up-grey.png create mode 100644 webif/html/img/nav/up.png diff --git a/webif/html/browse/assets.jim b/webif/html/browse/assets.jim index a1f3e43..139fdd3 100755 --- a/webif/html/browse/assets.jim +++ b/webif/html/browse/assets.jim @@ -38,6 +38,16 @@ if $nicesplice { puts {
  • Toggle Lock
  • Toggle New
  • +} + +if {[llength $plugins(menu)]} { + foreach plugin $plugins(menu) { + lassign $plugin tag options + puts "
  • $options(desc)
  • " + } +} + +puts { diff --git a/webif/html/browse/index.jim b/webif/html/browse/index.jim index f203b08..d93d045 100755 --- a/webif/html/browse/index.jim +++ b/webif/html/browse/index.jim @@ -2,10 +2,15 @@ package require cgi source /mod/webif/lib/setup -require ts.class pretty_size system.class settings.class escape browse.class +require ts.class pretty_size system.class settings.class escape browse.class \ + plugin jqplugin contextMenu bar enadis jscss script.js style.css + +set plugins { dmenu {} menu {} } +eval_plugins browse + header set nicesplice [system pkginst nicesplice] diff --git a/webif/html/browse/script.js b/webif/html/browse/script.js index 44268c1..47323e3 100755 --- a/webif/html/browse/script.js +++ b/webif/html/browse/script.js @@ -1,4 +1,9 @@ +var plugins = { + menu: {}, + dmenu: {} +}; + var dir; function disableall() @@ -131,24 +136,6 @@ function new_folder_callback(data, status, xhr) $.each(data, set_folder_new); } -//function insert_shrunk(file, perc) -//{ -// if (perc == 0) -// { -// file = file.replace(/[ ]/g, ''); -// file = file.replace(/([ #;&,.+*~\':"!^$[\]()=>|\/@])/g, '\\$1'); -// //console.log("File: (%s) = (%s)", file, perc); -// $('#sp_' + file).show(); -// } -//} - -//function shrunk_callback(data, status, xhr) -//{ -// //console.log("Status: %s", status); -// //console.dir(data); -// $.each(data, insert_shrunk); -//} - function delete_callback(file, dir, id) { var el = 'div.bf#' + id; @@ -471,9 +458,6 @@ var menuclick = function(action, el, pos) break; case 'vthm': -// window.open('/browse/bmpw.jim?file=' + file, 'hxwebifbmp', -// 'height=156,width=280,toolbar=no,' + -// 'scrollbars=no,menubar=no,location=no,titlebar=no'); $('#thmbmp').attr('src', 'bmp.jim?file=' + file); $('#bmpdialogue').dialog('open'); break; @@ -515,7 +499,10 @@ var menuclick = function(action, el, pos) break; default: - alert('Unhandled action: ' + action); + if (plugins.menu[action]) + plugins.menu[action](file); + else + alert('Unhandled action: ' + action); break; } }; @@ -668,7 +655,10 @@ var dmenuclick = function(action, el, pos) break; default: - alert('Unhandled action: ' + action); + if (plugins.dmenu[action]) + plugins.dmenu[action](file); + else + alert('Unhandled action: ' + action); break; } }; @@ -850,10 +840,6 @@ var dmenuclick = function(action, el, pos) $.getJSON('/browse/sizes.jim?dir=' + encodeURIComponent(dir), folder_size_callback); - // Flag shrunk recordings -// $.getJSON('/browse/shrunk.jim?dir=' + encodeURIComponent(dir), -// shrunk_callback); - // Flag folders with unwatched items $.getJSON('/browse/newdir.jim?dir=' + encodeURIComponent(dir), new_folder_callback); diff --git a/webif/html/img/nav/bottom-grey.png b/webif/html/img/nav/bottom-grey.png new file mode 100644 index 0000000000000000000000000000000000000000..cf428649e287e4a2cb93542b533d1a62b82cd867 GIT binary patch literal 315 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbK}V1Q4ED+2>-aBy&Wd3j@FV{2<` zZ*T9EDO09TpFV5WtoifjFI~EH`SRs!)~q>v`0$YCwIUCP}J&*-j$KdJe=d#Wz Gp$Py*#d){@ literal 0 HcmV?d00001 diff --git a/webif/html/img/nav/bottom.png b/webif/html/img/nav/bottom.png new file mode 100644 index 0000000000000000000000000000000000000000..f8054d8fd3da4c20b71db2dcb23b9939eaba7979 GIT binary patch literal 319 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbK}NPtg>E0E^k71VN$HV(=&kF2my z?QqSX=2J~wOY`Pthp%-Mc%-j0h4c3obw z_v-qiw>BNWz4hdsZKv+;yYLWbpvV@L3LwQ;666=m;PC858iv zL>4nJa0`PlBg3pY5H=O_A5Lhf_gj-OG81pgqjKA8Q$<#rMtE(U=+*k0V{N?PKWkT=d5ZUE9u-o0 zw(+vi#1jY4grzmCnLp{wT(z?~M>KaHIVf%NK}YQ0@%U7>n zy>{)|_3PKYy}h><@O=fE#aI&L7tG-B>_!@hljQC0!qCAg>jC6&7I;J!Gca%qgD@k* ztT_@uLG}_)Usv`kJR*XIjGz6~je$auo-U3d6}OTT6u3H^874Jo*qcjhZ)(`EfPve1 zQ$q)X{Hg|tHU@ipCx(=L67nZ_X1G3@!{p@P92qg=L6!vz3(JHb3W9NtDR#`v%HsT7 j@+;b6W$s#A*m5!O_p;^+EtcI5w1mOa)z4*}Q$iB}YZqkM literal 0 HcmV?d00001 diff --git a/webif/html/img/nav/down.png b/webif/html/img/nav/down.png new file mode 100644 index 0000000000000000000000000000000000000000..7ebe4ce5b2e6e48c491c33ed559c887a671eea1d GIT binary patch literal 300 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!cYsfbD=PyR2d|)(bF_J6g?(y= zYyLFPk~uz=ivt?gMt5wA@7^+T!&ZLYPTd8X*B1YZ9Y`^j1o;IsI6S+N2I3@nySp%Su*!M>Ih+L^k;M!Q+`=Ht z$S`Y;1W=H@#M9T6{R)qWpnOV@SoV`9-rk8JWuL`-h5&}Ni7d+(Y?#2n&CM+w!`t4_z#t^Aa!9-7OnO4X mlShsZnXhi}UQo@x+?`SDIqMu#L4|mrEexKnelF{r5}E+?zhWx@ literal 0 HcmV?d00001 diff --git a/webif/html/img/nav/first-grey.png b/webif/html/img/nav/first-grey.png new file mode 100644 index 0000000000000000000000000000000000000000..77058a33aa2790b3aab461c72be1c6e73f5bbf63 GIT binary patch literal 309 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!M}SX=E0E62%q%M_D=#mvs;X*i zZ0zmroj!f~%$YOStXXsX`0*1bPMkb>^3?NMQuIyKMLjwrkdv z>3&X3hnc&BbQy|*k2LSmXbNKg$F-qdfvINB_1e32f{e@VT4&$2YE5)Jo~NuNKBL)S yA=~7ON|RnHCyQOYqU~11W7?iKdE5R!pP1hDaij!ni?|20k-^i|&t;ucLK6UK6?m)w literal 0 HcmV?d00001 diff --git a/webif/html/img/nav/first.png b/webif/html/img/nav/first.png new file mode 100644 index 0000000000000000000000000000000000000000..78cf6fe8dedd987d8407bcf35df61bd40cd1e0be GIT binary patch literal 326 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbK}cz{ocE0C7awbgWr(sGX0bx$x3 z$}ZxES=|Fu_%4wj*Lk=XKg({d)tLM+b_=BadH06OAB^gUcBeZlD$`#?Yp|_ z;PusqZmc_UbN$g<`z|~@a^>;St51MtPBRh`15%77L4Lsu4$p3+fjCLt?k)@+tg;?J z4rhT!WHAE+w=f7ZGR&GI0Tg5}@$_|NzrrITXed@NchMK1P==?AV@SoV*8Y=x4GKIi zcMDs)y1G99zpojjGO=4f^U^*!tFxO#7#3C@?c7k&`bG9l_<<|~orLRWWzw!Qb4TpV zn58BaZT{ti{;a8!p1hbNu+B>`BcdYMCdAQ3ElzOG;vUOaCYirZ>zjY{;gYG&U-lYk OCxfS}pUXO@geCwx8hfY! literal 0 HcmV?d00001 diff --git a/webif/html/img/nav/last-grey.png b/webif/html/img/nav/last-grey.png new file mode 100644 index 0000000000000000000000000000000000000000..6b2a7cb0f233f99dace8f0aa333996b285fa5612 GIT binary patch literal 323 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbK}V1Q4ED+2>daBy&Wd3j@FV{2<` zZ*T9EDO09TpFV5WtoifjFI~EH`SRs!)~q>v`0$YCb-Z+%xbMJjZ;l zYK^k%nGM$%Kb-EKv#8>glXP?6`u9SX-2z4D7JbQB+P=@M_QN~E0E^k71VN$HV(=&kF2my z?QqSX=2J~wOY`Pthp%-Mc%-j0h4c3obw z_v-qiw>BNWz4hdsZKv+;yYLWbpvV@L3LwQ;666=m;PC858iv zL>4nJa0`PlBg3pY5H=O_A5Lhf<_`+_f3!n3T1h^IEGZ*s_j3?*Py`TQh2bo zv5EWK|NqM!E;a|oJKd^$nJDl`b_rulleo?p}&a)xhv-SgR OW$<+Mb6Mw<&;$UN!h0$J literal 0 HcmV?d00001 diff --git a/webif/html/img/nav/left-grey.png b/webif/html/img/nav/left-grey.png new file mode 100644 index 0000000000000000000000000000000000000000..a4c50623a519bb413127eae97e8c1fac01ceae05 GIT binary patch literal 290 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!Yk*IPE0E62%q%M_D=#mvs;X*i zZ0zmroj!f~%$YOStXXsX`0*1bPMkb>^3<>&kwGM?}zAVD*VqXP{7+r;B4q#jVzUPoV|_4wlFJSX_J${hzNDXd&VK_I61i zkHvSU={p7H>^N~meA;%~BLbO8XEz8{^?xqt(t60mpwVM>@rzfw^^q$xukAW=Cu-Br e-Cus5W@ndu&FVYv&|y!Y4Gf;HelF{r5}E*9TX69J literal 0 HcmV?d00001 diff --git a/webif/html/img/nav/left.png b/webif/html/img/nav/left.png new file mode 100644 index 0000000000000000000000000000000000000000..ac35e76fff446079d3b1ac974650cedfadfa4eb4 GIT binary patch literal 300 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!Uw}`DE0C7awbgWr(sGX0bx$w} z&bLqP@GPC@U9l)*(#~01&(Gd=Vb1o8^LAXEzw^?9U6&W{xw2&M)n)sxt~z*q^`RT< zj@(>-^wyCpkB?q`0y24p-YX!*SQ6wH%;50sMjD8d%U7>n zy>{)|_3PKYy}h><@O=fE#aI&L7tG-B>_!@hljQC0!qCAg>jC6&7I;J!Gca%qgD@k* ztT_@uLG}_)Usv`kJR*X|TDeE|d;|(bc)B=-RNU(Ai{xui;Bk4~7cCic>-YUD9SxjW zkABa-?zzk*{)O`sx9Yw5ax*eY;>`sk6S@@EFzZ;KIehh^;2E)o*;e^m)-tDNm|XQd kRjB%O$JD3O{a@;{>+7=Ss;|0y6=(;8r>mdKI;Vst0M%S{i2wiq literal 0 HcmV?d00001 diff --git a/webif/html/img/nav/right.png b/webif/html/img/nav/right.png new file mode 100644 index 0000000000000000000000000000000000000000..0b520427b1bc5afc383025f44c9883bfa820748a GIT binary patch literal 299 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!cYsfbD=PyR2d|)(bF_J6g?(y= zYyLFPk~uz=ivt?gMt5wA@7^+T!&ZLYPTd8X*B1YZ9Y`^j1o;IsI6S+N2I3@nySp%Su*!M>Ih+L^k;M!Q+`=Ht z$S`Y;1W=H@#M9T6{R)qWps|#puDALo#F{I*FZ(k%|g949B;qhL+9b3NJuM}hy zzH;Qd`TEH|Q-3+hDVbk7UHdsgw)f5JV`sQa1X(N_dJfyf$V#p?WI5nF*Zk78MkAA1 nuT-Aym{fG<)Th(SU+J@ZeP^9Bb6W2rpd}2Ru6{1-oD!M^3?NMQuIyKMLaT^vIyZpEH|&DWs7;gGn?BXYu2wfFy*U5w(k z{Qu)v3R4HK$xe^%6|LfbjzzQQ1|2ZxES=|Fu_%4wj*Lk=XKg({d)tLM+b_=BadH06OAB^gUcBeZlD$`#?Yp|_ z;PusqZmc_UbN$g<`z|~@a^>;St51MtPBRh`15%77L4Lsu4$p3+fjCLt?k)@+tg;?J z4rhT!WHAE+w=f7ZGR&GI0Tg5}@$_|NzrrITXl%^6Uc?Y66zA#U7*cU7_Pi%wg8_#_ zpiJSKi07yNp4VJv81%1CJSd3aTH}%FldYz#;wV#|<|uW4&bdY|zclm3LVT}{9_q{d zdB$p2x&G}FgYfj9GM)~$yP_>lG|2OO@r|A?b>+O=-#1(`Iq#F?fHpCBy85}Sb4q9e E00|9rD*ylh literal 0 HcmV?d00001 diff --git a/webif/html/img/nav/up-grey.png b/webif/html/img/nav/up-grey.png new file mode 100644 index 0000000000000000000000000000000000000000..62e1666af78b99b684f7bcd2723aada6a7820125 GIT binary patch literal 289 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!Yk*IPE0E62%q%M_D=#mvs;X*i zZ0zmroj!f~%$YOStXXsX`0*1bPMkb>^3<>&kwGM?}y>NhfX*3s5N3)5S5Q;#TjOn|uulJT4b^UG0q$o$>#Fh+$iYug4z$ zGoH+WOONHa%+Qs!yPX@u@o1xU9c!S!?*vv&{l443C*~j0;_UL@+p54;VrbBR`NH%M cF8_Bi9Is*Z{cR|$477m3)78&qol`;+0B$>M1poj5 literal 0 HcmV?d00001 diff --git a/webif/html/img/nav/up.png b/webif/html/img/nav/up.png new file mode 100644 index 0000000000000000000000000000000000000000..880e71e714837099a215a55bb968a21db371e309 GIT binary patch literal 300 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!Uw}`DE0C7awbgWr(sGX0bx$w} z&bLqP@GPC@U9l)*(#~01&(Gd=Vb1o8^LAXEzw^?9U6&W{xw2&M)n)sxt~z*q^`RT< zj@(>-^wyCpkB?q`0y24p-YX!*SQ6wH%;50sMjD8d z{Pxn5I+pC1pr9}9Vj#fIz;~AQTHV@rML;VUJYD@<);T3K0RUQ#VRirj literal 0 HcmV?d00001 diff --git a/webif/html/lib/jquery.plugin/enadis/enadis.js b/webif/html/lib/jquery.plugin/enadis/enadis.js index ccbc988..9656c76 100755 --- a/webif/html/lib/jquery.plugin/enadis/enadis.js +++ b/webif/html/lib/jquery.plugin/enadis/enadis.js @@ -6,7 +6,8 @@ $(this) .removeClass('ui-state-disabled') .removeClass('ui-button-disabled') - .removeProp('disabled'); + .removeProp('disabled') + .removeAttr('aria-disabled'); }); }; diff --git a/webif/lib/bin/auto b/webif/lib/bin/auto index f83173f..2a92cc0 100755 --- a/webif/lib/bin/auto +++ b/webif/lib/bin/auto @@ -574,6 +574,22 @@ proc expire {dir} { } } +proc scan_run {dir flag callback} { + global dustbin + + if {$dir eq $dustbin} return + + if {[string match {\[*} [file tail $dir]]} return + + if {[file exists "$dir/.$flag"]} { $callback $dir } + + foreach entry [readdir -nocomplain $dir] { + if {[file isdirectory "$dir/$entry"]} { + scan_run "$dir/$entry" $flag $callback + } + } +} + proc scan {dir attr {force 0} {recurse 1}} {{indent 0}} { global dustbin @@ -671,6 +687,7 @@ if {[lindex $argv 0] eq "-single"} { } else { foreach arg $modules { set st [clock milliseconds] + log "$arg scan starting." runplugin "pre${arg}scan" scan $root $arg runplugin "post${arg}scan" diff --git a/webif/lib/browse.class b/webif/lib/browse.class index 73aa287..a6cedeb 100644 --- a/webif/lib/browse.class +++ b/webif/lib/browse.class @@ -1,5 +1,5 @@ -require system.class +require system.class plugin #if {![exists -proc class]} { package require oo } #class browse {} @@ -104,6 +104,8 @@ proc {dir iconset} {dir} { lappend attrs "autoexpire=1" } + eval_plugins diriconset + return [list $icons $attrs] }