rsaccon / Bespin playground (http://rsaccon.com/)
No description has been added.
Clone this repository (size: 13.3 MB): HTTPS / SSH
$ hg clone http://bitbucket.org/rsaccon/bespin-playground/
| commit 914: | aa263a714c19 |
| parent 909: | dc1c9d1373a5 |
| branch: | default |
Fixed selectionChangeCase to work correctly when dealing with multiple rows being selected.
12 months ago
Changed (Δ57 bytes):
raw changeset »
frontend/js/bespin/editor/actions.js (11 lines added, 8 lines removed)
Up to file-list frontend/js/bespin/editor/actions.js:
| … | … | @@ -689,15 +689,18 @@ dojo.declare("bespin.editor.Actions", nu |
689 |
689 |
args.selectionObject = this.editor.getSelection(); |
690 |
690 |
} |
691 |
691 |
var selection = this.model.getChunk(args.selectionObject); |
692 |
var outText; |
|
693 |
if (args.stringCase==="l") { |
|
694 |
outText = selection.toLowerCase(); |
|
695 |
} |
|
696 |
else { |
|
697 |
outText = selection.toUpperCase(); |
|
698 |
} |
|
692 |
var stringArray=selection.split("\n"); |
|
693 |
for(i in stringArray) { |
|
694 |
if(args.stringCase==="l") { |
|
695 |
stringArray[i]=stringArray[i].toLowerCase(); |
|
696 |
} |
|
697 |
else { |
|
698 |
stringArray[i]=stringArray[i].toUpperCase(); |
|
699 |
} |
|
700 |
} |
|
701 |
var outText=stringArray.join("\n"); |
|
699 |
702 |
this.model.deleteChunk(args.selectionObject); |
700 |
this.model.insertCh |
|
703 |
this.model.insertChunk(args.selectionObject.startPos, outText); |
|
701 |
704 |
this.select(args.selectionObject); |
702 |
705 |
args.action = "selectionChangeCase"; |
703 |
706 |
var redoOperation = args; |
