//@javascript_url
//@private
(function(){
var table = [];
String.prototype.capitalize = function(){
return this.replace(/[A-Za-z0-9\-\s]/g, function(s) {
return String.fromCharCode(s.charCodeAt(0) + 0xFEE0);
});
};
String.prototype.paragraph = function(){
var str = this;
if (str.length > 20) {
str = str.replace(/^(.+[1-9][0-9]*)(.*)/, '$1\n$2');
}
return str.toString();
}
$('.decCnfWr:lt(4)').each(function(i){
table.push($(this).text());
});
var bidder = [
$('.decItmName').text().capitalize().substr(0,20), // print_title
table[1].substr(1,3), // zip1
table[1].substr(4,4), // zip2
table[1].substr(8).capitalize().paragraph(), // reciver_adress
table[0], // receiver_name
table[2], // receiver_phone
];
if( table[3].indexOf('クリックポスト') !== -1 ) {
console.log(bidder.toString());
prompt('コピーしてください',bidder.toString());
}
})();