I am sure these questions and hopefully answers will help a lot of users! The Tizen documentation is difficult to understand at best. The Tizen Studio sample for the BACK BUTTON is for one single index.html page. When the back button is pressed, it only goes to a different < div > on the same "page", not to a different html docs (Example: page1.html, page2.html, page_new.html, page_bart.html, etc.)
I have searched Tizen Forums, Google and Stackoverflow. The closets I have come to an answer is below.
Unfortunately, both questions and answers are from 2015, for version 2.3 AND did not work.
LINK HERE:
Stack overflow Tizen 1
AND HERE:
Stack overflow Tizen 2
Here is what I have:
Tizen Studio 1.2, TAU Web App, Tizen version 2.4, All code is HTML5 with a little java, Everything works...(except for below).
Here is what I need:
When a user is on page10.html (Example, any page) and presses the back button the "tau web app" simply goes back to page9.html. If they press it again, it goes back to page8.html. If they press it again page7, etc..
If the user presses the Menu button, a pop up (like the TIZEN sample app) says, "Do you want to exit the app? with options YES or NO.
If user presses YES the web app (or browser) window closes immediately. If user presses NO the pop-up closes immediately and the user stays on that page.
At the end of my app I have a button that says "The End". When the user clicks this it closes the web app (or browser window) immediately.
THIS REQUEST IS OPTIONAL, but why not...the capabilities are a few code lines away. Currently every page (I have over 100) jumps or cuts from one to the other. I would like to use a page transition (maybe a page slide, can I try others?). Is there a page turn?
PLEASE you Code Wizards! My app is done but I have been stuck trying to get the hardware key buttons to work! I am POSITIVE that other Tizen developers would also appreciate working code for the above issues!
I thank you in advance!
Here is the link to download all the code:
"TIZEN HARDWARE PUZZLE.PDF"
LINK HERE:
Single PDF with lots of TIZEN code
This .pdf shows my current code, some sample code from Tizen and anything I could find online about the TIZEN BACK BUTTON.
There is just one more itty, bitty, tiny request (AN IMPORTANT ONE)......
Can you PLEASE tell me where the code is inserted!?!
For example:
<!-- Put this code anywhere in main.js -->
<script>EXAMPLE</script>
<!-- End -->
or
<!-- Put this code in the Head on EACH page -->
<script>EXAMPLE</script>
<!-- End -->
or
<!-- Put this code in the Body on index.html page -->
<script>EXAMPLE</script>
<!-- End -->
This will HELP EVERYONE who is just starting out like me! We really need to know where to place the code, not just here it is! THANK YOU!
Stackoverflow is THE BEST!!!
====================================
You may use TAU to fulfill the first three requirements of your post's "Here is what I need:" section. It offers a collection of UI components that simplify application coding.
I would like to suggest you to go through the TAUUIComponents sample app in Tizen Studio.
For the first requirement i.e. the pagination thing, you may go through the app.js and try to realize how it's managing the hardware back key event to get back to previous page.
For second one i.e. the pop thing, go through moremenu.js here you'll find code as below:
menukeyHandler = function (ev) {
if( ev.keyName === "menu" ) {
if (morePopup.classList.contains("ui-popup-active")) {
tau.closePopup();
} else {
tau.openPopup("#moremenu");
}
}
};
Now, go through moremenu.html file and modify as below:
<div id="moremenu" class="ui-popup ui-popup-moremenu">
<div class="ui-popup-content">
<div class="ui-popup-content popup-content-padding">
Do you want to exit the app?
</div>
<div class="ui-popup-footer ui-grid-col-2">
<a class="ui-btn" data-rel="back" data-inline="true">Yes</a>
<a class="ui-btn" data-rel="back" data-inline="true">No</a>
</div>
</div>
</div>
I guess, once you've completed above two then you'll be able to complete the 3rd requirement also.
To know more about TAU components you may go through this links:
https://developer.tizen.org/development/api-references/web-application?redirect=/dev-guide/2.4/org.tizen.web.apireference/html/ui_fw_api/Mobile_UIComponents/mobile_component_list.htm
https://developer.tizen.org/development/guides/web-application/user-interface/tizen-advanced-ui/hello-world
Related
I have a FAQ page that reads a Firebase node and lists all the Q & A contents using the below lines of code:
<firebase-auth id="fbLogin" provider="anonymous" location="https://XXX.firebaseio.com"></firebase-auth>
<firebase-collection orderByPriority log id="fbFAQ" location="https://XXX.firebaseio.com/faq" data="{{faqs}}"></firebase-collection>
<template is="dom-repeat" items="[[faqs]]" as="faq">
<div class="forBorder">
<akyral-details id="[[faq.__firebaseKey__]]">
<akyral-summary>[[faq.q]]</akyral-summary>
<p class="answer">[[faq.a]]</p>
</akyral-details>
</div>
</template>
I have a link from mainpage to the FAQ page and upon click it works perfect! However when I go back to main page and then click again for FAQ link the page renders nothing. But if i refresh the page then its fine.
To recreate do the following:
Open https://sizzling-fire-7471.firebaseapp.com/ and click the FAQ page link at bottom . You will see a list of Q & A
Then click left arrow on top to go back to main page
Now click FAQ link again and you will not see anything,but in the console you will see it fetching data. Also, refreshing the page makes it okay
I bet it's a race condition. The firebase-auth and firebase-collection are firing at the same time, causing it to try to fetch the collection before it's authorized. Try wrapping firebase-collection in <template is="dom-if" if="{{fbUser}}"> so it doesn't get stamped until the auth is completed.
This issue has now been resolved. It was due to a bug in firebase-collection. It was fixed at https://github.com/GoogleWebComponents/firebase-element/pull/42/files and will soon be merged.
StumbleUpon publishes a Widget script, and documents how to use it to insert a stumbleUpon button (they call it a badge), into a website.
You can generate the markup for a button with their online tool. It looks like this:
<!-- Place this tag where you want the su badge to render -->
<su:badge layout="2" location="http://example.com"></su:badge>
<!-- Place this snippet wherever appropriate -->
<script type="text/javascript">
(function() {
var li = document.createElement('script');
li.type = 'text/javascript';
li.async = true;
li.src = 'https://platform.stumbleupon.com/1/widgets.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(li, s);
})();
</script>
That script element is just a way to delay-load the widgets.js thing. Just from looking at it, I suppose that it works by scanning the document for the <su:badge> elements and replacing them with iframes. The iframes themselves then get their source content from stumbleupon, at a URL like this: http://badge.stumbleupon.com/badge/embed/4/?url=http%3A%2F%2Fexample.com .
The iframe renders visually like this:
The stumbleupon button is the 2nd one. I show the other ones for comparison.
As you can see, the StumbleUpon rendering looks different than all the other guys. SU makes their button look like a "badge" while every other social share widget looks like...uh.... a button.
I'm trying to make the Stumbleupon widget look like a button. I'm pretty sure this is possible. For example, mashable does it (example). Here's what it looks like:
As you can see, the stumbleupon button looks like a button. It's not a badge. Mashable is not using the su:badge thing - they have rendered their own <a> tag, and styled it.
The visual rendering is not a problem; I can figure out how to make a span look like a button, no problem. The problem happens when I click the tag or span. It appears to me that, with the iframe-thing that StumbleUpon uses, it invokes this URL to submit a page for sharing:
http://www.stumbleupon.com/badge/?url=http%3A//example.com/whatever HTTP/1.1
The iframe uses javascript's window.open to request that, and restricts the resizing and so on. This is how it works on mashable. The resulting window looks like this:
This is also what the mashable page does, though it does not use the iframe. The Mashable page contains javascript that just opens the "stumbleupon submit" window directly from within the main mashable page.
But when I try the same thing from my page, the little fixed window gets a 302 redirect from StumbleUpon, and then another 302, which eventually points it to
http://www.stumbleupon.com/submit/visitor
...which does not allow sharing of the link.
This has been a long story, but:
does anyone have any insight as to how I can convince StumbleUpon to let me share a link or URL, from a button that is not contained within an iframe?
What is mashable's secret?
ok here's what I found.
The 302's that eventually pointed me to /submit/visitor happen when both of the following are true:
the user is not logged in
the article has not been stumbled in stumbleupon previously
When that happens, stumbleupon invites you (the user) to login. It won't take you just to the "submit url" page.
If the user is not logged in, but the article HAS been submitted previously, then it takes you to the submit window without a 302. Eventually you will be asked to login, if you proceed with the submission. But the first view of the stumbleupn website in this case gives you a visual indication that you are submitting something.
If the user is logged in, and the article has not been submitted previously, then you get taken right to the submit page.
So I was doing nothing wrong. I just needed to login the first time. This is just an artifact of the user experience offered by StumbleUpon. In my opinion it's sort of strange. It's surprising and therefore wrong. But that's just my opinion.
I have three camera-based apps (that take still pictures) in the app-store and have got feedback that the UIImagePickerController interface is very slow - and I can't deny that. So, to improve the performance of the app, I started to experiment with the AVCam Demo source code from the WWDC 2010.
Since the AVFoundation framework does not interact with the UI Kit, I have been successful at wrapping a view around the demo. I am able to transition between the view controllers successfully. The only thing that I've modified is replaced the Record button with the Exit button (to exit to the wrapping view controller)
The modified app works fine during the first session (wrapper -> demo) If I exit the demo to the wrapper, and come back to the demo second time , the video frame in the preview layer freezes a second or two after. The app itself does not freeze - just the video is frozen. At this point, all UI buttons are active. But, when I tap "Still" button to capture the image, I get the following error in an alert:
The operation cannot be completed (AVFoundationErrorDomain error - 11800.)
This cannot be duplicated in the original demo code - because you can't close and reopen the session. So, I am wondering if it has anything to do with the way I "exit" from the session in my test. Here's the "exit" action that I added in the demo code:
- (IBAction)exit:(id)sender
{
[[self captureManager] stopRecording];
[self dismissModalViewControllerAnimated:YES];
}
Is this sufficient - or did I miss something?
Regards, Sam.
There's a little problem of cleaning up a capture session in an orderly fashion, as there's some asynchroneous calls with no alerts of when they're done.
Try stopping and releasing as suggested in this question:
How to properly release an AVCaptureSession
(take the solution with most up votes)
If that doesn't help you may need to post some more code here. Are you sure that's all you changed?
Good luck!
Oded.
I'm implementing a search service called SearchInsideOut.
This search service simply replaces web page results by full web pages (Yes, I used iframe).
The problem I have to deal with is iframe-breaking pages.
The promising solution I found is using onbeforeunload to let users decide whether to stay or leave my site.
But this also creates another annoying behavior.
When users click other links in my site, onbeforeunload will also be triggered.
Fortunately, I could solve this case by placing window.onbeforeunload=null in the onclick event of those links of my site.
Unfortunately, I have no idea how to detect external events like clicking "refresh/back" buttons.
What should I do to solve this difficulty?
All suggestions and comments are highly appreciated.
Take as example this site. Try to refresh the page after u typed some text answering to a post. You will see that the page it will ask you to continue ur work or exit. Make another test without answering to a post, just refresh, you will see that the confirm will not showed, because the site is making a test if the "answer" is empty or not.
Example:
<html>
<head>
<script>
function closeIt()
{
var mytext = document.getElementById("mytext").value;
if(mytext != "")
return "Any string value here forces a dialog box to \n" +
"appear before closing the window.";
}
window.onbeforeunload = closeIt;
</script>
</head>
<body>
<textarea id="mytext"></textarea>
</body>
</html>
So it's up to u to decide when the box will show or not. Visit also Microsoft Msdn to understand when and how onbeforeunload works
I am writing an intranet application and am considering the use of a pop up window. I am not worried about accessibility since it's an intranet app.
The scenario is such as I need to be able to have the same code be used in a server page as well as in the middle of a process; which is why I decided when using it in the middle of the process, it's best to have it as a pop up window to running out of the real estate on the screen.
Any thoughts on this? I am hesitant to use a pop up window in such a manner as I usually only use it for error messages.
I don't completely understand what you're trying to do, but I think a popup window might be somewhat of an issue if the user's browser automatically blocks popup windows. Plus, if you were trying to run a process in the popup window, the user could close it and no longer have a way to check on the process.
Would it be possible to use Ajax to call back to a web service that gives the page information about the process? You could give the user a way to make the Ajax call to check on the status of the process or just have it continually polling in the background.
Edit:
You said you weren't too familiar with Ajax. For the most part, there are libraries to handle all the of hard details. I'll recommend jQuery because that's what I've been using for a while now.
If you go the Ajax route you'll be able to contain everything on one page and make the updates you need to make when the Ajax call is successful. Depending on how you write the code, it should be pretty reusable if you do it right. It really depends on how specific the your needs on each page.
Take a look at the jQuery documentation though. It may have what you need already built into it. Otherwise, someone else might be able to suggest some reasons why their favorite JavaScript library works better for what you're trying to do.
I think you might want to do something like this:
Inside of the parent page:
<input id="btnShowModal" runat="server" type="button" value='Show Modal' onclick="ShowModal()" />
function ShowModal()
{
var retVal = window.showModalDialog("MyPopup.aspx?param1=value","","center=yes;dialogWidth=200px;dialogHeight=200px;status:0;help:0")
if(retVal != "" && retVal != undefined)
{
//This code will be executed when the modal popup is closed, retVal will contain the value assigned to window.returnValue
}
}
Inside of the modal popup:
<input id="btnSave" runat="server" type="button" value='Save' onclick="Save()" />
function Save()
{
window.returnValue = "Whatever you want returned to the parent here"
window.close()
}
The usual argument against popup windows is that they are unreliable. The user may have disabled script initiated popups, I know I have.
In a controlled environment, such as an inranet, you may be able to be guaranteed that this is not the case, but even so, why risk it, there is an alternative.
Instead of popping up a new window just insert a new, absolutely positioned <div> into the document and insert your content into that using ajax or even an <iframe>. There are lots of examples/libraries on the web.
Thickbox for jQuery for example. There are of course scripts that don't require libraries.
I generally use a div with a z-index and absolute positioning; the .show() can be written and called on demand, it would have a button to .close(), and AJAX can make it seem modal so it must be clicked to close if you so desire. Then again, I hate messageboxes.
I was trying to avoid AJAX, simply because I have never used and don't have the time frame to learn it now. However, I am not totally opposed to it.
In short what I need to do is for the pop up window interact back with the page. Imagine that on the page I am building the links of the chain. Each link has unique properties. When user clicks on "ADD LINK" button, I was thinking have a pop up window with the little form and a Save button. The only issue with this is that a pop up needs to interact with the page; we need to know when something has been saved or not saved.
A div on the same page is one way. A pop up is yet another way. Another catch is that this code (adding new link) needs to be reusable, because I am also going to have a page that just creates new links.