├── .gitignore ├── .idea ├── encodings.xml ├── inspectionProfiles │ ├── Project_Default.xml │ └── profiles_settings.xml ├── misc.xml ├── modules.xml ├── rebase.iml ├── scopes │ └── scope_settings.xml └── vcs.xml ├── Gruntfile.js ├── README.md ├── gulpfile.js ├── package.json ├── rebase.js ├── tasks ├── grunt-rebase.js └── gulp-rebase.js └── test ├── dest ├── static │ ├── images │ │ ├── MassEffect2Citadel.jpg │ │ └── mass_effect_3_earth_dreamscene_by_droot1986-d661hfj.jpg │ ├── script │ │ └── test.js │ └── style │ │ ├── css.css │ │ └── import.css └── test.html ├── nodest ├── MassEffect2Citadel.jpg └── mass_effect_3_earth_dreamscene_by_droot1986-d661hfj.jpg └── src ├── css ├── css.css └── import.css ├── font └── SourceCodePro │ ├── OFL.txt │ ├── SourceCodePro-Black.ttf │ ├── SourceCodePro-Bold.ttf │ ├── SourceCodePro-ExtraLight.ttf │ ├── SourceCodePro-Light.ttf │ ├── SourceCodePro-Medium.ttf │ ├── SourceCodePro-Regular.ttf │ └── SourceCodePro-Semibold.ttf ├── img ├── MassEffect2Citadel.jpg └── mass_effect_3_earth_dreamscene_by_droot1986-d661hfj.jpg ├── js └── test.js └── test.html /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | .idea/ -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/Project_Default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 29 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/rebase.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/scopes/scope_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Gruntfile.js: -------------------------------------------------------------------------------- 1 | module.exports = function ( grunt ){ 2 | 3 | grunt.initConfig({ 4 | rebase: { 5 | noscope: { 6 | expand: true, 7 | cwd: "test/src/css/", 8 | src: "*.css", 9 | dest: "test/dest/static/style/" 10 | }, 11 | scoped: { 12 | // global options 13 | options: { 14 | // filter unreferenced files 15 | filter: true, 16 | // prepend this base to every reference 17 | base: "test/src/" 18 | }, 19 | files: [{ 20 | expand: true, 21 | cwd: "test/src/css/", 22 | src: "*.css", 23 | dest: "test/dest/static/style/", 24 | scopes: { 25 | url: { 26 | "/?img": "/static/images", 27 | "/?font": "/static/fonts" 28 | } 29 | } 30 | }, { 31 | expand: true, 32 | cwd: "test/src/", 33 | src: "*.html", 34 | dest: "test/dest/", 35 | scopes: { 36 | url: { 37 | "/?img": "/static/images", 38 | "/?font": "/static/fonts" 39 | }, 40 | a: { 41 | "/?img": "/static/images" 42 | }, 43 | img: { 44 | "/?img": "/static/images" 45 | }, 46 | link: { 47 | "/?css": "/static/style" 48 | }, 49 | script: { 50 | "/?js": "/static/script" 51 | } 52 | } 53 | }, { 54 | expand: true, 55 | cwd: "test/src/img/", 56 | src: "*.*", 57 | dest: "test/dest/static/images/" 58 | }, { 59 | expand: true, 60 | cwd: "test/src/js/", 61 | src: "*.*", 62 | dest: "test/dest/static/script/" 63 | }] 64 | } 65 | } 66 | }) 67 | 68 | grunt.loadTasks('tasks') 69 | 70 | grunt.registerTask("default", ["rebase"]) 71 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Rebase 2 | ======= 3 | 4 | ## What is this? 5 | 6 | Rebase helps you refactor urls in files. 7 | Let it be a script src attribute or a url() in a css rule. 8 | Tell it what scope you want the replace to happen. 9 | It is essentially `String.replace()` smarty-pants. 10 | 11 | ## Scopes 12 | 13 | ### script 14 | 15 | Matches script tags, and their sources. 16 | 17 | ```html 18 | 19 | ``` 20 | 21 | ### link 22 | 23 | Matches stylesheet links and their href attribute's value. 24 | 25 | ```html 26 | 27 | ``` 28 | 29 | ### a 30 | 31 | Matches html link tags and their href attribute's value. 32 | 33 | ```html 34 | 35 | ``` 36 | 37 | ### img 38 | 39 | Matches image elements and their source value. 40 | 41 | ```html 42 | test 43 | ``` 44 | 45 | ### url 46 | 47 | Matches `url()` resource links in css. 48 | 49 | ```css 50 | #test-1{ 51 | background: url("..."); 52 | } 53 | ``` 54 | 55 | ## Install 56 | 57 | npm install rebase --save-dev 58 | 59 | ## Usage 60 | 61 | ```js 62 | var rebase = require("../rebase") 63 | var contents = "" 64 | var scopes = {} 65 | var rebasedContents = rebase(contents, scopes) 66 | ``` 67 | 68 | ## Gulp task 69 | 70 | ```js 71 | var gulp = require("gulp") 72 | var rebase = require("./tasks/gulp-rebase") 73 | 74 | gulp.task("rebase-html", function( ){ 75 | gulp.src("test/src/*.html") 76 | .pipe(rebase({ 77 | url: { 78 | "/?img": "/static/images", 79 | "/?font": "/static/fonts" 80 | }, 81 | a: { 82 | "/?img": "/static/images" 83 | }, 84 | img: { 85 | "/?img": "/static/images" 86 | }, 87 | link: { 88 | "/?css": "/static/style" 89 | }, 90 | script: { 91 | "/?js": "/static/script" 92 | } 93 | })) 94 | .pipe(gulp.dest("test/dest/")) 95 | }) 96 | 97 | gulp.task("default", ["rebase-html"]) 98 | ``` 99 | 100 | ## Grunt task 101 | 102 | grunt.loadNpmTasks('grunt-rebase'); 103 | 104 | ## Usage 105 | 106 | In the grunt task, define a `scope` object on the file object. 107 | The keys will be converted to a RegExp pattern, and matched against the source files 108 | the task runs on. The values of the `scope`'s properties will be replace value of `"".replace(pattern, replacement)`. 109 | 110 | 111 | ```js 112 | 113 | grunt.initConfig({ 114 | rebase: { 115 | noscope: { 116 | expand: true, 117 | cwd: "test/src/css/", 118 | src: "*.css", 119 | dest: "test/dest/static/style/" 120 | }, 121 | scoped: { 122 | // global options 123 | options: { 124 | // filter unreferenced files 125 | filter: true, 126 | // prepend this base to every reference 127 | base: "test/src/" 128 | }, 129 | files: [{ 130 | expand: true, 131 | cwd: "test/src/css/", 132 | src: "*.css", 133 | dest: "test/dest/static/style/", 134 | // match glob pattern and add them to references 135 | reference: "test/src/css/*.css", 136 | scopes: { 137 | url: { 138 | "/?img": "/static/images", 139 | "/?font": "/static/fonts" 140 | } 141 | } 142 | }, { 143 | expand: true, 144 | cwd: "test/src/", 145 | src: "*.html", 146 | dest: "test/dest/", 147 | // add processed files to references 148 | reference: true, 149 | scopes: { 150 | url: { 151 | "/?img": "/static/images", 152 | "/?font": "/static/fonts" 153 | }, 154 | a: { 155 | "/?img": "/static/images" 156 | }, 157 | img: { 158 | "/?img": "/static/images" 159 | }, 160 | link: { 161 | "/?css": "/static/style" 162 | }, 163 | script: { 164 | "/?js": "/static/script" 165 | } 166 | } 167 | }, { 168 | expand: true, 169 | cwd: "test/src/img/", 170 | src: "*.*", 171 | dest: "test/dest/static/images/" 172 | }, { 173 | expand: true, 174 | cwd: "test/src/js/", 175 | src: "*.*", 176 | dest: "test/dest/static/script/" 177 | }] 178 | } 179 | } 180 | }) 181 | 182 | ``` 183 | 184 | ## LICENCE 185 | 186 | Copyright (c) 2014 Nagy Zoltan 187 | 188 | Permission is hereby granted, free of charge, to any person obtaining a copy 189 | of this software and associated documentation files (the "Software"), to deal 190 | in the Software without restriction, including without limitation the rights 191 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 192 | copies of the Software, and to permit persons to whom the Software is 193 | furnished to do so, subject to the following conditions: 194 | 195 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 196 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 197 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 198 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 199 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 200 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 201 | SOFTWARE. -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | var gulp = require("gulp") 2 | var rebase = require("./tasks/gulp-rebase") 3 | 4 | gulp.task("rebase-html", function( ){ 5 | gulp.src("test/src/*.html") 6 | .pipe(rebase({ 7 | url: { 8 | "/?img": "/static/images", 9 | "/?font": "/static/fonts" 10 | }, 11 | a: { 12 | "/?img": "/static/images" 13 | }, 14 | img: { 15 | "/?img": "/static/images" 16 | }, 17 | link: { 18 | "/?css": "/static/style" 19 | }, 20 | script: { 21 | "/?js": "/static/script" 22 | } 23 | })) 24 | .pipe(gulp.dest("test/dest/")) 25 | }) 26 | 27 | gulp.task("default", ["rebase-html"]) -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "rebase", 3 | "version": "0.3.1", 4 | "description": "Rewrite linked references/urls/srcs in files.", 5 | "main": "rebase.js", 6 | "scripts": { 7 | "test": "-" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/tunderdomb/rebase.git" 12 | }, 13 | "keywords": [ 14 | "node", 15 | "rebase", 16 | "rewrite path", 17 | "rewrite src", 18 | "rewrite url", 19 | "gruntplugin" 20 | ], 21 | "author": "Nagy Zoltan (tunderdomb)", 22 | "license": "MIT", 23 | "bugs": { 24 | "url": "https://github.com/tunderdomb/rebase/issues" 25 | }, 26 | "homepage": "https://github.com/tunderdomb/rebase", 27 | "devDependencies": { 28 | "grunt": "~0.4.5", 29 | "grunt-contrib-copy": "~0.5.0", 30 | "gulp": "~3.8.8" 31 | }, 32 | "directories": { 33 | "test": "test" 34 | }, 35 | "dependencies": { 36 | "through2": "~0.6.1", 37 | "gulp-util": "~3.0.1" 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /rebase.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Rebase.js 3 | * */ 4 | 5 | /** 6 | * rebase 7 | * @param content{String} 8 | * @param options{Object} 9 | * @param references{String} [optional] 10 | * */ 11 | var rebase = module.exports = function( content, options ){ 12 | if( !options ) return content 13 | for( var scope in options ){ 14 | var rewriter = rebase[scope] 15 | scope = options[scope] 16 | if( rewriter && scope ) { 17 | if ( scope.forEach ) { 18 | scope.forEach(function( rule ){ 19 | if ( rule.tag ) { 20 | content = rebase.tag(content, rule.tag, rule.attr, rule.base, rule.rebase) 21 | } 22 | else { 23 | content = rewriter(content, rule.base, rule.rebase) 24 | } 25 | }) 26 | } 27 | else { 28 | for( var base in scope ){ 29 | content = rewriter(content, base, scope[base]) 30 | } 31 | } 32 | } 33 | } 34 | return content 35 | } 36 | 37 | /** 38 | * "any string" 39 | * */ 40 | rebase.string = function( content, search, replace ){ 41 | search = new RegExp("^"+search) 42 | return content.replace(/('|")((?:\\\1|.)*?)\1/g, function( match, str, inside ){ 43 | if ( search.test(inside) ) { 44 | inside = inside.replace(search, replace) 45 | } 46 | return str + inside + str 47 | }) 48 | } 49 | 50 | /** 51 | * 52 | * */ 53 | var tag = rebase.tag = function( content, tag, attr, search, replace ){ 54 | tag = new RegExp("<"+tag+"([^>]+)>", 'g') // capture attribute space 55 | attr = new RegExp("("+attr+')\\s*=\\s*"\\s*([^"]+)\\s*"') // capture attribute name and value 56 | search = new RegExp("^"+search) 57 | return content.replace(tag, function( match ){ 58 | return match.replace(attr, function( match, attr, value ){ 59 | if ( search.test(value) ) { 60 | return attr+'="'+value.replace(search, replace)+'"' 61 | } 62 | else return match 63 | }) 64 | }) 65 | } 66 | 67 | /** 68 | * 69 | * */ 70 | rebase.script = function( content, search, replace ){ 71 | return tag(content, "script", "src", search, replace) 72 | } 73 | 74 | /** 75 | * 76 | * */ 77 | rebase.link = function( content, search, replace ){ 78 | return tag(content, "link", "href", search, replace) 79 | } 80 | 81 | /** 82 | * 83 | * */ 84 | rebase.a = function( content, search, replace ){ 85 | return tag(content, "a", "href", search, replace) 86 | } 87 | 88 | /** 89 | * 90 | * */ 91 | rebase.img = function( content, search, replace ){ 92 | return tag(content, "img", "src", search, replace) 93 | } 94 | 95 | /** 96 | * background-image: url(""); 97 | * */ 98 | rebase.url = function( content, search, replace ){ 99 | search = new RegExp("^"+search) 100 | return content.replace(/url\(\s*['"]?([^'"]+?)['"]?\s*\)/g, function( match, url ){ 101 | if ( search.test(url) ) { 102 | return "url("+url.replace(search, replace)+")" 103 | } 104 | else return match 105 | }) 106 | } 107 | 108 | /** 109 | * @import ""; 110 | * */ 111 | rebase.imports = function( content, search, replace ){ 112 | search = new RegExp("^"+search) 113 | return content.replace(/@import\s+"([^")]+)"/g, function( match, url ){ 114 | if ( search.test(url) ) { 115 | return "@import \""+url.replace(search, replace)+"\"" 116 | } 117 | else return match 118 | }) 119 | } -------------------------------------------------------------------------------- /tasks/grunt-rebase.js: -------------------------------------------------------------------------------- 1 | /* 2 | * grunt-rebase 3 | * 4 | * Copyright (c) 2014 tunderdomb 5 | * Licensed under the MIT license. 6 | */ 7 | 8 | 'use strict'; 9 | 10 | var rebase = require("../rebase") 11 | var path = require("path") 12 | 13 | module.exports = function ( grunt ){ 14 | 15 | // Please see the Grunt documentation for more information regarding task 16 | // creation: http://gruntjs.com/creating-tasks 17 | 18 | grunt.registerMultiTask('rebase', 'No description', function (){ 19 | 20 | // Merge task-specific and/or target-specific options with these defaults. 21 | var options = this.options({ 22 | }) 23 | var references = [] // referenced sources 24 | , files = {} // file content cache 25 | , dests = {} // src-dest maps 26 | , rebaseCount = 0 27 | , copyCount = 0 28 | 29 | // Iterate over all specified file groups. 30 | this.files.forEach(function ( filePair ){ 31 | var base = filePair.base || options.base 32 | , reference = filePair.reference || options.reference 33 | // iterate sources and process them 34 | filePair.src.forEach(function ( src ){ 35 | if( !grunt.file.exists(src) || !grunt.file.isFile(src) ) return 36 | var locals = [] 37 | , dest = filePair.dest || src 38 | // skip files that doesn't need rebasing (like images) 39 | if ( !filePair.scopes ) { 40 | grunt.file.copy(src, dest) 41 | ++copyCount 42 | } 43 | // or cache the rebased contents 44 | else { 45 | files[src] = rebase(grunt.file.read(src), filePair.scopes, locals) 46 | dests[src] = dest 47 | ++rebaseCount 48 | // remap references 49 | if ( base ) { 50 | locals = locals.map(function( src ){ 51 | return path.join(base, src).replace(/[\/\\]+/g, "/") 52 | }) 53 | } 54 | if( typeof reference == "string" ) { 55 | locals = locals.concat(grunt.file.expand(reference)) 56 | } 57 | else if( reference === true ) { 58 | locals.push(src) 59 | } 60 | // add them to the global list 61 | references = references.concat(locals) 62 | } 63 | }) 64 | }) 65 | 66 | // filter dupes 67 | references = references.filter(function( item, pos ){ 68 | return references.indexOf(item) == pos 69 | }) 70 | 71 | var src 72 | , rebased = [] 73 | // filter cached contents and only write referenced ones 74 | if ( options.filter ) for( src in files ){ 75 | if( !!~references.indexOf(src) ){ 76 | grunt.file.write(dests[src], files[src]) 77 | rebased.push(src) 78 | } 79 | else { 80 | --rebaseCount 81 | // free memory immediately 82 | files[src] = null 83 | } 84 | } 85 | // or write every file 86 | else for( src in files ){ 87 | grunt.file.write(dests[src], files[src]) 88 | rebased.push(src) 89 | } 90 | console.log("Rebased: %d, copied: %d, Total: %s", rebaseCount, copyCount, rebaseCount+copyCount) 91 | }) 92 | } -------------------------------------------------------------------------------- /tasks/gulp-rebase.js: -------------------------------------------------------------------------------- 1 | var gutil = require("gulp-util") 2 | var File = gutil.File; 3 | var through = require("through2") 4 | var PluginError = gutil.PluginError 5 | 6 | var rebase = require("../rebase") 7 | 8 | module.exports = function ( options ){ 9 | return through.obj(function( file, enc, done ){ 10 | if ( file.isNull() ) return // ignore 11 | if ( file.isStream() ) return this.emit("error", new PluginError("gulp-concat", "Streaming not supported")) 12 | 13 | var rebased = rebase(file.contents.toString(), options) 14 | this.push(new File({ 15 | cwd: file.cwd, 16 | base: file.base, 17 | path: file.path, 18 | contents: new Buffer(rebased) 19 | })) 20 | done() 21 | }) 22 | } -------------------------------------------------------------------------------- /test/dest/static/images/MassEffect2Citadel.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tunderdomb/rebase/7dec768e4083151ef305c3e0145590a64061a887/test/dest/static/images/MassEffect2Citadel.jpg -------------------------------------------------------------------------------- /test/dest/static/images/mass_effect_3_earth_dreamscene_by_droot1986-d661hfj.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tunderdomb/rebase/7dec768e4083151ef305c3e0145590a64061a887/test/dest/static/images/mass_effect_3_earth_dreamscene_by_droot1986-d661hfj.jpg -------------------------------------------------------------------------------- /test/dest/static/script/test.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tunderdomb/rebase/7dec768e4083151ef305c3e0145590a64061a887/test/dest/static/script/test.js -------------------------------------------------------------------------------- /test/dest/static/style/css.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | @import "import.css"; 3 | 4 | body{ 5 | background: url("/static/images/mass_effect_3_earth_dreamscene_by_droot1986-d661hfj.jpg") 6 | , url("/static/images/mass_effect_3_earth_dreamscene_by_droot1986-d661hfj.jpg") 7 | , url("/static/images/mass_effect_3_earth_dreamscene_by_droot1986-d661hfj.jpg") 8 | , url("/static/images/mass_effect_3_earth_dreamscene_by_droot1986-d661hfj.jpg") 9 | , url("/static/images/mass_effect_3_earth_dreamscene_by_droot1986-d661hfj.jpg") 10 | , url("/static/images/mass_effect_3_earth_dreamscene_by_droot1986-d661hfj.jpg"); 11 | } -------------------------------------------------------------------------------- /test/dest/static/style/import.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; -------------------------------------------------------------------------------- /test/dest/test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Rebase test 6 | 7 | 8 | 9 | 10 | 11 | 12 | 24 | 25 | 26 | 27 | 28 | home 29 | 30 | 31 | test 32 | 33 | 34 | 35 | test 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /test/nodest/MassEffect2Citadel.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tunderdomb/rebase/7dec768e4083151ef305c3e0145590a64061a887/test/nodest/MassEffect2Citadel.jpg -------------------------------------------------------------------------------- /test/nodest/mass_effect_3_earth_dreamscene_by_droot1986-d661hfj.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tunderdomb/rebase/7dec768e4083151ef305c3e0145590a64061a887/test/nodest/mass_effect_3_earth_dreamscene_by_droot1986-d661hfj.jpg -------------------------------------------------------------------------------- /test/src/css/css.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | @import "import.css"; 3 | 4 | body{ 5 | background: url("img/mass_effect_3_earth_dreamscene_by_droot1986-d661hfj.jpg") 6 | , url('img/mass_effect_3_earth_dreamscene_by_droot1986-d661hfj.jpg') 7 | , url(img/mass_effect_3_earth_dreamscene_by_droot1986-d661hfj.jpg) 8 | , url("/img/mass_effect_3_earth_dreamscene_by_droot1986-d661hfj.jpg") 9 | , url('/img/mass_effect_3_earth_dreamscene_by_droot1986-d661hfj.jpg') 10 | , url(/img/mass_effect_3_earth_dreamscene_by_droot1986-d661hfj.jpg); 11 | } -------------------------------------------------------------------------------- /test/src/css/import.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; -------------------------------------------------------------------------------- /test/src/font/SourceCodePro/OFL.txt: -------------------------------------------------------------------------------- 1 | Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe Systems Incorporated in the United States and/or other countries. 2 | This Font Software is licensed under the SIL Open Font License, Version 1.1. 3 | This license is copied below, and is also available with a FAQ at: 4 | http://scripts.sil.org/OFL 5 | 6 | 7 | ----------------------------------------------------------- 8 | SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 9 | ----------------------------------------------------------- 10 | 11 | PREAMBLE 12 | The goals of the Open Font License (OFL) are to stimulate worldwide 13 | development of collaborative font projects, to support the font creation 14 | efforts of academic and linguistic communities, and to provide a free and 15 | open framework in which fonts may be shared and improved in partnership 16 | with others. 17 | 18 | The OFL allows the licensed fonts to be used, studied, modified and 19 | redistributed freely as long as they are not sold by themselves. The 20 | fonts, including any derivative works, can be bundled, embedded, 21 | redistributed and/or sold with any software provided that any reserved 22 | names are not used by derivative works. The fonts and derivatives, 23 | however, cannot be released under any other type of license. The 24 | requirement for fonts to remain under this license does not apply 25 | to any document created using the fonts or their derivatives. 26 | 27 | DEFINITIONS 28 | "Font Software" refers to the set of files released by the Copyright 29 | Holder(s) under this license and clearly marked as such. This may 30 | include source files, build scripts and documentation. 31 | 32 | "Reserved Font Name" refers to any names specified as such after the 33 | copyright statement(s). 34 | 35 | "Original Version" refers to the collection of Font Software components as 36 | distributed by the Copyright Holder(s). 37 | 38 | "Modified Version" refers to any derivative made by adding to, deleting, 39 | or substituting -- in part or in whole -- any of the components of the 40 | Original Version, by changing formats or by porting the Font Software to a 41 | new environment. 42 | 43 | "Author" refers to any designer, engineer, programmer, technical 44 | writer or other person who contributed to the Font Software. 45 | 46 | PERMISSION & CONDITIONS 47 | Permission is hereby granted, free of charge, to any person obtaining 48 | a copy of the Font Software, to use, study, copy, merge, embed, modify, 49 | redistribute, and sell modified and unmodified copies of the Font 50 | Software, subject to the following conditions: 51 | 52 | 1) Neither the Font Software nor any of its individual components, 53 | in Original or Modified Versions, may be sold by itself. 54 | 55 | 2) Original or Modified Versions of the Font Software may be bundled, 56 | redistributed and/or sold with any software, provided that each copy 57 | contains the above copyright notice and this license. These can be 58 | included either as stand-alone text files, human-readable headers or 59 | in the appropriate machine-readable metadata fields within text or 60 | binary files as long as those fields can be easily viewed by the user. 61 | 62 | 3) No Modified Version of the Font Software may use the Reserved Font 63 | Name(s) unless explicit written permission is granted by the corresponding 64 | Copyright Holder. This restriction only applies to the primary font name as 65 | presented to the users. 66 | 67 | 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font 68 | Software shall not be used to promote, endorse or advertise any 69 | Modified Version, except to acknowledge the contribution(s) of the 70 | Copyright Holder(s) and the Author(s) or with their explicit written 71 | permission. 72 | 73 | 5) The Font Software, modified or unmodified, in part or in whole, 74 | must be distributed entirely under this license, and must not be 75 | distributed under any other license. The requirement for fonts to 76 | remain under this license does not apply to any document created 77 | using the Font Software. 78 | 79 | TERMINATION 80 | This license becomes null and void if any of the above conditions are 81 | not met. 82 | 83 | DISCLAIMER 84 | THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 85 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF 86 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT 87 | OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE 88 | COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 89 | INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL 90 | DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 91 | FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM 92 | OTHER DEALINGS IN THE FONT SOFTWARE. 93 | -------------------------------------------------------------------------------- /test/src/font/SourceCodePro/SourceCodePro-Black.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tunderdomb/rebase/7dec768e4083151ef305c3e0145590a64061a887/test/src/font/SourceCodePro/SourceCodePro-Black.ttf -------------------------------------------------------------------------------- /test/src/font/SourceCodePro/SourceCodePro-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tunderdomb/rebase/7dec768e4083151ef305c3e0145590a64061a887/test/src/font/SourceCodePro/SourceCodePro-Bold.ttf -------------------------------------------------------------------------------- /test/src/font/SourceCodePro/SourceCodePro-ExtraLight.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tunderdomb/rebase/7dec768e4083151ef305c3e0145590a64061a887/test/src/font/SourceCodePro/SourceCodePro-ExtraLight.ttf -------------------------------------------------------------------------------- /test/src/font/SourceCodePro/SourceCodePro-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tunderdomb/rebase/7dec768e4083151ef305c3e0145590a64061a887/test/src/font/SourceCodePro/SourceCodePro-Light.ttf -------------------------------------------------------------------------------- /test/src/font/SourceCodePro/SourceCodePro-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tunderdomb/rebase/7dec768e4083151ef305c3e0145590a64061a887/test/src/font/SourceCodePro/SourceCodePro-Medium.ttf -------------------------------------------------------------------------------- /test/src/font/SourceCodePro/SourceCodePro-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tunderdomb/rebase/7dec768e4083151ef305c3e0145590a64061a887/test/src/font/SourceCodePro/SourceCodePro-Regular.ttf -------------------------------------------------------------------------------- /test/src/font/SourceCodePro/SourceCodePro-Semibold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tunderdomb/rebase/7dec768e4083151ef305c3e0145590a64061a887/test/src/font/SourceCodePro/SourceCodePro-Semibold.ttf -------------------------------------------------------------------------------- /test/src/img/MassEffect2Citadel.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tunderdomb/rebase/7dec768e4083151ef305c3e0145590a64061a887/test/src/img/MassEffect2Citadel.jpg -------------------------------------------------------------------------------- /test/src/img/mass_effect_3_earth_dreamscene_by_droot1986-d661hfj.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tunderdomb/rebase/7dec768e4083151ef305c3e0145590a64061a887/test/src/img/mass_effect_3_earth_dreamscene_by_droot1986-d661hfj.jpg -------------------------------------------------------------------------------- /test/src/js/test.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tunderdomb/rebase/7dec768e4083151ef305c3e0145590a64061a887/test/src/js/test.js -------------------------------------------------------------------------------- /test/src/test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Rebase test 6 | 7 | 8 | 9 | 10 | 11 | 12 | 24 | 25 | 26 | 27 | 28 | home 29 | 30 | 31 | test 32 | 33 | 34 | 35 | test 36 | 37 | 38 | 39 | --------------------------------------------------------------------------------