mirror of
https://github.com/icecoder/ICEcoder.git
synced 2026-03-11 11:06:48 +01:00
Python now supported as a language
Also minor fixes to Ruby's usage
This commit is contained in:
@@ -157,9 +157,9 @@ var ICEcoder = {
|
||||
contentCleanUp: function() {
|
||||
var fileName, cM, content;
|
||||
|
||||
// If it's not a JS, CoffeeScript Ruby, CSS or LESS file, replace our temp /textarea value
|
||||
// If it's not a JS, CoffeeScript, CSS or LESS file, replace our temp /textarea value
|
||||
fileName = ICEcoder.openFiles[ICEcoder.selectedTab-1];
|
||||
if (["js","coffee","rb","css","less"].indexOf(fileName.split(".")[1])<0) {
|
||||
if (["js","coffee","css","less"].indexOf(fileName.split(".")[1])<0) {
|
||||
cM = ICEcoder.getcMInstance();
|
||||
content = cM.getValue();
|
||||
content = content.replace(/<ICEcoder:\/:textarea>/g,'<\/textarea>');
|
||||
@@ -216,6 +216,7 @@ var ICEcoder = {
|
||||
fileName.indexOf('.js')>0 ? cM.setOption("mode","javascript")
|
||||
: fileName.indexOf('.coffee')>0 ? cM.setOption("mode","coffeescript")
|
||||
: fileName.indexOf('.rb')>0 ? cM.setOption("mode","ruby")
|
||||
: fileName.indexOf('.py')>0 ? cM.setOption("mode","python")
|
||||
: fileName.indexOf('.css')>0 ? cM.setOption("mode","css")
|
||||
: fileName.indexOf('.less')>0 ? cM.setOption("mode","less")
|
||||
: fileName.indexOf('.md')>0 ? cM.setOption("mode","markdown")
|
||||
@@ -234,9 +235,9 @@ var ICEcoder = {
|
||||
lCLen = lineContent.length;
|
||||
adjustCursor = 2;
|
||||
|
||||
if (["JavaScript","CoffeeScript","PHP","Ruby","CSS"].indexOf(ICEcoder.caretLocType)>-1) {
|
||||
if (["JavaScript","CoffeeScript","PHP","Python","Ruby","CSS"].indexOf(ICEcoder.caretLocType)>-1) {
|
||||
if (cM.somethingSelected()) {
|
||||
if (ICEcoder.caretLocType=="Ruby") {
|
||||
if (ICEcoder.caretLocType=="Ruby"||ICEcoder.caretLocType=="Python") {
|
||||
startLine = cM.getCursor(true).line;
|
||||
endLine = cM.getCursor().line;
|
||||
for (var i=startLine; i<=endLine; i++) {
|
||||
@@ -1049,7 +1050,7 @@ var ICEcoder = {
|
||||
ICEcoder.nestDisplay.innerHTML = "";
|
||||
if ("undefined" != typeof ICEcoder.openFiles[ICEcoder.selectedTab-1]) {
|
||||
fileName = ICEcoder.openFiles[ICEcoder.selectedTab-1];
|
||||
if (["js","coffee","rb","css","less"].indexOf(fileName.split(".")[1])<0 &&
|
||||
if (["js","coffee","css","less"].indexOf(fileName.split(".")[1])<0 &&
|
||||
(nestCheck.indexOf("include(")==-1)&&(nestCheck.indexOf("include_once(")==-1)&&
|
||||
(nestCheck.indexOf("<html")>-1||nestCheck.indexOf("<body")>-1)) {
|
||||
|
||||
@@ -1078,7 +1079,7 @@ var ICEcoder = {
|
||||
cM = ICEcoder.getcMInstance();
|
||||
nestOK = true;
|
||||
fileName = ICEcoder.openFiles[ICEcoder.selectedTab-1];
|
||||
if (cM && fileName && ["js","coffee","rb","css","less"].indexOf(fileName.split(".")[1])==-1) {
|
||||
if (cM && fileName && ["js","coffee","css","less"].indexOf(fileName.split(".")[1])==-1) {
|
||||
nestOK = cM.getTokenAt({line:cM.lineCount(),ch:cM.lineInfo(cM.lineCount()-1).text.length}).className != "error" ? true : false;
|
||||
}
|
||||
ICEcoder.nestValid.style.background = nestOK ? "#0b0" : "#f00";
|
||||
@@ -1127,6 +1128,7 @@ var ICEcoder = {
|
||||
fileName = ICEcoder.openFiles[ICEcoder.selectedTab-1];
|
||||
if (fileName.indexOf(".js")>0) {caretLocType="JavaScript"}
|
||||
else if (fileName.indexOf(".coffee")>0) {caretLocType="CoffeeScript"}
|
||||
else if (fileName.indexOf(".py")>0) {caretLocType="Python"}
|
||||
else if (fileName.indexOf(".rb")>0) {caretLocType="Ruby"}
|
||||
else if (fileName.indexOf(".css")>0) {caretLocType="CSS"}
|
||||
else if (fileName.indexOf(".less")>0) {caretLocType="LESS"}
|
||||
|
||||
Reference in New Issue
Block a user