Skip to content

Commit 3963a3f

Browse files
committed
Merge pull request cmdjs#51 from tsj1107/master
增加codemirror和mergely组件
2 parents b14158e + 0d27ec2 commit 3963a3f

21 files changed

+17580
-0
lines changed

codemirror/Gruntfile.js

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
module.exports = function(grunt) {
2+
var pkg = grunt.file.readJSON('package.json');
3+
4+
grunt.initConfig({
5+
pkg: pkg,
6+
7+
download: {
8+
options: {
9+
dest: 'src'
10+
},
11+
codemirror: {
12+
options: {
13+
transform: function(code) {
14+
return [
15+
'define(function(require, exports, module) {',
16+
code,
17+
"module.exports = window.CodeMirror;",
18+
"});"
19+
].join('\n');
20+
}
21+
},
22+
url: 'https://raw.githubusercontent.com/marijnh/CodeMirror/v3.1/lib/codemirror.js',
23+
name: 'codemirror.js'
24+
},
25+
css: {
26+
url: 'https://raw.githubusercontent.com/marijnh/CodeMirror/v3.1/lib/codemirror.css',
27+
name: 'codemirror.css'
28+
}
29+
}
30+
});
31+
32+
grunt.loadGlobalTasks('spm-build');
33+
grunt.util._.merge(grunt.config.data, require('spm-build').config);
34+
35+
grunt.loadTasks('../_tasks/download/tasks');
36+
grunt.registerTask('build', ['download', 'spm-build']);
37+
};

codemirror/dist/codemirror-debug.css

Lines changed: 246 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,246 @@
1+
/*! define gallery/codemirror/3.1.0/codemirror-debug.css */
2+
/* BASICS */
3+
4+
.CodeMirror {
5+
/* Set height, width, borders, and global font properties here */
6+
font-family: monospace;
7+
height: 300px;
8+
}
9+
.CodeMirror-scroll {
10+
/* Set scrolling behaviour here */
11+
overflow: auto;
12+
}
13+
14+
/* PADDING */
15+
16+
.CodeMirror-lines {
17+
padding: 4px 0; /* Vertical padding around content */
18+
}
19+
.CodeMirror pre {
20+
padding: 0 4px; /* Horizontal padding of content */
21+
}
22+
23+
.CodeMirror-scrollbar-filler {
24+
background-color: white; /* The little square between H and V scrollbars */
25+
}
26+
27+
/* GUTTER */
28+
29+
.CodeMirror-gutters {
30+
border-right: 1px solid #ddd;
31+
background-color: #f7f7f7;
32+
}
33+
.CodeMirror-linenumbers {}
34+
.CodeMirror-linenumber {
35+
padding: 0 3px 0 5px;
36+
min-width: 20px;
37+
text-align: right;
38+
color: #999;
39+
}
40+
41+
/* CURSOR */
42+
43+
.CodeMirror div.CodeMirror-cursor {
44+
border-left: 1px solid black;
45+
}
46+
/* Shown when moving in bi-directional text */
47+
.CodeMirror div.CodeMirror-secondarycursor {
48+
border-left: 1px solid silver;
49+
}
50+
.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor {
51+
width: auto;
52+
border: 0;
53+
background: transparent;
54+
background: rgba(0, 200, 0, .4);
55+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#6600c800, endColorstr=#4c00c800);
56+
}
57+
/* Kludge to turn off filter in ie9+, which also accepts rgba */
58+
.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor:not(#nonsense_id) {
59+
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
60+
}
61+
/* Can style cursor different in overwrite (non-insert) mode */
62+
.CodeMirror div.CodeMirror-cursor.CodeMirror-overwrite {}
63+
64+
/* DEFAULT THEME */
65+
66+
.cm-s-default .cm-keyword {color: #708;}
67+
.cm-s-default .cm-atom {color: #219;}
68+
.cm-s-default .cm-number {color: #164;}
69+
.cm-s-default .cm-def {color: #00f;}
70+
.cm-s-default .cm-variable {color: black;}
71+
.cm-s-default .cm-variable-2 {color: #05a;}
72+
.cm-s-default .cm-variable-3 {color: #085;}
73+
.cm-s-default .cm-property {color: black;}
74+
.cm-s-default .cm-operator {color: black;}
75+
.cm-s-default .cm-comment {color: #a50;}
76+
.cm-s-default .cm-string {color: #a11;}
77+
.cm-s-default .cm-string-2 {color: #f50;}
78+
.cm-s-default .cm-meta {color: #555;}
79+
.cm-s-default .cm-error {color: #f00;}
80+
.cm-s-default .cm-qualifier {color: #555;}
81+
.cm-s-default .cm-builtin {color: #30a;}
82+
.cm-s-default .cm-bracket {color: #997;}
83+
.cm-s-default .cm-tag {color: #170;}
84+
.cm-s-default .cm-attribute {color: #00c;}
85+
.cm-s-default .cm-header {color: blue;}
86+
.cm-s-default .cm-quote {color: #090;}
87+
.cm-s-default .cm-hr {color: #999;}
88+
.cm-s-default .cm-link {color: #00c;}
89+
90+
.cm-negative {color: #d44;}
91+
.cm-positive {color: #292;}
92+
.cm-header, .cm-strong {font-weight: bold;}
93+
.cm-em {font-style: italic;}
94+
.cm-emstrong {font-style: italic; font-weight: bold;}
95+
.cm-link {text-decoration: underline;}
96+
97+
.cm-invalidchar {color: #f00;}
98+
99+
div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
100+
div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
101+
102+
/* STOP */
103+
104+
/* The rest of this file contains styles related to the mechanics of
105+
the editor. You probably shouldn't touch them. */
106+
107+
.CodeMirror {
108+
line-height: 1;
109+
position: relative;
110+
overflow: hidden;
111+
}
112+
113+
.CodeMirror-scroll {
114+
/* 30px is the magic margin used to hide the element's real scrollbars */
115+
/* See overflow: hidden in .CodeMirror, and the paddings in .CodeMirror-sizer */
116+
margin-bottom: -30px; margin-right: -30px;
117+
padding-bottom: 30px; padding-right: 30px;
118+
height: 100%;
119+
outline: none; /* Prevent dragging from highlighting the element */
120+
position: relative;
121+
}
122+
.CodeMirror-sizer {
123+
position: relative;
124+
}
125+
126+
/* The fake, visible scrollbars. Used to force redraw during scrolling
127+
before actuall scrolling happens, thus preventing shaking and
128+
flickering artifacts. */
129+
.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler {
130+
position: absolute;
131+
z-index: 6;
132+
display: none;
133+
}
134+
.CodeMirror-vscrollbar {
135+
right: 0; top: 0;
136+
overflow-x: hidden;
137+
overflow-y: scroll;
138+
}
139+
.CodeMirror-hscrollbar {
140+
bottom: 0; left: 0;
141+
overflow-y: hidden;
142+
overflow-x: scroll;
143+
}
144+
.CodeMirror-scrollbar-filler {
145+
right: 0; bottom: 0;
146+
z-index: 6;
147+
}
148+
149+
.CodeMirror-gutters {
150+
position: absolute; left: 0; top: 0;
151+
height: 100%;
152+
padding-bottom: 30px;
153+
z-index: 3;
154+
}
155+
.CodeMirror-gutter {
156+
height: 100%;
157+
display: inline-block;
158+
/* Hack to make IE7 behave */
159+
*zoom:1;
160+
*display:inline;
161+
}
162+
.CodeMirror-gutter-elt {
163+
position: absolute;
164+
cursor: default;
165+
z-index: 4;
166+
}
167+
168+
.CodeMirror-lines {
169+
cursor: text;
170+
}
171+
.CodeMirror pre {
172+
/* Reset some styles that the rest of the page might have set */
173+
-moz-border-radius: 0; -webkit-border-radius: 0; -o-border-radius: 0; border-radius: 0;
174+
border-width: 0;
175+
background: transparent;
176+
font-family: inherit;
177+
font-size: inherit;
178+
margin: 0;
179+
white-space: pre;
180+
word-wrap: normal;
181+
line-height: inherit;
182+
color: inherit;
183+
z-index: 2;
184+
position: relative;
185+
overflow: visible;
186+
}
187+
.CodeMirror-wrap pre {
188+
word-wrap: break-word;
189+
white-space: pre-wrap;
190+
word-break: normal;
191+
}
192+
.CodeMirror-linebackground {
193+
position: absolute;
194+
left: 0; right: 0; top: 0; bottom: 0;
195+
z-index: 0;
196+
}
197+
198+
.CodeMirror-linewidget {
199+
position: relative;
200+
z-index: 2;
201+
overflow: auto;
202+
}
203+
204+
.CodeMirror-widget {
205+
display: inline-block;
206+
}
207+
208+
.CodeMirror-wrap .CodeMirror-scroll {
209+
overflow-x: hidden;
210+
}
211+
212+
.CodeMirror-measure {
213+
position: absolute;
214+
width: 100%; height: 0px;
215+
overflow: hidden;
216+
visibility: hidden;
217+
}
218+
.CodeMirror-measure pre { position: static; }
219+
220+
.CodeMirror div.CodeMirror-cursor {
221+
position: absolute;
222+
visibility: hidden;
223+
border-right: none;
224+
width: 0;
225+
}
226+
.CodeMirror-focused div.CodeMirror-cursor {
227+
visibility: visible;
228+
}
229+
230+
.CodeMirror-selected { background: #d9d9d9; }
231+
.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
232+
233+
.cm-searching {
234+
background: #ffa;
235+
background: rgba(255, 255, 0, .4);
236+
}
237+
238+
/* IE7 hack to prevent it from returning funny offsetTops on the spans */
239+
.CodeMirror span { *vertical-align: text-bottom; }
240+
241+
@media print {
242+
/* Hide the cursor when printing */
243+
.CodeMirror div.CodeMirror-cursor {
244+
visibility: hidden;
245+
}
246+
}

0 commit comments

Comments
 (0)