lipka / piecon Goto Github PK
View Code? Open in Web Editor NEWA tiny javascript library for generating progress pie charts in your favicon.
A tiny javascript library for generating progress pie charts in your favicon.
I still had CORS issues, but if this method were made public, one could pass in a base64 encoded version of their favicon. Right now I'm just overloading the reset method (note that I didn't need any of the title logic):
var base64_icon_href = 'data:image/x-icon;base64,AAABAAEAEBAAAAAAAABoBQAAFgAAACgAAAAQAAAAIAAAAAEACAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAAAA8uvRAMq/oQDj28EA27crAOjRdwCrhwoAuZQLAODKdwC6r5EAkXs1AODCSgCKd0MA3rw7AP///wDi3dAA/PnwAI9yFwBzWxUAh2kHAL6aCwDAmgsA6taGAM+nDACwjxkA1q0NANfIkwDt3qQAz8ShAI98RADr6OAAlXUIAO3blQCqk0UAtKeCAOndsgCdewkAzsawAOTcwQDg1rIA2bIcALmlZADbvUkAno5iAPX07wDGt4MA8OCkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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Name('link');
var head = document.getElementsByTagName('head')[0];
for (var i = 0; i < links.length; i++) {
if (typeof(links[i]) !== 'undefined' && links[i].getAttribute('rel') === 'icon') {
head.removeChild(links[i]);
}
}
};
var setFaviconTag = function(url) {
removeFaviconTag();
var link = document.createElement('link');
link.type = 'image/x-icon';
link.rel = 'icon';
link.href = url;
document.getElementsByTagName('head')[0].appendChild(link);
};
setFaviconTag(base64_icon_href);
};
I'd like to show the pie chart favicon to chart progress during a file upload but then revert to my site's original favicon when the upload is complete. Piecon.reset()
just restores a partially filled pie chart when I call it when the file is done uploading.
How can I modify piecon.js such that Piecon.reset()
can restore the original favicon on my site?
thanks,
tim
I'm running Firefox Aurora (16.0a2, 2012-08-19) and Piecon flickers so heavily that I wouldn't dare use it in any of my projects for fear of looking unprofessional myself.
Currently, it's easier and more intuitive to download Tinycon via Piecon's site than to download or git clone
Piecon.
The Piecon site needs a link to the GitHub page (possibly the typical "Fork this GitHub" ribbon) and possibly a download link. (There's a Zip button on the GitHub page, but a download link would be a good way to bless a specific download link for people who specifically seek "the recommended stable version")
In the documentation, fallback
is set to 'false'
. It should not be a string, but rather a literal.
Hi there,
Would you consider versioning and hosting piecon at cdnjs.com?
Thanks
I've contacted the current owner via email. Will see what he responds.
I would like to report a bug, it seems that if the title is not set it can show percentage two times ( the 36% in this case is the good one) and a "5%" or other value gets appended to the title name
A possible solution I found is to verify if title is different from null like in the picture below. The change has to be made in reset also to work properly
Hi there?
Is this project still maintained?
I have some improvements to it, for example, for updating an element anywhere within the DOM and not just the favicon which I would like to merge, either as a pull request to this very quiet project, or Im happy to take over the maintenance of the project, or very lastly to fork it
Let me know your thoughts
Kindest regards
Phil.
email: [email protected]
When website has a real favicon and removeFaviconTag function tries to remove it, a JS exception is being thrown - this happens because in the loop at line 58 you are trying to access element which was previously removed.
Load up the demo + task manager and watch the memory usage slowly tick up... Wait until the icon finishes animating, then hit F5 and watch the memory usage continuing ticking up, and so on. It's a pretty small impact, but it's there.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.