diff --git a/.gitignore b/.gitignore index 0bd7f066..2fbb3220 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,5 @@ node_modules settings.json -static/js/jquery.js -static/js/prefixfree.js APIKEY.txt bin/abiword.exe bin/node.exe @@ -11,6 +9,5 @@ bin/convertSettings.json *~ *.patch src/static/js/jquery.js -src/static/js/prefixfree.js npm-debug.log *.DS_Store diff --git a/bin/installDeps.sh b/bin/installDeps.sh index e2a43c53..2acebd82 100755 --- a/bin/installDeps.sh +++ b/bin/installDeps.sh @@ -81,21 +81,6 @@ if [ $DOWNLOAD_JQUERY = "true" ]; then curl -lo src/static/js/jquery.js http://code.jquery.com/jquery-$NEEDED_VERSION.js || exit 1 fi -echo "Ensure prefixfree is downloaded and up to date..." -DOWNLOAD_PREFIXFREE="true" -NEEDED_VERSION="1.0.4" -if [ -f "src/static/js/prefixfree.js" ]; then - VERSION=$(cat src/static/js/prefixfree.js | grep "PrefixFree" | grep -o "[0-9].[0-9].[0-9]"); - - if [ $VERSION = $NEEDED_VERSION ]; then - DOWNLOAD_PREFIXFREE="false" - fi -fi - -if [ $DOWNLOAD_PREFIXFREE = "true" ]; then - curl -lo src/static/js/prefixfree.js -k https://raw.github.com/LeaVerou/prefixfree/master/prefixfree.js || exit 1 -fi - #Remove all minified data to force node creating it new echo "Clear minfified cache..." rm -f var/minified* diff --git a/src/node/utils/tar.json b/src/node/utils/tar.json index adb6e2b2..af31fb80 100644 --- a/src/node/utils/tar.json +++ b/src/node/utils/tar.json @@ -22,7 +22,6 @@ , "chat.js" , "excanvas.js" , "farbtastic.js" - , "prefixfree.js" ] , "timeslider.js": [ "jquery.js" diff --git a/src/static/js/pad.js b/src/static/js/pad.js index 176911ac..426eb089 100644 --- a/src/static/js/pad.js +++ b/src/static/js/pad.js @@ -31,7 +31,6 @@ require('./farbtastic'); require('./excanvas'); JSON = require('./json2'); require('./undo-xpopup'); -require('./prefixfree'); var chat = require('./chat').chat; var getCollabClient = require('./collab_client').getCollabClient; diff --git a/src/static/js/prefixfree.js b/src/static/js/prefixfree.js deleted file mode 100644 index b5b23466..00000000 --- a/src/static/js/prefixfree.js +++ /dev/null @@ -1,419 +0,0 @@ -/** - * StyleFix 1.0.2 - * @author Lea Verou - * MIT license - */ - -(function(){ - -if(!window.addEventListener) { - return; -} - -var self = window.StyleFix = { - link: function(link) { - try { - // Ignore stylesheets with data-noprefix attribute as well as alternate stylesheets - if(link.rel !== 'stylesheet' || link.hasAttribute('data-noprefix')) { - return; - } - } - catch(e) { - return; - } - - var url = link.href || link.getAttribute('data-href'), - base = url.replace(/[^\/]+$/, ''), - parent = link.parentNode, - xhr = new XMLHttpRequest(); - - xhr.open('GET', url); - - xhr.onreadystatechange = function() { - if(xhr.readyState === 4) { - var css = xhr.responseText; - - if(css && link.parentNode) { - css = self.fix(css, true, link); - - // Convert relative URLs to absolute, if needed - if(base) { - css = css.replace(/url\(('?|"?)(.+?)\1\)/gi, function($0, quote, url) { - if(!/^([a-z]{3,10}:|\/|#)/i.test(url)) { // If url not absolute & not a hash - // May contain sequences like /../ and /./ but those DO work - return 'url("' + base + url + '")'; - } - - return $0; - }); - - // behavior URLs shoudn’t be converted (Issue #19) - css = css.replace(RegExp('\\b(behavior:\\s*?url\\(\'?"?)' + base, 'gi'), '$1'); - } - - var style = document.createElement('style'); - style.textContent = css; - style.media = link.media; - style.disabled = link.disabled; - style.setAttribute('data-href', link.getAttribute('href')); - - parent.insertBefore(style, link); - parent.removeChild(link); - } - } - }; - - xhr.send(null); - - link.setAttribute('data-inprogress', ''); - }, - - styleElement: function(style) { - var disabled = style.disabled; - - style.textContent = self.fix(style.textContent, true, style); - - style.disabled = disabled; - }, - - styleAttribute: function(element) { - var css = element.getAttribute('style'); - - css = self.fix(css, false, element); - - element.setAttribute('style', css); - }, - - process: function() { - // Linked stylesheets - $('link[rel="stylesheet"]:not([data-inprogress])').forEach(StyleFix.link); - - // Inline stylesheets - $('style').forEach(StyleFix.styleElement); - - // Inline styles - $('[style]').forEach(StyleFix.styleAttribute); - }, - - register: function(fixer, index) { - (self.fixers = self.fixers || []) - .splice(index === undefined? self.fixers.length : index, 0, fixer); - }, - - fix: function(css, raw) { - for(var i=0; i 3) { - parts.pop(); - - var shorthand = parts.join('-'); - - if(supported(shorthand) && properties.indexOf(shorthand) === -1) { - properties.push(shorthand); - } - } - } - }, - supported = function(property) { - return StyleFix.camelCase(property) in dummy; - } - - // Some browsers have numerical indices for the properties, some don't - if(style.length > 0) { - for(var i=0; i 3) { - parts.pop(); - - var shorthand = parts.join('-'); - - if(supported(shorthand) && properties.indexOf(shorthand) === -1) { - properties.push(shorthand); - } - } - } - }, - supported = function(property) { - return StyleFix.camelCase(property) in dummy; - } - - // Some browsers have numerical indices for the properties, some don't - if(style.length > 0) { - for(var i=0; i