Fuse-box client scripts integration + deps update
This commit is contained in:
@@ -1,19 +1,25 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
'use strict'
|
||||
|
||||
function setInputSelection (input, startPos, endPos) {
|
||||
input.focus()
|
||||
if (typeof input.selectionStart !== 'undefined') {
|
||||
input.selectionStart = startPos
|
||||
input.selectionEnd = endPos
|
||||
} else if (document.selection && document.selection.createRange) {
|
||||
// IE branch
|
||||
input.select()
|
||||
var range = document.selection.createRange()
|
||||
range.collapse(true)
|
||||
range.moveEnd('character', endPos)
|
||||
range.moveStart('character', startPos)
|
||||
range.select()
|
||||
module.exports = {
|
||||
/**
|
||||
* Set Input Selection
|
||||
* @param {DOMElement} input The input element
|
||||
* @param {number} startPos The starting position
|
||||
* @param {nunber} endPos The ending position
|
||||
*/
|
||||
setInputSelection: (input, startPos, endPos) => {
|
||||
input.focus()
|
||||
if (typeof input.selectionStart !== 'undefined') {
|
||||
input.selectionStart = startPos
|
||||
input.selectionEnd = endPos
|
||||
} else if (document.selection && document.selection.createRange) {
|
||||
// IE branch
|
||||
input.select()
|
||||
var range = document.selection.createRange()
|
||||
range.collapse(true)
|
||||
range.moveEnd('character', endPos)
|
||||
range.moveStart('character', startPos)
|
||||
range.select()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* eslint-enable no-unused-vars */
|
||||
|
@@ -1,13 +1,19 @@
|
||||
/* global _ */
|
||||
/* eslint-disable no-unused-vars */
|
||||
'use strict'
|
||||
|
||||
function makeSafePath (rawPath) {
|
||||
let rawParts = _.split(_.trim(rawPath), '/')
|
||||
rawParts = _.map(rawParts, (r) => {
|
||||
return _.kebabCase(_.deburr(_.trim(r)))
|
||||
})
|
||||
import _ from 'lodash'
|
||||
|
||||
return _.join(_.filter(rawParts, (r) => { return !_.isEmpty(r) }), '/')
|
||||
module.exports = {
|
||||
/**
|
||||
* Convert raw path to safe path
|
||||
* @param {string} rawPath Raw path
|
||||
* @returns {string} Safe path
|
||||
*/
|
||||
makeSafePath: (rawPath) => {
|
||||
let rawParts = _.split(_.trim(rawPath), '/')
|
||||
rawParts = _.map(rawParts, (r) => {
|
||||
return _.kebabCase(_.deburr(_.trim(r)))
|
||||
})
|
||||
|
||||
return _.join(_.filter(rawParts, (r) => { return !_.isEmpty(r) }), '/')
|
||||
}
|
||||
}
|
||||
|
||||
/* eslint-enable no-unused-vars */
|
||||
|
Reference in New Issue
Block a user