Sie sind hier : sebastian1012.bplaced.net/ homepage-neu / Kurze-Scripte-und-Codeschnipsel / index.php

Zurück


Der Quellcode dazu


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css">
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js"></script>
<style>
.editor {
  height: 100%;
  width: 80%;
  position: fixed;
  z-index: 0;
}
 
.editor .ace_editor {
  overflow: hidden;
  position:relative;
  height: 100%;
  width: 100%;
}
.editor .ace_editor .ace_scrollbar-v {
  display: none;
}

.dg.ac {
  position: fixed;
  z-index: 5;
}
.dg .c select {
  color: #000;
}
</style>
    <div class="editor"  ng-app="app"  ng-controller="ctrl" ng-class="{'split':editor.splitMode}">
      <div ng-style="{opacity:editor.opacity*.01}" ui-ace="{
      useWrapMode : editor.useWrapMode,
      showGutter: editor.gutter,
      theme:editor.theme,
      mode: editor.mode,
      onLoad: aceLoaded,
      onChange: aceChanged
    }" ng-model='value'></div>
    </div>

  </body>
<script src='https://ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js'></script>
<script src='https://ace.c9.io/build/src-min-noconflict/ace.js'></script>
<script src='https://angular-ui.github.io/ui-ace/dist/ui-ace.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/dat-gui/0.5/dat.gui.min.js'></script>

</body>
<script>
  angular.module('app', ['ui.ace'])
.controller('ctrl', ['$scope', '$http', '$timeout', function($scope, $http, $timeout) {
  $scope.currentTheme = 14;
  $scope.value = '<html>333333333333';
  $http.get('https://rawgit.com/mrdoob/three.js/master/examples/webgl_lines_dashed.html').
  success(function(data, status, headers, config) {
    $scope.value = data;
  }).
  error(function(data, status, headers, config) {
   $scope.value = data;
   });
  $scope.aceLoaded = function (_editor) {
    _editor.setFontSize(14);
  }
  var editor = function() {
    this.theme = 'chaos';//themes[$scope.currentTheme];
    this.mode = 'html';
    this.opacity = 100;
    this.useWrapMode = true;
    this.gutter = true;
    this.splitMode = false;
    this.themeCycle = true;
  };
  $scope.editor = new editor();
}]);
  </script>