requirejs

Twitter Bootstrap js file loaded but not working alongside requirejs

放肆的年华 提交于 2019-12-08 05:13:31
问题 I have a Laravel app that uses Twitter Bootstrap. Everything was working fine and then I implemented the Aloha WYSIWYG editor - http://www.aloha-editor.org/ which uses RequireJS. I load the JS files in the following order: jQuery BootstrapJS file RequireJS AlohaJS In that order, Aloha will work fine but the $().modal function won't work (TypeError is not a function...) I can see that bootstrap.min.js is loaded in Firebug though. If I remove the RequireJS the bootstrap functions work fine. I

Gulp task to create a DEV and PROD version of main.js

我们两清 提交于 2019-12-08 05:07:41
问题 Im new to Gulp and have been playing with gulp-minify and gulp-uglify to create an overall main.js file via gulp-requirejs . However, i need to create 2 versions of this main.js file, one for my DEV environment, and one for PROD. Reason being, in some .js files, i have listed URLs, for example: currentPage == '/products/chairs.html' However, when moving these html files into my .Net structure, the actual URL is: currentPage == 'goodsandservices/products/our-chairs.html' My current rJS task is

Getting dependencies to load correctly in requirejs (autobahn and whenjs)

柔情痞子 提交于 2019-12-08 05:06:15
问题 I have been stuck on this problem for the past few hours. I'm trying to get autobahnjs and whenjs to be loaded correctly by requirejs. require.config({ paths: { angular: '../bower_components/angular/angular', angularBootstrap: '../bower_components/angular-bootstrap/ui-bootstrap', bootstrap: '../bower_components/bootstrap/dist/js/bootstrap', jquery: '../bower_components/jquery/jquery', chosen: '../bower_components/chosen/chosen.jquery.min', text: '../bower_components/requirejs-text/text',

angularjs + requirejs structure to build a huge modular app

不羁岁月 提交于 2019-12-08 03:59:57
问题 I'm trying to build a huge Modular Web App with AngularJs and RequireJS. This is my directory that I want to build: |--index.html |--css |--images |--libs | └--angular.js | └--angular-route.js | └--require.js | |--js | └--app.js | └--controller.js | └--module |--user | |--controller | | └--index.js (that is controller to list all users) | | └--add.js (this controller to add new user) | |--service | | └--user.js | └--template | └--index.tpl.html | └--add.tpl.html | └--photo |--controller | └-

EmberJS - RequireJS - How to connect a view/template to an outlet of a child view

℡╲_俬逩灬. 提交于 2019-12-08 03:48:25
Again a question due to EmberJS evolving quite fast :) [EDIT] I am using EmberJS from github. This is the version I am using https://github.com/emberjs/ember.js/tree/c87ad9fc13f7883e7b898c9fb9b1630cb2fc9bf1 [/EDIT] This question is a follow up of EmberJS - Manually bind controller to view But you don't need to read it to understand the following question. I have an EmberJS application and I am using requireJS to load my controllers and views for the section of the application the router is routing to. My main index.html has an {{outlet}} where the ApplicationView will be added. My

what (amd) script loader to use for mobile site

六眼飞鱼酱① 提交于 2019-12-08 03:45:34
问题 I'm starting work on a new version of a mobile site. I am looking into using an amd script loader and have pretty much narrowed it down to require and lsjs. I know there are many pro's and con's to both, but I am trying to figure all of those out for the mobile version of my site. Does anyone have experience with this lib's at the mobile level? Just trying to get a discussion going here of what people think the best way to go is. (anyone with a 1500 rep want to create an lsjs tag :) ). Maybe

WebSocket connection is not working when script is loaded from external source

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-08 03:43:20
问题 So, i have simple webSocket connection script: $(document).ready(function() { // set web scocket connection var wsConnection = new WebSocket('wss://websocket.lh:4443'); // web socket on open action wsConnection.onopen = function() { // web socket wsConnection.send(JSON.stringify({ 'action': 'subscribe', 'channel': '{{ app.user.webSocketToken }}' })); } // web socket on recive data action wsConnection.onmessage = function(e) { // load notifications handler requirejs(["notificationsHandler"],

Migrating Requirejs and Backbone based application to WebPack

血红的双手。 提交于 2019-12-08 03:33:21
问题 I have a large application developed using Backbone.js and Marionette with Requirejs.We are using Grunt for build. I need to migrate Requirejs to Webpack as we are frequently seeing Module Load Timeout. I feel that multiple entry point approach of Webpack is a better approach than to convert single page to multi-page using Requirejs. Overall we have approximately 400 js file and 250 html[partial] files. The project structure is app |--modules | |-- module-A | |- model | |- collection | |-

jQuery 1.7+, AMD (RequireJS), and Global Scope

江枫思渺然 提交于 2019-12-08 02:53:54
问题 I'm trying to get more in line w/ AMD, and I've come across something in jQuery source that I just can't quite undertand. Here is section (found just before the end of the file): if ( typeof define === "function" && define.amd && define.amd.jQuery ) { define( "jquery", [], function () { return jQuery; } ); } From what I can see, one of the major points of AMD is to keep the global scope clean. Yet jQuery chooses to return a reference to itself as a module, but still infects the global space.

Requirejs optimiser - Create minified groupings of scripts for sections of the site

只谈情不闲聊 提交于 2019-12-08 02:01:07
问题 I'm using the requirejs optimiser and I have a lot of JavaScript files for this webapp. I would like to create separate minified scripts which group scripts for certain sections of the site. My question is: how do I create minified groups of scripts and how I prevent script libraries for example JQuery from being added into these module groups which already exist in the scripts.min.js core script? ({ baseUrl: '../static/js', mainConfigFile: '../static/js/main.js', name: 'main', out: '..