Author Topic: my improvement for file rename  (Read 970 times)

Offline noname8

  • Posts: 141
my improvement for file rename
« on: June 13, 2016, 10:39:33 AM »
Here is my 5 cents for file rename, make it closer to what it is usually is used for.
- Rename not copy for default
- Original filename in the input already

Code: [Select]
admin\themes\templates\media_rename.htt
@@ -24,9 +24,13 @@
 </tr>
 <tr>
     <td>
-        <input type="text" name="name" style="width: 100%;" />
+        <input type="text" id="filename" name="name" style="width: 100%;" />
         <script type="text/javascript">
+        //better rename fix 20160613
         document.rename.name.focus();
+        var fname='{FILENAME}';
+        fname = fname.substr(0, fname.lastIndexOf('.'));
+        document.rename.name.value=fname;
         </script>
     </td>
     <td width="50" class="{DISPlAY_EXTENSION}">
@@ -35,7 +39,7 @@
 </tr>
 <tr>
     <td colspan="2">
-        <input type="checkbox" name="overwrite" id="overwrite" value="yes" />
+        <input type="checkbox" name="overwrite" id="overwrite" value="yes" checked="checked" />
         <label for="overwrite">
         {TEXT_OVERWRITE_EXISTING} {TYPE}
         </label>




Offline dbs

  • Betatester
  • **
  • Posts: 7671
  • Gender: Male
  • tioz4ever
    • WebsiteBaker - jQuery-Plugins - Module - Droplets - Tests
Re: my improvement for file rename
« Reply #1 on: June 13, 2016, 06:03:23 PM »
I agree with original filename.
The Checkbox is useless, because without check the file will also overwritten (SP6).

 

postern-length