Re: Zoom factor - store / set?

  •  04-11-2013, 1:11 PM

    Re: Zoom factor - store / set?

    Hi ederkley,

     

    The Rich TextEditor did not provide the API to catch the zoom function. you can try the way below to get the zoom value.

     

    1. Open file "richtexteditor\plugins\zoomview\plugin.xml", find section below.

     

             option.selectzoom=function(val)
                      {
                            plugin.zoomvalue=val;
                            label.set_text(val+"%");
                            var zoom=plugin.zoomvalue==100?"":(plugin.zoomvalue+"%");
                            editor.GetWindow().document.body.style.zoom=zoom;
                      }

     

    2. Chnage it to

     

              option.selectzoom=function(val)
                      {
                             var input1 = document.getElementById("input1");
                             input1.value=val;
                            plugin.zoomvalue=val;
                            label.set_text(val+"%");
                            var zoom=plugin.zoomvalue==100?"":(plugin.zoomvalue+"%");
                            editor.GetWindow().document.body.style.zoom=zoom;
                      }
     

    3. In your editor page add an input contrl in the page, like below. Each type you change the zoom, the button value will be changed too. The button just use for the sample, you can change it to anything you need to achieve your own requirement. For example, each time the button value has been changed, then fire a javascript function to achieve your other logic. 

     

      <input type="button" value="test" id="input1" />

     

    Regards,

     

    Ken 

View Complete Thread