Skip to content

Commit

Permalink
merged refactor148, resolved conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
arshaw committed Sep 27, 2010
2 parents a436ea7 + d42f3dc commit 1d93c56
Show file tree
Hide file tree
Showing 136 changed files with 5,079 additions and 5,275 deletions.
126 changes: 76 additions & 50 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,69 +1,95 @@

SRC_DIR = src
EXAMPLES_DIR = examples
BUILD_DIR = build
DIST_DIR = dist

JS_SRC_FILES = \
${SRC_DIR}/main.js \
${SRC_DIR}/grid.js \
${SRC_DIR}/agenda.js \
${SRC_DIR}/view.js \
${SRC_DIR}/selection_util.js \
${SRC_DIR}/util.js

CSS_SRC_FILES = \
${SRC_DIR}/css/main.css \
${SRC_DIR}/css/grid.css \
${SRC_DIR}/css/agenda.css

DEMOS_DIR = demos
OTHER_FILES = \
${SRC_DIR}/jquery \
changelog.txt

VER = `cat version.txt`
changelog.txt \
MIT-LICENSE.txt \
GPL-LICENSE.txt

VER = $$(cat version.txt)
VER_SED = sed s/@VERSION/"${VER}"/
DATE = `git log -1 | grep Date: | sed 's/[^:]*: *//'`
DATE = $$(git log -1 --pretty=format:%ad)
DATE_SED = sed s/@DATE/"${DATE}"/

JQ = $$(sed -n "s/.*JQUERY\s*=\s*[\"']\(.*\)[\"'].*/\1/p" "${SRC_DIR}/_loader.js")
JQUI = $$(sed -n "s/.*JQUERY_UI\s*=\s*[\"']\(.*\)[\"'].*/\1/p" "${SRC_DIR}/_loader.js")

DEMO_FILES = $$(cd ${DEMOS_DIR}; find . -mindepth 1 -maxdepth 1 -type f)
DEMO_SUBDIRS = $$(cd ${DEMOS_DIR}; find . -mindepth 1 -maxdepth 1 -type d)
DEMO_RE = \(<script[^>]*_loader\.js[^>]*><\/script>\|<!--\[\[\|\]\]-->\)\s*
DEMO_SED = sed -n "1h;1!H;\$${;g;s/${DEMO_RE}//g;p;}"

JS_SED = sed -n "s/\s*js([\"']\(.*\)[\"']).*/\1/p"
CSS_SED = sed -n "s/\s*css([\"']\(.*\)[\"']).*/\1/p"

concat_js = \
files=$$(cat "$(1)/_loader.js" | ${JS_SED}); \
if [ -f "$(1)/intro.js" ]; then \
files="intro.js $$files"; \
fi; \
if [ -f "$(1)/outro.js" ]; then \
files="$$files outro.js"; \
fi; \
old=$$PWD; \
(cd "$(1)"; cat $$files; cd "$$old") \
| ${VER_SED} \
| ${DATE_SED} \
> "$(2)"

concat_css = \
files=$$(cat "$(1)/_loader.js" | ${CSS_SED}); \
if [ "$$files" ]; then \
old=$$PWD; \
(cd "$(1)"; cat $$files; cd "$$old") \
| ${VER_SED} \
| ${DATE_SED} \
> "$(2)"; \
fi

zip:
@rm -rf ${BUILD_DIR}/fullcalendar
@rm -rf ${BUILD_DIR}/fullcalendar-*
@mkdir -p ${BUILD_DIR}/fullcalendar
@mkdir -p ${BUILD_DIR}/fullcalendar/fullcalendar/

@echo "building js..."
@cat ${SRC_DIR}/misc/head.txt ${JS_SRC_FILES} ${SRC_DIR}/misc/foot.txt \
| ${VER_SED} | ${DATE_SED} \
> ${BUILD_DIR}/fullcalendar/fullcalendar.js
@cat ${SRC_DIR}/gcal.js \
| ${VER_SED} | ${DATE_SED} \
> ${BUILD_DIR}/fullcalendar/gcal.js

@echo "compressing js..."
@java -jar ${BUILD_DIR}/compiler.jar --js ${BUILD_DIR}/fullcalendar/fullcalendar.js \
> ${BUILD_DIR}/fullcalendar/fullcalendar.min.js

@echo "building css..."
@cat ${CSS_SRC_FILES} \
| ${VER_SED} | ${DATE_SED} \
> ${BUILD_DIR}/fullcalendar/fullcalendar.css
@echo "building core..."
@$(call concat_js,${SRC_DIR},"${BUILD_DIR}/fullcalendar/fullcalendar/fullcalendar.js")
@$(call concat_css,${SRC_DIR},"${BUILD_DIR}/fullcalendar/fullcalendar/fullcalendar.css")

@echo "compressing core js..."
@java -jar ${BUILD_DIR}/compiler.jar --warning_level VERBOSE --jscomp_off checkTypes --externs build/externs.js \
--js ${BUILD_DIR}/fullcalendar/fullcalendar/fullcalendar.js \
> ${BUILD_DIR}/fullcalendar/fullcalendar/fullcalendar.min.js; \

@echo "building examples..."
@mkdir -p ${BUILD_DIR}/fullcalendar/examples
@for f in `cd ${EXAMPLES_DIR}; find . -mindepth 1 -maxdepth 1 -type f`; do \
cat ${EXAMPLES_DIR}/$$f \
| sed -n '1h;1!H;$${;g;s/<!--\s*<src>.*<\/src>\s*-->\s*//g;p;}' \
| sed -n '1h;1!H;$${;g;s/<!--\s*<dist>\s*//g;p;}' \
| sed -n '1h;1!H;$${;g;s/<\/dist>\s*-->\s*//g;p;}' \
> ${BUILD_DIR}/fullcalendar/examples/$$f; \
@echo "building plugins..."
@for loader in ${SRC_DIR}/*/_loader.js; do \
dir=`dirname $$loader`; \
name=`basename $$dir`; \
$(call concat_js,$$dir,"${BUILD_DIR}/fullcalendar/fullcalendar/$$name.js"); \
done

@echo "copying jquery..."
@mkdir -p ${BUILD_DIR}/fullcalendar/jquery
@cp lib/${JQ} ${BUILD_DIR}/fullcalendar/jquery
@cp lib/${JQUI} ${BUILD_DIR}/fullcalendar/jquery

@echo "building demos..."
@mkdir -p ${BUILD_DIR}/fullcalendar/demos
@for f in ${DEMO_FILES}; do \
cat ${DEMOS_DIR}/$$f \
| ${DEMO_SED} \
| sed "s/jquery\.js/${JQ}/" \
| sed "s/jquery-ui\.js/${JQUI}/" \
> ${BUILD_DIR}/fullcalendar/demos/$$f; \
done
@for d in `cd ${EXAMPLES_DIR}; find . -mindepth 1 -maxdepth 1 -type d`; do \
cp -r ${EXAMPLES_DIR}/$$d ${BUILD_DIR}/fullcalendar/examples/$$d; \
@for d in ${DEMO_SUBDIRS}; do \
cp -r ${DEMOS_DIR}/$$d ${BUILD_DIR}/fullcalendar/demos/$$d; \
done

@echo "copying other files..."
@cp -r ${OTHER_FILES} ${BUILD_DIR}/fullcalendar

@echo "zipping..."
@mv ${BUILD_DIR}/fullcalendar ${BUILD_DIR}/fullcalendar-${VER}
@cd ${BUILD_DIR}; for f in fullcalendar-*; do \
Expand All @@ -74,7 +100,7 @@ zip:
@mkdir -p ${DIST_DIR}
@mv ${BUILD_DIR}/fullcalendar-${VER}.zip ${DIST_DIR}
@echo "done."

clean:
@rm -rf ${BUILD_DIR}/fullcalendar
@rm -rf ${BUILD_DIR}/fullcalendar-*
Expand Down
1 change: 1 addition & 0 deletions build/externs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
var jQuery;
28 changes: 7 additions & 21 deletions examples/agenda-views.html → demos/agenda-views.html
Original file line number Diff line number Diff line change
@@ -1,27 +1,13 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<!--<src>-->
<link rel='stylesheet' type='text/css' href='../src/css/main.css' />
<link rel='stylesheet' type='text/css' href='../src/css/grid.css' />
<link rel='stylesheet' type='text/css' href='../src/css/agenda.css' />
<script type='text/javascript' src='../src/jquery/jquery.js'></script>
<script type='text/javascript' src='../src/jquery/jquery-ui-custom.js'></script>
<script type='text/javascript' src='../src/main.js'></script>
<script type='text/javascript' src='../src/grid.js'></script>
<script type='text/javascript' src='../src/agenda.js'></script>
<script type='text/javascript' src='../src/view.js'></script>
<script type='text/javascript' src='../src/selection_util.js'></script>
<script type='text/javascript' src='../src/util.js'></script>
<!--</src>-->
<!--
<dist>
<link rel='stylesheet' type='text/css' href='../fullcalendar.css' />
<script type='text/javascript' src='../src/_loader.js'></script>
<!--[[
<link rel='stylesheet' type='text/css' href='../fullcalendar/fullcalendar.css' />
<script type='text/javascript' src='../jquery/jquery.js'></script>
<script type='text/javascript' src='../jquery/jquery-ui-custom.js'></script>
<script type='text/javascript' src='../fullcalendar.min.js'></script>
</dist>
-->
<script type='text/javascript' src='../jquery/jquery-ui.js'></script>
<script type='text/javascript' src='../fullcalendar/fullcalendar.min.js'></script>
]]-->
<script type='text/javascript'>

$(document).ready(function() {
Expand Down
28 changes: 7 additions & 21 deletions examples/basic-views.html → demos/basic-views.html
Original file line number Diff line number Diff line change
@@ -1,27 +1,13 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<!--<src>-->
<link rel='stylesheet' type='text/css' href='../src/css/main.css' />
<link rel='stylesheet' type='text/css' href='../src/css/grid.css' />
<link rel='stylesheet' type='text/css' href='../src/css/agenda.css' />
<script type='text/javascript' src='../src/jquery/jquery.js'></script>
<script type='text/javascript' src='../src/jquery/jquery-ui-custom.js'></script>
<script type='text/javascript' src='../src/main.js'></script>
<script type='text/javascript' src='../src/grid.js'></script>
<script type='text/javascript' src='../src/agenda.js'></script>
<script type='text/javascript' src='../src/view.js'></script>
<script type='text/javascript' src='../src/selection_util.js'></script>
<script type='text/javascript' src='../src/util.js'></script>
<!--</src>-->
<!--
<dist>
<link rel='stylesheet' type='text/css' href='../fullcalendar.css' />
<script type='text/javascript' src='../src/_loader.js'></script>
<!--[[
<link rel='stylesheet' type='text/css' href='../fullcalendar/fullcalendar.css' />
<script type='text/javascript' src='../jquery/jquery.js'></script>
<script type='text/javascript' src='../jquery/jquery-ui-custom.js'></script>
<script type='text/javascript' src='../fullcalendar.min.js'></script>
</dist>
-->
<script type='text/javascript' src='../jquery/jquery-ui.js'></script>
<script type='text/javascript' src='../fullcalendar/fullcalendar.min.js'></script>
]]-->
<script type='text/javascript'>

$(document).ready(function() {
Expand Down
28 changes: 7 additions & 21 deletions examples/default.html → demos/default.html
Original file line number Diff line number Diff line change
@@ -1,27 +1,13 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<!--<src>-->
<link rel='stylesheet' type='text/css' href='../src/css/main.css' />
<link rel='stylesheet' type='text/css' href='../src/css/grid.css' />
<link rel='stylesheet' type='text/css' href='../src/css/agenda.css' />
<script type='text/javascript' src='../src/jquery/jquery.js'></script>
<script type='text/javascript' src='../src/jquery/jquery-ui-custom.js'></script>
<script type='text/javascript' src='../src/main.js'></script>
<script type='text/javascript' src='../src/grid.js'></script>
<script type='text/javascript' src='../src/agenda.js'></script>
<script type='text/javascript' src='../src/view.js'></script>
<script type='text/javascript' src='../src/selection_util.js'></script>
<script type='text/javascript' src='../src/util.js'></script>
<!--</src>-->
<!--
<dist>
<link rel='stylesheet' type='text/css' href='../fullcalendar.css' />
<script type='text/javascript' src='../src/_loader.js'></script>
<!--[[
<link rel='stylesheet' type='text/css' href='../fullcalendar/fullcalendar.css' />
<script type='text/javascript' src='../jquery/jquery.js'></script>
<script type='text/javascript' src='../jquery/jquery-ui-custom.js'></script>
<script type='text/javascript' src='../fullcalendar.min.js'></script>
</dist>
-->
<script type='text/javascript' src='../jquery/jquery-ui.js'></script>
<script type='text/javascript' src='../fullcalendar/fullcalendar.min.js'></script>
]]-->
<script type='text/javascript'>

$(document).ready(function() {
Expand Down
28 changes: 7 additions & 21 deletions examples/external-dragging.html → demos/external-dragging.html
Original file line number Diff line number Diff line change
@@ -1,27 +1,13 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<!--<src>-->
<link rel='stylesheet' type='text/css' href='../src/css/main.css' />
<link rel='stylesheet' type='text/css' href='../src/css/grid.css' />
<link rel='stylesheet' type='text/css' href='../src/css/agenda.css' />
<script type='text/javascript' src='../src/jquery/jquery.js'></script>
<script type='text/javascript' src='../src/jquery/jquery-ui-custom.js'></script>
<script type='text/javascript' src='../src/main.js'></script>
<script type='text/javascript' src='../src/grid.js'></script>
<script type='text/javascript' src='../src/agenda.js'></script>
<script type='text/javascript' src='../src/view.js'></script>
<script type='text/javascript' src='../src/selection_util.js'></script>
<script type='text/javascript' src='../src/util.js'></script>
<!--</src>-->
<!--
<dist>
<link rel='stylesheet' type='text/css' href='../fullcalendar.css' />
<script type='text/javascript' src='../src/_loader.js'></script>
<!--[[
<link rel='stylesheet' type='text/css' href='../fullcalendar/fullcalendar.css' />
<script type='text/javascript' src='../jquery/jquery.js'></script>
<script type='text/javascript' src='../jquery/jquery-ui-custom.js'></script>
<script type='text/javascript' src='../fullcalendar.min.js'></script>
</dist>
-->
<script type='text/javascript' src='../jquery/jquery-ui.js'></script>
<script type='text/javascript' src='../fullcalendar/fullcalendar.min.js'></script>
]]-->
<script type='text/javascript'>

$(document).ready(function() {
Expand Down
67 changes: 67 additions & 0 deletions demos/gcal.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<script type='text/javascript' src='../src/_loader.js'></script>
<script type='text/javascript' src='../src/gcal/_loader.js'></script>
<!--[[
<link rel='stylesheet' type='text/css' href='../fullcalendar/fullcalendar.css' />
<script type='text/javascript' src='../jquery/jquery.js'></script>
<script type='text/javascript' src='../jquery/jquery-ui.js'></script>
<script type='text/javascript' src='../fullcalendar/fullcalendar.min.js'></script>
<script type='text/javascript' src='../fullcalendar/gcal.js'></script>
]]-->
<script type='text/javascript'>

$(document).ready(function() {

$('#calendar').fullCalendar({

// US Holidays
events: $.fullCalendar.gcalFeed('http://www.google.com/calendar/feeds/usa__en%40holiday.calendar.google.com/public/basic'),

eventClick: function(event) {
// opens events in a popup window
window.open(event.url, 'gcalevent', 'width=700,height=600');
return false;
},

loading: function(bool) {
if (bool) {
$('#loading').show();
}else{
$('#loading').hide();
}
}

});

});

</script>
<style type='text/css'>

body {
margin-top: 40px;
text-align: center;
font-size: 14px;
font-family: "Lucida Grande",Helvetica,Arial,Verdana,sans-serif;
}

#loading {
position: absolute;
top: 5px;
right: 5px;
}

#calendar {
width: 900px;
margin: 0 auto;
}

</style>
</head>
<body>
<div id='loading' style='display:none'>loading...</div>
<div id='calendar'></div>
</body>
</html>
File renamed without changes.
Loading

0 comments on commit 1d93c56

Please sign in to comment.