Page 2 of 2 FirstFirst 12
Results 11 to 19 of 19

Thread: Custom js

  1. #11

    Default Re: Custom js

    Yep, that's it. It is very cool, doesn't suffer refresh issues, hardly ever needs !important to override settings either.
    Really handy and I suspect it will work for your plugin out of the box.

    --
    Wil

  2. #12
    Join Date
    Mar 2009
    Location
    Beech Hill - a village near Reading in the UK
    Posts
    2,812

    Default Re: Custom js

    Wil

    Thanks for pointing that out - very useful, I suspect, especially since different themes may require different CSS "tweaks". I'm especially taken with the fact that changes will survive theme updates, which seem to happen all the time.

    That said, I intend to implement (actually have already done so in my development version) a customcss setting in the shortcode as well. I was doing one for customjs and it seemed to make sense to do a customcss one alongside it. I would see this being used for custom CSS required for styling application aspects which would go with custom JavaScript components, rather that tweaks to overcome CSS conflicts between the DF theme and the WP theme, for which I think your solution is the better approach.

    Mike

  3. #13
    Join Date
    Mar 2009
    Location
    Sweden
    Posts
    742

    Default Re: Custom js

    Mike
    thanks for doing this. When do you think you can have something ready for df19 with the custom js stuff in it? :-)
    /Leif Angestam
    Sweden

  4. #14
    Join Date
    Mar 2009
    Location
    Beech Hill - a village near Reading in the UK
    Posts
    2,812

    Default Re: Custom js

    Leif

    The issue is less of development time as testing time. I may do some kind of pre-release alpha for any willing to test in their environments. That I could probably have ready in a few days.

    Mike

  5. #15
    Join Date
    Mar 2009
    Location
    Sweden
    Posts
    742

    Default Re: Custom js

    Hi Mike. I’d be willing to alpha test it :-)


    Skickat från min iPhone med Tapatalk
    /Leif Angestam
    Sweden

  6. #16
    Join Date
    Mar 2009
    Location
    Beech Hill - a village near Reading in the UK
    Posts
    2,812

    Default Re: Custom js

    OK Leif (and anybody else who is interested)... you asked for it!

    Here is a minimally (well, perhaps a little more than that) tested DF4WP for DataFlex v19.0. The ZIP contains two other ZIPs: the plugin (dataflex4wordpress.zip) and the library workspace (DF4WPlib_190.zip).

    The plugin should, as before, be uploaded as a zip to your WordPress site (Dashboard --> Plugins --> Add New --> Upload Plugin --> Choose file ... select dataflex4wordpress.zip ... Install Now --> Activate Plugin).

    The library workspace you should unzip, then use as a library from your app's workspace, making the following changes (along with appropriate Use statements) to your app:


    • cWebApp --> cWPWebApp
      • Set psWPEncryptSecret to "whateverIsInSecretInTheDF4WPDashboard"
      • Use WebResourceManager.wo --> Use WPWebResourceManager.wo // important for getting various pathing right

    • cWebView --> cWPWebView
    • cWebModalDialog --> cWPWebModalDialog
    • cWebImage --> cWPWebImage
    • cWebColumnImage --> cWPWebColumnImage


    The latter two are only required if you are loading the images using the older technique of having them under the AppHTML directory and using a relative URL, rather than using the DownloadURL of the WebResourceManager technique, which is taken care of in WPWebResourceManager.wo.

    In addition, when making reference to other local web-available resources (things you would normally load by relative URL from your AppHTML directory or subdirectories of that), amend the setting to be (FQUrl(ghoWebResporceManager, relativeURL)) rather than just relativeURL. This will dynamically replace relative URLs with fully qualified URLs (getting it right, I hope).

    Read the plugin help (now prettier, I hope ): there are a couple of new shortcode settings: customjs and customcss (always use lowercase).

    DF4WP19.zip

    Enjoy... and please let me know at once if you discover any bugs.

    Mike
    Last edited by Mike Peat; 30-Oct-2017 at 10:12 AM.

  7. #17
    Join Date
    Mar 2009
    Location
    Adelaide, South Australia
    Posts
    477

    Default Re: Custom js

    Quote Originally Posted by Mike Peat View Post
    Read the plugin help (now prettier, I hope ): there are a couple of new shortcode settings: customjs and customcss (always use lowercase).
    Hi Mike,
    there didn't seem to be an updated Help file in the download.

    Ian
    The most important leg on a three legged stool is the one that's missing.
    Murphy's Law (2)

  8. #18
    Join Date
    Mar 2009
    Location
    Beech Hill - a village near Reading in the UK
    Posts
    2,812

    Default Re: Custom js

    Ian

    The "Help" is the plugin's "Help" page in WordPress (in the Dashboard "DataFlex" section), not in a Help file as such. (Well, it is in a file - something like: C:\inetpub\wwwroot\wordpress\wp-content\plugins\dataflex4wordpress\df4wp-help.php, but it's a lot easier to look at it in the WordPress dashboard!)

    Mike

  9. #19
    Join Date
    Mar 2009
    Location
    Adelaide, South Australia
    Posts
    477

    Default Re: Custom js

    Duh, thanks Mike. I wondered what that Menu item was for.
    Ian
    The most important leg on a three legged stool is the one that's missing.
    Murphy's Law (2)

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •