changeset 63:97efd73f2158

Changed RequireJS paths to make it usable with the optimizer.
author Ludovic Chabant <ludovic@chabant.com>
date Wed, 06 Feb 2013 23:48:34 -0800
parents a73a3c0b6d4a
children 0b4f4c23770a
files Makefile static/.rbuild.js static/js/wikked.js static/js/wikked/app.js static/js/wikked/views.js wikked/templates/index.html
diffstat 6 files changed, 65 insertions(+), 31 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Makefile	Wed Feb 06 23:48:34 2013 -0800
@@ -0,0 +1,26 @@
+
+WIKKED_LESS 	= ./static/css/wikked.less
+WIKKED_CSS 		= ./static/css/wikked.min.css
+REQUIREJS_BUILD = ./static/.rbuild.js
+
+DATE=$(shell date +%I:%M%p)
+CHECK=\033[32m✔\033[39m
+
+build:
+	@echo ""
+	@echo "Building Wikked..."
+	@echo ""
+	@recess --compile --compress ${WIKKED_LESS} > ${WIKKED_CSS}
+	@echo "Compiling LESS stylesheets...       ${CHECK} Done"
+	@r.js -o ${REQUIREJS_BUILD}
+	@echo "Compiling Javascript code...        ${CHECK} Done"
+	@echo ""
+	@echo "Successfully compiled Wikked."
+	@echo ""
+
+clean:
+	rm ${WIKKED_CSS}
+
+watch:
+	recess ${WIKKED_LESS}:${WIKKED_CSS} --watch
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/static/.rbuild.js	Wed Feb 06 23:48:34 2013 -0800
@@ -0,0 +1,6 @@
+({
+    mainConfigFile: "js/wikked.js",
+    baseUrl: ".",
+    name: "js/wikked",
+    out: "js/wikked.min.js"
+})
--- a/static/js/wikked.js	Wed Feb 06 17:39:03 2013 -0800
+++ b/static/js/wikked.js	Wed Feb 06 23:48:34 2013 -0800
@@ -6,11 +6,12 @@
 require.config({
     urlArgs: "bust=" + (new Date()).getTime(),
     paths: {
-        jquery: 'jquery-1.8.3.min',
-        underscore: 'underscore-min',
-        backbone: 'backbone-min',
-        handlebars: 'handlebars-1.0.rc.1',
-        bootstrap_modal: '/bootstrap/js/bootstrap-modal'
+        jquery: 'js/jquery-1.8.3.min',
+        underscore: 'js/underscore-min',
+        backbone: 'js/backbone-min',
+        handlebars: 'js/handlebars-1.0.rc.1',
+        bootstrap_modal: '/bootstrap/js/bootstrap-modal',
+        text: 'js/text'
     },
     shim: {
         'jquery': {
@@ -41,8 +42,8 @@
  * by anybody, but need to be evaluated.
  */
 require([
-        'wikked/app',
-        'wikked/handlebars',
+        'js/wikked/app',
+        'js/wikked/handlebars',
         'backbone',
         'text'
         ],
--- a/static/js/wikked/app.js	Wed Feb 06 17:39:03 2013 -0800
+++ b/static/js/wikked/app.js	Wed Feb 06 23:48:34 2013 -0800
@@ -5,8 +5,8 @@
         'jquery',
         'underscore',
         'backbone',
-        './views',
-        './models'
+        'js/wikked/views',
+        'js/wikked/models'
         ],
     function($, _, Backbone, Views, Models) {
 
--- a/static/js/wikked/views.js	Wed Feb 06 17:39:03 2013 -0800
+++ b/static/js/wikked/views.js	Wed Feb 06 23:48:34 2013 -0800
@@ -6,27 +6,27 @@
         'underscore',
         'backbone',
         'handlebars',
-        './client',
-        './models',
-        './util',
-        'text!/tpl/read-page.html',
-        'text!/tpl/edit-page.html',
-        'text!/tpl/history-page.html',
-        'text!/tpl/revision-page.html',
-        'text!/tpl/diff-page.html',
-        'text!/tpl/inlinks-page.html',
-        'text!/tpl/nav.html',
-        'text!/tpl/footer.html',
-        'text!/tpl/search-results.html',
-        'text!/tpl/login.html',
-        'text!/tpl/error-unauthorized.html',
-        'text!/tpl/error-not-found.html',
-        'text!/tpl/error-unauthorized-edit.html',
-        'text!/tpl/state-warning.html',
-        'text!/tpl/special-nav.html',
-        'text!/tpl/special-pages.html',
-        'text!/tpl/special-changes.html',
-        'text!/tpl/special-orphans.html'
+        'js/wikked/client',
+        'js/wikked/models',
+        'js/wikked/util',
+        'text!tpl/read-page.html',
+        'text!tpl/edit-page.html',
+        'text!tpl/history-page.html',
+        'text!tpl/revision-page.html',
+        'text!tpl/diff-page.html',
+        'text!tpl/inlinks-page.html',
+        'text!tpl/nav.html',
+        'text!tpl/footer.html',
+        'text!tpl/search-results.html',
+        'text!tpl/login.html',
+        'text!tpl/error-unauthorized.html',
+        'text!tpl/error-not-found.html',
+        'text!tpl/error-unauthorized-edit.html',
+        'text!tpl/state-warning.html',
+        'text!tpl/special-nav.html',
+        'text!tpl/special-pages.html',
+        'text!tpl/special-changes.html',
+        'text!tpl/special-orphans.html'
         ],
     function($, _, Backbone, Handlebars, Client, Models, Util,
         tplReadPage, tplEditPage, tplHistoryPage, tplRevisionPage, tplDiffPage, tplInLinksPage,
@@ -289,6 +289,7 @@
             last_pageY = e.pageY;
             $('body')
                 .on('mousemove.wikked.editor_resize', function(e) {
+                    var editor_control = $('textarea#wmd-input');
                     editor_control.height(editor_control.height() + e.pageY - last_pageY);
                     last_pageY = e.pageY;
                 })
--- a/wikked/templates/index.html	Wed Feb 06 17:39:03 2013 -0800
+++ b/wikked/templates/index.html	Wed Feb 06 23:48:34 2013 -0800
@@ -11,7 +11,7 @@
         </div>
         <script type="text/javascript">
             var require = {
-                baseUrl: "/js/",
+                baseUrl: "/",
                 deps: ["/js/wikked.js{{cache_bust}}"]
             };
         </script>