Permalink
Browse files

Merge branch 'master' of github.com:funkatron/spaz-desktop-air

  • Loading branch information...
2 parents 5ef3d66 + d5cdd4d commit df6d2c3af563cef3bd134b60230f48084b011f3c @funkatron funkatron committed Jun 29, 2011
Showing with 41 additions and 6 deletions.
  1. +12 −1 app/controllers/spaz.controller.js
  2. +19 −4 app/models/spaz.prefs.js
  3. +5 −1 app/views/spaz.ui.js
  4. +5 −0 index.html
@@ -692,13 +692,24 @@ Spaz.Controller.setKeyboardShortcuts = function() {
target:$('#entrybox')[0],
propagate:false
});
- shortcut.add('Enter', function() {
+
+ shortcut.add('Enter', function() {
+ if (!Spaz.Prefs.get('keyboard-enterInsertsNewline')) {
+ Spaz.postPanel.submit();
+ }
+ }, {
+ target:$('#entrybox')[0],
+ propagate:true
+ });
+
+ shortcut.add('Shift+Enter', function() {
Spaz.postPanel.submit();
}, {
target:$('#entrybox')[0],
propagate:false
});
+
// ****************************************
// Username/password prefs -> save
// ****************************************
View
@@ -124,7 +124,9 @@ Spaz.Prefs.defaultPreferences = {
'key-reloadTimeline': "Shift+F5",
'key-showShortenWindow': "+Shift+A",
'key-showUploadImageWindow': "+Shift+U",
- 'key-highlight-code': "+R"
+ 'key-highlight-code': "+R",
+
+ 'key-enterIsNewline' : false
};
@@ -998,8 +1000,20 @@ Spaz.Prefs.changeMethods = {
onChange: function(value) {
Spaz.Dock.setShape(value);
}
- }
-
+ },
+
+ 'keyboard-enterInsertsNewline' : {
+ setUI: function(value) {
+ $('#keyboard-enterInsertsNewline').attr('checked', value);
+ },
+ onGet: function(key, value) {
+ return !!value;
+ },
+ onSet: function(key, value) {
+ return !!value;
+ }
+ }
+
};
@@ -1108,7 +1122,8 @@ Spaz.Prefs.initUI = function() {
$('#dock-displayunreadbadge').bind('change', Spaz.Prefs.setFromUI);
$('#dock-unreadbadgecolor').bind('change', Spaz.Prefs.setFromUI);
$('#dock-unreadbadgeshape').bind('change', Spaz.Prefs.setFromUI);
-
+
+ $('#keyboard-enterInsertsNewline').bind('change', Spaz.Prefs.setFromUI);
};
View
@@ -217,7 +217,11 @@ Spaz.UI.setCurrentPage = function(tabEl, newpage) {
$('#' + panel + ' .timeline-pager-number').html(newpage);
};
Spaz.UI.showEntryboxTip = function() {
- Spaz.UI.statusBar('Logged in as <span class="statusbar-username">' + Spaz.Prefs.getUsername() + '@'+Spaz.Prefs.getAccountType()+'</span>. ENTER sends.');
+ var enter_does_what = 'ENTER sends.';
+ if (Spaz.Prefs.get('keyboard-enterInsertsNewline')) {
+ enter_does_what = 'SHIFT+ENTER sends.';
+ }
+ Spaz.UI.statusBar('Logged in as <span class="statusbar-username">' + Spaz.Prefs.getUsername() + '@'+Spaz.Prefs.getAccountType()+'</span>. '+enter_does_what);
}
Spaz.UI.showLocationOnMap = function(location) {
View
@@ -709,6 +709,11 @@ <h2 class="CollapsiblePanelTab" tabindex="0">
id="timeline-keyboardnavwrap" />
<label for="timeline-keyboardnavwrap" class="checkbox">Wraparound keyboard nav.</label>
</div>
+ <div class="formrow">
+ <input type="checkbox" name="keyboard-enterInsertsNewline" value="1"
+ id="keyboard-enterInsertsNewline" />
+ <label for="keyboard-enterInsertsNewline" class="checkbox">ENTER key inserts newline.</label>
+ </div>
</fieldset>

0 comments on commit df6d2c3

Please sign in to comment.