diff --git a/README.md b/README.md index 48c638e..d6f964d 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,26 @@ -Install ------- +# Break Shot +# ![break shot](http://i.imgur.com/pz4yf10.jpg?1) - npm install - cd public/ && npm install && cd - - grunt nodewebkit +### About +Break Shot is amazing screen capture for responsive websites. It's detects all resolutions and take a print screens. +It's possible are you choose a others resolutions. +It can also take a print for just html selector called '#breakshot'. +### Usage simple detect breakpoint +1. Chose source selection (local html file) from an url or from a file (complete URL of site) +2. Click in next step +3. Choose auto sizing (break shot will find media queries break point) or custom size ( your prefered resolution, such as 800 x 600, 1024 x 768, etc) +4. Click in next +5. Chose a extension of file and outpu file name. +6. Click in save file, chose directory. + +### Usage generate ad banner +Create your banners using media queries in diferentes resolutions and user #breakshot selector. + +### Team +#####Developer +Victor Ferraz [@victorferraz](https://github.com/victorferraz) + +#####Designer +Bruno Magalhães [@brunomagalhaes] +(https://www.facebook.com/BrunodeMagalhaes?fref=ts) diff --git a/public/app/scripts/process/getcss.js b/public/app/scripts/process/getcss.js index d4e87ca..1599f7f 100644 --- a/public/app/scripts/process/getcss.js +++ b/public/app/scripts/process/getcss.js @@ -28,7 +28,11 @@ GetCss.prototype.getCss = function (file) { var style = $('link[rel=stylesheet]'); for(var index=0; index < style.length; index++){ array = []; - array.css = path + style[index].attribs.href; + var cssFile = style[index].attribs.href; + if (this.data.from === 'from-url') { + path = this.getPathUrl(cssFile); + } + array.css = path + cssFile; array.path = path; array.html = file[i].html; link.push(array); @@ -37,6 +41,15 @@ GetCss.prototype.getCss = function (file) { return link; }; + +GetCss.prototype.getPathUrl = function (cssFile){ + var urlFormated; + if (cssFile.search('http://') === -1){ + urlFormated = this.data.origin + '/'; + } + return urlFormated; +}; + GetCss.prototype.getPath = function (url){ var arrayPath = url.split('/'); arrayPath.pop(); diff --git a/public/app/scripts/process/mediaQuerieRotine.js b/public/app/scripts/process/mediaQuerieRotine.js index a5515b1..fd45fe2 100644 --- a/public/app/scripts/process/mediaQuerieRotine.js +++ b/public/app/scripts/process/mediaQuerieRotine.js @@ -71,7 +71,6 @@ MediaQuerieRotine.prototype.analysisCss = function (arrayStyle) { this.verifyArray = []; this.verifyAdExists = false; var breakPoints = null; - var result = null; for (var i = 0; i < arrayStyle.length; i++) { cssFile = arrayStyle[i]; breakPoints = null; @@ -85,9 +84,6 @@ MediaQuerieRotine.prototype.analysisCss = function (arrayStyle) { return media; }; -MediaQuerieRotine.prototype.mergeArray = function () { -}; - MediaQuerieRotine.prototype.getMedia = function (cssFile) { var ast = mensch.parse(cssFile.css); var tree = null; @@ -152,6 +148,7 @@ MediaQuerieRotine.prototype.findKey = function (obj, selector) { var properties = null; for(var index=0; index < obj.selectors.length; index++){ if (obj.selectors[index] === selector) { + console.log(obj); properties = this.findProperties(obj); } } diff --git a/public/package.json b/public/package.json index c4891c8..06aed3a 100644 --- a/public/package.json +++ b/public/package.json @@ -1,16 +1,16 @@ { "main": "index.html", "name": "break-shot", - "description": "demo app of node-webkit", + "description": "BreakShot", "version": "0.1.0", "keywords": [ "resize", "node-webkit" ], "window": { - "title": "node-webkit demo", + "title": "BrekShot", "icon": "link.png", - "toolbar": true, + "toolbar": false, "frame": true, "width": 1100, "height": 700,