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

Side by Side Diff: chrome/browser/resources/file_manager/js/image_editor/image_util.js

Issue 8745013: [filebrowser] Support renaming in Gallery. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 5
6 // Namespace object for the utilities. 6 // Namespace object for the utilities.
7 function ImageUtil() {} 7 function ImageUtil() {}
8 8
9 // Performance trace. 9 // Performance trace.
10 ImageUtil.trace = (function() { 10 ImageUtil.trace = (function() {
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 callback(context.canvas); 427 callback(context.canvas);
428 } else { 428 } else {
429 var self = this; 429 var self = this;
430 this.timeout_ = setTimeout( 430 this.timeout_ = setTimeout(
431 function() { 431 function() {
432 self.timeout_ = null; 432 self.timeout_ = null;
433 self.copyStrip_(context, lastRow, rowCount); 433 self.copyStrip_(context, lastRow, rowCount);
434 }, 0); 434 }, 0);
435 } 435 }
436 }; 436 };
437
438 ImageUtil.getFullNameFromUrl = function(url) {
439 if (url.indexOf('/') != -1)
440 return url.substr(url.lastIndexOf('/') + 1);
441 else
442 return url;
443 };
444
445 ImageUtil.getFileNameFromFullName = function(name) {
446 var index = name.lastIndexOf('.');
447 if (index != -1)
448 return name.substr(0, index);
449 else
450 return name;
451 };
452
453 ImageUtil.getFileNameFromUrl = function(url) {
454 return ImageUtil.getFileNameFromFullName(ImageUtil.getFullNameFromUrl(url));
455 };
456
457 ImageUtil.replaceFileNameInFullName = function(fullName, name) {
458 var index = fullName.lastIndexOf('.');
459 if (index != -1)
460 return name + fullName.substr(index);
461 else
462 return name;
463 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698