diff --git a/chipet/.DS_Store b/chipet/.DS_Store deleted file mode 100644 index 01edeeb..0000000 Binary files a/chipet/.DS_Store and /dev/null differ diff --git a/chipet/Flip/.DS_Store b/chipet/Flip/.DS_Store deleted file mode 100644 index 62597e6..0000000 Binary files a/chipet/Flip/.DS_Store and /dev/null differ diff --git a/chipet/Flip/Flip.css b/chipet/Flip/Flip.css deleted file mode 100644 index 2124b60..0000000 --- a/chipet/Flip/Flip.css +++ /dev/null @@ -1 +0,0 @@ -.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 deleted file mode 100644 index 60dc662..0000000 --- a/chipet/Flip/Flip.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index d43467d..0000000 Binary files a/chipet/Flip/back.png and /dev/null differ diff --git a/chipet/Flip/done.png b/chipet/Flip/done.png deleted file mode 100644 index 1766551..0000000 Binary files a/chipet/Flip/done.png and /dev/null differ diff --git a/chipet/Flip/done_click.png b/chipet/Flip/done_click.png deleted file mode 100644 index 20d819f..0000000 Binary files a/chipet/Flip/done_click.png and /dev/null differ diff --git a/chipet/Flip/down_arrow.png b/chipet/Flip/down_arrow.png deleted file mode 100644 index 530a995..0000000 Binary files a/chipet/Flip/down_arrow.png and /dev/null differ diff --git a/chipet/Flip/i.png b/chipet/Flip/i.png deleted file mode 100644 index e2bfcde..0000000 Binary files a/chipet/Flip/i.png and /dev/null differ diff --git a/chipet/Flip/i_rollie.png b/chipet/Flip/i_rollie.png deleted file mode 100644 index 8d432c4..0000000 Binary files a/chipet/Flip/i_rollie.png and /dev/null differ diff --git a/chipet/Flip/nd.png b/chipet/Flip/nd.png deleted file mode 100644 index fe50f06..0000000 Binary files a/chipet/Flip/nd.png and /dev/null differ diff --git a/chipet/Flip/up_arrow.png b/chipet/Flip/up_arrow.png deleted file mode 100644 index 895bfeb..0000000 Binary files a/chipet/Flip/up_arrow.png and /dev/null differ diff --git a/chipet/Icon.png b/chipet/Icon.png deleted file mode 100644 index d487440..0000000 Binary files a/chipet/Icon.png and /dev/null differ diff --git a/chipet/Images/.DS_Store b/chipet/Images/.DS_Store deleted file mode 100644 index f65d755..0000000 Binary files a/chipet/Images/.DS_Store and /dev/null differ diff --git a/chipet/Images/barberpole.png b/chipet/Images/barberpole.png deleted file mode 100644 index e115876..0000000 Binary files a/chipet/Images/barberpole.png and /dev/null differ diff --git a/chipet/Images/barberpoleover.png b/chipet/Images/barberpoleover.png deleted file mode 100644 index 53b4177..0000000 Binary files a/chipet/Images/barberpoleover.png and /dev/null differ diff --git a/chipet/Images/box.png b/chipet/Images/box.png deleted file mode 100644 index 9db7c09..0000000 Binary files a/chipet/Images/box.png and /dev/null differ diff --git a/chipet/Images/chistart.png b/chipet/Images/chistart.png deleted file mode 100644 index 0dd46b2..0000000 Binary files a/chipet/Images/chistart.png and /dev/null differ diff --git a/chipet/Images/cut1.png b/chipet/Images/cut1.png deleted file mode 100644 index 0202ee5..0000000 Binary files a/chipet/Images/cut1.png and /dev/null differ diff --git a/chipet/Images/cut2.png b/chipet/Images/cut2.png deleted file mode 100644 index 08399bc..0000000 Binary files a/chipet/Images/cut2.png and /dev/null differ diff --git a/chipet/Images/cut3.png b/chipet/Images/cut3.png deleted file mode 100644 index ea235db..0000000 Binary files a/chipet/Images/cut3.png and /dev/null differ diff --git a/chipet/Images/day1.png b/chipet/Images/day1.png deleted file mode 100644 index 1482399..0000000 Binary files a/chipet/Images/day1.png and /dev/null differ diff --git a/chipet/Images/day2.png b/chipet/Images/day2.png deleted file mode 100644 index a4ddbff..0000000 Binary files a/chipet/Images/day2.png and /dev/null differ diff --git a/chipet/Images/day3.png b/chipet/Images/day3.png deleted file mode 100644 index 5a1aa12..0000000 Binary files a/chipet/Images/day3.png and /dev/null differ diff --git a/chipet/Images/day4.png b/chipet/Images/day4.png deleted file mode 100644 index c12255c..0000000 Binary files a/chipet/Images/day4.png and /dev/null differ diff --git a/chipet/Images/day5.png b/chipet/Images/day5.png deleted file mode 100644 index 1b90357..0000000 Binary files a/chipet/Images/day5.png and /dev/null differ diff --git a/chipet/Images/day6.png b/chipet/Images/day6.png deleted file mode 100644 index b827003..0000000 Binary files a/chipet/Images/day6.png and /dev/null differ diff --git a/chipet/Images/dead.png b/chipet/Images/dead.png deleted file mode 100644 index 57120de..0000000 Binary files a/chipet/Images/dead.png and /dev/null differ diff --git a/chipet/Images/deadmess.png b/chipet/Images/deadmess.png deleted file mode 100644 index 370d757..0000000 Binary files a/chipet/Images/deadmess.png and /dev/null differ diff --git a/chipet/Images/hat.png b/chipet/Images/hat.png deleted file mode 100644 index 093dfde..0000000 Binary files a/chipet/Images/hat.png and /dev/null differ diff --git a/chipet/Images/hibernation_off.png b/chipet/Images/hibernation_off.png deleted file mode 100644 index b5a0b06..0000000 Binary files a/chipet/Images/hibernation_off.png and /dev/null differ diff --git a/chipet/Images/hibernation_on.png b/chipet/Images/hibernation_on.png deleted file mode 100644 index 218411b..0000000 Binary files a/chipet/Images/hibernation_on.png and /dev/null differ diff --git a/chipet/Images/rain/.DS_Store b/chipet/Images/rain/.DS_Store deleted file mode 100644 index ba56c5a..0000000 Binary files a/chipet/Images/rain/.DS_Store and /dev/null differ diff --git a/chipet/Images/rain/rain1.png b/chipet/Images/rain/rain1.png deleted file mode 100644 index 0ad1d09..0000000 Binary files a/chipet/Images/rain/rain1.png and /dev/null differ diff --git a/chipet/Images/rain/rain2.png b/chipet/Images/rain/rain2.png deleted file mode 100644 index 7cc9db5..0000000 Binary files a/chipet/Images/rain/rain2.png and /dev/null differ diff --git a/chipet/Images/rain/rain3.png b/chipet/Images/rain/rain3.png deleted file mode 100644 index a20ad80..0000000 Binary files a/chipet/Images/rain/rain3.png and /dev/null differ diff --git a/chipet/Images/rain/rain4.png b/chipet/Images/rain/rain4.png deleted file mode 100644 index 0695f44..0000000 Binary files a/chipet/Images/rain/rain4.png and /dev/null differ diff --git a/chipet/Images/rain/rain5.png b/chipet/Images/rain/rain5.png deleted file mode 100644 index 97e7f43..0000000 Binary files a/chipet/Images/rain/rain5.png and /dev/null differ diff --git a/chipet/Images/rain/rain6.png b/chipet/Images/rain/rain6.png deleted file mode 100644 index c10bed4..0000000 Binary files a/chipet/Images/rain/rain6.png and /dev/null differ diff --git a/chipet/Images/rain/rain7.png b/chipet/Images/rain/rain7.png deleted file mode 100644 index 9872d7c..0000000 Binary files a/chipet/Images/rain/rain7.png and /dev/null differ diff --git a/chipet/Images/rain/rain8.png b/chipet/Images/rain/rain8.png deleted file mode 100644 index 10e0d31..0000000 Binary files a/chipet/Images/rain/rain8.png and /dev/null differ diff --git a/chipet/Images/shuteye.png b/chipet/Images/shuteye.png deleted file mode 100644 index 07c5df3..0000000 Binary files a/chipet/Images/shuteye.png and /dev/null differ diff --git a/chipet/Images/sign.png b/chipet/Images/sign.png deleted file mode 100644 index 3257937..0000000 Binary files a/chipet/Images/sign.png and /dev/null differ diff --git a/chipet/Images/water.png b/chipet/Images/water.png deleted file mode 100644 index 77f281e..0000000 Binary files a/chipet/Images/water.png and /dev/null differ diff --git a/chipet/Images/waterclick.png b/chipet/Images/waterclick.png deleted file mode 100644 index 1514795..0000000 Binary files a/chipet/Images/waterclick.png and /dev/null differ diff --git a/chipet/Images/waterover.png b/chipet/Images/waterover.png deleted file mode 100644 index ef187c5..0000000 Binary files a/chipet/Images/waterover.png and /dev/null differ diff --git a/chipet/Info.plist b/chipet/Info.plist deleted file mode 100644 index e3586ae..0000000 --- a/chipet/Info.plist +++ /dev/null @@ -1,26 +0,0 @@ - - - - - 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 deleted file mode 100644 index be58edc..0000000 --- a/chipet/chia.css +++ /dev/null @@ -1 +0,0 @@ -/* 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 deleted file mode 100644 index a49ac8a..0000000 --- a/chipet/chia.js +++ /dev/null @@ -1 +0,0 @@ -// 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 deleted file mode 100644 index fedc1c6..0000000 Binary files a/chipet/default.png and /dev/null differ diff --git a/chipet/index.html b/chipet/index.html deleted file mode 100644 index c6a1022..0000000 --- a/chipet/index.html +++ /dev/null @@ -1 +0,0 @@ - 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 deleted file mode 100644 index adda61b..0000000 Binary files a/chipet/ndupdate/.DS_Store and /dev/null differ diff --git a/chipet/ndupdate/Images/.DS_Store b/chipet/ndupdate/Images/.DS_Store deleted file mode 100644 index 288dfaf..0000000 Binary files a/chipet/ndupdate/Images/.DS_Store and /dev/null differ diff --git a/chipet/ndupdate/Images/download.png b/chipet/ndupdate/Images/download.png deleted file mode 100644 index 2a74985..0000000 Binary files a/chipet/ndupdate/Images/download.png and /dev/null differ diff --git a/chipet/ndupdate/Images/gloss-fill.png b/chipet/ndupdate/Images/gloss-fill.png deleted file mode 100644 index 522eb4d..0000000 Binary files a/chipet/ndupdate/Images/gloss-fill.png and /dev/null differ diff --git a/chipet/ndupdate/Images/gloss-left.png b/chipet/ndupdate/Images/gloss-left.png deleted file mode 100644 index fcd94df..0000000 Binary files a/chipet/ndupdate/Images/gloss-left.png and /dev/null differ diff --git a/chipet/ndupdate/Images/gloss-right.png b/chipet/ndupdate/Images/gloss-right.png deleted file mode 100644 index 27c61c9..0000000 Binary files a/chipet/ndupdate/Images/gloss-right.png and /dev/null differ diff --git a/chipet/ndupdate/Images/later.png b/chipet/ndupdate/Images/later.png deleted file mode 100644 index 0085482..0000000 Binary files a/chipet/ndupdate/Images/later.png and /dev/null differ diff --git a/chipet/ndupdate/Images/main-bottomleft.png b/chipet/ndupdate/Images/main-bottomleft.png deleted file mode 100644 index be4c2d6..0000000 Binary files a/chipet/ndupdate/Images/main-bottomleft.png and /dev/null differ diff --git a/chipet/ndupdate/Images/main-bottomright.png b/chipet/ndupdate/Images/main-bottomright.png deleted file mode 100644 index ab422f7..0000000 Binary files a/chipet/ndupdate/Images/main-bottomright.png and /dev/null differ diff --git a/chipet/ndupdate/Images/main-fill.png b/chipet/ndupdate/Images/main-fill.png deleted file mode 100644 index 11c7785..0000000 Binary files a/chipet/ndupdate/Images/main-fill.png and /dev/null differ diff --git a/chipet/ndupdate/Images/main-topleft.png b/chipet/ndupdate/Images/main-topleft.png deleted file mode 100644 index b516018..0000000 Binary files a/chipet/ndupdate/Images/main-topleft.png and /dev/null differ diff --git a/chipet/ndupdate/Images/main-topright.png b/chipet/ndupdate/Images/main-topright.png deleted file mode 100644 index b9cd99a..0000000 Binary files a/chipet/ndupdate/Images/main-topright.png and /dev/null differ diff --git a/chipet/ndupdate/Images/nd-logo.png b/chipet/ndupdate/Images/nd-logo.png deleted file mode 100644 index 99cd81c..0000000 Binary files a/chipet/ndupdate/Images/nd-logo.png and /dev/null differ diff --git a/chipet/ndupdate/Images/shadow-bottom.png b/chipet/ndupdate/Images/shadow-bottom.png deleted file mode 100644 index 16b784d..0000000 Binary files a/chipet/ndupdate/Images/shadow-bottom.png and /dev/null differ diff --git a/chipet/ndupdate/Images/shadow-bottomleft.png b/chipet/ndupdate/Images/shadow-bottomleft.png deleted file mode 100644 index 733e327..0000000 Binary files a/chipet/ndupdate/Images/shadow-bottomleft.png and /dev/null differ diff --git a/chipet/ndupdate/Images/shadow-bottomright.png b/chipet/ndupdate/Images/shadow-bottomright.png deleted file mode 100644 index f58b237..0000000 Binary files a/chipet/ndupdate/Images/shadow-bottomright.png and /dev/null differ diff --git a/chipet/ndupdate/Images/shadow-right.png b/chipet/ndupdate/Images/shadow-right.png deleted file mode 100644 index dc2ca08..0000000 Binary files a/chipet/ndupdate/Images/shadow-right.png and /dev/null differ diff --git a/chipet/ndupdate/Images/shadow-topright.png b/chipet/ndupdate/Images/shadow-topright.png deleted file mode 100644 index b4de142..0000000 Binary files a/chipet/ndupdate/Images/shadow-topright.png and /dev/null differ diff --git a/chipet/ndupdate/ndupdate.css b/chipet/ndupdate/ndupdate.css deleted file mode 100644 index 1acebfd..0000000 --- a/chipet/ndupdate/ndupdate.css +++ /dev/null @@ -1,248 +0,0 @@ -#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 deleted file mode 100644 index 92df0cc..0000000 --- a/chipet/ndupdate/ndupdate.js +++ /dev/null @@ -1,228 +0,0 @@ -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