-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
beta1
- Loading branch information
KuoKongQingYun
committed
Jan 5, 2015
1 parent
dd4cbbc
commit 667db64
Showing
7 changed files
with
123 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
(function() | ||
{ | ||
"use strict"; | ||
/* | ||
hook up event handlers | ||
*/ | ||
function register_event_handlers() | ||
{ | ||
|
||
|
||
/* button 咔嚓 */ | ||
$(document).on("click", ".uib_w_2", function(evt) | ||
{ | ||
intel.xdk.camera.takePicture(80,false,"jpg"); | ||
/* your code goes here */ | ||
}); | ||
|
||
/* button 复制到剪切板 */ | ||
$(document).on("click", ".uib_w_6", function(evt) | ||
{ | ||
intel.xdk.device.copyToClipboard($["#URL"].html()); | ||
alert("已复制到剪切板"); | ||
/* your code goes here */ | ||
}); | ||
|
||
} | ||
document.addEventListener("app.Ready", register_event_handlers, false); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
|
||
function activate_subpage(sel, have_state) | ||
{ | ||
var $dn = $(sel); | ||
$dn.parents(".upage").find(".upage-content").addClass("hidden"); | ||
$dn.removeClass("hidden"); | ||
var parent_sel = "#" + $dn.parents(".upage").attr("id"); | ||
var parent_vis = $(parent_sel).is(":visible"); | ||
if(parent_vis) | ||
{ | ||
$(document).trigger("pagechange"); | ||
if(!have_state){ window.history.pushState({usubpage:sel}, sel, document.location.origin + document.location.pathname + "#" +sel); } | ||
} | ||
else | ||
{ | ||
//now activate parent page | ||
activate_page(parent_sel); | ||
window.history.replaceState({usubpage:sel}, sel, document.location.origin + document.location.pathname + "#" + sel); | ||
} | ||
} | ||
|
||
|
||
/* this function not used by jQueryMobile or Intel App Framework */ | ||
function activate_page(sel, have_state) | ||
{ | ||
var $dn = $(sel); | ||
var is_vis = $dn.is(":visible"); | ||
if(!is_vis) | ||
{ | ||
$dn.parents("body").find(".upage").addClass("hidden"); | ||
$dn.removeClass("hidden"); | ||
|
||
if(!have_state){ window.history.pushState({upage:sel}, sel, document.location.origin + document.location.pathname +sel); } | ||
} | ||
$(document).trigger("pagechange"); | ||
} | ||
|
||
|
||
|
||
|
||
window.onpopstate = function(event) | ||
{ | ||
//console.log("onpopstate location: " + document.location + ", state: " + JSON.stringify(event.state), ", length:", window.history.length); | ||
if(event.state) | ||
{ | ||
if(event.state.usubpage){ activate_subpage(event.state.usubpage, true); } | ||
else if(event.state.upage){ activate_page(event.state.upage, true); } | ||
} | ||
}; | ||
|
||
|
||
$(document).ready(function(){ setTimeout(function(){ var sel = "#mainsub"; window.history.pushState({usubpage:sel}, sel, document.location.origin + document.location.pathname + "#" + sel); }, 300); }); |