Create mode + Source view + UI enhancements
This commit is contained in:
		
							
								
								
									
										16
									
								
								client/js/helpers/form.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								client/js/helpers/form.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,16 @@
 | 
			
		||||
 | 
			
		||||
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();
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										11
									
								
								client/js/helpers/pages.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								client/js/helpers/pages.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,11 @@
 | 
			
		||||
 | 
			
		||||
function makeSafePath(rawPath) {
 | 
			
		||||
 | 
			
		||||
	let rawParts = _.split(_.trim(rawPath), '/');
 | 
			
		||||
	rawParts = _.map(rawParts, (r) => {
 | 
			
		||||
		return _.kebabCase(_.deburr(_.trim(r)));
 | 
			
		||||
	});
 | 
			
		||||
 | 
			
		||||
	return _.join(_.filter(rawParts, (r) => { return !_.isEmpty(r); }), '/');
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user