0

I have a project and am trying to incorporate a purchased theme into the project.

The theme comes with 3 javascript files: mvpready-core.js, mvpready-landing.js, mvpready-helpers.

I copied the js files into the assets/javascript folder and then added them to application.js like so:

// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
//= require jquery
//= require jquery_ujs
//= require mvpready-core
//= require mvpready-landing
//= require mvpready-helpers
//= require_tree .

When I load the web page I get the following errors in console: In the mvready-core file

SyntaxError: illegal character
book

In mvpready-landing file

ReferenceError: mvpready_core is not defined
mvpready_core.navHoverInit ({ delay: { show: 250, hide: 350 } })

I have tried switching the order of the files in application.js but that didn't help.

Here is the js of the static theme without rails:

<!-- Core JS -->
<script src="../../bower_components/jquery/dist/jquery.js"></script>
<script src="../../bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<!-- App JS -->
<script src="../../global/js/mvpready-core.js"></script>
<script src="../../global/js/mvpready-helpers.js"></script>
<script src="./js/mvpready-landing.js"></script>

and here it is with rails:

<!-- Core JS -->
    <script src="/assets/jquery.self-d03a5518f45df77341bdbe6201ba3bfa547ebba8ed64f0ea56bfa5f96ea7c074.js?body=1"></script>
<script src="/assets/jquery_ujs.self-8e98a7a072a6cee1372d19fff9ff3e6aa1e39a37d89d6f06861637d061113ee7.js?body=1"></script>
<script src="/assets/twitter/bootstrap/transition.self-db278e3a8fa6249c16796b113ebd29e11ef4e2cd021618ed84895d524a4511e0.js?body=1"></script>
<script src="/assets/twitter/bootstrap/alert.self-ebce91ec66c71bcee451ea7da9128fd1bf8faa02c6d22ea04c598423431e4c08.js?body=1"></script>
<script src="/assets/twitter/bootstrap/modal.self-ab1767545e27c0dbd36971e656ae4927171f673e3d932cdec2cbef39e991952b.js?body=1"></script>
<script src="/assets/twitter/bootstrap/dropdown.self-8bb9309b6c24a4ba6b94026a049d25b13bdc0553b6fe83255c14a715ba624cc4.js?body=1"></script>
<script src="/assets/twitter/bootstrap/scrollspy.self-bd0c6724cdc75302fe98dfeff923112b76c1673cf4a0752a7050b7feea15594c.js?body=1"></script>
<script src="/assets/twitter/bootstrap/tab.self-7e3ee4a243bb416b5f0111a0be08f8547c5d72ba71fe4afe4a4a007f5cb4e10e.js?body=1"></script>
<script src="/assets/twitter/bootstrap/tooltip.self-d7f9330825307d053f68da11bb9ddc9b070df72deef3d115f2f3d55f66b17457.js?body=1"></script>
<script src="/assets/twitter/bootstrap/popover.self-cd672ecad3b549e1dbd89bfd044e5812d6fdade56f42d48e3acee0c3f4614526.js?body=1"></script>
<script src="/assets/twitter/bootstrap/button.self-ceb562de883e04359bb2c06f07bdf6ecf065cc8a5027e2e58857c5e91b0b68e3.js?body=1"></script>
<script src="/assets/twitter/bootstrap/collapse.self-a87553101c955a01e2e8c81fad69a16582ddbf58fe95d5eb335dde5567af7647.js?body=1"></script>
<script src="/assets/twitter/bootstrap/carousel.self-5d09995e01b647168888180d40e271f9a6759d68ae7ac029d7026af58813d376.js?body=1"></script>
<script src="/assets/twitter/bootstrap/affix.self-14e04bbe71282aa039322ab93e3a3a886ddede5f59a2f365f7c861f697bbeb21.js?body=1"></script>
<script src="/assets/twitter/bootstrap.self-fbfa5ad7d9aa0afe439ec4ff3883acc4cb92b62cb67c40d674320c9aa1d4642d.js?body=1"></script>
<script src="/assets/jquery.color.self-563ece6445847ae2087fffbe72b094918ea69e3124d0389b2819fa5400a96210.js?body=1"></script>
<script src="/assets/mvpready-landing.self-e43f32f1c40792b294dfc7cfda1ae60af108443c2dbce31e8612acb5fdc75ddb.js?body=1"></script>
<script src="/assets/mvpready-core.self-f0da2b30dbdf9f447bd037b448e4e56201d93885a2fa14ea75992ab0cc3186e1.js?body=1"></script>
<script src="/assets/mvpready-helpers.self-05f3feaf1e237e0850478afaa5a5aa595e0950f54ac10a148d4288d32f5259df.js?body=1"></script>
<script src="/assets/bootstrap.self-803d1c88e207632a77fa3967407fbea537d48e6f7f54470e6a2ee8f14a7aefa9.js?body=1"></script>
<script src="/assets/application.self-968f575d6d917a8150cf2e95fd6ec791beb39f9c32f85283e7a09b9d8534333a.js?body=1"></script>
1
  • If you copied js files to assets/ dir then //= require_tree . will include them by default. Try removing it or explicit require. Commented May 4, 2015 at 9:12

1 Answer 1

1

The core-file of the theme has a syntax-error in it, you can't fix this by changing the order of the files. Contact the creator of the theme.

Sign up to request clarification or add additional context in comments.

3 Comments

@spuggy, if I am at your place, I would compare the source generated by rails to your static working files.
@maximus thanks for the help. I've added the js for rails and the static them. Maybe that could help?
@spuggy if you compare, the order of inclusion is different when rails. Rearranging the require statements to match with static files should work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.