Minor tweaks only re tag wrappers

No need to hardcode setting in the main ICEcoder object
Moved function param for tagWrapperCommand placement
Minor syntax tweaks for consistency
Also removed now old comment
This commit is contained in:
Matt Pass
2013-08-11 16:04:25 +01:00
parent e92662fd9b
commit c592e704ba

View File

@@ -43,7 +43,6 @@ var ICEcoder = {
pluginIntervalRefs: [], // Array of plugin interval refs
overPopup: false, // Indicates if we're over a popup or not
cmdKey: false, // Tracking apple Command key up/down state
tagWrapperCommand: "ctrl+alt", // Key combination for tag wrapper
fmReady: false, // Indicates if the file manager is ready for action
ready: false, // Indicates if ICEcoder is ready for action
@@ -1698,7 +1697,7 @@ var ICEcoder = {
},
// Update the settings used when we make a change to them
useNewSettings: function(themeURL,codeAssist,lockedNav,visibleTabs,fontSize,lineWrapping,indentWithTabs,indentSize,tagWrapperCommand,refreshFM) {
useNewSettings: function(themeURL,codeAssist,lockedNav,tagWrapperCommand,visibleTabs,fontSize,lineWrapping,indentWithTabs,indentSize,refreshFM) {
var styleNode, strCSS, cMCSS, activeLineBG;
// Add new stylesheet for selected theme
@@ -2269,8 +2268,8 @@ var ICEcoder = {
var isAltRight = (evt.ctrlKey||top.ICEcoder.cmdKey) ? true:false;
// tag wrapper or add line break at end
if ("content"==area&&(
(top.ICEcoder.tagWrapperCommand=="ctrl+alt" && isAltRight) // alt left + CTRL/Cmd + key || alt right + key
if ("content"==area && (
(top.ICEcoder.tagWrapperCommand=="ctrl+alt" && isAltRight) // CTRL/Cmd + alt left + key || alt right + key
|| (top.ICEcoder.tagWrapperCommand=="alt-left" && !isAltRight)) // alt left + key
) {
@@ -2285,7 +2284,6 @@ var ICEcoder = {
else if (key==49) {top.ICEcoder.tagWrapper('h1'); return false;}
else if (key==50) {top.ICEcoder.tagWrapper('h2'); return false;}
else if (key==51) {top.ICEcoder.tagWrapper('h3'); return false;}
// Not covering h4-h6 due to non English keyboards needing AltGr+4 for $ and {
else if (key==13) {top.ICEcoder.addLineBreakAtEnd(); return false;}
else {return key;}
} else {return key;}