Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Side by Side Diff: chrome/browser/resources/filebrowse.html

Issue 1736006: Changing filebrowser to append a number on the end of an existing directory.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE HTML> 1 <!DOCTYPE HTML>
2 <html i18n-values="dir:textdirection;"> 2 <html i18n-values="dir:textdirection;">
3 <head> 3 <head>
4 <meta charset="utf-8"> 4 <meta charset="utf-8">
5 <title i18n-content="title"></title> 5 <title i18n-content="title"></title>
6 <style type="text/css"> 6 <style type="text/css">
7 div.header { 7 div.header {
8 border-bottom: 1px solid #7289E2; 8 border-bottom: 1px solid #7289E2;
9 padding: 8px; 9 padding: 8px;
10 margin: 0; 10 margin: 0;
(...skipping 836 matching lines...) Expand 10 before | Expand all | Expand 10 after
847 link.className = 'rowlink'; 847 link.className = 'rowlink';
848 848
849 var icon = document.createElement('div'); 849 var icon = document.createElement('div');
850 icon.className = getClassForPath('', isDirectory); 850 icon.className = getClassForPath('', isDirectory);
851 link.appendChild(icon); 851 link.appendChild(icon);
852 var input = document.createElement('input'); 852 var input = document.createElement('input');
853 input.className = 'name'; 853 input.className = 'name';
854 input.id = 'newfoldername'; 854 input.id = 'newfoldername';
855 input.onblur = blurcallback; 855 input.onblur = blurcallback;
856 input.onkeypress = keypresscallback; 856 input.onkeypress = keypresscallback;
857 input.focus();
858 857
859 input.value = initialName; 858 input.value = initialName;
860 link.appendChild(input); 859 link.appendChild(input);
861 860
862 element.appendChild(link); 861 element.appendChild(link);
863 862
864 return element; 863 return element;
865 }; 864 };
866 865
867 function createFolder(elementId) { 866 function createFolder(elementId) {
868 var currentPath = pathArray[pathArray.length - 1]; 867 var currentPath = pathArray[pathArray.length - 1];
869 var element = $('newfoldername'); 868 var element = $('newfoldername');
870 if (element) { 869 if (element) {
871 element.id = ''; 870 element.id = '';
872 var filename = element.value; 871 var filename = element.value;
873 currentPath += '/'; 872 currentPath += '/';
874 currentPath += filename; 873 currentPath += filename;
875 var existingfolder = $(currentPath); 874 var existingfolder = $(currentPath);
876 if (existingfolder || filename == '') { 875 var counter = 1;
876 while (existingfolder) {
877 var testfilepath = currentPath;
878 testfilepath = testfilepath + counter;
879 existingfolder = $(testfilepath);
880 if (!existingfolder) {
881 currentPath = testfilepath;
882 filename = filename + counter;
883 break;
884 }
885 counter++;
886 }
887 if (filename == '') {
877 return false; 888 return false;
878 } 889 }
879 var parent = element.parentNode; 890 var parent = element.parentNode;
880 parent.removeChild(element); 891 parent.removeChild(element);
881 listitem = parent.parentNode; 892 listitem = parent.parentNode;
882 893
883 parent.onclick = getFunctionForItem(currentPath, listitem.id, true); 894 parent.onclick = getFunctionForItem(currentPath, listitem.id, true);
884 895
885 var span = document.createElement('span'); 896 var span = document.createElement('span');
886 if (inSelectMode) { 897 if (inSelectMode) {
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
1074 } 1085 }
1075 var id = 'listItem' + elementIdCounter; 1086 var id = 'listItem' + elementIdCounter;
1076 elementIdCounter++; 1087 elementIdCounter++;
1077 var element = createNewFormItem('', 1088 var element = createNewFormItem('',
1078 true, 1089 true,
1079 id, 1090 id,
1080 partial(createFolder, id), 1091 partial(createFolder, id),
1081 partial(createFolderTyping, id)); 1092 partial(createFolderTyping, id));
1082 list.appendChild(element); 1093 list.appendChild(element);
1083 element.scrollIntoView(); 1094 element.scrollIntoView();
1095 var inputelement = $('newfoldername');
1096 inputelement.focus();
1084 } 1097 }
1085 1098
1086 /////////////////////////////////////////////////////////////////////////////// 1099 ///////////////////////////////////////////////////////////////////////////////
1087 // Document Functions: 1100 // Document Functions:
1088 /** 1101 /**
1089 * Window onload handler, sets up the page. 1102 * Window onload handler, sets up the page.
1090 */ 1103 */
1091 function load() { 1104 function load() {
1092 localStrings = new LocalStrings(); 1105 localStrings = new LocalStrings();
1093 kPauseDownload = localStrings.getString('pause'); 1106 kPauseDownload = localStrings.getString('pause');
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
1517 </div> 1530 </div>
1518 <div id='fwd' class='fwdbutton controlbutton' onclick='goForwardInList();retur n false;'> 1531 <div id='fwd' class='fwdbutton controlbutton' onclick='goForwardInList();retur n false;'>
1519 <img src="../../app/theme/filebrowse_forward.png" width='100%' height='100%' > 1532 <img src="../../app/theme/filebrowse_forward.png" width='100%' height='100%' >
1520 </div> 1533 </div>
1521 <div id='currenttitle' class=''></div> 1534 <div id='currenttitle' class=''></div>
1522 </div><br> 1535 </div><br>
1523 <div id='main' class='container'></div> 1536 <div id='main' class='container'></div>
1524 <div id='status' class='status'></div> 1537 <div id='status' class='status'></div>
1525 </body> 1538 </body>
1526 </html> 1539 </html>
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698