code
stringlengths
1
2.08M
language
stringclasses
1 value
/** * editor_plugin_src.js * * Copyright 2009, Moxiecode Systems AB * Released under LGPL License. * * License: http://tinymce.moxiecode.com/license * Contributing: http://tinymce.moxiecode.com/contributing */ (function() { tinymce.create('tinymce.plugins.VisualChars', { init : function(ed, url)...
JavaScript
/** * editor_plugin_src.js * * Copyright 2009, Moxiecode Systems AB * Released under LGPL License. * * License: http://tinymce.moxiecode.com/license * Contributing: http://tinymce.moxiecode.com/contributing */ (function() { tinymce.create('tinymce.plugins.XHTMLXtrasPlugin', { init : function(ed,...
JavaScript
/** * element_common.js * * Copyright 2009, Moxiecode Systems AB * Released under LGPL License. * * License: http://tinymce.moxiecode.com/license * Contributing: http://tinymce.moxiecode.com/contributing */ tinyMCEPopup.requireLangPack(); function initCommonAttributes(elm) { var formObj = docume...
JavaScript
/** * abbr.js * * Copyright 2009, Moxiecode Systems AB * Released under LGPL License. * * License: http://tinymce.moxiecode.com/license * Contributing: http://tinymce.moxiecode.com/contributing */ function init() { SXE.initElementDialog('abbr'); if (SXE.currentAction == "update") { SXE.showRem...
JavaScript
/** * cite.js * * Copyright 2009, Moxiecode Systems AB * Released under LGPL License. * * License: http://tinymce.moxiecode.com/license * Contributing: http://tinymce.moxiecode.com/contributing */ function init() { SXE.initElementDialog('cite'); if (SXE.currentAction == "update") { SXE.showRem...
JavaScript
/** * del.js * * Copyright 2009, Moxiecode Systems AB * Released under LGPL License. * * License: http://tinymce.moxiecode.com/license * Contributing: http://tinymce.moxiecode.com/contributing */ function init() { SXE.initElementDialog('del'); if (SXE.currentAction == "update") { setFormValue(...
JavaScript
/** * ins.js * * Copyright 2009, Moxiecode Systems AB * Released under LGPL License. * * License: http://tinymce.moxiecode.com/license * Contributing: http://tinymce.moxiecode.com/contributing */ function init() { SXE.initElementDialog('ins'); if (SXE.currentAction == "update") { setFormValue(...
JavaScript
/** * acronym.js * * Copyright 2009, Moxiecode Systems AB * Released under LGPL License. * * License: http://tinymce.moxiecode.com/license * Contributing: http://tinymce.moxiecode.com/contributing */ function init() { SXE.initElementDialog('acronym'); if (SXE.currentAction == "update") { SXE.s...
JavaScript
/** * attributes.js * * Copyright 2009, Moxiecode Systems AB * Released under LGPL License. * * License: http://tinymce.moxiecode.com/license * Contributing: http://tinymce.moxiecode.com/contributing */ function init() { tinyMCEPopup.resizeToInnerSize(); var inst = tinyMCEPopup.editor; var dom ...
JavaScript
/** * validate.js * * Copyright 2009, Moxiecode Systems AB * Released under LGPL License. * * License: http://tinymce.moxiecode.com/license * Contributing: http://tinymce.moxiecode.com/contributing */ /** // String validation: if (!Validator.isEmail('myemail')) alert('Invalid email.'); /...
JavaScript
/** * mctabs.js * * Copyright 2009, Moxiecode Systems AB * Released under LGPL License. * * License: http://tinymce.moxiecode.com/license * Contributing: http://tinymce.moxiecode.com/contributing */ function MCTabs() { this.settings = []; this.onChange = tinyMCEPopup.editor.windowManager.createIn...
JavaScript
/** * editable_selects.js * * Copyright 2009, Moxiecode Systems AB * Released under LGPL License. * * License: http://tinymce.moxiecode.com/license * Contributing: http://tinymce.moxiecode.com/contributing */ var TinyMCE_EditableSelects = { editSelectElm : null, init : function() { var nl = ...
JavaScript
/** * form_utils.js * * Copyright 2009, Moxiecode Systems AB * Released under LGPL License. * * License: http://tinymce.moxiecode.com/license * Contributing: http://tinymce.moxiecode.com/contributing */ var themeBaseURL = tinyMCEPopup.editor.baseURI.toAbsolute('themes/' + tinyMCEPopup.getParam("theme...
JavaScript
function resizePanel(PanelName, hasMenu, redoOnResize) { var clientHeight = jQuery(window).height(); var clientWidth = jQuery(window).width(); if (top.document.location == document.location) resizePanelTo(PanelName, hasMenu, clientWidth - 12, clientHeight - 20); else resizePanelT...
JavaScript
Umbraco.Sys.registerNamespace("Umbraco.Dialogs"); (function ($) { Umbraco.Dialogs.EditMacro = base2.Base.extend({ /// <summary>Defines the EditMacro class to controll the UI interaction and code insertion for the macro syntax for the code editor</summary> //private methods/variables ...
JavaScript
Umbraco.Sys.registerNamespace("Umbraco.Dialogs"); (function($) { Umbraco.Dialogs.UmbracoField = base2.Base.extend({ //private methods/variables _opts: null, // Constructor constructor: function (opts) { // Merge options w...
JavaScript
Umbraco.Sys.registerNamespace("Umbraco.Dialogs"); (function ($) { Umbraco.Dialogs.SortDialog = base2.Base.extend({ //private methods/variables _opts: null, _setupTableSorter: function () { //adds a custom sorter to the tablesorter based on the current cultures date...
JavaScript
Umbraco.Sys.registerNamespace("Umbraco.Dialogs"); (function ($) { // register AssignDomain dialog Umbraco.Dialogs.AssignDomain2 = base2.Base.extend({ _opts: null, _isRepeated: function (element) { var inputs = $('#form1 input.domain'); var ...
JavaScript
Umbraco.Sys.registerNamespace("Umbraco.Dialogs"); (function ($) { Umbraco.Dialogs.PublishDialog = base2.Base.extend({ //private methods/variables _opts: null, _koViewModel: null, // Constructor constructor: function () { }, ...
JavaScript
var activeDragId = ""; function expandCollapse(theId) { var edit = document.getElementById("edit" + theId); if (edit.style.display == 'none') { edit.style.display = 'block'; document.getElementById("desc" + theId).style.display = 'none'; } else { edit.style.display = ...
JavaScript
var step = 8; var padding = 10; function progressBarUpdate(id, percent) { var total = document.getElementById("progressBar" + id).style.width; total = Math.round(total.substring(0, total.length-2))-padding; var onePercent = total / 100; var progress = Math.round(onePercent*percent); if (progress % step =...
JavaScript
/*! * jQuery contextMenu - Plugin for simple contextMenu handling * * Version: 1.5.22 * * Authors: Rodney Rehm, Addy Osmani (patches for FF) * Web: http://medialize.github.com/jQuery-contextMenu/ * * Licensed under * MIT License http://www.opensource.org/licenses/mit-license * GPL v3 http://open...
JavaScript
/*! Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net) * Licensed under the MIT License (LICENSE.txt). * * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers. * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix. * * Version: 3.0.3-pre * * Requires: 1.2....
JavaScript
/// <reference path="/umbraco_client/Application/NamespaceManager.js" /> Umbraco.Sys.registerNamespace("Umbraco.Controls.CodeEditor"); (function($) { Umbraco.Controls.CodeEditor.UmbracoEditor = function(isSimpleEditor, controlId) { //initialize var _isSimpleEditor = isSimpleEditor; ...
JavaScript
function resizeTextArea(textEditor, offsetX, offsetY) { var clientHeight = getViewportHeight(); var clientWidth = getViewportWidth(); if (textEditor != null) { // textEditor.style.width = (clientWidth - offsetX) + "px"; textEditor.style.height = (clientHeight - getY(textEditor) - offse...
JavaScript
/*! * jQuery UI Timepicker 0.2.1 * * Copyright (c) 2009 Martin Milesich (http://milesich.com/) * * Some parts are * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) * * $Id: timepicker.js 28 2009-08-11 20:31:23Z majlo $ * * Depends: * ui.core.js * ui.datepicker.js * ui.slider.js */ (functio...
JavaScript
(function($) { $.fn.umbDateTimePicker = function(showTime, chooseDateTxt, noDateTxt, removeDateTxt) { return $(this).each(function() { //create the date/time picker $(this).datepicker({ duration: "", showTime: showTime, constr...
JavaScript
/* * Class: fileUploader * Use: Upload multiple files using jquery * Author: Matt Brailsford * Version: 1.0 */ (function ($, window, document, undefined) { $.event.props.push('dataTransfer'); var defaultOptions = { autoUpload: false, limit: false, allowedExtension: 'jpg|...
JavaScript
/// <reference path="/umbraco_client/Application/NamespaceManager.js" /> /// <reference path="UmbracoUtils.js" /> /// <reference path="/umbraco_client/modal/modal.js" /> /// <reference path="language.aspx" /> /// <reference name="MicrosoftAjax.js"/> Umbraco.Sys.registerNamespace("Umbraco.Application"); Umbra...
JavaScript
/// <reference path="/umbraco_client/Application/NamespaceManager.js" /> Umbraco.Sys.registerNamespace("Umbraco.Utils"); Umbraco.Utils.generateRandom = function() { /// <summary>Returns a random integer for use with URLs</summary> day = new Date() z = day.getTime() y = (z - (parseInt(z / 1000...
JavaScript
/// <reference path="/umbraco_client/Application/NamespaceManager.js" /> /// <reference path="/umbraco_client/Application/HistoryManager.js" /> /// <reference path="/umbraco_client/ui/jquery.js" /> /// <reference path="/umbraco_client/Tree/UmbracoTree.js" /> /// <reference name="MicrosoftAjax.js"/> Umbraco.Sys....
JavaScript
(function($) { $.fn.VerticalAlign = function(opts) { return this.each(function() { var top = (($(this).parent().height() - $(this).height()) / 2); $(this).css('margin-top', top); }); }; })(jQuery);
JavaScript
/* * jQuery Autocomplete plugin 1.1 * * Copyright (c) 2009 Jörn Zaefferer * * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html * * Revision: $Id: jquery.autocomplete.js 15 2009-08-22 10:30:27Z joern.zaefferer $ */ ; (functio...
JavaScript
//used for live editing to invoke no conflict after jquery has loaded with lazy loading //alert("jquery.noConflict: " + jQuery.noConflict); jQuery.noConflict();
JavaScript
/*! * jQuery idleTimer plugin * version 0.9.100511 * by Paul Irish. * http://github.com/paulirish/yui-misc/tree/ * MIT license * adapted from YUI idle timer by nzakas: * http://github.com/nzakas/yui-misc/ */ /* * Copyright (c) 2009 Nicholas C. Zakas * * Permission is hereby granted, free of charge...
JavaScript
/** * Cookie plugin * * Copyright (c) 2006 Klaus Hartl (stilbuero.de) * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html * */ /** * Create a cookie with the given name and value and other optional parameters. ...
JavaScript
/* * jQuery Hotkeys Plugin * Copyright 2010, John Resig * Dual licensed under the MIT or GPL Version 2 licenses. * * Based upon the plugin by Tzury Bar Yochay: * http://github.com/tzuryby/hotkeys * * Original idea by: * Binny V A, http://www.openjs.com/scripts/events/keyboard_shortcuts/ */ (functi...
JavaScript
Umbraco.Sys.registerNamespace("Umbraco.Utils"); Umbraco.Utils.UrlEncoder = { // public method for url encoding encode: function(string) { return escape(this._utf8_encode(string)); }, // public method for url decoding decode: function(string) { return this._utf8_decode(...
JavaScript
if (typeof Umbraco == 'undefined') var Umbraco = {}; if (!Umbraco.Sys) Umbraco.Sys = {}; Umbraco.Sys.registerNamespace = function(namespace) { /// <summary> /// Used to easily register namespaces for classes without doing the syntax listed on line 1/2 for each class. /// Pretty much the same as ASP....
JavaScript
/// <reference path="/umbraco_client/Application/NamespaceManager.js" /> /// <reference name="MicrosoftAjax.js"/> /// <reference path="/umbraco_client/Application/JQuery/jquery.ba-bbq.min.js" /> Umbraco.Sys.registerNamespace("Umbraco.Controls"); (function($) { Umbraco.Controls.HistoryManager = function(...
JavaScript
// // password_strength_plugin.js // Copyright (c) 2009 myPocket technologies (www.mypocket-technologies.com) // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the ...
JavaScript
/* * Jeditable - jQuery in place edit plugin * * Copyright (c) 2006-2009 Mika Tuupola, Dylan Verheul * * Licensed under the MIT license: * http://www.opensource.org/licenses/mit-license.php * * Project home: * http://www.appelsiini.net/projects/jeditable * * Based on editable by Dylan Verheul <dylan_at_...
JavaScript
/** * * Color picker * Author: Stefan Petre www.eyecon.ro * * Dual licensed under the MIT and GPL licenses * */ (function ($) { var ColorPicker = function () { var ids = {}, inAction, charMin = 65, visible, tpl = '<div class="colorpicker"><div class="colorpicker_color"><div><di...
JavaScript
/* jQuery Tags Input Plugin 1.3.3 Copyright (c) 2011 XOXCO, Inc Documentation for this plugin lives here: http://xoxco.com/clickable/jquery-tags-input Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php ben@xoxco.com */ (function($) { var delimiter = n...
JavaScript
Umbraco.Sys.registerNamespace("Umbraco.Dashboards"); (function ($) { Umbraco.Dashboards.ExamineManagement = base2.Base.extend({ //private methods/variables _opts: null, _koViewModel: null, _mapSearcherModelProperties: function (indexerModel) { var self = t...
JavaScript
(function($) { $.extend({ tablesorter: new function() { var parsers = [], widgets = []; this.defaults = { cssHeader: "header", cssAsc: "headerSortUp", cssDesc: "headerSortDown", sortInitialOrder: "asc", sortMultiSortKey: "shiftKey", sortForce: null, sortAppend: null, textExtract...
JavaScript
// // @author daemach // daemach = function() { this.name = "Daemach's Toolbox"; this.version = "2.0"; this.debug = false; // load extensions this.cw = new colorWeasel(this); this.cm = new cssMonkey(this); }; jQuery.extend(daemach, { prototype: { log: function() {...
JavaScript
// // TableDnD plug-in for JQuery, allows you to drag and drop table rows // You can set up various options to control how the system will work // Copyright (c) Denis Howlett <denish@isocra.com> // Licensed like jQuery, see http://docs.jquery.com/License. // // Configuration options: // // onDragStyle // ...
JavaScript
/// <reference path="../Application/NamespaceManager.js" /> Umbraco.Sys.registerNamespace('Umbraco.Controls'); Umbraco.Controls.TabView = (function () { var onChangeEvents = []; var obj = { setActiveTab: function (tabviewid, tabid, tabs) { for (var i = 0; i < tabs.length; i++) { ...
JavaScript
// CodeMirror version 2.34 // All functions that need access to the editor's state live inside // the CodeMirror function. Below that, at the bottom of the file, // some utilities are defined. // CodeMirror is the only global var we claim window.CodeMirror = (function() { "use strict"; // This is the fun...
JavaScript
(function () { CodeMirror.simpleHint = function (editor, getHints) { // We want a single cursor position. if (editor.somethingSelected()) return; //don't show completion if the token is empty var tempToken = editor.getTokenAt(editor.getCursor()); if (!(/[\S]/gi.test(tem...
JavaScript
(function(){ function SearchCursor(cm, query, pos, caseFold) { this.atOccurrence = false; this.cm = cm; if (caseFold == null && typeof query == "string") caseFold = false; pos = pos ? cm.clipPos(pos) : {line: 0, ch: 0}; this.pos = {from: pos, to: pos}; // The matches method is filled in ...
JavaScript
// Utility function that allows modes to be combined. The mode given // as the base argument takes care of most of the normal mode // functionality, but a second (typically simple) mode is used, which // can override the style of text. Both modes get to parse all of the // text, but when both assign a non-null styl...
JavaScript
CodeMirror.multiplexingMode = function(outer /*, others */) { // Others should be {open, close, mode [, delimStyle]} objects var others = Array.prototype.slice.call(arguments, 1); var n_others = others.length; function indexOf(string, pattern, from) { if (typeof pattern == "string") return string.ind...
JavaScript
(function() { CodeMirror.simpleHint = function(editor, getHints, givenOptions) { // Determine effective options based on given values and defaults. var options = {}, defaults = CodeMirror.simpleHint.defaults; for (var opt in defaults) if (defaults.hasOwnProperty(opt)) options[opt] = (g...
JavaScript
// Define search commands. Depends on dialog.js or another // implementation of the openDialog method. // Replace works a little oddly -- it will do the replace on the next // Ctrl-G (or whatever is bound to findNext) press. You prevent a // replace by making sure the match is no longer selected when hitting // ...
JavaScript
// Open simple dialogs on top of an editor. Relies on dialog.css. (function() { function dialogDiv(cm, template) { var wrap = cm.getWrapperElement(); var dialog = wrap.insertBefore(document.createElement("div"), wrap.firstChild); dialog.className = "CodeMirror-dialog"; dialog.innerHTML = '<div...
JavaScript
(function () { function forEach(arr, f) { for (var i = 0, e = arr.length; i < e; ++i) f(arr[i]); } function arrayContains(arr, item) { if (!Array.prototype.indexOf) { var i = arr.length; while (i--) { if (arr[i] === item) { return true; } } ...
JavaScript
// ============== Formatting extensions ============================ (function() { // Define extensions for a few modes CodeMirror.extendMode("css", { commentStart: "/*", commentEnd: "*/", wordWrapChars: [";", "\\{", "\\}"], autoFormatLineBreaks: function (text) { return text.replace(n...
JavaScript
(function () { function forEach(arr, f) { for (var i = 0, e = arr.length; i < e; ++i) f(arr[i]); } function arrayContains(arr, item) { if (!Array.prototype.indexOf) { var i = arr.length; while (i--) { if (arr[i] === item) { return true; } } ...
JavaScript
(function() { CodeMirror.xmlHints = []; CodeMirror.xmlHint = function(cm, simbol) { if(simbol.length > 0) { var cursor = cm.getCursor(); cm.replaceSelection(simbol); cursor = {line: cursor.line, ch: cursor.ch + 1}; cm.setCursor(cursor); ...
JavaScript
(function() { CodeMirror.razorHints['@'] = [ 'inherits', 'Library', 'Model', 'Parameter', 'using', 'Dictionary', ['if/else', 'if(SomeCondition){\n\n}else{\n\n}\n'], ['if', 'if(SomeCondition){\...
JavaScript
// the tagRangeFinder function is // Copyright (C) 2011 by Daniel Glazman <daniel@glazman.org> // released under the MIT license (../../LICENSE) like the rest of CodeMirror CodeMirror.tagRangeFinder = function(cm, line, hideEnd) { var nameStartChar = "A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-...
JavaScript
// Define match-highlighter commands. Depends on searchcursor.js // Use by attaching the following function call to the onCursorActivity event: //myCodeMirror.matchHighlight(minChars); // And including a special span.CodeMirror-matchhighlight css class (also optionally a separate one for .CodeMirror-focused -- see ...
JavaScript
/* Just enough of CodeMirror to run runMode under node.js */ function splitLines(string){ return string.split(/\r?\n|\r/); }; function StringStream(string) { this.pos = this.start = 0; this.string = string; } StringStream.prototype = { eol: function() {return this.pos >= this.string.length;}, sol: f...
JavaScript
/** * Tag-closer extension for CodeMirror. * * This extension adds a "closeTag" utility function that can be used with key bindings to * insert a matching end tag after the ">" character of a start tag has been typed. It can * also complete "</" if a matching start tag is found. It will correctly ignore si...
JavaScript
(function () { CodeMirror.razorHints = []; function arrayContains(arr, item) { if (!Array.prototype.indexOf) { var i = arr.length; while (i--) { if (arr[i] === item) { return true; } } re...
JavaScript
CodeMirror.runMode = function(string, modespec, callback, options) { function esc(str) { return str.replace(/[<&]/, function(ch) { return ch == "<" ? "&lt;" : "&amp;"; }); } var mode = CodeMirror.getMode(CodeMirror.defaults, modespec); var isNode = callback.nodeType == 1; var tabSize = (options &&...
JavaScript
(function() { if (!CodeMirror.modeURL) CodeMirror.modeURL = "../mode/%N/%N.js"; var loading = {}; function splitCallback(cont, n) { var countDown = n; return function() { if (--countDown == 0) cont(); }; } function ensureDeps(mode, cont) { var deps = CodeMirror.modes[mode].dependencies; ...
JavaScript
(function() { function keywords(str) { var obj = {}, words = str.split(" "); for (var i = 0; i < words.length; ++i) obj[words[i]] = true; return obj; } function heredoc(delim) { return function(stream, state) { if (stream.match(delim)) state.tokenize = null; else stream.skipTo...
JavaScript
CodeMirror.defineMode("verilog", function(config, parserConfig) { var indentUnit = config.indentUnit, keywords = parserConfig.keywords || {}, blockKeywords = parserConfig.blockKeywords || {}, atoms = parserConfig.atoms || {}, hooks = parserConfig.hooks || {}, multiLineStrings = par...
JavaScript
CodeMirror.defineMode("razor", function(config, parserConfig) { var indentUnit = config.indentUnit, keywords = words("abstract as base break case catch checked class const continue" + " default delegate do else enum event explicit extern finally fixed for" + " forea...
JavaScript
CodeMirror.defineMode('ocaml', function(config) { var words = { 'true': 'atom', 'false': 'atom', 'let': 'keyword', 'rec': 'keyword', 'in': 'keyword', 'of': 'keyword', 'and': 'keyword', 'succ': 'keyword', 'if': 'keyword', 'then': 'keyword', 'else': 'keyword', ...
JavaScript
CodeMirror.defineMode('tiki', function(config, parserConfig) { function inBlock(style, terminator, returnTokenizer) { return function(stream, state) { while (!stream.eol()) { if (stream.match(terminator)) { state.tokenize = inText; break; } stream.next(); } if (returnTok...
JavaScript
CodeMirror.defineMode("plsql", function(config, parserConfig) { var indentUnit = config.indentUnit, keywords = parserConfig.keywords, functions = parserConfig.functions, types = parserConfig.types, sqlplus = parserConfig.sqlplus, multiLineSt...
JavaScript
/* * See LICENSE in this directory for the license under which this code * is released. */ CodeMirror.defineMode("sieve", function(config) { function words(str) { var obj = {}, words = str.split(" "); for (var i = 0; i < words.length; ++i) obj[words[i]] = true; return obj; } var keywo...
JavaScript
/********************************************************** * This script provides syntax highlighting support for * the Ntriples format. * Ntriples format specification: * http://www.w3.org/TR/rdf-testcases/#ntriples ***********************************************************/ /* The following expr...
JavaScript
/** * Author: Hans Engel * Branched from CodeMirror's Scheme mode (by Koh Zi Han, based on implementation by Koh Zi Chun) */ CodeMirror.defineMode("clojure", function (config, mode) { var BUILTIN = "builtin", COMMENT = "comment", STRING = "string", TAG = "tag", ATOM = "atom", NUMBER = "number", BRA...
JavaScript
/* * Pig Latin Mode for CodeMirror 2 * @author Prasanth Jayachandran * @link https://github.com/prasanthj/pig-codemirror-2 * This implementation is adapted from PL/SQL mode in CodeMirror 2. */ CodeMirror.defineMode("pig", function(config, parserConfig) { var indentUnit = config.indentUnit, keywords = ...
JavaScript
CodeMirror.defineMode("smarty", function(config, parserConfig) { var keyFuncs = ["debug", "extends", "function", "include", "literal"]; var last; var regs = { operatorChars: /[+\-*&%=<>!?]/, validIdentifier: /[a-zA-Z0-9\_]/, stringChar: /[\'\"]/ }; var leftDelim = (typeof config.mode.leftD...
JavaScript
// CodeMirror2 mode/perl/perl.js (text/x-perl) beta 0.10 (2011-11-08) // This is a part of CodeMirror from https://github.com/sabaca/CodeMirror_mode_perl (mail@sabaca.com) CodeMirror.defineMode("perl",function(config,parserConfig){ // http://perldoc.perl.org var PERL={ // null - magic touch // ...
JavaScript
/** * Link to the project's GitHub page: * https://github.com/pickhardt/coffeescript-codemirror-mode */ CodeMirror.defineMode('coffeescript', function(conf) { var ERRORCLASS = 'error'; function wordRegexp(words) { return new RegExp("^((" + words.join(")|(") + "))\\b"); } var sing...
JavaScript
/* LESS mode - http://www.lesscss.org/ Ported to CodeMirror by Peter Kroon <plakroon@gmail.com> Report bugs/issues here: https://github.com/marijnh/CodeMirror/issues GitHub: @peterkroon */ CodeMirror.defineMode("less", function(config) { var indentUnit = config.indentUnit, type; function ret(style, ...
JavaScript
CodeMirror.defineMode("vbscript", function() { var regexVBScriptKeyword = /^(?:Call|Case|CDate|Clear|CInt|CLng|Const|CStr|Description|Dim|Do|Each|Else|ElseIf|End|Err|Error|Exit|False|For|Function|If|LCase|Loop|LTrim|Next|Nothing|Now|Number|On|Preserve|Quit|ReDim|Resume|RTrim|Select|Set|Sub|Then|To|Trim|True|UBound|U...
JavaScript
// Initiate ModeTest and set defaults var MT = ModeTest; MT.modeName = 'css'; MT.modeOptions = {}; // Requires at least one media query MT.testMode( 'atMediaEmpty', '@media { }', [ 'def', '@media', null, ' ', 'error', '{', null, ' }' ] ); MT.testMode( 'atMediaMultiple', ...
JavaScript
CodeMirror.defineMode("css", function(config) { var indentUnit = config.indentUnit, type; var atMediaTypes = keySet([ "all", "aural", "braille", "handheld", "print", "projection", "screen", "tty", "tv", "embossed" ]); var atMediaFeatures = keySet([ "width", "min-width", "max-width", "...
JavaScript
CodeMirror.defineMode('rst', function(config, options) { function setState(state, fn, ctx) { state.fn = fn; setCtx(state, ctx); } function setCtx(state, ctx) { state.ctx = ctx || {}; } function setNormal(state, ch) { if (ch && (typeof ch !== 'string')) { ...
JavaScript
CodeMirror.defineMode("velocity", function(config) { function parseWords(str) { var obj = {}, words = str.split(" "); for (var i = 0; i < words.length; ++i) obj[words[i]] = true; return obj; } var indentUnit = config.indentUnit; var keywords = parseWords("#end #else #bre...
JavaScript
CodeMirror.defineMode("python", function(conf, parserConf) { var ERRORCLASS = 'error'; function wordRegexp(words) { return new RegExp("^((" + words.join(")|(") + "))\\b"); } var singleOperators = new RegExp("^[\\+\\-\\*/%&|\\^~<>!]"); var singleDelimiters = new RegExp('^[\\...
JavaScript
// LUA mode. Ported to CodeMirror 2 from Franciszek Wawrzak's // CodeMirror 1 mode. // highlights keywords, strings, comments (no leveling supported! ("[==[")), tokens, basic indenting CodeMirror.defineMode("lua", function(config, parserConfig) { var indentUnit = config.indentUnit; function prefixRE(words...
JavaScript
CodeMirror.defineMode("rust", function() { var indentUnit = 4, altIndentUnit = 2; var valKeywords = { "if": "if-style", "while": "if-style", "else": "else-style", "do": "else-style", "ret": "else-style", "fail": "else-style", "break": "atom", "cont": "atom", "const": "let", "resource": "fn", "...
JavaScript
CodeMirror.defineMode("ecl", function(config) { function words(str) { var obj = {}, words = str.split(" "); for (var i = 0; i < words.length; ++i) obj[words[i]] = true; return obj; } function metaHook(stream, state) { if (!state.startOfLine) return false; stream.skipToEnd(); r...
JavaScript
CodeMirror.defineMode("diff", function() { var TOKEN_NAMES = { '+': 'tag', '-': 'string', '@': 'meta' }; return { token: function(stream) { var tw_pos = stream.string.search(/[\t ]+?$/); if (!stream.sol() || tw_pos === 0) { stream.skipToEnd(); return ("...
JavaScript
CodeMirror.defineMode("changes", function(config, modeConfig) { var headerSeperator = /^-+$/; var headerLine = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ?\d{1,2} \d{2}:\d{2}(:\d{2})? [A-Z]{3,4} \d{4} - /; var simpleEmail = /^[\w+.-]+@[\w.-]+/; return { token: ...
JavaScript
// Quick and dirty spec file highlighting CodeMirror.defineMode("spec", function(config, modeConfig) { var arch = /^(i386|i586|i686|x86_64|ppc64|ppc|ia64|s390x|s390|sparc64|sparcv9|sparc|noarch|alphaev6|alpha|hppa|mipsel)/; var preamble = /^(Name|Version|Release|License|Summary|Url|Group|Source|BuildArch|Bui...
JavaScript
CodeMirror.defineMode('shell', function(config) { var words = {}; function define(style, string) { var split = string.split(' '); for(var i = 0; i < split.length; i++) { words[split[i]] = style; } }; // Atoms define('atom', 'true false'); // Keywords define('keyword', 'i...
JavaScript
CodeMirror.defineMode("commonlisp", function (config) { var assumeBody = /^with|^def|^do|^prog|case$|^cond$|bind$|when$|unless$/; var numLiteral = /^(?:[+\-]?(?:\d+|\d*\.\d+)(?:[efd][+\-]?\d+)?|[+\-]?\d+(?:\/[+\-]?\d+)?|#b[+\-]?[01]+|#o[+\-]?[0-7]+|#x[+\-]?[\da-f]+)/; var symbol = /[^\s'`,@()\[\]";]/; var t...
JavaScript
CodeMirror.defineMode("go", function(config, parserConfig) { var indentUnit = config.indentUnit; var keywords = { "break":true, "case":true, "chan":true, "const":true, "continue":true, "default":true, "defer":true, "else":true, "fallthrough":true, "for":true, "func":true, "go":true, "goto":true, ...
JavaScript
CodeMirror.defineMode("r", function(config) { function wordObj(str) { var words = str.split(" "), res = {}; for (var i = 0; i < words.length; ++i) res[words[i]] = true; return res; } var atoms = wordObj("NULL NA Inf NaN NA_integer_ NA_real_ NA_complex_ NA_character_"); var builtins = wordObj(...
JavaScript
CodeMirror.defineMode("groovy", function(config, parserConfig) { function words(str) { var obj = {}, words = str.split(" "); for (var i = 0; i < words.length; ++i) obj[words[i]] = true; return obj; } var keywords = words( "abstract as assert boolean break byte case catch char class const co...
JavaScript