Skip to content

Instantly share code, notes, and snippets.

@chantalgo
chantalgo / _back_button.md
Created May 25, 2013 01:36
Back button navigation

#Back button

A dedicated button that enables traversal backward through the navigation stack history. Each page can host a back button that remains hidden until you navigate to that page from another, whereupon the back button becomes visible on the page.

The BackButton checks the navigation stack to determine whether the user can navigate backwards. If there is nothing to navigate back to, the button is not displayed. When the user clicks the button or uses keyboard shortcuts (such as Alt+Left or the browserBack keys), the back function is called and the previous page in the navigation stack is loaded. You don't have to write any code.

@chantalgo
chantalgo / navwinjs.md
Last active December 17, 2015 17:39
About Navigation in WinJS

Page Navigation

A hyperlink to page2.html

a href="/pages/page2/page2.html"

Direct Hyperlink

Page control Navigation

@chantalgo
chantalgo / winjs.js
Created May 25, 2013 00:46
Default JS in WinJS
/*
args.detail.kind : shows the way the app was activated- value comes from the Windows.ApplicationModel.Activation.- ActivationKind enumeration.
== launch : when it comes from the Start screen
Windows.ApplicationMode.- Activation.ApplicationExecutionState enumeration tells the app how it was last running.
*/
// Note (function () { … })(); module pattern
(function (){
"use strict";
@chantalgo
chantalgo / dataheaderMenu.js
Created May 25, 2013 00:45
Adding a menu in WinJS.UI.Menu
// Within page definition
// Populate the menu under the title
populateMenu: function (){
var menu = document.getElementById('headerMenu').winControl;
for (var i = 0; i < Kippt.lists.meta.total_count; i++) {
var list = Kippt.lists.objects[i];
var mc = new WinJS.UI.MenuCommand(null, {
id: list.id, label: list.title, extraClass: 'caller', onclick: function () {
nav.navigate("/pages/groupDetail/groupDetail.html", { groupKey:this.id });}});
menu._addCommand(mc);
@chantalgo
chantalgo / runjsfiddlefromgist.md
Created May 24, 2013 20:21
Use JSFiddle to show github gists

Run in jsFiddle

One need to choose the framework and the Gist id using the URL:

URL: http://jsfiddle.net/gh/gist/{framework}/{version}/{gist_id}/

Use library/pure for no framework:

URL: http://jsfiddle.net/gh/gist/library/pure/{gist_id}/

@chantalgo
chantalgo / remoterepo.md
Created May 19, 2013 01:09 — forked from CristinaSolana/gist:1885435
Work with repositories remotely

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
<!DOCTYPE html>
<html>
<head>
<title>Template</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<h1>Hello, world!</h1>
<script src="http://code.jquery.com/jquery.js"></script>
</body>
@chantalgo
chantalgo / HTML5: template barebones
Created February 13, 2013 05:52
HTML: Barebones HTML5 template
<!DOCTYPE html>
<head>
<title></title>
</head>
<body>
</body>
</html>