• First off I would like to say that I will be adding this in an update as an option for the users, but for now this is a simple hack at the code you can use.

    To start off, you should note that CWv2 utilizes the “Thickbox” API that’s built into WordPress. Therefore to show the window it uses AJAX calls within the function. For this how-to I’ll be using the /content-warning-v2/assets/wpcwv2.dev.js file as it’s not compressed. However for this alteration to work you need to use its contents to overwrite the wpcwv2.js file.

    I honestly was going to separate it into parts, but it’s too simplified to do so, just open the dev.js file for the front-end and find the two functions show_tp() and show_denied_tb()

    Change the height and width parameters for the ajax call, just take care not to change the other parameters.

    Example (regular code):

    function show_tb() {
        tb_show('Warning', cwv2Params.url + '?m=buildMessage&p=' + cwv2Params.postID + '&height=300&width=500&modal=true', false)
    }

    Changing the height and width by adding 200:

    function show_tb() {
        tb_show('Warning', cwv2Params.url + '?m=buildMessage&p=' + cwv2Params.postID + '&height=500&width=700&modal=true', false)
    }

    Once you change the values remember to go into the wpcw.css file and change the #wpdoor_msg to a height of 100 less than what you changed it to within the javascript file. For instance our css would now read:
    #wpdoor_msg{height: 400px;}

    Hope that helps some of ya until I can get a chance to update the plugin, happy coding.

    http://wordpress.org/extend/plugins/content-warning-v2/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi, I tried this and it did not work. Specifically, this:

    Once you change the values remember to go into the wpcw.css file and change the #wpdoor_msg to a height of 100 less than what you changed it to within the javascript file. For instance our css would now read:
    #wpdoor_msg{height: 400px;}

    made the box act strangely. It did not enlarge the box for me.

    More help would be appreciated. Thank you

    Hi, it’s not working by just changing values in wpcwv2.dev.js, you need to update wpcwv2.js.

    However I’m wondering how to give percentage values to the modal box so it can resize depending on screen resolution (mobile devices more specifically) ?

    Thank u for ur help !!

    Hi, these instructions worked well. Thanks

    Thread Starter Jay

    (@phyrax)

    @wylesight
    The modal box uses WordPress’ default Thickbox Plugin, so the parameters are based on that. I may look into using a different modal plugin though.

    nice pluging, is it possible that block cover 90% of screen ?
    To hide the background ?

    Thanks a lot

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: Content Warning] How-To: Change width and height’ is closed to new replies.