Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Can the HTML editor be limited in it's editing feature set?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Can the HTML editor be limited in it's editing feature set?

    In general the HTML editor serves it's purpose. However sometimes, "WE" the developers would not like our end users to be able to use all of the features that the HTML editor provides us. For example, while I'd like my users to be able to change fonts and color etc. I would NOT like them to be able to alter the source (ie. html) of the memo field. The default seems to allow the user to do this and I would like to turn it off. Allowing them to manually insert or edit the source seems very dangerous to me, especially if they know what they doing (ie. hack).

    So: Can the HTML editor be limited in it's editing feature set?

    #2
    Re: Can the HTML editor be limited in it's editing feature set?

    Plug - if you use my Alpha-CKEditor Integration, you can do any customization you want. CKEditor is the editor used right here in this forum. See the demo here: http://ialpha5.com/CKEditor/

    Click Custom Editor Styles to see example configs.

    Note, the www.ckeditor.com is on version 4. My Integration is on version 3; working on the upgrade.
    Steve Wood
    See my profile on IADN

    Comment


      #3
      Re: Can the HTML editor be limited in it's editing feature set?

      Allowing them to manually insert or edit the source seems very dangerous to me, especially if they know what they doing (ie. hack)
      I was worried about the same thing and ended up using an Xbasic function (removeScriptTags) that Selwyn wrote to remove script tags. For example, on one of my grids I have a field named BUYER_NOTES that uses the HTML editor. In the server side event CanUpdateRecord, I call the Xbasic function like this:
      Code:
      dataSubmitted.BUYER_NOTES = removeScriptTags(dataSubmitted.BUYER_NOTES)
      Here is the Xbasic removeScriptTags function that Selwyn wrote:
      Code:
      function removeScriptTags as c (html as c )
      'PURPOSE - To remove javascript from HTML.  In case users try to inject javascript there.
      'WRITTEN BY:  Selwyn Rabins
      
      'debug(1)	
      dim count as n 
      count = occursi("<SCRIPT",html) 
      dim i as n 
      dim search as c 
      for i = 1 to count 
       search = extract_string(html,"<SCRIPT","</SCRIPT>",1,.t.)
       html = stritran(html,search,"")
      next i 
      
      count = occursi("&lt;SCRIPT",html) 
      for i = 1 to count 
      	search = extract_string(html,"&lt;SCRIPT","&lt;/SCRIPT&gt;",1,.t.)
      	html = stritran(html,search,"")
      next i 
      
      removeScriptTags = html
      
      end function
      Carol King
      Developer of Custom Homebuilders' Solutions (CHS)
      http://www.CHSBuilderSoftware.com

      Comment


        #4
        Re: Can the HTML editor be limited in it's editing feature set?

        Originally posted by Steve Wood View Post
        Plug - if you use my Alpha-CKEditor Integration, you can do any customization you want. CKEditor is the editor used right here in this forum. See the demo here: http://ialpha5.com/CKEditor/

        Click Custom Editor Styles to see example configs.

        Note, the www.ckeditor.com is on version 4. My Integration is on version 3; working on the upgrade.
        Steve,

        I read with interest your post in reference to my concerns. I was wondering if your CKEditor allowed you to configure features on an "item by item" bases or was it more "group wise".

        Also, I try like "heck" to stay away from those tiny tiny icons we've been innodated with in recent years. I don't need LARGE icons but something bigger than what was seen during my review is desired. Question! Can the icons for features be replaced by me?


        Carol,

        Thanks for the heads up on that function written by Selwyn. I have in the past written something similar but I didn't know where the best place to call it. Your reply exposed CanUpdateRecord for me. That was good information.

        Tom W.

        Comment


          #5
          Re: Can the HTML editor be limited in it's editing feature set?

          I was wondering if your CKEditor allowed you to configure features on an "item by item" bases or was it more "group wise". Can the icons for features be replaced by me?
          You can configure in/out each feature (icon) one-by-one. I do not see any larger icon sets available. There are several "skins" with different user interface design. You would need a "skin" that had larger icons. The complete set of icons, whether used or not, are all in a single jpg file.
          Steve Wood
          See my profile on IADN

          Comment


            #6
            Re: Can the HTML editor be limited in it's editing feature set?

            Originally posted by Fulltimer View Post
            So: Can the HTML editor be limited in it's editing feature set?
            Of course. Just not with Alpha.

            Code:
            var htmlFoo = function ()
            {
                jQuery('[id$="FIELD_NAME.TOOLBAR"]>[title="Toggle Code"]').remove();
            }
            Originally posted by Fulltimer View Post
            Allowing them to manually insert or edit the source seems very dangerous to me, especially if they know what they doing (ie. hack).
            This does not prevent someone from inserting scripts. If you really want to prevent scripts, then you'll need to preprocess the data as Carol suggests before saving/previewing it and strip out all the script tags. Someone who, as you put it, knows what they're doing probably has the know-how to use a tool such as FireBug to insert the scripting code --- completely bypassing your interface. The upshot is that the "script" code will only affect the person who is trying to insert it, so an xbasic function to strip that stuff out is more than sufficient.

            Also, "afterDetailViewNewRecord" for New Record in a Detail View is strange sauce. I recommend setTimeout(htmlFoo, 200) in that case.
            ---
            Sarah
            Alpha Anywhere latest pre-release

            Comment


              #7
              Re: Can the HTML editor be limited in it's editing feature set?

              Originally posted by TheSmitchell View Post

              Also, "afterDetailViewNewRecord" for New Record in a Detail View is strange sauce. I recommend setTimeout(htmlFoo, 200) in that case.
              ---
              Sarah
              Sarah,

              Thanks for your comments. I do however have a question. I am not clear on your quoted reference listed above. I don't recall ever seeing "afterDetailViewNewRecord" but more importantly, what purpose is the Timeout trying to accomplish. Could you clarify your response a bit please?

              Tom W.

              Comment


                #8
                Re: Can the HTML editor be limited in it's editing feature set?

                Originally posted by Fulltimer View Post
                Sarah,

                Thanks for your comments. I do however have a question. I am not clear on your quoted reference listed above. I don't recall ever seeing "afterDetailViewNewRecord" but more importantly, what purpose is the Timeout trying to accomplish. Could you clarify your response a bit please?

                Tom W.
                afterDetailViewNewRecord is a client-side event in grids.

                setTimeout waits a number of milliseconds before calling a function: setTimeout(function, number_of_milliseconds). Waiting because the toolbar doesn't exist just yet when you try to remove controls in afterDetailViewNewRecord.

                Do not use the parameter version of setTimeout. It is not supported by IE 9 or older.
                Alpha Anywhere latest pre-release

                Comment


                  #9
                  Re: Can the HTML editor be limited in it's editing feature set?

                  Originally posted by TheSmitchell View Post
                  afterDetailViewNewRecord is a client-side event in grids.

                  setTimeout waits a number of milliseconds before calling a function: setTimeout(function, number_of_milliseconds). Waiting because the toolbar doesn't exist just yet when you try to remove controls in afterDetailViewNewRecord.

                  Do not use the parameter version of setTimeout. It is not supported by IE 9 or older.
                  Sarah,

                  setTimeout(function, number_of_milliseconds) does not work for me in the same way it must apparently work for you. I created a simple function with alert() as the only command within that function. My alert msg displays as expected but it does not honor the wait period. I have tried 300, 3000, 30000 as the number of milli seconds to wait. The function and therefore my msg appear immediately after clicking my test button.

                  I am using Firefox to run my app. Seems like something is missing because I see nothing that will accept the number_of_milliseconds as a ligitimate parameter. I don't know if you were simply noting the snippet from memory or if what you provided should have been "real, workable code". Strangely I get no error but I get "no wait".

                  Tom W.

                  Comment


                    #10
                    Re: Can the HTML editor be limited in it's editing feature set?

                    what's your source code?

                    Edit:
                    Example -
                    EG:

                    In Client-Side event (such as afterDetailViewOpen):
                    Code:
                    setTimeout(htmlFoo, 1000);
                    In Code > Javascript Functions:
                    Code:
                    var htmlFoo = function ()
                    {
                        alert("Deleting");
                        jQuery('[id$="FIELD_NAME.TOOLBAR"]>[title="Toggle Code"]').remove();
                    }
                    Last edited by TheSmitchell; 03-27-2013, 05:41 PM.
                    Alpha Anywhere latest pre-release

                    Comment

                    Working...
                    X