From: user Date: Sun, 15 May 2011 06:50:16 +0000 (+0900) Subject: first git X-Git-Url: http://git.osdn.net/view?p=mashup-kakaku%2FkakApple.git;a=commitdiff_plain;h=2fe6406becdd73e3c06b9720807d311e46842938 first git --- 2fe6406becdd73e3c06b9720807d311e46842938 diff --git a/GNU LICENSE.pdf b/GNU LICENSE.pdf new file mode 100644 index 0000000..af9c5b4 Binary files /dev/null and b/GNU LICENSE.pdf differ diff --git a/css/style.css b/css/style.css new file mode 100644 index 0000000..1f3b8de --- /dev/null +++ b/css/style.css @@ -0,0 +1,146 @@ +/* +----------------------------------------------- +Licensed under the GPL licenses. +kakApple Web application v1.5 +Author: Coronet Internet Service, Kyoji KATO. +Date: 2009-08-25 +URL : http://blog.coronet-internet.com + +iWebKit : Christopher Plieger & Johan van Wilsum +URL : http://iwebkit.net +----------------------------------------------- */ +body{position:relative;margin:0;-webkit-text-size-adjust:none;min-height:416px;font-family:helvetica,sans-serif;background:url("../images/background.png"),url('../images/menutouched.png') no-repeat;-webkit-touch-callout:none} +.center{margin:auto;display:block} +img{border:0} +a:hover span.arrow{background-position:0 -13px!important} +#topbar{position:relative;left:0;top:0;height:44px;width:auto;background:url("../images/header.png") repeat;margin-bottom:13px} +#topbar h1{position:absolute;top:0;left:0;right:0;padding:0 10px;margin:0;text-align:center;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;height:44px;line-height:44px;font-weight:bold;color:#FFF;text-shadow:rgba(0,0,0,0.6) 0 -1px 0;font-size:16pt} +#topbar .title_hidden{display:none;} +#content{width:100%;position:relative;min-height:250px;margin-top:10px;height:auto;z-index:0;overflow:hidden} +#content h2.secondly{position:relative;right:20px;left:9px;font-weight:bold;font-size:17px;color:#4C4C4C;text-shadow:#FFF 0 1px 0;padding:0 0 0 8px;margin:0;} +#footer{text-align:center;position:relative;margin:20px 10px 0;height:auto;width:auto;bottom:10px} +#footer a,#footer{text-decoration:none;font-size:9pt;color:#4C4C4C;text-shadow:#FFF 0 1px 0} +.pageitem{-webkit-border-radius:8px;background-color:#fff;border:#878787 solid 1px;font-size:12pt;overflow:hidden;padding:0;position:relative;display:block;height:auto;width:auto;margin:3px 9px 17px;list-style:none} +.textbox{padding:5px 9px;position:relative;overflow:hidden;border-top:1px solid #878787} +.textbox p{margin-top:2px;color:#000;margin-bottom:2px;text-align:justify} +.textbox img{max-width:100%} +.textbox ul{margin:3px 0 3px 0;list-style:circle!important} +.textbox li{margin:0!important} +.pageitem li:first-child{border-top:0} +li.menu,li.form{position:relative;list-style-type:none;display:block;height:43px;overflow:hidden;border-top:1px solid #878787;width:auto} +ul.pageitem li:first-child:hover,.pageitem li:first-child a,li.form:first-child input[type=radio],li.form:first-child select,li.form:first-child input[type=submit],li.form:first-child button,li.form:first-child input[type=reset]{-webkit-border-top-left-radius:8px 8px;-webkit-border-top-right-radius:8px 8px} +ul.pageitem li:last-child:hover,.pageitem li:last-child a,li.form:last-child input[type=radio],li.form:last-child select,li.form:last-child input[type=submit],li.form:last-child button,li.form:last-child input[type=reset]{-webkit-border-bottom-left-radius:8px 8px;-webkit-border-bottom-right-radius:8px 8px} +li.menu:hover{background:url("../images/menutouched.png") repeat-x #0274ee} +li.menu a:hover span.name,li.menu a:hover span.comment,li.store:hover .starcomment,li.store:hover .name,li.store:hover .comment,body.list li.withimage a:hover .comment,li.store:hover .price,li.item:hover .name,li.item:hover .price,li.item:hover .comment,li.item:hover .starcomment{color:#fff} +li.menu a:hover span.comment{color:#CCF} +li.menu a{display:block;height:43px;width:auto;text-decoration:none} +li.menu a img{width:auto;height:32px;margin:5px 0 0 5px;float:left} +li.menu span.name{margin:11px 0 0 7px;width:auto;color:#000;font-weight:bold;font-size:17px;text-overflow:ellipsis;overflow:hidden;max-width:75%;white-space:nowrap;float:left} +li.menu span.comment{margin:11px 30px 0 0;width:auto;color:#000;font-size:17px;text-overflow:ellipsis;overflow:hidden;max-width:75%;white-space:nowrap;float:right;color:#324f85} +li.menu span.arrow,li.store span.arrow,body.musiclist span.arrow,body.list span.arrow{position:absolute;width:8px!important;height:13px!important;right:10px;top:15px;margin:0!important;background:url("../images/arrow.png") 0 0 no-repeat} +li.store{height:90px;border-top:#878787 solid 1px;overflow:hidden;position:relative} +li.store a{width:100%;height:90px;display:block;background:url("../images/storebg.png") left top no-repeat;text-decoration:none;position:absolute} +li.store:hover{background:url("../images/storetouched.png") repeat-x #0274ee} +li.store .image{position:absolute;left:0;top:0;height:90px;width:90px;display:block;background:url('../images/storetouched.png') no-repeat} +li:first-child.store .image,li.store:first-child a{-webkit-border-top-left-radius:8px 8px} +li:last-child.store .image,li.store:last-child a{-webkit-border-bottom-left-radius:8px 8px} +li.store .name{font-size:15px;white-space:nowrap;margin:2px 0 0 95px;display:block;overflow:hidden;color:#000;max-width:60%;text-overflow:ellipsis;font-weight:bold;white-space:nowrap;text-overflow:ellipsis} +li.store .price{position:absolute;left:115px;top:39px;font-size:15px;color:#ef027d;font-weight:bold} +li.store .comment,body.list li.withimage .comment{font-size:12px;color:#7f7f7f;margin:5px 0 0 95px;display:block;width:60%;font-weight:bold;white-space:nowrap;text-overflow:ellipsis;overflow:hidden} +li.store .arrow,body.list li.withimage .arrow{top:39px!important} +li.store .stars{margin:6px 0 0 95px} +li.store .starcomment{position:absolute;left:115px;top:57px;font-size:12px;color:#7f7f7f;font-weight:lighter} +li.item{height:170px;border-top:#878787 solid 1px;overflow:hidden;position:relative} +li.item a{width:100%;height:170px;display:block;text-decoration:none;position:absolute} +li.item:hover{background:url("../images/itemtouched.png") repeat-x #0274ee} +li.item .image{position:absolute;left:0;top:0;height:90px;width:90px;display:block;background:url('../images/itemtouched.png') no-repeat} +li:first-child.item .image,li.item:first-child a{-webkit-border-top-left-radius:8px 8px} +li:last-child.item .image,li.item:last-child a{-webkit-border-bottom-left-radius:8px 8px} +li.item .name{font-size:15px;white-space:nowrap;margin:2px 0 0 95px;display:block;overflow:hidden;color:#000;max-width:60%;text-overflow:ellipsis;font-weight:bold;white-space:nowrap;text-overflow:ellipsis} +li.item .price{position:absolute;left:115px;top:39px;font-size:15px;color:#ef027d;font-weight:bold} +li.item .comment,body.list li.withimage .comment{font-size:12px;color:#7f7f7f;margin:5px 0 0 95px;display:block;width:60%;font-weight:bold;white-space:nowrap;text-overflow:ellipsis;overflow:hidden} +li.item .arrow,body.list li.withimage .arrow{top:39px!important} +li.item .stars{margin:6px 0 0 95px} +li.item .starcomment{position:absolute;left:115px;top:56px;font-size:12px;color:#7f7f7f;font-weight:lighter} +.graytitle{position:relative;font-weight:bold;font-size:17px;right:20px;left:9px;color:#4C4C4C;text-shadow:#FFF 0 1px 0;padding:1px 0 3px 8px} +.header{display:block;font-weight:bold;color:rgb(73,102,145);font-size:12pt;margin-bottom:6px;line-height:14pt} +body.musiclist div#content{width:auto;margin:-29px auto auto -40px} +body.musiclist div#content ul{background:url("../images/musiclistbg.png") repeat} +body.musiclist div#content ul li{list-style:none;height:44px;width:auto;border-bottom:1px solid #e6e6e6;position:relative} +body.musiclist div#content ul li a{text-decoration:none;color:#000;width:100%!important;height:100%;display:block} +body.musiclist ul li .number,body.musiclist .name,body.musiclist .time{display:inline-block;height:44px;font-weight:bold;font-size:large;width:44px;text-align:center;line-height:46px} +body.musiclist ul li .name{margin-left:0;width:auto!important;font-size:medium;padding-left:5px;border-left:solid 1px #e6e6e6} +body.musiclist ul li .time{color:#848484;font-size:medium;margin-left:4px;width:auto!important;font-weight:normal} +body.musiclist{background-image:none!important;background-color:#cbcccf} +body.musiclist ul li span.name{text-overflow:ellipsis;overflow:hidden;white-space:nowrap;max-width:62%} +body.list ul li.title{background:url("../images/listheader.gif") repeat-x;height:22px!important;width:100%;color:#fff;font-weight:bold;font-size:16px;text-shadow:gray 0 1px 0;line-height:22px;padding-left:20px;border-bottom:none!important} +body.list ul{background-color:#fff;width:100%;overflow:hidden;padding:0;margin:0} +body.list div#content li{height:40px;border-bottom:1px solid #e1e1e1;list-style:none} +body.list{background-color:#fff;background-image:none!important} +body.list div#footer{margin-top:24px!important} +body.list div#content li a{padding:9px 0 0 20px;font-size:large;font-weight:bold;position:relative;display:block;color:#000;text-decoration:none;height:32px} +body.list div#content li a span.name{text-overflow:ellipsis;overflow:hidden;max-width:93%;white-space:nowrap;display:block} +body.list div#content li a:hover{color:#fff} +body.list div#content li a:hover{background:url("../images/menutouched.png") repeat-x} +body.list div#content{margin-top:-13px!important} +body.list ul img{width:90px;height:90px;position:absolute;left:0;top:0} +body.list li.withimage{height:90px!important} +body.list li.withimage span.name{margin:13px 0 0 90px;text-overflow:ellipsis;overflow:hidden;max-width:63%!important;white-space:nowrap} +body.list li.withimage .comment{margin:10px auto auto 90px !important;max-width:63%!important} +body.list li.withimage a,body.list li.withimage:hover a{height:81px!important;background:url("../images/storebg.png") left top no-repeat!important} +body.list li.withimage:hover{background-image:url("../images/storetouched.png")} +.confirm_screen{position:absolute;bottom:0;-webkit-transform:translate(0,100%);-webkit-transition-property:-webkit-transform;background-image:url("../images/popup-bg.png");opacity:0} +.confirm_screenopen{position:absolute;opacity:0.8;overflow:hidden;bottom:-100%;width:100%;background:url("../images/popup-bg.png") repeat-x #4e545f;-webkit-transition-duration:0.8s;-webkit-transition-property:-webkit-transform;-webkit-transform-style:preserve-3d;-webkit-transform:translate(0,0);text-align:center;z-index:99999} +.confirm_screenopenfull{position:absolute;opacity:0.8;overflow:hidden;bottom:-100%;width:100%;background:url("../images/popup-bg.png") repeat-x #4e545f;-webkit-transition-duration:0.8s;-webkit-transition-property:-webkit-transform;-webkit-transform-style:preserve-3d;-webkit-transform:translate(0,45px);text-align:center;z-index:99999} +.confirm_screenclose{-webkit-transition-duration:1.2s;-webkit-transition-property:-webkit-transform;-webkit-transform-style:preserve-3d;position:absolute;opacity:0.8;overflow:hidden;bottom:-100%;width:100%;background:url("../images/popup-bg.png") repeat-x #545A67;text-align:center;-webkit-transform:translate(0,150%)} +.confirm_screenopen span,.confirm_screenclose span,.confirm_screenopenfull span,.confirm_screenclosefull span{margin:10px 0 20px;font-size:17px;color:#fff;width:100%;height:10px;text-shadow:rgba(0,0,0,1) 0 -1px 0;display:block} +.popup{position:absolute;bottom:0;width:100%;left:0;z-index:9999} +.cover{width:100%;position:absolute;top:0;z-index:9998;opacity:0.4;left:0;background-color:#000} +.nocover{opacity:0;background-image:url('../images/bluebutton.png'),url('../images/darkredbutton.png')} +#frame a{text-decoration:none;display:block;width:90%;margin-left:auto;margin-right:auto;margin-bottom:-15px;margin-top:0} +#frame span.black,#frame span.red,#frame span.gray{display:block;height:46px;border-width:0 14px;width:auto;background-repeat:no-repeat;line-height:46px;font-size:large;opacity:1;font-weight:bolder;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;font-family:Arial,Helvetica,sans-serif} +#frame span.black{-webkit-border-image:url("../images/graybutton.png") 0 14 0 14;color:#fff} +#frame span.red{-webkit-border-image:url("../images/redbutton.png") 0 14 0 14;color:#fff} +#frame span.gray{-webkit-border-image:url("../images/whitebutton.png") 0 14 0 14;color:#000;text-shadow:white 0 1px 0} +#frame a:last-child{margin-bottom:20px!important} +#frame a:hover span.black,#frame a:hover span.gray{-webkit-border-image:url("../images/bluebutton.png") 0 14 0 14;color:#fff;text-shadow:rgba(0,0,0,1) 0 -1px 0} +#frame a:hover span.red{-webkit-border-image:url("../images/darkredbutton.png") 0 14 0 14} +#leftnav,#leftbutton{position:absolute;font-size:12px;left:9px;top:7px;font-weight:bold} +#leftnav,#leftbutton,#rightnav,#rightbutton{z-index:5000} +#leftnav a,#rightnav a,#leftbutton a,#rightbutton a{display:block;color:#fff;text-shadow:rgba(0,0,0,0.6) 0 -1px 0;line-height:30px;height:30px;text-decoration:none} +#leftnav img,#rightnav img{margin-top:4px} +#leftnav a:first-child{z-index:2;-webkit-border-image:url("../images/navleft.png") 0 5 0 13;border-width:0 5px 0 13px;-webkit-border-top-left-radius:16px;-webkit-border-bottom-left-radius:16px;-webkit-border-top-right-radius:6px;-webkit-border-bottom-right-radius:6px;width:auto} +#leftnav a{-webkit-border-image:url("../images/navlinkleft.png") 0 5 0 13;z-index:3;margin-left:-4px;border-width:0 5px 0 13px;padding-right:4px;-webkit-border-top-left-radius:16px;-webkit-border-bottom-left-radius:16px;-webkit-border-top-right-radius:6px;-webkit-border-bottom-right-radius:6px;float:left} +#rightnav,#rightbutton{position:absolute;font-size:12px;right:9px;top:7px;font-weight:bold} +#rightnav a{-webkit-border-image:url("../images/navlinkright.png") 0 13 0 5;z-index:3;margin-right:-4px;border-width:0 13px 0 5px;padding-left:4px;-webkit-border-top-left-radius:6px;-webkit-border-bottom-left-radius:6px;float:right;-webkit-border-top-right-radius:16px;-webkit-border-bottom-right-radius:16px} +#rightnav a:first-child{z-index:2;-webkit-border-top-left-radius:6px;-webkit-border-bottom-left-radius:6px;-webkit-border-image:url("../images/navright.png") 0 13 0 5;border-width:0 13px 0 5px;-webkit-border-top-right-radius:16px;-webkit-border-bottom-right-radius:16px} +#leftbutton a,#rightbutton a{-webkit-border-image:url("../images/navbutton.png") 0 5 0 5;border-width:0 5px;-webkit-border-radius:6px} +.rssxpresschannel{font-family:helvetica,sans-serif;border:none} +.rssxpresschtitle{text-align:center} +.rssxpresschdesc{color:#000;text-align:center;border-bottom:1px solid #000;padding-bottom:5px} +.rssxpressittitle{display:block;font-size:12pt;background:#fff;margin:5px 0 2px} +.rssxpressittitle a{text-decoration:none!important;font-weight:bold;color:rgb(73,102,145);line-height:10pt} +.rssxpressitdesc{background:#fff;font-size:12pt} +.rssxpressdivider{display:none} +li.form input[type=text],li.form input[type=password],li.form input[type=search]{border-width:7px 7px;font-weight:normal;border-color:white;height:10px;-webkit-border-image:url("../images/textfield.png") 7 7 7 7;-webkit-appearance:none;line-height:8px;font-size:18px;margin:auto;display:block;position:relative;width:90%} +li.form input[type=submit]{width:100%;background:none;border:0px;color:#000;margin-top:-5px;margin-bottom:-5px;font-weight:bold;font-size:17px} +.form{padding:5px 8px 0 5px;height:37px!important;position:relative;overflow:hidden} +li.form .narrow textarea,li.form .narrow input[type=text],li.form .narrow input[type=checkbox],li.form .narrow input[type=password],li.form .narrow input[type=search]{width:40%!important;border-width:7px 7px;height:10px;-webkit-border-image:url("../images/textfield.png") 7 7 7 7;-webkit-appearance:none;line-height:8px;font-size:18px;font-weight:normal;border-color:white;margin:0!important;position:absolute;right:-17px} +li.form span.narrow,li.form span.check{width:90%!important;display:block;position:relative;margin:auto} +li.form .name{width:55%!important;white-space:nowrap;text-overflow:ellipsis;position:absolute;margin:6px 0 0 7px;color:#000;font-weight:bold;font-size:17px;overflow:hidden;left:-17px} +li.form .check .name{width:70%!important} +li.form input[type=radio]{width:100%;height:42px;display:block;margin:-5px -8px 0 -5px;-webkit-appearance:none;border:0;-webkit-border-radius:0;position:relative;background:transparent;position:absolute} +span.radio{width:16px;height:30px;background:url(../images/check.png) no-repeat;display:block;position:absolute;right:5px;overflow:visible;z-index:1} +span.checkbox{width:94px;height:27px;background:url(../images/checkbox.png) no-repeat;display:block;position:absolute;right:-14px;top:2px} +input[type=checkbox]{display:none} +select{height:40px;opacity:0;position:absolute;width:100%;margin:-5px 0 0 -5px;-webkit-border-radius:0} +.form .choice .name{left:1.7%;width:87%!important} +span.select{z-index:1;position:absolute;white-space:nowrap;text-overflow:ellipsis;margin:6px 0 0 7px;color:#000;font-weight:bold;font-size:17px;overflow:hidden;max-width:87%} +.form .arrow{background:url('../images/more.png') no-repeat;width:13px;height:8px;position:absolute;right:8px;top:18px;margin:0!important} +input[type=submit],button,input[type=button],input[type=reset]{background:transparent;width:100%;height:40px;left:0px;position:absolute;top:6px;display:block;-webkit-border-radius:0;line-height:40px} +button,input[type=button],input[type=reset]{top:0px!important;border:none;color:black;font-weight:bold;font-size:17px;-webkit-appearance:none} +.textbox textarea{min-height:50px;margin:3px auto 4px auto;position:relative;-webkit-border-image:url("../images/textfield.png") 7 7 7 7;padding:3px 0 0 0;line-height:18px;left:-2px;font-size:18px;font-weight:normal;width:97%;display:block;border-width:7px 7px} +ul li.hidden{display:none} +ul li.autolisttext{text-align:center} +body.musiclist ul li.autolisttext{line-height:44px!important} +ul li.autolisttext a:hover{background-image:none!important;color:black!important} diff --git a/images/arrow.png b/images/arrow.png new file mode 100644 index 0000000..9993a06 Binary files /dev/null and b/images/arrow.png differ diff --git a/images/background.png b/images/background.png new file mode 100644 index 0000000..8c4f527 Binary files /dev/null and b/images/background.png differ diff --git a/images/buzz.png b/images/buzz.png new file mode 100644 index 0000000..4be7057 Binary files /dev/null and b/images/buzz.png differ diff --git a/images/check.png b/images/check.png new file mode 100644 index 0000000..39dfc24 Binary files /dev/null and b/images/check.png differ diff --git a/images/header.png b/images/header.png new file mode 100644 index 0000000..9a02c60 Binary files /dev/null and b/images/header.png differ diff --git a/images/home.png b/images/home.png new file mode 100644 index 0000000..0fc49fc Binary files /dev/null and b/images/home.png differ diff --git a/images/more.png b/images/more.png new file mode 100644 index 0000000..8b05580 Binary files /dev/null and b/images/more.png differ diff --git a/images/navleft.png b/images/navleft.png new file mode 100644 index 0000000..a6c05dd Binary files /dev/null and b/images/navleft.png differ diff --git a/images/navlinkleft.png b/images/navlinkleft.png new file mode 100644 index 0000000..5e59302 Binary files /dev/null and b/images/navlinkleft.png differ diff --git a/images/navlinkright.png b/images/navlinkright.png new file mode 100644 index 0000000..df5131f Binary files /dev/null and b/images/navlinkright.png differ diff --git a/images/navright.png b/images/navright.png new file mode 100644 index 0000000..afa269d Binary files /dev/null and b/images/navright.png differ diff --git a/images/storetouched.png b/images/storetouched.png new file mode 100644 index 0000000..2d1da68 Binary files /dev/null and b/images/storetouched.png differ diff --git a/images/textfield.png b/images/textfield.png new file mode 100644 index 0000000..8299a81 Binary files /dev/null and b/images/textfield.png differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..942e9da --- /dev/null +++ b/index.html @@ -0,0 +1,87 @@ + + + + + + + + + + + + +kakapple + + + + + +
+

kakApple

+
+ +
+ +
+
    +
  • +
  • +
+
    +
  • +
  • +
+
    +
  • 人気順 +
  • +
  • 価格の低い順 +
  • +
  • 価格の高い順 +
  • +
  • 発売日 +
  • +
+
    +
  • +
  • +
+
+
+ + + + + + \ No newline at end of file diff --git a/javascript/.DS_Store b/javascript/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/javascript/.DS_Store differ diff --git a/javascript/function_bbs.js b/javascript/function_bbs.js new file mode 100644 index 0000000..8bf820f --- /dev/null +++ b/javascript/function_bbs.js @@ -0,0 +1,62 @@ +/* +----------------------------------------------- +Licensed under the GPL licenses. +Author: Coronet Internet Service, Kyoji KATO. +Date: 2011-05-15 +URL : http://blog.coronet-internet.com +----------------------------------------------- */ +// get url to array +var get = new Object(); +var query = location.search.substr(1).split("&"); +for(var array = 0; array < query.length; array++) { + var wArray = query[array].split("="); + get[wArray[0]] = wArray[1]; + } +// build connecting to product url +var api_setkey = "&ApiKey=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; +var api_pathofBbs = "http://api.kakaku.com/WebAPI/BBSInfo/Ver1.0/BBSInfo.asp?ProductID="; +var get_productId = get['productId']; +var api_bbs_details = "&SortOrder=DateTime"; +var api_bbs = api_pathofBbs+get_productId+api_setkey+api_bbs_details; +// parse XML to data +var httpofProductBbs = new JKL.ParseXML( api_bbs ); +var dataofProductBbs = httpofProductBbs.parse(); + +if(dataofProductBbs.Error == null){ +for (var bbsNum = 0; bbsNum <= dataofProductBbs.BBSInfo.NumOfResult; bbsNum++){ +var productbbs = dataofProductBbs.BBSInfo.Item[bbsNum]; +// generate conf thread title +var cof_threadTitle = document.createElement('li'); + cof_threadTitle.setAttribute('class','textbox'); + cof_threadTitle.innerHTML = productbbs.ThreadTitle; + document.getElementById('buzzresult').innerText ="最新クチコミ"; +// represantion bbs +var product_bbs = document.createElement('li'); + product_bbs.setAttribute('class','menu'); +var bbs_link = document.createElement('a'); + bbs_link.href = productbbs.ThreadUrl; + bbs_link.setAttribute('class','noeffect'); + bbs_link.setAttribute('rel', 'external'); +var bbs_img = document.createElement('img'); + bbs_img.src = "images/buzz.png"; + bbs_img.setAttribute('alt','buzz'); + bbs_link.appendChild(bbs_img); +var bbs_name = document.createElement('span'); + bbs_name.innerText = productbbs.ThreadSummary; + bbs_name.setAttribute('class','name'); + bbs_link.appendChild(bbs_name); +var bbs_comment = document.createElement('span'); + bbs_comment.innerHTML = "返信数:" + productbbs.ThreadSummary + "
最終投稿日時:" + productbbs.WrittenDate; + bbs_comment.setAttribute('class','comment'); + bbs_link.appendChild(bbs_comment); +var bbs_arrow = document.createElement('span'); + bbs_arrow.setAttribute('class','arrow_out'); + bbs_link.appendChild(bbs_arrow); + product_bbs.appendChild(bbs_link); +document.getElementById('productItem').appendChild(cof_threadTitle); +document.getElementById('productItem').appendChild(product_bbs); +} +}else{ +var buzz_result = document.createTextNode(dataofProductBbs.Error.Message); + document.getElementById('buzzresult').appendChild(buzz_result); +} \ No newline at end of file diff --git a/javascript/function_details.js b/javascript/function_details.js new file mode 100644 index 0000000..ebb2fae --- /dev/null +++ b/javascript/function_details.js @@ -0,0 +1,67 @@ +/* +----------------------------------------------- +Licensed under the GPL licenses. +Author: Coronet Internet Service, Kyoji KATO. +Date: 2011-05-15 +URL : http://blog.coronet-internet.com +----------------------------------------------- */ +// get url to array +var get = new Object(); +var query = location.search.substr(1).split("&"); +for(var array = 0; array < query.length; array++) { + var wArray = query[array].split("="); + get[wArray[0]] = wArray[1]; + } +// build connecting to product url +var api_setkey = "ApiKey=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; +var api_pathofProduct = "http://api.kakaku.com/WebAPI/ItemInfo/Ver1.0/ItemInfo.ashx?"; +var api_productId = "&ProductID="; +var get_productId = get['productId']; +var api_product_details ="&ResultSet=medium"; +var api_product = api_pathofProduct+api_setkey+api_product_details+api_productId+get_productId; +// parse XML to data +var httpofProduct = new JKL.ParseXML( api_product ); +var dataofProduct = httpofProduct.parse(); +// set bbs of product url +var bbs_path = "product_bbs.html?productId="; +var bbs = bbs_path+get_productId;//generate right navi link in product page +var kakaku_navLink = document.createElement('a'); + kakaku_navLink.setAttribute('href', dataofProduct.ProductInfo.Item.ItemPageUrl); + kakaku_navLink.setAttribute('rel', 'external'); + kakaku_navLink.innerText ="価格.com"; + document.getElementById('rightnav').appendChild(kakaku_navLink); +//generate cof page item in product page +var pageItem = document.createTextNode(dataofProduct.ProductInfo.Item.MakerName+" :: "+dataofProduct.ProductInfo.Item.ProductName); + document.getElementById('cofpageitem').appendChild(pageItem); +// represantion info of products +var productItem = document.createElement('li'); + productItem.setAttribute('class','item'); +var bbs_link = document.createElement('a'); + bbs_link.href = bbs; + bbs_link.setAttribute('class','noeffect'); +var content_img = document.createElement('span'); + content_img.setAttribute('class','image'); + content_img.style.cssText = "background-image: url("+dataofProduct.ProductInfo.Item.ImageUrl+");" + +"margin:15px 3px;"; + bbs_link.appendChild(content_img); +var content_comment = document.createElement('span'); + content_comment.innerText = dataofProduct.ProductInfo.Item.CategoryName+" > "+dataofProduct.ProductInfo.Item.PvRanking+"位" ; + content_comment.setAttribute('class','comment'); + bbs_link.appendChild(content_comment); +var content_name = document.createElement('span'); + content_name.innerText = dataofProduct.ProductInfo.Item.ProductName; + content_name.setAttribute('class','name'); + bbs_link.appendChild(content_name); +var content_storePrice = document.createElement('span'); + content_storePrice.innerHTML = "¥"+dataofProduct.ProductInfo.Item.LowestPrice+"〜
"; + content_storePrice.setAttribute('class','price'); + bbs_link.appendChild(content_storePrice); +var content_starComment = document.createElement('span'); + content_starComment.innerHTML = "満足度:"+dataofProduct.ProductInfo.Item.ReviewRating+"
クチコミ:"+dataofProduct.ProductInfo.Item.NumOfBbs; + content_starComment.setAttribute('class','starcomment'); + bbs_link.appendChild(content_starComment); +var content_arrow = document.createElement('span'); + content_arrow.setAttribute('class','arrow'); + bbs_link.appendChild(content_arrow); +productItem.appendChild(bbs_link); +document.getElementById('productIteminfo').appendChild(productItem); \ No newline at end of file diff --git a/javascript/function_form.js b/javascript/function_form.js new file mode 100644 index 0000000..a8f391f --- /dev/null +++ b/javascript/function_form.js @@ -0,0 +1,36 @@ +/* +----------------------------------------------- +Licensed under the GPL licenses. +Author: Coronet Internet Service, Kyoji KATO. +Date: 2011-05-15 +URL : http://blog.coronet-internet.com +----------------------------------------------- */ +var inp_keyword = document.createElement('input'); + inp_keyword.setAttribute('type', 'text'); + inp_keyword.setAttribute('value', 'Search word here.'); + inp_keyword.setAttribute('name', 'Keyword'); + inp_keyword.style.color='#7f7f7f'; + inp_keyword.setAttribute('onfocus','if (this.value == "Search word here."){this.value = "";this.style.color="#7f7f7f";}'); + inp_keyword.setAttribute('onblur', 'if (this.value == ""){this.value = "Search word here.";this.style.color="#7f7f7f";}else{this.style.color="#ef027d";}'); + document.getElementById('Keyword').appendChild(inp_keyword); + +function send() { + if (document.search.Keyword.value=="Search word here."){ + alert("You didn't input search word"); + return false; + }else{ + var keyword=encodeURI(document.search.Keyword.value); + } + var category=document.search.Category.value; + if (document.search.Sort[0].checked){ + sort=document.search.Sort[0].value; + }else if(document.search.Sort[1].checked){ + sort=document.search.Sort[1].value; + }else if(document.search.Sort[2].checked){ + sort=document.search.Sort[2].value; + }else if(document.search.Sort[3].checked){ + sort=document.search.Sort[3].value; + } +var query="keyword="+keyword+"&sort="+sort+"&category="+category+"&pagenum=1"; + location.href="result.html?"+query; +} diff --git a/javascript/function_search.js b/javascript/function_search.js new file mode 100644 index 0000000..e61cb9f --- /dev/null +++ b/javascript/function_search.js @@ -0,0 +1,103 @@ +/* +----------------------------------------------- +Licensed under the GPL licenses. +Author: Coronet Internet Service, Kyoji KATO. +Date: 2011-05-15 +URL : http://blog.coronet-internet.com +----------------------------------------------- */ +// get url to array +var get = new Object(); +var query = location.search.substr(1).split("&"); +for(var array = 0; array < query.length; array++) { + var wArray = query[array].split("="); + get[wArray[0]] = wArray[1]; + } + +// build connecting to url +var api_path = "http://api.kakaku.com/WebAPI/ItemSearch/Ver1.0/ItemSearch.aspx?"; +var api_setkey = "ApiKey=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; +var api_ofsort = "&SortOrder="; +var api_sort = get['sort']; +var api_setkeyword = "&Keyword="; +var api_keyword = get['keyword']; +var api_ofcategory = "&CategoryGroup="; +var api_category =get['category']; +var api_resultset = "&ResultSet=medium"; +var api_hitnum = "&HitNum=7"; +var api_page = "&PageNum="; +var currentpage = get['pagenum']; +var api = api_path + api_setkey + api_hitnum + api_ofcategory + api_category + api_ofsort + api_sort + api_resultset + api_page + currentpage + api_setkeyword + api_keyword; +// parse XML to data +var http = new JKL.ParseXML( api ); +var data = http.parse(); + +if(data.Error == null){ +// set next search page url +var page_num = parseInt(currentpage)+ 1; +var products_query="keyword="+api_keyword+"&sort="+api_sort+"&category="+api_category+"&pagenum="+page_num; +var product_next_path = "result.html?"+products_query; +// set paging +var totalItems = data.ProductInfo.NumOfResult; +var max_page = Math.ceil(totalItems/7); + if(max_page >= page_num){ + //generate next link of right navi + var right_navLink = document.createElement('a'); + right_navLink.setAttribute('href', product_next_path); + right_navLink.innerText ="次ページ"; + document.getElementById('rightnav').appendChild(right_navLink); + } +//generate conf_keyword +var decode_keyword = decodeURI(api_keyword); +var search_keyword = document.createTextNode("「"+decode_keyword+"」キーワード検索"); + document.getElementById('searchkeyword').appendChild(search_keyword); +//generate result num +var totalItems = document.createTextNode(totalItems); + document.getElementById('resultsnum').appendChild(totalItems); +for (var itemsNum = 0; itemsNum <= 7; itemsNum++){ +// build product page url +var productItem = data.ProductInfo.Item[itemsNum]; +var product_path = "product.html?productId=" + productItem.ProductID; +var productItemUrl = productItem.ImageUrl; +// representation info of products +var products_list = document.createElement('li'); + products_list.setAttribute('class','store'); +var product_link = document.createElement('a'); + product_link.href = product_path; + product_link.setAttribute('class','noeffect'); +var product_img = document.createElement('span'); + product_img.setAttribute('class','image'); + product_img.style.cssText = "background-image: url("+productItemUrl+");" + +"margin:15px 0 0 2px;"; + product_link.appendChild(product_img); +var product_comment = document.createElement('span'); + product_comment.innerText = productItem.CategoryName+" > "+productItem.MakerName ; + product_comment.setAttribute('class','comment'); + product_link.appendChild(product_comment); +var product_name = document.createElement('span'); + product_name.innerText = productItem.ProductName; + product_name.setAttribute('class','name'); + product_link.appendChild(product_name); +var product_storePrice = document.createElement('span'); + product_storePrice.innerHTML = "¥"+productItem.LowestPrice+"〜
"; + product_storePrice.setAttribute('class','price'); + product_link.appendChild(product_storePrice); +var product_starComment = document.createElement('span'); + product_starComment.innerHTML = "カテゴリランキング:"+productItem.PvRanking+"位
満足度:"+productItem.TotalScoreAve; + product_starComment.setAttribute('class','starcomment'); + product_link.appendChild(product_starComment); +var product_arrow = document.createElement('span'); + product_arrow.setAttribute('class','arrow'); + product_link.appendChild(product_arrow); +products_list.appendChild(product_link); +document.getElementById('pageitem').appendChild(products_list); +} +}else{ +var search_keyword = document.createTextNode(data.Error.Message); + document.getElementById('searchkeyword').appendChild(search_keyword); +} + + + + + + diff --git a/javascript/functions.js b/javascript/functions.js new file mode 100644 index 0000000..851fa61 --- /dev/null +++ b/javascript/functions.js @@ -0,0 +1 @@ +/* ----------------------------------------------- Licensed under the GPL licenses. iWebKit : Christopher Plieger & Johan van Wilsum URL : http://iwebkit.net ----------------------------------------------- */ var iWebkit; if(!iWebkit){iWebkit=window.onload=function(){iWebkit.checkboxHeight="25"; iWebkit.radioHeight="25"; iWebkit.autolistNumVisible=10; function b(){var d=document.getElementsByTagName("a"); for(var e=0; e=l){j[k].className=j[k].className+" hidden"}else{m+=1}}this.visibleitems=m; e.className=e.className.replace(/hidden/g,""); if(m>=(j.length-1)){e.className=e.className+" hidden"}}; h.showItems(iWebkit.autolistNumVisible)}}iWebkit.init=function(){b(); c(); a(); var h=document.getElementsByTagName("input"),j=[],g,i,k; for(var f=0; f +// http://www.kawa.net/works/js/jkl/parsexml.html +// ================================================================ +// v0.01 2005/05/18 first release +// v0.02 2005/05/20 Opera 8.0beta may be abailable but somtimes crashed +// v0.03 2005/05/20 overrideMimeType( "text/xml" ); +// v0.04 2005/05/21 class variables: REQUEST_TYPE, RESPONSE_TYPE +// v0.05 2005/05/22 use Msxml2.DOMDocument.5.0 for GET method on IE6 +// v0.06 2005/05/22 CDATA_SECTION_NODE +// v0.07 2005/05/23 use Microsoft.XMLDOM for GET method on IE6 +// v0.10 2005/10/11 new function: JKL.ParseXML.HTTP.responseText() +// v0.11 2005/10/13 new sub class: JKL.ParseXML.Text, JSON and DOM. +// v0.12 2005/10/14 new sub class: JKL.ParseXML.CSV and CSVmap. +// v0.13 2005/10/28 bug fixed: TEXT_NODE regexp for white spaces +// v0.14 2005/11/06 bug fixed: TEXT_NODE regexp at Safari +// v0.15 2005/11/08 bug fixed: JKL.ParseXML.CSV.async() method +// v0.16 2005/11/15 new sub class: LoadVars, and UTF-8 text on Safari +// v0.18 2005/11/16 improve: UTF-8 text file on Safari +// v0.19 2006/02/03 use XMLHTTPRequest instead of ActiveX on IE7,iCab +// v0.20 2006/03/22 (skipped) +// v0.21 2006/11/30 use ActiveX again on IE7 +// v0.22 2007/01/04 JKL.ParseXML.JSON.parseResponse() updated +// ================================================================ + +if ( typeof(JKL) == 'undefined' ) JKL = function() {}; + +// ================================================================ +// class: JKL.ParseXML + +JKL.ParseXML = function ( url, query, method ) { + // debug.print( "new JKL.ParseXML( '"+url+"', '"+query+"', '"+method+"' );" ); + this.http = new JKL.ParseXML.HTTP( url, query, method, false ); + return this; +}; + +// ================================================================ +// class variables + +JKL.ParseXML.VERSION = "0.22"; +JKL.ParseXML.MIME_TYPE_XML = "text/xml"; +JKL.ParseXML.MAP_NODETYPE = [ + "", + "ELEMENT_NODE", // 1 + "ATTRIBUTE_NODE", // 2 + "TEXT_NODE", // 3 + "CDATA_SECTION_NODE", // 4 + "ENTITY_REFERENCE_NODE", // 5 + "ENTITY_NODE", // 6 + "PROCESSING_INSTRUCTION_NODE", // 7 + "COMMENT_NODE", // 8 + "DOCUMENT_NODE", // 9 + "DOCUMENT_TYPE_NODE", // 10 + "DOCUMENT_FRAGMENT_NODE", // 11 + "NOTATION_NODE" // 12 +]; + +// ================================================================ +// define callback function (ajax) + +JKL.ParseXML.prototype.async = function ( func, args ) { + this.callback_func = func; // callback function + this.callback_arg = args; // first argument +}; + +JKL.ParseXML.prototype.onerror = function ( func, args ) { + this.onerror_func = func; // callback function +}; + +// ================================================================ +// method: parse() +// return: parsed object +// Download a file from remote server and parse it. + +JKL.ParseXML.prototype.parse = function () { + if ( ! this.http ) return; + + // set onerror call back + if ( this.onerror_func ) { + this.http.onerror( this.onerror_func ); + } + + if ( this.callback_func ) { // async mode + var copy = this; + var proc = function() { + if ( ! copy.http ) return; + var data = copy.parseResponse(); + copy.callback_func( data, copy.callback_arg ); // call back + }; + this.http.async( proc ); + } + + this.http.load(); + + if ( ! this.callback_func ) { // sync mode + var data = this.parseResponse(); + return data; + } +}; + +// ================================================================ +// every child/children into array +JKL.ParseXML.prototype.setOutputArrayAll = function () { + this.setOutputArray( true ); +} +// a child into scalar, children into array +JKL.ParseXML.prototype.setOutputArrayAuto = function () { + this.setOutputArray( null ); +} +// every child/children into scalar (first sibiling only) +JKL.ParseXML.prototype.setOutputArrayNever = function () { + this.setOutputArray( false ); +} +// specified child/children into array, other child/children into scalar +JKL.ParseXML.prototype.setOutputArrayElements = function ( list ) { + this.setOutputArray( list ); +} +// specify how to treate child/children into scalar/array +JKL.ParseXML.prototype.setOutputArray = function ( mode ) { + if ( typeof(mode) == "string" ) { + mode = [ mode ]; // string into array + } + if ( mode && typeof(mode) == "object" ) { + if ( mode.length < 0 ) { + mode = false; // false when array == [] + } else { + var hash = {}; + for( var i=0; i" ); + + // COMMENT_NODE + + if ( elem.nodeType == 7 ) { + return; + } + + // TEXT_NODE CDATA_SECTION_NODE + + if ( elem.nodeType == 3 || elem.nodeType == 4 ) { + // var bool = elem.nodeValue.match( /[^\u0000-\u0020]/ ); + var bool = elem.nodeValue.match( /[^\x00-\x20]/ ); // for Safari + if ( bool == null ) return; // ignore white spaces + // debug.print( "TEXT_NODE: "+elem.nodeValue.length+ " "+bool ); + return elem.nodeValue; + } + + var retval; + var cnt = {}; + + // parse attributes + + if ( elem.attributes && elem.attributes.length ) { + retval = {}; + for ( var i=0; i -1 ) { + if ( text.charAt(nextquote+1) != '"' ) { + break; // end of column + } + nextquote = text.indexOf( '"', nextquote+2 ); + } + if ( nextquote < 0 ) { + // unclosed quote + } else if ( text.charAt(nextquote+1) == "," ) { // end of column + var quoted = text.substr( pos+1, nextquote-pos-1 ); + quoted = quoted.replace(/""/g,'"'); + line[line.length] = quoted; + pos = nextquote+2; + continue; + } else if ( text.charAt(nextquote+1) == "\n" || // end of line + len==nextquote+1 ) { // end of file + var quoted = text.substr( pos+1, nextquote-pos-1 ); + quoted = quoted.replace(/""/g,'"'); + line[line.length] = quoted; + pos = nextquote+2; + break; + } else { + // invalid column + } + } + var nextcomma = text.indexOf( ",", pos ); + var nextnline = text.indexOf( "\n", pos ); + if ( nextnline < 0 ) nextnline = len; + if ( nextcomma > -1 && nextcomma < nextnline ) { + line[line.length] = text.substr( pos, nextcomma-pos ); + pos = nextcomma+1; + } else { // end of line + line[line.length] = text.substr( pos, nextnline-pos ); + pos = nextnline+1; + break; + } + } + if ( line.length >= 0 ) { + table[table.length] = line; // push line + } + } + if ( table.length < 0 ) return; // null data + return table; +}; + +// ================================================================ +// class: JKL.ParseXML.CSVmap + +JKL.ParseXML.CSVmap = function ( url, query, method ) { + // debug.print( "new JKL.ParseXML.CSVmap( '"+url+"', '"+query+"', '"+method+"' );" ); + this.http = new JKL.ParseXML.HTTP( url, query, method, true ); + return this; +}; + +JKL.ParseXML.CSVmap.prototype.parse = JKL.ParseXML.prototype.parse; +JKL.ParseXML.CSVmap.prototype.async = JKL.ParseXML.prototype.async; +JKL.ParseXML.CSVmap.prototype.onerror = JKL.ParseXML.prototype.onerror; +JKL.ParseXML.CSVmap.prototype.parseCSV = JKL.ParseXML.CSV.prototype.parseCSV; + +JKL.ParseXML.CSVmap.prototype.parseResponse = function () { + var text = this.http.responseText(); + var source = this.parseCSV( text ); + if ( ! source ) return; + if ( source.length < 0 ) return; + + var title = source.shift(); // first line as title + var data = []; + for( var i=0; i 0 && + this.req.status != 200 && // OK + this.req.status != 206 && // Partial Content + this.req.status != 304 ) { // Not Modified + // debug.print( "status: "+this.req.status ); + if ( this.onerror_func ) this.onerror_func( this.req.status ); + return false; // failed + } + + return true; // succeed +} + +// ================================================================ +// method: documentElement() +// return: XML DOM in response body + +JKL.ParseXML.HTTP.prototype.documentElement = function() { + // debug.print( "documentElement: "+this.req ); + if ( ! this.req ) return; + if ( this.req.responseXML ) { + return this.req.responseXML.documentElement; // XMLHTTPRequest + } else { + return this.req.documentElement; // IXMLDOMDocument + } +} + +// ================================================================ +// method: responseText() +// return: text string in response body + +JKL.ParseXML.HTTP.prototype.responseText = function() { + // debug.print( "responseText: "+this.req ); + if ( ! this.req ) return; + + // Safari and Konqueror cannot understand the encoding of text files. + if ( navigator.appVersion.match( "KHTML" ) ) { + var esc = escape( this.req.responseText ); +// debug.print( "escape: "+esc ); + if ( ! esc.match("%u") && esc.match("%") ) { + return decodeURIComponent(esc); + } + } + + return this.req.responseText; +} + +// ================================================================ +// http://msdn.microsoft.com/library/en-us/xmlsdk/html/d051f7c5-e882-42e8-a5b6-d1ce67af275c.asp +// ================================================================ diff --git a/product.html b/product.html new file mode 100644 index 0000000..ba7b641 --- /dev/null +++ b/product.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + +kakapple + + + + + + + +
+

アイテム詳細

+
    +
  • +
+
+ + + + + + + \ No newline at end of file diff --git a/product_bbs.html b/product_bbs.html new file mode 100644 index 0000000..e9ebb59 --- /dev/null +++ b/product_bbs.html @@ -0,0 +1,56 @@ + + + + + + + + + + + + +kakapple + + + + + + + +
+

+
    +
+
+ + + + + + + \ No newline at end of file diff --git a/result.html b/result.html new file mode 100644 index 0000000..815ced4 --- /dev/null +++ b/result.html @@ -0,0 +1,56 @@ + + + + + + + + + + + + +kakapple + + + + + +
+

kakApple

+ +
+
+
+ +
+

+
    +
  • 検索結果:件
  • +
+
+ + + + + + + \ No newline at end of file