Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updating the custom example file

  • Loading branch information...
commit a82459e42bdc5231a585b9ce22b24d3f89aa2cf4 1 parent fafcba0
@jansepar jansepar authored
Showing with 16 additions and 34 deletions.
  1. +16 −34 mobify-custom.js.example
View
50 mobify-custom.js.example
@@ -1,37 +1,19 @@
-require(["mobifyjs/utils", "mobifyjs/capture", "mobifyjs/resizeImages", "mobifyjs/jazzcat", "mobifyjs/unblockify", "mobifyjs/firefox"], function(Utils, Capture, ResizeImages, Jazzcat, Unblockify, Firefox) {
- var Mobify = window.Mobify = window.Mobify || {};
+var Mobify = require('./src/mobify-library');
- // DECLARE LIBRARIES ATTACHED TO MOBIFY OBJECT HERE
- Mobify.Utils = Utils;
- Mobify.Capture = Capture;
- Mobify.ResizeImages = ResizeImages;
- Mobify.Jazzcat = Jazzcat;
- Mobify.Unblockify = Unblockify;
- Mobify.api = "2.0"; // v6 tag backwards compatibility change
-
- Mobify.Capture = Capture;
- Mobify.ResizeImages = ResizeImages;
+var capturing = window.Mobify && window.Mobify.capturing || false;
+if (capturing) {
+ // Grab reference to a newly created document
+ Mobify.Capture.initCapture(function(capture){
+ // optimize scripts
+ var capturedDoc = capture.capturedDoc;
+ //var scripts = capturedDoc.querySelectorAll('script');
+ //Mobify.Jazzcat.optimizeScripts(scripts);
+ // optimize images
+ var images = capturedDoc.querySelectorAll('img, picture');
+ Mobify.ResizeImages.resize(images);
- // OPTIONAL: Also add main executable logic to compile library + main
- // instead of having seperate main.js file
-
- var capturing = window.Mobify && window.Mobify.capturing || false;
- if (capturing) {
- // Grab reference to a newly created document
- Mobify.Capture.initCapture(function(capture){
- // optimize scripts
- var capturedDoc = capture.capturedDoc;
- //var scripts = capturedDoc.querySelectorAll('script');
- //Mobify.Jazzcat.optimizeScripts(scripts);
- // optimize images
- var images = capturedDoc.querySelectorAll('img, picture');
- Mobify.ResizeImages.resize(images);
+ capture.renderCapturedDoc();
+ });
+} else {
- capture.renderCapturedDoc();
- });
- } else {
-
- }
-
-}, undefined, true);
-// relPath, forceSync
+}
Please sign in to comment.
Something went wrong with that request. Please try again.