Black Hole
May contain traces of nut
It's gonna have to wait until next week...
NoDoes theNew Bookmarks
entry show?
Win7/Chrome / No, but it's worked beforeWhich browser, have you cleared the cache.
No - what does that tell us?Does the progress bar disappear on completion?
If your browser has aninspect option
click on inspect over the back button, is<button id="back" class="ui-button ui-corner-all ui-widget" style="display: inline-block;">Back to media list</button>
followed by:<button id="save" class="hidden ui-button ui-corner-all ui-widget" style="display: inline-block;"><span class="ui-button-icon ui-icon ui-icon-disk"></span><span class="ui-button-icon-space"> </span>Save New Bookmarks</button>
<button id="back" class="ui-button ui-corner-all ui-widget" style="display: inline-block;">Back to media list</button>
button id="save"
at all.No - what does that tell us?
if it doesn't scripts failed or isn't there!
nicesplice
for cropping not stripts?I haven't looked at the code but surely it isnicesplice
for cropping not stripts?
Don't have glasses on while watching F1 and misread c as t !The cropping code is unchanged, the save is achieved via jQuery, hence my reference to script.
Don't have glasses on while watching F1 and misread c as t !
Yes.are your recordings actually being cropped
HDRFOX1# cd mod/webif/html/browse/crop
HDRFOX1# ls
Mods crop.jim* crop.js* execute.jim* progress.jim* save.jim
HDRFOX1# ls -l
-rwxrw-rw- 1 root root 2.3K Sep 28 14:09 crop.jim*
-rwxrw-rw- 1 root root 1.1K Sep 28 14:09 crop.js*
-rwxrw-rw- 1 root root 1.8K Sep 28 14:09 execute.jim*
-rw-r--r-- 1 root root 6.0K Oct 5 14:55 mods
-rwxrw-rw- 1 root root 492 Sep 28 14:09 progress.jim*
-rw-r--r-- 1 root root 366 Jun 16 2014 save.jim
HDRFOX1# chmod 766 save.jim
HDRFOX1# ls -l
-rwxrw-rw- 1 root root 2.3K Sep 28 14:09 crop.jim*
-rwxrw-rw- 1 root root 1.1K Sep 28 14:09 crop.js*
-rwxrw-rw- 1 root root 1.8K Sep 28 14:09 execute.jim*
-rw-r--r-- 1 root root 6.0K Oct 5 14:55 mods
-rwxrw-rw- 1 root root 492 Sep 28 14:09 progress.jim*
-rwxrw-rw- 1 root root 366 Jun 16 2014 save.jim*
HDRFOX1# patch < mods
patching file crop.jim
patching file crop.js
patching file execute.jim
HDRFOX1#
--- /mod/webif/html/browse/crop/crop_orig.jim
+++ /mod/webif/html/browse/crop/crop.jim
@@ -23,13 +23,13 @@
<tr><th>File:</th><td>$rfile</td></tr>
<tr><th>Length:</th><td>[clock format $len -format \"%T\"]</td></tr>
<tr><th>Size:</th><td>[pretty_size [$ts size]] ([$ts get definition])</td></tr>
-<tr><th>Bookmarks:</th><td>[$ts get bookmarks] @ "
+<tr><th>Bookmarks:</th><td id=originalbookmarks>[$ts get bookmarks] @ "
puts [join [lmap i [$ts bookmarks 1] {
clock format $i -format "%T"
}] ", "]
-puts "</td></tr><tr><th>File</th><td>"
+puts "</td></tr><tr><th>File</th><td id=cutplan>"
puts "<div style=\"position: relative; top: -10px\">"
@@ -86,7 +86,42 @@
</td></tr>
<tr><th>Keeping:</th><td>
[clock format $keeping -format "%T"] ([format "%.2f" $keepperc]%)
-</td></tr>
+</td></tr>"
+
+set end -1
+set removing 0
+set i 0
+set newbookmark ""
+foreach b $bookmarks {
+ if {$i == 0} {
+ set removing $b
+ append newbookmark "0 "
+ incr i 1
+ continue
+ }
+ if {$end == -1} {
+ set start $($b - $removing)
+ append newbookmark "$($start +3) "
+ set end 0
+ } else {
+ set end $($b - $removing)
+ incr removing $($end - $start)
+ set end -1
+ }
+}
+ set i $([llength $newbookmark] - 1)
+ if {[lindex $newbookmark end] > [expr $keeping - 8] && [expr $keeping - 8] > 0} {
+ set newbookmark [lreplace $newbookmark $i $i]
+ append newbookmark " $($keeping - 8)"
+ }
+
+puts "<tr><th title=\"Calculated bookmarks for edit points following crop.\">New Bookmarks:</th><td id=newbookmarks>"
+puts "<span id=\"bookmarks\" val=\"$newbookmark\">$newbookmark</span> ( "
+puts [join [lmap i $newbookmark {
+ clock format $i -format "%T"
+}] ", "]
+
+puts " )</td></tr>
<tr><th>Time:</th>
<td>Cropping will take around [clock format $esttime -format "%T"]</td></tr>
</table>
@@ -100,9 +135,11 @@
<div id=cropdiv style=\"padding: 1em\">
<button id=invert invert=$invert>Invert selection</button>
<button id=cropit>Perform crop operation</button>
+<input id=saveIt type=checkbox name=saveIt checked /> Then Save New Bookmarks?
+<label id=saveItLabel for=saveIt> </label>
</div>
<button id=back>Back to media list</button>
-
+<button id=save class=\"hidden\">Save New Bookmarks</button>
+<div id=results class=\"hidden blood\"></div>
<div id=progressdiv class=hidden>
Cropping: <div id=progressbar></div>
</div>
--- /mod/webif/html/browse/crop/crop_orig.js
+++ /mod/webif/html/browse/crop/crop.js
@@ -3,8 +3,8 @@
function update()
{
var perc = $('#params').attr('perc');
- var file = $('#params').attr('file');
-
+ var file = escapestring($('#params').attr('file'));
+
$.get('progress.jim' + '?perc=' + perc + '&file=' + file,
function(data) {
if (handle)
@@ -12,15 +12,28 @@
});
}
+function escapestring (str) {
+ str = JSON.stringify(String(str));
+ str = str.substring(1, str.length-1);
+ return str;
+}
+
$(document).ready(function() {
+
+ $('#saveIt').hide();
+ $('#progressbar').reportprogress(0);
+ $('#saveItLabel').css({'height':'22px','width':'70px','background-image':'url("/img/on.png")',
+ 'display':'inline-block','background-size':'cover'});
+ $("#saveIt").change(function(){
+ if($(this).is(":checked")) $(this).next("label").css('background-image','url("/img/on.png")');
+ else $(this).next("label").css('background-image','url("/img/off.png")');
+ });
-$('#progressbar').reportprogress(0);
+ $('#back').button().click(function() {
+ window.location = '/go/browse?dir=' + $('#params').attr('dir');
+ });
-$('#back').button().click(function() {
- window.location = '/go/browse?dir=' + $('#params').attr('dir');
-});
-
-$('#cropit').button().click(function() {
+ $('#cropit').button().click(function() {
$('#cropdiv').hide('slow');
$('#progressdiv').show('slow');
$('#back').hide();
@@ -31,15 +44,43 @@
function() {
clearInterval(handle);
handle = 0;
- $('#back').show();
+ $('#back').show('slow');
+ $('#save').show('slow');
+ $('#cutplan').html('File cropping complete');
+ $('#originalbookmarks').html('Empty');
$('#progressbar').reportprogress(100);
+ if($('#saveIt').prop('checked')){
+ $.post('save.jim', {
+ file: $('#fileparams').attr('file'),
+ bookmarks: $('#bookmarks').attr('val')
+ }, function(data) {
+ $('#results').html(data)
+ .slideDown('slow').delay(6000).slideUp('slow')
+ .css('color','green');
+ $('#originalbookmarks').html($('#newbookmarks').clone());
+ $('#progressdiv').delay(3000).text('Cropping complete.');
+ });
+ }
});
+ });
+
+ $('#invert').button().on('click', function() {
+ window.location = 'crop.jim?file=' + $('#params').attr('file') +
+ '&invert=' + ($(this).attr('invert') == '1' ? '0' : '1');
+ });
+
+ $('#save').button({icons: {primary: "ui-icon-disk"}})
+ .on('click', function() {
+ $('#progressdiv').hide();
+ $('#output').hide();
+ $.post('save.jim', {
+ file: $('#fileparams').attr('file'),
+ bookmarks: $('#bookmarks').attr('val')
+ }, function(data) {
+ $('#results').html(data)
+ .slideDown('slow').delay(6000).slideUp('slow')
+ .css('color','green');
+ $('#originalbookmarks').html($('#newbookmarks').clone());
+ });
+ });
});
-$('#invert').button().on('click', function() {
- window.location = 'crop.jim?file=' + $('#params').attr('file') +
- '&invert=' + ($(this).attr('invert') == '1' ? '0' : '1');
-});
-
-});
-
--- /mod/webif/html/browse/crop/execute_orig.jim
+++ /mod/webif/html/browse/crop/execute.jim
@@ -68,6 +68,10 @@
set newname "$shname-[clock seconds]"
puts "Renaming file group to $newname"
+puts "<span class=hidden id=fileparams
+ file=\"$dir/$newname.ts\"
+></span>"
ts renamegroup "$dir/$shname.ts" $newname
exec /mod/bin/hmt "+setfilename=$newname" "$dir/$newname.hmt"
# New nicesplice shrinks whilst cropping.
HDRFOX1# cd mod/webif/html/browse/crop
HDRFOX1# ls -l
-rwxrw-rw- 1 root root 2.3K Oct 27 15:37 crop.jim*
-rwxrw-rw- 1 root root 1.1K Oct 27 15:37 crop.js*
-rwxrw-rw- 1 root root 1.8K Oct 27 15:37 execute.jim*
-rw-r--r-- 1 root root 6.0K Oct 5 14:55 mods
-rwxrw-rw- 1 root root 492 Sep 28 14:09 progress.jim*
-rwxrw-rw- 1 root root 366 Jun 16 2014 save.jim*
-rw-r--r-- 1 root root 3.0K Oct 5 15:08 telnet.txt
HDRFOX1# cksum *
3347949094 2366 crop.jim
107235942 1083 crop.js
2386013374 1803 execute.jim
880548162 6135 mods
1159930503 492 progress.jim
2825685166 366 save.jim
991945617 3107 telnet.txt
HDRFOX1# cd ../crop.bak
HDRFOX1# cksum *
3347949094 2366 crop.jim
107235942 1083 crop.js
2386013374 1803 execute.jim
1159930503 492 progress.jim
HDRFOX1# cd ../crop
HDRFOX1# patch < mods
patching file crop.jim
patching file crop.js
patching file execute.jim
HDRFOX1# ls -l
-rwxrw-rw- 1 root root 2.3K Oct 28 22:29 crop.jim*
-rwxrw-rw- 1 root root 1.1K Oct 28 22:29 crop.js*
-rwxrw-rw- 1 root root 1.8K Oct 28 22:29 execute.jim*
-rw-r--r-- 1 root root 6.0K Oct 5 14:55 mods
-rwxrw-rw- 1 root root 492 Sep 28 14:09 progress.jim*
-rwxrw-rw- 1 root root 366 Jun 16 2014 save.jim*
-rw-r--r-- 1 root root 3.0K Oct 5 15:08 telnet.txt
HDRFOX1# cksum *
3347949094 2366 crop.jim
107235942 1083 crop.js
2386013374 1803 execute.jim
880548162 6135 mods
1159930503 492 progress.jim
2825685166 366 save.jim
991945617 3107 telnet.txt
HDRFOX1#
humax# cd mod/webif/html/browse/crop
humax# ls -l
-rwxr-xr-x 1 root root 3519 May 22 16:27 crop.jim
-rwx------ 1 root root 2643 Jun 2 12:36 crop.js
-rwxr-xr-x 1 root root 2366 Feb 5 2016 crop_orig.jim
-rwx------ 1 root root 1083 Feb 5 2016 crop_orig.js
-rwx------ 1 root root 2034 May 22 16:27 execute.jim
-rwxr-xr-x 1 root root 492 Dec 28 2013 progress.jim
-rwxrwxrwx 1 root root 418 Dec 30 2018 save.jim
humax# cksum *
3542961729 3519 crop.jim
3176875196 2643 crop.js
3347949094 2366 crop_orig.jim
107235942 1083 crop_orig.js
2719064947 2034 execute.jim
1159930503 492 progress.jim
2734003092 418 save.jim
This perhaps?...
I don't know why your file names have the * suffix!
# ls --help
...
-F, --classify append indicator (one of */=>@|) to entries
...
# alias ls='ls -F'
...
indicator | file type |
---|---|
* | regular file with executable permission |
/ | directory |
= | socket |
> | door (Solaris RPC) |
@ | symbolic link |
| | FIFO (pipe) |
Fine, that's what I decided, but why isn't patch working? And I cannot understand why it worked before (I am sure it did, but cannot find any evidence, I recall being satisfied).Your files are clearly unmodified from the originals, which is why your not seeing the changes!
That's less of a mystery than why the capital M!I don't know why your file names have the * suffix!
The version of patch in Busybox is old and stupid. It doesn't complain about things it should complain about. If you copy the diffs as posted on to a sane system and attempt it, then it tells you they are all garbage.Fine, that's what I decided, but why isn't patch working?
Would suggest the OP does it and posts proper diffs.Please would somebody zip up and post their (modified) crop folder.
+puts " )</td></tr>
<tr><th>Time:</th>
<td>Cropping will take around [clock format $esttime -format "%T"]</td></tr>
</table>
Me neither, with @Matthew's permission I can get these changes incorporated into webif.It would be so much easier if this mod was incorporated into the base set - I can't see any reason not to.
So what you are saying is that, other than the OP, nobody will have been able to replicate? So I guess I must have been deluded to think I had success when I first looked into it....I gave up.
:relief:Me neither, with @Matthew's permission I can get these changes incorporated into webif.
FWIW, there is also a missing " here:
Me neither, with @Matthew's permission I can get these changes incorporated into webif.