Coder Social home page Coder Social logo

initial.js's People

Contributors

dv336699 avatar judesfernando avatar kikito avatar tarikozket avatar xuanxu avatar yaroslav-f avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

initial.js's Issues

When data-name is a number the unicode_slice function returns empty string

If the element contains the attribute data-name with only numbers the result of unicode_slice is an empty string on v0.2.0, the v0.1.0 throws the error on substring function and stops the iteration.
Based on some tests on casting strings (http://jsben.ch/#/ghQYR) problably the best way to resolve this is casting with '' for better performance.

Line 63:

var c = unicode_slice('' + settings.name, 0, settings.charCount).toUpperCase();

Internet Explorer support ( Not working)

Hello, thank you for that nice feature :)
I tried it but image still not working in internet explorer ( all versions) i dont know why.

is there other settings to add to get it supported by IE please?

thank you so much

this is my code :

  <script type="text/javascript">
  $(document).ready(function(){
    $('.profile-pic').initial({width:46,height:46,fontSize:20,fontWeight:400});
    $('.initial-logo').initial({width:80,height:80});
  })
  </script>

<img class="profile-pic media-object pull-left img-circle" data-name="Joe">

i get ( X ) in the place of image when its IE

Thank you

Adding custom font

First of all thankyou so much for the great plugin.

I tried to add custom downloaded font from google font ( Hind Silguri ) and its not updating.

How to implement custom font in the js? I tried to modify the js itself but its not working.

can you please help?

Validation errors

When validates a page using initial js with W3C Validator, appears one error validation in each image:

  • Element img is missing required attribute src: in the generated html appears src="data:image/svg+xml;base6..." but it's seem it's not valid.

😊 Thank you!

Unicode strings throw an error

Right now initial.js uses string.substr, which is non-unicode aware.

This means that unicode names (for example, "πŸ˜ΈπŸ‘πŸ’ƒπŸ»") throw an exception. (the result of string.substr is "")

There is unicode-substring for making substrings. Maybe it could be used to calculate the substrings correctly.

At the very least, unicode should not throw an error.

PS: In case it is useful, I also found this polyfill which implements String.prototype.at which is an ECS6 unicode-aware version of charAt

Tag latest version

Could you please do:

$ git tag v0.1.0
$ git push -t

On this repo so things like bower and rails-assets can pick the version number?

Thanks!

Same letter different colors

Hi,
it seems to me the plugin is designed to give same letter the same color, although it is a different username. I think it's better to make the color dependent on something else than the first letter - same color of two different initials can cause no confusion, but what can cause confusing the users is the same color of the same letter.
I propose (made this for myself as a workaround) changing around line 76
this:

var colorIndex = Math.floor((c.charCodeAt(0) + settings.seed) % colors.length);
to something like this:
var colorIndex = Math.floor((settings.name.charCodeAt(1) + settings.name.charCodeAt(3) + settings.seed) % colors.length);

Radius option not working

CSS border-radius property cannot be applied to svg images. So the radius option is ignored and the output is always a rectangle.

Not working on IE

Tested it with IE9 and IE10 on Windows 8.1, unfortunately it's not working.

initialjs-ie-test

Microsoft Edge resize image issue

Hi there,

It seems if I try to add a class to the image and set the css to width:25px the image resizes but the text is not centered

I believe it could be an issue with Edge text-anchor="middle"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.