Works codeReader object In the new version of smartface? I have two object on the page. Image and codereader. On load image throws alert but on load codereader not
function Page1_CodeReader1_OnShow(e){
alert("works!");
}
function Page1_Image1_OnShow(e){
alert("works!");
}
In the new version of Smartface(4.5.0), there is plugin support.
And codereader is no more a ui object, it is a plugin. The one you are trying is the ui codereader object which is not supported anymore.
You can check the below document for more information:
http://www.smartface.io/developer/guides/plugins/codereader/
Related
I am working on a plugin that launches a WebView to carry out some auth verification. Using the webview_flutter plugin, it works fine on Android and iOS once I call the runJavascriptReturningResult function. It returns the document.getElementById('return').innerText and then I parse the result. But on Flutter web, the webview_flutter_web does not currently support runJavascriptReturningResult, so it throws a platform error once invoked.
I tried using an HTML Popup, but I don't know how to extract the return data before the popup closes.
My implementation for the popup is like this:
html.WindowBase _popup = html.window.open(url, name,'left=100,top=100,width=800,height=600');
if (_popup.closed!) {
throw("Popups blocked");
}
How do I get the return data before the popup closes? Is there another way to do this on Flutter Web?
Maybe listening beforeunload event on the new window and getting the return value before it closes.
The solution was to listen to onMessage. Then get the event data from it.
html.window.open(url!, 'new tab');
html.window.onMessage.listen((event) async {
log(event.data.toString()); // Prints out the Message
});
I am trying to migrate from tinymce version 4.1.9 to latest tinymce version 4.3.12. I have a custom button which fires an event and simultaneously toggle (change the image of the button). It works fine with earlier versions of tinymce (all versions of 3.x and 4.1.2) but now giving an error message in tinymce 4.3.12.
Error message is: Uncaught TypeError: self.addClass is not a function in chrome debug console.
I have checked the latest documentation and which clearly shows .addClass is part of the library (tinymce.dom.DOMUtils class).
See below part of the code I am using:
tinymce.init({
setup: function (ed) {
ed.addButton('autosave', {
image: '/images/autosave_disk_off.png',
cmd: 'autosave',
selectable: true,
onClick: toggleAutoSave,
onPostRender: function() {
var self = this;
self.addClass('classAutosave');
ed.on('autosaveStateChanged', function(e) {
self.active(e.state);
});
}});
}
});
I want to add a class to current element so that image switching can be done.
Can someone help to understand the reason why this code is not working in tinymce 4.3.12?
Is there alternate way to add class in onPostRender?
Thanks
I sort of figured out the reason, what I have done is that compared the code of tinymce.js version 3.1.10 and tinymce.js version 3.2.0. I chose 3.1.10 because this is the last version in which my addClass() works. This is breaking in and after from 3.2.0.
While comparing, I found a lot of code changes has been done for addClass() and removeClass() API's. I also found that internally tinymce is using self.classes.add('classAutosave') to add new class. So I tried the same way in my plug-in and it works. So far, I haven't found any documentation mentioning this change. I am still checking in tinymce forums probably I will open a ticket with tinymce dev. Will update answer if any new info arrives.
Observation:
Use self.classes.add('classAutosave') instead of self.addclass('classAutosave')for adding new class with tinymce 3.20 -> tinymce 4.3.12.
After seeing #catherinelagoon's post I also having difficulty in quite understand how to replace an object using a button so is it possible to create a button which when pressed it replaces an existing object on the screen to another object in Smartface App Studio?
I tried using the answer provided in the post however I couldn't understand it much due to I'm a beginner in using Smartface App Studio and coding itself.
Thankyou and sorry for any inconvienience
After you create an image you should add it to a Page so it can show on that page. So here is a simple code for creating and showing an image on the page.
var image = new SMF.UI.Image({
visible: false
});
Pages.Page1.add(image);
function Page1_TextButton1_OnPressed(e) {
image.visible = true;
}
I am using .Net and Monodroid to develop Android applications, however I seem to have hit a wall when it comes to filling in a Spinner at run time, as I do not have access to the [Spinner Object].SetAdapter(...) method. I have been to both
developer.android.com/resources/tutorials/views/hello-spinner.html
and
android.xamarin.com/Tutorials
as well as
stackoverflow.com/questions/3958866/how-to-change-the-contents-of-spinner-on-run-time-in-android
and everything relies on this method. Is this a limitation of the unregistered version? Because they do not say anything about feature-limits here android.xamarin.com/DownloadTrial
Any help will be appreciated.
In Mono for Android, many cases where Java will have getXXXX/setXXXX methods get translated into properties named XXXX, in order to be more .NET friendly. In this case, Spinner.setAdapter() in Java becomes Spinner.Adapter in Mono for Android:
Spinner spinner = FindViewById<Spinner> (Resource.Id.spinner);
spinner.Adapter = new ArrayAdapter...
Xamarin also has a Spinner tutorial available here that might help you get going.
Solved it - there is an Adapter property that can be used to access the Adapter.
Also it turns out you must check if the adapter is null first - you cannot read a null object :)
if (_itemlist.Adapter == null)
{
adapter = new ArrayAdapter(this, Android.Resource.Layout.SimpleSpinnerItem, items);
}
the only problem is that it does not automatically refresh and the invalidate(...) method does not cause it to redraw with the new items...
I have a mobile website running jQuery Mobile 1.0a2 and I'm currently testing in Mobile Safari for Firmware 4.1 via the iPhone Simulator.
I cannot seem to bind to the load event for an image.
I have a simple gallery of thumbnails and a large image. When you click on a thumbnail it changes the src attribute of the main img
The js for that uses the live('click' method to bind and it works just fine.
$('.gallery-navigation img').live('click',function() {
// change source of main image to new
$.mobile.pageLoading(); // show jquerymobile loading message
});
My problem is that I need feedback on this click, so I wanted to show a loading message (provided by jquerymobile) and then hide it once the image loads.
Where #gallery_image_large is the actual <img> where the src is changing, I tried the following:
$("#gallery_image_large").bind("load", function () {
$.mobile.pageLoading(true); // hide jquerymobile loading message
});
This works in Safari on my desktop but does not in the iPhone Simulator mentioned above.
For reference:
jQuery Mobile Loading Message Methods
UPDATE: I am experimenting with JQuery Image load fails on MobiOne iPhone simulator, which explains how to implement the .load manually by "checking .complete".
I changed the structure of my jquery and it's seemed to have fixed it!
$('#gallery_image_large').one('load',function() {
try { // a grade
$.mobile.pageLoading(true);
} catch(err) { // low grade
}
}).attr('src',full_src);
(as you can see, I opt'd for a try { .. } catch { .. } to verify jquerymobile is available.
Although I didn't use the solution (directly) from JQuery Image load fails on MobiOne iPhone simulator, the manual firing of load via .complete is probably a good solution for anyone else out there!