app/Resources/static-src/app/js/task-manage/create/editor1.js

(开头部分) 1KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

import loadAnimation from 'common/load-animation';
import notify from 'common/notify';

class Editor {
  constructor($modal) {
    this.$element = $modal;
    this.step = 1;
    let $taskType = $('#task-create-type');
    this.taskConfig = {
      type: $taskType.data('editorType'),
      mode: $taskType.data('editorMode'),
      contentUrl: $taskType.data('contentUrl'),
      finishUrl: $taskType.data('finishUrl'),
      saveUrl: $taskType.data('saveUrl'),
    };

    this.$taskType = $taskType;
    this.$taskContent = $('#task-create-content');
    this.$taskFinish = $('#task-create-finish');
    this.$taskSubmit = $('#course-tasks-submit');
    this.$contentIframe = $('#task-create-content-iframe');
    this.$finishIframe = $('#task-create-finish-iframe');
    $('#task-create-content-iframe, #task-create-finish-iframe').iFrameResize();

    this._init();
    this._initEvent();
  }

  _initEvent() {
    this.$taskSubmit.click(event => this._onSave());
    $('#course-tasks-next').click(event => this._onNext(event));
    $('#course-tasks-prev').click(event => this._onPrev(event));

    if (this.taskConfig.mode != 'edit') {
      $('.js-course-tasks-item').click(event => this._onSetType(event));
    } else {
      $('.delete-task').click(event => this._onDelete(event));
    }
  }

  _init() {
    this._inItStep1form();
    if ('edit' == this.taskConfig.mode) {
      //编辑的时候,跳转到第二步
      this._doNext();
    } else {
      //创建时候,渲染第一步页面
      this._switchPage();
    }
  }

  _onNext() {
    if (this.step === 1) {
      this._doNext();
      return;
    }

    if (this.step === 2) {
      window.ltc.emitChild('task-create-content-iframe', 'getValidate');
      window.ltc.once('returnValidate', (msg) => {

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。