Skip to content

WinJS library to make windows 8 toast notifications simple and easy

Notifications You must be signed in to change notification settings

Tboda/YeahToast

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

YeahToast - Simple WinJS Toast Notification Wrapper

WinJS Supported Templates Catalog

Example Usage

Title + Description

YeahToast.show({ title: "YEAHTOAST!" });
YeahToast.show({ title: "YEAHTOAST!", textContent: "message goes here" });
YeahToast.show({ title: "YEAHTOAST!", textContent: "message goes here", textContent2: "message line 2" });
YeahToast.show({ imgsrc: "images/placeholder.png", title: "This one has an image!", textContent: "something something" });

Example1 Example2

Scheduling Background Notifications

var now = new Date().getTime();
var later = new Date(now + 60000); // 60 seconds

// save a reference to the notification so you can cancel it later
var notification = YeahToast.schedule({ title: "YEAHTOAST", textContent: "message goes here", due: later });

Canceling Background Notifications

YeahToast.cancel(notification.id); 

Events

function toastActivated(e){
  var dialog = new Windows.UI.Popups.MessageDialog("User clicked on the toast!");
  dialog.showAsync();
}

function toastDismissed(e){
  var dialog = new Windows.UI.Popups.MessageDialog("Toast was dismissed!");
  dialog.showAsync();
}

function toastFailed(e){
  var dialog = new Windows.UI.Popups.MessageDialog("Toast failed to show!");
  dialog.showAsync();
}

YeahToast.show({ title: "YEAHTOAST!", onactivated: toastActivated, ondismissed: toastDismissed, onfailed: toastFailed});

See http://msdn.microsoft.com/en-us/library/windows/apps/br208641.aspx for dismissal reasons.

YeahToast inspiration!

About

WinJS library to make windows 8 toast notifications simple and easy

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •