mirror of
https://github.com/icecoder/ICEcoder.git
synced 2026-03-03 07:13:59 +01:00
Ternary shortening htmlTagArray & getcMInstance
Reduced & simplified code to get the same result
This commit is contained in:
19
lib/coder.js
19
lib/coder.js
@@ -173,13 +173,8 @@ var ICEcoder = {
|
||||
if (!ICEcoder.codeBlock) {
|
||||
// OK, we can do something further as we're not in a code block
|
||||
// If it's the same as the previously logged tag preceeded by /, it's the equivalent end tag
|
||||
if (tagEnd=="/"+ICEcoder.htmlTagArray[ICEcoder.htmlTagArray.length-1]) {
|
||||
// So remove the last logged tag, thereby going up one in the nest
|
||||
ICEcoder.htmlTagArray.pop();
|
||||
} else {
|
||||
// Otherwise it's a different tag, add it to the end
|
||||
ICEcoder.htmlTagArray.push(tagString);
|
||||
}
|
||||
// so remove the last logged tag, thereby going up one in the nest, otherwise it's a different tag, add it to the end
|
||||
tagEnd=="/"+ICEcoder.htmlTagArray[ICEcoder.htmlTagArray.length-1] ? ICEcoder.htmlTagArray.pop() : ICEcoder.htmlTagArray.push(tagString);
|
||||
} else if (
|
||||
((ICEcoder.tagStart=="script"||ICEcoder.tagStart=="/script")&&tagEndJS=="</script")||
|
||||
((ICEcoder.tagStart=="?php"||ICEcoder.tagStart=="?")&&tagEnd=="?")||
|
||||
@@ -1051,11 +1046,11 @@ var ICEcoder = {
|
||||
getcMInstance: function(newTab) {
|
||||
var cM;
|
||||
|
||||
if (newTab=="new"||(newTab!="new" && ICEcoder.openFiles.length>0)) {
|
||||
cM = top.ICEcoder.content.contentWindow['cM'+ICEcoder.cMInstances[ICEcoder.selectedTab-1]];
|
||||
} else {
|
||||
cM = top.ICEcoder.content.contentWindow['cM1'];
|
||||
}
|
||||
cM = top.ICEcoder.content.contentWindow[
|
||||
newTab=="new"||(newTab!="new" && ICEcoder.openFiles.length>0)
|
||||
? 'cM'+ICEcoder.cMInstances[ICEcoder.selectedTab-1]
|
||||
: 'cM1'
|
||||
];
|
||||
return cM;
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user