edge_framework 0.6.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. data/.gitignore +0 -3
  2. data/Gemfile +3 -3
  3. data/LICENSE.txt +22 -22
  4. data/README.md +39 -35
  5. data/Rakefile +6 -6
  6. data/assets/js/edge/edge.collect.js +13 -13
  7. data/assets/js/edge/edge.ie8.js +4 -13
  8. data/assets/js/edge/edge.prism.js +692 -0
  9. data/assets/js/edge/edge.template.js +15 -0
  10. data/assets/js/edge.js +15 -15
  11. data/{template/base/assets → assets}/js/vendor/custom.modernizr.js +4 -4
  12. data/assets/js/vendor/jquery.min.js +6 -0
  13. data/assets/sass/edge/_base.scss +54 -26
  14. data/assets/sass/edge/_components.scss +2 -1
  15. data/assets/sass/edge/_helpers.scss +1 -0
  16. data/assets/sass/edge/components/_code.scss +320 -0
  17. data/assets/sass/edge/components/_normalize.scss +7 -16
  18. data/assets/sass/edge/components/_typography.scss +11 -16
  19. data/assets/sass/edge/helpers/_sticky-footer.scss +13 -13
  20. data/assets/test.html +74 -0
  21. data/assets/test2.html +28 -16
  22. data/edge.gemspec +26 -26
  23. data/lib/edge/version.rb +4 -4
  24. data/lib/edge_framework.rb +85 -85
  25. data/template/base/assets/sass/_setting.scss +33 -23
  26. data/template/html/index.html +1 -1
  27. data/template/php/partials/header.php +1 -1
  28. data/template/wordpress/404.php +6 -5
  29. data/template/wordpress/category.php +20 -20
  30. data/template/wordpress/footer.php +2 -1
  31. data/template/wordpress/functions.php +24 -10
  32. data/template/wordpress/header.php +8 -9
  33. data/template/wordpress/index.php +53 -6
  34. data/template/wordpress/page.php +18 -0
  35. data/template/wordpress/single.php +19 -3
  36. data/template/wordpress/style.css +12 -0
  37. metadata +31 -22
  38. checksums.yaml +0 -15
  39. data/Gemfile.lock +0 -40
  40. data/assets/js/edge/edge.notification.js +0 -0
  41. data/assets/js/sh/clipboard.swf +0 -0
  42. data/assets/js/sh/shBrushCss.js +0 -91
  43. data/assets/js/sh/shBrushJScript.js +0 -52
  44. data/assets/js/sh/shBrushPhp.js +0 -88
  45. data/assets/js/sh/shBrushRuby.js +0 -55
  46. data/assets/js/sh/shBrushSass.js +0 -94
  47. data/assets/js/sh/shBrushXml.js +0 -71
  48. data/assets/js/sh/shCore.js +0 -17
  49. data/assets/sass/for-test.scss +0 -169
  50. data/template/base/config.rb +0 -16
  51. /data/{template/base/assets/js/vendor → assets/js-docs}/jquery.min.js +0 -0
@@ -0,0 +1,692 @@
1
+ /*
2
+ EDGE PRISM - Syntax Highlighter
3
+ Supported languages: Markup, CSS, JS, Python, Ruby, PHP, Sass
4
+ Based on Prism JS [http://prismjs.com/] by Lea Verou [http://lea.verou.me]
5
+ */
6
+
7
+ (function(){
8
+
9
+ // Private helper vars
10
+ var lang = /\blang(?:uage)?-(?!\*)(\w+)\b/i;
11
+
12
+ var _ = self.Prism = {
13
+ util: {
14
+ type: function (o) {
15
+ return Object.prototype.toString.call(o).match(/\[object (\w+)\]/)[1];
16
+ },
17
+
18
+ // Deep clone a language definition (e.g. to extend it)
19
+ clone: function (o) {
20
+ var type = _.util.type(o);
21
+
22
+ switch (type) {
23
+ case 'Object':
24
+ var clone = {};
25
+
26
+ for (var key in o) {
27
+ if (o.hasOwnProperty(key) ) {
28
+ clone[key] = _.util.clone(o[key]);
29
+ }
30
+ }
31
+
32
+ return clone;
33
+
34
+ case 'Array':
35
+ return o.slice();
36
+ }
37
+
38
+ return o;
39
+ },
40
+
41
+ // Remove excess whitespace
42
+ filter: function(code, language) {
43
+ // escape special characters
44
+ code = code.replace(/</g, "&lt;").replace(/\u00a0/g, " ");
45
+ // If not python, convert spaces into tabs
46
+ if(language !== "python") {
47
+ code = code.replace(/\t/g, " ");
48
+ }
49
+
50
+ // remove trailing and following line break
51
+ var filteredText = code.replace(/^\n/, "").replace(/\n\s+$/, "");
52
+
53
+ // split the lines and count the offset
54
+ var lines = filteredText.split("\n");
55
+ var offset = lines[0].match(/^\s*/)[ 0 ].length;
56
+
57
+ // remove excess whitespace from each line
58
+ lines = lines.map(function(line) {
59
+ return line.slice(offset);
60
+ });
61
+
62
+ return lines.join("\n");
63
+ }
64
+ },
65
+
66
+ languages: {
67
+ extend: function (id, redef) {
68
+ var lang = _.util.clone(_.languages[id]);
69
+
70
+ for (var key in redef) {
71
+ lang[key] = redef[key];
72
+ }
73
+
74
+ return lang;
75
+ },
76
+
77
+ // Insert a token before another token in a language literal
78
+ insertBefore: function (inside, before, insert, root) {
79
+ root = root || _.languages;
80
+ var grammar = root[inside];
81
+ var ret = {};
82
+
83
+ for (var token in grammar) {
84
+
85
+ if (grammar.hasOwnProperty(token)) {
86
+
87
+ if (token == before) {
88
+
89
+ for (var newToken in insert) {
90
+
91
+ if (insert.hasOwnProperty(newToken)) {
92
+ ret[newToken] = insert[newToken];
93
+ }
94
+ }
95
+ }
96
+
97
+ ret[token] = grammar[token];
98
+ }
99
+ }
100
+
101
+ return root[inside] = ret;
102
+ },
103
+
104
+ // Traverse a language definition with Depth First Search
105
+ DFS: function(o, callback) {
106
+ for (var i in o) {
107
+ callback.call(o, i, o[i]);
108
+
109
+ if (_.util.type(o) === 'Object') {
110
+ _.languages.DFS(o[i], callback);
111
+ }
112
+ }
113
+ }
114
+ },
115
+
116
+ highlightAll: function(async, callback) {
117
+ //var elements = document.querySelectorAll('code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code');
118
+ var elements = document.querySelectorAll("code[data-lang], [data-lang] code");
119
+
120
+ for (var i=0, element; element = elements[i++];) {
121
+ _.highlightElement(element, async === true, callback);
122
+ }
123
+ },
124
+
125
+ highlightElement: function(element, async, callback) {
126
+ var language, grammar, parent = element;
127
+
128
+ // Look for element that has attribute "data-lang"
129
+ while (parent && !parent.getAttribute("data-lang") ) {
130
+ parent = parent.parentNode;
131
+ }
132
+
133
+ if(parent) {
134
+ language = parent.getAttribute("data-lang");
135
+ grammar = _.languages[language];
136
+ }
137
+
138
+ if (!grammar) {
139
+ return;
140
+ }
141
+
142
+ var code = _.util.filter(element.innerHTML, language);
143
+
144
+ if(!code) {
145
+ return;
146
+ }
147
+
148
+ var env = {
149
+ element: element,
150
+ language: language,
151
+ grammar: grammar,
152
+ code: code
153
+ };
154
+
155
+ _.hooks.run('before-highlight', env);
156
+
157
+ if (async && self.Worker) {
158
+ var worker = new Worker(_.filename);
159
+
160
+ worker.onmessage = function(evt) {
161
+ env.highlightedCode = Token.stringify(JSON.parse(evt.data), language);
162
+
163
+ _.hooks.run('before-insert', env);
164
+
165
+ env.element.innerHTML = env.highlightedCode;
166
+
167
+ callback && callback.call(env.element);
168
+ _.hooks.run('after-highlight', env);
169
+ };
170
+
171
+ worker.postMessage(JSON.stringify({
172
+ language: env.language,
173
+ code: env.code
174
+ }));
175
+ }
176
+ else {
177
+ env.highlightedCode = _.highlight(env.code, env.grammar, env.language)
178
+
179
+ _.hooks.run('before-insert', env);
180
+
181
+ env.element.innerHTML = env.highlightedCode;
182
+
183
+ callback && callback.call(element);
184
+
185
+ _.hooks.run('after-highlight', env);
186
+ }
187
+ },
188
+
189
+ highlight: function (text, grammar, language) {
190
+ return Token.stringify(_.tokenize(text, grammar), language);
191
+ },
192
+
193
+ tokenize: function(text, grammar, language) {
194
+ var Token = _.Token;
195
+
196
+ var strarr = [text];
197
+
198
+ var rest = grammar.rest;
199
+
200
+ if (rest) {
201
+ for (var token in rest) {
202
+ grammar[token] = rest[token];
203
+ }
204
+
205
+ delete grammar.rest;
206
+ }
207
+
208
+ tokenloop: for (var token in grammar) {
209
+ if(!grammar.hasOwnProperty(token) || !grammar[token]) {
210
+ continue;
211
+ }
212
+
213
+ var pattern = grammar[token],
214
+ inside = pattern.inside,
215
+ lookbehind = !!pattern.lookbehind,
216
+ lookbehindLength = 0;
217
+
218
+ pattern = pattern.pattern || pattern;
219
+
220
+ for (var i=0; i<strarr.length; i++) { // Don’t cache length as it changes during the loop
221
+
222
+ var str = strarr[i];
223
+
224
+ if (strarr.length > text.length) {
225
+ // Something went terribly wrong, ABORT, ABORT!
226
+ break tokenloop;
227
+ }
228
+
229
+ if (str instanceof Token) {
230
+ continue;
231
+ }
232
+
233
+ pattern.lastIndex = 0;
234
+
235
+ var match = pattern.exec(str);
236
+
237
+ if (match) {
238
+ if(lookbehind) {
239
+ lookbehindLength = match[1].length;
240
+ }
241
+
242
+ var from = match.index - 1 + lookbehindLength,
243
+ match = match[0].slice(lookbehindLength),
244
+ len = match.length,
245
+ to = from + len,
246
+ before = str.slice(0, from + 1),
247
+ after = str.slice(to + 1);
248
+
249
+ var args = [i, 1];
250
+
251
+ if (before) {
252
+ args.push(before);
253
+ }
254
+
255
+ var wrapped = new Token(token, inside? _.tokenize(match, inside) : match);
256
+
257
+ args.push(wrapped);
258
+
259
+ if (after) {
260
+ args.push(after);
261
+ }
262
+
263
+ Array.prototype.splice.apply(strarr, args);
264
+ }
265
+ }
266
+ }
267
+
268
+ return strarr;
269
+ },
270
+
271
+ hooks: {
272
+ all: {},
273
+
274
+ add: function (name, callback) {
275
+ var hooks = _.hooks.all;
276
+
277
+ hooks[name] = hooks[name] || [];
278
+
279
+ hooks[name].push(callback);
280
+ },
281
+
282
+ run: function (name, env) {
283
+ var callbacks = _.hooks.all[name];
284
+
285
+ if (!callbacks || !callbacks.length) {
286
+ return;
287
+ }
288
+
289
+ for (var i=0, callback; callback = callbacks[i++];) {
290
+ callback(env);
291
+ }
292
+ }
293
+ }
294
+ };
295
+
296
+ var Token = _.Token = function(type, content) {
297
+ this.type = type;
298
+ this.content = content;
299
+ };
300
+
301
+ Token.stringify = function(o, language, parent) {
302
+ if (typeof o == 'string') {
303
+ return o;
304
+ }
305
+
306
+ if (Object.prototype.toString.call(o) == '[object Array]') {
307
+ return o.map(function(element) {
308
+ return Token.stringify(element, language, o);
309
+ }).join('');
310
+ }
311
+
312
+ var env = {
313
+ type: o.type,
314
+ content: Token.stringify(o.content, language, parent),
315
+ tag: 'span',
316
+ classes: ['token', o.type],
317
+ attributes: {},
318
+ language: language,
319
+ parent: parent
320
+ };
321
+
322
+ if (env.type == 'comment') {
323
+ env.attributes['spellcheck'] = 'true';
324
+ }
325
+
326
+ _.hooks.run('wrap', env);
327
+
328
+ var attributes = '';
329
+
330
+ for (var name in env.attributes) {
331
+ attributes += name + '="' + (env.attributes[name] || '') + '"';
332
+ }
333
+
334
+ return '<' + env.tag + ' class="' + env.classes.join(' ') + '" ' + attributes + '>' + env.content + '</' + env.tag + '>';
335
+
336
+ };
337
+
338
+ if (!self.document) {
339
+ // In worker
340
+ self.addEventListener('message', function(evt) {
341
+ var message = JSON.parse(evt.data),
342
+ lang = message.language,
343
+ code = message.code;
344
+
345
+ self.postMessage(JSON.stringify(_.tokenize(code, _.languages[lang])));
346
+ self.close();
347
+ }, false);
348
+
349
+ return;
350
+ }
351
+
352
+ // Get current script and highlight
353
+ var script = document.getElementsByTagName('script');
354
+
355
+ script = script[script.length - 1];
356
+
357
+ if (script) {
358
+ _.filename = script.src;
359
+
360
+ if (document.addEventListener && !script.hasAttribute('data-manual')) {
361
+ document.addEventListener('DOMContentLoaded', _.highlightAll);
362
+ }
363
+ }
364
+
365
+ })();;
366
+ Prism.languages.markup = {
367
+ 'comment': /&lt;!--[\w\W]*?-->/g,
368
+ 'prolog': /&lt;\?.+?\?>/,
369
+ 'doctype': /&lt;!DOCTYPE.+?>/,
370
+ 'cdata': /&lt;!\[CDATA\[[\w\W]*?]]>/i,
371
+ 'tag': {
372
+ pattern: /&lt;\/?[\w:-]+\s*(?:\s+[\w:-]+(?:=(?:("|')(\\?[\w\W])*?\1|\w+))?\s*)*\/?>/gi,
373
+ inside: {
374
+ 'tag': {
375
+ pattern: /^&lt;\/?[\w:-]+/i,
376
+ inside: {
377
+ 'punctuation': /^&lt;\/?/,
378
+ 'namespace': /^[\w-]+?:/
379
+ }
380
+ },
381
+ 'attr-value': {
382
+ pattern: /=(?:('|")[\w\W]*?(\1)|[^\s>]+)/gi,
383
+ inside: {
384
+ 'punctuation': /=|>|"/g
385
+ }
386
+ },
387
+ 'punctuation': /\/?>/g,
388
+ 'attr-name': {
389
+ pattern: /[\w:-]+/g,
390
+ inside: {
391
+ 'namespace': /^[\w-]+?:/
392
+ }
393
+ }
394
+
395
+ }
396
+ },
397
+ 'entity': /&amp;#?[\da-z]{1,8};/gi
398
+ };
399
+
400
+ // Plugin to make entity title show the real entity, idea by Roman Komarov
401
+ Prism.hooks.add('wrap', function(env) {
402
+
403
+ if (env.type === 'entity') {
404
+ env.attributes['title'] = env.content.replace(/&amp;/, '&');
405
+ }
406
+ });;
407
+ Prism.languages.css = {
408
+ 'comment': /\/\*[\w\W]*?\*\//g,
409
+ 'atrule': {
410
+ pattern: /@[\w-]+?.*?(;|(?=\s*{))/gi,
411
+ inside: {
412
+ 'punctuation': /[;:]/g
413
+ }
414
+ },
415
+ 'url': /url\((["']?).*?\1\)/gi,
416
+ 'selector': /[^\{\}\s][^\{\};]*(?=\s*\{)/g,
417
+ 'property': /(\b|\B)[\w-]+(?=\s*:)/ig,
418
+ 'string': /("|')(\\?.)*?\1/g,
419
+ 'important': /\B!important\b/gi,
420
+ 'ignore': /&(lt|gt|amp);/gi,
421
+ 'punctuation': /[\{\};:]/g
422
+ };
423
+
424
+ if (Prism.languages.markup) {
425
+ Prism.languages.insertBefore('markup', 'tag', {
426
+ 'style': {
427
+ pattern: /(&lt;|<)style[\w\W]*?(>|&gt;)[\w\W]*?(&lt;|<)\/style(>|&gt;)/ig,
428
+ inside: {
429
+ 'tag': {
430
+ pattern: /(&lt;|<)style[\w\W]*?(>|&gt;)|(&lt;|<)\/style(>|&gt;)/ig,
431
+ inside: Prism.languages.markup.tag.inside
432
+ },
433
+ rest: Prism.languages.css
434
+ }
435
+ }
436
+ });
437
+ };
438
+ Prism.languages.clike = {
439
+ 'comment': {
440
+ pattern: /(^|[^\\])(\/\*[\w\W]*?\*\/|(^|[^:])\/\/.*?(\r?\n|$))/g,
441
+ lookbehind: true
442
+ },
443
+ 'string': /("|')(\\?.)*?\1/g,
444
+ 'class-name': {
445
+ pattern: /((?:(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/ig,
446
+ lookbehind: true,
447
+ inside: {
448
+ punctuation: /(\.|\\)/
449
+ }
450
+ },
451
+ 'keyword': /\b(if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/g,
452
+ 'boolean': /\b(true|false)\b/g,
453
+ 'function': {
454
+ pattern: /[a-z0-9_]+\(/ig,
455
+ inside: {
456
+ punctuation: /\(/
457
+ }
458
+ },
459
+ 'number': /\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/g,
460
+ 'operator': /[-+]{1,2}|!|&lt;=?|>=?|={1,3}|(&amp;){1,2}|\|?\||\?|\*|\/|\~|\^|\%/g,
461
+ 'ignore': /&(lt|gt|amp);/gi,
462
+ 'punctuation': /[{}[\];(),.:]/g
463
+ };
464
+ ;
465
+ Prism.languages.javascript = Prism.languages.extend('clike', {
466
+ 'keyword': /\b(var|let|if|else|while|do|for|return|in|instanceof|function|new|with|typeof|try|throw|catch|finally|null|break|continue)\b/g,
467
+ 'number': /\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?|NaN|-?Infinity)\b/g
468
+ });
469
+
470
+ Prism.languages.insertBefore('javascript', 'keyword', {
471
+ 'regex': {
472
+ pattern: /(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.;})]))/g,
473
+ lookbehind: true
474
+ }
475
+ });
476
+
477
+ if (Prism.languages.markup) {
478
+ Prism.languages.insertBefore('markup', 'tag', {
479
+ 'script': {
480
+ pattern: /(&lt;|<)script[\w\W]*?(>|&gt;)[\w\W]*?(&lt;|<)\/script(>|&gt;)/ig,
481
+ inside: {
482
+ 'tag': {
483
+ pattern: /(&lt;|<)script[\w\W]*?(>|&gt;)|(&lt;|<)\/script(>|&gt;)/ig,
484
+ inside: Prism.languages.markup.tag.inside
485
+ },
486
+ rest: Prism.languages.javascript
487
+ }
488
+ }
489
+ });
490
+ }
491
+ ;
492
+ Prism.languages.scss = Prism.languages.extend('css', {
493
+ 'comment': {
494
+ pattern: /(^|[^\\])(\/\*[\w\W]*?\*\/|\/\/.*?(\r?\n|$))/g,
495
+ lookbehind: true
496
+ },
497
+ // atrule is just the @***, not the entire rule (to highlight var & stuffs)
498
+ // + add ability to highlight number & unit for media queries
499
+ 'atrule': /@[\w-]+(?=\s+(\(|\{|;))/gi,
500
+ // url, compassified
501
+ 'url': /([-a-z]+-)*url(?=\()/gi,
502
+ // CSS selector regex is not appropriate for Sass
503
+ // since there can be lot more things (var, @ directive, nesting..)
504
+ // a selector must start at the end of a property or after a brace (end of other rules or nesting)
505
+ // it can contain some caracters that aren't used for defining rules or end of selector, & (parent selector), or interpolated variable
506
+ // the end of a selector is found when there is no rules in it ( {} or {\s}) or if there is a property (because an interpolated var
507
+ // can "pass" as a selector- e.g: proper#{$erty})
508
+ // this one was ard to do, so please be careful if you edit this one :)
509
+ 'selector': /([^@;\{\}\(\)]?([^@;\{\}\(\)]|&amp;|\#\{\$[-_\w]+\})+)(?=\s*\{(\}|\s|[^\}]+(:|\{)[^\}]+))/gm
510
+ });
511
+
512
+ Prism.languages.insertBefore('scss', 'atrule', {
513
+ 'keyword': /@(if|else if|else|for|each|while|import|extend|debug|warn|mixin|include|function|return)|(?=@for\s+\$[-_\w]+\s)+from/i
514
+ });
515
+
516
+ Prism.languages.insertBefore('scss', 'property', {
517
+ // var and interpolated vars
518
+ 'variable': /((\$[-_\w]+)|(#\{\$[-_\w]+\}))/i
519
+ });
520
+
521
+ Prism.languages.insertBefore('scss', 'ignore', {
522
+ 'placeholder': /%[-_\w]+/i,
523
+ 'statement': /\B!(default|optional)\b/gi,
524
+ 'boolean': /\b(true|false)\b/g,
525
+ 'null': /\b(null)\b/g,
526
+ 'operator': /\s+([-+]{1,2}|={1,2}|!=|\|?\||\?|\*|\/|\%)\s+/g
527
+ });
528
+ ;
529
+
530
+ Prism.languages.python= {
531
+ 'comment': {
532
+ pattern: /(^|[^\\])#.*?(\r?\n|$)/g,
533
+ lookbehind: true
534
+ },
535
+ 'string' : /("|')(\\?.)*?\1/g,
536
+ 'keyword' : /\b(as|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|pass|print|raise|return|try|while|with|yield)\b/g,
537
+ 'boolean' : /\b(True|False)\b/g,
538
+ 'number' : /\b-?(0x)?\d*\.?[\da-f]+\b/g,
539
+ 'operator' : /[-+]{1,2}|=?&lt;|=?&gt;|!|={1,2}|(&){1,2}|(&amp;){1,2}|\|?\||\?|\*|\/|~|\^|%|\b(or|and|not)\b/g,
540
+ 'ignore' : /&(lt|gt|amp);/gi,
541
+ 'punctuation' : /[{}[\];(),.:]/g
542
+ };
543
+ /**
544
+ * Original by Samuel Flores
545
+ *
546
+ * Adds the following new token classes:
547
+ * constant, builtin, variable, symbol, regex
548
+ */
549
+ Prism.languages.ruby = Prism.languages.extend('clike', {
550
+ 'comment': /#[^\r\n]*(\r?\n|$)/g,
551
+ 'keyword': /\b(alias|and|BEGIN|begin|break|case|class|def|define_method|defined|do|each|else|elsif|END|end|ensure|false|for|if|in|module|new|next|nil|not|or|raise|redo|require|rescue|retry|return|self|super|then|throw|true|undef|unless|until|when|while|yield)\b/g,
552
+ 'builtin': /\b(Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Stat|File|Fixnum|Fload|Hash|Integer|IO|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|String|Struct|TMS|Symbol|ThreadGroup|Thread|Time|TrueClass)\b/,
553
+ 'constant': /\b[A-Z][a-zA-Z_0-9]*[?!]?\b/g
554
+ });
555
+
556
+ Prism.languages.insertBefore('ruby', 'keyword', {
557
+ 'regex': {
558
+ pattern: /(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.;})]))/g,
559
+ lookbehind: true
560
+ },
561
+ 'variable': /[@$&]+\b[a-zA-Z_][a-zA-Z_0-9]*[?!]?\b/g,
562
+ 'symbol': /:\b[a-zA-Z_][a-zA-Z_0-9]*[?!]?\b/g
563
+ });
564
+ ;
565
+
566
+ /* -------------------
567
+ Line Highlighter
568
+ -------------------- */
569
+
570
+ (function(){
571
+
572
+ if(!window.Prism) {
573
+ return;
574
+ }
575
+
576
+ function $$(expr, con) {
577
+ return Array.prototype.slice.call((con || document).querySelectorAll(expr));
578
+ }
579
+
580
+ var CRLF = crlf = /\r?\n|\r/g;
581
+
582
+ function highlightLines(pre, lines, classes) {
583
+ var ranges = lines.replace(/\s+/g, '').split(','),
584
+ offset = +pre.getAttribute('data-line-offset') || 0;
585
+
586
+ var lineHeight = parseFloat(getComputedStyle(pre).lineHeight);
587
+
588
+ for (var i=0, range; range = ranges[i++];) {
589
+ range = range.split('-');
590
+
591
+ var start = +range[0],
592
+ end = +range[1] || start;
593
+
594
+ var line = document.createElement('div');
595
+
596
+ line.textContent = Array(end - start + 2).join(' \r\n');
597
+ line.className = (classes || '') + ' line-highlight';
598
+ line.setAttribute('data-start', start);
599
+
600
+ if(end > start) {
601
+ line.setAttribute('data-end', end);
602
+ }
603
+
604
+ line.style.top = (start - offset - 1) * lineHeight + 'px';
605
+
606
+ (pre.querySelector('code') || pre).appendChild(line);
607
+ }
608
+ }
609
+
610
+ function applyHash() {
611
+ var hash = location.hash.slice(1);
612
+
613
+ // Remove pre-existing temporary lines
614
+ $$('.temporary.line-highlight').forEach(function (line) {
615
+ line.parentNode.removeChild(line);
616
+ });
617
+
618
+ var range = (hash.match(/\.([\d,-]+)$/) || [,''])[1];
619
+
620
+ if (!range || document.getElementById(hash)) {
621
+ return;
622
+ }
623
+
624
+ var id = hash.slice(0, hash.lastIndexOf('.')),
625
+ pre = document.getElementById(id);
626
+
627
+ if (!pre) {
628
+ return;
629
+ }
630
+
631
+ if (!pre.hasAttribute('data-line')) {
632
+ pre.setAttribute('data-line', '');
633
+ }
634
+
635
+ highlightLines(pre, range, 'temporary ');
636
+
637
+ document.querySelector('.temporary.line-highlight').scrollIntoView();
638
+ }
639
+
640
+ var fakeTimer = 0; // Hack to limit the number of times applyHash() runs
641
+
642
+ Prism.hooks.add('after-highlight', function(env) {
643
+ var pre = env.element.parentNode;
644
+ var lines = pre && pre.getAttribute('data-line');
645
+
646
+ if (!pre || !lines || !/pre/i.test(pre.nodeName)) {
647
+ return;
648
+ }
649
+
650
+ clearTimeout(fakeTimer);
651
+
652
+ $$('.line-highlight', pre).forEach(function (line) {
653
+ line.parentNode.removeChild(line);
654
+ });
655
+
656
+ highlightLines(pre, lines);
657
+
658
+ fakeTimer = setTimeout(applyHash, 1);
659
+ });
660
+
661
+ addEventListener('hashchange', applyHash);
662
+
663
+ })();;
664
+
665
+ /* ----------------
666
+ Line Numbering
667
+ ----------------- */
668
+
669
+ Prism.hooks.add('after-highlight', function (env) {
670
+ // works only for <code> wrapped inside <pre data-line-numbers> (not inline)
671
+ var pre = env.element.parentNode;
672
+ if (!pre || !/pre/i.test(pre.nodeName) || pre.className.indexOf('line-numbers') === -1) {
673
+ return;
674
+ }
675
+
676
+ var linesNum = (1 + env.code.split('\n').length);
677
+ var lineNumbersWrapper;
678
+
679
+ lines = new Array(linesNum);
680
+ lines = lines.join('<span></span>');
681
+
682
+ lineNumbersWrapper = document.createElement('span');
683
+ lineNumbersWrapper.className = 'line-numbers-rows';
684
+ lineNumbersWrapper.innerHTML = lines;
685
+
686
+ if (pre.hasAttribute('data-start')) {
687
+ pre.style.counterReset = 'linenumber ' + (parseInt(pre.getAttribute('data-start'), 10) - 1);
688
+ }
689
+
690
+ env.element.appendChild(lineNumbersWrapper);
691
+
692
+ });;
@@ -0,0 +1,15 @@
1
+ ;(function ($, window, document, undefined) {
2
+ "use strict";
3
+
4
+ Edge.libs.ie8 = {
5
+ name : "name",
6
+ version : "1.0",
7
+ settings : {
8
+
9
+ },
10
+
11
+ init: function( scope, method, options ) {
12
+
13
+ },
14
+ }
15
+ }(jQuery, this, this.document) );