6 Replies Latest reply: Oct 8, 2014 2:35 AM by windscorpion RSS

    CPM.js only generated when publishing?

    Cozmicone Community Member

      Is the CPM.js file only generated when you're publishing a Captivate file? I want to modify a few lines of code, like you can with the index.html file so you don't have to modify the published file each time, but as it's not located in my Adobe Captivate 8 x64\HTML\assets\js folder I'm guessing that Captivate only generates it when you publish to HTML5.

        • 1. Re: CPM.js only generated when publishing?
          TLCMediaDesign Community Member

          I believe it's in the CPHTMLPublish.dll. It has to be created when publishing since your project JSON object is in there.

          • 2. Re: CPM.js only generated when publishing?
            windscorpion Community Member

            Yes you need to edit it after publishing. I wrote a script to do it for my projects.

            • 3. Re: CPM.js only generated when publishing?
              Cozmicone Community Member

              Well that's unfortunate. I was hoping to avoid doing anything more post-publish.

              • 4. Re: CPM.js only generated when publishing?
                TLCMediaDesign Community Member

                What is it that you want to edit? If you create a custom js file and make sure that it is loaded after the CPM.js it will use the functions/code that are outside of the JSON object in the CPM.js. Your custom code will overwrite the same code/functions in the CPM.js.

                • 5. Re: CPM.js only generated when publishing?
                  Cozmicone Community Member

                  I was wanting to edit all of the font calls that didn't conform to Google's open font CSS specifications, but I ended up using a CSS reset type of entry at the beginning of the index.html file that allowed me to hit pretty much every selector with the same information. I did have to add in the .cpMainContainer and .style selector, but the following allowed me to set all dynamically created text to the same Google font.

                   

                  html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address,  big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video, .cpMainContainer, .style {

                      font-family: 'Open Sans', sans-serif !important;

                      font-weight: 600 !important;

                  }

                   

                  I couldn't use the Captivate's Style Manager for some of the things I wanted to change because the resulting CPM.js file was referencing the font incorrectly because you have to reference the font-family on one line of CSS and the font-weight on another. It's possible that all the selectors aren't necessary for doing what I want, but it works so I'm happy.

                  • 6. Re: CPM.js only generated when publishing?
                    windscorpion Community Member

                    Yeah thats good (you probably don't need to include everything as Captivate seems to use <p> for most stuff but i guess as long as it works...) it also works with Edge Fonts.

                     

                    Though in my case i need to use different fonts on a slide so this isn't any good for me but if that changes then its good to know