GithubHelp home page GithubHelp logo

uranium's Introduction

Uranium

Overview

Uranium is a simple Javascript interaction library written in jQuery. It's meant to be...

  • Lightweight
  • Declarative
  • Interface Focused

That's it!

If given the choice between easy to use and powerful, ease of use is the greater goal.

View the website for more details and demos.


Easy to Use

Uranium requires ZERO programming on your part.

Uranium adopts the 'declarative' Javascript style. Because of this, you can use the interactions just by editing your HTML and CSS, without touching a single line of Javascript.

What is declarative Javascript?

Declarative Javascript is a model that looks for how html elements are formatted to construct all the necessary js magic to make those elements come to life.


Uranium is not ...

...designed for executing logic or site functions

The declarative Javascript in Uranium is not designed for performing functions, but for enabling interactions. It's a bad idea to add attributes to an element to perform some Javascript logic. This is exactly why onclicks should be avoided. If you want to execute site logic or perform functions, that's what events / listeners / callbacks are for. The declarative approach promoted by Uranium makes the view (your UI/UX) rely on the model (your HTML).

But I need to do x/y/z functions that Uranium doesn't handle !

You're in luck! Uranium is designed to work with jQuery – which (we think) provides a great set of convenient Javascript functions along with some very useful cross-browser compatibility features. With this in mind, using Uranium gives you the best of both worlds – its primary purpose is to make it easy to add great interaction – but if you need to do something fancy, it makes sure the tools you need to do so concisely are also available.


Building Uranium

If you're contributing to the code base, you need to test your changes and update the bundled Javascript.

Bundling

Bundling uses fusion to bundle the Javascript. This means you have to install the fusion ruby gem before you can run the build process. To perform the default build from inside your local copy of the Uranium repository, just do:

	gem install fusion
cd build
rake

This will read in the full Javascript source in the lib/jquery.uranium.js file, and place both full-source and minified copies of Uranium in build/src/.

Testing

You need to go through all of the test cases in the /examples/index.html file and make sure that all the interactions still work. Of course, if you've added functionality, or a new interaction, you need to make a test example for your new cases as well and make sure those pass. It should be an example file that can be shown on the website.


Building an Interaction

Fork Uranium. Build your interaction. Issue a Pull Request. Revel in glory.

If you're contributing to the code base, you need to test your changes and update the bundled Javascript.

Technical

First, run:

sass --watch examples/scss:examples/css --line-comments

to compile your Sass files. Then, in a separate terminal process, start the jekyll server with:

jekyll serve --watch

You will be able to navigate to localhost:4000 to see the examples running in your browser.

Documentation

You'll need to generate a .html file demonstrating the use of your new interaction. It goes in the examples folder, and should do the following things

  • Provide documentation of all the attributes, CSS, and JS required to make the interaction go.
  • At least one example of how the interaction can be used.

Important Note

If there are two versions of jQuery on a page, Uranium will break. To avoid this, try to only use 1 instance of jQuery. If that is not possible, you will need to use jQuery.noConflict() on both instances.


Future Wishlist

Uranium is an ongoing project and we're constantly looking to add useful features (that are within the scope of the ideals above).

Additional features to current interactions:

  • Carousel: "Stop autoscroll" button
  • Carousel: Auto-populate clones on infinite scroll when container is larger than actual items
  • Geocode: Entering zipcode should find address
  • Toggler: Pass height for CSS animation tie-ins

New interactions:

  • Validation interaction for form inputs

MIT License

Copyright (C) 2011-2013 by Moov Corporation (aka Moovweb)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

uranium's People

Contributors

alkzoupas avatar benbayard avatar cgbuen avatar cin210 avatar hamptonmakes avatar jbussdieker avatar kwliou avatar letrest avatar malrase avatar mdavidgreen avatar moovchris avatar sammerry avatar sjezewski avatar wonja 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

Watchers

 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

uranium's Issues

Unique ID syntax bug

The unique ID syntax example on the toggler page shows the bug. Initially the state is getting set to undefined. I think this is because of how I refactored the searching function for the widgets (I think it may assume that each widget set has a 'data-ur-set' component)

Tooltip Widget

When you focus on an input field, a tooltip will appear above the field with instruction text. Essentially like placeholder text that would still be viewable while the input is in focus.

Geolocation needs error callback

There is currently a "data-ur-callback", but the callback only gets executed when the location is found successfully. There needs to be a new and separate "data-ur-error-callback" so that there is a callback executed when the geolocation widget runs into an error state. This will allow the caller to determine that an error has occured and implement its own behavior on the front end.

Now that there is a site, is readme.md out of date?

Should we remove the content (except for the license, of course), leaving only a link to the site? Should the new readme.md be a ToC of the various parts of the website? Should we leave it as is?

Just asking the questions...

Carousel should allow vertical scrolling when not swiping

For gestures inside the carousel, there should be some logic to determine whether the user is trying to swipe horizontally or scroll vertically. Only one action should be performed: either a carousel swipe (with a lock on vertical scrolling) or a vertical scroll (with a lock on carousel swipe).

I believe the current carousel does not allow vertical scrolling inside the carousel, and carousel we use on vitacost (swipe-toggle?) does not lock gestures, so a single gesture usually results in both a carousel swipe and vertical scroll. I don't think these are natural carousel behaviors.

Carousel - Button bug

If you click the buttons too quickly (before the animation has completed), it screws up the offset. Easy enough to fix, just a reminder for me to do so.

Zoom Preview - need a loading indicator

When you tap the thumbnail on a 3G connection, the zoom feature appears to do nothing. I assume it's downloading the bigger image used for the zoomed-in visual. There needs to be immediate ("loading...") feedback given to the user so that they know something's happening.

Create a Swipe Toggle Widget Page

Should go here /widgets/swipe_toggle.html

Pretty Please...

  • Include detailed documentation on the carousel functionality
  • Update examples to get them functioning
  • Provide links to examples in the wild

UraniumJS not working in IE

I found that using uraniumjs in ie doesn't work.
I then found the special internet explorer version but still that is not working.

I'm working on a website for a friend of mine and i'm using the carousel from uranium.
I have included the windows version of uranium if the browser is ie, else i'm loading the normal uranium.

BTW the version of IE we are using at the moment is IE8, and the pages in which the carousel is used are the photography pages.
Did anybody experience this as well, or does someone know a solution?

Sam's Carousel

When Sam's carousels are fully functional, need to add them to the Uranium docs

Easily Clear Input Fields

When the user starts entering text in an input field, an (X) appears on the right hand side and if I tap the (X) it will clear all the text in the field.

This is usually implemented in the native apps, it will be a great addition in enhancing the user experience layer in our web apps.

CSS Animations

Don't really play nice with the toggler. Well -- I can animate in one direction, but I can't in the other direction without some glitchiness. What we need is another state that signals a 'state-change' -- I want to think about this for a bit before I do anything, as I feel like theres a simpler answer. For now, transitions suffice.

Create a Flex Table page

Pretty Please...

  • Include detailed documentation on the carousel functionality
  • Update examples to get them functioning
  • Provide links to examples in the wild

Carousel infinite scrolling doesn't clone child elements

Whenever there are child elements of a carousel item, they don't get cloned for the infinite scroller, only the containing element gets cloned.

This is what happens:

<div data-ur-carousel-component="item" data-ur-clone="1" data-ur-state="inactive"></div>
<div data-ur-carousel-component="item" data-ur-clone="2" data-ur-state="inactive"></div>
<div data-ur-carousel-component="item"  data-ur-state="active">
    <a href="#" >
        <img alt="" src="#">
    </a>        
</div>
<div data-ur-carousel-component="item"  data-ur-state="inactive">
    <a href="#" >
        <img alt="" src="#">
    </a>        
</div>
<div data-ur-carousel-component="item" data-ur-clone="1" data-ur-state="inactive"></div>
<div data-ur-carousel-component="item" data-ur-clone="2" data-ur-state="inactive"></div>

Should be:

<div data-ur-carousel-component="item" data-ur-clone="1"  data-ur-state="inactive">
    <a href="#" >
        <img alt="" src="#">
    </a>        
</div>
<div data-ur-carousel-component="item" data-ur-clone="2" data-ur-state="inactive">
    <a href="#" >
        <img alt="" src="#">
    </a>        
</div>
<div data-ur-carousel-component="item"  data-ur-state="active">
    <a href="#" >
        <img alt="" src="#">
    </a>        
</div>
<div data-ur-carousel-component="item"  data-ur-state="inactive">
    <a href="#" >
        <img alt="" src="#">
    </a>        
</div>
<div data-ur-carousel-component="item" data-ur-clone="1"  data-ur-state="inactive">
    <a href="#" >
        <img alt="" src="#">
    </a>        
</div>
<div data-ur-carousel-component="item" data-ur-clone="2" data-ur-state="inactive">
    <a href="#" >
        <img alt="" src="#">
    </a>        
</div>

The display of the slider's last item leaves the rest of the container empty

A slider container should always be filled with items (there should not be any empty spots unless there aren't enough to fill it). The Uranium slider will continue moving items over (not in infinite mode) until the last item is the only thing remaining in the container...leaving all the other container positions empty. Recreate by hitting next on the demo slider until you are at position 8...only one item will be on the screen as opposed to an expected 3 items.

I understand that this adds complexity, but as is, it is not a very good user experience to not see as many items as possible at all times. I also understand that you state that this slider is not for everyone...but that doesn't mean that it shouldn't cover the basics of a slider.

I'm willing to put some work into this, but I'd appreciate the maintainers of this project chiming in before I proceed. (I'm sure this isn't news to you and that you've put in some thought into this)

late load

Possible race condition:

I've late-loaded several javascript libraries: jquery => lightbox => main.js they are dependent on each other in that they must be run in that order.

I keep refreshing the page and my site only functions half the time, the other half I get an error Uncaught ReferenceError: $ is not defined. It seems jQuery hasn't been parsed (or finished) before my main.js script is parsed. I'm using unminified jQuery at 76kB and my main.js is only 400B.

I have a screenshot but github won't let me attach :(

Carousel Breaks due to old android flag and missing data-ur-android3d attribute

The carousel will break all Uranium if the old Android flag is set to true (eg the device is android 1.x or 2.x) and the carousel does not have the data-ur-android3d attribute. Either a default value should be set by Uranium if that attribute is not present, or the documentation should state that it is a required attribute.

Carousel Widget Example Page

Include the HTML/CSS for each example on the page. Because of the complexity of the carousel, this will make it easier when someone is looking to implement their item.

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.