Replacing codemirror ver 0.93 by ver 3.13 and using it in PM.
This commit is contained in:
@@ -75,7 +75,7 @@
|
||||
|
||||
<JS type="javascript">
|
||||
<![CDATA[
|
||||
var triggerEditor = CodeMirror.fromTextArea('form[TRI_WEBBOT]', {
|
||||
/*var triggerEditor = CodeMirror.fromTextArea('form[TRI_WEBBOT]', {
|
||||
height: "200px",
|
||||
width: "90%",
|
||||
parserfile: ["parsexml.js", "parsecss.js", "tokenizejavascript.js", "parsejavascript.js",
|
||||
@@ -83,6 +83,17 @@
|
||||
"../contrib/php/js/parsephphtmlmixed.js"],
|
||||
stylesheet: ["css/xmlcolors.css", "css/jscolors.css", "css/csscolors.css", "css/phpcolors.css" ],
|
||||
path: "js/", lineNumbers: true, continuousScanning: 500, readOnly:true, parserConfig: { phpOnly:true} });
|
||||
*/
|
||||
var triggerEditor = CodeMirror.fromTextArea(document.getElementById("form[TRI_WEBBOT]"), {
|
||||
lineNumbers: true,
|
||||
matchBrackets: true,
|
||||
mode: "application/x-httpd-php",
|
||||
PMEnabled: true,
|
||||
indentUnit: 2,
|
||||
indentWithTabs: false,
|
||||
readOnly: true
|
||||
});
|
||||
triggerEditor.setSize(350,200);
|
||||
|
||||
function cancel()
|
||||
{
|
||||
@@ -112,7 +123,8 @@
|
||||
txtTgrTitle.value = cboTriggerUid.options[cboTriggerUid.selectedIndex].text;
|
||||
}
|
||||
if (triggerEditor) {
|
||||
triggerEditor.setCode(document.getElementById('form[TRI_WEBBOT]').value);
|
||||
triggerEditor.setValue(document.getElementById('form[TRI_WEBBOT]').value);
|
||||
//triggerEditor.setCode(document.getElementById('form[TRI_WEBBOT]').value);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
<TRI_WEBBOT type="textareapm" class="formLabel" cols="55" rows="13" width="100%" height="380px" showVars="1" process="@#PRO_UID">
|
||||
</TRI_WEBBOT>
|
||||
<SAVE type="button" onclick="document.getElementById('form[TRI_WEBBOT]').value = triggerEditor.getCode(); triggerSave1(this.form);">
|
||||
<SAVE type="button" onclick="document.getElementById('form[TRI_WEBBOT]').value = triggerEditor.getValue(); triggerSave1(this.form);">
|
||||
<en>Save</en>
|
||||
</SAVE>
|
||||
<BTN_CANCEL type="button" onclick="cancel();triggerFromLibrary()">
|
||||
@@ -30,14 +30,25 @@
|
||||
|
||||
|
||||
<JS type="JavaScript"><![CDATA[
|
||||
var triggerEditor = CodeMirror.fromTextArea('form[TRI_WEBBOT]', {
|
||||
/*var triggerEditor = CodeMirror.fromTextArea('form[TRI_WEBBOT]', {
|
||||
height: "220px",
|
||||
width: "80%",
|
||||
parserfile: ["parsexml.js", "parsecss.js", "tokenizejavascript.js", "parsejavascript.js",
|
||||
"../contrib/php/js/tokenizephp.js", "../contrib/php/js/parsephp.js",
|
||||
"../contrib/php/js/parsephphtmlmixed.js"],
|
||||
stylesheet: ["css/xmlcolors.css", "css/jscolors.css", "css/csscolors.css", "css/phpcolors.css" ],
|
||||
path: "js/", lineNumbers: true, continuousScanning: 500, parserConfig: { phpOnly:true} });
|
||||
path: "js/", lineNumbers: true, continuousScanning: 500, parserConfig: { phpOnly:true} });*/
|
||||
|
||||
var triggerEditor = CodeMirror.fromTextArea(document.getElementById("form[TRI_WEBBOT]"), {
|
||||
lineNumbers: true,
|
||||
matchBrackets: true,
|
||||
mode: "application/x-httpd-php",
|
||||
PMEnabled: true,
|
||||
indentUnit: 2,
|
||||
indentWithTabs: false,
|
||||
extraKeys: {"Ctrl-Space": "autocomplete"}
|
||||
});
|
||||
triggerEditor.setSize(400,250);
|
||||
|
||||
getField('TRI_TITLE').form.onsubmit = function() {return false;};
|
||||
var _oVarsPanel_;
|
||||
@@ -75,32 +86,13 @@ var showDynaformsFormVars = function(sFieldName, sAjaxServer, sProcess, sSymbol)
|
||||
};
|
||||
|
||||
var insertFormVar = function(sFieldName, sValue) {
|
||||
//DEPRECATED
|
||||
//oAux = document.getElementById(sFieldName);
|
||||
//if (oAux.setSelectionRange) {
|
||||
// var rangeStart = oAux.selectionStart;
|
||||
//var rangeEnd = oAux.selectionEnd;
|
||||
//var tempStr1 = oAux.value.substring(0,rangeStart);
|
||||
//var tempStr2 = oAux.value.substring(rangeEnd);
|
||||
//oAux.value = tempStr1 + sValue + tempStr2;
|
||||
//}
|
||||
//else {
|
||||
// if (document.selection) {
|
||||
// oAux.focus();
|
||||
// document.selection.createRange().text = sValue;
|
||||
// }
|
||||
//}
|
||||
|
||||
if (triggerEditor.selection() == "") {
|
||||
pos = triggerEditor.cursorPosition();
|
||||
line = triggerEditor.cursorLine();
|
||||
triggerEditor.insertIntoLine(line, pos.character, sValue);
|
||||
if (triggerEditor.getSelection() == "") {
|
||||
triggerEditor.replaceRange(sValue, triggerEditor.getCursor());
|
||||
} else {
|
||||
triggerEditor.replaceSelection(sValue);
|
||||
}
|
||||
_oVarsPanel_.remove();
|
||||
triggerEditor.focus();
|
||||
triggerEditor.focusIfIE();
|
||||
};
|
||||
|
||||
function cancel(){
|
||||
|
||||
@@ -35,8 +35,7 @@
|
||||
</div>
|
||||
<div class="boxBottom"><div class="a"></div><div class="b"></div><div class="c"></div></div>
|
||||
</div>
|
||||
<script src="js/codemirror/js/codemirror.js" type="text/javascript">
|
||||
<script type="text/javascript">
|
||||
{$form.JS}
|
||||
</script>
|
||||
|
||||
</form>
|
||||
|
||||
@@ -14,12 +14,13 @@
|
||||
<en>Cancel</en>
|
||||
</BTN_CANCEL>
|
||||
|
||||
<SAVE type="button" onclick="document.getElementById('form[TRI_WEBBOT]').value = triggerEditor.getCode(); triggerSave1(this.form);">
|
||||
<SAVE type="button" onclick="document.getElementById('form[TRI_WEBBOT]').value = triggerEditor.getValue();
|
||||
triggerSave1(this.form);">
|
||||
<en>Save</en>
|
||||
</SAVE>
|
||||
<JS type="JavaScript"><![CDATA[
|
||||
|
||||
var triggerEditor = CodeMirror.fromTextArea('form[TRI_WEBBOT]', {
|
||||
/*var triggerEditor = CodeMirror.fromTextArea('form[TRI_WEBBOT]', {
|
||||
height: "380px",
|
||||
width: "90%",
|
||||
parserfile: ["parsexml.js", "parsecss.js", "tokenizejavascript.js", "parsejavascript.js",
|
||||
@@ -27,6 +28,22 @@ var triggerEditor = CodeMirror.fromTextArea('form[TRI_WEBBOT]', {
|
||||
"../contrib/php/js/parsephphtmlmixed.js"],
|
||||
stylesheet: ["css/xmlcolors.css", "css/jscolors.css", "css/csscolors.css", "css/phpcolors.css" ],
|
||||
path: "js/", lineNumbers: true, continuousScanning: 500, parserConfig: { phpOnly:true} });
|
||||
*/
|
||||
|
||||
CodeMirror.commands.autocomplete = function(cm) {
|
||||
CodeMirror.showHint(cm, CodeMirror.phpHint);
|
||||
}
|
||||
|
||||
var triggerEditor = CodeMirror.fromTextArea(document.getElementById("form[TRI_WEBBOT]"), {
|
||||
lineNumbers: true,
|
||||
matchBrackets: true,
|
||||
mode: "application/x-httpd-php",
|
||||
PMEnabled: true,
|
||||
indentUnit: 2,
|
||||
indentWithTabs: false,
|
||||
extraKeys: {"Ctrl-Space": "autocomplete"}
|
||||
});
|
||||
triggerEditor.setSize(800,400);
|
||||
|
||||
var _oVarsPanel_;
|
||||
var showDynaformsFormVars = function(sFieldName, sAjaxServer, sProcess, sSymbol) {
|
||||
@@ -63,32 +80,13 @@ var showDynaformsFormVars = function(sFieldName, sAjaxServer, sProcess, sSymbol)
|
||||
};
|
||||
|
||||
var insertFormVar = function(sFieldName, sValue) {
|
||||
//DEPRECTED
|
||||
//oAux = document.getElementById(sFieldName);
|
||||
//if (oAux.setSelectionRange) {
|
||||
//var rangeStart = oAux.selectionStart;
|
||||
//var rangeEnd = oAux.selectionEnd;
|
||||
//var tempStr1 = oAux.value.substring(0,rangeStart);
|
||||
//var tempStr2 = oAux.value.substring(rangeEnd);
|
||||
//oAux.value = tempStr1 + sValue + tempStr2;
|
||||
//}
|
||||
//else {
|
||||
//if (document.selection) {
|
||||
//oAux.focus();
|
||||
//document.selection.createRange().text = sValue;
|
||||
//}
|
||||
//}
|
||||
//codeMirror code
|
||||
if (triggerEditor.selection() == "") {
|
||||
pos = triggerEditor.cursorPosition();
|
||||
line = triggerEditor.cursorLine();
|
||||
triggerEditor.insertIntoLine(line, pos.character, sValue);
|
||||
if (triggerEditor.getSelection() == "") {
|
||||
triggerEditor.replaceRange(sValue, triggerEditor.getCursor());
|
||||
} else {
|
||||
triggerEditor.replaceSelection(sValue);
|
||||
}
|
||||
_oVarsPanel_.remove();
|
||||
triggerEditor.focus();
|
||||
triggerEditor.focusIfIE();
|
||||
};
|
||||
|
||||
function cancel(){
|
||||
|
||||
Reference in New Issue
Block a user