Updating the version of jQuery. Got Require working, sort-of.

This commit is contained in:
Elf M. Sternberg 2012-07-09 15:15:52 -07:00
parent 70059e4ed5
commit 064ebe5831
6 changed files with 9422 additions and 7 deletions

1
.gitignore vendored
View File

@ -7,6 +7,7 @@
npm-debug.log
node_modules/*
dist/*
dist-compiled/*
src/*.html
src/*.js
src/*.css

View File

@ -71,11 +71,11 @@ module.exports = function(grunt) {
}
},
requirejs: {
dir: 'dist',
appDir: 'src',
dir: 'dist-compiled',
appDir: 'dist',
baseUrl: '.',
paths: {
jquery : './libs/jquery',
jquery : '../libs/jquery/jquery-1.7.2',
},
pragmas: {
doExclude: true
@ -123,8 +123,9 @@ module.exports = function(grunt) {
});
grunt.registerHelper('templatize', function(src, dest, done) {
var file = grunt.file.read(src);
console.log('define(' + _und.template(file).source + ');');
var file = grunt.file.read(src),
out = path.basename(src, '.html');
grunt.file.write(path.join(dest, out + '.js'), 'define(' + _und.template(file).source + ');')
done();
});

9404
libs/jquery/jquery-1.7.2.js vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -7,7 +7,7 @@
%link{:rel => "stylesheet", :href => "style.css", :type => "text/css"}/
%link{:rel => "shortcut icon", :type => "image/x-icon", :href => "images/favicon.ico"}/
%link{:rel => "shortcut icon", :type => "image/png", :href => "images/favicon.png"}/
%script{:language => "javascript", :type => "text/javascript", :src => "prioritize.js", "data-main" => "prioritize"}
%script{:language => "javascript", :type => "text/javascript", :src => "require.js", "data-main" => "priority"}
%title Priority / Ignore
%body

View File

@ -1,4 +1,8 @@
require ['jquery', 'priority_tmpl'], ($, priority_template, new_priority_template, help_template) ->
require.config
paths:
'jquery': 'libs/jquery-1.7.2'
require ['jquery', 'priority_tmpl'], ($, priority_template) ->
class Prioritize

5
src/priority_tmpl.haml Normal file
View File

@ -0,0 +1,5 @@
%ul.priorities
<% var i,l,p; for(i=0,l=priorities.length;i<l;++i) { p=priorities[i]; %>
%li.task
.taskc <%= p.name %>
<% } %>