
function doRotation()
{
  $('play_panel').setAttribute('style', 'display:none');
  $('rotate_panel').setAttribute('style', 'visibility:visible');
  var oneSecond = 1000;
  setTimeout( "endRotation();", 10 * oneSecond);
}

function endRotation()
{
  $('rotate_panel').setAttribute('style', 'display:none');
  $('play_panel').setAttribute('style', 'visibility:visible');
  // refresh caretPos in current filename
  loadFile(current_filename);
}


@@ -14,24 +14,45 @@
 otation()%0A%7B%0A
+  saveCurrentFile();%0A
   $('play_pa

save current file before rotation to ensure edits are not lost