CodingGetting rid of vestigial js

 

Press Ctrl+Enter to quickly submit your post
Quick Reply  
 
 
  
 From:  CHYRON (DSMITHHFX)  
 To:  ALL
41601.1 
Per client's request we're building an 'e-zine' with a page-flip effect (don't ask), and turn.js appears to be about the only game in town that doesn't rely on flash. The developer hasn't updated it since 2012. I've been adapting this sample to client's more graphics-heavy needs. One thing I'd like to get rid of is an old, since-deprecated modernizr 'yepnope' function (to conditionally load scripts for IE8/other) that ultimately calls a custom function, loadApp. I'm not building against IE8, so I do not need the yepnope thing at all, but I do need to call the loadApp function
Code: 
        yepnope({
            test : Modernizr.csstransforms,
            yep: ['scripts/turn.js'],
            nope: ['scripts/turn.html4.min.js', 'styles/jquery.ui.html4.css', 'styles/html4.css'],
            both: ['scripts/custom.js', 'styles/jquery.ui.css', 'styles/styles.css'],
            complete: loadApp
        })
I put the 'yep' and 'both' scripts and css into the head, and tried variously replacing the whole yepnope function with just loadApp(); replacing every yepnope option with "null" (e.g. "test: null, yep: null" etc) leaving "complete: loadApp" and so on, but modernizr.js (incidentally I've never used previously) demands I keep it intact.

----
"A remarkable number of people think 'The Martian' is based on a true story"
0/0
 Reply   Quote More 

 From:  CHYRON (DSMITHHFX)  
 To:  ALL
41601.2 
Turns out modernizr was only being used for the csstransforms test (AFAICT). I ditched it all, and it appears to work... dare I say... better.

----
"A remarkable number of people think 'The Martian' is based on a true story"
0/0
 Reply   Quote More 

Reply to All    
 

1–2

Rate my interest:

Adjust text size : Smaller 10 Larger

Beehive Forum 1.5.2 |  FAQ |  Docs |  Support |  Donate! ©2002 - 2024 Project Beehive Forum

Forum Stats