Przeglądaj źródła

Implement CodeEditor export to ivprogcore

Lucas de Souza 5 lat temu
rodzic
commit
9b60e44c02
4 zmienionych plików z 18 dodań i 5 usunięć
  1. 6 0
      css/ivprog-visual-1.0.css
  2. 10 1
      js/main.js
  3. 1 1
      js/visualUI/text_editor.js
  4. 1 3
      webpack.config.js

+ 6 - 0
css/ivprog-visual-1.0.css

@@ -20,6 +20,12 @@ body {
 	overflow-x: auto;
 }
 
+.ivprog_textual_panel {
+	height: 95%;
+	overflow: auto;
+	overflow-x: auto;
+}
+
 .ivprog_textual_code {
 	width: 100%;
 	min-height: 500px;

+ 10 - 1
js/main.js

@@ -6,6 +6,14 @@ import * as LocalizedStringsService from './services/localizedStringsService';
 import { i18nHelper } from "./services/i18nHelper";
 import { ActionTypes, getLogs, getLogsAsString, registerClick, registerUserEvent, parseLogs } from "./services/userLog";
 import { prepareActivityToStudentHelper, autoEval } from "./util/iassignHelpers";
+import * as CodeEditorAll from "./visualUI/text_editor";
+
+const CodeEditor = {
+  setCode: CodeEditorAll.setCode,
+  getCode: CodeEditorAll.getCode,
+  updateEditor: CodeEditorAll.updateEditor,
+  disable: CodeEditorAll.disable
+};
 
 const i18n = i18nHelper.i18n
 const LocalizedStrings = LocalizedStringsService.getInstance();
@@ -27,5 +35,6 @@ export {
   registerClick,
   registerUserEvent,
   parseLogs,
-  ActionTypes
+  ActionTypes,
+  CodeEditor
 }

+ 1 - 1
js/visualUI/text_editor.js

@@ -23,7 +23,7 @@ export function initTextEditor (element) {
 }
 
 export function disable (flag) {
-  codeEditor.setOption({readOnly: flag})
+  codeEditor.setOption("readOnly", flag);
   updateEditor();
 }
 

+ 1 - 3
webpack.config.js

@@ -56,10 +56,10 @@ module.exports = {
       }),
       /*new ChangeScriptSourcePlugin(),*/
       new CopyPlugin([
+        {from:'js/iassign-integration-functions.js', to:path.resolve(__dirname, 'build/js')},
         {from:"css/ivprog-visual-1.0.css", to:path.resolve(__dirname, 'build/css')},
         {from:"css/ivprog-term.css", to:path.resolve(__dirname, 'build/css')},
         {from:'js/Sortable.js', to:path.resolve(__dirname, 'build/js')},
-        {from:'js/iassign-integration-functions.js', to:path.resolve(__dirname, 'build/js')},
         {from: 'img/trash-icon.png', to:path.resolve(__dirname, 'build/img')},
         {from:'js/jquery.json-editor.min.js', to:path.resolve(__dirname, 'build/js')},
         {from:'node_modules/codemirror/lib/codemirror.css', to:path.resolve(__dirname, 'build/css')},
@@ -76,8 +76,6 @@ module.exports = {
     watchOptions: {
         ignored: [
           path.resolve(__dirname, '.ima_version.json'),
-          path.resolve(__dirname, 'index.html'),
-          path.resolve(__dirname, 'runner.html')
         ]
     }
 };