img revealer

This commit is contained in:
Martin Donnelly 2015-08-07 13:48:37 +01:00
parent d7709e5764
commit 2abcc1eec1
18 changed files with 3206 additions and 33 deletions

View File

@ -0,0 +1,14 @@
<component name="libraryTable">
<library name="rinser node_modules" type="javaScript">
<properties>
<option name="frameworkName" value="node_modules" />
<sourceFilesUrls>
<item url="file://$PROJECT_DIR$/node_modules" />
</sourceFilesUrls>
</properties>
<CLASSES>
<root url="file://$PROJECT_DIR$/node_modules" />
</CLASSES>
<SOURCES />
</library>
</component>

View File

@ -2,8 +2,6 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="c2fd5632-2143-4c7e-8b0d-96d7692b700b" name="Default" comment="">
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/node_modules/rss-braider/lib/RssBraider.js" afterPath="$PROJECT_DIR$/node_modules/rss-braider/lib/RssBraider.js" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/lifestyle.js" afterPath="$PROJECT_DIR$/lifestyle.js" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/sonarIssues.xml" afterPath="$PROJECT_DIR$/.idea/sonarIssues.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
</list>
@ -49,8 +47,8 @@
<file leaf-file-name="lifestyle.js" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/lifestyle.js">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="-4.4827585">
<caret line="53" column="11" selection-start-line="48" selection-start-column="9" selection-end-line="53" selection-end-column="11" />
<state vertical-scroll-proportion="-21.689655">
<caret line="209" column="8" selection-start-line="209" selection-start-column="8" selection-end-line="209" selection-end-column="8" />
<folding />
</state>
</provider>
@ -99,8 +97,8 @@
<file leaf-file-name="RssBraider.js" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/node_modules/rss-braider/lib/RssBraider.js">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="-3.2142856">
<caret line="135" column="9" selection-start-line="135" selection-start-column="9" selection-end-line="135" selection-end-column="9" />
<state vertical-scroll-proportion="2.7236843">
<caret line="212" column="5" selection-start-line="212" selection-start-column="5" selection-end-line="212" selection-end-column="5" />
<folding />
</state>
</provider>
@ -590,12 +588,36 @@
<option name="project" value="LOCAL" />
<updated>1438343085237</updated>
</task>
<option name="localTasksCounter" value="13" />
<task id="LOCAL-00013" summary="reverting">
<created>1438343244912</created>
<option name="number" value="00013" />
<option name="project" value="LOCAL" />
<updated>1438343244912</updated>
</task>
<task id="LOCAL-00014" summary="debugging">
<created>1438343582415</created>
<option name="number" value="00014" />
<option name="project" value="LOCAL" />
<updated>1438343582415</updated>
</task>
<task id="LOCAL-00015" summary="debugging">
<created>1438344607380</created>
<option name="number" value="00015" />
<option name="project" value="LOCAL" />
<updated>1438344607381</updated>
</task>
<task id="LOCAL-00016" summary="debugging">
<created>1438344656021</created>
<option name="number" value="00016" />
<option name="project" value="LOCAL" />
<updated>1438344656021</updated>
</task>
<option name="localTasksCounter" value="17" />
<servers />
</component>
<component name="ToolWindowManager">
<frame x="-8" y="-8" width="1936" height="1056" extended-state="6" />
<editor active="false" />
<editor active="true" />
<layout>
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.24973656" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
@ -603,7 +625,7 @@
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
<window_info id="Application Servers" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="SonarQube" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32962137" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.5623608" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.2594655" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32962137" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
@ -634,7 +656,8 @@
<option name="CHECK_NEW_TODO" value="false" />
<MESSAGE value="debugging braider" />
<MESSAGE value="reverting" />
<option name="LAST_COMMIT_MESSAGE" value="reverting" />
<MESSAGE value="debugging" />
<option name="LAST_COMMIT_MESSAGE" value="debugging" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
@ -994,16 +1017,16 @@
</entry>
<entry file="file://$PROJECT_DIR$/lifestyle.js">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="-4.4827585">
<caret line="53" column="11" selection-start-line="48" selection-start-column="9" selection-end-line="53" selection-end-column="11" />
<state vertical-scroll-proportion="-21.689655">
<caret line="209" column="8" selection-start-line="209" selection-start-column="8" selection-end-line="209" selection-end-column="8" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/node_modules/rss-braider/lib/RssBraider.js">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="-3.2142856">
<caret line="135" column="9" selection-start-line="135" selection-start-column="9" selection-end-line="135" selection-end-column="9" />
<state vertical-scroll-proportion="2.7236843">
<caret line="212" column="5" selection-start-line="212" selection-start-column="5" selection-end-line="212" selection-end-column="5" />
<folding />
</state>
</provider>

3053
html/css/mui.css Normal file

File diff suppressed because it is too large Load Diff

1
html/css/mui.min.css vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -1,3 +1,3 @@
<% list.forEach(function (item) { %>
<button id="<%=item.name%>" class="pure-button"><%=item.name%></button>
<button id="<%=item.name%>" class="mui-btn mui-btn-primary"><%=item.name%></button>
<% }) %>

View File

@ -1,11 +1,13 @@
<h1><%= d.title %></h1>
<% d.items.forEach(function (item) { %>
<div class='pure-u-1 entry'>
<div class="mui-row">
<h2><a href='<%=item.url%>'><%=item.title %></a></h2>
<div class='u-full-width content' style='overflow:hidden;'><%=item.description%></div>
<div class='info' style='font-size:75%;color:#bbbbbb;'>
<span class='author' ><%=item.author%></span>
<span class='date' ><%=item.date%></span>
<div class=' content' style='overflow:hidden;'>
<%=item.description%>
</div>
<div class='info' style='font-size:75%;color:#bbbbbb;'>
<span class='author'><%=item.author%></span>
<span class='date'><%=item.date%></span>
</div>
</div>
<% }) %>

View File

@ -13,8 +13,8 @@
<!-- CSS
-->
<link rel="stylesheet" href="css/normalize-min.css">
<link rel="stylesheet" href="css/skeleton-min.css">
<link rel="stylesheet" href="css/mui.css">
<link rel="stylesheet" href="css/nprogress.css">
<style>
.info {
@ -52,17 +52,18 @@
</head>
<body>
<div class="container">
<div class="u-full-width content">
<div class="mui-container">
<div class="mui-panel">
Last update: <span id="lastupdate">x</span>
<button id="refresh">Refresh</button>
<button id="refresh" class="mui-btn mui-btn-primary mui-btn-raised">Refresh</button>
<div id="list" class="u-full-width content"></div>
</div>
</div>
<div id="feedcontent" class="container">
<div class="mui-container">
<div id="feedcontent" class="mui-panel">
</div>
</div>
<!-- <script type="text/javascript" src="js/zepto.js"></script>
<script type="text/javascript" src="js/moment.js"></script>
<script type="text/javascript" src="js/ejs.js"></script>-->
@ -70,6 +71,7 @@
<script type="text/javascript" src="js/fx.js"></script>
<script type="text/javascript" src="js/fx_methods.js"></script>
<script type="text/javascript" src="js/zprogress.js"></script>
<script type="text/javascript" src="js/jquery.unveil.js"></script>
<script type="text/javascript" src="js/app.prod.js"></script>
</body>

View File

@ -129,6 +129,7 @@ var APP = {
var output = this._feed.render(d);
$('#feedcontent').append(output);
$("img").unveil();
}

56
html/js/jquery.unveil.js Normal file
View File

@ -0,0 +1,56 @@
/**
* jQuery Unveil
* A very lightweight jQuery plugin to lazy load images
* http://luis-almeida.github.com/unveil
*
* Licensed under the MIT license.
* Copyright 2013 Luís Almeida
* https://github.com/luis-almeida
*/
;(function($) {
$.fn.unveil = function(threshold, callback) {
var $w = $(window),
th = threshold || 0,
retina = window.devicePixelRatio > 1,
attrib = retina? "data-src-retina" : "data-src",
images = this,
loaded;
this.one("unveil", function() {
var source = this.getAttribute(attrib);
source = source || this.getAttribute("data-src");
if (source) {
this.setAttribute("src", source);
if (typeof callback === "function") callback.call(this);
}
});
function unveil() {
var inview = images.filter(function() {
var $e = $(this);
if ($e.is(":hidden")) return;
var wt = $w.scrollTop(),
wb = wt + $w.height(),
et = $e.offset().top,
eb = et + $e.height();
return eb >= wt - th && et <= wb + th;
});
loaded = inview.trigger("unveil");
images = images.not(loaded);
}
$w.on("scroll.unveil resize.unveil lookup.unveil", unveil);
unveil();
return this;
};
})(window.jQuery || window.Zepto);

File diff suppressed because one or more lines are too long

View File

@ -20,7 +20,7 @@ feeds.simple_test_feed = {
"description": "Combined Paleo Feed",
'site_url': 'http://pipes.silvrtree.co.uk/paleo.xml'
},
"plugins" : ['filter_3_days' ],
"plugins" : ['filter_3_days',"fix_images" ],
"sources": [
{
/* "name" : "JobServe",*/

2
paleo.min.js vendored Normal file
View File

@ -0,0 +1,2 @@
var outputFile="paleo",RssBraider=require("rss-braider"),fs=require("fs"),ejs=require("ejs"),read=require("fs").readFileSync,join=require("path").join,str=read(join(__dirname,"/templates/rss.ejs"),"utf8"),feeds={};feeds.simple_test_feed={feed_name:"feed",default_count:1,no_cdata_fields:[],meta:{title:"Paleo",description:"Combined Paleo Feed",site_url:"http://pipes.silvrtree.co.uk/paleo.xml"},plugins:["filter_3_days","fix_images"],sources:[{count:100,feed_url:"http://feeds.feedburner.com/PaleoPlan"},{count:100,feed_url:"http://nomnompaleo.com/rss"},{count:100,feed_url:"http://thepaleodiet.com/feed/"},{count:100,feed_url:"http://paleoleap.com/feed/"},{count:100,feed_url:"http://ultimatepaleoguide.com/feed/"},{count:100,feed_url:"http://elanaspantry.com/feed/"},{count:100,feed_url:"http://feeds.feedburner.com/Paleomg-PaleoRecipes"},{count:100,feed_url:"http://civilizedcavemancooking.com/feed/"}]};var braider_options={feeds:feeds,indent:" ",date_sort_order:"desc",log_level:"warn",dedupe_fields:["guid"],plugins_directories:[__dirname+"/plugins/"]},rss_braider=RssBraider.createClient(braider_options);rss_braider.logger.level("off"),rss_braider.processFeed("simple_test_feed","json",function(e,o){if(e)return console.log(e);{var t=JSON.parse(o);ejs.compile(str)(t)}fs.writeFile(__dirname+"/html/"+outputFile+".json",o,function(e){return e?console.log(e):void console.log("The file was saved!")})});
//# sourceMappingURL=paleo.min.js.map

1
paleo.min.js.map Normal file
View File

@ -0,0 +1 @@
{"version":3,"sources":["paleo.js"],"names":["outputFile","RssBraider","require","fs","ejs","read","readFileSync","join","str","__dirname","feeds","simple_test_feed","feed_name","default_count","no_cdata_fields","meta","title","description","site_url","plugins","sources","count","feed_url","braider_options","indent","date_sort_order","log_level","dedupe_fields","plugins_directories","rss_braider","createClient","logger","level","processFeed","err","data","console","log","j","JSON","parse","compile","writeFile"],"mappings":"AAAA,GAAIA,YAAa,QACbC,WAAaC,QAAQ,eACrBC,GAAKD,QAAQ,MACbE,IAAMF,QAAQ,OACdG,KAAOH,QAAQ,MAAMI,aACrBC,KAAOL,QAAQ,QAAQK,KACvBC,IAAMH,KAAKE,KAAKE,UAAW,sBAAuB,QAClDC,QAMJA,OAAMC,kBACFC,UAAa,OACbC,cAAiB,EACjBC,mBACAC,MACIC,MAAS,QACTC,YAAe,sBACfC,SAAY,0CAEhBC,SAAuB,gBAAgB,cACvCC,UAGQC,MAAS,IACTC,SAAY,0CAIZD,MAAS,IACTC,SAAY,+BAIZD,MAAS,IACTC,SAAY,kCAIZD,MAAS,IACTC,SAAY,+BAIZD,MAAS,IACTC,SAAY,wCAIZD,MAAS,IACTC,SAAY,kCAKZD,MAAS,IACTC,SAAY,qDAIZD,MAAS,IACTC,SAAY,6CAIxB,IAAIC,kBACAb,MAAOA,MACPc,OAAQ,OACRC,gBAAiB,OACjBC,UAAW,OACXC,eAAgB,QACfC,qBAA2BnB,UAAY,cAExCoB,YAAc5B,WAAW6B,aAAaP,gBAG1CM,aAAYE,OAAOC,MAAM,OAEzBH,YAAYI,YAAY,mBAAoB,OAAQ,SAAUC,EAAKC,GAC/D,GAAID,EACA,MAAOE,SAAQC,IAAIH,EAGvB,EAAA,GAAII,GAAIC,KAAKC,MAAML,EACH/B,KAAIqC,QAAQjC,KAAK8B,GAEjCnC,GAAGuC,UAAUjC,UAAY,SAAWT,WAAa,QAASmC,EAAM,SAAUD,GACtE,MAAIA,GACOE,QAAQC,IAAIH,OAGvBE,SAAQC,IAAI"}

7
plugins/fix_images.js Normal file
View File

@ -0,0 +1,7 @@
module.exports = function (item, itemOptions, source) {
var match = itemOptions.description.replace(/\ssrc=/gi,' src="assets/fm.png" data-src=');
itemOptions.description = match;
return itemOptions;
};

6
regex.js Normal file

File diff suppressed because one or more lines are too long

2
regex.min.js vendored Normal file

File diff suppressed because one or more lines are too long

1
regex.min.js.map Normal file
View File

@ -0,0 +1 @@
{"version":3,"sources":["regex.js"],"names":["txt","reg1","RegExp","match","replaceAll","console","log"],"mappings":"AAAA,GAAIA,KAAM,s6VAENC,KAAO,GAAIC,QAAO,YAClBC,KACJA,OAAQF,KAAKG,WAAWJ,IAAI,kCAC5BK,QAAQC,IAAIH"}

2
regexx.js Normal file

File diff suppressed because one or more lines are too long