Skip to content

Instantly share code, notes, and snippets.

@leopic
Created June 4, 2014 04:40
Show Gist options
  • Save leopic/6a2f679633631f55d753 to your computer and use it in GitHub Desktop.
Save leopic/6a2f679633631f55d753 to your computer and use it in GitHub Desktop.
requirejs.config({
paths: {
jquery: "//cdnjs.cloudflare.com/ajax/libs/jquery/1.7.2/jquery.min",
jquery_ui: "//cdnjs.cloudflare.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min",
jquery_block_ui: "//cdnjs.cloudflare.com/ajax/libs/jquery.blockUI/2.66.0-2013.10.09/jquery.blockUI.min",
jquery_mask: "//cdnjs.cloudflare.com/ajax/libs/jquery.maskedinput/1.3.1/jquery.maskedinput.min",
underscore: "//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.6.0/underscore-min"
}
});
require([
"jquery",
"sn/pageData",
"unsorted/side_data",
"unsorted/sn"
], function($, Sn){
var whiteList = [
// example: "site/module/controller/action",
"main/order",
"main/order/details",
"main/creditcard",
"main/account/index",
"main/account/email",
"main/addressbook/edit",
"main/addressbook/index",
"main/profile/index",
"main/checkout/cart",
"main/checkout/creditcard",
"steals/archivep/groupedvariants",
"steals/index/index"
];
if(Sn.controller == "steals/daily" && Sn.action == "deal"){
Sn.controller = "steals/index";
Sn.action = "index";
}
if ($.inArray(Sn.controller, whiteList) > -1) {
requirejs([Sn.controller + '/global'], function(){ });
}
if ($.inArray(Sn.controller + '/' + Sn.action, whiteList) > -1) {
requirejs([Sn.controller + '/' + Sn.action], function(){ });
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment