Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 17    Views: 52

Moto110
Aspiring developer
Profile
Posts: 205
Reg: Jul 26, 2011
Orlando, FL
8,700
02/21/14 08:45 AM (10 years ago)

HTML Pro plugin - Can I disable the ability to select text and images?

I am using the HTML Pro plugin and would like to disable the ability for app users to select text and images. I tried turning on "disable all interaction" in the "Document Behavior" section, but that did exactly what it said and disabled all interaction. I plan to use this app on iOS and Android so a solution in either the JSON or at the control panel level is preferred. However, I am open to modifying the source code if needed. Thanks, Wayne
 
@rob
Code is Art
Profile
Posts: 115
Reg: Dec 10, 2013
Alabama
8,800
like
02/21/14 11:23 AM (10 years ago)
Although it is not a Control Panel option I imagine you can via manually editing your JSON...@chris1 can tell you for sure or you can just give it a try by adding this: "dataDetectorType":"0" EDIT:sorry disregard I did not read your entire post before responding
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
02/21/14 12:24 PM (10 years ago)
Hi @Moto110, could you clarify what you mean by "disable the ability for app users to select text and images" please? Cheers, Alan
 
Moto110
Aspiring developer
Profile
Posts: 205
Reg: Jul 26, 2011
Orlando, FL
8,700
like
02/21/14 01:02 PM (10 years ago)
In my app if I touch and hold text or an image on any of the HTML Pro screens I get the option to "select" or "copy" that text or image. However, on something like a list menu screen touching and holding the text does nothing. I want that same functionality in the HTML Pro screens. Does that make sense?
 
@rob
Code is Art
Profile
Posts: 115
Reg: Dec 10, 2013
Alabama
8,800
like
02/21/14 01:05 PM (10 years ago)
That is the expected result in an HTML document....your menu item is not HTML, thats why it does not behave the same
 
Moto110
Aspiring developer
Profile
Posts: 205
Reg: Jul 26, 2011
Orlando, FL
8,700
like
02/21/14 01:11 PM (10 years ago)
I am trying to find out if there is a way to make it not behave like and HTML doc and more like the other screen types. I have found a few java scripts that I tried putting into my HTML code that are supposed to disable text and image selection, but they don't seem to work on mobile browsers.
 
@rob
Code is Art
Profile
Posts: 115
Reg: Dec 10, 2013
Alabama
8,800
like
02/21/14 01:14 PM (10 years ago)
There are some solutions....what is your main concern? Do you not want your user to be able to download copyrighted or proprietary images or do you just not like the look/feel of the user getting prompted to download the images
 
Moto110
Aspiring developer
Profile
Posts: 205
Reg: Jul 26, 2011
Orlando, FL
8,700
like
02/21/14 01:18 PM (10 years ago)
I don't like the look/feel of the user getting prompted to download the images or prompted to select the text. I think it will make for a better user experience without those menus popping up if they touch and hold the screen to long while browsing the app.
 
@rob
Code is Art
Profile
Posts: 115
Reg: Dec 10, 2013
Alabama
8,800
like
02/21/14 01:24 PM (10 years ago)
I will have to check my iPhone apps but I know that in Android when using the custom URL plugin, selecting and holding an image offers no user prompt
 
@rob
Code is Art
Profile
Posts: 115
Reg: Dec 10, 2013
Alabama
8,800
like
02/21/14 01:27 PM (10 years ago)
Also I haven't tested this but I believe you can disable data selection (like you mention in your first post) and as long as you use properly formatted URLs in your HTML, those links should still show up as hyperlinks. The "recognize data links" option simply tries to recognize phone numbers and addresses and turn them into hyperlinks
 
Moto110
Aspiring developer
Profile
Posts: 205
Reg: Jul 26, 2011
Orlando, FL
8,700
like
02/21/14 01:28 PM (10 years ago)
I haven't tested this app yet on Android thanks for letting me know. What about text are you prompted to "select" it?
 
@rob
Code is Art
Profile
Posts: 115
Reg: Dec 10, 2013
Alabama
8,800
like
02/21/14 01:30 PM (10 years ago)
yes you can select text (to copy/paste) but I think that is strictly an Android Operating System function and does that on any type of screen that has text
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
02/21/14 01:33 PM (10 years ago)
The route to do this is probably by modifying your html. There are options in css or javascript that might do what you want. I found these with a quick google :- http://www.boogiejack.com/no_copy_paste.html http://stackoverflow.com/questions/8352367/disable-select-copy-and-paste-of-the-content-of-html-pages-in-mozilla-firefox http://stackoverflow.com/questions/8957443/prevent-copying-text-in-web-page Hope that helps, Alan
 
@rob
Code is Art
Profile
Posts: 115
Reg: Dec 10, 2013
Alabama
8,800
like
02/21/14 01:39 PM (10 years ago)
@AlanMac, that was why I ask what his concern was, if it was strictly to control downloads, those are excellent options, but because it is look/feel that he wants to control, those options will still throw up a dialog with the user
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
02/21/14 03:38 PM (10 years ago)
@Rob, you are probably right, I was just throwing a few options around, if they tick a box on the wish list, maybe a bit more googling will find something that can be placed in the html. Personally, I go with "disable all interaction" and work around the issues that causes.
 
Moto110
Aspiring developer
Profile
Posts: 205
Reg: Jul 26, 2011
Orlando, FL
8,700
like
02/21/14 07:00 PM (10 years ago)
I figured out how to get the results I am looking for with an the HTML Pro plugin and an HTML document. It was extremely simple to fix. I put the code below in the <head> section of my html pages. Links still work perfect touching and holding now does nothing. <style type="text/css"> body { -webkit-user-select: none; /* Chrome all / Safari all */ -o-user-select: none; user-select: none; -webkit-touch-callout:none; } </style> Thanks for the help guys. Hopefully this will be helpful for other BT members as well.
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
02/22/14 11:07 AM (10 years ago)
Looks like the second and third links I posted from stackoverflow were close. Glad you got it sorted, I'll add this to my list of Buzztouch workarounds. Cheers, Alan
 
@rob
Code is Art
Profile
Posts: 115
Reg: Dec 10, 2013
Alabama
8,800
like
02/23/14 07:49 PM (10 years ago)
Great info.......@AlanMac you were dead on with your info <now removing my foot from mouth>
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.