Commit 61e220e3 authored by Kjetil Thuen's avatar Kjetil Thuen
Browse files

Use bower to handle external dependencies

parent 419dda02
target
components
.idea
.settings
.classpath
......
To get up and running:
$ npm install -g bower
$ cd src/main/webapp/
$ bower install
{
"name": "TabulationMobile",
"version": "0.0.1",
"ignore": [
"**/.*",
"node_modules",
"components"
],
"dependencies": {
"dojo": "1.8.3",
"dojox": "1.8.3",
"dijit": "1.8.3",
}
}
......@@ -6,14 +6,9 @@
<meta charset="utf-8">
<title>Nesstar Mobile</title>
<link href="http://ajax.googleapis.com/ajax/libs/dojo/1.8.1/dojox/mobile/themes/iphone/iphone.css" rel="stylesheet"></link>
<link rel="stylesheet" type="text/css" href="css/overlay.css"></link>
<!-- <link rel="stylesheet" type="text/css" href="css/sidebar.css"/> -->
<!-- <link rel="stylesheet" type="text/css" href="css/style.css"> -->
<link rel="apple-touch-icon" href="images/apple-touch-icon.png">
<link rel="apple-touch-icon-precomposed" href="images/apple-touch-icon.png">
<script src="js/dojo/dojo.js" data-dojo-config="async:true"></script>
</head>
......@@ -30,12 +25,14 @@
packages: [
{
name: 'nesstarmobile',
location: base + '/js/nesstarmobile'
location: base + '/js/'
}
]
};
})();
</script>
<script src="components/dojo/dojo.js" data-dojo-config="async: true"></script>
<script>
var splash;
......@@ -43,7 +40,7 @@
function(declare, dom, domStyle, fx) {
var SplashScreen = declare(null, {
overlayNode: 'splash',
endLoading: function() {
this.doFadeAndHiding();
},
......@@ -80,7 +77,7 @@
function(parser) {
parser.parse();
});
})
</script>
<!-- select study view -->
......
//>>built
define("dijit/BackgroundIframe",["require","./main","dojo/_base/config","dojo/dom-construct","dojo/dom-style","dojo/_base/lang","dojo/on","dojo/sniff","dojo/_base/window"],function(_1,_2,_3,_4,_5,_6,on,_7,_8){
var _9=new function(){
var _a=[];
this.pop=function(){
var _b;
if(_a.length){
_b=_a.pop();
_b.style.display="";
}else{
if(_7("ie")<9){
var _c=_3["dojoBlankHtmlUrl"]||_1.toUrl("dojo/resources/blank.html")||"javascript:\"\"";
var _d="<iframe src='"+_c+"' role='presentation'"+" style='position: absolute; left: 0px; top: 0px;"+"z-index: -1; filter:Alpha(Opacity=\"0\");'>";
_b=_8.doc.createElement(_d);
}else{
_b=_4.create("iframe");
_b.src="javascript:\"\"";
_b.className="dijitBackgroundIframe";
_b.setAttribute("role","presentation");
_5.set(_b,"opacity",0.1);
}
_b.tabIndex=-1;
}
return _b;
};
this.push=function(_e){
_e.style.display="none";
_a.push(_e);
};
}();
_2.BackgroundIframe=function(_f){
if(!_f.id){
throw new Error("no id");
}
if(_7("ie")||_7("mozilla")){
var _10=(this.iframe=_9.pop());
_f.appendChild(_10);
if(_7("ie")<7||_7("quirks")){
this.resize(_f);
this._conn=on(_f,"resize",_6.hitch(this,function(){
this.resize(_f);
}));
}else{
_5.set(_10,{width:"100%",height:"100%"});
}
}
};
_6.extend(_2.BackgroundIframe,{resize:function(_11){
if(this.iframe){
_5.set(this.iframe,{width:_11.offsetWidth+"px",height:_11.offsetHeight+"px"});
}
},destroy:function(){
if(this._conn){
this._conn.remove();
this._conn=null;
}
if(this.iframe){
_9.push(this.iframe);
delete this.iframe;
}
}});
return _2.BackgroundIframe;
});
define("dijit/BackgroundIframe", [
"require", // require.toUrl
"./main", // to export dijit.BackgroundIframe
"dojo/_base/config",
"dojo/dom-construct", // domConstruct.create
"dojo/dom-style", // domStyle.set
"dojo/_base/lang", // lang.extend lang.hitch
"dojo/on",
"dojo/sniff", // has("ie"), has("mozilla"), has("quirks")
"dojo/_base/window" // win.doc.createElement
], function(require, dijit, config, domConstruct, domStyle, lang, on, has, win){
// module:
// dijit/BackgroundIFrame
// TODO: remove _frames, it isn't being used much, since popups never release their
// iframes (see [22236])
var _frames = new function(){
// summary:
// cache of iframes
var queue = [];
this.pop = function(){
var iframe;
if(queue.length){
iframe = queue.pop();
iframe.style.display="";
}else{
if(has("ie") < 9){
var burl = config["dojoBlankHtmlUrl"] || require.toUrl("dojo/resources/blank.html") || "javascript:\"\"";
var html="<iframe src='" + burl + "' role='presentation'"
+ " style='position: absolute; left: 0px; top: 0px;"
+ "z-index: -1; filter:Alpha(Opacity=\"0\");'>";
iframe = win.doc.createElement(html);
}else{
iframe = domConstruct.create("iframe");
iframe.src = 'javascript:""';
iframe.className = "dijitBackgroundIframe";
iframe.setAttribute("role", "presentation");
domStyle.set(iframe, "opacity", 0.1);
}
iframe.tabIndex = -1; // Magic to prevent iframe from getting focus on tab keypress - as style didn't work.
}
return iframe;
};
this.push = function(iframe){
iframe.style.display="none";
queue.push(iframe);
}
}();
dijit.BackgroundIframe = function(/*DomNode*/ node){
// summary:
// For IE/FF z-index schenanigans. id attribute is required.
//
// description:
// new dijit.BackgroundIframe(node).
//
// Makes a background iframe as a child of node, that fills
// area (and position) of node
if(!node.id){ throw new Error("no id"); }
if(has("ie") || has("mozilla")){
var iframe = (this.iframe = _frames.pop());
node.appendChild(iframe);
if(has("ie")<7 || has("quirks")){
this.resize(node);
this._conn = on(node, 'resize', lang.hitch(this, function(){
this.resize(node);
}));
}else{
domStyle.set(iframe, {
width: '100%',
height: '100%'
});
}
}
};
lang.extend(dijit.BackgroundIframe, {
resize: function(node){
// summary:
// Resize the iframe so it's the same size as node.
// Needed on IE6 and IE/quirks because height:100% doesn't work right.
if(this.iframe){
domStyle.set(this.iframe, {
width: node.offsetWidth + 'px',
height: node.offsetHeight + 'px'
});
}
},
destroy: function(){
// summary:
// destroy the iframe
if(this._conn){
this._conn.remove();
this._conn = null;
}
if(this.iframe){
_frames.push(this.iframe);
delete this.iframe;
}
}
});
return dijit.BackgroundIframe;
});
//>>built
define("dijit/Calendar",["dojo/_base/array","dojo/date","dojo/date/locale","dojo/_base/declare","dojo/dom-attr","dojo/dom-class","dojo/_base/event","dojo/_base/kernel","dojo/keys","dojo/_base/lang","dojo/sniff","./CalendarLite","./_Widget","./_CssStateMixin","./_TemplatedMixin","./form/DropDownButton"],function(_1,_2,_3,_4,_5,_6,_7,_8,_9,_a,_b,_c,_d,_e,_f,_10){
var _11=_4("dijit.Calendar",[_c,_d,_e],{cssStateNodes:{"decrementMonth":"dijitCalendarArrow","incrementMonth":"dijitCalendarArrow","previousYearLabelNode":"dijitCalendarPreviousYear","nextYearLabelNode":"dijitCalendarNextYear"},setValue:function(_12){
_8.deprecated("dijit.Calendar:setValue() is deprecated. Use set('value', ...) instead.","","2.0");
this.set("value",_12);
},_createMonthWidget:function(){
return new _11._MonthDropDownButton({id:this.id+"_mddb",tabIndex:-1,onMonthSelect:_a.hitch(this,"_onMonthSelect"),lang:this.lang,dateLocaleModule:this.dateLocaleModule},this.monthNode);
},postCreate:function(){
this.inherited(arguments);
this.connect(this.domNode,"onkeydown","_onKeyDown");
this.connect(this.dateRowsNode,"onmouseover","_onDayMouseOver");
this.connect(this.dateRowsNode,"onmouseout","_onDayMouseOut");
this.connect(this.dateRowsNode,"onmousedown","_onDayMouseDown");
this.connect(this.dateRowsNode,"onmouseup","_onDayMouseUp");
},_onMonthSelect:function(_13){
var _14=new this.dateClassObj(this.currentFocus);
_14.setDate(1);
_14.setMonth(_13);
var _15=this.dateModule.getDaysInMonth(_14);
var _16=this.currentFocus.getDate();
_14.setDate(Math.min(_16,_15));
this._setCurrentFocusAttr(_14);
},_onDayMouseOver:function(evt){
var _17=_6.contains(evt.target,"dijitCalendarDateLabel")?evt.target.parentNode:evt.target;
if(_17&&((_17.dijitDateValue&&!_6.contains(_17,"dijitCalendarDisabledDate"))||_17==this.previousYearLabelNode||_17==this.nextYearLabelNode)){
_6.add(_17,"dijitCalendarHoveredDate");
this._currentNode=_17;
}
},_onDayMouseOut:function(evt){
if(!this._currentNode){
return;
}
if(evt.relatedTarget&&evt.relatedTarget.parentNode==this._currentNode){
return;
}
var cls="dijitCalendarHoveredDate";
if(_6.contains(this._currentNode,"dijitCalendarActiveDate")){
cls+=" dijitCalendarActiveDate";
}
_6.remove(this._currentNode,cls);
this._currentNode=null;
},_onDayMouseDown:function(evt){
var _18=evt.target.parentNode;
if(_18&&_18.dijitDateValue&&!_6.contains(_18,"dijitCalendarDisabledDate")){
_6.add(_18,"dijitCalendarActiveDate");
this._currentNode=_18;
}
},_onDayMouseUp:function(evt){
var _19=evt.target.parentNode;
if(_19&&_19.dijitDateValue){
_6.remove(_19,"dijitCalendarActiveDate");
}
},handleKey:function(evt){
var _1a=-1,_1b,_1c=this.currentFocus;
switch(evt.keyCode){
case _9.RIGHT_ARROW:
_1a=1;
case _9.LEFT_ARROW:
_1b="day";
if(!this.isLeftToRight()){
_1a*=-1;
}
break;
case _9.DOWN_ARROW:
_1a=1;
case _9.UP_ARROW:
_1b="week";
break;
case _9.PAGE_DOWN:
_1a=1;
case _9.PAGE_UP:
_1b=evt.ctrlKey||evt.altKey?"year":"month";
break;
case _9.END:
_1c=this.dateModule.add(_1c,"month",1);
_1b="day";
case _9.HOME:
_1c=new this.dateClassObj(_1c);
_1c.setDate(1);
break;
case _9.ENTER:
case _9.SPACE:
this.set("value",this.currentFocus);
break;
default:
return true;
}
if(_1b){
_1c=this.dateModule.add(_1c,_1b,_1a);
}
this._setCurrentFocusAttr(_1c);
return false;
},_onKeyDown:function(evt){
if(!this.handleKey(evt)){
_7.stop(evt);
}
},onValueSelected:function(){
},onChange:function(_1d){
this.onValueSelected(_1d);
},getClassForDate:function(){
}});
_11._MonthDropDownButton=_4("dijit.Calendar._MonthDropDownButton",_10,{onMonthSelect:function(){
},postCreate:function(){
this.inherited(arguments);
this.dropDown=new _11._MonthDropDown({id:this.id+"_mdd",onChange:this.onMonthSelect});
},_setMonthAttr:function(_1e){
var _1f=this.dateLocaleModule.getNames("months","wide","standAlone",this.lang,_1e);
this.dropDown.set("months",_1f);
this.containerNode.innerHTML=(_b("ie")==6?"":"<div class='dijitSpacer'>"+this.dropDown.domNode.innerHTML+"</div>")+"<div class='dijitCalendarMonthLabel dijitCalendarCurrentMonthLabel'>"+_1f[_1e.getMonth()]+"</div>";
}});
_11._MonthDropDown=_4("dijit.Calendar._MonthDropDown",[_d,_f],{months:[],templateString:"<div class='dijitCalendarMonthMenu dijitMenu' "+"data-dojo-attach-event='onclick:_onClick,onmouseover:_onMenuHover,onmouseout:_onMenuHover'></div>",_setMonthsAttr:function(_20){
this.domNode.innerHTML=_1.map(_20,function(_21,idx){
return _21?"<div class='dijitCalendarMonthLabel' month='"+idx+"'>"+_21+"</div>":"";
}).join("");
},_onClick:function(evt){
this.onChange(_5.get(evt.target,"month"));
},onChange:function(){
},_onMenuHover:function(evt){
_6.toggle(evt.target,"dijitCalendarMonthLabelHover",evt.type=="mouseover");
}});
return _11;
});
define("dijit/Calendar", [
"dojo/_base/array", // array.map
"dojo/date",
"dojo/date/locale",
"dojo/_base/declare", // declare
"dojo/dom-attr", // domAttr.get
"dojo/dom-class", // domClass.add domClass.contains domClass.remove domClass.toggle
"dojo/_base/event", // event.stop
"dojo/_base/kernel", // kernel.deprecated
"dojo/keys", // keys
"dojo/_base/lang", // lang.hitch
"dojo/sniff", // has("ie")
"./CalendarLite",
"./_Widget",
"./_CssStateMixin",
"./_TemplatedMixin",
"./form/DropDownButton"
], function(array, date, local, declare, domAttr, domClass, event, kernel, keys, lang, has,
CalendarLite, _Widget, _CssStateMixin, _TemplatedMixin, DropDownButton){
// module:
// dijit/Calendar
var Calendar = declare("dijit.Calendar",
[CalendarLite, _Widget, _CssStateMixin], // _Widget for deprecated methods like setAttribute()
{
// summary:
// A simple GUI for choosing a date in the context of a monthly calendar.
//
// description:
// See CalendarLite for general description. Calendar extends CalendarLite, adding:
//
// - month drop down list
// - keyboard navigation
// - CSS classes for hover/mousepress on date, month, and year nodes
// - support of deprecated methods (will be removed in 2.0)
// Set node classes for various mouse events, see dijit._CssStateMixin for more details
cssStateNodes: {
"decrementMonth": "dijitCalendarArrow",
"incrementMonth": "dijitCalendarArrow",
"previousYearLabelNode": "dijitCalendarPreviousYear",
"nextYearLabelNode": "dijitCalendarNextYear"
},
setValue: function(/*Date*/ value){
// summary:
// Deprecated. Use set('value', ...) instead.
// tags:
// deprecated
kernel.deprecated("dijit.Calendar:setValue() is deprecated. Use set('value', ...) instead.", "", "2.0");
this.set('value', value);
},
_createMonthWidget: function(){
// summary:
// Creates the drop down button that displays the current month and lets user pick a new one
return new Calendar._MonthDropDownButton({
id: this.id + "_mddb",
tabIndex: -1,
onMonthSelect: lang.hitch(this, "_onMonthSelect"),
lang: this.lang,
dateLocaleModule: this.dateLocaleModule
}, this.monthNode);
},
postCreate: function(){
this.inherited(arguments);
// Events specific to Calendar, not used in CalendarLite
this.connect(this.domNode, "onkeydown", "_onKeyDown");
this.connect(this.dateRowsNode, "onmouseover", "_onDayMouseOver");
this.connect(this.dateRowsNode, "onmouseout", "_onDayMouseOut");
this.connect(this.dateRowsNode, "onmousedown", "_onDayMouseDown");
this.connect(this.dateRowsNode, "onmouseup", "_onDayMouseUp");
},
_onMonthSelect: function(/*Number*/ newMonth){
// summary:
// Handler for when user selects a month from the drop down list
// tags:
// protected
// move to selected month, bounding by the number of days in the month
// (ex: jan 31 --> feb 28, not feb 31)
var date = new this.dateClassObj(this.currentFocus);
date.setDate(1);
date.setMonth(newMonth);
var daysInMonth = this.dateModule.getDaysInMonth(date);
var currentDate = this.currentFocus.getDate();
date.setDate(Math.min(currentDate, daysInMonth));
this._setCurrentFocusAttr(date);
},
_onDayMouseOver: function(/*Event*/ evt){
// summary:
// Handler for mouse over events on days, sets hovered style
// tags:
// protected
// event can occur on <td> or the <span> inside the td,
// set node to the <td>.
var node =
domClass.contains(evt.target, "dijitCalendarDateLabel") ?
evt.target.parentNode :
evt.target;
if(node && (
(node.dijitDateValue && !domClass.contains(node, "dijitCalendarDisabledDate"))
|| node == this.previousYearLabelNode || node == this.nextYearLabelNode
)){
domClass.add(node, "dijitCalendarHoveredDate");
this._currentNode = node;
}
},
_onDayMouseOut: function(/*Event*/ evt){
// summary:
// Handler for mouse out events on days, clears hovered style
// tags:
// protected
if(!this._currentNode){ return; }
// if mouse out occurs moving from <td> to <span> inside <td>, ignore it
if(evt.relatedTarget && evt.relatedTarget.parentNode == this._currentNode){ return; }
var cls = "dijitCalendarHoveredDate";
if(domClass.contains(this._currentNode, "dijitCalendarActiveDate")){
cls += " dijitCalendarActiveDate";
}
domClass.remove(this._currentNode, cls);
this._currentNode = null;
},
_onDayMouseDown: function(/*Event*/ evt){
var node = evt.target.parentNode;
if(node && node.dijitDateValue && !domClass.contains(node, "dijitCalendarDisabledDate")){
domClass.add(node, "dijitCalendarActiveDate");
this._currentNode = node;
}
},
_onDayMouseUp: function(/*Event*/ evt){
var node = evt.target.parentNode;
if(node && node.dijitDateValue){
domClass.remove(node, "dijitCalendarActiveDate");
}
},
handleKey: function(/*Event*/ evt){
// summary:
// Provides keyboard navigation of calendar.
// description:
// Called from _onKeyDown() to handle keypress on a stand alone Calendar,
// and also from `dijit/form/_DateTimeTextBox` to pass a keydown event
// from the `dijit/form/DateTextBox` to be handled in this widget
// returns:
// False if the key was recognized as a navigation key,
// to indicate that the event was handled by Calendar and shouldn't be propagated
// tags:
// protected
var increment = -1,
interval,
newValue = this.currentFocus;
switch(evt.keyCode){
case keys.RIGHT_ARROW:
increment = 1;
//fallthrough...
case keys.LEFT_ARROW:
interval = "day";
if(!this.isLeftToRight()){ increment *= -1; }
break;
case keys.DOWN_ARROW:
increment = 1;
//fallthrough...
case keys.UP_ARROW:
interval = "week";
break;
case keys.PAGE_DOWN:
increment = 1;
//fallthrough...
case keys.PAGE_UP:
interval = evt.ctrlKey || evt.altKey ? "year" : "month";
break;
case keys.END:
// go to the next month
newValue = this.dateModule.add(newValue, "month", 1);
// subtract a day from the result when we're done
interval = "day";
//fallthrough...
case keys.HOME:
newValue = new this.dateClassObj(newValue);
newValue.setDate(1);
break;
case keys.ENTER:
case keys.SPACE: