commit 3a8ecd4bde88451afb227841bdda47eb5e1ba290 Author: Pin Lin Date: Thu Feb 1 19:48:42 2018 +0800 wow, so web diff --git a/TaiwanTech.png b/TaiwanTech.png new file mode 100644 index 0000000..9112646 Binary files /dev/null and b/TaiwanTech.png differ diff --git a/bg.jpg b/bg.jpg new file mode 100644 index 0000000..cb85241 Binary files /dev/null and b/bg.jpg differ diff --git a/chipet/.DS_Store b/chipet/.DS_Store new file mode 100644 index 0000000..01edeeb Binary files /dev/null and b/chipet/.DS_Store differ diff --git a/chipet/Flip/.DS_Store b/chipet/Flip/.DS_Store new file mode 100644 index 0000000..62597e6 Binary files /dev/null and b/chipet/Flip/.DS_Store differ diff --git a/chipet/Flip/Flip.css b/chipet/Flip/Flip.css new file mode 100644 index 0000000..2124b60 --- /dev/null +++ b/chipet/Flip/Flip.css @@ -0,0 +1 @@ +.flip { position:absolute; top:111px; left: 128px; width:21px; height:18px; opacity:0.0; } #flip { background:url(i.png) no-repeat center center; z-index:8000; } #fliprollie { display:none; opacity:0.5; background:url(i_rollie.png) no-repeat center left; z-index:7999; } #front { display:block; } #back { display:none; } \ No newline at end of file diff --git a/chipet/Flip/Flip.js b/chipet/Flip/Flip.js new file mode 100644 index 0000000..60dc662 --- /dev/null +++ b/chipet/Flip/Flip.js @@ -0,0 +1 @@ +function showBack() { var front = document.getElementById("front"); var back = document.getElementById("back"); if (window.widget) widget.prepareForTransition("ToBack"); front.style.display="none"; back.style.display="block"; if (window.widget) setTimeout ('widget.performTransition();', 0); document.getElementById('fliprollie').style.display = 'none'; } function hideBack() { var front = document.getElementById("front"); var back = document.getElementById("back"); if (window.widget) widget.prepareForTransition("ToFront"); back.style.display="none"; front.style.display="block"; document.getElementById('flip').style.backgroundImage = "url('Flip/i.png')"; if (window.widget) setTimeout ('widget.performTransition();', 0); } var flipShown = false; var animation = {duration:0, starttime:0, to:1.0, now:0.0, from:0.0, firstElement:null, timer:null}; function mousemove (event) { if (!flipShown) { if (animation.timer != null) { clearInterval (animation.timer); animation.timer = null; } var starttime = (new Date).getTime() - 13; animation.duration = 500; animation.starttime = starttime; animation.firstElement = document.getElementById ('flip'); animation.timer = setInterval ("animate();", 13); animation.from = animation.now; animation.to = 1.0; animate(); flipShown = true; } } function mouseexit (event) { if (flipShown) { // fade in the info button if (animation.timer != null) { clearInterval (animation.timer); animation.timer = null; } var starttime = (new Date).getTime() - 13; animation.duration = 500; animation.starttime = starttime; animation.firstElement = document.getElementById ('flip'); animation.timer = setInterval ("animate();", 13); animation.from = animation.now; animation.to = 0.0; animate(); flipShown = false; } } function animate() { var T; var ease; var time = (new Date).getTime(); T = limit_3(time-animation.starttime, 0, animation.duration); if (T >= animation.duration) { clearInterval (animation.timer); animation.timer = null; animation.now = animation.to; } else { ease = 0.5 - (0.5 * Math.cos(Math.PI * T / animation.duration)); animation.now = computeNextFloat (animation.from, animation.to, ease); } animation.firstElement.style.opacity = animation.now; } function limit_3 (a, b, c) { return a < b ? b : (a > c ? c : a); } function computeNextFloat (from, to, ease) { return from + (to - from) * ease; } function enterflip(event) { document.getElementById('flip').style.backgroundImage = "url('Flip/i_rollie.png')"; } function exitflip(event) { document.getElementById('flip').style.backgroundImage = "url('Flip/i.png')"; } \ No newline at end of file diff --git a/chipet/Flip/back.png b/chipet/Flip/back.png new file mode 100644 index 0000000..d43467d Binary files /dev/null and b/chipet/Flip/back.png differ diff --git a/chipet/Flip/done.png b/chipet/Flip/done.png new file mode 100644 index 0000000..1766551 Binary files /dev/null and b/chipet/Flip/done.png differ diff --git a/chipet/Flip/done_click.png b/chipet/Flip/done_click.png new file mode 100644 index 0000000..20d819f Binary files /dev/null and b/chipet/Flip/done_click.png differ diff --git a/chipet/Flip/down_arrow.png b/chipet/Flip/down_arrow.png new file mode 100644 index 0000000..530a995 Binary files /dev/null and b/chipet/Flip/down_arrow.png differ diff --git a/chipet/Flip/i.png b/chipet/Flip/i.png new file mode 100644 index 0000000..e2bfcde Binary files /dev/null and b/chipet/Flip/i.png differ diff --git a/chipet/Flip/i_rollie.png b/chipet/Flip/i_rollie.png new file mode 100644 index 0000000..8d432c4 Binary files /dev/null and b/chipet/Flip/i_rollie.png differ diff --git a/chipet/Flip/nd.png b/chipet/Flip/nd.png new file mode 100644 index 0000000..fe50f06 Binary files /dev/null and b/chipet/Flip/nd.png differ diff --git a/chipet/Flip/up_arrow.png b/chipet/Flip/up_arrow.png new file mode 100644 index 0000000..895bfeb Binary files /dev/null and b/chipet/Flip/up_arrow.png differ diff --git a/chipet/Icon.png b/chipet/Icon.png new file mode 100644 index 0000000..d487440 Binary files /dev/null and b/chipet/Icon.png differ diff --git a/chipet/Images/.DS_Store b/chipet/Images/.DS_Store new file mode 100644 index 0000000..f65d755 Binary files /dev/null and b/chipet/Images/.DS_Store differ diff --git a/chipet/Images/barberpole.png b/chipet/Images/barberpole.png new file mode 100644 index 0000000..e115876 Binary files /dev/null and b/chipet/Images/barberpole.png differ diff --git a/chipet/Images/barberpoleover.png b/chipet/Images/barberpoleover.png new file mode 100644 index 0000000..53b4177 Binary files /dev/null and b/chipet/Images/barberpoleover.png differ diff --git a/chipet/Images/box.png b/chipet/Images/box.png new file mode 100644 index 0000000..9db7c09 Binary files /dev/null and b/chipet/Images/box.png differ diff --git a/chipet/Images/chistart.png b/chipet/Images/chistart.png new file mode 100644 index 0000000..0dd46b2 Binary files /dev/null and b/chipet/Images/chistart.png differ diff --git a/chipet/Images/cut1.png b/chipet/Images/cut1.png new file mode 100644 index 0000000..0202ee5 Binary files /dev/null and b/chipet/Images/cut1.png differ diff --git a/chipet/Images/cut2.png b/chipet/Images/cut2.png new file mode 100644 index 0000000..08399bc Binary files /dev/null and b/chipet/Images/cut2.png differ diff --git a/chipet/Images/cut3.png b/chipet/Images/cut3.png new file mode 100644 index 0000000..ea235db Binary files /dev/null and b/chipet/Images/cut3.png differ diff --git a/chipet/Images/day1.png b/chipet/Images/day1.png new file mode 100644 index 0000000..1482399 Binary files /dev/null and b/chipet/Images/day1.png differ diff --git a/chipet/Images/day2.png b/chipet/Images/day2.png new file mode 100644 index 0000000..a4ddbff Binary files /dev/null and b/chipet/Images/day2.png differ diff --git a/chipet/Images/day3.png b/chipet/Images/day3.png new file mode 100644 index 0000000..5a1aa12 Binary files /dev/null and b/chipet/Images/day3.png differ diff --git a/chipet/Images/day4.png b/chipet/Images/day4.png new file mode 100644 index 0000000..c12255c Binary files /dev/null and b/chipet/Images/day4.png differ diff --git a/chipet/Images/day5.png b/chipet/Images/day5.png new file mode 100644 index 0000000..1b90357 Binary files /dev/null and b/chipet/Images/day5.png differ diff --git a/chipet/Images/day6.png b/chipet/Images/day6.png new file mode 100644 index 0000000..b827003 Binary files /dev/null and b/chipet/Images/day6.png differ diff --git a/chipet/Images/dead.png b/chipet/Images/dead.png new file mode 100644 index 0000000..57120de Binary files /dev/null and b/chipet/Images/dead.png differ diff --git a/chipet/Images/deadmess.png b/chipet/Images/deadmess.png new file mode 100644 index 0000000..370d757 Binary files /dev/null and b/chipet/Images/deadmess.png differ diff --git a/chipet/Images/hat.png b/chipet/Images/hat.png new file mode 100644 index 0000000..093dfde Binary files /dev/null and b/chipet/Images/hat.png differ diff --git a/chipet/Images/hibernation_off.png b/chipet/Images/hibernation_off.png new file mode 100644 index 0000000..b5a0b06 Binary files /dev/null and b/chipet/Images/hibernation_off.png differ diff --git a/chipet/Images/hibernation_on.png b/chipet/Images/hibernation_on.png new file mode 100644 index 0000000..218411b Binary files /dev/null and b/chipet/Images/hibernation_on.png differ diff --git a/chipet/Images/rain/.DS_Store b/chipet/Images/rain/.DS_Store new file mode 100644 index 0000000..ba56c5a Binary files /dev/null and b/chipet/Images/rain/.DS_Store differ diff --git a/chipet/Images/rain/rain1.png b/chipet/Images/rain/rain1.png new file mode 100644 index 0000000..0ad1d09 Binary files /dev/null and b/chipet/Images/rain/rain1.png differ diff --git a/chipet/Images/rain/rain2.png b/chipet/Images/rain/rain2.png new file mode 100644 index 0000000..7cc9db5 Binary files /dev/null and b/chipet/Images/rain/rain2.png differ diff --git a/chipet/Images/rain/rain3.png b/chipet/Images/rain/rain3.png new file mode 100644 index 0000000..a20ad80 Binary files /dev/null and b/chipet/Images/rain/rain3.png differ diff --git a/chipet/Images/rain/rain4.png b/chipet/Images/rain/rain4.png new file mode 100644 index 0000000..0695f44 Binary files /dev/null and b/chipet/Images/rain/rain4.png differ diff --git a/chipet/Images/rain/rain5.png b/chipet/Images/rain/rain5.png new file mode 100644 index 0000000..97e7f43 Binary files /dev/null and b/chipet/Images/rain/rain5.png differ diff --git a/chipet/Images/rain/rain6.png b/chipet/Images/rain/rain6.png new file mode 100644 index 0000000..c10bed4 Binary files /dev/null and b/chipet/Images/rain/rain6.png differ diff --git a/chipet/Images/rain/rain7.png b/chipet/Images/rain/rain7.png new file mode 100644 index 0000000..9872d7c Binary files /dev/null and b/chipet/Images/rain/rain7.png differ diff --git a/chipet/Images/rain/rain8.png b/chipet/Images/rain/rain8.png new file mode 100644 index 0000000..10e0d31 Binary files /dev/null and b/chipet/Images/rain/rain8.png differ diff --git a/chipet/Images/shuteye.png b/chipet/Images/shuteye.png new file mode 100644 index 0000000..07c5df3 Binary files /dev/null and b/chipet/Images/shuteye.png differ diff --git a/chipet/Images/sign.png b/chipet/Images/sign.png new file mode 100644 index 0000000..3257937 Binary files /dev/null and b/chipet/Images/sign.png differ diff --git a/chipet/Images/water.png b/chipet/Images/water.png new file mode 100644 index 0000000..77f281e Binary files /dev/null and b/chipet/Images/water.png differ diff --git a/chipet/Images/waterclick.png b/chipet/Images/waterclick.png new file mode 100644 index 0000000..1514795 Binary files /dev/null and b/chipet/Images/waterclick.png differ diff --git a/chipet/Images/waterover.png b/chipet/Images/waterover.png new file mode 100644 index 0000000..ef187c5 Binary files /dev/null and b/chipet/Images/waterover.png differ diff --git a/chipet/Info.plist b/chipet/Info.plist new file mode 100644 index 0000000..e3586ae --- /dev/null +++ b/chipet/Info.plist @@ -0,0 +1,26 @@ + + + + + AllowFullAccess + + AllowMultipleInstances + + CFBundleDisplayName + Chi Pet + CFBundleIdentifier + novisdesign.ChiPet.widget + CFBundleName + Chi Pet + CFBundleShortVersionString + 1.1 + CFBundleVersion + 1.1 + CloseBoxInsetX + 50 + CloseBoxInsetY + 40 + MainHTML + chia.html + + diff --git a/chipet/chia.css b/chipet/chia.css new file mode 100644 index 0000000..be58edc --- /dev/null +++ b/chipet/chia.css @@ -0,0 +1 @@ +/* CSS Document */ #alive { position:absolute; top:0px; left:0px; display:block; z-index:2; } #default { position: absolute; left: 0px; top: 0px; z-index: 2; } #rainIt { position:absolute; z-index:2; top:-15px; left:33px; height:259px; width:155px; background:no-repeat; } #water { position: absolute; z-index: 3; left: 25px; top: 90px; height: 40px; width: 26px; display: block; } #haircut { position:absolute; z-index:4; left:58px; top:100px; display:none; } #zzzs { position:absolute; top:120px; left:29px; z-index:5; display:none; } #hat { position:absolute; top:33px; left:159px; z-index:6; display:none; } #eye { position:absolute; top:58px; left:175px; z-index:7; display:none; } #alerts { position:absolute; top:0px; left:0px; width:200px; height:35px; color:white; font-family:"Lucida Grande"; display:block; } #cut { position:absolute; top:10px; left:35px; display:none; z-index:8; } #abig { position:absolute; bottom:0px; right:5px; font-size:24px; opacity:0.5; } #asmall { position:absolute; top:2px; right:27px; font-size:12px; } #dead { position:absolute; top:0px; left:0px; display:none; z-index:1; } #defaultdead { position:absolute; top:0px; left:-20px; } #alertdead { position:absolute; top:30px; left:0px; z-index:2; opacity:0.75; cursor:pointer; } #box { position:absolute; left:3px; top:78px; z-index:0; } #backMain { position:absolute; top:0px; left:0px; } a { color: #333333; } .page { position:absolute; top:38px; left:26px; width:136px; height:75px; z-index:100; font-family: Arial, Helvetica, sans-serif; font-size: x-small; color: #333333; } .top { position:absolute; top:1px; left:3px; width:133px; height:11px; } .title { position:absolute; top:0px; left:0px; font-size:11px; font-weight:bold; } .return { position:absolute; right:2px; top:0px; cursor:pointer; } .cont { position:absolute; top:18px; left:3px; width:130px; height:55px; overflow:hidden; } #main {display:block;} #howto {display:none;} #phrases {display:none;} #myphrases {display:none;} #hibernation {display:none;} #prefs {display:none;} #pEnter { position:absolute; top:11px; left:0px; width:130px; } #submitP { position:absolute; top:32px; left:0px; text-decoration:underline; cursor:pointer; } #viewP { position:absolute; top:44px; right:-13px; text-decoration:underline; cursor:pointer; } #pList { position:absolute; top:0px; left:0px; width:90px; height:53px; } #pRemove { position:absolute; top:0px; left:92px; text-decoration:underline; cursor:pointer; } #pAdd { position:absolute; top:15px; left:91px; text-decoration:underline; cursor:pointer; } #cHibernation { position:absolute; top:10px; width:130px; text-align:center; } #bottomText { font-size:9px; color:gray; } #alertPref { position:absolute; top:0px; left:0px; } #apText { position:absolute; top:3px; left:20px; width:130px; } #savePref { position:absolute; top:17px; left:0px; } #spText { position:absolute; top:20px; left:20px; width:130px; } #lengthPref { position:absolute; top:37px; left:80px; width:50px; z-index:3; } #lpText { position:absolute; top:40px; left:0px; width:130px; } #arrows { position:absolute; left:163px; top:93px; height:21px; width:18px; opacity:0.5; } #up { position:absolute; top:0px; height:10px; width:18px; background:url('Flip/up_arrow.png') center center no-repeat; } #down { position:absolute; bottom:0px; height:10px; width:18px; background:url('Flip/down_arrow.png') center center no-repeat; } #doneButton { position:absolute; top:118px; left:10px; cursor:pointer; } #ndButton { position:absolute; top:118px; left:95px; cursor:pointer; } \ No newline at end of file diff --git a/chipet/chia.js b/chipet/chia.js new file mode 100644 index 0000000..a49ac8a --- /dev/null +++ b/chipet/chia.js @@ -0,0 +1 @@ +// JavaScript Document - Coded soly by Gabe S. of Novis Design, Thanks to Mike for the cool graphics, // you rock man. Also thanks to Meechy, Mendoza, Nunez, & Patino for your feedback and friendship. // Everybody go visit NovisDesign.net, its a great site. If you want to use any of this code // please contact me at that site. Enjoy your Chi Pet! // Our lone global. hehe var checkwater = true; if (window.widget) { widget.onshow = onshow; widget.onhide = onhide; } function onshow() { changeChia() watered() talk() NDupdate(); } function onhide() { if (ft != undefined) { clearTimeout(ft) document.getElementById('alerts').style.opacity = '0'; document.getElementById('asmall').innerHTML = ''; document.getElementById('abig').innerHTML = ''; } if (c != 1) { c == 1; } } // Easy global Funct for miliseconds since time... function getHoursNow() { var startup = new Date(); var f = startup.getTime(); var i = parseInt(f) return i } // On Start... function setup() { NDupdate(); changeChia() doWater() var time = widget.preferenceForKey('time') if (time == undefined) { widget.setPreferenceForKey(getHoursNow(), 'time') } var cw = widget.preferenceForKey('cw') if (cw != undefined) { if (cw) { stillUp(); } else { stillHib(); } } var i; var lg = widget.preferenceForKey('lg'); if (lg && lg != 0) { for (i = 1; i <= lg; i++) { if (widget.preferenceForKey('speak'+i) != undefined) { var item = widget.preferenceForKey('speak'+i); var n = document.createElement("option") n.text = item; n.value = item; document.getElementById('pList').add(n,null); } } } var showAlerts = widget.preferenceForKey('showAlerts'); if (showAlerts != undefined) { document.getElementById('alertPref').checked = showAlerts } var showSave = widget.preferenceForKey('showSave'); if (showAlerts != undefined) { document.getElementById('savePref').checked = showSave } var showLength = widget.preferenceForKey('showLength'); if (showLength != undefined) { document.getElementById('lengthPref').value = showLength; changeLength(showLength) } } // This returnes the amount of time you've had the pet function checkNewH() { var time = widget.preferenceForKey('time') var a = new Date(); var b = a.getTime(); var x = b - time; var y = parseInt(x); return y; } // Main function, change the body function changeChia() { if (checkwater) { var diff = checkNewH(); var elm = document.getElementById("default"); if (diff <= 3600000) { elm.src = 'Images/chistart.png'; } if (diff > 3600000 && diff <= 172800000) { elm.src = 'Images/day1.png'; } if (diff > 172800000 && diff <= 518400000) { elm.src = 'Images/day2.png'; } if (diff > 518400000 && diff <= 691200000) { elm.src = 'Images/day3.png'; } if (diff > 691200000 && diff <= 864000000) { elm.src = 'Images/day4.png'; } if (diff > 864000000 && diff <= 1036800000) { elm.src = 'Images/day5.png'; document.getElementById('haircut').style.display = 'block'; } if (diff > 1036800000) { elm.src = 'Images/day6.png'; document.getElementById('haircut').style.display = 'block'; tryRand(); } } } // Water Functions function overWater() { document.getElementById('water').src = "Images/waterover.png"; } function outWater() { document.getElementById('water').src = "Images/water.png"; } function clickWater() { document.getElementById('water').src = "Images/waterclick.png"; rainIt(); } function doWater() { var clicked = widget.preferenceForKey('clicked') if (clicked == undefined) { widget.setPreferenceForKey(getHoursNow(), 'clicked') } watered(); } // See How long since last water... function checkNewHWater() { var clicked = widget.preferenceForKey('clicked') var a = new Date(); var b = a.getTime(); var x = b - clicked; var y = parseInt(x); return y; } // Change acording, function watered() { var diff = checkNewHWater(); if (checkwater) { if (diff >= 259200000) { document.getElementById('alive').style.display = 'none'; document.getElementById('dead').style.display = 'block'; } } } function updateWater() { widget.setPreferenceForKey(getHoursNow(), 'clicked') watered() } // Once Dead function redoChia() { widget.setPreferenceForKey(getHoursNow(), 'clicked') widget.setPreferenceForKey(getHoursNow(), 'time') document.getElementById('haircut').style.display = 'none'; document.getElementById('alive').style.display = 'block'; document.getElementById('dead').style.display = 'none'; watered(); changeChia() } // New Hibernation function checkNewHib() { var sH = widget.preferenceForKey('startHibernation'); var sT = widget.preferenceForKey('time'); var sub = sH - sT; elm = document.getElementById('default'); if (diff <= 3600000) { elm.src = 'Images/chistart.png'; } if (diff > 3600000 && diff <= 172800000) { elm.src = 'Images/day1.png'; } if (diff > 172800000 && diff <= 518400000) { elm.src = 'Images/day2.png'; } if (diff > 518400000 && diff <= 691200000) { elm.src = 'Images/day3.png'; } if (diff > 691200000 && diff <= 864000000) { elm.src = 'Images/day4.png'; } if (diff > 864000000 && diff <= 1036800000) { elm.src = 'Images/day5.png'; } if (diff > 1036800000) { elm.src = 'Images/day6.png'; } } function compTime() { var sH = widget.preferenceForKey('startHibernation'); var sT = getHoursNow(); var sub = sT - sH; var add = widget.preferenceForKey('time') + sub; widget.setPreferenceForKey(add, 'time'); var add = widget.preferenceForKey('clicked') + sub; widget.setPreferenceForKey(add, 'clicked'); } function startHibernation() { checkwater = false; document.getElementById('bottomText').innerHTML = 'click to turn hibernation off'; document.getElementById('startH').onclick = wakeUp; document.getElementById('startH').src = 'Images/hibernation_on.png' document.getElementById('haircut').style.display = 'none'; document.getElementById('water').style.display = 'none'; document.getElementById('hat').style.display = 'block'; document.getElementById('zzzs').style.display = 'block'; document.getElementById('eye').style.display = 'block'; widget.setPreferenceForKey(false, 'cw') widget.setPreferenceForKey(getHoursNow(), 'startHibernation') checkNewHib() } function wakeUp() { var diff = checkNewH(); checkwater = true; document.getElementById('bottomText').innerHTML = 'click to turn hibernation on'; document.getElementById('startH').onclick = startHibernation; document.getElementById('startH').src = 'Images/hibernation_off.png'; document.getElementById('water').style.display = 'block'; document.getElementById('hat').style.display = 'none'; document.getElementById('zzzs').style.display = 'none'; document.getElementById('eye').style.display = 'none'; widget.setPreferenceForKey(true, 'cw') compTime(); changeChia(); } function stillUp() { var diff = checkNewH(); checkwater = true; document.getElementById('bottomText').innerHTML = 'click to turn hibernation on'; document.getElementById('startH').src = 'Images/hibernation_off.png'; document.getElementById('startH').onclick = startHibernation; if (diff > 864000000) { document.getElementById('haircut').style.display = 'block'; } document.getElementById('water').style.display = 'block'; document.getElementById('hat').style.display = 'none'; document.getElementById('zzzs').style.display = 'none'; document.getElementById('eye').style.display = 'none'; } function stillHib() { checkwater = false; document.getElementById('bottomText').innerHTML = 'click to turn hibernation off'; document.getElementById('startH').src = 'Images/hibernation_on.png' document.getElementById('startH').onclick = wakeUp; document.getElementById('haircut').style.display = 'none'; document.getElementById('water').style.display = 'none'; document.getElementById('hat').style.display = 'block'; document.getElementById('zzzs').style.display = 'block'; document.getElementById('eye').style.display = 'block'; ft = setTimeout('fadeTalk();',1500); checkNewHib() } // New Talk var ft; var timeOf = 1500; var rsayings = new Array("","","","","","Novis Design","i love apple","sup?","wat up dog?","cha chia","cha cha cha Chia!","how are you?","hello!","novisdesign.net","have a nice day","take it easy","salutations","check the due","peace and love","surprise!!!","rock on!!!",""); function talk() { if (checkwater && document.getElementById('alertPref').checked) { document.getElementById('alerts').style.opacity = '1'; var t = new Date(); var h = t.getHours(); var diff = checkNewHWater(); var rand = Math.round(random() * (rsayings.length-1)); var time = Math.floor(checkNewH()/86400000); if (diff > 172800000) { document.getElementById('abig').innerHTML = 'feed me!'; document.getElementById('asmall').innerHTML = 'feed me!'; } else { if (rand == 0) { if (h > 0 && h < 12) { document.getElementById('abig').innerHTML = 'good morning!'; document.getElementById('asmall').innerHTML = 'good morning!'; } if (h==12) { document.getElementById('abig').innerHTML = 'hello!'; document.getElementById('asmall').innerHTML = 'hello!'; } if (h > 12 && h < 19) { document.getElementById('abig').innerHTML = 'good afternoon!'; document.getElementById('asmall').innerHTML = 'good afternoon!'; } if (h > 19) { document.getElementById('abig').innerHTML = 'good night!'; document.getElementById('asmall').innerHTML = 'good night!'; } } if (rand == 1) { if (time == 1) { document.getElementById('abig').innerHTML = time + " day old"; document.getElementById('asmall').innerHTML = time + " day old"; } if (time > 1) { document.getElementById('abig').innerHTML = time + " days old"; document.getElementById('asmall').innerHTML = time + " days old"; } } if (rand == 2 || rand == 3 || rand == 4) { var elm = document.getElementById('pList'); if (elm.length != 0) { var rtwo = Math.round(Math.random() * (elm.length)); var put = elm.options[rtwo].text; document.getElementById('abig').innerHTML = put; document.getElementById('asmall').innerHTML = put; } else { document.getElementById('abig').innerHTML = rsayings[rand]; document.getElementById('asmall').innerHTML = rsayings[rand]; } } if (rand > 3) { document.getElementById('abig').innerHTML = rsayings[rand]; document.getElementById('asmall').innerHTML = rsayings[rand]; } } setTextSize(document.getElementById('abig').innerHTML.length); ft = setTimeout('fadeTalk();',timeOf); } } function fadeTalk() { var elm = document.getElementById('alerts').style; var op = parseFloat(elm.opacity); var newop = op - .2; elm.opacity = newop; if (newop > 0) { ft = setTimeout('fadeTalk();',100) } } function setTextSize(val) { if (val <= 22 && val > 19) { document.getElementById('abig').style.fontSize = '14px'; } if (val <= 19 && val > 17) { document.getElementById('abig').style.fontSize = '16px'; } if (val <= 17 && val > 15) { document.getElementById('abig').style.fontSize = '20px'; } if (val <= 15 && val > 14) { document.getElementById('abig').style.fontSize = '22px'; } if (val < 13) { document.getElementById('abig').style.fontSize = '24px'; } } // A widgets way to do random... (thanks a lot apple) function random() { d = new Date(); time = d.getTime(); function getR() { time = (time*9301+49297) % 233280; return time/(233280.0); }; return getR(); } // Random Chi!!! Cool function tryRand() { if (checkwater) { var rand = random() rand = Math.round(rand * 100); if (rand <= 1) { showRandomChi(); } } } function showRandomChi() { req = new XMLHttpRequest(); req.onreadystatechange = setChi; req.open("GET", "http://novisdesign.net/WidgetResorces/ChiPet/number.txt", true); req.send(null); } function setChi() { if (req.readyState == 4) { if (req.status == 200) { var number = parseInt(req.responseText); elm = document.getElementById('default'); var cin = Math.round(Math.random() * number); var cImage = document.createElement('img'); cImage.src = "http://novisdesign.net/WidgetResorces/ChiPet/chipet"+cin+".png"; cImage.onload = function() { elm.src = "http://novisdesign.net/WidgetResorces/ChiPet/chipet"+cin+".png"; } cImage.onerror = function() { changeChia(); } } } } // Rain drop effect var tm; var i = 0; function rainIt() { var elm = document.getElementById('rainIt'); i++ if (i == 1) { elm.style.backgroundImage = "url('Images/rain/rain1.png')"; tm = setTimeout('rainIt()',60); } if (i == 2) { elm.style.backgroundImage = "url('Images/rain/rain2.png')"; tm = setTimeout('rainIt()',60); } if (i == 3) { elm.style.backgroundImage = "url('Images/rain/rain3.png')"; tm = setTimeout('rainIt()',60); } if (i == 4) { elm.style.backgroundImage = "url('Images/rain/rain4.png')"; tm = setTimeout('rainIt()',60); } if (i == 5) { elm.style.backgroundImage = "url('Images/rain/rain5.png')"; tm = setTimeout('rainIt()',60); } if (i == 6) { elm.style.backgroundImage = "url('Images/rain/rain6.png')"; tm = setTimeout('rainIt()',60); } if (i == 7) { elm.style.backgroundImage ="url('Images/rain/rain7.png')"; tm = setTimeout('rainIt()',60); } if (i == 8) { elm.style.backgroundImage = "url('Images/rain/rain8.png')"; tm = setTimeout('rainIt()',60); } if (i == 9) { elm.style.backgroundImage = "none"; tm = clearTimeout(tm); i = 0; } } // Barbershop Code var c = 1; var ch; function startCut() { document.getElementById('cut').style.display = 'block'; document.getElementById('haircut').style.display = 'none'; ch = setInterval('cutHair();',100); } function cutHair() { var elm = document.getElementById('default'); var cut = document.getElementById('cut'); if (c == 4) { cut.style.display = 'none'; var a = new Date(); var b = a.getTime(); var b = b - 518400000; widget.setPreferenceForKey(b, 'time') clearInterval(ch) } if (c == 3) { c++; elm.src = "Images/day3.png"; cut.src = "Images/cut3.png"; } if (c == 2) { c++; elm.src = "Images/day4.png"; cut.src = "Images/cut2.png"; } if (c == 1) { c++; elm.src = "Images/day5.png"; cut.src = "Images/cut1.png"; } } // Switching pages on back var sc; function goTo(go,old,scroll) { document.getElementById(old).style.display = 'none'; document.getElementById(go).style.display = 'block'; if (scroll == null) { document.getElementById('arrows').style.opacity = '0.5'; sc = scroll; } else { document.getElementById('arrows').style.opacity = '1.0'; sc = scroll; } } function goMain(elm) { document.getElementById('main').style.display = 'block'; document.getElementById(elm).style.display = 'none'; sc = null; document.getElementById('arrows').style.opacity = '0.5'; document.getElementById('cHow').style.top = '0px'; } function goMainAll() { if (!document.getElementById('savePref').checked) { document.getElementById('main').style.display = 'block'; document.getElementById('howto').style.display = 'none'; document.getElementById('phrases').style.display = 'none'; document.getElementById('myphrases').style.display = 'none'; document.getElementById('hibernation').style.display = 'none'; document.getElementById('prefs').style.display = 'none'; document.getElementById('cHow').style.top = '0px'; sc = null; document.getElementById('arrows').style.opacity = '0.5'; } } function addItem() { if (document.getElementById('pEnter').value != "") { var n = document.createElement("option") n.text = document.getElementById('pEnter').value; n.value = document.getElementById('pList').length + 1; document.getElementById('pList').add(n,null); widget.setPreferenceForKey(document.getElementById('pList').length, 'lg'); widget.setPreferenceForKey(document.getElementById('pEnter').value, 'speak'+document.getElementById('pList').length) document.getElementById('pEnter').value = ""; } } function removeItem() { var i; rem = document.getElementById('pList').selectedIndex; document.getElementById('pList').remove(rem); widget.setPreferenceForKey(null, 'speak'+(rem+1)) widget.setPreferenceForKey(document.getElementById('pList').length, 'lg'); for (i = (rem + 2); widget.preferenceForKey('speak'+i) != undefined; i++) { widget.setPreferenceForKey(widget.preferenceForKey('speak'+i),'speak'+(i-1)); widget.setPreferenceForKey(null,'speak'+i); } } function changeAlert() { value = document.getElementById('alertPref').checked; widget.setPreferenceForKey(value, 'showAlerts'); } function changeSave() { value = document.getElementById('savePref').checked; widget.setPreferenceForKey(value, 'showSave'); } function changeLength(val) { var value = (parseInt(val) + 100) * 10; timeOf = value; widget.setPreferenceForKey(val, 'showLength'); } // Arrow Scrolling function scrollUp(a) { var top = parseInt(document.getElementById(sc).style.top); if (top > a) { document.getElementById(sc).style.top = top - 10 + "px"; } } function scrollDown() { var top = parseInt(document.getElementById(sc).style.top); if (top < 0) { document.getElementById(sc).style.top = top + 10 + "px"; } } \ No newline at end of file diff --git a/chipet/default.png b/chipet/default.png new file mode 100644 index 0000000..fedc1c6 Binary files /dev/null and b/chipet/default.png differ diff --git a/chipet/index.html b/chipet/index.html new file mode 100644 index 0000000..c6a1022 --- /dev/null +++ b/chipet/index.html @@ -0,0 +1 @@ + Chia Pet
Main Menu!
How to!main menu
Your chi pet must be watered every three days to insure growth. To water, simply click the water droplet and watch your chi pet be watered. Your chi pet is more than a plant though, it can talk, sleep, and even get haircuts!
Phrases!main menu
I want my Chi Pet to say Enter View my phrases
My phrases!main menu
Remove Add
Hibernation!main menu

click to turn hibernation on
Prefs!main menu
Show Chi Pet phrases Save last page viewed Show phrase for
\ No newline at end of file diff --git a/chipet/ndupdate/.DS_Store b/chipet/ndupdate/.DS_Store new file mode 100644 index 0000000..adda61b Binary files /dev/null and b/chipet/ndupdate/.DS_Store differ diff --git a/chipet/ndupdate/Images/.DS_Store b/chipet/ndupdate/Images/.DS_Store new file mode 100644 index 0000000..288dfaf Binary files /dev/null and b/chipet/ndupdate/Images/.DS_Store differ diff --git a/chipet/ndupdate/Images/download.png b/chipet/ndupdate/Images/download.png new file mode 100644 index 0000000..2a74985 Binary files /dev/null and b/chipet/ndupdate/Images/download.png differ diff --git a/chipet/ndupdate/Images/gloss-fill.png b/chipet/ndupdate/Images/gloss-fill.png new file mode 100644 index 0000000..522eb4d Binary files /dev/null and b/chipet/ndupdate/Images/gloss-fill.png differ diff --git a/chipet/ndupdate/Images/gloss-left.png b/chipet/ndupdate/Images/gloss-left.png new file mode 100644 index 0000000..fcd94df Binary files /dev/null and b/chipet/ndupdate/Images/gloss-left.png differ diff --git a/chipet/ndupdate/Images/gloss-right.png b/chipet/ndupdate/Images/gloss-right.png new file mode 100644 index 0000000..27c61c9 Binary files /dev/null and b/chipet/ndupdate/Images/gloss-right.png differ diff --git a/chipet/ndupdate/Images/later.png b/chipet/ndupdate/Images/later.png new file mode 100644 index 0000000..0085482 Binary files /dev/null and b/chipet/ndupdate/Images/later.png differ diff --git a/chipet/ndupdate/Images/main-bottomleft.png b/chipet/ndupdate/Images/main-bottomleft.png new file mode 100644 index 0000000..be4c2d6 Binary files /dev/null and b/chipet/ndupdate/Images/main-bottomleft.png differ diff --git a/chipet/ndupdate/Images/main-bottomright.png b/chipet/ndupdate/Images/main-bottomright.png new file mode 100644 index 0000000..ab422f7 Binary files /dev/null and b/chipet/ndupdate/Images/main-bottomright.png differ diff --git a/chipet/ndupdate/Images/main-fill.png b/chipet/ndupdate/Images/main-fill.png new file mode 100644 index 0000000..11c7785 Binary files /dev/null and b/chipet/ndupdate/Images/main-fill.png differ diff --git a/chipet/ndupdate/Images/main-topleft.png b/chipet/ndupdate/Images/main-topleft.png new file mode 100644 index 0000000..b516018 Binary files /dev/null and b/chipet/ndupdate/Images/main-topleft.png differ diff --git a/chipet/ndupdate/Images/main-topright.png b/chipet/ndupdate/Images/main-topright.png new file mode 100644 index 0000000..b9cd99a Binary files /dev/null and b/chipet/ndupdate/Images/main-topright.png differ diff --git a/chipet/ndupdate/Images/nd-logo.png b/chipet/ndupdate/Images/nd-logo.png new file mode 100644 index 0000000..99cd81c Binary files /dev/null and b/chipet/ndupdate/Images/nd-logo.png differ diff --git a/chipet/ndupdate/Images/shadow-bottom.png b/chipet/ndupdate/Images/shadow-bottom.png new file mode 100644 index 0000000..16b784d Binary files /dev/null and b/chipet/ndupdate/Images/shadow-bottom.png differ diff --git a/chipet/ndupdate/Images/shadow-bottomleft.png b/chipet/ndupdate/Images/shadow-bottomleft.png new file mode 100644 index 0000000..733e327 Binary files /dev/null and b/chipet/ndupdate/Images/shadow-bottomleft.png differ diff --git a/chipet/ndupdate/Images/shadow-bottomright.png b/chipet/ndupdate/Images/shadow-bottomright.png new file mode 100644 index 0000000..f58b237 Binary files /dev/null and b/chipet/ndupdate/Images/shadow-bottomright.png differ diff --git a/chipet/ndupdate/Images/shadow-right.png b/chipet/ndupdate/Images/shadow-right.png new file mode 100644 index 0000000..dc2ca08 Binary files /dev/null and b/chipet/ndupdate/Images/shadow-right.png differ diff --git a/chipet/ndupdate/Images/shadow-topright.png b/chipet/ndupdate/Images/shadow-topright.png new file mode 100644 index 0000000..b4de142 Binary files /dev/null and b/chipet/ndupdate/Images/shadow-topright.png differ diff --git a/chipet/ndupdate/ndupdate.css b/chipet/ndupdate/ndupdate.css new file mode 100644 index 0000000..1acebfd --- /dev/null +++ b/chipet/ndupdate/ndupdate.css @@ -0,0 +1,248 @@ +#NDmain { + position:fixed; + top:1px; + left:1px; + right:6px; + bottom:6px; + z-index:9000; +} +#NDtitle { + position:absolute; + width:100%; + top:6px; + font-family:Arial; + font-weight:bold; + font-size:14px; + color:#D5D5D5; + text-align:center; + z-index:4; +} +#NDupdate { + position:absolute; + width:100%; + top:35%; + font-family:Arial; + font-size:20px; + color:#D5D5D5; + text-align:center; + z-index:5; +} +#NDbuttons { + position:absolute; + width:100%; + bottom:12%; + height:10px; + text-align:center; + z-index:6; +} +#NDdownload { + position:relative; + left:2px; + cursor:pointer; +} +#NDlater { + position:relative; + right:2px; + cursor:pointer; +} +#NDtop { + position:absolute; + top:0px; + left:0px; + right:0px; + height:0px; + z-index:2; +} +#NDtopFill { + position:absolute; + top:0px; + left:5px; + right:5px; + height:5px; + background:url('Images/main-fill.png') repeat; +} +#NDtopLeft { + position:absolute; + left:0px; + top:0px; + width:5px; + height:5px; + background:url('Images/main-topleft.png'); +} +#NDtopRight { + position:absolute; + right:0px; + top:0px; + width:5px; + height:5px; + background:url('Images/main-topright.png'); +} + +#NDmid { + position:absolute; + top:5px; + left:0px; + right:0px; + bottom:5px; + z-index:2; +} +#NDmidLogo { + position:absolute; + width:54px; + height:36px; + background:url('Images/nd-logo.png'); +} +#NDmidTop { + position:absolute; + top:0px; + left:0px; + right:0px; + background:url('Images/main-fill.png') repeat; +} +#NDmidBottom { + position:absolute; + bottom:0px; + left:0px; + right:0px; + background:url('Images/main-fill.png') repeat; +} +#NDmidLeft { + position:absolute; + left:0px; + height:36px; + background:url('Images/main-fill.png') repeat; +} +#NDmidRight { + position:absolute; + right:0px; + height:36px; + background:url('Images/main-fill.png') repeat; +} + +#NDbottom { + position:absolute; + bottom:0px; + left:0px; + right:0px; + height:0px; + z-index:2; +} +#NDbottomFill { + position:absolute; + bottom:0px; + left:5px; + right:5px; + height:5px; + background:url('Images/main-fill.png') repeat; +} +#NDbottomLeft { + position:absolute; + left:0px; + bottom:0px; + width:5px; + height:5px; + background:url('Images/main-bottomleft.png'); +} +#NDbottomRight { + position:absolute; + right:0px; + bottom:0px; + width:5px; + height:5px; + background:url('Images/main-bottomright.png'); +} + +#NDgloss { + position:absolute; + top:2px; + left:2px; + right:2px; + height:12px; + z-index:3; +} +#NDglossFill { + position:absolute; + top:0px; + left:4px; + right:4px; + height:12px; + background:url('Images/gloss-fill.png') repeat; +} +#NDglossLeft { + position:absolute; + top:0px; + left:0px; + width:4px; + height:12px; + background:url('Images/gloss-left.png'); +} +#NDglossRight { + position:absolute; + top:0px; + right:0px; + width:4px; + height:12px; + background:url('Images/gloss-right.png'); + z-index:2; +} + +#NDshadow { + position:absolute; + top:-1px; + bottom:-6px; + right:-6px; + left:0px; + z-index:1; +} +#NDshadowBottom { + position:absolute; + bottom:0px; + left:0px; + right:0px; +} +#NDshadowBottomLeft { + position:absolute; + bottom:0px; + left:0px; + width:39px; + height:9px; + background:url('Images/shadow-bottomleft.png'); +} +#NDshadowBottomFill { + position:absolute; + bottom:0px; + left:39px; + right:11px; + height:6px; + background:url('Images/shadow-bottom.png') repeat; +} +#NDshadowBottomRight { + position:absolute; + bottom:0px; + right:0px; + width:11px; + height:11px; + background:url('Images/shadow-bottomright.png'); +} +#NDshadowRight { + position:absolute; + bottom:11px; + top:0px; + right:0px; +} +#NDshadowRightFill { + position:absolute; + bottom:0px; + right:0px; + top:30px; + width:6px; + background:url('Images/shadow-right.png') repeat; +} +#NDshadowTopRight { + position:absolute; + top:0px; + right:0px; + width:11px; + height:30px; + background:url('Images/shadow-topright.png'); +} \ No newline at end of file diff --git a/chipet/ndupdate/ndupdate.js b/chipet/ndupdate/ndupdate.js new file mode 100644 index 0000000..92df0cc --- /dev/null +++ b/chipet/ndupdate/ndupdate.js @@ -0,0 +1,228 @@ +var widgetName = NDgetKeyValue("Info.plist", "CFBundleName"); +var location = 'http://novisdesign.net/WidgetResorces/Updates/ChiPet.txt'; +var current = NDgetKeyValue("Info.plist", "CFBundleVersion"); +var downloadPage = 'http://www.novisdesign.net/Widgets?chipet'; +var checkDays = 5; +var newestVersion; + +function NDupdate() { + if (window.widget) { + var lastDate = widget.preferenceForKey('lastDate'); + if (lastDate != undefined) { + NDcheckAmount(); + } + else { + NDsetTimeForNow(); + } + } +} + +var NDreq; +function NDcheck() { + NDreq = new XMLHttpRequest(); + NDreq.onreadystatechange = NDcompare; + NDreq.open("GET", location, true); + NDreq.setRequestHeader("Cache-Control", "no-cache"); + NDreq.send(null); +} +function NDcompare() { + if (NDreq.readyState == 4) { + if (NDreq.status == 200) { + var newNumber = NDreq.responseText; + if (newNumber > current) { + newestVersion = newNumber; + NDshow() + } + else { + NDaddTime() + } + } + } +} + +var w = window.innerWidth; +var h = window.innerHeight; +var leftPx = Math.round(((w - 20) - 54) / 2) +var topPx = Math.round(((h - 30) - 36) / 2) + +function NDshow() { + if (!document.getElementById('NDmain')) { + var newElm = document.createElement('div'); + newElm.id = 'NDmain'; + + var title = document.createElement('div'); + title.id = 'NDtitle'; + title.innerHTML = 'Update Avaliable'; + + var update = document.createElement('div'); + update.id = 'NDupdate'; + update.innerHTML = widgetName + ' version ' + newestVersion + '
now available'; + + var buttons = document.createElement('div'); + buttons.id = 'NDbuttons'; + var bElm = document.createElement('div'); + bElm.id = 'NDbElm'; + bElm.innerHTML = ' '; + buttons.appendChild(bElm); + + var top = document.createElement('div'); + top.id = 'NDtop'; + var topFill = document.createElement('div'); + topFill.id = 'NDtopFill'; + var topLeft = document.createElement('div'); + topLeft.id = 'NDtopLeft'; + var topRight = document.createElement('div'); + topRight.id = 'NDtopRight'; + top.appendChild(topFill); + top.appendChild(topLeft); + top.appendChild(topRight); + + var mid = document.createElement('div'); + mid.id = 'NDmid'; + var midLogo = document.createElement('div'); + midLogo.id = 'NDmidLogo'; + midLogo.style.left = leftPx + 'px'; + midLogo.style.top = topPx + 'px'; + var midTop = document.createElement('div'); + midTop.id = 'NDmidTop'; + midTop.style.height = topPx + 'px'; + var midBottom = document.createElement('div'); + midBottom.id = 'NDmidBottom'; + midBottom.style.top = topPx + 36 + 'px'; + var midLeft = document.createElement('div'); + midLeft.id = 'NDmidLeft'; + midLeft.style.top = topPx + 'px'; + midLeft.style.width = leftPx + 'px'; + var midRight = document.createElement('div'); + midRight.id = 'NDmidRight'; + midRight.style.top = topPx + 'px'; + midRight.style.left = leftPx + 54 + 'px'; + mid.appendChild(midLogo); + mid.appendChild(midTop); + mid.appendChild(midBottom); + mid.appendChild(midLeft); + mid.appendChild(midRight); + + var bottom = document.createElement('div'); + bottom.id = 'NDbottom'; + var bottomFill = document.createElement('div'); + bottomFill.id = 'NDbottomFill'; + var bottomLeft = document.createElement('div'); + bottomLeft.id = 'NDbottomLeft'; + var bottomRight = document.createElement('div'); + bottomRight.id = 'NDbottomRight'; + bottom.appendChild(bottomFill); + bottom.appendChild(bottomLeft); + bottom.appendChild(bottomRight); + + var gloss = document.createElement('div'); + gloss.id = 'NDgloss'; + var glossFill = document.createElement('div'); + glossFill.id = 'NDglossFill'; + var glossLeft = document.createElement('div'); + glossLeft.id = 'NDglossLeft'; + var glossRight = document.createElement('div'); + glossRight.id = 'NDglossRight'; + gloss.appendChild(glossFill); + gloss.appendChild(glossLeft); + gloss.appendChild(glossRight); + + var shadow = document.createElement('div'); + shadow.id = 'NDshadow'; + var shadowBottom = document.createElement('div'); + shadowBottom.id = 'NDshadowBottom'; + var shadowBottomLeft = document.createElement('div'); + shadowBottomLeft.id = 'NDshadowBottomLeft'; + var shadowBottomFill = document.createElement('div'); + shadowBottomFill.id = 'NDshadowBottomFill'; + var shadowBottomRight = document.createElement('div'); + shadowBottomRight.id = 'NDshadowBottomRight'; + shadowBottom.appendChild(shadowBottomLeft) + shadowBottom.appendChild(shadowBottomFill) + shadowBottom.appendChild(shadowBottomRight) + var shadowRight = document.createElement('div'); + shadowRight.id = 'NDshadowRight'; + var shadowRightFill = document.createElement('div'); + shadowRightFill.id = 'NDshadowRightFill'; + var shadowTopRight = document.createElement('div'); + shadowTopRight.id = 'NDshadowTopRight'; + shadowRight.appendChild(shadowRightFill) + shadowRight.appendChild(shadowTopRight) + shadow.appendChild(shadowBottom) + shadow.appendChild(shadowRight) + + newElm.appendChild(title); + newElm.appendChild(update); + newElm.appendChild(buttons); + newElm.appendChild(top); + newElm.appendChild(mid); + newElm.appendChild(bottom); + newElm.appendChild(gloss); + newElm.appendChild(shadow); + + document.body.appendChild(newElm) + } +} + +function NDgoToDownlaod() { + if (window.widget) { + widget.openURL(downloadPage); + } +} + +function NDaddTime() { + if (window.widget) { + var d = new Date(); + var mil = d.getTime(); + widget.setPreferenceForKey(mil,'lastDate'); + } + document.body.removeChild(document.getElementById('NDmain')); +} + +function NDcheckAmount() { + if (window.widget) { + var d = new Date(); + var lastDate = widget.preferenceForKey('lastDate'); + var nowDate = d.getTime(); + if ((nowDate - lastDate) > (86400000 * checkDays)) { + NDcheck(); + } + } +} + +function NDsetTimeForNow() { + if (window.widget) { + var d = new Date(); + var mil = d.getTime(); + widget.setPreferenceForKey(mil,'lastDate'); + } +} + +// Adapted from Jon Brown's Tutorial +function NDgetKeyValue(plist, key) { + var xml_http = new XMLHttpRequest(); + xml_http.open("GET", plist, false); + xml_http.send(null); + + var xml = xml_http.responseXML; + var key_value = null; + var nodes = xml.getElementsByTagName("dict")[0].childNodes; + + for (var i=0; i < nodes.length; i++) { + if (nodes[i].nodeType == 1 && nodes[i].tagName.toLowerCase() == "key" && nodes[i].firstChild.data == key) { + if (nodes[i+2].tagName.toLowerCase() != "array") { + key_value = nodes[i+2].firstChild.data; + } + else { + key_value = new Array(); + var ar_nodes = nodes[i+2].childNodes; + for (var j=0; j < ar_nodes.length; j++) { + if (ar_nodes[j].nodeType == 1) + key_value.push(ar_nodes[j].firstChild.data); + } + } + break; + } + } + return key_value; +} \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 0000000..5223ec3 --- /dev/null +++ b/index.html @@ -0,0 +1,38 @@ + + + + + + 我們就是企業家! + + + +
+

工業推手一世紀,企業搖籃一百年

+ + 我每天都吃六教美食街ㄛ!!!!! + +
+ +
+ +
+ + + + +
+ + + + 學生:我們是台北科技大學,簡稱「北科大」,請大家不要再搞錯了。 + +
+ +