Sha256: 903565752958637c12b346b97c4535d9f8056c0a7bd4a73d197f702c7379995a
Contents?: true
Size: 1.57 KB
Versions: 34
Compression:
Stored size: 1.57 KB
Contents
# PluginFactoryScaffolding : PARTIAL ######################################################################################################################## window.Utils = {} ######################################################################################################################## Utils.$safeApply = ((fn) -> phase = this.$root.$$phase; if(phase == '$apply' || phase == '$digest') fn() if(fn && (typeof(fn) == 'function')) else this.$apply(fn) ) Utils.removeFromArray = ((value, array) -> index = array.indexOf(value) array.splice(index, 1) ) Utils.parseUrl = ((url_string) -> uriPartNames = ["source","scheme","authority","host","port","path","directory_path","file_name","query_string","hash"] uriParts = new RegExp("^(?:([^:/?#.]+):)?(?://)?(([^:/?#]*)(?::(\\d*))?)?((/(?:[^?#](?![^?#/]*\\.[^?#/.]+(?:[\\?#]|$)))*/?)?([^?#/]*))?(?:\\?([^#]*))?(?:#(.*))?").exec(url_string) uri = {}; for i in [0..uriPartNames.length] uri[uriPartNames[i]] = (if uriParts[i] then uriParts[i] else '') uri.port = if uri.port then parseInt(uri.port) else 80 domain_parts = (/^(.*?)\.?([^\.]*\.\w+)$/).exec(uri.host) if domain_parts? uri.sub_domain = domain_parts[1] uri.root_domain = domain_parts[2] else uri.sub_domain = uri.root_domain = '' if(uri.directory_path.length > 0) uri.directory_path = uri.directory_path.replace(/\/?$/, "/") return uri ) Utils.parseQueryString = ((query_string) -> $.deparam(query_string) ) # END PARTIAL ##########################################################################################################
Version data entries
34 entries across 34 versions & 1 rubygems