code
stringlengths
24
2.07M
docstring
stringlengths
25
85.3k
func_name
stringlengths
1
92
language
stringclasses
1 value
repo
stringlengths
5
64
path
stringlengths
4
172
url
stringlengths
44
218
license
stringclasses
7 values
function createMatch(self, shift) { var match = new Match(self, shift); self.__compiled__[match.schema].normalize(match, self); return match; }
Match#url -> String Normalized url of matched string.
createMatch
javascript
jbt/markdown-editor
lib/markdown-it.js
https://github.com/jbt/markdown-editor/blob/master/lib/markdown-it.js
ISC
function LinkifyIt(schemas) { if (!(this instanceof LinkifyIt)) { return new LinkifyIt(schemas); } // Cache last tested result. Used to skip repeating steps on next `match` call. this.__index__ = -1; this.__last_index__ = -1; // Next scan position this.__schema__ = ''; this.__tex...
new LinkifyIt(schemas) - schemas (Object): Optional. Additional schemas to validate (prefix/validator) Creates new linkifier instance with optional additional schemas. Can be called without `new` keyword for convenience. By default understands: - `http(s)://...` , `ftp://...`, `mailto:...` & `//...` links - "fuzzy" ...
LinkifyIt
javascript
jbt/markdown-editor
lib/markdown-it.js
https://github.com/jbt/markdown-editor/blob/master/lib/markdown-it.js
ISC
function getDecodeCache(exclude) { var i, ch, cache = decodeCache[exclude]; if (cache) { return cache; } cache = decodeCache[exclude] = []; for (i = 0; i < 128; i++) { ch = String.fromCharCode(i); cache.push(ch); } for (i = 0; i < exclude.length; i++) { ch = exclude.charCodeAt(i); cache[c...
LinkifyIt#normalize(match) Default normalizer (if schema does not define it's own).
getDecodeCache
javascript
jbt/markdown-editor
lib/markdown-it.js
https://github.com/jbt/markdown-editor/blob/master/lib/markdown-it.js
ISC
function decode(string, exclude) { var cache; if (typeof exclude !== 'string') { exclude = decode.defaultChars; } cache = getDecodeCache(exclude); return string.replace(/(%[a-f0-9]{2})+/gi, function(seq) { var i, l, b1, b2, b3, b4, char, result = ''; for (i = 0, l = seq.length; i < l; ...
LinkifyIt#normalize(match) Default normalizer (if schema does not define it's own).
decode
javascript
jbt/markdown-editor
lib/markdown-it.js
https://github.com/jbt/markdown-editor/blob/master/lib/markdown-it.js
ISC
function getEncodeCache(exclude) { var i, ch, cache = encodeCache[exclude]; if (cache) { return cache; } cache = encodeCache[exclude] = []; for (i = 0; i < 128; i++) { ch = String.fromCharCode(i); if (/^[0-9a-z]$/i.test(ch)) { // always allow unencoded alphanumeric characters cache.push(c...
LinkifyIt#normalize(match) Default normalizer (if schema does not define it's own).
getEncodeCache
javascript
jbt/markdown-editor
lib/markdown-it.js
https://github.com/jbt/markdown-editor/blob/master/lib/markdown-it.js
ISC
function encode(string, exclude, keepEscaped) { var i, l, code, nextCode, cache, result = ''; if (typeof exclude !== 'string') { // encode(string, keepEscaped) keepEscaped = exclude; exclude = encode.defaultChars; } if (typeof keepEscaped === 'undefined') { keepEscaped = true; } ca...
LinkifyIt#normalize(match) Default normalizer (if schema does not define it's own).
encode
javascript
jbt/markdown-editor
lib/markdown-it.js
https://github.com/jbt/markdown-editor/blob/master/lib/markdown-it.js
ISC
function Url() { this.protocol = null; this.slashes = null; this.auth = null; this.port = null; this.hostname = null; this.hash = null; this.search = null; this.pathname = null; }
LinkifyIt#normalize(match) Default normalizer (if schema does not define it's own).
Url
javascript
jbt/markdown-editor
lib/markdown-it.js
https://github.com/jbt/markdown-editor/blob/master/lib/markdown-it.js
ISC
function urlParse(url, slashesDenoteHost) { if (url && url instanceof Url) { return url; } var u = new Url(); u.parse(url, slashesDenoteHost); return u; }
LinkifyIt#normalize(match) Default normalizer (if schema does not define it's own).
urlParse
javascript
jbt/markdown-editor
lib/markdown-it.js
https://github.com/jbt/markdown-editor/blob/master/lib/markdown-it.js
ISC
arrayBufferToBase64 = buffer => { let binary = ''; let bytes = [].slice.call(new Uint8Array(buffer.data.data)); bytes.forEach((b) => binary += String.fromCharCode(b)); return `data:${buffer.contentType};base64,${window.btoa(binary)}`; }
base64.js this helper formulate buffer data to base64 string
arrayBufferToBase64
javascript
mohamedsamara/mern-ecommerce
client/app/utils/base64.js
https://github.com/mohamedsamara/mern-ecommerce/blob/master/client/app/utils/base64.js
MIT
arrayBufferToBase64 = buffer => { let binary = ''; let bytes = [].slice.call(new Uint8Array(buffer.data.data)); bytes.forEach((b) => binary += String.fromCharCode(b)); return `data:${buffer.contentType};base64,${window.btoa(binary)}`; }
base64.js this helper formulate buffer data to base64 string
arrayBufferToBase64
javascript
mohamedsamara/mern-ecommerce
client/app/utils/base64.js
https://github.com/mohamedsamara/mern-ecommerce/blob/master/client/app/utils/base64.js
MIT
formatDate = date => { const newDate = new Date(date); // const newDateOptions = { // year: "numeric", // month: "short", // day: "numeric" // }; return newDate.toLocaleDateString('en-US', dateOptions); }
date.js this helper formulate date
formatDate
javascript
mohamedsamara/mern-ecommerce
client/app/utils/date.js
https://github.com/mohamedsamara/mern-ecommerce/blob/master/client/app/utils/date.js
MIT
formatDate = date => { const newDate = new Date(date); // const newDateOptions = { // year: "numeric", // month: "short", // day: "numeric" // }; return newDate.toLocaleDateString('en-US', dateOptions); }
date.js this helper formulate date
formatDate
javascript
mohamedsamara/mern-ecommerce
client/app/utils/date.js
https://github.com/mohamedsamara/mern-ecommerce/blob/master/client/app/utils/date.js
MIT
formatTime = date => { const newDate = new Date(date); return newDate.toLocaleTimeString(undefined, timeOptions); }
date.js this helper formulate date
formatTime
javascript
mohamedsamara/mern-ecommerce
client/app/utils/date.js
https://github.com/mohamedsamara/mern-ecommerce/blob/master/client/app/utils/date.js
MIT
formatTime = date => { const newDate = new Date(date); return newDate.toLocaleTimeString(undefined, timeOptions); }
date.js this helper formulate date
formatTime
javascript
mohamedsamara/mern-ecommerce
client/app/utils/date.js
https://github.com/mohamedsamara/mern-ecommerce/blob/master/client/app/utils/date.js
MIT
handleError = (err, dispatch, title = '') => { const unsuccessfulOptions = { title: `${title}`, message: ``, position: 'tr', autoDismiss: 1 }; if (err.response) { if (err.response.status === 400) { unsuccessfulOptions.title = title ? title : 'Please Try Again!'; unsuccessfulOption...
error.js This is a generic error handler, it receives the error returned from the server and present it on a pop up
handleError
javascript
mohamedsamara/mern-ecommerce
client/app/utils/error.js
https://github.com/mohamedsamara/mern-ecommerce/blob/master/client/app/utils/error.js
MIT
handleError = (err, dispatch, title = '') => { const unsuccessfulOptions = { title: `${title}`, message: ``, position: 'tr', autoDismiss: 1 }; if (err.response) { if (err.response.status === 400) { unsuccessfulOptions.title = title ? title : 'Please Try Again!'; unsuccessfulOption...
error.js This is a generic error handler, it receives the error returned from the server and present it on a pop up
handleError
javascript
mohamedsamara/mern-ecommerce
client/app/utils/error.js
https://github.com/mohamedsamara/mern-ecommerce/blob/master/client/app/utils/error.js
MIT
formatSelectOptions = (data, empty = false, from) => { let newSelectOptions = []; if (data && data.length > 0) { data.map(option => { let newOption = {}; newOption.value = option._id; newOption.label = option.name; newSelectOptions.push(newOption); }); } if (empty) { const ...
select.js this helper formulate data into select options
formatSelectOptions
javascript
mohamedsamara/mern-ecommerce
client/app/utils/select.js
https://github.com/mohamedsamara/mern-ecommerce/blob/master/client/app/utils/select.js
MIT
formatSelectOptions = (data, empty = false, from) => { let newSelectOptions = []; if (data && data.length > 0) { data.map(option => { let newOption = {}; newOption.value = option._id; newOption.label = option.name; newSelectOptions.push(newOption); }); } if (empty) { const ...
select.js this helper formulate data into select options
formatSelectOptions
javascript
mohamedsamara/mern-ecommerce
client/app/utils/select.js
https://github.com/mohamedsamara/mern-ecommerce/blob/master/client/app/utils/select.js
MIT
unformatSelectOptions = data => { if (!data) return null; let newSelectOptions = []; if (data && data.length > 0) { data.map(option => { let newOption = {}; newOption._id = option.value; newSelectOptions.push(newOption._id); }); } return newSelectOptions; }
select.js this helper formulate data into select options
unformatSelectOptions
javascript
mohamedsamara/mern-ecommerce
client/app/utils/select.js
https://github.com/mohamedsamara/mern-ecommerce/blob/master/client/app/utils/select.js
MIT
unformatSelectOptions = data => { if (!data) return null; let newSelectOptions = []; if (data && data.length > 0) { data.map(option => { let newOption = {}; newOption._id = option.value; newSelectOptions.push(newOption._id); }); } return newSelectOptions; }
select.js this helper formulate data into select options
unformatSelectOptions
javascript
mohamedsamara/mern-ecommerce
client/app/utils/select.js
https://github.com/mohamedsamara/mern-ecommerce/blob/master/client/app/utils/select.js
MIT
setToken = token => { if (token) { axios.defaults.headers.common['Authorization'] = token; } else { delete axios.defaults.headers.common['Authorization']; } }
token.js axios default headers setup
setToken
javascript
mohamedsamara/mern-ecommerce
client/app/utils/token.js
https://github.com/mohamedsamara/mern-ecommerce/blob/master/client/app/utils/token.js
MIT
setToken = token => { if (token) { axios.defaults.headers.common['Authorization'] = token; } else { delete axios.defaults.headers.common['Authorization']; } }
token.js axios default headers setup
setToken
javascript
mohamedsamara/mern-ecommerce
client/app/utils/token.js
https://github.com/mohamedsamara/mern-ecommerce/blob/master/client/app/utils/token.js
MIT
Tagging = function( elem, options ) { this.elem = elem; // The tag box this.$elem = $( elem ); // jQuerify tag box this.options = options; // JS custom options this.tags = []; // Here we store all tags // this.$type_zone = void 0; // The tag...
taggingJS Constructor @param obj elem DOM object of tag box @param obj options Custom JS options
Tagging
javascript
sniperwolf/taggingJS
tagging.js
https://github.com/sniperwolf/taggingJS/blob/master/tagging.js
MIT
Tagging = function( elem, options ) { this.elem = elem; // The tag box this.$elem = $( elem ); // jQuerify tag box this.options = options; // JS custom options this.tags = []; // Here we store all tags // this.$type_zone = void 0; // The tag...
taggingJS Constructor @param obj elem DOM object of tag box @param obj options Custom JS options
Tagging
javascript
sniperwolf/taggingJS
example/tagging.js
https://github.com/sniperwolf/taggingJS/blob/master/example/tagging.js
MIT
function _applyAttrs(context, attrs) { for (var attr in attrs) { if (attrs.hasOwnProperty(attr)) { context.setAttribute(attr, attrs[attr]); } } }
Applies attributes to a DOM object @param {object} context The DOM obj you want to apply the attributes to @param {object} attrs A key/value pair of attributes you want to apply @returns {undefined}
_applyAttrs
javascript
OscarGodson/EpicEditor
epiceditor/js/epiceditor.js
https://github.com/OscarGodson/EpicEditor/blob/master/epiceditor/js/epiceditor.js
MIT
function _applyStyles(context, attrs) { for (var attr in attrs) { if (attrs.hasOwnProperty(attr)) { context.style[attr] = attrs[attr]; } } }
Applies styles to a DOM object @param {object} context The DOM obj you want to apply the attributes to @param {object} attrs A key/value pair of attributes you want to apply @returns {undefined}
_applyStyles
javascript
OscarGodson/EpicEditor
epiceditor/js/epiceditor.js
https://github.com/OscarGodson/EpicEditor/blob/master/epiceditor/js/epiceditor.js
MIT
function _getStyle(el, styleProp) { var x = el , y = null; if (window.getComputedStyle) { y = document.defaultView.getComputedStyle(x, null).getPropertyValue(styleProp); } else if (x.currentStyle) { y = x.currentStyle[styleProp]; } return y; }
Returns a DOM objects computed style @param {object} el The element you want to get the style from @param {string} styleProp The property you want to get from the element @returns {string} Returns a string of the value. If property is not set it will return a blank string
_getStyle
javascript
OscarGodson/EpicEditor
epiceditor/js/epiceditor.js
https://github.com/OscarGodson/EpicEditor/blob/master/epiceditor/js/epiceditor.js
MIT
function _saveStyleState(el, type, styles) { var returnState = {} , style; if (type === 'save') { for (style in styles) { if (styles.hasOwnProperty(style)) { returnState[style] = _getStyle(el, style); } } // After it's all done saving all the previous states, ch...
Saves the current style state for the styles requested, then applies styles to overwrite the existing one. The old styles are returned as an object so you can pass it back in when you want to revert back to the old style @param {object} el The element to get the styles of @param {string} type Can be "save" or...
_saveStyleState
javascript
OscarGodson/EpicEditor
epiceditor/js/epiceditor.js
https://github.com/OscarGodson/EpicEditor/blob/master/epiceditor/js/epiceditor.js
MIT
function _outerWidth(el) { var b = parseInt(_getStyle(el, 'border-left-width'), 10) + parseInt(_getStyle(el, 'border-right-width'), 10) , p = parseInt(_getStyle(el, 'padding-left'), 10) + parseInt(_getStyle(el, 'padding-right'), 10) , w = el.offsetWidth , t; // For IE in case no border is set ...
Gets an elements total width including it's borders and padding @param {object} el The element to get the total width of @returns {int}
_outerWidth
javascript
OscarGodson/EpicEditor
epiceditor/js/epiceditor.js
https://github.com/OscarGodson/EpicEditor/blob/master/epiceditor/js/epiceditor.js
MIT
function _outerHeight(el) { var b = parseInt(_getStyle(el, 'border-top-width'), 10) + parseInt(_getStyle(el, 'border-bottom-width'), 10) , p = parseInt(_getStyle(el, 'padding-top'), 10) + parseInt(_getStyle(el, 'padding-bottom'), 10) , w = parseInt(_getStyle(el, 'height'), 10) , t; // For IE i...
Gets an elements total height including it's borders and padding @param {object} el The element to get the total width of @returns {int}
_outerHeight
javascript
OscarGodson/EpicEditor
epiceditor/js/epiceditor.js
https://github.com/OscarGodson/EpicEditor/blob/master/epiceditor/js/epiceditor.js
MIT
function _insertCSSLink(path, context, id) { id = id || ''; var headID = context.getElementsByTagName("head")[0] , cssNode = context.createElement('link'); _applyAttrs(cssNode, { type: 'text/css' , id: id , rel: 'stylesheet' , href: path , name: path , media: 'screen' ...
Inserts a <link> tag specifically for CSS @param {string} path The path to the CSS file @param {object} context In what context you want to apply this to (document, iframe, etc) @param {string} id An id for you to reference later for changing properties of the <link> @returns {undefined}
_insertCSSLink
javascript
OscarGodson/EpicEditor
epiceditor/js/epiceditor.js
https://github.com/OscarGodson/EpicEditor/blob/master/epiceditor/js/epiceditor.js
MIT
function _replaceClass(e, o, n) { e.className = e.className.replace(o, n); }
Inserts a <link> tag specifically for CSS @param {string} path The path to the CSS file @param {object} context In what context you want to apply this to (document, iframe, etc) @param {string} id An id for you to reference later for changing properties of the <link> @returns {undefined}
_replaceClass
javascript
OscarGodson/EpicEditor
epiceditor/js/epiceditor.js
https://github.com/OscarGodson/EpicEditor/blob/master/epiceditor/js/epiceditor.js
MIT
function _getIframeInnards(el) { return el.contentDocument || el.contentWindow.document; }
Inserts a <link> tag specifically for CSS @param {string} path The path to the CSS file @param {object} context In what context you want to apply this to (document, iframe, etc) @param {string} id An id for you to reference later for changing properties of the <link> @returns {undefined}
_getIframeInnards
javascript
OscarGodson/EpicEditor
epiceditor/js/epiceditor.js
https://github.com/OscarGodson/EpicEditor/blob/master/epiceditor/js/epiceditor.js
MIT
function _getText(el) { var theText; // Make sure to check for type of string because if the body of the page // doesn't have any text it'll be "" which is falsey and will go into // the else which is meant for Firefox and shit will break if (typeof document.body.innerText == 'string') { theTe...
Inserts a <link> tag specifically for CSS @param {string} path The path to the CSS file @param {object} context In what context you want to apply this to (document, iframe, etc) @param {string} id An id for you to reference later for changing properties of the <link> @returns {undefined}
_getText
javascript
OscarGodson/EpicEditor
epiceditor/js/epiceditor.js
https://github.com/OscarGodson/EpicEditor/blob/master/epiceditor/js/epiceditor.js
MIT
function _setText(el, content) { // Don't convert lt/gt characters as HTML when viewing the editor window // TODO: Write a test to catch regressions for this content = content.replace(/</g, '&lt;'); content = content.replace(/>/g, '&gt;'); content = content.replace(/\n/g, '<br>'); // Make s...
Inserts a <link> tag specifically for CSS @param {string} path The path to the CSS file @param {object} context In what context you want to apply this to (document, iframe, etc) @param {string} id An id for you to reference later for changing properties of the <link> @returns {undefined}
_setText
javascript
OscarGodson/EpicEditor
epiceditor/js/epiceditor.js
https://github.com/OscarGodson/EpicEditor/blob/master/epiceditor/js/epiceditor.js
MIT
function _sanitizeRawContent(content) { // Get this, 2 spaces in a content editable actually converts to: // 0020 00a0, meaning, "space no-break space". So, manually convert // no-break spaces to spaces again before handing to marked. // Also, WebKit converts no-break to unicode equivalent and FF HTML. ...
Converts the 'raw' format of a file's contents into plaintext @param {string} content Contents of the file @returns {string} the sanitized content
_sanitizeRawContent
javascript
OscarGodson/EpicEditor
epiceditor/js/epiceditor.js
https://github.com/OscarGodson/EpicEditor/blob/master/epiceditor/js/epiceditor.js
MIT
function _isIE() { var rv = -1 // Return value assumes failure. , ua = navigator.userAgent , re; if (navigator.appName == 'Microsoft Internet Explorer') { re = /MSIE ([0-9]{1,}[\.0-9]{0,})/; if (re.exec(ua) != null) { rv = parseFloat(RegExp.$1, 10); } } return rv; ...
Will return the version number if the browser is IE. If not will return -1 TRY NEVER TO USE THIS AND USE FEATURE DETECTION IF POSSIBLE @returns {Number} -1 if false or the version number if true
_isIE
javascript
OscarGodson/EpicEditor
epiceditor/js/epiceditor.js
https://github.com/OscarGodson/EpicEditor/blob/master/epiceditor/js/epiceditor.js
MIT
function _isSafari() { var n = window.navigator; return n.userAgent.indexOf('Safari') > -1 && n.userAgent.indexOf('Chrome') == -1; }
Same as the isIE(), but simply returns a boolean THIS IS TERRIBLE AND IS ONLY USED BECAUSE FULLSCREEN IN SAFARI IS BORKED If some other engine uses WebKit and has support for fullscreen they probably wont get native fullscreen until Safari's fullscreen is fixed @returns {Boolean} true if Safari
_isSafari
javascript
OscarGodson/EpicEditor
epiceditor/js/epiceditor.js
https://github.com/OscarGodson/EpicEditor/blob/master/epiceditor/js/epiceditor.js
MIT
function _isFirefox() { var n = window.navigator; return n.userAgent.indexOf('Firefox') > -1 && n.userAgent.indexOf('Seamonkey') == -1; }
Same as the isIE(), but simply returns a boolean THIS IS TERRIBLE ONLY USE IF ABSOLUTELY NEEDED @returns {Boolean} true if Safari
_isFirefox
javascript
OscarGodson/EpicEditor
epiceditor/js/epiceditor.js
https://github.com/OscarGodson/EpicEditor/blob/master/epiceditor/js/epiceditor.js
MIT
function _isFunction(functionToCheck) { var getType = {}; return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]'; }
Determines if supplied value is a function @param {object} object to determine type
_isFunction
javascript
OscarGodson/EpicEditor
epiceditor/js/epiceditor.js
https://github.com/OscarGodson/EpicEditor/blob/master/epiceditor/js/epiceditor.js
MIT
function _mergeObjs() { // copy reference to target object var target = arguments[0] || {} , i = 1 , length = arguments.length , deep = false , options , name , src , copy // Handle a deep copy situation if (typeof target === "boolean") { deep = target; ...
Overwrites obj1's values with obj2's and adds obj2's if non existent in obj1 @param {boolean} [deepMerge=false] If true, will deep merge meaning it will merge sub-objects like {obj:obj2{foo:'bar'}} @param {object} first object @param {object} second object @returnss {object} a new object based on obj1 and obj2
_mergeObjs
javascript
OscarGodson/EpicEditor
epiceditor/js/epiceditor.js
https://github.com/OscarGodson/EpicEditor/blob/master/epiceditor/js/epiceditor.js
MIT
function EpicEditor(options) { // Default settings will be overwritten/extended by options arg var self = this , opts = options || {} , _defaultFileSchema , _defaultFile , defaults = { container: 'epiceditor' , basePath: 'epiceditor' , textarea: undefined , client...
Initiates the EpicEditor object and sets up offline storage as well @class Represents an EpicEditor instance @param {object} options An optional customization object @returns {object} EpicEditor will be returned
EpicEditor
javascript
OscarGodson/EpicEditor
epiceditor/js/epiceditor.js
https://github.com/OscarGodson/EpicEditor/blob/master/epiceditor/js/epiceditor.js
MIT
function utilBarHandler(e) { if (self.settings.button.bar !== "auto") { return; } // Here we check if the mouse has moves more than 5px in any direction before triggering the mousemove code // we do this for 2 reasons: // 1. On Mac OS X lion when you scroll and it does the iOS like...
Inserts the EpicEditor into the DOM via an iframe and gets it ready for editing and previewing @returns {object} EpicEditor will be returned
utilBarHandler
javascript
OscarGodson/EpicEditor
epiceditor/js/epiceditor.js
https://github.com/OscarGodson/EpicEditor/blob/master/epiceditor/js/epiceditor.js
MIT
function shortcutHandler(e) { if (e.keyCode == self.settings.shortcut.modifier) { isMod = true } // check for modifier press(default is alt key), save to var if (e.keyCode == 17) { isCtrl = true } // check for ctrl/cmnd press, in order to catch ctrl/cmnd + s if (e.keyCode == 18) { isCtrl = false } ...
Inserts the EpicEditor into the DOM via an iframe and gets it ready for editing and previewing @returns {object} EpicEditor will be returned
shortcutHandler
javascript
OscarGodson/EpicEditor
epiceditor/js/epiceditor.js
https://github.com/OscarGodson/EpicEditor/blob/master/epiceditor/js/epiceditor.js
MIT
function shortcutUpHandler(e) { if (e.keyCode == self.settings.shortcut.modifier) { isMod = false } if (e.keyCode == 17) { isCtrl = false } }
Inserts the EpicEditor into the DOM via an iframe and gets it ready for editing and previewing @returns {object} EpicEditor will be returned
shortcutUpHandler
javascript
OscarGodson/EpicEditor
epiceditor/js/epiceditor.js
https://github.com/OscarGodson/EpicEditor/blob/master/epiceditor/js/epiceditor.js
MIT
function pasteHandler(e) { var content; if (e.clipboardData) { //FF 22, Webkit, "standards" e.preventDefault(); content = e.clipboardData.getData("text/plain"); self.editorIframeDocument.execCommand("insertText", false, content); } else if (window.clipboardData) {...
Inserts the EpicEditor into the DOM via an iframe and gets it ready for editing and previewing @returns {object} EpicEditor will be returned
pasteHandler
javascript
OscarGodson/EpicEditor
epiceditor/js/epiceditor.js
https://github.com/OscarGodson/EpicEditor/blob/master/epiceditor/js/epiceditor.js
MIT
function _applyAttrs(context, attrs) { for (var attr in attrs) { if (attrs.hasOwnProperty(attr)) { context.setAttribute(attr, attrs[attr]); } } }
Applies attributes to a DOM object @param {object} context The DOM obj you want to apply the attributes to @param {object} attrs A key/value pair of attributes you want to apply @returns {undefined}
_applyAttrs
javascript
OscarGodson/EpicEditor
src/editor.js
https://github.com/OscarGodson/EpicEditor/blob/master/src/editor.js
MIT
function _applyStyles(context, attrs) { for (var attr in attrs) { if (attrs.hasOwnProperty(attr)) { context.style[attr] = attrs[attr]; } } }
Applies styles to a DOM object @param {object} context The DOM obj you want to apply the attributes to @param {object} attrs A key/value pair of attributes you want to apply @returns {undefined}
_applyStyles
javascript
OscarGodson/EpicEditor
src/editor.js
https://github.com/OscarGodson/EpicEditor/blob/master/src/editor.js
MIT
function _getStyle(el, styleProp) { var x = el , y = null; if (window.getComputedStyle) { y = document.defaultView.getComputedStyle(x, null).getPropertyValue(styleProp); } else if (x.currentStyle) { y = x.currentStyle[styleProp]; } return y; }
Returns a DOM objects computed style @param {object} el The element you want to get the style from @param {string} styleProp The property you want to get from the element @returns {string} Returns a string of the value. If property is not set it will return a blank string
_getStyle
javascript
OscarGodson/EpicEditor
src/editor.js
https://github.com/OscarGodson/EpicEditor/blob/master/src/editor.js
MIT
function _saveStyleState(el, type, styles) { var returnState = {} , style; if (type === 'save') { for (style in styles) { if (styles.hasOwnProperty(style)) { returnState[style] = _getStyle(el, style); } } // After it's all done saving all the previous states, ch...
Saves the current style state for the styles requested, then applies styles to overwrite the existing one. The old styles are returned as an object so you can pass it back in when you want to revert back to the old style @param {object} el The element to get the styles of @param {string} type Can be "save" or...
_saveStyleState
javascript
OscarGodson/EpicEditor
src/editor.js
https://github.com/OscarGodson/EpicEditor/blob/master/src/editor.js
MIT
function _outerWidth(el) { var b = parseInt(_getStyle(el, 'border-left-width'), 10) + parseInt(_getStyle(el, 'border-right-width'), 10) , p = parseInt(_getStyle(el, 'padding-left'), 10) + parseInt(_getStyle(el, 'padding-right'), 10) , w = el.offsetWidth , t; // For IE in case no border is set ...
Gets an elements total width including it's borders and padding @param {object} el The element to get the total width of @returns {int}
_outerWidth
javascript
OscarGodson/EpicEditor
src/editor.js
https://github.com/OscarGodson/EpicEditor/blob/master/src/editor.js
MIT
function _outerHeight(el) { var b = parseInt(_getStyle(el, 'border-top-width'), 10) + parseInt(_getStyle(el, 'border-bottom-width'), 10) , p = parseInt(_getStyle(el, 'padding-top'), 10) + parseInt(_getStyle(el, 'padding-bottom'), 10) , w = parseInt(_getStyle(el, 'height'), 10) , t; // For IE i...
Gets an elements total height including it's borders and padding @param {object} el The element to get the total width of @returns {int}
_outerHeight
javascript
OscarGodson/EpicEditor
src/editor.js
https://github.com/OscarGodson/EpicEditor/blob/master/src/editor.js
MIT
function _insertCSSLink(path, context, id) { id = id || ''; var headID = context.getElementsByTagName("head")[0] , cssNode = context.createElement('link'); _applyAttrs(cssNode, { type: 'text/css' , id: id , rel: 'stylesheet' , href: path , name: path , media: 'screen' ...
Inserts a <link> tag specifically for CSS @param {string} path The path to the CSS file @param {object} context In what context you want to apply this to (document, iframe, etc) @param {string} id An id for you to reference later for changing properties of the <link> @returns {undefined}
_insertCSSLink
javascript
OscarGodson/EpicEditor
src/editor.js
https://github.com/OscarGodson/EpicEditor/blob/master/src/editor.js
MIT
function _replaceClass(e, o, n) { e.className = e.className.replace(o, n); }
Inserts a <link> tag specifically for CSS @param {string} path The path to the CSS file @param {object} context In what context you want to apply this to (document, iframe, etc) @param {string} id An id for you to reference later for changing properties of the <link> @returns {undefined}
_replaceClass
javascript
OscarGodson/EpicEditor
src/editor.js
https://github.com/OscarGodson/EpicEditor/blob/master/src/editor.js
MIT
function _getIframeInnards(el) { return el.contentDocument || el.contentWindow.document; }
Inserts a <link> tag specifically for CSS @param {string} path The path to the CSS file @param {object} context In what context you want to apply this to (document, iframe, etc) @param {string} id An id for you to reference later for changing properties of the <link> @returns {undefined}
_getIframeInnards
javascript
OscarGodson/EpicEditor
src/editor.js
https://github.com/OscarGodson/EpicEditor/blob/master/src/editor.js
MIT
function _getText(el) { var theText; // Make sure to check for type of string because if the body of the page // doesn't have any text it'll be "" which is falsey and will go into // the else which is meant for Firefox and shit will break if (typeof document.body.innerText == 'string') { theTe...
Inserts a <link> tag specifically for CSS @param {string} path The path to the CSS file @param {object} context In what context you want to apply this to (document, iframe, etc) @param {string} id An id for you to reference later for changing properties of the <link> @returns {undefined}
_getText
javascript
OscarGodson/EpicEditor
src/editor.js
https://github.com/OscarGodson/EpicEditor/blob/master/src/editor.js
MIT
function _setText(el, content) { // Don't convert lt/gt characters as HTML when viewing the editor window // TODO: Write a test to catch regressions for this content = content.replace(/</g, '&lt;'); content = content.replace(/>/g, '&gt;'); content = content.replace(/\n/g, '<br>'); // Make s...
Inserts a <link> tag specifically for CSS @param {string} path The path to the CSS file @param {object} context In what context you want to apply this to (document, iframe, etc) @param {string} id An id for you to reference later for changing properties of the <link> @returns {undefined}
_setText
javascript
OscarGodson/EpicEditor
src/editor.js
https://github.com/OscarGodson/EpicEditor/blob/master/src/editor.js
MIT
function _sanitizeRawContent(content) { // Get this, 2 spaces in a content editable actually converts to: // 0020 00a0, meaning, "space no-break space". So, manually convert // no-break spaces to spaces again before handing to marked. // Also, WebKit converts no-break to unicode equivalent and FF HTML. ...
Converts the 'raw' format of a file's contents into plaintext @param {string} content Contents of the file @returns {string} the sanitized content
_sanitizeRawContent
javascript
OscarGodson/EpicEditor
src/editor.js
https://github.com/OscarGodson/EpicEditor/blob/master/src/editor.js
MIT
function _isIE() { var rv = -1 // Return value assumes failure. , ua = navigator.userAgent , re; if (navigator.appName == 'Microsoft Internet Explorer') { re = /MSIE ([0-9]{1,}[\.0-9]{0,})/; if (re.exec(ua) != null) { rv = parseFloat(RegExp.$1, 10); } } return rv; ...
Will return the version number if the browser is IE. If not will return -1 TRY NEVER TO USE THIS AND USE FEATURE DETECTION IF POSSIBLE @returns {Number} -1 if false or the version number if true
_isIE
javascript
OscarGodson/EpicEditor
src/editor.js
https://github.com/OscarGodson/EpicEditor/blob/master/src/editor.js
MIT
function _isSafari() { var n = window.navigator; return n.userAgent.indexOf('Safari') > -1 && n.userAgent.indexOf('Chrome') == -1; }
Same as the isIE(), but simply returns a boolean THIS IS TERRIBLE AND IS ONLY USED BECAUSE FULLSCREEN IN SAFARI IS BORKED If some other engine uses WebKit and has support for fullscreen they probably wont get native fullscreen until Safari's fullscreen is fixed @returns {Boolean} true if Safari
_isSafari
javascript
OscarGodson/EpicEditor
src/editor.js
https://github.com/OscarGodson/EpicEditor/blob/master/src/editor.js
MIT
function _isFirefox() { var n = window.navigator; return n.userAgent.indexOf('Firefox') > -1 && n.userAgent.indexOf('Seamonkey') == -1; }
Same as the isIE(), but simply returns a boolean THIS IS TERRIBLE ONLY USE IF ABSOLUTELY NEEDED @returns {Boolean} true if Safari
_isFirefox
javascript
OscarGodson/EpicEditor
src/editor.js
https://github.com/OscarGodson/EpicEditor/blob/master/src/editor.js
MIT
function _isFunction(functionToCheck) { var getType = {}; return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]'; }
Determines if supplied value is a function @param {object} object to determine type
_isFunction
javascript
OscarGodson/EpicEditor
src/editor.js
https://github.com/OscarGodson/EpicEditor/blob/master/src/editor.js
MIT
function _mergeObjs() { // copy reference to target object var target = arguments[0] || {} , i = 1 , length = arguments.length , deep = false , options , name , src , copy // Handle a deep copy situation if (typeof target === "boolean") { deep = target; ...
Overwrites obj1's values with obj2's and adds obj2's if non existent in obj1 @param {boolean} [deepMerge=false] If true, will deep merge meaning it will merge sub-objects like {obj:obj2{foo:'bar'}} @param {object} first object @param {object} second object @returnss {object} a new object based on obj1 and obj2
_mergeObjs
javascript
OscarGodson/EpicEditor
src/editor.js
https://github.com/OscarGodson/EpicEditor/blob/master/src/editor.js
MIT
function EpicEditor(options) { // Default settings will be overwritten/extended by options arg var self = this , opts = options || {} , _defaultFileSchema , _defaultFile , defaults = { container: 'epiceditor' , basePath: 'epiceditor' , textarea: undefined , client...
Initiates the EpicEditor object and sets up offline storage as well @class Represents an EpicEditor instance @param {object} options An optional customization object @returns {object} EpicEditor will be returned
EpicEditor
javascript
OscarGodson/EpicEditor
src/editor.js
https://github.com/OscarGodson/EpicEditor/blob/master/src/editor.js
MIT
function utilBarHandler(e) { if (self.settings.button.bar !== "auto") { return; } // Here we check if the mouse has moves more than 5px in any direction before triggering the mousemove code // we do this for 2 reasons: // 1. On Mac OS X lion when you scroll and it does the iOS like...
Inserts the EpicEditor into the DOM via an iframe and gets it ready for editing and previewing @returns {object} EpicEditor will be returned
utilBarHandler
javascript
OscarGodson/EpicEditor
src/editor.js
https://github.com/OscarGodson/EpicEditor/blob/master/src/editor.js
MIT
function shortcutHandler(e) { if (e.keyCode == self.settings.shortcut.modifier) { isMod = true } // check for modifier press(default is alt key), save to var if (e.keyCode == 17) { isCtrl = true } // check for ctrl/cmnd press, in order to catch ctrl/cmnd + s if (e.keyCode == 18) { isCtrl = false } ...
Inserts the EpicEditor into the DOM via an iframe and gets it ready for editing and previewing @returns {object} EpicEditor will be returned
shortcutHandler
javascript
OscarGodson/EpicEditor
src/editor.js
https://github.com/OscarGodson/EpicEditor/blob/master/src/editor.js
MIT
function shortcutUpHandler(e) { if (e.keyCode == self.settings.shortcut.modifier) { isMod = false } if (e.keyCode == 17) { isCtrl = false } }
Inserts the EpicEditor into the DOM via an iframe and gets it ready for editing and previewing @returns {object} EpicEditor will be returned
shortcutUpHandler
javascript
OscarGodson/EpicEditor
src/editor.js
https://github.com/OscarGodson/EpicEditor/blob/master/src/editor.js
MIT
function pasteHandler(e) { var content; if (e.clipboardData) { //FF 22, Webkit, "standards" e.preventDefault(); content = e.clipboardData.getData("text/plain"); self.editorIframeDocument.execCommand("insertText", false, content); } else if (window.clipboardData) {...
Inserts the EpicEditor into the DOM via an iframe and gets it ready for editing and previewing @returns {object} EpicEditor will be returned
pasteHandler
javascript
OscarGodson/EpicEditor
src/editor.js
https://github.com/OscarGodson/EpicEditor/blob/master/src/editor.js
MIT
function formatDate(language) { var finalDate, date = new Date(); switch (language) { case 'en_US' : finalDate = date.getFullYear() + '/' + (parseInt(date.getMonth(), 10) + 1) + '/' + date.getDate(); break; case 'pt_BR' : finalDate = date.getDate() + '/' + (parseInt(date.getMonth(), 1...
Write last change date (current day) to the main _data.json file. It will appear in the header of the Styleguide. Additional date formats should be configured here.
formatDate
javascript
hugeinc/styleguide
styleguide/structure/_node-files/modules/write-date.js
https://github.com/hugeinc/styleguide/blob/master/styleguide/structure/_node-files/modules/write-date.js
MIT
function getCoords(event) { // touch move and touch end have different touch data var touches = event.touches, data = touches && touches.length ? touches : event.changedTouches; return { x: isTouch ? data[0].pageX : event.pageX, y: isTouch ? data[0].pageY : event.pageY ...
Returns an object containing the co-ordinates for the event, normalising for touch / non-touch. @param {Object} event @returns {Object}
getCoords
javascript
Stereobit/dragend
dragend.js
https://github.com/Stereobit/dragend/blob/master/dragend.js
MIT
function Dragend( container, settings ) { var defaultSettingsCopy = extend( {}, defaultSettings ); this.settings = extend( defaultSettingsCopy, settings ); this.container = container; this.pageContainer = doc.createElement( "div" ); this.scrollBorder = { x: 0, y: 0 }; this...
Returns an object containing the co-ordinates for the event, normalising for touch / non-touch. @param {Object} event @returns {Object}
Dragend
javascript
Stereobit/dragend
dragend.js
https://github.com/Stereobit/dragend/blob/master/dragend.js
MIT
function addEventListener(container, event, callback) { if ($) { $(container).on(event, callback); } else { container.addEventListener(event, callback, false); } }
Returns an object containing the co-ordinates for the event, normalising for touch / non-touch. @param {Object} event @returns {Object}
addEventListener
javascript
Stereobit/dragend
dragend.js
https://github.com/Stereobit/dragend/blob/master/dragend.js
MIT
function removeEventListener(container, event, callback) { if ($) { $(container).off(event, callback); } else { container.removeEventListener(event, callback, false); } }
Returns an object containing the co-ordinates for the event, normalising for touch / non-touch. @param {Object} event @returns {Object}
removeEventListener
javascript
Stereobit/dragend
dragend.js
https://github.com/Stereobit/dragend/blob/master/dragend.js
MIT
function getCoords(event) { // touch move and touch end have different touch data var touches = event.touches, data = touches && touches.length ? touches : event.changedTouches; return { x: isTouch ? data[0].pageX : event.pageX, y: isTouch ? data[0].pageY : event.pageY ...
Returns an object containing the co-ordinates for the event, normalising for touch / non-touch. @param {Object} event @returns {Object}
getCoords
javascript
Stereobit/dragend
dist/dragend.js
https://github.com/Stereobit/dragend/blob/master/dist/dragend.js
MIT
function Dragend( container, settings ) { var defaultSettingsCopy = extend( {}, defaultSettings ); this.settings = extend( defaultSettingsCopy, settings ); this.container = container; this.pageContainer = doc.createElement( "div" ); this.scrollBorder = { x: 0, y: 0 }; this...
Returns an object containing the co-ordinates for the event, normalising for touch / non-touch. @param {Object} event @returns {Object}
Dragend
javascript
Stereobit/dragend
dist/dragend.js
https://github.com/Stereobit/dragend/blob/master/dist/dragend.js
MIT
function addEventListener(container, event, callback) { if ($) { $(container).on(event, callback); } else { container.addEventListener(event, callback, false); } }
Returns an object containing the co-ordinates for the event, normalising for touch / non-touch. @param {Object} event @returns {Object}
addEventListener
javascript
Stereobit/dragend
dist/dragend.js
https://github.com/Stereobit/dragend/blob/master/dist/dragend.js
MIT
function removeEventListener(container, event, callback) { if ($) { $(container).off(event, callback); } else { container.removeEventListener(event, callback, false); } }
Returns an object containing the co-ordinates for the event, normalising for touch / non-touch. @param {Object} event @returns {Object}
removeEventListener
javascript
Stereobit/dragend
dist/dragend.js
https://github.com/Stereobit/dragend/blob/master/dist/dragend.js
MIT
addInlineAddButton = function() { if (addButton === null) { if ($this.prop("tagName") === "TR") { // If forms are laid out as table rows, insert the // "add" button in a new table row: const numCols = $this.eq(-1).children().length;...
The "Add another MyModel" button below the inline forms.
addInlineAddButton
javascript
johanmodin/clifs
www/assets/admin/js/inlines.js
https://github.com/johanmodin/clifs/blob/master/www/assets/admin/js/inlines.js
Apache-2.0
addInlineAddButton = function() { if (addButton === null) { if ($this.prop("tagName") === "TR") { // If forms are laid out as table rows, insert the // "add" button in a new table row: const numCols = $this.eq(-1).children().length;...
The "Add another MyModel" button below the inline forms.
addInlineAddButton
javascript
johanmodin/clifs
www/assets/admin/js/inlines.js
https://github.com/johanmodin/clifs/blob/master/www/assets/admin/js/inlines.js
Apache-2.0
addInlineClickHandler = function(e) { e.preventDefault(); const template = $("#" + options.prefix + "-empty"); const row = template.clone(true); row.removeClass(options.emptyCssClass) .addClass(options.formCssClass) .attr("id", options.pref...
The "Add another MyModel" button below the inline forms.
addInlineClickHandler
javascript
johanmodin/clifs
www/assets/admin/js/inlines.js
https://github.com/johanmodin/clifs/blob/master/www/assets/admin/js/inlines.js
Apache-2.0
addInlineClickHandler = function(e) { e.preventDefault(); const template = $("#" + options.prefix + "-empty"); const row = template.clone(true); row.removeClass(options.emptyCssClass) .addClass(options.formCssClass) .attr("id", options.pref...
The "Add another MyModel" button below the inline forms.
addInlineClickHandler
javascript
johanmodin/clifs
www/assets/admin/js/inlines.js
https://github.com/johanmodin/clifs/blob/master/www/assets/admin/js/inlines.js
Apache-2.0
addInlineDeleteButton = function(row) { if (row.is("tr")) { // If the forms are laid out in table rows, insert // the remove button into the last table cell: row.children(":last").append('<div><a class="' + options.deleteCssClass + '" href="#">' + options.dele...
The "X" button that is part of every unsaved inline. (When saved, it is replaced with a "Delete" checkbox.)
addInlineDeleteButton
javascript
johanmodin/clifs
www/assets/admin/js/inlines.js
https://github.com/johanmodin/clifs/blob/master/www/assets/admin/js/inlines.js
Apache-2.0
addInlineDeleteButton = function(row) { if (row.is("tr")) { // If the forms are laid out in table rows, insert // the remove button into the last table cell: row.children(":last").append('<div><a class="' + options.deleteCssClass + '" href="#">' + options.dele...
The "X" button that is part of every unsaved inline. (When saved, it is replaced with a "Delete" checkbox.)
addInlineDeleteButton
javascript
johanmodin/clifs
www/assets/admin/js/inlines.js
https://github.com/johanmodin/clifs/blob/master/www/assets/admin/js/inlines.js
Apache-2.0
inlineDeleteHandler = function(e1) { e1.preventDefault(); const deleteButton = $(e1.target); const row = deleteButton.closest('.' + options.formCssClass); const inlineGroup = row.closest('.inline-group'); // Remove the parent form containing this button, ...
The "X" button that is part of every unsaved inline. (When saved, it is replaced with a "Delete" checkbox.)
inlineDeleteHandler
javascript
johanmodin/clifs
www/assets/admin/js/inlines.js
https://github.com/johanmodin/clifs/blob/master/www/assets/admin/js/inlines.js
Apache-2.0
inlineDeleteHandler = function(e1) { e1.preventDefault(); const deleteButton = $(e1.target); const row = deleteButton.closest('.' + options.formCssClass); const inlineGroup = row.closest('.inline-group'); // Remove the parent form containing this button, ...
The "X" button that is part of every unsaved inline. (When saved, it is replaced with a "Delete" checkbox.)
inlineDeleteHandler
javascript
johanmodin/clifs
www/assets/admin/js/inlines.js
https://github.com/johanmodin/clifs/blob/master/www/assets/admin/js/inlines.js
Apache-2.0
updateElementCallback = function() { updateElementIndex(this, options.prefix, i); }
The "X" button that is part of every unsaved inline. (When saved, it is replaced with a "Delete" checkbox.)
updateElementCallback
javascript
johanmodin/clifs
www/assets/admin/js/inlines.js
https://github.com/johanmodin/clifs/blob/master/www/assets/admin/js/inlines.js
Apache-2.0
updateElementCallback = function() { updateElementIndex(this, options.prefix, i); }
The "X" button that is part of every unsaved inline. (When saved, it is replaced with a "Delete" checkbox.)
updateElementCallback
javascript
johanmodin/clifs
www/assets/admin/js/inlines.js
https://github.com/johanmodin/clifs/blob/master/www/assets/admin/js/inlines.js
Apache-2.0
toggleDeleteButtonVisibility = function(inlineGroup) { if ((minForms.val() !== '') && (minForms.val() - totalForms.val()) >= 0) { inlineGroup.find('.inline-deletelink').hide(); } else { inlineGroup.find('.inline-deletelink').show(); } }
The "X" button that is part of every unsaved inline. (When saved, it is replaced with a "Delete" checkbox.)
toggleDeleteButtonVisibility
javascript
johanmodin/clifs
www/assets/admin/js/inlines.js
https://github.com/johanmodin/clifs/blob/master/www/assets/admin/js/inlines.js
Apache-2.0
toggleDeleteButtonVisibility = function(inlineGroup) { if ((minForms.val() !== '') && (minForms.val() - totalForms.val()) >= 0) { inlineGroup.find('.inline-deletelink').hide(); } else { inlineGroup.find('.inline-deletelink').show(); } }
The "X" button that is part of every unsaved inline. (When saved, it is replaced with a "Delete" checkbox.)
toggleDeleteButtonVisibility
javascript
johanmodin/clifs
www/assets/admin/js/inlines.js
https://github.com/johanmodin/clifs/blob/master/www/assets/admin/js/inlines.js
Apache-2.0
reinitDateTimeShortCuts = function() { // Reinitialize the calendar and clock widgets by force if (typeof DateTimeShortcuts !== "undefined") { $(".datetimeshortcuts").remove(); DateTimeShortcuts.init(); } }
The "X" button that is part of every unsaved inline. (When saved, it is replaced with a "Delete" checkbox.)
reinitDateTimeShortCuts
javascript
johanmodin/clifs
www/assets/admin/js/inlines.js
https://github.com/johanmodin/clifs/blob/master/www/assets/admin/js/inlines.js
Apache-2.0
reinitDateTimeShortCuts = function() { // Reinitialize the calendar and clock widgets by force if (typeof DateTimeShortcuts !== "undefined") { $(".datetimeshortcuts").remove(); DateTimeShortcuts.init(); } }
The "X" button that is part of every unsaved inline. (When saved, it is replaced with a "Delete" checkbox.)
reinitDateTimeShortCuts
javascript
johanmodin/clifs
www/assets/admin/js/inlines.js
https://github.com/johanmodin/clifs/blob/master/www/assets/admin/js/inlines.js
Apache-2.0
updateSelectFilter = function() { // If any SelectFilter widgets are a part of the new form, // instantiate a new SelectFilter instance for it. if (typeof SelectFilter !== 'undefined') { $('.selectfilter').each(function(index, value) { const namear...
The "X" button that is part of every unsaved inline. (When saved, it is replaced with a "Delete" checkbox.)
updateSelectFilter
javascript
johanmodin/clifs
www/assets/admin/js/inlines.js
https://github.com/johanmodin/clifs/blob/master/www/assets/admin/js/inlines.js
Apache-2.0
updateSelectFilter = function() { // If any SelectFilter widgets are a part of the new form, // instantiate a new SelectFilter instance for it. if (typeof SelectFilter !== 'undefined') { $('.selectfilter').each(function(index, value) { const namear...
The "X" button that is part of every unsaved inline. (When saved, it is replaced with a "Delete" checkbox.)
updateSelectFilter
javascript
johanmodin/clifs
www/assets/admin/js/inlines.js
https://github.com/johanmodin/clifs/blob/master/www/assets/admin/js/inlines.js
Apache-2.0
initPrepopulatedFields = function(row) { row.find('.prepopulated_field').each(function() { const field = $(this), input = field.find('input, select, textarea'), dependency_list = input.data('dependency_list') || [], dependencies = [...
The "X" button that is part of every unsaved inline. (When saved, it is replaced with a "Delete" checkbox.)
initPrepopulatedFields
javascript
johanmodin/clifs
www/assets/admin/js/inlines.js
https://github.com/johanmodin/clifs/blob/master/www/assets/admin/js/inlines.js
Apache-2.0
initPrepopulatedFields = function(row) { row.find('.prepopulated_field').each(function() { const field = $(this), input = field.find('input, select, textarea'), dependency_list = input.data('dependency_list') || [], dependencies = [...
The "X" button that is part of every unsaved inline. (When saved, it is replaced with a "Delete" checkbox.)
initPrepopulatedFields
javascript
johanmodin/clifs
www/assets/admin/js/inlines.js
https://github.com/johanmodin/clifs/blob/master/www/assets/admin/js/inlines.js
Apache-2.0
updateInlineLabel = function(row) { $(selector).find(".inline_label").each(function(i) { const count = i + 1; $(this).html($(this).html().replace(/(#\d+)/g, "#" + count)); }); }
The "X" button that is part of every unsaved inline. (When saved, it is replaced with a "Delete" checkbox.)
updateInlineLabel
javascript
johanmodin/clifs
www/assets/admin/js/inlines.js
https://github.com/johanmodin/clifs/blob/master/www/assets/admin/js/inlines.js
Apache-2.0
updateInlineLabel = function(row) { $(selector).find(".inline_label").each(function(i) { const count = i + 1; $(this).html($(this).html().replace(/(#\d+)/g, "#" + count)); }); }
The "X" button that is part of every unsaved inline. (When saved, it is replaced with a "Delete" checkbox.)
updateInlineLabel
javascript
johanmodin/clifs
www/assets/admin/js/inlines.js
https://github.com/johanmodin/clifs/blob/master/www/assets/admin/js/inlines.js
Apache-2.0
reinitDateTimeShortCuts = function() { // Reinitialize the calendar and clock widgets by force, yuck. if (typeof DateTimeShortcuts !== "undefined") { $(".datetimeshortcuts").remove(); DateTimeShortcuts.init(); } }
The "X" button that is part of every unsaved inline. (When saved, it is replaced with a "Delete" checkbox.)
reinitDateTimeShortCuts
javascript
johanmodin/clifs
www/assets/admin/js/inlines.js
https://github.com/johanmodin/clifs/blob/master/www/assets/admin/js/inlines.js
Apache-2.0
reinitDateTimeShortCuts = function() { // Reinitialize the calendar and clock widgets by force, yuck. if (typeof DateTimeShortcuts !== "undefined") { $(".datetimeshortcuts").remove(); DateTimeShortcuts.init(); } }
The "X" button that is part of every unsaved inline. (When saved, it is replaced with a "Delete" checkbox.)
reinitDateTimeShortCuts
javascript
johanmodin/clifs
www/assets/admin/js/inlines.js
https://github.com/johanmodin/clifs/blob/master/www/assets/admin/js/inlines.js
Apache-2.0
updateSelectFilter = function() { // If any SelectFilter widgets were added, instantiate a new instance. if (typeof SelectFilter !== "undefined") { $(".selectfilter").each(function(index, value) { const namearr = value.name.split('-'); Sele...
The "X" button that is part of every unsaved inline. (When saved, it is replaced with a "Delete" checkbox.)
updateSelectFilter
javascript
johanmodin/clifs
www/assets/admin/js/inlines.js
https://github.com/johanmodin/clifs/blob/master/www/assets/admin/js/inlines.js
Apache-2.0