winjs

Webview: Bing Map tiles appear to be blurred compared to Google Maps ones

早过忘川 提交于 2019-12-11 09:57:47
问题 I'm doing a bit of a POC for the WP8.1 application written in HTML5/JS that includes the maps in the webviews. Scenario: I have 2 webviews with exactly the same HTML structure I'm referring the webviews to. In one webview I'm loading the bing.html that loads the bing maps. In other webview I'm loading the google maps map via the google.html. bing.html and google.html have the same HTML structure and that is: Bing.html <!DOCTYPE html> <html style="width:100%; height:100%; overflow:hidden;

WinJS.UI.ListView horizontal

江枫思渺然 提交于 2019-12-11 09:57:31
问题 Have a few items and want to display them horizontally and need them to wrap to next line when not enough space. <div class="historyItem"> <div id="testTemplate" data-win-control="WinJS.Binding.Template" style="display:none"> <div class="itemTemp"> <h6 data-win-bind="innerText: desc"></h6> </div> </div> </div> <div id="listViewForecast" data-win-control="WinJS.UI.ListView" data-win-options="{itemTemplate:testTemplate, selectionMode: 'none', tapBehavior: 'none', swipeBehavior:'none', layout:

Iterate over array of WinJS Promises and break if one completed successful

白昼怎懂夜的黑 提交于 2019-12-11 06:39:40
问题 I have 3 WinJS Promises that I want to call sequentially until one completes without an error. Pseudo code: var promises = [promise1,promise2,promise3]; promises.each (promise) promise.then (result) return result Of course, I cannot use .each on the array as this would execute the promises in parallel. So first the iteration should be sequential and if the promise returns with an error the next promise should be tried, otherwise it should return the value of the successful promise. If no

Removing an item from a WinJS.Binding.List

旧街凉风 提交于 2019-12-11 05:08:18
问题 I looked at the Controls_ListViewWorkingWithDataSources MSDN sample to see how to remove an item from a WinJS.Binding.List and here's their solution. Please tell me there's an easier way. if (list2.selection.count() > 0) { list2.selection.getItems().done(function (items) { //Sort the selection to ensure its in index order items.sort(function CompareForSort(item1, item2) { var first = item1.index, second = item2.index; if (first === second) { return 0; } else if (first < second) { return -1; }

WinJS SQLite runAsync all before doing something else

别说谁变了你拦得住时间么 提交于 2019-12-11 04:29:53
问题 I have a collection of INSERT statements that gets run within a SQLite async method: SQLite3JS.openAsync(path).then(function (db) { $.each(sql, function (idx, item) { return db.runAsync(item).done(function complete(xhr) { var i = 0; }); }); }); I want the collection to be inserted, then do something after this has completed successfully. I tried to follow through on then() promises, but they all get called before the db.runAsync() gets fired. Is there a clean way to do this? Basically, I have

WinJS AutoSuggestBox doesn't render properly

我们两清 提交于 2019-12-11 04:24:15
问题 I am using the WinJS.UI.AutoSuggestBox from the first example on this link: http://try.buildwinjs.com/#searchbox:simplelist1 I copied the exact same code to make sure I was not making any mistakes on my part, but it still doesn't render correctly. I have no idea what the problem might be. PS: the Data.animeList is a namespace defined on the default.js, it works correctly and I've been using it on other pages. It is an array of strings, just like the one on the example mentioned above. Using

Restarting Windows Store Apps programmatically

萝らか妹 提交于 2019-12-11 03:47:36
问题 I know that one can use MSApp.terminateApp to kill the application. What about restarting an app? Is there any command for restarting? 回答1: Restarting does not fit within the Windows 8 Application concept (formerly metro). If you get into an unrecoverable state then the appropriate thing to do is let it crash and let windows handle it from there. From here: App crash Apps are required to follow the system crash experience, which is to simply return to the Start screen. The system crash

Push Notification Background Task Crashes Windows Phone 8.1 Emulator/Device

前提是你 提交于 2019-12-11 03:46:06
问题 Has anyone else had problems running the push notification background task sample (Javascript) on the WP 8.1 emulator? Sample link is here. When I run the sample app, register the background task, then send a raw notification via the notification simulator, the entire emulator crashes. See images below: I'm wondering if anyone else has experienced this issue, or knows how to fix it. Maybe I'm doing something wrong, but it seems that an official sample application should work out of the box...

Databinding with WinJS as powerful as with knockout?

孤者浪人 提交于 2019-12-11 00:23:00
问题 I have recently started to develop Win8 apps with HTML/CSS/JS. After 2 weeks a question regarding databinding with WinJS arose: Is it possible to perform databindings via WinJS as powerful as with e.g. knockout.js(Can WinJS do all the things knockout can)? If so, how would I perform an ko.applyBindings() from knockout with just WinJS? 回答1: While "as powerful" is quite subjective, WinJS has a very capable binding engine. It's not the same, but shares some characteristics with Knockout. It's

Sending a mail from WinJS

余生长醉 提交于 2019-12-10 22:36:17
问题 I have the following code in a standard Windows 8 Javascript Store App: var test = document.getElementById("testButton"); test.addEventListener("click", function () { var mailto = new Windows.Foundation.Uri("mailto:?to=my.address@here.com" + "&subject=test" + "&body=Hello,<br>How are you?"); Windows.System.Launcher.launchUriAsync(mailto); The problem I have is that no matter what I do, I can't get a carriage return between Hello, and How are you? . I've tried \n & \r\n . What do I need to