Current File : /home/pacjaorg/public_html/kmm/media/vendor/codemirror/mode/textile/textile.min.js
(function(d){typeof exports=="object"&&typeof module=="object"?d(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],d):d(CodeMirror)})(function(d){"use strict";var a={addition:"positive",attributes:"attribute",bold:"strong",cite:"keyword",code:"atom",definitionList:"number",deletion:"negative",div:"punctuation",em:"em",footnote:"variable",footCite:"qualifier",header:"header",html:"comment",image:"string",italic:"em",link:"link",linkDefinition:"link",list1:"variable-2",list2:"variable-3",list3:"keyword",notextile:"string-2",pre:"operator",p:"property",quote:"bracket",span:"quote",specialChar:"tag",strong:"strong",sub:"builtin",sup:"builtin",table:"variable-3",tableHeading:"operator"};function g(i,e){e.mode=r.newLayout,e.tableHeading=!1,e.layoutType==="definitionList"&&e.spanningLayout&&i.match(l("definitionListEnd"),!1)&&(e.spanningLayout=!1)}function s(i,e,n){if(n==="_")return i.eat("_")?f(i,e,"italic",/__/,2):f(i,e,"em",/_/,1);if(n==="*")return i.eat("*")?f(i,e,"bold",/\*\*/,2):f(i,e,"strong",/\*/,1);if(n==="[")return i.match(/\d+\]/)&&(e.footCite=!0),o(e);if(n==="("){var u=i.match(/^(r|tm|c)\)/);if(u)return c(e,a.specialChar)}if(n==="<"&&i.match(/(\w+)[^>]+>[^<]+<\/\1>/))return c(e,a.html);if(n==="?"&&i.eat("?"))return f(i,e,"cite",/\?\?/,2);if(n==="="&&i.eat("="))return f(i,e,"notextile",/==/,2);if(n==="-"&&!i.eat("-"))return f(i,e,"deletion",/-/,1);if(n==="+")return f(i,e,"addition",/\+/,1);if(n==="~")return f(i,e,"sub",/~/,1);if(n==="^")return f(i,e,"sup",/\^/,1);if(n==="%")return f(i,e,"span",/%/,1);if(n==="@")return f(i,e,"code",/@/,1);if(n==="!"){var b=f(i,e,"image",/(?:\([^\)]+\))?!/,1);return i.match(/^:\S+/),b}return o(e)}function f(i,e,n,u,b){var p=i.pos>b?i.string.charAt(i.pos-b-1):null,y=i.peek();if(e[n]){if((!y||/\W/.test(y))&&p&&/\S/.test(p)){var v=o(e);return e[n]=!1,v}}else(!p||/\W/.test(p))&&y&&/\S/.test(y)&&i.match(new RegExp("^.*\\S"+u.source+"(?:\\W|$)"),!1)&&(e[n]=!0,e.mode=r.attributes);return o(e)}function o(i){var e=h(i);if(e)return e;var n=[];return i.layoutType&&n.push(a[i.layoutType]),n=n.concat(m(i,"addition","bold","cite","code","deletion","em","footCite","image","italic","link","span","strong","sub","sup","table","tableHeading")),i.layoutType==="header"&&n.push(a.header+"-"+i.header),n.length?n.join(" "):null}function h(i){var e=i.layoutType;switch(e){case"notextile":case"code":case"pre":return a[e];default:return i.notextile?a.notextile+(e?" "+a[e]:""):null}}function c(i,e){var n=h(i);if(n)return n;var u=o(i);return e?u?u+" "+e:e:u}function m(i){for(var e=[],n=1;n<arguments.length;++n)i[arguments[n]]&&e.push(a[arguments[n]]);return e}function k(i){var e=i.spanningLayout,n=i.layoutType;for(var u in i)i.hasOwnProperty(u)&&delete i[u];i.mode=r.newLayout,e&&(i.layoutType=n,i.spanningLayout=!0)}var t={cache:{},single:{bc:"bc",bq:"bq",definitionList:/- .*?:=+/,definitionListEnd:/.*=:\s*$/,div:"div",drawTable:/\|.*\|/,foot:/fn\d+/,header:/h[1-6]/,html:/\s*<(?:\/)?(\w+)(?:[^>]+)?>(?:[^<]+<\/\1>)?/,link:/[^"]+":\S/,linkDefinition:/\[[^\s\]]+\]\S+/,list:/(?:#+|\*+)/,notextile:"notextile",para:"p",pre:"pre",table:"table",tableCellAttributes:/[\/\\]\d+/,tableHeading:/\|_\./,tableText:/[^"_\*\[\(\?\+~\^%@|-]+/,text:/[^!"_=\*\[\(<\?\+~\^%@-]+/},attributes:{align:/(?:<>|<|>|=)/,selector:/\([^\(][^\)]+\)/,lang:/\[[^\[\]]+\]/,pad:/(?:\(+|\)+){1,2}/,css:/\{[^\}]+\}/},createRe:function(i){switch(i){case"drawTable":return t.makeRe("^",t.single.drawTable,"$");case"html":return t.makeRe("^",t.single.html,"(?:",t.single.html,")*","$");case"linkDefinition":return t.makeRe("^",t.single.linkDefinition,"$");case"listLayout":return t.makeRe("^",t.single.list,l("allAttributes"),"*\\s+");case"tableCellAttributes":return t.makeRe("^",t.choiceRe(t.single.tableCellAttributes,l("allAttributes")),"+\\.");case"type":return t.makeRe("^",l("allTypes"));case"typeLayout":return t.makeRe("^",l("allTypes"),l("allAttributes"),"*\\.\\.?","(\\s+|$)");case"attributes":return t.makeRe("^",l("allAttributes"),"+");case"allTypes":return t.choiceRe(t.single.div,t.single.foot,t.single.header,t.single.bc,t.single.bq,t.single.notextile,t.single.pre,t.single.table,t.single.para);case"allAttributes":return t.choiceRe(t.attributes.selector,t.attributes.css,t.attributes.lang,t.attributes.align,t.attributes.pad);default:return t.makeRe("^",t.single[i])}},makeRe:function(){for(var i="",e=0;e<arguments.length;++e){var n=arguments[e];i+=typeof n=="string"?n:n.source}return new RegExp(i)},choiceRe:function(){for(var i=[arguments[0]],e=1;e<arguments.length;++e)i[e*2-1]="|",i[e*2]=arguments[e];return i.unshift("(?:"),i.push(")"),t.makeRe.apply(null,i)}};function l(i){return t.cache[i]||(t.cache[i]=t.createRe(i))}var r={newLayout:function(i,e){if(i.match(l("typeLayout"),!1))return e.spanningLayout=!1,(e.mode=r.blockType)(i,e);var n;return h(e)||(i.match(l("listLayout"),!1)?n=r.list:i.match(l("drawTable"),!1)?n=r.table:i.match(l("linkDefinition"),!1)?n=r.linkDefinition:i.match(l("definitionList"))?n=r.definitionList:i.match(l("html"),!1)&&(n=r.html)),(e.mode=n||r.text)(i,e)},blockType:function(i,e){var n,u;if(e.layoutType=null,n=i.match(l("type")))u=n[0];else return(e.mode=r.text)(i,e);return(n=u.match(l("header")))?(e.layoutType="header",e.header=parseInt(n[0][1])):u.match(l("bq"))?e.layoutType="quote":u.match(l("bc"))?e.layoutType="code":u.match(l("foot"))?e.layoutType="footnote":u.match(l("notextile"))?e.layoutType="notextile":u.match(l("pre"))?e.layoutType="pre":u.match(l("div"))?e.layoutType="div":u.match(l("table"))&&(e.layoutType="table"),e.mode=r.attributes,o(e)},text:function(i,e){if(i.match(l("text")))return o(e);var n=i.next();return n==='"'?(e.mode=r.link)(i,e):s(i,e,n)},attributes:function(i,e){return e.mode=r.layoutLength,i.match(l("attributes"))?c(e,a.attributes):o(e)},layoutLength:function(i,e){return i.eat(".")&&i.eat(".")&&(e.spanningLayout=!0),e.mode=r.text,o(e)},list:function(i,e){var n=i.match(l("list"));e.listDepth=n[0].length;var u=(e.listDepth-1)%3;return u?u===1?e.layoutType="list2":e.layoutType="list3":e.layoutType="list1",e.mode=r.attributes,o(e)},link:function(i,e){return e.mode=r.text,i.match(l("link"))?(i.match(/\S+/),c(e,a.link)):o(e)},linkDefinition:function(i,e){return i.skipToEnd(),c(e,a.linkDefinition)},definitionList:function(i,e){return i.match(l("definitionList")),e.layoutType="definitionList",i.match(/\s*$/)?e.spanningLayout=!0:e.mode=r.attributes,o(e)},html:function(i,e){return i.skipToEnd(),c(e,a.html)},table:function(i,e){return e.layoutType="table",(e.mode=r.tableCell)(i,e)},tableCell:function(i,e){return i.match(l("tableHeading"))?e.tableHeading=!0:i.eat("|"),e.mode=r.tableCellAttributes,o(e)},tableCellAttributes:function(i,e){return e.mode=r.tableText,i.match(l("tableCellAttributes"))?c(e,a.attributes):o(e)},tableText:function(i,e){return i.match(l("tableText"))?o(e):i.peek()==="|"?(e.mode=r.tableCell,o(e)):s(i,e,i.next())}};d.defineMode("textile",function(){return{startState:function(){return{mode:r.newLayout}},token:function(i,e){return i.sol()&&g(i,e),e.mode(i,e)},blankLine:k}}),d.defineMIME("text/x-textile","textile")});
Site is undergoing maintenance

PACJA Events

Maintenance mode is on

Site will be available soon. Thank you for your patience!