Giter Club home page Giter Club logo

winjs's Introduction

Windows Library for JavaScript (WinJS)

Join the chat at https://gitter.im/winjs/winjs Build Status

Status

Microsoft is committed to making sure that WinJS continues to run for existing customers. At this time we don't have plans to invest in new features or feature requests. Bug fixes will be limited to correcting substantial issues that are blocking customer deployments. We may also consider bug fixes to help our customers maintain their existing WinJS-based apps.

Intro

WinJS is a set of JavaScript toolkits that allow developers to build applications using HTML/JS/CSS technology forged with the following principles in mind:

  • Provide developers with a distinctive set of UI controls with high polish and performance with fundamental support for touch, mouse, keyboard and accessibility
  • Provide developers with a cohesive set of components and utilities to build the scaffolding and infrastructure of their applications

This is a first step for the WinJS project and there is still a lot of work that needs to be done. Feel free to participate by contributing along the way.

Contribute

There are many ways to contribute to the project.

You can contribute by reviewing and sending feedback on code checkins, suggesting and trying out new features as they are implemented, submitting bugs and helping us verify fixes as they are checked in, as well as submitting code fixes or code contributions of your own.

Note that all code submissions will be rigorously reviewed and tested by the team, and only those that meet an extremely high bar for both quality and design appropriateness will be merged into the source.

Build WinJS

In order to build WinJS, ensure that you have git and Node.js installed.

Clone a copy of the master WinJS git repo:

git clone https://github.com/winjs/winjs.git

Change to the winjs directory:

cd winjs

Install the grunt command-line interface globally:

npm install -g grunt-cli

Grunt dependencies are installed separately in each cloned git repo. Install the dependencies with:

npm install

Run the following and the WinJS JavaScript and CSS files will be put in the bin directory:

grunt

Note: You may need to use sudo (for OSX, *nix, BSD etc) or run your command shell as Administrator (for Windows) to install Grunt globally.

Tests status

Refer to http://winjs.azurewebsites.net/#status for the current status of the unit tests and the list of known issues.

Try WinJS

Check out our online playground at http://winjsdevelop.azurewebsites.net/

Follow Us

Twitter https://twitter.com/BuildWinJS
Facebook https://www.facebook.com/buildwinjs

winjs's People

Contributors

amazingjaze avatar anishchandwani avatar banguero avatar bmullan91 avatar brenopolanski avatar charleswli avatar cthedot avatar cybermerlin avatar ericjimenez avatar gitter-badger avatar granthnk avatar humale avatar jayrenn avatar jdalton avatar jseanxu avatar kanreisa avatar llongley avatar mythilim avatar niallatms avatar nobuoka avatar paulwells avatar payzer avatar pgills avatar ph200 avatar phosphoer avatar pke avatar rigdern avatar ryandemopoulos avatar spankyj avatar xirzec 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  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

winjs's Issues

FlipView: Symbols on buttons do not render on all platforms

Symbols on the FlipView buttons do not render on all platforms:

  • Safari on Mac OS X
  • Safari on iOS
  • Chrome on Android

Expected:
FlipView button symbols render on all platforms

Actual:
FlipView button symbols only render on Windows platforms

grunt test does not work on Mac

@jseanxu is working on a fix for this

sh-3.2# grunt test
Building QUnit test pages...Loading "test.js" tasks...ERROR

Error: ENOENT, no such file or directory './tests/FlipView/..\TestLib\LegacyLiveUnit\commonutils.js'

Base: WinJS.Namespace.define() treats any object with a value property as a data descriptor.

WinJS.Namespace.define() treats any object with a value property as a data descriptor.

To reproduce:

// assuming <input id="submitID" ... /> 
WinJS.Namespace.define("ui", {
  submit : document.getElementById("submitID")
});

Expected:
ui.submit is an HTMLInputElement

Actual:
ui.submit is a string that contains the value of the HTMLInputElement when WinJS.Namespace.define() was called.

Pivot: only last pivot header is shown on IE10

In IE10, when multiple pivot headers are created, only the last pivot header is shown.

(Not sure if IE10 is supported since I tried to find browser compatibility in WinJS documentation, but couldn't find any information regarding this)

Add minification to grunt

Clearly Microsoft has some process for producing minified versions of the JS but this is not part of the published grunt file. That should be added for "release" builds. Same for CSS files.

Tests are a mess

Required HTML files are missing from some folders.
When running "grunt test" the following error message is displayed.

Running "shell:runTests:" (shell) task
'%_NTTREE%' is not recognized as an internal or external command,
operable program or batch file.

Investigating this further, the webunit.exe program is missing from the source. The shell.js task uses the driver _NTTREE env var to figure out where "Corsica/other.2.1.debug/Tools/WebUnit/WebUnit.exe" is located. I'm not familiar with that test runner, but it seems like this could be adapted to use the Chutzpah test runner or QUnit for Node. If I manage to get them running before you do I'll submit a PR. ;)

Pivot: current header is not highlighted

The current header's opacity should be 1 but is not. This is a CSS rule ordering issue, the rule to set the current header's opacity to 1 appears before the rule that sets it to 0.4 and both rules have the same specificity.

This can be fixed by either increasing the specificity of the rule that sets opacity to 1 or fix the ordering of the rules.

Hub: changing orientation of the hub doesn't reset its scroll position

If you scroll a Hub then change its orientation from horizontal to vertical (say in response to a screen rotation) the .win-hub-viewport still has a scrollLeft applied that causes the content to be off-center.

Workaround: manually set hub._viewportElement.scrollLeft = 0 when changing orientation to vertical.

Listview Tabbing Scenarios broken in outside of IE

Tabbing in listview is dependent on the "beforeactivate" event which is only present in IE. The listview tabManager calls preventDefault() on this event to tell the browser to keep looking for an appropriate item to focus, rather than just the first one it would normally move focus to in the document's tab order.

Expected Behavior: Tab key will move focus from the current item inside of the listview, outside of the listview onto the next element that would follow the listview according to the document's tab order.

Actual Behavior: It requires at least two presses of the Tab key (sometimes more depending on the html structure of the item) to move focus off of the current listview item, and then the focus just moves to the next item in the listview instead of the first element outside of the listview.

originally discovered in Chrome

Adding WinJs to Web Page

Hey Guys, i have been trying since morning to add the WinJs library on my web pages, styling is ok, but javascript is not working and don't know why. Any idea?

WinJS.UI.Pages and navigator.js broken unload functionality

Not strictly a WinJS issue but related:
btw: Why isn't navigator.js part of WinJS?

Imagine a page registers a hotkey (using the great mousetrap.js) in its init() handler. It will of course unbind that key in the unload() handler.

So now imagine we have 2 pages, both registering for the same hotkey "f5".

WinJS.UI.Pages.define("page1.hml", {
  init: function() { 
    Mousetrap.bind("f5", function() {});
  }
  unload: function() {
     Mousetrap.unbind("f5");
  }
}

WinJS.UI.Pages.define("page2.hml", {
  init: function() { 
    Mousetrap.bind("f5", function() {});
  }
  unload: function() {
     Mousetrap.unbind("f5");
  }
}

When page2 is active, no hotkey "f5" is registered anymore. Thats due to the way navigator.js calls the unload method of "page1" after everything happened for "page2".The "f5" key registered by "page2" is unbound by page1's unload handler.

Add WinJS to npm.

WinJS currently has a package.json but it's not registered on npm.
Before it does though it should change the name field in the package.json to lowercase winjs (npm restriction).

Publish to a CDN

Ideally for web apps we would point to a CDN. Similarly, for PhoneGap-type apps, we could just grab the latest build from a known location. As-is, each developer has to independently grab source, build it, and deploy the output even if they don't want to make changes to the code.

ListView: groupHeaderPosition: 'left' depends on CSS Grid, which is currently not supported outside of IE

ListView: groupHeaderPosition: 'left' depends on CSS Grid, which is currently not supported outside of IE

Outside of IE (Chrome, FF, Safari...):
-Go to http://try.buildwinjs.com/#listview
-Select the 'Grouped ListView using ListLayout' scenario
-Select the Html tab
-In the Listview configuration, update:
layout: { type: WinJS.UI.ListLayout, groupHeaderPosition: 'top' }
to
layout: { type: WinJS.UI.ListLayout, groupHeaderPosition: 'left' }

expected:
header is shown in the left

actualL
header is shown on top of the group items with some spacing, due to dependency on CSS Grid

Open source try.buildwinjs.com

Let us make improvements to it's examples, features (idea: a JS/TS toggle), and layout (idea: use pivot control instead of tabs) - plus make it easy for us to use it as a testbed when submitting changes to the WinJS library.

WinJS Repeater not rendering in dynamically loaded template

This is on Windows 8.1 Store app specifically.

I have an HTML file, say /templates/tableSection.html:

<!DOCTYPE html>
<html>
  <head>
    <title>Table Section</title>
  </head>
  <body>
    <div data-win-control="WinJS.UI.HubSection" data-win-options="{ header: 'Important Table' }" >
      <h3 data-win-bind="textContent: title"></h3>
      <table>
        <tbody data-win-control="WinJS.UI.Repeater" data-win-bind="winControl.data: listOfThings">
          <tr>
            <td data-win-bind="innerText: name"></td>
            <td data-win-bind="innerText: value"></td>
          </tr>
        </tbody>
      </table>
    </div>
  </body>
</html>

Using winControl.data to bind the item list is in line with the example located here: http://code.msdn.microsoft.com/windowsapps/HTML-Repeater-control-da22d278/sourcecode?fileId=86617&pathId=1418094029

I have js code that loads and renders this template similar to:

var tableTemplate = new WinJS.Binding.Template(null, { href: "/templates/tableSection.html", extractChild: true });

tableTemplate.render({
  title: "Boss Table",
  listOfThings: new WinJS.Binding.List([{ name: "Dave", value: 2 }, { name: "Erika", value: 11 }])
}).then(function(sectionDiv) {
  hub.sections.push(sectionDiv.winControl);
}).done();

The h3 element will properly bind to the title value, but the Repeater will not render at all. Even looking at the element using the dom query selector for the WinJS.UI.Repeater shows that it does not even have a winControl attribute. Do I have a code bug, or is there a bug in the Repeater or Template controls?

NavBar: Does not layout correctly in browsers other than IE

NavBar does not layout correctly on other browsers. This is mainly due to it's reliance on -ms-grid for laying out buttons.

Expected:
NavBar layouts command buttons correctly in all browsers

Actual:
NavBar does not layout buttons correctly in other browsers expect IE

AppBar: AppBar symbols do not render on all platforms

AppBar symbols do not render on all platforms:

  • Safari on Mac OS X
  • Sarfai on iOS
  • Chrome on Android
  • etc.

Expected:
AppBar command button symbols render

Actual:
AppBar command button symbols do not render on platforms other than Windows

Ratings: Stars do not render on all platforms

The start for the Ratings control does not render on all platforms:

  • Safari on Mac OS X
  • Safari on iOS
  • Chrome on Android

Expected:
Ratings stars render on all platforms

Actual:
Ratings stars render only on Windows platform

Does WinJS need a new name?

I brought this up to the devs and they are open to the idea of changing the name if the community really wants it... and if we can find a better name. I'm concerned that people will overlook this awesome library because they think it is just for Windows.

Some ideas:
MicrosoftJS (same kind of branding as Microsoft Azure)
MSJS or MsJs
mJs
ToolkitJS

So I pose this to the community:
What names do you like the most? Have other ideas for names? Or are you happy with the current name?

NavBar: Symbols do not render on all platforms

NavBar symbols do not render on all platforms:

  • Safari on Mac OS X
  • Sarfai on iOS
  • Chrome on Android
  • etc.

Expected:
NavBar command button symbols render

Actual:
NavBar command button symbols do not render on platforms other than Windows

Pivot: Does not work well in all browsers

The Pivot control relies heavily on IE specific features like:

  • Snap-points
  • Scroll limits
  • CSS Grid

This means it does not function well in all browsers outside of IE.

BackButton: symbol does not render on all platforms

The back button symbol does not render on all platforms:

  • Sarfari on Mac
  • Sarfari on iOS
  • Chrome on Android
  • etc.

Expected:
Back button symbol should render correctly on all platforms

Actual:
Back button symbol only renders on Windows platform

Pivot: Pivot without PivotItems renders the control unusable

The Pivot must get its first PIvotItem synchronously after construction, or subsequently added PivotItems do not work properly.

The issue is that the Pivot is never centered after construction if there are no items to load. This causes the first PivotItem added asynchronously to scroll a huge distance, triggering the onScroll handler, causing a loop of flips, rendering the Pivot control unusable.

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.